summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:36:21 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:36:21 -0400
commitd29a4fd2dd3b5d4cf6e80b602544d7b71d794e76 (patch)
treeb38e2e5c6974b9a15f103e5cf884cba9fff90ef4
parenta88a88d0986a4a32288c102cdbfebd78d7e91d99 (diff)
downloadphp-d29a4fd2dd3b5d4cf6e80b602544d7b71d794e76.tar.gz
Imported Upstream version 5.2.0upstream/5.2.0
-rw-r--r--EXTENSIONS7
-rw-r--r--INSTALL159
-rw-r--r--Makefile.gcov8
-rw-r--r--NEWS490
-rw-r--r--README.PARAMETER_PARSING_API13
-rw-r--r--README.UPDATE_5_2892
-rw-r--r--README.input_filter7
-rw-r--r--TSRM/tsrm.m41
-rw-r--r--TSRM/tsrm_virtual_cwd.c286
-rw-r--r--TSRM/tsrm_virtual_cwd.h10
-rwxr-xr-xUPGRADING4
-rw-r--r--Zend/README.ZEND_MM13
-rw-r--r--Zend/Zend.m4123
-rw-r--r--Zend/ZendTS.dsp1
-rw-r--r--Zend/acinclude.m42
-rw-r--r--Zend/tests/001.phpt54
-rw-r--r--Zend/tests/002.phpt108
-rw-r--r--Zend/tests/003.phpt81
-rw-r--r--Zend/tests/004.phpt25
-rw-r--r--Zend/tests/005.phpt27
-rw-r--r--Zend/tests/006.phpt31
-rw-r--r--Zend/tests/007.phpt63
-rw-r--r--Zend/tests/008.phpt53
-rw-r--r--Zend/tests/009.phpt46
-rw-r--r--Zend/tests/010.phpt59
-rw-r--r--Zend/tests/011.phpt89
-rw-r--r--Zend/tests/012.phpt34
-rw-r--r--Zend/tests/013.phpt34
-rw-r--r--Zend/tests/014.inc3
-rw-r--r--Zend/tests/014.phpt52
-rw-r--r--Zend/tests/015.phpt35
-rw-r--r--Zend/tests/016.phpt12
-rw-r--r--Zend/tests/abstract-static.phpt22
-rwxr-xr-xZend/tests/array_type_hint_001.phpt2
-rwxr-xr-xZend/tests/bug24884.phpt4
-rwxr-xr-xZend/tests/bug26166.phpt141
-rw-r--r--Zend/tests/bug27641.phpt44
-rwxr-xr-xZend/tests/bug28444.phpt9
-rwxr-xr-xZend/tests/bug30791.phpt18
-rwxr-xr-xZend/tests/bug32660.phpt5
-rwxr-xr-xZend/tests/bug33732.phpt2
-rw-r--r--Zend/tests/bug33771.phpt10
-rwxr-xr-xZend/tests/bug33996.phpt58
-rwxr-xr-xZend/tests/bug34065.phpt15
-rwxr-xr-xZend/tests/bug36759.phpt27
-rwxr-xr-xZend/tests/bug37144.phpt16
-rwxr-xr-xZend/tests/bug37212.phpt55
-rwxr-xr-xZend/tests/bug37632.phpt135
-rwxr-xr-xZend/tests/bug37667.phpt53
-rwxr-xr-xZend/tests/bug37707.phpt16
-rwxr-xr-xZend/tests/bug37811.phpt28
-rwxr-xr-xZend/tests/bug38047.phpt50
-rwxr-xr-xZend/tests/bug38146.phpt19
-rwxr-xr-xZend/tests/bug38211.phpt10
-rwxr-xr-xZend/tests/bug38220.phpt92
-rwxr-xr-xZend/tests/bug38234.phpt18
-rwxr-xr-xZend/tests/bug38287.phpt45
-rw-r--r--Zend/tests/bug38461.phpt25
-rwxr-xr-xZend/tests/bug38623.phpt16
-rw-r--r--Zend/tests/bug38624.phpt34
-rwxr-xr-xZend/tests/bug38772.phpt42
-rw-r--r--Zend/tests/bug38779.phpt29
-rw-r--r--Zend/tests/bug38779_1.phpt45
-rwxr-xr-xZend/tests/bug38808.phpt17
-rwxr-xr-xZend/tests/bug38942.phpt17
-rw-r--r--Zend/tests/bug39003.phpt24
-rwxr-xr-xZend/tests/bug39017.phpt11
-rw-r--r--Zend/tests/bug39036.phpt19
-rwxr-xr-xZend/tests/bug39304.phpt9
-rwxr-xr-xZend/tests/catch_002.phpt33
-rwxr-xr-xZend/tests/catch_003.phpt38
-rwxr-xr-xZend/tests/catch_004.phpt43
-rw-r--r--Zend/tests/error_reporting01.phpt2
-rw-r--r--Zend/tests/error_reporting02.phpt2
-rw-r--r--Zend/tests/error_reporting03.phpt2
-rw-r--r--Zend/tests/error_reporting04.phpt2
-rw-r--r--Zend/tests/error_reporting05.phpt2
-rw-r--r--Zend/tests/error_reporting06.phpt2
-rw-r--r--Zend/tests/error_reporting07.phpt2
-rw-r--r--Zend/tests/error_reporting08.phpt2
-rw-r--r--Zend/tests/error_reporting09.phpt2
-rw-r--r--Zend/tests/error_reporting10.phpt4
-rw-r--r--Zend/tests/int_overflow_32bit.phpt29
-rw-r--r--Zend/tests/int_overflow_64bit.phpt29
-rw-r--r--Zend/tests/int_underflow_32bit.phpt29
-rw-r--r--Zend/tests/int_underflow_64bit.phpt29
-rw-r--r--Zend/tests/objects_001.phpt60
-rw-r--r--Zend/tests/objects_002.phpt24
-rw-r--r--Zend/tests/objects_003.phpt24
-rw-r--r--Zend/tests/objects_004.phpt24
-rw-r--r--Zend/tests/objects_005.phpt24
-rw-r--r--Zend/tests/objects_006.phpt24
-rw-r--r--Zend/tests/objects_007.phpt24
-rw-r--r--Zend/tests/objects_008.phpt24
-rw-r--r--Zend/tests/objects_009.phpt24
-rw-r--r--Zend/tests/objects_010.phpt19
-rw-r--r--Zend/tests/objects_011.phpt19
-rw-r--r--Zend/tests/objects_012.phpt15
-rw-r--r--Zend/tests/objects_013.phpt15
-rw-r--r--Zend/tests/objects_014.phpt15
-rwxr-xr-xZend/tests/objects_015.phpt26
-rw-r--r--Zend/tests/offset_array.phpt47
-rw-r--r--Zend/tests/offset_bool.phpt37
-rw-r--r--Zend/tests/offset_long.phpt37
-rw-r--r--Zend/tests/offset_null.phpt37
-rw-r--r--Zend/tests/offset_object.phpt11
-rw-r--r--Zend/tests/offset_string.phpt45
-rw-r--r--Zend/tests/strict_001.phpt19
-rw-r--r--Zend/tests/strict_002.phpt27
-rw-r--r--Zend/zend.c146
-rw-r--r--Zend/zend.h42
-rw-r--r--Zend/zend_API.c483
-rw-r--r--Zend/zend_API.h113
-rw-r--r--Zend/zend_alloc.c2227
-rw-r--r--Zend/zend_alloc.h219
-rw-r--r--Zend/zend_arg_defs.c3
-rw-r--r--Zend/zend_builtin_functions.c178
-rw-r--r--Zend/zend_compile.c351
-rw-r--r--Zend/zend_compile.h77
-rw-r--r--Zend/zend_config.w32.h4
-rw-r--r--Zend/zend_constants.c21
-rw-r--r--Zend/zend_constants.h3
-rw-r--r--Zend/zend_errors.h5
-rw-r--r--Zend/zend_exceptions.c48
-rw-r--r--Zend/zend_exceptions.h11
-rw-r--r--Zend/zend_execute.c478
-rw-r--r--Zend/zend_execute.h25
-rw-r--r--Zend/zend_execute_API.c96
-rw-r--r--Zend/zend_extensions.c18
-rw-r--r--Zend/zend_extensions.h10
-rw-r--r--Zend/zend_fast_cache.h6
-rw-r--r--Zend/zend_globals.h39
-rw-r--r--Zend/zend_globals_macros.h15
-rw-r--r--Zend/zend_hash.c23
-rw-r--r--Zend/zend_ini.c33
-rw-r--r--Zend/zend_ini.h3
-rw-r--r--Zend/zend_ini_parser.c41
-rw-r--r--Zend/zend_ini_parser.y35
-rw-r--r--Zend/zend_ini_scanner.c13
-rw-r--r--Zend/zend_ini_scanner.h3
-rw-r--r--Zend/zend_ini_scanner.l13
-rwxr-xr-xZend/zend_interfaces.c86
-rwxr-xr-xZend/zend_interfaces.h14
-rwxr-xr-xZend/zend_iterators.c13
-rwxr-xr-xZend/zend_iterators.h11
-rw-r--r--Zend/zend_language_parser.c94
-rw-r--r--Zend/zend_language_parser.y152
-rw-r--r--Zend/zend_mm.c6
-rw-r--r--Zend/zend_mm.h6
-rw-r--r--Zend/zend_modules.h27
-rw-r--r--Zend/zend_object_handlers.c238
-rw-r--r--Zend/zend_object_handlers.h20
-rw-r--r--Zend/zend_objects.c31
-rw-r--r--Zend/zend_objects_API.c75
-rw-r--r--Zend/zend_objects_API.h8
-rw-r--r--Zend/zend_operators.c147
-rw-r--r--Zend/zend_operators.h77
-rw-r--r--Zend/zend_variables.c4
-rw-r--r--Zend/zend_vm_def.h469
-rw-r--r--Zend/zend_vm_execute.h4335
-rw-r--r--Zend/zend_vm_gen.php29
-rw-r--r--acinclude.m427
-rw-r--r--aclocal.m427
-rwxr-xr-xconfigure8865
-rw-r--r--configure.in32
-rw-r--r--ext/bcmath/bcmath.c105
-rw-r--r--ext/bz2/bz2.c138
-rw-r--r--ext/bz2/bz2_filter.c8
-rw-r--r--ext/bz2/php_bz2.h13
-rw-r--r--ext/bz2/tests/001.phpt43
-rw-r--r--ext/bz2/tests/002.phpt129
-rw-r--r--ext/bz2/tests/003.phpt40
-rw-r--r--ext/bz2/tests/003.txt.bz2bin0 -> 126 bytes
-rw-r--r--ext/bz2/tests/004.phpt111
-rw-r--r--ext/bz2/tests/004_1.txt.bz2bin0 -> 125 bytes
-rw-r--r--ext/bz2/tests/004_2.txt.bz2bin0 -> 123 bytes
-rw-r--r--ext/bz2/tests/005.phpt71
-rw-r--r--ext/calendar/calendar.c152
-rw-r--r--ext/calendar/gregor.c7
-rw-r--r--ext/calendar/php_calendar.h2
-rw-r--r--ext/calendar/tests/cal_from_jd.phpt60
-rw-r--r--ext/calendar/tests/cal_info.phpt216
-rw-r--r--ext/calendar/tests/easter_date.phpt20
-rw-r--r--ext/calendar/tests/gregoriantojd.phpt18
-rw-r--r--ext/calendar/tests/jddayofweek.phpt130
-rw-r--r--ext/calendar/tests/jdmonthname.phpt314
-rw-r--r--ext/calendar/tests/jdtofrench.phpt20
-rw-r--r--ext/calendar/tests/jdtogregorian.phpt18
-rw-r--r--ext/calendar/tests/jdtojulian.phpt18
-rw-r--r--ext/calendar/tests/jdtomonthname.phpt71
-rw-r--r--ext/calendar/tests/jdtounix.phpt16
-rw-r--r--ext/calendar/tests/jewishtojd.phpt16
-rw-r--r--ext/calendar/tests/juliantojd.phpt18
-rw-r--r--ext/calendar/tests/unixtojd.phpt14
-rw-r--r--ext/com_dotnet/com_com.c4
-rw-r--r--ext/com_dotnet/com_extension.c23
-rw-r--r--ext/com_dotnet/com_handlers.c15
-rw-r--r--ext/com_dotnet/com_iterator.c8
-rwxr-xr-xext/com_dotnet/com_persist.c21
-rw-r--r--ext/com_dotnet/com_saproxy.c10
-rw-r--r--ext/com_dotnet/com_typeinfo.c4
-rw-r--r--ext/com_dotnet/php_com_dotnet_internal.h6
-rw-r--r--ext/ctype/ctype.c120
-rw-r--r--ext/ctype/php_ctype.h18
-rw-r--r--ext/curl/config.m426
-rw-r--r--ext/curl/config.w328
-rw-r--r--ext/curl/interface.c249
-rw-r--r--ext/curl/multi.c99
-rw-r--r--ext/curl/php_curl.h3
-rw-r--r--ext/curl/streams.c171
-rw-r--r--ext/date/lib/dow.c2
-rw-r--r--ext/date/lib/parse_date.c21552
-rw-r--r--ext/date/lib/parse_date.c.orig21712
-rw-r--r--ext/date/lib/parse_date.re111
-rw-r--r--ext/date/lib/parse_tz.c24
-rw-r--r--ext/date/lib/timelib.c9
-rw-r--r--ext/date/lib/timelib.h16
-rwxr-xr-xext/date/lib/timelib_config.h.win321
-rw-r--r--ext/date/lib/timelib_structs.h33
-rw-r--r--ext/date/lib/timezonedb.h3717
-rw-r--r--ext/date/lib/timezonemap.h49
-rw-r--r--ext/date/lib/tm2unixtime.c56
-rw-r--r--ext/date/lib/unixtime2tm.c8
-rw-r--r--ext/date/php_date.c642
-rw-r--r--ext/date/php_date.h8
-rw-r--r--ext/date/tests/003.phpt47
-rw-r--r--ext/date/tests/004.phpt73
-rw-r--r--ext/date/tests/005.phpt45
-rw-r--r--ext/date/tests/006.phpt33
-rw-r--r--ext/date/tests/007.phpt101
-rw-r--r--ext/date/tests/008.phpt67
-rw-r--r--ext/date/tests/009.phpt46
-rw-r--r--ext/date/tests/bug20382-2.phpt2
-rw-r--r--ext/date/tests/bug37368.phpt10
-rw-r--r--ext/date/tests/bug37514.phpt20
-rw-r--r--ext/date/tests/bug37616.phpt9
-rw-r--r--ext/date/tests/bug37747.phpt11
-rw-r--r--ext/date/tests/bug38229.phpt13
-rw-r--r--ext/date/tests/date_constants.phpt75
-rw-r--r--ext/date/tests/date_create-1.phpt2
-rw-r--r--ext/date/tests/date_create-2.phpt2
-rw-r--r--ext/date/tests/date_modify-1.phpt12
-rw-r--r--ext/date/tests/date_modify-2.phpt4
-rw-r--r--ext/date/tests/oo_001.phpt53
-rw-r--r--ext/date/tests/oo_002.phpt28
-rwxr-xr-xext/date/tests/strtotime-mysql.phpt25
-rw-r--r--ext/date/tests/strtotime2.phpt40
-rw-r--r--ext/date/tests/strtotime3.phpt69
-rw-r--r--ext/date/tests/timezones.phpt26
-rw-r--r--ext/dba/config.m48
-rw-r--r--ext/dba/dba.c165
-rw-r--r--ext/dba/libinifile/inifile.c6
-rw-r--r--ext/dbase/dbase.c113
-rw-r--r--ext/dbase/dbf_head.c31
-rw-r--r--ext/dbase/tests/001.phpt61
-rw-r--r--ext/dbase/tests/002.phpt54
-rw-r--r--ext/dom/attr.c7
-rw-r--r--ext/dom/characterdata.c16
-rw-r--r--ext/dom/document.c141
-rw-r--r--ext/dom/dom_fe.h6
-rw-r--r--ext/dom/dom_iterators.c31
-rw-r--r--ext/dom/element.c271
-rw-r--r--ext/dom/entityreference.c4
-rw-r--r--ext/dom/node.c228
-rw-r--r--ext/dom/nodelist.c4
-rw-r--r--ext/dom/php_dom.c62
-rw-r--r--ext/dom/php_dom.h6
-rw-r--r--ext/dom/tests/bug34276.phpt2
-rw-r--r--ext/dom/tests/bug35342.phpt2
-rw-r--r--ext/dom/tests/bug37456.phpt22
-rw-r--r--ext/dom/tests/bug38438.phpt13
-rw-r--r--ext/dom/tests/bug38474.phpt41
-rw-r--r--ext/dom/tests/bug38850.phpt22
-rw-r--r--ext/dom/tests/bug38949.phpt27
-rw-r--r--ext/dom/tests/canonicalization.phpt102
-rw-r--r--ext/dom/tests/dom.ent8
-rw-r--r--ext/dom/tests/dom.xml8
-rw-r--r--ext/dom/tests/dom002.phpt2
-rw-r--r--ext/dom/tests/domattributes.phpt43
-rw-r--r--ext/dom/tests/domchardata.phpt76
-rw-r--r--ext/dom/tests/domelement.phpt114
-rw-r--r--ext/dom/tests/nsdoc.xml4
-rw-r--r--ext/dom/tests/regsiter_node_class.phpt43
-rw-r--r--ext/dom/xml_common.h14
-rw-r--r--ext/exif/exif.c63
-rw-r--r--ext/fbsql/php_fbsql.c501
-rw-r--r--ext/fbsql/php_fbsql.h2
-rw-r--r--ext/fdf/fdf.c316
-rw-r--r--ext/filepro/CREDITS2
-rw-r--r--ext/filepro/config.m411
-rw-r--r--ext/filepro/config.w329
-rw-r--r--ext/filepro/filepro.c614
-rw-r--r--ext/filepro/filepro.dsp109
-rw-r--r--ext/filepro/package.xml40
-rw-r--r--ext/filepro/php_filepro.h50
-rw-r--r--ext/filter/CREDITS2
-rw-r--r--ext/filter/callback_filter.c63
-rw-r--r--ext/filter/config.m495
-rw-r--r--ext/filter/config.w328
-rw-r--r--ext/filter/docs/filter.txt331
-rw-r--r--ext/filter/docs/input_get_args.php41
-rw-r--r--ext/filter/filter.c808
-rw-r--r--ext/filter/filter_private.h115
-rw-r--r--ext/filter/logical_filters.c821
-rw-r--r--ext/filter/php_filter.h107
-rw-r--r--ext/filter/sanitizing_filters.c339
-rw-r--r--ext/filter/tests/001.phpt8
-rw-r--r--ext/filter/tests/002.phpt11
-rw-r--r--ext/filter/tests/003.phpt22
-rw-r--r--ext/filter/tests/004.phpt30
-rw-r--r--ext/filter/tests/005.phpt21
-rw-r--r--ext/filter/tests/006.phpt10
-rw-r--r--ext/filter/tests/007.phpt68
-rw-r--r--ext/filter/tests/008.phpt53
-rw-r--r--ext/filter/tests/009.phpt30
-rw-r--r--ext/filter/tests/010.phpt60
-rw-r--r--ext/filter/tests/011.phpt52
-rw-r--r--ext/filter/tests/012.phpt16
-rw-r--r--ext/filter/tests/013.phpt72
-rw-r--r--ext/filter/tests/014.phpt68
-rw-r--r--ext/filter/tests/015.phpt71
-rw-r--r--ext/filter/tests/016.phpt32
-rw-r--r--ext/filter/tests/017.phpt24
-rw-r--r--ext/filter/tests/018.phpt50
-rw-r--r--ext/filter/tests/019.phpt20
-rw-r--r--ext/filter/tests/020.phpt18
-rw-r--r--ext/filter/tests/021.phpt44
-rw-r--r--ext/filter/tests/022.phpt20
-rw-r--r--ext/filter/tests/023.phpt20
-rw-r--r--ext/filter/tests/024.phpt18
-rw-r--r--ext/filter/tests/025.phpt24
-rw-r--r--ext/filter/tests/026.phpt30
-rw-r--r--ext/filter/tests/027.phpt30
-rw-r--r--ext/filter/tests/028.phpt35
-rw-r--r--ext/filter/tests/029.phpt103
-rw-r--r--ext/filter/tests/030.phpt35
-rw-r--r--ext/filter/tests/031.phpt54
-rw-r--r--ext/filter/tests/032.phpt55
-rw-r--r--ext/filter/tests/033.phpt25
-rw-r--r--ext/filter/tests/033_run.inc35
-rw-r--r--ext/filter/tests/034.phpt31
-rw-r--r--ext/filter/tests/035.phpt36
-rw-r--r--ext/filter/tests/036.phpt39
-rw-r--r--ext/filter/tests/037.phpt39
-rw-r--r--ext/filter/tests/038.phpt56
-rw-r--r--ext/filter/tests/bug7586.phpt53
-rw-r--r--ext/filter/tests/bug7715.phpt29
-rw-r--r--ext/filter/tests/bug7733.phpt27
-rw-r--r--ext/filter/tests/bug8315.phpt13
-rw-r--r--ext/filter/tests/filter_data.phpt71
-rw-r--r--ext/ftp/php_ftp.c303
-rw-r--r--ext/gd/gd.c1030
-rw-r--r--ext/gd/gd_ctx.c10
-rw-r--r--ext/gd/libgd/gd.c4
-rw-r--r--ext/gd/libgd/gd_gd2.c4
-rw-r--r--ext/gd/libgd/gd_gif_in.c839
-rw-r--r--ext/gd/libgd/gd_gif_out.c8
-rw-r--r--ext/gd/libgd/gd_png.c5
-rw-r--r--ext/gd/libgd/gdfontg.c4
-rw-r--r--ext/gd/libgd/gdfontl.c4
-rw-r--r--ext/gd/libgd/gdfontmb.c4
-rw-r--r--ext/gd/libgd/gdfonts.c4
-rw-r--r--ext/gd/libgd/gdfontt.c4
-rw-r--r--ext/gd/libgd/gdft.c30
-rw-r--r--ext/gd/libgd/gdtables.c4
-rw-r--r--ext/gd/tests/001.phpt25
-rw-r--r--ext/gd/tests/bug38112.gifbin0 -> 18276 bytes
-rw-r--r--ext/gd/tests/bug38112.phpt17
-rw-r--r--ext/gd/tests/bug38179.phpt28
-rw-r--r--ext/gd/tests/bug38212.phpt17
-rw-r--r--ext/gd/tests/bug39082.phpt18
-rw-r--r--ext/gd/tests/colorat.phpt42
-rw-r--r--ext/gd/tests/colorclosest.phpt127
-rw-r--r--ext/gd/tests/colorexact.phpt40
-rw-r--r--ext/gd/tests/colorresolve.phpt113
-rw-r--r--ext/gd/tests/copy.phpt109
-rw-r--r--ext/gd/tests/copyresized.phpt91
-rw-r--r--ext/gd/tests/createfromgd2.phpt24
-rw-r--r--ext/gd/tests/createfromwbmp.phpt18
-rw-r--r--ext/gd/tests/dashedlines.phpt78
-rw-r--r--ext/gd/tests/gif.phpt145
-rw-r--r--ext/gd/tests/imagefill_1.phpt25
-rw-r--r--ext/gd/tests/imagewbmp.phpt31
-rw-r--r--ext/gd/tests/lines.phpt114
-rw-r--r--ext/gd/tests/src.gd2bin0 -> 423 bytes
-rw-r--r--ext/gd/tests/src.wbmpbin0 -> 9 bytes
-rw-r--r--ext/gd/tests/test_gif_2.gifbin0 -> 33641 bytes
-rw-r--r--ext/gd/tests/truecolor.phpt19
-rw-r--r--ext/gd/tests/types.phpt33
-rw-r--r--ext/gettext/gettext.c93
-rw-r--r--ext/gettext/tests/dcngettext.phpt30
-rw-r--r--ext/gmp/gmp.c341
-rw-r--r--ext/gmp/php_gmp.h1
-rw-r--r--ext/gmp/tests/004.phpt45
-rw-r--r--ext/gmp/tests/005.phpt68
-rw-r--r--ext/gmp/tests/006.phpt50
-rw-r--r--ext/gmp/tests/007.phpt133
-rw-r--r--ext/gmp/tests/008.phpt73
-rw-r--r--ext/gmp/tests/009.phpt73
-rw-r--r--ext/gmp/tests/010.phpt40
-rw-r--r--ext/gmp/tests/gmp_nextprime.phpt40
-rw-r--r--ext/hash/hash.c198
-rw-r--r--ext/hwapi/CREDITS2
-rw-r--r--ext/hwapi/config.m435
-rw-r--r--ext/hwapi/hwapi.cpp5023
-rw-r--r--ext/hwapi/php_hwapi.h157
-rw-r--r--ext/iconv/iconv.c161
-rw-r--r--ext/iconv/tests/bug37176.phpt2
-rw-r--r--ext/iconv/tests/iconv_strpos.phpt6
-rw-r--r--ext/iconv/tests/iconv_strrpos.phpt6
-rw-r--r--ext/imap/config.m47
-rw-r--r--ext/imap/php_imap.c44
-rw-r--r--ext/imap/tests/imap_utf8.phpt22
-rw-r--r--ext/interbase/interbase.c17
-rw-r--r--ext/json/CREDITS2
-rw-r--r--ext/json/JSON_parser.c757
-rw-r--r--ext/json/JSON_parser.h6
-rw-r--r--ext/json/README76
-rw-r--r--ext/json/config.m416
-rw-r--r--ext/json/config.w3210
-rw-r--r--ext/json/json.c468
-rw-r--r--ext/json/json.dsp135
-rw-r--r--ext/json/package.xml152
-rw-r--r--ext/json/php_json.h55
-rw-r--r--ext/json/tests/001.phpt71
-rw-r--r--ext/json/tests/002.phpt28
-rw-r--r--ext/json/tests/003.phpt33
-rw-r--r--ext/json/tests/004.phpt27
-rw-r--r--ext/json/tests/005.phpt27
-rw-r--r--ext/json/tests/fail001.phpt165
-rw-r--r--ext/json/tests/pass001.1.phpt887
-rw-r--r--ext/json/tests/pass001.phpt700
-rw-r--r--ext/json/tests/pass002.phpt275
-rw-r--r--ext/json/tests/pass003.phpt94
-rw-r--r--ext/json/utf8_decode.c179
-rw-r--r--ext/json/utf8_decode.h18
-rw-r--r--ext/json/utf8_to_utf16.c56
-rw-r--r--ext/json/utf8_to_utf16.h3
-rw-r--r--ext/ldap/config.m44
-rw-r--r--ext/ldap/ldap.c17
-rw-r--r--ext/libxml/libxml.c94
-rw-r--r--ext/libxml/php_libxml.h21
-rw-r--r--ext/libxml/php_libxml2.def1
-rw-r--r--ext/libxml/tests/001.phpt31
-rw-r--r--ext/libxml/tests/002.phpt87
-rw-r--r--ext/libxml/tests/003.phpt28
-rw-r--r--ext/libxml/tests/004.phpt57
-rw-r--r--ext/libxml/tests/test.xml8
-rw-r--r--ext/mbstring/config.m413
-rw-r--r--ext/mbstring/config.w328
-rw-r--r--ext/mbstring/mbstring.c640
-rw-r--r--ext/mbstring/mbstring.h12
-rw-r--r--ext/mbstring/oniguruma/AUTHORS1
-rw-r--r--ext/mbstring/oniguruma/COPYING4
-rw-r--r--ext/mbstring/oniguruma/HISTORY387
-rw-r--r--ext/mbstring/oniguruma/README51
-rw-r--r--ext/mbstring/oniguruma/README.ja53
-rw-r--r--ext/mbstring/oniguruma/config.h.in125
-rw-r--r--ext/mbstring/oniguruma/doc/API586
-rw-r--r--ext/mbstring/oniguruma/doc/API.ja593
-rw-r--r--ext/mbstring/oniguruma/doc/FAQ33
-rw-r--r--ext/mbstring/oniguruma/doc/FAQ.ja115
-rw-r--r--ext/mbstring/oniguruma/doc/RE412
-rw-r--r--ext/mbstring/oniguruma/doc/RE.ja424
-rw-r--r--ext/mbstring/oniguruma/enc/big5.c2
-rw-r--r--ext/mbstring/oniguruma/enc/euc_jp.c20
-rw-r--r--ext/mbstring/oniguruma/enc/euc_kr.c2
-rw-r--r--ext/mbstring/oniguruma/enc/euc_tw.c2
-rw-r--r--ext/mbstring/oniguruma/enc/gb18030.c501
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_1.c2
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_10.c8
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_11.c2
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_13.c8
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_14.c8
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_15.c8
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_16.c8
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_2.c8
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_3.c8
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_4.c8
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_5.c8
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_6.c2
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_7.c8
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_8.c2
-rw-r--r--ext/mbstring/oniguruma/enc/iso8859_9.c8
-rw-r--r--ext/mbstring/oniguruma/enc/koi8.c16
-rw-r--r--ext/mbstring/oniguruma/enc/koi8_r.c8
-rw-r--r--ext/mbstring/oniguruma/enc/sjis.c21
-rw-r--r--ext/mbstring/oniguruma/enc/unicode.c37
-rwxr-xr-xext/mbstring/oniguruma/enc/utf16_be.c10
-rwxr-xr-xext/mbstring/oniguruma/enc/utf16_le.c10
-rwxr-xr-xext/mbstring/oniguruma/enc/utf32_be.c10
-rwxr-xr-xext/mbstring/oniguruma/enc/utf32_le.c10
-rw-r--r--ext/mbstring/oniguruma/enc/utf8.c90
-rwxr-xr-xext/mbstring/oniguruma/index.html124
-rw-r--r--ext/mbstring/oniguruma/onigcmpt200.h6
-rw-r--r--ext/mbstring/oniguruma/oniggnu.h8
-rw-r--r--ext/mbstring/oniguruma/oniguruma.h219
-rw-r--r--ext/mbstring/oniguruma/regcomp.c854
-rw-r--r--ext/mbstring/oniguruma/regenc.c66
-rw-r--r--ext/mbstring/oniguruma/regenc.h26
-rw-r--r--ext/mbstring/oniguruma/regerror.c34
-rw-r--r--ext/mbstring/oniguruma/regexec.c562
-rwxr-xr-xext/mbstring/oniguruma/regext.c4
-rw-r--r--ext/mbstring/oniguruma/reggnu.c12
-rw-r--r--ext/mbstring/oniguruma/regint.h102
-rw-r--r--ext/mbstring/oniguruma/regparse.c459
-rw-r--r--ext/mbstring/oniguruma/regparse.h22
-rw-r--r--ext/mbstring/oniguruma/regposix.c11
-rw-r--r--ext/mbstring/oniguruma/regsyntax.c33
-rw-r--r--ext/mbstring/oniguruma/regversion.c4
-rw-r--r--ext/mbstring/oniguruma/st.c140
-rw-r--r--ext/mbstring/oniguruma/st.h16
-rw-r--r--ext/mbstring/oniguruma/win32/config.h168
-rw-r--r--ext/mbstring/php_mbregex.c33
-rw-r--r--ext/mbstring/tests/common.inc6
-rw-r--r--ext/mbstring/tests/mb_ereg1.phpt79
-rw-r--r--ext/mbstring/tests/mb_ereg2.phpt41
-rw-r--r--ext/mbstring/tests/mb_send_mail01.phpt2
-rw-r--r--ext/mbstring/tests/mb_send_mail02.phpt2
-rw-r--r--ext/mbstring/tests/mb_send_mail03.phpt2
-rw-r--r--ext/mbstring/tests/mb_send_mail04.phpt2
-rw-r--r--ext/mbstring/tests/mb_send_mail05.phpt2
-rw-r--r--ext/mbstring/tests/mb_send_mail06.phpt2
-rw-r--r--ext/mbstring/tests/mb_send_mail07.phpt2
-rw-r--r--ext/mbstring/tests/mb_strlen.phpt38
-rw-r--r--ext/mbstring/tests/mb_substr.phpt1
-rw-r--r--ext/mcrypt/mcrypt.c40
-rw-r--r--ext/mcrypt/php_mcrypt.h3
-rw-r--r--ext/mcrypt/tests/blowfish.phpt16
-rw-r--r--ext/mcrypt/tests/bug37595.phptbin0 -> 1094 bytes
-rw-r--r--ext/mime_magic/mime_magic.c17
-rw-r--r--ext/ming/ming.c56
-rw-r--r--ext/mssql/php_mssql.c19
-rw-r--r--ext/mysql/config.m48
-rw-r--r--ext/mysql/php_mysql.c58
-rwxr-xr-xext/mysql/tests/skipif.inc5
-rw-r--r--ext/mysqli/config.m410
-rw-r--r--ext/mysqli/mysqli.c175
-rw-r--r--ext/mysqli/mysqli_api.c165
-rw-r--r--ext/mysqli/mysqli_driver.c2
-rw-r--r--ext/mysqli/mysqli_embedded.c10
-rw-r--r--ext/mysqli/mysqli_nonapi.c4
-rw-r--r--ext/mysqli/mysqli_report.c4
-rw-r--r--ext/mysqli/php_mysqli.h20
-rw-r--r--ext/mysqli/tests/013.phpt2
-rw-r--r--ext/mysqli/tests/019.phpt7
-rw-r--r--ext/mysqli/tests/028.phpt4
-rw-r--r--ext/mysqli/tests/047.phpt117
-rw-r--r--ext/mysqli/tests/068.phpt33
-rw-r--r--ext/mysqli/tests/071.phpt36
-rw-r--r--ext/mysqli/tests/072.phpt27
-rw-r--r--ext/mysqli/tests/073.phpt23
-rw-r--r--ext/mysqli/tests/bug33263.phpt1
-rw-r--r--ext/mysqli/tests/bug36745.phpt4
-rw-r--r--ext/mysqli/tests/bug36802.phpt6
-rw-r--r--ext/mysqli/tests/bug36949.phpt50
-rw-r--r--ext/mysqli/tests/bug37090.phpt37
-rw-r--r--ext/mysqli/tests/bug38003.phpt20
-rw-r--r--ext/mysqli/tests/connect.inc6
-rw-r--r--ext/mysqli/tests/skipifnotemb.inc5
-rw-r--r--ext/oci8/config.m437
-rw-r--r--ext/oci8/config.w322
-rw-r--r--ext/oci8/oci8.c256
-rw-r--r--ext/oci8/oci8_collection.c202
-rw-r--r--ext/oci8/oci8_interface.c40
-rw-r--r--ext/oci8/oci8_lob.c328
-rw-r--r--ext/oci8/oci8_statement.c294
-rw-r--r--ext/oci8/package.xml63
-rw-r--r--ext/oci8/php_oci8_int.h44
-rw-r--r--ext/oci8/tests/array_bind_005.phpt3
-rw-r--r--ext/oci8/tests/array_bind_013.phpt39
-rw-r--r--ext/oci8/tests/bind_long.phpt14
-rw-r--r--ext/oci8/tests/bug35973.phpt43
-rw-r--r--ext/oci8/tests/bug37581.phpt69
-rw-r--r--ext/oci8/tests/bug38161.phpt30
-rw-r--r--ext/oci8/tests/bug38173.phpt79
-rw-r--r--ext/oci8/tests/coll_016.phpt4
-rw-r--r--ext/oci8/tests/coll_016_func.phpt4
-rw-r--r--ext/oci8/tests/connect_with_charset_001.phpt37
-rw-r--r--ext/oci8/tests/define1.phpt52
-rw-r--r--ext/oci8/tests/error1.phpt4
-rw-r--r--ext/oci8/tests/field_funcs.phpt6
-rw-r--r--ext/oci8/tests/field_funcs_old.phpt6
-rw-r--r--ext/oci8/tests/lob_015.phpt24
-rw-r--r--ext/oci8/tests/lob_021.phpt74
-rw-r--r--ext/oci8/tests/lob_022.phpt80
-rw-r--r--ext/oci8/tests/lob_023.phpt84
-rw-r--r--ext/oci8/tests/lob_024.phpt75
-rw-r--r--ext/oci8/tests/lob_025.phpt82
-rw-r--r--ext/oci8/tests/lob_026.phpt100
-rw-r--r--ext/oci8/tests/pecl_bug8816.phpt98
-rw-r--r--ext/oci8/tests/statement_cache.phpt4
-rw-r--r--ext/oci8/tests/test.txt9
-rw-r--r--ext/odbc/php_odbc.c47
-rw-r--r--ext/odbc/php_odbc_includes.h10
-rw-r--r--ext/openssl/openssl.c589
-rw-r--r--ext/openssl/php_openssl.h6
-rw-r--r--ext/openssl/tests/002.phpt32
-rw-r--r--ext/openssl/tests/003.phpt43
-rw-r--r--ext/openssl/tests/004.phpt34
-rw-r--r--ext/openssl/tests/bug28382.phpt38
-rw-r--r--ext/openssl/tests/bug28382cert.txt27
-rw-r--r--ext/openssl/tests/bug36732.phpt40
-rw-r--r--ext/openssl/tests/bug37820.phpt35
-rw-r--r--ext/openssl/tests/bug37820cert.pem14
-rw-r--r--ext/openssl/tests/bug37820key.pem9
-rw-r--r--ext/openssl/tests/bug38255.phpt55
-rw-r--r--ext/openssl/tests/bug38261.phpt34
-rw-r--r--ext/openssl/xp_ssl.c14
-rwxr-xr-xext/pcntl/pcntl.c25
-rw-r--r--ext/pcre/config.w326
-rw-r--r--ext/pcre/config0.m410
-rw-r--r--ext/pcre/pcrelib/AUTHORS4
-rw-r--r--ext/pcre/pcrelib/COPYING4
-rw-r--r--ext/pcre/pcrelib/ChangeLog169
-rw-r--r--ext/pcre/pcrelib/LICENCE2
-rw-r--r--ext/pcre/pcrelib/NEWS11
-rw-r--r--ext/pcre/pcrelib/README50
-rw-r--r--ext/pcre/pcrelib/doc/Tech.Notes32
-rw-r--r--ext/pcre/pcrelib/doc/pcre.txt1510
-rw-r--r--ext/pcre/pcrelib/pcre.h10
-rw-r--r--ext/pcre/pcrelib/pcre_compile.c505
-rw-r--r--ext/pcre/pcrelib/pcre_dfa_exec.c2027
-rw-r--r--ext/pcre/pcrelib/pcre_exec.c566
-rw-r--r--ext/pcre/pcrelib/pcre_get.c122
-rw-r--r--ext/pcre/pcrelib/pcre_internal.h54
-rw-r--r--ext/pcre/pcrelib/pcre_maketables.c4
-rw-r--r--ext/pcre/pcrelib/pcre_printint.src40
-rw-r--r--ext/pcre/pcrelib/pcre_study.c57
-rw-r--r--ext/pcre/pcrelib/pcre_try_flipped.c4
-rw-r--r--ext/pcre/pcrelib/pcre_ucp_searchfuncs.c2
-rw-r--r--ext/pcre/pcrelib/pcrecpp.cc48
-rw-r--r--ext/pcre/pcrelib/pcrecpp_unittest.cc59
-rw-r--r--ext/pcre/pcrelib/pcredemo.c10
-rw-r--r--ext/pcre/pcrelib/pcregrep.c71
-rw-r--r--ext/pcre/pcrelib/pcreposix.c10
-rw-r--r--ext/pcre/pcrelib/pcretest.c382
-rw-r--r--ext/pcre/pcrelib/testdata/grepinputx6
-rw-r--r--ext/pcre/pcrelib/testdata/testinput141
-rw-r--r--ext/pcre/pcrelib/testdata/testinput2155
-rw-r--r--ext/pcre/pcrelib/testdata/testinput47
-rw-r--r--ext/pcre/pcrelib/testdata/testinput56
-rw-r--r--ext/pcre/pcrelib/testdata/testinput69
-rw-r--r--ext/pcre/pcrelib/testdata/testinput7100
-rw-r--r--ext/pcre/pcrelib/testdata/testoutput176
-rw-r--r--ext/pcre/pcrelib/testdata/testoutput2578
-rw-r--r--ext/pcre/pcrelib/testdata/testoutput412
-rw-r--r--ext/pcre/pcrelib/testdata/testoutput513
-rw-r--r--ext/pcre/pcrelib/testdata/testoutput616
-rw-r--r--ext/pcre/pcrelib/testdata/testoutput7210
-rw-r--r--ext/pcre/php_pcre.c655
-rw-r--r--ext/pcre/php_pcre.h22
-rw-r--r--ext/pcre/tests/backtrack_limit.phpt19
-rw-r--r--ext/pcre/tests/bug37800.phpt31
-rw-r--r--ext/pcre/tests/cache_limit.phpt25
-rw-r--r--ext/pcre/tests/delimiters.phpt37
-rw-r--r--ext/pcre/tests/dollar_endonly.phpt39
-rw-r--r--ext/pcre/tests/grep.phpt23
-rw-r--r--ext/pcre/tests/grep2.phpt45
-rw-r--r--ext/pcre/tests/invalid_utf8.phpt16
-rw-r--r--ext/pcre/tests/locales.phpt25
-rw-r--r--ext/pcre/tests/match_flags.phpt127
-rw-r--r--ext/pcre/tests/match_flags2.phpt95
-rw-r--r--ext/pcre/tests/match_flags3.phpt46
-rw-r--r--ext/pcre/tests/multiline.phpt18
-rw-r--r--ext/pcre/tests/pcre_anchored.phpt22
-rw-r--r--ext/pcre/tests/pcre_extended.phpt29
-rw-r--r--ext/pcre/tests/pcre_extra.phpt14
-rw-r--r--ext/pcre/tests/preg_replace.phpt25
-rw-r--r--ext/pcre/tests/preg_replace2.phpt42
-rw-r--r--ext/pcre/tests/preg_replace_callback.phpt25
-rw-r--r--ext/pcre/tests/preg_replace_callback2.phpt40
-rw-r--r--ext/pcre/tests/preg_replace_callback3.phpt45
-rw-r--r--ext/pcre/tests/recursion_limit.phpt19
-rw-r--r--ext/pcre/tests/split.phpt86
-rw-r--r--ext/pcre/tests/split2.phpt315
-rw-r--r--ext/pcre/tests/study.phpt31
-rw-r--r--ext/pcre/tests/ungreedy.phpt31
-rwxr-xr-xext/pdo/config.m44
-rwxr-xr-xext/pdo/pdo.c73
-rwxr-xr-xext/pdo/pdo_dbh.c174
-rwxr-xr-xext/pdo/pdo_stmt.c80
-rwxr-xr-xext/pdo/php_pdo.h17
-rwxr-xr-xext/pdo/php_pdo_driver.h19
-rwxr-xr-xext/pdo/php_pdo_int.h4
-rwxr-xr-xext/pdo/tests/bug_36428.phpt33
-rw-r--r--ext/pdo/tests/bug_38253.phpt47
-rw-r--r--ext/pdo/tests/bug_38394.phpt51
-rw-r--r--ext/pdo/tests/pdo_017.phpt9
-rw-r--r--ext/pdo/tests/pdo_026.phpt2
-rwxr-xr-xext/pdo/tests/pdo_029.phpt2
-rwxr-xr-xext/pdo/tests/pdo_030.phpt37
-rwxr-xr-xext/pdo/tests/pdo_031.phpt2
-rw-r--r--ext/pdo/tests/pdo_033.phpt39
-rw-r--r--ext/pdo/tests/pdo_test.inc6
-rwxr-xr-xext/pdo_dblib/config.w326
-rw-r--r--ext/pdo_dblib/pdo_dblib.c18
-rw-r--r--ext/pdo_firebird/config.w323
-rwxr-xr-xext/pdo_mysql/config.m430
-rw-r--r--ext/pdo_mysql/config.w323
-rwxr-xr-xext/pdo_mysql/mysql_driver.c32
-rw-r--r--ext/pdo_mysql/tests/bug_33689.phpt2
-rw-r--r--ext/pdo_mysql/tests/bug_37445.phpt21
-rw-r--r--ext/pdo_mysql/tests/last_insert_id.phpt36
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5200.phpt1
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5780.phpt1
-rw-r--r--ext/pdo_mysql/tests/pecl_bug_5802.phpt1
-rw-r--r--ext/pdo_mysql/tests/show_tables.phpt3
-rwxr-xr-xext/pdo_oci/config.w324
-rwxr-xr-xext/pdo_odbc/odbc_driver.c4
-rwxr-xr-xext/pdo_odbc/odbc_stmt.c43
-rwxr-xr-xext/pdo_odbc/pdo_odbc.c4
-rw-r--r--ext/pdo_odbc/php_pdo_odbc.h4
-rwxr-xr-xext/pdo_odbc/php_pdo_odbc_int.h5
-rw-r--r--ext/pdo_odbc/tests/long_columns.phpt4
-rw-r--r--ext/pdo_pgsql/config.m44
-rw-r--r--ext/pdo_pgsql/config.w325
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c21
-rw-r--r--ext/pdo_pgsql/pgsql_statement.c23
-rw-r--r--ext/pdo_sqlite/config.m413
-rw-r--r--ext/pdo_sqlite/config.w3210
-rw-r--r--ext/pdo_sqlite/package2.xml8
-rw-r--r--ext/pdo_sqlite/sqlite/Makefile.in78
-rw-r--r--ext/pdo_sqlite/sqlite/Makefile.linux-gcc18
-rw-r--r--ext/pdo_sqlite/sqlite/VERSION2
-rw-r--r--ext/pdo_sqlite/sqlite/aclocal.m42
-rwxr-xr-xext/pdo_sqlite/sqlite/configure444
-rw-r--r--ext/pdo_sqlite/sqlite/configure.ac101
-rw-r--r--ext/pdo_sqlite/sqlite/main.mk81
-rw-r--r--ext/pdo_sqlite/sqlite/mkdll.sh6
-rw-r--r--ext/pdo_sqlite/sqlite/mkopcodeh.awk25
-rw-r--r--ext/pdo_sqlite/sqlite/publish.sh2
-rw-r--r--ext/pdo_sqlite/sqlite/sqlite3.def4
-rw-r--r--ext/pdo_sqlite/sqlite/src/alter.c82
-rw-r--r--ext/pdo_sqlite/sqlite/src/analyze.c39
-rw-r--r--ext/pdo_sqlite/sqlite/src/attach.c396
-rw-r--r--ext/pdo_sqlite/sqlite/src/auth.c19
-rw-r--r--ext/pdo_sqlite/sqlite/src/btree.c1452
-rw-r--r--ext/pdo_sqlite/sqlite/src/btree.h9
-rw-r--r--ext/pdo_sqlite/sqlite/src/build.c868
-rw-r--r--ext/pdo_sqlite/sqlite/src/callback.c87
-rw-r--r--ext/pdo_sqlite/sqlite/src/complete.c263
-rw-r--r--ext/pdo_sqlite/sqlite/src/date.c26
-rw-r--r--ext/pdo_sqlite/sqlite/src/delete.c91
-rw-r--r--ext/pdo_sqlite/sqlite/src/experimental.c37
-rw-r--r--ext/pdo_sqlite/sqlite/src/expr.c310
-rw-r--r--ext/pdo_sqlite/sqlite/src/func.c179
-rw-r--r--ext/pdo_sqlite/sqlite/src/hash.c29
-rw-r--r--ext/pdo_sqlite/sqlite/src/hash.h2
-rw-r--r--ext/pdo_sqlite/sqlite/src/insert.c155
-rw-r--r--ext/pdo_sqlite/sqlite/src/keywordhash.h87
-rw-r--r--ext/pdo_sqlite/sqlite/src/legacy.c13
-rw-r--r--ext/pdo_sqlite/sqlite/src/loadext.c355
-rw-r--r--ext/pdo_sqlite/sqlite/src/main.c641
-rw-r--r--ext/pdo_sqlite/sqlite/src/opcodes.h296
-rw-r--r--ext/pdo_sqlite/sqlite/src/os.c92
-rw-r--r--ext/pdo_sqlite/sqlite/src/os.h355
-rw-r--r--ext/pdo_sqlite/sqlite/src/os_common.h67
-rw-r--r--ext/pdo_sqlite/sqlite/src/os_mac.c738
-rw-r--r--ext/pdo_sqlite/sqlite/src/os_mac.h41
-rw-r--r--ext/pdo_sqlite/sqlite/src/os_unix.c1010
-rw-r--r--ext/pdo_sqlite/sqlite/src/os_win.c936
-rw-r--r--ext/pdo_sqlite/sqlite/src/pager.c1225
-rw-r--r--ext/pdo_sqlite/sqlite/src/pager.h11
-rw-r--r--ext/pdo_sqlite/sqlite/src/parse.c4083
-rw-r--r--ext/pdo_sqlite/sqlite/src/parse.h298
-rw-r--r--ext/pdo_sqlite/sqlite/src/parse.y229
-rw-r--r--ext/pdo_sqlite/sqlite/src/pragma.c160
-rw-r--r--ext/pdo_sqlite/sqlite/src/prepare.c235
-rw-r--r--ext/pdo_sqlite/sqlite/src/printf.c97
-rw-r--r--ext/pdo_sqlite/sqlite/src/select.c772
-rw-r--r--ext/pdo_sqlite/sqlite/src/shell.c110
-rw-r--r--ext/pdo_sqlite/sqlite/src/sqlite.h.in475
-rw-r--r--ext/pdo_sqlite/sqlite/src/sqlite3ext.h280
-rw-r--r--ext/pdo_sqlite/sqlite/src/sqliteInt.h529
-rw-r--r--ext/pdo_sqlite/sqlite/src/table.c27
-rw-r--r--ext/pdo_sqlite/sqlite/src/tclsqlite.c272
-rw-r--r--ext/pdo_sqlite/sqlite/src/test1.c880
-rw-r--r--ext/pdo_sqlite/sqlite/src/test2.c10
-rw-r--r--ext/pdo_sqlite/sqlite/src/test3.c23
-rw-r--r--ext/pdo_sqlite/sqlite/src/test4.c72
-rw-r--r--ext/pdo_sqlite/sqlite/src/test5.c8
-rw-r--r--ext/pdo_sqlite/sqlite/src/tokenize.c122
-rw-r--r--ext/pdo_sqlite/sqlite/src/trigger.c161
-rw-r--r--ext/pdo_sqlite/sqlite/src/update.c176
-rw-r--r--ext/pdo_sqlite/sqlite/src/utf.c44
-rw-r--r--ext/pdo_sqlite/sqlite/src/util.c968
-rw-r--r--ext/pdo_sqlite/sqlite/src/vacuum.c59
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbe.c1311
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbe.h17
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbeInt.h48
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbeapi.c170
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbeaux.c569
-rw-r--r--ext/pdo_sqlite/sqlite/src/vdbemem.c149
-rw-r--r--ext/pdo_sqlite/sqlite/src/vtab.c659
-rw-r--r--ext/pdo_sqlite/sqlite/src/where.c681
-rw-r--r--ext/pdo_sqlite/sqlite/tool/lemon.c298
-rw-r--r--ext/pdo_sqlite/sqlite/tool/lempar.c52
-rw-r--r--ext/pdo_sqlite/sqlite/tool/memleak3.tcl1
-rw-r--r--ext/pdo_sqlite/sqlite/tool/mkkeywordhash.c18
-rw-r--r--ext/pdo_sqlite/sqlite/tool/showdb.c7
-rw-r--r--ext/pdo_sqlite/sqlite/tool/spaceanal.tcl51
-rw-r--r--ext/pdo_sqlite/sqlite_driver.c6
-rw-r--r--ext/pgsql/config.m45
-rw-r--r--ext/pgsql/config.w324
-rw-r--r--ext/pgsql/pgsql.c184
-rw-r--r--ext/pgsql/php_pgsql.h3
-rw-r--r--ext/posix/config.m44
-rw-r--r--ext/posix/php_posix.h6
-rw-r--r--ext/posix/posix.c67
-rw-r--r--ext/posix/tests/001.phpt12
-rw-r--r--ext/pspell/php_pspell.h24
-rw-r--r--ext/pspell/pspell.c68
-rw-r--r--ext/pspell/tests/001.phpt (renamed from ext/pspell/tests/01pspell_basic.phpt)10
-rw-r--r--ext/pspell/tests/002.phpt44
-rw-r--r--ext/pspell/tests/003.phpt39
-rw-r--r--ext/pspell/tests/004.phpt35
-rw-r--r--ext/pspell/tests/005.phpt46
-rw-r--r--ext/pspell/tests/wordlist.txt5
-rw-r--r--ext/readline/readline.c4
-rw-r--r--ext/recode/recode.c17
-rwxr-xr-xext/reflection/config.m47
-rwxr-xr-xext/reflection/config.w323
-rw-r--r--ext/reflection/php_reflection.c667
-rw-r--r--ext/reflection/php_reflection.h3
-rwxr-xr-xext/reflection/tests/008.phpt39
-rw-r--r--ext/reflection/tests/bug29986.phpt12
-rwxr-xr-xext/reflection/tests/bug37816.phpt28
-rwxr-xr-xext/reflection/tests/bug38132.phpt34
-rwxr-xr-xext/reflection/tests/bug38194.phpt13
-rw-r--r--ext/reflection/tests/bug38217.phpt40
-rw-r--r--ext/reflection/tests/bug38465.phpt66
-rw-r--r--ext/reflection/tests/bug38653.phpt28
-rwxr-xr-xext/reflection/tests/bug38942.phpt34
-rw-r--r--ext/reflection/tests/bug39001.phpt27
-rw-r--r--ext/reflection/tests/bug39067.phpt45
-rw-r--r--ext/session/mod_files.c10
-rw-r--r--ext/session/php_session.h7
-rw-r--r--ext/session/session.c142
-rw-r--r--ext/session/tests/008-php4.2.3.phpt2
-rw-r--r--ext/session/tests/bug38377.phpt13
-rw-r--r--ext/shmop/tests/001.phpt2
-rw-r--r--ext/simplexml/php_simplexml.h8
-rw-r--r--ext/simplexml/simplexml.c295
-rwxr-xr-xext/simplexml/tests/032.phpt2
-rwxr-xr-xext/simplexml/tests/bug35785.phpt2
-rw-r--r--ext/simplexml/tests/bug36611.phpt2
-rwxr-xr-xext/simplexml/tests/bug37565.phpt31
-rw-r--r--ext/simplexml/tests/bug38347.phpt28
-rw-r--r--ext/simplexml/tests/bug38354.phpt28
-rw-r--r--ext/simplexml/tests/bug38424.phpt26
-rwxr-xr-xext/simplexml/tests/profile12.phpt74
-rwxr-xr-xext/simplexml/tests/profile13.phpt75
-rwxr-xr-xext/simplexml/tests/simplexml_import_dom.phpt4
-rw-r--r--ext/skeleton/skeleton.c1
-rw-r--r--ext/snmp/php_snmp.h4
-rw-r--r--ext/snmp/snmp.c57
-rw-r--r--ext/soap/php_encoding.c723
-rw-r--r--ext/soap/php_encoding.h18
-rw-r--r--ext/soap/php_http.c121
-rw-r--r--ext/soap/php_packet_soap.c46
-rw-r--r--ext/soap/php_schema.c324
-rw-r--r--ext/soap/php_sdl.c124
-rw-r--r--ext/soap/php_sdl.h4
-rw-r--r--ext/soap/php_soap.h32
-rw-r--r--ext/soap/php_xml.c30
-rw-r--r--ext/soap/php_xml.h4
-rw-r--r--ext/soap/soap.c733
-rw-r--r--ext/soap/tests/bugs/bug30799.phpt2
-rw-r--r--ext/soap/tests/bugs/bug31755.phpt2
-rwxr-xr-xext/soap/tests/bugs/bug34449.phpt2
-rwxr-xr-xext/soap/tests/bugs/bug35273.phpt2
-rwxr-xr-xext/soap/tests/bugs/bug36575.phpt4
-rwxr-xr-xext/soap/tests/bugs/bug37278.phpt2
-rwxr-xr-xext/soap/tests/bugs/bug38004.phpt40
-rwxr-xr-xext/soap/tests/bugs/bug38004.wsdl51
-rwxr-xr-xext/soap/tests/bugs/bug38005.phpt41
-rwxr-xr-xext/soap/tests/bugs/bug38055.phpt39
-rwxr-xr-xext/soap/tests/bugs/bug38055.wsdl49
-rwxr-xr-xext/soap/tests/bugs/bug38067.phpt40
-rwxr-xr-xext/soap/tests/bugs/bug38067.wsdl48
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_003s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_003w.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_006s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_006w.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_007p.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_007s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_007w.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_008p.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_008s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_008w.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_009p.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_009w.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_011p.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_011s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_011w.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_013p.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_013s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_013w.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_014s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_016p.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_016s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/Base/r2_base_016w.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_001s.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_001w.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_002p.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_002s.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_002w.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_003p.phpt2
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_003s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_003w.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_004p.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_004s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_004w.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_005p.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_005s.phpt4
-rw-r--r--ext/soap/tests/interop/Round2/GroupB/r2_groupB_005w.phpt4
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt4
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt4
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt4
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_002w.phpt4
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt4
-rw-r--r--ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_004w.phpt4
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt4
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt4
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt4
-rw-r--r--ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_001w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_002w.phpt2
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_003w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_004w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_005w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_006w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_007w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_008w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_009w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_010w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_011w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_012w.phpt2
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_013w.phpt2
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_014w.phpt2
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_015w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_016w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_simple_rpcenc_017w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_001w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_002w.phpt4
-rw-r--r--ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_004w.phpt2
-rw-r--r--ext/soap/tests/schema/schema009.phpt2
-rw-r--r--ext/soap/tests/schema/schema010.phpt2
-rw-r--r--ext/soap/tests/schema/schema011.phpt2
-rw-r--r--ext/soap/tests/schema/schema012.phpt2
-rw-r--r--ext/soap/tests/schema/schema013.phpt2
-rw-r--r--ext/soap/tests/schema/schema014.phpt2
-rw-r--r--ext/soap/tests/schema/schema015.phpt2
-rw-r--r--ext/soap/tests/schema/schema016.phpt2
-rw-r--r--ext/soap/tests/schema/schema017.phpt2
-rw-r--r--ext/soap/tests/schema/schema018.phpt2
-rw-r--r--ext/soap/tests/schema/schema019.phpt2
-rw-r--r--ext/soap/tests/schema/schema020.phpt2
-rw-r--r--ext/soap/tests/schema/schema021.phpt2
-rw-r--r--ext/soap/tests/schema/schema022.phpt2
-rw-r--r--ext/soap/tests/schema/schema023.phpt2
-rw-r--r--ext/soap/tests/schema/schema024.phpt2
-rw-r--r--ext/soap/tests/schema/schema025.phpt2
-rw-r--r--ext/soap/tests/schema/schema026.phpt2
-rw-r--r--ext/soap/tests/schema/schema027.phpt2
-rw-r--r--ext/soap/tests/schema/schema028.phpt2
-rw-r--r--ext/soap/tests/schema/schema029.phpt2
-rw-r--r--ext/soap/tests/schema/schema054.phpt2
-rw-r--r--ext/soap/tests/schema/schema055.phpt2
-rw-r--r--ext/soap/tests/schema/schema062.phpt2
-rw-r--r--ext/soap/tests/schema/schema065.phpt2
-rw-r--r--ext/soap/tests/schema/schema066.phpt2
-rw-r--r--ext/soap/tests/schema/schema067.phpt2
-rw-r--r--ext/soap/tests/schema/schema069.phpt2
-rw-r--r--ext/soap/tests/schema/schema070.phpt2
-rw-r--r--ext/soap/tests/schema/schema075.phpt2
-rw-r--r--ext/soap/tests/schema/schema076.phpt2
-rw-r--r--ext/soap/tests/schema/schema077.phpt2
-rwxr-xr-xext/soap/tests/server025.phpt2
-rwxr-xr-xext/soap/tests/server026.phpt37
-rwxr-xr-xext/soap/tests/server027.phpt30
-rwxr-xr-xext/soap/tests/server028.phpt41
-rwxr-xr-xext/soap/tests/setheaders.phpt38
-rw-r--r--ext/soap/tests/soap12/T31.phpt2
-rw-r--r--ext/soap/tests/soap12/T41.phpt2
-rw-r--r--ext/soap/tests/soap12/T42.phpt2
-rw-r--r--ext/soap/tests/soap12/T44.phpt2
-rw-r--r--ext/soap/tests/soap12/T45.phpt2
-rw-r--r--ext/soap/tests/soap12/T46.phpt2
-rw-r--r--ext/soap/tests/soap12/T47.phpt2
-rw-r--r--ext/soap/tests/soap12/T48.phpt2
-rw-r--r--ext/soap/tests/soap12/T49.phpt2
-rw-r--r--ext/soap/tests/soap12/T50.phpt2
-rwxr-xr-xext/soap/tests/typemap001.phpt60
-rwxr-xr-xext/soap/tests/typemap002.phpt56
-rwxr-xr-xext/soap/tests/typemap003.phpt54
-rwxr-xr-xext/soap/tests/typemap004.phpt41
-rwxr-xr-xext/soap/tests/typemap005.phpt61
-rwxr-xr-xext/soap/tests/typemap006.phpt57
-rwxr-xr-xext/soap/tests/typemap007.phpt56
-rwxr-xr-xext/soap/tests/typemap008.phpt43
-rwxr-xr-xext/soap/tests/typemap009.phpt56
-rwxr-xr-xext/soap/tests/typemap010.phpt56
-rwxr-xr-xext/soap/tests/typemap011.phpt49
-rwxr-xr-xext/soap/tests/typemap012.phpt45
-rwxr-xr-xext/soap/tests/typemap013.phpt56
-rw-r--r--ext/sockets/sockets.c39
-rwxr-xr-xext/spl/config.m47
-rwxr-xr-xext/spl/doxygen.cfg4
-rwxr-xr-xext/spl/examples/dualiterator.inc212
-rwxr-xr-xext/spl/examples/recursivedualiterator.inc72
-rwxr-xr-xext/spl/examples/tests/dualiterator_001.phpt47
-rwxr-xr-xext/spl/internal/filteriterator.inc10
-rwxr-xr-xext/spl/internal/recursiveregexiterator.inc61
-rwxr-xr-xext/spl/internal/regexiterator.inc163
-rwxr-xr-xext/spl/internal/splfileobject.inc40
-rwxr-xr-xext/spl/php_spl.c83
-rwxr-xr-xext/spl/spl.php264
-rwxr-xr-xext/spl/spl_array.c303
-rwxr-xr-xext/spl/spl_array.h3
-rwxr-xr-xext/spl/spl_directory.c360
-rwxr-xr-xext/spl/spl_directory.h7
-rwxr-xr-xext/spl/spl_exceptions.c4
-rwxr-xr-xext/spl/spl_functions.c18
-rwxr-xr-xext/spl/spl_functions.h8
-rwxr-xr-xext/spl/spl_iterators.c978
-rwxr-xr-xext/spl/spl_iterators.h51
-rwxr-xr-xext/spl/spl_observer.c4
-rwxr-xr-xext/spl/tests/array_013.phpt2
-rwxr-xr-xext/spl/tests/array_019.phpt4
-rwxr-xr-xext/spl/tests/array_021.phpt2
-rwxr-xr-xext/spl/tests/array_022.phpt26
-rwxr-xr-xext/spl/tests/bug36941.phpt2
-rwxr-xr-xext/spl/tests/bug37457.phpt82
-rwxr-xr-xext/spl/tests/fileobject_003.phpt89
-rwxr-xr-xext/spl/tests/iterator_027.phpt85
-rwxr-xr-xext/spl/tests/iterator_029.phpt40
-rw-r--r--ext/spl/tests/iterator_035.phpt2
-rwxr-xr-xext/spl/tests/iterator_036.phpt24
-rwxr-xr-xext/spl/tests/iterator_037.phpt133
-rwxr-xr-xext/spl/tests/iterator_038.phpt21
-rwxr-xr-xext/spl/tests/iterator_039.phpt123
-rwxr-xr-xext/spl/tests/iterator_040.phpt49
-rwxr-xr-xext/spl/tests/iterator_041.phpt119
-rwxr-xr-xext/spl/tests/iterator_041a.phpt109
-rwxr-xr-xext/spl/tests/iterator_041b.phpt107
-rwxr-xr-xext/spl/tests/iterator_042.phpt104
-rwxr-xr-xext/spl/tests/iterator_043.phpt20
-rwxr-xr-xext/spl/tests/iterator_044.phpt169
-rwxr-xr-xext/spl/tests/iterator_045.phpt171
-rwxr-xr-xext/spl/tests/iterator_046.phpt53
-rwxr-xr-xext/spl/tests/iterator_047.phpt119
-rwxr-xr-xext/spl/tests/iterator_048.phpt38
-rwxr-xr-xext/spl/tests/iterator_049.phpt24
-rwxr-xr-xext/spl/tests/iterator_049b.phptbin0 -> 616 bytes
-rwxr-xr-xext/spl/tests/iterator_050.phpt93
-rwxr-xr-xext/spl/tests/iterator_051.phpt95
-rwxr-xr-xext/spl/tests/iterator_052.phpt314
-rwxr-xr-xext/spl/tests/iterator_053.phpt314
-rwxr-xr-xext/spl/tests/iterator_054.phpt84
-rwxr-xr-xext/spl/tests/iterator_055.phpt61
-rwxr-xr-xext/spl/tests/spl_004.phpt86
-rwxr-xr-xext/spl/tests/spl_005.phpt23
-rw-r--r--ext/sqlite/libsqlite/src/vdbe.c4
-rw-r--r--ext/sqlite/pdo_sqlite2.c6
-rw-r--r--ext/sqlite/sqlite.c138
-rw-r--r--ext/sqlite/tests/bug38759.phpt18
-rw-r--r--ext/standard/array.c169
-rw-r--r--ext/standard/assert.c9
-rw-r--r--ext/standard/base64.c58
-rw-r--r--ext/standard/base64.h3
-rw-r--r--ext/standard/basic_functions.c4171
-rw-r--r--ext/standard/basic_functions.h5
-rw-r--r--ext/standard/config.m422
-rw-r--r--ext/standard/credits.c4
-rw-r--r--ext/standard/credits_ext.h13
-rw-r--r--ext/standard/datetime.c12
-rw-r--r--ext/standard/dir.c4
-rw-r--r--ext/standard/file.c57
-rw-r--r--ext/standard/file.h4
-rw-r--r--ext/standard/filestat.c50
-rw-r--r--ext/standard/filters.c6
-rw-r--r--ext/standard/formatted_print.c5
-rw-r--r--ext/standard/head.c31
-rw-r--r--ext/standard/head.h4
-rw-r--r--ext/standard/html.c23
-rw-r--r--ext/standard/http.c6
-rw-r--r--ext/standard/http_fopen_wrapper.c6
-rw-r--r--ext/standard/image.c6
-rw-r--r--ext/standard/info.c50
-rw-r--r--ext/standard/info.h4
-rw-r--r--ext/standard/iptc.c8
-rw-r--r--ext/standard/levenshtein.c4
-rw-r--r--ext/standard/link.c16
-rw-r--r--ext/standard/math.c43
-rw-r--r--ext/standard/metaphone.c12
-rw-r--r--ext/standard/php_array.h3
-rw-r--r--ext/standard/php_fopen_wrapper.c6
-rw-r--r--ext/standard/php_string.h4
-rw-r--r--ext/standard/php_var.h3
-rw-r--r--ext/standard/proc_open.c6
-rw-r--r--ext/standard/scanf.c2
-rw-r--r--ext/standard/sha1.h3
-rw-r--r--ext/standard/streamsfuncs.c48
-rw-r--r--ext/standard/streamsfuncs.h3
-rw-r--r--ext/standard/string.c273
-rw-r--r--ext/standard/tests/array/007.phpt58
-rw-r--r--ext/standard/tests/array/array_fill.phpt366
-rwxr-xr-xext/standard/tests/array/array_fill_keys.phpt42
-rw-r--r--ext/standard/tests/array/array_filter.phpt93
-rw-r--r--ext/standard/tests/array/array_flip.phpt37
-rw-r--r--ext/standard/tests/array/array_intersect_1.phpt127
-rw-r--r--ext/standard/tests/array/array_search1.phpt35
-rw-r--r--ext/standard/tests/array/array_walk.phpt48
-rw-r--r--ext/standard/tests/array/array_walk_objects.phptbin0 -> 785 bytes
-rw-r--r--ext/standard/tests/array/array_walk_rec_objects.phptbin0 -> 845 bytes
-rw-r--r--ext/standard/tests/array/array_walk_recursive1.phpt54
-rw-r--r--ext/standard/tests/array/bug30833.phpt2
-rw-r--r--ext/standard/tests/array/bug34066.phpt804
-rw-r--r--ext/standard/tests/array/bug34066_1.phpt731
-rw-r--r--ext/standard/tests/array/bug38464.phpt20
-rw-r--r--ext/standard/tests/array/max.phpt39
-rw-r--r--ext/standard/tests/array/min.phpt39
-rw-r--r--ext/standard/tests/assert/assert02.phpt42
-rw-r--r--ext/standard/tests/file/bug22414.phpt1
-rw-r--r--ext/standard/tests/file/bug24313.phpt6
-rw-r--r--ext/standard/tests/file/bug37864.phpt12
-rw-r--r--ext/standard/tests/file/bug38086.phpt46
-rw-r--r--ext/standard/tests/file/bug38086.txt5
-rw-r--r--ext/standard/tests/file/bug38450.phpt114
-rw-r--r--ext/standard/tests/file/bug38450_1.phpt114
-rw-r--r--ext/standard/tests/file/bug38450_2.phpt114
-rw-r--r--ext/standard/tests/file/bug38450_3.phpt105
-rw-r--r--ext/standard/tests/file/file_put_contents.phpt28
-rw-r--r--ext/standard/tests/file/mkdir-001.phpt36
-rw-r--r--ext/standard/tests/file/mkdir-002.phpt49
-rw-r--r--ext/standard/tests/file/mkdir-003.phpt30
-rw-r--r--ext/standard/tests/file/mkdir-004.phpt24
-rw-r--r--ext/standard/tests/file/mkdir-005.phpt25
-rw-r--r--ext/standard/tests/file/mkdir-006.phpt26
-rw-r--r--ext/standard/tests/file/stream_001.phpt24
-rw-r--r--ext/standard/tests/file/stream_002.phpt53
-rw-r--r--ext/standard/tests/file/stream_copy_to_stream.phpt129
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_001.phpt20
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_002.phpt180
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_003.gifbin0 -> 273 bytes
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_003.phpt36
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_004.phpt30
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_005.phpt36
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_006.phpt28
-rwxr-xr-xext/standard/tests/file/stream_rfc2397_007.phpt141
-rw-r--r--ext/standard/tests/filters/001.phpt31
-rw-r--r--ext/standard/tests/filters/php_user_filter_01.phpt17
-rw-r--r--ext/standard/tests/filters/php_user_filter_02.phpt12
-rw-r--r--ext/standard/tests/filters/php_user_filter_03.phpt12
-rw-r--r--ext/standard/tests/general_functions/010.phpt25
-rw-r--r--ext/standard/tests/general_functions/sunfuncts.phpt50
-rw-r--r--ext/standard/tests/image/image_type_to_extension.phpt103
-rw-r--r--ext/standard/tests/math/constants.phpt46
-rwxr-xr-xext/standard/tests/serialize/bug37947.phpt21
-rw-r--r--ext/standard/tests/strings/bug22224.phpt7
-rw-r--r--ext/standard/tests/strings/bug24098.phpt4
-rw-r--r--ext/standard/tests/strings/bug29538.phpt10
-rw-r--r--ext/standard/tests/strings/bug37244.phpt18
-rw-r--r--ext/standard/tests/strings/bug37262.phpt9
-rw-r--r--ext/standard/tests/strings/bug38322.phpt13
-rw-r--r--ext/standard/tests/strings/bug39032.phpt18
-rw-r--r--ext/standard/tests/strings/explode.phpt2
-rw-r--r--ext/standard/tests/strings/htmlentities15.phpt4
-rw-r--r--ext/standard/tests/strings/implode1.phpt59
-rw-r--r--ext/standard/tests/strings/pathinfo.phpt108
-rw-r--r--ext/standard/tests/strings/str_replace.phpt108
-rw-r--r--ext/standard/tests/strings/str_word_count.phpt51
-rw-r--r--ext/standard/tests/strings/str_word_count1.phpt26
-rw-r--r--ext/standard/tests/strings/strings001.phpt2
-rw-r--r--ext/standard/tests/strings/stripos.phpt55
-rw-r--r--ext/standard/tests/strings/strrchr.phpt22
-rw-r--r--ext/standard/tests/strings/url_t.phpt21
-rwxr-xr-xext/standard/tests/time/bug38524.phpt29
-rw-r--r--ext/standard/url.c40
-rw-r--r--ext/standard/user_filters.c38
-rw-r--r--ext/standard/uuencode.c6
-rw-r--r--ext/standard/var.c69
-rw-r--r--ext/standard/versioning.c4
-rw-r--r--ext/sybase_ct/php_sybase_ct.c50
-rw-r--r--ext/sysvmsg/config.m47
-rw-r--r--ext/sysvmsg/sysvmsg.c6
-rw-r--r--ext/sysvshm/sysvshm.c6
-rw-r--r--ext/sysvshm/tests/001.phpt42
-rw-r--r--ext/sysvshm/tests/002.phpt67
-rw-r--r--ext/sysvshm/tests/003.phpt46
-rw-r--r--ext/sysvshm/tests/004.phpt40
-rw-r--r--ext/sysvshm/tests/005.phpt68
-rw-r--r--ext/sysvshm/tests/006.phpt48
-rw-r--r--ext/sysvshm/tests/007.phpt41
-rw-r--r--ext/tidy/README9
-rw-r--r--ext/tidy/libtidy.txt12
-rw-r--r--ext/tidy/php_tidy.h61
-rw-r--r--ext/tidy/tests/007.phpt12
-rw-r--r--ext/tidy/tests/019.phpt38
-rw-r--r--ext/tidy/tests/020.phpt36
-rw-r--r--ext/tidy/tests/021.phpt18
-rw-r--r--ext/tidy/tests/022.phpt38
-rw-r--r--ext/tidy/tests/023.phpt49
-rw-r--r--ext/tidy/tidy.c353
-rw-r--r--ext/tokenizer/php_tokenizer.h5
-rw-r--r--ext/tokenizer/tokenizer.c42
-rw-r--r--ext/wddx/config.m453
-rwxr-xr-xext/wddx/tests/bug37569.phpt778
-rwxr-xr-xext/wddx/tests/bug37587.phpt34
-rw-r--r--ext/wddx/wddx.c61
-rw-r--r--ext/xml/php_xml.h9
-rw-r--r--ext/xml/tests/bug32001.phpt4
-rw-r--r--ext/xml/tests/xml011.phpt71
-rw-r--r--ext/xml/xml.c54
-rw-r--r--ext/xmlreader/php_xmlreader.c193
-rw-r--r--ext/xmlreader/php_xmlreader.h6
-rwxr-xr-xext/xmlreader/tests/013.phpt52
-rwxr-xr-xext/xmlreader/tests/013.xsd10
-rw-r--r--ext/xmlreader/tests/bug36743.phpt2
-rw-r--r--ext/xmlrpc/libxmlrpc/xml_element.c9
-rw-r--r--ext/xmlrpc/tests/001.phpt66
-rw-r--r--ext/xmlrpc/tests/002.phpt56
-rw-r--r--ext/xmlrpc/tests/bug37057.phpt2
-rw-r--r--ext/xmlrpc/xmlrpc-epi-php.c7
-rw-r--r--ext/xmlwriter/php_xmlwriter.c582
-rw-r--r--ext/xmlwriter/php_xmlwriter.h4
-rw-r--r--ext/xmlwriter/tests/009.phpt10
-rw-r--r--ext/xmlwriter/tests/010.phpt41
-rw-r--r--ext/xmlwriter/tests/OO_009.phpt10
-rw-r--r--ext/xsl/config.m410
-rw-r--r--ext/xsl/tests/xslt010.phpt9
-rw-r--r--ext/xsl/xsltprocessor.c30
-rw-r--r--ext/zip/CREDITS2
-rw-r--r--ext/zip/TODO5
-rw-r--r--ext/zip/config.m468
-rw-r--r--ext/zip/config.w3237
-rw-r--r--ext/zip/examples/comment.php6
-rw-r--r--ext/zip/examples/create.php20
-rw-r--r--ext/zip/examples/dir.php17
-rw-r--r--ext/zip/examples/extract.php24
-rw-r--r--ext/zip/examples/extractAll.php24
-rw-r--r--ext/zip/examples/fopen.php31
-rw-r--r--ext/zip/examples/get_set_comments.php38
-rw-r--r--ext/zip/examples/im.php11
-rw-r--r--ext/zip/examples/odt.php20
-rw-r--r--ext/zip/examples/oldapi.php17
-rw-r--r--ext/zip/examples/test.odtbin0 -> 6162 bytes
-rw-r--r--ext/zip/examples/test.zipbin0 -> 541 bytes
-rw-r--r--ext/zip/examples/test1.zipbin0 -> 681 bytes
-rw-r--r--ext/zip/examples/test_im.zipbin0 -> 1086 bytes
-rw-r--r--ext/zip/examples/test_with_comment.zipbin0 -> 560 bytes
-rw-r--r--ext/zip/examples/too.php2
-rw-r--r--ext/zip/lib/mkstemp.c136
-rw-r--r--ext/zip/lib/unistd.h3
-rw-r--r--ext/zip/lib/zip.h206
-rw-r--r--ext/zip/lib/zip_add.c51
-rw-r--r--ext/zip/lib/zip_close.c554
-rw-r--r--ext/zip/lib/zip_delete.c61
-rw-r--r--ext/zip/lib/zip_dirent.c532
-rw-r--r--ext/zip/lib/zip_entry_free.c55
-rw-r--r--ext/zip/lib/zip_entry_new.c81
-rw-r--r--ext/zip/lib/zip_err_str.c72
-rw-r--r--ext/zip/lib/zip_error.c95
-rw-r--r--ext/zip/lib/zip_error_get.c47
-rw-r--r--ext/zip/lib/zip_error_get_sys_type.c50
-rw-r--r--ext/zip/lib/zip_error_strerror.c93
-rw-r--r--ext/zip/lib/zip_error_to_str.c73
-rw-r--r--ext/zip/lib/zip_fclose.c74
-rw-r--r--ext/zip/lib/zip_file_error_get.c47
-rw-r--r--ext/zip/lib/zip_file_get_offset.c80
-rw-r--r--ext/zip/lib/zip_file_strerror.c47
-rw-r--r--ext/zip/lib/zip_fopen.c52
-rw-r--r--ext/zip/lib/zip_fopen_index.c219
-rw-r--r--ext/zip/lib/zip_fread.c125
-rw-r--r--ext/zip/lib/zip_free.c83
-rw-r--r--ext/zip/lib/zip_get_archive_comment.c58
-rw-r--r--ext/zip/lib/zip_get_file_comment.c61
-rw-r--r--ext/zip/lib/zip_get_name.c74
-rw-r--r--ext/zip/lib/zip_get_num_files.c50
-rw-r--r--ext/zip/lib/zip_memdup.c58
-rw-r--r--ext/zip/lib/zip_name_locate.c91
-rw-r--r--ext/zip/lib/zip_new.c71
-rw-r--r--ext/zip/lib/zip_open.c465
-rw-r--r--ext/zip/lib/zip_rename.c52
-rw-r--r--ext/zip/lib/zip_replace.c82
-rw-r--r--ext/zip/lib/zip_set_archive_comment.c68
-rw-r--r--ext/zip/lib/zip_set_file_comment.c69
-rw-r--r--ext/zip/lib/zip_set_name.c77
-rw-r--r--ext/zip/lib/zip_source_buffer.c162
-rw-r--r--ext/zip/lib/zip_source_file.c71
-rw-r--r--ext/zip/lib/zip_source_filep.c180
-rw-r--r--ext/zip/lib/zip_source_free.c54
-rw-r--r--ext/zip/lib/zip_source_function.c62
-rw-r--r--ext/zip/lib/zip_source_zip.c189
-rw-r--r--ext/zip/lib/zip_stat.c52
-rw-r--r--ext/zip/lib/zip_stat_index.c93
-rw-r--r--ext/zip/lib/zip_strerror.c47
-rw-r--r--ext/zip/lib/zip_unchange.c84
-rw-r--r--ext/zip/lib/zip_unchange_all.c56
-rw-r--r--ext/zip/lib/zip_unchange_archive.c52
-rw-r--r--ext/zip/lib/zip_unchange_data.c53
-rw-r--r--ext/zip/lib/zip_win32.h29
-rw-r--r--ext/zip/lib/zipint.h225
-rw-r--r--ext/zip/php_zip.c2002
-rw-r--r--ext/zip/php_zip.h101
-rw-r--r--ext/zip/tests/001.phpt12
-rw-r--r--ext/zip/tests/binarynull.zipbin0 -> 656 bytes
-rw-r--r--ext/zip/tests/bug38943.phpt50
-rw-r--r--ext/zip/tests/bug38944.phpt40
-rw-r--r--ext/zip/tests/bug7214.phpt23
-rw-r--r--ext/zip/tests/bug7658.odtbin0 -> 8873 bytes
-rw-r--r--ext/zip/tests/bug7658.phpt60
-rw-r--r--ext/zip/tests/bug7658.xml2
-rw-r--r--ext/zip/tests/bug8009.phpt27
-rw-r--r--ext/zip/tests/bug8009.zipbin0 -> 112 bytes
-rw-r--r--ext/zip/tests/bug8700.phpt30
-rw-r--r--ext/zip/tests/oo_addfile.phpt37
-rw-r--r--ext/zip/tests/oo_close.phpt25
-rw-r--r--ext/zip/tests/oo_delete.phpt76
-rw-r--r--ext/zip/tests/oo_ext_zip.phpt27
-rw-r--r--ext/zip/tests/oo_namelocate.phpt46
-rw-r--r--ext/zip/tests/oo_open.phpt46
-rw-r--r--ext/zip/tests/oo_rename.phpt58
-rw-r--r--ext/zip/tests/test.zipbin0 -> 526 bytes
-rw-r--r--ext/zip/tests/test_procedural.zipbin0 -> 541 bytes
-rw-r--r--ext/zip/tests/utils.inc8
-rw-r--r--ext/zip/tests/zip_close.phpt17
-rw-r--r--ext/zip/tests/zip_entry_compressedsize.phpt23
-rw-r--r--ext/zip/tests/zip_entry_compressionmethod.phpt24
-rw-r--r--ext/zip/tests/zip_entry_filesize.phpt23
-rw-r--r--ext/zip/tests/zip_entry_name.phpt23
-rw-r--r--ext/zip/tests/zip_entry_open.phpt17
-rw-r--r--ext/zip/tests/zip_entry_read.phpt18
-rw-r--r--ext/zip/tests/zip_open.phpt16
-rw-r--r--ext/zip/tests/zip_read.phpt21
-rw-r--r--ext/zip/zip_stream.c235
-rw-r--r--ext/zlib/php_zlib.h19
-rw-r--r--ext/zlib/tests/004.phpt89
-rw-r--r--ext/zlib/tests/004.txt.gzbin0 -> 150 bytes
-rw-r--r--ext/zlib/tests/005.phpt72
-rw-r--r--ext/zlib/tests/006.phpt73
-rw-r--r--ext/zlib/tests/007.phpt51
-rw-r--r--ext/zlib/zlib.c81
-rw-r--r--ext/zlib/zlib_filter.c8
-rw-r--r--ext/zlib/zlib_fopen_wrapper.c4
-rw-r--r--generated_lists2
-rw-r--r--main/SAPI.c16
-rw-r--r--main/SAPI.h4
-rw-r--r--main/config.w32.h2
-rw-r--r--main/fopen_wrappers.c8
-rw-r--r--main/fopen_wrappers.h6
-rw-r--r--main/internal_functions.c.in4
-rw-r--r--main/internal_functions_nw.c4
-rw-r--r--main/internal_functions_win32.c4
-rw-r--r--main/logos.h8
-rw-r--r--main/main.c83
-rw-r--r--main/network.c33
-rw-r--r--main/php.h13
-rw-r--r--main/php_compat.h17
-rw-r--r--main/php_config.h.in115
-rw-r--r--main/php_globals.h4
-rw-r--r--main/php_ini.c40
-rw-r--r--main/php_logos.c8
-rw-r--r--main/php_logos.h4
-rw-r--r--main/php_memory_streams.h4
-rw-r--r--main/php_open_temporary_file.c16
-rw-r--r--main/php_variables.c28
-rw-r--r--main/php_variables.h5
-rw-r--r--main/php_version.h7
-rw-r--r--main/rfc1867.c145
-rw-r--r--main/rfc1867.h45
-rw-r--r--main/safe_mode.c8
-rw-r--r--main/safe_mode.h6
-rw-r--r--main/snprintf.c3
-rw-r--r--main/spprintf.c3
-rw-r--r--main/streams/filter.c8
-rw-r--r--main/streams/memory.c320
-rw-r--r--main/streams/php_streams_int.h11
-rw-r--r--main/streams/plain_wrapper.c56
-rwxr-xr-xmain/streams/streams.c47
-rw-r--r--main/streams/userspace.c36
-rw-r--r--main/streams/xp_socket.c11
-rw-r--r--main/win95nt.h4
-rwxr-xr-xmakedist2
-rw-r--r--pear/Makefile.frag2
-rw-r--r--pear/install-pear-nozlib.phar3137
-rw-r--r--php.ini-dist84
-rw-r--r--php.ini-recommended92
-rw-r--r--regex/regcomp.c5
-rwxr-xr-xrun-tests.php109
-rw-r--r--sapi/apache/mod_php5.c33
-rw-r--r--sapi/apache/php_apache.c5
-rw-r--r--sapi/apache2filter/apache_config.c2
-rwxr-xr-xsapi/apache2filter/config.w3235
-rw-r--r--sapi/apache2filter/php_apache.h11
-rw-r--r--sapi/apache2filter/sapi_apache2.c184
-rw-r--r--sapi/apache2handler/EXPERIMENTAL5
-rw-r--r--sapi/apache2handler/apache_config.c2
-rw-r--r--sapi/apache2handler/config.w3219
-rw-r--r--sapi/apache2handler/php_apache.h4
-rw-r--r--sapi/apache2handler/sapi_apache2.c30
-rw-r--r--sapi/apache_hooks/mod_php5.c18
-rw-r--r--sapi/apache_hooks/php_apache.c5
-rw-r--r--sapi/cgi/README.FastCGI21
-rw-r--r--sapi/cgi/cgi_main.c297
-rw-r--r--sapi/cgi/config.w326
-rw-r--r--sapi/cgi/config9.m47
-rw-r--r--sapi/cgi/fastcgi.c202
-rw-r--r--sapi/cgi/fastcgi.h61
-rw-r--r--sapi/cgi/libfcgi/LICENSE.TERMS28
-rw-r--r--sapi/cgi/libfcgi/acinclude.m4389
-rw-r--r--sapi/cgi/libfcgi/fcgi_stdio.c801
-rw-r--r--sapi/cgi/libfcgi/fcgiapp.c2323
-rw-r--r--sapi/cgi/libfcgi/include/fastcgi.h136
-rw-r--r--sapi/cgi/libfcgi/include/fcgi_config.h7
-rw-r--r--sapi/cgi/libfcgi/include/fcgi_config_win32.h108
-rw-r--r--sapi/cgi/libfcgi/include/fcgi_config_x86.h103
-rw-r--r--sapi/cgi/libfcgi/include/fcgi_stdio.h249
-rw-r--r--sapi/cgi/libfcgi/include/fcgiapp.h640
-rw-r--r--sapi/cgi/libfcgi/include/fcgiappmisc.h50
-rw-r--r--sapi/cgi/libfcgi/include/fcgimisc.h38
-rw-r--r--sapi/cgi/libfcgi/include/fcgio.h147
-rw-r--r--sapi/cgi/libfcgi/include/fcgios.h140
-rw-r--r--sapi/cgi/libfcgi/libfcgi.m477
-rw-r--r--sapi/cgi/libfcgi/os_unix.c1273
-rw-r--r--sapi/cgi/libfcgi/os_win32.c2067
-rw-r--r--sapi/cgi/libfcgi/strerror.c91
-rw-r--r--sapi/cli/config.w324
-rw-r--r--sapi/cli/php_cli.c208
-rw-r--r--sapi/nsapi/config.m424
-rw-r--r--sapi/nsapi/nsapi-readme.txt14
-rw-r--r--scripts/dev/check_parameters.php373
-rw-r--r--scripts/man1/php-config.1.in4
-rw-r--r--scripts/php-config.in7
-rwxr-xr-xtests/classes/abstract_by_interface_001.phpt33
-rwxr-xr-xtests/classes/abstract_by_interface_002.phpt33
-rw-r--r--tests/classes/abstract_static.phpt24
-rwxr-xr-xtests/classes/abstract_user_call.phpt30
-rwxr-xr-xtests/classes/ctor_in_interface_01.phpt19
-rwxr-xr-xtests/classes/ctor_in_interface_02.phpt35
-rwxr-xr-xtests/classes/ctor_in_interface_03.phpt23
-rwxr-xr-xtests/classes/ctor_in_interface_04.phpt26
-rwxr-xr-xtests/classes/ctor_visibility.phpt69
-rwxr-xr-xtests/classes/factory_and_singleton_003.phpt2
-rwxr-xr-xtests/classes/factory_and_singleton_004.phpt2
-rwxr-xr-xtests/classes/inheritance_003.phpt21
-rwxr-xr-xtests/classes/inheritance_004.phpt21
-rwxr-xr-xtests/classes/interface_construct.phpt24
-rwxr-xr-xtests/classes/interfaces_003.phpt13
-rw-r--r--tests/classes/tostring.phpt86
-rwxr-xr-xtests/classes/tostring_001.phpt130
-rwxr-xr-xtests/classes/tostring_002.phpt31
-rwxr-xr-xtests/classes/tostring_003.phpt33
-rw-r--r--tests/classes/type_hinting_001.phpt2
-rwxr-xr-xtests/classes/type_hinting_002.phpt3
-rwxr-xr-xtests/classes/type_hinting_003.phpt2
-rw-r--r--tests/lang/034.phpt4
-rw-r--r--tests/lang/bug22367.phpt131
-rw-r--r--tests/lang/bug24658.phpt2
-rwxr-xr-xtests/lang/bug38579.inc3
-rwxr-xr-xtests/lang/bug38579.phpt16
-rw-r--r--tests/lang/catchable_error_001.phpt22
-rw-r--r--tests/lang/catchable_error_002.phpt37
-rw-r--r--tests/lang/type_hints_001.phpt2
-rw-r--r--tests/lang/type_hints_002.phpt28
-rw-r--r--tests/lang/type_hints_003.phpt14
-rw-r--r--tests/run-test/test005.phpt2
-rw-r--r--tests/run-test/test008.phpt2
-rw-r--r--tests/run-test/test008a.phpt2
-rw-r--r--tests/run-test/test010.phpt17
-rw-r--r--win32/build/config.w328
-rw-r--r--win32/build/confutils.js16
-rw-r--r--win32/crypt_win32.c833
-rw-r--r--win32/crypt_win32.h35
-rw-r--r--win32/install.txt52
-rw-r--r--win32/installer/README93
-rw-r--r--win32/installer/gen-nsis.php446
-rw-r--r--win32/installer/setini.php87
-rw-r--r--win32/php5dllts.dsp530
-rw-r--r--win32/php5ts.dsp4
-rw-r--r--win32/registry.c59
1502 files changed, 126765 insertions, 70326 deletions
diff --git a/EXTENSIONS b/EXTENSIONS
index a14fae362..ba27483eb 100644
--- a/EXTENSIONS
+++ b/EXTENSIONS
@@ -229,7 +229,7 @@ STATUS: Working
SINCE: 5.0
-------------------------------------------------------------------------------
EXTENSION: simplexml
-PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
+PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.0
@@ -464,6 +464,11 @@ PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
+EXTENSION: reflection
+PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Johannes Schlüter <johannes@php.net>
+MAINTENANCE: Maintained
+STATUS: Working
+-------------------------------------------------------------------------------
EXTENSION: session
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>, Ilia Alshanetsky <iliaa@php.net>
MAINTENANCE: Maintained
diff --git a/INSTALL b/INSTALL
index 957b6fac4..aa4bdd163 100644
--- a/INSTALL
+++ b/INSTALL
@@ -15,7 +15,6 @@ Installing PHP
HP-UX specific installation notes
OpenBSD installation notes
Solaris specific installation tips
- Gentoo installation notes
Debian GNU/Linux installation notes
3. Installation on Mac OS X
@@ -60,9 +59,9 @@ Chapter 1. General Installation Considerations
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
+ * Websites and web applications (server-side scripting)
* Command line scripting
- * Client-side GUI applications
+ * Desktop (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
@@ -72,15 +71,15 @@ Chapter 1. General Installation Considerations
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.
+ In case of 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
@@ -996,111 +995,6 @@ Using Packages
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 \<apache-2
-# USE="-*" emerge php mod_php
-# ebuild /var/db/pkg/dev-php/mod_php-<your PHP version>/mod_php-<your PHP versi
-on>.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-<old version>.
- * 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".
- _________________________________________________________________
-
Debian GNU/Linux installation notes
This section contains notes and hints specific to installing PHP on
@@ -1135,7 +1029,7 @@ Using APT
versions of PHP 4 and PHP 5. To use it, just add the to following two
lines to your /etc/apt/sources.lists and run apt-get update :
- Example 2-10. The two Dotdeb related lines
+ Example 2-7. The two Dotdeb related lines
deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all
@@ -1147,7 +1041,7 @@ deb-src http://packages.dotdeb.org stable all
Now that everything is in place, you can use the following example to
install Apache and PHP:
- Example 2-11. Debian Install Example with Apache 1.3
+ Example 2-8. Debian Install Example with Apache 1.3
# apt-get install libapache-mod-php4
APT will automatically install the PHP 4 module for Apache 1.3, and
@@ -1155,7 +1049,7 @@ deb-src http://packages.dotdeb.org stable all
restart Apache during the install process, you'll have to do it
manually :
- Example 2-12. Stopping and starting Apache once PHP 4 is installed
+ Example 2-9. Stopping and starting Apache once PHP 4 is installed
# /etc/init.d/apache stop
# /etc/init.d/apache start
_________________________________________________________________
@@ -1171,7 +1065,7 @@ Better control on configuration
additional packages. They're all named 'php4-*' (or 'php5-*' if you
installed PHP 5 from a third party repository).
- Example 2-13. Getting the list of PHP additional packages
+ Example 2-10. Getting the list of PHP additional packages
# dpkg -l 'php4-*'
As you can see from the last output, there's a lot of PHP modules that
@@ -1183,13 +1077,13 @@ Better control on configuration
If you choose to add the MySQL, cURL and GD support to PHP the command
will look something like this:
- Example 2-14. Install PHP with MySQL, cURL and GD
+ Example 2-11. Install PHP with MySQL, cURL and GD
# apt-get install php4-mysql php4-curl php4-gd
APT will automatically add the appropriate lines to your different
php.ini (/etc/php4/apache/php.ini, /etc/php4/cgi/php.ini, etc).
- Example 2-15. These lines activate MySQL, cURL and GD into PHP
+ Example 2-12. These lines activate MySQL, cURL and GD into PHP
extension=mysql.so
extension=curl.so
extension=gd.so
@@ -1206,7 +1100,7 @@ Common Problems
line is present in your /etc/apache/httpd.conf file then
stop/start Apache:
- Example 2-16. This line activates PHP 4 into Apache
+ Example 2-13. This line activates PHP 4 into Apache
# Include /etc/apache/conf.d/
* If you installed an additional module and if its functions are not
@@ -1387,7 +1281,7 @@ $ cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/extname
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.
+ appropriate chapter.
_________________________________________________________________
PECL for Windows users
@@ -1446,6 +1340,14 @@ $ make
A successful install will have created extname.so and put it into the
PHP extensions directory. You'll need to and adjust php.ini and add an
extension=extname.so line before you can use the extension.
+
+ If the system is missing the phpize command, and precompiled packages
+ (like RPM's) are used, be sure to also install the appropriate devel
+ version of the PHP package as they often include the phpize command
+ along with the appropriate header files to build PHP and its
+ extensions.
+
+ Execute phpize --help to display additional usage information.
_________________________________________________________________
Compiling PECL extensions statically into PHP
@@ -1540,9 +1442,10 @@ The configuration file
* SAPI module specific location (PHPIniDir directive in Apache 2, -c
command line option in CGI and CLI, php_ini parameter in NSAPI,
PHP_INI_PATH environment variable in THTTPD)
+ * The PHPRC environment variable. Before PHP 5.2.0 this was checked
+ after the registry key mentioned below.
* HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath (Windows Registry
location)
- * The PHPRC environment variable
* Current working directory (for CLI)
* The web server's directory (for SAPI modules), or directory of PHP
(otherwise in Windows)
@@ -1686,9 +1589,7 @@ Chapter 7. Installation FAQ
is available for almost any OS (except maybe for MacOS before OSX),
and almost any web server.
- To install PHP, follow the instructions in the INSTALL file located in
- the distribution. Windows users should also read the install.txt file.
- There are also some helpful hints for Windows users here.
+ To install PHP, follow the instructions in Installing PHP.
1. Why shouldn't I use Apache2 with a threaded MPM in a production
environment?
diff --git a/Makefile.gcov b/Makefile.gcov
index 9dbf39adc..57018b60b 100644
--- a/Makefile.gcov
+++ b/Makefile.gcov
@@ -29,7 +29,7 @@ php_lcov.info: lcov-test
@rm -rf lcov_data/
@$(mkinstalldirs) lcov_data/
@echo
- -@find . -name \*.gcda -o -name \*.gcno -o -name \*.da | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | uniq | while read x; do \
+ -@find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | uniq | while read x; do \
echo -n . ;\
y=`echo $$x | sed -e 's!\.libs/!!'`; \
dir=lcov_data/`dirname $$x`; \
@@ -37,6 +37,9 @@ php_lcov.info: lcov-test
if test -f "$(top_srcdir)/$$y.c"; then \
ln -f -s $(top_srcdir)/$$y.c lcov_data/$$y.c; \
fi; \
+ if test -f "$(top_srcdir)/$$y.h"; then \
+ ln -f -s $(top_srcdir)/$$y.h lcov_data/$$y.h; \
+ fi; \
if test -f "$(top_srcdir)/$$y.re"; then \
ln -f -s $(top_srcdir)/$$y.re lcov_data/$$y.re; \
fi; \
@@ -46,6 +49,9 @@ php_lcov.info: lcov-test
if test -f "$(top_srcdir)/$$y.l"; then \
ln -f -s $(top_srcdir)/$$y.l lcov_data/$$y.l; \
fi; \
+ if test -f "$(top_srcdir)/$$y"; then \
+ ln -f -s $(top_srcdir)/$$y lcov_data/$$y; \
+ fi; \
if test -f "$(top_builddir)/$$y.c"; then \
ln -f -s $(top_builddir)/$$y.c lcov_data/$$y.c; \
fi; \
diff --git a/NEWS b/NEWS
index 44f080a8e..cbce558fa 100644
--- a/NEWS
+++ b/NEWS
@@ -1,45 +1,499 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-24 Aug 2006, PHP 5.1.6
-- Fixed memory_limit on 64bit systems. (Stefan E.)
-- Fixed bug #38488 (Access to "php://stdin" and family crashes PHP on win32).
+02 Nov 2006, PHP 5.2.0
+- Updated bundled OpenSSL to version 0.9.8d in the Windows distro. (Edin)
+- Updated Postgresql client libraries to 8.1.4 in the Windows distro. (Edin)
+- Updated PCRE to version 6.7. (Ilia)
+- Updated libsqlite in ext/pdo_sqlite to 3.3.7. (Ilia)
+- Updated bundled MySQL client library to version 5.0.22 in the Windows
+ distribution. (Edin)
+- Updated timezonedb to version 2006.7. (Derick)
+
+- Added ability to make SOAP call userspace PHP<->XML converters. (Dmitry)
+- Added support for character sets in pg_escape_string() for PostgreSQL 8.1.4
+ and higher. (Ilia)
+- Added support for character sets in PDO quote() method for PostgreSQL 8.1.4
+ and higher. (Ilia)
+- Added DSA key generation support to openssl_pkey_new(), FR #38731 (marci
+ at balabit dot hu, Tony)
+- Added SoapServer::setObject() method (it is a simplified version of
+ SoapServer::setClass() method). (Dmitry)
+- Added support for hexadecimal entity in imagettftext() for the bundled GD.
+ (Pierre)
+- Added support for httpOnly flag for session extension and cookie setting
+ functions. (Scott MacVicar, Ilia)
+- Added version specific registry keys to allow different configurations for
+ different php version. (Richard, Dmitry)
+- Added "PHPINIDir" Apache directive to apache and apache_hooks SAPIs.
(Dmitry)
+- Added an optional boolean parameter to memory_get_usage() and
+ memory_get_peak_usage() to get memory size allocated by emalloc() or real
+ size of memory allocated from system. (Dmitry)
+- Added Zip Archive extension. (Pierre)
+- Added RFC1867 fileupload processing hook. (Stefan E.)
+- Added JSON and Filter extensions. (Derick, Rasmus)
+- Added error messages to disk_free_space() and disk_total_space() functions.
+ FR #37971 (Tony)
+- Added PATHINFO_FILENAME option to pathinfo() to get the filename.
+ (Toby S. and Christian S.)
+- Added array_fill_keys() function. (Marcus, Matt Wilmas)
+- Added posix_initgroups() function. (Ilia)
+- Added an optional parameter to parse_url() to allow retrieval of distinct
+ URL components. (Ilia)
+- Added optional parameter to http_build_query() to allow specification of
+ string separator. (Ilia)
+- Added image_type_to_extension() function. (Hannes, Ilia)
+- Added allow_url_include ini directive to complement allow_url_fopen. (Rasmus)
+- Added automatic module globals management. (Dmitry)
+- Added RFC2397 (data: stream) support. (Marcus)
+- Added new error mode E_RECOVERABLE_ERROR. (Derick, Marcus, Tony)
+- Added support for getenv() input filtering. (Rasmus)
+- Added support for constructors in interfaces to force constructor signature
+ checks in implementations. (Marcus)
+- Added memory_get_peak_usage() function for retrieving peak memory usage of
+ a PHP script. (Ilia)
+- Added pg_field_table() function. (Edin)
+- Added SimpleXMLElement::saveXML() as an alias for SimpleXMLElement::asXML().
+ (Hannes)
+- Added DOMNode::getNodePath() for getting an XPath for a node. (Christian)
+- Added gmp_nextprime() function. (ants dot aasma at gmail dot com, Tony)
+- Added error_get_last() function. (Mike)
+
+- Removed current working directory from the php.ini search path for CLI and
+ re-added it for other SAPIs (restore to pre 5.1.x behavior). (Edin)
+- Moved extensions to PECL:
+ . ext/filepro (Derick, Tony)
+ . ext/hwapi (Derick, Tony)
+- Disabled CURLOPT_FOLLOWLOCATION in curl when open_basedir or
+ safe_mode are enabled. (Stefan E., Ilia)
+
+- Increased default memory limit to 16 megabytes to accommodate for a more
+ accurate memory utilization measurement.
+- In addition to path to php.ini, PHPRC now may specify full file name.
+ (Dmitry)
+
+- Optimized array/HashTable copying. (Matt Wilmas, Dmitry)
+- Optimized zend_try/zend_catch macros by eliminating memcpy(3). (Dmitry)
+- Optimized require_once() and include_once() by eliminating fopen(3) on
+ second usage. (Dmitry)
+- Optimized request shutdown sequence. Restoring ini directives now iterates
+ only over modified directives instead of all. (Dmitry)
+
+- Changed priority of PHPRC environment variable on win32 to be higher then
+ value from registry. (Dmitry)
+- Changed __toString() to be called wherever applicable. (Marcus)
+- Changed E_ALL error reporting mode to include E_RECOVERABLE_ERROR. (Marcus)
+- Changed realpath cache to be disabled when "open_basedir" or "safe_mode"
+ are enabled on per-request basis. (Ilia)
-17 Aug 2006, PHP 5.1.5
+- Improved SNMP extension: (Jani)
+ . Renamed snmp_set_oid_numeric_print() to snmp_set_oid_output_format().
+ . Added 2 new constants: SNMP_OID_OUTPUT_FULL and SNMP_OID_OUTPUT_NUMERIC
+ . Fixed bug #37564 (AES privacy encryption not possible due to net-snmp 5.2
+ compatibility issue). (Patch: scott dot moynes+php at gmail dot com)
+- Improved OpenSSL extension: (Pierre)
+ . Added support for all supported algorithms in openssl_verify
+ . Added openssl_pkey_get_details, returns the details of a key
+ . Added x509 v3 extensions support
+ . Added openssl_csr_get_subject() and openssl_csr_get_public_key()
+ . Added 3 new constants OPENSSL_VERSION_TEXT and OPENSSL_VERSION_NUMBER and
+ OPENSSL_KEYTYPE_EC
+- Improved the Zend memory manager: (Dmitry)
+ . Removed unnecessary "--disable-zend-memory-manager" configure option.
+ . Added "--enable-malloc-mm" configure option which is enabled by default in
+ debug builds to allow using internal and external memory debuggers.
+ . Allow tweaking the memory manager with ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE
+ environment variables.
+ . For more information: Zend/README.ZEND_MM
+- Improved safe_mode check for the error_log() function. (Ilia)
+- Improved the error reporting in SOAP extension on request failure. (Ilia)
+- Improved crypt() on win32 to be about 10 times faster and to have friendlier
+ license. (Frank, Dmitry)
+- Improved performance of the implode() function on associated arrays. (Ilia)
+- Improved performance of str_replace() when doing 1 char to 1 char or 1 char
+ to many chars replacement. (Ilia)
+- Improved apache2filter SAPI:
+ . Allowed PHP to be an arbitrary filter in the chain and read the script from
+ the Apache stream. (John)
+ . Added support for apache2filter in the Windows build including binary
+ support for both Apache 2.0.x (php5apache2_filter.dll) and Apache 2.2.x
+ (php5apache2_2_filter.dll). (Edin)
+- Improved apache2handler SAPI:
+ . Changed ap_set_content_type() to be called only once. (Mike)
+ . Added support for Apache 2.2 handler in the Windows distribution. (Edin)
+- Improved FastCGI SAPI: (Dmitry)
+ . Removed source compatibility with libfcgi.
+ . Optimized access to FastCGI environment variables by using HashTable
+ instead of linear search.
+ . Allowed PHP_FCGI_MAX_REQUESTS=0 that assumes no limit.
+ . Allowed PHP_FCGI_CHILDREN=0 that assumes no worker children. (FastCGI
+ requests are handled by main process itself)
+- Improved CURL:
+ . Added control character checks for "open_basedir" and "safe_mode" checks.
+ (Ilia)
+ . Added implementation of curl_multi_info_read(). (Brian)
+- Improved PCRE: (Andrei)
+ . Added run-time configurable backtracking/recursion limits.
+ . Added preg_last_error(). (Andrei)
+- Improved PDO:
+ . Added new attribute ATTR_DEFAULT_FETCH_MODE. (Pierre)
+ . Added FETCH_PROPS_LATE. (Marcus)
+- Improved SPL: (Marcus)
+ . Made most iterator code exception safe.
+ . Added RegExIterator and RecursiveRegExIterator.
+ . Added full caching support and ArrayAccess to CachingIterator.
+ . Added array functions to ArrayObject/ArrayIterator and made them faster.
+ . Added support for reading csv and skipping empty lines in SplFileObject.
+ . Added CachingIterator::TOSTRING_USE_INNER, calls inner iterator __toString.
+ . Added ability to set the CSV separator per SplFileObject.
+- Improved xmlReader: (Rob)
+ . Added readInnerXml(), xmlReader::setSchema().
+ . Added readInnerXML(), readOuterXML(), readString(), setSchema(). (2.6.20+)
+ . Changed to passing libxml options when loading reader.
+
+- Fixed invalid read in imagecreatefrompng when an empty file is given
+ (Pierre, Tony)
+- Fixed infinite loop when a wrong color index is given to imagefill (Pierre)
+- Fixed mess with CGI/CLI -d option (now it works with cgi; constants are
+ working exactly like in php.ini; with FastCGI -d affects all requests).
+ (Dmitry)
+- Fixed missing open_basedir check inside chdir() function. (Ilia)
- Fixed overflow on 64bit systems in str_repeat() and wordwrap(). (Stefan E.)
-- Disabled CURLOPT_FOLLOWLOCATION in curl when open_basedir or safe_mode are
- enabled. (Stefan E., Ilia)
+- Fixed XSLTProcessor::importStylesheet() to return TRUE on success
+ (Christian)
+- Fixed leaks in openssl_csr_sign and openssl_csr_new (Pierre)
+- Fixed phpinfo() cutoff of variables at \0. (Ilia)
+- Fixed a bug in the filter extension that prevented magic_quotes_gpc from
+ being applied when RAW filter is used. (Ilia)
+- Fixed memory leaks in openssl streams context options. (Pierre)
+- Fixed handling of extremely long paths inside tempnam() function. (Ilia)
+- Fixed bug #39304 (Segmentation fault with list unpacking of string offset).
+ (Dmitry)
+- Fixed bug #39192 (Not including nsapi.h properly with SJSWS 7). This will
+ make PHP 5.2 compatible to new Sun Webserver. (Uwe)
+- Fixed bug #39140 (Uncaught exception may cause crash). (Dmitry)
+- Fixed bug #39125 (Memleak when reflecting non-existing class/method). (Tony)
+- Fixed bug #39067 (getDeclaringClass() and private properties). (Tony)
+- Fixed bug #39039 (SSL: fatal protocol error when fetching HTTPS from servers
+ running Google web server). (Ilia)
+- Fixed bug #39035 (Compatibility issue between DOM and
+ zend.ze1_compatibility_mode). (Rob)
+- Fixed bug #39034 (curl_exec() with return transfer returns TRUE on empty
+ files). (Ilia)
+- Fixed bug #39032 (strcspn() stops on null character). (Tony)
+- Fixed bug #39020 (PHP in FastCGI server mode crashes). (Dmitry)
+- Fixed bug #39017 (foreach(($obj = new myClass) as $v); echo $obj;
+ segfaults). (Dmitry)
+- Fixed bug #39004 (Fixed generation of config.nice with autoconf 2.60). (Ilia)
+- Fixed bug #39003 (__autoload() is called for type hinting). (Dmitry, Tony)
+- Fixed bug #39001 (ReflectionProperty returns incorrect declaring class for
+ protected properties). (Tony)
+- Fixed bug #38996 (PDO_MYSQL doesn't check connections for liveness). (Tony)
+- Fixed bug #38993 (Fixed safe_mode/open_basedir checks for session.save_path,
+ allowing them to account for extra parameters). (Ilia)
+- Fixed bug #38989 (Absolute path with slash at beginning doesn't work on win).
+ (Dmitry)
+- Fixed bug #38985 (Can't cast COM objects). (Wez)
+- Fixed bug #38981 (using FTP URLs in get_headers() causes crash). (Tony)
+- Fixed bug #38963 (Fixed a possible open_basedir bypass in tempnam()). (Ilia)
+- Fixed bug #38961 (metaphone() results in segmentation fault on NetBSD).
+ (Tony)
+- Fixed bug #38949 (Cannot get xmlns value attribute). (Rob)
+- Fixed bug #38942 (Double old-style-ctor inheritance). (Dmitry)
+- Fixed bug #38941 (imap extension does not compile against new version of the
+ imap library). (Ilia)
+- Fixed bug #38934 (move_uploaded_file() cannot read uploaded file outside of
+ open_basedir). (Ilia)
+- Fixed bug #38904 (apache2filter changes cwd to /). (Ilia, Hannes)
+- Fixed bug #38891 (get_headers() do not work with curl-wrappers). (Ilia)
+- Fixed bug #38882 (ldap_connect causes segfault with newer versions of
+ OpenLDAP). (Tony)
+- Fixed bug #38859 (parse_url() fails if passing '@' in passwd). (Tony)
+- Fixed bug #38850 (lookupNamespaceURI doesn't return default namespace). (Rob)
+- Fixed bug #38844 (curl_easy_strerror() is defined only since cURL 7.12.0).
+ (Tony)
+- Fixed bug #38813 (DOMEntityReference->__construct crashes when called
+ explicitly). (Rob)
+- Fixed bug #38808 ("maybe ref" issue for current() and others). (Dmitry)
+- Fixed bug #38779 (engine crashes when require()'ing file with syntax error
+ through userspace stream wrapper). (Tony, Dmitry)
+- Fixed bug #38772 (inconsistent overriding of methods in different visibility
+ contexts). (Dmitry)
+- Fixed bug #38759 (PDO sqlite2 empty query causes segfault). (Tony)
+- Fixed bug #38721 (Invalid memory read in date_parse()). (Tony, Derick)
+- Fixed bug #38700 (SoapClient::__getTypes never returns). (Dmitry)
+- Fixed bug #38693 (curl_multi_add_handle() set curl handle to null). (Ilia)
+- Fixed bug #38687 (sockaddr local storage insufficient for all sock families).
+ (Sara)
+- Fixed bug #38661 (mixed-case URL breaks url-wrappers). (Ilia)
+- Fixed bug #38653 (memory leak in ReflectionClass::getConstant()). (Tony)
+- Fixed bug #38649 (uninit'd optional arg in stream_socket_sendto()). (Sara)
+- Fixed bug #38637 (curl_copy_handle() fails to fully copy the cURL handle).
+ (Tony, Ilia)
+- Fixed bug #38624 (Strange warning when incrementing an object property and
+ exception is thrown from __get method). (Tony)
+- Fixed bug #38623 (leaks in a tricky code with switch() and exceptions).
+ (Dmitry)
+- Fixed bug #38579 (include_once() may include the same file twice). (Dmitry)
+- Fixed bug #38574 (missing curl constants and improper constant detection).
+ (Ilia)
+- Fixed bug #38543 (shutdown_executor() may segfault when memory_limit is too
+ low). (Dmitry)
+- Fixed bug #38535 (memory corruption in pdo_pgsql driver on error retrieval
+ inside a failed query executed via query() method). (Ilia)
+- Fixed bug #38534 (segfault when calling setlocale() in userspace session
+ handler). (Tony)
+- Fixed bug #38524 (strptime() does not initialize the internal date storage
+ structure). (Ilia)
+- Fixed bug #38511, #38473, #38263 (Fixed session extension request shutdown
+ order to ensure it is shutdown before the extensions it may depend on).
+ (Ilia)
+- Fixed bug #38488 (Access to "php://stdin" and family crashes PHP on win32).
+ (Dmitry)
+- Fixed bug #38474 (getAttribute select attribute by order, even when
+ prefixed). (Rob)
+- Fixed bug #38467 (--enable-versioning causes make fail on OS X). (Tony)
+- Fixed bug #38465 (ReflectionParameter fails if default value is an access
+ to self::). (Johannes)
+- Fixed bug #38464 (array_count_values() mishandles numeric strings).
+ (Matt Wilmas, Ilia)
+- Fixed bug #38461 (setting private attribute with __set() produces
+ segfault). (Tony)
+- Fixed bug #38458, PECL bug #8944, PECL bug #7775 (error retrieving columns
+ after long/text columns with PDO_ODBC). (Wez)
+- Fixed bug #38454 (warning upon disabling handler via
+ xml_set_element_handler). (dtorop933 at gmail dot com, Rob)
+- Fixed bug #38451 (PDO_MYSQL doesn't compile on Solaris). (Tony)
+- Fixed bug #38450 (constructor is not called for classes used in userspace
+ stream wrappers). (Tony)
+- Fixed bug #38438 (DOMNodeList->item(0) segfault on empty NodeList). (Ilia)
+- Fixed bug #38431 (xmlrpc_get_type() crashes PHP on objects). (Tony)
+- Fixed bug #38427 (unicode causes xml_parser to misbehave). (Rob)
+- Fixed bug #38424 (Different attribute assignment if new or existing). (Rob)
+- Fixed bug #38400 (Use of com.typelib_file may cause a crash). (Ilia)
+- Fixed bug #38394 (PDO fails to recover from failed prepared statement
+ execution). (Ilia)
+- Fixed bug #38377 (session_destroy() gives warning after
+ session_regenerate_id()). (Ilia)
+- Implemented #38357 (dbase_open can't open DBase 3 dbf file).
+ (rodrigo at fabricadeideias dot com, Mike)
+- Fixed bug #38354 (Unwanted reformatting of XML when using AsXML). (Christian)
+- Fixed bug #38347 (Segmentation fault when using foreach with an unknown/empty
+ SimpleXMLElement). (Tony)
- Fixed bug #38322 (reading past array in sscanf() leads to arbitrary code
execution). (Tony)
+- Fixed bug #38315 (Constructing in the destructor causes weird behavior).
+ (Dmitry)
+- Fixed bug #38303 (spl_autoload_register() suppress all errors silently).
+ (Ilia)
+- Fixed bug #38290 (configure script ignores --without-cdb,inifile,flatfile).
+ (Marcus)
+- Fixed bug #38289 (segfault in session_decode() when _SESSION is NULL).
+ (Tony)
+- Fixed bug #38287 (static variables mess up global vars). (Dmitry)
+- Fixed bug #38278 (session_cache_expire()'s value does not match phpinfo's
+ session.cache_expire). (Tony)
+- Fixed bug #38276 (file_exists() works incorrectly with long filenames
+ on Windows). (Ilia, Tony)
+- Fixed bug #38269 (fopen wrapper doesn't fail on invalid hostname with
+ curlwrappers enabled). (Tony)
+- Fixed bug #38265 (heap corruption). (Dmitry)
+- Fixed bug #38261 (openssl_x509_parse() leaks with invalid cert) (Pierre)
+- Fixed bug #38255 (openssl possible leaks while passing keys) (Pierre)
+- Fixed bug #38253 (PDO produces segfault with default fetch mode). (Tony)
+- Fixed bug #38251 (socket_select() and invalid arguments). (Tony)
+- Fixed bug #38236 (Binary data gets corrupted on multipart/formdata POST).
+ (Ilia)
+- Fixed bug #38234 (Exception in __clone makes memory leak). (Dmitry, Nuno)
+- Fixed bug #38229 (strtotime() does not parse YYYY-MM format). (Ilia)
+- Fixed bug #38224 (session extension can't handle broken cookies). (Ilia)
+- Fixed bug #38220 (Crash on some object operations). (Dmitry)
+- Fixed bug #38217 (ReflectionClass::newInstanceArgs() tries to allocate too
+ much memory). (Tony)
+- Fixed bug #38214 (gif interlace output cannot work). (Pierre)
+- Fixed bug #38213, #37611, #37571 (wddx encoding fails to handle certain
+ characters). (Ilia)
+- Fixed bug #38212 (Segfault on invalid imagecreatefromgd2part() parameters).
+ (Pierre)
+- Fixed bug #38211 (variable name and cookie name match breaks script
+ execution). (Dmitry)
+- Fixed bug #38199 (fclose() unable to close STDOUT and STDERR). (Tony)
+- Fixed bug #38198 (possible crash when COM reports an exception). (Ilia)
+- Fixed bug #38194 (ReflectionClass::isSubclassOf() returns TRUE for the
+ class itself). (Ilia)
+- Fixed bug #38183 (disable_classes=Foobar causes disabled class to be
+ called Foo). (Jani)
+- Fixed bug #38179 (imagecopy from a palette to a truecolor image loose alpha
+ channel) (Pierre)
+- Fixed bug #38173 (Freeing nested cursors causes OCI8 to segfault). (Tony)
+- Fixed bug #38168 (Crash in pdo_pgsql on missing bound parameters). (Ilia)
+- Fixed bug #38161 (oci_bind_by_name() returns garbage when Oracle didn't set
+ the variable). (Tony)
+- Fixed bug #38146 (Cannot use array returned from foo::__get('bar') in write
+ context). (Dmitry)
+- Fixed bug #38132 (ReflectionClass::getStaticProperties() retains \0 in key
+ names). (Ilia)
- Fixed bug #38125 (undefined reference to spl_dual_it_free_storage). (Marcus)
- Fixed bug #38112 (corrupted gif segfaults) (Pierre)
+- Fixed bug #38096 (large timeout values ignored on 32bit machines in
+ stream_socket_accept() and stream_socket_client()). (Ilia)
+- Fixed bug #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger
+ than the actual length). (Tony)
+- Fixed bug #38072 (boolean arg for mysqli_autocommit() is always true on
+ Solaris). (Tony)
+- Fixed bug #38067 (Parameters are not decoded from utf-8 when using encoding
+ option). (Dmitry)
+- Fixed bug #38064 (ignored constructor visibility). (Marcus)
+- Fixed bug #38055 (Wrong interpretation of boolean parameters). (Dmitry)
+- Fixed bug #38047 ("file" and "line" sometimes not set in backtrace from
+ inside error handler). (Dmitry)
+- Fixed bug #38019 (segfault extending mysqli class). (Dmitry)
+- Fixed bug #38005 (SoapFault faultstring doesn't follow encoding rules).
+ (Dmitry)
+- Fixed bug #38004 (Parameters in SoapServer are decoded twice). (Dmitry)
+- Fixed bug #38003 (in classes inherited from MySQLi it's possible to call
+ private constructors from invalid context). (Tony)
+- Fixed bug #37987 (invalid return of file_exists() in safe mode). (Ilia)
+- Fixed bug #37947 (zend_ptr_stack reallocation problem). (Dmitry)
+- Fixed bug #37945 (pathinfo() cannot handle argument with special characters
+ like German "Umlaut"). (Mike)
+- Fixed bug #37931 (possible crash in OCI8 after database restart
+ when using persistent connections). (Tony)
+- Fixed bug #37923 (Display constant value in reflection::export). (Johannes)
+- Fixed bug #37920 (compilation problems on z/OS). (Tony)
+- Fixed bug #37870 (pgo_pgsql tries to de-allocate unused statements).
+ (Ilia, ce at netage dot bg)
+- Fixed bug #37864 (file_get_contents() leaks on empty file). (Hannes)
+- Fixed bug #37862 (Integer pointer comparison to numeric value).
+ (bugs-php at thewrittenword dot com)
+- Fixed bug #37846 (wordwrap() wraps incorrectly). (ddk at krasn dot ru, Tony)
+- Fixed bug #37816 (ReflectionProperty does not throw exception when accessing
+ protected attribute). (Marcus)
+- Fixed bug #37811 (define not using toString on objects). (Marcus)
+- Fixed bug #37807 (segmentation fault during SOAP schema import). (Tony)
+- Fixed bug #37806 (weird behavior of object type and comparison). (Marcus)
+- Fixed bug #37780 (memory leak trying to execute a non existing file (CLI)).
+ (Mike)
+- Fixed bug #37779 (empty include_path leads to search for files inside /).
+ (jr at terragate dot net, Ilia)
+- Fixed bug #37747 (strtotime segfaults when given "nextyear"). (Derick)
+- Fixed bug #37720 (merge_php_config scrambles values).
+ (Mike, pumuckel at metropolis dot de)
+- Fixed bug #37709 (Possible crash in PDO::errorCode()). (Ilia)
+- Fixed bug #37707 (clone without assigning leaks memory). (Ilia, Nuno, Dmitri)
+- Fixed bug #37705 (Semaphore constants not available). (Ilia)
+- Fixed bug #37671 (MySQLi extension fails to recognize BIT column). (Ilia)
+- Fixed bug #37667 (Object is not added into array returned by __get). (Marcus)
+- Fixed bug #37635 (parameter of pcntl signal handler is trashed). (Mike)
+- Fixed bug #37632 (Protected method access problem). (Marcus)
+- Fixed bug #37630 (MySQL extensions should link against thread safe client
+ libs if built with ZTS). (Mike)
+- Fixed bug #37620 (mysqli_ssl_set validation is inappropriate). (Georg)
+- Fixed bug #37616 (DATE_RFC822 does not product RFC 822 dates).
+ (Hannes Magnusson, Derick)
+- Fixed bug #37614 (Class name lowercased in error message). (Johannes)
- Fixed bug #37587 (var without attribute causes segfault). (Marcus)
-- Fixed bug #37576 (FastCGI env (cgi vars) table overflow). (Piotr)
+- Fixed bug #37586 (Bumped minimum PCRE version to 6.6, needed for recursion
+ limit support). (Ilia)
+- Fixed bug #37581 (oci_bind_array_by_name clobbers input array when using
+ SQLT_AFC, AVC). (Tony)
+- Fixed bug #37569 (WDDX incorrectly encodes high-ascii characters). (Ilia)
+- Fixed bug #37565 (Using reflection::export with simplexml causing a crash).
+ (Marcus)
+- Fixed bug #37564 (AES privacy encryption not possible due to net-snmp 5.2
+ compatibility issue). (Jani, patch by scott dot moynes+php at gmail dot com)
+- Fixed bug #37563 (array_key_exists performance is poor for &$array). (Ilia)
+- Fixed bug #37558 (timeout functionality doesn't work after a second PHP
+ start-up on the same thread). (p dot desarnaud at wanadoo dot fr)
+- Fixed bug #37531 (oci8 persistent connection corruption). (Tony)
+- Fixed bug #37523 (namespaces added too late, leads to missing xsi:type
+ attributes. Incompatibility with libxml2-2.6.24). (Dmitry)
+- Fixed bug #37514 (strtotime doesn't assume year correctly). (Derick)
+- Fixed bug #37510 (session_regenerate_id changes session_id() even on
+ failure). (Hannes)
+- Fixed bug #37505 (touch() truncates large files). (Ilia)
+- Fixed bug #37499 (CLI segmentation faults during cleanup with sybase-ct
+ extension enabled). (Tony)
- Fixed bug #37496 (FastCGI output buffer overrun). (Piotr, Dmitry)
-- Fixed bug #37487 (oci_fetch_array() array-type should always default to
+- Fixed bug #37487 (oci_fetch_array() array-type should always default to
OCI_BOTH). (Tony)
-- Fixed bug #37416 (iterator_to_array() hides exceptions thrown in rewind()
- method). (Tony)
-- Fixed bug #37392 (Unnecessary call to OCITransRollback() at the end of
+- Fixed bug #37457 (Crash when an exception is thrown in accept() method of
+ FilterIterator). (Marcus)
+- Fixed bug #37456 (DOMElement->setAttribute() loops forever). (Rob)
+- Fixed bug #37445 (Fixed crash in pdo_mysql resulting from premature object
+ destruction). (Ilia)
+- Fixed bug #37428 (PHP crashes on windows if there are start-up errors and
+ event log is used for logging them). (Edin)
+- Fixed bug #37418 (tidy module crashes on shutdown). (Tony)
+- Fixed bug #37416 (iterator_to_array() hides exceptions thrown in rewind()
+ method). (Tony)
+- Fixed bug #37413 (Rejected versions of flex that don't work). (Ilia)
+- Fixed bug #37395 (recursive mkdir() fails to create nonexistent directories
+ in root dir). (Tony)
+- Fixed bug #37394 (substr_compare() returns an error when offset equals
+ string length). (Ilia)
+- Fixed bug #37392 (Unnecessary call to OCITransRollback() at the end of
request). (Tony)
-- Fixed bug #37341 ($_SERVER in included file is shortened to two entries,
+- Fixed bug #37376 (fastcgi.c compile fail with gcc 2.95.4). (Ilia)
+- Fixed bug #37368 (Incorrect timestamp returned for strtotime()). (Derick)
+- Fixed bug #37363 (PDO_MYSQL does not build if no other mysql extension is
+ enabled). (Mike)
+- Fixed bug #37348 (make PEAR install ignore open_basedir). (Ilia)
+- Fixed bug #37341 ($_SERVER in included file is shortened to two entries,
if $_ENV gets used). (Dmitry)
- Fixed bug #37313 (sigemptyset() used without including <signal.h>).
(jdolecek)
-- Fixed bug #37346 (invalid colormap format) (Pierre)
-- Fixed bug #37360 (invalid gif size) (Pierre)
- Fixed bug #37306 (max_execution_time = max_input_time). (Dmitry)
-- Fixed Bug #37278 (SOAP not respecting uri in __soapCall). (Dmitry)
-- Fixed bug #37265 (Added missing safe_mode & open_basedir checks to
+- Fixed bug #37278 (SOAP not respecting uri in __soapCall). (Dmitry)
+- Fixed bug #37265 (Added missing safe_mode & open_basedir checks to
imap_body()). (Ilia)
-- Fixed bug #37256 (php-fastcgi dosen't handle connection abort). (Dmitry)
+- Fixed bug #37262 (var_export() does not escape \0 character). (Ilia)
+- Fixed bug #37256 (php-fastcgi doesn't handle connection abort). (Dmitry)
+- Fixed bug #37244 (Added strict flag to base64_decode() that enforces
+ RFC3548 compliance). (Ilia)
+- Fixed bug #37144 (PHP crashes trying to assign into property of dead object).
+ (Dmitry)
+- Fixed bug #36949 (invalid internal mysqli objects dtor). (Mike)
+- Implement #36732 (req/x509 extensions support for openssl_csr_new and
+ openssl_csr_sign) (ben at psc dot edu, Pierre)
+- Fixed bug #36759 (Objects destructors are invoked in wrong order when script
+ is finished). (Dmitry)
+- Fixed bug #36681 (pdo_pgsql driver incorrectly ignored some errors).
+ (Wez, Ilia)
+- Fixed bug #36630 (umask not reset at the end of the request). (Ilia)
+- Fixed bug #36515 (Unlinking buckets from non-existent brigades). (Sara)
+- Fixed bug #35973 (Error ORA-24806 occurs when trying to fetch a NCLOB
+ field). (Tony)
+- Fixed bug #35886 (file_get_contents() fails with some combinations of
+ offset & maxlen). (Nuno)
+- Fixed bug #35512 (Lack of read permission on main script results in
+ E_WARNING rather then E_ERROR). (Ilia)
+- Fixed bug #34180 (--with-curlwrappers causes PHP to disregard some HTTP
+ stream context options). (Mike)
+- Fixed bug #34066 (recursive array_walk causes segfault). (Tony)
+- Fixed bug #34065 (throw in foreach causes memory leaks). (Dmitry)
+- Fixed bug #34005 (oci_password_change() fails).
+ (pholdaway at technocom-wireless dot com, Tony)
+- Fixed bug #33895 (Missing math constants). (Hannes)
+- Fixed bug #33770 (https:// or ftps:// do not work when --with-curlwrappers
+ is used and ssl certificate is not verifiable). (Ilia)
+- Fixed bug #29538 (number_format and problem with 0). (Matt Wilmas)
+- Implement #28382 (openssl_x509_parse() extensions support) (Pierre)
+- Fixed PECL bug #9061 (oci8 might reuse wrong persistent connection). (Tony)
+- Fixed PECL bug #8816 (issue in php_oci_statement_fetch with more than one
+ piecewise column) (jeff at badtz-maru dot com, Tony)
+- Fixed PECL bug #8112 (OCI8 persistent connections misbehave when Apache
+ process times out). (Tony)
+- Fixed PECL bug #7755 (error selecting DOUBLE fields with PDO_ODBC).
+ ("slaws", Wez)
+
04 May 2006, PHP 5.1.4
- Added "capture_peer_cert" and "capture_peer_cert_chain" context options
for SSL streams. (Wez).
- Added PDO::PARAM_EVT_* family of constants. (Sara)
- Fixed possible crash in highlight_string(). (Dmitry)
-- Fixed bug #37291 (FastCGI now longer works with isapi_fcgi.dll). (Dmitry)
+- Fixed bug #37291 (FastCGI no longer works with isapi_fcgi.dll). (Dmitry)
- Fixed bug #37277 (cloning Dom Documents or Nodes does not work). (Rob)
- Fixed bug #37276 (problems with $_POST array). (Dmitry)
- Fixed bug #36632 (bad error reporting for pdo_odbc exec UPDATE). (Wez).
diff --git a/README.PARAMETER_PARSING_API b/README.PARAMETER_PARSING_API
index a051723b5..a4c73e54e 100644
--- a/README.PARAMETER_PARSING_API
+++ b/README.PARAMETER_PARSING_API
@@ -31,14 +31,17 @@ 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
+ b - boolean, stored in zend_bool
+ d - double
+ f - function or array containing php method call info (returned as
+ zend_fcall_info* and zend_fcall_info_cache*)
+ h - array (returned as HashTable*)
+ l - long
o - object (of any type)
O - object (of specific type, specified by class entry)
+ r - resource (stored in zval)
+ s - string (with possible null bytes) and its length
z - the actual zval
The following characters also have a meaning in the specifier string:
diff --git a/README.UPDATE_5_2 b/README.UPDATE_5_2
new file mode 100644
index 000000000..bdb474a00
--- /dev/null
+++ b/README.UPDATE_5_2
@@ -0,0 +1,892 @@
+PHP 5.2 UPDATE INFO
+
+===============================
+Changes in PHP datetime support
+===============================
+
+Since PHP 5.1, there has been an extension named 'date' in the PHP core. This
+is the new implementation of PHP's datetime support. Although it will attempt
+to guess your system's timezone setting, you should set the timezone manually.
+You can do this in any of three ways:
+
+1) in your php.ini using the date.timezone INI directive
+2) on your system using the TZ environmental variable
+3) from your script using the convenience function date_default_timezone_set()
+
+All supported timezones are listed in the PHP Manual at
+http://www.php.net/manual/timezones.php.
+
+With the advent of PHP 5.2, there are object representations of the date and
+timezone, named DateTime and DateTimeZone respectively. You can see the methods
+and constants available to the new classes by running
+
+php --rc DateTime
+php --rc DateTimeZone
+
+under PHP CLI - or see the PHP Manual under Date/Time functions, or the 'NEW
+FEATURES' section below. All methods map to existing procedural date functions.
+
+==================================
+Items from the NEWS file explained
+==================================
+
+- Added new error mode E_RECOVERABLE_ERROR. (Derick, Marcus, Tony)
+
+ Some of the existing E_ERROR conditions have been converted to something that
+ you can catch with a user-defined error handler. If an E_RECOVERABLE_ERROR is
+ not handled, it will behave in the same way as E_ERROR behaves in all versions
+ of PHP. Errors of this type are logged as 'Catchable fatal error'.
+
+
+- Changed E_ALL error reporting mode to include E_RECOVERABLE_ERROR. (Marcus)
+
+ This change means that the value of the E_ALL error_reporting constant is now
+ 6143, where the previous value was 2047. If you are setting the error_reporting
+ mode from either the Apache config file or the .htaccess files, you will need
+ to adjust the value accordingly. The same applies if you use the numeric value
+ rather than the constant in your PHP scripts.
+
+
+- Added support for constructors in interfaces to force constructor signature
+ checks in implementations. (Marcus)
+
+ Starting with PHP 5.2, interfaces can have constructors. However, if you choose
+ to declare a constructor in an interface, each class implementing that interface
+ MUST include a constructor with a signature matching that of the base interface
+ constructor. By 'signature' we mean the parameter and return type definitions,
+ including any type hints and including whether the data is passed by reference
+ or by value.
+
+
+- Changed __toString to be called wherever applicable. (Marcus)
+
+ The magic method __toString() will now be called in a string context, that
+ is, anywhere an object is used as a string. When implementing your __toString()
+ method in a class, you should be aware that the script will terminate if
+ your function throws an exception.
+
+ The PHP 5.0/5.1 fallback - returning a string that contains the object
+ identifier - has been dropped in PHP 5.2. It became problematic because
+ an object identifier cannot be considered unique. This change will mean
+ that your application is flawed if you have relied on the object identifier
+ as a return value. An attempt to use that value as a string will now result
+ in a catchable fatal error (see above).
+
+ Even with __toString(), objects cannot be used as array indices or keys. We
+ may add built-in hash support for this at a later date, but for PHP 5.2 you
+ will need to either provide your own hashing or use the new SPL function
+ spl_object_hash().
+
+
+- Added RFC2397 (data: stream) support. (Marcus)
+
+ The introduction of the 'data' URL scheme has the potential to lead to a
+ change of behaviour under Windows. If you are working with an NTFS
+ file system and making use of meta streams in your application, and if you
+ just happen to be using a file with the name 'data:' that is accessed without
+ any path information - it won't work any more. The fix is to use the 'file:'
+ protocol when accessing it.
+
+ There is information about the RFC at http://www.faqs.org/rfcs/rfc2397.html.
+
+
+- Added allow_url_include ini directive to complement allow_url_fopen. (Rasmus)
+
+ This useful option makes it possible to differentiate between standard
+ file operations on remote files, and the inclusion of remote files. While the
+ former is usually desirable, the latter can be a security risk if used naively.
+ Starting with PHP 5.2, you can allow remote file operations while
+ disallowing the inclusion of remote files in local scripts. In fact, this
+ is the default configuration.
+
+
+- Dropped abstract static class functions. (Marcus)
+
+ Due to an oversight, PHP 5.0 and 5.1 allowed abstract static functions in
+ classes. In PHP 5.2, only interfaces can have them.
+
+
+- Removed extensions (Derick, Tony)
+
+ The filepro and hwapi extensions have been moved to PECL and are no longer
+ part of the PHP distribution. The PECL package version of these extensions
+ will be created according to user demand.
+
+
+- Added extensions (Rasmus, Derick, Pierre)
+
+ The JSON extension implements the JavaScript Object Notation (JSON)
+ data interchange format. This extension is enabled by default.
+
+ The Filter extension validates and filters data, and is designed for
+ use with insecure data such as user input. This extension is enabled
+ by default; the default mode RAW does not impact input data in any way.
+
+ The Zip extension enables you to transparently read or write ZIP
+ compressed archives and the files inside them.
+
+ Please refer to the NEW FEATURES section below or to the PHP Manual
+ for details.
+
+
+- Improved memory manager and increased default memory limit (Dmitry)
+
+ The new memory manager allocates less memory and works faster than the
+ previous incarnation. It allocates memory from the system in large blocks,
+ and then manages the heap by itself. The memory_limit value in php.ini is
+ checked, not for each emalloc() call (as before), but for actual blocks
+ requested from the system. This means that memory_limit is far more
+ accurate than it used to be, since the old memory manager didn't calculate
+ all the memory overhead used by the malloc library.
+
+ Thanks to this new-found accuracy memory usage may appear to have increased,
+ although actually it has not. To accommodate this apparent increase, the
+ default memory_limit setting was also increased - from 8 to 16 megabytes.
+
+
+- Changed priority of PHPRC environment variable on win32 (Dmitry)
+
+ The PHPRC environment variable now takes priority over the path stored
+ in the Windows registry.
+
+
+- CLI SAPI no longer checks cwd for php.ini or the php-cli.ini file (Edin)
+
+ In PHP 5.1 an undocumented feature was added that made the CLI binary check
+ the current working directory for a PHP configuration file, potentially
+ leading to unpredictable behavior if an unexpected configuration file were
+ read. This functionality was removed in 5.2, and PHP will no longer search
+ CWD for the presence of php.ini or php-cli.ini files.
+
+
+- Added a notice when performing modulus 0 operation (Tony)
+
+ In earlier versions of PHP, performing integer % 0 did not emit any
+ warning messages, instead returning an unexpected return value of FALSE.
+ As of PHP 5.2 this operation will emit an E_WARNING, as is the case in all
+ other instances where division by zero is performed.
+
+
+- As a side-effect of a change made to prevent duplicate error messages
+ when error_tracking is On [Ilia], it is now necessary to return FALSE
+ from your error handler in order to populate $php_errormsg. This allows
+ you to fine-grain the levels of the messages stored.
+
+
+==================
+NEW ERROR MESSAGES
+==================
+
+In the PHP core
+===============
+
+<?php
+
+print 10%0;
+/* Warning: Division by zero in filename on line n */
+
+echo " ";
+session_regenerate_id();
+/* Warning: session_regenerate_id(): Cannot regenerate session id - headers already sent in filename on line n */
+
+str_word_count("string", 4);
+/* Warning: str_word_count(): Invalid format value 4 in filename on line n */
+
+strripos("foo", "f", 4);
+/* Notice: strripos(): Offset is greater than the length of haystack string in filename on line n */
+
+strrpos("foo", "f", 4);
+/* Notice: strrpos(): Offset is greater than the length of haystack string in filename on line n */
+
+?>
+
+OO related in the PHP core
+==========================
+
+<?php
+
+interface foo {
+}
+class bar implements foo, foo {
+}
+/* Fatal error: Class bar cannot implement previously implemented interface foo in filename on line n */
+
+
+class foo {
+ public $bar;
+ function __get($var)
+ {
+ return $this->bar;
+ }
+}
+
+$foo = new foo;
+$bar =& $foo->prop;
+/* Notice: Indirect modification of overloaded property foo::$prop has no effect in filename on line n */
+
+
+class foo implements iterator {
+ public function current() {
+
+ }
+ public function next() {
+
+ }
+ public function key() {
+
+ }
+ public function valid() {
+
+ }
+ public function rewind() {
+
+ }
+}
+
+$foo = new foo();
+foreach($foo as &$ref) {}
+/* Fatal error: An iterator cannot be used with foreach by reference in filename on line n */
+
+
+class foo {
+ private function __construct() {
+ }
+}
+class bar extends foo {
+ public function __construct() {
+ parent::__construct();
+ /* Fatal error: Cannot call private foo::__construct() in filename on line n */
+ }
+}
+new bar;
+
+
+abstract class foo {
+ abstract static function bar();
+ /* Strict Standards: Static function foo::bar() should not be abstract in filename on line n */
+}
+
+
+stream_filter_register("", "class");
+/* Warning: stream_filter_register(): Filter name cannot be empty in filename on line n */
+
+stream_filter_register("filter", "");
+/* Warning: stream_filter_register(): Class name cannot be empty in filename on line n */
+
+
+class foo {
+ public function __toString() {
+ throw new Exception;
+ }
+}
+try {
+ print new foo;
+ /* Fatal error: Method foo::__toString() must not throw an exception in filename on line n */
+} catch(Exception $e) {}
+
+
+class foo {}
+$foo = new foo;
+print $foo;
+/* Catchable fatal error: Object of class foo could not be converted to string in filename on line n */
+
+?>
+
+In the bzip2 extension
+======================
+
+<?php
+
+bzopen("", "w");
+/* Warning: bzopen(): filename cannot be empty in filename on line n */
+
+bzopen("foo", "a");
+/* Warning: bzopen(): 'a' is not a valid mode for bzopen(). Only 'w' and 'r' are supported in filename on line n */
+
+$fp = fopen("foo", "w");
+bzopen($fp, "r");
+/* Warning: bzopen(): cannot read from a stream opened in write only mode in filename on line n */
+
+?>
+
+In the dBase extension
+======================
+
+<?php
+
+dbase_open("foo", -1);
+/* Warning: Invalid access mode -1 in filename on line n */
+
+?>
+
+In the mcrypt extension
+=======================
+
+<?php
+
+$key = "this is a secret key";
+
+$td = mcrypt_module_open('tripledes', '', 'ecb', '');
+$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
+mcrypt_generic_init($td, $key, $iv);
+$encrypted_data = mcrypt_generic($td, "");
+/* Warning: mcrypt_generic(): An empty string was passed in filename on line n */
+
+?>
+
+In the oci8 extension
+=====================
+
+<?php
+
+oci_connect("user", "pass", "db", "bogus_charset");
+/* Warning: Invalid character set name: bogus_charset in filename on line n */
+
+$oci = oci_connect("user", "pass", "db");
+oci_password_change($oci, "", "old", "new");
+/* Warning: username cannot be empty in filename on line n */
+
+oci_password_change($oci, "user", "", "new");
+/* Warning: old password cannot be empty in filename on line n */
+
+oci_password_change($oci, "user", "old", "");
+/* Warning: new password cannot be empty in filename on line n */
+
+?>
+
+In the SPL extension
+====================
+
+<?php
+
+$obj = new SplFileObject(__FILE__);
+$obj->fgetcsv("foo");
+/* Warning: SplFileObject::fgetcsv(): delimiter must be a character in filename on line n */
+
+$obj->fgetcsv(",", "foo");
+/* Warning: SplFileObject::fgetcsv(): enclosure must be a character in filename on line n */
+
+?>
+
+
+============
+NEW FEATURES
+============
+
+New extensions
+==============
+
+ Filter
+ Methods:
+ mixed filter_has_var(constant type, string variable_name)
+ - Returns true if the variable with the name 'name' exists in source
+ int filter_id(string filtername)
+ - Returns the filter ID belonging to a named filter
+ mixed filter_input(constant type, string variable_name [, long filter [, mixed options]])
+ - Returns the filtered variable 'name'* from source `type`
+ mixed filter_input_array(constant type, [, mixed options]])
+ - Returns an array with all arguments defined in 'definition'
+ array filter_list()
+ - Returns a list of all supported filters
+ mixed filter_var(mixed variable [, long filter [, mixed options]])
+ - Returns the filtered version of the variable.
+ mixed filter_var_array(array data, [, mixed options]])
+ - Returns an array with all arguments defined in 'definition'
+
+ JSON
+ Methods:
+ mixed json_decode(string json[, boolean assoc=0])
+ - Decodes a JSON string into a PHP object/associative array
+ string json_encode(mixed parameter)
+ - Takes a object or an array and returns a JSON encoded string
+
+ Zip
+ Class constants:
+ ZipArchive::CHECKCONS
+ ZipArchive::CM_DEFAULT
+ ZipArchive::CM_DEFLATE
+ ZipArchive::CM_DEFLATE64
+ ZipArchive::CM_IMPLODE
+ ZipArchive::CM_PKWARE_IMPLODE
+ ZipArchive::CM_REDUCE_1
+ ZipArchive::CM_REDUCE_2
+ ZipArchive::CM_REDUCE_3
+ ZipArchive::CM_REDUCE_4
+ ZipArchive::CM_SHRINK
+ ZipArchive::CM_STORE
+ ZipArchive::CREATE
+ ZipArchive::ER_CHANGED
+ ZipArchive::ER_CLOSE
+ ZipArchive::ER_COMPNOTSUPP
+ ZipArchive::ER_CRC
+ ZipArchive::ER_DELETED
+ ZipArchive::ER_EOF
+ ZipArchive::ER_EXISTS
+ ZipArchive::ER_INCONS
+ ZipArchive::ER_INTERNAL
+ ZipArchive::ER_INVAL
+ ZipArchive::ER_MEMORY
+ ZipArchive::ER_MULTIDISK
+ ZipArchive::ER_NOENT
+ ZipArchive::ER_NOZIP
+ ZipArchive::ER_OK
+ ZipArchive::ER_OPEN
+ ZipArchive::ER_READ
+ ZipArchive::ER_REMOVE
+ ZipArchive::ER_RENAME
+ ZipArchive::ER_SEEK
+ ZipArchive::ER_TMPOPEN
+ ZipArchive::ER_WRITE
+ ZipArchive::ER_ZIPCLOSED
+ ZipArchive::ER_ZLIB
+ ZipArchive::EXCL
+ ZipArchive::FL_COMPRESSED
+ ZipArchive::FL_NOCASE
+ ZipArchive::FL_NODIR
+ ZipArchive::FL_UNCHANGED
+ ZipArchive::OVERWRITE
+
+ Functions:
+ void zip_close(resource zip)
+ - Close a Zip archive
+ void zip_entry_close(resource zip_ent)
+ - Close a zip entry
+ int zip_entry_compressedsize(resource zip_entry)
+ - Return the compressed size of a Zip entry
+ string zip_entry_compressionmethod(resource zip_entry)
+ - Return a string containing the compression method used on a particular entry
+ int zip_entry_filesize(resource zip_entry)
+ - Return the actual filesize of a Zip entry
+ string zip_entry_name(resource zip_entry)
+ - Return the name given a Zip entry
+ bool zip_entry_open(resource zip_dp, resource zip_entry [, string mode])
+ - Open a Zip File, pointed by the resource entry
+ mixed zip_entry_read(resource zip_entry [, int len])
+ - Read from an open directory entry
+ resource zip_open(string filename)
+ - Create new zip using source URI for output
+ resource zip_read(resource zip)
+ - Returns the next file in the archive
+ Methods:
+ bool ZipArchive::addFile(string filepath[, string entryname[, int start [, int length]]])
+ - Add a file in a Zip archive using its path and the name to use
+ bool ZipArchive::addFromString(string name, string content)
+ - Add a file using content and the entry name
+ void ZipArchive::close()
+ - close the zip archive
+ bool ZipArchive::deleteIndex(int index)
+ - Delete a file using its index
+ bool ZipArchive::deleteName(string name)
+ - Delete a file using its index
+ bool ZipArchive::extractTo(string pathto[, mixed files])
+ - Extract one or more file from a zip archive to a specified destination
+ string ZipArchive::getArchiveComment()
+ - Returns the Zip archive comment
+ string ZipArchive::getCommentIndex(int index)
+ - Returns the comment of an entry using its index
+ string ZipArchive::getCommentName(string name)
+ - Returns the comment of an entry using its name
+ string ZipArchive::getFromName(string entryname[, int len [, int flags]])
+ - get the contents of an entry using its name
+ string ZipArchive::getFromIndex(string entryname[, int len [, int flags]])
+ - get the contents of an entry using its index
+ string ZipArchive::getNameIndex(int index [, int flags])
+ - Returns the name of the file at position index
+ resource ZipArchive::getStream(string entryname)
+ - Get a stream for an entry using its name
+ int ZipArchive::locateName(string filename[, int flags])
+ - Returns the index of the entry named filename in the archive
+ mixed ZipArchive::open(string source [, int flags])
+ - Create new zip using source URI for output, return TRUE on success or the error code
+ bool ZipArchive::renameIndex(int index, string new_name)
+ - Rename an entry selected by its index to new_name
+ bool ZipArchive::renameName(string name, string new_name)
+ - Rename an entry selected by its name to new_name
+ bool ZipArchive::setArchiveComment(string name, string comment)
+ - Set or remove (NULL/'') the comment of the archive
+ bool ZipArchive::setCommentIndex(int index, string comment)
+ - Set or remove (NULL/'') the comment of an entry using its index
+ bool ZipArchive::setCommentName(string name, string comment)
+ - Set or remove (NULL/'') the comment of an entry using its Name
+ array ZipArchive::statIndex(int index[, int flags])
+ - Returns the zip entry information using its index
+ array ZipArchive::statName(string filename[, int flags])
+ - Returns the information about a the zip entry filename
+ bool ZipArchive::unchangeAll()
+ - All changes made to the archive are reverted
+ bool ZipArchive::unchangeArchive()
+ - Revert all global changes to the archive. For now, this only reverts archive comment changes
+ bool ZipArchive::unchangeIndex(int index)
+ - Changes to the file at position index are reverted
+ bool ZipArchive::unchangeName(string name)
+ - Changes to the file named 'name' are reverted
+
+
+New classes
+===========
+
+ DateTime:
+ Constants:
+ DateTime::ATOM
+ DateTime::COOKIE
+ DateTime::ISO8601
+ DateTime::RFC822
+ DateTime::RFC850
+ DateTime::RFC1036
+ DateTime::RFC1123
+ DateTime::RFC2822
+ DateTime::RFC3339
+ DateTime::RSS
+ DateTime::W3C
+ Methods:
+ DateTime::__construct([string time[, DateTimeZone object]])
+ - Returns new DateTime object
+ string DateTime::format(DateTime object, string format)
+ - Returns date formatted according to given format
+ long DateTime::getOffset(DateTime object)
+ - Returns the DST offset
+ DateTimeZone DateTime::getTimezone(DateTime object)
+ - Return new DateTimeZone object relative to give DateTime
+ void DateTime::modify(DateTime object, string modify)
+ - Alters the timestamp
+ array DateTime::parse(string date)
+ - Returns associative array with detailed info about given date
+ void DateTime::setDate(DateTime object, long year, long month, long day)
+ - Sets the date
+ void DateTime::setISODate(DateTime object, long year, long week[, long day])
+ - Sets the ISO date
+ void DateTime::setTime(DateTime object, long hour, long minute[, long second])
+ - Sets the time
+ void DateTime::setTimezone(DateTime object, DateTimeZone object)
+ - Sets the timezone for the DateTime object
+
+ DateTimeZone:
+ Methods:
+ DateTimeZone DateTimeZone::__construct(string timezone)
+ - Returns new DateTimeZone object
+ string DateTimeZone::getName(DateTimeZone object)
+ - Returns the name of the timezone
+ long DateTimeZone::getOffset(DateTimeZone object, DateTime object)
+ - Returns the timezone offset
+ array DateTimeZone::getTransitions(DateTimeZone object)
+ - Returns numerically indexed array containing associative array for all transitions for the timezone
+
+ RecursiveRegexIterator:
+ extends RegexIterator
+ implements OuterIterator, Traversable, Iterator, RecursiveIterator
+ Methods:
+ RecursiveRegexIterator::__construct(RecursiveIterator it, string regex [, int mode [, int flags [, int preg_flags]]])
+ Create an RecursiveRegexIterator from another recursive iterator and a regular expression
+ RecursiveRegexIterator RecursiveRegexIterator::getChildren()
+ Return the inner iterator's children contained in a RecursiveRegexIterator
+ bool RecursiveRegexIterator::hasChildren()
+ Check whether the inner iterator's current element has children
+
+ RegexIterator:
+ extends FilterIterator
+ implements Iterator, Traversable, OuterIterator
+ Constants:
+ RecursiveRegexIterator::ALL_MATCHES
+ RecursiveRegexIterator::GET_MATCH
+ RecursiveRegexIterator::MATCH
+ RecursiveRegexIterator::REPLACE
+ RecursiveRegexIterator::SPLIT
+ RecursiveRegexIterator::USE_KEY
+ Properties:
+ public $replacement
+ Methods:
+ RegexIterator::__construct(Iterator it, string regex [, int mode [, int flags [, int preg_flags]]])
+ - Create an RegexIterator from another iterator and a regular expression
+ bool RegexIterator::accept()
+ - Match (string)current() against regular expression
+ bool RegexIterator::getFlags()
+ - Returns current operation flags
+ bool RegexIterator::getMode()
+ - Returns current operation mode
+ bool RegexIterator::getPregFlags()
+ - Returns current PREG flags (if in use or NULL)
+ bool RegexIterator::setFlags(int new_flags)
+ - Set operation flags
+ bool RegexIterator::setMode(int new_mode)
+ - Set new operation mode
+ bool RegexIterator::setPregFlags(int new_flags)
+ - Set PREG flags
+
+
+New methods
+===========
+
+In ext/dom
+==========
+ DOMDocument:
+ DOMDocument::registerNodeClass(string baseclass, string extendedclass)
+ - Register extended class used to create base node type
+
+ DOMElement:
+ DOMElement::setIDAttribute(string name, boolean isId)
+ - Declares the attribute specified by name to be of type ID
+ DOMElement::setIDAttributeNode(DOMAttr idAttr, boolean isId)
+ - Declares the attribute specified by node to be of type ID
+ DOMElement::setIDAttributeNS(string namespaceURI, string localName, boolean isId)
+ - Declares the attribute specified by local name and namespace URI to be of type ID
+
+ DOMNode:
+ DOMNode::C14N([bool exclusive [, bool with_comments [, array xpath [, array ns_prefixes]]]])
+ - Canonicalize nodes to a string
+ DOMNode::C14NFile(string uri [, bool exclusive [, bool with_comments [, array xpath [, array ns_prefixes]]]])
+ - Canonicalize nodes to a file
+ DOMNode::getNodePath()
+ - Gets an xpath for a node
+
+In ext/soap
+===========
+ SoapServer:
+ SoapServer::setObject(object obj)
+ - Sets object which will handle SOAP requests
+
+In ext/spl
+==========
+ ArrayObject:
+ int ArrayObject::asort(void)
+ - Sort the entries by values
+ int ArrayObject::ksort(void)
+ - Sort the entries by key
+ int ArrayObject::natcasesort(void)
+ - Sort the entries by key using case insensitive "natural order" algorithm.
+ int ArrayObject::natsort(void)
+ - Sort the entries by values using "natural order" algorithm.
+ int ArrayObject::uasort(callback cmp_function)
+ - Sort the entries by values user defined function
+ int ArrayObject::uksort(callback cmp_function)
+ - Sort the entries by key using user defined function.
+
+ AppendIterator:
+ ArrayIterator AppendIterator::getArrayIterator()
+ Get access to inner ArrayIterator
+ int AppendIterator::getIteratorIndex()
+ Get index of iterator
+
+ CachingIterator:
+ bool CachingIterator::getCache()
+ Return the cache
+ int CachingIterator::getFlags()
+ Return the internal flags
+ bool CachingIterator::offsetExists(mixed index)
+ Return whether the requested index exists
+ string CachingIterator::offsetGet(mixed index)
+ - Return the internal cache if used
+ void CachingIterator::offsetSet(mixed index, mixed newval)
+ - Set given index in cache
+ void CachingIterator::offsetUnset(mixed index)
+ - Unset given index in cache
+ void CachingIterator::setFlags()
+ Set the internal flags
+
+ SplFileObject:
+ array("delimiter" =>, "enclosure" =>) SplFileObject::getCsvControl(void)
+ - Get the delimiter and enclosure character used in fgetcsv
+ void SplFileObject::setCsvControl([string delimiter = ',' [, string enclosure = '"']])
+ - Set the delimiter and enclosure character used in fgetcsv
+
+ XMLReader:
+ boolean XMLReader::setSchema(string filename)
+ Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read()
+
+
+New class constants
+===================
+
+In ext/pdo
+==========
+ PDO::ATTR_DEFAULT_FETCH_MODE
+ PDO::FETCH_PROPS_LATE
+
+In ext/spl
+==========
+ CachingIterator::FULL_CACHE
+ CachingIterator::TOSTRING_USE_INNER
+
+ SplFileObject::READ_AHEAD
+ SplFileObject::READ_CSV
+ SplFileObject::SKIP_EMPTY
+
+
+New functions
+=============
+
+In the PHP core
+===============
+ array array_fill_keys(array keys, mixed val)
+ - Create an array using the elements of the first parameter as keys, each initialized to val
+ array error_get_last()
+ - Get the last occurred error as associative array. Returns NULL if there hasn't been an error yet
+ string image_type_to_extension(int imagetype [, bool include_dot])
+ - Get file extension for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype
+ int memory_get_peak_usage([real_usage])
+ - Returns the peak allocated by PHP memory
+ array timezone_abbreviations_list()
+ - Returns associative array containing DST, offset and the timezone name
+ array timezone_identifiers_list()
+ - Returns numerically indexed array with all timezone identifiers
+ string timezone_name_from_abbr(string abbr[, long gmtOffset[, long isdst]])
+ - Returns the timezone name from abbreviation
+
+In ext/mbstring
+===============
+ array mb_list_encodings_alias_names([string encoding])
+ - Returns an array of all supported entity encodings
+ mixed mb_list_mime_names([string encoding])
+ - Returns an array or string of all supported mime names
+ int mb_stripos(string haystack, string needle [, int offset [, string encoding]])
+ - Finds position of first occurrence of a string within another, case insensitive
+ string mb_stristr(string haystack, string needle[, bool part[, string encoding]])
+ - Finds first occurrence of a string within another, case insensitive
+ string mb_strrchr(string haystack, string needle[, bool part[, string encoding]])
+ - Finds the last occurrence of a character in a string within another
+ string mb_strrichr(string haystack, string needle[, bool part[, string encoding]])
+ - Finds the last occurrence of a character in a string within another, case insensitive
+ int mb_strripos(string haystack, string needle [, int offset [, string encoding]])
+ - Finds position of last occurrence of a string within another, case insensitive
+ string mb_strstr(string haystack, string needle[, bool part[, string encoding]])
+ - Finds first occurrence of a string within another
+
+In ext/openssl
+==============
+ resource openssl_csr_get_public_key(mixed csr)
+ - Extracts public key from a CERT and prepares it for use
+ array openssl_csr_get_subject(mixed csr [, bool use_short_names])
+ - Returns the subject of a CERT
+ array openssl_pkey_get_details(resource key)
+ - returns an array with the key details (bits, pkey, type)
+
+In ext/spl
+==========
+ string spl_object_hash(object obj)
+ - Return hash id for given object
+ int iterator_apply(Traversable it, mixed function [, mixed params])
+ - Calls a function for every element in an iterator
+
+In ext/pcre
+===========
+ int preg_last_error(void)
+ - Returns the error code of the last regex execution
+
+In ext/pgsql
+============
+ mixed pg_field_table(resource result, int field_number[, bool oid_only])
+ - Returns the name of the table field belongs to, or table's oid if oid_only is true
+
+In ext/posix
+============
+ bool posix_initgroups(string name, int base_group_id)
+ - Calculate the group access list for the user specified in name
+
+In ext/gmp
+==========
+ resource gmp_nextprime(resource a)
+ - Finds next prime of a
+
+In ext/xmlwriter
+================
+ bool xmlwriter_full_end_element(resource xmlwriter)
+ - End current element - returns FALSE on error
+ bool xmlwriter_write_raw(resource xmlwriter, string content)
+ - Write text - returns FALSE on error
+
+
+New optional parameters
+=======================
+
+In the PHP core
+===============
+ - string base64_decode(string str[, bool strict=false]) (strict)
+ - bool setcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure[, bool httponly=false]]]]]] (httponly)
+ - bool setrawcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure[, bool httponly=false]]]]]] (httponly)
+ - void session_set_cookie_params(int lifetime [, string path [, string domain [, bool secure[, bool httponly]]]]) (httponly)
+ - int memory_get_usage([bool real_usage=false]) (real_usage)
+
+In ext/curl
+===========
+ - array curl_multi_info_read(resource mh [, long msgs_in_queue]) (msgs_in_queue)
+
+In ext/mbstring
+===============
+ - int mb_strrpos(string haystack, string needle [, int offset [, string encoding]]) (offset)
+
+In ext/openssl
+==============
+ - int openssl_verify(string data, string signature, mixed key [, int signature_algo]) (signature_algo)
+
+In ext/pgsql
+============
+ - string pg_escape_bytea([resource connection,] string data) (connection)
+ - string pg_escape_string([resource connection,] string data) (connection)
+
+In ext/simplexml
+================
+ - SimpleXMLElement::__construct(string data [, int options [, bool data_is_url [, string ns [, bool is_prefix]]]]) (ns, is_prefix)
+ - SimpleXMLElement SimpleXMLElement::attributes([string ns [, bool is_prefix]]) (is_prefix)
+ - SimpleXMLElement SimpleXMLElement::children([string ns [, bool is_prefix]]) (is_prefix)
+ - SimpleXMLElement simplexml_load_file(string filename [, string class_name [, int options [, string ns [, bool is_prefix]]]]) (ns, is_prefix)
+ - SimpleXMLElement simplexml_load_string(string data [, string class_name [, int options [, string ns [, bool is_prefix]]]]) (ns, is_prefix)
+
+In ext/xmlreader
+================
+ - boolean XMLReader::open(string URI [, string encoding [, int options]]) (encoding, options)
+ - boolean XMLReader::XML(string source [, string encoding [, int options]]) (encoding, options)
+
+
+New INI settings
+================
+allow_url_include PHP_INI_SYSTEM, default: false
+pcre.backtrack_limit PHP_INI_ALL, default: 100000
+pcre.recursion_limit PHP_INI_ALL, default: 100000
+session.cookie_httponly PHP_INI_ALL, default: false
+
+
+New global constants
+====================
+
+In the PHP core
+===============
+ - M_EULER
+ - M_LNPI
+ - M_SQRT3
+ - M_SQRTPI
+ - PATHINFO_FILENAME
+ - PREG_BACKTRACK_LIMIT_ERROR
+ - PREG_BAD_UTF8_ERROR
+ - PREG_INTERNAL_ERROR
+ - PREG_NO_ERROR
+ - PREG_RECURSION_LIMIT_ERROR
+ - UPLOAD_ERR_EXTENSION
+
+In ext/curl
+===========
+ - CURLE_FILESIZE_EXCEEDED
+ - CURLE_FTP_SSL_FAILED
+ - CURLE_LDAP_INVALID_URL
+ - CURLFTPAUTH_DEFAULT
+ - CURLFTPAUTH_SSL
+ - CURLFTPAUTH_TLS
+ - CURLFTPSSL_ALL
+ - CURLFTPSSL_CONTROL
+ - CURLFTPSSL_NONE
+ - CURLFTPSSL_TRY
+ - CURLOPT_FTP_SSL
+ - CURLOPT_FTPSSLAUTH
+
+In ext/openssl
+==============
+ - OPENSSL_VERSION_NUMBER
+ - OPENSSL_VERSION_TEXT
+
+In ext/snmp
+===========
+ - SNMP_OID_OUTPUT_FULL
+ - SNMP_OID_OUTPUT_NUMERIC
+
+In ext/sysvmsg
+==============
+ - MSG_EAGAIN
+ - MSG_ENOMSG
diff --git a/README.input_filter b/README.input_filter
index 4d0bc6d2c..1d4269590 100644
--- a/README.input_filter
+++ b/README.input_filter
@@ -10,7 +10,10 @@ 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.
+policy you will need to write a standard PHP extension. There is also
+a powerful standard implementation in ext/filter that should suit most
+peoples' needs. However, if you want to implement your own security
+policy, read on.
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
@@ -85,7 +88,7 @@ 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: 1.7.4.1 $");
+ php_info_print_table_row( 2, "Revision", "$Revision: 1.7.4.1.2.1 $");
php_info_print_table_end();
}
diff --git a/TSRM/tsrm.m4 b/TSRM/tsrm.m4
index bf4a872ac..85e6a83a8 100644
--- a/TSRM/tsrm.m4
+++ b/TSRM/tsrm.m4
@@ -68,7 +68,6 @@ AC_DEFUN([TSRM_CHECK_ST],[
])
sinclude(threads.m4)
-sinclude(TSRM/threads.m4)
AC_DEFUN([TSRM_CHECK_PTHREADS],[
diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c
index 3b4f1c127..5918b85e6 100644
--- a/TSRM/tsrm_virtual_cwd.c
+++ b/TSRM/tsrm_virtual_cwd.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9 2006/03/05 18:57:54 derick Exp $ */
+/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.9 2006/10/06 14:03:19 tony2001 Exp $ */
#include <sys/types.h>
#include <sys/stat.h>
@@ -366,23 +366,11 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
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
char orig_path[MAXPATHLEN];
- int orig_path_len = 0;
realpath_cache_bucket *bucket;
time_t t = 0;
+ int ret;
TSRMLS_FETCH();
if (path_length == 0)
@@ -390,21 +378,36 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
if (path_length >= MAXPATHLEN)
return (1);
- 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);
+#if VIRTUAL_CWD_DEBUG
+ fprintf(stderr,"cwd = %s path = %s\n", state->cwd, path);
+#endif
+
+ /* 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 > 0)) {
+ int orig_path_len;
+ int state_cwd_length = state->cwd_length;
+
+#ifdef TSRM_WIN32
+ if (IS_SLASH(path[0])) {
+ state_cwd_length = 2;
}
+#endif
+ 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);
+ path = orig_path;
+ path_length = orig_path_len;
+ }
+
+ if (use_realpath && CWDG(realpath_cache_size_limit)) {
t = CWDG(realpath_cache_ttl)?time(NULL):0;
- if ((bucket = realpath_cache_find(orig_path, orig_path_len, t TSRMLS_CC)) != NULL) {
+ if ((bucket = realpath_cache_find(path, path_length, t TSRMLS_CC)) != NULL) {
int len = bucket->realpath_len;
CWD_STATE_COPY(&old_state, state);
@@ -421,107 +424,55 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
}
}
}
+
+ if (use_realpath) {
#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;
+ char resolved_path[MAXPATHLEN];
- 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)
- {
- int new_path_length;
-
- new_path_length = GetLongPathName(path, NULL, 0);
- if (new_path_length == 0) {
- goto php_failed_getlongpath;
+ if (!realpath(path, resolved_path)) { /* Note: Not threadsafe on older *BSD's */
+ goto no_realpath;
}
+ CWD_STATE_COPY(&old_state, state);
- /* GetLongPathName already counts the \0 */
- 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);
-php_failed_getlongpath:
- new_path = NULL;
- }
- }
+ state->cwd_length = strlen(resolved_path);
+ state->cwd = (char *) realloc(state->cwd, state->cwd_length+1);
+ memcpy(state->cwd, resolved_path, state->cwd_length+1);
+#else
+ goto no_realpath;
#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);
+ } else {
+ char *ptr, *path_copy, *free_path;
+ char *tok = NULL;
+ int ptr_length;
+
+no_realpath:
+
+ free_path = path_copy = tsrm_strndup(path, path_length);
+ CWD_STATE_COPY(&old_state, state);
+
+#ifdef TSRM_WIN32
+ if (path_length >= 2 && path[1] == ':') {
+ state->cwd = (char *) realloc(state->cwd, 2 + 1);
+ state->cwd[0] = toupper(path[0]);
+ state->cwd[1] = ':';
+ state->cwd[2] = '\0';
+ state->cwd_length = 2;
+ path_copy += 2;
+ } else if (IS_UNC_PATH(path, path_length)) {
+ state->cwd = (char *) realloc(state->cwd, 1 + 1);
+ state->cwd[0] = DEFAULT_SLASH;
+ state->cwd[1] = '\0';
+ state->cwd_length = 1;
+ path_copy += 2;
+ } else {
#endif
- if (IS_ABSOLUTE_PATH(path_copy, path_length)) {
- copy_amount = COPY_WHEN_ABSOLUTE(path_copy);
- is_absolute = 1;
+ state->cwd = (char *) realloc(state->cwd, 1);
+ state->cwd[0] = '\0';
+ state->cwd_length = 0;
#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)) {
+#endif
+
ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, &tok);
while (ptr) {
ptr_length = strlen(ptr);
@@ -551,7 +502,8 @@ php_failed_getlongpath:
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]!='/') ||
+ if (state->cwd_length < 2 ||
+ (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;
}
@@ -575,32 +527,42 @@ php_failed_getlongpath:
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
#endif
memcpy(&state->cwd[state->cwd_length], ptr, ptr_length+1);
+
+#ifdef TSRM_WIN32
+ if (use_realpath) {
+ WIN32_FIND_DATA data;
+ HANDLE hFind;
+
+ if ((hFind = FindFirstFile(state->cwd, &data)) != INVALID_HANDLE_VALUE) {
+ int length = strlen(data.cFileName);
+
+ if (length != ptr_length) {
+ state->cwd = (char *) realloc(state->cwd, state->cwd_length+length+1);
+ }
+ memcpy(&state->cwd[state->cwd_length], data.cFileName, length+1);
+ ptr_length = length;
+ FindClose(hFind);
+ }
+ }
+#endif
+
state->cwd_length += ptr_length;
}
ptr = tsrm_strtok_r(NULL, TOKENIZER_STRING, &tok);
}
+ free(free_path);
+
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);
-
if (use_realpath && CWDG(realpath_cache_size_limit)) {
- realpath_cache_add(orig_path, orig_path_len, state->cwd, state->cwd_length, t TSRMLS_CC);
+ realpath_cache_add(path, path_length, state->cwd, state->cwd_length, t TSRMLS_CC);
}
if (verify_path && verify_path(state)) {
@@ -706,7 +668,9 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC)
}
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, path, NULL, 1);
+ if (virtual_file_ex(&new_state, path, NULL, 1)) {
+ return NULL;
+ }
f = fopen(new_state.cwd, mode);
@@ -720,7 +684,9 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC)
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, pathname, NULL, 1);
+ if (virtual_file_ex(&new_state, pathname, NULL, 1)) {
+ return -1;
+ }
#if defined(TSRM_WIN32)
ret = tsrm_win32_access(new_state.cwd, mode);
@@ -741,7 +707,9 @@ CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC)
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, filename, NULL, 0);
+ if (virtual_file_ex(&new_state, filename, NULL, 0)) {
+ return -1;
+ }
ret = utime(new_state.cwd, buf);
@@ -756,7 +724,9 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC)
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, filename, NULL, 1);
+ if (virtual_file_ex(&new_state, filename, NULL, 1)) {
+ return -1;
+ }
ret = chmod(new_state.cwd, mode);
@@ -771,7 +741,9 @@ CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int li
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, filename, NULL, 0);
+ if (virtual_file_ex(&new_state, filename, NULL, 0)) {
+ return -1;
+ }
if (link) {
#if HAVE_LCHOWN
@@ -794,7 +766,9 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...)
int f;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, path, NULL, 1);
+ if (virtual_file_ex(&new_state, path, NULL, 1)) {
+ return -1;
+ }
if (flags & O_CREAT) {
mode_t mode;
@@ -818,7 +792,9 @@ CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC)
int f;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, path, NULL, 1);
+ if (virtual_file_ex(&new_state, path, NULL, 1)) {
+ return -1;
+ }
f = creat(new_state.cwd, mode);
@@ -833,11 +809,15 @@ CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC)
int retval;
CWD_STATE_COPY(&old_state, &CWDG(cwd));
- virtual_file_ex(&old_state, oldname, NULL, 0);
+ if (virtual_file_ex(&old_state, oldname, NULL, 0)) {
+ return -1;
+ }
oldname = old_state.cwd;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, newname, NULL, 0);
+ if (virtual_file_ex(&new_state, newname, NULL, 0)) {
+ return -1;
+ }
newname = new_state.cwd;
retval = rename(oldname, newname);
@@ -871,7 +851,9 @@ CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC)
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, path, NULL, 0);
+ if (virtual_file_ex(&new_state, path, NULL, 0)) {
+ return -1;
+ }
retval = lstat(new_state.cwd, buf);
@@ -886,7 +868,9 @@ CWD_API int virtual_unlink(const char *path TSRMLS_DC)
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, path, NULL, 0);
+ if (virtual_file_ex(&new_state, path, NULL, 0)) {
+ return -1;
+ }
retval = unlink(new_state.cwd);
@@ -900,7 +884,9 @@ CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC)
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, pathname, NULL, 1);
+ if (virtual_file_ex(&new_state, pathname, NULL, 1)) {
+ return -1;
+ }
#ifdef TSRM_WIN32
retval = mkdir(new_state.cwd);
@@ -917,7 +903,9 @@ CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC)
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, pathname, NULL, 0);
+ if (virtual_file_ex(&new_state, pathname, NULL, 0)) {
+ return -1;
+ }
retval = rmdir(new_state.cwd);
@@ -935,7 +923,9 @@ CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC)
DIR *retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, pathname, NULL, 1);
+ if (virtual_file_ex(&new_state, pathname, NULL, 1)) {
+ return NULL;
+ }
retval = opendir(new_state.cwd);
@@ -1050,7 +1040,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
* realpath() function.
*/
#if defined(__osf__) || defined(_AIX)
-char *php_realpath_hack(char *src, char *dest)
+char *php_realpath_hack(const char *src, char *dest)
{
char *ret;
diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h
index 753ec0207..a43482b21 100644
--- a/TSRM/tsrm_virtual_cwd.h
+++ b/TSRM/tsrm_virtual_cwd.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tsrm_virtual_cwd.h,v 1.48.2.5 2006/04/10 11:56:18 sniper Exp $ */
+/* $Id: tsrm_virtual_cwd.h,v 1.48.2.5.2.2 2006/10/04 13:24:19 tony2001 Exp $ */
#ifndef VIRTUAL_CWD_H
#define VIRTUAL_CWD_H
@@ -37,8 +37,14 @@
#include <stdarg.h>
#endif
+#ifdef ZTS
+#define VIRTUAL_DIR
+#endif
+
#ifndef TSRM_WIN32
#include <unistd.h>
+#else
+#include <direct.h>
#endif
#if defined(__osf__) || defined(_AIX)
@@ -167,7 +173,7 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC);
#endif
#if defined(__osf__) || defined(_AIX)
-char *php_realpath_hack(char *src, char *dest);
+char *php_realpath_hack(const char *src, char *dest);
#endif
#if HAVE_UTIME
diff --git a/UPGRADING b/UPGRADING
index 2b4e4c0b1..2533cc076 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -1,4 +1,4 @@
-$Id: UPGRADING,v 1.1.2.3 2005/11/27 15:39:09 iliaa Exp $
+$Id: UPGRADING,v 1.1.2.3.2.1 2006/08/28 17:18:03 tony2001 Exp $
UPGRADE NOTES - PHP 5.1
@@ -35,7 +35,7 @@ UPGRADE NOTES - PHP 5.1
1a. Overview
============
->From the PHP script writer's point of view, the change most likely to impact
+From the PHP script writer's point of view, the change most likely to impact
legacy code is in the way that references are handled in all PHP versions
post-dating the PHP 4.4.0 release.
diff --git a/Zend/README.ZEND_MM b/Zend/README.ZEND_MM
new file mode 100644
index 000000000..0825e08b4
--- /dev/null
+++ b/Zend/README.ZEND_MM
@@ -0,0 +1,13 @@
+The goal of the new memory manager (PHP 5.2 and later) is reducing memory allocation overhead and speedup memory management.
+
+The new manager's "configure" has no "--disable-zend-memory-manager" option, but it has "--enable-malloc-mm" instead. It is enabled by default in DEBUG build and disabled by default in RELEASE built. It allows select malloc/emalloc at runtime. So you can use internal and external memory debuggers without recompilation.
+
+$ sapi/cli/php -r 'leak();'
+
+$ USE_ZEND_ALLOC=0 valgrind --leak-check=full -r 'leak();'
+
+The patch allows tweaking memory manager with ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE environment variables. Default values are "malloc" and "256K". Dependent on target system you can also use "mmap_anon", "mmap_zero"
+and "win32" storage managers.
+
+$ ZEND_MM_MEM_TYPE=mmap_anon ZEND_MM_SEG_SIZE=1M sapi/cli/php
+
diff --git a/Zend/Zend.m4 b/Zend/Zend.m4
index 7f3df2aef..2e442135b 100644
--- a/Zend/Zend.m4
+++ b/Zend/Zend.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: Zend.m4,v 1.58 2005/06/14 12:23:26 sniper Exp $
+dnl $Id: Zend.m4,v 1.58.4.2 2006/09/14 09:58:27 dmitry Exp $
dnl
dnl This file contains Zend specific autoconf functions.
dnl
@@ -129,13 +129,11 @@ AC_ARG_WITH(zend-vm,
PHP_ZEND_VM=CALL
])
-AC_ARG_ENABLE(zend-memory-manager,
-[ --disable-zend-memory-manager
- Disable the Zend memory manager - FOR DEVELOPERS ONLY!!],
+AC_ARG_ENABLE(malloc-mm,
+[ --enable-malloc-mm Use environment variable for run-time malloc/emalloc
+ selection - FOR DEVELOPERS ONLY!!],
[
- ZEND_USE_ZEND_ALLOC=$enableval
-], [
- ZEND_USE_ZEND_ALLOC=yes
+ ZEND_USE_MALLOC_MM=$enableval
])
AC_ARG_ENABLE(maintainer-zts,
@@ -170,9 +168,6 @@ AC_ARG_ENABLE(zend-multibyte,
AC_MSG_CHECKING([virtual machine dispatch method])
AC_MSG_RESULT($PHP_ZEND_VM)
-AC_MSG_CHECKING(whether to enable the Zend memory manager)
-AC_MSG_RESULT($ZEND_USE_ZEND_ALLOC)
-
AC_MSG_CHECKING(whether to enable thread-safety)
AC_MSG_RESULT($ZEND_MAINTAINER_ZTS)
@@ -216,12 +211,6 @@ fi
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
-if test "$ZEND_USE_ZEND_ALLOC" = "yes"; then
- AC_DEFINE(USE_ZEND_ALLOC,1,[Use Zend memory manager])
-else
- AC_DEFINE(USE_ZEND_ALLOC,0,[Use Zend memory manager])
-fi
-
if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
AC_DEFINE(ZTS,1,[ ])
CFLAGS="$CFLAGS -DZTS"
@@ -306,6 +295,108 @@ int main()
AC_MSG_RESULT(done)
+dnl test for memory allocation using mmap(MAP_ANON)
+AC_MSG_CHECKING(for memory allocation using mmap(MAP_ANON))
+
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <stdlib.h>
+#include <stdio.h>
+#ifndef MAP_ANON
+# ifdef MAP_ANONYMOUS
+# define MAP_ANON MAP_ANONYMOUS
+# endif
+#endif
+#ifndef MREMAP_MAYMOVE
+# define MREMAP_MAYMOVE 0
+#endif
+#ifndef MAP_FAILED
+# define MAP_FAILED ((void*)-1)
+#endif
+
+#define SEG_SIZE (256*1024)
+
+int main()
+{
+ void *seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (seg == MAP_FAILED) {
+ return 1;
+ }
+ if (munmap(seg, SEG_SIZE) != 0) {
+ return 2;
+ }
+ return 0;
+}
+], [
+ AC_DEFINE([HAVE_MEM_MMAP_ANON], 1, [Define if the target system has support for memory allocation using mmap(MAP_ANON)])
+ AC_MSG_RESULT(yes)
+], [
+ AC_MSG_RESULT(no)
+], [
+ dnl cross-compile needs something here
+ AC_MSG_RESULT(no)
+])
+
+dnl test for memory allocation using mmap("/dev/zero")
+AC_MSG_CHECKING(for memory allocation using mmap("/dev/zero"))
+
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <stdlib.h>
+#include <stdio.h>
+#ifndef MAP_ANON
+# ifdef MAP_ANONYMOUS
+# define MAP_ANON MAP_ANONYMOUS
+# endif
+#endif
+#ifndef MREMAP_MAYMOVE
+# define MREMAP_MAYMOVE 0
+#endif
+#ifndef MAP_FAILED
+# define MAP_FAILED ((void*)-1)
+#endif
+
+#define SEG_SIZE (256*1024)
+
+int main()
+{
+ int fd;
+ void *seg;
+
+ fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
+ if (fd < 0) {
+ return 1;
+ }
+ seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+ if (seg == MAP_FAILED) {
+ return 2;
+ }
+ if (munmap(seg, SEG_SIZE) != 0) {
+ return 3;
+ }
+ if (close(fd) != 0) {
+ return 4;
+ }
+ return 0;
+}
+], [
+ AC_DEFINE([HAVE_MEM_MMAP_ZERO], 1, [Define if the target system has support for memory allocation using mmap("/dev/zero")])
+ AC_MSG_RESULT(yes)
+], [
+ AC_MSG_RESULT(no)
+], [
+ dnl cross-compile needs something here
+ AC_MSG_RESULT(no)
+])
+
+AC_CHECK_FUNCS(mremap)
+
])
diff --git a/Zend/ZendTS.dsp b/Zend/ZendTS.dsp
index abc6fe766..a3591c6db 100644
--- a/Zend/ZendTS.dsp
+++ b/Zend/ZendTS.dsp
@@ -169,6 +169,7 @@ SOURCE=.\zend_exceptions.c
# Begin Source File
SOURCE=.\zend_execute.c
+# ADD CPP /I "..\TSRM"
# End Source File
# Begin Source File
diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4
index 6f2e5b716..5fb4f4689 100644
--- a/Zend/acinclude.m4
+++ b/Zend/acinclude.m4
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.15.2.4 2006/08/04 06:48:59 derick Exp $
+dnl $Id: acinclude.m4,v 1.15.2.2.2.2 2006/08/04 06:48:20 derick Exp $
dnl
dnl This file contains local autoconf functions.
diff --git a/Zend/tests/001.phpt b/Zend/tests/001.phpt
new file mode 100644
index 000000000..78d982a7a
--- /dev/null
+++ b/Zend/tests/001.phpt
@@ -0,0 +1,54 @@
+--TEST--
+func_num_args() tests
+--FILE--
+<?php
+
+function test1() {
+ var_dump(func_num_args());
+}
+
+function test2($a) {
+ var_dump(func_num_args());
+}
+
+function test3($a, $b) {
+ var_dump(func_num_args());
+}
+
+test1();
+test2(1);
+test2();
+test3(1,2);
+
+call_user_func("test1");
+call_user_func("test3", 1);
+call_user_func("test3", 1, 2);
+
+class test {
+ static function test1($a) {
+ var_dump(func_num_args());
+ }
+}
+
+test::test1(1);
+var_dump(func_num_args());
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(0)
+int(1)
+
+Warning: Missing argument 1 for test2(), called in %s on line %d
+int(0)
+int(2)
+int(0)
+
+Warning: Missing argument 2 for test3() in %s on line %d
+int(1)
+int(2)
+int(1)
+
+Warning: func_num_args(): Called from the global scope - no function context in %s on line %d
+int(-1)
+Done
diff --git a/Zend/tests/002.phpt b/Zend/tests/002.phpt
new file mode 100644
index 000000000..73c8d3ec4
--- /dev/null
+++ b/Zend/tests/002.phpt
@@ -0,0 +1,108 @@
+--TEST--
+func_get_arg() tests
+--FILE--
+<?php
+
+function test1() {
+ var_dump(func_get_arg(-10));
+ var_dump(func_get_arg(0));
+ var_dump(func_get_arg(1));
+}
+
+function test2($a) {
+ var_dump(func_get_arg(0));
+ var_dump(func_get_arg(1));
+}
+
+function test3($a, $b) {
+ var_dump(func_get_arg(0));
+ var_dump(func_get_arg(1));
+ var_dump(func_get_arg(2));
+}
+
+test1();
+test1(10);
+test2(1);
+test2();
+test3(1,2);
+
+call_user_func("test1");
+call_user_func("test3", 1);
+call_user_func("test3", 1, 2);
+
+class test {
+ static function test1($a) {
+ var_dump(func_get_arg(0));
+ var_dump(func_get_arg(1));
+ }
+}
+
+test::test1(1);
+var_dump(func_get_arg(1));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
+bool(false)
+
+Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
+bool(false)
+
+Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
+bool(false)
+
+Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
+bool(false)
+int(10)
+
+Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
+bool(false)
+int(1)
+
+Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
+bool(false)
+
+Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
+
+Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
+bool(false)
+
+Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
+bool(false)
+int(1)
+int(2)
+
+Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
+bool(false)
+
+Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
+bool(false)
+
+Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
+bool(false)
+
+Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
+bool(false)
+
+Warning: Missing argument 2 for test3() in %s on line %d
+int(1)
+
+Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
+bool(false)
+
+Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
+bool(false)
+int(1)
+int(2)
+
+Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
+bool(false)
+int(1)
+
+Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
+bool(false)
+
+Warning: func_get_arg(): Called from the global scope - no function context in %s on line %d
+bool(false)
+Done
diff --git a/Zend/tests/003.phpt b/Zend/tests/003.phpt
new file mode 100644
index 000000000..81f70b8d8
--- /dev/null
+++ b/Zend/tests/003.phpt
@@ -0,0 +1,81 @@
+--TEST--
+func_get_args() tests
+--FILE--
+<?php
+
+function test1() {
+ var_dump(func_get_args());
+}
+
+function test2($a) {
+ var_dump(func_get_args());
+}
+
+function test3($a, $b) {
+ var_dump(func_get_args());
+}
+
+test1();
+test1(10);
+test2(1);
+test2();
+test3(1,2);
+
+call_user_func("test1");
+call_user_func("test3", 1);
+call_user_func("test3", 1, 2);
+
+class test {
+ static function test1($a) {
+ var_dump(func_get_args());
+ }
+}
+
+test::test1(1);
+var_dump(func_get_args());
+
+echo "Done\n";
+?>
+--EXPECTF--
+array(0) {
+}
+array(1) {
+ [0]=>
+ int(10)
+}
+array(1) {
+ [0]=>
+ int(1)
+}
+
+Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
+array(0) {
+}
+array(2) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+}
+array(0) {
+}
+
+Warning: Missing argument 2 for test3() in %s on line %d
+array(1) {
+ [0]=>
+ int(1)
+}
+array(2) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+}
+array(1) {
+ [0]=>
+ int(1)
+}
+
+Warning: func_get_args(): Called from the global scope - no function context in %s on line %d
+bool(false)
+Done
diff --git a/Zend/tests/004.phpt b/Zend/tests/004.phpt
new file mode 100644
index 000000000..ff7863346
--- /dev/null
+++ b/Zend/tests/004.phpt
@@ -0,0 +1,25 @@
+--TEST--
+strncmp() tests
+--FILE--
+<?php
+
+var_dump(strncmp("", ""));
+var_dump(strncmp("", "", 100));
+var_dump(strncmp("aef", "dfsgbdf", -1));
+var_dump(strncmp("fghjkl", "qwer", 0));
+var_dump(strncmp("qwerty", "qwerty123", 6));
+var_dump(strncmp("qwerty", "qwerty123", 7));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for strncmp() in %s on line %d
+NULL
+int(0)
+
+Warning: Length must be greater than or equal to 0 in %s on line %d
+bool(false)
+int(0)
+int(0)
+int(-1)
+Done
diff --git a/Zend/tests/005.phpt b/Zend/tests/005.phpt
new file mode 100644
index 000000000..15a510bfe
--- /dev/null
+++ b/Zend/tests/005.phpt
@@ -0,0 +1,27 @@
+--TEST--
+strcasecmp() tests
+--FILE--
+<?php
+
+var_dump(strcasecmp(""));
+var_dump(strcasecmp("", ""));
+var_dump(strcasecmp("aef", "dfsgbdf"));
+var_dump(strcasecmp("qwe", "qwer"));
+var_dump(strcasecmp("qwerty", "QweRty"));
+var_dump(strcasecmp("qwErtY", "qwerty"));
+var_dump(strcasecmp("q123", "Q123"));
+var_dump(strcasecmp("01", "01"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for strcasecmp() in %s on line %d
+NULL
+int(0)
+int(-3)
+int(-1)
+int(0)
+int(0)
+int(0)
+int(0)
+Done
diff --git a/Zend/tests/006.phpt b/Zend/tests/006.phpt
new file mode 100644
index 000000000..c600baa01
--- /dev/null
+++ b/Zend/tests/006.phpt
@@ -0,0 +1,31 @@
+--TEST--
+strncasecmp() tests
+--FILE--
+<?php
+
+var_dump(strncasecmp(""));
+var_dump(strncasecmp("", "", -1));
+var_dump(strncasecmp("aef", "dfsgbdf", 0));
+var_dump(strncasecmp("aef", "dfsgbdf", 10));
+var_dump(strncasecmp("qwe", "qwer", 3));
+var_dump(strncasecmp("qwerty", "QweRty", 6));
+var_dump(strncasecmp("qwErtY", "qwer", 7));
+var_dump(strncasecmp("q123", "Q123", 3));
+var_dump(strncasecmp("01", "01", 1000));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for strncasecmp() in %s on line %d
+NULL
+
+Warning: Length must be greater than or equal to 0 in %s on line %d
+bool(false)
+int(0)
+int(-3)
+int(0)
+int(0)
+int(2)
+int(0)
+int(0)
+Done
diff --git a/Zend/tests/007.phpt b/Zend/tests/007.phpt
new file mode 100644
index 000000000..e04e0bf9e
--- /dev/null
+++ b/Zend/tests/007.phpt
@@ -0,0 +1,63 @@
+--TEST--
+each() tests
+--FILE--
+<?php
+
+var_dump(each());
+$var = 1;
+var_dump(each($var));
+$var = "string";
+var_dump(each($var));
+$var = array(1,2,3);
+var_dump(each($var));
+$var = array("a"=>1,"b"=>2,"c"=>3);
+var_dump(each($var));
+
+$a = array(1);
+$a [] =&$a[0];
+
+var_dump(each($a));
+
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for each() in %s on line %d
+NULL
+
+Warning: Variable passed to each() is not an array or object in %s on line %d
+NULL
+
+Warning: Variable passed to each() is not an array or object in %s on line %d
+NULL
+array(4) {
+ [1]=>
+ int(1)
+ ["value"]=>
+ int(1)
+ [0]=>
+ int(0)
+ ["key"]=>
+ int(0)
+}
+array(4) {
+ [1]=>
+ int(1)
+ ["value"]=>
+ int(1)
+ [0]=>
+ string(1) "a"
+ ["key"]=>
+ string(1) "a"
+}
+array(4) {
+ [1]=>
+ int(1)
+ ["value"]=>
+ int(1)
+ [0]=>
+ int(0)
+ ["key"]=>
+ int(0)
+}
+Done
diff --git a/Zend/tests/008.phpt b/Zend/tests/008.phpt
new file mode 100644
index 000000000..5b229a070
--- /dev/null
+++ b/Zend/tests/008.phpt
@@ -0,0 +1,53 @@
+--TEST--
+define() tests
+--FILE--
+<?php
+
+var_dump(define());
+var_dump(define("TRUE"));
+var_dump(define("TRUE", 1));
+var_dump(define("TRUE", 1, array(1)));
+
+var_dump(define(array(1,2,3,4,5), 1));
+var_dump(define(" ", 1));
+var_dump(define("[[[", 2));
+var_dump(define("test const", 3));
+var_dump(define("test const", 3));
+var_dump(define("test", array(1)));
+var_dump(define("test1", new stdclass));
+
+var_dump(constant(" "));
+var_dump(constant("[[["));
+var_dump(constant("test const"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for define() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for define() in %s on line %d
+NULL
+bool(true)
+
+Notice: Constant true already defined in %s on line %d
+bool(false)
+
+Notice: Array to string conversion in %s on line %d
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Notice: Constant test const already defined in %s on line %d
+bool(false)
+
+Warning: Constants may only evaluate to scalar values in %s on line %d
+bool(false)
+
+Warning: Constants may only evaluate to scalar values in %s on line %d
+bool(false)
+int(1)
+int(2)
+int(3)
+Done
diff --git a/Zend/tests/009.phpt b/Zend/tests/009.phpt
new file mode 100644
index 000000000..87eeb2755
--- /dev/null
+++ b/Zend/tests/009.phpt
@@ -0,0 +1,46 @@
+--TEST--
+get_class() tests
+--FILE--
+<?php
+
+class foo {
+ function bar () {
+ var_dump(get_class());
+ }
+}
+
+class foo2 extends foo {
+}
+
+foo::bar();
+foo2::bar();
+
+$f1 = new foo;
+$f2 = new foo2;
+
+$f1->bar();
+$f2->bar();
+
+var_dump(get_class());
+var_dump(get_class("qwerty"));
+
+var_dump(get_class($f1));
+var_dump(get_class($f2));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Non-static method foo::bar() should not be called statically in %s on line %d
+string(3) "foo"
+
+Strict Standards: Non-static method foo::bar() should not be called statically in %s on line %d
+string(3) "foo"
+string(3) "foo"
+string(3) "foo"
+
+Warning: get_class() called without object from outside a class in %s on line %d
+bool(false)
+bool(false)
+string(3) "foo"
+string(4) "foo2"
+Done
diff --git a/Zend/tests/010.phpt b/Zend/tests/010.phpt
new file mode 100644
index 000000000..45e183291
--- /dev/null
+++ b/Zend/tests/010.phpt
@@ -0,0 +1,59 @@
+--TEST--
+get_parent_class() tests
+--FILE--
+<?php
+
+interface i {
+ function test();
+}
+
+class foo implements i {
+ function test() {
+ var_dump(get_parent_class());
+ }
+}
+
+class bar extends foo {
+ function test_bar() {
+ var_dump(get_parent_class());
+ }
+}
+
+$bar = new bar;
+$foo = new foo;
+
+$foo->test();
+$bar->test();
+$bar->test_bar();
+
+var_dump(get_parent_class($bar));
+var_dump(get_parent_class($foo));
+var_dump(get_parent_class("bar"));
+var_dump(get_parent_class("foo"));
+var_dump(get_parent_class("i"));
+
+var_dump(get_parent_class(""));
+var_dump(get_parent_class("[[[["));
+var_dump(get_parent_class(" "));
+var_dump(get_parent_class(new stdclass));
+var_dump(get_parent_class(array()));
+var_dump(get_parent_class(1));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(false)
+bool(false)
+string(3) "foo"
+string(3) "foo"
+bool(false)
+string(3) "foo"
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+Done
diff --git a/Zend/tests/011.phpt b/Zend/tests/011.phpt
new file mode 100644
index 000000000..58ed8d74d
--- /dev/null
+++ b/Zend/tests/011.phpt
@@ -0,0 +1,89 @@
+--TEST--
+property_exists() tests
+--FILE--
+<?php
+
+class foo {
+ public $pp1 = 1;
+ private $pp2 = 2;
+ protected $pp3 = 3;
+
+ function bar() {
+ var_dump(property_exists("foo","pp1"));
+ var_dump(property_exists("foo","pp2"));
+ var_dump(property_exists("foo","pp3"));
+ }
+}
+
+class bar extends foo {
+ function test() {
+ var_dump(property_exists("foo","pp1"));
+ var_dump(property_exists("foo","pp2"));
+ var_dump(property_exists("foo","pp3"));
+ }
+}
+
+var_dump(property_exists());
+var_dump(property_exists(""));
+var_dump(property_exists("foo","pp1"));
+var_dump(property_exists("foo","pp2"));
+var_dump(property_exists("foo","pp3"));
+var_dump(property_exists("foo","nonexistent"));
+var_dump(property_exists("fo","nonexistent"));
+var_dump(property_exists("foo",""));
+var_dump(property_exists("","test"));
+var_dump(property_exists("",""));
+
+$foo = new foo;
+
+var_dump(property_exists($foo,"pp1"));
+var_dump(property_exists($foo,"pp2"));
+var_dump(property_exists($foo,"pp3"));
+var_dump(property_exists($foo,"nonexistent"));
+var_dump(property_exists($foo,""));
+var_dump(property_exists(array(),"test"));
+var_dump(property_exists(1,"test"));
+var_dump(property_exists(true,"test"));
+
+$foo->bar();
+
+$bar = new bar;
+$bar->test();
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for property_exists() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for property_exists() in %s on line %d
+NULL
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+
+Warning: First parameter must either be an object or the name of an existing class in %s on line %d
+NULL
+
+Warning: First parameter must either be an object or the name of an existing class in %s on line %d
+NULL
+
+Warning: First parameter must either be an object or the name of an existing class in %s on line %d
+NULL
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(false)
+bool(true)
+Done
diff --git a/Zend/tests/012.phpt b/Zend/tests/012.phpt
new file mode 100644
index 000000000..b192bc1e0
--- /dev/null
+++ b/Zend/tests/012.phpt
@@ -0,0 +1,34 @@
+--TEST--
+class_exists() tests
+--FILE--
+<?php
+
+class foo {
+}
+
+var_dump(class_exists());
+var_dump(class_exists("qwerty"));
+var_dump(class_exists(""));
+var_dump(class_exists(array()));
+var_dump(class_exists("test", false));
+var_dump(class_exists("foo", false));
+var_dump(class_exists("foo"));
+var_dump(class_exists("stdClass", false));
+var_dump(class_exists("stdClass"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: class_exists() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+bool(false)
+bool(false)
+
+Warning: class_exists() expects parameter 1 to be string, array given in %s on line %d
+NULL
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+Done
diff --git a/Zend/tests/013.phpt b/Zend/tests/013.phpt
new file mode 100644
index 000000000..1fc4af77a
--- /dev/null
+++ b/Zend/tests/013.phpt
@@ -0,0 +1,34 @@
+--TEST--
+interface_exists() tests
+--FILE--
+<?php
+
+interface foo {
+}
+
+var_dump(interface_exists());
+var_dump(interface_exists("qwerty"));
+var_dump(interface_exists(""));
+var_dump(interface_exists(array()));
+var_dump(interface_exists("test", false));
+var_dump(interface_exists("foo", false));
+var_dump(interface_exists("foo"));
+var_dump(interface_exists("stdClass", false));
+var_dump(interface_exists("stdClass"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: interface_exists() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+bool(false)
+bool(false)
+
+Warning: interface_exists() expects parameter 1 to be string, array given in %s on line %d
+NULL
+bool(false)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+Done
diff --git a/Zend/tests/014.inc b/Zend/tests/014.inc
new file mode 100644
index 000000000..69c9bc079
--- /dev/null
+++ b/Zend/tests/014.inc
@@ -0,0 +1,3 @@
+<?php
+/* dummy file for 014.phpt */
+?>
diff --git a/Zend/tests/014.phpt b/Zend/tests/014.phpt
new file mode 100644
index 000000000..f65f2a328
--- /dev/null
+++ b/Zend/tests/014.phpt
@@ -0,0 +1,52 @@
+--TEST--
+get_included_files() tests
+--FILE--
+<?php
+
+var_dump(get_included_files());
+
+include(dirname(__FILE__)."/014.inc");
+var_dump(get_included_files());
+
+var_dump(get_included_files(1,1));
+
+include_once(dirname(__FILE__)."/014.inc");
+var_dump(get_included_files());
+
+var_dump(get_included_files(1));
+
+include(dirname(__FILE__)."/014.inc");
+var_dump(get_included_files());
+
+echo "Done\n";
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ string(%d) "%s"
+}
+array(2) {
+ [0]=>
+ string(%d) "%s"
+ [1]=>
+ string(%d) "%s"
+}
+
+Warning: Wrong parameter count for get_included_files() in %s on line %d
+NULL
+array(2) {
+ [0]=>
+ string(%d) "%s"
+ [1]=>
+ string(%d) "%s"
+}
+
+Warning: Wrong parameter count for get_included_files() in %s on line %d
+NULL
+array(2) {
+ [0]=>
+ string(%d) "%s"
+ [1]=>
+ string(%d) "%s"
+}
+Done
diff --git a/Zend/tests/015.phpt b/Zend/tests/015.phpt
new file mode 100644
index 000000000..a80254281
--- /dev/null
+++ b/Zend/tests/015.phpt
@@ -0,0 +1,35 @@
+--TEST--
+trigger_error() tests
+--FILE--
+<?php
+
+var_dump(trigger_error());
+var_dump(trigger_error("error"));
+var_dump(trigger_error(array()));
+var_dump(trigger_error("error", -1));
+var_dump(trigger_error("error", 0));
+var_dump(trigger_error("error", E_USER_WARNING));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for trigger_error() in %s on line %d
+NULL
+
+Notice: error in %s on line %d
+bool(true)
+
+Notice: Array to string conversion in %s on line %d
+
+Notice: Array in %s on line %d
+bool(true)
+
+Warning: Invalid error type specified in %s on line %d
+bool(false)
+
+Warning: Invalid error type specified in %s on line %d
+bool(false)
+
+Warning: error in %s on line %d
+bool(true)
+Done
diff --git a/Zend/tests/016.phpt b/Zend/tests/016.phpt
new file mode 100644
index 000000000..6ec507e6b
--- /dev/null
+++ b/Zend/tests/016.phpt
@@ -0,0 +1,12 @@
+--TEST--
+isset() with object properties when operating on non-object
+--FILE--
+<?php
+
+$foo = NULL;
+isset($foo->bar->bar);
+
+echo "Done\n";
+?>
+--EXPECT--
+Done
diff --git a/Zend/tests/abstract-static.phpt b/Zend/tests/abstract-static.phpt
index 9db88fc4c..c4ab8f248 100644
--- a/Zend/tests/abstract-static.phpt
+++ b/Zend/tests/abstract-static.phpt
@@ -2,23 +2,13 @@
Test for abstract static classes
--FILE--
<?php
-abstract class ezcDbHandler extends PDO
+abstract class TestClass
{
- public function __construct( $dbParams, $dsn )
- {
- $user = null;
- $pass = null;
- $driverOptions = null;
- }
-
abstract static public function getName();
-
- static public function hasFeature( $feature )
- {
- return false;
- }
}
?>
-DONE
---EXPECT--
-DONE
+===DONE===
+--EXPECTF--
+
+Strict Standards: Static function TestClass::getName() should not be abstract in %sabstract-static.php on line %d
+===DONE===
diff --git a/Zend/tests/array_type_hint_001.phpt b/Zend/tests/array_type_hint_001.phpt
index b8a8955f2..533319b6e 100755
--- a/Zend/tests/array_type_hint_001.phpt
+++ b/Zend/tests/array_type_hint_001.phpt
@@ -12,4 +12,4 @@ foo(123);
--EXPECTF--
3
-Fatal error: Argument 1 passed to foo() must be an array, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
+Catchable fatal error: Argument 1 passed to foo() must be an array, integer given, called in %sarray_type_hint_001.php on line 7 and defined in %sarray_type_hint_001.php on line 2
diff --git a/Zend/tests/bug24884.phpt b/Zend/tests/bug24884.phpt
index 6d363f2cf..457acd00d 100755
--- a/Zend/tests/bug24884.phpt
+++ b/Zend/tests/bug24884.phpt
@@ -23,6 +23,6 @@ $test = new Test();
$test2 = $test->__copy();
var_dump($test2);
?>
---EXPECT--
-object(Test)#2 (0) {
+--EXPECTF--
+object(Test)#%d (0) {
}
diff --git a/Zend/tests/bug26166.phpt b/Zend/tests/bug26166.phpt
index 01344cfb1..60624ed98 100755
--- a/Zend/tests/bug26166.phpt
+++ b/Zend/tests/bug26166.phpt
@@ -1,67 +1,74 @@
---TEST--
-Bug #26166 (__toString() crash when no values returned)
---FILE--
-<?php
-class Foo
-{
- function __toString()
- {
- return "Hello World!\n";
- }
-}
-
-class Bar
-{
- private $obj;
-
- function __construct()
- {
- $this->obj = new Foo();
- }
-
- function __toString()
- {
- return $this->obj->__toString();
- }
-}
-
-$o = new Bar;
-echo $o;
-
-echo "===THROW===\n";
-
-class Error
-{
- function __toString() {
- throw new Exception("This is an error!");
- }
-}
-
-$o = new Error;
-try {
- echo $o;
-}
-catch (Exception $e) {
- echo "Got the exception\n";
-}
-
-echo "===NONE===\n";
-
-class None
-{
- function __toString() {
- }
-}
-
-$o = new None;
-echo $o;
-
-?>
-===DONE===
---EXPECTF--
-Hello World!
-===THROW===
-Got the exception
-===NONE===
-
-Fatal error: Method None::__toString() must return a string value in %sbug26166.php on line %d
+--TEST--
+Bug #26166 (__toString() crash when no values returned)
+--FILE--
+<?php
+
+class Foo
+{
+ function __toString()
+ {
+ return "Hello World!\n";
+ }
+}
+
+class Bar
+{
+ private $obj;
+
+ function __construct()
+ {
+ $this->obj = new Foo();
+ }
+
+ function __toString()
+ {
+ return $this->obj->__toString();
+ }
+}
+
+$o = new Bar;
+echo $o;
+
+echo "===NONE===\n";
+
+function my_error_handler($errno, $errstr, $errfile, $errline) {
+ var_dump($errstr);
+}
+
+set_error_handler('my_error_handler');
+
+class None
+{
+ function __toString() {
+ }
+}
+
+$o = new None;
+echo $o;
+
+echo "===THROW===\n";
+
+class Error
+{
+ function __toString() {
+ throw new Exception("This is an error!");
+ }
+}
+
+$o = new Error;
+try {
+ echo $o;
+}
+catch (Exception $e) {
+ echo "Got the exception\n";
+}
+
+?>
+===DONE===
+--EXPECTF--
+Hello World!
+===NONE===
+string(52) "Method None::__toString() must return a string value"
+===THROW===
+
+Fatal error: Method Error::__toString() must not throw an exception in %sbug26166.php on line %d
diff --git a/Zend/tests/bug27641.phpt b/Zend/tests/bug27641.phpt
deleted file mode 100644
index c3c58696c..000000000
--- a/Zend/tests/bug27641.phpt
+++ /dev/null
@@ -1,44 +0,0 @@
---TEST--
-Bug #27641 (zend.ze1_compatibility_mode = On causes object properties to be misreported)
---SKIPIF--
-<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
---INI--
-error_reporting=4095
---FILE--
-<?php
- class A {
- public $a = "Default for A";
- public $b = "Default for B";
-
- function __construct($a, $b) {
- $this->a = $a;
- $this->b = $b;
- }
- function A() {
- $args = func_get_args();
- call_user_func_array(Array(&$this, '__construct'), $args);
- }
- }
-
- $t = new A("New A", "New B");
- print_r($t);
- print_r(get_class_vars(get_class($t)));
- print_r(get_object_vars($t));
-?>
---EXPECTF--
-Strict Standards: Redefining already defined constructor for class A in %sbug27641.php on line %d
-A Object
-(
- [a] => New A
- [b] => New B
-)
-Array
-(
- [a] => Default for A
- [b] => Default for B
-)
-Array
-(
- [a] => New A
- [b] => New B
-)
diff --git a/Zend/tests/bug28444.phpt b/Zend/tests/bug28444.phpt
index f8a5513e0..78c08d2fc 100755
--- a/Zend/tests/bug28444.phpt
+++ b/Zend/tests/bug28444.phpt
@@ -3,6 +3,12 @@ Bug #28444 (Cannot access undefined property for object with overloaded property
--FILE--
<?php
+function my_error_handler($errno, $errstr, $errfile, $errline) {
+ var_dump($errstr);
+}
+
+set_error_handler('my_error_handler');
+
class Object
{
public $x;
@@ -60,7 +66,8 @@ Overloaded::__set(y,3)
int(3)
Overloaded::__get(y)
int(3)
-Overloaded::__set(z,Object id #3)
+string(55) "Object of class Object could not be converted to string"
+Overloaded::__set(z,)
object(Object)#%d (1) {
["x"]=>
int(4)
diff --git a/Zend/tests/bug30791.phpt b/Zend/tests/bug30791.phpt
index 64ee313e4..52261a046 100755
--- a/Zend/tests/bug30791.phpt
+++ b/Zend/tests/bug30791.phpt
@@ -2,21 +2,33 @@
Bug #30791 magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded
--FILE--
<?php
-class a {
+
+function my_error_handler($errno, $errstr, $errfile, $errline) {
+ var_dump($errstr);
+}
+
+set_error_handler('my_error_handler');
+
+class a
+{
public $a = 4;
function __call($a,$b) {
return "unknown method";
}
}
+
$b = new a;
echo $b,"\n";
$c = unserialize(serialize($b));
echo $c,"\n";
var_dump($c);
+
?>
--EXPECT--
-Object id #1
-Object id #2
+string(50) "Object of class a could not be converted to string"
+
+string(50) "Object of class a could not be converted to string"
+
object(a)#2 (1) {
["a"]=>
int(4)
diff --git a/Zend/tests/bug32660.phpt b/Zend/tests/bug32660.phpt
index 36a2f7872..b075e1993 100755
--- a/Zend/tests/bug32660.phpt
+++ b/Zend/tests/bug32660.phpt
@@ -28,9 +28,12 @@ $b = "much longer";
print_r($a);
?>
--EXPECTF--
+Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 20
A Object
(
- [q] => long
+ [q] => 3
)
+Notice: Indirect modification of overloaded property A::$whatever has no effect in %sbug32660.php on line 23
+
Fatal error: Cannot assign by reference to overloaded object in %sbug32660.php on line 23
diff --git a/Zend/tests/bug33732.phpt b/Zend/tests/bug33732.phpt
index 58c204411..e723c2064 100755
--- a/Zend/tests/bug33732.phpt
+++ b/Zend/tests/bug33732.phpt
@@ -27,7 +27,7 @@ interface iB2 extends iA2 {
class A2 implements iA2 {
}
-class B2 extends A2 implements iB2 {
+class B2 extends A2 implements iA2 {
}
echo iA2::cA;
diff --git a/Zend/tests/bug33771.phpt b/Zend/tests/bug33771.phpt
index 336aee8e8..a786e5806 100644
--- a/Zend/tests/bug33771.phpt
+++ b/Zend/tests/bug33771.phpt
@@ -1,5 +1,5 @@
--TEST--
-bug #33771 (error_reporting falls to 0 when @ was used inside try/catch block)
+Bug #33771 (error_reporting falls to 0 when @ was used inside try/catch block)
--FILE--
<?php
@@ -14,7 +14,7 @@ function make_exception()
function make_exception_and_change_err_reporting()
{
- error_reporting(E_ALL);
+ error_reporting(E_ALL & ~E_STRICT);
throw new Exception();
}
@@ -34,7 +34,7 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
-int(4095)
-int(4095)
-int(2047)
+int(8191)
+int(8191)
+int(6143)
Done
diff --git a/Zend/tests/bug33996.phpt b/Zend/tests/bug33996.phpt
index 1f02cae0f..e1677ce78 100755
--- a/Zend/tests/bug33996.phpt
+++ b/Zend/tests/bug33996.phpt
@@ -1,29 +1,29 @@
---TEST--
-Bug #33996 (No information given for fatal error on passing invalid value to typed argument)
---INI--
-error_reporting=4095
---FILE--
-<?php
-class Foo
-{
- // nothing
-}
-
-function FooTest(Foo $foo)
-{
- echo "Hello!";
-}
-
-function NormalTest($a)
-{
- echo "Hi!";
-}
-
-NormalTest();
-FooTest();
-FooTest(new Foo());
-?>
---EXPECTF--
-Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line 17 and defined in %sbug33996.php on line 12
-Hi!
-Fatal error: Argument 1 passed to FooTest() must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7
+--TEST--
+Bug #33996 (No information given for fatal error on passing invalid value to typed argument)
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+class Foo
+{
+ // nothing
+}
+
+function FooTest(Foo $foo)
+{
+ echo "Hello!";
+}
+
+function NormalTest($a)
+{
+ echo "Hi!";
+}
+
+NormalTest();
+FooTest();
+FooTest(new Foo());
+?>
+--EXPECTF--
+Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
+Hi!
+Catchable fatal error: Argument 1 passed to FooTest() must be an instance of Foo, none given, called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
diff --git a/Zend/tests/bug34065.phpt b/Zend/tests/bug34065.phpt
new file mode 100755
index 000000000..9f6e00e61
--- /dev/null
+++ b/Zend/tests/bug34065.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #34065 (throw in foreach causes memory leaks)
+--FILE--
+<?php
+$data = file(__FILE__);
+try {
+ foreach ($data as $line) {
+ throw new Exception("error");
+ }
+} catch (Exception $e) {
+ echo "ok\n";
+}
+?>
+--EXPECT--
+ok
diff --git a/Zend/tests/bug36759.phpt b/Zend/tests/bug36759.phpt
new file mode 100755
index 000000000..8aa9977a0
--- /dev/null
+++ b/Zend/tests/bug36759.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #36759 (Objects destructors are invoked in wrong order when script is finished)
+--FILE--
+<?php
+class Foo {
+ private $bar;
+ function __construct($bar) {
+ $this->bar = $bar;
+ }
+ function __destruct() {
+ echo __METHOD__,"\n";
+ unset($this->bar);
+ }
+}
+
+class Bar {
+ function __destruct() {
+ echo __METHOD__,"\n";
+ unset($this->bar);
+ }
+}
+$y = new Bar();
+$x = new Foo($y);
+?>
+--EXPECT--
+Foo::__destruct
+Bar::__destruct
diff --git a/Zend/tests/bug37144.phpt b/Zend/tests/bug37144.phpt
new file mode 100755
index 000000000..6191a2938
--- /dev/null
+++ b/Zend/tests/bug37144.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #37144 (PHP crashes trying to assign into property of dead object)
+--FILE--
+<?php
+function foo() {
+ $x = new stdClass();
+ $x->bar = array(1);
+ return $x;
+}
+foo()->bar[1] = "123";
+foo()->bar[0]++;
+unset(foo()->bar[0]);
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/Zend/tests/bug37212.phpt b/Zend/tests/bug37212.phpt
new file mode 100755
index 000000000..5320a6173
--- /dev/null
+++ b/Zend/tests/bug37212.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Bug #3721 (Access to protected property of common base class)
+--FILE--
+<?php
+
+class A
+{
+ protected $value;
+
+ public function __construct($val)
+ {
+ $this->value = $val;
+ }
+
+ protected function getValue()
+ {
+ return $this->value;
+ }
+}
+
+class B extends A
+{
+ public function copyValue($obj)
+ {
+ $this->value = $obj->getValue();
+ $this->value = $obj->value; // value defined in common base class
+ }
+}
+class C extends A {}
+
+$B = new B("B");
+var_dump($B);
+$C = new C("C");
+var_dump($C);
+
+$B->copyValue($C);
+
+var_dump($B);
+
+?>
+===DONE===
+--EXPECTF--
+object(B)#%d (1) {
+ ["value:protected"]=>
+ string(1) "B"
+}
+object(C)#%d (1) {
+ ["value:protected"]=>
+ string(1) "C"
+}
+object(B)#%d (1) {
+ ["value:protected"]=>
+ string(1) "C"
+}
+===DONE===
diff --git a/Zend/tests/bug37632.phpt b/Zend/tests/bug37632.phpt
new file mode 100755
index 000000000..fb72f8934
--- /dev/null
+++ b/Zend/tests/bug37632.phpt
@@ -0,0 +1,135 @@
+--TEST--
+Bug #37632 (Protected method access problem)
+--FILE--
+<?php
+
+class A1
+{
+ protected function test()
+ {
+ echo __METHOD__ . "\n";
+ }
+}
+
+class B1 extends A1
+{
+ public function doTest(A1 $obj)
+ {
+ echo __METHOD__ . "\n";
+ $obj->test();
+ }
+}
+
+class C1 extends A1
+{
+ protected function test()
+ {
+ echo __METHOD__ . "\n";
+ }
+}
+
+$b = new B1;
+$b->doTest(new C1);
+
+class A2
+{
+ static protected function test()
+ {
+ echo __METHOD__ . "\n";
+ }
+}
+
+class B2 extends A2
+{
+ static public function doTest(A2 $obj)
+ {
+ echo __METHOD__ . "\n";
+ $obj->test();
+ }
+}
+
+class C2 extends A2
+{
+ static protected function test()
+ {
+ echo __METHOD__ . "\n";
+ }
+}
+
+B2::doTest(new C2);
+
+/* Right now Ctor's cannot be made protected when defined in a ctor. That is
+ * we cannot decrease visibility.
+ *
+
+interface Ctor
+{
+ function __construct($x);
+}
+
+class A3 implements Ctor
+{
+ protected function __construct()
+ {
+ echo __METHOD__ . "\n";
+ }
+}
+
+class B3 extends A3
+{
+ static public function doTest()
+ {
+ echo __METHOD__ . "\n";
+ new C3;
+ }
+}
+
+class C3 extends A3
+{
+ protected function __construct()
+ {
+ echo __METHOD__ . "\n";
+ }
+}
+
+B3::doTest();
+
+*/
+
+class A4
+{
+ protected function __construct()
+ {
+ echo __METHOD__ . "\n";
+ }
+}
+
+class B4 extends A4
+{
+ static public function doTest()
+ {
+ echo __METHOD__ . "\n";
+ new C4;
+ }
+}
+
+class C4 extends A4
+{
+ protected function __construct()
+ {
+ echo __METHOD__ . "\n";
+ }
+}
+
+B4::doTest();
+
+?>
+===DONE===
+--EXPECTF--
+B1::doTest
+C1::test
+B2::doTest
+C2::test
+B4::doTest
+
+Fatal error: Call to protected C4::__construct() from context 'B4' in %sbug37632.php on line %d
diff --git a/Zend/tests/bug37667.phpt b/Zend/tests/bug37667.phpt
new file mode 100755
index 000000000..b05f296f0
--- /dev/null
+++ b/Zend/tests/bug37667.phpt
@@ -0,0 +1,53 @@
+--TEST--
+Bug #37667 (Object is not added into array returned by __get)
+--FILE--
+<?php
+
+class Test
+{
+ protected $property = array('foo' => 'bar');
+
+ function __get($name)
+ {
+ return $this->property;
+ }
+}
+
+$obj = new Test;
+
+var_dump($obj->property['foo']);
+var_dump($obj->property[2]);
+
+var_dump($obj);
+
+$obj->property[] = 1;
+$obj->property[] = 2;
+
+var_dump($obj);
+
+?>
+===DONE===
+--EXPECTF--
+string(3) "bar"
+
+Notice: Undefined offset: 2 in %sbug37667.php on line 16
+NULL
+object(Test)#%d (1) {
+ ["property:protected"]=>
+ array(1) {
+ ["foo"]=>
+ string(3) "bar"
+ }
+}
+
+Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 20
+
+Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 21
+object(Test)#%d (1) {
+ ["property:protected"]=>
+ array(1) {
+ ["foo"]=>
+ string(3) "bar"
+ }
+}
+===DONE===
diff --git a/Zend/tests/bug37707.phpt b/Zend/tests/bug37707.phpt
new file mode 100755
index 000000000..196495852
--- /dev/null
+++ b/Zend/tests/bug37707.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #37707 (clone without assigning leaks memory)
+--FILE--
+<?php
+class testme {
+ function __clone() {
+ echo "clonned\n";
+ }
+}
+clone new testme();
+echo "NO LEAK\n";
+?>
+--EXPECT--
+clonned
+NO LEAK
+
diff --git a/Zend/tests/bug37811.phpt b/Zend/tests/bug37811.phpt
new file mode 100755
index 000000000..dc3ef93d6
--- /dev/null
+++ b/Zend/tests/bug37811.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #37811 define not using toString on objects
+--FILE--
+<?php
+
+class TestClass
+{
+ function __toString()
+ {
+ return "Foo";
+ }
+}
+
+define("Bar",new TestClass);
+var_dump(Bar);
+define("Baz",new stdClass);
+var_dump(Baz);
+
+?>
+===DONE===
+--EXPECTF--
+string(3) "Foo"
+
+Warning: Constants may only evaluate to scalar values in %sbug37811.php on line %d
+
+Notice: Use of undefined constant Baz - assumed 'Baz' in %sbug37811.php on line %d
+string(3) "Baz"
+===DONE===
diff --git a/Zend/tests/bug38047.phpt b/Zend/tests/bug38047.phpt
new file mode 100755
index 000000000..00290ee54
--- /dev/null
+++ b/Zend/tests/bug38047.phpt
@@ -0,0 +1,50 @@
+--TEST--
+Bug #38047 ("file" and "line" sometimes not set in backtrace from inside error handler)
+--FILE--
+<?php
+error_reporting(E_ALL);
+set_error_handler('kalus_error_handler');
+ini_set("display_errors", "on");
+
+class A {
+ function A_ftk($a) {
+ }
+}
+
+function kalus_error_handler($error_code, $error_string, $filename, $line, $symbols) {
+ echo "$error_string\n";
+ get_error_context();
+}
+
+function get_error_context() {
+ $backtrace = debug_backtrace();
+ $n = 1;
+ foreach ($backtrace as $call) {
+ echo $n++." ";
+ if (isset($call["file"])) {
+ echo $call["file"];
+ if (isset($call["line"])) {
+ echo ":".$call["line"];
+ }
+ }
+ if (isset($call["function"])) {
+ echo " ".$call["function"]."()";
+ }
+ echo "\n";
+ }
+ echo "\n";
+}
+
+//This will not create file and line items for the call into the error handler
+$page["name"] = A::A_ftk();
+?>
+--EXPECTF--
+Non-static method A::A_ftk() should not be called statically
+1 %sbug38047.php:13 get_error_context()
+2 %sbug38047.php:36 kalus_error_handler()
+3 %sbug38047.php:36 A_ftk()
+
+Missing argument 1 for A::A_ftk(), called in %sbug38047.php on line 36 and defined
+1 %sbug38047.php:13 get_error_context()
+2 %sbug38047.php:7 kalus_error_handler()
+3 %sbug38047.php:36 A_ftk()
diff --git a/Zend/tests/bug38146.phpt b/Zend/tests/bug38146.phpt
new file mode 100755
index 000000000..1f022f342
--- /dev/null
+++ b/Zend/tests/bug38146.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #38146 (Cannot use array returned from foo::__get('bar') in write context)
+--FILE--
+<?php
+class foo {
+ public function __get($member) {
+ $f = array("foo"=>"bar","bar"=>"foo");
+ return $f;
+ }
+}
+
+$f = new foo();
+foreach($f->bar as $key => $value) {
+ print "$key => $value\n";
+}
+?>
+--EXPECT--
+foo => bar
+bar => foo
diff --git a/Zend/tests/bug38211.phpt b/Zend/tests/bug38211.phpt
new file mode 100755
index 000000000..4b088125a
--- /dev/null
+++ b/Zend/tests/bug38211.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #38211 (variable name and cookie name match breaks script execution)
+--FILE--
+<?php
+$test = 'test';
+unset($$test);
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/Zend/tests/bug38220.phpt b/Zend/tests/bug38220.phpt
new file mode 100755
index 000000000..5b0a7178d
--- /dev/null
+++ b/Zend/tests/bug38220.phpt
@@ -0,0 +1,92 @@
+--TEST--
+Bug #38220 Crash on some object operations
+--FILE--
+<?php
+class drv {
+ public $obj;
+
+ function func1() {
+ echo "func1(): {$this->obj->i}\n";
+ }
+
+ function close() {
+ echo "close(): {$this->obj->i}\n";
+ }
+}
+
+class A {
+ public $i;
+
+ function __construct($i) {
+ $this->i = $i;
+
+ }
+
+ function __call($method, $args) {
+ $drv = myserv::drv();
+
+ $drv->obj = $this;
+
+ echo "before call $method\n";
+ print_r($this);
+ call_user_func_array(array($drv, $method), $args);
+ echo "after call $method\n";
+
+ // Uncomment this line to work without crash
+// $drv->obj = null;
+ }
+
+ function __destruct() {
+ echo "A::__destruct()\n";
+ $this->close();
+ }
+}
+
+class myserv {
+ private static $drv = null;
+
+ static function drv() {
+ if (is_null(self::$drv))
+ self::$drv = new drv;
+ return self::$drv;
+ }
+}
+
+$obj1 = new A(1);
+$obj1->func1();
+
+$obj2 = new A(2);
+unset($obj1);
+$obj2->func1();
+?>
+--EXPECT--
+before call func1
+A Object
+(
+ [i] => 1
+)
+func1(): 1
+after call func1
+A::__destruct()
+before call close
+A Object
+(
+ [i] => 1
+)
+close(): 1
+after call close
+before call func1
+A Object
+(
+ [i] => 2
+)
+func1(): 1
+after call func1
+A::__destruct()
+before call close
+A Object
+(
+ [i] => 2
+)
+close(): 2
+after call close
diff --git a/Zend/tests/bug38234.phpt b/Zend/tests/bug38234.phpt
new file mode 100755
index 000000000..337420667
--- /dev/null
+++ b/Zend/tests/bug38234.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #38234 (Exception in __clone makes memory leak)
+--FILE--
+<?php
+class Foo {
+ function __clone() {
+ throw new Exception();
+ }
+}
+try {
+ $x = new Foo();
+ $y = clone $x;
+} catch (Exception $e) {
+}
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/Zend/tests/bug38287.phpt b/Zend/tests/bug38287.phpt
new file mode 100755
index 000000000..3052fc7f9
--- /dev/null
+++ b/Zend/tests/bug38287.phpt
@@ -0,0 +1,45 @@
+--TEST--
+Bug #38287 (static variables mess up global vars)
+--FILE--
+<?php
+error_reporting(0);
+
+something::do_something();
+
+// $not_there is really NULL
+var_dump($not_there);
+
+// error occurs here: execution should never get inside the if condition because $not_there is NULL
+if ($not_there["invalid_var"]) {
+ // will print NULL (which is ok, but execution should never get here if the value is NULL)
+ var_dump($not_there["use_authmodule"]);
+ // will print "PATH:Array"
+ print "PATH:".$not_there["use_authmodule"]."\n";
+}
+
+class something {
+ public static function get_object() {
+ static $object=NULL;
+ if ($object===NULL)
+ $object=new something;
+ return $object;
+ }
+
+ public static function do_something() {
+ self::get_object()->vars[]=1;
+ self::get_object()->vars[]=2;
+ self::get_object()->vars[]=3;
+ var_dump(self::get_object()->vars);
+ }
+}
+?>
+--EXPECT--
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+NULL
diff --git a/Zend/tests/bug38461.phpt b/Zend/tests/bug38461.phpt
new file mode 100644
index 000000000..281d99901
--- /dev/null
+++ b/Zend/tests/bug38461.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #38461 (setting private attribute with __set() produces segfault)
+--FILE--
+<?php
+
+class Operation
+{
+ function __set( $var, $value )
+ {
+ $this->$var = $value;
+ }
+}
+
+class ExtOperation extends Operation
+{
+ private $x;
+}
+
+$op = new ExtOperation;
+$op->x = 'test';
+
+echo "Done\n";
+?>
+--EXPECT--
+Done
diff --git a/Zend/tests/bug38623.phpt b/Zend/tests/bug38623.phpt
new file mode 100755
index 000000000..8b03539db
--- /dev/null
+++ b/Zend/tests/bug38623.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #38623 (leaks in a tricky code with switch() and exceptions)
+--FILE--
+<?php
+try {
+ switch(strtolower("apache")) {
+ case "apache":
+ throw new Exception("test");
+ break;
+ }
+} catch (Exception $e) {
+ echo "ok\n";
+}
+?>
+--EXPECT--
+ok
diff --git a/Zend/tests/bug38624.phpt b/Zend/tests/bug38624.phpt
new file mode 100644
index 000000000..081e35c72
--- /dev/null
+++ b/Zend/tests/bug38624.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #38624 (Strange warning when incrementing an object property and exception is thrown from __get method)
+--FILE--
+<?php
+
+class impl
+{
+ public function __construct()
+ {
+ $this->counter++;
+ }
+ public function __set( $name, $value )
+ {
+ throw new Exception( "doesn't work" );
+ }
+
+ public function __get( $name )
+ {
+ throw new Exception( "doesn't work" );
+ }
+
+}
+
+$impl = new impl();
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'Exception' with message 'doesn't work' in %s:%d
+Stack trace:
+#0 %s(%d): impl->__get('counter')
+#1 %s(%d): impl->__construct()
+#2 {main}
+ thrown in %s on line %d
diff --git a/Zend/tests/bug38772.phpt b/Zend/tests/bug38772.phpt
new file mode 100755
index 000000000..0e97c291c
--- /dev/null
+++ b/Zend/tests/bug38772.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Bug #38772 (inconsistent overriding of methods in different visibility contexts)
+--FILE--
+<?php
+class A {
+
+ public function __construct() {
+ $this -> foo();
+ }
+
+ private function foo() {
+ echo __METHOD__ . "\r\n";
+ }
+}
+
+class B extends A {
+ public function foo() {
+ echo __METHOD__ . "\r\n";
+ }
+}
+
+class C extends A {
+ protected function foo() {
+ echo __METHOD__ . "\r\n";
+ }
+}
+
+class D extends A {
+ private function foo() {
+ echo __METHOD__ . "\r\n";
+ }
+}
+
+$a = new A();
+$b = new B();
+$c = new C();
+$d = new D();
+--EXPECT--
+A::foo
+A::foo
+A::foo
+A::foo
diff --git a/Zend/tests/bug38779.phpt b/Zend/tests/bug38779.phpt
new file mode 100644
index 000000000..b551767c9
--- /dev/null
+++ b/Zend/tests/bug38779.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #38779 (engine crashes when require()'ing file with syntax error through userspace stream wrapper)
+--FILE--
+<?php
+
+class Loader {
+ private $position;
+ private $data;
+ public function stream_open($path, $mode, $options, &$opened_path) {
+ $this->data = '<' . "?php \n\"\";ll l\n ?" . '>';
+ $this->position = 0;
+ return true;
+ }
+ function stream_read($count) {
+ $ret = substr($this->data, $this->position, $count);
+ $this->position += strlen($ret);
+ return $ret;
+ }
+ function stream_eof() {
+ return $this->position >= strlen($this->data);
+ }
+}
+stream_wrapper_register('Loader', 'Loader');
+require 'Loader://qqq.php';
+
+echo "Done\n";
+?>
+--EXPECTF--
+Parse error: %s error%sin Loader://qqq.php on line %d
diff --git a/Zend/tests/bug38779_1.phpt b/Zend/tests/bug38779_1.phpt
new file mode 100644
index 000000000..eefa952e3
--- /dev/null
+++ b/Zend/tests/bug38779_1.phpt
@@ -0,0 +1,45 @@
+--TEST--
+Bug #38779 (engine crashes when require()'ing file with syntax error through userspace stream wrapper)
+--FILE--
+<?php
+
+class Loader {
+ private $position;
+ private $data;
+ public function stream_open($path, $mode, $options, &$opened_path) {
+ $this->data = '<' . "?php \n\"\";ll l\n ?" . '>';
+ $this->position = 0;
+ return true;
+ }
+ function stream_read($count) {
+ $ret = substr($this->data, $this->position, $count);
+ $this->position += strlen($ret);
+ return $ret;
+ }
+ function stream_eof() {
+ return $this->position >= strlen($this->data);
+ }
+ function stream_flush() {
+ @unlink(dirname(__FILE__)."/bug38779.txt");
+ var_dump("flush!");
+ }
+ function stream_close() {
+ var_dump("close!");
+ }
+}
+stream_wrapper_register('Loader', 'Loader');
+$fp = fopen ('Loader://qqq.php', 'r');
+
+$filename = dirname(__FILE__)."/bug38779.txt";
+$fp1 = fopen($filename, "w");
+fwrite($fp1, "<"."?php blah blah?".">");
+fclose($fp1);
+
+include $filename;
+
+echo "Done\n";
+?>
+--EXPECTF--
+Parse error: %s error%sin %s on line %d
+string(6) "flush!"
+string(6) "close!"
diff --git a/Zend/tests/bug38808.phpt b/Zend/tests/bug38808.phpt
new file mode 100755
index 000000000..0fc4bfecd
--- /dev/null
+++ b/Zend/tests/bug38808.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #38808 ("maybe ref" issue for current() and others)
+--FILE--
+<?php
+$current = "current";
+$next = "next";
+
+$b = array(1=>'one', 2=>'two');
+$a =& $b;
+
+echo $current($a)."\n";
+$next($a);
+echo $current($a)."\n";
+?>
+--EXPECT--
+one
+two \ No newline at end of file
diff --git a/Zend/tests/bug38942.phpt b/Zend/tests/bug38942.phpt
new file mode 100755
index 000000000..5b86e15d7
--- /dev/null
+++ b/Zend/tests/bug38942.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #38942 (Double old-style-ctor inheritance)
+--FILE--
+<?php
+class foo {
+ public function foo() {}
+}
+
+class bar extends foo {
+}
+print_r(get_class_methods("bar"));
+?>
+--EXPECT--
+Array
+(
+ [0] => foo
+)
diff --git a/Zend/tests/bug39003.phpt b/Zend/tests/bug39003.phpt
new file mode 100644
index 000000000..7a3da849b
--- /dev/null
+++ b/Zend/tests/bug39003.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #39003 (__autoload() is called for type hinting)
+--FILE--
+<?php
+
+class ClassName
+{
+ public $var = 'bla';
+}
+
+function test (OtherClassName $object) { }
+
+function __autoload($class)
+{
+ var_dump("__autload($class)");
+}
+
+$obj = new ClassName;
+test($obj);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Catchable fatal error: Argument 1 passed to test() must be an instance of OtherClassName, instance of ClassName given, called in %s on line %d and defined in %s on line %d
diff --git a/Zend/tests/bug39017.phpt b/Zend/tests/bug39017.phpt
new file mode 100755
index 000000000..f38b9a310
--- /dev/null
+++ b/Zend/tests/bug39017.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #39017 (foreach(($obj = new myClass) as $v); echo $obj; segfaults)
+--FILE--
+<?php
+class A {}
+foreach(($a=(object)new A()) as $v);
+var_dump($a); // UNKNOWN:0
+?>
+--EXPECTF--
+object(A)#%d (0) {
+}
diff --git a/Zend/tests/bug39036.phpt b/Zend/tests/bug39036.phpt
new file mode 100644
index 000000000..017012fdd
--- /dev/null
+++ b/Zend/tests/bug39036.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #39036 (Unsetting key of foreach() yields segmentation fault)
+--FILE--
+<?php
+
+$key = 'asdf';
+
+foreach (get_defined_vars() as $key => $value) {
+ unset($$key);
+}
+
+var_dump($key);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Notice: Undefined variable: key in %s on line %d
+NULL
+Done
diff --git a/Zend/tests/bug39304.phpt b/Zend/tests/bug39304.phpt
new file mode 100755
index 000000000..5529d700d
--- /dev/null
+++ b/Zend/tests/bug39304.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Bug #39304 (Segmentation fault with list unpacking of string offset)
+--FILE--
+<?php
+ $s = "";
+ list($a, $b) = $s[0];
+?>
+--EXPECTF--
+Fatal error: Cannot use string offset as an array in %sbug39304.php on line 3
diff --git a/Zend/tests/catch_002.phpt b/Zend/tests/catch_002.phpt
new file mode 100755
index 000000000..73fa97b0a
--- /dev/null
+++ b/Zend/tests/catch_002.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Catching an exception in a constructor
+--FILE--
+<?php
+
+class MyObject
+{
+ function __construct()
+ {
+ throw new Exception();
+ echo __METHOD__ . "() Must not be reached\n";
+ }
+
+ function __destruct()
+ {
+ echo __METHOD__ . "() Must not be called\n";
+ }
+}
+
+try
+{
+ new MyObject();
+}
+catch(Exception $e)
+{
+ echo "Caught\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Caught
+===DONE===
diff --git a/Zend/tests/catch_003.phpt b/Zend/tests/catch_003.phpt
new file mode 100755
index 000000000..9210e3f1f
--- /dev/null
+++ b/Zend/tests/catch_003.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Catching an exception in a constructor fired form a static method
+--FILE--
+<?php
+
+class MyObject
+{
+ function fail()
+ {
+ throw new Exception();
+ }
+
+ function __construct()
+ {
+ self::fail();
+ echo __METHOD__ . "() Must not be reached\n";
+ }
+
+ function __destruct()
+ {
+ echo __METHOD__ . "() Must not be called\n";
+ }
+}
+
+try
+{
+ new MyObject();
+}
+catch(Exception $e)
+{
+ echo "Caught\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Caught
+===DONE===
diff --git a/Zend/tests/catch_004.phpt b/Zend/tests/catch_004.phpt
new file mode 100755
index 000000000..f1df06788
--- /dev/null
+++ b/Zend/tests/catch_004.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Catching an exception in a constructor inside a static method
+--FILE--
+<?php
+
+class MyObject
+{
+ function fail()
+ {
+ throw new Exception();
+ }
+
+ function __construct()
+ {
+ self::fail();
+ echo __METHOD__ . "() Must not be reached\n";
+ }
+
+ function __destruct()
+ {
+ echo __METHOD__ . "() Must not be called\n";
+ }
+
+ static function test()
+ {
+ try
+ {
+ new MyObject();
+ }
+ catch(Exception $e)
+ {
+ echo "Caught\n";
+ }
+ }
+}
+
+MyObject::test();
+
+?>
+===DONE===
+--EXPECT--
+Caught
+===DONE===
diff --git a/Zend/tests/error_reporting01.phpt b/Zend/tests/error_reporting01.phpt
index 3944ed129..60be02390 100644
--- a/Zend/tests/error_reporting01.phpt
+++ b/Zend/tests/error_reporting01.phpt
@@ -22,5 +22,5 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECT--
-int(2047)
+int(6143)
Done
diff --git a/Zend/tests/error_reporting02.phpt b/Zend/tests/error_reporting02.phpt
index eb57e4b17..227d8c6f2 100644
--- a/Zend/tests/error_reporting02.phpt
+++ b/Zend/tests/error_reporting02.phpt
@@ -23,5 +23,5 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECT--
-int(4095)
+int(8191)
Done
diff --git a/Zend/tests/error_reporting03.phpt b/Zend/tests/error_reporting03.phpt
index 0bd0b37e1..ec916048d 100644
--- a/Zend/tests/error_reporting03.phpt
+++ b/Zend/tests/error_reporting03.phpt
@@ -31,5 +31,5 @@ echo "Done\n";
?>
--EXPECTF--
Notice: Undefined variable: undef2 in %s on line %d
-int(4095)
+int(8191)
Done
diff --git a/Zend/tests/error_reporting04.phpt b/Zend/tests/error_reporting04.phpt
index 79054fe2a..1d7d678b2 100644
--- a/Zend/tests/error_reporting04.phpt
+++ b/Zend/tests/error_reporting04.phpt
@@ -19,5 +19,5 @@ echo "Done\n";
?>
--EXPECTF--
Notice: Undefined variable: undef in %s on line %d
-int(4095)
+int(8191)
Done
diff --git a/Zend/tests/error_reporting05.phpt b/Zend/tests/error_reporting05.phpt
index 501cf2ea1..71fee17f4 100644
--- a/Zend/tests/error_reporting05.phpt
+++ b/Zend/tests/error_reporting05.phpt
@@ -30,5 +30,5 @@ echo "Done\n";
Notice: Undefined variable: undef_value in %s on line %d
Notice: Undefined variable: undef_name in %s on line %d
-int(2047)
+int(6143)
Done
diff --git a/Zend/tests/error_reporting06.phpt b/Zend/tests/error_reporting06.phpt
index effa8305c..f472d3405 100644
--- a/Zend/tests/error_reporting06.phpt
+++ b/Zend/tests/error_reporting06.phpt
@@ -26,5 +26,5 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
-int(2047)
+int(6143)
Done
diff --git a/Zend/tests/error_reporting07.phpt b/Zend/tests/error_reporting07.phpt
index 8cbca46d1..696a3757e 100644
--- a/Zend/tests/error_reporting07.phpt
+++ b/Zend/tests/error_reporting07.phpt
@@ -26,5 +26,5 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
-int(2047)
+int(6143)
Done
diff --git a/Zend/tests/error_reporting08.phpt b/Zend/tests/error_reporting08.phpt
index dcc5975fa..362aa3765 100644
--- a/Zend/tests/error_reporting08.phpt
+++ b/Zend/tests/error_reporting08.phpt
@@ -28,5 +28,5 @@ echo "Done\n";
?>
--EXPECTF--
Notice: Undefined variable: undef3 in %s on line %d
-int(4095)
+int(8191)
Done
diff --git a/Zend/tests/error_reporting09.phpt b/Zend/tests/error_reporting09.phpt
index d10812c90..193758148 100644
--- a/Zend/tests/error_reporting09.phpt
+++ b/Zend/tests/error_reporting09.phpt
@@ -27,5 +27,5 @@ echo "Done\n";
Notice: Undefined variable: blah in %s on line %d
Notice: Undefined variable: undef2 in %s on line %d
-int(4095)
+int(8191)
Done
diff --git a/Zend/tests/error_reporting10.phpt b/Zend/tests/error_reporting10.phpt
index a2c13e4ad..1d0abb10f 100644
--- a/Zend/tests/error_reporting10.phpt
+++ b/Zend/tests/error_reporting10.phpt
@@ -30,6 +30,6 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
-int(2047)
-int(2039)
+int(6143)
+int(6135)
Done
diff --git a/Zend/tests/int_overflow_32bit.phpt b/Zend/tests/int_overflow_32bit.phpt
new file mode 100644
index 000000000..d9b56495e
--- /dev/null
+++ b/Zend/tests/int_overflow_32bit.phpt
@@ -0,0 +1,29 @@
+--TEST--
+testing integer overflow (32bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
+--FILE--
+<?php
+
+$doubles = array(
+ 2147483648,
+ 2147483649,
+ 2147483658,
+ 2147483748,
+ 2147484648,
+ );
+
+foreach ($doubles as $d) {
+ $l = (int)$d;
+ var_dump($l);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(-2147483648)
+int(-2147483647)
+int(-2147483638)
+int(-2147483548)
+int(-2147482648)
+Done
diff --git a/Zend/tests/int_overflow_64bit.phpt b/Zend/tests/int_overflow_64bit.phpt
new file mode 100644
index 000000000..306fbae60
--- /dev/null
+++ b/Zend/tests/int_overflow_64bit.phpt
@@ -0,0 +1,29 @@
+--TEST--
+testing integer overflow (64bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
+--FILE--
+<?php
+
+$doubles = array(
+ 9223372036854775808,
+ 9223372036854775809,
+ 9223372036854775818,
+ 9223372036854775908,
+ 9223372036854776808,
+ );
+
+foreach ($doubles as $d) {
+ $l = (int)$d;
+ var_dump($l);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(-9223372036854775808)
+Done
diff --git a/Zend/tests/int_underflow_32bit.phpt b/Zend/tests/int_underflow_32bit.phpt
new file mode 100644
index 000000000..901e7cfb5
--- /dev/null
+++ b/Zend/tests/int_underflow_32bit.phpt
@@ -0,0 +1,29 @@
+--TEST--
+testing integer underflow (32bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
+--FILE--
+<?php
+
+$doubles = array(
+ -2147483648,
+ -2147483649,
+ -2147483658,
+ -2147483748,
+ -2147484648,
+ );
+
+foreach ($doubles as $d) {
+ $l = (int)$d;
+ var_dump($l);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(-2147483648)
+int(-2147483648)
+int(-2147483648)
+int(-2147483648)
+int(-2147483648)
+Done
diff --git a/Zend/tests/int_underflow_64bit.phpt b/Zend/tests/int_underflow_64bit.phpt
new file mode 100644
index 000000000..48a43a3ca
--- /dev/null
+++ b/Zend/tests/int_underflow_64bit.phpt
@@ -0,0 +1,29 @@
+--TEST--
+testing integer underflow (64bit)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
+--FILE--
+<?php
+
+$doubles = array(
+ -9223372036854775808,
+ -9223372036854775809,
+ -9223372036854775818,
+ -9223372036854775908,
+ -9223372036854776808,
+ );
+
+foreach ($doubles as $d) {
+ $l = (int)$d;
+ var_dump($l);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(-9223372036854775808)
+Done
diff --git a/Zend/tests/objects_001.phpt b/Zend/tests/objects_001.phpt
new file mode 100644
index 000000000..5cdc3dded
--- /dev/null
+++ b/Zend/tests/objects_001.phpt
@@ -0,0 +1,60 @@
+--TEST--
+comparing objects to other types
+--FILE--
+<?php
+
+class Bar {
+}
+
+$b = new Bar;
+
+var_dump($b == NULL);
+var_dump($b != NULL);
+var_dump($b == true);
+var_dump($b != true);
+var_dump($b == false);
+var_dump($b != false);
+var_dump($b == "");
+var_dump($b != "");
+var_dump($b == 0);
+var_dump($b != 0);
+var_dump($b == 1);
+var_dump($b != 1);
+var_dump($b == 1.0);
+var_dump($b != 1.0);
+var_dump($b == 1);
+
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(false)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+
+Notice: Object of class Bar could not be converted to int in %s on line %d
+bool(false)
+
+Notice: Object of class Bar could not be converted to int in %s on line %d
+bool(true)
+
+Notice: Object of class Bar could not be converted to int in %s on line %d
+bool(true)
+
+Notice: Object of class Bar could not be converted to int in %s on line %d
+bool(false)
+
+Notice: Object of class Bar could not be converted to double in %s on line %d
+bool(true)
+
+Notice: Object of class Bar could not be converted to double in %s on line %d
+bool(false)
+
+Notice: Object of class Bar could not be converted to int in %s on line %d
+bool(true)
+Done
diff --git a/Zend/tests/objects_002.phpt b/Zend/tests/objects_002.phpt
new file mode 100644
index 000000000..87ba0fdc3
--- /dev/null
+++ b/Zend/tests/objects_002.phpt
@@ -0,0 +1,24 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo() {}
+}
+
+class test2 extends test {
+ function foo() {}
+}
+
+class test3 extends test {
+ function foo($arg) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Done
diff --git a/Zend/tests/objects_003.phpt b/Zend/tests/objects_003.phpt
new file mode 100644
index 000000000..1c254290f
--- /dev/null
+++ b/Zend/tests/objects_003.phpt
@@ -0,0 +1,24 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo($arg) {}
+}
+
+class test2 extends test {
+ function foo($arg) {}
+}
+
+class test3 extends test {
+ function foo($arg, $arg2) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Done
diff --git a/Zend/tests/objects_004.phpt b/Zend/tests/objects_004.phpt
new file mode 100644
index 000000000..35ab4775b
--- /dev/null
+++ b/Zend/tests/objects_004.phpt
@@ -0,0 +1,24 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo($arg) {}
+}
+
+class test2 extends test {
+ function foo($arg) {}
+}
+
+class test3 extends test {
+ function foo(&$arg) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Done
diff --git a/Zend/tests/objects_005.phpt b/Zend/tests/objects_005.phpt
new file mode 100644
index 000000000..d583c9be9
--- /dev/null
+++ b/Zend/tests/objects_005.phpt
@@ -0,0 +1,24 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function &foo() {}
+}
+
+class test2 extends test {
+ function &foo() {}
+}
+
+class test3 extends test {
+ function foo() {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Done
diff --git a/Zend/tests/objects_006.phpt b/Zend/tests/objects_006.phpt
new file mode 100644
index 000000000..fb2e28b3a
--- /dev/null
+++ b/Zend/tests/objects_006.phpt
@@ -0,0 +1,24 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo($arg, $arg2 = NULL) {}
+}
+
+class test2 extends test {
+ function foo($arg, $arg2 = NULL) {}
+}
+
+class test3 extends test {
+ function foo($arg, $arg2) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Done
diff --git a/Zend/tests/objects_007.phpt b/Zend/tests/objects_007.phpt
new file mode 100644
index 000000000..2fce04a17
--- /dev/null
+++ b/Zend/tests/objects_007.phpt
@@ -0,0 +1,24 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo($arg, &$arg2 = NULL) {}
+}
+
+class test2 extends test {
+ function foo($arg, &$arg2 = NULL) {}
+}
+
+class test3 extends test {
+ function foo($arg, &$arg2) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Done
diff --git a/Zend/tests/objects_008.phpt b/Zend/tests/objects_008.phpt
new file mode 100644
index 000000000..b61d16786
--- /dev/null
+++ b/Zend/tests/objects_008.phpt
@@ -0,0 +1,24 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo(Test $arg) {}
+}
+
+class test2 extends test {
+ function foo(Test $arg) {}
+}
+
+class test3 extends test {
+ function foo(Test3 $arg) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Done
diff --git a/Zend/tests/objects_009.phpt b/Zend/tests/objects_009.phpt
new file mode 100644
index 000000000..5fad0046a
--- /dev/null
+++ b/Zend/tests/objects_009.phpt
@@ -0,0 +1,24 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo(Test $arg) {}
+}
+
+class test2 extends test {
+ function foo(Test $arg) {}
+}
+
+class test3 extends test {
+ function foo($arg) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Declaration of test3::foo() should be compatible with that of test::foo() in %s on line %d
+Done
diff --git a/Zend/tests/objects_010.phpt b/Zend/tests/objects_010.phpt
new file mode 100644
index 000000000..5d004629d
--- /dev/null
+++ b/Zend/tests/objects_010.phpt
@@ -0,0 +1,19 @@
+--TEST--
+redefining constructor (__construct second)
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function test() {
+ }
+ function __construct() {
+ }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Redefining already defined constructor for class test in %s on line %d
+Done
diff --git a/Zend/tests/objects_011.phpt b/Zend/tests/objects_011.phpt
new file mode 100644
index 000000000..eb1fc0c1f
--- /dev/null
+++ b/Zend/tests/objects_011.phpt
@@ -0,0 +1,19 @@
+--TEST--
+redefining constructor (__construct first)
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function __construct() {
+ }
+ function test() {
+ }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Redefining already defined constructor for class test in %s on line %d
+Done
diff --git a/Zend/tests/objects_012.phpt b/Zend/tests/objects_012.phpt
new file mode 100644
index 000000000..95cce3eca
--- /dev/null
+++ b/Zend/tests/objects_012.phpt
@@ -0,0 +1,15 @@
+--TEST--
+implementing a class
+--FILE--
+<?php
+
+class foo {
+}
+
+interface bar extends foo {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: bar cannot implement foo - it is not an interface in %s on line %d
diff --git a/Zend/tests/objects_013.phpt b/Zend/tests/objects_013.phpt
new file mode 100644
index 000000000..3f7bea81a
--- /dev/null
+++ b/Zend/tests/objects_013.phpt
@@ -0,0 +1,15 @@
+--TEST--
+implementing the same interface twice
+--FILE--
+<?php
+
+interface foo {
+}
+
+class bar implements foo, foo {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Class bar cannot implement previously implemented interface foo in %s on line %d
diff --git a/Zend/tests/objects_014.phpt b/Zend/tests/objects_014.phpt
new file mode 100644
index 000000000..c422b392e
--- /dev/null
+++ b/Zend/tests/objects_014.phpt
@@ -0,0 +1,15 @@
+--TEST--
+extending the same interface twice
+--FILE--
+<?php
+
+interface foo {
+}
+
+interface bar extends foo, foo {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Class bar cannot implement previously implemented interface foo in %s on line %d
diff --git a/Zend/tests/objects_015.phpt b/Zend/tests/objects_015.phpt
new file mode 100755
index 000000000..a923ee0c4
--- /dev/null
+++ b/Zend/tests/objects_015.phpt
@@ -0,0 +1,26 @@
+--TEST--
+comparing objects with strings/NULL
+--FILE--
+<?php
+
+$o=new stdClass;
+
+var_dump($o == "");
+var_dump($o != "");
+var_dump($o < "");
+var_dump("" < $o);
+var_dump("" > $o);
+var_dump($o != null);
+var_dump(is_null($o));
+
+?>
+===DONE===
+--EXPECT--
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+===DONE===
diff --git a/Zend/tests/offset_array.phpt b/Zend/tests/offset_array.phpt
new file mode 100644
index 000000000..a7e2f21b1
--- /dev/null
+++ b/Zend/tests/offset_array.phpt
@@ -0,0 +1,47 @@
+--TEST--
+using different variables to access array offsets
+--FILE--
+<?php
+
+$arr = array(1,2,3,4,5,6,7,8);
+
+var_dump($arr[1]);
+var_dump($arr[0.0836]);
+var_dump($arr[NULL]);
+var_dump($arr["run away"]);
+
+var_dump($arr[TRUE]);
+var_dump($arr[FALSE]);
+
+$fp = fopen(__FILE__, "r");
+var_dump($arr[$fp]);
+
+$obj = new stdClass;
+var_dump($arr[$obj]);
+
+$arr1 = Array(1,2,3);
+var_dump($arr[$arr1]);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(2)
+int(1)
+
+Notice: Undefined index: in %s on line %d
+NULL
+
+Notice: Undefined index: run away in %s on line %d
+NULL
+int(2)
+int(1)
+
+Strict Standards: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
+int(%d)
+
+Warning: Illegal offset type in %s on line %d
+NULL
+
+Warning: Illegal offset type in %s on line %d
+NULL
+Done
diff --git a/Zend/tests/offset_bool.phpt b/Zend/tests/offset_bool.phpt
new file mode 100644
index 000000000..9bf8a89da
--- /dev/null
+++ b/Zend/tests/offset_bool.phpt
@@ -0,0 +1,37 @@
+--TEST--
+using different variables to access boolean offsets
+--FILE--
+<?php
+
+$bool = TRUE;
+
+var_dump($bool[1]);
+var_dump($bool[0.0836]);
+var_dump($bool[NULL]);
+var_dump($bool["run away"]);
+
+var_dump($bool[TRUE]);
+var_dump($bool[FALSE]);
+
+$fp = fopen(__FILE__, "r");
+var_dump($bool[$fp]);
+
+$obj = new stdClass;
+var_dump($bool[$obj]);
+
+$arr = Array(1,2,3);
+var_dump($bool[$arr]);
+
+echo "Done\n";
+?>
+--EXPECTF--
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+Done
diff --git a/Zend/tests/offset_long.phpt b/Zend/tests/offset_long.phpt
new file mode 100644
index 000000000..c65a5ba3f
--- /dev/null
+++ b/Zend/tests/offset_long.phpt
@@ -0,0 +1,37 @@
+--TEST--
+using different variables to access long offsets
+--FILE--
+<?php
+
+$long = 1;
+
+var_dump($long[1]);
+var_dump($long[0.0836]);
+var_dump($long[NULL]);
+var_dump($long["run away"]);
+
+var_dump($long[TRUE]);
+var_dump($long[FALSE]);
+
+$fp = fopen(__FILE__, "r");
+var_dump($long[$fp]);
+
+$obj = new stdClass;
+var_dump($long[$obj]);
+
+$arr = Array(1,2,3);
+var_dump($long[$arr]);
+
+echo "Done\n";
+?>
+--EXPECTF--
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+Done
diff --git a/Zend/tests/offset_null.phpt b/Zend/tests/offset_null.phpt
new file mode 100644
index 000000000..9364f0a2e
--- /dev/null
+++ b/Zend/tests/offset_null.phpt
@@ -0,0 +1,37 @@
+--TEST--
+using different variables to access null offsets
+--FILE--
+<?php
+
+$null = NULL;
+
+var_dump($null[1]);
+var_dump($null[0.0836]);
+var_dump($null[NULL]);
+var_dump($null["run away"]);
+
+var_dump($null[TRUE]);
+var_dump($null[FALSE]);
+
+$fp = fopen(__FILE__, "r");
+var_dump($null[$fp]);
+
+$obj = new stdClass;
+var_dump($null[$obj]);
+
+$arr = Array(1,2,3);
+var_dump($null[$arr]);
+
+echo "Done\n";
+?>
+--EXPECTF--
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+Done
diff --git a/Zend/tests/offset_object.phpt b/Zend/tests/offset_object.phpt
new file mode 100644
index 000000000..b570fd2a2
--- /dev/null
+++ b/Zend/tests/offset_object.phpt
@@ -0,0 +1,11 @@
+--TEST--
+accessing object dimension
+--FILE--
+<?php
+
+$object = new stdClass;
+var_dump($object[1]);
+
+?>
+--EXPECTF--
+Fatal error: Cannot use object of type stdClass as array in %s on line %d
diff --git a/Zend/tests/offset_string.phpt b/Zend/tests/offset_string.phpt
new file mode 100644
index 000000000..63d8abe8d
--- /dev/null
+++ b/Zend/tests/offset_string.phpt
@@ -0,0 +1,45 @@
+--TEST--
+using different variables to access string offsets
+--FILE--
+<?php
+
+$str = "Sitting on a corner all alone, staring from the bottom of his soul";
+
+var_dump($str[1]);
+var_dump($str[0.0836]);
+var_dump($str[NULL]);
+var_dump($str["run away"]);
+
+var_dump($str[TRUE]);
+var_dump($str[FALSE]);
+
+$fp = fopen(__FILE__, "r");
+var_dump($str[$fp]);
+
+$obj = new stdClass;
+var_dump($str[$obj]);
+
+$arr = Array(1,2,3);
+var_dump($str[$arr]);
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(1) "i"
+string(1) "S"
+string(1) "S"
+string(1) "S"
+string(1) "i"
+string(1) "S"
+
+Warning: Illegal offset type in %s on line %d
+string(1) "%s"
+
+Warning: Illegal offset type in %s on line %d
+
+Notice: Object of class stdClass could not be converted to int in %s on line %d
+string(1) "%s"
+
+Warning: Illegal offset type in %s on line %d
+string(1) "i"
+Done
diff --git a/Zend/tests/strict_001.phpt b/Zend/tests/strict_001.phpt
new file mode 100644
index 000000000..8070eb9fe
--- /dev/null
+++ b/Zend/tests/strict_001.phpt
@@ -0,0 +1,19 @@
+--TEST--
+using resource as array offset
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+$fp = fopen(__FILE__, 'r');
+
+$array = array(1,2,3,4,5,6,7);
+
+var_dump($array[$fp]);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
+int(%d)
+Done
diff --git a/Zend/tests/strict_002.phpt b/Zend/tests/strict_002.phpt
new file mode 100644
index 000000000..d8a5af2f4
--- /dev/null
+++ b/Zend/tests/strict_002.phpt
@@ -0,0 +1,27 @@
+--TEST--
+assigning static property as non static
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ static $foo = 1;
+}
+
+$t = new test;
+$t->foo = 5;
+
+$fp = fopen(__FILE__, 'r');
+
+var_dump($t);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Accessing static property test::$foo as non static in %s on line %d
+object(test)#%d (1) {
+ ["foo"]=>
+ int(5)
+}
+Done
diff --git a/Zend/zend.c b/Zend/zend.c
index c83e482cb..985017594 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend.c,v 1.308.2.12 2006/03/30 21:39:01 tony2001 Exp $ */
+/* $Id: zend.c,v 1.308.2.12.2.22 2006/10/16 11:13:08 dmitry Exp $ */
#include "zend.h"
#include "zend_extensions.h"
@@ -87,7 +87,6 @@ ZEND_INI_END()
#ifdef ZTS
ZEND_API int compiler_globals_id;
ZEND_API int executor_globals_id;
-ZEND_API int alloc_globals_id;
HashTable *global_function_table;
HashTable *global_class_table;
HashTable *global_constants_table;
@@ -107,7 +106,7 @@ static uint zend_version_info_length;
#define PRINT_ZVAL_INDENT 4
-static void print_hash(HashTable *ht, int indent, zend_bool is_object TSRMLS_DC)
+static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object TSRMLS_DC)
{
zval **tmp;
char *string_key;
@@ -117,48 +116,52 @@ static void print_hash(HashTable *ht, int indent, zend_bool is_object TSRMLS_DC)
int i;
for (i=0; i<indent; i++) {
- ZEND_PUTS(" ");
+ ZEND_PUTS_EX(" ");
}
- ZEND_PUTS("(\n");
+ ZEND_PUTS_EX("(\n");
indent += PRINT_ZVAL_INDENT;
zend_hash_internal_pointer_reset_ex(ht, &iterator);
while (zend_hash_get_current_data_ex(ht, (void **) &tmp, &iterator) == SUCCESS) {
for (i=0; i<indent; i++) {
- ZEND_PUTS(" ");
+ ZEND_PUTS_EX(" ");
}
- ZEND_PUTS("[");
+ ZEND_PUTS_EX("[");
switch (zend_hash_get_current_key_ex(ht, &string_key, &str_len, &num_key, 0, &iterator)) {
case HASH_KEY_IS_STRING:
if (is_object) {
char *prop_name, *class_name;
- zend_unmangle_property_name_ex(string_key, str_len, &class_name, &prop_name);
- ZEND_PUTS(prop_name);
+ zend_unmangle_property_name(string_key, str_len-1, &class_name, &prop_name);
+ ZEND_PUTS_EX(prop_name);
if (class_name) {
if (class_name[0]=='*') {
- ZEND_PUTS(":protected");
+ ZEND_PUTS_EX(":protected");
} else {
- ZEND_PUTS(":private");
+ ZEND_PUTS_EX(":private");
}
}
} else {
- ZEND_WRITE(string_key, str_len-1);
+ ZEND_WRITE_EX(string_key, str_len-1);
}
break;
case HASH_KEY_IS_LONG:
- zend_printf("%ld", num_key);
+ {
+ char key[25];
+ sprintf(key, "%ld", num_key);
+ ZEND_PUTS_EX(key);
+ }
break;
}
- ZEND_PUTS("] => ");
- zend_print_zval_r(*tmp, indent+PRINT_ZVAL_INDENT TSRMLS_CC);
- ZEND_PUTS("\n");
+ ZEND_PUTS_EX("] => ");
+ zend_print_zval_r_ex(write_func, *tmp, indent+PRINT_ZVAL_INDENT TSRMLS_CC);
+ ZEND_PUTS_EX("\n");
zend_hash_move_forward_ex(ht, &iterator);
}
indent -= PRINT_ZVAL_INDENT;
for (i=0; i<indent; i++) {
- ZEND_PUTS(" ");
+ ZEND_PUTS_EX(" ");
}
- ZEND_PUTS(")\n");
+ ZEND_PUTS_EX(")\n");
}
static void print_flat_hash(HashTable *ht TSRMLS_DC)
@@ -221,46 +224,36 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
case IS_OBJECT:
{
TSRMLS_FETCH();
-#if 0
+
+ if(Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, cast_object)(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
+ break;
+ }
/* Standard PHP objects */
- if (Z_OBJ_HT_P(expr) == &std_object_handlers || !Z_OBJ_HT_P(expr)->cast_object) {
- if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(expr) == &std_object_handlers || !Z_OBJ_HANDLER_P(expr, cast_object)) {
+ if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
break;
}
- zend_error(E_NOTICE, "Object of class %s could not be converted to string", Z_OBJCE_P(expr)->name);
}
-#endif
- if (Z_OBJ_HANDLER_P(expr, cast_object)) {
- if(Z_OBJ_HANDLER_P(expr, cast_object)(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
- break;
- }
- } else {
- if(Z_OBJ_HANDLER_P(expr, get)) {
- zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
-
- z->refcount++;
- if(Z_TYPE_P(z) != IS_OBJECT) {
- zend_make_printable_zval(z, expr_copy, use_copy);
- if (*use_copy) {
- zval_ptr_dtor(&z);
- } else {
- ZVAL_ZVAL(expr_copy, z, 0, 1);
- *use_copy = 1;
- }
- return;
+ if (!Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, get)) {
+ zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
+
+ z->refcount++;
+ if(Z_TYPE_P(z) != IS_OBJECT) {
+ zend_make_printable_zval(z, expr_copy, use_copy);
+ if (*use_copy) {
+ zval_ptr_dtor(&z);
+ } else {
+ ZVAL_ZVAL(expr_copy, z, 0, 1);
+ *use_copy = 1;
}
- zval_ptr_dtor(&z);
+ return;
}
+ zval_ptr_dtor(&z);
}
- if (EG(exception)) {
- zval_dtor(expr_copy);
- expr_copy->value.str.len = 0;
- expr_copy->value.str.val = STR_EMPTY_ALLOC();
- break;
- }
+ zend_error(EG(exception) ? E_ERROR : E_RECOVERABLE_ERROR, "Object of class %s could not be converted to string", Z_OBJCE_P(expr)->name);
+ expr_copy->value.str.len = 0;
+ expr_copy->value.str.val = STR_EMPTY_ALLOC();
}
- expr_copy->value.str.val = (char *) emalloc(sizeof("Object id #")-1 + MAX_LENGTH_OF_LONG);
- expr_copy->value.str.len = sprintf(expr_copy->value.str.val, "Object id #%ld", (long)expr->value.obj.handle);
break;
case IS_DOUBLE:
*expr_copy = *expr;
@@ -364,13 +357,13 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
{
switch (expr->type) {
case IS_ARRAY:
- ZEND_PUTS("Array\n");
+ ZEND_PUTS_EX("Array\n");
if (++expr->value.ht->nApplyCount>1) {
- ZEND_PUTS(" *RECURSION*");
+ ZEND_PUTS_EX(" *RECURSION*");
expr->value.ht->nApplyCount--;
return;
}
- print_hash(expr->value.ht, indent, 0 TSRMLS_CC);
+ print_hash(write_func, expr->value.ht, indent, 0 TSRMLS_CC);
expr->value.ht->nApplyCount--;
break;
case IS_OBJECT:
@@ -382,7 +375,12 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
if (Z_OBJ_HANDLER_P(expr, get_class_name)) {
Z_OBJ_HANDLER_P(expr, get_class_name)(expr, &class_name, &clen, 0 TSRMLS_CC);
}
- zend_printf("%s Object\n", class_name?class_name:"Unknown Class");
+ if (class_name) {
+ ZEND_PUTS_EX(class_name);
+ } else {
+ ZEND_PUTS_EX("Unknown Class");
+ }
+ ZEND_PUTS_EX(" Object\n");
if (class_name) {
efree(class_name);
}
@@ -391,17 +389,17 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
}
if (properties) {
if (++properties->nApplyCount>1) {
- ZEND_PUTS(" *RECURSION*");
+ ZEND_PUTS_EX(" *RECURSION*");
properties->nApplyCount--;
return;
}
- print_hash(properties, indent, 1 TSRMLS_CC);
+ print_hash(write_func, properties, indent, 1 TSRMLS_CC);
properties->nApplyCount--;
}
break;
}
default:
- zend_print_variable(expr);
+ zend_print_zval_ex(write_func, expr, indent);
break;
}
}
@@ -504,6 +502,8 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS
EG(in_autoload) = NULL;
EG(current_execute_data) = NULL;
EG(current_module) = NULL;
+ EG(exit_status) = 0;
+ EG(active) = 0;
}
@@ -525,19 +525,8 @@ static void zend_new_thread_end_handler(THREAD_T thread_id TSRMLS_DC)
zend_copy_ini_directives(TSRMLS_C);
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC);
}
-
-static void alloc_globals_dtor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
-{
- shutdown_memory_manager(0, 1 TSRMLS_CC);
-}
#endif
-static void alloc_globals_ctor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
-{
- start_memory_manager(TSRMLS_C);
-}
-
-
#if defined(__FreeBSD__) || defined(__DragonFly__)
/* FreeBSD and DragonFly floating point precision fix */
#include <floatingpoint.h>
@@ -566,19 +555,15 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
#ifdef ZTS
zend_compiler_globals *compiler_globals;
zend_executor_globals *executor_globals;
- void ***tsrm_ls;
extern ZEND_API ts_rsrc_id ini_scanner_globals_id;
extern ZEND_API ts_rsrc_id language_scanner_globals_id;
#else
extern zend_scanner_globals ini_scanner_globals;
extern zend_scanner_globals language_scanner_globals;
#endif
+ TSRMLS_FETCH();
-#ifdef ZTS
- ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor);
-#else
- alloc_globals_ctor(&alloc_globals TSRMLS_CC);
-#endif
+ start_memory_manager(TSRMLS_C);
#if defined(__FreeBSD__) || defined(__DragonFly__)
/* FreeBSD and DragonFly floating point precision fix */
@@ -606,6 +591,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
zend_getenv = utility_functions->getenv_function;
zend_compile_file = compile_file;
+ zend_compile_string = compile_string;
zend_execute = execute;
zend_execute_internal = NULL;
zend_throw_exception_hook = NULL;
@@ -771,14 +757,14 @@ ZEND_API void _zend_bailout(char *filename, uint lineno)
{
TSRMLS_FETCH();
- if (!EG(bailout_set)) {
+ if (!EG(bailout)) {
zend_output_debug_string(1, "%s(%d) : Bailed out without a bailout address!", filename, lineno);
exit(-1);
}
CG(unclean_shutdown) = 1;
CG(in_compilation) = EG(in_execution) = 0;
EG(current_execute_data) = NULL;
- longjmp(EG(bailout), FAILURE);
+ longjmp(*EG(bailout), FAILURE);
}
END_EXTERN_C()
@@ -930,6 +916,7 @@ ZEND_API void zend_error(int type, const char *format, ...)
case E_USER_ERROR:
case E_USER_WARNING:
case E_USER_NOTICE:
+ case E_RECOVERABLE_ERROR:
if (zend_is_compiling(TSRMLS_C)) {
error_filename = zend_get_compiled_filename(TSRMLS_C);
error_lineno = zend_get_compiled_lineno(TSRMLS_C);
@@ -1090,6 +1077,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
int i;
zend_file_handle *file_handle;
zend_op_array *orig_op_array = EG(active_op_array);
+ zval **orig_retval_ptr_ptr = EG(return_value_ptr_ptr);
zval *local_retval=NULL;
va_start(files, file_count);
@@ -1098,7 +1086,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
if (!file_handle) {
continue;
}
- EG(active_op_array) = zend_compile_file(file_handle, ZEND_INCLUDE TSRMLS_CC);
+ EG(active_op_array) = zend_compile_file(file_handle, type TSRMLS_CC);
if(file_handle->opened_path) {
int dummy=1;
zend_hash_add(&EG(included_files), file_handle->opened_path, strlen(file_handle->opened_path)+1, (void *)&dummy, sizeof(int), NULL);
@@ -1109,6 +1097,8 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
zend_execute(EG(active_op_array) TSRMLS_CC);
if (EG(exception)) {
char ex_class_name[128];
+
+ EG(opline_ptr) = NULL;
if (Z_TYPE_P(EG(exception)) == IS_OBJECT) {
strncpy(ex_class_name, Z_OBJ_CLASS_NAME_P(EG(exception)), 127);
ex_class_name[127] = '\0';
@@ -1152,11 +1142,13 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
} else if (type==ZEND_REQUIRE) {
va_end(files);
EG(active_op_array) = orig_op_array;
+ EG(return_value_ptr_ptr) = orig_retval_ptr_ptr;
return FAILURE;
}
}
va_end(files);
EG(active_op_array) = orig_op_array;
+ EG(return_value_ptr_ptr) = orig_retval_ptr_ptr;
return SUCCESS;
}
diff --git a/Zend/zend.h b/Zend/zend.h
index d8d5022d6..5ca0845f9 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -17,12 +17,12 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend.h,v 1.293.2.11 2006/03/30 21:39:01 tony2001 Exp $ */
+/* $Id: zend.h,v 1.293.2.11.2.6 2006/09/14 10:32:45 dmitry Exp $ */
#ifndef ZEND_H
#define ZEND_H
-#define ZEND_VERSION "2.1.0"
+#define ZEND_VERSION "2.2.0"
#define ZEND_ENGINE_2
@@ -258,7 +258,6 @@ void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((nore
# define zend_error_noreturn zend_error
#endif
-
/*
* zval
*/
@@ -320,7 +319,7 @@ struct _zend_class_entry {
char type;
char *name;
zend_uint name_length;
- struct _zend_class_entry *parent;
+ struct _zend_class_entry *parent;
int refcount;
zend_bool constants_updated;
zend_uint ce_flags;
@@ -341,6 +340,7 @@ struct _zend_class_entry {
union _zend_function *__unset;
union _zend_function *__isset;
union _zend_function *__call;
+ union _zend_function *__tostring;
union _zend_function *serialize_func;
union _zend_function *unserialize_func;
@@ -348,7 +348,7 @@ struct _zend_class_entry {
/* handlers */
zend_object_value (*create_object)(zend_class_entry *class_type TSRMLS_DC);
- zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object TSRMLS_DC);
+ zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type TSRMLS_DC); /* a class implements this interface */
/* serializer callbacks */
@@ -363,7 +363,7 @@ struct _zend_class_entry {
zend_uint line_end;
char *doc_comment;
zend_uint doc_comment_len;
-
+
struct _zend_module_entry *module;
};
@@ -384,7 +384,7 @@ typedef struct _zend_utility_functions {
char *(*getenv_function)(char *name, size_t name_len TSRMLS_DC);
} zend_utility_functions;
-
+
typedef struct _zend_utility_values {
char *import_use_extension;
uint import_use_extension_length;
@@ -430,7 +430,6 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
#define OE_IS_OBJECT (1<<1)
#define OE_IS_METHOD (1<<2)
-
int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions);
void zend_shutdown(TSRMLS_D);
void zend_register_standard_ini_entries(TSRMLS_D);
@@ -449,19 +448,19 @@ END_EXTERN_C()
#define zend_try \
{ \
- jmp_buf orig_bailout; \
- zend_bool orig_bailout_set=EG(bailout_set); \
+ jmp_buf *__orig_bailout = EG(bailout); \
+ jmp_buf __bailout; \
\
- EG(bailout_set) = 1; \
- memcpy(&orig_bailout, &EG(bailout), sizeof(jmp_buf)); \
- if (setjmp(EG(bailout))==0)
+ EG(bailout) = &__bailout; \
+ if (setjmp(__bailout)==0) {
#define zend_catch \
- else
+ } else { \
+ EG(bailout) = __orig_bailout;
#define zend_end_try() \
- memcpy(&EG(bailout), &orig_bailout, sizeof(jmp_buf)); \
- EG(bailout_set) = orig_bailout_set; \
+ } \
+ EG(bailout) = __orig_bailout; \
}
-#define zend_first_try EG(bailout_set)=0; zend_try
+#define zend_first_try EG(bailout)=NULL; zend_try
BEGIN_EXTERN_C()
ZEND_API char *get_zend_version(void);
@@ -503,7 +502,9 @@ END_EXTERN_C()
/* output support */
#define ZEND_WRITE(str, str_len) zend_write((str), (str_len))
+#define ZEND_WRITE_EX(str, str_len) write_func((str), (str_len))
#define ZEND_PUTS(str) zend_write((str), strlen((str)))
+#define ZEND_PUTS_EX(str) write_func((str), strlen((str)))
#define ZEND_PUTC(c) zend_write(&(c), 1), (c)
@@ -562,7 +563,7 @@ END_EXTERN_C()
#define INIT_PZVAL(z) \
(z)->refcount = 1; \
- (z)->is_ref = 0;
+ (z)->is_ref = 0;
#define INIT_ZVAL(z) z = zval_used_for_init;
@@ -639,6 +640,11 @@ END_EXTERN_C()
varptr->refcount++; \
}
+#define READY_TO_DESTROY(zv) \
+ ((zv)->refcount == 1 && \
+ (Z_TYPE_P(zv) != IS_OBJECT || \
+ zend_objects_store_get_refcount(zv TSRMLS_CC) == 1))
+
#define ZEND_MAX_RESERVED_RESOURCES 4
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index a2c8c0031..8381f1187 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 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 |
+ | 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 |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.c,v 1.296.2.27 2006/04/20 07:30:38 dmitry Exp $ */
+/* $Id: zend_API.c,v 1.296.2.27.2.23 2006/10/03 11:10:32 dmitry Exp $ */
#include "zend.h"
#include "zend_execute.h"
@@ -196,7 +196,7 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TS
while (param_count-->0) {
zval **param = (zval **) p-(arg_count--);
zval_add_ref(param);
- add_next_index_zval(argument_array, *param);
+ add_next_index_zval(argument_array, *param);
}
return SUCCESS;
@@ -214,38 +214,35 @@ ZEND_API void zend_wrong_param_count(TSRMLS_D)
/* Argument parsing API -- andrei */
-ZEND_API char *zend_zval_type_name(zval *arg)
+ZEND_API char *zend_get_type_by_const(int type)
{
- switch (Z_TYPE_P(arg)) {
- case IS_NULL:
- return "null";
-
+ switch(type) {
+ case IS_BOOL:
+ return "boolean";
case IS_LONG:
return "integer";
-
case IS_DOUBLE:
return "double";
-
case IS_STRING:
return "string";
-
- case IS_ARRAY:
- return "array";
-
case IS_OBJECT:
return "object";
-
- case IS_BOOL:
- return "boolean";
-
case IS_RESOURCE:
return "resource";
-
+ case IS_NULL:
+ return "null";
+ case IS_ARRAY:
+ return "array";
default:
return "unknown";
}
}
+ZEND_API char *zend_zval_type_name(zval *arg)
+{
+ return zend_get_type_by_const(Z_TYPE_P(arg));
+}
+
ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC)
{
if (Z_OBJ_HT_P(zobject)->get_class_entry) {
@@ -262,7 +259,7 @@ ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uin
if (Z_OBJ_HT_P(object)->get_class_name == NULL ||
Z_OBJ_HT_P(object)->get_class_name(object, class_name, class_name_len, 0 TSRMLS_CC) != SUCCESS) {
zend_class_entry *ce = Z_OBJCE_P(object);
-
+
*class_name = ce->name;
*class_name_len = ce->name_length;
return 1;
@@ -270,6 +267,44 @@ ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uin
return 0;
}
+static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int type TSRMLS_DC)
+{
+ if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
+ SEPARATE_ZVAL_IF_NOT_REF(arg);
+ if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, type TSRMLS_CC) == SUCCESS) {
+ *pl = Z_STRLEN_PP(arg);
+ *p = Z_STRVAL_PP(arg);
+ return SUCCESS;
+ }
+ }
+ /* Standard PHP objects */
+ if (Z_OBJ_HT_PP(arg) == &std_object_handlers || !Z_OBJ_HANDLER_PP(arg, cast_object)) {
+ SEPARATE_ZVAL_IF_NOT_REF(arg);
+ if (zend_std_cast_object_tostring(*arg, *arg, type TSRMLS_CC) == SUCCESS) {
+ *pl = Z_STRLEN_PP(arg);
+ *p = Z_STRVAL_PP(arg);
+ return SUCCESS;
+ }
+ }
+ if (!Z_OBJ_HANDLER_PP(arg, cast_object) && Z_OBJ_HANDLER_PP(arg, get)) {
+ int use_copy;
+ zval *z = Z_OBJ_HANDLER_PP(arg, get)(*arg TSRMLS_CC);
+ z->refcount++;
+ if(Z_TYPE_P(z) != IS_OBJECT) {
+ zval_dtor(*arg);
+ Z_TYPE_P(*arg) = IS_NULL;
+ zend_make_printable_zval(z, *arg, &use_copy);
+ if (!use_copy) {
+ ZVAL_ZVAL(*arg, z, 1, 1);
+ }
+ *pl = Z_STRLEN_PP(arg);
+ *p = Z_STRVAL_PP(arg);
+ return SUCCESS;
+ }
+ zval_ptr_dtor(&z);
+ }
+ return FAILURE;
+}
static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **spec TSRMLS_DC)
{
@@ -376,17 +411,12 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
*p = Z_STRVAL_PP(arg);
*pl = Z_STRLEN_PP(arg);
break;
- case IS_OBJECT: {
- if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
- SEPARATE_ZVAL_IF_NOT_REF(arg);
- if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
- *pl = Z_STRLEN_PP(arg);
- *p = Z_STRVAL_PP(arg);
- break;
- }
+
+ case IS_OBJECT:
+ if (parse_arg_object_to_string(arg, p, pl, IS_STRING TSRMLS_CC) == SUCCESS) {
+ break;
}
- }
-
+
case IS_ARRAY:
case IS_RESOURCE:
default:
@@ -426,8 +456,9 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
} else {
return "resource";
}
- } else
+ } else {
*p = *arg;
+ }
}
break;
@@ -440,8 +471,9 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
} else {
return "array";
}
- } else
+ } else {
*p = *arg;
+ }
}
break;
@@ -469,8 +501,9 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
} else {
return "object";
}
- } else
+ } else {
*p = *arg;
+ }
}
break;
@@ -485,8 +518,10 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
} else {
if (Z_TYPE_PP(arg) == IS_NULL && return_null) {
*p = NULL;
+ } else if (ce) {
+ return ce->name;
} else {
- return ce ? ce->name : "object";
+ return "object";
}
}
}
@@ -497,6 +532,10 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
zend_class_entry **lookup, **pce = va_arg(*va, zend_class_entry **);
zend_class_entry *ce_base = *pce;
+ if (return_null && Z_TYPE_PP(arg) == IS_NULL) {
+ *pce = NULL;
+ break;
+ }
convert_to_string_ex(arg);
if (zend_lookup_class(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), &lookup TSRMLS_CC) == FAILURE) {
*pce = NULL;
@@ -514,7 +553,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
return "";
}
}
- if (!*pce && !return_null) {
+ if (!*pce) {
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%s%s%s() expects parameter %d to be a valid class name, '%s' given",
@@ -527,6 +566,22 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
}
break;
+ case 'f':
+ {
+ zend_fcall_info *fci = va_arg(*va, zend_fcall_info *);
+ zend_fcall_info_cache *fcc = va_arg(*va, zend_fcall_info_cache *);
+
+ if (zend_fcall_info_init(*arg, fci, fcc TSRMLS_CC) == SUCCESS) {
+ break;
+ } else if (return_null) {
+ fci->size = 0;
+ fcc->initialized = 0;
+ break;
+ } else {
+ return "function";
+ }
+ }
+
case 'z':
{
zval **p = va_arg(*va, zval **);
@@ -562,7 +617,7 @@ static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int
expected_type = zend_parse_arg_impl(arg_num, arg, va, spec TSRMLS_CC);
if (expected_type) {
- if (!quiet) {
+ if (!quiet && *expected_type) {
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
@@ -572,7 +627,7 @@ static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int
}
return FAILURE;
}
-
+
return SUCCESS;
}
@@ -596,6 +651,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
case 'o': case 'O':
case 'z': case 'Z':
case 'C': case 'h':
+ case 'f':
max_num_args++;
break;
@@ -646,7 +702,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
if (num_args > arg_count) {
zend_error(E_WARNING, "%s(): could not obtain parameters for parsing",
- get_active_function_name(TSRMLS_C));
+ get_active_function_name(TSRMLS_C));
return FAILURE;
}
@@ -669,7 +725,7 @@ ZEND_API int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *t
{
va_list va;
int retval;
-
+
va_start(va, type_spec);
retval = zend_parse_va_args(num_args, type_spec, &va, flags TSRMLS_CC);
va_end(va);
@@ -681,7 +737,7 @@ ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...)
{
va_list va;
int retval;
-
+
va_start(va, type_spec);
retval = zend_parse_va_args(num_args, type_spec, &va, 0 TSRMLS_CC);
va_end(va);
@@ -786,7 +842,7 @@ static int zend_merge_property(zval **value, int num_args, va_list args, zend_ha
}
-/* This function should be called after the constructor has been called
+/* This function should be called after the constructor has been called
* because it may call __set from the uninitialized object otherwise. */
ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destroy_ht TSRMLS_DC)
{
@@ -826,7 +882,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
#else
ALLOC_HASHTABLE(class_type->static_members);
#endif
- zend_hash_init(CE_STATIC_MEMBERS(class_type), 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(CE_STATIC_MEMBERS(class_type), zend_hash_num_elements(&class_type->default_static_members), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_internal_pointer_reset_ex(&class_type->default_static_members, &pos);
while (zend_hash_get_current_data_ex(&class_type->default_static_members, (void**)&p, &pos) == SUCCESS) {
@@ -846,7 +902,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)q, sizeof(zval*), NULL);
} else {
zval *q;
-
+
ALLOC_ZVAL(q);
*q = **p;
INIT_PZVAL(q);
@@ -865,7 +921,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
/* This function requires 'properties' to contain all props declared in the
- * class and all props being public. If only a subset is given or the class
+ * class and all props being public. If only a subset is given or the class
* has protected members then you need to merge the properties seperately by
* calling zend_merge_properties(). */
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC)
@@ -879,19 +935,19 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type
}
zend_update_class_constants(class_type TSRMLS_CC);
-
- arg->type = IS_OBJECT;
+
+ Z_TYPE_P(arg) = IS_OBJECT;
if (class_type->create_object == NULL) {
- arg->value.obj = zend_objects_new(&object, class_type TSRMLS_CC);
+ Z_OBJVAL_P(arg) = zend_objects_new(&object, class_type TSRMLS_CC);
if (properties) {
object->properties = properties;
} else {
ALLOC_HASHTABLE_REL(object->properties);
- zend_hash_init(object->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(object->properties, zend_hash_num_elements(&class_type->default_properties), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(object->properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
}
} else {
- arg->value.obj = class_type->create_object(class_type TSRMLS_CC);
+ Z_OBJVAL_P(arg) = class_type->create_object(class_type TSRMLS_CC);
}
return SUCCESS;
}
@@ -920,24 +976,24 @@ ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n)
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, n);
-
+
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_NULL(tmp);
-
+
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
@@ -947,10 +1003,10 @@ ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b)
ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, r);
-
+
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
@@ -958,7 +1014,7 @@ ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r)
ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
@@ -969,7 +1025,7 @@ ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d)
ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
@@ -980,7 +1036,7 @@ ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str,
ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
@@ -1017,10 +1073,10 @@ ZEND_API int add_index_null(zval *arg, ulong index)
ZEND_API int add_index_bool(zval *arg, ulong index, int b)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
@@ -1028,10 +1084,10 @@ ZEND_API int add_index_bool(zval *arg, ulong index, int b)
ZEND_API int add_index_resource(zval *arg, ulong index, int r)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, r);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
@@ -1039,10 +1095,10 @@ ZEND_API int add_index_resource(zval *arg, ulong index, int r)
ZEND_API int add_index_double(zval *arg, ulong index, double d)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
@@ -1050,7 +1106,7 @@ ZEND_API int add_index_double(zval *arg, ulong index, double d)
ZEND_API int add_index_string(zval *arg, ulong index, char *str, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
@@ -1061,7 +1117,7 @@ ZEND_API int add_index_string(zval *arg, ulong index, char *str, int duplicate)
ZEND_API int add_index_stringl(zval *arg, ulong index, char *str, uint length, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
@@ -1078,10 +1134,10 @@ ZEND_API int add_index_zval(zval *arg, ulong index, zval *value)
ZEND_API int add_next_index_long(zval *arg, long n)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, n);
-
+
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
@@ -1089,10 +1145,10 @@ ZEND_API int add_next_index_long(zval *arg, long n)
ZEND_API int add_next_index_null(zval *arg)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_NULL(tmp);
-
+
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
@@ -1100,10 +1156,10 @@ ZEND_API int add_next_index_null(zval *arg)
ZEND_API int add_next_index_bool(zval *arg, int b)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
-
+
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
@@ -1111,10 +1167,10 @@ ZEND_API int add_next_index_bool(zval *arg, int b)
ZEND_API int add_next_index_resource(zval *arg, int r)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, r);
-
+
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
@@ -1122,10 +1178,10 @@ ZEND_API int add_next_index_resource(zval *arg, int r)
ZEND_API int add_next_index_double(zval *arg, double d)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
-
+
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
@@ -1161,10 +1217,10 @@ ZEND_API int add_next_index_zval(zval *arg, zval *value)
ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
-
+
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), dest);
}
@@ -1172,7 +1228,7 @@ ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *s
ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
@@ -1183,10 +1239,10 @@ ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *
ZEND_API int add_get_index_long(zval *arg, ulong index, long l, void **dest)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, l);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
@@ -1194,10 +1250,10 @@ ZEND_API int add_get_index_long(zval *arg, ulong index, long l, void **dest)
ZEND_API int add_get_index_double(zval *arg, ulong index, double d, void **dest)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
@@ -1205,7 +1261,7 @@ ZEND_API int add_get_index_double(zval *arg, ulong index, double d, void **dest)
ZEND_API int add_get_index_string(zval *arg, ulong index, char *str, void **dest, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
@@ -1385,13 +1441,24 @@ ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC)
zend_error(E_CORE_WARNING, "Cannot load module '%s' because required module '%s' is not loaded", module->name, dep->name);
module->module_started = 0;
return FAILURE;
- }
+ }
efree(lcname);
}
++dep;
}
}
+ /* Initialize module globals */
+ if (module->globals_size) {
+#ifdef ZTS
+ ts_allocate_id(module->globals_id_ptr, module->globals_size, (ts_allocate_ctor) module->globals_ctor, (ts_allocate_dtor) module->globals_dtor);
+#else
+ if (module->globals_ctor) {
+ module->globals_ctor(module->globals_ptr TSRMLS_CC);
+ }
+#endif
+ }
+
if (module->module_startup_func) {
EG(current_module) = module;
if (module->module_startup_func(module->type, module->module_number TSRMLS_CC)==FAILURE) {
@@ -1409,7 +1476,7 @@ static void zend_sort_modules(void *base, size_t count, size_t siz, compare_func
Bucket **b1 = base;
Bucket **b2;
Bucket **end = b1 + count;
- Bucket *tmp;
+ Bucket *tmp;
zend_module_entry *m, *r;
while (b1 < end) {
@@ -1425,14 +1492,14 @@ try_again:
if (strcasecmp(dep->name, r->name) == 0) {
tmp = *b1;
*b1 = *b2;
- *b2 = tmp;
+ *b2 = tmp;
goto try_again;
}
b2++;
}
}
dep++;
- }
+ }
}
b1++;
}
@@ -1450,7 +1517,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS
int name_len;
char *lcname;
zend_module_entry *module_ptr;
-
+
if (!module) {
return NULL;
}
@@ -1473,7 +1540,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS
/* TODO: Check version relationship */
zend_error(E_CORE_WARNING, "Cannot load module '%s' because conflicting module '%s' is already loaded", module->name, dep->name);
return NULL;
- }
+ }
efree(lcname);
}
++dep;
@@ -1490,12 +1557,15 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS
}
efree(lcname);
module = module_ptr;
+ EG(current_module) = module;
if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type TSRMLS_CC)==FAILURE) {
+ EG(current_module) = NULL;
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name);
return NULL;
}
+ EG(current_module) = NULL;
return module;
}
@@ -1518,7 +1588,7 @@ ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_
lcname[sizeof(lcname)-1] = '\0'; /* zend_str_tolower_copy won't necessarily set the zero byte */
if (name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)) && fptr->common.num_args != 0) {
- zend_error(error_type, "Destuctor %s::%s() cannot take arguments", ce->name, ZEND_DESTRUCTOR_FUNC_NAME);
+ zend_error(error_type, "Destructor %s::%s() cannot take arguments", ce->name, ZEND_DESTRUCTOR_FUNC_NAME);
} else if (name_len == sizeof(ZEND_CLONE_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)) && fptr->common.num_args != 0) {
zend_error(error_type, "Method %s::%s() cannot accept any arguments", ce->name, ZEND_CLONE_FUNC_NAME);
} else if (name_len == sizeof(ZEND_GET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)) && fptr->common.num_args != 1) {
@@ -1543,7 +1613,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
int count=0, unload=0;
HashTable *target_function_table = function_table;
int error_type;
- zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL;
+ zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__tostring = NULL;
char *lowercase_name;
int fname_len;
char *lc_class_name = NULL;
@@ -1611,6 +1681,9 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
scope->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
}
}
+ if (ptr->flags & ZEND_ACC_STATIC && (!scope || !(scope->ce_flags & ZEND_ACC_INTERFACE))) {
+ zend_error(error_type, "Static function %s%s%s() cannot be abstract", scope ? scope->name : "", scope ? "::" : "", ptr->fname);
+ }
} else {
if (scope && (scope->ce_flags & ZEND_ACC_INTERFACE)) {
efree(lc_class_name);
@@ -1652,6 +1725,8 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
clone = reg_function;
} else if ((fname_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME))) {
__call = reg_function;
+ } else if ((fname_len == sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME))) {
+ __tostring = reg_function;
} else if ((fname_len == sizeof(ZEND_GET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME))) {
__get = reg_function;
} else if ((fname_len == sizeof(ZEND_SET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME))) {
@@ -1689,6 +1764,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
scope->destructor = dtor;
scope->clone = clone;
scope->__call = __call;
+ scope->__tostring = __tostring;
scope->__get = __get;
scope->__set = __set;
scope->__unset = __unset;
@@ -1720,6 +1796,12 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
}
__call->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
}
+ if (__tostring) {
+ if (__tostring->common.fn_flags & ZEND_ACC_STATIC) {
+ zend_error(error_type, "Method %s::%s() cannot be static", scope->name, __tostring->common.function_name);
+ }
+ __tostring->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
+ }
if (__get) {
if (__get->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(error_type, "Method %s::%s() cannot be static", scope->name, __get->common.function_name);
@@ -1749,7 +1831,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
return SUCCESS;
}
-/* count=-1 means erase all functions, otherwise,
+/* count=-1 means erase all functions, otherwise,
* erase the first count functions
*/
ZEND_API void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC)
@@ -1778,7 +1860,7 @@ ZEND_API void zend_unregister_functions(zend_function_entry *functions, int coun
ZEND_API int zend_startup_module(zend_module_entry *module)
{
TSRMLS_FETCH();
-
+
if ((module = zend_register_internal_module(module TSRMLS_CC)) != NULL &&
zend_startup_module_ex(module TSRMLS_CC) == SUCCESS) {
return SUCCESS;
@@ -1790,7 +1872,7 @@ ZEND_API int zend_startup_module(zend_module_entry *module)
ZEND_API int zend_get_module_started(char *module_name)
{
zend_module_entry *module;
-
+
return (zend_hash_find(&module_registry, module_name, strlen(module_name)+1, (void**)&module) == SUCCESS && module->module_started) ? SUCCESS : FAILURE;
}
@@ -1810,6 +1892,18 @@ void module_destructor(zend_module_entry *module)
#endif
module->module_shutdown_func(module->type, module->module_number TSRMLS_CC);
}
+
+ /* Deinitilaise module globals */
+ if (module->globals_size) {
+#ifdef ZTS
+ ts_free_id(*module->globals_id_ptr);
+#else
+ if (module->globals_dtor) {
+ module->globals_dtor(module->globals_ptr TSRMLS_CC);
+ }
+#endif
+ }
+
module->module_started=0;
if (module->functions) {
zend_unregister_functions(module->functions, -1, NULL TSRMLS_CC);
@@ -1817,9 +1911,9 @@ void module_destructor(zend_module_entry *module)
#if HAVE_LIBDL || defined(HAVE_MACH_O_DYLD_H)
#if !(defined(NETWARE) && defined(APACHE_1_BUILD))
- if (module->handle) {
- DL_UNLOAD(module->handle);
- }
+ if (module->handle) {
+ DL_UNLOAD(module->handle);
+ }
#endif
#endif
}
@@ -1915,24 +2009,14 @@ ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *cla
ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int num_interfaces, ...)
{
zend_class_entry *interface_entry;
- int ce_num = class_entry->num_interfaces, impl_num;
va_list interface_list;
va_start(interface_list, num_interfaces);
- if (class_entry->type & ZEND_INTERNAL_CLASS) {
- class_entry->interfaces = realloc(class_entry->interfaces, sizeof(zend_class_entry*) * (class_entry->num_interfaces+num_interfaces));
- } else {
- class_entry->interfaces = erealloc(class_entry->interfaces, sizeof(zend_class_entry*) * (class_entry->num_interfaces+num_interfaces));
- }
-
while (num_interfaces--) {
interface_entry = va_arg(interface_list, zend_class_entry *);
- class_entry->interfaces[class_entry->num_interfaces++] = interface_entry;
- }
- impl_num = class_entry->num_interfaces;
- while(ce_num < impl_num) {
- zend_do_implement_interface(class_entry, class_entry->interfaces[ce_num++] TSRMLS_CC);
+ zend_do_implement_interface(class_entry, interface_entry TSRMLS_CC);
}
+
va_end(interface_list);
}
@@ -1951,21 +2035,21 @@ ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *or
ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
zend_bool is_ref, int num_symbol_tables, ...)
{
- HashTable *symbol_table;
- va_list symbol_table_list;
+ HashTable *symbol_table;
+ va_list symbol_table_list;
- if (num_symbol_tables <= 0) return FAILURE;
+ if (num_symbol_tables <= 0) return FAILURE;
- symbol->is_ref = is_ref;
+ symbol->is_ref = is_ref;
- va_start(symbol_table_list, num_symbol_tables);
- while (num_symbol_tables-- > 0) {
- symbol_table = va_arg(symbol_table_list, HashTable *);
- zend_hash_update(symbol_table, name, name_length + 1, &symbol, sizeof(zval *), NULL);
- zval_add_ref(&symbol);
- }
- va_end(symbol_table_list);
- return SUCCESS;
+ va_start(symbol_table_list, num_symbol_tables);
+ while (num_symbol_tables-- > 0) {
+ symbol_table = va_arg(symbol_table_list, HashTable *);
+ zend_hash_update(symbol_table, name, name_length + 1, &symbol, sizeof(zval *), NULL);
+ zval_add_ref(&symbol);
+ }
+ va_end(symbol_table_list);
+ return SUCCESS;
}
@@ -2013,13 +2097,14 @@ ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_
{
zend_class_entry *disabled_class;
disabled_class = (zend_class_entry *) emalloc(sizeof(zend_class_entry));
-
+
zend_str_tolower(class_name, class_name_length);
if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) {
return FAILURE;
}
INIT_CLASS_ENTRY((*disabled_class), class_name, disabled_class_new);
disabled_class->create_object = display_disabled_class;
+ disabled_class->name_length = class_name_length;
zend_register_internal_class(disabled_class TSRMLS_CC);
return 1;
}
@@ -2032,7 +2117,7 @@ static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, ze
zend_function *fptr;
zend_class_entry **pce;
HashTable *ftable;
-
+
*ce_ptr = NULL;
*fptr_ptr = NULL;
@@ -2153,7 +2238,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, char **
zend_class_entry *ce = NULL;
zval **method;
zval **obj;
-
+
if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2 &&
zend_hash_index_find(Z_ARRVAL_P(callable), 0, (void **) &obj) == SUCCESS &&
zend_hash_index_find(Z_ARRVAL_P(callable), 1, (void **) &method) == SUCCESS &&
@@ -2188,7 +2273,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, char **
efree(lcname);
} else {
ce = Z_OBJCE_PP(obj); /* TBFixed: what if it's overloaded? */
-
+
*zobj_ptr_ptr = obj;
if (callable_name) {
@@ -2264,15 +2349,105 @@ ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRML
}
+ZEND_API int zend_fcall_info_init(zval *callable, zend_fcall_info *fci, zend_fcall_info_cache *fcc TSRMLS_DC)
+{
+ zend_class_entry *ce;
+ zend_function *func;
+ zval **obj;
+
+ if (!zend_is_callable_ex(callable, IS_CALLABLE_STRICT, NULL, NULL, &ce, &func, &obj TSRMLS_CC)) {
+ return FAILURE;
+ }
+
+ fci->size = sizeof(*fci);
+ fci->function_table = ce ? &ce->function_table : EG(function_table);
+ fci->object_pp = obj;
+ fci->function_name = NULL;
+ fci->retval_ptr_ptr = NULL;
+ fci->param_count = 0;
+ fci->params = NULL;
+ fci->no_separation = 1;
+ fci->symbol_table = NULL;
+
+ fcc->initialized = 1;
+ fcc->function_handler = func;
+ fcc->calling_scope = ce;
+ fcc->object_pp = obj;
+
+ return SUCCESS;
+}
+
+
+ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC)
+{
+ HashPosition pos;
+ zval **arg, ***params;
+
+ if (fci->params) {
+ while (fci->param_count) {
+ zval_ptr_dtor(fci->params[--fci->param_count]);
+ }
+ efree(fci->params);
+ }
+ fci->params = NULL;
+ fci->param_count = 0;
+
+ if (!args) {
+ return SUCCESS;
+ }
+
+ if (Z_TYPE_P(args) != IS_ARRAY) {
+ return FAILURE;
+ }
+
+ fci->param_count = zend_hash_num_elements(Z_ARRVAL_P(args));
+ fci->params = params = (zval***)safe_emalloc(sizeof(zval**), fci->param_count, 0);
+
+ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), &pos);
+
+ while (zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **) &arg, &pos) == SUCCESS) {
+ *params++ = arg;
+ (*arg)->refcount++;
+ zend_hash_move_forward_ex(Z_ARRVAL_P(args), &pos);
+ }
+ return SUCCESS;
+}
+
+
+ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval_ptr_ptr, zval *args TSRMLS_DC)
+{
+ zval *retval, ***org_params = NULL;
+ int result, org_count = 0;
+
+ fci->retval_ptr_ptr = retval_ptr_ptr ? retval_ptr_ptr : &retval;
+ if (args) {
+ org_params = fci->params;
+ org_count = fci->param_count;
+ zend_fcall_info_args(fci, args TSRMLS_CC);
+ }
+ result = zend_call_function(fci, fcc TSRMLS_CC);
+
+ if (!retval_ptr_ptr && retval) {
+ zval_ptr_dtor(&retval);
+ }
+ if (args) {
+ zend_fcall_info_args(fci, NULL TSRMLS_CC);
+ fci->params = org_params;
+ fci->param_count = org_count;
+ }
+ return result;
+}
+
+
ZEND_API char *zend_get_module_version(char *module_name)
{
zend_module_entry *module;
if (zend_hash_find(&module_registry, module_name, strlen(module_name) + 1,
- (void**)&module) == FAILURE) {
+ (void**)&module) == FAILURE) {
return NULL;
}
- return module->version;
+ return module->version;
}
@@ -2346,7 +2521,9 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, char *name, int name
property_info.doc_comment = doc_comment;
property_info.doc_comment_len = doc_comment_len;
-
+
+ property_info.ce = ce;
+
zend_hash_update(&ce->properties_info, name, name_length + 1, &property_info, sizeof(zend_property_info), NULL);
return SUCCESS;
@@ -2355,7 +2532,7 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, char *name, int name
ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC)
{
zval *property;
-
+
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
} else {
@@ -2368,7 +2545,7 @@ ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int na
ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC)
{
zval *property;
-
+
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
} else {
@@ -2382,7 +2559,7 @@ ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int na
ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC)
{
zval *property;
-
+
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
} else {
@@ -2396,7 +2573,7 @@ ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int na
ZEND_API int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC)
{
zval *property;
-
+
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
} else {
@@ -2411,7 +2588,7 @@ ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int
{
zval *property;
int len = strlen(value);
-
+
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
ZVAL_STRINGL(property, zend_strndup(value, len), len, 0);
@@ -2426,7 +2603,7 @@ ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int
ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, char *name, int name_length, char *value, int value_len, int access_type TSRMLS_DC)
{
zval *property;
-
+
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
ZVAL_STRINGL(property, zend_strndup(value, value_len), value_len, 0);
@@ -2523,7 +2700,7 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *
{
zval *property;
zend_class_entry *old_scope = EG(scope);
-
+
EG(scope) = scope;
if (!Z_OBJ_HT_P(object)->write_property) {
@@ -2531,7 +2708,7 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *
zend_uint class_name_len;
zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
-
+
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be updated", name, class_name);
}
MAKE_STD_ZVAL(property);
@@ -2556,7 +2733,7 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, c
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@@ -2567,7 +2744,7 @@ ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, c
ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@@ -2578,7 +2755,7 @@ ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, c
ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@@ -2589,7 +2766,7 @@ ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object,
ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@@ -2600,7 +2777,7 @@ ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object,
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@@ -2612,7 +2789,7 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, in
{
zval **property;
zend_class_entry *old_scope = EG(scope);
-
+
EG(scope) = scope;
property = zend_std_get_static_property(scope, name, name_length, 0 TSRMLS_CC);
EG(scope) = old_scope;
@@ -2622,7 +2799,7 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, in
if (*property != value) {
if (PZVAL_IS_REF(*property)) {
zval_dtor(*property);
- (*property)->type = value->type;
+ Z_TYPE_PP(property) = Z_TYPE_P(value);
(*property)->value = value->value;
if (value->refcount > 0) {
zval_copy_ctor(*property);
@@ -2656,7 +2833,7 @@ ZEND_API int zend_update_static_property_null(zend_class_entry *scope, char *nam
ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@@ -2667,7 +2844,7 @@ ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *nam
ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@@ -2678,7 +2855,7 @@ ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *nam
ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *name, int name_length, double value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@@ -2689,7 +2866,7 @@ ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *n
ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@@ -2700,7 +2877,7 @@ ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *n
ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@@ -2712,7 +2889,7 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *n
{
zval *property, *value;
zend_class_entry *old_scope = EG(scope);
-
+
EG(scope) = scope;
if (!Z_OBJ_HT_P(object)->read_property) {
@@ -2722,10 +2899,12 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *n
zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be read", name, class_name);
}
+
MAKE_STD_ZVAL(property);
ZVAL_STRINGL(property, name, name_length, 1);
- value = Z_OBJ_HT_P(object)->read_property(object, property, silent TSRMLS_CC);
+ value = Z_OBJ_HT_P(object)->read_property(object, property, silent?BP_VAR_IS:BP_VAR_R TSRMLS_CC);
zval_ptr_dtor(&property);
+
EG(scope) = old_scope;
return value;
}
@@ -2734,7 +2913,7 @@ ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, in
{
zval **property;
zend_class_entry *old_scope = EG(scope);
-
+
EG(scope) = scope;
property = zend_std_get_static_property(scope, name, name_length, silent TSRMLS_CC);
EG(scope) = old_scope;
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index c0d580546..ac8692e9d 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -18,14 +18,13 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.h,v 1.207.2.8 2006/03/05 16:12:24 helly Exp $ */
+/* $Id: zend_API.h,v 1.207.2.8.2.5 2006/07/18 09:06:32 dmitry Exp $ */
#ifndef ZEND_API_H
#define ZEND_API_H
#include "zend_modules.h"
#include "zend_list.h"
-#include "zend_fast_cache.h"
#include "zend_operators.h"
#include "zend_variables.h"
#include "zend_execute.h"
@@ -42,9 +41,10 @@ typedef struct _zend_function_entry {
} zend_function_entry;
#define ZEND_FN(name) zif_##name
+#define ZEND_MN(name) zim_##name
#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
#define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(ZEND_FN(name))
-#define ZEND_METHOD(classname, name) ZEND_NAMED_FUNCTION(ZEND_FN(classname##_##name))
+#define ZEND_METHOD(classname, name) ZEND_NAMED_FUNCTION(ZEND_MN(classname##_##name))
#define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags },
@@ -53,11 +53,12 @@ typedef struct _zend_function_entry {
#define ZEND_DEP_FE(name, arg_info) ZEND_FENTRY(name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
#define ZEND_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, 0)
#define ZEND_DEP_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, ZEND_ACC_DEPRECATED)
-#define ZEND_ME(classname, name, arg_info, flags) ZEND_FENTRY(name, ZEND_FN(classname##_##name), arg_info, flags)
+#define ZEND_NAMED_ME(zend_name, name, arg_info, flags) ZEND_FENTRY(zend_name, name, arg_info, flags)
+#define ZEND_ME(classname, name, arg_info, flags) ZEND_FENTRY(name, ZEND_MN(classname##_##name), arg_info, flags)
#define ZEND_ABSTRACT_ME(classname, name, arg_info) ZEND_FENTRY(name, NULL, arg_info, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
#define ZEND_MALIAS(classname, name, alias, arg_info, flags) \
- ZEND_FENTRY(name, ZEND_FN(classname##_##alias), arg_info, flags)
-#define ZEND_ME_MAPPING(name, func_name, arg_types) ZEND_NAMED_FE(name, ZEND_FN(func_name), arg_types)
+ ZEND_FENTRY(name, ZEND_MN(classname##_##alias), arg_info, flags)
+#define ZEND_ME_MAPPING(name, func_name, arg_types, flags) ZEND_NAMED_ME(name, ZEND_FN(func_name), arg_types, flags)
#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, 0, pass_by_ref, 0, 0 },
#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, 0, pass_by_ref, 0, 0 },
@@ -77,6 +78,8 @@ typedef struct _zend_function_entry {
#define ZEND_MODULE_DEACTIVATE_N(module) zm_deactivate_##module
#define ZEND_MODULE_POST_ZEND_DEACTIVATE_N(module) zm_post_zend_deactivate_##module
#define ZEND_MODULE_INFO_N(module) zm_info_##module
+#define ZEND_MODULE_GLOBALS_CTOR_N(module) zm_globals_ctor_##module
+#define ZEND_MODULE_GLOBALS_DTOR_N(module) zm_globals_dtor_##module
/* Declaration macros */
#define ZEND_MODULE_STARTUP_D(module) int ZEND_MODULE_STARTUP_N(module)(INIT_FUNC_ARGS)
@@ -85,6 +88,8 @@ typedef struct _zend_function_entry {
#define ZEND_MODULE_DEACTIVATE_D(module) int ZEND_MODULE_DEACTIVATE_N(module)(SHUTDOWN_FUNC_ARGS)
#define ZEND_MODULE_POST_ZEND_DEACTIVATE_D(module) int ZEND_MODULE_POST_ZEND_DEACTIVATE_N(module)(void)
#define ZEND_MODULE_INFO_D(module) void ZEND_MODULE_INFO_N(module)(ZEND_MODULE_INFO_FUNC_ARGS)
+#define ZEND_MODULE_GLOBALS_CTOR_D(module) void ZEND_MODULE_GLOBALS_CTOR_N(module)(zend_##module##_globals *module##_globals TSRMLS_DC)
+#define ZEND_MODULE_GLOBALS_DTOR_D(module) void ZEND_MODULE_GLOBALS_DTOR_N(module)(zend_##module##_globals *module##_globals TSRMLS_DC)
#define ZEND_GET_MODULE(name) \
BEGIN_EXTERN_C()\
@@ -116,8 +121,6 @@ typedef struct _zend_function_entry {
#endif
-
-
#define INIT_CLASS_ENTRY(class_container, class_name, functions) INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, NULL, NULL, NULL)
#define INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
@@ -128,21 +131,26 @@ typedef struct _zend_function_entry {
class_container.constructor = NULL; \
class_container.destructor = NULL; \
class_container.clone = NULL; \
- class_container.create_object = NULL; \
+ class_container.serialize = NULL; \
+ class_container.unserialize = NULL; \
+ class_container.create_object = NULL; \
class_container.interface_gets_implemented = NULL; \
- class_container.__call = handle_fcall; \
- class_container.__get = handle_propget; \
- class_container.__set = handle_propset; \
- class_container.__unset = handle_propunset; \
- class_container.__isset = handle_propisset; \
- class_container.serialize = NULL; \
- class_container.unserialize = NULL; \
- class_container.parent = NULL; \
- class_container.num_interfaces = 0; \
- class_container.interfaces = NULL; \
- class_container.get_iterator = NULL; \
- class_container.iterator_funcs.funcs = NULL; \
- class_container.module = NULL; \
+ class_container.__call = handle_fcall; \
+ class_container.__tostring = NULL; \
+ class_container.__get = handle_propget; \
+ class_container.__set = handle_propset; \
+ class_container.__unset = handle_propunset; \
+ class_container.__isset = handle_propisset; \
+ class_container.serialize_func = NULL; \
+ class_container.unserialize_func = NULL; \
+ class_container.serialize = NULL; \
+ class_container.unserialize = NULL; \
+ class_container.parent = NULL; \
+ class_container.num_interfaces = 0; \
+ class_container.interfaces = NULL; \
+ class_container.get_iterator = NULL; \
+ class_container.iterator_funcs.funcs = NULL; \
+ class_container.module = NULL; \
}
#define INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset) \
@@ -253,6 +261,7 @@ ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, in
ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC);
ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uint *class_name_len TSRMLS_DC);
+ZEND_API char *zend_get_type_by_const(int type);
#define getThis() (this_ptr)
@@ -347,7 +356,7 @@ ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *valu
#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) + 1 TSRMLS_CC)
#define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key)+1, __b TSRMLS_CC)
#define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key)+1, __r TSRMLS_CC)
-#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC)
+#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC)
#define add_property_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
#define add_property_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC)
@@ -379,6 +388,26 @@ typedef struct _zend_fcall_info_cache {
BEGIN_EXTERN_C()
ZEND_API extern zend_fcall_info_cache empty_fcall_info_cache;
+/** Build zend_call_info/cache from a zval*
+ *
+ * Caller is responsible to provide a return value, otherwise the we will crash.
+ * fci->retval_ptr_ptr = NULL;
+ * In order to pass parameters the following members need to be set:
+ * fci->param_count = 0;
+ * fci->params = NULL;
+ */
+ZEND_API int zend_fcall_info_init(zval *callable, zend_fcall_info *fci, zend_fcall_info_cache *fcc TSRMLS_DC);
+
+/** Set or clear the arguments in the zend_call_info struct taking care of
+ * refcount. If args is NULL and arguments are set then those are cleared.
+ */
+ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC);
+
+/** Call a function using information created by zend_fcall_info_init()/args().
+ * If args is given then those replace the arguement info in fci is temporarily.
+ */
+ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval, zval *args TSRMLS_DC);
+
ZEND_API int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC);
@@ -405,28 +434,28 @@ END_EXTERN_C()
#define CHECK_ZVAL_STRING_REL(z)
#endif
-#define ZVAL_RESOURCE(z, l) { \
- (z)->type = IS_RESOURCE; \
- (z)->value.lval = l; \
+#define ZVAL_RESOURCE(z, l) { \
+ Z_TYPE_P(z) = IS_RESOURCE; \
+ Z_LVAL_P(z) = l; \
}
-#define ZVAL_BOOL(z, b) { \
- (z)->type = IS_BOOL; \
- (z)->value.lval = ((b) != 0); \
+#define ZVAL_BOOL(z, b) { \
+ Z_TYPE_P(z) = IS_BOOL; \
+ Z_LVAL_P(z) = ((b) != 0); \
}
-#define ZVAL_NULL(z) { \
- (z)->type = IS_NULL; \
+#define ZVAL_NULL(z) { \
+ Z_TYPE_P(z) = IS_NULL; \
}
-#define ZVAL_LONG(z, l) { \
- (z)->type = IS_LONG; \
- (z)->value.lval = l; \
+#define ZVAL_LONG(z, l) { \
+ Z_TYPE_P(z) = IS_LONG; \
+ Z_LVAL_P(z) = l; \
}
-#define ZVAL_DOUBLE(z, d) { \
- (z)->type = IS_DOUBLE; \
- (z)->value.dval = d; \
+#define ZVAL_DOUBLE(z, d) { \
+ Z_TYPE_P(z) = IS_DOUBLE; \
+ Z_DVAL_P(z) = d; \
}
#define ZVAL_STRING(z, s, duplicate) { \
@@ -576,8 +605,8 @@ END_EXTERN_C()
zend_declare_property(class_ptr, _name, namelen, value, mask TSRMLS_CC); \
}
-#define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL)))
-#define ZVAL_IS_NULL(z) ((z)->type==IS_NULL)
+#define HASH_OF(p) (Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL)))
+#define ZVAL_IS_NULL(z) (Z_TYPE_P(z)==IS_NULL)
/* For compatibility */
#define ZEND_MINIT ZEND_MODULE_STARTUP_N
@@ -585,15 +614,19 @@ END_EXTERN_C()
#define ZEND_RINIT ZEND_MODULE_ACTIVATE_N
#define ZEND_RSHUTDOWN ZEND_MODULE_DEACTIVATE_N
#define ZEND_MINFO ZEND_MODULE_INFO_N
+#define ZEND_GINIT(module) ((void (*)(void* TSRMLS_DC))(ZEND_MODULE_GLOBALS_CTOR_N(module)))
+#define ZEND_GSHUTDOWN(module) ((void (*)(void* TSRMLS_DC))(ZEND_MODULE_GLOBALS_DTOR_N(module)))
#define ZEND_MINIT_FUNCTION ZEND_MODULE_STARTUP_D
#define ZEND_MSHUTDOWN_FUNCTION ZEND_MODULE_SHUTDOWN_D
#define ZEND_RINIT_FUNCTION ZEND_MODULE_ACTIVATE_D
#define ZEND_RSHUTDOWN_FUNCTION ZEND_MODULE_DEACTIVATE_D
#define ZEND_MINFO_FUNCTION ZEND_MODULE_INFO_D
+#define ZEND_GINIT_FUNCTION ZEND_MODULE_GLOBALS_CTOR_D
+#define ZEND_GSHUTDOWN_FUNCTION ZEND_MODULE_GLOBALS_DTOR_D
END_EXTERN_C()
-
+
#endif /* ZEND_API_H */
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index a63d00e97..8873daeb1 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 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 |
+ | 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 |
@@ -14,15 +14,17 @@
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
+ | Dmitry Sogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: zend_alloc.c,v 1.144.2.4 2006/08/10 17:16:24 iliaa Exp $ */
+/* $Id: zend_alloc.c,v 1.144.2.3.2.12 2006/10/12 06:46:51 dmitry Exp $ */
#include "zend.h"
#include "zend_alloc.h"
#include "zend_globals.h"
-#include "zend_fast_cache.h"
+#include "zend_operators.h"
+
#ifdef HAVE_SIGNAL_H
# include <signal.h>
#endif
@@ -30,794 +32,1869 @@
# include <unistd.h>
#endif
-#include "zend_mm.h"
-
-#ifndef ZTS
-ZEND_API zend_alloc_globals alloc_globals;
+#ifndef ZEND_USE_MALLOC_MM
+# define ZEND_USE_MALLOC_MM ZEND_DEBUG
#endif
+#if ZEND_DEBUG
+void zend_debug_alloc_output(char *format, ...)
+{
+ char output_buf[256];
+ va_list args;
-#ifdef ZEND_MM
-#define ZEND_DISABLE_MEMORY_CACHE 0
-#else
-#define ZEND_DISABLE_MEMORY_CACHE 0
-#endif
+ va_start(args, format);
+ vsprintf(output_buf, format, args);
+ va_end(args);
-#ifdef ZEND_MM
-#define ZEND_DO_MALLOC(size) zend_mm_alloc(&AG(mm_heap), size)
-#define ZEND_DO_FREE(ptr) zend_mm_free(&AG(mm_heap), ptr)
-#define ZEND_DO_REALLOC(ptr, size) zend_mm_realloc(&AG(mm_heap), ptr, size)
-#elif defined(ZEND_WIN32)
-#define ZEND_DO_MALLOC(size) (AG(memory_heap) ? HeapAlloc(AG(memory_heap), HEAP_NO_SERIALIZE, size) : malloc(size))
-#define ZEND_DO_FREE(ptr) (AG(memory_heap) ? HeapFree(AG(memory_heap), HEAP_NO_SERIALIZE, ptr) : free(ptr))
-#define ZEND_DO_REALLOC(ptr, size) (AG(memory_heap) ? HeapReAlloc(AG(memory_heap), HEAP_NO_SERIALIZE, ptr, size) : realloc(ptr, size))
+#ifdef ZEND_WIN32
+ OutputDebugString(output_buf);
#else
-#define ZEND_DO_MALLOC(size) malloc(size)
-#define ZEND_DO_FREE(ptr) free(ptr)
-#define ZEND_DO_REALLOC(ptr, size) realloc(ptr, size)
+ fprintf(stderr, "%s", output_buf);
+#endif
+}
#endif
-#if ZEND_DEBUG
-# define END_MAGIC_SIZE sizeof(long)
-static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
+static void zend_mm_panic(const char *message)
+{
+ fprintf(stderr, "%s\n", message);
+#if ZEND_DEBUG && defined(HAVE_KILL) && defined(HAVE_GETPID)
+ kill(getpid(), SIGSEGV);
#else
-# define END_MAGIC_SIZE 0
+ exit(1);
#endif
+}
+/*******************/
+/* Storage Manager */
+/*******************/
-# if MEMORY_LIMIT
-# if ZEND_DEBUG
-#define CHECK_MEMORY_LIMIT(s, rs) _CHECK_MEMORY_LIMIT(s, rs, __zend_filename, __zend_lineno)
-# else
-#define CHECK_MEMORY_LIMIT(s, rs) _CHECK_MEMORY_LIMIT(s, rs, NULL, 0)
-# endif
+#ifdef ZEND_WIN32
+# define HAVE_MEM_WIN32 /* use VirtualAlloc() to allocate memory */
+#endif
+#define HAVE_MEM_MALLOC /* use malloc() to allocate segments */
-#define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { if ((ssize_t)(rs) > (ssize_t)(INT_MAX - AG(allocated_memory))) { \
- if (file) { \
- fprintf(stderr, "Integer overflow in memory_limit check detected at %s:%d\n", file, lineno); \
- } else { \
- fprintf(stderr, "Integer overflow in memory_limit check detected\n"); \
- } \
- exit(1); \
- } \
- AG(allocated_memory) += rs;\
- if (AG(memory_limit)<AG(allocated_memory)) {\
- int php_mem_limit = AG(memory_limit); \
- AG(allocated_memory) -= rs; \
- if (EG(in_execution) && AG(memory_limit)+1048576 > AG(allocated_memory)) { \
- AG(memory_limit) = AG(allocated_memory) + 1048576; \
- if (file) { \
- zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", php_mem_limit, file, lineno, s); \
- } else { \
- zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", php_mem_limit, s); \
- } \
- } else { \
- if (file) { \
- fprintf(stderr, "Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)\n", php_mem_limit, file, lineno, s); \
- } else { \
- fprintf(stderr, "Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)\n", php_mem_limit, s); \
- } \
- exit(1); \
- } \
- } \
- }
+#include <sys/types.h>
+#include <sys/stat.h>
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#include <fcntl.h>
+#include <errno.h>
+
+#if defined(HAVE_MEM_MMAP_ANON) || defined(HAVE_MEM_MMAP_ZERO)
+# include <sys/mman.h>
+# ifndef MAP_ANON
+# ifdef MAP_ANONYMOUS
+# define MAP_ANON MAP_ANONYMOUS
+# endif
+# endif
+# ifndef MREMAP_MAYMOVE
+# define MREMAP_MAYMOVE 0
+# endif
+# ifndef MAP_FAILED
+# define MAP_FAILED ((void*)-1)
# endif
-
-#ifndef CHECK_MEMORY_LIMIT
-#define CHECK_MEMORY_LIMIT(s, rs)
#endif
+static zend_mm_storage* zend_mm_mem_dummy_init(void *params)
+{
+ return malloc(sizeof(zend_mm_storage));
+}
+
+static void zend_mm_mem_dummy_dtor(zend_mm_storage *storage)
+{
+ free(storage);
+}
-#if ZEND_DEBUG || !defined(ZEND_MM)
-#define REMOVE_POINTER_FROM_LIST(p) \
- if (p==AG(head)) { \
- AG(head) = p->pNext; \
- } else { \
- p->pLast->pNext = p->pNext; \
- } \
- if (p->pNext) { \
- p->pNext->pLast = p->pLast; \
+#if defined(HAVE_MEM_MMAP_ANON) || defined(HAVE_MEM_MMAP_ZERO)
+
+static zend_mm_segment* zend_mm_mem_mmap_realloc(zend_mm_storage *storage, zend_mm_segment* segment, size_t size)
+{
+ zend_mm_segment *ret;
+#ifdef HAVE_MREMAP
+ ret = (zend_mm_segment*)mremap(segment, segment->size, size, MREMAP_MAYMOVE);
+ if (ret == MAP_FAILED) {
+#endif
+ ret = storage->handlers->_alloc(storage, size);
+ if (ret) {
+ memcpy(ret, segment, size > segment->size ? segment->size : size);
+ storage->handlers->_free(storage, segment);
+ }
+#ifdef HAVE_MREMAP
}
-#else
-#define REMOVE_POINTER_FROM_LIST(p)
#endif
+ return ret;
+}
+
+static void zend_mm_mem_mmap_free(zend_mm_storage *storage, zend_mm_segment* segment)
+{
+ munmap(segment, segment->size);
+}
-#if ZEND_DEBUG || !defined(ZEND_MM)
-#define ADD_POINTER_TO_LIST(p) \
- p->pNext = AG(head); \
- if (AG(head)) { \
- AG(head)->pLast = p; \
- } \
- AG(head) = p; \
- p->pLast = (zend_mem_header *) NULL;
-#else
-#define ADD_POINTER_TO_LIST(p)
#endif
-#define DECLARE_CACHE_VARS() \
- size_t real_size; \
- unsigned int cache_index
+#ifdef HAVE_MEM_MMAP_ANON
-#define REAL_SIZE(size) ((size+7) & ~0x7)
+static zend_mm_segment* zend_mm_mem_mmap_anon_alloc(zend_mm_storage *storage, size_t size)
+{
+ zend_mm_segment *ret = (zend_mm_segment*)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (ret == MAP_FAILED) {
+ ret = NULL;
+ }
+ return ret;
+}
-#define CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size) \
- real_size = REAL_SIZE(size); \
- cache_index = real_size >> 3;
+# define ZEND_MM_MEM_MMAP_ANON_DSC {"mmap_anon", zend_mm_mem_dummy_init, zend_mm_mem_dummy_dtor, zend_mm_mem_mmap_anon_alloc, zend_mm_mem_mmap_realloc, zend_mm_mem_mmap_free}
-#define SIZE real_size
+#endif
-#define CACHE_INDEX cache_index
+#ifdef HAVE_MEM_MMAP_ZERO
-ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+static int zend_mm_dev_zero_fd = -1;
+
+static zend_mm_storage* zend_mm_mem_mmap_zero_init(void *params)
{
- zend_mem_header *p = NULL;
- DECLARE_CACHE_VARS();
- TSRMLS_FETCH();
+ if (zend_mm_dev_zero_fd != -1) {
+ zend_mm_dev_zero_fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
+ }
+ if (zend_mm_dev_zero_fd >= 0) {
+ return malloc(sizeof(zend_mm_storage));
+ } else {
+ return NULL;
+ }
+}
- CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
+static void zend_mm_mem_mmap_zero_dtor(zend_mm_storage *storage)
+{
+ close(zend_mm_dev_zero_fd);
+ free(storage);
+}
- if (size > INT_MAX || SIZE < size) {
- goto emalloc_error;
+static zend_mm_segment* zend_mm_mem_mmap_zero_alloc(zend_mm_storage *storage, size_t size)
+{
+ zend_mm_segment *ret = (zend_mm_segment*)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, zend_mm_dev_zero_fd, 0);
+ if (ret == MAP_FAILED) {
+ ret = NULL;
}
+ return ret;
+}
+
+# define ZEND_MM_MEM_MMAP_ZERO_DSC {"mmap_zero", zend_mm_mem_mmap_zero_init, zend_mm_mem_mmap_zero_dtor, zend_mm_mem_mmap_zero_alloc, zend_mm_mem_mmap_realloc, zend_mm_mem_mmap_free}
+
+#endif
+
+#ifdef HAVE_MEM_WIN32
+
+static zend_mm_segment* zend_mm_mem_win32_alloc(zend_mm_storage *storage, size_t size)
+{
+ return (zend_mm_segment*) VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);
+}
+
+static void zend_mm_mem_win32_free(zend_mm_storage *storage, zend_mm_segment* segment)
+{
+ VirtualFree(segment, segment->size, MEM_RELEASE);
+}
+
+static zend_mm_segment* zend_mm_mem_win32_realloc(zend_mm_storage *storage, zend_mm_segment* segment, size_t size)
+{
+ if (size < segment->size) {
+ VirtualFree((char*)segment + size, segment->size - size, MEM_RELEASE);
+ } else if (size > segment->size) {
+ if (!VirtualAlloc((char*)segment + segment->size, size - segment->size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE)) {
+ zend_mm_segment *ret = zend_mm_mem_win32_alloc(storage, size);
+
+ if (ret) {
+ memcpy(ret, segment, size > segment->size ? segment->size : size);
+ zend_mm_mem_win32_free(storage, segment);
+ }
+ segment = ret;
+ }
+ }
+ return segment;
+}
+
+# define ZEND_MM_MEM_WIN32_DSC {"win32", zend_mm_mem_dummy_init, zend_mm_mem_dummy_dtor, zend_mm_mem_win32_alloc, zend_mm_mem_win32_realloc, zend_mm_mem_win32_free}
+
+#endif
+
+#ifdef HAVE_MEM_MALLOC
-#if !ZEND_DISABLE_MEMORY_CACHE
- if ((CACHE_INDEX < MAX_CACHED_MEMORY) && (AG(cache_count)[CACHE_INDEX] > 0)) {
- p = AG(cache)[CACHE_INDEX][--AG(cache_count)[CACHE_INDEX]];
+static zend_mm_segment* zend_mm_mem_malloc_alloc(zend_mm_storage *storage, size_t size)
+{
+ return (zend_mm_segment*)malloc(size);
+}
+
+static zend_mm_segment* zend_mm_mem_malloc_realloc(zend_mm_storage *storage, zend_mm_segment *ptr, size_t size)
+{
+ return (zend_mm_segment*)realloc(ptr, size);
+}
+
+static void zend_mm_mem_malloc_free(zend_mm_storage *storage, zend_mm_segment *ptr)
+{
+ free(ptr);
+}
+
+# define ZEND_MM_MEM_MALLOC_DSC {"malloc", zend_mm_mem_dummy_init, zend_mm_mem_dummy_dtor, zend_mm_mem_malloc_alloc, zend_mm_mem_malloc_realloc, zend_mm_mem_malloc_free}
+
+#endif
+
+static const zend_mm_mem_handlers mem_handlers[] = {
+#ifdef HAVE_MEM_MALLOC
+ ZEND_MM_MEM_MALLOC_DSC,
+#endif
+#ifdef HAVE_MEM_MMAP_ANON
+ ZEND_MM_MEM_MMAP_ANON_DSC,
+#endif
+#ifdef HAVE_MEM_MMAP_ZERO
+ ZEND_MM_MEM_MMAP_ZERO_DSC,
+#endif
+#ifdef HAVE_MEM_WIN32
+ ZEND_MM_MEM_WIN32_DSC,
+#endif
+ {NULL, NULL, NULL, NULL, NULL, NULL}
+};
+
+# define ZEND_MM_STORAGE_DTOR() heap->storage->handlers->dtor(heap->storage)
+# define ZEND_MM_STORAGE_ALLOC(size) heap->storage->handlers->_alloc(heap->storage, size)
+# define ZEND_MM_STORAGE_REALLOC(ptr, size) heap->storage->handlers->_realloc(heap->storage, ptr, size)
+# define ZEND_MM_STORAGE_FREE(ptr) heap->storage->handlers->_free(heap->storage, ptr)
+
+/****************/
+/* Heap Manager */
+/****************/
+
+typedef enum _mem_magic {
+ MEM_BLOCK_VALID = 0x7312F8DC,
+ MEM_BLOCK_FREED = 0x99954317,
+ MEM_BLOCK_CACHED = 0xFB8277DC,
+ MEM_BLOCK_GUARD = 0x2A8FCC84,
+ MEM_BLOCK_LEAK = 0x6C5E8F2D
+} mem_magic;
+
+/* mm block type */
+typedef struct _zend_mm_block_info {
+ size_t _size;
+ size_t _prev;
+} zend_mm_block_info;
+
+typedef struct _zend_mm_debug_info {
+ char *filename;
+ uint lineno;
+ char *orig_filename;
+ uint orig_lineno;
+ size_t size;
+} zend_mm_debug_info;
+
+typedef struct _zend_mm_block {
+ zend_mm_block_info info;
#if ZEND_DEBUG
- p->filename = __zend_filename;
- p->lineno = __zend_lineno;
- p->orig_filename = __zend_orig_filename;
- p->orig_lineno = __zend_orig_lineno;
- p->magic = MEM_BLOCK_START_MAGIC;
- p->reported = 0;
- /* Setting the thread id should not be necessary, because we fetched this block
- * from this thread's cache
- */
- AG(cache_stats)[CACHE_INDEX][1]++;
- memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long));
-#endif
- p->size = size;
- return (void *)((char *)p + sizeof(zend_mem_header) + MEM_HEADER_PADDING);
- } else {
+ mem_magic magic;
+ zend_mm_debug_info debug;
+# ifdef ZTS
+ THREAD_T thread_id;
+# endif
#endif
+} zend_mm_block;
+
+typedef struct _zend_mm_free_block {
+ zend_mm_block_info info;
#if ZEND_DEBUG
- if (CACHE_INDEX<MAX_CACHED_MEMORY) {
- AG(cache_stats)[CACHE_INDEX][0]++;
- }
+ mem_magic magic;
#endif
+ struct _zend_mm_free_block *prev_free_block;
+ struct _zend_mm_free_block *next_free_block;
+} zend_mm_free_block;
+
+#define ZEND_MM_NUM_BUCKETS 32
+
+#define ZEND_MM_CACHE 1
+#define ZEND_MM_CACHE_SIZE (32*1024)
+
+struct _zend_mm_heap {
+ unsigned int free_bitmap;
+ size_t block_size;
+ zend_mm_segment *segments_list;
+ zend_mm_storage *storage;
+ size_t real_size;
#if MEMORY_LIMIT
- CHECK_MEMORY_LIMIT(size, SIZE);
- if (AG(allocated_memory) > AG(allocated_memory_peak)) {
- AG(allocated_memory_peak) = AG(allocated_memory);
- }
+ size_t real_peak;
+ size_t limit;
+ size_t size;
+ size_t peak;
#endif
- p = (zend_mem_header *) ZEND_DO_MALLOC(sizeof(zend_mem_header) + MEM_HEADER_PADDING + SIZE + END_MAGIC_SIZE);
-#if !ZEND_DISABLE_MEMORY_CACHE
- }
+#if ZEND_USE_MALLOC_MM
+ int use_zend_alloc;
+#endif
+ int overflow;
+#if ZEND_MM_CACHE
+ unsigned int cached;
+ zend_mm_free_block *cache[ZEND_MM_NUM_BUCKETS];
+#endif
+ zend_mm_free_block free_buckets[ZEND_MM_NUM_BUCKETS];
+};
+
+#define ZEND_MM_TYPE_MASK 0x3L
+
+#define ZEND_MM_FREE_BLOCK 0x0L
+#define ZEND_MM_USED_BLOCK 0x1L
+#define ZEND_MM_GUARD_BLOCK 0x3L
+
+#define ZEND_MM_BLOCK(b, type, size) do { \
+ size_t _size = (size); \
+ (b)->info._size = (type) | _size; \
+ ZEND_MM_BLOCK_AT(b, _size)->info._prev = (type) | _size; \
+ } while (0);
+#define ZEND_MM_LAST_BLOCK(b) do { \
+ (b)->info._size = ZEND_MM_GUARD_BLOCK | ZEND_MM_ALIGNED_HEADER_SIZE; \
+ ZEND_MM_SET_MAGIC(b, MEM_BLOCK_GUARD); \
+ } while (0);
+#define ZEND_MM_BLOCK_SIZE(b) ((b)->info._size & ~ZEND_MM_TYPE_MASK)
+#define ZEND_MM_IS_FREE_BLOCK(b) (!((b)->info._size & ZEND_MM_USED_BLOCK))
+#define ZEND_MM_IS_USED_BLOCK(b) ((b)->info._size & ZEND_MM_USED_BLOCK)
+#define ZEND_MM_IS_GUARD_BLOCK(b) (((b)->info._size & ZEND_MM_TYPE_MASK) == ZEND_MM_GUARD_BLOCK)
+
+#define ZEND_MM_NEXT_BLOCK(b) ZEND_MM_BLOCK_AT(b, ZEND_MM_BLOCK_SIZE(b))
+#define ZEND_MM_PREV_BLOCK(b) ZEND_MM_BLOCK_AT(b, -(int)((b)->info._prev & ~ZEND_MM_TYPE_MASK))
+
+#define ZEND_MM_PREV_BLOCK_IS_FREE(b) (!((b)->info._prev & ZEND_MM_USED_BLOCK))
+
+#define ZEND_MM_MARK_FIRST_BLOCK(b) ((b)->info._prev = ZEND_MM_GUARD_BLOCK)
+#define ZEND_MM_IS_FIRST_BLOCK(b) ((b)->info._prev == ZEND_MM_GUARD_BLOCK)
+
+/* optimized access */
+#define ZEND_MM_FREE_BLOCK_SIZE(b) (b)->info._size
+
+#ifndef ZEND_MM_ALIGNMENT
+# define ZEND_MM_ALIGNMENT 8
+# define ZEND_MM_ALIGNMENT_LOG2 3
#endif
-emalloc_error:
+#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1)
- HANDLE_BLOCK_INTERRUPTIONS();
+/* 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_MIN_HEADER_SIZE (sizeof(zend_mm_block)+END_MAGIC_SIZE>sizeof(zend_mm_free_block)?ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_block)+END_MAGIC_SIZE):ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_free_block)))
+#define ZEND_MM_ALIGNED_SEGMENT_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_segment))
- if (!p) {
- fprintf(stderr,"FATAL: emalloc(): Unable to allocate %ld bytes\n", (long) size);
-#if ZEND_DEBUG && defined(HAVE_KILL) && defined(HAVE_GETPID)
- kill(getpid(), SIGSEGV);
-#else
- exit(1);
-#endif
- HANDLE_UNBLOCK_INTERRUPTIONS();
- return (void *)p;
- }
- ADD_POINTER_TO_LIST(p);
- p->size = size; /* Save real size for correct cache output */
+#define ZEND_MM_MIN_SIZE (ZEND_MM_ALIGNED_MIN_HEADER_SIZE-(ZEND_MM_ALIGNED_HEADER_SIZE+END_MAGIC_SIZE))
+
+#define ZEND_MM_MAX_SMALL_SIZE (((ZEND_MM_NUM_BUCKETS-1)<<ZEND_MM_ALIGNMENT_LOG2)+ZEND_MM_ALIGNED_MIN_HEADER_SIZE)
+
+#define ZEND_MM_TRUE_SIZE(size) (((long)size<(long)ZEND_MM_MIN_SIZE)?(ZEND_MM_ALIGNED_MIN_HEADER_SIZE):(ZEND_MM_ALIGNED_SIZE(size+ZEND_MM_ALIGNED_HEADER_SIZE+END_MAGIC_SIZE)))
+
+#define ZEND_MM_BUCKET_INDEX(true_size) ((true_size>>ZEND_MM_ALIGNMENT_LOG2)-(ZEND_MM_ALIGNED_MIN_HEADER_SIZE>>ZEND_MM_ALIGNMENT_LOG2)+1)
+
+#define ZEND_MM_SMALL_SIZE(true_size) (true_size < ZEND_MM_MAX_SMALL_SIZE)
+
+/* 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 */
#if ZEND_DEBUG
- p->filename = __zend_filename;
- p->lineno = __zend_lineno;
- p->orig_filename = __zend_orig_filename;
- p->orig_lineno = __zend_orig_lineno;
- p->magic = MEM_BLOCK_START_MAGIC;
- p->reported = 0;
+
# ifdef ZTS
- p->thread_id = tsrm_thread_id();
+# define ZEND_MM_BAD_THREAD_ID(block) ((block)->thread_id != tsrm_thread_id())
+# else
+# define ZEND_MM_BAD_THREAD_ID(block) 0
# endif
- memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long));
-#endif
- HANDLE_UNBLOCK_INTERRUPTIONS();
- return (void *)((char *)p + sizeof(zend_mem_header) + MEM_HEADER_PADDING);
-}
+# define ZEND_MM_VALID_PTR(block) \
+ zend_mm_check_ptr(heap, block, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)
-#include "zend_multiply.h"
+# define ZEND_MM_SET_MAGIC(block, val) do { \
+ (block)->magic = (val); \
+ } while (0)
-ZEND_API void *_safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+# define ZEND_MM_CHECK_MAGIC(block, val) do { \
+ if ((block)->magic != (val)) { \
+ zend_mm_panic("Heap corrupted"); \
+ } \
+ } while (0)
+
+# define ZEND_MM_END_MAGIC_PTR(block) \
+ (long*)(((char*)(ZEND_MM_DATA_OF(block))) + ((zend_mm_block*)(block))->debug.size)
+
+# define ZEND_MM_SET_END_MAGIC(block) do { \
+ long *p = ZEND_MM_END_MAGIC_PTR(block); \
+ memcpy(p, &_mem_block_end_magic, END_MAGIC_SIZE); \
+ } while (0)
+
+# define MEM_BLOCK_END_MAGIC 0x2A8FCC84L
+
+# define END_MAGIC_SIZE sizeof(long)
+
+static long _mem_block_end_magic = MEM_BLOCK_END_MAGIC;
+
+#else
+
+# define ZEND_MM_VALID_PTR(ptr) 1
+
+# define ZEND_MM_SET_MAGIC(block, val)
+
+# define ZEND_MM_SET_END_MAGIC(block)
+
+# define ZEND_MM_CHECK_MAGIC(block, val)
+
+# define END_MAGIC_SIZE 0
+
+#endif
+
+static inline void zend_mm_add_to_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block)
{
+ zend_mm_free_block *prev, *next;
+ size_t size;
- if (nmemb < LONG_MAX
- && size < LONG_MAX
- && offset < LONG_MAX
- && nmemb >= 0
- && size >= 0
- && offset >= 0) {
- long lval;
- double dval;
- int use_dval;
+ ZEND_MM_SET_MAGIC(mm_block, MEM_BLOCK_FREED);
- ZEND_SIGNED_MULTIPLY_LONG(nmemb, size, lval, dval, use_dval);
+ size = ZEND_MM_FREE_BLOCK_SIZE(mm_block);
+ if (ZEND_MM_SMALL_SIZE(size)) {
+ size_t index = ZEND_MM_BUCKET_INDEX(size);
+ prev = &heap->free_buckets[index];
- if (!use_dval
- && lval < (long) (LONG_MAX - offset)) {
- return emalloc_rel(lval + offset);
+ if (prev->prev_free_block == prev) {
+ heap->free_bitmap |= (1U << index);
}
+ } else {
+ prev = &heap->free_buckets[0];
}
-
- zend_error(E_ERROR, "Possible integer overflow in memory allocation (%zd * %zd + %zd)", nmemb, size, offset);
- return 0;
+ next = prev->next_free_block;
+ mm_block->prev_free_block = prev;
+ mm_block->next_free_block = next;
+ prev->next_free_block = mm_block;
+ next->prev_free_block = mm_block;
}
-ZEND_API void *_safe_malloc(size_t nmemb, size_t size, size_t offset)
+
+static inline void zend_mm_remove_from_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block)
{
+ zend_mm_free_block *prev, *next;
- if (nmemb < LONG_MAX
- && size < LONG_MAX
- && offset < LONG_MAX
- && nmemb >= 0
- && size >= 0
- && offset >= 0) {
- long lval;
- double dval;
- int use_dval;
+ ZEND_MM_CHECK_MAGIC(mm_block, MEM_BLOCK_FREED);
- ZEND_SIGNED_MULTIPLY_LONG(nmemb, size, lval, dval, use_dval);
+ prev = mm_block->prev_free_block;
+ next = mm_block->next_free_block;
+ prev->next_free_block = next;
+ next->prev_free_block = prev;
- if (!use_dval
- && lval < (long) (LONG_MAX - offset)) {
- return pemalloc(lval + offset, 1);
+ if (prev == next) {
+ size_t size = ZEND_MM_FREE_BLOCK_SIZE(mm_block);
+
+ if (ZEND_MM_SMALL_SIZE(size)) {
+ size_t index = ZEND_MM_BUCKET_INDEX(size);
+
+ heap->free_bitmap &= ~(1U << index);
}
}
+}
- zend_error(E_ERROR, "Possible integer overflow in memory allocation (%zd * %zd + %zd)", nmemb, size, offset);
- return 0;
+static inline void zend_mm_init(zend_mm_heap *heap)
+{
+ int i;
+
+ heap->free_bitmap = 0;
+#if ZEND_MM_CACHE
+ heap->cached = 0;
+ memset(heap->cache, 0, sizeof(heap->cache));
+#endif
+ for (i = 0; i < ZEND_MM_NUM_BUCKETS; i++) {
+ heap->free_buckets[i].next_free_block =
+ heap->free_buckets[i].prev_free_block = &heap->free_buckets[i];
+ }
}
+static void zend_mm_del_segment(zend_mm_heap *heap, zend_mm_segment *segment)
+{
+ if (heap->segments_list == segment) {
+ heap->segments_list = segment->next_segment;
+ } else {
+ zend_mm_segment *p = heap->segments_list;
-ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ while (p) {
+ if (p->next_segment == segment) {
+ p->next_segment = segment->next_segment;
+ break;
+ }
+ p = p->next_segment;
+ }
+ }
+ heap->real_size -= segment->size;
+ ZEND_MM_STORAGE_FREE(segment);
+}
+
+#if ZEND_MM_CACHE
+static void zend_mm_free_cache(zend_mm_heap *heap)
{
- zend_mem_header *p = (zend_mem_header *) ((char *)ptr - sizeof(zend_mem_header) - MEM_HEADER_PADDING);
- DECLARE_CACHE_VARS();
- TSRMLS_FETCH();
+ int i;
-#if defined(ZTS) && TSRM_DEBUG
- if (p->thread_id != tsrm_thread_id()) {
- tsrm_error(TSRM_ERROR_LEVEL_ERROR, "Memory block allocated at %s:(%d) on thread %x freed at %s:(%d) on thread %x, ignoring",
- p->filename, p->lineno, p->thread_id,
- __zend_filename, __zend_lineno, tsrm_thread_id());
- return;
+ for (i = 0; i < ZEND_MM_NUM_BUCKETS; i++) {
+ if (heap->cache[i]) {
+ zend_mm_free_block *mm_block = heap->cache[i];
+
+ while (mm_block) {
+ size_t size = ZEND_MM_BLOCK_SIZE(mm_block);
+ zend_mm_free_block *q = mm_block->prev_free_block;
+ zend_mm_block *prev_block = ZEND_MM_PREV_BLOCK(mm_block);
+ zend_mm_block *next_block = ZEND_MM_NEXT_BLOCK(mm_block);
+
+ heap->cached -= size;
+
+ if (ZEND_MM_IS_FREE_BLOCK(prev_block)) {
+ size += ZEND_MM_FREE_BLOCK_SIZE(prev_block);
+ mm_block = (zend_mm_free_block*)prev_block;
+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) prev_block);
+ }
+ if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
+ size += ZEND_MM_FREE_BLOCK_SIZE(next_block);
+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block);
+ }
+ ZEND_MM_BLOCK(mm_block, ZEND_MM_FREE_BLOCK, size);
+
+ if (ZEND_MM_IS_FIRST_BLOCK(mm_block) &&
+ ZEND_MM_IS_GUARD_BLOCK(ZEND_MM_NEXT_BLOCK(mm_block))) {
+ zend_mm_del_segment(heap, (zend_mm_segment *) ((char *)mm_block - ZEND_MM_ALIGNED_SEGMENT_SIZE));
+ } else {
+ zend_mm_add_to_free_list(heap, (zend_mm_free_block *) mm_block);
+ }
+
+ mm_block = q;
+ }
+ heap->cache[i] = NULL;
+ }
}
+}
#endif
- CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
-#if ZEND_DEBUG
- if (!_mem_block_check(ptr, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
- return;
+/* Notes:
+ * - This function may alter the block_sizes values to match platform alignment
+ * - This function does *not* perform sanity checks on the arguments
+ */
+ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers, size_t block_size, void *params)
+{
+ zend_mm_storage *storage;
+ zend_mm_heap *heap;
+
+#if 0
+ for (i = 0; i < ZEND_MM_MAX_SMALL_SIZE; i++) {
+ printf("%3d%c: %3ld %d %2ld\n", i, (i == ZEND_MM_MIN_SIZE?'*':' '), (long)ZEND_MM_TRUE_SIZE(i), ZEND_MM_SMALL_SIZE(ZEND_MM_TRUE_SIZE(i)), (long)ZEND_MM_BUCKET_INDEX(ZEND_MM_TRUE_SIZE(i)));
}
- memset(ptr, 0x5a, p->size);
-#endif
-#if !ZEND_DISABLE_MEMORY_CACHE
- if ((CACHE_INDEX < MAX_CACHED_MEMORY) && (AG(cache_count)[CACHE_INDEX] < MAX_CACHED_ENTRIES)) {
- AG(cache)[CACHE_INDEX][AG(cache_count)[CACHE_INDEX]++] = p;
-#if ZEND_DEBUG
- p->magic = MEM_BLOCK_CACHED_MAGIC;
+ exit(0);
#endif
- return;
+
+ storage = handlers->init(params);
+ if (!storage) {
+ fprintf(stderr, "Cannot initialize zend_mm storage [%s]\n", handlers->name);
+ exit(255);
}
+ storage->handlers = handlers;
+
+ heap = malloc(sizeof(struct _zend_mm_heap));
+
+ heap->storage = storage;
+ heap->block_size = block_size = ZEND_MM_ALIGNED_SIZE(block_size);
+ heap->segments_list = NULL;
+ zend_mm_init(heap);
+
+#if ZEND_USE_MALLOC_MM
+ heap->use_zend_alloc = 1;
#endif
- HANDLE_BLOCK_INTERRUPTIONS();
- REMOVE_POINTER_FROM_LIST(p);
+ heap->real_size = 0;
#if MEMORY_LIMIT
- AG(allocated_memory) -= SIZE;
+ heap->real_peak = 0;
+ heap->limit = 1<<30;
+ heap->size = 0;
+ heap->peak = 0;
#endif
-
- ZEND_DO_FREE(p);
- HANDLE_UNBLOCK_INTERRUPTIONS();
-}
+ heap->overflow = 0;
-ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ return heap;
+}
+
+ZEND_API zend_mm_heap *zend_mm_startup(void)
{
- void *p;
- int final_size = size*nmemb;
-
- HANDLE_BLOCK_INTERRUPTIONS();
- p = _emalloc(final_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
- if (!p) {
- HANDLE_UNBLOCK_INTERRUPTIONS();
- return (void *) p;
+ int i;
+ size_t seg_size;
+ char *mem_type = getenv("ZEND_MM_MEM_TYPE");
+ char *tmp;
+ const zend_mm_mem_handlers *handlers;
+
+ if (mem_type == NULL) {
+ i = 0;
+ } else {
+ for (i = 0; mem_handlers[i].name; i++) {
+ if (strcmp(mem_handlers[i].name, mem_type) == 0) {
+ break;
+ }
+ }
+ if (!mem_handlers[i].name) {
+ fprintf(stderr, "Wrong or unsupported zend_mm storage type '%s'\n", mem_type);
+ fprintf(stderr, " supported types:\n");
+ for (i = 0; mem_handlers[i].name; i++) {
+ fprintf(stderr, " '%s'\n", mem_handlers[i].name);
+ }
+ exit(255);
+ }
}
- memset(p, 0, final_size);
- HANDLE_UNBLOCK_INTERRUPTIONS();
- return p;
+ handlers = &mem_handlers[i];
+
+ tmp = getenv("ZEND_MM_SEG_SIZE");
+ if (tmp) {
+ seg_size = zend_atoi(tmp, 0);
+ } else {
+ seg_size = 256 * 1024;
+ }
+
+ return zend_mm_startup_ex(handlers, seg_size, NULL);
}
+#if ZEND_DEBUG
+static long zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block *b)
+{
+ long leaks = 0;
+ zend_mm_block *p, *q;
+
+ p = ZEND_MM_NEXT_BLOCK(b);
+ while (1) {
+ q = ZEND_MM_NEXT_BLOCK(p);
+ if (q <= p ||
+ (char*)q > (char*)segment + segment->size ||
+ p->info._size != q->info._prev) {
+ zend_mm_panic("zend_mm_heap corrupted");
+ }
+ if (!ZEND_MM_IS_FREE_BLOCK(p)) {
+ if (p->magic == MEM_BLOCK_VALID) {
+ if (p->debug.filename==b->debug.filename && p->debug.lineno==b->debug.lineno) {
+ ZEND_MM_SET_MAGIC(p, MEM_BLOCK_LEAK);
+ leaks++;
+ }
+#if ZEND_MM_CACHE
+ } else if (p->magic == MEM_BLOCK_CACHED) {
+ /* skip it */
+#endif
+ } else if (p->magic != MEM_BLOCK_LEAK) {
+ zend_mm_panic("zend_mm_heap corrupted");
+ }
+ }
+ if (ZEND_MM_IS_GUARD_BLOCK(q)) {
+ ZEND_MM_CHECK_MAGIC(q, MEM_BLOCK_GUARD);
+ segment = segment->next_segment;
+ if (!segment) {
+ break;
+ }
+ q = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE);
+ }
+ p = q;
+ }
+ return leaks;
+}
-ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+static void zend_mm_check_leaks(zend_mm_heap *heap)
{
- zend_mem_header *p;
- zend_mem_header *orig;
- DECLARE_CACHE_VARS();
- TSRMLS_FETCH();
+ zend_mm_segment *segment = heap->segments_list;
+ zend_mm_block *p, *q;
+ zend_uint total = 0;
- if (!ptr) {
- return _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ if (!segment) {
+ return;
}
+ p = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE);
+ while (1) {
+ q = ZEND_MM_NEXT_BLOCK(p);
+ if (q <= p ||
+ (char*)q > (char*)segment + segment->size ||
+ p->info._size != q->info._prev) {
+ zend_mm_panic("zend_mm_heap corrupted");
+ }
+ if (!ZEND_MM_IS_FREE_BLOCK(p)) {
+ if (p->magic == MEM_BLOCK_VALID) {
+ long repeated;
+ zend_leak_info leak;
- p = orig = (zend_mem_header *) ((char *)ptr-sizeof(zend_mem_header)-MEM_HEADER_PADDING);
+ ZEND_MM_SET_MAGIC(p, MEM_BLOCK_LEAK);
-#if defined(ZTS) && TSRM_DEBUG
- if (p->thread_id != tsrm_thread_id()) {
- void *new_p;
+ leak.addr = ZEND_MM_DATA_OF(p);
+ leak.size = p->debug.size;
+ leak.filename = p->debug.filename;
+ leak.lineno = p->debug.lineno;
+ leak.orig_filename = p->debug.orig_filename;
+ leak.orig_lineno = p->debug.orig_lineno;
- tsrm_error(TSRM_ERROR_LEVEL_ERROR, "Memory block allocated at %s:(%d) on thread %x reallocated at %s:(%d) on thread %x, duplicating",
- p->filename, p->lineno, p->thread_id,
- __zend_filename, __zend_lineno, tsrm_thread_id());
- new_p = _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
- memcpy(new_p, ptr, p->size);
- return new_p;
- }
+ zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL);
+ zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, &leak);
+ repeated = zend_mm_find_leaks(segment, p);
+ total += 1 + repeated;
+ if (repeated) {
+ zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *)repeated);
+ }
+#if ZEND_MM_CACHE
+ } else if (p->magic == MEM_BLOCK_CACHED) {
+ /* skip it */
#endif
+ } else if (p->magic != MEM_BLOCK_LEAK) {
+ zend_mm_panic("zend_mm_heap corrupted");
+ }
+ }
+ if (ZEND_MM_IS_GUARD_BLOCK(q)) {
+ segment = segment->next_segment;
+ if (!segment) {
+ break;
+ }
+ q = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE);
+ }
+ p = q;
+ }
+ if (total) {
+ zend_message_dispatcher(ZMSG_MEMORY_LEAKS_GRAND_TOTAL, &total);
+ }
+}
- CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
+static int zend_mm_check_ptr(zend_mm_heap *heap, void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+ zend_mm_block *p;
+ int no_cache_notice = 0;
+ int had_problems = 0;
+ int valid_beginning = 1;
+ long *end_magic;
- HANDLE_BLOCK_INTERRUPTIONS();
+ if (silent==2) {
+ silent = 1;
+ no_cache_notice = 1;
+ } else if (silent==3) {
+ silent = 0;
+ no_cache_notice = 1;
+ }
+ if (!silent) {
+ zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL);
+ zend_debug_alloc_output("---------------------------------------\n");
+ zend_debug_alloc_output("%s(%d) : Block 0x%0.8lX status:\n" ZEND_FILE_LINE_RELAY_CC, (long) ptr);
+ if (__zend_orig_filename) {
+ zend_debug_alloc_output("%s(%d) : Actual location (location was relayed)\n" ZEND_FILE_LINE_ORIG_RELAY_CC);
+ }
+ if (!ptr) {
+ zend_debug_alloc_output("NULL\n");
+ zend_debug_alloc_output("---------------------------------------\n");
+ return 0;
+ }
+ }
- if (size > INT_MAX || SIZE < size) {
- REMOVE_POINTER_FROM_LIST(p);
- p = NULL;
- goto erealloc_error;
+ if (!ptr) {
+ if (silent) {
+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ }
}
-#if MEMORY_LIMIT
- CHECK_MEMORY_LIMIT(size - p->size, SIZE - REAL_SIZE(p->size));
- if (AG(allocated_memory) > AG(allocated_memory_peak)) {
- AG(allocated_memory_peak) = AG(allocated_memory);
+ p = ZEND_MM_HEADER_OF(ptr);
+
+#ifdef ZTS
+ if (ZEND_MM_BAD_THREAD_ID(p)) {
+ if (!silent) {
+ zend_debug_alloc_output("Invalid pointer: ((thread_id=0x%0.8X) != (expected=0x%0.8X))\n", (long)p->thread_id, (long)tsrm_thread_id());
+ had_problems = 1;
+ } else {
+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ }
}
#endif
- REMOVE_POINTER_FROM_LIST(p);
- p = (zend_mem_header *) ZEND_DO_REALLOC(p, sizeof(zend_mem_header)+MEM_HEADER_PADDING+SIZE+END_MAGIC_SIZE);
-erealloc_error:
- if (!p) {
- if (!allow_failure) {
- fprintf(stderr,"FATAL: erealloc(): Unable to allocate %ld bytes\n", (long) size);
-#if ZEND_DEBUG && HAVE_KILL && HAVE_GETPID
- kill(getpid(), SIGSEGV);
-#else
- exit(1);
-#endif
+
+ if (p->info._size != ZEND_MM_NEXT_BLOCK(p)->info._prev) {
+ if (!silent) {
+ zend_debug_alloc_output("Invalid pointer: ((size=0x%0.8X) != (next.prev=0x%0.8X))\n", p->info._size, ZEND_MM_NEXT_BLOCK(p)->info._prev);
+ had_problems = 1;
+ } else {
+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ }
+ }
+ if (p->info._prev != ZEND_MM_GUARD_BLOCK &&
+ ZEND_MM_PREV_BLOCK(p)->info._size != p->info._prev) {
+ if (!silent) {
+ zend_debug_alloc_output("Invalid pointer: ((prev=0x%0.8X) != (prev.size=0x%0.8X))\n", p->info._prev, ZEND_MM_PREV_BLOCK(p)->info._size);
+ had_problems = 1;
+ } else {
+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
- ADD_POINTER_TO_LIST(orig);
- HANDLE_UNBLOCK_INTERRUPTIONS();
- return (void *)NULL;
}
- ADD_POINTER_TO_LIST(p);
-#if ZEND_DEBUG
- p->filename = __zend_filename;
- p->lineno = __zend_lineno;
- p->magic = MEM_BLOCK_START_MAGIC;
- memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long));
-#endif
- p->size = size;
+ if (had_problems) {
+ zend_debug_alloc_output("---------------------------------------\n");
+ return 0;
+ }
- HANDLE_UNBLOCK_INTERRUPTIONS();
- return (void *)((char *)p+sizeof(zend_mem_header)+MEM_HEADER_PADDING);
-}
+ if (!silent) {
+ zend_debug_alloc_output("%10s\t","Beginning: ");
+ }
+ if (!ZEND_MM_IS_USED_BLOCK(p)) {
+ if (!silent) {
+ if (p->magic != MEM_BLOCK_FREED) {
+ zend_debug_alloc_output("Freed (magic=0x%0.8X, expected=0x%0.8X)\n", p->magic, MEM_BLOCK_FREED);
+ } else {
+ zend_debug_alloc_output("Freed\n");
+ }
+ had_problems = 1;
+ } else {
+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ }
+ } else if (ZEND_MM_IS_GUARD_BLOCK(p)) {
+ if (!silent) {
+ if (p->magic != MEM_BLOCK_FREED) {
+ zend_debug_alloc_output("Guard (magic=0x%0.8X, expected=0x%0.8X)\n", p->magic, MEM_BLOCK_FREED);
+ } else {
+ zend_debug_alloc_output("Guard\n");
+ }
+ had_problems = 1;
+ } else {
+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ }
+ } else {
+ switch (p->magic) {
+ case MEM_BLOCK_VALID:
+ case MEM_BLOCK_LEAK:
+ if (!silent) {
+ zend_debug_alloc_output("OK (allocated on %s:%d, %d bytes)\n", p->debug.filename, p->debug.lineno, (int)p->debug.size);
+ }
+ break; /* ok */
+ case MEM_BLOCK_CACHED:
+ if (!no_cache_notice) {
+ if (!silent) {
+ zend_debug_alloc_output("Cached\n");
+ had_problems = 1;
+ } else {
+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ }
+ }
+ case MEM_BLOCK_FREED:
+ if (!silent) {
+ zend_debug_alloc_output("Freed (invalid)\n");
+ had_problems = 1;
+ } else {
+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ }
+ break;
+ case MEM_BLOCK_GUARD:
+ if (!silent) {
+ zend_debug_alloc_output("Guard (invalid)\n");
+ had_problems = 1;
+ } else {
+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ }
+ break;
+ default:
+ if (!silent) {
+ zend_debug_alloc_output("Unknown (magic=0x%0.8X, expected=0x%0.8X)\n", p->magic, MEM_BLOCK_VALID);
+ had_problems = 1;
+ valid_beginning = 0;
+ } else {
+ return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ }
+ break;
+ }
+ }
-ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
-{
- int length;
- char *p;
+ end_magic = ZEND_MM_END_MAGIC_PTR(p);
+ if (!valid_beginning) {
+ if (!silent) {
+ zend_debug_alloc_output("%10s\t", "End:");
+ zend_debug_alloc_output("Unknown\n");
+ }
+ } else if (memcmp(end_magic, &_mem_block_end_magic, END_MAGIC_SIZE)==0) {
+ if (!silent) {
+ zend_debug_alloc_output("%10s\t", "End:");
+ zend_debug_alloc_output("OK\n");
+ }
+ } else {
+ char *overflow_ptr, *magic_ptr=(char *) &_mem_block_end_magic;
+ int overflows=0;
+ long i;
- length = strlen(s)+1;
- HANDLE_BLOCK_INTERRUPTIONS();
- p = (char *) _emalloc(length ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
- if (!p) {
- HANDLE_UNBLOCK_INTERRUPTIONS();
- return (char *)NULL;
+ if (silent) {
+ return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ }
+ had_problems = 1;
+ overflow_ptr = (char *) end_magic;
+
+ for (i=0; i<(int)sizeof(long); i++) {
+ if (overflow_ptr[i]!=magic_ptr[i]) {
+ overflows++;
+ }
+ }
+
+ zend_debug_alloc_output("%10s\t", "End:");
+ zend_debug_alloc_output("Overflown (magic=0x%0.8lX instead of 0x%0.8lX)\n", *end_magic, MEM_BLOCK_END_MAGIC);
+ zend_debug_alloc_output("%10s\t","");
+ if (overflows>=(int)sizeof(long)) {
+ zend_debug_alloc_output("At least %d bytes overflown\n", sizeof(long));
+ } else {
+ zend_debug_alloc_output("%d byte(s) overflown\n", overflows);
+ }
}
- HANDLE_UNBLOCK_INTERRUPTIONS();
- memcpy(p, s, length);
- return p;
+
+ if (!silent) {
+ zend_debug_alloc_output("---------------------------------------\n");
+ }
+ return ((!had_problems) ? 1 : 0);
}
-ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+static int zend_mm_check_heap(zend_mm_heap *heap, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
- char *p;
+ zend_mm_segment *segment = heap->segments_list;
+ zend_mm_block *p, *q;
+ int errors = 0;
- HANDLE_BLOCK_INTERRUPTIONS();
- p = (char *) _emalloc(length+1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
- if (!p) {
- HANDLE_UNBLOCK_INTERRUPTIONS();
- return (char *)NULL;
+ if (!segment) {
+ return 0;
+ }
+ p = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE);
+ while (1) {
+ q = ZEND_MM_NEXT_BLOCK(p);
+ if (q <= p ||
+ (char*)q > (char*)segment + segment->size ||
+ p->info._size != q->info._prev) {
+ zend_mm_panic("zend_mm_heap corrupted");
+ }
+ if (!ZEND_MM_IS_FREE_BLOCK(p)) {
+ if (p->magic == MEM_BLOCK_VALID || p->magic == MEM_BLOCK_LEAK) {
+ if (!zend_mm_check_ptr(heap, ZEND_MM_DATA_OF(p), (silent?2:3) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
+ errors++;
+ }
+#if ZEND_MM_CACHE
+ } else if (p->magic == MEM_BLOCK_CACHED) {
+ /* skip it */
+#endif
+ } else if (p->magic != MEM_BLOCK_LEAK) {
+ zend_mm_panic("zend_mm_heap corrupted");
+ }
+ }
+ if (ZEND_MM_IS_GUARD_BLOCK(q)) {
+ segment = segment->next_segment;
+ if (!segment) {
+ return errors;
+ }
+ q = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE);
+ }
+ p = q;
}
- HANDLE_UNBLOCK_INTERRUPTIONS();
- memcpy(p, s, length);
- p[length] = 0;
- return p;
}
+#endif
-
-ZEND_API char *zend_strndup(const char *s, uint length)
+ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent)
{
- char *p;
+ zend_mm_segment *segment;
+ zend_mm_segment *prev;
- p = (char *) malloc(length+1);
- if (!p) {
- return (char *)NULL;
+#if ZEND_DEBUG
+ if (!silent) {
+ zend_mm_check_leaks(heap);
}
- if (length) {
- memcpy(p, s, length);
+#endif
+
+ segment = heap->segments_list;
+ while (segment) {
+ prev = segment;
+ segment = segment->next_segment;
+ ZEND_MM_STORAGE_FREE(prev);
+ }
+ if (full_shutdown) {
+ ZEND_MM_STORAGE_DTOR();
+ free(heap);
+ } else {
+ heap->segments_list = NULL;
+ zend_mm_init(heap);
+ heap->real_size = 0;
+#if MEMORY_LIMIT
+ heap->real_peak = 0;
+ heap->size = 0;
+ heap->peak = 0;
+#endif
+ heap->overflow = 0;
}
- p[length] = 0;
- return p;
}
-
-ZEND_API int zend_set_memory_limit(unsigned int memory_limit)
+static void zend_mm_safe_error(zend_mm_heap *heap,
+ const char *format,
+ size_t limit,
+#if ZEND_DEBUG
+ const char *filename,
+ uint lineno,
+#endif
+ size_t size)
{
-#if MEMORY_LIMIT
- TSRMLS_FETCH();
-
- AG(memory_limit) = memory_limit;
- return SUCCESS;
-#else
- return FAILURE;
+ if (heap->overflow == 0) {
+ char *error_filename;
+ uint error_lineno;
+ TSRMLS_FETCH();
+ if (zend_is_compiling(TSRMLS_C)) {
+ error_filename = zend_get_compiled_filename(TSRMLS_C);
+ error_lineno = zend_get_compiled_lineno(TSRMLS_C);
+ } else if (EG(in_execution)) {
+ error_filename = EG(active_op_array)?EG(active_op_array)->filename:NULL;
+ error_lineno = EG(opline_ptr)?(*EG(opline_ptr))->lineno:0;
+ } else {
+ error_filename = NULL;
+ error_lineno = 0;
+ }
+ if (!error_filename) {
+ error_filename = "Unknown";
+ }
+ heap->overflow = 1;
+ zend_try {
+ zend_error(E_ERROR,
+ format,
+ limit,
+#if ZEND_DEBUG
+ filename,
+ lineno,
+#endif
+ size);
+ } zend_catch {
+ if (heap->overflow == 2) {
+ fprintf(stderr, "\nFatal error: ");
+ fprintf(stderr,
+ format,
+ limit,
+#if ZEND_DEBUG
+ filename,
+ lineno,
#endif
+ size);
+ fprintf(stderr, " in %s on line %d\n", error_filename, error_lineno);
+ }
+ } zend_end_try();
+ } else {
+ heap->overflow = 2;
+ }
+ zend_bailout();
}
+static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
-ZEND_API void start_memory_manager(TSRMLS_D)
+static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
- AG(head) = NULL;
-
+ size_t true_size, best_size = 0x7fffffff;
+ zend_mm_free_block *p, *end, *best_fit = NULL;
+
+ true_size = ZEND_MM_TRUE_SIZE(size);
+
+ if (ZEND_MM_SMALL_SIZE(true_size)) {
+ size_t index = ZEND_MM_BUCKET_INDEX(true_size);
+ unsigned int bitmap;
+
+#if ZEND_MM_CACHE
+ if (heap->cache[index]) {
+ /* Get block from cache */
+ best_fit = heap->cache[index];
+ heap->cache[index] = best_fit->prev_free_block;
+ heap->cached -= true_size;
+#if ZEND_DEBUG
+ ZEND_MM_CHECK_MAGIC(best_fit, MEM_BLOCK_CACHED);
+ ZEND_MM_SET_MAGIC(best_fit, MEM_BLOCK_VALID);
+ ((zend_mm_block*)best_fit)->debug.size = size;
+ ((zend_mm_block*)best_fit)->debug.filename = __zend_filename;
+ ((zend_mm_block*)best_fit)->debug.lineno = __zend_lineno;
+ ((zend_mm_block*)best_fit)->debug.orig_filename = __zend_orig_filename;
+ ((zend_mm_block*)best_fit)->debug.orig_lineno = __zend_orig_lineno;
+ ZEND_MM_SET_END_MAGIC(best_fit);
+#endif
+ return ZEND_MM_DATA_OF(best_fit);
+ }
+#endif
+
+ bitmap = heap->free_bitmap >> index;
+ if (bitmap) {
+ /* Found some "small" free block that can be used */
+ if (bitmap & 1) {
+ /* Found "small" free block of exactly the same size */
+ best_fit = heap->free_buckets[index].next_free_block;
+ goto zend_mm_finished_searching_for_block;
+ } else {
+ /* Search for bigger "small" block */
+ static const int offset[16] = {4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0};
+ int n;
+
+ /* Unrolled loop that search for best "small" block */
+ do {
+ n = offset[bitmap & 15];
+ bitmap >>= 4;
+ index += n;
+ } while (n == 4);
+
+ best_fit = heap->free_buckets[index].next_free_block;
+ goto zend_mm_finished_searching_for_block;
+ }
+ }
+ }
+
+ end = &heap->free_buckets[0];
+ for (p = end->next_free_block; p != end; p = p->next_free_block) {
+ size_t s = ZEND_MM_FREE_BLOCK_SIZE(p);
+ if (s > true_size) {
+ if (s < best_size) { /* better fit */
+ best_fit = p;
+ best_size = s;
+ }
+ } else if (s == true_size) {
+ /* Found "big" free block of exactly the same size */
+ best_fit = p;
+ goto zend_mm_finished_searching_for_block;
+ }
+ }
+
+ if (best_fit) {
+zend_mm_finished_searching_for_block:
+ /* remove from free list */
+ HANDLE_BLOCK_INTERRUPTIONS();
+#if ZEND_DEBUG
+ ZEND_MM_CHECK_MAGIC(best_fit, MEM_BLOCK_FREED);
+#endif
+ zend_mm_remove_from_free_list(heap, best_fit);
+
+ {
+ size_t block_size = ZEND_MM_FREE_BLOCK_SIZE(best_fit);
+ size_t remaining_size = block_size - true_size;
+
+ if (remaining_size < ZEND_MM_ALIGNED_MIN_HEADER_SIZE) {
+ ZEND_MM_BLOCK(best_fit, ZEND_MM_USED_BLOCK, block_size);
+ } else {
+ zend_mm_free_block *new_free_block;
+
+ /* prepare new free block */
+ ZEND_MM_BLOCK(best_fit, ZEND_MM_USED_BLOCK, true_size);
+ new_free_block = (zend_mm_free_block *) ZEND_MM_BLOCK_AT(best_fit, true_size);
+ ZEND_MM_BLOCK(new_free_block, ZEND_MM_FREE_BLOCK, remaining_size);
+
+ /* add the new free block to the free list */
+ zend_mm_add_to_free_list(heap, new_free_block);
+ }
+ }
+ } else {
+ size_t segment_size;
+ size_t block_size;
+ size_t remaining_size;
+ zend_mm_segment *segment;
+
+ if (true_size + ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE > heap->block_size) {
+ /* Make sure we add a memory block which is big enough,
+ segment must have header "size" and trailer "guard" block */
+ segment_size = true_size + ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE;
+ segment_size = ((segment_size + (heap->block_size-1)) / heap->block_size) * heap->block_size;
+ } else {
+ segment_size = heap->block_size;
+ }
+
+
#if MEMORY_LIMIT
- AG(memory_limit) = 1<<30; /* ridiculous limit, effectively no limit */
- AG(allocated_memory) = 0;
- AG(memory_exhausted) = 0;
- AG(allocated_memory_peak) = 0;
+ if (heap->real_size + segment_size > heap->limit) {
+ /* Memory limit overflow */
+#if ZEND_DEBUG
+ zend_mm_safe_error(heap, "Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", heap->limit, __zend_filename, __zend_lineno, size);
+#else
+ zend_mm_safe_error(heap, "Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", heap->limit, size);
#endif
+ }
+#endif
+
+ HANDLE_BLOCK_INTERRUPTIONS();
-#if ZEND_ENABLE_FAST_CACHE
- memset(AG(fast_cache_list_head), 0, sizeof(AG(fast_cache_list_head)));
+ segment = (zend_mm_segment *) ZEND_MM_STORAGE_ALLOC(segment_size);
+
+ if (!segment) {
+ /* Storage manager cannot allocate memory */
+#if ZEND_MM_CACHE
+ zend_mm_free_cache(heap);
#endif
-#if !ZEND_DISABLE_MEMORY_CACHE
- memset(AG(cache_count), 0, sizeof(AG(cache_count)));
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+#if ZEND_DEBUG
+ zend_mm_safe_error(heap, "Out of memory (allocated %d) at %s:%d (tried to allocate %d bytes)", heap->real_size, __zend_filename, __zend_lineno, size);
+#else
+ zend_mm_safe_error(heap, "Out of memory (allocated %d) (tried to allocate %d bytes)", heap->real_size, size);
#endif
+ return NULL;
+ }
-#ifdef ZEND_MM
- zend_mm_startup(&AG(mm_heap), 256*1024);
-#elif defined(ZEND_WIN32)
- AG(memory_heap) = HeapCreate(HEAP_NO_SERIALIZE, 256*1024, 0);
+ heap->real_size += segment_size;
+#if MEMORY_LIMIT
+ if (heap->real_size > heap->real_peak) {
+ heap->real_peak = heap->real_size;
+ }
#endif
+ segment->size = segment_size;
+ segment->next_segment = heap->segments_list;
+ heap->segments_list = segment;
+
+ best_fit = (zend_mm_free_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE);
+ ZEND_MM_MARK_FIRST_BLOCK(best_fit);
+
+ block_size = segment_size - ZEND_MM_ALIGNED_SEGMENT_SIZE - ZEND_MM_ALIGNED_HEADER_SIZE;
+ remaining_size = block_size - true_size;
+
+ ZEND_MM_LAST_BLOCK(ZEND_MM_BLOCK_AT(best_fit, block_size));
+
+ if (remaining_size < ZEND_MM_ALIGNED_MIN_HEADER_SIZE) {
+ ZEND_MM_BLOCK(best_fit, ZEND_MM_USED_BLOCK, block_size);
+ } else {
+ zend_mm_free_block *new_free_block;
+
+ /* prepare new free block */
+ ZEND_MM_BLOCK(best_fit, ZEND_MM_USED_BLOCK, true_size);
+ new_free_block = (zend_mm_free_block *) ZEND_MM_BLOCK_AT(best_fit, true_size);
+ ZEND_MM_BLOCK(new_free_block, ZEND_MM_FREE_BLOCK, remaining_size);
+
+ /* add the new free block to the free list */
+ zend_mm_add_to_free_list(heap, new_free_block);
+ }
+ }
+
#if ZEND_DEBUG
- memset(AG(cache_stats), 0, sizeof(AG(cache_stats)));
- memset(AG(fast_cache_stats), 0, sizeof(AG(fast_cache_stats)));
+ ZEND_MM_SET_MAGIC(best_fit, MEM_BLOCK_VALID);
+ ((zend_mm_block*)best_fit)->debug.size = size;
+ ((zend_mm_block*)best_fit)->debug.filename = __zend_filename;
+ ((zend_mm_block*)best_fit)->debug.lineno = __zend_lineno;
+ ((zend_mm_block*)best_fit)->debug.orig_filename = __zend_orig_filename;
+ ((zend_mm_block*)best_fit)->debug.orig_lineno = __zend_orig_lineno;
+# ifdef ZTS
+ ((zend_mm_block*)best_fit)->thread_id = tsrm_thread_id();
+# endif
+ ZEND_MM_SET_END_MAGIC(best_fit);
#endif
+
+#if MEMORY_LIMIT
+ heap->size += true_size;
+ if (heap->peak < heap->size) {
+ heap->peak = heap->size;
+ }
+#endif
+
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+
+ return ZEND_MM_DATA_OF(best_fit);
}
-ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
+static void _zend_mm_free_int(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
-#if ZEND_DEBUG || !defined(ZEND_MM)
- zend_mem_header *p, *t;
-#endif
+ zend_mm_block *mm_block;
+ zend_mm_block *prev_block, *next_block;
+ size_t size;
+
+ if (!ZEND_MM_VALID_PTR(p)) {
+ return;
+ }
+ mm_block = ZEND_MM_HEADER_OF(p);
+ size = ZEND_MM_BLOCK_SIZE(mm_block);
+
#if ZEND_DEBUG
- zend_uint grand_total_leaks=0;
+ memset(ZEND_MM_DATA_OF(mm_block), 0x5a, mm_block->debug.size);
#endif
-#if !ZEND_DISABLE_MEMORY_CACHE
- /* Free memory cache even on partial shutdown to avoid fragmentation */
- if (1 || full_shutdown) {
- unsigned int i, j;
- zend_mem_header *ptr;
+#if ZEND_MM_CACHE
+ if (ZEND_MM_SMALL_SIZE(size) && heap->cached < ZEND_MM_CACHE_SIZE) {
+ size_t index = ZEND_MM_BUCKET_INDEX(size);
+ zend_mm_free_block **cache = &heap->cache[index];
- for (i=0; i<MAX_CACHED_MEMORY; i++) {
- for (j=0; j<AG(cache_count)[i]; j++) {
- ptr = (zend_mem_header *) AG(cache)[i][j];
-# if MEMORY_LIMIT
- AG(allocated_memory) -= REAL_SIZE(ptr->size);
-# endif
- REMOVE_POINTER_FROM_LIST(ptr);
- ZEND_DO_FREE(ptr);
+ ((zend_mm_free_block*)mm_block)->prev_free_block = *cache;
+ *cache = (zend_mm_free_block*)mm_block;
+ heap->cached += size;
+ ZEND_MM_SET_MAGIC(mm_block, MEM_BLOCK_CACHED);
+ return;
+ }
+#endif
+
+ HANDLE_BLOCK_INTERRUPTIONS();
+
+#if MEMORY_LIMIT
+ heap->size -= size;
+#endif
+
+ if (ZEND_MM_PREV_BLOCK_IS_FREE(mm_block)) {
+ next_block = ZEND_MM_NEXT_BLOCK(mm_block);
+ if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
+ /* merge with previous and next block */
+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block);
+ prev_block=ZEND_MM_PREV_BLOCK(mm_block);
+ if (ZEND_MM_SMALL_SIZE(ZEND_MM_FREE_BLOCK_SIZE(prev_block))) {
+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) prev_block);
+ size += ZEND_MM_FREE_BLOCK_SIZE(prev_block) + ZEND_MM_FREE_BLOCK_SIZE(next_block);
+ mm_block = prev_block;
+ } else {
+ ZEND_MM_BLOCK(prev_block, ZEND_MM_FREE_BLOCK, size + ZEND_MM_FREE_BLOCK_SIZE(prev_block) + ZEND_MM_FREE_BLOCK_SIZE(next_block));
+ if (ZEND_MM_IS_FIRST_BLOCK(prev_block) &&
+ ZEND_MM_IS_GUARD_BLOCK(ZEND_MM_NEXT_BLOCK(prev_block))) {
+ mm_block = prev_block;
+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) mm_block);
+ goto free_segment;
+ }
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+ return;
}
- AG(cache_count)[i] = 0;
+ } else {
+ /* merge with previous block */
+ prev_block=ZEND_MM_PREV_BLOCK(mm_block);
+ if (ZEND_MM_SMALL_SIZE(ZEND_MM_FREE_BLOCK_SIZE(prev_block))) {
+ size += ZEND_MM_FREE_BLOCK_SIZE(prev_block);
+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) prev_block);
+ mm_block = prev_block;
+ } else {
+ ZEND_MM_BLOCK(prev_block, ZEND_MM_FREE_BLOCK, size + ZEND_MM_FREE_BLOCK_SIZE(prev_block));
+ if (ZEND_MM_IS_FIRST_BLOCK(prev_block) &&
+ ZEND_MM_IS_GUARD_BLOCK(ZEND_MM_NEXT_BLOCK(prev_block))) {
+ mm_block = prev_block;
+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) mm_block);
+ goto free_segment;
+ }
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+ return;
+ }
+ }
+ } else {
+ next_block = ZEND_MM_NEXT_BLOCK(mm_block);
+ if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
+ /* merge with the next block */
+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block);
+ size += ZEND_MM_FREE_BLOCK_SIZE(next_block);
}
}
-#endif /* !ZEND_DISABLE_MEMORY_CACHE */
+ ZEND_MM_BLOCK(mm_block, ZEND_MM_FREE_BLOCK, size);
+ if (ZEND_MM_IS_FIRST_BLOCK(mm_block) &&
+ ZEND_MM_IS_GUARD_BLOCK(ZEND_MM_NEXT_BLOCK(mm_block))) {
+free_segment:
+ zend_mm_del_segment(heap, (zend_mm_segment *) ((char *)mm_block - ZEND_MM_ALIGNED_SEGMENT_SIZE));
+ } else {
+ zend_mm_add_to_free_list(heap, (zend_mm_free_block *) mm_block);
+ }
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+}
-#if defined(ZEND_MM) && !ZEND_DEBUG
- zend_mm_shutdown(&AG(mm_heap));
- if (full_shutdown) {
- return;
+static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+ zend_mm_block *mm_block = ZEND_MM_HEADER_OF(p);
+ zend_mm_block *next_block;
+ size_t true_size;
+ void *ptr;
+
+ if (!p || !ZEND_MM_VALID_PTR(p)) {
+ return _zend_mm_alloc_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
- zend_mm_startup(&AG(mm_heap), 256*1024);
+ mm_block = ZEND_MM_HEADER_OF(p);
+ true_size = ZEND_MM_TRUE_SIZE(size);
-#elif defined(ZEND_WIN32) && !ZEND_DEBUG
- if (full_shutdown && AG(memory_heap)) {
- HeapDestroy(AG(memory_heap));
- return;
+#if MEMORY_LIMIT
+ heap->size = heap->size + true_size - ZEND_MM_BLOCK_SIZE(mm_block);
+ if (heap->peak < heap->size) {
+ heap->peak = heap->size;
}
#endif
+
+ if (true_size <= ZEND_MM_BLOCK_SIZE(mm_block)) {
+ size_t remaining_size = ZEND_MM_BLOCK_SIZE(mm_block) - true_size;
-#if ZEND_ENABLE_FAST_CACHE
- {
- zend_fast_cache_list_entry *fast_cache_list_entry, *next_fast_cache_list_entry;
- unsigned int fci;
-
- for (fci=0; fci<MAX_FAST_CACHE_TYPES; fci++) {
- fast_cache_list_entry = AG(fast_cache_list_head)[fci];
- while (fast_cache_list_entry) {
- next_fast_cache_list_entry = fast_cache_list_entry->next;
- efree(fast_cache_list_entry);
- fast_cache_list_entry = next_fast_cache_list_entry;
+ if (remaining_size >= ZEND_MM_ALIGNED_MIN_HEADER_SIZE) {
+ zend_mm_free_block *new_free_block;
+
+ HANDLE_BLOCK_INTERRUPTIONS();
+ next_block = ZEND_MM_NEXT_BLOCK(mm_block);
+ if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
+ remaining_size += ZEND_MM_FREE_BLOCK_SIZE(next_block);
+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block);
}
- AG(fast_cache_list_head)[fci] = NULL;
+
+ /* prepare new free block */
+ ZEND_MM_BLOCK(mm_block, ZEND_MM_USED_BLOCK, true_size);
+ new_free_block = (zend_mm_free_block *) ZEND_MM_BLOCK_AT(mm_block, true_size);
+
+ ZEND_MM_BLOCK(new_free_block, ZEND_MM_FREE_BLOCK, remaining_size);
+
+ /* add the new free block to the free list */
+ zend_mm_add_to_free_list(heap, new_free_block);
+ HANDLE_UNBLOCK_INTERRUPTIONS();
}
+#if ZEND_DEBUG
+ mm_block->debug.size = size;
+ mm_block->debug.filename = __zend_filename;
+ mm_block->debug.lineno = __zend_lineno;
+ mm_block->debug.orig_filename = __zend_orig_filename;
+ mm_block->debug.orig_lineno = __zend_orig_lineno;
+ ZEND_MM_SET_END_MAGIC(mm_block);
+#endif
+ return p;
}
-#endif /* ZEND_ENABLE_FAST_CACHE */
-#if ZEND_DEBUG || !defined(ZEND_MM)
- p = AG(head);
- t = AG(head);
- while (t) {
-#if ZEND_DEBUG
- if (!t->reported) {
- zend_mem_header *iterator;
- int total_leak=0, total_leak_count=0;
+ next_block = ZEND_MM_NEXT_BLOCK(mm_block);
- grand_total_leaks++;
- if (!silent) {
- zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL);
- zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, t);
- }
- t->reported = 1;
- for (iterator=t->pNext; iterator; iterator=iterator->pNext) {
- if (iterator->filename==t->filename && iterator->lineno==t->lineno) {
- total_leak += iterator->size;
- total_leak_count++;
- iterator->reported = 1;
- }
- }
- if (!silent && total_leak_count>0) {
- zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *) (long) (total_leak_count));
+ if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
+ if (ZEND_MM_BLOCK_SIZE(mm_block) + ZEND_MM_FREE_BLOCK_SIZE(next_block) >= true_size) {
+ size_t block_size = ZEND_MM_BLOCK_SIZE(mm_block) + ZEND_MM_FREE_BLOCK_SIZE(next_block);
+ size_t remaining_size = block_size - true_size;
+
+ HANDLE_BLOCK_INTERRUPTIONS();
+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block);
+
+ if (remaining_size < ZEND_MM_ALIGNED_MIN_HEADER_SIZE) {
+ ZEND_MM_BLOCK(mm_block, ZEND_MM_USED_BLOCK, block_size);
+ } else {
+ zend_mm_free_block *new_free_block;
+
+ /* prepare new free block */
+ ZEND_MM_BLOCK(mm_block, ZEND_MM_USED_BLOCK, true_size);
+ new_free_block = (zend_mm_free_block *) ZEND_MM_BLOCK_AT(mm_block, true_size);
+ ZEND_MM_BLOCK(new_free_block, ZEND_MM_FREE_BLOCK, remaining_size);
+
+ /* add the new free block to the free list */
+ zend_mm_add_to_free_list(heap, new_free_block);
}
- grand_total_leaks += total_leak_count;
+#if ZEND_DEBUG
+ mm_block->debug.size = size;
+ mm_block->debug.filename = __zend_filename;
+ mm_block->debug.lineno = __zend_lineno;
+ mm_block->debug.orig_filename = __zend_orig_filename;
+ mm_block->debug.orig_lineno = __zend_orig_lineno;
+ ZEND_MM_SET_END_MAGIC(mm_block);
+#endif
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+ return p;
+ } else if (ZEND_MM_IS_FIRST_BLOCK(mm_block) &&
+ ZEND_MM_IS_GUARD_BLOCK(ZEND_MM_NEXT_BLOCK(next_block))) {
+ HANDLE_BLOCK_INTERRUPTIONS();
+ zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block);
+ goto realloc_segment;
}
+ } else if (ZEND_MM_IS_FIRST_BLOCK(mm_block) && ZEND_MM_IS_GUARD_BLOCK(next_block)) {
+ zend_mm_segment *segment;
+ zend_mm_segment *segment_copy;
+ size_t segment_size;
+ size_t block_size;
+ size_t remaining_size;
+
+ HANDLE_BLOCK_INTERRUPTIONS();
+realloc_segment:
+ /* segment size, size of block and size of guard block */
+ if (true_size+ZEND_MM_ALIGNED_SEGMENT_SIZE+ZEND_MM_ALIGNED_HEADER_SIZE > heap->block_size) {
+ segment_size = true_size+ZEND_MM_ALIGNED_SEGMENT_SIZE+ZEND_MM_ALIGNED_HEADER_SIZE;
+ segment_size = ((segment_size + (heap->block_size-1)) / heap->block_size) * heap->block_size;
+ } else {
+ segment_size = heap->block_size;
+ }
+
+ segment_copy = (zend_mm_segment *) ((char *)mm_block - ZEND_MM_ALIGNED_SEGMENT_SIZE);
+#if MEMORY_LIMIT
+ if (heap->real_size + segment_size - segment_copy->size > heap->limit) {
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+#if ZEND_DEBUG
+ zend_mm_safe_error(heap, "Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", heap->limit, __zend_filename, __zend_lineno, size);
+#else
+ zend_mm_safe_error(heap, "Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", heap->limit, size);
#endif
+ return NULL;
+ }
+#endif
+ segment = ZEND_MM_STORAGE_REALLOC(segment_copy, segment_size);
+ if (!segment) {
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+#if ZEND_DEBUG
+ zend_mm_safe_error(heap, "Out of memory (allocated %d) at %s:%d (tried to allocate %d bytes)", heap->real_size, __zend_filename, __zend_lineno, size);
+#else
+ zend_mm_safe_error(heap, "Out of memory (allocated %d) (tried to allocate %d bytes)", heap->real_size, size);
+#endif
+ return NULL;
+ }
+ heap->real_size += segment_size - segment->size;
#if MEMORY_LIMIT
- AG(allocated_memory) -= REAL_SIZE(t->size);
+ if (heap->real_size > heap->real_peak) {
+ heap->real_peak = heap->real_size;
+ }
#endif
- p = t->pNext;
- REMOVE_POINTER_FROM_LIST(t);
- ZEND_DO_FREE(t);
- t = p;
- }
+ segment->size = segment_size;
+
+ 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);
+ ZEND_MM_MARK_FIRST_BLOCK(mm_block);
+ }
+
+ block_size = segment_size - ZEND_MM_ALIGNED_SEGMENT_SIZE - ZEND_MM_ALIGNED_HEADER_SIZE;
+ remaining_size = block_size - true_size;
+
+ /* setup guard block */
+ ZEND_MM_LAST_BLOCK(ZEND_MM_BLOCK_AT(mm_block, block_size));
+
+ if (remaining_size < ZEND_MM_ALIGNED_MIN_HEADER_SIZE) {
+ ZEND_MM_BLOCK(mm_block, ZEND_MM_USED_BLOCK, block_size);
+ } else {
+ zend_mm_free_block *new_free_block;
+
+ /* prepare new free block */
+ ZEND_MM_BLOCK(mm_block, ZEND_MM_USED_BLOCK, true_size);
+ new_free_block = (zend_mm_free_block *) ZEND_MM_BLOCK_AT(mm_block, true_size);
+ ZEND_MM_BLOCK(new_free_block, ZEND_MM_FREE_BLOCK, remaining_size);
+
+ /* add the new free block to the free list */
+ zend_mm_add_to_free_list(heap, new_free_block);
+ }
#if ZEND_DEBUG
- if (!silent && grand_total_leaks > 0) {
- zend_message_dispatcher(ZMSG_MEMORY_LEAKS_GRAND_TOTAL, &grand_total_leaks);
- }
+ ZEND_MM_SET_MAGIC(mm_block, MEM_BLOCK_VALID);
+ mm_block->debug.size = size;
+ mm_block->debug.filename = __zend_filename;
+ mm_block->debug.lineno = __zend_lineno;
+ mm_block->debug.orig_filename = __zend_orig_filename;
+ mm_block->debug.orig_lineno = __zend_orig_lineno;
+# ifdef ZTS
+ mm_block->thread_id = tsrm_thread_id();
+# endif
+ ZEND_MM_SET_END_MAGIC(mm_block);
#endif
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+ return ZEND_MM_DATA_OF(mm_block);
+ }
-#if MEMORY_LIMIT
- AG(memory_exhausted)=0;
- AG(allocated_memory_peak) = 0;
+ ptr = _zend_mm_alloc_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+#if ZEND_DEBUG
+ memcpy(ptr, p, mm_block->debug.size);
+#else
+ memcpy(ptr, p, ZEND_MM_BLOCK_SIZE(mm_block) - ZEND_MM_ALIGNED_HEADER_SIZE);
#endif
+ _zend_mm_free_int(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ return ptr;
+}
+ZEND_API void *_zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+ return _zend_mm_alloc_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+}
-#if (ZEND_DEBUG)
- do {
- zval display_memory_cache_stats;
- int i, j;
+ZEND_API void _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+ _zend_mm_free_int(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+}
- if (full_shutdown) {
- /* we're shutting down completely, don't even touch the INI subsystem */
- break;
- }
- if (zend_get_configuration_directive("display_memory_cache_stats", sizeof("display_memory_cache_stats"), &display_memory_cache_stats)==FAILURE) {
- break;
- }
- if (!atoi(display_memory_cache_stats.value.str.val)) {
- break;
- }
- fprintf(stderr, "Memory cache statistics\n"
- "-----------------------\n\n"
- "[zval, %2ld]\t\t%d / %d (%.2f%%)\n"
- "[hash, %2ld]\t\t%d / %d (%.2f%%)\n",
- (long) sizeof(zval),
- AG(fast_cache_stats)[ZVAL_CACHE_LIST][1], AG(fast_cache_stats)[ZVAL_CACHE_LIST][0]+AG(fast_cache_stats)[ZVAL_CACHE_LIST][1],
- ((double) AG(fast_cache_stats)[ZVAL_CACHE_LIST][1] / (AG(fast_cache_stats)[ZVAL_CACHE_LIST][0]+AG(fast_cache_stats)[ZVAL_CACHE_LIST][1]))*100,
- (long) sizeof(HashTable),
- AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][1], AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][0]+AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][1],
- ((double) AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][1] / (AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][0]+AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][1]))*100);
+ZEND_API void *_zend_mm_realloc(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+ return _zend_mm_realloc_int(heap, ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+}
+ZEND_API size_t _zend_mm_block_size(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+ zend_mm_block *mm_block;
- for (i=0; i<MAX_CACHED_MEMORY; i+=2) {
- fprintf(stderr, "[%2d, %2d]\t\t", i, i+1);
- for (j=0; j<2; j++) {
- fprintf(stderr, "%d / %d (%.2f%%)\t\t",
- AG(cache_stats)[i+j][1], AG(cache_stats)[i+j][0]+AG(cache_stats)[i+j][1],
- ((double) AG(cache_stats)[i+j][1] / (AG(cache_stats)[i+j][0]+AG(cache_stats)[i+j][1]))*100);
- }
- fprintf(stderr, "\n");
- }
-
- } while (0);
+ if (!ZEND_MM_VALID_PTR(p)) {
+ return 0;
+ }
+ mm_block = ZEND_MM_HEADER_OF(p);
+#if ZEND_DEBUG
+ return mm_block->debug.size;
+#else
+ return ZEND_MM_BLOCK_SIZE(mm_block);
#endif
+}
+
+/**********************/
+/* Allocation Manager */
+/**********************/
+
+typedef struct _zend_alloc_globals {
+ zend_mm_heap *mm_heap;
+} zend_alloc_globals;
+#ifdef ZTS
+static int alloc_globals_id;
+# define AG(v) TSRMG(alloc_globals_id, zend_alloc_globals *, v)
+#else
+# define AG(v) (alloc_globals.v)
+static zend_alloc_globals alloc_globals;
#endif
-#if defined(ZEND_MM) && ZEND_DEBUG
- zend_mm_shutdown(&AG(mm_heap));
- if (full_shutdown) {
- return;
+ZEND_API int is_zend_mm(TSRMLS_D)
+{
+#if ZEND_USE_MALLOC_MM
+ return AG(mm_heap)->use_zend_alloc;
+#else
+ return 1;
+#endif
+}
+
+ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+ TSRMLS_FETCH();
+
+#if ZEND_USE_MALLOC_MM
+ if (!AG(mm_heap)->use_zend_alloc) {
+ return malloc(size);
}
- zend_mm_startup(&AG(mm_heap), 256*1024);
-#elif defined(ZEND_WIN32) && ZEND_DEBUG
- if (full_shutdown && AG(memory_heap)) {
- HeapDestroy(AG(memory_heap));
+#endif
+ return _zend_mm_alloc_int(AG(mm_heap), size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+}
+
+ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+ TSRMLS_FETCH();
+
+#if ZEND_USE_MALLOC_MM
+ if (!AG(mm_heap)->use_zend_alloc) {
+ free(ptr);
return;
}
#endif
+ _zend_mm_free_int(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
-
-#if ZEND_DEBUG
-void zend_debug_alloc_output(char *format, ...)
+ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
- char output_buf[256];
- va_list args;
+ TSRMLS_FETCH();
- va_start(args, format);
- vsprintf(output_buf, format, args);
- va_end(args);
+#if ZEND_USE_MALLOC_MM
+ if (!AG(mm_heap)->use_zend_alloc) {
+ return realloc(ptr, size);
+ }
+#endif
+ return _zend_mm_realloc_int(AG(mm_heap), ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+}
-#ifdef ZEND_WIN32
- OutputDebugString(output_buf);
-#else
- fprintf(stderr, "%s", output_buf);
+ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+#if ZEND_USE_MALLOC_MM
+ if (!AG(mm_heap)->use_zend_alloc) {
+ return 0;
+ }
#endif
+ return _zend_mm_block_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
+#include "zend_multiply.h"
-ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+ZEND_API void *_safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
- zend_mem_header *p = (zend_mem_header *) ((char *)ptr - sizeof(zend_mem_header) - MEM_HEADER_PADDING);
- int no_cache_notice=0;
- int valid_beginning=1;
- int had_problems=0;
- long end_magic;
- if (silent==2) {
- silent = 1;
- no_cache_notice = 1;
- }
- if (silent==3) {
- silent = 0;
- no_cache_notice = 1;
+ if (nmemb < LONG_MAX
+ && size < LONG_MAX
+ && offset < LONG_MAX
+ && nmemb >= 0
+ && size >= 0
+ && offset >= 0) {
+ long lval;
+ double dval;
+ int use_dval;
+
+ ZEND_SIGNED_MULTIPLY_LONG(nmemb, size, lval, dval, use_dval);
+
+ if (!use_dval
+ && lval < (long) (LONG_MAX - offset)) {
+ return emalloc_rel(lval + offset);
+ }
}
- if (!silent) {
- zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL);
- zend_debug_alloc_output("---------------------------------------\n");
- zend_debug_alloc_output("%s(%d) : Block 0x%0.8lX status:\n" ZEND_FILE_LINE_RELAY_CC, (long) p);
- if (__zend_orig_filename) {
- zend_debug_alloc_output("%s(%d) : Actual location (location was relayed)\n" ZEND_FILE_LINE_ORIG_RELAY_CC);
+
+ zend_error(E_ERROR, "Possible integer overflow in memory allocation (%zd * %zd + %zd)", nmemb, size, offset);
+ return 0;
+}
+
+ZEND_API void *_safe_malloc(size_t nmemb, size_t size, size_t offset)
+{
+
+ if (nmemb < LONG_MAX
+ && size < LONG_MAX
+ && offset < LONG_MAX
+ && nmemb >= 0
+ && size >= 0
+ && offset >= 0) {
+ long lval;
+ double dval;
+ int use_dval;
+
+ ZEND_SIGNED_MULTIPLY_LONG(nmemb, size, lval, dval, use_dval);
+
+ if (!use_dval
+ && lval < (long) (LONG_MAX - offset)) {
+ return pemalloc(lval + offset, 1);
}
- zend_debug_alloc_output("%10s\t","Beginning: ");
}
- switch (p->magic) {
- case MEM_BLOCK_START_MAGIC:
- if (!silent) {
- zend_debug_alloc_output("OK (allocated on %s:%d, %d bytes)\n", p->filename, p->lineno, p->size);
- }
- break; /* ok */
- case MEM_BLOCK_FREED_MAGIC:
- if (!silent) {
- zend_debug_alloc_output("Freed\n");
- had_problems = 1;
- } else {
- return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
- }
- break;
- case MEM_BLOCK_CACHED_MAGIC:
- if (!silent) {
- if (!no_cache_notice) {
- zend_debug_alloc_output("Cached (allocated on %s:%d, %d bytes)\n", p->filename, p->lineno, p->size);
- had_problems = 1;
- }
- } else {
- if (!no_cache_notice) {
- return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
- }
- }
- break;
- default:
- if (!silent) {
- zend_debug_alloc_output("Overrun (magic=0x%0.8lX, expected=0x%0.8lX)\n", p->magic, MEM_BLOCK_START_MAGIC);
- } else {
- return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
- }
- had_problems = 1;
- valid_beginning = 0;
- break;
+ zend_error(E_ERROR, "Possible integer overflow in memory allocation (%zd * %zd + %zd)", nmemb, size, offset);
+ return 0;
+}
+
+ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+ void *p;
+
+ p = _safe_emalloc(nmemb, size, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ if (!p) {
+ return (void *) p;
}
+ memset(p, 0, size * nmemb);
+ return p;
+}
+ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+ int length;
+ char *p;
- memcpy(&end_magic, (((char *) p)+sizeof(zend_mem_header)+MEM_HEADER_PADDING+p->size), sizeof(long));
+ length = strlen(s)+1;
+ p = (char *) _emalloc(length ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ if (!p) {
+ return (char *)NULL;
+ }
+ memcpy(p, s, length);
+ return p;
+}
- if (valid_beginning && (end_magic != MEM_BLOCK_END_MAGIC)) {
- char *overflow_ptr, *magic_ptr=(char *) &mem_block_end_magic;
- int overflows=0;
- long i;
+ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+ char *p;
- if (silent) {
- return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
- }
- had_problems = 1;
- overflow_ptr = (char *) &end_magic;
+ p = (char *) _emalloc(length+1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ if (!p) {
+ return (char *)NULL;
+ }
+ memcpy(p, s, length);
+ p[length] = 0;
+ return p;
+}
- for (i=0; i<(int)sizeof(long); i++) {
- if (overflow_ptr[i]!=magic_ptr[i]) {
- overflows++;
- }
- }
- zend_debug_alloc_output("%10s\t", "End:");
- zend_debug_alloc_output("Overflown (magic=0x%0.8lX instead of 0x%0.8lX)\n", end_magic, MEM_BLOCK_END_MAGIC);
- zend_debug_alloc_output("%10s\t","");
- if (overflows>=(int)sizeof(long)) {
- zend_debug_alloc_output("At least %d bytes overflown\n", sizeof(long));
- } else {
- zend_debug_alloc_output("%d byte(s) overflown\n", overflows);
- }
- } else if (!silent) {
- zend_debug_alloc_output("%10s\t", "End:");
- if (valid_beginning) {
- zend_debug_alloc_output("OK\n");
- } else {
- zend_debug_alloc_output("Unknown\n");
+ZEND_API char *zend_strndup(const char *s, uint length)
+{
+ char *p;
+
+ p = (char *) malloc(length+1);
+ if (!p) {
+ return (char *)NULL;
+ }
+ if (length) {
+ memcpy(p, s, length);
+ }
+ p[length] = 0;
+ return p;
+}
+
+
+ZEND_API int zend_set_memory_limit(unsigned int memory_limit)
+{
+#if MEMORY_LIMIT
+ TSRMLS_FETCH();
+
+ AG(mm_heap)->limit = memory_limit;
+ return SUCCESS;
+#else
+ return FAILURE;
+#endif
+}
+
+ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC)
+{
+ if (real_usage) {
+ return AG(mm_heap)->real_size;
+ } else {
+#if MEMORY_LIMIT
+ return AG(mm_heap)->size;
+#else
+ return AG(mm_heap)->real_size;
+#endif
+ }
+}
+
+ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC)
+{
+#if MEMORY_LIMIT
+ if (real_usage) {
+ return AG(mm_heap)->real_peak;
+ } else {
+ return AG(mm_heap)->peak;
+ }
+#else
+ return 0;
+#endif
+}
+
+ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
+{
+ zend_mm_shutdown(AG(mm_heap), full_shutdown, silent);
+}
+
+static void alloc_globals_ctor(zend_alloc_globals *alloc_globals TSRMLS_DC)
+{
+ alloc_globals->mm_heap = zend_mm_startup();
+#if ZEND_USE_MALLOC_MM
+ {
+ char *tmp = getenv("USE_ZEND_ALLOC");
+ if (tmp) {
+ alloc_globals->mm_heap->use_zend_alloc = zend_atoi(tmp, 0);
}
}
-
- if (!silent) {
- zend_debug_alloc_output("---------------------------------------\n");
+#endif
+}
+
+#ifdef ZTS
+static void alloc_globals_dtor(zend_alloc_globals *alloc_globals TSRMLS_DC)
+{
+ shutdown_memory_manager(1, 1 TSRMLS_CC);
+}
+#endif
+
+ZEND_API void start_memory_manager(TSRMLS_D)
+{
+#ifdef ZTS
+ ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor);
+#else
+ alloc_globals_ctor(&alloc_globals);
+#endif
+}
+
+ZEND_API zend_mm_heap *zend_mm_set_heap(zend_mm_heap *new_heap TSRMLS_DC)
+{
+ zend_mm_heap *old_heap;
+
+ old_heap = AG(mm_heap);
+ AG(mm_heap) = new_heap;
+ return old_heap;
+}
+
+
+#if ZEND_DEBUG
+ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
+{
+ TSRMLS_FETCH();
+
+#if ZEND_USE_MALLOC_MM
+ if (!AG(mm_heap)->use_zend_alloc) {
+ return 1;
}
- return ((!had_problems) ? 1 : 0);
+#endif
+ return zend_mm_check_ptr(AG(mm_heap), ptr, silent ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
- zend_mem_header *p;
- int errors=0;
+ int errors;
TSRMLS_FETCH();
- p = AG(head);
-
+#if ZEND_USE_MALLOC_MM
+ if (!AG(mm_heap)->use_zend_alloc) {
+ return;
+ }
+#endif
zend_debug_alloc_output("------------------------------------------------\n");
zend_debug_alloc_output("Full Memory Check at %s:%d\n" ZEND_FILE_LINE_RELAY_CC);
- while (p) {
- if (!_mem_block_check((void *)((char *)p + sizeof(zend_mem_header) + MEM_HEADER_PADDING), (silent?2:3) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
- errors++;
- }
- p = p->pNext;
- }
+ errors = zend_mm_check_heap(AG(mm_heap), silent ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+
zend_debug_alloc_output("End of full memory check %s:%d (%d errors)\n" ZEND_FILE_LINE_RELAY_CC, errors);
zend_debug_alloc_output("------------------------------------------------\n");
}
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h
index 8e25aed16..7bf25d38a 100644
--- a/Zend/zend_alloc.h
+++ b/Zend/zend_alloc.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_alloc.h,v 1.63.2.2 2006/01/04 23:53:03 andi Exp $ */
+/* $Id: zend_alloc.h,v 1.63.2.2.2.5 2006/10/12 06:46:51 dmitry Exp $ */
#ifndef ZEND_ALLOC_H
#define ZEND_ALLOC_H
@@ -25,52 +25,16 @@
#include <stdio.h>
#include "../TSRM/TSRM.h"
-#include "zend_globals_macros.h"
+#include "zend.h"
-#include "zend_mm.h"
-
-#define MEM_BLOCK_START_MAGIC 0x7312F8DCL
-#define MEM_BLOCK_END_MAGIC 0x2A8FCC84L
-#define MEM_BLOCK_FREED_MAGIC 0x99954317L
-#define MEM_BLOCK_CACHED_MAGIC 0xFB8277DCL
-
-typedef struct _zend_mem_header {
-#if ZEND_DEBUG
- long magic;
+typedef struct _zend_leak_info {
+ void *addr;
+ size_t size;
char *filename;
uint lineno;
- int reported;
char *orig_filename;
uint orig_lineno;
-# ifdef ZTS
- THREAD_T thread_id;
-# endif
-#endif
-#if ZEND_DEBUG || !defined(ZEND_MM)
- struct _zend_mem_header *pNext;
- struct _zend_mem_header *pLast;
-#endif
- unsigned int size;
-} zend_mem_header;
-
-typedef union _align_test {
- void *ptr;
- double dbl;
- long lng;
-} align_test;
-
-#define MAX_CACHED_MEMORY 11
-#define MAX_CACHED_ENTRIES 256
-#define PRE_INIT_CACHE_ENTRIES 32
-
-#if ZEND_GCC_VERSION >= 2000
-# define PLATFORM_ALIGNMENT (__alignof__ (align_test))
-#else
-# define PLATFORM_ALIGNMENT (sizeof(align_test))
-#endif
-
-#define MEM_HEADER_PADDING (((PLATFORM_ALIGNMENT-sizeof(zend_mem_header))%PLATFORM_ALIGNMENT+PLATFORM_ALIGNMENT)%PLATFORM_ALIGNMENT)
-
+} zend_leak_info;
BEGIN_EXTERN_C()
@@ -84,28 +48,29 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
-
-#if USE_ZEND_ALLOC
+ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
/* Standard wrapper macros */
-#define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
-#define safe_emalloc(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
-#define efree(ptr) _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
-#define ecalloc(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
-#define erealloc(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
-#define erealloc_recoverable(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
-#define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
-#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define safe_emalloc(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define efree(ptr) _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define ecalloc(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define erealloc(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define erealloc_recoverable(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define zend_mem_block_size(ptr) _zend_mem_block_size((ptr) TSRMLS_CC ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
/* Relay wrapper macros */
-#define emalloc_rel(size) _emalloc((size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
-#define safe_emalloc_rel(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
-#define efree_rel(ptr) _efree((ptr) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
-#define ecalloc_rel(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
-#define erealloc_rel(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
-#define erealloc_recoverable_rel(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
-#define estrdup_rel(s) _estrdup((s) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
-#define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define emalloc_rel(size) _emalloc((size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define safe_emalloc_rel(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define efree_rel(ptr) _efree((ptr) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define ecalloc_rel(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define erealloc_rel(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define erealloc_recoverable_rel(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define estrdup_rel(s) _estrdup((s) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define zend_mem_block_size_rel(ptr) _zend_mem_block_size((ptr) TSRMLS_CC ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
/* Selective persistent/non persistent allocation macros */
#define pemalloc(size, persistent) ((persistent)?malloc(size):emalloc(size))
@@ -123,51 +88,6 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
#define perealloc_recoverable_rel(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable_rel((ptr), (size)))
#define pestrdup_rel(s, persistent) ((persistent)?strdup(s):estrdup_rel(s))
-#else
-
-#undef _GNU_SOURCE
-#define _GNU_SOURCE
-#include <string.h>
-#undef _GNU_SOURCE
-
-/* Standard wrapper macros */
-#define emalloc(size) malloc(size)
-#define safe_emalloc(nmemb, size, offset) malloc((nmemb) * (size) + (offset))
-#define efree(ptr) free(ptr)
-#define ecalloc(nmemb, size) calloc((nmemb), (size))
-#define erealloc(ptr, size) realloc((ptr), (size))
-#define erealloc_recoverable(ptr, size) realloc((ptr), (size))
-#define estrdup(s) strdup(s)
-#define estrndup(s, length) zend_strndup((s), (length))
-
-/* Relay wrapper macros */
-#define emalloc_rel(size) malloc(size)
-#define safe_emalloc_rel(nmemb, size, offset) malloc((nmemb) * (size) + (offset))
-#define efree_rel(ptr) free(ptr)
-#define ecalloc_rel(nmemb, size) calloc((nmemb), (size))
-#define erealloc_rel(ptr, size) realloc((ptr), (size))
-#define erealloc_recoverable_rel(ptr, size) realloc((ptr), (size))
-#define estrdup_rel(s) strdup(s)
-#define estrndup_rel(s, length) zend_strndup((s), (length))
-
-/* Selective persistent/non persistent allocation macros */
-#define pemalloc(size, persistent) malloc(size)
-#define safe_pemalloc(nmemb, size, offset, persistent) malloc((nmemb) * (size) + (offset))
-#define pefree(ptr, persistent) free(ptr)
-#define pecalloc(nmemb, size, persistent) calloc((nmemb), (size))
-#define perealloc(ptr, size, persistent) realloc((ptr), (size))
-#define perealloc_recoverable(ptr, size, persistent) realloc((ptr), (size))
-#define pestrdup(s, persistent) strdup(s)
-
-#define pemalloc_rel(size, persistent) malloc(size)
-#define pefree_rel(ptr, persistent) free(ptr)
-#define pecalloc_rel(nmemb, size, persistent) calloc((nmemb), (size))
-#define perealloc_rel(ptr, size, persistent) realloc((ptr), (size))
-#define perealloc_recoverable_rel(ptr, size, persistent) realloc((ptr), (size))
-#define pestrdup_rel(s, persistent) strdup(s)
-
-#endif /* !USE_ZEND_ALLOC */
-
#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):STR_EMPTY_ALLOC())
#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):STR_EMPTY_ALLOC())
@@ -175,6 +95,7 @@ ZEND_API int zend_set_memory_limit(unsigned int memory_limit);
ZEND_API void start_memory_manager(TSRMLS_D);
ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC);
+ZEND_API int is_zend_mm(TSRMLS_D);
#if ZEND_DEBUG
ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
@@ -187,8 +108,96 @@ void zend_debug_alloc_output(char *format, ...);
#define full_mem_check(silent)
#endif
+ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC);
+ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC);
+
END_EXTERN_C()
+/* Macroses for zend_fast_cache.h compatibility */
+
+#define ZEND_FAST_ALLOC(p, type, fc_type) \
+ (p) = (type *) emalloc(sizeof(type))
+
+#define ZEND_FAST_FREE(p, fc_type) \
+ efree(p)
+
+#define ZEND_FAST_ALLOC_REL(p, type, fc_type) \
+ (p) = (type *) emalloc_rel(sizeof(type))
+
+#define ZEND_FAST_FREE_REL(p, fc_type) \
+ efree_rel(p)
+
+/* fast cache for zval's */
+#define ALLOC_ZVAL(z) \
+ ZEND_FAST_ALLOC(z, zval, ZVAL_CACHE_LIST)
+
+#define FREE_ZVAL(z) \
+ ZEND_FAST_FREE(z, ZVAL_CACHE_LIST)
+
+#define ALLOC_ZVAL_REL(z) \
+ ZEND_FAST_ALLOC_REL(z, zval, ZVAL_CACHE_LIST)
+
+#define FREE_ZVAL_REL(z) \
+ ZEND_FAST_FREE_REL(z, ZVAL_CACHE_LIST)
+
+/* fast cache for HashTables */
+#define ALLOC_HASHTABLE(ht) \
+ ZEND_FAST_ALLOC(ht, HashTable, HASHTABLE_CACHE_LIST)
+
+#define FREE_HASHTABLE(ht) \
+ ZEND_FAST_FREE(ht, HASHTABLE_CACHE_LIST)
+
+#define ALLOC_HASHTABLE_REL(ht) \
+ ZEND_FAST_ALLOC_REL(ht, HashTable, HASHTABLE_CACHE_LIST)
+
+#define FREE_HASHTABLE_REL(ht) \
+ ZEND_FAST_FREE_REL(ht, HASHTABLE_CACHE_LIST)
+
+/* Heap functions */
+typedef struct _zend_mm_heap zend_mm_heap;
+
+ZEND_API zend_mm_heap *zend_mm_startup(void);
+ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent);
+ZEND_API void *_zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
+ZEND_API void _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
+ZEND_API void *_zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
+ZEND_API size_t _zend_mm_block_size(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
+
+#define zend_mm_alloc(heap, size) _zend_mm_alloc((heap), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define zend_mm_free(heap, p) _zend_mm_free((heap), (p) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define zend_mm_realloc(heap, p, size) _zend_mm_realloc((heap), (p), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+#define zend_mm_block_size(heap, p) _zend_mm_block_size((heap), (p), ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+
+#define zend_mm_alloc_rel(heap, size) _zend_mm_alloc((heap), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define zend_mm_free_rel(heap, p) _zend_mm_free((heap), (p) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define zend_mm_realloc_rel(heap, p, size) _zend_mm_realloc((heap), (p), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
+#define zend_mm_block_size_rel(heap, p) _zend_mm_block_size((heap), (p), ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
+
+/* Heaps with user defined storage */
+typedef struct _zend_mm_storage zend_mm_storage;
+
+typedef struct _zend_mm_segment {
+ size_t size;
+ struct _zend_mm_segment *next_segment;
+} zend_mm_segment;
+
+typedef struct _zend_mm_mem_handlers {
+ const char *name;
+ zend_mm_storage* (*init)(void *params);
+ void (*dtor)(zend_mm_storage *storage);
+ zend_mm_segment* (*_alloc)(zend_mm_storage *storage, size_t size);
+ zend_mm_segment* (*_realloc)(zend_mm_storage *storage, zend_mm_segment *ptr, size_t size);
+ void (*_free)(zend_mm_storage *storage, zend_mm_segment *ptr);
+} zend_mm_mem_handlers;
+
+struct _zend_mm_storage {
+ const zend_mm_mem_handlers *handlers;
+ void *data;
+};
+
+ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers, size_t block_size, void *params);
+ZEND_API zend_mm_heap *zend_mm_set_heap(zend_mm_heap *new_heap TSRMLS_DC);
+
#endif
/*
diff --git a/Zend/zend_arg_defs.c b/Zend/zend_arg_defs.c
index 9a128fee2..bec328ad8 100644
--- a/Zend/zend_arg_defs.c
+++ b/Zend/zend_arg_defs.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_arg_defs.c,v 1.2.2.2 2006/04/06 21:10:45 andrei Exp $ */
+/* $Id: zend_arg_defs.c,v 1.2.2.2.2.1 2006/05/09 23:53:23 helly Exp $ */
ZEND_BEGIN_ARG_INFO(first_arg_force_ref, 0)
ZEND_ARG_PASS_INFO(1)
@@ -50,4 +50,3 @@ ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO(all_args_by_ref, 1)
ZEND_END_ARG_INFO();
-
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index ea8e7b111..dc744221c 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_builtin_functions.c,v 1.277.2.12 2006/04/05 11:36:13 tony2001 Exp $ */
+/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.8 2006/09/26 07:55:09 dmitry Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -276,7 +276,7 @@ ZEND_FUNCTION(func_get_args)
ZEND_NAMED_FUNCTION(zend_if_strlen)
{
zval **str;
-
+
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
@@ -374,7 +374,7 @@ ZEND_FUNCTION(each)
ulong num_key;
zval **inserted_pointer;
HashTable *target_hash;
-
+
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
@@ -452,10 +452,10 @@ ZEND_FUNCTION(error_reporting)
Define a new constant */
ZEND_FUNCTION(define)
{
- zval **var, **val, **non_cs;
+ zval **var, **val, **non_cs, *val_free = NULL;
int case_sensitive;
zend_constant c;
-
+
switch (ZEND_NUM_ARGS()) {
case 2:
if (zend_get_parameters_ex(2, &var, &val)==FAILURE) {
@@ -468,7 +468,7 @@ ZEND_FUNCTION(define)
RETURN_FALSE;
}
convert_to_long_ex(non_cs);
- if ((*non_cs)->value.lval) {
+ if (Z_LVAL_PP(non_cs)) {
case_sensitive = 0;
} else {
case_sensitive = CONST_CS;
@@ -479,7 +479,8 @@ ZEND_FUNCTION(define)
break;
}
- switch ((*val)->type) {
+repeat:
+ switch (Z_TYPE_PP(val)) {
case IS_LONG:
case IS_DOUBLE:
case IS_STRING:
@@ -487,15 +488,34 @@ ZEND_FUNCTION(define)
case IS_RESOURCE:
case IS_NULL:
break;
+ case IS_OBJECT:
+ if (!val_free) {
+ if (Z_OBJ_HT_PP(val)->get) {
+ val_free = *val = Z_OBJ_HT_PP(val)->get(*val TSRMLS_CC);
+ goto repeat;
+ } else if (Z_OBJ_HT_PP(val)->cast_object) {
+ ALLOC_INIT_ZVAL(val_free);
+ if (Z_OBJ_HT_PP(val)->cast_object(*val, val_free, IS_STRING TSRMLS_CC) == SUCCESS) {
+ val = &val_free;
+ break;
+ }
+ }
+ }
+ /* no break */
default:
zend_error(E_WARNING,"Constants may only evaluate to scalar values");
+ if (val_free) {
+ zval_ptr_dtor(&val_free);
+ }
RETURN_FALSE;
- break;
}
convert_to_string_ex(var);
c.value = **val;
zval_copy_ctor(&c.value);
+ if (val_free) {
+ zval_ptr_dtor(&val_free);
+ }
c.flags = case_sensitive; /* non persistent */
c.name = zend_strndup((*var)->value.str.val, (*var)->value.str.len);
c.name_len = (*var)->value.str.len+1;
@@ -515,7 +535,7 @@ ZEND_FUNCTION(defined)
{
zval **var;
zval c;
-
+
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &var)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
@@ -539,12 +559,13 @@ ZEND_FUNCTION(get_class)
char *name = "";
zend_uint name_len = 0;
int dup;
-
+
if (!ZEND_NUM_ARGS()) {
if (EG(scope)) {
RETURN_STRINGL(EG(scope)->name, EG(scope)->name_length, 1);
} else {
- zend_error(E_ERROR, "get_class() called without object from outside a class");
+ zend_error(E_WARNING, "get_class() called without object from outside a class");
+ RETURN_FALSE;
}
}
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) {
@@ -623,13 +644,13 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
zend_error(E_WARNING, "Unknown class passed as parameter");
RETURN_FALSE;
}
- instance_ce = *the_ce;
+ instance_ce = *the_ce;
} else if (Z_TYPE_PP(obj) != IS_OBJECT) {
RETURN_FALSE;
} else {
instance_ce = NULL;
}
-
+
/* TBI!! new object handlers */
if (Z_TYPE_PP(obj) == IS_OBJECT && !HAS_CLASS_ENTRY(**obj)) {
RETURN_FALSE;
@@ -702,7 +723,7 @@ static void add_class_vars(zend_class_entry *ce, HashTable *properties, zval *re
zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos);
zend_hash_move_forward_ex(properties, &pos);
- zend_unmangle_property_name_ex(key, key_len, &class_name, &prop_name);
+ zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name);
if (class_name) {
if (class_name[0] != '*' && strcmp(class_name, ce->name)) {
/* filter privates from base classes */
@@ -724,7 +745,7 @@ static void add_class_vars(zend_class_entry *ce, HashTable *properties, zval *re
if (Z_TYPE_P(prop_copy) == IS_CONSTANT_ARRAY || Z_TYPE_P(prop_copy) == IS_CONSTANT) {
zval_update_constant(&prop_copy, 0 TSRMLS_CC);
}
-
+
add_assoc_zval(return_value, prop_name, prop_copy);
}
}
@@ -773,7 +794,7 @@ ZEND_FUNCTION(get_object_vars)
ZEND_WRONG_PARAM_COUNT();
}
- if ((*obj)->type != IS_OBJECT) {
+ if (Z_TYPE_PP(obj) != IS_OBJECT) {
RETURN_FALSE;
}
if (Z_OBJ_HT_PP(obj)->get_properties == NULL) {
@@ -799,7 +820,7 @@ ZEND_FUNCTION(get_object_vars)
(*value)->refcount++;
add_assoc_zval_ex(return_value, key, key_len, *value);
} else if (instanceof) {
- zend_unmangle_property_name_ex(key, key_len, &class_name, &prop_name);
+ zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name);
if (!memcmp(class_name, "*", 2) || (Z_OBJCE_P(EG(This)) == Z_OBJCE_PP(obj) && !strcmp(Z_OBJCE_P(EG(This))->name, class_name))) {
/* Not separating references */
(*value)->refcount++;
@@ -853,9 +874,21 @@ ZEND_FUNCTION(get_class_methods)
instanceof_function(EG(scope), mptr->common.scope TSRMLS_CC))
|| ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) &&
EG(scope) == mptr->common.scope)))) {
- MAKE_STD_ZVAL(method_name);
- ZVAL_STRING(method_name, mptr->common.function_name, 1);
- zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
+ char *key;
+ uint key_len;
+ ulong num_index;
+ uint len = strlen(mptr->common.function_name);
+
+ /* Do not display old-style inherited constructors */
+ if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
+ mptr->common.scope == ce ||
+ zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_STRING ||
+ zend_binary_strcasecmp(key, key_len-1, mptr->common.function_name, len) == 0) {
+
+ MAKE_STD_ZVAL(method_name);
+ ZVAL_STRINGL(method_name, mptr->common.function_name, len, 1);
+ zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
+ }
}
zend_hash_move_forward_ex(&ce->function_table, &pos);
}
@@ -870,7 +903,7 @@ ZEND_FUNCTION(method_exists)
zval **klass, **method_name;
char *lcname;
zend_class_entry * ce, **pce;
-
+
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &klass, &method_name)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
@@ -948,7 +981,7 @@ ZEND_FUNCTION(property_exists)
if (property_info->flags & ZEND_ACC_PUBLIC) {
RETURN_TRUE;
}
- zend_unmangle_property_name_ex(property_info->name, property_info->name_length, &class_name, &prop_name);
+ zend_unmangle_property_name(property_info->name, property_info->name_length, &class_name, &prop_name);
if (!strncmp(class_name, "*", 1)) {
if (instanceof_function(EG(scope), ce TSRMLS_CC)) {
RETURN_TRUE;
@@ -961,8 +994,7 @@ ZEND_FUNCTION(property_exists)
RETURN_FALSE; /* shouldn't happen */
}
RETURN_BOOL(EG(scope) == ce);
- RETURN_FALSE;
-
+
case IS_OBJECT:
if (Z_OBJ_HANDLER_PP(object, has_property) && Z_OBJ_HANDLER_PP(object, has_property)(*object, *property, 2 TSRMLS_CC)) {
RETURN_TRUE;
@@ -1086,7 +1118,7 @@ ZEND_FUNCTION(leak)
leakbytes = (*leak)->value.lval;
}
}
-
+
emalloc(leakbytes);
}
/* }}} */
@@ -1170,7 +1202,7 @@ ZEND_FUNCTION(set_error_handler)
zend_bool had_orig_error_handler=0;
char *error_handler_name = NULL;
long error_type = E_ALL | E_STRICT;
-
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &error_handler, &error_type) == FAILURE) {
return;
}
@@ -1333,7 +1365,7 @@ ZEND_FUNCTION(get_declared_interfaces)
{
zend_uint mask = ZEND_ACC_INTERFACE;
zend_uint comply = 1;
-
+
if (ZEND_NUM_ARGS() != 0) {
ZEND_WRONG_PARAM_COUNT();
}
@@ -1358,7 +1390,7 @@ static int copy_function_name(zend_function *func, int num_args, va_list args, z
} else if (func->type == ZEND_USER_FUNCTION) {
add_next_index_stringl(user_ar, hash_key->arKey, hash_key->nKeyLength-1, 1);
}
-
+
return 0;
}
@@ -1369,26 +1401,26 @@ ZEND_FUNCTION(get_defined_functions)
{
zval *internal;
zval *user;
-
+
if (ZEND_NUM_ARGS() != 0) {
ZEND_WRONG_PARAM_COUNT();
}
-
+
MAKE_STD_ZVAL(internal);
MAKE_STD_ZVAL(user);
-
+
array_init(internal);
array_init(user);
array_init(return_value);
-
+
zend_hash_apply_with_arguments(EG(function_table), (apply_func_args_t) copy_function_name, 2, internal, user);
-
- if (zend_hash_add(return_value->value.ht, "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) {
+
+ if (zend_hash_add(Z_ARRVAL_P(return_value), "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) {
zend_error(E_WARNING, "Cannot add internal functions to return value from get_defined_functions()");
RETURN_FALSE;
}
-
- if (zend_hash_add(return_value->value.ht, "user", sizeof("user"), (void **)&user, sizeof(zval *), NULL) == FAILURE) {
+
+ if (zend_hash_add(Z_ARRVAL_P(return_value), "user", sizeof("user"), (void **)&user, sizeof(zval *), NULL) == FAILURE) {
zend_error(E_WARNING, "Cannot add user functions to return value from get_defined_functions()");
RETURN_FALSE;
}
@@ -1399,12 +1431,12 @@ ZEND_FUNCTION(get_defined_functions)
/* {{{ proto array get_defined_vars(void)
Returns an associative array of names and values of all currently defined variable names (variables in the current scope) */
ZEND_FUNCTION(get_defined_vars)
-{
+{
zval *tmp;
-
+
array_init(return_value);
-
- zend_hash_copy(return_value->value.ht, EG(active_symbol_table),
+
+ zend_hash_copy(Z_ARRVAL_P(return_value), EG(active_symbol_table),
(copy_ctor_func_t)zval_add_ref, &tmp, sizeof(zval *));
}
/* }}} */
@@ -1568,7 +1600,7 @@ ZEND_FUNCTION(get_defined_constants)
modules = ecalloc(zend_hash_num_elements(&module_registry) + 2, sizeof(zval *));
module_names = emalloc((zend_hash_num_elements(&module_registry) + 2) * sizeof(char *));
-
+
module_names[0] = "internal";
zend_hash_internal_pointer_reset_ex(&module_registry, &pos);
while (zend_hash_get_current_data_ex(&module_registry, (void *) &module, &pos) != FAILURE) {
@@ -1620,7 +1652,7 @@ static zval *debug_backtrace_get_args(void ***curpos TSRMLS_DC)
zval *arg_array, **arg;
int arg_count = (ulong) *p;
- *curpos -= (arg_count+2);
+ *curpos -= (arg_count+2);
MAKE_STD_ZVAL(arg_array);
array_init(arg_array);
@@ -1628,9 +1660,13 @@ static zval *debug_backtrace_get_args(void ***curpos TSRMLS_DC)
while (--arg_count >= 0) {
arg = (zval **) p++;
- SEPARATE_ZVAL_TO_MAKE_IS_REF(arg);
- (*arg)->refcount++;
- add_next_index_zval(arg_array, *arg);
+ if (*arg) {
+ SEPARATE_ZVAL_TO_MAKE_IS_REF(arg);
+ (*arg)->refcount++;
+ add_next_index_zval(arg_array, *arg);
+ } else {
+ add_next_index_null(arg_array);
+ }
}
/* skip args from incomplete frames */
@@ -1717,7 +1753,7 @@ ZEND_FUNCTION(debug_print_backtrace)
arg_array = NULL;
skip = ptr;
- /* skip internal handler */
+ /* skip internal handler */
if (!skip->op_array &&
skip->prev_execute_data &&
skip->prev_execute_data->opline &&
@@ -1744,7 +1780,7 @@ ZEND_FUNCTION(debug_print_backtrace)
} else {
zend_uint class_name_len;
int dup;
-
+
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
if(!dup) {
free_class_name = class_name;
@@ -1764,7 +1800,7 @@ ZEND_FUNCTION(debug_print_backtrace)
arg_array = debug_backtrace_get_args(&cur_arg_pos TSRMLS_CC);
frames_on_stack--;
}
- }
+ }
} else {
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
zend_bool build_filename_arg = 1;
@@ -1774,7 +1810,7 @@ ZEND_FUNCTION(debug_print_backtrace)
function_name = "unknown";
build_filename_arg = 0;
} else
- switch (ptr->opline->op2.u.constant.value.lval) {
+ switch (Z_LVAL(ptr->opline->op2.u.constant)) {
case ZEND_EVAL:
function_name = "eval";
build_filename_arg = 0;
@@ -1819,7 +1855,23 @@ ZEND_FUNCTION(debug_print_backtrace)
if (filename) {
zend_printf(") called at [%s:%d]\n", filename, lineno);
} else {
- ZEND_PUTS(")\n");
+ zend_execute_data *prev = skip->prev_execute_data;
+
+ while (prev) {
+ if (prev->function_state.function &&
+ prev->function_state.function->common.type != ZEND_USER_FUNCTION) {
+ prev = NULL;
+ break;
+ }
+ if (prev->op_array) {
+ zend_printf(") called at [%s:%d]\n", prev->op_array->filename, prev->opline->lineno);
+ break;
+ }
+ prev = prev->prev_execute_data;
+ }
+ if (!prev) {
+ ZEND_PUTS(")\n");
+ }
}
include_filename = filename;
ptr = skip->prev_execute_data;
@@ -1900,7 +1952,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
skip->prev_execute_data->opline->opcode != ZEND_DO_FCALL &&
skip->prev_execute_data->opline->opcode != ZEND_DO_FCALL_BY_NAME &&
skip->prev_execute_data->opline->opcode != ZEND_INCLUDE_OR_EVAL) {
- skip = skip->prev_execute_data;
+ skip = skip->prev_execute_data;
}
if (skip->op_array) {
@@ -1913,6 +1965,20 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
* and debug_baktrace() might have been called by the error_handler. in this case we don't
* want to pop anything of the argument-stack */
} else {
+ zend_execute_data *prev = skip->prev_execute_data;
+
+ while (prev) {
+ if (prev->function_state.function &&
+ prev->function_state.function->common.type != ZEND_USER_FUNCTION) {
+ break;
+ }
+ if (prev->op_array) {
+ add_assoc_string_ex(stack_frame, "file", sizeof("file"), prev->op_array->filename, 1);
+ add_assoc_long_ex(stack_frame, "line", sizeof("line"), prev->opline->lineno);
+ break;
+ }
+ prev = prev->prev_execute_data;
+ }
filename = NULL;
}
@@ -1927,7 +1993,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
} else {
zend_uint class_name_len;
int dup;
-
+
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
add_assoc_string_ex(stack_frame, "class", sizeof("class"), class_name, dup);
@@ -1948,7 +2014,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
add_assoc_zval_ex(stack_frame, "args", sizeof("args"), debug_backtrace_get_args(&cur_arg_pos TSRMLS_CC));
frames_on_stack--;
}
- }
+ }
} else {
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
zend_bool build_filename_arg = 1;
@@ -1988,7 +2054,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
MAKE_STD_ZVAL(arg_array);
array_init(arg_array);
-
+
/* include_filename always points to the last filename of the last last called-fuction.
if we have called include in the frame above - this is the file we have included.
*/
@@ -2017,7 +2083,7 @@ ZEND_FUNCTION(debug_backtrace)
if (ZEND_NUM_ARGS()) {
ZEND_WRONG_PARAM_COUNT();
}
-
+
zend_fetch_debug_backtrace(return_value, 1, 1 TSRMLS_CC);
}
/* }}} */
@@ -2066,7 +2132,7 @@ ZEND_FUNCTION(get_extension_funcs)
RETURN_FALSE;
}
efree(lcname);
-
+
if (!(func = module->functions)) {
RETURN_FALSE;
}
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 73c66c511..d7eb537e9 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.647.2.27 2006/05/02 15:49:26 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.647.2.27.2.20 2006/10/20 02:44:02 iliaa Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -25,13 +25,13 @@
#include "zend_constants.h"
#include "zend_llist.h"
#include "zend_API.h"
-#include "zend_fast_cache.h"
#ifdef ZEND_MULTIBYTE
#include "zend_multibyte.h"
#endif /* ZEND_MULTIBYTE */
ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
+ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename TSRMLS_DC);
#ifndef ZTS
@@ -104,7 +104,7 @@ int zend_auto_global_arm(zend_auto_global *auto_global TSRMLS_DC)
}
-int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_DC)
+ZEND_API int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_DC)
{
zend_auto_global *auto_global;
@@ -118,8 +118,8 @@ int zend_auto_global_disable_jit(char *varname, zend_uint varname_length TSRMLS_
static void init_compiler_declarables(TSRMLS_D)
{
- CG(declarables).ticks.type = IS_LONG;
- CG(declarables).ticks.value.lval = 0;
+ Z_TYPE(CG(declarables).ticks) = IS_LONG;
+ Z_LVAL(CG(declarables).ticks) = 0;
}
@@ -245,7 +245,7 @@ static int lookup_cv(zend_op_array *op_array, char* name, int name_len)
i = op_array->last_var;
op_array->last_var++;
if (op_array->last_var > op_array->size_var) {
- op_array->size_var += 16; /* FIXME */
+ op_array->size_var += 16; /* FIXME */
op_array->vars = erealloc(op_array->vars, op_array->size_var*sizeof(zend_compiled_variable));
}
op_array->vars[i].name = name; /* estrndup(name, name_len); */
@@ -297,7 +297,7 @@ void zend_do_binary_assign_op(zend_uchar op, znode *result, znode *op1, znode *o
if (last_op_number > 0) {
zend_op *last_op = &CG(active_op_array)->opcodes[last_op_number-1];
-
+
switch (last_op->opcode) {
case ZEND_FETCH_OBJ_RW:
last_op->opcode = op;
@@ -500,7 +500,7 @@ void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body
char *method_type;
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
- modifiers->u.constant.value.lval |= ZEND_ACC_ABSTRACT;
+ Z_LVAL(modifiers->u.constant) |= ZEND_ACC_ABSTRACT;
method_type = "Interface";
} else {
method_type = "Abstract";
@@ -510,7 +510,7 @@ void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body
if(modifiers->u.constant.value.lval & ZEND_ACC_PRIVATE) {
zend_error(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", method_type, CG(active_class_entry)->name, function_name->u.constant.value.str.val);
}
- if (body->u.constant.value.lval == ZEND_ACC_ABSTRACT) {
+ if (Z_LVAL(body->u.constant) == ZEND_ACC_ABSTRACT) {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_RAISE_ABSTRACT_ERROR;
@@ -549,8 +549,8 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC)
while (last_op_number - n > 0) {
zend_op *last_op;
-
- last_op = &CG(active_op_array)->opcodes[last_op_number-(n+1)];
+
+ last_op = &CG(active_op_array)->opcodes[last_op_number-n-1];
if (last_op->result.op_type == IS_VAR &&
last_op->result.u.var == variable->u.var) {
@@ -623,7 +623,7 @@ void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC)
opline->opcode = ZEND_ASSIGN_REF;
if (zend_is_function_or_method_call(rvar)) {
- opline->extended_value = ZEND_RETURNS_FUNCTION;
+ opline->extended_value = ZEND_RETURNS_FUNCTION;
} else {
opline->extended_value = 0;
}
@@ -649,6 +649,7 @@ static inline void do_begin_loop(TSRMLS_D)
parent = CG(active_op_array)->current_brk_cont;
CG(active_op_array)->current_brk_cont = CG(active_op_array)->last_brk_cont;
brk_cont_element = get_next_brk_cont_element(CG(active_op_array));
+ brk_cont_element->start = get_next_op_number(CG(active_op_array));
brk_cont_element->parent = parent;
}
@@ -685,7 +686,7 @@ void zend_do_while_end(znode *while_token, znode *close_bracket_token TSRMLS_DC)
opline->op1.u.opline_num = while_token->u.opline_num;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
-
+
/* update while's conditional jmp */
CG(active_op_array)->opcodes[close_bracket_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
@@ -824,7 +825,7 @@ void zend_do_if_after_statement(znode *closing_bracket_token, unsigned char init
}
zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr);
zend_llist_add_element(jmp_list_ptr, &if_end_op_number);
-
+
CG(active_op_array)->opcodes[closing_bracket_token->u.opline_num].op2.u.opline_num = if_end_op_number+1;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
@@ -878,7 +879,7 @@ void zend_do_end_variable_parse(int type, int arg_offset TSRMLS_DC)
le = fetch_list_ptr->head;
/* TODO: $foo->x->y->z = 1 should fetch "x" and "y" for R or RW, not just W */
-
+
if (le) {
opline_ptr = (zend_op *)le->data;
if (opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
@@ -979,7 +980,7 @@ void zend_do_add_variable(znode *result, znode *op1, znode *op2 TSRMLS_DC)
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
- if (op1->u.constant.value.str.len>0) {
+ if (Z_STRLEN(op1->u.constant)>0) {
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_ADD_STRING;
opline->result = *result;
@@ -1040,21 +1041,21 @@ void zend_do_free(znode *op1 TSRMLS_DC)
}
} else if (op1->op_type == IS_CONST) {
zval_dtor(&op1->u.constant);
- }
+ }
}
int zend_do_verify_access_types(znode *current_access_type, znode *new_modifier)
{
- if ((current_access_type->u.constant.value.lval & ZEND_ACC_PPP_MASK)
- && (new_modifier->u.constant.value.lval & ZEND_ACC_PPP_MASK)
- && ((current_access_type->u.constant.value.lval & ZEND_ACC_PPP_MASK) != (new_modifier->u.constant.value.lval & ZEND_ACC_PPP_MASK))) {
+ if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_PPP_MASK)
+ && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK)
+ && ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_PPP_MASK) != (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK))) {
zend_error(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed");
}
- if (((current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval) & (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) == (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) {
+ if (((Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant)) & (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) == (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) {
zend_error(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class member");
}
- return (current_access_type->u.constant.value.lval | new_modifier->u.constant.value.lval);
+ return (Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant));
}
@@ -1069,15 +1070,18 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
if (is_method) {
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
- if ((fn_flags_znode->u.constant.value.lval & ~(ZEND_ACC_STATIC|ZEND_ACC_PUBLIC))) {
+ if ((Z_LVAL(fn_flags_znode->u.constant) & ~(ZEND_ACC_STATIC|ZEND_ACC_PUBLIC))) {
zend_error(E_COMPILE_ERROR, "Access type for interface method %s::%s() must be omitted", CG(active_class_entry)->name, function_name->u.constant.value.str.val);
}
- fn_flags_znode->u.constant.value.lval |= ZEND_ACC_ABSTRACT; /* propagates to the rest of the parser */
+ Z_LVAL(fn_flags_znode->u.constant) |= ZEND_ACC_ABSTRACT; /* propagates to the rest of the parser */
}
- fn_flags = fn_flags_znode->u.constant.value.lval; /* must be done *after* the above check */
+ fn_flags = Z_LVAL(fn_flags_znode->u.constant); /* must be done *after* the above check */
} else {
fn_flags = 0;
}
+ if ((fn_flags & ZEND_ACC_STATIC) && (fn_flags & ZEND_ACC_ABSTRACT) && !(CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) {
+ zend_error(E_STRICT, "Static function %s%s%s() should not be abstract", is_method ? CG(active_class_entry)->name : "", is_method ? "::" : "", Z_STRVAL(function_name->u.constant));
+ }
function_token->u.op_array = CG(active_op_array);
lcname = zend_str_tolower_dup(name, name_len);
@@ -1149,6 +1153,8 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
CG(active_class_entry)->__unset = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_ISSET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME)))) {
CG(active_class_entry)->__isset = (zend_function *) CG(active_op_array);
+ } else if ((name_len == sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME)))) {
+ CG(active_class_entry)->__tostring = (zend_function *) CG(active_op_array);
} else if (!(fn_flags & ZEND_ACC_STATIC)) {
CG(active_op_array)->fn_flags |= ZEND_ACC_ALLOW_STATIC;
}
@@ -1179,11 +1185,11 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
}
-
+
{
/* Push a seperator to the switch and foreach stacks */
zend_switch_entry switch_entry;
-
+
switch_entry.cond.op_type = IS_UNUSED;
switch_entry.default_case = 0;
switch_entry.control_var = 0;
@@ -1325,18 +1331,18 @@ int zend_do_begin_function_call(znode *function_name TSRMLS_DC)
switch (function->type) {
case ZEND_USER_FUNCTION: {
zend_op_array *op_array = (zend_op_array *) function;
-
+
zend_stack_push(&CG(function_call_stack), (void *) &op_array, sizeof(zend_function *));
}
break;
case ZEND_INTERNAL_FUNCTION: {
zend_internal_function *internal_function = (zend_internal_function *) function;
-
+
zend_stack_push(&CG(function_call_stack), (void *) &internal_function, sizeof(zend_function *));
}
break;
}
- zend_do_extended_fcall_begin(TSRMLS_C);
+ zend_do_extended_fcall_begin(TSRMLS_C);
return 0;
}
@@ -1350,7 +1356,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC);
zend_do_begin_variable_parse(TSRMLS_C);
-
+
last_op_number = get_next_op_number(CG(active_op_array))-1;
last_op = &CG(active_op_array)->opcodes[last_op_number];
@@ -1361,7 +1367,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
if (last_op->opcode == ZEND_FETCH_OBJ_R) {
last_op->opcode = ZEND_INIT_METHOD_CALL;
- left_bracket->u.constant.value.lval = ZEND_INIT_FCALL_BY_NAME;
+ Z_LVAL(left_bracket->u.constant) = ZEND_INIT_FCALL_BY_NAME;
} else {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
@@ -1371,9 +1377,9 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
}
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
- zend_do_extended_fcall_begin(TSRMLS_C);
+ zend_do_extended_fcall_begin(TSRMLS_C);
}
-
+
void zend_do_clone(znode *result, znode *expr TSRMLS_DC)
{
@@ -1401,7 +1407,7 @@ void zend_do_begin_dynamic_function_call(znode *function_name TSRMLS_DC)
SET_UNUSED(opline->op1);
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
- zend_do_extended_fcall_begin(TSRMLS_C);
+ zend_do_extended_fcall_begin(TSRMLS_C);
}
@@ -1487,13 +1493,13 @@ void zend_do_begin_class_member_function_call(znode *class_name, znode *method_n
void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC)
{
zend_op *opline;
-
+
if (is_method && function_name && function_name->op_type == IS_UNUSED) {
/* clone */
- if (argument_list->u.constant.value.lval != 0) {
+ if (Z_LVAL(argument_list->u.constant) != 0) {
zend_error(E_WARNING, "Clone method does not require arguments");
}
- opline = &CG(active_op_array)->opcodes[function_name->u.constant.value.lval];
+ opline = &CG(active_op_array)->opcodes[Z_LVAL(function_name->u.constant)];
} else {
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
if (!is_method && !is_dynamic_fcall && function_name->op_type==IS_CONST) {
@@ -1504,14 +1510,14 @@ void zend_do_end_function_call(znode *function_name, znode *result, znode *argum
SET_UNUSED(opline->op1);
}
}
-
+
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->result.op_type = IS_VAR;
*result = opline->result;
SET_UNUSED(opline->op2);
zend_stack_del_top(&CG(function_call_stack));
- opline->extended_value = argument_list->u.constant.value.lval;
+ opline->extended_value = Z_LVAL(argument_list->u.constant);
}
@@ -1522,7 +1528,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
zend_function **function_ptr_ptr, *function_ptr;
int send_by_reference;
int send_function = 0;
-
+
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
function_ptr = *function_ptr_ptr;
@@ -1542,7 +1548,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
op = (param->op_type & (IS_VAR|IS_CV))?ZEND_SEND_REF:ZEND_SEND_VAL;
send_by_reference = 0;
} else {
- send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
+ send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
}
} else {
send_by_reference = 0;
@@ -1612,11 +1618,11 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
static int generate_free_switch_expr(zend_switch_entry *switch_entry TSRMLS_DC)
{
zend_op *opline;
-
+
if (switch_entry->cond.op_type != IS_VAR && switch_entry->cond.op_type != IS_TMP_VAR) {
return (switch_entry->cond.op_type == IS_UNUSED);
}
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_SWITCH_FREE;
@@ -1633,7 +1639,7 @@ static int generate_free_foreach_copy(zend_op *foreach_copy TSRMLS_DC)
/* If we reach the seperator then stop applying the stack */
if (foreach_copy->result.op_type == IS_UNUSED && foreach_copy->op1.op_type == IS_UNUSED) {
return 1;
- }
+ }
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -1650,14 +1656,14 @@ static int generate_free_foreach_copy(zend_op *foreach_copy TSRMLS_DC)
SET_UNUSED(opline->op2);
opline->extended_value = 0;
}
-
+
return 0;
}
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
{
zend_op *opline;
-
+
if (do_end_vparse) {
if (CG(active_op_array)->return_reference && !zend_is_function_or_method_call(expr)) {
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
@@ -1677,7 +1683,7 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_RETURN;
-
+
if (expr) {
opline->op1 = *expr;
} else {
@@ -1687,7 +1693,7 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
if (do_end_vparse) {
if (zend_is_function_or_method_call(expr)) {
- opline->extended_value = ZEND_RETURNS_FUNCTION;
+ opline->extended_value = ZEND_RETURNS_FUNCTION;
} else {
opline->extended_value = 0;
}
@@ -1746,7 +1752,7 @@ void zend_do_begin_catch(znode *try_token, znode *catch_class, znode *catch_var,
{
long catch_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
-
+
if (catch_op_number > 0) {
opline = &CG(active_op_array)->opcodes[catch_op_number-1];
if (opline->opcode == ZEND_FETCH_CLASS) {
@@ -1772,7 +1778,7 @@ void zend_do_end_catch(znode *try_token TSRMLS_DC)
void zend_do_throw(znode *expr TSRMLS_DC)
{
zend_op *opline;
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_THROW;
opline->op1 = *expr;
@@ -1790,7 +1796,7 @@ ZEND_API void function_add_ref(zend_function *function)
zval *tmp_zval;
ALLOC_HASHTABLE(op_array->static_variables);
- zend_hash_init(op_array->static_variables, 2, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(op_array->static_variables, zend_hash_num_elements(static_variables), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(op_array->static_variables, static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_zval, sizeof(zval *));
}
}
@@ -1829,6 +1835,9 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
if (!ce->__call) {
ce->__call = ce->parent->__call;
}
+ if (!ce->__tostring) {
+ ce->__tostring = ce->parent->__tostring;
+ }
if (!ce->clone) {
ce->clone = ce->parent->clone;
}
@@ -1850,7 +1859,7 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
}
return;
}
-
+
if (zend_hash_find(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), (void **)&function)==SUCCESS) {
/* inherit parent's constructor */
zend_hash_update(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, sizeof(zend_function), NULL);
@@ -1912,8 +1921,8 @@ static zend_bool zend_do_perform_implementation_check(zend_function *fe, zend_fu
return 1;
}
- /* No implementation checks for constructors */
- if (fe->common.fn_flags & ZEND_ACC_CTOR) {
+ /* Checks for constructors only if they are declared in an interface */
+ if ((fe->common.fn_flags & ZEND_ACC_CTOR) && !(proto->common.scope->ce_flags & ZEND_ACC_INTERFACE)) {
return 1;
}
@@ -2011,21 +2020,23 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
*/
if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) {
zend_error(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
- } else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
+ } else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
&& ((parent_flags & ZEND_ACC_PPP_MASK) & ZEND_ACC_PRIVATE)) {
child->common.fn_flags |= ZEND_ACC_CHANGED;
}
}
- if (parent_flags & ZEND_ACC_ABSTRACT) {
+ if (parent_flags & ZEND_ACC_PRIVATE) {
+ child->common.prototype = NULL;
+ } else if (parent_flags & ZEND_ACC_ABSTRACT) {
child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
child->common.prototype = parent;
- } else {
- child->common.prototype = parent->common.prototype;
+ } else if (!(parent->common.fn_flags & ZEND_ACC_CTOR) || (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE))) {
+ /* ctors only have a prototype if it comes from an interface */
+ child->common.prototype = parent->common.prototype ? parent->common.prototype : parent;
}
-
- if (child->common.prototype) {
+ if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
if (!zend_do_perform_implementation_check(child, child->common.prototype)) {
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
}
@@ -2067,11 +2078,11 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
(child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name, hash_key->arKey);
}
-
+
if(parent_info->flags & ZEND_ACC_CHANGED) {
child_info->flags |= ZEND_ACC_CHANGED;
}
-
+
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
} else if (child_info->flags & ZEND_ACC_IMPLICIT_PUBLIC) {
@@ -2108,7 +2119,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
if (zend_hash_find(&ce->default_static_members, child_info->name, child_info->name_length+1, (void**)&new_prop) == SUCCESS) {
if (Z_TYPE_PP(new_prop) != IS_NULL && Z_TYPE_PP(prop) != IS_NULL) {
char *prop_name, *tmp;
- zend_unmangle_property_name_ex(child_info->name, child_info->name_length, &tmp, &prop_name);
+ zend_unmangle_property_name(child_info->name, child_info->name_length, &tmp, &prop_name);
zend_error(E_COMPILE_ERROR, "Cannot change initial value of property static protected %s::$%s in class %s",
parent_ce->name, prop_name, ce->name);
@@ -2214,8 +2225,12 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
zend_hash_merge(&ce->constants_table, &parent_ce->constants_table, (void (*)(void *)) zval_add_ref, NULL, sizeof(zval *), 0);
zend_hash_merge_ex(&ce->function_table, &parent_ce->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);
do_inherit_parent_constructor(ce);
-
- zend_verify_abstract_class(ce TSRMLS_CC);
+
+ if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS && ce->type == ZEND_INTERNAL_CLASS) {
+ ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
+ } else {
+ zend_verify_abstract_class(ce TSRMLS_CC);
+ }
}
@@ -2227,7 +2242,7 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zva
if (*old_constant != *parent_constant) {
zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited constant %s from interface %s", hash_key->arKey, iface->name);
}
- return 0;
+ return 0;
}
return 1;
}
@@ -2235,11 +2250,38 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zva
ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC)
{
- zend_hash_merge_ex(&ce->constants_table, &iface->constants_table, (copy_ctor_func_t) zval_add_ref, sizeof(zval *), (merge_checker_func_t) do_inherit_constant_check, iface);
- zend_hash_merge_ex(&ce->function_table, &iface->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);
-
- do_implement_interface(ce, iface TSRMLS_CC);
- zend_do_inherit_interfaces(ce, iface TSRMLS_CC);
+ zend_uint i, ignore = 0;
+ zend_uint current_iface_num = ce->num_interfaces;
+ zend_uint parent_iface_num = ce->parent ? ce->parent->num_interfaces : 0;
+
+ for (i = 0; i < ce->num_interfaces; i++) {
+ if (ce->interfaces[i] == NULL) {
+ memmove(ce->interfaces + i, ce->interfaces + i + 1, sizeof(zend_class_entry*) * (--ce->num_interfaces - i));
+ i--;
+ } else if (ce->interfaces[i] == iface) {
+ if (i < parent_iface_num) {
+ ignore = 1;
+ } else {
+ zend_error(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name, iface->name);
+ }
+ }
+ }
+ if (!ignore) {
+ if (ce->num_interfaces >= current_iface_num) {
+ if (ce->type == ZEND_INTERNAL_CLASS) {
+ ce->interfaces = (zend_class_entry **) realloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num));
+ } else {
+ ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num));
+ }
+ }
+ ce->interfaces[ce->num_interfaces++] = iface;
+
+ zend_hash_merge_ex(&ce->constants_table, &iface->constants_table, (copy_ctor_func_t) zval_add_ref, sizeof(zval *), (merge_checker_func_t) do_inherit_constant_check, iface);
+ zend_hash_merge_ex(&ce->function_table, &iface->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);
+
+ do_implement_interface(ce, iface TSRMLS_CC);
+ zend_do_inherit_interfaces(ce, iface TSRMLS_CC);
+ }
}
@@ -2273,7 +2315,7 @@ ZEND_API int do_bind_function(zend_op *opline, HashTable *function_table, zend_b
return SUCCESS;
}
}
-
+
ZEND_API zend_class_entry *do_bind_class(zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC)
{
@@ -2294,7 +2336,7 @@ ZEND_API zend_class_entry *do_bind_class(zend_op *opline, HashTable *class_table
* so we shut up about it. This allows the if (!defined('FOO')) { return; }
* approach to work.
*/
- zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);
+ zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name);
}
return NULL;
} else {
@@ -2337,7 +2379,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(zend_op *opline, HashTable *c
/* Register the derived class */
if (zend_hash_add(class_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, pce, sizeof(zend_class_entry *), NULL)==FAILURE) {
- zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);
+ zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name);
ce->refcount--;
zend_hash_destroy(&ce->function_table);
zend_hash_destroy(&ce->default_properties);
@@ -2452,7 +2494,7 @@ void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC)
}
opline->op1 = *expr1;
SET_UNUSED(opline->op2);
-
+
op_token->u.opline_num = next_op_number;
*expr1 = opline->result;
@@ -2487,7 +2529,7 @@ void zend_do_boolean_and_begin(znode *expr1, znode *op_token TSRMLS_DC)
}
opline->op1 = *expr1;
SET_UNUSED(opline->op2);
-
+
op_token->u.opline_num = next_op_number;
*expr1 = opline->result;
@@ -2540,8 +2582,8 @@ void zend_do_brk_cont(zend_uchar op, znode *expr TSRMLS_DC)
if (expr) {
opline->op2 = *expr;
} else {
- opline->op2.u.constant.type = IS_LONG;
- opline->op2.u.constant.value.lval = 1;
+ Z_TYPE(opline->op2.u.constant) = IS_LONG;
+ Z_LVAL(opline->op2.u.constant) = 1;
INIT_PZVAL(&opline->op2.u.constant);
opline->op2.op_type = IS_CONST;
}
@@ -2568,7 +2610,7 @@ void zend_do_switch_end(znode *case_list TSRMLS_DC)
{
zend_op *opline;
zend_switch_entry *switch_entry_ptr;
-
+
zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr);
/* add code to jmp to default case */
@@ -2628,7 +2670,7 @@ void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *c
zval_copy_ctor(&opline->op1.u.constant);
}
result = opline->result;
-
+
next_op_number = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZ;
@@ -2736,7 +2778,7 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
opline->op2.op_type = IS_CONST;
opline->op2.u.constant.type = IS_STRING;
opline->op2.u.constant.refcount = 1;
-
+
if (doing_inheritance) {
opline->extended_value = parent_class_name->u.var;
opline->opcode = ZEND_DECLARE_INHERITED_CLASS;
@@ -2800,11 +2842,6 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
ce->line_end = zend_get_compiled_lineno(TSRMLS_C);
- /* Inherit interfaces */
- if (ce->num_interfaces > 0) {
- ce->interfaces = (zend_class_entry **) emalloc(sizeof(zend_class_entry *)*ce->num_interfaces);
- memset(ce->interfaces, 0, sizeof(zend_class_entry *)*ce->num_interfaces);
- }
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
zend_verify_abstract_class(ce TSRMLS_CC);
@@ -2812,6 +2849,12 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
do_verify_abstract_class(TSRMLS_C);
}
}
+ /* Inherit interfaces; reset number to zero, we need it for above check and
+ * will restore it during actual implementation. */
+ if (ce->num_interfaces > 0) {
+ ce->interfaces = NULL;
+ ce->num_interfaces = 0;
+ }
CG(active_class_entry) = NULL;
}
@@ -2836,7 +2879,7 @@ void zend_do_implements_interface(znode *interface_znode TSRMLS_DC)
}
break;
}
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_ADD_INTERFACE;
opline->op1 = CG(implementing_class);
@@ -2849,7 +2892,7 @@ ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src
{
char *prop_name;
int prop_name_length;
-
+
prop_name_length = 1 + src1_length + 1 + src2_length;
prop_name = pemalloc(prop_name_length + 1, internal);
prop_name[0] = '\0';
@@ -2861,29 +2904,38 @@ ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src
}
-ZEND_API void zend_unmangle_property_name_ex(char *mangled_property, int mangled_property_len, char **class_name, char **prop_name)
+static int zend_strnlen(const char* s, int maxlen)
{
- *prop_name = *class_name = NULL;
-
- if (mangled_property_len < 2) { /* do not try to unmangle empty strings */
- *prop_name = mangled_property;
- return;
- }
-
- zend_unmangle_property_name(mangled_property, class_name, prop_name);
+ int len = 0;
+ while (*s++ && maxlen--) len++;
+ return len;
}
-ZEND_API void zend_unmangle_property_name(char *mangled_property, char **class_name, char **prop_name)
+ZEND_API int zend_unmangle_property_name(char *mangled_property, int len, char **class_name, char **prop_name)
{
- *prop_name = *class_name = NULL;
+ int class_name_len;
+
+ *class_name = NULL;
if (mangled_property[0]!=0) {
*prop_name = mangled_property;
- return;
+ return SUCCESS;
+ }
+ if (len < 3 || mangled_property[1]==0) {
+ zend_error(E_NOTICE, "Illegal member variable name");
+ *prop_name = mangled_property;
+ return FAILURE;
}
+ class_name_len = zend_strnlen(mangled_property+1, --len - 1) + 1;
+ if (class_name_len >= len || mangled_property[class_name_len]!=0) {
+ zend_error(E_NOTICE, "Corrupt member variable name");
+ *prop_name = mangled_property;
+ return FAILURE;
+ }
*class_name = mangled_property+1;
- *prop_name = (*class_name)+strlen(*class_name)+1;
+ *prop_name = (*class_name)+class_name_len;
+ return SUCCESS;
}
void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_type TSRMLS_DC)
@@ -2917,7 +2969,7 @@ void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_ty
*property = value->u.constant;
} else {
INIT_PZVAL(property);
- property->type = IS_NULL;
+ Z_TYPE_P(property) = IS_NULL;
}
if (CG(doc_comment)) {
@@ -2935,11 +2987,11 @@ void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_ty
void zend_do_declare_class_constant(znode *var_name, znode *value TSRMLS_DC)
{
zval *property;
-
+
if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
zend_error(E_COMPILE_ERROR, "Arrays are not allowed in class constants");
}
-
+
ALLOC_ZVAL(property);
*property = value->u.constant;
@@ -2957,9 +3009,9 @@ void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS
zend_op opline;
zend_llist *fetch_list_ptr;
zend_op *opline_ptr=NULL;
-
+
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
-
+
if (fetch_list_ptr->count == 1) {
zend_llist_element *le;
@@ -2967,7 +3019,7 @@ void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS
opline_ptr = (zend_op *) le->data;
if (opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
- efree(opline_ptr->op1.u.constant.value.str.val);
+ efree(Z_STRVAL(opline_ptr->op1.u.constant));
SET_UNUSED(opline_ptr->op1); /* this means $this for objects */
opline_ptr->op2 = *property;
/* if it was usual fetch, we change it to object fetch */
@@ -3066,7 +3118,7 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC)
{
zend_op *opline;
unsigned char *ptr = NULL;
-
+
new_token->u.opline_num = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_NEW;
@@ -3074,7 +3126,7 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC)
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->op1 = *class_type;
SET_UNUSED(opline->op2);
-
+
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(unsigned char *));
}
@@ -3134,7 +3186,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
if (constant_container ||
!zend_constant_ct_subst(result, &constant_name->u.constant TSRMLS_CC)) {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
-
+
opline->opcode = ZEND_FETCH_CONSTANT;
opline->result.op_type = IS_TMP_VAR;
opline->result.u.var = get_temporary_variable(CG(active_op_array));
@@ -3173,10 +3225,10 @@ void zend_do_shell_exec(znode *result, znode *cmd TSRMLS_DC)
opline->opcode = ZEND_DO_FCALL;
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->result.op_type = IS_VAR;
- opline->op1.u.constant.value.str.val = estrndup("shell_exec", sizeof("shell_exec")-1);
- opline->op1.u.constant.value.str.len = sizeof("shell_exec")-1;
+ Z_STRVAL(opline->op1.u.constant) = estrndup("shell_exec", sizeof("shell_exec")-1);
+ Z_STRLEN(opline->op1.u.constant) = sizeof("shell_exec")-1;
INIT_PZVAL(&opline->op1.u.constant);
- opline->op1.u.constant.type = IS_STRING;
+ Z_TYPE(opline->op1.u.constant) = IS_STRING;
opline->op1.op_type = IS_CONST;
opline->extended_value = 1;
SET_UNUSED(opline->op2);
@@ -3235,28 +3287,28 @@ void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr)
switch (offset->u.constant.type) {
case IS_CONSTANT:
/* Ugly hack to denote that this value has a constant index */
- element->type |= IS_CONSTANT_INDEX;
+ Z_TYPE_P(element) |= IS_CONSTANT_INDEX;
/* break missing intentionally */
case IS_STRING:
zend_symtable_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL);
zval_dtor(&offset->u.constant);
break;
case IS_NULL:
- zend_symtable_update(result->u.constant.value.ht, "", 1, &element, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL(result->u.constant), "", 1, &element, sizeof(zval *), NULL);
break;
case IS_LONG:
- case IS_BOOL:
- zend_hash_index_update(result->u.constant.value.ht, offset->u.constant.value.lval, &element, sizeof(zval *), NULL);
+ case IS_BOOL:
+ zend_hash_index_update(Z_ARRVAL(result->u.constant), Z_LVAL(offset->u.constant), &element, sizeof(zval *), NULL);
break;
case IS_DOUBLE:
- zend_hash_index_update(result->u.constant.value.ht, (long)offset->u.constant.value.dval, &element, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL(result->u.constant), (long)Z_DVAL(offset->u.constant), &element, sizeof(zval *), NULL);
break;
case IS_CONSTANT_ARRAY:
zend_error(E_ERROR, "Illegal offset type");
break;
}
} else {
- zend_hash_next_index_insert(result->u.constant.value.ht, &element, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL(result->u.constant), &element, sizeof(zval *), NULL);
}
}
@@ -3338,8 +3390,8 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC)
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->op1 = last_container;
opline->op2.op_type = IS_CONST;
- opline->op2.u.constant.type = IS_LONG;
- opline->op2.u.constant.value.lval = *((int *) dimension->data);
+ Z_TYPE(opline->op2.u.constant) = IS_LONG;
+ Z_LVAL(opline->op2.u.constant) = *((int *) dimension->data);
INIT_PZVAL(&opline->op2.u.constant);
opline->extended_value = ZEND_FETCH_ADD_LOCK;
last_container = opline->result;
@@ -3462,7 +3514,7 @@ void zend_do_include_or_eval(int type, znode *result, znode *op1 TSRMLS_DC)
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->op1 = *op1;
SET_UNUSED(opline->op2);
- opline->op2.u.constant.value.lval = type;
+ Z_LVAL(opline->op2.u.constant) = type;
*result = opline->result;
}
zend_do_extended_fcall_end(TSRMLS_C);
@@ -3514,7 +3566,7 @@ void zend_do_unset(znode *variable TSRMLS_DC)
break;
}
- }
+ }
}
@@ -3525,7 +3577,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
zend_do_end_variable_parse(BP_VAR_IS, 0 TSRMLS_CC);
zend_check_writable_variable(variable);
-
+
if (variable->op_type == IS_CV) {
last_op = get_next_op(CG(active_op_array) TSRMLS_CC);
last_op->opcode = ZEND_ISSET_ISEMPTY_VAR;
@@ -3538,7 +3590,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
last_op->result.u.var = get_temporary_variable(CG(active_op_array));
} else {
last_op = &CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1];
-
+
switch (last_op->opcode) {
case ZEND_FETCH_IS:
last_op->opcode = ZEND_ISSET_ISEMPTY_VAR;
@@ -3618,7 +3670,7 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->op1 = *array;
SET_UNUSED(opline->op2);
- opline->extended_value = is_variable;
+ opline->extended_value = is_variable ? ZEND_FE_RESET_VARIABLE : 0;
*open_brackets_token = opline->result;
{
@@ -3641,7 +3693,7 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
void zend_do_foreach_fetch(znode *foreach_token, znode *open_brackets_token, znode *as_token TSRMLS_DC)
{
zend_op *opline;
-
+
/* save the location of FE_FETCH */
as_token->u.opline_num = get_next_op_number(CG(active_op_array));
@@ -3691,11 +3743,13 @@ void zend_do_foreach_cont(znode *foreach_token, znode *as_token, znode *value, z
}
/* Mark extended_value for assign-by-reference */
opline->extended_value |= ZEND_FE_FETCH_BYREF;
+ CG(active_op_array)->opcodes[foreach_token->u.opline_num].extended_value |= ZEND_FE_RESET_REFERENCE;
}
value_node = opline->result;
- zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
- if (assign_by_ref) {
+
+ zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
+ if (assign_by_ref) {
/* Mark FE_FETCH as IS_VAR as it holds the data directly as a value */
zend_do_assign_ref(NULL, value, &value_node TSRMLS_CC);
} else {
@@ -3706,8 +3760,8 @@ void zend_do_foreach_cont(znode *foreach_token, znode *as_token, znode *value, z
if (key->op_type != IS_UNUSED) {
znode key_node;
- zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
- opline = &CG(active_op_array)->opcodes[as_token->u.opline_num+1];
+ zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
+ opline = &CG(active_op_array)->opcodes[as_token->u.opline_num+1];
opline->result.op_type = IS_TMP_VAR;
opline->result.u.EA.type = 0;
opline->result.u.opline_num = get_temporary_variable(CG(active_op_array));
@@ -3761,7 +3815,7 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC)
zend_encoding *new_encoding, *old_encoding;
zend_encoding_filter old_input_filter;
- if (val->u.constant.type == IS_CONSTANT) {
+ if (Z_TYPE(val->u.constant) == IS_CONSTANT) {
zend_error(E_COMPILE_ERROR, "Cannot use constants as encoding");
}
convert_to_string(&val->u.constant);
@@ -3795,7 +3849,7 @@ void zend_do_declare_end(znode *declare_token TSRMLS_DC)
zend_stack_top(&CG(declare_stack), (void **) &declarables);
/* We should restore if there was more than (current - start) - (ticks?1:0) opcodes */
- if ((get_next_op_number(CG(active_op_array)) - declare_token->u.opline_num) - ((CG(declarables).ticks.value.lval)?1:0)) {
+ if ((get_next_op_number(CG(active_op_array)) - declare_token->u.opline_num) - ((Z_LVAL(CG(declarables).ticks))?1:0)) {
CG(declarables) = *declarables;
}
}
@@ -3828,8 +3882,8 @@ void zend_do_exit(znode *result, znode *message TSRMLS_DC)
SET_UNUSED(opline->op2);
result->op_type = IS_CONST;
- result->u.constant.type = IS_BOOL;
- result->u.constant.value.lval = 1;
+ Z_TYPE(result->u.constant) = IS_BOOL;
+ Z_LVAL(result->u.constant) = 1;
}
void zend_do_begin_silence(znode *strudel_token TSRMLS_DC)
@@ -3859,7 +3913,7 @@ void zend_do_begin_qm_op(znode *cond, znode *qm_token TSRMLS_DC)
{
int jmpz_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZ;
@@ -3902,7 +3956,7 @@ void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode
opline->result = *qm_token;
opline->op1 = *false_value;
SET_UNUSED(opline->op2);
-
+
CG(active_op_array)->opcodes[colon_token->u.opline_num].op1.u.opline_num = get_next_op_number(CG(active_op_array));
*result = opline->result;
@@ -3914,11 +3968,11 @@ void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode
void zend_do_extended_info(TSRMLS_D)
{
zend_op *opline;
-
+
if (!CG(extended_info)) {
return;
}
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXT_STMT;
@@ -3930,11 +3984,11 @@ void zend_do_extended_info(TSRMLS_D)
void zend_do_extended_fcall_begin(TSRMLS_D)
{
zend_op *opline;
-
+
if (!CG(extended_info)) {
return;
}
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXT_FCALL_BEGIN;
@@ -3946,11 +4000,11 @@ void zend_do_extended_fcall_begin(TSRMLS_D)
void zend_do_extended_fcall_end(TSRMLS_D)
{
zend_op *opline;
-
+
if (!CG(extended_info)) {
return;
}
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXT_FCALL_END;
@@ -3961,7 +4015,7 @@ void zend_do_extended_fcall_end(TSRMLS_D)
void zend_do_ticks(TSRMLS_D)
{
- if (CG(declarables).ticks.value.lval) {
+ if (Z_LVAL(CG(declarables).ticks)) {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_TICKS;
@@ -4013,7 +4067,7 @@ again:
CG(increment_lineno) = 0;
}
- zendlval->u.constant.type = IS_LONG;
+ Z_TYPE(zendlval->u.constant) = IS_LONG;
retval = lex_scan(&zendlval->u.constant TSRMLS_CC);
switch (retval) {
case T_COMMENT:
@@ -4033,12 +4087,12 @@ again:
retval = T_ECHO;
break;
case T_END_HEREDOC:
- efree(zendlval->u.constant.value.str.val);
+ efree(Z_STRVAL(zendlval->u.constant));
break;
case EOF:
return EOF;
}
-
+
INIT_PZVAL(&zendlval->u.constant);
zendlval->op_type = IS_CONST;
return retval;
@@ -4090,6 +4144,7 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
ce->__unset = NULL;
ce->__isset = NULL;
ce->__call = NULL;
+ ce->__tostring = NULL;
ce->create_object = NULL;
ce->get_iterator = NULL;
ce->iterator_funcs.funcs = NULL;
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 2488bea83..a2f90e288 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 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 |
+ | 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 |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.h,v 1.316.2.8 2006/03/13 11:13:42 dmitry Exp $ */
+/* $Id: zend_compile.h,v 1.316.2.8.2.7 2006/09/26 10:30:50 dmitry Exp $ */
#ifndef ZEND_COMPILE_H
#define ZEND_COMPILE_H
@@ -89,6 +89,7 @@ struct _zend_op {
typedef struct _zend_brk_cont_element {
+ int start;
int cont;
int brk;
int parent;
@@ -149,6 +150,7 @@ typedef struct _zend_property_info {
ulong h;
char *doc_comment;
int doc_comment_len;
+ zend_class_entry *ce;
} zend_property_info;
@@ -226,9 +228,9 @@ struct _zend_op_array {
typedef struct _zend_internal_function {
/* Common elements */
zend_uchar type;
- char *function_name;
+ char * function_name;
zend_class_entry *scope;
- zend_uint fn_flags;
+ zend_uint fn_flags;
union _zend_function *prototype;
zend_uint num_args;
zend_uint required_num_args;
@@ -238,6 +240,7 @@ typedef struct _zend_internal_function {
/* END of common elements */
void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
+ struct _zend_module_entry *module;
} zend_internal_function;
#define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? (function)->common.scope->name : "")
@@ -257,7 +260,7 @@ typedef union _zend_function {
zend_bool pass_rest_by_reference;
unsigned char return_reference;
} common;
-
+
zend_op_array op_array;
zend_internal_function internal_function;
} zend_function;
@@ -319,6 +322,7 @@ void shutdown_compiler(TSRMLS_D);
void zend_init_compiler_data_structures(TSRMLS_D);
extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
+extern ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename TSRMLS_DC);
ZEND_API int lex_scan(zval *zendlval TSRMLS_DC);
void startup_scanner(TSRMLS_D);
@@ -507,7 +511,7 @@ ZEND_API void function_add_ref(zend_function *function);
/* helper functions in zend_language_scanner.l */
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);
-ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC);
+ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC);
ZEND_API zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC);
ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_count, ...);
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC);
@@ -525,8 +529,7 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce);
void zend_class_add_ref(zend_class_entry **ce);
ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src1, int src1_length, char *src2, int src2_length, int internal);
-ZEND_API void zend_unmangle_property_name(char *mangled_property, char **prop_name, char **class_name);
-ZEND_API void zend_unmangle_property_name_ex(char *mangled_property, int mangled_property_len, char **prop_name, char **class_name);
+ZEND_API int zend_unmangle_property_name(char *mangled_property, int mangled_property_len, char **prop_name, char **class_name);
#define ZEND_FUNCTION_DTOR (void (*)(void *)) zend_function_dtor
#define ZEND_CLASS_DTOR (void (*)(void *)) destroy_zend_class
@@ -647,6 +650,9 @@ int zendlex(znode *zendlval TSRMLS_DC);
#define ZEND_FE_FETCH_BYREF 1
#define ZEND_FE_FETCH_WITH_KEY 2
+#define ZEND_FE_RESET_VARIABLE 1
+#define ZEND_FE_RESET_REFERENCE 2
+
#define ZEND_MEMBER_FUNC_CALL 1<<0
#define ZEND_ARG_SEND_BY_REF (1<<0)
@@ -657,40 +663,22 @@ int zendlex(znode *zendlval TSRMLS_DC);
#define ZEND_SEND_BY_REF 1
#define ZEND_SEND_PREFER_REF 2
-/* Lost In Stupid Parentheses */
-#define ARG_SHOULD_BE_SENT_BY_REF(zf, arg_num) \
- ( \
- zf \
- && ((zend_function *) zf)->common.arg_info \
- && \
- ( \
- ( \
- arg_num<=((zend_function *) zf)->common.num_args \
- && ((zend_function *) zf)->common.arg_info[arg_num-1].pass_by_reference == ZEND_SEND_BY_REF \
- ) \
- || ( \
- arg_num>((zend_function *) zf)->common.num_args \
- && ((zend_function *) zf)->common.pass_rest_by_reference == ZEND_SEND_BY_REF \
- ) \
- ) \
- )
-
-#define ARG_MAY_BE_SENT_BY_REF(zf, arg_num) \
- ( \
- zf \
- && ((zend_function *) zf)->common.arg_info \
- && \
- ( \
- ( \
- arg_num<=((zend_function *) zf)->common.num_args \
- && ((zend_function *) zf)->common.arg_info[arg_num-1].pass_by_reference == ZEND_SEND_PREFER_REF \
- ) \
- || ( \
- arg_num>((zend_function *) zf)->common.num_args \
- && ((zend_function *) zf)->common.pass_rest_by_reference == ZEND_SEND_PREFER_REF \
- ) \
- ) \
- )
+#define ARG_SEND_TYPE(zf, arg_num) \
+ ((zf) ? \
+ ((((zend_function*)(zf))->common.arg_info && \
+ arg_num<=((zend_function*)(zf))->common.num_args) ? \
+ ((zend_function *)(zf))->common.arg_info[arg_num-1].pass_by_reference : \
+ ((zend_function *)(zf))->common.pass_rest_by_reference) : \
+ ZEND_SEND_BY_VAL)
+
+#define ARG_MUST_BE_SENT_BY_REF(zf, arg_num) \
+ (ARG_SEND_TYPE(zf, arg_num) == ZEND_SEND_BY_REF)
+
+#define ARG_SHOULD_BE_SENT_BY_REF(zf, arg_num) \
+ (ARG_SEND_TYPE(zf, arg_num) & (ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF))
+
+#define ARG_MAY_BE_SENT_BY_REF(zf, arg_num) \
+ (ARG_SEND_TYPE(zf, arg_num) == ZEND_SEND_PREFER_REF)
#define ZEND_RETURN_VAL 0
#define ZEND_RETURN_REF 1
@@ -705,9 +693,10 @@ END_EXTERN_C()
#define ZEND_DESTRUCTOR_FUNC_NAME "__destruct"
#define ZEND_GET_FUNC_NAME "__get"
#define ZEND_SET_FUNC_NAME "__set"
-#define ZEND_UNSET_FUNC_NAME "__unset"
-#define ZEND_ISSET_FUNC_NAME "__isset"
+#define ZEND_UNSET_FUNC_NAME "__unset"
+#define ZEND_ISSET_FUNC_NAME "__isset"
#define ZEND_CALL_FUNC_NAME "__call"
+#define ZEND_TOSTRING_FUNC_NAME "__tostring"
#define ZEND_AUTOLOAD_FUNC_NAME "__autoload"
#endif /* ZEND_COMPILE_H */
diff --git a/Zend/zend_config.w32.h b/Zend/zend_config.w32.h
index 0576f2cbc..8c9d9e563 100644
--- a/Zend/zend_config.w32.h
+++ b/Zend/zend_config.w32.h
@@ -17,13 +17,11 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_config.w32.h,v 1.39.2.2 2006/03/14 14:19:00 dmitry Exp $ */
+/* $Id: zend_config.w32.h,v 1.39.2.2.2.1 2006/07/18 09:06:32 dmitry Exp $ */
#ifndef ZEND_CONFIG_W32_H
#define ZEND_CONFIG_W32_H
-#define USE_ZEND_ALLOC 1
-
#include <../main/config.w32.h>
#define _CRTDBG_MAP_ALLOC
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index 5703c3661..8e8affb56 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_constants.c,v 1.71.2.5 2006/03/15 14:12:26 dmitry Exp $ */
+/* $Id: zend_constants.c,v 1.71.2.5.2.3 2006/10/18 17:17:18 johannes Exp $ */
#include "zend.h"
#include "zend_constants.h"
@@ -96,6 +96,7 @@ int zend_startup_constants(TSRMLS_D)
void zend_register_standard_constants(TSRMLS_D)
{
REGISTER_MAIN_LONG_CONSTANT("E_ERROR", E_ERROR, CONST_PERSISTENT | CONST_CS);
+ REGISTER_MAIN_LONG_CONSTANT("E_RECOVERABLE_ERROR", E_RECOVERABLE_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_WARNING", E_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_PARSE", E_PARSE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_NOTICE", E_NOTICE, CONST_PERSISTENT | CONST_CS);
@@ -212,7 +213,7 @@ ZEND_API void zend_register_string_constant(char *name, uint name_len, char *str
}
-ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC)
+ZEND_API int zend_get_constant_ex(char *name, uint name_len, zval *result, zend_class_entry *scope TSRMLS_DC)
{
zend_constant *c;
int retval = 1;
@@ -221,17 +222,19 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
if ((colon = memchr(name, ':', name_len)) && colon[1] == ':') {
/* class constant */
- zend_class_entry **ce = NULL, *scope;
+ zend_class_entry **ce = NULL;
int class_name_len = colon-name;
int const_name_len = name_len - class_name_len - 2;
char *constant_name = colon+2;
zval **ret_constant;
char *class_name;
- if (EG(in_execution)) {
- scope = EG(scope);
- } else {
- scope = CG(active_class_entry);
+ if (!scope) {
+ if (EG(in_execution)) {
+ scope = EG(scope);
+ } else {
+ scope = CG(active_class_entry);
+ }
}
class_name = estrndup(name, class_name_len);
@@ -299,6 +302,10 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
return retval;
}
+ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC)
+{
+ return zend_get_constant_ex(name, name_len, result, NULL TSRMLS_CC);
+}
ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
{
diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h
index 36814f1ef..1716a8347 100644
--- a/Zend/zend_constants.h
+++ b/Zend/zend_constants.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_constants.h,v 1.31.2.2 2006/03/15 09:04:36 dmitry Exp $ */
+/* $Id: zend_constants.h,v 1.31.2.2.2.1 2006/10/18 16:35:15 johannes Exp $ */
#ifndef ZEND_CONSTANTS_H
#define ZEND_CONSTANTS_H
@@ -56,6 +56,7 @@ int zend_shutdown_constants(TSRMLS_D);
void zend_register_standard_constants(TSRMLS_D);
void clean_non_persistent_constants(TSRMLS_D);
ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC);
+ZEND_API int zend_get_constant_ex(char *name, uint name_len, zval *result, zend_class_entry *scope TSRMLS_DC);
ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_double_constant(char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC);
ZEND_API void zend_register_string_constant(char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC);
diff --git a/Zend/zend_errors.h b/Zend/zend_errors.h
index d8f3c0ea7..9768c7442 100644
--- a/Zend/zend_errors.h
+++ b/Zend/zend_errors.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_errors.h,v 1.18.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_errors.h,v 1.18.2.1.2.4 2006/05/17 19:07:45 helly Exp $ */
#ifndef ZEND_ERRORS_H
#define ZEND_ERRORS_H
@@ -34,8 +34,9 @@
#define E_USER_WARNING (1<<9L)
#define E_USER_NOTICE (1<<10L)
#define E_STRICT (1<<11L)
+#define E_RECOVERABLE_ERROR (1<<12L)
-#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE)
+#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR)
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
#endif /* ZEND_ERRORS_H */
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 2889e89a0..06eb5dfc1 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_exceptions.c,v 1.79.2.6 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_exceptions.c,v 1.79.2.6.2.5 2006/07/21 08:39:30 dmitry Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -81,8 +81,8 @@ static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_t
zend_object *object;
zval *trace;
- obj.value.obj = zend_objects_new(&object, class_type TSRMLS_CC);
- obj.value.obj.handlers = &default_exception_handlers;
+ Z_OBJVAL(obj) = zend_objects_new(&object, class_type TSRMLS_CC);
+ Z_OBJ_HT(obj) = &default_exception_handlers;
ALLOC_HASHTABLE(object->properties);
zend_hash_init(object->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
@@ -97,7 +97,7 @@ static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_t
zend_update_property_long(default_exception_ce, &obj, "line", sizeof("line")-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);
zend_update_property(default_exception_ce, &obj, "trace", sizeof("trace")-1, trace TSRMLS_CC);
- return obj.value.obj;
+ return Z_OBJVAL(obj);
}
static zend_object_value zend_default_exception_new(zend_class_entry *class_type TSRMLS_DC)
@@ -171,7 +171,7 @@ ZEND_METHOD(error_exception, __construct)
}
zend_update_property_long(default_exception_ce, object, "severity", sizeof("severity")-1, severity TSRMLS_CC);
-
+
if (argc >= 4) {
zend_update_property_string(default_exception_ce, object, "file", sizeof("file")-1, filename TSRMLS_CC);
if (argc < 5) {
@@ -271,7 +271,7 @@ ZEND_METHOD(error_exception, getSeverity)
#define TRACE_APPEND_STRL(val, vallen) \
{ \
- int l = vallen; \
+ int l = vallen; \
*str = (char*)erealloc(*str, *len + l + 1); \
memcpy((*str) + *len, val, l); \
*len += l; \
@@ -372,7 +372,7 @@ static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_k
if(!dup) {
efree(class_name);
}
-
+
TRACE_APPEND_STR("), ");
break;
}
@@ -434,7 +434,7 @@ ZEND_METHOD(exception, getTraceAsString)
zval *trace;
char *res = estrdup(""), **str = &res, *s_tmp;
int res_len = 0, *len = &res_len, num = 0;
-
+
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
zend_hash_apply_with_arguments(Z_ARRVAL_P(trace), (apply_func_args_t)_build_trace_string, 3, str, len, &num);
@@ -448,12 +448,12 @@ ZEND_METHOD(exception, getTraceAsString)
}
/* }}} */
-static int zend_spprintf(char **message, int max_len, char *format, ...)
+int zend_spprintf(char **message, int max_len, char *format, ...)
{
va_list arg;
int len;
- va_start(arg, format);
+ va_start(arg, format);
len = zend_vspprintf(message, max_len, format, arg);
va_end(arg);
return len;
@@ -524,15 +524,15 @@ ZEND_METHOD(exception, __toString)
/* All functions that may be used in uncaught exception handlers must be final
* and must not throw exceptions. Otherwise we would need a facility to handle
- * such exceptions in that handler.
+ * such exceptions in that handler.
* Also all getXY() methods are final because thy serve as read only access to
- * their corresponding properties, no more, no less. If after all you need to
+ * their corresponding properties, no more, no less. If after all you need to
* override somthing then it is method __toString().
* And never try to change the state of exceptions and never implement anything
* that gives the user anything to accomplish this.
*/
static
-ZEND_BEGIN_ARG_INFO(arginfo_exception___construct, 0)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_exception___construct, 0, 0, 0)
ZEND_ARG_INFO(0, message)
ZEND_ARG_INFO(0, code)
ZEND_END_ARG_INFO();
@@ -551,7 +551,7 @@ static zend_function_entry default_exception_functions[] = {
};
static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_error_exception___construct, 0, 0, 3)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_error_exception___construct, 0, 0, 0)
ZEND_ARG_INFO(0, message)
ZEND_ARG_INFO(0, code)
ZEND_ARG_INFO(0, severity)
@@ -571,7 +571,7 @@ void zend_register_default_exception(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions);
default_exception_ce = zend_register_internal_class(&ce TSRMLS_CC);
- default_exception_ce->create_object = zend_default_exception_new;
+ default_exception_ce->create_object = zend_default_exception_new;
memcpy(&default_exception_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
default_exception_handlers.clone_obj = NULL;
@@ -584,16 +584,16 @@ void zend_register_default_exception(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "ErrorException", error_exception_functions);
error_exception_ce = zend_register_internal_class_ex(&ce, default_exception_ce, NULL TSRMLS_CC);
- error_exception_ce->create_object = zend_error_exception_new;
+ error_exception_ce->create_object = zend_error_exception_new;
zend_declare_property_long(error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED TSRMLS_CC);
}
-ZEND_API zend_class_entry *zend_exception_get_default(void)
+ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D)
{
return default_exception_ce;
}
-ZEND_API zend_class_entry *zend_get_error_exception(void)
+ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D)
{
return error_exception_ce;
}
@@ -613,7 +613,7 @@ ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *messa
exception_ce = default_exception_ce;
}
object_init_ex(ex, exception_ce);
-
+
if (message) {
zend_update_property_string(default_exception_ce, ex, "message", sizeof("message")-1, message TSRMLS_CC);
@@ -633,7 +633,7 @@ ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long cod
char *message;
zval *zexception;
- va_start(arg, format);
+ va_start(arg, format);
zend_vspprintf(&message, 0, format, arg);
va_end(arg);
zexception = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
@@ -652,7 +652,7 @@ ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, char
static void zend_error_va(int type, const char *file, uint lineno, const char *format, ...)
{
va_list args;
-
+
va_start(args, format);
zend_error_cb(type, file, lineno, format, args);
va_end(args);
@@ -666,7 +666,7 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
zval *str, *file, *line;
EG(exception) = NULL;
-
+
zend_call_method_with_0_params(&exception, ce_exception, NULL, "__tostring", &str);
if (!EG(exception)) {
if (Z_TYPE_P(str) != IS_STRING) {
@@ -676,7 +676,7 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
}
}
zval_ptr_dtor(&str);
-
+
if (EG(exception)) {
/* do the best we can to inform about the inner exception */
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
@@ -704,7 +704,7 @@ ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC)
{
zend_class_entry *exception_ce;
- if (exception == NULL || exception->type != IS_OBJECT) {
+ if (exception == NULL || Z_TYPE_P(exception) != IS_OBJECT) {
zend_error(E_ERROR, "Need to supply an object when throwing an exception");
}
diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h
index d0587a34e..2b08d94ba 100644
--- a/Zend/zend_exceptions.h
+++ b/Zend/zend_exceptions.h
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_exceptions.h,v 1.21.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_exceptions.h,v 1.21.2.1.2.1 2006/05/09 23:53:23 helly Exp $ */
#ifndef ZEND_EXCEPTIONS_H
#define ZEND_EXCEPTIONS_H
@@ -30,11 +30,11 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC);
void zend_register_default_exception(TSRMLS_D);
-ZEND_API zend_class_entry *zend_exception_get_default(void);
-ZEND_API zend_class_entry *zend_get_error_exception(void);
+ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D);
+ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D);
ZEND_API void zend_register_default_classes(TSRMLS_D);
-/* exception_ce NULL or zend_exception_get_default() or a derived class
+/* exception_ce NULL or zend_exception_get_default() or a derived class
* message NULL or the message of the exception */
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC);
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, char *format, ...);
@@ -48,6 +48,9 @@ extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
/* show an exception using zend_error(E_ERROR,...) */
ZEND_API void zend_exception_error(zval *exception TSRMLS_DC);
+/* do not export, in php it's available thru spprintf directly */
+int zend_spprintf(char **message, int max_len, char *format, ...);
+
END_EXTERN_C()
#endif
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index c7aac2f1a..3b27bcefb 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.c,v 1.716.2.12 2006/02/26 10:53:38 helly Exp $ */
+/* $Id: zend_execute.c,v 1.716.2.12.2.12 2006/10/02 11:09:52 tony2001 Exp $ */
#define ZEND_INTENSIVE_DEBUGGING 0
@@ -31,11 +31,14 @@
#include "zend_ptr_stack.h"
#include "zend_constants.h"
#include "zend_extensions.h"
-#include "zend_fast_cache.h"
#include "zend_ini.h"
#include "zend_exceptions.h"
+#include "zend_interfaces.h"
#include "zend_vm.h"
+/* Virtual current working directory support */
+#include "tsrm_virtual_cwd.h"
+
#define _CONST_CODE 0
#define _TMP_CODE 1
#define _VAR_CODE 2
@@ -123,16 +126,16 @@ static inline void zend_pzval_unlock_free_func(zval *z)
#define INIT_PZVAL_COPY(z,v) \
(z)->value = (v)->value; \
- (z)->type = (v)->type; \
+ Z_TYPE_P(z) = Z_TYPE_P(v); \
(z)->refcount = 1; \
- (z)->is_ref = 0;
+ (z)->is_ref = 0;
#define MAKE_REAL_ZVAL_PTR(val) \
do { \
zval *_tmp; \
ALLOC_ZVAL(_tmp); \
_tmp->value = (val)->value; \
- _tmp->type = (val)->type; \
+ Z_TYPE_P(_tmp) = Z_TYPE_P(val); \
_tmp->refcount = 1; \
_tmp->is_ref = 0; \
val = _tmp; \
@@ -150,10 +153,10 @@ ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data
static inline void zend_get_cv_address(zend_compiled_variable *cv, zval ***ptr, temp_variable *Ts TSRMLS_DC)
{
- zval *new_zval = &EG(uninitialized_zval);
-
- new_zval->refcount++;
- zend_hash_quick_update(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, &new_zval, sizeof(zval *), (void **)ptr);
+ zval *new_zval = &EG(uninitialized_zval);
+
+ new_zval->refcount++;
+ zend_hash_quick_update(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, &new_zval, sizeof(zval *), (void **)ptr);
}
static inline zval *_get_zval_ptr_tmp(znode *node, temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
@@ -199,7 +202,7 @@ static inline zval *_get_zval_ptr_var(znode *node, temp_variable *Ts, zend_free_
static inline zval *_get_zval_ptr_cv(znode *node, temp_variable *Ts, int type TSRMLS_DC)
{
zval ***ptr = &CV_OF(node->u.var);
-
+
if (!*ptr) {
zend_compiled_variable *cv = &CV_DEF_OF(node->u.var);
if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **)ptr)==FAILURE) {
@@ -267,7 +270,7 @@ static inline zval **_get_zval_ptr_ptr_var(znode *node, temp_variable *Ts, zend_
static inline zval **_get_zval_ptr_ptr_cv(znode *node, temp_variable *Ts, int type TSRMLS_DC)
{
zval ***ptr = &CV_OF(node->u.var);
-
+
if (!*ptr) {
zend_compiled_variable *cv = &CV_DEF_OF(node->u.var);
if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **)ptr)==FAILURE) {
@@ -364,7 +367,7 @@ static inline void zend_switch_free(zend_op *opline, temp_variable *Ts TSRMLS_DC
PZVAL_UNLOCK_FREE(T->str_offset.str);
} else {
zval_ptr_dtor(&T(opline->op1.u.var).var.ptr);
- if (opline->extended_value) { /* foreach() free */
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { /* foreach() free */
zval_ptr_dtor(&T(opline->op1.u.var).var.ptr);
}
}
@@ -433,9 +436,10 @@ static void zend_assign_to_variable_reference(zval **variable_ptr_ptr, zval **va
static inline void make_real_object(zval **object_ptr TSRMLS_DC)
{
/* this should modify object only if it's empty */
- if ((*object_ptr)->type == IS_NULL
- || ((*object_ptr)->type == IS_BOOL && (*object_ptr)->value.lval==0)
- || ((*object_ptr)->type == IS_STRING && (*object_ptr)->value.str.len == 0)) {
+ if (Z_TYPE_PP(object_ptr) == IS_NULL
+ || (Z_TYPE_PP(object_ptr) == IS_BOOL && Z_LVAL_PP(object_ptr)==0)
+ || (Z_TYPE_PP(object_ptr) == IS_STRING && Z_STRLEN_PP(object_ptr) == 0)) {
+
if (!PZVAL_IS_REF(*object_ptr)) {
SEPARATE_ZVAL(object_ptr);
}
@@ -445,95 +449,79 @@ static inline void make_real_object(zval **object_ptr TSRMLS_DC)
}
}
-static inline void zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg TSRMLS_DC)
+static inline char * zend_verify_arg_class_kind(zend_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce TSRMLS_DC)
+{
+ *pce = zend_fetch_class(cur_arg_info->class_name, cur_arg_info->class_name_len, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD) TSRMLS_CC);
+
+ *class_name = (*pce) ? (*pce)->name: cur_arg_info->class_name;
+ if (*pce && (*pce)->ce_flags & ZEND_ACC_INTERFACE) {
+ return "implement interface ";
+ } else {
+ return "be an instance of ";
+ }
+}
+
+static inline int zend_verify_arg_error(zend_function *zf, zend_uint arg_num, zend_arg_info *cur_arg_info, char *need_msg, char *need_kind, char *given_msg, char *given_kind TSRMLS_DC)
{
- zend_arg_info *cur_arg_info;
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
- char *fclass, *fsep, *fname;
+ char *fname = zf->common.function_name;
+ char *fsep;
+ char *fclass;
+
+ if (zf->common.scope) {
+ fsep = "::";
+ fclass = zf->common.scope->name;
+ } else {
+ fsep = "";
+ fclass = "";
+ }
+
+ if (ptr && ptr->op_array) {
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s%s, %s%s given, called in %s on line %d and defined", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind, ptr->op_array->filename, ptr->opline->lineno);
+ } else {
+ zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
+ }
+ return 0;
+}
+
+static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg TSRMLS_DC)
+{
+ zend_arg_info *cur_arg_info;
+ char *need_msg;
+ zend_class_entry *ce;
if (!zf->common.arg_info
|| arg_num>zf->common.num_args) {
- return;
+ return 1;
}
cur_arg_info = &zf->common.arg_info[arg_num-1];
- fname = zf->common.function_name;
- fsep = zf->common.scope ? "::" : "";
- fclass = zf->common.scope ? zf->common.scope->name : "";
if (cur_arg_info->class_name) {
+ char *class_name;
+
if (!arg) {
- if (ptr && ptr->op_array) {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
- } else {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
- }
+ need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce TSRMLS_CC);
+ return zend_verify_arg_error(zf, arg_num, cur_arg_info, need_msg, class_name, "none", "" TSRMLS_CC);
}
- switch (Z_TYPE_P(arg)) {
- case IS_NULL:
- if (!cur_arg_info->allow_null) {
- if (ptr && ptr->op_array) {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must not be null, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
- } else {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must not be null", arg_num, fclass, fsep, fname);
- }
- }
- break;
- case IS_OBJECT: {
- zend_class_entry *ce = zend_fetch_class(cur_arg_info->class_name, cur_arg_info->class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
- if (!instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
- char *error_msg;
-
- if (ce->ce_flags & ZEND_ACC_INTERFACE) {
- error_msg = "implement interface";
- } else {
- error_msg = "be an instance of";
- }
- if (ptr && ptr->op_array) {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must %s %s, called in %s on line %d and defined", arg_num, fclass, fsep, fname, error_msg, ce->name, ptr->op_array->filename, ptr->opline->lineno);
- } else {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must %s %s", arg_num, fclass, fsep, fname, error_msg, ce->name);
- }
- }
- }
- break;
- default:
- if (ptr && ptr->op_array) {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
- } else {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an object of class %s", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
- }
- break;
+ if (Z_TYPE_P(arg) == IS_OBJECT) {
+ need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce TSRMLS_CC);
+ if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
+ return zend_verify_arg_error(zf, arg_num, cur_arg_info, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name TSRMLS_CC);
+ }
+ } else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
+ need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce TSRMLS_CC);
+ return zend_verify_arg_error(zf, arg_num, cur_arg_info, need_msg, class_name, zend_zval_type_name(arg), "" TSRMLS_CC);
}
} else if (cur_arg_info->array_type_hint) {
if (!arg) {
- if(ptr && ptr->op_array) {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
- } else {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an array", arg_num, fclass, fsep, fname);
- }
+ return zend_verify_arg_error(zf, arg_num, cur_arg_info, "be an array", "", "none", "" TSRMLS_CC);
}
- switch (Z_TYPE_P(arg)) {
- case IS_NULL:
- if (!cur_arg_info->allow_null) {
- if (ptr && ptr->op_array) {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must not be null, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
- } else {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must not be null", arg_num, fclass, fsep, fname);
- }
- }
- break;
- case IS_ARRAY:
- break;
- default:
- if (ptr && ptr->op_array) {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
- } else {
- zend_error_noreturn(E_ERROR, "Argument %d passed to %s%s%s() must be an array", arg_num, fclass, fsep, fname);
- }
- break;
+ if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
+ return zend_verify_arg_error(zf, arg_num, cur_arg_info, "be an array", "", zend_zval_type_name(arg), "" TSRMLS_CC);
}
}
+ return 1;
}
@@ -557,8 +545,8 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
-
- if (object->type != IS_OBJECT || (opcode == ZEND_ASSIGN_OBJ && !Z_OBJ_HT_P(object)->write_property)) {
+
+ if (Z_TYPE_P(object) != IS_OBJECT || (opcode == ZEND_ASSIGN_OBJ && !Z_OBJ_HT_P(object)->write_property)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op2);
if (!RETURN_VALUE_UNUSED(result)) {
@@ -607,7 +595,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
value->refcount = 0;
zval_copy_ctor(value);
}
-
+
value->refcount++;
if (opcode == ZEND_ASSIGN_OBJ) {
@@ -625,7 +613,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
}
Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC);
}
-
+
if (result && !RETURN_VALUE_UNUSED(result)) {
T(result->u.var).var.ptr = value;
T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; /* this is so that we could use it in FETCH_DIM_R, etc. - see bug #27876 */
@@ -646,11 +634,12 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
zend_free_op free_op1;
zval **variable_ptr_ptr = get_zval_ptr_ptr(op1, Ts, &free_op1, BP_VAR_W);
zval *variable_ptr;
-
+
if (!variable_ptr_ptr) {
temp_variable *T = &T(op1->u.var);
- if (T->str_offset.str->type == IS_STRING) do {
+ if (Z_TYPE_P(T->str_offset.str) == IS_STRING)
+ do {
zval tmp;
zval *final_value = value;
@@ -658,23 +647,23 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
zend_error(E_WARNING, "Illegal string offset: %d", T->str_offset.offset);
break;
}
- if ((int)T->str_offset.offset >= T->str_offset.str->value.str.len) {
+ if (T->str_offset.offset >= Z_STRLEN_P(T->str_offset.str)) {
zend_uint i;
- if (T->str_offset.str->value.str.len==0) {
- STR_FREE(T->str_offset.str->value.str.val);
- T->str_offset.str->value.str.val = (char *) emalloc(T->str_offset.offset+1+1);
+ if (Z_STRLEN_P(T->str_offset.str)==0) {
+ STR_FREE(Z_STRVAL_P(T->str_offset.str));
+ Z_STRVAL_P(T->str_offset.str) = (char *) emalloc(T->str_offset.offset+1+1);
} else {
- T->str_offset.str->value.str.val = (char *) erealloc(T->str_offset.str->value.str.val, T->str_offset.offset+1+1);
+ Z_STRVAL_P(T->str_offset.str) = (char *) erealloc(Z_STRVAL_P(T->str_offset.str), T->str_offset.offset+1+1);
}
- for (i=T->str_offset.str->value.str.len; i<T->str_offset.offset; i++) {
- T->str_offset.str->value.str.val[i] = ' ';
+ for (i=Z_STRLEN_P(T->str_offset.str); i<T->str_offset.offset; i++) {
+ Z_STRVAL_P(T->str_offset.str)[i] = ' ';
}
- T->str_offset.str->value.str.val[T->str_offset.offset+1] = 0;
- T->str_offset.str->value.str.len = T->str_offset.offset+1;
+ Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset+1] = 0;
+ Z_STRLEN_P(T->str_offset.str) = T->str_offset.offset+1;
}
- if (value->type!=IS_STRING) {
+ if (Z_TYPE_P(value)!=IS_STRING) {
tmp = *value;
if (op2->op_type & (IS_VAR|IS_CV)) {
zval_copy_ctor(&tmp);
@@ -683,14 +672,14 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
final_value = &tmp;
}
- T->str_offset.str->value.str.val[T->str_offset.offset] = final_value->value.str.val[0];
-
+ Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL_P(final_value)[0];
+
if (op2->op_type == IS_TMP_VAR) {
if (final_value == &T(op2->u.var).tmp_var) {
/* we can safely free final_value here
* because separation is done only
* in case op2->op_type == IS_VAR */
- STR_FREE(final_value->value.str.val);
+ STR_FREE(Z_STRVAL_P(final_value));
}
}
if (final_value == &tmp) {
@@ -702,7 +691,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
*/
} while (0);
/* zval_ptr_dtor(&T->str_offset.str); Nuke this line if it doesn't cause a leak */
-
+
/* T(result->u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); */
if (!RETURN_VALUE_UNUSED(result)) {
T(result->u.var).var.ptr_ptr = &value;
@@ -728,65 +717,64 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
return;
}
- if(Z_TYPE_P(variable_ptr) == IS_OBJECT && Z_OBJ_HANDLER_P(variable_ptr, set)) {
- /* TODO? ze1_compatibility_mode support */
+ if (Z_TYPE_P(variable_ptr) == IS_OBJECT && Z_OBJ_HANDLER_P(variable_ptr, set)) {
Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr_ptr, value TSRMLS_CC);
goto done_setting_var;
}
-
- if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
- char *class_name;
- zend_uint class_name_len;
- int dup;
-
- dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
-
- if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
- zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
- } else if (PZVAL_IS_REF(variable_ptr)) {
- if (variable_ptr != value) {
- zend_uint refcount = variable_ptr->refcount;
- zval garbage;
- if (type != IS_TMP_VAR) {
- value->refcount++;
- }
- garbage = *variable_ptr;
- *variable_ptr = *value;
- variable_ptr->refcount = refcount;
- variable_ptr->is_ref = 1;
- zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
- variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
- if (type != IS_TMP_VAR) {
- value->refcount--;
- }
- zendi_zval_dtor(garbage);
- }
- } else {
- if (variable_ptr != value) {
- value->refcount++;
- variable_ptr->refcount--;
- if (variable_ptr->refcount == 0) {
- zendi_zval_dtor(*variable_ptr);
- } else {
- ALLOC_ZVAL(variable_ptr);
- *variable_ptr_ptr = variable_ptr;
- }
- *variable_ptr = *value;
- INIT_PZVAL(variable_ptr);
- zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
- variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
- zval_ptr_dtor(&value);
- }
- }
- if (!dup) {
- efree(class_name);
- }
- } else if (PZVAL_IS_REF(variable_ptr)) {
+ if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
+ char *class_name;
+ zend_uint class_name_len;
+ int dup;
+
+ dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
+
+ if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
+ } else if (PZVAL_IS_REF(variable_ptr)) {
+ if (variable_ptr != value) {
+ zend_uint refcount = variable_ptr->refcount;
+ zval garbage;
+
+ if (type != IS_TMP_VAR) {
+ value->refcount++;
+ }
+ garbage = *variable_ptr;
+ *variable_ptr = *value;
+ variable_ptr->refcount = refcount;
+ variable_ptr->is_ref = 1;
+ zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
+ variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
+ if (type != IS_TMP_VAR) {
+ value->refcount--;
+ }
+ zendi_zval_dtor(garbage);
+ }
+ } else {
+ if (variable_ptr != value) {
+ value->refcount++;
+ variable_ptr->refcount--;
+ if (variable_ptr->refcount == 0) {
+ zendi_zval_dtor(*variable_ptr);
+ } else {
+ ALLOC_ZVAL(variable_ptr);
+ *variable_ptr_ptr = variable_ptr;
+ }
+ *variable_ptr = *value;
+ INIT_PZVAL(variable_ptr);
+ zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
+ variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
+ zval_ptr_dtor(&value);
+ }
+ }
+ if (!dup) {
+ efree(class_name);
+ }
+ } else if (PZVAL_IS_REF(variable_ptr)) {
if (variable_ptr!=value) {
zend_uint refcount = variable_ptr->refcount;
zval garbage;
-
+
if (type!=IS_TMP_VAR) {
value->refcount++;
}
@@ -812,7 +800,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
variable_ptr->refcount++;
} else if (PZVAL_IS_REF(value)) {
zval tmp;
-
+
tmp = *value;
zval_copy_ctor(&tmp);
tmp.refcount=1;
@@ -859,13 +847,13 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
}
(*variable_ptr_ptr)->is_ref=0;
}
-
+
done_setting_var:
if (result && !RETURN_VALUE_UNUSED(result)) {
T(result->u.var).var.ptr_ptr = variable_ptr_ptr;
PZVAL_LOCK(*variable_ptr_ptr);
AI_USE_PTR(T(result->u.var).var);
- }
+ }
FREE_OP_VAR_PTR(free_op1);
}
@@ -874,32 +862,32 @@ static inline void zend_receive(zval **variable_ptr_ptr, zval *value TSRMLS_DC)
{
zval *variable_ptr = *variable_ptr_ptr;
- if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
- char *class_name;
- zend_uint class_name_len;
- int dup;
-
- dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
-
- if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
- zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
- } else {
- variable_ptr->refcount--;
- ALLOC_ZVAL(variable_ptr);
- *variable_ptr_ptr = variable_ptr;
- *variable_ptr = *value;
- INIT_PZVAL(variable_ptr);
- zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
- variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
- }
- if (!dup) {
- efree(class_name);
- }
- } else {
- variable_ptr->refcount--;
- *variable_ptr_ptr = value;
- value->refcount++;
- }
+ if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
+ char *class_name;
+ zend_uint class_name_len;
+ int dup;
+
+ dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
+
+ if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
+ } else {
+ variable_ptr->refcount--;
+ ALLOC_ZVAL(variable_ptr);
+ *variable_ptr_ptr = variable_ptr;
+ *variable_ptr = *value;
+ INIT_PZVAL(variable_ptr);
+ zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
+ variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
+ }
+ if (!dup) {
+ efree(class_name);
+ }
+ } else {
+ variable_ptr->refcount--;
+ *variable_ptr_ptr = value;
+ value->refcount++;
+ }
}
/* Utility Functions for Extensions */
@@ -960,6 +948,7 @@ static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, zval *dim
offset_key = "";
offset_key_length = 0;
goto fetch_string_dim;
+
case IS_STRING:
offset_key = dim->value.str.val;
@@ -989,17 +978,17 @@ fetch_string_dim:
}
break;
case IS_RESOURCE:
- zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", dim->value.lval, dim->value.lval);
+ zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(dim), Z_LVAL_P(dim));
/* Fall Through */
case IS_DOUBLE:
- case IS_BOOL:
+ case IS_BOOL:
case IS_LONG: {
long index;
- if (dim->type == IS_DOUBLE) {
- index = (long)dim->value.dval;
+ if (Z_TYPE_P(dim) == IS_DOUBLE) {
+ index = (long)Z_DVAL_P(dim);
} else {
- index = dim->value.lval;
+ index = Z_LVAL_P(dim);
}
if (zend_hash_index_find(ht, index, (void **) &retval) == FAILURE) {
switch (type) {
@@ -1024,7 +1013,7 @@ fetch_string_dim:
}
}
break;
- default:
+ default:
zend_error(E_WARNING, "Illegal offset type");
switch (type) {
case BP_VAR_R:
@@ -1048,7 +1037,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
if (!container_ptr) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
-
+
container = *container_ptr;
if (container == EG(error_zval_ptr)) {
@@ -1062,9 +1051,9 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
return;
}
- if (container->type==IS_NULL
- || (container->type==IS_BOOL && container->value.lval==0)
- || (container->type==IS_STRING && container->value.str.len==0)) {
+ if (Z_TYPE_P(container)==IS_NULL
+ || (Z_TYPE_P(container)==IS_BOOL && Z_LVAL_P(container)==0)
+ || (Z_TYPE_P(container)==IS_STRING && Z_STRLEN_P(container)==0)) {
switch (type) {
case BP_VAR_RW:
case BP_VAR_W:
@@ -1078,7 +1067,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
}
}
- switch (container->type) {
+ switch (Z_TYPE_P(container)) {
zval **retval;
case IS_ARRAY:
@@ -1090,13 +1079,13 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
zval *new_zval = &EG(uninitialized_zval);
new_zval->refcount++;
- if (zend_hash_next_index_insert(container->value.ht, &new_zval, sizeof(zval *), (void **) &retval) == FAILURE) {
+ if (zend_hash_next_index_insert(Z_ARRVAL_P(container), &new_zval, sizeof(zval *), (void **) &retval) == FAILURE) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
retval = &EG(error_zval_ptr);
- new_zval->refcount--;
+ new_zval->refcount--;
}
} else {
- retval = zend_fetch_dimension_address_inner(container->value.ht, dim, type TSRMLS_CC);
+ retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, type TSRMLS_CC);
}
if (result) {
result->var.ptr_ptr = retval;
@@ -1121,7 +1110,20 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
zend_error_noreturn(E_ERROR, "[] operator not supported for strings");
}
- if (dim->type != IS_LONG) {
+ if (Z_TYPE_P(dim) != IS_LONG) {
+ switch(Z_TYPE_P(dim)) {
+ /* case IS_LONG: */
+ case IS_STRING:
+ case IS_DOUBLE:
+ case IS_NULL:
+ case IS_BOOL:
+ /* do nothing */
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type");
+ break;
+ }
+
tmp = *dim;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
@@ -1141,7 +1143,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
container = *container_ptr;
result->str_offset.str = container;
PZVAL_LOCK(container);
- result->str_offset.offset = dim->value.lval;
+ result->str_offset.offset = Z_LVAL_P(dim);
result->var.ptr_ptr = NULL;
if (type == BP_VAR_R || type == BP_VAR_IS) {
AI_USE_PTR(result->var);
@@ -1155,19 +1157,19 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
zend_error_noreturn(E_ERROR, "Cannot use object as array");
} else {
zval *overloaded_result;
-
+
if (dim_is_tmp_var) {
zval *orig = dim;
MAKE_REAL_ZVAL_PTR(dim);
ZVAL_NULL(orig);
- }
+ }
overloaded_result = Z_OBJ_HT_P(container)->read_dimension(container, dim, type TSRMLS_CC);
if (overloaded_result) {
switch (type) {
case BP_VAR_RW:
case BP_VAR_W:
- if (overloaded_result->type != IS_OBJECT
+ if (Z_TYPE_P(overloaded_result) != IS_OBJECT
&& !overloaded_result->is_ref) {
zend_error_noreturn(E_ERROR, "Objects used as arrays in post/pre increment/decrement must return values by reference");
}
@@ -1193,7 +1195,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
return;
}
break;
- default: {
+ default: {
switch (type) {
case BP_VAR_UNSET:
zend_error(E_WARNING, "Cannot unset offset in a non-array variable");
@@ -1224,7 +1226,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
static void zend_fetch_property_address(temp_variable *result, zval **container_ptr, zval *prop_ptr, int type TSRMLS_DC)
{
zval *container;
-
+
container = *container_ptr;
if (container == EG(error_zval_ptr)) {
if (result) {
@@ -1234,9 +1236,9 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
return;
}
/* this should modify object only if it's empty */
- if (container->type == IS_NULL
- || (container->type == IS_BOOL && container->value.lval==0)
- || (container->type == IS_STRING && container->value.str.len == 0)) {
+ if (Z_TYPE_P(container) == IS_NULL
+ || (Z_TYPE_P(container) == IS_BOOL && Z_LVAL_P(container)==0)
+ || (Z_TYPE_P(container) == IS_STRING && Z_STRLEN_P(container)==0)) {
switch (type) {
case BP_VAR_RW:
case BP_VAR_W:
@@ -1248,8 +1250,8 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
break;
}
}
-
- if (container->type != IS_OBJECT) {
+
+ if (Z_TYPE_P(container) != IS_OBJECT) {
if (result) {
if (type == BP_VAR_R || type == BP_VAR_IS) {
result->var.ptr_ptr = &EG(uninitialized_zval_ptr);
@@ -1260,14 +1262,14 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
}
return;
}
-
+
if (Z_OBJ_HT_P(container)->get_property_ptr_ptr) {
zval **ptr_ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr TSRMLS_CC);
- if(NULL == ptr_ptr) {
+ if (NULL == ptr_ptr) {
zval *ptr;
if (Z_OBJ_HT_P(container)->read_property &&
- (ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, BP_VAR_W TSRMLS_CC)) != NULL) {
+ (ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type TSRMLS_CC)) != NULL) {
if (result) {
result->var.ptr = ptr;
result->var.ptr_ptr = &result->var.ptr;
@@ -1280,7 +1282,7 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
}
} else if (Z_OBJ_HT_P(container)->read_property) {
if (result) {
- result->var.ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, BP_VAR_W TSRMLS_CC);
+ result->var.ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type TSRMLS_CC);
result->var.ptr_ptr = &result->var.ptr;
}
} else {
@@ -1289,10 +1291,10 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
result->var.ptr_ptr = &EG(error_zval_ptr);
}
}
-
+
if (result) {
PZVAL_LOCK(*result->var.ptr_ptr);
- }
+ }
}
static inline zend_brk_cont_element* zend_brk_cont(zval *nest_levels_zval, int array_offset, zend_op_array *op_array, temp_variable *Ts TSRMLS_DC)
@@ -1347,7 +1349,7 @@ static int zend_check_symbol(zval **pz TSRMLS_DC)
} else if (Z_TYPE_PP(pz) == IS_ARRAY) {
zend_hash_apply(Z_ARRVAL_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC);
} else if (Z_TYPE_PP(pz) == IS_OBJECT) {
-
+
/* OBJ-TBI - doesn't support new object model! */
zend_hash_apply(Z_OBJPROP_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC);
}
@@ -1369,13 +1371,13 @@ ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int return_v
}
#define ZEND_VM_NEXT_OPCODE() \
- CHECK_SYMBOL_TABLES() \
- EX(opline)++; \
- ZEND_VM_CONTINUE()
+ CHECK_SYMBOL_TABLES() \
+ EX(opline)++; \
+ ZEND_VM_CONTINUE()
#define ZEND_VM_SET_OPCODE(new_op) \
- CHECK_SYMBOL_TABLES() \
- EX(opline) = new_op
+ CHECK_SYMBOL_TABLES() \
+ EX(opline) = new_op
#define ZEND_VM_JMP(new_op) \
CHECK_SYMBOL_TABLES() \
@@ -1383,21 +1385,21 @@ ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int return_v
ZEND_VM_CONTINUE()
#define ZEND_VM_INC_OPCODE() \
- if (!EG(exception)) { \
- CHECK_SYMBOL_TABLES() \
- EX(opline)++; \
- }
+ if (!EG(exception)) { \
+ CHECK_SYMBOL_TABLES() \
+ EX(opline)++; \
+ }
#define ZEND_VM_RETURN_FROM_EXECUTE_LOOP() \
- free_alloca(EX(CVs)); \
- if (EX(op_array)->T < TEMP_VAR_STACK_LIMIT) { \
- free_alloca(EX(Ts)); \
- } else { \
- efree(EX(Ts)); \
- } \
- EG(in_execution) = EX(original_in_execution); \
- EG(current_execute_data) = EX(prev_execute_data); \
- ZEND_VM_RETURN()
+ free_alloca(EX(CVs)); \
+ if (EX(op_array)->T < TEMP_VAR_STACK_LIMIT) { \
+ free_alloca(EX(Ts)); \
+ } else { \
+ efree(EX(Ts)); \
+ } \
+ EG(in_execution) = EX(original_in_execution); \
+ EG(current_execute_data) = EX(prev_execute_data); \
+ ZEND_VM_RETURN()
#include "zend_vm_execute.h"
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index ee105c8e0..6abe48b08 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -17,15 +17,15 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.h,v 1.84.2.4 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_execute.h,v 1.84.2.4.2.4 2006/10/18 16:35:15 johannes Exp $ */
#ifndef ZEND_EXECUTE_H
#define ZEND_EXECUTE_H
#include "zend_compile.h"
#include "zend_hash.h"
-#include "zend_variables.h"
#include "zend_operators.h"
+#include "zend_variables.h"
typedef union _temp_variable {
zval tmp_var;
@@ -73,28 +73,28 @@ static inline int i_zend_is_true(zval *op)
{
int result;
- switch (op->type) {
+ switch (Z_TYPE_P(op)) {
case IS_NULL:
result = 0;
break;
case IS_LONG:
case IS_BOOL:
case IS_RESOURCE:
- result = (op->value.lval?1:0);
+ result = (Z_LVAL_P(op)?1:0);
break;
case IS_DOUBLE:
- result = (op->value.dval ? 1 : 0);
+ result = (Z_DVAL_P(op) ? 1 : 0);
break;
case IS_STRING:
- if (op->value.str.len == 0
- || (op->value.str.len==1 && op->value.str.val[0]=='0')) {
+ if (Z_STRLEN_P(op) == 0
+ || (Z_STRLEN_P(op)==1 && Z_STRVAL_P(op)[0]=='0')) {
result = 0;
} else {
result = 1;
}
break;
case IS_ARRAY:
- result = (zend_hash_num_elements(op->value.ht)?1:0);
+ result = (zend_hash_num_elements(Z_ARRVAL_P(op))?1:0);
break;
case IS_OBJECT:
if(IS_ZEND_STD_OBJECT(*op)) {
@@ -102,7 +102,7 @@ static inline int i_zend_is_true(zval *op)
if (Z_OBJ_HT_P(op)->cast_object) {
zval tmp;
- if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_BOOL, 0 TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_BOOL TSRMLS_CC) == SUCCESS) {
result = Z_LVAL(tmp);
break;
}
@@ -134,6 +134,7 @@ static inline int i_zend_is_true(zval *op)
}
ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC);
+ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *scope TSRMLS_DC);
/* dedicated Zend executor functions - do not use! */
static inline void zend_ptr_stack_clear_multiple(TSRMLS_D)
@@ -143,7 +144,9 @@ static inline void zend_ptr_stack_clear_multiple(TSRMLS_D)
EG(argument_stack).top -= (delete_count+2);
while (--delete_count>=0) {
- zval_ptr_dtor((zval **) --p);
+ zval *q = *(zval **)(--p);
+ *p = NULL;
+ zval_ptr_dtor(&q);
}
EG(argument_stack).top_element = p;
}
@@ -191,7 +194,7 @@ void zend_shutdown_timeout_thread();
/* The following tries to resolve the classname of a zval of type object.
* Since it is slow it should be only used in error messages.
*/
-#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && (zval)->type == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : "")
+#define Z_OBJ_CLASS_NAME_P(zval) ((zval) && Z_TYPE_P(zval) == IS_OBJECT && Z_OBJ_HT_P(zval)->get_class_entry != NULL && Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC) ? Z_OBJ_HT_P(zval)->get_class_entry(zval TSRMLS_CC)->name : "")
ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data_ptr, zend_uint var);
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index fac0b3f1b..cf14a2b98 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute_API.c,v 1.331.2.20 2006/04/20 22:49:20 tony2001 Exp $ */
+/* $Id: zend_execute_API.c,v 1.331.2.20.2.10 2006/10/18 17:04:49 johannes Exp $ */
#include <stdio.h>
#include <signal.h>
@@ -155,8 +155,8 @@ void init_executor(TSRMLS_D)
ALLOC_ZVAL(globals);
globals->refcount=1;
globals->is_ref=1;
- globals->type = IS_ARRAY;
- globals->value.ht = &EG(symbol_table);
+ Z_TYPE_P(globals) = IS_ARRAY;
+ Z_ARRVAL_P(globals) = &EG(symbol_table);
zend_hash_update(&EG(symbol_table), "GLOBALS", sizeof("GLOBALS"), &globals, sizeof(zval *), NULL);
}
EG(active_symbol_table) = &EG(symbol_table);
@@ -188,10 +188,28 @@ void init_executor(TSRMLS_D)
EG(scope) = NULL;
EG(This) = NULL;
+
+ EG(active_op_array) = NULL;
+
+ EG(active) = 1;
+}
+
+static int zval_call_destructor(zval **zv TSRMLS_DC)
+{
+ if (Z_TYPE_PP(zv) == IS_OBJECT && (*zv)->refcount == 1) {
+ return ZEND_HASH_APPLY_REMOVE;
+ } else {
+ return ZEND_HASH_APPLY_KEEP;
+ }
}
void shutdown_destructors(TSRMLS_D) {
zend_try {
+ int symbols;
+ do {
+ symbols = zend_hash_num_elements(&EG(symbol_table));
+ zend_hash_reverse_apply(&EG(symbol_table), (apply_func_t) zval_call_destructor TSRMLS_CC);
+ } while (symbols != zend_hash_num_elements(&EG(symbol_table)));
zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC);
} zend_catch {
/* if we couldn't destruct cleanly, mark all objects as destructed anyway */
@@ -302,6 +320,7 @@ void shutdown_executor(TSRMLS_D)
FREE_HASHTABLE(EG(in_autoload));
}
} zend_end_try();
+ EG(active) = 0;
}
@@ -429,13 +448,13 @@ ZEND_API int zend_is_true(zval *op)
#include "../TSRM/tsrm_strtok_r.h"
-ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
+ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *scope TSRMLS_DC)
{
zval *p = *pp;
zend_bool inline_change = (zend_bool) (unsigned long) arg;
zval const_value;
- if (p->type == IS_CONSTANT) {
+ if (Z_TYPE_P(p) == IS_CONSTANT) {
int refcount;
zend_uchar is_ref;
@@ -445,7 +464,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
refcount = p->refcount;
is_ref = p->is_ref;
- if (!zend_get_constant(p->value.str.val, p->value.str.len, &const_value TSRMLS_CC)) {
+ if (!zend_get_constant_ex(p->value.str.val, p->value.str.len, &const_value, scope TSRMLS_CC)) {
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'",
p->value.str.val,
p->value.str.val);
@@ -462,7 +481,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
p->refcount = refcount;
p->is_ref = is_ref;
- } else if (p->type == IS_CONSTANT_ARRAY) {
+ } else if (Z_TYPE_P(p) == IS_CONSTANT_ARRAY) {
zval **element, *new_val;
char *str_index;
uint str_index_len;
@@ -470,23 +489,23 @@ ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
SEPARATE_ZVAL_IF_NOT_REF(pp);
p = *pp;
- p->type = IS_ARRAY;
+ Z_TYPE_P(p) = IS_ARRAY;
/* First go over the array and see if there are any constant indices */
- zend_hash_internal_pointer_reset(p->value.ht);
- while (zend_hash_get_current_data(p->value.ht, (void **) &element)==SUCCESS) {
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(p));
+ while (zend_hash_get_current_data(Z_ARRVAL_P(p), (void **) &element)==SUCCESS) {
if (!(Z_TYPE_PP(element) & IS_CONSTANT_INDEX)) {
- zend_hash_move_forward(p->value.ht);
+ zend_hash_move_forward(Z_ARRVAL_P(p));
continue;
}
Z_TYPE_PP(element) &= ~IS_CONSTANT_INDEX;
- if (zend_hash_get_current_key_ex(p->value.ht, &str_index, &str_index_len, &num_index, 0, NULL)!=HASH_KEY_IS_STRING) {
- zend_hash_move_forward(p->value.ht);
+ if (zend_hash_get_current_key_ex(Z_ARRVAL_P(p), &str_index, &str_index_len, &num_index, 0, NULL)!=HASH_KEY_IS_STRING) {
+ zend_hash_move_forward(Z_ARRVAL_P(p));
continue;
}
- if (!zend_get_constant(str_index, str_index_len-1, &const_value TSRMLS_CC)) {
+ if (!zend_get_constant_ex(str_index, str_index_len-1, &const_value, scope TSRMLS_CC)) {
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", str_index, str_index);
- zend_hash_move_forward(p->value.ht);
+ zend_hash_move_forward(Z_ARRVAL_P(p));
continue;
}
@@ -509,30 +528,34 @@ ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
zval_ptr_dtor(element);
*element = new_val;
- switch (const_value.type) {
+ switch (Z_TYPE(const_value)) {
case IS_STRING:
- zend_symtable_update_current_key(p->value.ht, const_value.value.str.val, const_value.value.str.len+1);
+ zend_symtable_update_current_key(Z_ARRVAL_P(p), const_value.value.str.val, const_value.value.str.len+1);
break;
case IS_BOOL:
case IS_LONG:
- zend_hash_update_current_key(p->value.ht, HASH_KEY_IS_LONG, NULL, 0, const_value.value.lval);
+ zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL, 0, Z_LVAL(const_value));
break;
case IS_DOUBLE:
- zend_hash_update_current_key(p->value.ht, HASH_KEY_IS_LONG, NULL, 0, (long)const_value.value.dval);
+ zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL, 0, (long)Z_DVAL(const_value));
break;
case IS_NULL:
- zend_hash_update_current_key(p->value.ht, HASH_KEY_IS_STRING, "", 1, 0);
+ zend_hash_update_current_key(Z_ARRVAL_P(p), HASH_KEY_IS_STRING, "", 1, 0);
break;
}
- zend_hash_move_forward(p->value.ht);
+ zend_hash_move_forward(Z_ARRVAL_P(p));
zval_dtor(&const_value);
}
- zend_hash_apply_with_argument(p->value.ht, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
- zend_hash_internal_pointer_reset(p->value.ht);
+ zend_hash_apply_with_argument(Z_ARRVAL_P(p), (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(p));
}
return 0;
}
+ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
+{
+ return zval_update_constant_ex(pp, arg, NULL TSRMLS_CC);
+}
int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, zend_uint param_count, zval *params[] TSRMLS_DC)
{
@@ -599,6 +622,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
char *fname, *colon;
int fname_len;
+ if (!EG(active)) {
+ return FAILURE; /* executor is already inactive */
+ }
+
if (EG(exception)) {
return FAILURE; /* we would result in an instable executor otherwise */
}
@@ -631,13 +658,13 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
*fci->retval_ptr_ptr = NULL;
if (!fci_cache || !fci_cache->initialized) {
- if (fci->function_name->type==IS_ARRAY) { /* assume array($obj, $name) couple */
+ if (Z_TYPE_P(fci->function_name)==IS_ARRAY) { /* assume array($obj, $name) couple */
zval **tmp_object_ptr, **tmp_real_function_name;
- if (zend_hash_index_find(fci->function_name->value.ht, 0, (void **) &tmp_object_ptr)==FAILURE) {
+ if (zend_hash_index_find(Z_ARRVAL_P(fci->function_name), 0, (void **) &tmp_object_ptr)==FAILURE) {
return FAILURE;
}
- if (zend_hash_index_find(fci->function_name->value.ht, 1, (void **) &tmp_real_function_name)==FAILURE) {
+ if (zend_hash_index_find(Z_ARRVAL_P(fci->function_name), 1, (void **) &tmp_real_function_name)==FAILURE) {
return FAILURE;
}
fci->function_name = *tmp_real_function_name;
@@ -693,7 +720,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
if (found == FAILURE) {
zend_error(E_ERROR, "Class '%s' not found", Z_STRVAL_PP(fci->object_pp));
}
- if (scope && EG(This) &&
+ if (scope && EG(This) &&
instanceof_function(Z_OBJCE_P(EG(This)), scope TSRMLS_CC) &&
instanceof_function(scope, *ce TSRMLS_CC)) {
fci->object_pp = &EG(This);
@@ -776,7 +803,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
&& !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)
&& !instanceof_function(check_scope_or_static, calling_scope TSRMLS_CC)) {
zend_error(E_ERROR, "Cannot call method %s() of class %s which is not a derived from %s", fname, calling_scope->name, check_scope_or_static->name);
- return 0;
+ return FAILURE;
}
} else {
char *function_name_lc = zend_str_tolower_dup(fname, fname_len);
@@ -816,7 +843,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
fci->object_pp = fci_cache->object_pp;
EX(object) = fci->object_pp ? *fci->object_pp : NULL;
}
-
+
if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) {
zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
@@ -1023,7 +1050,7 @@ ZEND_API int zend_lookup_class_ex(char *name, int name_length, int use_autoload,
ZVAL_STRINGL(class_name_ptr, name, name_length, 1);
args[0] = &class_name_ptr;
-
+
fcall_info.size = sizeof(fcall_info);
fcall_info.function_table = EG(function_table);
fcall_info.function_name = &autoload_function;
@@ -1101,7 +1128,7 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSR
original_handle_op_arrays = CG(handle_op_arrays);
CG(handle_op_arrays) = 0;
- new_op_array = compile_string(&pv, string_name TSRMLS_CC);
+ new_op_array = zend_compile_string(&pv, string_name TSRMLS_CC);
CG(handle_op_arrays) = original_handle_op_arrays;
if (new_op_array) {
@@ -1339,6 +1366,7 @@ void zend_shutdown_timeout_thread()
/* Wait for thread termination */
WaitForSingleObject(timeout_thread_handle, 5000);
CloseHandle(timeout_thread_handle);
+ timeout_thread_initialized = 0;
}
#endif
@@ -1490,9 +1518,9 @@ void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC)
zend_hash_apply_with_argument(&ce->function_table, (apply_func_arg_t) zend_verify_abstract_class_function, &ai TSRMLS_CC);
- if (ai.cnt) {
- zend_error(E_ERROR, "Class %s contains %d abstract method%s and must therefore be declared abstract or implement the remaining methods (" MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT ")",
- ce->name, ai.cnt,
+ if (ai.cnt) {
+ zend_error(E_ERROR, "Class %s contains %d abstract method%s and must therefore be declared abstract or implement the remaining methods (" MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT ")",
+ ce->name, ai.cnt,
ai.cnt > 1 ? "s" : "",
DISPLAY_ABSTRACT_FN(0),
DISPLAY_ABSTRACT_FN(1),
diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c
index e498235f9..11fa6881e 100644
--- a/Zend/zend_extensions.c
+++ b/Zend/zend_extensions.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_extensions.c,v 1.48.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_extensions.c,v 1.48.2.1.2.1 2006/05/09 23:53:23 helly Exp $ */
#include "zend_extensions.h"
@@ -78,7 +78,7 @@ int zend_load_extension(char *path)
new_extension->name);
DL_UNLOAD(handle);
return FAILURE;
- }
+ }
} else if (ZTS_V!=extension_version_info->thread_safe) {
fprintf(stderr, "Cannot load %s - it %s thread safe, whereas Zend %s\n",
new_extension->name,
@@ -229,10 +229,10 @@ ZEND_API zend_extension *zend_get_extension(char *extension_name)
* Support for dynamic loading of MH_BUNDLEs on Darwin / Mac OS X
*
*/
-
+
#if HAVE_MACH_O_DYLD_H
-void *zend_mh_bundle_load(char* bundle_path)
+void *zend_mh_bundle_load(char* bundle_path)
{
NSObjectFileImage bundle_image;
NSModule bundle_handle;
@@ -242,17 +242,17 @@ void *zend_mh_bundle_load(char* bundle_path)
if (NSCreateObjectFileImageFromFile(bundle_path, &bundle_image) != NSObjectFileImageSuccess) {
return NULL;
}
-
+
bundle_handle = NSLinkModule(bundle_image, bundle_path, NSLINKMODULE_OPTION_PRIVATE);
NSDestroyObjectFileImage(bundle_image);
-
+
/* call the init function of the bundle */
bundle_init_nssymbol = NSLookupSymbolInModule(bundle_handle, "__init");
if (bundle_init_nssymbol != NULL) {
bundle_init = NSAddressOfSymbol(bundle_init_nssymbol);
bundle_init();
}
-
+
return bundle_handle;
}
@@ -260,14 +260,14 @@ int zend_mh_bundle_unload(void *bundle_handle)
{
NSSymbol bundle_fini_nssymbol;
void (*bundle_fini)(void);
-
+
/* call the fini function of the bundle */
bundle_fini_nssymbol = NSLookupSymbolInModule(bundle_handle, "__fini");
if (bundle_fini_nssymbol != NULL) {
bundle_fini = NSAddressOfSymbol(bundle_fini_nssymbol);
bundle_fini();
}
-
+
return (int) NSUnLinkModule(bundle_handle, NULL);
}
diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h
index 5a87967f8..4006035d5 100644
--- a/Zend/zend_extensions.h
+++ b/Zend/zend_extensions.h
@@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 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 |
+ | 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 |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_extensions.h,v 1.67.2.3 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_extensions.h,v 1.67.2.3.2.2 2006/05/19 06:09:14 dmitry Exp $ */
#ifndef ZEND_EXTENSIONS_H
#define ZEND_EXTENSIONS_H
@@ -25,9 +25,9 @@
#include "zend_compile.h"
/* The first number is the engine version and the rest is the date.
- * This way engine 2 API no. is always greater than engine 1 API no..
+ * This way engine 2/3 API no. is always greater than engine 1 API no..
*/
-#define ZEND_EXTENSION_API_NO 220051025
+#define ZEND_EXTENSION_API_NO 220060519
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
@@ -72,7 +72,7 @@ struct _zend_extension {
op_array_handler_func_t op_array_handler;
- statement_handler_func_t statement_handler;
+ statement_handler_func_t statement_handler;
fcall_begin_handler_func_t fcall_begin_handler;
fcall_end_handler_func_t fcall_end_handler;
diff --git a/Zend/zend_fast_cache.h b/Zend/zend_fast_cache.h
index d990e5824..1fb5bca07 100644
--- a/Zend/zend_fast_cache.h
+++ b/Zend/zend_fast_cache.h
@@ -17,8 +17,8 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_fast_cache.h,v 1.21.2.1 2006/01/04 23:53:04 andi Exp $ */
-
+/* $Id: zend_fast_cache.h,v 1.21.2.1.2.1 2006/07/18 09:06:33 dmitry Exp $ */
+#if 0
#ifndef ZEND_FAST_CACHE_H
#define ZEND_FAST_CACHE_H
@@ -131,7 +131,7 @@ typedef struct _zend_fast_cache_list_entry {
ZEND_FAST_FREE_REL(ht, HASHTABLE_CACHE_LIST)
#endif /* ZEND_FAST_CACHE_H */
-
+#endif
/*
* Local variables:
* tab-width: 4
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h
index 7c0997883..4bc99cfee 100644
--- a/Zend/zend_globals.h
+++ b/Zend/zend_globals.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_globals.h,v 1.141.2.3 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_globals.h,v 1.141.2.3.2.6 2006/09/11 14:30:03 tony2001 Exp $ */
#ifndef ZEND_GLOBALS_H
#define ZEND_GLOBALS_H
@@ -31,7 +31,6 @@
#include "zend_ptr_stack.h"
#include "zend_hash.h"
#include "zend_llist.h"
-#include "zend_fast_cache.h"
#include "zend_objects.h"
#include "zend_objects_API.h"
#include "zend_modules.h"
@@ -48,7 +47,6 @@
BEGIN_EXTERN_C()
ZEND_API extern int compiler_globals_id;
ZEND_API extern int executor_globals_id;
-ZEND_API extern int alloc_globals_id;
END_EXTERN_C()
#endif
@@ -176,7 +174,7 @@ struct _zend_executor_globals {
HashTable included_files; /* files already included */
- jmp_buf bailout;
+ jmp_buf *bailout;
int error_reporting;
int orig_error_reporting;
@@ -199,7 +197,6 @@ struct _zend_executor_globals {
zend_bool in_execution;
HashTable *in_autoload;
zend_function *autoload_func;
- zend_bool bailout_set;
zend_bool full_tables_cleanup;
zend_bool ze1_compatibility_mode;
@@ -228,6 +225,8 @@ struct _zend_executor_globals {
int lambda_count;
HashTable *ini_directives;
+ HashTable *modified_ini_directives;
+
zend_objects_store objects_store;
zval *exception;
zend_op *opline_before_exception;
@@ -238,35 +237,9 @@ struct _zend_executor_globals {
zend_property_info std_property_info;
- void *reserved[ZEND_MAX_RESERVED_RESOURCES];
-};
-
-#include "zend_mm.h"
-
-struct _zend_alloc_globals {
- zend_mem_header *head; /* standard list */
- void *cache[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
- unsigned int cache_count[MAX_CACHED_MEMORY];
- void *fast_cache_list_head[MAX_FAST_CACHE_TYPES];
-
-#ifdef ZEND_WIN32
- HANDLE memory_heap;
-#endif
+ zend_bool active;
-#if ZEND_DEBUG
- /* for performance tuning */
- int cache_stats[MAX_CACHED_MEMORY][2];
- int fast_cache_stats[MAX_FAST_CACHE_TYPES][2];
-#endif
-#if MEMORY_LIMIT
- unsigned int memory_limit;
- unsigned int allocated_memory;
- unsigned int allocated_memory_peak;
- unsigned char memory_exhausted;
-#endif
-#ifdef ZEND_MM
- zend_mm_heap mm_heap;
-#endif
+ void *reserved[ZEND_MAX_RESERVED_RESOURCES];
};
struct _zend_scanner_globals {
diff --git a/Zend/zend_globals_macros.h b/Zend/zend_globals_macros.h
index 75c221f79..f18296647 100644
--- a/Zend/zend_globals_macros.h
+++ b/Zend/zend_globals_macros.h
@@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 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 |
+ | 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 |
@@ -17,14 +17,13 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_globals_macros.h,v 1.22.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_globals_macros.h,v 1.22.2.1.2.2 2006/07/18 09:06:33 dmitry Exp $ */
#ifndef ZEND_GLOBALS_MACROS_H
#define ZEND_GLOBALS_MACROS_H
typedef struct _zend_compiler_globals zend_compiler_globals;
typedef struct _zend_executor_globals zend_executor_globals;
-typedef struct _zend_alloc_globals zend_alloc_globals;
typedef struct _zend_scanner_globals zend_scanner_globals;
/* Compiler */
@@ -48,16 +47,6 @@ int zendparse(void);
extern ZEND_API zend_executor_globals executor_globals;
#endif
-
-/* Memory Manager */
-#ifdef ZTS
-# define AG(v) TSRMG(alloc_globals_id, zend_alloc_globals *, v)
-#else
-# define AG(v) (alloc_globals.v)
-extern ZEND_API zend_alloc_globals alloc_globals;
-#endif
-
-
/* Language Scanner */
#ifdef ZTS
# define LANG_SCNG(v) TSRMG(language_scanner_globals_id, zend_scanner_globals *, v)
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index 36dafd680..f637ecef2 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_hash.c,v 1.121.2.4 2006/04/07 10:06:21 dmitry Exp $ */
+/* $Id: zend_hash.c,v 1.121.2.4.2.1 2006/08/24 09:42:35 dmitry Exp $ */
#include "zend.h"
@@ -571,15 +571,6 @@ static Bucket *zend_hash_apply_deleter(HashTable *ht, Bucket *p)
Bucket *retval;
HANDLE_BLOCK_INTERRUPTIONS();
-
- if (ht->pDestructor) {
- ht->pDestructor(p->pData);
- }
- if (p->pData != &p->pDataPtr) {
- pefree(p->pData, ht->persistent);
- }
- retval = p->pListNext;
-
if (p->pLast) {
p->pLast->pNext = p->pNext;
} else {
@@ -608,9 +599,17 @@ static Bucket *zend_hash_apply_deleter(HashTable *ht, Bucket *p)
if (ht->pInternalPointer == p) {
ht->pInternalPointer = p->pListNext;
}
- pefree(p, ht->persistent);
- HANDLE_UNBLOCK_INTERRUPTIONS();
ht->nNumOfElements--;
+ HANDLE_UNBLOCK_INTERRUPTIONS();
+
+ if (ht->pDestructor) {
+ ht->pDestructor(p->pData);
+ }
+ if (p->pData != &p->pDataPtr) {
+ pefree(p->pData, ht->persistent);
+ }
+ retval = p->pListNext;
+ pefree(p, ht->persistent);
return retval;
}
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c
index c6572d3b8..d17abf22a 100644
--- a/Zend/zend_ini.c
+++ b/Zend/zend_ini.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_ini.c,v 1.39.2.2 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_ini.c,v 1.39.2.2.2.3 2006/09/06 08:54:44 dmitry Exp $ */
#include "zend.h"
#include "zend_qsort.h"
@@ -65,6 +65,12 @@ static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS
return 0;
}
+static int zend_restore_ini_entry_wrapper(zend_ini_entry **ini_entry TSRMLS_DC)
+{
+ zend_restore_ini_entry_cb(*ini_entry, ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC);
+ return 1;
+}
+
/*
* Startup / shutdown
*/
@@ -73,6 +79,7 @@ ZEND_API int zend_ini_startup(TSRMLS_D)
registered_zend_ini_directives = (HashTable *) malloc(sizeof(HashTable));
EG(ini_directives) = registered_zend_ini_directives;
+ EG(modified_ini_directives) = NULL;
if (zend_hash_init_ex(registered_zend_ini_directives, 100, NULL, NULL, 1, 0)==FAILURE) {
return FAILURE;
}
@@ -98,7 +105,12 @@ ZEND_API int zend_ini_global_shutdown(TSRMLS_D)
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);
+ if (EG(modified_ini_directives)) {
+ zend_hash_apply(EG(modified_ini_directives), (apply_func_t) zend_restore_ini_entry_wrapper TSRMLS_CC);
+ zend_hash_destroy(EG(modified_ini_directives));
+ FREE_HASHTABLE(EG(modified_ini_directives));
+ EG(modified_ini_directives) = NULL;
+ }
return SUCCESS;
}
@@ -108,6 +120,7 @@ ZEND_API int zend_copy_ini_directives(TSRMLS_D)
{
zend_ini_entry ini_entry;
+ EG(modified_ini_directives) = NULL;
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;
@@ -237,12 +250,17 @@ ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value,
if (!ini_entry->modified) {
ini_entry->orig_value = ini_entry->value;
ini_entry->orig_value_length = ini_entry->value_length;
+ ini_entry->modified = 1;
+ if (!EG(modified_ini_directives)) {
+ ALLOC_HASHTABLE(EG(modified_ini_directives));
+ zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0);
+ }
+ zend_hash_add(EG(modified_ini_directives), name, name_length, &ini_entry, sizeof(zend_ini_entry*), NULL);
} 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);
}
@@ -256,11 +274,16 @@ 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) {
+ if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==FAILURE ||
+ (stage == ZEND_INI_STAGE_RUNTIME && (ini_entry->modifiable & ZEND_INI_USER) == 0)) {
return FAILURE;
}
- zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC);
+ if (EG(modified_ini_directives)) {
+ zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC);
+ zend_hash_del(EG(modified_ini_directives), name, name_length);
+ }
+
return SUCCESS;
}
diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h
index 843f1078a..0880b9537 100644
--- a/Zend/zend_ini.h
+++ b/Zend/zend_ini.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_ini.h,v 1.34.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_ini.h,v 1.34.2.1.2.1 2006/09/19 20:33:12 dmitry Exp $ */
#ifndef ZEND_INI_H
#define ZEND_INI_H
@@ -193,6 +193,7 @@ END_EXTERN_C()
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);
+ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg);
END_EXTERN_C()
#define ZEND_INI_PARSER_ENTRY 1
diff --git a/Zend/zend_ini_parser.c b/Zend/zend_ini_parser.c
index 00cc274fa..f4dfc7499 100644
--- a/Zend/zend_ini_parser.c
+++ b/Zend/zend_ini_parser.c
@@ -116,7 +116,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_ini_parser.y,v 1.41.2.2 2006/04/12 09:51:54 dmitry Exp $ */
+/* $Id: zend_ini_parser.y,v 1.41.2.2.2.1 2006/09/19 20:33:12 dmitry Exp $ */
#define DEBUG_CFG_PARSER 0
#include "zend.h"
@@ -256,10 +256,14 @@ static void ini_error(char *str)
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);
+ if (currently_parsed_filename) {
+ 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));
+ sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno(TSRMLS_C));
+ } else {
+ error_buf = estrdup("Invalid configuration directive\n");
+ }
if (CG(ini_parser_unbuffered_errors)) {
#ifdef PHP_WIN32
@@ -301,6 +305,29 @@ ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_erro
}
+ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg)
+{
+ 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_prepare_string_for_scanning(str TSRMLS_CC)==FAILURE) {
+ return FAILURE;
+ }
+
+ CG(ini_parser_unbuffered_errors) = unbuffered_errors;
+
+ if (ini_parse(TSRMLS_C)) {
+ return SUCCESS;
+ } else {
+ return FAILURE;
+ }
+}
+
+
/* Enabling traces. */
@@ -625,9 +652,9 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 221, 221, 222, 226, 234, 242, 243, 244, 249,
- 250, 251, 252, 253, 258, 259, 260, 261, 262, 263,
- 267, 271, 272, 273, 274, 275, 276, 280
+ 0, 248, 248, 249, 253, 261, 269, 270, 271, 276,
+ 277, 278, 279, 280, 285, 286, 287, 288, 289, 290,
+ 294, 298, 299, 300, 301, 302, 303, 307
};
#endif
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y
index 6341c4812..1ec947d4f 100644
--- a/Zend/zend_ini_parser.y
+++ b/Zend/zend_ini_parser.y
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_ini_parser.y,v 1.41.2.2 2006/04/12 09:51:54 dmitry Exp $ */
+/* $Id: zend_ini_parser.y,v 1.41.2.2.2.1 2006/09/19 20:33:12 dmitry Exp $ */
#define DEBUG_CFG_PARSER 0
#include "zend.h"
@@ -157,10 +157,14 @@ static void ini_error(char *str)
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);
+ if (currently_parsed_filename) {
+ 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));
+ sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno(TSRMLS_C));
+ } else {
+ error_buf = estrdup("Invalid configuration directive\n");
+ }
if (CG(ini_parser_unbuffered_errors)) {
#ifdef PHP_WIN32
@@ -202,6 +206,29 @@ ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_erro
}
+ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg)
+{
+ 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_prepare_string_for_scanning(str TSRMLS_CC)==FAILURE) {
+ return FAILURE;
+ }
+
+ CG(ini_parser_unbuffered_errors) = unbuffered_errors;
+
+ if (ini_parse(TSRMLS_C)) {
+ return SUCCESS;
+ } else {
+ return FAILURE;
+ }
+}
+
+
%}
%pure_parser
diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c
index 276c9885a..5c0719d18 100644
--- a/Zend/zend_ini_scanner.c
+++ b/Zend/zend_ini_scanner.c
@@ -495,7 +495,7 @@ char *yytext;
+----------------------------------------------------------------------+
*/
-/* $Id: zend_ini_scanner.l,v 1.41.2.2 2006/01/17 19:56:25 iliaa Exp $ */
+/* $Id: zend_ini_scanner.l,v 1.41.2.2.2.1 2006/09/19 20:33:12 dmitry Exp $ */
#define yyleng SCNG(yy_leng)
#define yytext SCNG(yy_text)
@@ -561,6 +561,17 @@ int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC)
}
+int zend_ini_prepare_string_for_scanning(char *str TSRMLS_DC)
+{
+ int len = strlen(str);
+
+ yyin = NULL;
+ yy_scan_buffer(str, len + 2 TSRMLS_CC);
+ ini_filename = NULL;
+ return SUCCESS;
+}
+
+
void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC)
{
zend_stream_close(fh);
diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h
index 5fbf171ce..9be3a1530 100644
--- a/Zend/zend_ini_scanner.h
+++ b/Zend/zend_ini_scanner.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_ini_scanner.h,v 1.14.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_ini_scanner.h,v 1.14.2.1.2.1 2006/09/19 20:33:12 dmitry Exp $ */
#ifndef _ZEND_INI_SCANNER_H
#define _ZEND_INI_SCANNER_H
@@ -26,6 +26,7 @@ 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);
+int zend_ini_prepare_string_for_scanning(char *str TSRMLS_DC);
void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC);
int ini_lex(zval *ini_lval TSRMLS_DC);
END_EXTERN_C()
diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l
index 24414c32a..36fd8f947 100644
--- a/Zend/zend_ini_scanner.l
+++ b/Zend/zend_ini_scanner.l
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_ini_scanner.l,v 1.41.2.2 2006/01/17 19:56:25 iliaa Exp $ */
+/* $Id: zend_ini_scanner.l,v 1.41.2.2.2.1 2006/09/19 20:33:12 dmitry Exp $ */
#define yyleng SCNG(yy_leng)
#define yytext SCNG(yy_text)
@@ -83,6 +83,17 @@ int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC)
}
+int zend_ini_prepare_string_for_scanning(char *str TSRMLS_DC)
+{
+ int len = strlen(str);
+
+ yyin = NULL;
+ yy_scan_buffer(str, len + 2 TSRMLS_CC);
+ ini_filename = NULL;
+ return SUCCESS;
+}
+
+
void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC)
{
zend_stream_close(fh);
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c
index 7a1fa5892..3be8a56c5 100755
--- a/Zend/zend_interfaces.c
+++ b/Zend/zend_interfaces.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_interfaces.c,v 1.33.2.4 2006/04/10 22:49:29 helly Exp $ */
+/* $Id: zend_interfaces.c,v 1.33.2.4.2.4 2006/08/28 10:27:58 tony2001 Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -29,7 +29,7 @@ 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
+/* {{{ 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)
{
@@ -92,7 +92,9 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend
if (!obj_ce) {
obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL;
}
- zend_error(E_CORE_ERROR, "Couldn't execute method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name);
+ if (!EG(exception)) {
+ zend_error(E_CORE_ERROR, "Couldn't execute method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name);
+ }
}
if (!retval_ptr_ptr) {
if (retval) {
@@ -107,7 +109,7 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend
/* 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)
+ZEND_API zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS_DC)
{
zval *retval;
@@ -117,7 +119,7 @@ static zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS
/* }}} */
/* {{{ zend_user_it_dtor */
-static void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC)
+ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
@@ -141,14 +143,14 @@ static void zend_user_it_dtor(zend_object_iterator *_iter TSRMLS_DC)
/* }}} */
/* {{{ zend_user_it_valid */
-static int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC)
+ZEND_API 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);
@@ -161,7 +163,7 @@ static int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC)
/* }}} */
/* {{{ zend_user_it_get_current_data */
-static void zend_user_it_get_current_data(zend_object_iterator *_iter, zval ***data TSRMLS_DC)
+ZEND_API 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;
@@ -184,7 +186,7 @@ static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, cha
/* }}} */
/* {{{ 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_API 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;
@@ -200,8 +202,8 @@ static int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_
}
return HASH_KEY_IS_LONG;
}
- switch (retval->type) {
- default:
+ switch (Z_TYPE_P(retval)) {
+ default:
zend_error(E_WARNING, "Illegal type returned from %s::key()", iter->ce->name);
case IS_NULL:
*int_key = 0;
@@ -209,21 +211,20 @@ static int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_
return HASH_KEY_IS_LONG;
case IS_STRING:
- *str_key = estrndup(retval->value.str.val, retval->value.str.len);
- *str_key_len = retval->value.str.len+1;
+ *str_key = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
+ *str_key_len = Z_STRLEN_P(retval)+1;
zval_ptr_dtor(&retval);
return HASH_KEY_IS_STRING;
case IS_DOUBLE:
+ *int_key = (long)Z_DVAL_P(retval);
+ zval_ptr_dtor(&retval);
+ return HASH_KEY_IS_LONG;
+
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;
- }
- }
+ case IS_BOOL:
+ case IS_LONG:
+ *int_key = (long)Z_LVAL_P(retval);
zval_ptr_dtor(&retval);
return HASH_KEY_IS_LONG;
}
@@ -231,7 +232,7 @@ static int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_
/* }}} */
/* {{{ zend_user_it_move_forward */
-static void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC)
+ZEND_API 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;
@@ -242,7 +243,7 @@ static void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC)
/* }}} */
/* {{{ zend_user_it_rewind */
-static void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC)
+ZEND_API 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;
@@ -263,9 +264,15 @@ zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = {
};
/* {{{ zend_user_it_get_iterator */
-static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC)
+static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
{
- zend_user_iterator *iterator = emalloc(sizeof(zend_user_iterator));
+ zend_user_iterator *iterator;
+
+ if (by_ref) {
+ zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
+ }
+
+ iterator = emalloc(sizeof(zend_user_iterator));
object->refcount++;
iterator->it.data = (void*)object;
@@ -277,25 +284,24 @@ static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zva
/* }}} */
/* {{{ zend_user_it_get_new_iterator */
-static zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object TSRMLS_DC)
+ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref 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))
- {
+ if (!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 %s::getIterator() must be traversable or implement interface Iterator", ce ? ce->name : Z_OBJCE_P(object)->name);
}
- if (iterator)
- {
+ if (iterator) {
zval_ptr_dtor(&iterator);
}
return NULL;
}
- new_iterator = ce_it->get_iterator(ce_it, iterator TSRMLS_CC);
+
+ new_iterator = ce_it->get_iterator(ce_it, iterator, by_ref TSRMLS_CC);
zval_ptr_dtor(&iterator);
return new_iterator;
}
@@ -336,7 +342,7 @@ static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entr
} 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 < (int)class_type->num_interfaces; i++) {
+ for (i = 0; i < class_type->num_interfaces; i++) {
if (class_type->interfaces[i] == zend_ce_iterator) {
return FAILURE;
}
@@ -440,14 +446,14 @@ int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned ch
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 {
@@ -498,7 +504,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_get, 0, 0, 1) /* actually this
ZEND_END_ARG_INFO();
static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_value, 0, 0, 2)
+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();
@@ -518,7 +524,7 @@ 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)
+ ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR)
{NULL, NULL, NULL}
};
/* }}} */
@@ -544,9 +550,9 @@ ZEND_API void zend_register_interfaces(TSRMLS_D)
REGISTER_ITERATOR_INTERFACE(iterator, Iterator);
REGISTER_ITERATOR_IMPLEMENT(iterator, traversable);
-
+
REGISTER_ITERATOR_INTERFACE(arrayaccess, ArrayAccess);
-
+
REGISTER_ITERATOR_INTERFACE(serializable, Serializable)
}
/* }}} */
diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h
index 24e9f3c24..1b69c43d2 100755
--- a/Zend/zend_interfaces.h
+++ b/Zend/zend_interfaces.h
@@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 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 |
+ | 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 |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_interfaces.h,v 1.11.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_interfaces.h,v 1.11.2.1.2.1 2006/05/11 08:11:45 helly Exp $ */
#ifndef ZEND_INTERFACES_H
#define ZEND_INTERFACES_H
@@ -49,6 +49,16 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend
#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_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC);
+ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC);
+ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
+ZEND_API void zend_user_it_get_current_data(zend_object_iterator *_iter, zval ***data TSRMLS_DC);
+ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC);
+ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC);
+
+ZEND_API zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS_DC);
+ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+
ZEND_API void zend_register_interfaces(TSRMLS_D);
END_EXTERN_C()
diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c
index a0349d427..eef5e6b05 100755
--- a/Zend/zend_iterators.c
+++ b/Zend/zend_iterators.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_iterators.c,v 1.12.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_iterators.c,v 1.12.2.1.2.1 2006/05/09 23:53:23 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -64,11 +64,11 @@ static void iter_wrapper_dtor(void *object, zend_object_handle handle TSRMLS_DC)
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;
+ Z_OBJ_HANDLE_P(wrapped) = zend_objects_store_put(iter, iter_wrapper_dtor, NULL, NULL TSRMLS_CC);
+ Z_OBJ_HT_P(wrapped) = &iterator_object_handlers;
return wrapped;
}
@@ -86,14 +86,13 @@ ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap(
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;
}
diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h
index b8a68296b..264130eb9 100755
--- a/Zend/zend_iterators.h
+++ b/Zend/zend_iterators.h
@@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 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 |
+ | 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 |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_iterators.h,v 1.10.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_iterators.h,v 1.10.2.1.2.1 2006/05/09 23:53:23 helly Exp $ */
/* These iterators were designed to operate within the foreach()
* structures provided by the engine, but could be extended for use
@@ -31,7 +31,7 @@ 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);
@@ -46,7 +46,7 @@ typedef struct _zend_object_iterator_funcs {
/* 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;
@@ -57,11 +57,8 @@ struct _zend_object_iterator {
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;
diff --git a/Zend/zend_language_parser.c b/Zend/zend_language_parser.c
index 35f0e6523..154f71c47 100644
--- a/Zend/zend_language_parser.c
+++ b/Zend/zend_language_parser.c
@@ -327,7 +327,7 @@
| Copyright (c) 1998-2006 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 |
+ | 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 |
@@ -339,15 +339,15 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_language_parser.y,v 1.160.2.4 2006/03/12 16:52:18 iliaa Exp $ */
+/* $Id: zend_language_parser.y,v 1.160.2.4.2.1 2006/05/11 21:07:39 helly Exp $ */
-/*
+/*
* 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 arrays within encapsulated strings. Solved by shift.
* - 1 shift/reduce conflict due to objects within encapsulated strings. Solved by shift.
- *
+ *
*/
@@ -3564,42 +3564,42 @@ yyreduce:
case 141:
- { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(2) - (2)]), 0 TSRMLS_CC); (yyval).op_type = IS_CONST; (yyval).u.constant.value.lval=1; (yyval).u.constant.type=IS_LONG; INIT_PZVAL(&(yyval).u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &(yyval), NULL, &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]), 0 TSRMLS_CC); }
+ { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(2) - (2)]), 0 TSRMLS_CC); (yyval).op_type = IS_CONST; Z_LVAL((yyval).u.constant)=1; Z_TYPE((yyval).u.constant)=IS_LONG; INIT_PZVAL(&(yyval).u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &(yyval), NULL, &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]), 0 TSRMLS_CC); }
break;
case 142:
- { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(3) - (3)]), 0 TSRMLS_CC); (yyval).op_type = IS_CONST; (yyval).u.constant.value.lval=1; (yyval).u.constant.type=IS_LONG; INIT_PZVAL(&(yyval).u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &(yyval), NULL, &(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), 1 TSRMLS_CC); }
+ { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(3) - (3)]), 0 TSRMLS_CC); (yyval).op_type = IS_CONST; Z_LVAL((yyval).u.constant)=1; Z_TYPE((yyval).u.constant)=IS_LONG; INIT_PZVAL(&(yyval).u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &(yyval), NULL, &(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), 1 TSRMLS_CC); }
break;
case 143:
- { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(3) - (5)]), 0 TSRMLS_CC); (yyval).op_type = IS_CONST; (yyval).u.constant.value.lval=1; (yyval).u.constant.type=IS_LONG; INIT_PZVAL(&(yyval).u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &(yyval), &(yyvsp[(5) - (5)]), &(yyvsp[(1) - (5)]), &(yyvsp[(3) - (5)]), 1 TSRMLS_CC); }
+ { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(3) - (5)]), 0 TSRMLS_CC); (yyval).op_type = IS_CONST; Z_LVAL((yyval).u.constant)=1; Z_TYPE((yyval).u.constant)=IS_LONG; INIT_PZVAL(&(yyval).u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &(yyval), &(yyvsp[(5) - (5)]), &(yyvsp[(1) - (5)]), &(yyvsp[(3) - (5)]), 1 TSRMLS_CC); }
break;
case 144:
- { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(2) - (4)]), 0 TSRMLS_CC); (yyval).op_type = IS_CONST; (yyval).u.constant.value.lval=1; (yyval).u.constant.type=IS_LONG; INIT_PZVAL(&(yyval).u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &(yyval), &(yyvsp[(4) - (4)]), &(yyvsp[(1) - (4)]), &(yyvsp[(2) - (4)]), 0 TSRMLS_CC); }
+ { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(2) - (4)]), 0 TSRMLS_CC); (yyval).op_type = IS_CONST; Z_LVAL((yyval).u.constant)=1; Z_TYPE((yyval).u.constant)=IS_LONG; INIT_PZVAL(&(yyval).u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &(yyval), &(yyvsp[(4) - (4)]), &(yyvsp[(1) - (4)]), &(yyvsp[(2) - (4)]), 0 TSRMLS_CC); }
break;
case 145:
- { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(4) - (4)]), 0 TSRMLS_CC); (yyval)=(yyvsp[(1) - (4)]); (yyval).u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &(yyval), NULL, &(yyvsp[(3) - (4)]), &(yyvsp[(4) - (4)]), 0 TSRMLS_CC); }
+ { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(4) - (4)]), 0 TSRMLS_CC); (yyval)=(yyvsp[(1) - (4)]); Z_LVAL((yyval).u.constant)++; zend_do_receive_arg(ZEND_RECV, &tmp, &(yyval), NULL, &(yyvsp[(3) - (4)]), &(yyvsp[(4) - (4)]), 0 TSRMLS_CC); }
break;
case 146:
- { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(5) - (5)]), 0 TSRMLS_CC); (yyval)=(yyvsp[(1) - (5)]); (yyval).u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &(yyval), NULL, &(yyvsp[(3) - (5)]), &(yyvsp[(5) - (5)]), 1 TSRMLS_CC); }
+ { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(5) - (5)]), 0 TSRMLS_CC); (yyval)=(yyvsp[(1) - (5)]); Z_LVAL((yyval).u.constant)++; zend_do_receive_arg(ZEND_RECV, &tmp, &(yyval), NULL, &(yyvsp[(3) - (5)]), &(yyvsp[(5) - (5)]), 1 TSRMLS_CC); }
break;
case 147:
- { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(5) - (7)]), 0 TSRMLS_CC); (yyval)=(yyvsp[(1) - (7)]); (yyval).u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &(yyval), &(yyvsp[(7) - (7)]), &(yyvsp[(3) - (7)]), &(yyvsp[(5) - (7)]), 1 TSRMLS_CC); }
+ { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(5) - (7)]), 0 TSRMLS_CC); (yyval)=(yyvsp[(1) - (7)]); Z_LVAL((yyval).u.constant)++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &(yyval), &(yyvsp[(7) - (7)]), &(yyvsp[(3) - (7)]), &(yyvsp[(5) - (7)]), 1 TSRMLS_CC); }
break;
case 148:
- { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(4) - (6)]), 0 TSRMLS_CC); (yyval)=(yyvsp[(1) - (6)]); (yyval).u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &(yyval), &(yyvsp[(6) - (6)]), &(yyvsp[(3) - (6)]), &(yyvsp[(4) - (6)]), 0 TSRMLS_CC); }
+ { znode tmp; fetch_simple_variable(&tmp, &(yyvsp[(4) - (6)]), 0 TSRMLS_CC); (yyval)=(yyvsp[(1) - (6)]); Z_LVAL((yyval).u.constant)++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &(yyval), &(yyvsp[(6) - (6)]), &(yyvsp[(3) - (6)]), &(yyvsp[(4) - (6)]), 0 TSRMLS_CC); }
break;
case 149:
@@ -3614,7 +3614,7 @@ yyreduce:
case 151:
- { (yyval).op_type = IS_CONST; (yyval).u.constant.type=IS_NULL;}
+ { (yyval).op_type = IS_CONST; Z_TYPE((yyval).u.constant)=IS_NULL;}
break;
case 152:
@@ -3624,37 +3624,37 @@ yyreduce:
case 153:
- { (yyval).u.constant.value.lval = 0; }
+ { Z_LVAL((yyval).u.constant) = 0; }
break;
case 154:
- { (yyval).u.constant.value.lval = 1; zend_do_pass_param(&(yyvsp[(1) - (1)]), ZEND_SEND_VAL, (yyval).u.constant.value.lval TSRMLS_CC); }
+ { Z_LVAL((yyval).u.constant) = 1; zend_do_pass_param(&(yyvsp[(1) - (1)]), ZEND_SEND_VAL, Z_LVAL((yyval).u.constant) TSRMLS_CC); }
break;
case 155:
- { (yyval).u.constant.value.lval = 1; zend_do_pass_param(&(yyvsp[(1) - (1)]), ZEND_SEND_VAR, (yyval).u.constant.value.lval TSRMLS_CC); }
+ { Z_LVAL((yyval).u.constant) = 1; zend_do_pass_param(&(yyvsp[(1) - (1)]), ZEND_SEND_VAR, Z_LVAL((yyval).u.constant) TSRMLS_CC); }
break;
case 156:
- { (yyval).u.constant.value.lval = 1; zend_do_pass_param(&(yyvsp[(2) - (2)]), ZEND_SEND_REF, (yyval).u.constant.value.lval TSRMLS_CC); }
+ { Z_LVAL((yyval).u.constant) = 1; zend_do_pass_param(&(yyvsp[(2) - (2)]), ZEND_SEND_REF, Z_LVAL((yyval).u.constant) TSRMLS_CC); }
break;
case 157:
- { (yyval).u.constant.value.lval=(yyvsp[(1) - (3)]).u.constant.value.lval+1; zend_do_pass_param(&(yyvsp[(3) - (3)]), ZEND_SEND_VAL, (yyval).u.constant.value.lval TSRMLS_CC); }
+ { Z_LVAL((yyval).u.constant)=Z_LVAL((yyvsp[(1) - (3)]).u.constant)+1; zend_do_pass_param(&(yyvsp[(3) - (3)]), ZEND_SEND_VAL, Z_LVAL((yyval).u.constant) TSRMLS_CC); }
break;
case 158:
- { (yyval).u.constant.value.lval=(yyvsp[(1) - (3)]).u.constant.value.lval+1; zend_do_pass_param(&(yyvsp[(3) - (3)]), ZEND_SEND_VAR, (yyval).u.constant.value.lval TSRMLS_CC); }
+ { Z_LVAL((yyval).u.constant)=Z_LVAL((yyvsp[(1) - (3)]).u.constant)+1; zend_do_pass_param(&(yyvsp[(3) - (3)]), ZEND_SEND_VAR, Z_LVAL((yyval).u.constant) TSRMLS_CC); }
break;
case 159:
- { (yyval).u.constant.value.lval=(yyvsp[(1) - (4)]).u.constant.value.lval+1; zend_do_pass_param(&(yyvsp[(4) - (4)]), ZEND_SEND_REF, (yyval).u.constant.value.lval TSRMLS_CC); }
+ { Z_LVAL((yyval).u.constant)=Z_LVAL((yyvsp[(1) - (4)]).u.constant)+1; zend_do_pass_param(&(yyvsp[(4) - (4)]), ZEND_SEND_REF, Z_LVAL((yyval).u.constant) TSRMLS_CC); }
break;
case 160:
@@ -3704,7 +3704,7 @@ yyreduce:
case 171:
- { CG(access_type) = (yyvsp[(1) - (1)]).u.constant.value.lval; }
+ { CG(access_type) = Z_LVAL((yyvsp[(1) - (1)]).u.constant); }
break;
case 174:
@@ -3724,12 +3724,12 @@ yyreduce:
case 177:
- { (yyval).u.constant.value.lval = ZEND_ACC_ABSTRACT; }
+ { Z_LVAL((yyval).u.constant) = ZEND_ACC_ABSTRACT; }
break;
case 178:
- { (yyval).u.constant.value.lval = 0; }
+ { Z_LVAL((yyval).u.constant) = 0; }
break;
case 179:
@@ -3739,17 +3739,17 @@ yyreduce:
case 180:
- { (yyval).u.constant.value.lval = ZEND_ACC_PUBLIC; }
+ { Z_LVAL((yyval).u.constant) = ZEND_ACC_PUBLIC; }
break;
case 181:
- { (yyval).u.constant.value.lval = ZEND_ACC_PUBLIC; }
+ { Z_LVAL((yyval).u.constant) = ZEND_ACC_PUBLIC; }
break;
case 182:
- { (yyval) = (yyvsp[(1) - (1)]); if (!((yyval).u.constant.value.lval & ZEND_ACC_PPP_MASK)) { (yyval).u.constant.value.lval |= ZEND_ACC_PUBLIC; } }
+ { (yyval) = (yyvsp[(1) - (1)]); if (!(Z_LVAL((yyval).u.constant) & ZEND_ACC_PPP_MASK)) { Z_LVAL((yyval).u.constant) |= ZEND_ACC_PUBLIC; } }
break;
case 183:
@@ -3759,37 +3759,37 @@ yyreduce:
case 184:
- { (yyval).u.constant.value.lval = zend_do_verify_access_types(&(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)])); }
+ { Z_LVAL((yyval).u.constant) = zend_do_verify_access_types(&(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)])); }
break;
case 185:
- { (yyval).u.constant.value.lval = ZEND_ACC_PUBLIC; }
+ { Z_LVAL((yyval).u.constant) = ZEND_ACC_PUBLIC; }
break;
case 186:
- { (yyval).u.constant.value.lval = ZEND_ACC_PROTECTED; }
+ { Z_LVAL((yyval).u.constant) = ZEND_ACC_PROTECTED; }
break;
case 187:
- { (yyval).u.constant.value.lval = ZEND_ACC_PRIVATE; }
+ { Z_LVAL((yyval).u.constant) = ZEND_ACC_PRIVATE; }
break;
case 188:
- { (yyval).u.constant.value.lval = ZEND_ACC_STATIC; }
+ { Z_LVAL((yyval).u.constant) = ZEND_ACC_STATIC; }
break;
case 189:
- { (yyval).u.constant.value.lval = ZEND_ACC_ABSTRACT; }
+ { Z_LVAL((yyval).u.constant) = ZEND_ACC_ABSTRACT; }
break;
case 190:
- { (yyval).u.constant.value.lval = ZEND_ACC_FINAL; }
+ { Z_LVAL((yyval).u.constant) = ZEND_ACC_FINAL; }
break;
case 191:
@@ -3834,7 +3834,7 @@ yyreduce:
case 199:
- { (yyval).op_type = IS_CONST; (yyval).u.constant.type = IS_BOOL; (yyval).u.constant.value.lval = 1; }
+ { (yyval).op_type = IS_CONST; Z_TYPE((yyval).u.constant) = IS_BOOL; Z_LVAL((yyval).u.constant) = 1; }
break;
case 200:
@@ -4079,12 +4079,12 @@ yyreduce:
case 248:
- { (yyvsp[(1) - (2)]).u.constant.value.lval=0; (yyvsp[(1) - (2)]).u.constant.type=IS_LONG; (yyvsp[(1) - (2)]).op_type = IS_CONST; INIT_PZVAL(&(yyvsp[(1) - (2)]).u.constant); zend_do_binary_op(ZEND_ADD, &(yyval), &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); }
+ { Z_LVAL((yyvsp[(1) - (2)]).u.constant)=0; Z_TYPE((yyvsp[(1) - (2)]).u.constant)=IS_LONG; (yyvsp[(1) - (2)]).op_type = IS_CONST; INIT_PZVAL(&(yyvsp[(1) - (2)]).u.constant); zend_do_binary_op(ZEND_ADD, &(yyval), &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); }
break;
case 249:
- { (yyvsp[(1) - (2)]).u.constant.value.lval=0; (yyvsp[(1) - (2)]).u.constant.type=IS_LONG; (yyvsp[(1) - (2)]).op_type = IS_CONST; INIT_PZVAL(&(yyvsp[(1) - (2)]).u.constant); zend_do_binary_op(ZEND_SUB, &(yyval), &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); }
+ { Z_LVAL((yyvsp[(1) - (2)]).u.constant)=0; Z_TYPE((yyvsp[(1) - (2)]).u.constant)=IS_LONG; (yyvsp[(1) - (2)]).op_type = IS_CONST; INIT_PZVAL(&(yyvsp[(1) - (2)]).u.constant); zend_do_binary_op(ZEND_SUB, &(yyval), &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); }
break;
case 250:
@@ -4334,7 +4334,7 @@ yyreduce:
case 301:
- { (yyval).u.constant.value.lval=0; }
+ { Z_LVAL((yyval).u.constant)=0; }
break;
case 302:
@@ -4399,12 +4399,12 @@ yyreduce:
case 314:
- { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&(yyvsp[(2) - (2)]).u.constant, &(yyvsp[(2) - (2)]).u.constant, &minus_one TSRMLS_CC); (yyval) = (yyvsp[(2) - (2)]); }
+ { zval minus_one; Z_TYPE(minus_one) = IS_LONG; Z_LVAL(minus_one) = -1; mul_function(&(yyvsp[(2) - (2)]).u.constant, &(yyvsp[(2) - (2)]).u.constant, &minus_one TSRMLS_CC); (yyval) = (yyvsp[(2) - (2)]); }
break;
case 315:
- { (yyval) = (yyvsp[(3) - (4)]); (yyval).u.constant.type = IS_CONSTANT_ARRAY; }
+ { (yyval) = (yyvsp[(3) - (4)]); Z_TYPE((yyval).u.constant) = IS_CONSTANT_ARRAY; }
break;
case 316:
@@ -4690,12 +4690,12 @@ yyreduce:
case 374:
- { (yyval).u.constant.value.lval = 1; }
+ { Z_LVAL((yyval).u.constant) = 1; }
break;
case 375:
- { (yyval).u.constant.value.lval++; }
+ { Z_LVAL((yyval).u.constant)++; }
break;
case 378:
@@ -4800,27 +4800,27 @@ yyreduce:
case 398:
- { (yyvsp[(2) - (2)]).u.constant.value.lval = (long) '['; zend_do_add_char(&(yyval), &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); }
+ { Z_LVAL((yyvsp[(2) - (2)]).u.constant) = (long) '['; zend_do_add_char(&(yyval), &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); }
break;
case 399:
- { (yyvsp[(2) - (2)]).u.constant.value.lval = (long) ']'; zend_do_add_char(&(yyval), &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); }
+ { Z_LVAL((yyvsp[(2) - (2)]).u.constant) = (long) ']'; zend_do_add_char(&(yyval), &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); }
break;
case 400:
- { (yyvsp[(2) - (2)]).u.constant.value.lval = (long) '{'; zend_do_add_char(&(yyval), &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); }
+ { Z_LVAL((yyvsp[(2) - (2)]).u.constant) = (long) '{'; zend_do_add_char(&(yyval), &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); }
break;
case 401:
- { (yyvsp[(2) - (2)]).u.constant.value.lval = (long) '}'; zend_do_add_char(&(yyval), &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); }
+ { Z_LVAL((yyvsp[(2) - (2)]).u.constant) = (long) '}'; zend_do_add_char(&(yyval), &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); }
break;
case 402:
- { znode tmp; (yyvsp[(2) - (2)]).u.constant.value.lval = (long) '-'; zend_do_add_char(&tmp, &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); (yyvsp[(2) - (2)]).u.constant.value.lval = (long) '>'; zend_do_add_char(&(yyval), &tmp, &(yyvsp[(2) - (2)]) TSRMLS_CC); }
+ { znode tmp; Z_LVAL((yyvsp[(2) - (2)]).u.constant) = (long) '-'; zend_do_add_char(&tmp, &(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]) TSRMLS_CC); Z_LVAL((yyvsp[(2) - (2)]).u.constant) = (long) '>'; zend_do_add_char(&(yyval), &tmp, &(yyvsp[(2) - (2)]) TSRMLS_CC); }
break;
case 403:
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 9c654e625..2273637a7 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -6,7 +6,7 @@
| Copyright (c) 1998-2006 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 |
+ | 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 |
@@ -18,15 +18,15 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_language_parser.y,v 1.160.2.4 2006/03/12 16:52:18 iliaa Exp $ */
+/* $Id: zend_language_parser.y,v 1.160.2.4.2.1 2006/05/11 21:07:39 helly Exp $ */
-/*
+/*
* 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 arrays within encapsulated strings. Solved by shift.
* - 1 shift/reduce conflict due to objects within encapsulated strings. Solved by shift.
- *
+ *
*/
@@ -190,7 +190,7 @@ unticked_statement:
| 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
+ | T_FOR
'('
for_expr
';' { zend_do_free(&$3 TSRMLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); }
@@ -214,13 +214,13 @@ unticked_statement:
| 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); }
+ | 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); }
+ | 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 */
@@ -243,7 +243,7 @@ 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); }
@@ -287,13 +287,13 @@ unticked_function_declaration_statement:
unticked_class_declaration_statement:
class_entry_type T_STRING extends_from
- { zend_do_begin_class_declaration(&$1, &$2, &$3 TSRMLS_CC); }
+ { 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); }
+ { zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); }
interface_extends_list
'{'
class_statement_list
@@ -418,44 +418,44 @@ new_else_single:
;
-parameter_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 T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=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; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=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; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=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; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=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; Z_LVAL($$.u.constant)++; 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; Z_LVAL($$.u.constant)++; 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; Z_LVAL($$.u.constant)++; 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; Z_LVAL($$.u.constant)++; 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;}
+ | T_ARRAY { $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_NULL;}
;
function_call_parameter_list:
non_empty_function_call_parameter_list { $$ = $1; }
- | /* empty */ { $$.u.constant.value.lval = 0; }
+ | /* empty */ { Z_LVAL($$.u.constant) = 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); }
+ expr_without_variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$1, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); }
+ | variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$1, ZEND_SEND_VAR, Z_LVAL($$.u.constant) TSRMLS_CC); }
+ | '&' w_variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$2, ZEND_SEND_REF, Z_LVAL($$.u.constant) TSRMLS_CC); }
+ | non_empty_function_call_parameter_list ',' expr_without_variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$3, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); }
+ | non_empty_function_call_parameter_list ',' variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$3, ZEND_SEND_VAR, Z_LVAL($$.u.constant) TSRMLS_CC); }
+ | non_empty_function_call_parameter_list ',' '&' w_variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$4, ZEND_SEND_REF, Z_LVAL($$.u.constant) TSRMLS_CC); }
;
global_var_list:
@@ -487,40 +487,40 @@ class_statement_list:
class_statement:
- variable_modifiers { CG(access_type) = $1.u.constant.value.lval; } class_variable_declaration ';'
+ variable_modifiers { CG(access_type) = Z_LVAL($1.u.constant); } 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); } '('
+ | 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; }
+ ';' /* abstract method */ { Z_LVAL($$.u.constant) = ZEND_ACC_ABSTRACT; }
+ | '{' inner_statement_list '}' { Z_LVAL($$.u.constant) = 0; }
;
variable_modifiers:
non_empty_member_modifiers { $$ = $1; }
- | T_VAR { $$.u.constant.value.lval = ZEND_ACC_PUBLIC; }
+ | T_VAR { Z_LVAL($$.u.constant) = 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; } }
+ /* empty */ { Z_LVAL($$.u.constant) = ZEND_ACC_PUBLIC; }
+ | non_empty_member_modifiers { $$ = $1; if (!(Z_LVAL($$.u.constant) & ZEND_ACC_PPP_MASK)) { Z_LVAL($$.u.constant) |= 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); }
+ | non_empty_member_modifiers member_modifier { Z_LVAL($$.u.constant) = 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; }
+ T_PUBLIC { Z_LVAL($$.u.constant) = ZEND_ACC_PUBLIC; }
+ | T_PROTECTED { Z_LVAL($$.u.constant) = ZEND_ACC_PROTECTED; }
+ | T_PRIVATE { Z_LVAL($$.u.constant) = ZEND_ACC_PRIVATE; }
+ | T_STATIC { Z_LVAL($$.u.constant) = ZEND_ACC_STATIC; }
+ | T_ABSTRACT { Z_LVAL($$.u.constant) = ZEND_ACC_ABSTRACT; }
+ | T_FINAL { Z_LVAL($$.u.constant) = ZEND_ACC_FINAL; }
;
class_variable_declaration:
@@ -535,14 +535,14 @@ class_constant_declaration:
| T_CONST T_STRING '=' static_scalar { zend_do_declare_class_constant(&$2, &$4 TSRMLS_CC); }
;
-echo_expr_list:
+echo_expr_list:
echo_expr_list ',' expr { zend_do_echo(&$3 TSRMLS_CC); }
| expr { zend_do_echo(&$1 TSRMLS_CC); }
;
for_expr:
- /* empty */ { $$.op_type = IS_CONST; $$.u.constant.type = IS_BOOL; $$.u.constant.value.lval = 1; }
+ /* empty */ { $$.op_type = IS_CONST; Z_TYPE($$.u.constant) = IS_BOOL; Z_LVAL($$.u.constant) = 1; }
| non_empty_for_expr { $$ = $1; }
;
@@ -551,7 +551,7 @@ non_empty_for_expr:
| expr { $$ = $1; }
;
-expr_without_variable:
+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); }
@@ -567,14 +567,14 @@ expr_without_variable:
| 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); }
+ | 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_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); }
@@ -589,8 +589,8 @@ expr_without_variable:
| 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 { Z_LVAL($1.u.constant)=0; Z_TYPE($1.u.constant)=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_ADD, &$$, &$1, &$2 TSRMLS_CC); }
+ | '-' expr { Z_LVAL($1.u.constant)=0; Z_TYPE($1.u.constant)=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); }
@@ -609,7 +609,7 @@ expr_without_variable:
| 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_STRING_CAST expr { zend_do_cast(&$$, &$2, 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); }
@@ -618,7 +618,7 @@ expr_without_variable:
| '@' { 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); }
+ | '`' encaps_list '`' { zend_do_shell_exec(&$$, &$2 TSRMLS_CC); }
| T_PRINT expr { zend_do_print(&$$, &$2 TSRMLS_CC); }
;
@@ -626,11 +626,11 @@ 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
+ | 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
+ | 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 ')'
@@ -666,14 +666,14 @@ dynamic_class_name_variable_property:
;
exit_expr:
- /* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
- | '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
+ /* 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; }
+ /* empty */ { Z_LVAL($$.u.constant)=0; }
| '(' function_call_parameter_list ')' { $$ = $2; }
;
@@ -694,8 +694,8 @@ 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_scalar { zval minus_one; Z_TYPE(minus_one) = IS_LONG; Z_LVAL(minus_one) = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one TSRMLS_CC); $$ = $2; }
+ | T_ARRAY '(' static_array_pair_list ')' { $$ = $3; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
| static_class_constant { $$ = $1; }
;
@@ -771,7 +771,7 @@ variable_property:
method_or_not:
'(' { zend_do_pop_object(&$1 TSRMLS_CC); zend_do_begin_method_call(&$1 TSRMLS_CC); }
- function_call_parameter_list ')'
+ 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; }
@@ -798,13 +798,13 @@ base_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; }
@@ -834,8 +834,8 @@ variable_name:
;
simple_indirect_reference:
- '$' { $$.u.constant.value.lval = 1; }
- | simple_indirect_reference '$' { $$.u.constant.value.lval++; }
+ '$' { Z_LVAL($$.u.constant) = 1; }
+ | simple_indirect_reference '$' { Z_LVAL($$.u.constant)++; }
;
assignment_list:
@@ -874,11 +874,11 @@ encaps_list:
| 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); }
+ | encaps_list '[' { Z_LVAL($2.u.constant) = (long) '['; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); }
+ | encaps_list ']' { Z_LVAL($2.u.constant) = (long) ']'; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); }
+ | encaps_list '{' { Z_LVAL($2.u.constant) = (long) '{'; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); }
+ | encaps_list '}' { Z_LVAL($2.u.constant) = (long) '}'; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); }
+ | encaps_list T_OBJECT_OPERATOR { znode tmp; Z_LVAL($2.u.constant) = (long) '-'; zend_do_add_char(&tmp, &$1, &$2 TSRMLS_CC); Z_LVAL($2.u.constant) = (long) '>'; zend_do_add_char(&$$, &tmp, &$2 TSRMLS_CC); }
| /* empty */ { zend_do_init_string(&$$ TSRMLS_CC); }
;
@@ -915,7 +915,7 @@ internal_functions_in_yacc:
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); }
diff --git a/Zend/zend_mm.c b/Zend/zend_mm.c
index 532e863ea..562e6c8d1 100644
--- a/Zend/zend_mm.c
+++ b/Zend/zend_mm.c
@@ -17,8 +17,8 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_mm.c,v 1.31.2.1 2006/01/04 23:53:04 andi Exp $ */
-
+/* $Id: zend_mm.c,v 1.31.2.1.2.1 2006/07/18 09:06:33 dmitry Exp $ */
+#if 0
#include "zend.h"
#include "zend_mm.h"
@@ -465,7 +465,7 @@ void *zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size)
return p;
}
-
+#endif
/*
* Local variables:
* tab-width: 4
diff --git a/Zend/zend_mm.h b/Zend/zend_mm.h
index 9a09c278b..6403807df 100644
--- a/Zend/zend_mm.h
+++ b/Zend/zend_mm.h
@@ -17,8 +17,8 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_mm.h,v 1.19.2.1 2006/01/04 23:53:04 andi Exp $ */
-
+/* $Id: zend_mm.h,v 1.19.2.1.2.1 2006/07/18 09:06:33 dmitry Exp $ */
+#if 0
#ifndef _ZEND_MM_H
#define _ZEND_MM_H
@@ -75,7 +75,7 @@ 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 */
-
+#endif
/*
* Local variables:
* tab-width: 4
diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h
index a5e7d597d..3532fe2c3 100644
--- a/Zend/zend_modules.h
+++ b/Zend/zend_modules.h
@@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 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 |
+ | 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 |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_modules.h,v 1.67.2.3 2006/04/06 21:10:45 andrei Exp $ */
+/* $Id: zend_modules.h,v 1.67.2.3.2.3 2006/06/22 21:24:23 tony2001 Exp $ */
#ifndef MODULES_H
#define MODULES_H
@@ -39,7 +39,7 @@ extern struct _zend_arg_info fourth_arg_force_ref[5];
extern struct _zend_arg_info fifth_arg_force_ref[6];
extern struct _zend_arg_info all_args_by_ref[1];
-#define ZEND_MODULE_API_NO 20050922
+#define ZEND_MODULE_API_NO 20060613
#ifdef ZTS
#define USING_ZTS 1
#else
@@ -52,10 +52,18 @@ extern struct _zend_arg_info all_args_by_ref[1];
#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_EX 0, 0, NULL, 0
+
+#define NO_MODULE_GLOBALS 0, NULL, NULL, NULL
+
+#ifdef ZTS
+# define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals_id
+#else
+# define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals
+#endif
#define STANDARD_MODULE_PROPERTIES \
- NULL, STANDARD_MODULE_PROPERTIES_EX
+ NO_MODULE_GLOBALS, NULL, STANDARD_MODULE_PROPERTIES_EX
#define NO_VERSION_YET NULL
@@ -81,8 +89,15 @@ struct _zend_module_entry {
int (*request_shutdown_func)(SHUTDOWN_FUNC_ARGS);
void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS);
char *version;
+ size_t globals_size;
+#ifdef ZTS
+ ts_rsrc_id* globals_id_ptr;
+#else
+ void* globals_ptr;
+#endif
+ void (*globals_ctor)(void *global TSRMLS_DC);
+ void (*globals_dtor)(void *global TSRMLS_DC);
int (*post_deactivate_func)(void);
- int globals_id;
int module_started;
unsigned char type;
void *handle;
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 564d1051d..765403381 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_object_handlers.c,v 1.135.2.6 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_object_handlers.c,v 1.135.2.6.2.15 2006/09/12 11:01:16 dmitry Exp $ */
#include "zend.h"
#include "zend_globals.h"
@@ -46,7 +46,7 @@
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.
+ called, we cal __call handler.
*/
static HashTable *zend_std_get_properties(zval *object TSRMLS_DC)
@@ -60,13 +60,13 @@ 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);
@@ -112,11 +112,11 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_D
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);
@@ -128,13 +128,13 @@ 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);
@@ -150,7 +150,7 @@ static int zend_verify_property_access(zend_property_info *property_info, zend_c
case ZEND_ACC_PUBLIC:
return 1;
case ZEND_ACC_PROTECTED:
- return zend_check_protected(ce, EG(scope));
+ return zend_check_protected(property_info->ce, EG(scope));
case ZEND_ACC_PRIVATE:
if (ce==EG(scope) && EG(scope)) {
return 1;
@@ -190,7 +190,7 @@ ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce
zend_error(E_ERROR, "Cannot access property started with '\\0'");
}
}
- return NULL;
+ return NULL;
}
h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
if (zend_hash_quick_find(&ce->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &property_info)==SUCCESS) {
@@ -238,19 +238,20 @@ ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce
EG(std_property_info).name = Z_STRVAL_P(member);
EG(std_property_info).name_length = Z_STRLEN_P(member);
EG(std_property_info).h = h;
+ EG(std_property_info).ce = ce;
property_info = &EG(std_property_info);
}
return property_info;
}
-ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name TSRMLS_DC)
+ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name, int prop_info_name_len TSRMLS_DC)
{
zend_property_info *property_info;
char *class_name, *prop_name;
zval member;
- zend_unmangle_property_name(prop_info_name, &class_name, &prop_name);
+ zend_unmangle_property_name(prop_info_name, prop_info_name_len, &class_name, &prop_name);
ZVAL_STRING(&member, prop_name, 0);
property_info = zend_get_property_info(zobj->ce, &member, 1 TSRMLS_CC);
if (!property_info) {
@@ -333,8 +334,20 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC)
if (rv) {
retval = &rv;
+ if ((type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) && rv->refcount > 0) {
+ zval *tmp = rv;
+
+ ALLOC_ZVAL(rv);
+ *rv = *tmp;
+ zval_copy_ctor(rv);
+ rv->is_ref = 0;
+ rv->refcount = 0;
+ if (Z_TYPE_P(rv) != IS_OBJECT) {
+ zend_error(E_NOTICE, "Indirect modification of overloaded property %s::$%s has no effect", zobj->ce->name, Z_STRVAL_P(member));
+ }
+ }
} else {
- retval = &EG(uninitialized_zval_ptr);
+ retval = &EG(uninitialized_zval_ptr);
}
} else {
if (!silent) {
@@ -357,7 +370,6 @@ static void zend_std_write_property(zval *object, zval *member, zval *value TSRM
zend_object *zobj;
zval *tmp_member = NULL;
zval **variable_ptr;
- int setter_done = 0;
zend_property_info *property_info;
zobj = Z_OBJ_P(object);
@@ -374,10 +386,8 @@ static void zend_std_write_property(zval *object, zval *member, zval *value TSRM
property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__set != NULL) TSRMLS_CC);
if (property_info && zend_hash_quick_find(zobj->properties, 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 already have this value there, we don't actually need to do anything */
+ if (*variable_ptr != value) {
/* if we are assigning reference, we shouldn't move it, but instead assign variable
to the same pointer */
if (PZVAL_IS_REF(*variable_ptr)) {
@@ -390,10 +400,20 @@ static void zend_std_write_property(zval *object, zval *member, zval *value TSRM
zval_copy_ctor(*variable_ptr);
}
zval_dtor(&garbage);
- setter_done = 1;
+ } else {
+ zval *garbage = *variable_ptr;
+
+ /* if we assign referenced variable, we should separate it */
+ value->refcount++;
+ if (PZVAL_IS_REF(value)) {
+ SEPARATE_ZVAL(&value);
+ }
+ *variable_ptr = value;
+ zval_ptr_dtor(&garbage);
}
}
} else {
+ int setter_done = 0;
zend_guard *guard;
if (zobj->ce->__set &&
@@ -406,18 +426,18 @@ static void zend_std_write_property(zval *object, zval *member, zval *value TSRM
setter_done = 1;
guard->in_set = 0;
}
- }
+ if (!setter_done && property_info) {
+ zval **foo;
- if (!setter_done) {
- zval **foo;
-
- /* if we assign referenced variable, we should separate it */
- value->refcount++;
- if (PZVAL_IS_REF(value)) {
- SEPARATE_ZVAL(&value);
+ /* if we assign referenced variable, we should separate it */
+ value->refcount++;
+ if (PZVAL_IS_REF(value)) {
+ SEPARATE_ZVAL(&value);
+ }
+ zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &value, sizeof(zval *), (void **) &foo);
}
- zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &value, sizeof(zval *), (void **) &foo);
}
+
if (tmp_member) {
zval_ptr_dtor(&tmp_member);
}
@@ -427,7 +447,7 @@ 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, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
if(offset == NULL) {
/* [] construct */
@@ -480,7 +500,7 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty TS
zend_class_entry *ce = Z_OBJCE_P(object);
zval *retval;
int result;
-
+
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset);
@@ -512,7 +532,7 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC
zval tmp_member;
zval **retval;
zend_property_info *property_info;
-
+
zobj = Z_OBJ_P(object);
if (member->type != IS_STRING) {
@@ -524,7 +544,7 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC
#if DEBUG_OBJECT_HANDLERS
fprintf(stderr, "Ptr object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member));
-#endif
+#endif
property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC);
@@ -558,7 +578,7 @@ static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC)
zend_object *zobj;
zval *tmp_member = NULL;
zend_property_info *property_info;
-
+
zobj = Z_OBJ_P(object);
if (member->type != IS_STRING) {
@@ -571,7 +591,7 @@ static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC)
}
property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__unset != NULL) TSRMLS_CC);
-
+
if (!property_info || zend_hash_del(zobj->properties, property_info->name, property_info->name_length+1) == FAILURE) {
zend_guard *guard;
@@ -579,7 +599,7 @@ static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC)
zend_get_property_guard(zobj, property_info, member, &guard) == SUCCESS &&
!guard->in_unset) {
/* have unseter - try with it! */
- guard->in_unset = 1; /* prevent circular setting */
+ guard->in_unset = 1; /* prevent circular unsetting */
zend_std_call_unsetter(object, member TSRMLS_CC);
guard->in_unset = 0;
}
@@ -594,7 +614,7 @@ static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC)
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, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(&object, ce, NULL, "offsetunset", NULL, offset);
@@ -611,7 +631,7 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS)
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);
@@ -640,7 +660,7 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS)
RETVAL_ZVAL(method_result_ptr, 0, 1);
}
}
-
+
/* now destruct all auxiliaries */
zval_ptr_dtor(&method_args_ptr);
zval_ptr_dtor(&method_name_ptr);
@@ -723,6 +743,12 @@ ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope)
}
+static inline zend_class_entry * zend_get_function_root_class(zend_function *fbc)
+{
+ return fbc->common.prototype ? fbc->common.prototype->common.scope : fbc->common.scope;
+}
+
+
static union _zend_function *zend_std_get_method(zval **object_ptr, char *method_name, int method_len TSRMLS_DC)
{
zend_object *zobj;
@@ -740,6 +766,7 @@ static union _zend_function *zend_std_get_method(zval **object_ptr, char *method
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;
@@ -756,7 +783,17 @@ static union _zend_function *zend_std_get_method(zval **object_ptr, char *method
}
/* Check access level */
- if (fbc->op_array.fn_flags & ZEND_ACC_PUBLIC) {
+ 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, Z_OBJ_HANDLER_P(object, get_class_entry)(object TSRMLS_CC), lc_method_name, method_len TSRMLS_CC);
+ if (!updated_fbc) {
+ zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : "");
+ }
+ fbc = updated_fbc;
+ } else {
/* Ensure that we haven't overridden a private function and end up calling
* the overriding public function...
*/
@@ -769,21 +806,12 @@ static union _zend_function *zend_std_get_method(zval **object_ptr, char *method
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 %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : "");
- }
- 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 %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : "");
+ 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(zend_get_function_root_class(fbc), EG(scope))) {
+ zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : "");
+ }
}
}
@@ -812,7 +840,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
/* 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);
+ 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 %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : "");
}
@@ -820,7 +848,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
} 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)) {
+ if (!zend_check_protected(zend_get_function_root_class(fbc), EG(scope))) {
zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : "");
}
}
@@ -841,6 +869,7 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *propert
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);
+ std_property_info.ce = ce;
property_info = &std_property_info;
}
@@ -866,7 +895,7 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *propert
zend_error(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name);
}
}
-
+
return retval;
}
@@ -878,7 +907,7 @@ ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *pr
}
-static union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC)
+ZEND_API union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC)
{
zend_object *zobj = Z_OBJ_P(object);
zend_function *constructor = zobj->ce->constructor;
@@ -889,14 +918,22 @@ static union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC)
} 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 %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : "");
+ if (Z_OBJ_HANDLER_P(object, get_class_entry)(object TSRMLS_CC) != EG(scope)) {
+ if (EG(scope)) {
+ zend_error(E_ERROR, "Call to private %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope)->name);
+ } else {
+ zend_error(E_ERROR, "Call to private %s::%s() from invalid context", constructor->common.scope->name, constructor->common.function_name);
+ }
}
} 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 %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : "");
+ if (!zend_check_protected(zend_get_function_root_class(constructor), EG(scope))) {
+ if (EG(scope)) {
+ zend_error(E_ERROR, "Call to protected %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope)->name);
+ } else {
+ zend_error(E_ERROR, "Call to protected %s::%s() from invalid context", constructor->common.scope->name, constructor->common.function_name);
+ }
}
}
}
@@ -911,7 +948,7 @@ 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);
@@ -928,11 +965,11 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists
zval **value;
zval *tmp_member = NULL;
zend_property_info *property_info;
-
+
zobj = Z_OBJ_P(object);
- if (member->type != IS_STRING) {
- ALLOC_ZVAL(tmp_member);
+ if (member->type != IS_STRING) {
+ ALLOC_ZVAL(tmp_member);
*tmp_member = *member;
INIT_PZVAL(tmp_member);
zval_copy_ctor(tmp_member);
@@ -942,7 +979,7 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists
#if DEBUG_OBJECT_HANDLERS
fprintf(stderr, "Read object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member));
-#endif
+#endif
property_info = zend_get_property_info(zobj->ce, member, 1 TSRMLS_CC);
@@ -1024,32 +1061,55 @@ int zend_std_object_get_class_name(zval *object, char **class_name, zend_uint *c
return SUCCESS;
}
-ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC)
+ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC)
{
- zval fname, *retval;
-
+ zval *retval;
+ zend_class_entry *ce;
+
switch (type) {
case IS_STRING:
- if (!zend_hash_exists(&Z_OBJCE_P(readobj)->function_table, "__tostring", sizeof("__tostring"))) {
- return FAILURE;
- }
- ZVAL_STRING(&fname, "__tostring", 0);
- if (call_user_function_ex(NULL, &readobj, &fname, &retval, 0, NULL, 0, NULL TSRMLS_CC) == SUCCESS) {
- if (retval) {
- if (Z_TYPE_P(retval) != IS_STRING) {
- zend_error(E_ERROR, "Method %s::__toString() must return a string value", Z_OBJCE_P(readobj)->name);
+ ce = Z_OBJCE_P(readobj);
+ if (ce->__tostring &&
+ (zend_call_method_with_0_params(&readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(exception))) {
+ if (EG(exception)) {
+ if (retval) {
+ zval_ptr_dtor(&retval);
+ }
+ zend_error(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name);
+ return FAILURE;
+ }
+ if (Z_TYPE_P(retval) == 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 {
- MAKE_STD_ZVAL(retval);
- ZVAL_STRINGL(retval, "", 0, 1);
+ zval_ptr_dtor(&retval);
+ INIT_PZVAL(writeobj);
+ ZVAL_EMPTY_STRING(writeobj);
+ zend_error(E_RECOVERABLE_ERROR, "Method %s::__toString() must return a string value", ce->name);
+ return SUCCESS;
}
- *writeobj = *retval;
- zval_copy_ctor(writeobj);
- INIT_PZVAL(writeobj);
- zval_ptr_dtor(&retval);
- return SUCCESS;
}
- break;
+ 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 %s 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 %s could not be converted to double", ce->name);
+ INIT_PZVAL(writeobj);
+ ZVAL_DOUBLE(writeobj, 1);
+ return SUCCESS;
default:
break;
}
@@ -1061,7 +1121,7 @@ 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 */
@@ -1080,7 +1140,7 @@ ZEND_API zend_object_handlers std_object_handlers = {
zend_std_object_get_class, /* get_class_entry */
zend_std_object_get_class_name, /* get_class_name */
zend_std_compare_objects, /* compare_objects */
- NULL, /* cast_object */
+ zend_std_cast_object_tostring, /* cast_object */
NULL, /* count_elements */
};
diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h
index 2f18bd7ae..f94ac6708 100644
--- a/Zend/zend_object_handlers.h
+++ b/Zend/zend_object_handlers.h
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_object_handlers.h,v 1.47.2.2 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_object_handlers.h,v 1.47.2.2.2.4 2006/07/24 17:58:32 helly Exp $ */
#ifndef ZEND_OBJECT_HANDLERS_H
#define ZEND_OBJECT_HANDLERS_H
@@ -53,12 +53,12 @@ typedef zval **(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member
/* 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);
+typedef void (*zend_object_set_t)(zval **object, 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);
+typedef zval* (*zend_object_get_t)(zval *object TSRMLS_DC);
/* Used to check if a property of the object exists */
/* param has_set_exists:
@@ -97,7 +97,10 @@ 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);
-typedef int (*zend_object_cast_t)(zval *readobj, zval *writeobj, int type, int should_free 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 */
@@ -137,19 +140,20 @@ 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, char *property_name, int property_name_len, zend_bool silent TSRMLS_DC);
ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len TSRMLS_DC);
+ZEND_API union _zend_function *zend_std_get_constructor(zval *object 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, int should_free 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 IS_ZEND_STD_OBJECT(z) (Z_TYPE(z) == 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, char *prop_info_name TSRMLS_DC);
+ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name, int prop_info_name_len TSRMLS_DC);
ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS);
END_EXTERN_C()
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 5417f8c7f..2ff7d5acb 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
@@ -17,13 +17,14 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_objects.c,v 1.56.2.3 2006/03/29 14:28:40 tony2001 Exp $ */
+/* $Id: zend_objects.c,v 1.56.2.3.2.5 2006/07/26 15:29:27 dmitry Exp $ */
#include "zend.h"
#include "zend_globals.h"
#include "zend_variables.h"
#include "zend_API.h"
#include "zend_interfaces.h"
+#include "zend_exceptions.h"
ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC)
{
@@ -51,9 +52,9 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
zend_function *destructor = object->ce->destructor;
if (destructor) {
- zval zobj, *obj = &zobj;
+ zval *obj;
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.
@@ -84,10 +85,12 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
}
}
- zobj.type = IS_OBJECT;
- zobj.value.obj.handle = handle;
- zobj.value.obj.handlers = &std_object_handlers;
- INIT_PZVAL(obj);
+ MAKE_STD_ZVAL(obj);
+ Z_TYPE_P(obj) = IS_OBJECT;
+ Z_OBJ_HANDLE_P(obj) = handle;
+ /* TODO: We cannot set proper handlers. */
+ Z_OBJ_HT_P(obj) = &std_object_handlers;
+ zval_copy_ctor(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
@@ -95,14 +98,22 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
*/
old_exception = EG(exception);
EG(exception) = NULL;
- zend_call_method_with_0_params(&obj, object->ce, &object->ce->destructor, ZEND_DESTRUCTOR_FUNC_NAME, NULL);
+ zend_call_method_with_0_params(&obj, object->ce, &destructor, ZEND_DESTRUCTOR_FUNC_NAME, NULL);
if (old_exception) {
if (EG(exception)) {
- zend_error(E_ERROR, "Ignoring exception from %s::__destruct() while an exception is already active", object->ce->name);
+ zend_class_entry *default_exception_ce = zend_exception_get_default(TSRMLS_C);
+ zval *file = zend_read_property(default_exception_ce, old_exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
+ zval *line = zend_read_property(default_exception_ce, old_exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
+
+ zval_ptr_dtor(&obj);
zval_ptr_dtor(&EG(exception));
+ EG(exception) = old_exception;
+ zend_error(E_ERROR, "Ignoring exception from %s::__destruct() while an exception is already active (Uncaught %s in %s on line %ld)",
+ object->ce->name, Z_OBJCE_P(old_exception)->name, Z_STRVAL_P(file), Z_LVAL_P(line));
}
EG(exception) = old_exception;
}
+ zval_ptr_dtor(&obj);
}
}
diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c
index 48b37b3ab..5a9a7a835 100644
--- a/Zend/zend_objects_API.c
+++ b/Zend/zend_objects_API.c
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_objects_API.c,v 1.47.2.6 2006/03/28 21:58:01 tony2001 Exp $ */
+/* $Id: zend_objects_API.c,v 1.47.2.6.2.3 2006/08/07 15:15:20 dmitry Exp $ */
#include "zend.h"
#include "zend_globals.h"
@@ -97,7 +97,7 @@ ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_st
{
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;
@@ -125,6 +125,13 @@ ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_st
return handle;
}
+ZEND_API zend_uint zend_objects_store_get_refcount(zval *object TSRMLS_DC)
+{
+ zend_object_handle handle = Z_OBJ_HANDLE_P(object);
+
+ return EG(objects_store).object_buckets[handle].bucket.obj.refcount;
+}
+
ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC)
{
zend_object_handle handle = Z_OBJ_HANDLE_P(object);
@@ -135,6 +142,14 @@ ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC)
#endif
}
+/*
+ * Add a reference to an objects store entry given the object handle.
+ */
+ZEND_API void zend_objects_store_add_ref_by_handle(zend_object_handle handle TSRMLS_DC)
+{
+ EG(objects_store).object_buckets[handle].bucket.obj.refcount++;
+}
+
#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; \
@@ -143,33 +158,52 @@ ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC)
ZEND_API void zend_objects_store_del_ref(zval *zobject TSRMLS_DC)
{
zend_object_handle handle;
+
+ handle = Z_OBJ_HANDLE_P(zobject);
+
+ zobject->refcount++;
+ zend_objects_store_del_ref_by_handle(handle TSRMLS_CC);
+ zobject->refcount--;
+}
+
+/*
+ * Delete a reference to an objects store entry given the object handle.
+ */
+ZEND_API void zend_objects_store_del_ref_by_handle(zend_object_handle handle TSRMLS_DC)
+{
struct _store_object *obj;
+ int failure = 0;
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--;
+ zend_try {
+ obj->dtor(obj->object, handle TSRMLS_CC);
+ } zend_catch {
+ failure = 1;
+ } zend_end_try();
}
}
if (obj->refcount == 1) {
if (obj->free_storage) {
- obj->free_storage(obj->object TSRMLS_CC);
+ zend_try {
+ obj->free_storage(obj->object TSRMLS_CC);
+ } zend_catch {
+ failure = 1;
+ } zend_end_try();
}
ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST();
}
@@ -185,6 +219,9 @@ ZEND_API void zend_objects_store_del_ref(zval *zobject TSRMLS_DC)
fprintf(stderr, "Decreased refcount of object id #%d\n", handle);
}
#endif
+ if (failure) {
+ zend_bailout();
+ }
}
ZEND_API zend_object_value zend_objects_store_clone_obj(zval *zobject TSRMLS_DC)
@@ -195,16 +232,16 @@ ZEND_API zend_object_value zend_objects_store_clone_obj(zval *zobject TSRMLS_DC)
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 %s", 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;
}
@@ -215,6 +252,14 @@ ZEND_API void *zend_object_store_get_object(zval *zobject TSRMLS_DC)
return EG(objects_store).object_buckets[handle].bucket.obj.object;
}
+/*
+ * Retrieve an entry from the objects store given the object handle.
+ */
+ZEND_API void *zend_object_store_get_object_by_handle(zend_object_handle handle TSRMLS_DC)
+{
+ 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
@@ -274,10 +319,10 @@ ZEND_API zval *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC)
zval_add_ref(&pobj->object);
MAKE_STD_ZVAL(retval);
- retval->type = IS_OBJECT;
+ Z_TYPE_P(retval) = 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;
}
@@ -312,7 +357,7 @@ ZEND_API zend_object_handlers *zend_get_std_object_handlers()
static zend_object_handlers zend_object_proxy_handlers = {
ZEND_OBJECTS_STORE_HANDLERS,
-
+
NULL, /* read_property */
NULL, /* write_property */
NULL, /* read dimension */
diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h
index f08174763..7fc8d0d74 100644
--- a/Zend/zend_objects_API.h
+++ b/Zend/zend_objects_API.h
@@ -1,4 +1,4 @@
-/*
+/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_objects_API.h,v 1.20.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_objects_API.h,v 1.20.2.1.2.2 2006/08/07 15:15:20 dmitry Exp $ */
#ifndef ZEND_OBJECTS_API_H
#define ZEND_OBJECTS_API_H
@@ -64,8 +64,12 @@ ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_st
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 void zend_objects_store_add_ref_by_handle(zend_object_handle handle TSRMLS_DC);
+ZEND_API void zend_objects_store_del_ref_by_handle(zend_object_handle handle TSRMLS_DC);
+ZEND_API zend_uint zend_objects_store_get_refcount(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);
+ZEND_API void *zend_object_store_get_object_by_handle(zend_object_handle handle 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);
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 5a5180926..6f6b65fab 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_operators.c,v 1.208.2.4 2006/02/05 17:07:40 helly Exp $ */
+/* $Id: zend_operators.c,v 1.208.2.4.2.10 2006/10/03 17:54:51 tony2001 Exp $ */
#include <ctype.h>
@@ -26,7 +26,6 @@
#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"
@@ -187,8 +186,13 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
} \
}
+#define DVAL_TO_LVAL(d, l) \
+ if ((d) > LONG_MAX) { \
+ (l) = (unsigned long) (d); \
+ } else { \
+ (l) = (long) (d); \
+ }
-#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) { \
@@ -266,10 +270,17 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
}
-#define convert_object_to_type(op, ctype, conv_func) \
+#define convert_object_to_type(op, ctype, conv_func) \
if (Z_OBJ_HT_P(op)->cast_object) { \
- if (Z_OBJ_HT_P(op)->cast_object(op, op, ctype, 1 TSRMLS_CC) == SUCCESS) { \
- op->type = ctype; \
+ zval dst; \
+ if (Z_OBJ_HT_P(op)->cast_object(op, &dst, ctype TSRMLS_CC) == FAILURE) { \
+ zend_error(E_RECOVERABLE_ERROR, \
+ "Object of class %s could not be converted to %s", Z_OBJCE_P(op)->name, \
+ zend_get_type_by_const(ctype)); \
+ } else { \
+ zval_dtor(op); \
+ Z_TYPE_P(op) = ctype; \
+ op->value = dst.value; \
} \
} else { \
if(Z_OBJ_HT_P(op)->get) { \
@@ -424,17 +435,23 @@ ZEND_API void convert_to_double(zval *op)
ZEND_API void convert_to_null(zval *op)
{
- if (op->type == IS_OBJECT) {
+ if (Z_TYPE_P(op) == IS_OBJECT) {
if (Z_OBJ_HT_P(op)->cast_object) {
+ zval *org;
TSRMLS_FETCH();
- if (Z_OBJ_HT_P(op)->cast_object(op, op, IS_NULL, 1 TSRMLS_CC) == SUCCESS) {
+
+ 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;
+ Z_TYPE_P(op) = IS_NULL;
}
@@ -901,6 +918,7 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
zendi_convert_to_long(op2, op2_copy, result);
if (op2->value.lval == 0) {
+ zend_error(E_WARNING, "Division by zero");
ZVAL_BOOL(result, 0);
return FAILURE; /* modulus by zero */
}
@@ -1260,8 +1278,7 @@ ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_
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;
+ ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_DVAL(op1_copy)-Z_DVAL(op2_copy)));
return SUCCESS;
}
@@ -1288,52 +1305,65 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
zval *op1_free, *op2_free;
- int op1_obj = op1->type == IS_OBJECT;
- int op2_obj = op2->type == IS_OBJECT;
-
- if (op1_obj) {
- if (Z_OBJ_HT_P(op1)->get) {
+ int op1_obj = Z_TYPE_P(op1) == IS_OBJECT;
+ int op2_obj = Z_TYPE_P(op2) == IS_OBJECT;
+ int eq_comp = op1_obj && op2_obj && (Z_OBJ_HANDLER_P(op1,compare_objects)
+ == Z_OBJ_HANDLER_P(op2,compare_objects));
+
+ if (op1_obj && !eq_comp) {
+ if (Z_TYPE_P(op2) == IS_NULL) {
+ ZVAL_LONG(result, 1);
+ return SUCCESS;
+ } else if (Z_OBJ_HT_P(op1)->get) {
op1 = op1_free = Z_OBJ_HT_P(op1)->get(op1 TSRMLS_CC);
} else if (!op2_obj && Z_OBJ_HT_P(op1)->cast_object) {
ALLOC_INIT_ZVAL(op1_free);
- if (Z_OBJ_HT_P(op1)->cast_object(op1, op1_free, Z_TYPE_P(op2), 0 TSRMLS_CC) == FAILURE) {
+ if (Z_OBJ_HT_P(op1)->cast_object(op1, op1_free, Z_TYPE_P(op2) TSRMLS_CC) == FAILURE) {
op2_free = NULL;
- ZVAL_BOOL(result, 0);
- COMPARE_RETURN_AND_FREE(FAILURE);
+ ZVAL_LONG(result, 1);
+ COMPARE_RETURN_AND_FREE(SUCCESS);
}
op1 = op1_free;
} else {
op1_free = NULL;
}
+ op1_obj = Z_TYPE_P(op1) == IS_OBJECT;
+ eq_comp = op1_obj && op2_obj && (Z_OBJ_HANDLER_P(op1,compare_objects)
+ == Z_OBJ_HANDLER_P(op2,compare_objects));
} else {
op1_free = NULL;
}
- if (op2_obj) {
- if (Z_OBJ_HT_P(op2)->get) {
+ if (op2_obj && !eq_comp) {
+ if (Z_TYPE_P(op1) == IS_NULL) {
+ op2_free = NULL;
+ ZVAL_LONG(result, -1);
+ COMPARE_RETURN_AND_FREE(SUCCESS);
+ } else if (Z_OBJ_HT_P(op2)->get) {
op2 = op2_free = Z_OBJ_HT_P(op2)->get(op2 TSRMLS_CC);
} else if (!op1_obj && Z_OBJ_HT_P(op2)->cast_object) {
ALLOC_INIT_ZVAL(op2_free);
- if (Z_OBJ_HT_P(op2)->cast_object(op2, op2_free, Z_TYPE_P(op1), 0 TSRMLS_CC) == FAILURE) {
- ZVAL_BOOL(result, 0);
- COMPARE_RETURN_AND_FREE(FAILURE);
+ if (Z_OBJ_HT_P(op2)->cast_object(op2, op2_free, Z_TYPE_P(op1) TSRMLS_CC) == FAILURE) {
+ ZVAL_LONG(result, -1);
+ COMPARE_RETURN_AND_FREE(SUCCESS);
}
op2 = op2_free;
} else {
op2_free = NULL;
}
+ op2_obj = Z_TYPE_P(op2) == IS_OBJECT;
+ eq_comp = op1_obj && op2_obj && (Z_OBJ_HANDLER_P(op1,compare_objects)
+ == Z_OBJ_HANDLER_P(op2,compare_objects));
} else {
op2_free = NULL;
}
- 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);
+ if ((Z_TYPE_P(op1) == IS_NULL && Z_TYPE_P(op2) == IS_STRING)
+ || (Z_TYPE_P(op2) == IS_NULL && Z_TYPE_P(op1) == IS_STRING)) {
+ if (Z_TYPE_P(op1) == IS_NULL) {
+ ZVAL_LONG(result, zend_binary_strcmp("", 0, Z_STRVAL_P(op2), Z_STRLEN_P(op2)));
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);
+ ZVAL_LONG(result, zend_binary_strcmp(Z_STRVAL_P(op1), Z_STRLEN_P(op1), "", 0));
COMPARE_RETURN_AND_FREE(SUCCESS);
}
}
@@ -1343,63 +1373,52 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
COMPARE_RETURN_AND_FREE(SUCCESS);
}
- if (op1->type == IS_BOOL || op2->type == IS_BOOL
- || op1->type == IS_NULL || op2->type == IS_NULL) {
+ if (Z_TYPE_P(op1) == IS_BOOL || Z_TYPE_P(op2) == IS_BOOL
+ || Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op2) == 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);
+ ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2)));
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);
- }
+ /* If both are objects sharing the same comparision handler then use is */
+ if (eq_comp) {
+ ZVAL_LONG(result, Z_OBJ_HT_P(op1)->compare_objects(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.lval<op2->value.lval?-1:0);
+ if (Z_TYPE_P(op1) == IS_LONG && Z_TYPE_P(op2) == IS_LONG) {
+ ZVAL_LONG(result, Z_LVAL_P(op1)>Z_LVAL_P(op2)?1:(Z_LVAL_P(op1)<Z_LVAL_P(op2)?-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;
+ if ((Z_TYPE_P(op1) == IS_DOUBLE || Z_TYPE_P(op1) == IS_LONG)
+ && (Z_TYPE_P(op2) == IS_DOUBLE || Z_TYPE_P(op2) == IS_LONG)) {
+ Z_DVAL_P(result) = (Z_TYPE_P(op1) == IS_LONG ? (double) Z_LVAL_P(op1) : Z_DVAL_P(op1)) - (Z_TYPE_P(op2) == IS_LONG ? (double) Z_LVAL_P(op2) : Z_DVAL_P(op2));
+ ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_DVAL_P(result)));
COMPARE_RETURN_AND_FREE(SUCCESS);
}
- if (op1->type==IS_ARRAY && op2->type==IS_ARRAY) {
+ if (Z_TYPE_P(op1)==IS_ARRAY && Z_TYPE_P(op2)==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;
+ if (Z_TYPE_P(op1)==IS_ARRAY) {
+ ZVAL_LONG(result, 1);
COMPARE_RETURN_AND_FREE(SUCCESS);
}
- if (op2->type==IS_ARRAY) {
- result->value.lval = -1;
- result->type = IS_LONG;
+ if (Z_TYPE_P(op2)==IS_ARRAY) {
+ ZVAL_LONG(result, -1);
COMPARE_RETURN_AND_FREE(SUCCESS);
}
- if (op1->type==IS_OBJECT) {
- result->value.lval = 1;
- result->type = IS_LONG;
+ if (Z_TYPE_P(op1)==IS_OBJECT) {
+ ZVAL_LONG(result, 1);
COMPARE_RETURN_AND_FREE(SUCCESS);
}
- if (op2->type==IS_OBJECT) {
- result->value.lval = -1;
- result->type = IS_LONG;
+ if (Z_TYPE_P(op2)==IS_OBJECT) {
+ ZVAL_LONG(result, -1);
COMPARE_RETURN_AND_FREE(SUCCESS);
}
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index 20c75de38..ebdce7666 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -17,13 +17,14 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_operators.h,v 1.94.2.4 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_operators.h,v 1.94.2.4.2.4 2006/08/08 10:54:24 tony2001 Exp $ */
#ifndef ZEND_OPERATORS_H
#define ZEND_OPERATORS_H
#include <errno.h>
#include <math.h>
+#include <assert.h>
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
@@ -65,6 +66,15 @@ ZEND_API zend_bool instanceof_function_ex(zend_class_entry *instance_ce, zend_cl
ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class_entry *ce TSRMLS_DC);
END_EXTERN_C()
+/**
+ * Checks whether the string "str" with the length "length" is a numeric string.
+ *
+ * The function returns 0 if the string did not contain a string; IS_LONG if
+ * the string contained a number that fits in the integer range and IS_DOUBLE
+ * in case it did not. The long value is returned into the pointer *lval if
+ * that pointer was not NULL or into the pointer *dval if that pointer was not
+ * NULL.
+ */
static inline zend_bool is_numeric_string(char *str, int length, long *lval, double *dval, int allow_errors)
{
long local_lval;
@@ -75,7 +85,7 @@ static inline zend_bool is_numeric_string(char *str, int length, long *lval, dou
if (!length) {
return 0;
}
-
+
/* handle hex numbers */
if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) {
conv_base=16;
@@ -148,17 +158,29 @@ zend_memnstr(char *haystack, char *needle, int needle_len, char *end)
return p;
}
}
-
+
if (p == NULL) {
return NULL;
}
-
+
p++;
}
-
+
return NULL;
}
+static inline void *zend_memrchr(const void *s, int c, size_t n)
+{
+ register unsigned char *e = (unsigned char *)s + n;
+
+ for (e--; e >= (unsigned char *)s; e--) {
+ if (*e == (unsigned char)c) {
+ return (void *)e;
+ }
+ }
+
+ return NULL;
+}
BEGIN_EXTERN_C()
ZEND_API int increment_function(zval *op1);
@@ -225,6 +247,41 @@ END_EXTERN_C()
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; \
+ default: \
+ assert(0); \
+ break; \
+ } \
+ } while (0); \
+
+#define convert_to_explicit_type_ex(ppzv, str_type) \
+ if (Z_TYPE_PP(ppzv) != 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)
@@ -235,7 +292,7 @@ END_EXTERN_C()
#define convert_to_null_ex(ppzv) convert_to_ex_master(ppzv, null, NULL)
#define convert_scalar_to_number_ex(ppzv) \
- if ((*ppzv)->type!=IS_LONG && (*ppzv)->type!=IS_DOUBLE) { \
+ if (Z_TYPE_PP(ppzv)!=IS_LONG && Z_TYPE_PP(ppzv)!=IS_DOUBLE) { \
if (!(*ppzv)->is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
@@ -250,8 +307,8 @@ END_EXTERN_C()
#define Z_STRLEN(zval) (zval).value.str.len
#define Z_ARRVAL(zval) (zval).value.ht
#define Z_OBJVAL(zval) (zval).value.obj
-#define Z_OBJ_HANDLE(zval) (zval).value.obj.handle
-#define Z_OBJ_HT(zval) (zval).value.obj.handlers
+#define Z_OBJ_HANDLE(zval) Z_OBJVAL(zval).handle
+#define Z_OBJ_HT(zval) Z_OBJVAL(zval).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
@@ -269,7 +326,7 @@ END_EXTERN_C()
#define Z_OBJVAL_P(zval_p) Z_OBJVAL(*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_OBJ_HANDLER_P(zval_p, h) Z_OBJ_HANDLER(*zval_p, h)
#define Z_LVAL_PP(zval_pp) Z_LVAL(**zval_pp)
#define Z_BVAL_PP(zval_pp) Z_BVAL(**zval_pp)
@@ -283,7 +340,7 @@ END_EXTERN_C()
#define Z_OBJVAL_PP(zval_pp) Z_OBJVAL(**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_OBJ_HANDLER_PP(zval_p, h) Z_OBJ_HANDLER(**zval_p, h)
#define Z_TYPE(zval) (zval).type
#define Z_TYPE_P(zval_p) Z_TYPE(*zval_p)
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index 5527bd822..4faecc22e 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_variables.c,v 1.62.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_variables.c,v 1.62.2.1.2.1 2006/10/03 11:10:33 dmitry Exp $ */
#include <stdio.h>
#include "zend.h"
@@ -130,7 +130,7 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
return; /* do nothing */
}
ALLOC_HASHTABLE_REL(tmp_ht);
- zend_hash_init(tmp_ht, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
zvalue->value.ht = tmp_ht;
}
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 013bd3b03..340579cd3 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_vm_def.h,v 1.59.2.30 2006/07/06 15:39:23 pollita Exp $ */
+/* $Id: zend_vm_def.h,v 1.59.2.29.2.32 2006/10/30 11:04:31 dmitry Exp $ */
/* If you change this file, please regenerate the zend_vm_execute.h and
* zend_vm_opcodes.h files by running:
@@ -298,7 +298,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP2();
FREE_OP(free_op_data1);
@@ -335,17 +335,17 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -412,7 +412,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -548,7 +548,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
FREE_OP2();
if (!RETURN_VALUE_UNUSED(&opline->result)) {
@@ -581,9 +581,9 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -640,7 +640,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
FREE_OP2();
*retval = *EG(uninitialized_zval_ptr);
@@ -670,10 +670,10 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -888,7 +888,7 @@ ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMP|VAR|CV, ANY)
zval *z = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
- zend_std_cast_object_tostring(z, &z_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
+ zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
@@ -903,8 +903,8 @@ 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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG;
ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ECHO);
}
@@ -918,7 +918,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type
zval tmp_varname;
HashTable *target_symbol_table;
- if (varname->type != IS_STRING) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp_varname = *varname;
zval_copy_ctor(&tmp_varname);
convert_to_string(&tmp_varname);
@@ -938,13 +938,13 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type
switch (type) {
case BP_VAR_R:
case BP_VAR_UNSET:
- zend_error(E_NOTICE,"Undefined variable: %s", varname->value.str.val);
+ zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_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: %s", varname->value.str.val);
+ zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
/* break missing intentionally */
case BP_VAR_W: {
zval *new_zval = &EG(uninitialized_zval);
@@ -958,6 +958,10 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type
}
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;
@@ -1037,7 +1041,9 @@ ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, VAR|CV, CONST|TMP|VAR|CV)
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) {
+ if (opline->extended_value == ZEND_FETCH_ADD_LOCK &&
+ OP1_TYPE != IS_CV &&
+ EX_T(opline->op1.u.var).var.ptr_ptr) {
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);
@@ -1054,6 +1060,11 @@ ZEND_VM_HANDLER(84, ZEND_FETCH_DIM_W, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
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();
+ if (OP1_TYPE == IS_VAR && OP1_FREE &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
FREE_OP1_VAR_PTR();
ZEND_VM_NEXT_OPCODE();
}
@@ -1066,6 +1077,11 @@ ZEND_VM_HANDLER(87, ZEND_FETCH_DIM_RW, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
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();
+ if (OP1_TYPE == IS_VAR && OP1_FREE &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
FREE_OP1_VAR_PTR();
ZEND_VM_NEXT_OPCODE();
}
@@ -1088,13 +1104,18 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
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();
+ if (OP1_TYPE == IS_VAR && type == BP_VAR_W && OP1_FREE &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
FREE_OP1_VAR_PTR();
ZEND_VM_NEXT_OPCODE();
}
@@ -1118,6 +1139,11 @@ ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMP|VAR|CV)
}
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();
+ if (OP1_TYPE == IS_VAR && OP1_FREE &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
FREE_OP1_VAR_PTR();
if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
@@ -1157,7 +1183,7 @@ ZEND_VM_HELPER_EX(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -1219,6 +1245,11 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
} else {
FREE_OP2();
}
+ if (OP1_TYPE == IS_VAR && OP1_FREE &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
FREE_OP1_VAR_PTR();
ZEND_VM_NEXT_OPCODE();
}
@@ -1238,6 +1269,11 @@ ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
} else {
FREE_OP2();
}
+ if (OP1_TYPE == IS_VAR && OP1_FREE &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
FREE_OP1_VAR_PTR();
ZEND_VM_NEXT_OPCODE();
}
@@ -1265,6 +1301,11 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
} else {
FREE_OP2();
}
+ if (OP1_TYPE == IS_VAR && OP1_FREE &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
FREE_OP1_VAR_PTR();
ZEND_VM_NEXT_OPCODE();
} else {
@@ -1293,6 +1334,11 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
} else {
FREE_OP2();
}
+ if (OP1_TYPE == IS_VAR && OP1_FREE &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
FREE_OP1_VAR_PTR();
PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
@@ -1310,7 +1356,7 @@ ZEND_VM_HANDLER(98, ZEND_FETCH_DIM_TMP_VAR, TMP, CONST)
zend_free_op free_op1;
zval *container = GET_OP1_ZVAL_PTR(BP_VAR_R);
- if (container->type != IS_ARRAY) {
+ if (Z_TYPE_P(container) != 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);
@@ -1319,7 +1365,7 @@ ZEND_VM_HANDLER(98, ZEND_FETCH_DIM_TMP_VAR, TMP, CONST)
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);
+ EX_T(opline->result.u.var).var.ptr_ptr = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, BP_VAR_R TSRMLS_CC);
SELECTIVE_PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &opline->result);
FREE_OP2();
}
@@ -1341,7 +1387,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
+ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
@@ -1350,12 +1396,12 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
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);
+ object_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
} else {
object_ptr = NULL;
}
- if (object_ptr && (*object_ptr)->type == IS_OBJECT) {
+ if (object_ptr && Z_TYPE_PP(object_ptr) == 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;
@@ -1398,7 +1444,7 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
if (OP2_TYPE == IS_VAR &&
value_ptr_ptr &&
!(*value_ptr_ptr)->is_ref &&
- opline->extended_value == ZEND_RETURNS_FUNCTION &&
+ 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() */
@@ -1495,8 +1541,8 @@ ZEND_VM_HANDLER(46, ZEND_JMPZ_EX, CONST|TMP|VAR|CV, ANY)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
if (!retval) {
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
@@ -1513,8 +1559,8 @@ ZEND_VM_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMP|VAR|CV, ANY)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
if (retval) {
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
@@ -1610,7 +1656,7 @@ ZEND_VM_HANDLER(109, ZEND_FETCH_CLASS, ANY, CONST|TMP|VAR|UNUSED|CV)
class_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
- switch (class_name->type) {
+ switch (Z_TYPE_P(class_name)) {
case IS_OBJECT:
EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
break;
@@ -1642,12 +1688,12 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_P(function_name);
EX(object) = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R);
- if (EX(object) && EX(object)->type == IS_OBJECT) {
+ if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -1697,8 +1743,8 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, ANY, CONST|TMP|VAR|UNUSED|CV)
zend_free_op free_op2;
if (is_const) {
- function_name_strval = opline->op2.u.constant.value.str.val;
- function_name_strlen = opline->op2.u.constant.value.str.len;
+ function_name_strval = Z_STRVAL(opline->op2.u.constant);
+ function_name_strlen = Z_STRLEN(opline->op2.u.constant);
} else {
function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
@@ -1719,6 +1765,9 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, ANY, CONST|TMP|VAR|UNUSED|CV)
if(!ce->constructor) {
zend_error_noreturn(E_ERROR, "Can not call constructor");
}
+ if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+ zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name);
+ }
EX(fbc) = ce->constructor;
}
@@ -1728,7 +1777,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, ANY, CONST|TMP|VAR|UNUSED|CV)
if (OP2_TYPE != IS_UNUSED &&
EG(This) &&
Z_OBJ_HT_P(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
+ !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
@@ -1789,8 +1838,8 @@ 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;
+ zend_class_entry *current_scope = NULL;
+ zval *current_this = NULL;
int return_value_used = RETURN_VALUE_USED(opline);
zend_bool should_change_scope;
zend_op *ctor_opline;
@@ -1805,7 +1854,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
EX(function_state).function->common.scope ? "::" : "",
EX(function_state).function->common.function_name);
- };
+ }
}
zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL);
@@ -1994,7 +2043,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, CONST, ANY)
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);
if (zend_hash_find(EG(function_table), fname->value.str.val, fname->value.str.len+1, (void **) &EX(function_state).function)==FAILURE) {
- zend_error_noreturn(E_ERROR, "Unknown function: %s()", fname->value.str.val);
+ zend_error_noreturn(E_ERROR, "Call to undefined function %s()", fname->value.str.val);
}
EX(object) = NULL;
@@ -2097,7 +2146,7 @@ ZEND_VM_HANDLER(108, ZEND_THROW, CONST|TMP|VAR|CV, ANY)
value = GET_OP1_ZVAL_PTR(BP_VAR_R);
- if (value->type != IS_OBJECT) {
+ if (Z_TYPE_P(value) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "Can only throw objects");
}
/* Not sure if a complete copy is what we want here */
@@ -2144,7 +2193,7 @@ 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)) {
+ && ARG_MUST_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);
}
{
@@ -2205,12 +2254,12 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
} 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 != &EG(uninitialized_zval) &&
+ (PZVAL_IS_REF(varptr) ||
(varptr->refcount == 1 && (OP1_TYPE == IS_CV || free_op1.var)))) {
varptr->is_ref = 1;
varptr->refcount++;
@@ -2266,7 +2315,7 @@ 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;
+ zend_uint arg_num = Z_LVAL(opline->op1.u.constant);
if (zend_ptr_stack_get_arg(arg_num, (void **) &param TSRMLS_CC)==FAILURE) {
char *space;
@@ -2302,16 +2351,16 @@ 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_uint arg_num = Z_LVAL(opline->op1.u.constant);
zend_free_op free_res;
if (zend_ptr_stack_get_arg(arg_num, (void **) &param TSRMLS_CC)==FAILURE) {
- if (opline->op2.u.constant.type == IS_CONSTANT || opline->op2.u.constant.type==IS_CONSTANT_ARRAY) {
+ if (Z_TYPE(opline->op2.u.constant) == IS_CONSTANT || Z_TYPE(opline->op2.u.constant)==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) {
+ if (Z_TYPE(opline->op2.u.constant)==IS_CONSTANT_ARRAY) {
zval_copy_ctor(default_value);
}
default_value->refcount=1;
@@ -2347,8 +2396,8 @@ ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMP|VAR|CV, ANY)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R));
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
FREE_OP1();
ZEND_VM_NEXT_OPCODE();
@@ -2450,7 +2499,7 @@ ZEND_VM_HANDLER(68, ZEND_NEW, ANY, ANY)
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 */
@@ -2482,7 +2531,11 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY)
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 %s", ce->name);
+ if (ce) {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name);
+ } else {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object");
+ }
EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
EX_T(opline->result.u.var).var.ptr->refcount++;
}
@@ -2504,14 +2557,15 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY)
}
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;
+ if (!EG(exception)) {
+ ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
+ Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC);
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT;
EX_T(opline->result.u.var).var.ptr->refcount=1;
EX_T(opline->result.u.var).var.ptr->is_ref=1;
+ if (!RETURN_VALUE_USED(opline) || EG(exception)) {
+ zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ }
}
FREE_OP1_IF_VAR();
ZEND_VM_NEXT_OPCODE();
@@ -2527,7 +2581,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, CONST|UNUSED, CONST)
/* 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) {
+ if (zend_hash_find(&ce->constants_table, Z_STRVAL(opline->op2.u.constant), Z_STRLEN(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);
@@ -2558,39 +2612,42 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, CONST|UNUSED, CONST)
ZEND_VM_NEXT_OPCODE();
}
-ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
+ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|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 *expr_ptr;
zval *offset=GET_OP2_ZVAL_PTR(BP_VAR_R);
+#if !defined(ZEND_VM_SPEC) || OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV
+ zval **expr_ptr_ptr = NULL;
+
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);
}
+#else
+ expr_ptr=GET_OP1_ZVAL_PTR(BP_VAR_R);
+#endif
- 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 */
+ if (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 !defined(ZEND_VM_SPEC) || OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -2602,19 +2659,19 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|V
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -2624,7 +2681,7 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|V
}
FREE_OP2();
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
FREE_OP1_VAR_PTR();
@@ -2636,7 +2693,16 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|V
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_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (OP1_TYPE == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if !defined(ZEND_VM_SPEC) || OP1_TYPE != IS_UNUSED
+ } else {
+ ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ADD_ARRAY_ELEMENT);
+#endif
+ }
}
ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY)
@@ -2705,43 +2771,59 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
return_value_used = RETURN_VALUE_USED(opline);
- switch (opline->op2.u.constant.value.lval) {
+ switch (Z_LVAL(opline->op2.u.constant)) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
- int dummy = 1;
zend_file_handle file_handle;
+ char cwd[MAXPATHLEN];
+ cwd_state state;
+
+ if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) {
+ cwd[0] = '\0';
+ } else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) {
+ cwd[0] = '\0';
+ }
+
+ state.cwd_length = strlen(cwd);
+ state.cwd = zend_strndup(cwd, state.cwd_length);
- if (SUCCESS == zend_stream_open(inc_filename->value.str.val, &file_handle TSRMLS_CC)) {
+ failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
+ zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1));
+
+ free(state.cwd);
+
+ if (failure_retval) {
+ /* do nothing */
+ } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
- file_handle.opened_path = estrndup(inc_filename->value.str.val, inc_filename->value.str.len);
+ file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
}
- 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);
+ if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
+ new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==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);
+ if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, inc_filename->value.str.val);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- break;
}
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), 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);
+ new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
efree(eval_desc);
}
break;
@@ -2778,8 +2860,8 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
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;
+ Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1;
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
}
}
@@ -2795,8 +2877,8 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
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;
+ Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval;
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
}
}
FREE_OP1();
@@ -2813,17 +2895,19 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, ANY)
varname = GET_OP1_ZVAL_PTR(BP_VAR_R);
- if (varname->type != IS_STRING) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
varname = &tmp;
+ } else if (OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) {
+ varname->refcount++;
}
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC);
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) {
zend_execute_data *ex = EXECUTE_DATA;
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
@@ -2841,13 +2925,15 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, ANY)
}
}
}
- ex = ex->prev_execute_data;
- } while (ex && ex->symbol_table == target_symbol_table);
+ ex = ex->prev_execute_data;
+ } while (ex && ex->symbol_table == target_symbol_table);
}
}
if (varname == &tmp) {
zval_dtor(&tmp);
+ } else if (OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) {
+ zval_ptr_dtor(&varname);
}
FREE_OP1();
ZEND_VM_NEXT_OPCODE();
@@ -2869,20 +2955,21 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -2903,6 +2990,9 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
}
}
+ if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -2985,7 +3075,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
zend_class_entry *ce = NULL;
zend_bool is_empty = 0;
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
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);
@@ -2994,7 +3084,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class");
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
}
-
+
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
@@ -3018,6 +3108,9 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
array_ptr = tmp;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
+ if (!ce || !ce->get_iterator) {
+ array_ptr->refcount++;
+ }
} else {
if (OP1_TYPE == IS_VAR &&
free_op1.var == NULL &&
@@ -3037,12 +3130,12 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
}
if (ce && ce->get_iterator) {
- iter = ce->get_iterator(ce, array_ptr TSRMLS_CC);
+ iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
if (iter && !EG(exception)) {
array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
} else {
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
FREE_OP1_VAR_PTR();
} else {
FREE_OP1_IF_VAR();
@@ -3066,6 +3159,11 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ FREE_OP1_VAR_PTR();
+ } else {
+ FREE_OP1_IF_VAR();
+ }
ZEND_VM_NEXT_OPCODE();
}
}
@@ -3073,8 +3171,14 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ FREE_OP1_VAR_PTR();
+ } else {
+ FREE_OP1_IF_VAR();
+ }
ZEND_VM_NEXT_OPCODE();
}
+ iter->index = -1; /* will be set to 0 before using next handler */
} else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
zend_hash_internal_pointer_reset(fe_ht);
if (ce) {
@@ -3083,8 +3187,11 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
char *str_key;
uint str_key_len;
ulong int_key;
- if (zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL) == HASH_KEY_IS_STRING
- && zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) {
+ 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, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS) {
break;
}
zend_hash_move_forward(fe_ht);
@@ -3096,7 +3203,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
is_empty = 1;
}
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
FREE_OP1_VAR_PTR();
} else {
FREE_OP1_IF_VAR();
@@ -3119,7 +3226,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
ulong int_key;
HashTable *fe_ht;
zend_object_iterator *iter = NULL;
- int key_type;
+ int key_type = 0;
zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY);
PZVAL_LOCK(array);
@@ -3143,9 +3250,9 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
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_IS_STRING || zend_check_property_access(zobj, str_key TSRMLS_CC) != SUCCESS);
+ } while (key_type == HASH_KEY_NON_EXISTANT || zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS);
if (use_key) {
- zend_unmangle_property_name_ex(str_key, str_key_len, &class_name, &prop_name);
+ zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name);
str_key_len = strlen(prop_name);
str_key = estrndup(prop_name, str_key_len);
str_key_len++;
@@ -3167,7 +3274,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
case ZEND_ITER_OBJECT:
/* !iter happens from exception */
- if (iter && iter->index++) {
+ if (iter && ++iter->index > 0) {
/* 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);
@@ -3177,7 +3284,8 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
ZEND_VM_NEXT_OPCODE();
}
}
- if (!iter || (iter->index > 1 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) {
+ /* If index is zero we come from FE_RESET and checked valid() already. */
+ if (!iter || (iter->index > 0 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) {
/* reached end of iteration */
if (EG(exception)) {
array->refcount--;
@@ -3209,7 +3317,6 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
int_key = iter->index;
}
}
-
break;
}
@@ -3230,15 +3337,16 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
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;
+ Z_STRVAL_P(key) = str_key;
+ Z_STRLEN_P(key) = str_key_len-1;
+ Z_TYPE_P(key) = IS_STRING;
break;
case HASH_KEY_IS_LONG:
- key->value.lval = int_key;
- key->type = IS_LONG;
+ Z_LVAL_P(key) = int_key;
+ Z_TYPE_P(key) = IS_LONG;
break;
default:
+ case HASH_KEY_NON_EXISTANT:
ZVAL_NULL(key);
break;
}
@@ -3257,7 +3365,7 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, ANY)
zend_bool isset = 1;
HashTable *target_symbol_table;
- if (varname->type != IS_STRING) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
@@ -3276,21 +3384,21 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, ANY)
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = 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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
} else {
- EX_T(opline->result.u.var).tmp_var.value.lval = isset;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset;
}
break;
case ZEND_ISEMPTY:
if (!isset || !i_zend_is_true(*value)) {
- EX_T(opline->result.u.var).tmp_var.value.lval = 1;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
} else {
- EX_T(opline->result.u.var).tmp_var.value.lval = 0;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
}
break;
}
@@ -3316,22 +3424,23 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
zend_free_op free_op2;
zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
- if ((*container)->type == IS_ARRAY) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -3369,7 +3478,7 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
break;
}
FREE_OP2();
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (IS_OP2_TMP_FREE()) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -3386,13 +3495,13 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -3412,14 +3521,14 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -3440,6 +3549,7 @@ ZEND_VM_HANDLER(148, ZEND_ISSET_ISEMPTY_PROP_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|C
ZEND_VM_HANDLER(79, ZEND_EXIT, CONST|TMP|VAR|UNUSED|CV, ANY)
{
+#if !defined(ZEND_VM_SPEC) || (OP1_TYPE != IS_UNUSED)
zend_op *opline = EX(opline);
if (OP1_TYPE != IS_UNUSED) {
zend_free_op free_op1;
@@ -3452,6 +3562,7 @@ ZEND_VM_HANDLER(79, ZEND_EXIT, CONST|TMP|VAR|UNUSED|CV, ANY)
}
FREE_OP1();
}
+#endif
zend_bailout();
ZEND_VM_NEXT_OPCODE();
}
@@ -3459,13 +3570,13 @@ ZEND_VM_HANDLER(79, ZEND_EXIT, CONST|TMP|VAR|UNUSED|CV, ANY)
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 */
+
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = EG(error_reporting);
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = 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);
}
@@ -3483,9 +3594,9 @@ 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;
+ if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.u.var).tmp_var) != 0) {
+ Z_TYPE(restored_error_reporting) = IS_LONG;
+ Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.u.var).tmp_var);
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);
@@ -3560,10 +3671,10 @@ ZEND_VM_HANDLER(105, ZEND_TICKS, CONST, ANY)
{
zend_op *opline = EX(opline);
- if (++EG(ticks_count)>=opline->op1.u.constant.value.lval) {
+ if (++EG(ticks_count)>=Z_LVAL(opline->op1.u.constant)) {
EG(ticks_count)=0;
if (zend_ticks_function) {
- zend_ticks_function(opline->op1.u.constant.value.lval);
+ zend_ticks_function(Z_LVAL(opline->op1.u.constant));
}
}
ZEND_VM_NEXT_OPCODE();
@@ -3606,8 +3717,6 @@ ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, ANY)
zend_error_noreturn(E_ERROR, "%s cannot implement %s - 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();
@@ -3617,7 +3726,8 @@ 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;
+ zend_uint catch_op_num;
+ int catched = 0;
zval **stack_zval_pp;
zval restored_error_reporting;
@@ -3636,7 +3746,8 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
}
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;
+ catch_op_num = EX(op_array)->try_catch_array[i].catch_op;
+ catched = 1;
}
}
@@ -3652,22 +3763,44 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc));
}
+ for (i=0; i<EX(op_array)->last_brk_cont; i++) {
+ if (EX(op_array)->brk_cont_array[i].start > op_num) {
+ /* further blocks will not be relevant... */
+ break;
+ }
+ if (op_num < EX(op_array)->brk_cont_array[i].brk) {
+ if (!catched ||
+ catch_op_num >= EX(op_array)->brk_cont_array[i].brk) {
+ zend_op *brk_opline = &EX(op_array)->opcodes[EX(op_array)->brk_cont_array[i].brk];
+
+ switch (brk_opline->opcode) {
+ case ZEND_SWITCH_FREE:
+ zend_switch_free(brk_opline, EX(Ts) TSRMLS_CC);
+ break;
+ case ZEND_FREE:
+ zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var);
+ break;
+ }
+ }
+ }
+ }
+
/* 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;
+ if (!EG(error_reporting) && EX(old_error_reporting) != NULL && Z_LVAL_P(EX(old_error_reporting)) != 0) {
+ Z_TYPE(restored_error_reporting) = IS_LONG;
+ Z_LVAL(restored_error_reporting) = Z_LVAL_P(EX(old_error_reporting));
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();
- }
+
+ if (!catched) {
+ ZEND_VM_RETURN_FROM_EXECUTE_LOOP();
+ } else {
+ ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]);
+ ZEND_VM_CONTINUE();
+ }
}
ZEND_VM_HANDLER(146, ZEND_VERIFY_ABSTRACT_CLASS, ANY, ANY)
@@ -3677,7 +3810,7 @@ ZEND_VM_HANDLER(146, ZEND_VERIFY_ABSTRACT_CLASS, ANY, ANY)
}
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) {
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 2417f69a7..19ecb8830 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -126,8 +126,8 @@ 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;
+ zend_class_entry *current_scope = NULL;
+ zval *current_this = NULL;
int return_value_used = RETURN_VALUE_USED(opline);
zend_bool should_change_scope;
zend_op *ctor_opline;
@@ -138,11 +138,11 @@ static int zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_NEXT_OPCODE(); /* Never reached */
}
if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
- zend_error(E_STRICT, "Function %s%s%s() is deprecated",
+ zend_error(E_STRICT, "Function %s%s%s() is deprecated",
EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
EX(function_state).function->common.scope ? "::" : "",
EX(function_state).function->common.function_name);
- };
+ }
}
zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL);
@@ -354,7 +354,7 @@ 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;
+ zend_uint arg_num = Z_LVAL(opline->op1.u.constant);
if (zend_ptr_stack_get_arg(arg_num, (void **) &param TSRMLS_CC)==FAILURE) {
char *space;
@@ -420,7 +420,7 @@ static int ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 */
@@ -434,13 +434,13 @@ static int ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 */
+
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = EG(error_reporting);
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = 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);
}
@@ -519,8 +519,6 @@ static int ZEND_ADD_INTERFACE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error_noreturn(E_ERROR, "%s cannot implement %s - 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();
@@ -530,7 +528,8 @@ 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;
+ zend_uint catch_op_num;
+ int catched = 0;
zval **stack_zval_pp;
zval restored_error_reporting;
@@ -549,7 +548,8 @@ static int ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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;
+ catch_op_num = EX(op_array)->try_catch_array[i].catch_op;
+ catched = 1;
}
}
@@ -565,22 +565,44 @@ static int ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc));
}
+ for (i=0; i<EX(op_array)->last_brk_cont; i++) {
+ if (EX(op_array)->brk_cont_array[i].start > op_num) {
+ /* further blocks will not be relevant... */
+ break;
+ }
+ if (op_num < EX(op_array)->brk_cont_array[i].brk) {
+ if (!catched ||
+ catch_op_num >= EX(op_array)->brk_cont_array[i].brk) {
+ zend_op *brk_opline = &EX(op_array)->opcodes[EX(op_array)->brk_cont_array[i].brk];
+
+ switch (brk_opline->opcode) {
+ case ZEND_SWITCH_FREE:
+ zend_switch_free(brk_opline, EX(Ts) TSRMLS_CC);
+ break;
+ case ZEND_FREE:
+ zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var);
+ break;
+ }
+ }
+ }
+ }
+
/* 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;
+ if (!EG(error_reporting) && EX(old_error_reporting) != NULL && Z_LVAL_P(EX(old_error_reporting)) != 0) {
+ Z_TYPE(restored_error_reporting) = IS_LONG;
+ Z_LVAL(restored_error_reporting) = Z_LVAL_P(EX(old_error_reporting));
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();
- }
+
+ if (!catched) {
+ ZEND_VM_RETURN_FROM_EXECUTE_LOOP();
+ } else {
+ ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]);
+ ZEND_VM_CONTINUE();
+ }
}
static int ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -590,7 +612,7 @@ static int ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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) {
@@ -609,7 +631,7 @@ 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) {
@@ -619,7 +641,7 @@ static int ZEND_FETCH_CLASS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
class_name = &opline->op2.u.constant;
- switch (class_name->type) {
+ switch (Z_TYPE_P(class_name)) {
case IS_OBJECT:
EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
break;
@@ -647,11 +669,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
char *function_name_strval;
int function_name_strlen;
zend_bool is_const = (IS_CONST == IS_CONST);
-
+
if (is_const) {
- function_name_strval = opline->op2.u.constant.value.str.val;
- function_name_strlen = opline->op2.u.constant.value.str.len;
+ function_name_strval = Z_STRVAL(opline->op2.u.constant);
+ function_name_strlen = Z_STRLEN(opline->op2.u.constant);
} else {
function_name = &opline->op2.u.constant;
@@ -672,6 +694,9 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
if(!ce->constructor) {
zend_error_noreturn(E_ERROR, "Can not call constructor");
}
+ if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+ zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name);
+ }
EX(fbc) = ce->constructor;
}
@@ -681,7 +706,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
if (IS_CONST != IS_UNUSED &&
EG(This) &&
Z_OBJ_HT_P(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
+ !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
@@ -702,7 +727,7 @@ static int ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_function *function;
char *function_name_strval, *lcname;
int function_name_strlen;
-
+
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);
@@ -742,16 +767,16 @@ 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_uint arg_num = Z_LVAL(opline->op1.u.constant);
zend_free_op free_res;
if (zend_ptr_stack_get_arg(arg_num, (void **) &param TSRMLS_CC)==FAILURE) {
- if (opline->op2.u.constant.type == IS_CONSTANT || opline->op2.u.constant.type==IS_CONSTANT_ARRAY) {
+ if (Z_TYPE(opline->op2.u.constant) == IS_CONSTANT || Z_TYPE(opline->op2.u.constant)==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) {
+ if (Z_TYPE(opline->op2.u.constant)==IS_CONSTANT_ARRAY) {
zval_copy_ctor(default_value);
}
default_value->refcount=1;
@@ -784,7 +809,7 @@ static int ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_BRK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zend_brk_cont_element *el;
el = zend_brk_cont(&opline->op2.u.constant, opline->op1.u.opline_num,
@@ -796,7 +821,7 @@ static int ZEND_BRK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zend_brk_cont_element *el;
el = zend_brk_cont(&opline->op2.u.constant, opline->op1.u.opline_num,
@@ -819,7 +844,7 @@ static int ZEND_FETCH_CLASS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
class_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
- switch (class_name->type) {
+ switch (Z_TYPE_P(class_name)) {
case IS_OBJECT:
EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
break;
@@ -851,8 +876,8 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_free_op free_op2;
if (is_const) {
- function_name_strval = opline->op2.u.constant.value.str.val;
- function_name_strlen = opline->op2.u.constant.value.str.len;
+ function_name_strval = Z_STRVAL(opline->op2.u.constant);
+ function_name_strlen = Z_STRLEN(opline->op2.u.constant);
} else {
function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
@@ -873,6 +898,9 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
if(!ce->constructor) {
zend_error_noreturn(E_ERROR, "Can not call constructor");
}
+ if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+ zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name);
+ }
EX(fbc) = ce->constructor;
}
@@ -882,7 +910,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (IS_TMP_VAR != IS_UNUSED &&
EG(This) &&
Z_OBJ_HT_P(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
+ !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
@@ -977,7 +1005,7 @@ static int ZEND_FETCH_CLASS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
class_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
- switch (class_name->type) {
+ switch (Z_TYPE_P(class_name)) {
case IS_OBJECT:
EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
break;
@@ -1009,8 +1037,8 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_free_op free_op2;
if (is_const) {
- function_name_strval = opline->op2.u.constant.value.str.val;
- function_name_strlen = opline->op2.u.constant.value.str.len;
+ function_name_strval = Z_STRVAL(opline->op2.u.constant);
+ function_name_strlen = Z_STRLEN(opline->op2.u.constant);
} else {
function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
@@ -1031,6 +1059,9 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if(!ce->constructor) {
zend_error_noreturn(E_ERROR, "Can not call constructor");
}
+ if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+ zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name);
+ }
EX(fbc) = ce->constructor;
}
@@ -1040,7 +1071,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (IS_VAR != IS_UNUSED &&
EG(This) &&
Z_OBJ_HT_P(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
+ !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
@@ -1125,7 +1156,7 @@ 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) {
@@ -1135,7 +1166,7 @@ static int ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
class_name = NULL;
- switch (class_name->type) {
+ switch (Z_TYPE_P(class_name)) {
case IS_OBJECT:
EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
break;
@@ -1163,11 +1194,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
char *function_name_strval;
int function_name_strlen;
zend_bool is_const = (IS_UNUSED == IS_CONST);
-
+
if (is_const) {
- function_name_strval = opline->op2.u.constant.value.str.val;
- function_name_strlen = opline->op2.u.constant.value.str.len;
+ function_name_strval = Z_STRVAL(opline->op2.u.constant);
+ function_name_strlen = Z_STRLEN(opline->op2.u.constant);
} else {
function_name = NULL;
@@ -1188,6 +1219,9 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
if(!ce->constructor) {
zend_error_noreturn(E_ERROR, "Can not call constructor");
}
+ if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+ zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name);
+ }
EX(fbc) = ce->constructor;
}
@@ -1197,7 +1231,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
if (IS_UNUSED != IS_UNUSED &&
EG(This) &&
Z_OBJ_HT_P(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
+ !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
@@ -1215,7 +1249,7 @@ 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) {
@@ -1225,7 +1259,7 @@ static int ZEND_FETCH_CLASS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
class_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
- switch (class_name->type) {
+ switch (Z_TYPE_P(class_name)) {
case IS_OBJECT:
EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
break;
@@ -1253,11 +1287,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
char *function_name_strval;
int function_name_strlen;
zend_bool is_const = (IS_CV == IS_CONST);
-
+
if (is_const) {
- function_name_strval = opline->op2.u.constant.value.str.val;
- function_name_strlen = opline->op2.u.constant.value.str.len;
+ function_name_strval = Z_STRVAL(opline->op2.u.constant);
+ function_name_strlen = Z_STRLEN(opline->op2.u.constant);
} else {
function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
@@ -1278,6 +1312,9 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if(!ce->constructor) {
zend_error_noreturn(E_ERROR, "Can not call constructor");
}
+ if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+ zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name);
+ }
EX(fbc) = ce->constructor;
}
@@ -1287,7 +1324,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (IS_CV != IS_UNUSED &&
EG(This) &&
Z_OBJ_HT_P(EG(This))->get_class_entry &&
- !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
+ !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
/* We are calling method of the other (incompatible) class,
but passing $this. This is done for compatibility with php-4. */
zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name);
@@ -1308,7 +1345,7 @@ static int ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_function *function;
char *function_name_strval, *lcname;
int function_name_strlen;
-
+
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);
@@ -1347,7 +1384,7 @@ static int ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_BRK_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zend_brk_cont_element *el;
el = zend_brk_cont(_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC), opline->op1.u.opline_num,
@@ -1359,7 +1396,7 @@ static int ZEND_BRK_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_CONT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zend_brk_cont_element *el;
el = zend_brk_cont(_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC), opline->op1.u.opline_num,
@@ -1371,7 +1408,7 @@ static int ZEND_CONT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -1382,7 +1419,7 @@ static int ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -1393,12 +1430,12 @@ static int ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
- zend_std_cast_object_tostring(z, &z_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
+ zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
@@ -1412,8 +1449,8 @@ 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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG;
return ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -1427,7 +1464,7 @@ static int zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND_OPCODE_HANDLE
zval tmp_varname;
HashTable *target_symbol_table;
- if (varname->type != IS_STRING) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp_varname = *varname;
zval_copy_ctor(&tmp_varname);
convert_to_string(&tmp_varname);
@@ -1447,13 +1484,13 @@ static int zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND_OPCODE_HANDLE
switch (type) {
case BP_VAR_R:
case BP_VAR_UNSET:
- zend_error(E_NOTICE,"Undefined variable: %s", varname->value.str.val);
+ zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_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: %s", varname->value.str.val);
+ zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
/* break missing intentionally */
case BP_VAR_W: {
zval *new_zval = &EG(uninitialized_zval);
@@ -1467,6 +1504,10 @@ static int zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND_OPCODE_HANDLE
}
switch (opline->op2.u.EA.type) {
case ZEND_FETCH_GLOBAL:
+ if (IS_CONST != IS_TMP_VAR) {
+
+ }
+ break;
case ZEND_FETCH_LOCAL:
break;
@@ -1542,7 +1583,7 @@ static int ZEND_FETCH_IS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
@@ -1558,7 +1599,7 @@ static int ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
@@ -1574,7 +1615,7 @@ static int ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
@@ -1593,11 +1634,11 @@ static int ZEND_JMPZNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
if (!retval) {
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
@@ -1610,11 +1651,11 @@ static int ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
if (retval) {
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
@@ -1627,13 +1668,13 @@ static int ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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_hash_find(EG(function_table), fname->value.str.val, fname->value.str.len+1, (void **) &EX(function_state).function)==FAILURE) {
- zend_error_noreturn(E_ERROR, "Unknown function: %s()", fname->value.str.val);
+ zend_error_noreturn(E_ERROR, "Call to undefined function %s()", fname->value.str.val);
}
EX(object) = NULL;
@@ -1645,7 +1686,7 @@ 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) {
@@ -1730,11 +1771,11 @@ 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) {
+ if (Z_TYPE_P(value) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "Can only throw objects");
}
/* Not sure if a complete copy is what we want here */
@@ -1753,13 +1794,13 @@ 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)) {
+ && ARG_MUST_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;
@@ -1777,11 +1818,11 @@ static int ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(&opline->op1.u.constant);
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
ZEND_VM_NEXT_OPCODE();
}
@@ -1789,7 +1830,7 @@ static int ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -1807,7 +1848,11 @@ static int ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 %s", ce->name);
+ if (ce) {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name);
+ } else {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object");
+ }
EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
EX_T(opline->result.u.var).var.ptr->refcount++;
}
@@ -1829,14 +1874,15 @@ static int ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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;
+ if (!EG(exception)) {
+ ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
+ Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC);
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT;
EX_T(opline->result.u.var).var.ptr->refcount=1;
EX_T(opline->result.u.var).var.ptr->is_ref=1;
+ if (!RETURN_VALUE_USED(opline) || EG(exception)) {
+ zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ }
}
ZEND_VM_NEXT_OPCODE();
@@ -1845,7 +1891,7 @@ static int ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -1894,7 +1940,7 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -1908,43 +1954,59 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
return_value_used = RETURN_VALUE_USED(opline);
- switch (opline->op2.u.constant.value.lval) {
+ switch (Z_LVAL(opline->op2.u.constant)) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
- int dummy = 1;
zend_file_handle file_handle;
+ char cwd[MAXPATHLEN];
+ cwd_state state;
+
+ if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) {
+ cwd[0] = '\0';
+ } else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) {
+ cwd[0] = '\0';
+ }
+
+ state.cwd_length = strlen(cwd);
+ state.cwd = zend_strndup(cwd, state.cwd_length);
+
+ failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
+ zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1));
- if (SUCCESS == zend_stream_open(inc_filename->value.str.val, &file_handle TSRMLS_CC)) {
+ free(state.cwd);
+
+ if (failure_retval) {
+ /* do nothing */
+ } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
- file_handle.opened_path = estrndup(inc_filename->value.str.val, inc_filename->value.str.len);
+ file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
}
- 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);
+ if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
+ new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==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);
+ if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, inc_filename->value.str.val);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- break;
}
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), 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);
+ new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
efree(eval_desc);
}
break;
@@ -1981,8 +2043,8 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1;
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
}
}
@@ -1998,8 +2060,8 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval;
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
}
}
@@ -2012,23 +2074,25 @@ 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) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
varname = &tmp;
+ } else if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
+ varname->refcount++;
}
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC);
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
- if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) {
- zend_execute_data *ex = execute_data;
+ target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) {
+ zend_execute_data *ex = execute_data;
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
do {
@@ -2044,13 +2108,15 @@ static int ZEND_UNSET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
- ex = ex->prev_execute_data;
- } while (ex && ex->symbol_table == target_symbol_table);
+ ex = ex->prev_execute_data;
+ } while (ex && ex->symbol_table == target_symbol_table);
}
}
if (varname == &tmp) {
zval_dtor(&tmp);
+ } else if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
+ zval_ptr_dtor(&varname);
}
ZEND_VM_NEXT_OPCODE();
@@ -2066,7 +2132,7 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_class_entry *ce = NULL;
zend_bool is_empty = 0;
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
array_ptr_ptr = NULL;
if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) {
ALLOC_INIT_ZVAL(array_ptr);
@@ -2075,7 +2141,7 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class");
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
}
-
+
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
@@ -2099,6 +2165,9 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
array_ptr = tmp;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
+ if (!ce || !ce->get_iterator) {
+ array_ptr->refcount++;
+ }
} else {
if (IS_CONST == IS_VAR &&
free_op1.var == NULL &&
@@ -2118,12 +2187,12 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
if (ce && ce->get_iterator) {
- iter = ce->get_iterator(ce, array_ptr TSRMLS_CC);
+ iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
if (iter && !EG(exception)) {
array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
} else {
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
} else {
@@ -2147,6 +2216,11 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ } else {
+
+ }
ZEND_VM_NEXT_OPCODE();
}
}
@@ -2154,8 +2228,14 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ } else {
+
+ }
ZEND_VM_NEXT_OPCODE();
}
+ iter->index = -1; /* will be set to 0 before using next handler */
} else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
zend_hash_internal_pointer_reset(fe_ht);
if (ce) {
@@ -2164,8 +2244,11 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
char *str_key;
uint str_key_len;
ulong int_key;
- if (zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL) == HASH_KEY_IS_STRING
- && zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) {
+ 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, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS) {
break;
}
zend_hash_move_forward(fe_ht);
@@ -2177,7 +2260,7 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
is_empty = 1;
}
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
} else {
@@ -2192,13 +2275,13 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
@@ -2217,21 +2300,21 @@ static int ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = 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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
} else {
- EX_T(opline->result.u.var).tmp_var.value.lval = isset;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset;
}
break;
case ZEND_ISEMPTY:
if (!isset || !i_zend_is_true(*value)) {
- EX_T(opline->result.u.var).tmp_var.value.lval = 1;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
} else {
- EX_T(opline->result.u.var).tmp_var.value.lval = 0;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
}
break;
}
@@ -2245,9 +2328,10 @@ static int ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_EXIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+#if 0 || (IS_CONST != IS_UNUSED)
zend_op *opline = EX(opline);
if (IS_CONST != IS_UNUSED) {
-
+
zval *ptr = &opline->op1.u.constant;
if (Z_TYPE_P(ptr) == IS_LONG) {
@@ -2257,6 +2341,7 @@ static int ZEND_EXIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
+#endif
zend_bailout();
ZEND_VM_NEXT_OPCODE();
}
@@ -2264,7 +2349,7 @@ static int ZEND_EXIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -2279,10 +2364,10 @@ 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) {
+ if (++EG(ticks_count)>=Z_LVAL(opline->op1.u.constant)) {
EG(ticks_count)=0;
if (zend_ticks_function) {
- zend_ticks_function(opline->op1.u.constant.value.lval);
+ zend_ticks_function(Z_LVAL(opline->op1.u.constant));
}
}
ZEND_VM_NEXT_OPCODE();
@@ -2291,7 +2376,7 @@ static int ZEND_TICKS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2304,7 +2389,7 @@ static int ZEND_ADD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2317,7 +2402,7 @@ static int ZEND_SUB_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2330,7 +2415,7 @@ static int ZEND_MUL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2343,7 +2428,7 @@ static int ZEND_DIV_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2356,7 +2441,7 @@ static int ZEND_MOD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2369,7 +2454,7 @@ static int ZEND_SL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2382,7 +2467,7 @@ static int ZEND_SR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2395,7 +2480,7 @@ static int ZEND_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2408,7 +2493,7 @@ static int ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2421,7 +2506,7 @@ static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
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,
@@ -2434,7 +2519,7 @@ static int ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2447,7 +2532,7 @@ static int ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2460,7 +2545,7 @@ static int ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2473,7 +2558,7 @@ static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER
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,
@@ -2486,7 +2571,7 @@ static int ZEND_BW_OR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2499,7 +2584,7 @@ static int ZEND_BW_AND_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2512,7 +2597,7 @@ static int ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -2526,7 +2611,7 @@ 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) {
@@ -2563,7 +2648,7 @@ static int ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
/* 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) {
+ if (zend_hash_find(&ce->constants_table, Z_STRVAL(opline->op2.u.constant), Z_STRLEN(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);
@@ -2597,36 +2682,39 @@ static int ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
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 *expr_ptr;
zval *offset=&opline->op2.u.constant;
+#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
+ zval **expr_ptr_ptr = NULL;
+
if (opline->extended_value) {
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
expr_ptr=&opline->op1.u.constant;
}
+#else
+ expr_ptr=&opline->op1.u.constant;
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -2638,19 +2726,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -2660,7 +2748,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
}
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -2672,7 +2760,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_CONST == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_CONST != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_ADD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -2946,34 +3043,37 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
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 *expr_ptr;
zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
+ zval **expr_ptr_ptr = NULL;
+
if (opline->extended_value) {
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
expr_ptr=&opline->op1.u.constant;
}
+#else
+ expr_ptr=&opline->op1.u.constant;
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -2985,19 +3085,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -3007,7 +3107,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
zval_dtor(free_op2.var);
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -3019,7 +3119,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_CONST == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_CONST != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_ADD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -3293,34 +3402,37 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
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 *expr_ptr;
zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
+ zval **expr_ptr_ptr = NULL;
+
if (opline->extended_value) {
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
expr_ptr=&opline->op1.u.constant;
}
+#else
+ expr_ptr=&opline->op1.u.constant;
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -3332,19 +3444,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -3354,7 +3466,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
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);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -3366,42 +3478,54 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_CONST == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_CONST != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
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 *expr_ptr;
zval *offset=NULL;
+#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
+ zval **expr_ptr_ptr = NULL;
+
if (opline->extended_value) {
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
expr_ptr=&opline->op1.u.constant;
}
+#else
+ expr_ptr=&opline->op1.u.constant;
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -3413,19 +3537,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -3435,7 +3559,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
}
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -3447,13 +3571,22 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_CONST == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_CONST != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
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,
@@ -3466,7 +3599,7 @@ static int ZEND_ADD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3479,7 +3612,7 @@ static int ZEND_SUB_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3492,7 +3625,7 @@ static int ZEND_MUL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3505,7 +3638,7 @@ static int ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3518,7 +3651,7 @@ static int ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3531,7 +3664,7 @@ static int ZEND_SL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3544,7 +3677,7 @@ static int ZEND_SR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3557,7 +3690,7 @@ static int ZEND_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3570,7 +3703,7 @@ static int ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3583,7 +3716,7 @@ static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3596,7 +3729,7 @@ static int ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3609,7 +3742,7 @@ static int ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3622,7 +3755,7 @@ static int ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3635,7 +3768,7 @@ static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
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,
@@ -3648,7 +3781,7 @@ static int ZEND_BW_OR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3661,7 +3794,7 @@ static int ZEND_BW_AND_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3674,7 +3807,7 @@ static int ZEND_BW_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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,
@@ -3688,7 +3821,7 @@ 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) {
@@ -3718,36 +3851,39 @@ static int ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 *expr_ptr;
zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
+#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
+ zval **expr_ptr_ptr = NULL;
+
if (opline->extended_value) {
expr_ptr_ptr=NULL;
expr_ptr = *expr_ptr_ptr;
} else {
expr_ptr=&opline->op1.u.constant;
}
+#else
+ expr_ptr=&opline->op1.u.constant;
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -3759,19 +3895,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -3781,7 +3917,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -3793,7 +3929,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_CONST == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_CONST != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_BW_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -3826,7 +3971,7 @@ static int ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *z = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
- zend_std_cast_object_tostring(z, &z_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
+ zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
@@ -3841,8 +3986,8 @@ 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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG;
return ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -3856,7 +4001,7 @@ static int zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_OPCODE_HANDLER_
zval tmp_varname;
HashTable *target_symbol_table;
- if (varname->type != IS_STRING) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp_varname = *varname;
zval_copy_ctor(&tmp_varname);
convert_to_string(&tmp_varname);
@@ -3876,13 +4021,13 @@ static int zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_OPCODE_HANDLER_
switch (type) {
case BP_VAR_R:
case BP_VAR_UNSET:
- zend_error(E_NOTICE,"Undefined variable: %s", varname->value.str.val);
+ zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_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: %s", varname->value.str.val);
+ zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
/* break missing intentionally */
case BP_VAR_W: {
zval *new_zval = &EG(uninitialized_zval);
@@ -3896,6 +4041,10 @@ static int zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_OPCODE_HANDLER_
}
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;
@@ -4029,8 +4178,8 @@ static int ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
if (!retval) {
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
@@ -4047,8 +4196,8 @@ static int ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
if (retval) {
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
@@ -4158,7 +4307,7 @@ static int ZEND_THROW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
- if (value->type != IS_OBJECT) {
+ if (Z_TYPE_P(value) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "Can only throw objects");
}
/* Not sure if a complete copy is what we want here */
@@ -4177,7 +4326,7 @@ 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)) {
+ && ARG_MUST_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);
}
{
@@ -4204,8 +4353,8 @@ static int ZEND_BOOL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC));
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -4238,7 +4387,11 @@ static int ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 %s", ce->name);
+ if (ce) {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name);
+ } else {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object");
+ }
EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
EX_T(opline->result.u.var).var.ptr->refcount++;
}
@@ -4260,14 +4413,15 @@ static int ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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;
+ if (!EG(exception)) {
+ ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
+ Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC);
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT;
EX_T(opline->result.u.var).var.ptr->refcount=1;
EX_T(opline->result.u.var).var.ptr->is_ref=1;
+ if (!RETURN_VALUE_USED(opline) || EG(exception)) {
+ zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ }
}
ZEND_VM_NEXT_OPCODE();
@@ -4339,43 +4493,59 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
return_value_used = RETURN_VALUE_USED(opline);
- switch (opline->op2.u.constant.value.lval) {
+ switch (Z_LVAL(opline->op2.u.constant)) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
- int dummy = 1;
zend_file_handle file_handle;
+ char cwd[MAXPATHLEN];
+ cwd_state state;
- if (SUCCESS == zend_stream_open(inc_filename->value.str.val, &file_handle TSRMLS_CC)) {
+ if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) {
+ cwd[0] = '\0';
+ } else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) {
+ cwd[0] = '\0';
+ }
+
+ state.cwd_length = strlen(cwd);
+ state.cwd = zend_strndup(cwd, state.cwd_length);
+
+ failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
+ zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1));
+
+ free(state.cwd);
+
+ if (failure_retval) {
+ /* do nothing */
+ } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
- file_handle.opened_path = estrndup(inc_filename->value.str.val, inc_filename->value.str.len);
+ file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
}
- 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);
+ if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
+ new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==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);
+ if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, inc_filename->value.str.val);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- break;
}
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), 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);
+ new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
efree(eval_desc);
}
break;
@@ -4412,8 +4582,8 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1;
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
}
}
@@ -4429,8 +4599,8 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval;
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
}
}
zval_dtor(free_op1.var);
@@ -4447,19 +4617,21 @@ static int ZEND_UNSET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
- if (varname->type != IS_STRING) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
varname = &tmp;
+ } else if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
+ varname->refcount++;
}
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC);
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
- if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) {
- zend_execute_data *ex = execute_data;
+ target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) {
+ zend_execute_data *ex = execute_data;
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
do {
@@ -4475,13 +4647,15 @@ static int ZEND_UNSET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
- ex = ex->prev_execute_data;
- } while (ex && ex->symbol_table == target_symbol_table);
+ ex = ex->prev_execute_data;
+ } while (ex && ex->symbol_table == target_symbol_table);
}
}
if (varname == &tmp) {
zval_dtor(&tmp);
+ } else if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
+ zval_ptr_dtor(&varname);
}
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -4497,7 +4671,7 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_class_entry *ce = NULL;
zend_bool is_empty = 0;
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
array_ptr_ptr = NULL;
if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) {
ALLOC_INIT_ZVAL(array_ptr);
@@ -4506,7 +4680,7 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class");
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
}
-
+
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
@@ -4530,6 +4704,9 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
array_ptr = tmp;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
+ if (!ce || !ce->get_iterator) {
+ array_ptr->refcount++;
+ }
} else {
if (IS_TMP_VAR == IS_VAR &&
free_op1.var == NULL &&
@@ -4549,12 +4726,12 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
if (ce && ce->get_iterator) {
- iter = ce->get_iterator(ce, array_ptr TSRMLS_CC);
+ iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
if (iter && !EG(exception)) {
array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
} else {
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
} else {
@@ -4578,6 +4755,11 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ } else {
+
+ }
ZEND_VM_NEXT_OPCODE();
}
}
@@ -4585,8 +4767,14 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ } else {
+
+ }
ZEND_VM_NEXT_OPCODE();
}
+ iter->index = -1; /* will be set to 0 before using next handler */
} else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
zend_hash_internal_pointer_reset(fe_ht);
if (ce) {
@@ -4595,8 +4783,11 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
char *str_key;
uint str_key_len;
ulong int_key;
- if (zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL) == HASH_KEY_IS_STRING
- && zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) {
+ 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, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS) {
break;
}
zend_hash_move_forward(fe_ht);
@@ -4608,7 +4799,7 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
is_empty = 1;
}
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
} else {
@@ -4629,7 +4820,7 @@ static int ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_bool isset = 1;
HashTable *target_symbol_table;
- if (varname->type != IS_STRING) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
@@ -4648,21 +4839,21 @@ static int ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = 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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
} else {
- EX_T(opline->result.u.var).tmp_var.value.lval = isset;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset;
}
break;
case ZEND_ISEMPTY:
if (!isset || !i_zend_is_true(*value)) {
- EX_T(opline->result.u.var).tmp_var.value.lval = 1;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
} else {
- EX_T(opline->result.u.var).tmp_var.value.lval = 0;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
}
break;
}
@@ -4677,6 +4868,7 @@ static int ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_EXIT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+#if 0 || (IS_TMP_VAR != IS_UNUSED)
zend_op *opline = EX(opline);
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op1;
@@ -4689,6 +4881,7 @@ static int ZEND_EXIT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
zval_dtor(free_op1.var);
}
+#endif
zend_bailout();
ZEND_VM_NEXT_OPCODE();
}
@@ -4698,9 +4891,9 @@ 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;
+ if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.u.var).tmp_var) != 0) {
+ Z_TYPE(restored_error_reporting) = IS_LONG;
+ Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.u.var).tmp_var);
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);
@@ -4982,16 +5175,16 @@ static int ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
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 (Z_TYPE_P(container) != 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);
+ EX_T(opline->result.u.var).var.ptr_ptr = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, BP_VAR_R TSRMLS_CC);
SELECTIVE_PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &opline->result);
}
@@ -5039,12 +5232,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_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 (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -5112,34 +5305,37 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
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 *expr_ptr;
zval *offset=&opline->op2.u.constant;
+#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 1) { /* temporary variable */
+ if (1) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -5151,19 +5347,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -5173,7 +5369,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -5185,7 +5381,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_TMP_VAR == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_TMP_VAR != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_ADD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -5467,12 +5672,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_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 (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -5542,34 +5747,37 @@ 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 *expr_ptr;
zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 1) { /* temporary variable */
+ if (1) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -5581,19 +5789,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -5603,7 +5811,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
zval_dtor(free_op2.var);
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -5615,7 +5823,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_TMP_VAR == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_TMP_VAR != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -5897,12 +6114,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_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 (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -5972,34 +6189,37 @@ 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 *expr_ptr;
zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 1) { /* temporary variable */
+ if (1) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -6011,19 +6231,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -6033,7 +6253,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -6045,7 +6265,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_TMP_VAR == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_TMP_VAR != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6053,34 +6282,37 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_AR
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 *expr_ptr;
zval *offset=NULL;
+#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 1) { /* temporary variable */
+ if (1) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -6092,19 +6324,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_AR
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -6114,7 +6346,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_AR
}
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -6126,7 +6358,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_AR
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_TMP_VAR == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_TMP_VAR != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_ADD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6407,12 +6648,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_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 (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -6480,34 +6721,37 @@ 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 *expr_ptr;
zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
+#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 1) { /* temporary variable */
+ if (1) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -6519,19 +6763,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -6541,7 +6785,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -6553,7 +6797,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_TMP_VAR == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_TMP_VAR != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_BW_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6748,7 +7001,7 @@ static int ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *z = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
- zend_std_cast_object_tostring(z, &z_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
+ zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
@@ -6763,8 +7016,8 @@ 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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG;
return ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -6778,7 +7031,7 @@ static int zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_OPCODE_HANDLER_
zval tmp_varname;
HashTable *target_symbol_table;
- if (varname->type != IS_STRING) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp_varname = *varname;
zval_copy_ctor(&tmp_varname);
convert_to_string(&tmp_varname);
@@ -6798,13 +7051,13 @@ static int zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_OPCODE_HANDLER_
switch (type) {
case BP_VAR_R:
case BP_VAR_UNSET:
- zend_error(E_NOTICE,"Undefined variable: %s", varname->value.str.val);
+ zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_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: %s", varname->value.str.val);
+ zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
/* break missing intentionally */
case BP_VAR_W: {
zval *new_zval = &EG(uninitialized_zval);
@@ -6818,6 +7071,10 @@ static int zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_OPCODE_HANDLER_
}
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;
@@ -6951,8 +7208,8 @@ static int ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
if (!retval) {
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
@@ -6969,8 +7226,8 @@ static int ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
if (retval) {
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
@@ -7074,7 +7331,7 @@ static int ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
- if (value->type != IS_OBJECT) {
+ if (Z_TYPE_P(value) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "Can only throw objects");
}
/* Not sure if a complete copy is what we want here */
@@ -7093,7 +7350,7 @@ 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)) {
+ && ARG_MUST_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);
}
{
@@ -7154,12 +7411,12 @@ static int ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} 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 != &EG(uninitialized_zval) &&
+ (PZVAL_IS_REF(varptr) ||
(varptr->refcount == 1 && (IS_VAR == IS_CV || free_op1.var)))) {
varptr->is_ref = 1;
varptr->refcount++;
@@ -7217,8 +7474,8 @@ static int ZEND_BOOL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC));
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -7251,7 +7508,11 @@ static int ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 %s", ce->name);
+ if (ce) {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name);
+ } else {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object");
+ }
EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
EX_T(opline->result.u.var).var.ptr->refcount++;
}
@@ -7273,14 +7534,15 @@ static int ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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;
+ if (!EG(exception)) {
+ ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
+ Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC);
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT;
EX_T(opline->result.u.var).var.ptr->refcount=1;
EX_T(opline->result.u.var).var.ptr->is_ref=1;
+ if (!RETURN_VALUE_USED(opline) || EG(exception)) {
+ zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ }
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -7352,43 +7614,59 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
return_value_used = RETURN_VALUE_USED(opline);
- switch (opline->op2.u.constant.value.lval) {
+ switch (Z_LVAL(opline->op2.u.constant)) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
- int dummy = 1;
zend_file_handle file_handle;
+ char cwd[MAXPATHLEN];
+ cwd_state state;
- if (SUCCESS == zend_stream_open(inc_filename->value.str.val, &file_handle TSRMLS_CC)) {
+ if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) {
+ cwd[0] = '\0';
+ } else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) {
+ cwd[0] = '\0';
+ }
+
+ state.cwd_length = strlen(cwd);
+ state.cwd = zend_strndup(cwd, state.cwd_length);
+
+ failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
+ zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1));
+
+ free(state.cwd);
+
+ if (failure_retval) {
+ /* do nothing */
+ } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
- file_handle.opened_path = estrndup(inc_filename->value.str.val, inc_filename->value.str.len);
+ file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
}
- 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);
+ if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
+ new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==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);
+ if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, inc_filename->value.str.val);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- break;
}
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), 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);
+ new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
efree(eval_desc);
}
break;
@@ -7425,8 +7703,8 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1;
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
}
}
@@ -7442,8 +7720,8 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval;
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
}
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -7460,19 +7738,21 @@ static int ZEND_UNSET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
- if (varname->type != IS_STRING) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
varname = &tmp;
+ } else if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
+ varname->refcount++;
}
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC);
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
- if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) {
- zend_execute_data *ex = execute_data;
+ target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) {
+ zend_execute_data *ex = execute_data;
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
do {
@@ -7488,13 +7768,15 @@ static int ZEND_UNSET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
- ex = ex->prev_execute_data;
- } while (ex && ex->symbol_table == target_symbol_table);
+ ex = ex->prev_execute_data;
+ } while (ex && ex->symbol_table == target_symbol_table);
}
}
if (varname == &tmp) {
zval_dtor(&tmp);
+ } else if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
+ zval_ptr_dtor(&varname);
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -7510,7 +7792,7 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_class_entry *ce = NULL;
zend_bool is_empty = 0;
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
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);
@@ -7519,7 +7801,7 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class");
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
}
-
+
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
@@ -7543,6 +7825,9 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
array_ptr = tmp;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
+ if (!ce || !ce->get_iterator) {
+ array_ptr->refcount++;
+ }
} else {
if (IS_VAR == IS_VAR &&
free_op1.var == NULL &&
@@ -7562,12 +7847,12 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
if (ce && ce->get_iterator) {
- iter = ce->get_iterator(ce, array_ptr TSRMLS_CC);
+ iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
if (iter && !EG(exception)) {
array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
} else {
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
} else {
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -7591,6 +7876,11 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ 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();
}
}
@@ -7598,8 +7888,14 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+ 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();
}
+ iter->index = -1; /* will be set to 0 before using next handler */
} else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
zend_hash_internal_pointer_reset(fe_ht);
if (ce) {
@@ -7608,8 +7904,11 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
char *str_key;
uint str_key_len;
ulong int_key;
- if (zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL) == HASH_KEY_IS_STRING
- && zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) {
+ 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, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS) {
break;
}
zend_hash_move_forward(fe_ht);
@@ -7621,7 +7920,7 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
is_empty = 1;
}
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
} else {
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -7644,7 +7943,7 @@ static int ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ulong int_key;
HashTable *fe_ht;
zend_object_iterator *iter = NULL;
- int key_type;
+ int key_type = 0;
zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY);
PZVAL_LOCK(array);
@@ -7668,9 +7967,9 @@ static int ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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_IS_STRING || zend_check_property_access(zobj, str_key TSRMLS_CC) != SUCCESS);
+ } while (key_type == HASH_KEY_NON_EXISTANT || zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS);
if (use_key) {
- zend_unmangle_property_name_ex(str_key, str_key_len, &class_name, &prop_name);
+ zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name);
str_key_len = strlen(prop_name);
str_key = estrndup(prop_name, str_key_len);
str_key_len++;
@@ -7692,7 +7991,7 @@ static int ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case ZEND_ITER_OBJECT:
/* !iter happens from exception */
- if (iter && iter->index++) {
+ if (iter && ++iter->index > 0) {
/* 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);
@@ -7702,7 +8001,8 @@ static int ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
ZEND_VM_NEXT_OPCODE();
}
}
- if (!iter || (iter->index > 1 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) {
+ /* If index is zero we come from FE_RESET and checked valid() already. */
+ if (!iter || (iter->index > 0 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) {
/* reached end of iteration */
if (EG(exception)) {
array->refcount--;
@@ -7734,7 +8034,6 @@ static int ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
int_key = iter->index;
}
}
-
break;
}
@@ -7755,15 +8054,16 @@ static int ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_STRVAL_P(key) = str_key;
+ Z_STRLEN_P(key) = str_key_len-1;
+ Z_TYPE_P(key) = IS_STRING;
break;
case HASH_KEY_IS_LONG:
- key->value.lval = int_key;
- key->type = IS_LONG;
+ Z_LVAL_P(key) = int_key;
+ Z_TYPE_P(key) = IS_LONG;
break;
default:
+ case HASH_KEY_NON_EXISTANT:
ZVAL_NULL(key);
break;
}
@@ -7782,7 +8082,7 @@ static int ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_bool isset = 1;
HashTable *target_symbol_table;
- if (varname->type != IS_STRING) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
@@ -7801,21 +8101,21 @@ static int ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = 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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
} else {
- EX_T(opline->result.u.var).tmp_var.value.lval = isset;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset;
}
break;
case ZEND_ISEMPTY:
if (!isset || !i_zend_is_true(*value)) {
- EX_T(opline->result.u.var).tmp_var.value.lval = 1;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
} else {
- EX_T(opline->result.u.var).tmp_var.value.lval = 0;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
}
break;
}
@@ -7830,6 +8130,7 @@ static int ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+#if 0 || (IS_VAR != IS_UNUSED)
zend_op *opline = EX(opline);
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op1;
@@ -7842,6 +8143,7 @@ static int ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
}
+#endif
zend_bailout();
ZEND_VM_NEXT_OPCODE();
}
@@ -8128,7 +8430,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*binary_op)(zval
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
@@ -8165,17 +8467,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*binary_op)(zval
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -8242,7 +8544,7 @@ static int zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binary_op)(zval *re
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -8377,7 +8679,7 @@ static int zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t incdec_op, ZE
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (!RETURN_VALUE_UNUSED(&opline->result)) {
@@ -8410,9 +8712,9 @@ static int zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t incdec_op, ZE
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -8469,7 +8771,7 @@ static int zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_t incdec_op, Z
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
*retval = *EG(uninitialized_zval_ptr);
@@ -8499,10 +8801,10 @@ static int zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_t incdec_op, Z
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -8553,7 +8855,9 @@ static int ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_free_op free_op1;
zval *dim = &opline->op2.u.constant;
- if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) {
+ if (opline->extended_value == ZEND_FETCH_ADD_LOCK &&
+ IS_VAR != IS_CV &&
+ EX_T(opline->op1.u.var).var.ptr_ptr) {
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);
@@ -8570,6 +8874,11 @@ static int ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -8582,6 +8891,11 @@ static int ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -8604,13 +8918,18 @@ static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
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 (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -8634,6 +8953,11 @@ static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).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");
@@ -8673,7 +8997,7 @@ static int zend_fetch_property_address_read_helper_SPEC_VAR_CONST(int type, ZEND
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -8681,7 +9005,7 @@ static int zend_fetch_property_address_read_helper_SPEC_VAR_CONST(int type, ZEND
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) {
@@ -8735,6 +9059,11 @@ static int ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -8754,6 +9083,11 @@ static int ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -8781,6 +9115,11 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
} else {
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
} else {
@@ -8809,6 +9148,11 @@ static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
@@ -8848,7 +9192,7 @@ static int ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
object_ptr = NULL;
}
- if (object_ptr && (*object_ptr)->type == IS_OBJECT) {
+ if (object_ptr && Z_TYPE_PP(object_ptr) == 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;
@@ -8870,7 +9214,7 @@ static int ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -8895,12 +9239,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_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 (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -8969,34 +9313,37 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
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 *expr_ptr;
zval *offset=&opline->op2.u.constant;
+#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -9008,19 +9355,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -9030,7 +9377,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -9042,7 +9389,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_VAR == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_VAR != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -9061,20 +9417,21 @@ static int ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -9095,6 +9452,9 @@ static int ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
+ if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -9177,25 +9537,26 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(int prop_dim,
long index;
if (container) {
-
+
zval *offset = &opline->op2.u.constant;
- if ((*container)->type == IS_ARRAY) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -9233,7 +9594,7 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(int prop_dim,
break;
}
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -9250,13 +9611,13 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(int prop_dim,
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -9276,14 +9637,14 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(int prop_dim,
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -9553,7 +9914,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*binary_op)(zval *
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
zval_dtor(free_op2.var);
FREE_OP(free_op_data1);
@@ -9590,17 +9951,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*binary_op)(zval *
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -9667,7 +10028,7 @@ static int zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_op)(zval *resu
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -9803,7 +10164,7 @@ static int zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t incdec_op, ZEND
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != 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)) {
@@ -9836,9 +10197,9 @@ static int zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t incdec_op, ZEND
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -9895,7 +10256,7 @@ static int zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t incdec_op, ZEN
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_dtor(free_op2.var);
*retval = *EG(uninitialized_zval_ptr);
@@ -9925,10 +10286,10 @@ static int zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t incdec_op, ZEN
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -9979,7 +10340,9 @@ static int ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (opline->extended_value == ZEND_FETCH_ADD_LOCK &&
+ IS_VAR != IS_CV &&
+ EX_T(opline->op1.u.var).var.ptr_ptr) {
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);
@@ -9996,6 +10359,11 @@ static int ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -10008,6 +10376,11 @@ static int ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -10030,13 +10403,18 @@ static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
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 (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -10060,6 +10438,11 @@ static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).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");
@@ -10099,7 +10482,7 @@ static int zend_fetch_property_address_read_helper_SPEC_VAR_TMP(int type, ZEND_O
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -10161,6 +10544,11 @@ static int ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zval_dtor(free_op2.var);
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -10180,6 +10568,11 @@ static int ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zval_dtor(free_op2.var);
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -10207,6 +10600,11 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
} else {
zval_dtor(free_op2.var);
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
} else {
@@ -10235,6 +10633,11 @@ static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zval_dtor(free_op2.var);
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
@@ -10274,7 +10677,7 @@ static int ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
object_ptr = NULL;
}
- if (object_ptr && (*object_ptr)->type == IS_OBJECT) {
+ if (object_ptr && Z_TYPE_PP(object_ptr) == 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;
@@ -10322,12 +10725,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_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 (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -10398,34 +10801,37 @@ 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 *expr_ptr;
zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -10437,19 +10843,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -10459,7 +10865,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
zval_dtor(free_op2.var);
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -10471,7 +10877,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_VAR == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_VAR != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -10490,20 +10905,21 @@ static int ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -10524,6 +10940,9 @@ static int ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
+ if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -10609,22 +11028,23 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(int prop_dim, ZE
zend_free_op free_op2;
zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
- if ((*container)->type == IS_ARRAY) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -10662,7 +11082,7 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(int prop_dim, ZE
break;
}
zval_dtor(free_op2.var);
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (1) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -10679,13 +11099,13 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(int prop_dim, ZE
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -10705,14 +11125,14 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(int prop_dim, ZE
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -10982,7 +11402,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*binary_op)(zval *
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != 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);
@@ -11019,17 +11439,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*binary_op)(zval *
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -11096,7 +11516,7 @@ static int zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_op)(zval *resu
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -11232,7 +11652,7 @@ static int zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t incdec_op, ZEND
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != 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)) {
@@ -11265,9 +11685,9 @@ static int zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t incdec_op, ZEND
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -11324,7 +11744,7 @@ static int zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t incdec_op, ZEN
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != 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);
@@ -11354,10 +11774,10 @@ static int zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t incdec_op, ZEN
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -11408,7 +11828,9 @@ static int ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (opline->extended_value == ZEND_FETCH_ADD_LOCK &&
+ IS_VAR != IS_CV &&
+ EX_T(opline->op1.u.var).var.ptr_ptr) {
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);
@@ -11425,6 +11847,11 @@ static int ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -11437,6 +11864,11 @@ static int ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -11459,13 +11891,18 @@ static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
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 (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -11489,6 +11926,11 @@ static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).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");
@@ -11528,7 +11970,7 @@ static int zend_fetch_property_address_read_helper_SPEC_VAR_VAR(int type, ZEND_O
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -11590,6 +12032,11 @@ static int ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -11609,6 +12056,11 @@ static int ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -11636,6 +12088,11 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
} else {
@@ -11664,6 +12121,11 @@ static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
@@ -11703,7 +12165,7 @@ static int ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
object_ptr = NULL;
}
- if (object_ptr && (*object_ptr)->type == IS_OBJECT) {
+ if (object_ptr && Z_TYPE_PP(object_ptr) == 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;
@@ -11746,7 +12208,7 @@ static int ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_VAR == IS_VAR &&
value_ptr_ptr &&
!(*value_ptr_ptr)->is_ref &&
- opline->extended_value == ZEND_RETURNS_FUNCTION &&
+ 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() */
@@ -11789,12 +12251,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_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 (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -11865,34 +12327,37 @@ 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 *expr_ptr;
zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -11904,19 +12369,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -11926,7 +12391,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -11938,7 +12403,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_VAR == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_VAR != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -11957,20 +12431,21 @@ static int ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -11991,6 +12466,9 @@ static int ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
+ if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -12076,22 +12554,23 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(int prop_dim, ZE
zend_free_op free_op2;
zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
- if ((*container)->type == IS_ARRAY) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -12129,7 +12608,7 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(int prop_dim, ZE
break;
}
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -12146,13 +12625,13 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(int prop_dim, ZE
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -12172,14 +12651,14 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(int prop_dim, ZE
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -12215,7 +12694,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*binary_op)(zva
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
@@ -12252,17 +12731,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*binary_op)(zva
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -12329,7 +12808,7 @@ static int zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *r
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -12459,6 +12938,11 @@ static int ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -12471,6 +12955,11 @@ static int ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -12481,13 +12970,18 @@ static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_A
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 (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -12506,7 +13000,7 @@ static int ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
object_ptr = NULL;
}
- if (object_ptr && (*object_ptr)->type == IS_OBJECT) {
+ if (object_ptr && Z_TYPE_PP(object_ptr) == 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;
@@ -12530,34 +13024,37 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_AR
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 *expr_ptr;
zval *offset=NULL;
+#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -12569,19 +13066,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_AR
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -12591,7 +13088,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_AR
}
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -12603,7 +13100,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_AR
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_VAR == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_VAR != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -12857,7 +13363,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*binary_op)(zval *r
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
@@ -12894,17 +13400,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*binary_op)(zval *r
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -12971,7 +13477,7 @@ static int zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_op)(zval *resul
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -13106,7 +13612,7 @@ static int zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND_
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (!RETURN_VALUE_UNUSED(&opline->result)) {
@@ -13139,9 +13645,9 @@ static int zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND_
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -13198,7 +13704,7 @@ static int zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
*retval = *EG(uninitialized_zval_ptr);
@@ -13228,10 +13734,10 @@ static int zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -13282,7 +13788,9 @@ static int ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (opline->extended_value == ZEND_FETCH_ADD_LOCK &&
+ IS_VAR != IS_CV &&
+ EX_T(opline->op1.u.var).var.ptr_ptr) {
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);
@@ -13299,6 +13807,11 @@ static int ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -13311,6 +13824,11 @@ static int ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -13333,13 +13851,18 @@ static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -13363,6 +13886,11 @@ static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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 (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).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");
@@ -13402,7 +13930,7 @@ static int zend_fetch_property_address_read_helper_SPEC_VAR_CV(int type, ZEND_OP
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -13410,7 +13938,7 @@ static int zend_fetch_property_address_read_helper_SPEC_VAR_CV(int type, ZEND_OP
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) {
@@ -13464,6 +13992,11 @@ static int ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -13483,6 +14016,11 @@ static int ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
@@ -13510,6 +14048,11 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
} else {
@@ -13538,6 +14081,11 @@ static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_VAR == IS_VAR && (free_op1.var != NULL) &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
@@ -13577,7 +14125,7 @@ static int ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
object_ptr = NULL;
}
- if (object_ptr && (*object_ptr)->type == IS_OBJECT) {
+ if (object_ptr && Z_TYPE_PP(object_ptr) == 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;
@@ -13599,7 +14147,7 @@ static int ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -13618,7 +14166,7 @@ static int ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_CV == IS_VAR &&
value_ptr_ptr &&
!(*value_ptr_ptr)->is_ref &&
- opline->extended_value == ZEND_RETURNS_FUNCTION &&
+ 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() */
@@ -13660,12 +14208,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_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 (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -13734,34 +14282,37 @@ 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 *expr_ptr;
zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
+#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -13773,19 +14324,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -13795,7 +14346,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
@@ -13807,7 +14358,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_VAR == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_VAR != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -13826,20 +14386,21 @@ static int ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (IS_CV == IS_CV || IS_CV == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -13860,6 +14421,9 @@ static int ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
+ if (IS_CV == IS_CV || IS_CV == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -13942,25 +14506,26 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int prop_dim, ZEN
long index;
if (container) {
-
+
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
- if ((*container)->type == IS_ARRAY) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -13998,7 +14563,7 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int prop_dim, ZEN
break;
}
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -14015,13 +14580,13 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int prop_dim, ZEN
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -14041,14 +14606,14 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int prop_dim, ZEN
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -14070,7 +14635,7 @@ static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_A
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;
@@ -14088,7 +14653,11 @@ static int ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 %s", ce->name);
+ if (ce) {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name);
+ } else {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object");
+ }
EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
EX_T(opline->result.u.var).var.ptr->refcount++;
}
@@ -14110,14 +14679,15 @@ static int ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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;
+ if (!EG(exception)) {
+ ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
+ Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC);
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT;
EX_T(opline->result.u.var).var.ptr->refcount=1;
EX_T(opline->result.u.var).var.ptr->is_ref=1;
+ if (!RETURN_VALUE_USED(opline) || EG(exception)) {
+ zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ }
}
ZEND_VM_NEXT_OPCODE();
@@ -14125,9 +14695,10 @@ static int ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_EXIT_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+#if 0 || (IS_UNUSED != IS_UNUSED)
zend_op *opline = EX(opline);
if (IS_UNUSED != IS_UNUSED) {
-
+
zval *ptr = NULL;
if (Z_TYPE_P(ptr) == IS_LONG) {
@@ -14137,6 +14708,7 @@ static int ZEND_EXIT_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
+#endif
zend_bailout();
ZEND_VM_NEXT_OPCODE();
}
@@ -14158,7 +14730,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int (*binary_op)(z
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
@@ -14195,17 +14767,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int (*binary_op)(z
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -14271,7 +14843,7 @@ static int zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -14396,7 +14968,7 @@ static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
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;
@@ -14406,7 +14978,7 @@ static int zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op,
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (!RETURN_VALUE_UNUSED(&opline->result)) {
@@ -14439,9 +15011,9 @@ static int zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op,
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -14488,7 +15060,7 @@ static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -14498,7 +15070,7 @@ static int zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
*retval = *EG(uninitialized_zval_ptr);
@@ -14528,10 +15100,10 @@ static int zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -14581,7 +15153,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(int type, Z
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;
@@ -14599,7 +15171,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(int type, Z
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -14607,7 +15179,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(int type, Z
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) {
@@ -14643,7 +15215,7 @@ static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_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_UNUSED != IS_CV) {
@@ -14660,6 +15232,11 @@ static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -14667,7 +15244,7 @@ static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+ zend_free_op free_op1;
zval *property = &opline->op2.u.constant;
if (0) {
@@ -14679,6 +15256,11 @@ static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -14694,7 +15276,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER
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) {
@@ -14706,6 +15288,11 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER
} else {
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
} else {
@@ -14716,7 +15303,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER
static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_res;
+ zend_free_op free_op1, free_res;
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *property = &opline->op2.u.constant;
@@ -14734,6 +15321,11 @@ static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
} else {
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).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)) {
@@ -14748,7 +15340,7 @@ 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);
@@ -14758,46 +15350,13 @@ static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
-
+
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);
@@ -14807,12 +15366,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_P(function_name);
EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (EX(object) && EX(object)->type == IS_OBJECT) {
+ if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -14854,7 +15413,7 @@ static int ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
/* 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) {
+ if (zend_hash_find(&ce->constants_table, Z_STRVAL(opline->op2.u.constant), Z_STRLEN(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);
@@ -14885,91 +15444,24 @@ static int ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_INIT_ARRAY_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:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+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) {
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_UNUSED == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_UNUSED != IS_UNUSED
} else {
-
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
}
- 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;
@@ -14982,20 +15474,21 @@ static int ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -15016,6 +15509,9 @@ static int ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
+ if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -15058,7 +15554,7 @@ static int ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -15089,32 +15585,33 @@ static int ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -15152,7 +15649,7 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(int prop_di
break;
}
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -15169,13 +15666,13 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(int prop_di
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -15195,14 +15692,14 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(int prop_di
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -15236,7 +15733,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*binary_op)(zva
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
zval_dtor(free_op2.var);
FREE_OP(free_op_data1);
@@ -15273,17 +15770,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*binary_op)(zva
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -15349,7 +15846,7 @@ static int zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*binary_op)(zval *r
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -15485,7 +15982,7 @@ static int zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_t incdec_op, Z
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != 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)) {
@@ -15518,9 +16015,9 @@ static int zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_t incdec_op, Z
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -15577,7 +16074,7 @@ static int zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec_t incdec_op,
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_dtor(free_op2.var);
*retval = *EG(uninitialized_zval_ptr);
@@ -15607,10 +16104,10 @@ static int zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec_t incdec_op,
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -15660,7 +16157,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(int type, ZEN
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;
@@ -15678,7 +16175,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(int type, ZEN
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -15722,7 +16219,7 @@ static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ 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_UNUSED != IS_CV) {
@@ -15739,6 +16236,11 @@ static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zval_dtor(free_op2.var);
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -15746,7 +16248,7 @@ static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ zend_free_op free_op1, free_op2;
zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (1) {
@@ -15758,6 +16260,11 @@ static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zval_dtor(free_op2.var);
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -15773,7 +16280,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
/* Behave like FETCH_OBJ_W */
- zend_free_op free_op2;
+ zend_free_op free_op1, free_op2;
zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (1) {
@@ -15785,6 +16292,11 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
} else {
zval_dtor(free_op2.var);
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
} else {
@@ -15795,7 +16307,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_A
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;
+ zend_free_op free_op1, 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);
@@ -15813,6 +16325,11 @@ static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
} else {
zval_dtor(free_op2.var);
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).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)) {
@@ -15827,7 +16344,7 @@ 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);
@@ -15837,40 +16354,6 @@ static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -15887,12 +16370,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_P(function_name);
EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (EX(object) && EX(object)->type == IS_OBJECT) {
+ if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -15925,85 +16408,18 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_INIT_ARRAY_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:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+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) {
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_UNUSED == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_UNUSED != IS_UNUSED
} else {
-
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
}
- 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)
@@ -16022,20 +16438,21 @@ static int ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -16056,6 +16473,9 @@ static int ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
+ if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -16129,7 +16549,7 @@ static int ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -16139,22 +16559,23 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(int prop_dim,
zend_free_op free_op2;
zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
- if ((*container)->type == IS_ARRAY) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -16192,7 +16613,7 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(int prop_dim,
break;
}
zval_dtor(free_op2.var);
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (1) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -16209,13 +16630,13 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(int prop_dim,
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -16235,14 +16656,14 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(int prop_dim,
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -16276,7 +16697,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*binary_op)(zva
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != 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);
@@ -16313,17 +16734,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*binary_op)(zva
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -16389,7 +16810,7 @@ static int zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*binary_op)(zval *r
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -16525,7 +16946,7 @@ static int zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_t incdec_op, Z
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != 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)) {
@@ -16558,9 +16979,9 @@ static int zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_t incdec_op, Z
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -16617,7 +17038,7 @@ static int zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec_t incdec_op,
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != 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);
@@ -16647,10 +17068,10 @@ static int zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec_t incdec_op,
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -16700,7 +17121,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(int type, ZEN
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;
@@ -16718,7 +17139,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(int type, ZEN
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -16762,7 +17183,7 @@ static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ 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_UNUSED != IS_CV) {
@@ -16779,6 +17200,11 @@ static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -16786,7 +17212,7 @@ static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ zend_free_op free_op1, free_op2;
zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (0) {
@@ -16798,6 +17224,11 @@ static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -16813,7 +17244,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
/* Behave like FETCH_OBJ_W */
- zend_free_op free_op2;
+ zend_free_op free_op1, free_op2;
zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (0) {
@@ -16825,6 +17256,11 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
} else {
@@ -16835,7 +17271,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_A
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;
+ zend_free_op free_op1, 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);
@@ -16853,6 +17289,11 @@ static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).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)) {
@@ -16867,7 +17308,7 @@ 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);
@@ -16877,40 +17318,6 @@ static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -16927,12 +17334,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_P(function_name);
EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (EX(object) && EX(object)->type == IS_OBJECT) {
+ if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -16965,85 +17372,18 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_INIT_ARRAY_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:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+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) {
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_UNUSED == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_UNUSED != IS_UNUSED
} else {
-
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
}
- 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)
@@ -17062,20 +17402,21 @@ static int ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -17096,6 +17437,9 @@ static int ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
+ if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -17169,7 +17513,7 @@ static int ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -17179,22 +17523,23 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(int prop_dim,
zend_free_op free_op2;
zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
- if ((*container)->type == IS_ARRAY) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -17232,7 +17577,7 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(int prop_dim,
break;
}
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -17249,13 +17594,13 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(int prop_dim,
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -17275,14 +17620,14 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(int prop_dim,
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -17316,7 +17661,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
@@ -17353,17 +17698,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -17429,7 +17774,7 @@ static int zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -17551,118 +17896,18 @@ static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
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)
+static int ZEND_INIT_ARRAY_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:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+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) {
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_UNUSED == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_UNUSED != IS_UNUSED
} else {
-
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
}
- 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)
@@ -17682,7 +17927,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*binary_op)(zval
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
@@ -17719,17 +17964,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*binary_op)(zval
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -17795,7 +18040,7 @@ static int zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *re
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -17920,7 +18165,7 @@ static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -17930,7 +18175,7 @@ static int zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, ZE
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (!RETURN_VALUE_UNUSED(&opline->result)) {
@@ -17963,9 +18208,9 @@ static int zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, ZE
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -18012,7 +18257,7 @@ static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -18022,7 +18267,7 @@ static int zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, Z
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
*retval = *EG(uninitialized_zval_ptr);
@@ -18052,10 +18297,10 @@ static int zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, Z
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -18105,7 +18350,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(int type, ZEND
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;
@@ -18123,7 +18368,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(int type, ZEND
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -18131,7 +18376,7 @@ static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(int type, ZEND
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) {
@@ -18167,7 +18412,7 @@ static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_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_UNUSED != IS_CV) {
@@ -18184,6 +18429,11 @@ static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -18191,7 +18441,7 @@ static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_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) {
@@ -18203,6 +18453,11 @@ static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -18218,7 +18473,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
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) {
@@ -18230,6 +18485,11 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
} else {
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
} else {
@@ -18240,7 +18500,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_AR
static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_res;
+ zend_free_op free_op1, 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);
@@ -18258,6 +18518,11 @@ static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_UNUSED == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).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)) {
@@ -18272,7 +18537,7 @@ 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);
@@ -18282,46 +18547,13 @@ static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
-
+
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);
@@ -18331,12 +18563,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_P(function_name);
EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C);
- if (EX(object) && EX(object)->type == IS_OBJECT) {
+ if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -18368,91 +18600,24 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZEND_VM_NEXT_OPCODE();
}
-static int ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+static int ZEND_INIT_ARRAY_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:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+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) {
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_UNUSED == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_UNUSED != IS_UNUSED
} else {
-
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
}
- 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;
@@ -18465,20 +18630,21 @@ static int ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (IS_CV == IS_CV || IS_CV == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -18499,6 +18665,9 @@ static int ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
+ if (IS_CV == IS_CV || IS_CV == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -18541,7 +18710,7 @@ static int ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -18572,32 +18741,33 @@ static int ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -18635,7 +18805,7 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(int prop_dim,
break;
}
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -18652,13 +18822,13 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(int prop_dim,
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -18678,14 +18848,14 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(int prop_dim,
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -18705,7 +18875,7 @@ static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLE
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);
@@ -18716,7 +18886,7 @@ static int ZEND_BW_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -18727,7 +18897,7 @@ static int ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
@@ -18769,7 +18939,7 @@ static int ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
@@ -18811,7 +18981,7 @@ static int ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
@@ -18848,7 +19018,7 @@ static int ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
@@ -18885,12 +19055,12 @@ static int ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
- zend_std_cast_object_tostring(z, &z_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
+ zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
@@ -18904,8 +19074,8 @@ 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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG;
return ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -18919,7 +19089,7 @@ static int zend_fetch_var_address_helper_SPEC_CV(int type, ZEND_OPCODE_HANDLER_A
zval tmp_varname;
HashTable *target_symbol_table;
- if (varname->type != IS_STRING) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp_varname = *varname;
zval_copy_ctor(&tmp_varname);
convert_to_string(&tmp_varname);
@@ -18939,13 +19109,13 @@ static int zend_fetch_var_address_helper_SPEC_CV(int type, ZEND_OPCODE_HANDLER_A
switch (type) {
case BP_VAR_R:
case BP_VAR_UNSET:
- zend_error(E_NOTICE,"Undefined variable: %s", varname->value.str.val);
+ zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_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: %s", varname->value.str.val);
+ zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
/* break missing intentionally */
case BP_VAR_W: {
zval *new_zval = &EG(uninitialized_zval);
@@ -18959,6 +19129,10 @@ static int zend_fetch_var_address_helper_SPEC_CV(int type, ZEND_OPCODE_HANDLER_A
}
switch (opline->op2.u.EA.type) {
case ZEND_FETCH_GLOBAL:
+ if (IS_CV != IS_TMP_VAR) {
+
+ }
+ break;
case ZEND_FETCH_LOCAL:
break;
@@ -19034,7 +19208,7 @@ static int ZEND_FETCH_IS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
@@ -19050,7 +19224,7 @@ static int ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
@@ -19066,7 +19240,7 @@ static int ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
@@ -19085,11 +19259,11 @@ static int ZEND_JMPZNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
if (!retval) {
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
@@ -19102,11 +19276,11 @@ static int ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
if (retval) {
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
@@ -19121,7 +19295,7 @@ 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) {
@@ -19206,11 +19380,11 @@ 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) {
+ if (Z_TYPE_P(value) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "Can only throw objects");
}
/* Not sure if a complete copy is what we want here */
@@ -19229,13 +19403,13 @@ 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)) {
+ && ARG_MUST_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);
@@ -19254,7 +19428,7 @@ 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)) {
@@ -19290,12 +19464,12 @@ static int ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} 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 != &EG(uninitialized_zval) &&
+ (PZVAL_IS_REF(varptr) ||
(varptr->refcount == 1 && (IS_CV == IS_CV || free_op1.var)))) {
varptr->is_ref = 1;
varptr->refcount++;
@@ -19318,7 +19492,7 @@ static int ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -19349,11 +19523,11 @@ static int ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC));
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
ZEND_VM_NEXT_OPCODE();
}
@@ -19361,7 +19535,7 @@ static int ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -19379,7 +19553,11 @@ static int ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 %s", ce->name);
+ if (ce) {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name);
+ } else {
+ zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object");
+ }
EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr);
EX_T(opline->result.u.var).var.ptr->refcount++;
}
@@ -19401,14 +19579,15 @@ static int ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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;
+ if (!EG(exception)) {
+ ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
+ Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC);
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT;
EX_T(opline->result.u.var).var.ptr->refcount=1;
EX_T(opline->result.u.var).var.ptr->is_ref=1;
+ if (!RETURN_VALUE_USED(opline) || EG(exception)) {
+ zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
+ }
}
ZEND_VM_NEXT_OPCODE();
@@ -19417,7 +19596,7 @@ static int ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -19466,7 +19645,7 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -19480,43 +19659,59 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
return_value_used = RETURN_VALUE_USED(opline);
- switch (opline->op2.u.constant.value.lval) {
+ switch (Z_LVAL(opline->op2.u.constant)) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
- int dummy = 1;
zend_file_handle file_handle;
+ char cwd[MAXPATHLEN];
+ cwd_state state;
+
+ if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) {
+ cwd[0] = '\0';
+ } else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) {
+ cwd[0] = '\0';
+ }
+
+ state.cwd_length = strlen(cwd);
+ state.cwd = zend_strndup(cwd, state.cwd_length);
- if (SUCCESS == zend_stream_open(inc_filename->value.str.val, &file_handle TSRMLS_CC)) {
+ failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) &&
+ zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1));
+
+ free(state.cwd);
+
+ if (failure_retval) {
+ /* do nothing */
+ } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) {
if (!file_handle.opened_path) {
- file_handle.opened_path = estrndup(inc_filename->value.str.val, inc_filename->value.str.len);
+ file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
}
- 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);
+ if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
+ new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==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);
+ if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename));
} else {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, inc_filename->value.str.val);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename));
}
}
- break;
}
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
- new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename TSRMLS_CC);
+ new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), 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);
+ new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
efree(eval_desc);
}
break;
@@ -19553,8 +19748,8 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1;
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
}
}
@@ -19570,8 +19765,8 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval;
+ Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
}
}
@@ -19584,23 +19779,25 @@ 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) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
varname = &tmp;
+ } else if (IS_CV == IS_CV || IS_CV == IS_VAR) {
+ varname->refcount++;
}
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC);
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
- if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) {
- zend_execute_data *ex = execute_data;
+ target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) {
+ zend_execute_data *ex = execute_data;
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
do {
@@ -19616,13 +19813,15 @@ static int ZEND_UNSET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
- ex = ex->prev_execute_data;
- } while (ex && ex->symbol_table == target_symbol_table);
+ ex = ex->prev_execute_data;
+ } while (ex && ex->symbol_table == target_symbol_table);
}
}
if (varname == &tmp) {
zval_dtor(&tmp);
+ } else if (IS_CV == IS_CV || IS_CV == IS_VAR) {
+ zval_ptr_dtor(&varname);
}
ZEND_VM_NEXT_OPCODE();
@@ -19638,7 +19837,7 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_class_entry *ce = NULL;
zend_bool is_empty = 0;
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
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);
@@ -19647,7 +19846,7 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class");
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
}
-
+
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
@@ -19671,6 +19870,9 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
array_ptr = tmp;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
ce = Z_OBJCE_P(array_ptr);
+ if (!ce || !ce->get_iterator) {
+ array_ptr->refcount++;
+ }
} else {
if (IS_CV == IS_VAR &&
free_op1.var == NULL &&
@@ -19690,12 +19892,12 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
if (ce && ce->get_iterator) {
- iter = ce->get_iterator(ce, array_ptr TSRMLS_CC);
+ iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
if (iter && !EG(exception)) {
array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
} else {
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
} else {
@@ -19719,6 +19921,11 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ } else {
+
+ }
ZEND_VM_NEXT_OPCODE();
}
}
@@ -19726,8 +19933,14 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
+
+ } else {
+
+ }
ZEND_VM_NEXT_OPCODE();
}
+ iter->index = -1; /* will be set to 0 before using next handler */
} else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
zend_hash_internal_pointer_reset(fe_ht);
if (ce) {
@@ -19736,8 +19949,11 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
char *str_key;
uint str_key_len;
ulong int_key;
- if (zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL) == HASH_KEY_IS_STRING
- && zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) {
+ 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, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS) {
break;
}
zend_hash_move_forward(fe_ht);
@@ -19749,7 +19965,7 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
is_empty = 1;
}
- if (opline->extended_value) {
+ if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
} else {
@@ -19764,13 +19980,13 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (Z_TYPE_P(varname) != IS_STRING) {
tmp = *varname;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
@@ -19789,21 +20005,21 @@ static int ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = 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;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
} else {
- EX_T(opline->result.u.var).tmp_var.value.lval = isset;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset;
}
break;
case ZEND_ISEMPTY:
if (!isset || !i_zend_is_true(*value)) {
- EX_T(opline->result.u.var).tmp_var.value.lval = 1;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
} else {
- EX_T(opline->result.u.var).tmp_var.value.lval = 0;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
}
break;
}
@@ -19817,9 +20033,10 @@ static int ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_EXIT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+#if 0 || (IS_CV != IS_UNUSED)
zend_op *opline = EX(opline);
if (IS_CV != IS_UNUSED) {
-
+
zval *ptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
if (Z_TYPE_P(ptr) == IS_LONG) {
@@ -19829,6 +20046,7 @@ static int ZEND_EXIT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
+#endif
zend_bailout();
ZEND_VM_NEXT_OPCODE();
}
@@ -19836,7 +20054,7 @@ static int ZEND_EXIT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -19850,7 +20068,7 @@ static int ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -19867,7 +20085,7 @@ static int ZEND_INSTANCEOF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -19880,7 +20098,7 @@ static int ZEND_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -19893,7 +20111,7 @@ static int ZEND_SUB_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -19906,7 +20124,7 @@ static int ZEND_MUL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -19919,7 +20137,7 @@ static int ZEND_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -19932,7 +20150,7 @@ static int ZEND_MOD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -19945,7 +20163,7 @@ static int ZEND_SL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -19958,7 +20176,7 @@ static int ZEND_SR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -19971,7 +20189,7 @@ static int ZEND_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -19984,7 +20202,7 @@ static int ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -19997,7 +20215,7 @@ static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -20010,7 +20228,7 @@ static int ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -20023,7 +20241,7 @@ static int ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -20036,7 +20254,7 @@ static int ZEND_IS_SMALLER_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -20049,7 +20267,7 @@ static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
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),
@@ -20062,7 +20280,7 @@ static int ZEND_BW_OR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -20075,7 +20293,7 @@ static int ZEND_BW_AND_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -20088,7 +20306,7 @@ static int ZEND_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -20115,7 +20333,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*binary_op)(zval
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
@@ -20152,17 +20370,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*binary_op)(zval
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -20228,7 +20446,7 @@ static int zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary_op)(zval *res
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -20353,7 +20571,7 @@ static int ZEND_ASSIGN_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -20363,7 +20581,7 @@ static int zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZEN
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (!RETURN_VALUE_UNUSED(&opline->result)) {
@@ -20396,9 +20614,9 @@ static int zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZEN
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -20445,7 +20663,7 @@ static int ZEND_PRE_DEC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -20455,7 +20673,7 @@ static int zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZE
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
*retval = *EG(uninitialized_zval_ptr);
@@ -20485,10 +20703,10 @@ static int zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZE
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -20536,10 +20754,12 @@ static int ZEND_POST_DEC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (opline->extended_value == ZEND_FETCH_ADD_LOCK &&
+ IS_CV != IS_CV &&
+ EX_T(opline->op1.u.var).var.ptr_ptr) {
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);
@@ -20551,11 +20771,16 @@ static int ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_W_SPEC_CV_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_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC);
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -20563,11 +20788,16 @@ static int ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_RW_SPEC_CV_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_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC);
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -20575,7 +20805,7 @@ static int ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -20587,16 +20817,21 @@ static int ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_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_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC);
+ if (IS_CV == IS_VAR && type == BP_VAR_W && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -20604,7 +20839,7 @@ static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
static int ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+ zend_free_op free_op1;
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
zval *dim = &opline->op2.u.constant;
@@ -20620,6 +20855,11 @@ static int ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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 (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
@@ -20641,7 +20881,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_CONST(int type, ZEND_
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;
@@ -20659,7 +20899,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_CONST(int type, ZEND_
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -20667,7 +20907,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_CONST(int type, ZEND_
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) {
@@ -20703,7 +20943,7 @@ static int ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_W_SPEC_CV_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_CV != IS_CV) {
@@ -20720,6 +20960,11 @@ static int ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -20727,7 +20972,7 @@ static int ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+ zend_free_op free_op1;
zval *property = &opline->op2.u.constant;
if (0) {
@@ -20739,6 +20984,11 @@ static int ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -20754,7 +21004,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
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) {
@@ -20766,6 +21016,11 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
} else {
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
} else {
@@ -20776,7 +21031,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_res;
+ zend_free_op free_op1, free_res;
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
zval *property = &opline->op2.u.constant;
@@ -20794,6 +21049,11 @@ static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).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)) {
@@ -20808,7 +21068,7 @@ 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);
@@ -20822,7 +21082,7 @@ 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) {
@@ -20832,7 +21092,7 @@ static int ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
object_ptr = NULL;
}
- if (object_ptr && (*object_ptr)->type == IS_OBJECT) {
+ if (object_ptr && Z_TYPE_PP(object_ptr) == 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;
@@ -20854,7 +21114,7 @@ static int ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -20869,7 +21129,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *function_name;
char *function_name_strval;
int function_name_strlen;
-
+
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);
@@ -20879,12 +21139,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_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 (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -20920,7 +21180,7 @@ 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) {
@@ -20950,36 +21210,39 @@ static int ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 *expr_ptr;
zval *offset=&opline->op2.u.constant;
+#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -20991,19 +21254,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -21013,7 +21276,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
}
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -21025,13 +21288,22 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_CV == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_CV != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
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;
@@ -21044,20 +21316,21 @@ static int ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -21078,6 +21351,9 @@ static int ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
+ if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -21120,7 +21396,7 @@ static int ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -21151,32 +21427,33 @@ static int ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -21214,7 +21491,7 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(int prop_dim, Z
break;
}
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -21231,13 +21508,13 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(int prop_dim, Z
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -21257,14 +21534,14 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(int prop_dim, Z
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -21532,7 +21809,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*binary_op)(zval *r
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
zval_dtor(free_op2.var);
FREE_OP(free_op_data1);
@@ -21569,17 +21846,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*binary_op)(zval *r
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -21645,7 +21922,7 @@ static int zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_op)(zval *resul
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -21781,7 +22058,7 @@ static int zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t incdec_op, ZEND_
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != 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)) {
@@ -21814,9 +22091,9 @@ static int zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t incdec_op, ZEND_
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -21873,7 +22150,7 @@ static int zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t incdec_op, ZEND
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_dtor(free_op2.var);
*retval = *EG(uninitialized_zval_ptr);
@@ -21903,10 +22180,10 @@ static int zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t incdec_op, ZEND
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -21957,7 +22234,9 @@ static int ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (opline->extended_value == ZEND_FETCH_ADD_LOCK &&
+ IS_CV != IS_CV &&
+ EX_T(opline->op1.u.var).var.ptr_ptr) {
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);
@@ -21969,11 +22248,16 @@ static int ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ 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_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 1, BP_VAR_W TSRMLS_CC);
zval_dtor(free_op2.var);
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -21981,11 +22265,16 @@ static int ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ 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_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC);
zval_dtor(free_op2.var);
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -22005,16 +22294,21 @@ static int ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ 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_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 1, type TSRMLS_CC);
zval_dtor(free_op2.var);
+ if (IS_CV == IS_VAR && type == BP_VAR_W && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -22022,7 +22316,7 @@ static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ zend_free_op free_op1, 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);
@@ -22038,6 +22332,11 @@ static int ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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 (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
@@ -22059,7 +22358,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_TMP(int type, ZEND_OP
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;
@@ -22077,7 +22376,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_TMP(int type, ZEND_OP
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -22121,7 +22420,7 @@ static int ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ 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_CV != IS_CV) {
@@ -22138,6 +22437,11 @@ static int ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zval_dtor(free_op2.var);
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -22145,7 +22449,7 @@ static int ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ zend_free_op free_op1, free_op2;
zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (1) {
@@ -22157,6 +22461,11 @@ static int ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zval_dtor(free_op2.var);
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -22172,7 +22481,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
/* Behave like FETCH_OBJ_W */
- zend_free_op free_op2;
+ zend_free_op free_op1, free_op2;
zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (1) {
@@ -22184,6 +22493,11 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zval_dtor(free_op2.var);
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
} else {
@@ -22194,7 +22508,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ zend_free_op free_op1, 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);
@@ -22212,6 +22526,11 @@ static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zval_dtor(free_op2.var);
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).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)) {
@@ -22226,7 +22545,7 @@ 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);
@@ -22240,7 +22559,7 @@ 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) {
@@ -22250,7 +22569,7 @@ static int ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
object_ptr = NULL;
}
- if (object_ptr && (*object_ptr)->type == IS_OBJECT) {
+ if (object_ptr && Z_TYPE_PP(object_ptr) == 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;
@@ -22298,12 +22617,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_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 (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -22373,34 +22692,37 @@ 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 *expr_ptr;
zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -22412,19 +22734,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -22434,7 +22756,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
zval_dtor(free_op2.var);
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -22446,7 +22768,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_CV == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_CV != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -22465,20 +22796,21 @@ static int ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -22499,6 +22831,9 @@ static int ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
+ if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -22572,7 +22907,7 @@ static int ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -22582,22 +22917,23 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int prop_dim, ZEN
zend_free_op free_op2;
zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
- if ((*container)->type == IS_ARRAY) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -22635,7 +22971,7 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int prop_dim, ZEN
break;
}
zval_dtor(free_op2.var);
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (1) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -22652,13 +22988,13 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int prop_dim, ZEN
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -22678,14 +23014,14 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int prop_dim, ZEN
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -22953,7 +23289,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*binary_op)(zval *r
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != 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);
@@ -22990,17 +23326,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*binary_op)(zval *r
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -23066,7 +23402,7 @@ static int zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_op)(zval *resul
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -23202,7 +23538,7 @@ static int zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t incdec_op, ZEND_
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != 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)) {
@@ -23235,9 +23571,9 @@ static int zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t incdec_op, ZEND_
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -23294,7 +23630,7 @@ static int zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t incdec_op, ZEND
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != 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);
@@ -23324,10 +23660,10 @@ static int zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t incdec_op, ZEND
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -23378,7 +23714,9 @@ static int ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (opline->extended_value == ZEND_FETCH_ADD_LOCK &&
+ IS_CV != IS_CV &&
+ EX_T(opline->op1.u.var).var.ptr_ptr) {
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);
@@ -23390,11 +23728,16 @@ static int ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ 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_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);};
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -23402,11 +23745,16 @@ static int ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ 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_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);};
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -23426,16 +23774,21 @@ static int ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ 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_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC);
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+ if (IS_CV == IS_VAR && type == BP_VAR_W && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -23443,7 +23796,7 @@ static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ zend_free_op free_op1, 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);
@@ -23459,6 +23812,11 @@ static int ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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 (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
@@ -23480,7 +23838,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_VAR(int type, ZEND_OP
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;
@@ -23498,7 +23856,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_VAR(int type, ZEND_OP
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -23542,7 +23900,7 @@ static int ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ 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_CV != IS_CV) {
@@ -23559,6 +23917,11 @@ static int ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -23566,7 +23929,7 @@ static int ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_op2;
+ zend_free_op free_op1, free_op2;
zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (0) {
@@ -23578,6 +23941,11 @@ static int ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -23593,7 +23961,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
/* Behave like FETCH_OBJ_W */
- zend_free_op free_op2;
+ zend_free_op free_op1, free_op2;
zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
if (0) {
@@ -23605,6 +23973,11 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
} else {
@@ -23615,7 +23988,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
+ zend_free_op free_op1, 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);
@@ -23633,6 +24006,11 @@ static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).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)) {
@@ -23647,7 +24025,7 @@ 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);
@@ -23661,7 +24039,7 @@ 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) {
@@ -23671,7 +24049,7 @@ static int ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
object_ptr = NULL;
}
- if (object_ptr && (*object_ptr)->type == IS_OBJECT) {
+ if (object_ptr && Z_TYPE_PP(object_ptr) == 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;
@@ -23714,7 +24092,7 @@ static int ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_VAR == IS_VAR &&
value_ptr_ptr &&
!(*value_ptr_ptr)->is_ref &&
- opline->extended_value == ZEND_RETURNS_FUNCTION &&
+ 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() */
@@ -23756,12 +24134,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_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 (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -23831,34 +24209,37 @@ 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 *expr_ptr;
zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
+#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -23870,19 +24251,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -23892,7 +24273,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -23904,7 +24285,16 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_CV == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_CV != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
static int ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -23923,20 +24313,21 @@ static int ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -23957,6 +24348,9 @@ static int ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
+ if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -24030,7 +24424,7 @@ static int ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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;
@@ -24040,22 +24434,23 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int prop_dim, ZEN
zend_free_op free_op2;
zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
- if ((*container)->type == IS_ARRAY) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -24093,7 +24488,7 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int prop_dim, ZEN
break;
}
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -24110,13 +24505,13 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int prop_dim, ZEN
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -24136,14 +24531,14 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int prop_dim, ZEN
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -24177,7 +24572,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*binary_op)(zval
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
@@ -24214,17 +24609,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*binary_op)(zval
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -24290,7 +24685,7 @@ static int zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *re
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -24415,11 +24810,16 @@ static int ZEND_ASSIGN_BW_XOR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_W_SPEC_CV_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_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC);
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -24427,11 +24827,16 @@ static int ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_RW_SPEC_CV_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_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC);
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -24439,16 +24844,21 @@ static int ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_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_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC);
+ if (IS_CV == IS_VAR && type == BP_VAR_W && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -24457,7 +24867,7 @@ 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) {
@@ -24467,7 +24877,7 @@ static int ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
object_ptr = NULL;
}
- if (object_ptr && (*object_ptr)->type == IS_OBJECT) {
+ if (object_ptr && Z_TYPE_PP(object_ptr) == 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;
@@ -24489,36 +24899,39 @@ static int ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 *expr_ptr;
zval *offset=NULL;
+#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -24530,19 +24943,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -24552,7 +24965,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
}
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -24564,13 +24977,22 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_CV == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_CV != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
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),
@@ -24583,7 +25005,7 @@ static int ZEND_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24596,7 +25018,7 @@ static int ZEND_SUB_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24609,7 +25031,7 @@ static int ZEND_MUL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24622,7 +25044,7 @@ static int ZEND_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24635,7 +25057,7 @@ static int ZEND_MOD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24648,7 +25070,7 @@ static int ZEND_SL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24661,7 +25083,7 @@ static int ZEND_SR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24674,7 +25096,7 @@ static int ZEND_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24687,7 +25109,7 @@ static int ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24700,7 +25122,7 @@ static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24713,7 +25135,7 @@ static int ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24726,7 +25148,7 @@ static int ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24739,7 +25161,7 @@ static int ZEND_IS_SMALLER_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24752,7 +25174,7 @@ static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24765,7 +25187,7 @@ static int ZEND_BW_OR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24778,7 +25200,7 @@ static int ZEND_BW_AND_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24791,7 +25213,7 @@ static int ZEND_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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),
@@ -24818,7 +25240,7 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binary_op)(zval *re
make_real_object(object_ptr TSRMLS_CC);
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
@@ -24855,17 +25277,17 @@ static int zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binary_op)(zval *re
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);
+ z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R 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);
+ z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
}
break;
}
if (z) {
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -24931,7 +25353,7 @@ static int zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op)(zval *result
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
}
- if ((*object_ptr)->type == IS_OBJECT) {
+ if (Z_TYPE_PP(object_ptr) == 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;
@@ -25056,7 +25478,7 @@ static int ZEND_ASSIGN_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -25066,7 +25488,7 @@ static int zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_O
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (!RETURN_VALUE_UNUSED(&opline->result)) {
@@ -25099,9 +25521,9 @@ static int zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_O
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -25148,7 +25570,7 @@ static int ZEND_PRE_DEC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -25158,7 +25580,7 @@ static int zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
- if (object->type != IS_OBJECT) {
+ if (Z_TYPE_P(object) != IS_OBJECT) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
*retval = *EG(uninitialized_zval_ptr);
@@ -25188,10 +25610,10 @@ static int zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_
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 = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
zval *z_copy;
- if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
+ if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
if (z->refcount == 0) {
@@ -25239,10 +25661,12 @@ static int ZEND_POST_DEC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (opline->extended_value == ZEND_FETCH_ADD_LOCK &&
+ IS_CV != IS_CV &&
+ EX_T(opline->op1.u.var).var.ptr_ptr) {
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);
@@ -25254,11 +25678,16 @@ static int ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_W_SPEC_CV_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_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC);
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -25266,11 +25695,16 @@ static int ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_RW_SPEC_CV_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_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC);
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -25278,7 +25712,7 @@ static int ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -25290,16 +25724,21 @@ static int ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_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_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC);
+ if (IS_CV == IS_VAR && type == BP_VAR_W && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -25307,7 +25746,7 @@ static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+ zend_free_op free_op1;
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);
@@ -25323,6 +25762,11 @@ static int ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
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 (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) {
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
@@ -25344,7 +25788,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_CV(int type, ZEND_OPC
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;
@@ -25362,7 +25806,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_CV(int type, ZEND_OPC
}
- if (container->type != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
+ if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Trying to get property of non-object");
}
@@ -25370,7 +25814,7 @@ static int zend_fetch_property_address_read_helper_SPEC_CV_CV(int type, ZEND_OPC
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) {
@@ -25406,7 +25850,7 @@ static int ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_W_SPEC_CV_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_CV != IS_CV) {
@@ -25423,6 +25867,11 @@ static int ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -25430,7 +25879,7 @@ static int ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_RW_SPEC_CV_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) {
@@ -25442,6 +25891,11 @@ static int ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
}
@@ -25457,7 +25911,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
@@ -25469,6 +25923,11 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).var);
+ }
ZEND_VM_NEXT_OPCODE();
} else {
@@ -25479,7 +25938,7 @@ static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
- zend_free_op free_res;
+ zend_free_op free_op1, 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);
@@ -25497,6 +25956,11 @@ static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
}
+ if (IS_CV == IS_VAR && 0 &&
+ READY_TO_DESTROY(free_op1.var) &&
+ !RETURN_VALUE_UNUSED(&opline->result)) {
+ AI_USE_PTR(EX_T(opline->result.u.var).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)) {
@@ -25511,7 +25975,7 @@ 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);
@@ -25525,7 +25989,7 @@ 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) {
@@ -25535,7 +25999,7 @@ static int ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
object_ptr = NULL;
}
- if (object_ptr && (*object_ptr)->type == IS_OBJECT) {
+ if (object_ptr && Z_TYPE_PP(object_ptr) == 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;
@@ -25557,7 +26021,7 @@ static int ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -25576,7 +26040,7 @@ static int ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_CV == IS_VAR &&
value_ptr_ptr &&
!(*value_ptr_ptr)->is_ref &&
- opline->extended_value == ZEND_RETURNS_FUNCTION &&
+ 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() */
@@ -25607,7 +26071,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zval *function_name;
char *function_name_strval;
int function_name_strlen;
-
+
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);
@@ -25617,12 +26081,12 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
zend_error_noreturn(E_ERROR, "Method name must be a string");
}
- function_name_strval = function_name->value.str.val;
- function_name_strlen = function_name->value.str.len;
+ function_name_strval = Z_STRVAL_P(function_name);
+ function_name_strlen = Z_STRLEN_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 (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
zend_error_noreturn(E_ERROR, "Object does not support method calls");
}
@@ -25658,7 +26122,7 @@ 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) {
@@ -25688,36 +26152,39 @@ static int ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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 *expr_ptr;
zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
+#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV
+ zval **expr_ptr_ptr = 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);
}
+#else
+ expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
+#endif
- if (opline->opcode == ZEND_INIT_ARRAY) {
- array_init(array_ptr);
- if (!expr_ptr) {
- ZEND_VM_NEXT_OPCODE();
- }
- }
- if (!opline->extended_value && 0) { /* temporary variable */
+ if (0) { /* temporary variable */
zval *new_expr;
ALLOC_ZVAL(new_expr);
INIT_PZVAL_COPY(new_expr, expr_ptr);
expr_ptr = new_expr;
} else {
+#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV
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)) {
+ } else
+#endif
+ if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr;
ALLOC_ZVAL(new_expr);
@@ -25729,19 +26196,19 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
if (offset) {
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
- zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &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);
+ zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
- zend_symtable_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
+ zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_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);
+ zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
@@ -25751,7 +26218,7 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
} else {
- zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
}
if (opline->extended_value) {
@@ -25763,13 +26230,22 @@ static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
+ zend_op *opline = EX(opline);
+
+ array_init(&EX_T(opline->result.u.var).tmp_var);
+ if (IS_CV == IS_UNUSED) {
+ ZEND_VM_NEXT_OPCODE();
+#if 0 || IS_CV != IS_UNUSED
+ } else {
+ return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
+ }
}
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;
@@ -25782,20 +26258,21 @@ static int ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ zend_hash_index_del(ht, index);
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
-
+ index = Z_LVAL_P(offset);
zend_hash_index_del(ht, index);
break;
case IS_STRING:
+ if (IS_CV == IS_CV || IS_CV == IS_VAR) {
+ offset->refcount++;
+ }
if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@@ -25816,6 +26293,9 @@ static int ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
}
}
}
+ if (IS_CV == IS_CV || IS_CV == IS_VAR) {
+ zval_ptr_dtor(&offset);
+ }
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
@@ -25858,7 +26338,7 @@ static int ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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);
@@ -25889,32 +26369,33 @@ static int ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
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) {
+ if (Z_TYPE_PP(container) == IS_ARRAY) {
HashTable *ht;
int isset = 0;
- ht = (*container)->value.ht;
+ ht = Z_ARRVAL_PP(container);
- switch (offset->type) {
+ switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
+ index = (long) Z_DVAL_P(offset);
+ if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
+ isset = 1;
+ }
+ break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
- if (offset->type == IS_DOUBLE) {
- index = (long) offset->value.dval;
- } else {
- index = offset->value.lval;
- }
+ index = Z_LVAL_P(offset);
if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) {
isset = 1;
}
@@ -25952,7 +26433,7 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int prop_dim, ZEND
break;
}
- } else if ((*container)->type == IS_OBJECT) {
+ } else if (Z_TYPE_PP(container) == IS_OBJECT) {
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
@@ -25969,13 +26450,13 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int prop_dim, ZEND
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
- if (offset->type != IS_LONG) {
+ if (Z_TYPE_P(offset) != IS_LONG) {
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
offset = &tmp;
}
- if (offset->type == IS_LONG) {
+ if (Z_TYPE_P(offset) == IS_LONG) {
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
@@ -25995,14 +26476,14 @@ static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int prop_dim, ZEND
}
}
- EX_T(opline->result.u.var).tmp_var.type = IS_BOOL;
+ Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
switch (opline->extended_value) {
case ZEND_ISSET:
- EX_T(opline->result.u.var).tmp_var.value.lval = result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
break;
case ZEND_ISEMPTY:
- EX_T(opline->result.u.var).tmp_var.value.lval = !result;
+ Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
break;
}
@@ -27844,11 +28325,11 @@ void zend_init_opcodes_handlers()
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_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_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,
@@ -29719,11 +30200,11 @@ void zend_init_opcodes_handlers()
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_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
+ ZEND_NULL_HANDLER,
ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER,
ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER,
ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER,
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index c717ad385..9a1df4db8 100644
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -16,7 +16,7 @@
| Authors: Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
- $Id: zend_vm_gen.php,v 1.12.2.5 2006/03/15 08:06:28 dmitry Exp $
+ $Id: zend_vm_gen.php,v 1.12.2.5.2.3 2006/09/18 12:03:10 dmitry Exp $
*/
$header_text = <<< DATA
@@ -338,8 +338,12 @@ function gen_code($f, $spec, $kind, $code, $op1, $op2) {
"/FREE_OP2_VAR_PTR\(\)/",
"/^#ifdef\s+ZEND_VM_SPEC\s*\n/m",
"/^#ifndef\s+ZEND_VM_SPEC\s*\n/m",
+ "/\!defined\(ZEND_VM_SPEC\)/m",
+ "/defined\(ZEND_VM_SPEC\)/m",
"/ZEND_VM_C_LABEL\(\s*([A-Za-z_]*)\s*\)/m",
"/ZEND_VM_C_GOTO\(\s*([A-Za-z_]*)\s*\)/m",
+ "/^#if\s+1\s*\\|\\|.*[^\\\\]$/m",
+ "/^#if\s+0\s*&&.*[^\\\\]$/m"
),
array(
$op1_type[$op1],
@@ -364,8 +368,12 @@ function gen_code($f, $spec, $kind, $code, $op1, $op2) {
$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",
+ ($op1!="ANY"||$op2!="ANY")?"0":"1",
+ ($op1!="ANY"||$op2!="ANY")?"1":"0",
"\\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]):""),
+ "#if 1",
+ "#if 0",
),
$code);
@@ -456,6 +464,9 @@ function gen_code($f, $spec, $kind, $code, $op1, $op2) {
/* Remove unnecessary ';' */
$code = preg_replace('/^\s*;\s*$/m', '', $code);
+ /* Remove WS */
+ $code = preg_replace('/[ \t]+\n/m', "\n", $code);
+
out($f, $code);
}
@@ -581,7 +592,7 @@ function gen_labels($f, $spec, $kind, $prolog) {
// Try to use unspecialized handler
$op2 = "ANY";
}
- // Check if specialized handler is defined
+ // Check if specialized handler is defined
if (isset($dsc["op1"][$op1]) &&
isset($dsc["op2"][$op2])) {
// Emit pointer to specialized handler
@@ -670,7 +681,7 @@ function gen_labels($f, $spec, $kind, $prolog) {
function gen_null_handler($f) {
static $done = 0;
- // New and all executors with CALL threading model can use the same handler
+ // 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;
@@ -689,10 +700,10 @@ function gen_executor_code($f, $spec, $kind, $prolog) {
if ($spec) {
// Produce specialized executor
$op1t = $op_types;
- // for each op1.op_type
+ // for each op1.op_type
foreach($op1t as $op1) {
$op2t = $op_types;
- // for each op2.op_type
+ // for each op2.op_type
foreach($op2t as $op2) {
// for each handlers in helpers in original order
foreach ($list as $lineno => $dsc) {
@@ -1068,7 +1079,7 @@ function gen_vm($def, $skel) {
$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
+ // Insert header
out($f, $GLOBALS['header_text']);
foreach ($opcodes as $code => $dsc) {
@@ -1083,7 +1094,7 @@ function gen_vm($def, $skel) {
$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
+ // Insert header
out($f, $GLOBALS['header_text']);
// Support for ZEND_USER_OPCODE
@@ -1158,8 +1169,8 @@ function gen_vm($def, $skel) {
out($f, "}\n\n");
// Export handlers and helpers
- if (count($export) > 0 &&
- !ZEND_VM_OLD_EXECUTOR &&
+ 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");
diff --git a/acinclude.m4 b/acinclude.m4
index ae9fda7c5..9ffe131b4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: acinclude.m4,v 1.332.2.14 2006/04/10 12:17:36 sniper Exp $
+dnl $Id: acinclude.m4,v 1.332.2.14.2.5 2006/10/02 20:49:23 tony2001 Exp $
dnl
dnl This file contains local autoconf functions.
dnl
@@ -2049,7 +2049,7 @@ AC_DEFUN([PHP_PROG_LEX], [
""|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;"
+ LEX="echo \"error: $flex_msg\" 1>&2 ; exit 1;"
;;
esac
PHP_SUBST(LEX)
@@ -2503,9 +2503,26 @@ EOF
fi
done
- for arg in [$]0 "[$]@"; do
- echo "'[$]arg' \\" >> $1
- CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]arg'"
+ echo "'[$]0' \\" >> $1
+ if test `expr -- [$]0 : "'.*"` = 0; then
+ CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]0'"
+ else
+ CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0"
+ fi
+ for arg in $ac_configure_args; do
+ if test `expr -- $arg : "'.*"` = 0; then
+ if test `expr -- $arg : "--.*"` = 0; then
+ break;
+ fi
+ echo "'[$]arg' \\" >> $1
+ CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]arg'"
+ else
+ if test `expr -- $arg : "'--.*"` = 0; then
+ break;
+ fi
+ echo "[$]arg \\" >> $1
+ CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]arg"
+ fi
done
echo '"[$]@"' >> $1
chmod +x $1
diff --git a/aclocal.m4 b/aclocal.m4
index 25a4ad9b0..7aa15abe9 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: acinclude.m4,v 1.332.2.14 2006/04/10 12:17:36 sniper Exp $
+dnl $Id: acinclude.m4,v 1.332.2.14.2.5 2006/10/02 20:49:23 tony2001 Exp $
dnl
dnl This file contains local autoconf functions.
dnl
@@ -2049,7 +2049,7 @@ AC_DEFUN([PHP_PROG_LEX], [
""|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;"
+ LEX="echo \"error: $flex_msg\" 1>&2 ; exit 1;"
;;
esac
PHP_SUBST(LEX)
@@ -2503,9 +2503,26 @@ EOF
fi
done
- for arg in [$]0 "[$]@"; do
- echo "'[$]arg' \\" >> $1
- CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]arg'"
+ echo "'[$]0' \\" >> $1
+ if test `expr -- [$]0 : "'.*"` = 0; then
+ CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]0'"
+ else
+ CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0"
+ fi
+ for arg in $ac_configure_args; do
+ if test `expr -- $arg : "'.*"` = 0; then
+ if test `expr -- $arg : "--.*"` = 0; then
+ break;
+ fi
+ echo "'[$]arg' \\" >> $1
+ CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]arg'"
+ else
+ if test `expr -- $arg : "'--.*"` = 0; then
+ break;
+ fi
+ echo "[$]arg \\" >> $1
+ CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]arg"
+ fi
done
echo '"[$]@"' >> $1
chmod +x $1
diff --git a/configure b/configure
index c143fc2ff..849c9ff4f 100755
--- a/configure
+++ b/configure
@@ -236,6 +236,8 @@
+
+
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
## Free Software Foundation, Inc.
@@ -989,7 +991,7 @@ ac_help="$ac_help
ac_help="$ac_help
--with-milter[=DIR] Build PHP as Milter application"
ac_help="$ac_help
- --with-nsapi=DIR Build PHP as NSAPI module for Netscape/iPlanet/SunONE"
+ --with-nsapi=DIR Build PHP as NSAPI module for Netscape/iPlanet/Sun Webserver"
ac_help="$ac_help
--with-phttpd=DIR Build PHP as phttpd module"
ac_help="$ac_help
@@ -1109,9 +1111,9 @@ ac_help="$ac_help
ac_help="$ac_help
--disable-ctype Disable ctype functions"
ac_help="$ac_help
- --with-curl[=DIR] Include CURL support"
+ --with-curl[=DIR] Include cURL support"
ac_help="$ac_help
- --with-curlwrappers Use CURL for url streams"
+ --with-curlwrappers Use cURL for url streams"
ac_help="$ac_help
--enable-dba Build DBA with builtin modules. To build shared DBA
extension use --enable-dba=shared"
@@ -1150,7 +1152,9 @@ ac_help="$ac_help
ac_help="$ac_help
--with-fdftk[=DIR] Include FDF support"
ac_help="$ac_help
- --enable-filepro Enable the bundled read-only filePro support"
+ --disable-filter Disable input filter support"
+ac_help="$ac_help
+ --with-pcre-dir FILTER: pcre install prefix"
ac_help="$ac_help
--enable-ftp Enable FTP support"
ac_help="$ac_help
@@ -1183,8 +1187,6 @@ ac_help="$ac_help
ac_help="$ac_help
--disable-hash Disable hash support"
ac_help="$ac_help
- --with-hwapi[=DIR] Include official Hyperwave API support"
-ac_help="$ac_help
--without-iconv[=DIR] Exclude iconv support"
ac_help="$ac_help
--with-imap[=DIR] Include IMAP support. DIR is the c-client install prefix"
@@ -1199,6 +1201,8 @@ ac_help="$ac_help
--with-interbase[=DIR] Include InterBase support. DIR is the InterBase base
install directory, defaults to /usr/interbase"
ac_help="$ac_help
+ --disable-json Disable JavaScript Object Serialization support"
+ac_help="$ac_help
--with-ldap[=DIR] Include LDAP support"
ac_help="$ac_help
--with-ldap-sasl[=DIR] LDAP: Include Cyrus SASL support"
@@ -1207,6 +1211,8 @@ ac_help="$ac_help
ac_help="$ac_help
--disable-mbregex MBSTRING: Disable multibyte regex support"
ac_help="$ac_help
+ --disable-mbregex-backtrack MBSTRING: Disable multibyte regex backtrack check"
+ac_help="$ac_help
--with-libmbfl[=DIR] MBSTRING: Use external libmbfl. DIR is the libmbfl install prefix.
If DIR is not set, the bundled libmbfl will be used"
ac_help="$ac_help
@@ -1338,9 +1344,7 @@ ac_help="$ac_help
--with-pdo-pgsql[=DIR] PDO: PostgreSQL support. DIR is the PostgreSQL base
install directory or the path to pg_config"
ac_help="$ac_help
- --without-pdo-sqlite PDO: sqlite 3 support"
-ac_help="$ac_help
- --with-pdo-sqlite[=DIR] PDO: sqlite support. DIR is the sqlite base directory, the bundled sqlite is used by default"
+ --without-pdo-sqlite[=DIR] PDO: sqlite support. DIR is the sqlite base directory, the bundled sqlite is used by default"
ac_help="$ac_help
--with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL
base install directory or the path to pg_config"
@@ -1410,6 +1414,10 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-wddx Enable WDDX support"
ac_help="$ac_help
+ --with-libxml-dir=DIR WDDX: libxml2 install prefix"
+ac_help="$ac_help
+ --with-libexpat-dir=DIR WDDX: libexpat dir for XMLRPC-EPI (deprecated)"
+ac_help="$ac_help
--disable-xml Disable XML support"
ac_help="$ac_help
--with-libxml-dir=DIR XML: libxml2 install prefix"
@@ -1432,9 +1440,13 @@ ac_help="$ac_help
ac_help="$ac_help
--with-libxml-dir=DIR XMLWriter: libxml2 install prefix"
ac_help="$ac_help
- --with-xsl[=DIR] Include new XSL support (requires libxslt >= 1.0.18).
+ --with-xsl[=DIR] Include new XSL support (requires libxslt >= 1.1.0).
DIR is the libxslt install directory"
ac_help="$ac_help
+ --enable-zip Include Zip read/write support."
+ac_help="$ac_help
+ --with-zlib-dir[=DIR] zip: Set the path to libz install prefix."
+ac_help="$ac_help
PEAR:
"
@@ -1449,8 +1461,8 @@ ac_help="$ac_help
--with-zend-vm=TYPE Set virtual machine dispatch method. Type is
one of "CALL", "SWITCH" or "GOTO" [TYPE=CALL]"
ac_help="$ac_help
- --disable-zend-memory-manager
- Disable the Zend memory manager - FOR DEVELOPERS ONLY!!"
+ --enable-malloc-mm Use environment variable for run-time malloc/emalloc
+ selection - FOR DEVELOPERS ONLY!!"
ac_help="$ac_help
--enable-maintainer-zts Enable thread safety - for code maintainers only!!"
ac_help="$ac_help
@@ -2158,12 +2170,12 @@ fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:2162: checking for Cygwin environment" >&5
+echo "configure:2174: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2167 "configure"
+#line 2179 "configure"
#include "confdefs.h"
int main() {
@@ -2174,7 +2186,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:2178: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -2191,19 +2203,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:2195: checking for mingw32 environment" >&5
+echo "configure:2207: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2200 "configure"
+#line 2212 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:2207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -2222,7 +2234,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for egrep""... $ac_c" 1>&6
-echo "configure:2226: checking for egrep" >&5
+echo "configure:2238: checking for egrep" >&5
if eval "test \"`echo '$''{'ac_cv_prog_egrep'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2237,7 +2249,7 @@ echo "$ac_t""$ac_cv_prog_egrep" 1>&6
echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
-echo "configure:2241: checking for a sed that does not truncate output" >&5
+echo "configure:2253: checking for a sed that does not truncate output" >&5
if eval "test \"`echo '$''{'lt_cv_path_SED'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2317,9 +2329,26 @@ EOF
fi
done
- for arg in $0 "$@"; do
- echo "'$arg' \\" >> config.nice
- CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
+ echo "'$0' \\" >> config.nice
+ if test `expr -- $0 : "'.*"` = 0; then
+ CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$0'"
+ else
+ CONFIGURE_COMMAND="$CONFIGURE_COMMAND $0"
+ fi
+ for arg in $ac_configure_args; do
+ if test `expr -- $arg : "'.*"` = 0; then
+ if test `expr -- $arg : "--.*"` = 0; then
+ break;
+ fi
+ echo "'$arg' \\" >> config.nice
+ CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
+ else
+ if test `expr -- $arg : "'--.*"` = 0; then
+ break;
+ fi
+ echo "$arg \\" >> config.nice
+ CONFIGURE_COMMAND="$CONFIGURE_COMMAND $arg"
+ fi
done
echo '"$@"' >> config.nice
chmod +x config.nice
@@ -2357,7 +2386,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:2361: checking host system type" >&5
+echo "configure:2390: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -2378,7 +2407,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:2382: checking target system type" >&5
+echo "configure:2411: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -2407,14 +2436,14 @@ echo "$ac_t""$target" 1>&6
MAJOR_VERSION=5
-MINOR_VERSION=1
-RELEASE_VERSION=6
+MINOR_VERSION=2
+RELEASE_VERSION=0
EXTRA_VERSION=""
-VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
+PHP_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
+PHP_VERSION_ID=`expr $MAJOR_VERSION \* 10000 + $MINOR_VERSION \* 100 + $RELEASE_VERSION`
-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
@@ -2422,6 +2451,7 @@ 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
+echo "#define PHP_VERSION_ID $PHP_VERSION_ID" >> 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 && \
@@ -2476,7 +2506,7 @@ rm -f libs/*
# 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:2480: checking for $ac_word" >&5
+echo "configure:2510: 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
@@ -2506,7 +2536,7 @@ 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:2510: checking for $ac_word" >&5
+echo "configure:2540: 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
@@ -2557,7 +2587,7 @@ fi
# 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:2561: checking for $ac_word" >&5
+echo "configure:2591: 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
@@ -2589,7 +2619,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2593: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2623: 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.
@@ -2600,12 +2630,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 2604 "configure"
+#line 2634 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:2609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2639: \"$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
@@ -2631,12 +2661,12 @@ 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:2635: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2665: 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:2640: checking whether we are using GNU C" >&5
+echo "configure:2670: 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
@@ -2645,7 +2675,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -2664,7 +2694,7 @@ 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:2668: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2698: 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
@@ -2697,10 +2727,10 @@ fi
if test "x$CC" != xcc; then
echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
-echo "configure:2701: checking whether $CC and cc understand -c and -o together" >&5
+echo "configure:2731: checking whether $CC and cc understand -c and -o together" >&5
else
echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
-echo "configure:2704: checking whether cc understands -c and -o together" >&5
+echo "configure:2734: checking whether cc understands -c and -o together" >&5
fi
set dummy $CC; ac_cc="`echo $2 |
sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
@@ -2712,16 +2742,16 @@ else
# We do the test twice because some compilers refuse to overwrite an
# existing .o file with -o, though they will create one.
ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
-if { (eval echo configure:2716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:2717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+if { (eval echo configure:2746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+ test -f conftest.o && { (eval echo configure:2747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
then
eval ac_cv_prog_cc_${ac_cc}_c_o=yes
if test "x$CC" != xcc; then
# Test first that cc exists at all.
- if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:2752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
ac_try='cc -c conftest.c -o conftest.o 1>&5'
- if { (eval echo configure:2724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:2725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+ if { (eval echo configure:2754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+ test -f conftest.o && { (eval echo configure:2755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
then
# cc works too.
:
@@ -2748,7 +2778,7 @@ EOF
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2752: checking how to run the C preprocessor" >&5
+echo "configure:2782: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2763,13 +2793,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 2767 "configure"
+#line 2797 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2803: \"$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
:
@@ -2780,13 +2810,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2784 "configure"
+#line 2814 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2820: \"$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
:
@@ -2797,13 +2827,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2801 "configure"
+#line 2831 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2837: \"$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
:
@@ -2828,9 +2858,9 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:2832: checking for AIX" >&5
+echo "configure:2862: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
-#line 2834 "configure"
+#line 2864 "configure"
#include "confdefs.h"
#ifdef _AIX
yes
@@ -2852,7 +2882,7 @@ rm -f conftest*
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2856: checking whether ln -s works" >&5
+echo "configure:2886: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2884,7 +2914,7 @@ fi
echo $ac_n "checking if compiler supports -R""... $ac_c" 1>&6
-echo "configure:2888: checking if compiler supports -R" >&5
+echo "configure:2918: checking if compiler supports -R" >&5
if eval "test \"`echo '$''{'php_cv_cc_dashr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2892,14 +2922,14 @@ else
SAVE_LIBS=$LIBS
LIBS="-R /usr/$PHP_LIBDIR $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2896 "configure"
+#line 2926 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
php_cv_cc_dashr=yes
else
@@ -2917,7 +2947,7 @@ if test $php_cv_cc_dashr = "yes"; then
ld_runpath_switch=-R
else
echo $ac_n "checking if compiler supports -Wl,-rpath,""... $ac_c" 1>&6
-echo "configure:2921: checking if compiler supports -Wl,-rpath," >&5
+echo "configure:2951: checking if compiler supports -Wl,-rpath," >&5
if eval "test \"`echo '$''{'php_cv_cc_rpath'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2925,14 +2955,14 @@ else
SAVE_LIBS=$LIBS
LIBS="-Wl,-rpath,/usr/$PHP_LIBDIR $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2929 "configure"
+#line 2959 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
php_cv_cc_rpath=yes
else
@@ -2958,7 +2988,7 @@ fi
# Extract the first word of "re2c", so it can be a program name with args.
set dummy re2c; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2962: checking for $ac_word" >&5
+echo "configure:2992: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RE2C'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2986,7 +3016,7 @@ fi
if test -n "$RE2C"; then
echo $ac_n "checking for re2c version""... $ac_c" 1>&6
-echo "configure:2990: checking for re2c version" >&5
+echo "configure:3020: checking for re2c version" >&5
if eval "test \"`echo '$''{'php_cv_re2c_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3018,7 +3048,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3022: checking for $ac_word" >&5
+echo "configure:3052: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3059,7 +3089,7 @@ test -n "$AWK" || AWK="bork"
;;
*)
echo $ac_n "checking if $AWK is broken""... $ac_c" 1>&6
-echo "configure:3063: checking if $AWK is broken" >&5
+echo "configure:3093: checking if $AWK is broken" >&5
if ! $AWK 'function foo() {}' >/dev/null 2>&1 ; then
echo "$ac_t""yes" 1>&6
{ echo "configure: error: You should install GNU awk" 1>&2; exit 1; }
@@ -3078,7 +3108,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3082: checking for $ac_word" >&5
+echo "configure:3112: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3118,7 +3148,7 @@ test -n "$YACC" || YACC="yacc"
bison_version=none
if test "$YACC"; then
echo $ac_n "checking for bison version""... $ac_c" 1>&6
-echo "configure:3122: checking for bison version" >&5
+echo "configure:3152: checking for bison version" >&5
if eval "test \"`echo '$''{'php_cv_bison_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3159,7 +3189,7 @@ echo "$ac_t""$php_cv_bison_version" 1>&6
# Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3163: checking for $ac_word" >&5
+echo "configure:3193: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3193,7 +3223,7 @@ then
*) ac_lib=l ;;
esac
echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:3197: checking for yywrap in -l$ac_lib" >&5
+echo "configure:3227: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3201,7 +3231,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3205 "configure"
+#line 3235 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3212,7 +3242,7 @@ int main() {
yywrap()
; return 0; }
EOF
-if { (eval echo configure:3216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3236,7 +3266,7 @@ fi
if test -n "$LEX"; then
echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:3240: checking lex output file root" >&5
+echo "configure:3270: checking lex output file root" >&5
if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3257,7 +3287,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:3261: checking whether yytext is a pointer" >&5
+echo "configure:3291: checking whether yytext is a pointer" >&5
if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3269,14 +3299,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LEXLIB"
cat > conftest.$ac_ext <<EOF
-#line 3273 "configure"
+#line 3303 "configure"
#include "confdefs.h"
`cat $LEX_OUTPUT_ROOT.c`
int main() {
; return 0; }
EOF
-if { (eval echo configure:3280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_prog_lex_yytext_pointer=yes
else
@@ -3300,12 +3330,12 @@ fi
:
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3304: checking for working const" >&5
+echo "configure:3334: 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 <<EOF
-#line 3309 "configure"
+#line 3339 "configure"
#include "confdefs.h"
int main() {
@@ -3354,7 +3384,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:3358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -3380,7 +3410,7 @@ fi
if test "$LEX"; then
echo $ac_n "checking for flex version""... $ac_c" 1>&6
-echo "configure:3384: checking for flex version" >&5
+echo "configure:3414: checking for flex version" >&5
if eval "test \"`echo '$''{'php_cv_flex_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3404,7 +3434,7 @@ echo "$ac_t""$php_cv_flex_version" 1>&6
""|invalid)
flex_msg="flex versions supported for regeneration of the Zend/PHP parsers: $flex_version_list (found: $flex_version)."
echo "configure: warning: $flex_msg" 1>&2
- LEX="exit 0;"
+ LEX="echo \"error: $flex_msg\" 1>&2 ; exit 1;"
;;
esac
@@ -3603,7 +3633,7 @@ 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
echo $ac_n "checking whether to force non-PIC code in shared modules""... $ac_c" 1>&6
-echo "configure:3607: checking whether to force non-PIC code in shared modules" >&5
+echo "configure:3637: checking whether to force non-PIC code in shared modules" >&5
case $host_alias in
i?86-*-linux*|i?86-*-freebsd*)
if test "${with_pic+set}" != "set" || test "$with_pic" = "no"; then
@@ -3681,7 +3711,7 @@ if test "$cross_compiling" = yes; then
else
cat > conftest.$ac_ext <<EOF
-#line 3685 "configure"
+#line 3715 "configure"
#include "confdefs.h"
#include <pthread.h>
@@ -3699,7 +3729,7 @@ int main() {
return pthread_create(&thd, NULL, thread_routine, &data);
}
EOF
-if { (eval echo configure:3703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pthreads_working=yes
@@ -3719,7 +3749,7 @@ fi
CFLAGS=$save_CFLAGS
echo $ac_n "checking for pthreads_cflags""... $ac_c" 1>&6
-echo "configure:3723: checking for pthreads_cflags" >&5
+echo "configure:3753: checking for pthreads_cflags" >&5
if eval "test \"`echo '$''{'ac_cv_pthreads_cflags'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3741,7 +3771,7 @@ if test "$cross_compiling" = yes; then
else
cat > conftest.$ac_ext <<EOF
-#line 3745 "configure"
+#line 3775 "configure"
#include "confdefs.h"
#include <pthread.h>
@@ -3759,7 +3789,7 @@ int main() {
return pthread_create(&thd, NULL, thread_routine, &data);
}
EOF
-if { (eval echo configure:3763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pthreads_working=yes
@@ -3789,7 +3819,7 @@ fi
echo "$ac_t""$ac_cv_pthreads_cflags" 1>&6
echo $ac_n "checking for pthreads_lib""... $ac_c" 1>&6
-echo "configure:3793: checking for pthreads_lib" >&5
+echo "configure:3823: checking for pthreads_lib" >&5
if eval "test \"`echo '$''{'ac_cv_pthreads_lib'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3811,7 +3841,7 @@ if test "$cross_compiling" = yes; then
else
cat > conftest.$ac_ext <<EOF
-#line 3815 "configure"
+#line 3845 "configure"
#include "confdefs.h"
#include <pthread.h>
@@ -3829,7 +3859,7 @@ int main() {
return pthread_create(&thd, NULL, thread_routine, &data);
}
EOF
-if { (eval echo configure:3833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pthreads_working=yes
@@ -3938,7 +3968,7 @@ SAPI_LIBTOOL=libphp5.la
echo $ac_n "checking for AOLserver support""... $ac_c" 1>&6
-echo "configure:3942: checking for AOLserver support" >&5
+echo "configure:3972: checking for AOLserver support" >&5
# Check whether --with-aolserver or --without-aolserver was given.
if test "${with_aolserver+set}" = set; then
withval="$with_aolserver"
@@ -4181,7 +4211,7 @@ fi
echo $ac_n "checking for Apache 1.x module support via DSO through APXS""... $ac_c" 1>&6
-echo "configure:4185: checking for Apache 1.x module support via DSO through APXS" >&5
+echo "configure:4215: checking for Apache 1.x module support via DSO through APXS" >&5
# Check whether --with-apxs or --without-apxs was given.
if test "${with_apxs+set}" = set; then
withval="$with_apxs"
@@ -4486,7 +4516,7 @@ fi
if test "$PHP_SAPI" != "apache"; then
echo $ac_n "checking for Apache 1.x module support""... $ac_c" 1>&6
-echo "configure:4490: checking for Apache 1.x module support" >&5
+echo "configure:4520: checking for Apache 1.x module support" >&5
# Check whether --with-apache or --without-apache was given.
if test "${with_apache+set}" = set; then
withval="$with_apache"
@@ -5329,7 +5359,7 @@ fi
fi
echo $ac_n "checking for mod_charset compatibility option""... $ac_c" 1>&6
-echo "configure:5333: checking for mod_charset compatibility option" >&5
+echo "configure:5363: checking for mod_charset compatibility option" >&5
# Check whether --with-mod_charset or --without-mod_charset was given.
if test "${with_mod_charset+set}" = set; then
withval="$with_mod_charset"
@@ -5353,7 +5383,7 @@ if test -n "$APACHE_MODULE"; then
gcc_arg_name=ac_cv_gcc_arg_rdynamic
echo $ac_n "checking whether $CC supports -rdynamic""... $ac_c" 1>&6
-echo "configure:5357: checking whether $CC supports -rdynamic" >&5
+echo "configure:5387: checking whether $CC supports -rdynamic" >&5
if eval "test \"`echo '$''{'ac_cv_gcc_arg_rdynamic'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5396,7 +5426,7 @@ if test -n "$APACHE_INSTALL"; then
echo $ac_n "checking for member fd in BUFF *""... $ac_c" 1>&6
-echo "configure:5400: checking for member fd in BUFF *" >&5
+echo "configure:5430: checking for member fd in BUFF *" >&5
if eval "test \"`echo '$''{'ac_cv_php_fd_in_buff'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5408,14 +5438,14 @@ else
CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE"
fi
cat > conftest.$ac_ext <<EOF
-#line 5412 "configure"
+#line 5442 "configure"
#include "confdefs.h"
#include <httpd.h>
int main() {
conn_rec *c; int fd = c->client->fd;
; return 0; }
EOF
-if { (eval echo configure:5419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_php_fd_in_buff=yes
@@ -5466,7 +5496,7 @@ fi
echo $ac_n "checking for Apache 2.0 filter-module support via DSO through APXS""... $ac_c" 1>&6
-echo "configure:5470: checking for Apache 2.0 filter-module support via DSO through APXS" >&5
+echo "configure:5500: checking for Apache 2.0 filter-module support via DSO through APXS" >&5
# Check whether --with-apxs2filter or --without-apxs2filter was given.
if test "${with_apxs2filter+set}" = set; then
withval="$with_apxs2filter"
@@ -6296,7 +6326,7 @@ fi
echo $ac_n "checking for Apache 2.0 handler-module support via DSO through APXS""... $ac_c" 1>&6
-echo "configure:6300: checking for Apache 2.0 handler-module support via DSO through APXS" >&5
+echo "configure:6330: checking for Apache 2.0 handler-module support via DSO through APXS" >&5
# Check whether --with-apxs2 or --without-apxs2 was given.
if test "${with_apxs2+set}" = set; then
withval="$with_apxs2"
@@ -7127,7 +7157,7 @@ fi
echo $ac_n "checking for Apache 1.x (hooks) module support via DSO through APXS""... $ac_c" 1>&6
-echo "configure:7131: checking for Apache 1.x (hooks) module support via DSO through APXS" >&5
+echo "configure:7161: checking for Apache 1.x (hooks) module support via DSO through APXS" >&5
# Check whether --with-apache-hooks or --without-apache-hooks was given.
if test "${with_apache_hooks+set}" = set; then
withval="$with_apache_hooks"
@@ -7432,7 +7462,7 @@ fi
if test "$PHP_SAPI" != "apache_hooks"; then
echo $ac_n "checking for Apache 1.x (hooks) module support""... $ac_c" 1>&6
-echo "configure:7436: checking for Apache 1.x (hooks) module support" >&5
+echo "configure:7466: checking for Apache 1.x (hooks) module support" >&5
# Check whether --with-apache-hooks-static or --without-apache-hooks-static was given.
if test "${with_apache_hooks_static+set}" = set; then
withval="$with_apache_hooks_static"
@@ -8275,7 +8305,7 @@ fi
fi
echo $ac_n "checking for mod_charset compatibility option""... $ac_c" 1>&6
-echo "configure:8279: checking for mod_charset compatibility option" >&5
+echo "configure:8309: checking for mod_charset compatibility option" >&5
# Check whether --with-mod_charset or --without-mod_charset was given.
if test "${with_mod_charset+set}" = set; then
withval="$with_mod_charset"
@@ -8299,7 +8329,7 @@ if test -n "$APACHE_HOOKS_MODULE"; then
gcc_arg_name=ac_cv_gcc_arg_rdynamic
echo $ac_n "checking whether $CC supports -rdynamic""... $ac_c" 1>&6
-echo "configure:8303: checking whether $CC supports -rdynamic" >&5
+echo "configure:8333: checking whether $CC supports -rdynamic" >&5
if eval "test \"`echo '$''{'ac_cv_gcc_arg_rdynamic'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8342,7 +8372,7 @@ if test -n "$APACHE_HOOKS_INSTALL"; then
echo $ac_n "checking for member fd in BUFF *""... $ac_c" 1>&6
-echo "configure:8346: checking for member fd in BUFF *" >&5
+echo "configure:8376: checking for member fd in BUFF *" >&5
if eval "test \"`echo '$''{'ac_cv_php_fd_in_buff'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8354,14 +8384,14 @@ else
CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE"
fi
cat > conftest.$ac_ext <<EOF
-#line 8358 "configure"
+#line 8388 "configure"
#include "confdefs.h"
#include <httpd.h>
int main() {
conn_rec *c; int fd = c->client->fd;
; return 0; }
EOF
-if { (eval echo configure:8365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8395: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_php_fd_in_buff=yes
@@ -8413,7 +8443,7 @@ fi
RESULT=no
echo $ac_n "checking for Caudium support""... $ac_c" 1>&6
-echo "configure:8417: checking for Caudium support" >&5
+echo "configure:8447: checking for Caudium support" >&5
# Check whether --with-caudium or --without-caudium was given.
if test "${with_caudium+set}" = set; then
withval="$with_caudium"
@@ -8485,7 +8515,7 @@ if test "${with_caudium+set}" = set; then
PIKE_C_INCLUDE=/usr/local/include/`basename $PIKE`
fi
echo $ac_n "checking for C includes in $PIKE_C_INCLUDE""... $ac_c" 1>&6
-echo "configure:8489: checking for C includes in $PIKE_C_INCLUDE" >&5
+echo "configure:8519: checking for C includes in $PIKE_C_INCLUDE" >&5
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 #######
@@ -8745,7 +8775,7 @@ echo "$ac_t""$RESULT" 1>&6
echo $ac_n "checking for CLI build""... $ac_c" 1>&6
-echo "configure:8749: checking for CLI build" >&5
+echo "configure:8779: checking for CLI build" >&5
# Check whether --enable-cli or --disable-cli was given.
if test "${enable_cli+set}" = set; then
@@ -8803,7 +8833,7 @@ echo "$ac_t""$PHP_SAPI_CLI" 1>&6
echo $ac_n "checking for Continuity support""... $ac_c" 1>&6
-echo "configure:8807: checking for Continuity support" >&5
+echo "configure:8837: checking for Continuity support" >&5
# Check whether --with-continuity or --without-continuity was given.
if test "${with_continuity+set}" = set; then
withval="$with_continuity"
@@ -8824,7 +8854,7 @@ if test "$PHP_CONTINUITY" != "no"; then
{ echo "configure: error: Please specify the path to the root of your Continuity server using --with-continuity=DIR" 1>&2; exit 1; }
fi
echo $ac_n "checking for Continuity include files""... $ac_c" 1>&6
-echo "configure:8828: checking for Continuity include files" >&5
+echo "configure:8858: checking for Continuity include files" >&5
if test -d $PHP_CONTINUITY/include ; then
CAPI_INCLUDE=$PHP_CONTINUITY/include
echo "$ac_t""Continuity Binary Distribution" 1>&6
@@ -9050,7 +9080,7 @@ fi
echo $ac_n "checking for embedded SAPI library support""... $ac_c" 1>&6
-echo "configure:9054: checking for embedded SAPI library support" >&5
+echo "configure:9084: checking for embedded SAPI library support" >&5
# Check whether --enable-embed or --disable-embed was given.
if test "${enable_embed+set}" = set; then
@@ -9273,7 +9303,7 @@ fi
RESULT=no
echo $ac_n "checking for Zeus ISAPI support""... $ac_c" 1>&6
-echo "configure:9277: checking for Zeus ISAPI support" >&5
+echo "configure:9307: checking for Zeus ISAPI support" >&5
# Check whether --with-isapi or --without-isapi was given.
if test "${with_isapi+set}" = set; then
withval="$with_isapi"
@@ -9505,7 +9535,7 @@ echo "$ac_t""$RESULT" 1>&6
echo $ac_n "checking for Milter support""... $ac_c" 1>&6
-echo "configure:9509: checking for Milter support" >&5
+echo "configure:9539: checking for Milter support" >&5
# Check whether --with-milter or --without-milter was given.
if test "${with_milter+set}" = set; then
withval="$with_milter"
@@ -9780,7 +9810,7 @@ echo "$ac_t""$RESULT" 1>&6
echo $ac_n "checking for NSAPI support""... $ac_c" 1>&6
-echo "configure:9784: checking for NSAPI support" >&5
+echo "configure:9814: checking for NSAPI support" >&5
# Check whether --with-nsapi or --without-nsapi was given.
if test "${with_nsapi+set}" = set; then
withval="$with_nsapi"
@@ -9797,28 +9827,28 @@ echo "$ac_t""$PHP_NSAPI" 1>&6
if test "$PHP_NSAPI" != "no"; then
if test ! -d $PHP_NSAPI/bin ; then
- { echo "configure: error: Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR" 1>&2; exit 1; }
+ { echo "configure: error: Please specify the path to the root of your Netscape/iPlanet/Sun Webserver using --with-nsapi=DIR" 1>&2; exit 1; }
fi
echo $ac_n "checking for NSAPI include files""... $ac_c" 1>&6
-echo "configure:9804: checking for NSAPI include files" >&5
+echo "configure:9834: checking for NSAPI include files" >&5
if test -d $PHP_NSAPI/include ; then
- NSAPI_INCLUDE=$PHP_NSAPI/include
- echo "$ac_t""Netscape-Enterprise 3.x style" 1>&6
- for ac_hdr in $NSAPI_INCLUDE/nsapi.h
+ NSAPI_INC_DIR="$PHP_NSAPI/include"
+ echo "$ac_t""Netscape 3.x / Sun 7.x style" 1>&6
+ for ac_hdr in $NSAPI_INC_DIR/nsapi.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9812: checking for $ac_hdr" >&5
+echo "configure:9842: 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
-#line 9817 "configure"
+#line 9847 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9852: \"$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*
@@ -9844,26 +9874,26 @@ else
fi
done
+ NSAPI_INCLUDE="-I$NSAPI_INC_DIR"
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"
- echo "$ac_t""iPlanet 4.x / SunONE 6.x style" 1>&6
- for ac_hdr in $NSAPI_INCLUDE/nsapi.h
+ NSAPI_INC_DIR="$PHP_NSAPI/plugins/include"
+ echo "$ac_t""iPlanet 4.x / Sun 6.x style" 1>&6
+ for ac_hdr in $NSAPI_INC_DIR/nsapi.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9857: checking for $ac_hdr" >&5
+echo "configure:9887: 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
-#line 9862 "configure"
+#line 9892 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9897: \"$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*
@@ -9889,7 +9919,7 @@ else
fi
done
- NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
+ NSAPI_INCLUDE="$NSAPI_INCLUDE -I$NSAPI_INC_DIR"
fi
if test "$NSAPI_INCLUDE" = ""; then
{ echo "configure: error: Please check you have nsapi.h in either $PHP_NSAPI/include or $PHP_NSAPI/plugins/include" 1>&2; exit 1; }
@@ -10123,7 +10153,7 @@ fi
RESULT=no
echo $ac_n "checking for PHTTPD support""... $ac_c" 1>&6
-echo "configure:10127: checking for PHTTPD support" >&5
+echo "configure:10157: checking for PHTTPD support" >&5
# Check whether --with-phttpd or --without-phttpd was given.
if test "${with_phttpd+set}" = set; then
withval="$with_phttpd"
@@ -10354,7 +10384,7 @@ echo "$ac_t""$RESULT" 1>&6
RESULT=no
echo $ac_n "checking for Pi3Web support""... $ac_c" 1>&6
-echo "configure:10358: checking for Pi3Web support" >&5
+echo "configure:10388: checking for Pi3Web support" >&5
# Check whether --with-pi3web or --without-pi3web was given.
if test "${with_pi3web+set}" = set; then
@@ -10685,7 +10715,7 @@ echo "$ac_t""$RESULT" 1>&6
RESULT=no
echo $ac_n "checking for Roxen/Pike support""... $ac_c" 1>&6
-echo "configure:10689: checking for Roxen/Pike support" >&5
+echo "configure:10719: checking for Roxen/Pike support" >&5
# Check whether --with-roxen or --without-roxen was given.
if test "${with_roxen+set}" = set; then
withval="$with_roxen"
@@ -10929,7 +10959,7 @@ echo "$ac_t""$RESULT" 1>&6
if test "$RESULT" != "no" ; then
RESULT=no
echo $ac_n "checking if Roxen should use ZTS""... $ac_c" 1>&6
-echo "configure:10933: checking if Roxen should use ZTS" >&5
+echo "configure:10963: checking if Roxen should use ZTS" >&5
# Check whether --enable-roxen-zts or --disable-roxen-zts was given.
if test "${enable_roxen_zts+set}" = set; then
enableval="$enable_roxen_zts"
@@ -10989,7 +11019,7 @@ if test "${with_thttpd+set}" = set; then
gcc_arg_name=ac_cv_gcc_arg_rdynamic
echo $ac_n "checking whether $CC supports -rdynamic""... $ac_c" 1>&6
-echo "configure:10993: checking whether $CC supports -rdynamic" >&5
+echo "configure:11023: checking whether $CC supports -rdynamic" >&5
if eval "test \"`echo '$''{'ac_cv_gcc_arg_rdynamic'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -11196,7 +11226,7 @@ fi
echo $ac_n "checking for thttpd""... $ac_c" 1>&6
-echo "configure:11200: checking for thttpd" >&5
+echo "configure:11230: checking for thttpd" >&5
echo "$ac_t""$PHP_THTTPD" 1>&6
@@ -11211,17 +11241,17 @@ if test "${with_tux+set}" = set; then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:11215: checking for $ac_hdr" >&5
+echo "configure:11245: 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
-#line 11220 "configure"
+#line 11250 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11255: \"$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*
@@ -11424,7 +11454,7 @@ fi
echo $ac_n "checking for TUX""... $ac_c" 1>&6
-echo "configure:11428: checking for TUX" >&5
+echo "configure:11458: checking for TUX" >&5
echo "$ac_t""$PHP_TUX" 1>&6
unset PHP_TUX
@@ -11660,7 +11690,7 @@ fi
echo $ac_n "checking for webjames""... $ac_c" 1>&6
-echo "configure:11664: checking for webjames" >&5
+echo "configure:11694: checking for webjames" >&5
echo "$ac_t""$PHP_WEBJAMES" 1>&6
@@ -11734,7 +11764,7 @@ fi
if test "$PHP_SAPI" = "default"; then
echo $ac_n "checking for CGI build""... $ac_c" 1>&6
-echo "configure:11738: checking for CGI build" >&5
+echo "configure:11768: checking for CGI build" >&5
if test "$PHP_SAPI_CGI" != "no"; then
echo "$ac_t""yes" 1>&6
@@ -11758,7 +11788,7 @@ echo "configure:11738: checking for CGI build" >&5
echo $ac_n "checking whether writing to stdout works""... $ac_c" 1>&6
-echo "configure:11762: checking whether writing to stdout works" >&5
+echo "configure:11792: checking whether writing to stdout works" >&5
if eval "test \"`echo '$''{'ac_cv_write_stdout'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -11769,7 +11799,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 11773 "configure"
+#line 11803 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
@@ -11787,7 +11817,7 @@ main()
}
EOF
-if { (eval echo configure:11791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:11821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_write_stdout=yes
@@ -11816,7 +11846,7 @@ EOF
echo $ac_n "checking whether to force Apache CGI redirect""... $ac_c" 1>&6
-echo "configure:11820: checking whether to force Apache CGI redirect" >&5
+echo "configure:11850: checking whether to force Apache CGI redirect" >&5
if test "$PHP_FORCE_CGI_REDIRECT" = "yes"; then
REDIRECT=1
else
@@ -11830,7 +11860,7 @@ EOF
echo $ac_n "checking whether to discard path_info + path_translated""... $ac_c" 1>&6
-echo "configure:11834: checking whether to discard path_info + path_translated" >&5
+echo "configure:11864: checking whether to discard path_info + path_translated" >&5
if test "$PHP_DISCARD_PATH" = "yes"; then
DISCARD_PATH=1
else
@@ -11843,7 +11873,7 @@ EOF
echo "$ac_t""$PHP_DISCARD_PATH" 1>&6
echo $ac_n "checking whether to enable path info checking""... $ac_c" 1>&6
-echo "configure:11847: checking whether to enable path info checking" >&5
+echo "configure:11877: checking whether to enable path info checking" >&5
if test "$PHP_ENABLE_PATHINFO_CHECK" = "yes"; then
ENABLE_PATHINFO_CHECK=1
else
@@ -11856,12 +11886,7 @@ EOF
echo "$ac_t""$PHP_ENABLE_PATHINFO_CHECK" 1>&6
echo $ac_n "checking whether to enable fastcgi support""... $ac_c" 1>&6
-echo "configure:11860: checking whether to enable fastcgi support" >&5
- 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
+echo "configure:11890: checking whether to enable fastcgi support" >&5
if test "$PHP_ENABLE_FASTCGI" = "yes"; then
PHP_FASTCGI=1
PHP_FCGI_FILES="fastcgi.c"
@@ -12081,7 +12106,7 @@ fi
echo $ac_n "checking for chosen SAPI module""... $ac_c" 1>&6
-echo "configure:12085: checking for chosen SAPI module" >&5
+echo "configure:12110: checking for chosen SAPI module" >&5
echo "$ac_t""$PHP_SAPI" 1>&6
if test "$enable_maintainer_zts" = "yes"; then
@@ -12130,847 +12155,7 @@ if test "$PHP_ENABLE_FASTCGI" = "yes"; then
echo "$ac_t""${T_MD}Running FastCGI checks${T_ME}" 1>&6
-
-
-
-
-
-
-
-
-
-
-
-#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 <iostream>],
-# [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 <iostream>],
-# [cin = static_cast<streambuf *>(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 <iostream>],
-# [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])
-
-echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:12188: checking for gethostbyname in -lnsl" >&5
-ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lnsl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 12196 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gethostbyname();
-
-int main() {
-gethostbyname()
-; return 0; }
-EOF
-if { (eval echo configure:12207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-lnsl $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:12235: checking for socket in -lsocket" >&5
-ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lsocket $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 12243 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char socket();
-
-int main() {
-socket()
-; return 0; }
-EOF
-if { (eval echo configure:12254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-lsocket $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-
-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_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
-echo "configure:12290: checking for pthread.h" >&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
-#line 12295 "configure"
-#include "confdefs.h"
-#include <pthread.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12300: \"$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
- :
-else
- echo "$ac_t""no" 1>&6
-acx_pthread_ok=noheader
-fi
-
-
-# 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"
- echo $ac_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS""... $ac_c" 1>&6
-echo "configure:12337: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
- cat > conftest.$ac_ext <<EOF
-#line 12339 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char pthread_join();
-
-int main() {
-pthread_join()
-; return 0; }
-EOF
-if { (eval echo configure:12350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- acx_pthread_ok=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
- echo "$ac_t""$acx_pthread_ok" 1>&6
- 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)
- echo $ac_n "checking whether pthreads work without any flags""... $ac_c" 1>&6
-echo "configure:12412: checking whether pthreads work without any flags" >&5
- ;;
-
- -*)
- echo $ac_n "checking whether pthreads work with $flag""... $ac_c" 1>&6
-echo "configure:12417: checking whether pthreads work with $flag" >&5
- PTHREAD_CFLAGS="$flag"
- ;;
-
- *)
- echo $ac_n "checking for the pthreads library -l$flag""... $ac_c" 1>&6
-echo "configure:12423: checking for the pthreads library -l$flag" >&5
- 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.
- cat > conftest.$ac_ext <<EOF
-#line 12443 "configure"
-#include "confdefs.h"
-#include <pthread.h>
-int main() {
-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);
-; return 0; }
-EOF
-if { (eval echo configure:12452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- acx_pthread_ok=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-
- echo "$ac_t""$acx_pthread_ok" 1>&6
- 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).
- echo $ac_n "checking for joinable pthread attribute""... $ac_c" 1>&6
-echo "configure:12484: checking for joinable pthread attribute" >&5
- cat > conftest.$ac_ext <<EOF
-#line 12486 "configure"
-#include "confdefs.h"
-#include <pthread.h>
-int main() {
-int attr=PTHREAD_CREATE_JOINABLE;
-; return 0; }
-EOF
-if { (eval echo configure:12493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- ok=PTHREAD_CREATE_JOINABLE
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ok=unknown
-fi
-rm -f conftest*
- if test x"$ok" = xunknown; then
- cat > conftest.$ac_ext <<EOF
-#line 12505 "configure"
-#include "confdefs.h"
-#include <pthread.h>
-int main() {
-int attr=PTHREAD_CREATE_UNDETACHED;
-; return 0; }
-EOF
-if { (eval echo configure:12512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- ok=PTHREAD_CREATE_UNDETACHED
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ok=unknown
-fi
-rm -f conftest*
- fi
- if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
- cat >> confdefs.h <<\EOF
-#define PTHREAD_CREATE_JOINABLE $ok
-EOF
-
- fi
- echo "$ac_t""${ok}" 1>&6
- if test x"$ok" = xunknown; then
- echo "configure: warning: we do not know how to create joinable pthreads" 1>&2
- fi
-
- echo $ac_n "checking if more special flags are required for pthreads""... $ac_c" 1>&6
-echo "configure:12535: checking if more special flags are required for pthreads" >&5
- flag=no
- case "${host_cpu}-${host_os}" in
- *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
- *solaris* | alpha*-osf*) flag="-D_REENTRANT";;
- esac
- echo "$ac_t""${flag}" 1>&6
- 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
- # Extract the first word of "cc_r", so it can be a program name with args.
-set dummy cc_r; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:12553: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_PTHREAD_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$PTHREAD_CC"; then
- ac_cv_prog_PTHREAD_CC="$PTHREAD_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_PTHREAD_CC="cc_r"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_PTHREAD_CC" && ac_cv_prog_PTHREAD_CC="${CC}"
-fi
-fi
-PTHREAD_CC="$ac_cv_prog_PTHREAD_CC"
-if test -n "$PTHREAD_CC"; then
- echo "$ac_t""$PTHREAD_CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-else
- PTHREAD_CC="$CC"
-fi
-
-
-
-
-
-# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-if test x"$acx_pthread_ok" = xyes; then
- THREADED=threaded${EXEEXT}
- :
-else
- acx_pthread_ok=no
-
-fi
-
-
-
-
-
- echo $ac_n "checking for sun_len in sys/un.h""... $ac_c" 1>&6
-echo "configure:12602: checking for sun_len in sys/un.h" >&5
- cat > conftest.$ac_ext <<EOF
-#line 12604 "configure"
-#include "confdefs.h"
-#include <sys/un.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "sun_len" >/dev/null 2>&1; then
- rm -rf conftest*
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_SOCKADDR_UN_SUN_LEN 1
-EOF
-
-else
- rm -rf conftest*
- echo "$ac_t""no" 1>&6
-fi
-rm -f conftest*
-
-
- echo $ac_n "checking for fpos_t in stdio.h""... $ac_c" 1>&6
-echo "configure:12624: checking for fpos_t in stdio.h" >&5
- cat > conftest.$ac_ext <<EOF
-#line 12626 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "fpos_t" >/dev/null 2>&1; then
- rm -rf conftest*
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_FPOS 1
-EOF
-
-else
- rm -rf conftest*
- echo "$ac_t""no" 1>&6
-fi
-rm -f conftest*
-
-
- for ac_hdr in sys/socket.h netdb.h netinet/in.h arpa/inet.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:12649: 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
-#line 12654 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12659: \"$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 <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- for ac_hdr in sys/time.h limits.h sys/param.h unistd.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:12689: 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
-#line 12694 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12699: \"$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 <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
- echo $ac_n "checking for a fileno() prototype in stdio.h""... $ac_c" 1>&6
-echo "configure:12727: checking for a fileno() prototype in stdio.h" >&5
- cat > conftest.$ac_ext <<EOF
-#line 12729 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "fileno" >/dev/null 2>&1; then
- rm -rf conftest*
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_FILENO_PROTO 1
-EOF
-
-else
- rm -rf conftest*
- echo "$ac_t""no" 1>&6
-fi
-rm -f conftest*
-
-
- if test "$HAVE_SYS_SOCKET_H"; then
- echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6
-echo "configure:12750: checking for socklen_t in sys/socket.h" >&5
- cat > conftest.$ac_ext <<EOF
-#line 12752 "configure"
-#include "confdefs.h"
-#include <sys/socket.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "socklen_t" >/dev/null 2>&1; then
- rm -rf conftest*
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_SOCKLEN 1
-EOF
-
-else
- rm -rf conftest*
- echo "$ac_t""no" 1>&6
-fi
-rm -f conftest*
-
- fi
-
- #--------------------------------------------------------------------
- # Do we need cross-process locking on this platform?
- #--------------------------------------------------------------------
- echo $ac_n "checking whether cross-process locking is required by accept()""... $ac_c" 1>&6
-echo "configure:12776: checking whether cross-process locking is required by accept()" >&5
- case "`uname -sr`" in
- IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0)
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define USE_LOCKING 1
-EOF
-
- ;;
- *)
- echo "$ac_t""no" 1>&6
- ;;
- esac
-
- #--------------------------------------------------------------------
- # Does va_arg(arg, long double) crash the compiler?
- # hpux 9.04 compiler does and so does Stratus FTX (uses HP's compiler)
- #--------------------------------------------------------------------
- echo $ac_n "checking whether va_arg(arg, long double) crashes the compiler""... $ac_c" 1>&6
-echo "configure:12795: checking whether va_arg(arg, long double) crashes the compiler" >&5
- cat > conftest.$ac_ext <<EOF
-#line 12797 "configure"
-#include "confdefs.h"
-#include <stdarg.h>
-int main() {
-long double lDblArg; va_list arg; lDblArg = va_arg(arg, long double);
-; return 0; }
-EOF
-if { (eval echo configure:12804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- echo "$ac_t""no" 1>&6
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_VA_ARG_LONG_DOUBLE_BUG 1
-EOF
-
-fi
-rm -f conftest*
-
- echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:12820: 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 <<EOF
-#line 12825 "configure"
-#include "confdefs.h"
-
-int main() {
-
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
-
-; return 0; }
-EOF
-if { (eval echo configure:12874: \"$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
-
-
-
-for ac_func in strerror
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12899: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 12904 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:12927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
-fi
-done
-
-
-
-#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
-
fi
@@ -12988,7 +12173,7 @@ fi
# Extract the first word of "sendmail", so it can be a program name with args.
set dummy sendmail; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:12992: checking for $ac_word" >&5
+echo "configure:12177: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PROG_SENDMAIL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -13033,7 +12218,7 @@ EOF
echo $ac_n "checking whether system uses EBCDIC""... $ac_c" 1>&6
-echo "configure:13037: checking whether system uses EBCDIC" >&5
+echo "configure:12222: checking whether system uses EBCDIC" >&5
if eval "test \"`echo '$''{'ac_cv_ebcdic'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -13044,7 +12229,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 13048 "configure"
+#line 12233 "configure"
#include "confdefs.h"
int main(void) {
@@ -13052,7 +12237,7 @@ int main(void) {
}
EOF
-if { (eval echo configure:13056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_ebcdic=yes
@@ -13080,7 +12265,7 @@ EOF
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:13084: checking whether byte ordering is bigendian" >&5
+echo "configure:12269: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian_php'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -13090,7 +12275,7 @@ else
ac_cv_c_bigendian_php=unknown
else
cat > conftest.$ac_ext <<EOF
-#line 13094 "configure"
+#line 12279 "configure"
#include "confdefs.h"
int main(void)
@@ -13106,7 +12291,7 @@ int main(void)
}
EOF
-if { (eval echo configure:13110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian_php=yes
else
@@ -13177,12 +12362,12 @@ test -d /usr/ucblib &&
unset found
echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:13181: checking for socket" >&5
+echo "configure:12366: checking for socket" >&5
if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 13186 "configure"
+#line 12371 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char socket(); below. */
@@ -13205,7 +12390,7 @@ socket();
; return 0; }
EOF
-if { (eval echo configure:13209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_socket=yes"
else
@@ -13223,12 +12408,12 @@ if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __socket""... $ac_c" 1>&6
-echo "configure:13227: checking for __socket" >&5
+echo "configure:12412: checking for __socket" >&5
if eval "test \"`echo '$''{'ac_cv_func___socket'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 13232 "configure"
+#line 12417 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __socket(); below. */
@@ -13251,7 +12436,7 @@ __socket();
; return 0; }
EOF
-if { (eval echo configure:13255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___socket=yes"
else
@@ -13289,7 +12474,7 @@ EOF
unset ac_cv_lib_socket___socket
unset found
echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:13293: checking for socket in -lsocket" >&5
+echo "configure:12478: checking for socket in -lsocket" >&5
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13297,7 +12482,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 13301 "configure"
+#line 12486 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -13308,7 +12493,7 @@ int main() {
socket()
; return 0; }
EOF
-if { (eval echo configure:13312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -13328,7 +12513,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __socket in -lsocket""... $ac_c" 1>&6
-echo "configure:13332: checking for __socket in -lsocket" >&5
+echo "configure:12517: checking for __socket in -lsocket" >&5
ac_lib_var=`echo socket'_'__socket | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13336,7 +12521,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 13340 "configure"
+#line 12525 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -13347,7 +12532,7 @@ int main() {
__socket()
; return 0; }
EOF
-if { (eval echo configure:13351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -13379,11 +12564,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 13383 "configure"
+#line 12568 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:13387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -13434,12 +12619,12 @@ EOF
unset found
echo $ac_n "checking for socketpair""... $ac_c" 1>&6
-echo "configure:13438: checking for socketpair" >&5
+echo "configure:12623: checking for socketpair" >&5
if eval "test \"`echo '$''{'ac_cv_func_socketpair'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 13443 "configure"
+#line 12628 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char socketpair(); below. */
@@ -13462,7 +12647,7 @@ socketpair();
; return 0; }
EOF
-if { (eval echo configure:13466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_socketpair=yes"
else
@@ -13480,12 +12665,12 @@ if eval "test \"`echo '$ac_cv_func_'socketpair`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __socketpair""... $ac_c" 1>&6
-echo "configure:13484: checking for __socketpair" >&5
+echo "configure:12669: checking for __socketpair" >&5
if eval "test \"`echo '$''{'ac_cv_func___socketpair'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 13489 "configure"
+#line 12674 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __socketpair(); below. */
@@ -13508,7 +12693,7 @@ __socketpair();
; return 0; }
EOF
-if { (eval echo configure:13512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___socketpair=yes"
else
@@ -13546,7 +12731,7 @@ EOF
unset ac_cv_lib_socket___socketpair
unset found
echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6
-echo "configure:13550: checking for socketpair in -lsocket" >&5
+echo "configure:12735: checking for socketpair in -lsocket" >&5
ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13554,7 +12739,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 13558 "configure"
+#line 12743 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -13565,7 +12750,7 @@ int main() {
socketpair()
; return 0; }
EOF
-if { (eval echo configure:13569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -13585,7 +12770,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __socketpair in -lsocket""... $ac_c" 1>&6
-echo "configure:13589: checking for __socketpair in -lsocket" >&5
+echo "configure:12774: checking for __socketpair in -lsocket" >&5
ac_lib_var=`echo socket'_'__socketpair | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13593,7 +12778,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 13597 "configure"
+#line 12782 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -13604,7 +12789,7 @@ int main() {
__socketpair()
; return 0; }
EOF
-if { (eval echo configure:13608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -13636,11 +12821,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 13640 "configure"
+#line 12825 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:13644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:12829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -13691,12 +12876,12 @@ EOF
unset found
echo $ac_n "checking for htonl""... $ac_c" 1>&6
-echo "configure:13695: checking for htonl" >&5
+echo "configure:12880: checking for htonl" >&5
if eval "test \"`echo '$''{'ac_cv_func_htonl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 13700 "configure"
+#line 12885 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char htonl(); below. */
@@ -13719,7 +12904,7 @@ htonl();
; return 0; }
EOF
-if { (eval echo configure:13723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_htonl=yes"
else
@@ -13737,12 +12922,12 @@ if eval "test \"`echo '$ac_cv_func_'htonl`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __htonl""... $ac_c" 1>&6
-echo "configure:13741: checking for __htonl" >&5
+echo "configure:12926: checking for __htonl" >&5
if eval "test \"`echo '$''{'ac_cv_func___htonl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 13746 "configure"
+#line 12931 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __htonl(); below. */
@@ -13765,7 +12950,7 @@ __htonl();
; return 0; }
EOF
-if { (eval echo configure:13769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___htonl=yes"
else
@@ -13803,7 +12988,7 @@ EOF
unset ac_cv_lib_socket___htonl
unset found
echo $ac_n "checking for htonl in -lsocket""... $ac_c" 1>&6
-echo "configure:13807: checking for htonl in -lsocket" >&5
+echo "configure:12992: checking for htonl in -lsocket" >&5
ac_lib_var=`echo socket'_'htonl | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13811,7 +12996,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 13815 "configure"
+#line 13000 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -13822,7 +13007,7 @@ int main() {
htonl()
; return 0; }
EOF
-if { (eval echo configure:13826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -13842,7 +13027,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __htonl in -lsocket""... $ac_c" 1>&6
-echo "configure:13846: checking for __htonl in -lsocket" >&5
+echo "configure:13031: checking for __htonl in -lsocket" >&5
ac_lib_var=`echo socket'_'__htonl | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13850,7 +13035,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 13854 "configure"
+#line 13039 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -13861,7 +13046,7 @@ int main() {
__htonl()
; return 0; }
EOF
-if { (eval echo configure:13865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -13893,11 +13078,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 13897 "configure"
+#line 13082 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:13901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -13948,12 +13133,12 @@ EOF
unset found
echo $ac_n "checking for gethostname""... $ac_c" 1>&6
-echo "configure:13952: checking for gethostname" >&5
+echo "configure:13137: checking for gethostname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 13957 "configure"
+#line 13142 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostname(); below. */
@@ -13976,7 +13161,7 @@ gethostname();
; return 0; }
EOF
-if { (eval echo configure:13980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostname=yes"
else
@@ -13994,12 +13179,12 @@ if eval "test \"`echo '$ac_cv_func_'gethostname`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __gethostname""... $ac_c" 1>&6
-echo "configure:13998: checking for __gethostname" >&5
+echo "configure:13183: checking for __gethostname" >&5
if eval "test \"`echo '$''{'ac_cv_func___gethostname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 14003 "configure"
+#line 13188 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __gethostname(); below. */
@@ -14022,7 +13207,7 @@ __gethostname();
; return 0; }
EOF
-if { (eval echo configure:14026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___gethostname=yes"
else
@@ -14060,7 +13245,7 @@ EOF
unset ac_cv_lib_nsl___gethostname
unset found
echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6
-echo "configure:14064: checking for gethostname in -lnsl" >&5
+echo "configure:13249: checking for gethostname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -14068,7 +13253,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 14072 "configure"
+#line 13257 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -14079,7 +13264,7 @@ int main() {
gethostname()
; return 0; }
EOF
-if { (eval echo configure:14083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -14099,7 +13284,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __gethostname in -lnsl""... $ac_c" 1>&6
-echo "configure:14103: checking for __gethostname in -lnsl" >&5
+echo "configure:13288: checking for __gethostname in -lnsl" >&5
ac_lib_var=`echo nsl'_'__gethostname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -14107,7 +13292,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 14111 "configure"
+#line 13296 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -14118,7 +13303,7 @@ int main() {
__gethostname()
; return 0; }
EOF
-if { (eval echo configure:14122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -14150,11 +13335,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 14154 "configure"
+#line 13339 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:14158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -14205,12 +13390,12 @@ EOF
unset found
echo $ac_n "checking for gethostbyaddr""... $ac_c" 1>&6
-echo "configure:14209: checking for gethostbyaddr" >&5
+echo "configure:13394: checking for gethostbyaddr" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyaddr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 14214 "configure"
+#line 13399 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyaddr(); below. */
@@ -14233,7 +13418,7 @@ gethostbyaddr();
; return 0; }
EOF
-if { (eval echo configure:14237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyaddr=yes"
else
@@ -14251,12 +13436,12 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyaddr`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __gethostbyaddr""... $ac_c" 1>&6
-echo "configure:14255: checking for __gethostbyaddr" >&5
+echo "configure:13440: checking for __gethostbyaddr" >&5
if eval "test \"`echo '$''{'ac_cv_func___gethostbyaddr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 14260 "configure"
+#line 13445 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __gethostbyaddr(); below. */
@@ -14279,7 +13464,7 @@ __gethostbyaddr();
; return 0; }
EOF
-if { (eval echo configure:14283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___gethostbyaddr=yes"
else
@@ -14317,7 +13502,7 @@ EOF
unset ac_cv_lib_nsl___gethostbyaddr
unset found
echo $ac_n "checking for gethostbyaddr in -lnsl""... $ac_c" 1>&6
-echo "configure:14321: checking for gethostbyaddr in -lnsl" >&5
+echo "configure:13506: checking for gethostbyaddr in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyaddr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -14325,7 +13510,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 14329 "configure"
+#line 13514 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -14336,7 +13521,7 @@ int main() {
gethostbyaddr()
; return 0; }
EOF
-if { (eval echo configure:14340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -14356,7 +13541,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __gethostbyaddr in -lnsl""... $ac_c" 1>&6
-echo "configure:14360: checking for __gethostbyaddr in -lnsl" >&5
+echo "configure:13545: checking for __gethostbyaddr in -lnsl" >&5
ac_lib_var=`echo nsl'_'__gethostbyaddr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -14364,7 +13549,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 14368 "configure"
+#line 13553 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -14375,7 +13560,7 @@ int main() {
__gethostbyaddr()
; return 0; }
EOF
-if { (eval echo configure:14379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -14407,11 +13592,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 14411 "configure"
+#line 13596 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:14415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -14462,12 +13647,12 @@ EOF
unset found
echo $ac_n "checking for yp_get_default_domain""... $ac_c" 1>&6
-echo "configure:14466: checking for yp_get_default_domain" >&5
+echo "configure:13651: checking for yp_get_default_domain" >&5
if eval "test \"`echo '$''{'ac_cv_func_yp_get_default_domain'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 14471 "configure"
+#line 13656 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char yp_get_default_domain(); below. */
@@ -14490,7 +13675,7 @@ yp_get_default_domain();
; return 0; }
EOF
-if { (eval echo configure:14494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_yp_get_default_domain=yes"
else
@@ -14508,12 +13693,12 @@ if eval "test \"`echo '$ac_cv_func_'yp_get_default_domain`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __yp_get_default_domain""... $ac_c" 1>&6
-echo "configure:14512: checking for __yp_get_default_domain" >&5
+echo "configure:13697: checking for __yp_get_default_domain" >&5
if eval "test \"`echo '$''{'ac_cv_func___yp_get_default_domain'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 14517 "configure"
+#line 13702 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __yp_get_default_domain(); below. */
@@ -14536,7 +13721,7 @@ __yp_get_default_domain();
; return 0; }
EOF
-if { (eval echo configure:14540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___yp_get_default_domain=yes"
else
@@ -14574,7 +13759,7 @@ EOF
unset ac_cv_lib_nsl___yp_get_default_domain
unset found
echo $ac_n "checking for yp_get_default_domain in -lnsl""... $ac_c" 1>&6
-echo "configure:14578: checking for yp_get_default_domain in -lnsl" >&5
+echo "configure:13763: checking for yp_get_default_domain in -lnsl" >&5
ac_lib_var=`echo nsl'_'yp_get_default_domain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -14582,7 +13767,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 14586 "configure"
+#line 13771 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -14593,7 +13778,7 @@ int main() {
yp_get_default_domain()
; return 0; }
EOF
-if { (eval echo configure:14597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -14613,7 +13798,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __yp_get_default_domain in -lnsl""... $ac_c" 1>&6
-echo "configure:14617: checking for __yp_get_default_domain in -lnsl" >&5
+echo "configure:13802: checking for __yp_get_default_domain in -lnsl" >&5
ac_lib_var=`echo nsl'_'__yp_get_default_domain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -14621,7 +13806,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 14625 "configure"
+#line 13810 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -14632,7 +13817,7 @@ int main() {
__yp_get_default_domain()
; return 0; }
EOF
-if { (eval echo configure:14636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -14664,11 +13849,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 14668 "configure"
+#line 13853 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:14672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:13857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -14720,12 +13905,12 @@ EOF
unset found
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:14724: checking for dlopen" >&5
+echo "configure:13909: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 14729 "configure"
+#line 13914 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
@@ -14748,7 +13933,7 @@ dlopen();
; return 0; }
EOF
-if { (eval echo configure:14752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dlopen=yes"
else
@@ -14766,12 +13951,12 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __dlopen""... $ac_c" 1>&6
-echo "configure:14770: checking for __dlopen" >&5
+echo "configure:13955: checking for __dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func___dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 14775 "configure"
+#line 13960 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __dlopen(); below. */
@@ -14794,7 +13979,7 @@ __dlopen();
; return 0; }
EOF
-if { (eval echo configure:14798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___dlopen=yes"
else
@@ -14832,7 +14017,7 @@ EOF
unset ac_cv_lib_dl___dlopen
unset found
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:14836: checking for dlopen in -ldl" >&5
+echo "configure:14021: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -14840,7 +14025,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 14844 "configure"
+#line 14029 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -14851,7 +14036,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:14855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -14871,7 +14056,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:14875: checking for __dlopen in -ldl" >&5
+echo "configure:14060: checking for __dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'__dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -14879,7 +14064,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 14883 "configure"
+#line 14068 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -14890,7 +14075,7 @@ int main() {
__dlopen()
; return 0; }
EOF
-if { (eval echo configure:14894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -14922,11 +14107,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 14926 "configure"
+#line 14111 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:14930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -14978,7 +14163,7 @@ EOF
fi
echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:14982: checking for sin in -lm" >&5
+echo "configure:14167: checking for sin in -lm" >&5
ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -14986,7 +14171,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 14990 "configure"
+#line 14175 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -14997,7 +14182,7 @@ int main() {
sin()
; return 0; }
EOF
-if { (eval echo configure:15001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -15031,12 +14216,12 @@ fi
unset found
echo $ac_n "checking for res_search""... $ac_c" 1>&6
-echo "configure:15035: checking for res_search" >&5
+echo "configure:14220: checking for res_search" >&5
if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 15040 "configure"
+#line 14225 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char res_search(); below. */
@@ -15059,7 +14244,7 @@ res_search();
; return 0; }
EOF
-if { (eval echo configure:15063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_res_search=yes"
else
@@ -15077,12 +14262,12 @@ if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __res_search""... $ac_c" 1>&6
-echo "configure:15081: checking for __res_search" >&5
+echo "configure:14266: checking for __res_search" >&5
if eval "test \"`echo '$''{'ac_cv_func___res_search'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 15086 "configure"
+#line 14271 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __res_search(); below. */
@@ -15105,7 +14290,7 @@ __res_search();
; return 0; }
EOF
-if { (eval echo configure:15109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___res_search=yes"
else
@@ -15143,7 +14328,7 @@ EOF
unset ac_cv_lib_resolv___res_search
unset found
echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
-echo "configure:15147: checking for res_search in -lresolv" >&5
+echo "configure:14332: checking for res_search in -lresolv" >&5
ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -15151,7 +14336,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 15155 "configure"
+#line 14340 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -15162,7 +14347,7 @@ int main() {
res_search()
; return 0; }
EOF
-if { (eval echo configure:15166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -15182,7 +14367,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __res_search in -lresolv""... $ac_c" 1>&6
-echo "configure:15186: checking for __res_search in -lresolv" >&5
+echo "configure:14371: checking for __res_search in -lresolv" >&5
ac_lib_var=`echo resolv'_'__res_search | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -15190,7 +14375,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 15194 "configure"
+#line 14379 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -15201,7 +14386,7 @@ int main() {
__res_search()
; return 0; }
EOF
-if { (eval echo configure:15205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -15233,11 +14418,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 15237 "configure"
+#line 14422 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:15241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -15279,7 +14464,7 @@ EOF
unset ac_cv_lib_bind___res_search
unset found
echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
-echo "configure:15283: checking for res_search in -lbind" >&5
+echo "configure:14468: checking for res_search in -lbind" >&5
ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -15287,7 +14472,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 15291 "configure"
+#line 14476 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -15298,7 +14483,7 @@ int main() {
res_search()
; return 0; }
EOF
-if { (eval echo configure:15302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -15318,7 +14503,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __res_search in -lbind""... $ac_c" 1>&6
-echo "configure:15322: checking for __res_search in -lbind" >&5
+echo "configure:14507: checking for __res_search in -lbind" >&5
ac_lib_var=`echo bind'_'__res_search | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -15326,7 +14511,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 15330 "configure"
+#line 14515 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -15337,7 +14522,7 @@ int main() {
__res_search()
; return 0; }
EOF
-if { (eval echo configure:15341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -15369,11 +14554,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 15373 "configure"
+#line 14558 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:15377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -15415,7 +14600,7 @@ EOF
unset ac_cv_lib_socket___res_search
unset found
echo $ac_n "checking for res_search in -lsocket""... $ac_c" 1>&6
-echo "configure:15419: checking for res_search in -lsocket" >&5
+echo "configure:14604: checking for res_search in -lsocket" >&5
ac_lib_var=`echo socket'_'res_search | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -15423,7 +14608,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 15427 "configure"
+#line 14612 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -15434,7 +14619,7 @@ int main() {
res_search()
; return 0; }
EOF
-if { (eval echo configure:15438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -15454,7 +14639,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __res_search in -lsocket""... $ac_c" 1>&6
-echo "configure:15458: checking for __res_search in -lsocket" >&5
+echo "configure:14643: checking for __res_search in -lsocket" >&5
ac_lib_var=`echo socket'_'__res_search | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -15462,7 +14647,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 15466 "configure"
+#line 14651 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -15473,7 +14658,7 @@ int main() {
__res_search()
; return 0; }
EOF
-if { (eval echo configure:15477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -15505,11 +14690,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 15509 "configure"
+#line 14694 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:15513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -15567,12 +14752,12 @@ EOF
unset found
echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
-echo "configure:15571: checking for inet_aton" >&5
+echo "configure:14756: checking for inet_aton" >&5
if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 15576 "configure"
+#line 14761 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char inet_aton(); below. */
@@ -15595,7 +14780,7 @@ inet_aton();
; return 0; }
EOF
-if { (eval echo configure:15599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_inet_aton=yes"
else
@@ -15613,12 +14798,12 @@ if eval "test \"`echo '$ac_cv_func_'inet_aton`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __inet_aton""... $ac_c" 1>&6
-echo "configure:15617: checking for __inet_aton" >&5
+echo "configure:14802: checking for __inet_aton" >&5
if eval "test \"`echo '$''{'ac_cv_func___inet_aton'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 15622 "configure"
+#line 14807 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __inet_aton(); below. */
@@ -15641,7 +14826,7 @@ __inet_aton();
; return 0; }
EOF
-if { (eval echo configure:15645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___inet_aton=yes"
else
@@ -15679,7 +14864,7 @@ EOF
unset ac_cv_lib_resolv___inet_aton
unset found
echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
-echo "configure:15683: checking for inet_aton in -lresolv" >&5
+echo "configure:14868: checking for inet_aton in -lresolv" >&5
ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -15687,7 +14872,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 15691 "configure"
+#line 14876 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -15698,7 +14883,7 @@ int main() {
inet_aton()
; return 0; }
EOF
-if { (eval echo configure:15702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -15718,7 +14903,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __inet_aton in -lresolv""... $ac_c" 1>&6
-echo "configure:15722: checking for __inet_aton in -lresolv" >&5
+echo "configure:14907: checking for __inet_aton in -lresolv" >&5
ac_lib_var=`echo resolv'_'__inet_aton | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -15726,7 +14911,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 15730 "configure"
+#line 14915 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -15737,7 +14922,7 @@ int main() {
__inet_aton()
; return 0; }
EOF
-if { (eval echo configure:15741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -15769,11 +14954,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 15773 "configure"
+#line 14958 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:15777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:14962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -15815,7 +15000,7 @@ EOF
unset ac_cv_lib_bind___inet_aton
unset found
echo $ac_n "checking for inet_aton in -lbind""... $ac_c" 1>&6
-echo "configure:15819: checking for inet_aton in -lbind" >&5
+echo "configure:15004: checking for inet_aton in -lbind" >&5
ac_lib_var=`echo bind'_'inet_aton | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -15823,7 +15008,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 15827 "configure"
+#line 15012 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -15834,7 +15019,7 @@ int main() {
inet_aton()
; return 0; }
EOF
-if { (eval echo configure:15838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -15854,7 +15039,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __inet_aton in -lbind""... $ac_c" 1>&6
-echo "configure:15858: checking for __inet_aton in -lbind" >&5
+echo "configure:15043: checking for __inet_aton in -lbind" >&5
ac_lib_var=`echo bind'_'__inet_aton | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -15862,7 +15047,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 15866 "configure"
+#line 15051 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -15873,7 +15058,7 @@ int main() {
__inet_aton()
; return 0; }
EOF
-if { (eval echo configure:15877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -15905,11 +15090,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 15909 "configure"
+#line 15094 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:15913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:15098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -15963,12 +15148,12 @@ EOF
unset found
echo $ac_n "checking for dn_skipname""... $ac_c" 1>&6
-echo "configure:15967: checking for dn_skipname" >&5
+echo "configure:15152: checking for dn_skipname" >&5
if eval "test \"`echo '$''{'ac_cv_func_dn_skipname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 15972 "configure"
+#line 15157 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dn_skipname(); below. */
@@ -15991,7 +15176,7 @@ dn_skipname();
; return 0; }
EOF
-if { (eval echo configure:15995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dn_skipname=yes"
else
@@ -16009,12 +15194,12 @@ if eval "test \"`echo '$ac_cv_func_'dn_skipname`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __dn_skipname""... $ac_c" 1>&6
-echo "configure:16013: checking for __dn_skipname" >&5
+echo "configure:15198: checking for __dn_skipname" >&5
if eval "test \"`echo '$''{'ac_cv_func___dn_skipname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 16018 "configure"
+#line 15203 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __dn_skipname(); below. */
@@ -16037,7 +15222,7 @@ __dn_skipname();
; return 0; }
EOF
-if { (eval echo configure:16041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___dn_skipname=yes"
else
@@ -16075,7 +15260,7 @@ EOF
unset ac_cv_lib_resolv___dn_skipname
unset found
echo $ac_n "checking for dn_skipname in -lresolv""... $ac_c" 1>&6
-echo "configure:16079: checking for dn_skipname in -lresolv" >&5
+echo "configure:15264: checking for dn_skipname in -lresolv" >&5
ac_lib_var=`echo resolv'_'dn_skipname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -16083,7 +15268,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 16087 "configure"
+#line 15272 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -16094,7 +15279,7 @@ int main() {
dn_skipname()
; return 0; }
EOF
-if { (eval echo configure:16098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -16114,7 +15299,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __dn_skipname in -lresolv""... $ac_c" 1>&6
-echo "configure:16118: checking for __dn_skipname in -lresolv" >&5
+echo "configure:15303: checking for __dn_skipname in -lresolv" >&5
ac_lib_var=`echo resolv'_'__dn_skipname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -16122,7 +15307,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 16126 "configure"
+#line 15311 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -16133,7 +15318,7 @@ int main() {
__dn_skipname()
; return 0; }
EOF
-if { (eval echo configure:16137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -16165,11 +15350,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 16169 "configure"
+#line 15354 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:16173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:15358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -16211,7 +15396,7 @@ EOF
unset ac_cv_lib_bind___dn_skipname
unset found
echo $ac_n "checking for dn_skipname in -lbind""... $ac_c" 1>&6
-echo "configure:16215: checking for dn_skipname in -lbind" >&5
+echo "configure:15400: checking for dn_skipname in -lbind" >&5
ac_lib_var=`echo bind'_'dn_skipname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -16219,7 +15404,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 16223 "configure"
+#line 15408 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -16230,7 +15415,7 @@ int main() {
dn_skipname()
; return 0; }
EOF
-if { (eval echo configure:16234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -16250,7 +15435,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __dn_skipname in -lbind""... $ac_c" 1>&6
-echo "configure:16254: checking for __dn_skipname in -lbind" >&5
+echo "configure:15439: checking for __dn_skipname in -lbind" >&5
ac_lib_var=`echo bind'_'__dn_skipname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -16258,7 +15443,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 16262 "configure"
+#line 15447 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -16269,7 +15454,7 @@ int main() {
__dn_skipname()
; return 0; }
EOF
-if { (eval echo configure:16273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -16301,11 +15486,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 16305 "configure"
+#line 15490 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:16309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:15494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -16357,12 +15542,12 @@ EOF
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:16361: checking for ANSI C header files" >&5
+echo "configure:15546: 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 <<EOF
-#line 16366 "configure"
+#line 15551 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -16370,7 +15555,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:15559: \"$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*
@@ -16387,7 +15572,7 @@ 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
-#line 16391 "configure"
+#line 15576 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -16405,7 +15590,7 @@ 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
-#line 16409 "configure"
+#line 15594 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -16426,7 +15611,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 16430 "configure"
+#line 15615 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -16437,7 +15622,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:16441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:15626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -16465,12 +15650,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:16469: checking for $ac_hdr that defines DIR" >&5
+echo "configure:15654: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 16474 "configure"
+#line 15659 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -16478,7 +15663,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:16482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -16503,7 +15688,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:16507: checking for opendir in -ldir" >&5
+echo "configure:15692: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -16511,7 +15696,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 16515 "configure"
+#line 15700 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -16522,7 +15707,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:16526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -16544,7 +15729,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:16548: checking for opendir in -lx" >&5
+echo "configure:15733: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -16552,7 +15737,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 16556 "configure"
+#line 15741 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -16563,7 +15748,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:16567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -16631,6 +15816,7 @@ sys/vfs.h \
sys/sysexits.h \
sys/varargs.h \
sys/wait.h \
+sys/loadavg.h \
termios.h \
unistd.h \
unix.h \
@@ -16643,17 +15829,17 @@ assert.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:16647: checking for $ac_hdr" >&5
+echo "configure:15833: 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
-#line 16652 "configure"
+#line 15838 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:16657: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:15843: \"$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*
@@ -16682,12 +15868,12 @@ done
echo $ac_n "checking for fopencookie""... $ac_c" 1>&6
-echo "configure:16686: checking for fopencookie" >&5
+echo "configure:15872: checking for fopencookie" >&5
if eval "test \"`echo '$''{'ac_cv_func_fopencookie'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 16691 "configure"
+#line 15877 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char fopencookie(); below. */
@@ -16710,7 +15896,7 @@ fopencookie();
; return 0; }
EOF
-if { (eval echo configure:16714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_fopencookie=yes"
else
@@ -16732,7 +15918,7 @@ fi
if test "$have_glibc_fopencookie" = "yes"; then
cat > conftest.$ac_ext <<EOF
-#line 16736 "configure"
+#line 15922 "configure"
#include "confdefs.h"
#define _GNU_SOURCE
@@ -16742,7 +15928,7 @@ int main() {
cookie_io_functions_t cookie;
; return 0; }
EOF
-if { (eval echo configure:16746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15932: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
have_cookie_io_functions_t=yes
else
@@ -16761,7 +15947,7 @@ if test "$cross_compiling" = yes; then
else
cat > conftest.$ac_ext <<EOF
-#line 16765 "configure"
+#line 15951 "configure"
#include "confdefs.h"
#define _GNU_SOURCE
@@ -16793,7 +15979,7 @@ main() {
EOF
-if { (eval echo configure:16797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:15983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
cookie_io_functions_use_off64_t=yes
@@ -16813,7 +15999,7 @@ fi
else
cat > conftest.$ac_ext <<EOF
-#line 16817 "configure"
+#line 16003 "configure"
#include "confdefs.h"
#define _GNU_SOURCE
@@ -16823,7 +16009,7 @@ int main() {
_IO_cookie_io_functions_t cookie;
; return 0; }
EOF
-if { (eval echo configure:16827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
have_IO_cookie_io_functions_t=yes
else
@@ -16857,7 +16043,7 @@ EOF
echo $ac_n "checking for broken getcwd""... $ac_c" 1>&6
-echo "configure:16861: checking for broken getcwd" >&5
+echo "configure:16047: checking for broken getcwd" >&5
os=`uname -sr 2>/dev/null`
case $os in
SunOS*)
@@ -16872,14 +16058,14 @@ EOF
echo $ac_n "checking for broken libc stdio""... $ac_c" 1>&6
-echo "configure:16876: checking for broken libc stdio" >&5
+echo "configure:16062: checking for broken libc stdio" >&5
if eval "test \"`echo '$''{'have_broken_glibc_fopen_append'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
cat > conftest.$ac_ext <<EOF
-#line 16883 "configure"
+#line 16069 "configure"
#include "confdefs.h"
#include <features.h>
@@ -16892,7 +16078,7 @@ choke me
; return 0; }
EOF
-if { (eval echo configure:16896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
have_broken_glibc_fopen_append=yes
else
@@ -16905,7 +16091,7 @@ rm -f conftest*
else
cat > conftest.$ac_ext <<EOF
-#line 16909 "configure"
+#line 16095 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -16933,7 +16119,7 @@ int main(int argc, char *argv[])
}
EOF
-if { (eval echo configure:16937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
have_broken_glibc_fopen_append=no
else
@@ -16961,12 +16147,12 @@ EOF
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:16965: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:16151: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 16970 "configure"
+#line 16156 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -16974,7 +16160,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:16978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16164: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -16995,12 +16181,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:16999: checking for tm_zone in struct tm" >&5
+echo "configure:16185: checking for tm_zone in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17004 "configure"
+#line 16190 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -17008,7 +16194,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
-if { (eval echo configure:17012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16198: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
@@ -17028,12 +16214,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:17032: checking for tzname" >&5
+echo "configure:16218: checking for tzname" >&5
if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17037 "configure"
+#line 16223 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@@ -17043,7 +16229,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
-if { (eval echo configure:17047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
@@ -17067,16 +16253,16 @@ fi
echo $ac_n "checking for missing declarations of reentrant functions""... $ac_c" 1>&6
-echo "configure:17071: checking for missing declarations of reentrant functions" >&5
+echo "configure:16257: checking for missing declarations of reentrant functions" >&5
cat > conftest.$ac_ext <<EOF
-#line 17073 "configure"
+#line 16259 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
struct tm *(*func)() = localtime_r
; return 0; }
EOF
-if { (eval echo configure:17080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
:
@@ -17094,14 +16280,14 @@ EOF
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 17098 "configure"
+#line 16284 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
struct tm *(*func)() = gmtime_r
; return 0; }
EOF
-if { (eval echo configure:17105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
:
@@ -17119,14 +16305,14 @@ EOF
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 17123 "configure"
+#line 16309 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
char *(*func)() = asctime_r
; return 0; }
EOF
-if { (eval echo configure:17130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
:
@@ -17144,14 +16330,14 @@ EOF
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 17148 "configure"
+#line 16334 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
char *(*func)() = ctime_r
; return 0; }
EOF
-if { (eval echo configure:17155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16341: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
:
@@ -17169,14 +16355,14 @@ EOF
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 17173 "configure"
+#line 16359 "configure"
#include "confdefs.h"
#include <string.h>
int main() {
char *(*func)() = strtok_r
; return 0; }
EOF
-if { (eval echo configure:17180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16366: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
:
@@ -17197,16 +16383,16 @@ rm -f conftest*
echo $ac_n "checking for fclose declaration""... $ac_c" 1>&6
-echo "configure:17201: checking for fclose declaration" >&5
+echo "configure:16387: checking for fclose declaration" >&5
cat > conftest.$ac_ext <<EOF
-#line 17203 "configure"
+#line 16389 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
int (*func)() = fclose
; return 0; }
EOF
-if { (eval echo configure:17210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
@@ -17232,12 +16418,12 @@ rm -f conftest*
echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
-echo "configure:17236: checking for tm_gmtoff in struct tm" >&5
+echo "configure:16422: checking for tm_gmtoff in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_gmtoff'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17241 "configure"
+#line 16427 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -17245,7 +16431,7 @@ int main() {
struct tm tm; tm.tm_gmtoff;
; return 0; }
EOF
-if { (eval echo configure:17249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_gmtoff=yes
else
@@ -17268,12 +16454,12 @@ fi
echo $ac_n "checking for struct flock""... $ac_c" 1>&6
-echo "configure:17272: checking for struct flock" >&5
+echo "configure:16458: checking for struct flock" >&5
if eval "test \"`echo '$''{'ac_cv_struct_flock'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17277 "configure"
+#line 16463 "configure"
#include "confdefs.h"
#include <unistd.h>
@@ -17283,7 +16469,7 @@ int main() {
struct flock x;
; return 0; }
EOF
-if { (eval echo configure:17287: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_flock=yes
@@ -17310,12 +16496,12 @@ fi
echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:17314: checking for socklen_t" >&5
+echo "configure:16500: checking for socklen_t" >&5
if eval "test \"`echo '$''{'ac_cv_socklen_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17319 "configure"
+#line 16505 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -17327,7 +16513,7 @@ socklen_t x;
; return 0; }
EOF
-if { (eval echo configure:17331: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16517: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_socklen_t=yes
@@ -17353,7 +16539,7 @@ fi
echo $ac_n "checking size of intmax_t""... $ac_c" 1>&6
-echo "configure:17357: checking size of intmax_t" >&5
+echo "configure:16543: checking size of intmax_t" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_intmax_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -17361,7 +16547,7 @@ else
ac_cv_sizeof_intmax_t=0
else
cat > conftest.$ac_ext <<EOF
-#line 17365 "configure"
+#line 16551 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -17372,7 +16558,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:17376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_intmax_t=`cat conftestval`
else
@@ -17392,7 +16578,7 @@ EOF
echo $ac_n "checking size of size_t""... $ac_c" 1>&6
-echo "configure:17396: checking size of size_t" >&5
+echo "configure:16582: checking size of size_t" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -17400,7 +16586,7 @@ else
ac_cv_sizeof_size_t=8
else
cat > conftest.$ac_ext <<EOF
-#line 17404 "configure"
+#line 16590 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -17411,7 +16597,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:17415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_size_t=`cat conftestval`
else
@@ -17431,7 +16617,7 @@ EOF
echo $ac_n "checking size of ssize_t""... $ac_c" 1>&6
-echo "configure:17435: checking size of ssize_t" >&5
+echo "configure:16621: checking size of ssize_t" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_ssize_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -17439,7 +16625,7 @@ else
ac_cv_sizeof_ssize_t=8
else
cat > conftest.$ac_ext <<EOF
-#line 17443 "configure"
+#line 16629 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -17450,7 +16636,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:17454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_ssize_t=`cat conftestval`
else
@@ -17470,7 +16656,7 @@ EOF
echo $ac_n "checking size of ptrdiff_t""... $ac_c" 1>&6
-echo "configure:17474: checking size of ptrdiff_t" >&5
+echo "configure:16660: checking size of ptrdiff_t" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_ptrdiff_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -17478,7 +16664,7 @@ else
ac_cv_sizeof_ptrdiff_t=8
else
cat > conftest.$ac_ext <<EOF
-#line 17482 "configure"
+#line 16668 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -17489,7 +16675,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:17493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_ptrdiff_t=`cat conftestval`
else
@@ -17509,7 +16695,7 @@ EOF
echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:17513: checking size of long long" >&5
+echo "configure:16699: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -17517,7 +16703,7 @@ else
ac_cv_sizeof_long_long=8
else
cat > conftest.$ac_ext <<EOF
-#line 17521 "configure"
+#line 16707 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -17528,7 +16714,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:17532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_long=`cat conftestval`
else
@@ -17548,7 +16734,7 @@ EOF
echo $ac_n "checking size of long long int""... $ac_c" 1>&6
-echo "configure:17552: checking size of long long int" >&5
+echo "configure:16738: checking size of long long int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -17556,7 +16742,7 @@ else
ac_cv_sizeof_long_long_int=8
else
cat > conftest.$ac_ext <<EOF
-#line 17560 "configure"
+#line 16746 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -17567,7 +16753,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:17571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_long_int=`cat conftestval`
else
@@ -17587,7 +16773,7 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:17591: checking size of long" >&5
+echo "configure:16777: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -17595,7 +16781,7 @@ else
ac_cv_sizeof_long=8
else
cat > conftest.$ac_ext <<EOF
-#line 17599 "configure"
+#line 16785 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -17606,7 +16792,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:17610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
@@ -17626,7 +16812,7 @@ EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:17630: checking size of int" >&5
+echo "configure:16816: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -17634,7 +16820,7 @@ else
ac_cv_sizeof_int=4
else
cat > conftest.$ac_ext <<EOF
-#line 17638 "configure"
+#line 16824 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -17645,7 +16831,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:17649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
@@ -17666,12 +16852,12 @@ EOF
echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:17670: checking for st_blksize in struct stat" >&5
+echo "configure:16856: checking for st_blksize in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17675 "configure"
+#line 16861 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -17679,7 +16865,7 @@ int main() {
struct stat s; s.st_blksize;
; return 0; }
EOF
-if { (eval echo configure:17683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blksize=yes
else
@@ -17701,12 +16887,12 @@ fi
if test "`uname -s 2>/dev/null`" != "QNX"; then
echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:17705: checking for st_blocks in struct stat" >&5
+echo "configure:16891: checking for st_blocks in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17710 "configure"
+#line 16896 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -17714,7 +16900,7 @@ int main() {
struct stat s; s.st_blocks;
; return 0; }
EOF
-if { (eval echo configure:17718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blocks=yes
else
@@ -17741,12 +16927,12 @@ else
WARNING_LEVEL=0
fi
echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:17745: checking for st_rdev in struct stat" >&5
+echo "configure:16931: checking for st_rdev in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17750 "configure"
+#line 16936 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -17754,7 +16940,7 @@ int main() {
struct stat s; s.st_rdev;
; return 0; }
EOF
-if { (eval echo configure:17758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_rdev=yes
else
@@ -17776,12 +16962,12 @@ fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:17780: checking for size_t" >&5
+echo "configure:16966: 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 <<EOF
-#line 17785 "configure"
+#line 16971 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -17809,12 +16995,12 @@ EOF
fi
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:17813: checking for uid_t in sys/types.h" >&5
+echo "configure:16999: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17818 "configure"
+#line 17004 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -17845,12 +17031,12 @@ fi
echo $ac_n "checking for struct sockaddr_storage""... $ac_c" 1>&6
-echo "configure:17849: checking for struct sockaddr_storage" >&5
+echo "configure:17035: checking for struct sockaddr_storage" >&5
if eval "test \"`echo '$''{'ac_cv_sockaddr_storage'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17854 "configure"
+#line 17040 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@@ -17858,7 +17044,7 @@ int main() {
struct sockaddr_storage s; s
; return 0; }
EOF
-if { (eval echo configure:17862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:17048: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sockaddr_storage=yes
else
@@ -17879,13 +17065,13 @@ EOF
fi
echo $ac_n "checking for field sa_len in struct sockaddr""... $ac_c" 1>&6
-echo "configure:17883: checking for field sa_len in struct sockaddr" >&5
+echo "configure:17069: checking for field sa_len in struct sockaddr" >&5
if eval "test \"`echo '$''{'ac_cv_sockaddr_sa_len'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17889 "configure"
+#line 17075 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@@ -17893,7 +17079,7 @@ int main() {
static struct sockaddr sa; int n = (int) sa.sa_len; return n;
; return 0; }
EOF
-if { (eval echo configure:17897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:17083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sockaddr_sa_len=yes
else
@@ -17916,12 +17102,12 @@ EOF
echo $ac_n "checking for IPv6 support""... $ac_c" 1>&6
-echo "configure:17920: checking for IPv6 support" >&5
+echo "configure:17106: checking for IPv6 support" >&5
if eval "test \"`echo '$''{'ac_cv_ipv6_support'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17925 "configure"
+#line 17111 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@@ -17930,7 +17116,7 @@ int main() {
struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;
; return 0; }
EOF
-if { (eval echo configure:17934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_ipv6_support=yes
else
@@ -17946,12 +17132,12 @@ echo "$ac_t""$ac_cv_ipv6_support" 1>&6
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:17950: checking for vprintf" >&5
+echo "configure:17136: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 17955 "configure"
+#line 17141 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
@@ -17974,7 +17160,7 @@ vprintf();
; return 0; }
EOF
-if { (eval echo configure:17978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
@@ -17998,12 +17184,12 @@ fi
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:18002: checking for _doprnt" >&5
+echo "configure:17188: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 18007 "configure"
+#line 17193 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
@@ -18026,7 +17212,7 @@ _doprnt();
; return 0; }
EOF
-if { (eval echo configure:18030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
@@ -18098,6 +17284,7 @@ scandir \
setitimer \
setlocale \
localeconv \
+setenv \
setpgid \
setsockopt \
setvbuf \
@@ -18129,12 +17316,12 @@ vsnprintf \
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:18133: checking for $ac_func" >&5
+echo "configure:17320: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 18138 "configure"
+#line 17325 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -18157,7 +17344,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:18161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -18183,25 +17370,25 @@ done
echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6
-echo "configure:18187: checking for getaddrinfo" >&5
+echo "configure:17374: checking for getaddrinfo" >&5
if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 18192 "configure"
+#line 17379 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);
; return 0; }
EOF
-if { (eval echo configure:18199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
if test "$cross_compiling" = yes; then
ac_cv_func_getaddrinfo=no
else
cat > conftest.$ac_ext <<EOF
-#line 18205 "configure"
+#line 17392 "configure"
#include "confdefs.h"
#include <netdb.h>
@@ -18241,7 +17428,7 @@ int main(void) {
}
EOF
-if { (eval echo configure:18245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:17432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_getaddrinfo=yes
else
@@ -18273,12 +17460,12 @@ fi
for ac_func in strlcat strlcpy getopt
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:18277: checking for $ac_func" >&5
+echo "configure:17464: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 18282 "configure"
+#line 17469 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -18301,7 +17488,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:18305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -18328,7 +17515,7 @@ done
echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6
-echo "configure:18332: checking whether utime accepts a null argument" >&5
+echo "configure:17519: checking whether utime accepts a null argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_utime_null'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -18338,7 +17525,7 @@ if test "$cross_compiling" = yes; then
ac_cv_func_utime_null=no
else
cat > conftest.$ac_ext <<EOF
-#line 18342 "configure"
+#line 17529 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -18349,7 +17536,7 @@ exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
&& t.st_mtime - s.st_mtime < 120));
}
EOF
-if { (eval echo configure:18353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:17540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_utime_null=yes
else
@@ -18375,19 +17562,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:18379: checking for working alloca.h" >&5
+echo "configure:17566: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 18384 "configure"
+#line 17571 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:18391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -18408,12 +17595,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:18412: checking for alloca" >&5
+echo "configure:17599: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 18417 "configure"
+#line 17604 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -18441,7 +17628,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:18445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -18473,12 +17660,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:18477: checking whether alloca needs Cray hooks" >&5
+echo "configure:17664: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 18482 "configure"
+#line 17669 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -18503,12 +17690,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:18507: checking for $ac_func" >&5
+echo "configure:17694: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 18512 "configure"
+#line 17699 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -18531,7 +17718,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:18535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -18558,7 +17745,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:18562: checking stack direction for C alloca" >&5
+echo "configure:17749: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -18566,7 +17753,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 18570 "configure"
+#line 17757 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -18585,7 +17772,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:18589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:17776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -18608,13 +17795,13 @@ fi
echo $ac_n "checking for declared timezone""... $ac_c" 1>&6
-echo "configure:18612: checking for declared timezone" >&5
+echo "configure:17799: checking for declared timezone" >&5
if eval "test \"`echo '$''{'ac_cv_declared_timezone'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 18618 "configure"
+#line 17805 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -18629,7 +17816,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:18633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:17820: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_declared_timezone=yes
@@ -18655,7 +17842,7 @@ EOF
echo $ac_n "checking for type of reentrant time-related functions""... $ac_c" 1>&6
-echo "configure:18659: checking for type of reentrant time-related functions" >&5
+echo "configure:17846: checking for type of reentrant time-related functions" >&5
if eval "test \"`echo '$''{'ac_cv_time_r_type'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -18666,7 +17853,7 @@ if test "$cross_compiling" = yes; then
else
cat > conftest.$ac_ext <<EOF
-#line 18670 "configure"
+#line 17857 "configure"
#include "confdefs.h"
#include <time.h>
@@ -18684,7 +17871,7 @@ return (1);
}
EOF
-if { (eval echo configure:18688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:17875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_time_r_type=hpux
@@ -18700,7 +17887,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 18704 "configure"
+#line 17891 "configure"
#include "confdefs.h"
#include <time.h>
@@ -18716,7 +17903,7 @@ main() {
}
EOF
-if { (eval echo configure:18720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:17907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_time_r_type=irix
@@ -18754,12 +17941,12 @@ EOF
echo $ac_n "checking for readdir_r""... $ac_c" 1>&6
-echo "configure:18758: checking for readdir_r" >&5
+echo "configure:17945: checking for readdir_r" >&5
if eval "test \"`echo '$''{'ac_cv_func_readdir_r'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 18763 "configure"
+#line 17950 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char readdir_r(); below. */
@@ -18782,7 +17969,7 @@ readdir_r();
; return 0; }
EOF
-if { (eval echo configure:18786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_readdir_r=yes"
else
@@ -18804,7 +17991,7 @@ fi
if test "$ac_cv_func_readdir_r" = "yes"; then
echo $ac_n "checking for type of readdir_r""... $ac_c" 1>&6
-echo "configure:18808: checking for type of readdir_r" >&5
+echo "configure:17995: checking for type of readdir_r" >&5
if eval "test \"`echo '$''{'ac_cv_what_readdir_r'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -18815,7 +18002,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 18819 "configure"
+#line 18006 "configure"
#include "confdefs.h"
#define _REENTRANT
@@ -18840,7 +18027,7 @@ main() {
}
EOF
-if { (eval echo configure:18844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:18031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_what_readdir_r=POSIX
@@ -18851,7 +18038,7 @@ else
rm -fr conftest*
cat > conftest.$ac_ext <<EOF
-#line 18855 "configure"
+#line 18042 "configure"
#include "confdefs.h"
#define _REENTRANT
@@ -18861,7 +18048,7 @@ int readdir_r(DIR *, struct dirent *);
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:18865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:18052: \"$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*
@@ -18903,12 +18090,12 @@ EOF
echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6
-echo "configure:18907: checking for in_addr_t" >&5
+echo "configure:18094: checking for in_addr_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_in_addr_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 18912 "configure"
+#line 18099 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -18959,7 +18146,7 @@ fi
echo $ac_n "checking whether to include gcov symbols""... $ac_c" 1>&6
-echo "configure:18963: checking whether to include gcov symbols" >&5
+echo "configure:18150: checking whether to include gcov symbols" >&5
# Check whether --enable-gcov or --disable-gcov was given.
if test "${enable_gcov+set}" = set; then
enableval="$enable_gcov"
@@ -19001,7 +18188,7 @@ if test "$PHP_GCOV" = "yes"; then
# Extract the first word of "lcov", so it can be a program name with args.
set dummy lcov; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:19005: checking for $ac_word" >&5
+echo "configure:18192: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LTP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -19030,7 +18217,7 @@ fi
# Extract the first word of "genhtml", so it can be a program name with args.
set dummy genhtml; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:19034: checking for $ac_word" >&5
+echo "configure:18221: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LTP_GENHTML'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -19065,7 +18252,7 @@ fi
if test "$LTP"; then
echo $ac_n "checking for ltp version""... $ac_c" 1>&6
-echo "configure:19069: checking for ltp version" >&5
+echo "configure:18256: checking for ltp version" >&5
if eval "test \"`echo '$''{'php_cv_ltp_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -19111,15 +18298,17 @@ EOF
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+ CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
+ CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
fi
echo $ac_n "checking whether to include debugging symbols""... $ac_c" 1>&6
-echo "configure:19123: checking whether to include debugging symbols" >&5
+echo "configure:18312: checking whether to include debugging symbols" >&5
# Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
enableval="$enable_debug"
@@ -19144,6 +18333,12 @@ echo "$ac_t""$ext_output" 1>&6
if test "$PHP_DEBUG" = "yes"; then
PHP_DEBUG=1
ZEND_DEBUG=yes
+
+ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+ CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
+
+ CFLAGS="$CFLAGS -O0"
+ CXXFLAGS="$CXXFLAGS -O0"
else
PHP_DEBUG=0
ZEND_DEBUG=no
@@ -19152,7 +18347,7 @@ fi
echo $ac_n "checking layout of installed files""... $ac_c" 1>&6
-echo "configure:19156: checking layout of installed files" >&5
+echo "configure:18351: checking layout of installed files" >&5
# Check whether --with-layout or --without-layout was given.
if test "${with_layout+set}" = set; then
withval="$with_layout"
@@ -19186,7 +18381,7 @@ esac
echo $ac_n "checking path to configuration file""... $ac_c" 1>&6
-echo "configure:19190: checking path to configuration file" >&5
+echo "configure:18385: checking path to configuration file" >&5
# Check whether --with-config-file-path or --without-config-file-path was given.
if test "${with_config_file_path+set}" = set; then
withval="$with_config_file_path"
@@ -19222,7 +18417,7 @@ fi
echo $ac_n "checking where to scan for configuration files""... $ac_c" 1>&6
-echo "configure:19226: checking where to scan for configuration files" >&5
+echo "configure:18421: checking where to scan for configuration files" >&5
# Check whether --with-config-file-scan-dir or --without-config-file-scan-dir was given.
if test "${with_config_file_scan_dir+set}" = set; then
withval="$with_config_file_scan_dir"
@@ -19252,7 +18447,7 @@ test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
echo $ac_n "checking whether to enable safe mode by default""... $ac_c" 1>&6
-echo "configure:19256: checking whether to enable safe mode by default" >&5
+echo "configure:18451: checking whether to enable safe mode by default" >&5
# Check whether --enable-safe-mode or --disable-safe-mode was given.
if test "${enable_safe_mode+set}" = set; then
enableval="$enable_safe_mode"
@@ -19287,7 +18482,7 @@ EOF
fi
echo $ac_n "checking for safe mode exec dir""... $ac_c" 1>&6
-echo "configure:19291: checking for safe mode exec dir" >&5
+echo "configure:18486: checking for safe mode exec dir" >&5
# Check whether --with-exec-dir or --without-exec-dir was given.
if test "${with_exec_dir+set}" = set; then
withval="$with_exec_dir"
@@ -19328,7 +18523,7 @@ fi
echo $ac_n "checking whether to enable PHP's own SIGCHLD handler""... $ac_c" 1>&6
-echo "configure:19332: checking whether to enable PHP's own SIGCHLD handler" >&5
+echo "configure:18527: checking whether to enable PHP's own SIGCHLD handler" >&5
# Check whether --enable-sigchild or --disable-sigchild was given.
if test "${enable_sigchild+set}" = set; then
enableval="$enable_sigchild"
@@ -19365,7 +18560,7 @@ fi
echo $ac_n "checking whether to enable magic quotes by default""... $ac_c" 1>&6
-echo "configure:19369: checking whether to enable magic quotes by default" >&5
+echo "configure:18564: checking whether to enable magic quotes by default" >&5
# Check whether --enable-magic-quotes or --disable-magic-quotes was given.
if test "${enable_magic_quotes+set}" = set; then
enableval="$enable_magic_quotes"
@@ -19402,7 +18597,7 @@ fi
echo $ac_n "checking whether to enable runpaths""... $ac_c" 1>&6
-echo "configure:19406: checking whether to enable runpaths" >&5
+echo "configure:18601: checking whether to enable runpaths" >&5
# Check whether --enable-rpath or --disable-rpath was given.
if test "${enable_rpath+set}" = set; then
enableval="$enable_rpath"
@@ -19427,7 +18622,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking whether to explicitly link against libgcc""... $ac_c" 1>&6
-echo "configure:19431: checking whether to explicitly link against libgcc" >&5
+echo "configure:18626: checking whether to explicitly link against libgcc" >&5
# Check whether --enable-libgcc or --disable-libgcc was given.
if test "${enable_libgcc+set}" = set; then
enableval="$enable_libgcc"
@@ -19506,7 +18701,7 @@ fi
echo $ac_n "checking whether to enable short tags by default""... $ac_c" 1>&6
-echo "configure:19510: checking whether to enable short tags by default" >&5
+echo "configure:18705: checking whether to enable short tags by default" >&5
# Check whether --enable-short-tags or --disable-short-tags was given.
if test "${enable_short_tags+set}" = set; then
enableval="$enable_short_tags"
@@ -19543,7 +18738,7 @@ fi
echo $ac_n "checking whether to enable dmalloc""... $ac_c" 1>&6
-echo "configure:19547: checking whether to enable dmalloc" >&5
+echo "configure:18742: checking whether to enable dmalloc" >&5
# Check whether --enable-dmalloc or --disable-dmalloc was given.
if test "${enable_dmalloc+set}" = set; then
enableval="$enable_dmalloc"
@@ -19568,7 +18763,7 @@ echo "$ac_t""$ext_output" 1>&6
if test "$PHP_DMALLOC" = "yes"; then
echo $ac_n "checking for dmalloc_error in -ldmalloc""... $ac_c" 1>&6
-echo "configure:19572: checking for dmalloc_error in -ldmalloc" >&5
+echo "configure:18767: checking for dmalloc_error in -ldmalloc" >&5
ac_lib_var=`echo dmalloc'_'dmalloc_error | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -19576,7 +18771,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldmalloc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 19580 "configure"
+#line 18775 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -19587,7 +18782,7 @@ int main() {
dmalloc_error()
; return 0; }
EOF
-if { (eval echo configure:19591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:18786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -19631,7 +18826,7 @@ fi
echo $ac_n "checking whether to enable IPv6 support""... $ac_c" 1>&6
-echo "configure:19635: checking whether to enable IPv6 support" >&5
+echo "configure:18830: checking whether to enable IPv6 support" >&5
# Check whether --enable-ipv6 or --disable-ipv6 was given.
if test "${enable_ipv6+set}" = set; then
enableval="$enable_ipv6"
@@ -19661,7 +18856,7 @@ EOF
fi
echo $ac_n "checking how big to make fd sets""... $ac_c" 1>&6
-echo "configure:19665: checking how big to make fd sets" >&5
+echo "configure:18860: checking how big to make fd sets" >&5
# Check whether --enable-fd-setsize or --disable-fd-setsize was given.
if test "${enable_fd_setsize+set}" = set; then
enableval="$enable_fd_setsize"
@@ -19681,7 +18876,7 @@ fi
echo $ac_n "checking whether to enable versioning""... $ac_c" 1>&6
-echo "configure:19685: checking whether to enable versioning" >&5
+echo "configure:18880: checking whether to enable versioning" >&5
# Check whether --enable-versioning or --disable-versioning was given.
if test "${enable_versioning+set}" = set; then
enableval="$enable_versioning"
@@ -19729,7 +18924,7 @@ fi
echo $ac_n "checking whether to enable LIBXML support""... $ac_c" 1>&6
-echo "configure:19733: checking whether to enable LIBXML support" >&5
+echo "configure:18928: checking whether to enable LIBXML support" >&5
# Check whether --enable-libxml or --disable-libxml was given.
if test "${enable_libxml+set}" = set; then
enableval="$enable_libxml"
@@ -19776,7 +18971,7 @@ if test -z "$PHP_LIBXML_DIR"; then
echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6
-echo "configure:19780: checking libxml2 install dir" >&5
+echo "configure:18975: checking libxml2 install dir" >&5
# Check whether --with-libxml-dir or --without-libxml-dir was given.
if test "${with_libxml_dir+set}" = set; then
withval="$with_libxml_dir"
@@ -19805,7 +19000,7 @@ if test "$PHP_LIBXML" != "no"; then
echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6
-echo "configure:19809: checking for xml2-config path" >&5
+echo "configure:19004: checking for xml2-config path" >&5
if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -19962,7 +19157,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6
echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6
-echo "configure:19966: checking whether libxml build works" >&5
+echo "configure:19161: checking whether libxml build works" >&5
if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -19978,7 +19173,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 19982 "configure"
+#line 19177 "configure"
#include "confdefs.h"
@@ -19989,7 +19184,7 @@ else
}
EOF
-if { (eval echo configure:19993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:19188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBS=$old_LIBS
@@ -20342,7 +19537,7 @@ fi
echo $ac_n "checking for OpenSSL support""... $ac_c" 1>&6
-echo "configure:20346: checking for OpenSSL support" >&5
+echo "configure:19541: checking for OpenSSL support" >&5
# Check whether --with-openssl or --without-openssl was given.
if test "${with_openssl+set}" = set; then
withval="$with_openssl"
@@ -20388,7 +19583,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking for Kerberos support""... $ac_c" 1>&6
-echo "configure:20392: checking for Kerberos support" >&5
+echo "configure:19587: checking for Kerberos support" >&5
# Check whether --with-kerberos or --without-kerberos was given.
if test "${with_kerberos+set}" = set; then
withval="$with_kerberos"
@@ -20706,7 +19901,7 @@ EOF
# Extract the first word of "krb5-config", so it can be a program name with args.
set dummy krb5-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:20710: checking for $ac_word" >&5
+echo "configure:19905: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_KRB5_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -21081,7 +20276,7 @@ fi
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:21085: checking for $ac_word" >&5
+echo "configure:20280: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -21285,9 +20480,9 @@ fi
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$OPENSSL_INCDIR
echo $ac_n "checking for OpenSSL version""... $ac_c" 1>&6
-echo "configure:21289: checking for OpenSSL version" >&5
+echo "configure:20484: checking for OpenSSL version" >&5
cat > conftest.$ac_ext <<EOF
-#line 21291 "configure"
+#line 20486 "configure"
#include "confdefs.h"
#include <openssl/opensslv.h>
@@ -21441,7 +20636,7 @@ rm -f conftest*
done
echo $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6
-echo "configure:21445: checking for CRYPTO_free in -lcrypto" >&5
+echo "configure:20640: checking for CRYPTO_free in -lcrypto" >&5
ac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -21449,7 +20644,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcrypto $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 21453 "configure"
+#line 20648 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -21460,7 +20655,7 @@ int main() {
CRYPTO_free()
; return 0; }
EOF
-if { (eval echo configure:21464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -21616,7 +20811,7 @@ fi
done
echo $ac_n "checking for SSL_CTX_set_ssl_version in -lssl""... $ac_c" 1>&6
-echo "configure:21620: checking for SSL_CTX_set_ssl_version in -lssl" >&5
+echo "configure:20815: checking for SSL_CTX_set_ssl_version in -lssl" >&5
ac_lib_var=`echo ssl'_'SSL_CTX_set_ssl_version | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -21624,7 +20819,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lssl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 21628 "configure"
+#line 20823 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -21635,7 +20830,7 @@ int main() {
SSL_CTX_set_ssl_version()
; return 0; }
EOF
-if { (eval echo configure:21639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:20834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -21755,7 +20950,7 @@ fi
echo $ac_n "checking for PCRE support""... $ac_c" 1>&6
-echo "configure:21759: checking for PCRE support" >&5
+echo "configure:20954: checking for PCRE support" >&5
# Check whether --with-pcre-regex or --without-pcre-regex was given.
if test "${with_pcre_regex+set}" = set; then
withval="$with_pcre_regex"
@@ -21804,7 +20999,7 @@ if test "$PHP_PCRE_REGEX" != "no"; then
ext_builddir=ext/pcre
ext_srcdir=$abs_srcdir/ext/pcre
- ac_extra=`echo "-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000 -DMATCH_LIMIT_RECURSION=10000000 -I@ext_srcdir@/pcrelib"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g`
+ ac_extra=`echo "-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000 -DMATCH_LIMIT_RECURSION=10000000 -DMAX_NAME_SIZE=32 -DMAX_NAME_COUNT=10000 -DMAX_DUPLENGTH=30000 -I@ext_srcdir@/pcrelib"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g`
if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then
PHP_PCRE_SHARED=no
@@ -21828,7 +21023,7 @@ if test "$PHP_PCRE_REGEX" != "no"; then
old_IFS=$IFS
- for ac_src in pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.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_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c; do
+ for ac_src in pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.c pcrelib/pcre_compile.c pcrelib/pcre_config.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_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c; do
IFS=.
set $ac_src
@@ -21877,7 +21072,7 @@ EOF
old_IFS=$IFS
- for ac_src in pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.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_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c; do
+ for ac_src in pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.c pcrelib/pcre_compile.c pcrelib/pcre_config.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_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c; do
IFS=.
set $ac_src
@@ -21997,7 +21192,7 @@ EOF
old_IFS=$IFS
- for ac_src in pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.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_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c; do
+ for ac_src in pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.c pcrelib/pcre_compile.c pcrelib/pcre_config.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_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c; do
IFS=.
set $ac_src
@@ -22042,7 +21237,7 @@ EOF
old_IFS=$IFS
- for ac_src in pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.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_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c; do
+ for ac_src in pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.c pcrelib/pcre_compile.c pcrelib/pcre_config.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_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c; do
IFS=.
set $ac_src
@@ -22136,8 +21331,8 @@ EOF
pcre_minor="$pcre_minor"0
fi
pcre_version=$pcre_major$pcre_minor
- if test "$pcre_version" -lt 208; then
- { echo "configure: error: The PCRE extension requires PCRE library version >= 2.08" 1>&2; exit 1; }
+ if test "$pcre_version" -lt 660; then
+ { echo "configure: error: The PCRE extension requires PCRE library version >= 6.6" 1>&2; exit 1; }
fi
@@ -22276,7 +21471,7 @@ EOF
ext_builddir=ext/pcre
ext_srcdir=$abs_srcdir/ext/pcre
- ac_extra=`echo "-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000 -DMATCH_LIMIT_RECURSION=10000000"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g`
+ ac_extra=`echo "-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000 -DMATCH_LIMIT_RECURSION=10000000 -DMAX_NAME_SIZE=32 -DMAX_NAME_COUNT=10000 -DMAX_DUPLENGTH=30000"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g`
if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then
PHP_PCRE_SHARED=no
@@ -22563,7 +21758,7 @@ fi
echo $ac_n "checking for ZLIB support""... $ac_c" 1>&6
-echo "configure:22567: checking for ZLIB support" >&5
+echo "configure:21762: checking for ZLIB support" >&5
# Check whether --with-zlib or --without-zlib was given.
if test "${with_zlib+set}" = set; then
withval="$with_zlib"
@@ -22609,7 +21804,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking if the location of ZLIB install directory is defined""... $ac_c" 1>&6
-echo "configure:22613: checking if the location of ZLIB install directory is defined" >&5
+echo "configure:21808: checking if the location of ZLIB install directory is defined" >&5
# Check whether --with-zlib-dir or --without-zlib-dir was given.
if test "${with_zlib_dir+set}" = set; then
withval="$with_zlib_dir"
@@ -23043,7 +22238,7 @@ EOF
done
echo $ac_n "checking for gzgets in -lz""... $ac_c" 1>&6
-echo "configure:23047: checking for gzgets in -lz" >&5
+echo "configure:22242: checking for gzgets in -lz" >&5
ac_lib_var=`echo z'_'gzgets | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -23051,7 +22246,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 23055 "configure"
+#line 22250 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -23062,7 +22257,7 @@ int main() {
gzgets()
; return 0; }
EOF
-if { (eval echo configure:23066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -23200,7 +22395,7 @@ fi
echo $ac_n "checking whether to enable bc style precision math functions""... $ac_c" 1>&6
-echo "configure:23204: checking whether to enable bc style precision math functions" >&5
+echo "configure:22399: checking whether to enable bc style precision math functions" >&5
# Check whether --enable-bcmath or --disable-bcmath was given.
if test "${enable_bcmath+set}" = set; then
enableval="$enable_bcmath"
@@ -23556,7 +22751,7 @@ fi
echo $ac_n "checking for BZip2 support""... $ac_c" 1>&6
-echo "configure:23560: checking for BZip2 support" >&5
+echo "configure:22755: checking for BZip2 support" >&5
# Check whether --with-bz2 or --without-bz2 was given.
if test "${with_bz2+set}" = set; then
withval="$with_bz2"
@@ -23604,7 +22799,7 @@ if test "$PHP_BZ2" != "no"; then
BZIP_DIR=$PHP_BZ2
else
echo $ac_n "checking for BZip2 in default path""... $ac_c" 1>&6
-echo "configure:23608: checking for BZip2 in default path" >&5
+echo "configure:22803: checking for BZip2 in default path" >&5
for i in /usr/local /usr; do
if test -r $i/include/bzlib.h; then
BZIP_DIR=$i
@@ -23716,7 +22911,7 @@ echo "configure:23608: checking for BZip2 in default path" >&5
done
echo $ac_n "checking for BZ2_bzerror in -lbz2""... $ac_c" 1>&6
-echo "configure:23720: checking for BZ2_bzerror in -lbz2" >&5
+echo "configure:22915: checking for BZ2_bzerror in -lbz2" >&5
ac_lib_var=`echo bz2'_'BZ2_bzerror | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -23724,7 +22919,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbz2 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 23728 "configure"
+#line 22923 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -23735,7 +22930,7 @@ int main() {
BZ2_bzerror()
; return 0; }
EOF
-if { (eval echo configure:23739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:22934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -24190,7 +23385,7 @@ fi
echo $ac_n "checking whether to enable calendar conversion support""... $ac_c" 1>&6
-echo "configure:24194: checking whether to enable calendar conversion support" >&5
+echo "configure:23389: checking whether to enable calendar conversion support" >&5
# Check whether --enable-calendar or --disable-calendar was given.
if test "${enable_calendar+set}" = set; then
enableval="$enable_calendar"
@@ -24525,7 +23720,7 @@ fi
echo $ac_n "checking whether to enable ctype functions""... $ac_c" 1>&6
-echo "configure:24529: checking whether to enable ctype functions" >&5
+echo "configure:23724: checking whether to enable ctype functions" >&5
# Check whether --enable-ctype or --disable-ctype was given.
if test "${enable_ctype+set}" = set; then
enableval="$enable_ctype"
@@ -24859,8 +24054,8 @@ fi
-echo $ac_n "checking for CURL support""... $ac_c" 1>&6
-echo "configure:24864: checking for CURL support" >&5
+echo $ac_n "checking for cURL support""... $ac_c" 1>&6
+echo "configure:24059: checking for cURL support" >&5
# Check whether --with-curl or --without-curl was given.
if test "${with_curl+set}" = set; then
withval="$with_curl"
@@ -24905,8 +24100,8 @@ echo "$ac_t""$ext_output" 1>&6
-echo $ac_n "checking if we should use CURL for url streams""... $ac_c" 1>&6
-echo "configure:24910: checking if we should use CURL for url streams" >&5
+echo $ac_n "checking if we should use cURL for url streams""... $ac_c" 1>&6
+echo "configure:24105: checking if we should use cURL for url streams" >&5
# Check whether --with-curlwrappers or --without-curlwrappers was given.
if test "${with_curlwrappers+set}" = set; then
withval="$with_curlwrappers"
@@ -24932,8 +24127,8 @@ if test "$PHP_CURL" != "no"; then
if test -r $PHP_CURL/include/curl/easy.h; then
CURL_DIR=$PHP_CURL
else
- echo $ac_n "checking for CURL in default path""... $ac_c" 1>&6
-echo "configure:24937: checking for CURL in default path" >&5
+ echo $ac_n "checking for cURL in default path""... $ac_c" 1>&6
+echo "configure:24132: checking for cURL in default path" >&5
for i in /usr/local /usr; do
if test -r $i/include/curl/easy.h; then
CURL_DIR=$i
@@ -24951,7 +24146,7 @@ echo "configure:24937: checking for CURL in default path" >&5
CURL_CONFIG="curl-config"
echo $ac_n "checking for cURL 7.10.5 or greater""... $ac_c" 1>&6
-echo "configure:24955: checking for cURL 7.10.5 or greater" >&5
+echo "configure:24150: checking for cURL 7.10.5 or greater" >&5
if ${CURL_DIR}/bin/curl-config --libs > /dev/null 2>&1; then
CURL_CONFIG=${CURL_DIR}/bin/curl-config
@@ -24971,7 +24166,7 @@ echo "configure:24955: checking for cURL 7.10.5 or greater" >&5
fi
echo $ac_n "checking for SSL support in libcurl""... $ac_c" 1>&6
-echo "configure:24975: checking for SSL support in libcurl" >&5
+echo "configure:24170: checking for SSL support in libcurl" >&5
CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL`
if test "$CURL_SSL" = "SSL"; then
echo "$ac_t""yes" 1>&6
@@ -24981,7 +24176,7 @@ EOF
echo $ac_n "checking for SSL library used""... $ac_c" 1>&6
-echo "configure:24985: checking for SSL library used" >&5
+echo "configure:24180: checking for SSL library used" >&5
CURL_SSL_FLAVOUR=
for i in $CURL_LIBS; do
if test "$i" = "-lssl"; then
@@ -24995,17 +24190,17 @@ EOF
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:24999: checking for $ac_hdr" >&5
+echo "configure:24194: 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
-#line 25004 "configure"
+#line 24199 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:25009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:24204: \"$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*
@@ -25043,17 +24238,17 @@ EOF
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:25047: checking for $ac_hdr" >&5
+echo "configure:24242: 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
-#line 25052 "configure"
+#line 24247 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:25057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:24252: \"$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*
@@ -25404,7 +24599,7 @@ done
done
echo $ac_n "checking for curl_easy_perform in -lcurl""... $ac_c" 1>&6
-echo "configure:25408: checking for curl_easy_perform in -lcurl" >&5
+echo "configure:24603: checking for curl_easy_perform in -lcurl" >&5
ac_lib_var=`echo curl'_'curl_easy_perform | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -25412,7 +24607,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 25416 "configure"
+#line 24611 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -25423,7 +24618,7 @@ int main() {
curl_easy_perform()
; return 0; }
EOF
-if { (eval echo configure:25427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -25558,7 +24753,7 @@ fi
done
echo $ac_n "checking for curl_version_info in -lcurl""... $ac_c" 1>&6
-echo "configure:25562: checking for curl_version_info in -lcurl" >&5
+echo "configure:24757: checking for curl_version_info in -lcurl" >&5
ac_lib_var=`echo curl'_'curl_version_info | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -25566,7 +24761,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 25570 "configure"
+#line 24765 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -25577,7 +24772,7 @@ int main() {
curl_version_info()
; return 0; }
EOF
-if { (eval echo configure:25581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:24776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -25613,6 +24808,310 @@ else
fi
+
+ save_old_LDFLAGS=$LDFLAGS
+ ac_stuff="
+ $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
+ "
+
+ save_ext_shared=$ext_shared
+ ext_shared=yes
+
+ for ac_i in $ac_stuff; do
+ case $ac_i in
+ -pthread)
+ if test "$ext_shared" = "yes"; then
+ LDFLAGS="$LDFLAGS -pthread"
+ else
+
+
+ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "EXTRA_LDFLAGS$unique=set"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i"
+ fi
+
+ fi
+ ;;
+ -l*)
+ ac_ii=`echo $ac_i|cut -c 3-`
+
+
+ case $ac_ii in
+ c|c_r|pthread*) ;;
+ *)
+ if test "$ext_shared" = "yes"; then
+ LDFLAGS="$LDFLAGS -l$ac_ii"
+ else
+
+
+ case $ac_ii in
+ c|c_r|pthread*) ;;
+ *)
+ LIBS="$LIBS -l$ac_ii"
+ ;;
+ esac
+
+
+ fi
+ ;;
+ esac
+
+
+ ;;
+ -L*)
+ ac_ii=`echo $ac_i|cut -c 3-`
+
+ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then
+
+ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
+ ai_p=$ac_ii
+ else
+
+ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$ac_ii\"`"
+ fi
+
+
+ if test "$ext_shared" = "yes"; then
+ LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
+ else
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "LIBPATH$unique=set"
+
+ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
+ LDFLAGS="$LDFLAGS -L$ai_p"
+ PHP_RPATHS="$PHP_RPATHS $ai_p"
+
+ fi
+
+
+ fi
+
+ fi
+
+ ;;
+ esac
+ done
+
+ echo $ac_n "checking for curl_easy_strerror in -lcurl""... $ac_c" 1>&6
+echo "configure:24909: checking for curl_easy_strerror in -lcurl" >&5
+ac_lib_var=`echo curl'_'curl_easy_strerror | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lcurl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 24917 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char curl_easy_strerror();
+
+int main() {
+curl_easy_strerror()
+; return 0; }
+EOF
+if { (eval echo configure:24928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ LDFLAGS=$save_old_LDFLAGS
+ ext_shared=$save_ext_shared
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_CURL_EASY_STRERROR 1
+EOF
+
+
+
+else
+ echo "$ac_t""no" 1>&6
+
+ LDFLAGS=$save_old_LDFLAGS
+ ext_shared=$save_ext_shared
+ unset ac_cv_lib_curl_curl_easy_strerror
+
+
+fi
+
+
+
+ save_old_LDFLAGS=$LDFLAGS
+ ac_stuff="
+ $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
+ "
+
+ save_ext_shared=$ext_shared
+ ext_shared=yes
+
+ for ac_i in $ac_stuff; do
+ case $ac_i in
+ -pthread)
+ if test "$ext_shared" = "yes"; then
+ LDFLAGS="$LDFLAGS -pthread"
+ else
+
+
+ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "EXTRA_LDFLAGS$unique=set"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i"
+ fi
+
+ fi
+ ;;
+ -l*)
+ ac_ii=`echo $ac_i|cut -c 3-`
+
+
+ case $ac_ii in
+ c|c_r|pthread*) ;;
+ *)
+ if test "$ext_shared" = "yes"; then
+ LDFLAGS="$LDFLAGS -l$ac_ii"
+ else
+
+
+ case $ac_ii in
+ c|c_r|pthread*) ;;
+ *)
+ LIBS="$LIBS -l$ac_ii"
+ ;;
+ esac
+
+
+ fi
+ ;;
+ esac
+
+
+ ;;
+ -L*)
+ ac_ii=`echo $ac_i|cut -c 3-`
+
+ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then
+
+ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
+ ai_p=$ac_ii
+ else
+
+ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$ac_ii\"`"
+ fi
+
+
+ if test "$ext_shared" = "yes"; then
+ LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
+ else
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "LIBPATH$unique=set"
+
+ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
+ LDFLAGS="$LDFLAGS -L$ai_p"
+ PHP_RPATHS="$PHP_RPATHS $ai_p"
+
+ fi
+
+
+ fi
+
+ fi
+
+ ;;
+ esac
+ done
+
+ echo $ac_n "checking for curl_multi_strerror in -lcurl""... $ac_c" 1>&6
+echo "configure:25061: checking for curl_multi_strerror in -lcurl" >&5
+ac_lib_var=`echo curl'_'curl_multi_strerror | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lcurl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 25069 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char curl_multi_strerror();
+
+int main() {
+curl_multi_strerror()
+; return 0; }
+EOF
+if { (eval echo configure:25080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ LDFLAGS=$save_old_LDFLAGS
+ ext_shared=$save_ext_shared
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_CURL_MULTI_STRERROR 1
+EOF
+
+
+
+else
+ echo "$ac_t""no" 1>&6
+
+ LDFLAGS=$save_old_LDFLAGS
+ ext_shared=$save_ext_shared
+ unset ac_cv_lib_curl_curl_multi_strerror
+
+
+fi
+
+
if test "$PHP_CURLWRAPPERS" != "no" ; then
cat >> confdefs.h <<\EOF
#define PHP_CURL_URL_WRAPPERS 1
@@ -25911,7 +25410,7 @@ fi
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:25915: checking size of long" >&5
+echo "configure:25414: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -25919,7 +25418,7 @@ else
ac_cv_sizeof_long=8
else
cat > conftest.$ac_ext <<EOF
-#line 25923 "configure"
+#line 25422 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -25930,7 +25429,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:25934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:25433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
@@ -25950,7 +25449,7 @@ EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:25954: checking size of int" >&5
+echo "configure:25453: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -25958,7 +25457,7 @@ else
ac_cv_sizeof_int=4
else
cat > conftest.$ac_ext <<EOF
-#line 25962 "configure"
+#line 25461 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -25969,7 +25468,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:25973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:25472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
@@ -25990,13 +25489,13 @@ EOF
echo $ac_n "checking for int32_t""... $ac_c" 1>&6
-echo "configure:25994: checking for int32_t" >&5
+echo "configure:25493: checking for int32_t" >&5
if eval "test \"`echo '$''{'ac_cv_int_type_int32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 26000 "configure"
+#line 25499 "configure"
#include "confdefs.h"
#if HAVE_SYS_TYPES_H
@@ -26015,7 +25514,7 @@ if (sizeof (int32_t))
; return 0; }
EOF
-if { (eval echo configure:26019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:25518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_int_type_int32_t=yes
else
@@ -26038,13 +25537,13 @@ fi
echo $ac_n "checking for uint32_t""... $ac_c" 1>&6
-echo "configure:26042: checking for uint32_t" >&5
+echo "configure:25541: checking for uint32_t" >&5
if eval "test \"`echo '$''{'ac_cv_int_type_uint32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 26048 "configure"
+#line 25547 "configure"
#include "confdefs.h"
#if HAVE_SYS_TYPES_H
@@ -26063,7 +25562,7 @@ if (sizeof (uint32_t))
; return 0; }
EOF
-if { (eval echo configure:26067: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:25566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_int_type_uint32_t=yes
else
@@ -26095,17 +25594,17 @@ stdlib.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:26099: checking for $ac_hdr" >&5
+echo "configure:25598: 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
-#line 26104 "configure"
+#line 25603 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:26109: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:25608: \"$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*
@@ -26135,12 +25634,12 @@ done
for ac_func in strtoll atoll strftime
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:26139: checking for $ac_func" >&5
+echo "configure:25638: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 26144 "configure"
+#line 25643 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -26163,7 +25662,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:26167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:25666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -26590,7 +26089,7 @@ EOF
echo $ac_n "checking whether to enable DBA""... $ac_c" 1>&6
-echo "configure:26594: checking whether to enable DBA" >&5
+echo "configure:26093: checking whether to enable DBA" >&5
# Check whether --enable-dba or --disable-dba was given.
if test "${enable_dba+set}" = set; then
enableval="$enable_dba"
@@ -26746,7 +26245,7 @@ if test "${with_qdbm+set}" = set; then
done
echo $ac_n "checking for dpopen in -l$LIB""... $ac_c" 1>&6
-echo "configure:26750: checking for dpopen in -l$LIB" >&5
+echo "configure:26249: checking for dpopen in -l$LIB" >&5
ac_lib_var=`echo $LIB'_'dpopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -26754,7 +26253,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$LIB $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 26758 "configure"
+#line 26257 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -26765,7 +26264,7 @@ int main() {
dpopen()
; return 0; }
EOF
-if { (eval echo configure:26769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:26268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -26936,7 +26435,7 @@ fi
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:26940: checking for $THIS_FULL_NAME support" >&5
+echo "configure:26439: checking for $THIS_FULL_NAME support" >&5
if test -n ""; then
{ echo "configure: error: " 1>&2; exit 1; }
fi
@@ -26967,7 +26466,7 @@ if test "${with_gdbm+set}" = set; then
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:26971: checking for $THIS_FULL_NAME support" >&5
+echo "configure:26470: checking for $THIS_FULL_NAME support" >&5
if test -n "You cannot combine --with-gdbm with --with-qdbm"; then
{ echo "configure: error: You cannot combine --with-gdbm with --with-qdbm" 1>&2; exit 1; }
fi
@@ -27085,7 +26584,7 @@ echo "configure:26971: checking for $THIS_FULL_NAME support" >&5
done
echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:27089: checking for gdbm_open in -lgdbm" >&5
+echo "configure:26588: checking for gdbm_open in -lgdbm" >&5
ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -27093,7 +26592,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgdbm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 27097 "configure"
+#line 26596 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -27104,7 +26603,7 @@ int main() {
gdbm_open()
; return 0; }
EOF
-if { (eval echo configure:27108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:26607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -27271,7 +26770,7 @@ fi
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:27275: checking for $THIS_FULL_NAME support" >&5
+echo "configure:26774: checking for $THIS_FULL_NAME support" >&5
if test -n ""; then
{ echo "configure: error: " 1>&2; exit 1; }
fi
@@ -27402,7 +26901,7 @@ if test "${with_ndbm+set}" = set; then
done
echo $ac_n "checking for dbm_open in -l$LIB""... $ac_c" 1>&6
-echo "configure:27406: checking for dbm_open in -l$LIB" >&5
+echo "configure:26905: checking for dbm_open in -l$LIB" >&5
ac_lib_var=`echo $LIB'_'dbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -27410,7 +26909,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$LIB $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 27414 "configure"
+#line 26913 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -27421,7 +26920,7 @@ int main() {
dbm_open()
; return 0; }
EOF
-if { (eval echo configure:27425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:26924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -27592,7 +27091,7 @@ fi
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:27596: checking for $THIS_FULL_NAME support" >&5
+echo "configure:27095: checking for $THIS_FULL_NAME support" >&5
if test -n ""; then
{ echo "configure: error: " 1>&2; exit 1; }
fi
@@ -27649,7 +27148,7 @@ if test "${with_db4+set}" = set; then
LIBS="-l$LIB $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 27653 "configure"
+#line 27152 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -27660,11 +27159,11 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:27664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:27163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 27668 "configure"
+#line 27167 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -27697,14 +27196,14 @@ rm -f conftest*
done
if test -z "$THIS_LIBS"; then
echo $ac_n "checking for db4 major version""... $ac_c" 1>&6
-echo "configure:27701: checking for db4 major version" >&5
+echo "configure:27200: checking for db4 major version" >&5
{ echo "configure: error: Header contains different version" 1>&2; exit 1; }
fi
if test "4" = "4"; then
echo $ac_n "checking for db4 minor version and patch level""... $ac_c" 1>&6
-echo "configure:27706: checking for db4 minor version and patch level" >&5
+echo "configure:27205: checking for db4 minor version and patch level" >&5
cat > conftest.$ac_ext <<EOF
-#line 27708 "configure"
+#line 27207 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -27730,9 +27229,9 @@ rm -f conftest*
fi
if test "$ext_shared" = "yes"; then
echo $ac_n "checking if dba can be used as shared extension""... $ac_c" 1>&6
-echo "configure:27734: checking if dba can be used as shared extension" >&5
+echo "configure:27233: checking if dba can be used as shared extension" >&5
cat > conftest.$ac_ext <<EOF
-#line 27736 "configure"
+#line 27235 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -27897,7 +27396,7 @@ fi
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:27901: checking for $THIS_FULL_NAME support" >&5
+echo "configure:27400: checking for $THIS_FULL_NAME support" >&5
if test -n ""; then
{ echo "configure: error: " 1>&2; exit 1; }
fi
@@ -27928,7 +27427,7 @@ if test "${with_db3+set}" = set; then
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:27932: checking for $THIS_FULL_NAME support" >&5
+echo "configure:27431: checking for $THIS_FULL_NAME support" >&5
if test -n "You cannot combine --with-db3 with --with-db4"; then
{ echo "configure: error: You cannot combine --with-db3 with --with-db4" 1>&2; exit 1; }
fi
@@ -27975,7 +27474,7 @@ echo "configure:27932: checking for $THIS_FULL_NAME support" >&5
LIBS="-l$LIB $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 27979 "configure"
+#line 27478 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -27986,11 +27485,11 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:27990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:27489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 27994 "configure"
+#line 27493 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -28023,14 +27522,14 @@ rm -f conftest*
done
if test -z "$THIS_LIBS"; then
echo $ac_n "checking for db3 major version""... $ac_c" 1>&6
-echo "configure:28027: checking for db3 major version" >&5
+echo "configure:27526: checking for db3 major version" >&5
{ echo "configure: error: Header contains different version" 1>&2; exit 1; }
fi
if test "3" = "4"; then
echo $ac_n "checking for db4 minor version and patch level""... $ac_c" 1>&6
-echo "configure:28032: checking for db4 minor version and patch level" >&5
+echo "configure:27531: checking for db4 minor version and patch level" >&5
cat > conftest.$ac_ext <<EOF
-#line 28034 "configure"
+#line 27533 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -28056,9 +27555,9 @@ rm -f conftest*
fi
if test "$ext_shared" = "yes"; then
echo $ac_n "checking if dba can be used as shared extension""... $ac_c" 1>&6
-echo "configure:28060: checking if dba can be used as shared extension" >&5
+echo "configure:27559: checking if dba can be used as shared extension" >&5
cat > conftest.$ac_ext <<EOF
-#line 28062 "configure"
+#line 27561 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -28223,7 +27722,7 @@ fi
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:28227: checking for $THIS_FULL_NAME support" >&5
+echo "configure:27726: checking for $THIS_FULL_NAME support" >&5
if test -n ""; then
{ echo "configure: error: " 1>&2; exit 1; }
fi
@@ -28254,7 +27753,7 @@ if test "${with_db2+set}" = set; then
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:28258: checking for $THIS_FULL_NAME support" >&5
+echo "configure:27757: checking for $THIS_FULL_NAME support" >&5
if test -n "You cannot combine --with-db2 with --with-db3 or --with-db4"; then
{ echo "configure: error: You cannot combine --with-db2 with --with-db3 or --with-db4" 1>&2; exit 1; }
fi
@@ -28301,7 +27800,7 @@ echo "configure:28258: checking for $THIS_FULL_NAME support" >&5
LIBS="-l$LIB $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 28305 "configure"
+#line 27804 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -28312,11 +27811,11 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:28316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:27815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 28320 "configure"
+#line 27819 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -28349,14 +27848,14 @@ rm -f conftest*
done
if test -z "$THIS_LIBS"; then
echo $ac_n "checking for db2 major version""... $ac_c" 1>&6
-echo "configure:28353: checking for db2 major version" >&5
+echo "configure:27852: checking for db2 major version" >&5
{ echo "configure: error: Header contains different version" 1>&2; exit 1; }
fi
if test "2" = "4"; then
echo $ac_n "checking for db4 minor version and patch level""... $ac_c" 1>&6
-echo "configure:28358: checking for db4 minor version and patch level" >&5
+echo "configure:27857: checking for db4 minor version and patch level" >&5
cat > conftest.$ac_ext <<EOF
-#line 28360 "configure"
+#line 27859 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -28382,9 +27881,9 @@ rm -f conftest*
fi
if test "$ext_shared" = "yes"; then
echo $ac_n "checking if dba can be used as shared extension""... $ac_c" 1>&6
-echo "configure:28386: checking if dba can be used as shared extension" >&5
+echo "configure:27885: checking if dba can be used as shared extension" >&5
cat > conftest.$ac_ext <<EOF
-#line 28388 "configure"
+#line 27887 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -28549,7 +28048,7 @@ fi
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:28553: checking for $THIS_FULL_NAME support" >&5
+echo "configure:28052: checking for $THIS_FULL_NAME support" >&5
if test -n ""; then
{ echo "configure: error: " 1>&2; exit 1; }
fi
@@ -28572,7 +28071,7 @@ if test "${with_db1+set}" = set; then
unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT
echo $ac_n "checking for DB1 in library""... $ac_c" 1>&6
-echo "configure:28576: checking for DB1 in library" >&5
+echo "configure:28075: checking for DB1 in library" >&5
if test "$HAVE_DB4" = "1"; then
THIS_VERSION=4
THIS_LIBS=$DB4_LIBS
@@ -28620,7 +28119,7 @@ EOF
fi
echo "$ac_t""$THIS_LIBS" 1>&6
echo $ac_n "checking for DB1 in header""... $ac_c" 1>&6
-echo "configure:28624: checking for DB1 in header" >&5
+echo "configure:28123: checking for DB1 in header" >&5
echo "$ac_t""$THIS_INCLUDE" 1>&6
if test -n "$THIS_INCLUDE"; then
@@ -28630,7 +28129,7 @@ echo "configure:28624: checking for DB1 in header" >&5
LIBS="-l$THIS_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 28634 "configure"
+#line 28133 "configure"
#include "confdefs.h"
#include "$THIS_INCLUDE"
@@ -28641,7 +28140,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:28645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:28144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
cat >> confdefs.h <<EOF
@@ -28793,7 +28292,7 @@ fi
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:28797: checking for $THIS_FULL_NAME support" >&5
+echo "configure:28296: checking for $THIS_FULL_NAME support" >&5
if test -n ""; then
{ echo "configure: error: " 1>&2; exit 1; }
fi
@@ -28824,7 +28323,7 @@ if test "${with_dbm+set}" = set; then
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:28828: checking for $THIS_FULL_NAME support" >&5
+echo "configure:28327: checking for $THIS_FULL_NAME support" >&5
if test -n "You cannot combine --with-dbm with --with-qdbm"; then
{ echo "configure: error: You cannot combine --with-dbm with --with-qdbm" 1>&2; exit 1; }
fi
@@ -28947,7 +28446,7 @@ echo "configure:28828: checking for $THIS_FULL_NAME support" >&5
done
echo $ac_n "checking for dbminit in -l$LIB""... $ac_c" 1>&6
-echo "configure:28951: checking for dbminit in -l$LIB" >&5
+echo "configure:28450: checking for dbminit in -l$LIB" >&5
ac_lib_var=`echo $LIB'_'dbminit | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -28955,7 +28454,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$LIB $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 28959 "configure"
+#line 28458 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -28966,7 +28465,7 @@ int main() {
dbminit()
; return 0; }
EOF
-if { (eval echo configure:28970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:28469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -28986,7 +28485,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
ext_shared=$save_ext_shared
echo $ac_n "checking for DBM using GDBM""... $ac_c" 1>&6
-echo "configure:28990: checking for DBM using GDBM" >&5
+echo "configure:28489: checking for DBM using GDBM" >&5
cat >> confdefs.h <<EOF
#define DBM_INCLUDE_FILE "$THIS_INCLUDE"
EOF
@@ -29152,7 +28651,7 @@ fi
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:29156: checking for $THIS_FULL_NAME support" >&5
+echo "configure:28655: checking for $THIS_FULL_NAME support" >&5
if test -n ""; then
{ echo "configure: error: " 1>&2; exit 1; }
fi
@@ -29298,7 +28797,7 @@ EOF
done
echo $ac_n "checking for cdb_read in -l$LIB""... $ac_c" 1>&6
-echo "configure:29302: checking for cdb_read in -l$LIB" >&5
+echo "configure:28801: checking for cdb_read in -l$LIB" >&5
ac_lib_var=`echo $LIB'_'cdb_read | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -29306,7 +28805,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$LIB $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 29310 "configure"
+#line 28809 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -29317,7 +28816,7 @@ int main() {
cdb_read()
; return 0; }
EOF
-if { (eval echo configure:29321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:28820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -29480,7 +28979,7 @@ fi
else
- if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1"; then
+ if test "$PHP_DBA" != "no" && test "$HAVE_DBA" = "1"; then
cat >> confdefs.h <<\EOF
#define DBA_CDB_BUILTIN 1
@@ -29509,7 +29008,7 @@ fi
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:29513: checking for $THIS_FULL_NAME support" >&5
+echo "configure:29012: checking for $THIS_FULL_NAME support" >&5
if test -n ""; then
{ echo "configure: error: " 1>&2; exit 1; }
fi
@@ -29542,7 +29041,7 @@ EOF
else
- if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1"; then
+ if test "$PHP_DBA" != "no" && test "$HAVE_DBA" = "1"; then
cat >> confdefs.h <<\EOF
#define DBA_INIFILE 1
@@ -29563,7 +29062,7 @@ fi
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:29567: checking for $THIS_FULL_NAME support" >&5
+echo "configure:29066: checking for $THIS_FULL_NAME support" >&5
if test -n ""; then
{ echo "configure: error: " 1>&2; exit 1; }
fi
@@ -29596,7 +29095,7 @@ EOF
else
- if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1"; then
+ if test "$PHP_DBA" != "no" && test "$HAVE_DBA" = "1"; then
cat >> confdefs.h <<\EOF
#define DBA_FLATFILE 1
@@ -29617,7 +29116,7 @@ fi
THIS_FULL_NAME="$THIS_NAME"
fi
echo $ac_n "checking for $THIS_FULL_NAME support""... $ac_c" 1>&6
-echo "configure:29621: checking for $THIS_FULL_NAME support" >&5
+echo "configure:29120: checking for $THIS_FULL_NAME support" >&5
if test -n ""; then
{ echo "configure: error: " 1>&2; exit 1; }
fi
@@ -29632,7 +29131,7 @@ echo "configure:29621: checking for $THIS_FULL_NAME support" >&5
echo $ac_n "checking whether to enable DBA interface""... $ac_c" 1>&6
-echo "configure:29636: checking whether to enable DBA interface" >&5
+echo "configure:29135: checking whether to enable DBA interface" >&5
if test "$HAVE_DBA" = "1"; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
@@ -29946,7 +29445,7 @@ fi
echo $ac_n "checking whether to enable dbase support""... $ac_c" 1>&6
-echo "configure:29950: checking whether to enable dbase support" >&5
+echo "configure:29449: checking whether to enable dbase support" >&5
# Check whether --enable-dbase or --disable-dbase was given.
if test "${enable_dbase+set}" = set; then
enableval="$enable_dbase"
@@ -30281,7 +29780,7 @@ fi
echo $ac_n "checking whether to enable DOM support""... $ac_c" 1>&6
-echo "configure:30285: checking whether to enable DOM support" >&5
+echo "configure:29784: checking whether to enable DOM support" >&5
# Check whether --enable-dom or --disable-dom was given.
if test "${enable_dom+set}" = set; then
enableval="$enable_dom"
@@ -30328,7 +29827,7 @@ if test -z "$PHP_LIBXML_DIR"; then
echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6
-echo "configure:30332: checking libxml2 install dir" >&5
+echo "configure:29831: checking libxml2 install dir" >&5
# Check whether --with-libxml-dir or --without-libxml-dir was given.
if test "${with_libxml_dir+set}" = set; then
withval="$with_libxml_dir"
@@ -30359,7 +29858,7 @@ if test "$PHP_DOM" != "no"; then
echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6
-echo "configure:30363: checking for xml2-config path" >&5
+echo "configure:29862: checking for xml2-config path" >&5
if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -30516,7 +30015,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6
echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6
-echo "configure:30520: checking whether libxml build works" >&5
+echo "configure:30019: checking whether libxml build works" >&5
if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -30532,7 +30031,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 30536 "configure"
+#line 30035 "configure"
#include "confdefs.h"
@@ -30543,7 +30042,7 @@ else
}
EOF
-if { (eval echo configure:30547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:30046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBS=$old_LIBS
@@ -30954,7 +30453,7 @@ fi
echo $ac_n "checking whether to enable EXIF (metadata from images) support""... $ac_c" 1>&6
-echo "configure:30958: checking whether to enable EXIF (metadata from images) support" >&5
+echo "configure:30457: checking whether to enable EXIF (metadata from images) support" >&5
# Check whether --enable-exif or --disable-exif was given.
if test "${enable_exif+set}" = set; then
enableval="$enable_exif"
@@ -31289,7 +30788,7 @@ fi
echo $ac_n "checking for FrontBase SQL92 (fbsql) support""... $ac_c" 1>&6
-echo "configure:31293: checking for FrontBase SQL92 (fbsql) support" >&5
+echo "configure:30792: checking for FrontBase SQL92 (fbsql) support" >&5
# Check whether --with-fbsql or --without-fbsql was given.
if test "${with_fbsql+set}" = set; then
withval="$with_fbsql"
@@ -31783,7 +31282,7 @@ fi
echo $ac_n "checking for FDF support""... $ac_c" 1>&6
-echo "configure:31787: checking for FDF support" >&5
+echo "configure:31286: checking for FDF support" >&5
# Check whether --with-fdftk or --without-fdftk was given.
if test "${with_fdftk+set}" = set; then
withval="$with_fdftk"
@@ -32000,7 +31499,7 @@ EOF
done
echo $ac_n "checking for FDFOpen in -l$file""... $ac_c" 1>&6
-echo "configure:32004: checking for FDFOpen in -l$file" >&5
+echo "configure:31503: checking for FDFOpen in -l$file" >&5
ac_lib_var=`echo $file'_'FDFOpen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -32008,7 +31507,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$file $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 32012 "configure"
+#line 31511 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -32019,7 +31518,7 @@ int main() {
FDFOpen()
; return 0; }
EOF
-if { (eval echo configure:32023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:31522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -32145,7 +31644,7 @@ fi
done
echo $ac_n "checking for FDFGetFDFVersion in -l$file""... $ac_c" 1>&6
-echo "configure:32149: checking for FDFGetFDFVersion in -l$file" >&5
+echo "configure:31648: checking for FDFGetFDFVersion in -l$file" >&5
ac_lib_var=`echo $file'_'FDFGetFDFVersion | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -32153,7 +31652,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$file $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 32157 "configure"
+#line 31656 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -32164,7 +31663,7 @@ int main() {
FDFGetFDFVersion()
; return 0; }
EOF
-if { (eval echo configure:32168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:31667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -32598,18 +32097,18 @@ fi
-echo $ac_n "checking whether to enable the bundled filePro support""... $ac_c" 1>&6
-echo "configure:32603: checking whether to enable the bundled filePro support" >&5
-# Check whether --enable-filepro or --disable-filepro was given.
-if test "${enable_filepro+set}" = set; then
- enableval="$enable_filepro"
- PHP_FILEPRO=$enableval
+echo $ac_n "checking whether to enable input filter support""... $ac_c" 1>&6
+echo "configure:32102: checking whether to enable input filter support" >&5
+# Check whether --enable-filter or --disable-filter was given.
+if test "${enable_filter+set}" = set; then
+ enableval="$enable_filter"
+ PHP_FILTER=$enableval
else
- PHP_FILEPRO=no
+ PHP_FILTER=yes
if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
- PHP_FILEPRO=$PHP_ENABLE_ALL
+ PHP_FILTER=$PHP_ENABLE_ALL
fi
fi
@@ -32618,12 +32117,12 @@ fi
ext_output="yes, shared"
ext_shared=yes
-case $PHP_FILEPRO in
+case $PHP_FILTER in
shared,*)
- PHP_FILEPRO=`echo "$PHP_FILEPRO"|$SED 's/^shared,//'`
+ PHP_FILTER=`echo "$PHP_FILTER"|$SED 's/^shared,//'`
;;
shared)
- PHP_FILEPRO=yes
+ PHP_FILTER=yes
;;
no)
ext_output=no
@@ -32642,25 +32141,271 @@ echo "$ac_t""$ext_output" 1>&6
-if test "$PHP_FILEPRO" = "yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_FILEPRO 1
+
+
+echo $ac_n "checking pcre install prefix""... $ac_c" 1>&6
+echo "configure:32148: checking pcre install prefix" >&5
+# Check whether --with-pcre-dir or --without-pcre-dir was given.
+if test "${with_pcre_dir+set}" = set; then
+ withval="$with_pcre_dir"
+ PHP_PCRE_DIR=$withval
+else
+
+ PHP_PCRE_DIR=no
+
+ if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
+ PHP_PCRE_DIR=$PHP_ENABLE_ALL
+ fi
+
+fi
+
+
+ext_output=$PHP_PCRE_DIR
+echo "$ac_t""$ext_output" 1>&6
+
+
+
+
+if test "$PHP_FILTER" != "no"; then
+
+ if test -n "$PHP_VERSION"; then
+ ext_shared=no
+ else
+ old_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS=$INCLUDES
+ cat > conftest.$ac_ext <<EOF
+#line 32178 "configure"
+#include "confdefs.h"
+
+#include <main/php_config.h>
+#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
+yes
+#endif
+
EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "yes" >/dev/null 2>&1; then
+ rm -rf conftest*
+
+ PHP_PCRE_REGEX=yes
+
+else
+ rm -rf conftest*
+
+ cat > conftest.$ac_ext <<EOF
+#line 32197 "configure"
+#include "confdefs.h"
+
+#include <main/php_config.h>
+#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE)
+yes
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "yes" >/dev/null 2>&1; then
+ rm -rf conftest*
+
+ PHP_PCRE_REGEX=pecl
+
+else
+ rm -rf conftest*
+
+ PHP_PCRE_REGEX=no
+
+fi
+rm -f conftest*
+
+
+fi
+rm -f conftest*
+
+ CPPFLAGS=$old_CPPFLAGS
+ fi
+
+ if test "$PHP_PCRE_REGEX" != "yes"; then
+ if test "$PHP_PCRE_REGEX" = "no" || test "$PHP_PCRE_REGEX" = "pecl"; then
+ case "$PHP_PCRE_DIR" in
+ yes|no)
+ PCRE_SEARCH_DIR="/usr/local /usr"
+ ;;
+ *)
+ PCRE_SEARCH_DIR="$PHP_PCRE_DIR"
+ ;;
+ esac
+
+ for i in $PCRE_SEARCH_DIR; do
+ if test -f $i/include/pcre/pcre.h; then
+ PCRE_INCDIR=$i/include/pcre
+ break
+ elif test -f $i/include/pcre.h; then
+ PCRE_INCDIR=$i/include
+ break
+ elif test -f $i/pcre.h; then
+ PCRE_INCDIR=$i
+ break
+ fi
+ done
+
+ if test -z "$PCRE_INCDIR"; then
+ { echo "configure: error: Could not find pcre.h anywhere under $PCRE_SEARCH_DIR" 1>&2; exit 1; }
+ fi
+
+ for j in $PCRE_SEARCH_DIR/$PHP_LIBDIR $PCRE_SEARCH_DIR; do
+ if test -f $j/libpcre.a || test -f $j/libpcre.$SHLIB_SUFFIX_NAME; then
+ PCRE_LIBDIR=$j
+ break
+ fi
+ done
+
+ if test -z "$PCRE_LIBDIR" ; then
+ { echo "configure: error: Could not find libpcre.(a|$SHLIB_SUFFIX_NAME) anywhere under $PCRE_SEARCH_DIR" 1>&2; exit 1; }
+ fi
+ fi
+
+
+
+ if test "$ext_shared" = "yes"; then
+ FILTER_SHARED_LIBADD="-lpcre $FILTER_SHARED_LIBADD"
+ if test -n "$PCRE_LIBDIR"; then
+
+ if test "$PCRE_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PCRE_LIBDIR" != "/usr/lib"; then
+
+ if test -z "$PCRE_LIBDIR" || echo "$PCRE_LIBDIR" | grep '^/' >/dev/null ; then
+ ai_p=$PCRE_LIBDIR
+ else
+
+ ep_dir="`echo $PCRE_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$PCRE_LIBDIR\"`"
+ fi
+
+
+ if test "$ext_shared" = "yes"; then
+ FILTER_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $FILTER_SHARED_LIBADD"
+ else
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "LIBPATH$unique=set"
+
+ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
+ LDFLAGS="$LDFLAGS -L$ai_p"
+ PHP_RPATHS="$PHP_RPATHS $ai_p"
+
+ fi
+
+
+ fi
+
+ fi
+
+ fi
+ else
+
+
+ if test -n "$PCRE_LIBDIR"; then
+
+ if test "$PCRE_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$PCRE_LIBDIR" != "/usr/lib"; then
+
+ if test -z "$PCRE_LIBDIR" || echo "$PCRE_LIBDIR" | grep '^/' >/dev/null ; then
+ ai_p=$PCRE_LIBDIR
+ else
+
+ ep_dir="`echo $PCRE_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$PCRE_LIBDIR\"`"
+ fi
+
+
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "LIBPATH$unique=set"
+
+ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
+ LDFLAGS="$LDFLAGS -L$ai_p"
+ PHP_RPATHS="$PHP_RPATHS $ai_p"
+
+ fi
+
+
+
+ fi
+
+ fi
+
+
+ case pcre in
+ c|c_r|pthread*) ;;
+ *)
+ LIBS="-lpcre $LIBS"
+ ;;
+ esac
+
+
+
+
+ fi
+
+
+
+ if test "$PCRE_INCDIR" != "/usr/include"; then
+
+ if test -z "$PCRE_INCDIR" || echo "$PCRE_INCDIR" | grep '^/' >/dev/null ; then
+ ai_p=$PCRE_INCDIR
+ else
+
+ ep_dir="`echo $PCRE_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$PCRE_INCDIR\"`"
+ fi
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "INCLUDEPATH$unique=set"
+
+ if test ""; then
+ INCLUDES="-I$ai_p $INCLUDES"
+ else
+ INCLUDES="$INCLUDES -I$ai_p"
+ fi
+
+ fi
+
+ fi
+
+ fi
- ext_builddir=ext/filepro
- ext_srcdir=$abs_srcdir/ext/filepro
+ ext_builddir=ext/filter
+ ext_srcdir=$abs_srcdir/ext/filter
ac_extra=
if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then
- PHP_FILEPRO_SHARED=no
+ PHP_FILTER_SHARED=no
- case ext/filepro in
+ case ext/filter in
"") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
- /*) ac_srcdir=`echo "ext/filepro"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
- *) ac_srcdir="$abs_srcdir/ext/filepro/"; ac_bdir="ext/filepro/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/filter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/filter/"; ac_bdir="ext/filter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
esac
@@ -32675,7 +32420,7 @@ EOF
old_IFS=$IFS
- for ac_src in filepro.c; do
+ for ac_src in filter.c sanitizing_filters.c logical_filters.c callback_filter.c; do
IFS=.
set $ac_src
@@ -32698,18 +32443,18 @@ EOF
done
- EXT_STATIC="$EXT_STATIC filepro"
+ EXT_STATIC="$EXT_STATIC filter"
if test "$ext_shared" != "nocli"; then
- EXT_CLI_STATIC="$EXT_CLI_STATIC filepro"
+ EXT_CLI_STATIC="$EXT_CLI_STATIC filter"
fi
else
if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then
- PHP_FILEPRO_SHARED=yes
+ PHP_FILTER_SHARED=yes
- case ext/filepro in
+ case ext/filter in
"") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
- /*) ac_srcdir=`echo "ext/filepro"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
- *) ac_srcdir="$abs_srcdir/ext/filepro/"; ac_bdir="ext/filepro/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/filter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/filter/"; ac_bdir="ext/filter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
esac
@@ -32724,14 +32469,14 @@ EOF
old_IFS=$IFS
- for ac_src in filepro.c; do
+ for ac_src in filter.c sanitizing_filters.c logical_filters.c callback_filter.c; do
IFS=.
set $ac_src
ac_obj=$1
IFS=$old_IFS
- shared_objects_filepro="$shared_objects_filepro $ac_bdir$ac_obj.lo"
+ shared_objects_filter="$shared_objects_filter $ac_bdir$ac_obj.lo"
case $ac_src in
*.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
@@ -32754,27 +32499,27 @@ EOF
case $host_alias in
*aix*)
suffix=so
- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpfilepro.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filepro) $(PHPFILEPRO_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpfilepro.so '$ext_builddir'/phpfilepro.so'
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpfilter.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filter) $(PHPFILTER_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpfilter.so '$ext_builddir'/phpfilter.so'
;;
*netware*)
suffix=nlm
- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filepro) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPFILEPRO, 3)_SHARED_LIBADD)'
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filter) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPFILTER, 3)_SHARED_LIBADD)'
;;
*)
suffix=la
- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filepro) $(PHPFILEPRO_SHARED_LIBADD)'
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filter) $(PHPFILTER_SHARED_LIBADD)'
;;
esac
- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpfilepro.$suffix"
+ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpfilter.$suffix"
- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_filepro"
+ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_filter"
cat >>Makefile.objects<<EOF
-\$(phplibdir)/phpfilepro.$suffix: $ext_builddir/phpfilepro.$suffix
- \$(LIBTOOL) --mode=install cp $ext_builddir/phpfilepro.$suffix \$(phplibdir)
+\$(phplibdir)/phpfilter.$suffix: $ext_builddir/phpfilter.$suffix
+ \$(LIBTOOL) --mode=install cp $ext_builddir/phpfilter.$suffix \$(phplibdir)
-$ext_builddir/phpfilepro.$suffix: \$(shared_objects_filepro) \$(PHPFILEPRO_SHARED_DEPENDENCIES)
+$ext_builddir/phpfilter.$suffix: \$(shared_objects_filter) \$(PHPFILTER_SHARED_DEPENDENCIES)
$link_cmd
EOF
@@ -32787,27 +32532,27 @@ EOF
case $host_alias in
*aix*)
suffix=so
- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/filepro.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filepro) $(FILEPRO_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/filepro.so '$ext_builddir'/filepro.so'
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/filter.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filter) $(FILTER_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/filter.so '$ext_builddir'/filter.so'
;;
*netware*)
suffix=nlm
- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filepro) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(FILEPRO, 3)_SHARED_LIBADD)'
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filter) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(FILTER, 3)_SHARED_LIBADD)'
;;
*)
suffix=la
- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filepro) $(FILEPRO_SHARED_LIBADD)'
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filter) $(FILTER_SHARED_LIBADD)'
;;
esac
- PHP_MODULES="$PHP_MODULES \$(phplibdir)/filepro.$suffix"
+ PHP_MODULES="$PHP_MODULES \$(phplibdir)/filter.$suffix"
- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_filepro"
+ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_filter"
cat >>Makefile.objects<<EOF
-\$(phplibdir)/filepro.$suffix: $ext_builddir/filepro.$suffix
- \$(LIBTOOL) --mode=install cp $ext_builddir/filepro.$suffix \$(phplibdir)
+\$(phplibdir)/filter.$suffix: $ext_builddir/filter.$suffix
+ \$(LIBTOOL) --mode=install cp $ext_builddir/filter.$suffix \$(phplibdir)
-$ext_builddir/filepro.$suffix: \$(shared_objects_filepro) \$(FILEPRO_SHARED_DEPENDENCIES)
+$ext_builddir/filter.$suffix: \$(shared_objects_filter) \$(FILTER_SHARED_DEPENDENCIES)
$link_cmd
EOF
@@ -32815,21 +32560,21 @@ EOF
;;
esac
cat >> confdefs.h <<EOF
-#define COMPILE_DL_FILEPRO 1
+#define COMPILE_DL_FILTER 1
EOF
fi
fi
if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
- PHP_FILEPRO_SHARED=no
+ PHP_FILTER_SHARED=no
if test "$PHP_SAPI" = "cgi"; then
- case ext/filepro in
+ case ext/filter in
"") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
- /*) ac_srcdir=`echo "ext/filepro"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
- *) ac_srcdir="$abs_srcdir/ext/filepro/"; ac_bdir="ext/filepro/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/filter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/filter/"; ac_bdir="ext/filter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
esac
@@ -32844,7 +32589,7 @@ EOF
old_IFS=$IFS
- for ac_src in filepro.c; do
+ for ac_src in filter.c sanitizing_filters.c logical_filters.c callback_filter.c; do
IFS=.
set $ac_src
@@ -32867,14 +32612,14 @@ EOF
done
- EXT_STATIC="$EXT_STATIC filepro"
+ EXT_STATIC="$EXT_STATIC filter"
else
- case ext/filepro in
+ case ext/filter in
"") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
- /*) ac_srcdir=`echo "ext/filepro"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
- *) ac_srcdir="$abs_srcdir/ext/filepro/"; ac_bdir="ext/filepro/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/filter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/filter/"; ac_bdir="ext/filter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
esac
@@ -32889,7 +32634,7 @@ EOF
old_IFS=$IFS
- for ac_src in filepro.c; do
+ for ac_src in filter.c sanitizing_filters.c logical_filters.c callback_filter.c; do
IFS=.
set $ac_src
@@ -32913,7 +32658,7 @@ EOF
fi
- EXT_CLI_STATIC="$EXT_CLI_STATIC filepro"
+ EXT_CLI_STATIC="$EXT_CLI_STATIC filter"
fi
@@ -32922,19 +32667,41 @@ EOF
if test "$ext_builddir" = "."; then
- PHP_PECL_EXTENSION=filepro
+ PHP_PECL_EXTENSION=filter
PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION"
fi
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST FILTER_SHARED_LIBADD"
+
+
+
+
+ for header_file in $ext_srcdir/php_filter.h; do
+
+
+ unique=`echo $header_file|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$INSTALLHEADERS$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "INSTALLHEADERS$unique=set"
+
+ INSTALL_HEADERS="$INSTALL_HEADERS $header_file"
+
+ fi
+
+ done
+
+
fi
echo $ac_n "checking whether to enable FTP support""... $ac_c" 1>&6
-echo "configure:32938: checking whether to enable FTP support" >&5
+echo "configure:32705: checking whether to enable FTP support" >&5
# Check whether --enable-ftp or --disable-ftp was given.
if test "${enable_ftp+set}" = set; then
enableval="$enable_ftp"
@@ -32980,7 +32747,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking OpenSSL dir for FTP""... $ac_c" 1>&6
-echo "configure:32984: checking OpenSSL dir for FTP" >&5
+echo "configure:32751: checking OpenSSL dir for FTP" >&5
# Check whether --with-openssl-dir or --without-openssl-dir was given.
if test "${with_openssl_dir+set}" = set; then
withval="$with_openssl_dir"
@@ -33310,7 +33077,7 @@ EOF
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:33314: checking for $ac_word" >&5
+echo "configure:33081: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -33514,9 +33281,9 @@ fi
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$OPENSSL_INCDIR
echo $ac_n "checking for OpenSSL version""... $ac_c" 1>&6
-echo "configure:33518: checking for OpenSSL version" >&5
+echo "configure:33285: checking for OpenSSL version" >&5
cat > conftest.$ac_ext <<EOF
-#line 33520 "configure"
+#line 33287 "configure"
#include "confdefs.h"
#include <openssl/opensslv.h>
@@ -33670,7 +33437,7 @@ rm -f conftest*
done
echo $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6
-echo "configure:33674: checking for CRYPTO_free in -lcrypto" >&5
+echo "configure:33441: checking for CRYPTO_free in -lcrypto" >&5
ac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -33678,7 +33445,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcrypto $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 33682 "configure"
+#line 33449 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -33689,7 +33456,7 @@ int main() {
CRYPTO_free()
; return 0; }
EOF
-if { (eval echo configure:33693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:33460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -33845,7 +33612,7 @@ fi
done
echo $ac_n "checking for SSL_CTX_set_ssl_version in -lssl""... $ac_c" 1>&6
-echo "configure:33849: checking for SSL_CTX_set_ssl_version in -lssl" >&5
+echo "configure:33616: checking for SSL_CTX_set_ssl_version in -lssl" >&5
ac_lib_var=`echo ssl'_'SSL_CTX_set_ssl_version | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -33853,7 +33620,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lssl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 33857 "configure"
+#line 33624 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -33864,7 +33631,7 @@ int main() {
SSL_CTX_set_ssl_version()
; return 0; }
EOF
-if { (eval echo configure:33868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:33635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -33981,7 +33748,7 @@ fi
echo $ac_n "checking for GD support""... $ac_c" 1>&6
-echo "configure:33985: checking for GD support" >&5
+echo "configure:33752: checking for GD support" >&5
# Check whether --with-gd or --without-gd was given.
if test "${with_gd+set}" = set; then
withval="$with_gd"
@@ -34028,7 +33795,7 @@ if test -z "$PHP_JPEG_DIR"; then
echo $ac_n "checking for the location of libjpeg""... $ac_c" 1>&6
-echo "configure:34032: checking for the location of libjpeg" >&5
+echo "configure:33799: checking for the location of libjpeg" >&5
# Check whether --with-jpeg-dir or --without-jpeg-dir was given.
if test "${with_jpeg_dir+set}" = set; then
withval="$with_jpeg_dir"
@@ -34055,7 +33822,7 @@ if test -z "$PHP_PNG_DIR"; then
echo $ac_n "checking for the location of libpng""... $ac_c" 1>&6
-echo "configure:34059: checking for the location of libpng" >&5
+echo "configure:33826: checking for the location of libpng" >&5
# Check whether --with-png-dir or --without-png-dir was given.
if test "${with_png_dir+set}" = set; then
withval="$with_png_dir"
@@ -34082,7 +33849,7 @@ if test -z "$PHP_ZLIB_DIR"; then
echo $ac_n "checking for the location of libz""... $ac_c" 1>&6
-echo "configure:34086: checking for the location of libz" >&5
+echo "configure:33853: checking for the location of libz" >&5
# Check whether --with-zlib-dir or --without-zlib-dir was given.
if test "${with_zlib_dir+set}" = set; then
withval="$with_zlib_dir"
@@ -34108,7 +33875,7 @@ fi
echo $ac_n "checking for the location of libXpm""... $ac_c" 1>&6
-echo "configure:34112: checking for the location of libXpm" >&5
+echo "configure:33879: checking for the location of libXpm" >&5
# Check whether --with-xpm-dir or --without-xpm-dir was given.
if test "${with_xpm_dir+set}" = set; then
withval="$with_xpm_dir"
@@ -34133,7 +33900,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking for FreeType 1.x support""... $ac_c" 1>&6
-echo "configure:34137: checking for FreeType 1.x support" >&5
+echo "configure:33904: checking for FreeType 1.x support" >&5
# Check whether --with-ttf or --without-ttf was given.
if test "${with_ttf+set}" = set; then
withval="$with_ttf"
@@ -34158,7 +33925,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking for FreeType 2""... $ac_c" 1>&6
-echo "configure:34162: checking for FreeType 2" >&5
+echo "configure:33929: checking for FreeType 2" >&5
# Check whether --with-freetype-dir or --without-freetype-dir was given.
if test "${with_freetype_dir+set}" = set; then
withval="$with_freetype_dir"
@@ -34183,7 +33950,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking for T1lib support""... $ac_c" 1>&6
-echo "configure:34187: checking for T1lib support" >&5
+echo "configure:33954: checking for T1lib support" >&5
# Check whether --with-t1lib or --without-t1lib was given.
if test "${with_t1lib+set}" = set; then
withval="$with_t1lib"
@@ -34208,7 +33975,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking whether to enable truetype string function in GD""... $ac_c" 1>&6
-echo "configure:34212: checking whether to enable truetype string function in GD" >&5
+echo "configure:33979: checking whether to enable truetype string function in GD" >&5
# Check whether --enable-gd-native-ttf or --disable-gd-native-ttf was given.
if test "${enable_gd_native_ttf+set}" = set; then
enableval="$enable_gd_native_ttf"
@@ -34233,7 +34000,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking whether to enable JIS-mapped Japanese font support in GD""... $ac_c" 1>&6
-echo "configure:34237: checking whether to enable JIS-mapped Japanese font support in GD" >&5
+echo "configure:34004: checking whether to enable JIS-mapped Japanese font support in GD" >&5
# Check whether --enable-gd-jis-conv or --disable-gd-jis-conv was given.
if test "${enable_gd_jis_conv+set}" = set; then
enableval="$enable_gd_jis_conv"
@@ -34287,12 +34054,12 @@ if test "$PHP_GD" = "yes"; then
for ac_func in fabsf floorf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:34291: checking for $ac_func" >&5
+echo "configure:34058: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 34296 "configure"
+#line 34063 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -34315,7 +34082,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:34319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:34086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -34463,7 +34230,7 @@ EOF
done
echo $ac_n "checking for jpeg_read_header in -ljpeg""... $ac_c" 1>&6
-echo "configure:34467: checking for jpeg_read_header in -ljpeg" >&5
+echo "configure:34234: checking for jpeg_read_header in -ljpeg" >&5
ac_lib_var=`echo jpeg'_'jpeg_read_header | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -34471,7 +34238,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ljpeg $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 34475 "configure"
+#line 34242 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -34482,7 +34249,7 @@ int main() {
jpeg_read_header()
; return 0; }
EOF
-if { (eval echo configure:34486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:34253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -34762,7 +34529,7 @@ fi
done
echo $ac_n "checking for png_write_image in -lpng""... $ac_c" 1>&6
-echo "configure:34766: checking for png_write_image in -lpng" >&5
+echo "configure:34533: checking for png_write_image in -lpng" >&5
ac_lib_var=`echo png'_'png_write_image | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -34770,7 +34537,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpng $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 34774 "configure"
+#line 34541 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -34781,7 +34548,7 @@ int main() {
png_write_image()
; return 0; }
EOF
-if { (eval echo configure:34785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:34552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -35158,7 +34925,7 @@ fi
done
echo $ac_n "checking for XpmFreeXpmImage in -lXpm""... $ac_c" 1>&6
-echo "configure:35162: checking for XpmFreeXpmImage in -lXpm" >&5
+echo "configure:34929: checking for XpmFreeXpmImage in -lXpm" >&5
ac_lib_var=`echo Xpm'_'XpmFreeXpmImage | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -35166,7 +34933,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXpm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 35170 "configure"
+#line 34937 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -35177,7 +34944,7 @@ int main() {
XpmFreeXpmImage()
; return 0; }
EOF
-if { (eval echo configure:35181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:34948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -35780,7 +35547,7 @@ EOF
else
echo $ac_n "checking for FreeType 1 support""... $ac_c" 1>&6
-echo "configure:35784: checking for FreeType 1 support" >&5
+echo "configure:35551: checking for FreeType 1 support" >&5
echo "$ac_t""no - FreeType 2.x is to be used instead" 1>&6
fi
fi
@@ -35893,7 +35660,7 @@ echo "configure:35784: checking for FreeType 1 support" >&5
done
echo $ac_n "checking for T1_StrError in -lt1""... $ac_c" 1>&6
-echo "configure:35897: checking for T1_StrError in -lt1" >&5
+echo "configure:35664: checking for T1_StrError in -lt1" >&5
ac_lib_var=`echo t1'_'T1_StrError | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -35901,7 +35668,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lt1 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 35905 "configure"
+#line 35672 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -35912,7 +35679,7 @@ int main() {
T1_StrError()
; return 0; }
EOF
-if { (eval echo configure:35916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:35683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -36325,7 +36092,7 @@ EOF
done
echo $ac_n "checking for jpeg_read_header in -ljpeg""... $ac_c" 1>&6
-echo "configure:36329: checking for jpeg_read_header in -ljpeg" >&5
+echo "configure:36096: checking for jpeg_read_header in -ljpeg" >&5
ac_lib_var=`echo jpeg'_'jpeg_read_header | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -36333,7 +36100,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ljpeg $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 36337 "configure"
+#line 36104 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -36344,7 +36111,7 @@ int main() {
jpeg_read_header()
; return 0; }
EOF
-if { (eval echo configure:36348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:36115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -36624,7 +36391,7 @@ fi
done
echo $ac_n "checking for png_write_image in -lpng""... $ac_c" 1>&6
-echo "configure:36628: checking for png_write_image in -lpng" >&5
+echo "configure:36395: checking for png_write_image in -lpng" >&5
ac_lib_var=`echo png'_'png_write_image | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -36632,7 +36399,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpng $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 36636 "configure"
+#line 36403 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -36643,7 +36410,7 @@ int main() {
png_write_image()
; return 0; }
EOF
-if { (eval echo configure:36647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:36414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -37020,7 +36787,7 @@ fi
done
echo $ac_n "checking for XpmFreeXpmImage in -lXpm""... $ac_c" 1>&6
-echo "configure:37024: checking for XpmFreeXpmImage in -lXpm" >&5
+echo "configure:36791: checking for XpmFreeXpmImage in -lXpm" >&5
ac_lib_var=`echo Xpm'_'XpmFreeXpmImage | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -37028,7 +36795,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXpm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 37032 "configure"
+#line 36799 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -37039,7 +36806,7 @@ int main() {
XpmFreeXpmImage()
; return 0; }
EOF
-if { (eval echo configure:37043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:36810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -37642,7 +37409,7 @@ EOF
else
echo $ac_n "checking for FreeType 1 support""... $ac_c" 1>&6
-echo "configure:37646: checking for FreeType 1 support" >&5
+echo "configure:37413: checking for FreeType 1 support" >&5
echo "$ac_t""no - FreeType 2.x is to be used instead" 1>&6
fi
fi
@@ -37755,7 +37522,7 @@ echo "configure:37646: checking for FreeType 1 support" >&5
done
echo $ac_n "checking for T1_StrError in -lt1""... $ac_c" 1>&6
-echo "configure:37759: checking for T1_StrError in -lt1" >&5
+echo "configure:37526: checking for T1_StrError in -lt1" >&5
ac_lib_var=`echo t1'_'T1_StrError | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -37763,7 +37530,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lt1 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 37767 "configure"
+#line 37534 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -37774,7 +37541,7 @@ int main() {
T1_StrError()
; return 0; }
EOF
-if { (eval echo configure:37778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:37545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -38146,7 +37913,7 @@ EOF
done
echo $ac_n "checking for gdImageString16 in -lgd""... $ac_c" 1>&6
-echo "configure:38150: checking for gdImageString16 in -lgd" >&5
+echo "configure:37917: checking for gdImageString16 in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageString16 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -38154,7 +37921,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 38158 "configure"
+#line 37925 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -38165,7 +37932,7 @@ int main() {
gdImageString16()
; return 0; }
EOF
-if { (eval echo configure:38169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:37936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -38293,7 +38060,7 @@ fi
done
echo $ac_n "checking for gdImagePaletteCopy in -lgd""... $ac_c" 1>&6
-echo "configure:38297: checking for gdImagePaletteCopy in -lgd" >&5
+echo "configure:38064: checking for gdImagePaletteCopy in -lgd" >&5
ac_lib_var=`echo gd'_'gdImagePaletteCopy | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -38301,7 +38068,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 38305 "configure"
+#line 38072 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -38312,7 +38079,7 @@ int main() {
gdImagePaletteCopy()
; return 0; }
EOF
-if { (eval echo configure:38316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:38083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -38440,7 +38207,7 @@ fi
done
echo $ac_n "checking for gdImageCreateFromPng in -lgd""... $ac_c" 1>&6
-echo "configure:38444: checking for gdImageCreateFromPng in -lgd" >&5
+echo "configure:38211: checking for gdImageCreateFromPng in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromPng | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -38448,7 +38215,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 38452 "configure"
+#line 38219 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -38459,7 +38226,7 @@ int main() {
gdImageCreateFromPng()
; return 0; }
EOF
-if { (eval echo configure:38463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:38230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -38587,7 +38354,7 @@ fi
done
echo $ac_n "checking for gdImageCreateFromGif in -lgd""... $ac_c" 1>&6
-echo "configure:38591: checking for gdImageCreateFromGif in -lgd" >&5
+echo "configure:38358: checking for gdImageCreateFromGif in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromGif | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -38595,7 +38362,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 38599 "configure"
+#line 38366 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -38606,7 +38373,7 @@ int main() {
gdImageCreateFromGif()
; return 0; }
EOF
-if { (eval echo configure:38610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:38377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -38734,7 +38501,7 @@ fi
done
echo $ac_n "checking for gdImageGif in -lgd""... $ac_c" 1>&6
-echo "configure:38738: checking for gdImageGif in -lgd" >&5
+echo "configure:38505: checking for gdImageGif in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageGif | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -38742,7 +38509,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 38746 "configure"
+#line 38513 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -38753,7 +38520,7 @@ int main() {
gdImageGif()
; return 0; }
EOF
-if { (eval echo configure:38757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:38524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -38881,7 +38648,7 @@ fi
done
echo $ac_n "checking for gdImageWBMP in -lgd""... $ac_c" 1>&6
-echo "configure:38885: checking for gdImageWBMP in -lgd" >&5
+echo "configure:38652: checking for gdImageWBMP in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageWBMP | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -38889,7 +38656,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 38893 "configure"
+#line 38660 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -38900,7 +38667,7 @@ int main() {
gdImageWBMP()
; return 0; }
EOF
-if { (eval echo configure:38904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:38671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -39028,7 +38795,7 @@ fi
done
echo $ac_n "checking for gdImageCreateFromJpeg in -lgd""... $ac_c" 1>&6
-echo "configure:39032: checking for gdImageCreateFromJpeg in -lgd" >&5
+echo "configure:38799: checking for gdImageCreateFromJpeg in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromJpeg | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -39036,7 +38803,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 39040 "configure"
+#line 38807 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -39047,7 +38814,7 @@ int main() {
gdImageCreateFromJpeg()
; return 0; }
EOF
-if { (eval echo configure:39051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:38818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -39175,7 +38942,7 @@ fi
done
echo $ac_n "checking for gdImageCreateFromXpm in -lgd""... $ac_c" 1>&6
-echo "configure:39179: checking for gdImageCreateFromXpm in -lgd" >&5
+echo "configure:38946: checking for gdImageCreateFromXpm in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromXpm | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -39183,7 +38950,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 39187 "configure"
+#line 38954 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -39194,7 +38961,7 @@ int main() {
gdImageCreateFromXpm()
; return 0; }
EOF
-if { (eval echo configure:39198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:38965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -39322,7 +39089,7 @@ fi
done
echo $ac_n "checking for gdImageCreateFromGd2 in -lgd""... $ac_c" 1>&6
-echo "configure:39326: checking for gdImageCreateFromGd2 in -lgd" >&5
+echo "configure:39093: checking for gdImageCreateFromGd2 in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromGd2 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -39330,7 +39097,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 39334 "configure"
+#line 39101 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -39341,7 +39108,7 @@ int main() {
gdImageCreateFromGd2()
; return 0; }
EOF
-if { (eval echo configure:39345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:39112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -39469,7 +39236,7 @@ fi
done
echo $ac_n "checking for gdImageCreateTrueColor in -lgd""... $ac_c" 1>&6
-echo "configure:39473: checking for gdImageCreateTrueColor in -lgd" >&5
+echo "configure:39240: checking for gdImageCreateTrueColor in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateTrueColor | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -39477,7 +39244,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 39481 "configure"
+#line 39248 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -39488,7 +39255,7 @@ int main() {
gdImageCreateTrueColor()
; return 0; }
EOF
-if { (eval echo configure:39492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:39259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -39616,7 +39383,7 @@ fi
done
echo $ac_n "checking for gdImageSetTile in -lgd""... $ac_c" 1>&6
-echo "configure:39620: checking for gdImageSetTile in -lgd" >&5
+echo "configure:39387: checking for gdImageSetTile in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageSetTile | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -39624,7 +39391,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 39628 "configure"
+#line 39395 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -39635,7 +39402,7 @@ int main() {
gdImageSetTile()
; return 0; }
EOF
-if { (eval echo configure:39639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:39406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -39763,7 +39530,7 @@ fi
done
echo $ac_n "checking for gdImageEllipse in -lgd""... $ac_c" 1>&6
-echo "configure:39767: checking for gdImageEllipse in -lgd" >&5
+echo "configure:39534: checking for gdImageEllipse in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageEllipse | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -39771,7 +39538,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 39775 "configure"
+#line 39542 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -39782,7 +39549,7 @@ int main() {
gdImageEllipse()
; return 0; }
EOF
-if { (eval echo configure:39786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:39553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -39910,7 +39677,7 @@ fi
done
echo $ac_n "checking for gdImageSetBrush in -lgd""... $ac_c" 1>&6
-echo "configure:39914: checking for gdImageSetBrush in -lgd" >&5
+echo "configure:39681: checking for gdImageSetBrush in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageSetBrush | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -39918,7 +39685,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 39922 "configure"
+#line 39689 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -39929,7 +39696,7 @@ int main() {
gdImageSetBrush()
; return 0; }
EOF
-if { (eval echo configure:39933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:39700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -40057,7 +39824,7 @@ fi
done
echo $ac_n "checking for gdImageStringTTF in -lgd""... $ac_c" 1>&6
-echo "configure:40061: checking for gdImageStringTTF in -lgd" >&5
+echo "configure:39828: checking for gdImageStringTTF in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageStringTTF | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -40065,7 +39832,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 40069 "configure"
+#line 39836 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -40076,7 +39843,7 @@ int main() {
gdImageStringTTF()
; return 0; }
EOF
-if { (eval echo configure:40080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:39847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -40204,7 +39971,7 @@ fi
done
echo $ac_n "checking for gdImageStringFT in -lgd""... $ac_c" 1>&6
-echo "configure:40208: checking for gdImageStringFT in -lgd" >&5
+echo "configure:39975: checking for gdImageStringFT in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageStringFT | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -40212,7 +39979,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 40216 "configure"
+#line 39983 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -40223,7 +39990,7 @@ int main() {
gdImageStringFT()
; return 0; }
EOF
-if { (eval echo configure:40227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:39994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -40351,7 +40118,7 @@ fi
done
echo $ac_n "checking for gdImageStringFTEx in -lgd""... $ac_c" 1>&6
-echo "configure:40355: checking for gdImageStringFTEx in -lgd" >&5
+echo "configure:40122: checking for gdImageStringFTEx in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageStringFTEx | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -40359,7 +40126,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 40363 "configure"
+#line 40130 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -40370,7 +40137,7 @@ int main() {
gdImageStringFTEx()
; return 0; }
EOF
-if { (eval echo configure:40374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:40141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -40498,7 +40265,7 @@ fi
done
echo $ac_n "checking for gdImageColorClosestHWB in -lgd""... $ac_c" 1>&6
-echo "configure:40502: checking for gdImageColorClosestHWB in -lgd" >&5
+echo "configure:40269: checking for gdImageColorClosestHWB in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageColorClosestHWB | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -40506,7 +40273,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 40510 "configure"
+#line 40277 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -40517,7 +40284,7 @@ int main() {
gdImageColorClosestHWB()
; return 0; }
EOF
-if { (eval echo configure:40521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:40288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -40645,7 +40412,7 @@ fi
done
echo $ac_n "checking for gdImageColorResolve in -lgd""... $ac_c" 1>&6
-echo "configure:40649: checking for gdImageColorResolve in -lgd" >&5
+echo "configure:40416: checking for gdImageColorResolve in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageColorResolve | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -40653,7 +40420,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 40657 "configure"
+#line 40424 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -40664,7 +40431,7 @@ int main() {
gdImageColorResolve()
; return 0; }
EOF
-if { (eval echo configure:40668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:40435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -40792,7 +40559,7 @@ fi
done
echo $ac_n "checking for gdImageGifCtx in -lgd""... $ac_c" 1>&6
-echo "configure:40796: checking for gdImageGifCtx in -lgd" >&5
+echo "configure:40563: checking for gdImageGifCtx in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageGifCtx | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -40800,7 +40567,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 40804 "configure"
+#line 40571 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -40811,7 +40578,7 @@ int main() {
gdImageGifCtx()
; return 0; }
EOF
-if { (eval echo configure:40815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:40582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -40939,7 +40706,7 @@ fi
done
echo $ac_n "checking for gdCacheCreate in -lgd""... $ac_c" 1>&6
-echo "configure:40943: checking for gdCacheCreate in -lgd" >&5
+echo "configure:40710: checking for gdCacheCreate in -lgd" >&5
ac_lib_var=`echo gd'_'gdCacheCreate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -40947,7 +40714,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 40951 "configure"
+#line 40718 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -40958,7 +40725,7 @@ int main() {
gdCacheCreate()
; return 0; }
EOF
-if { (eval echo configure:40962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:40729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -41086,7 +40853,7 @@ fi
done
echo $ac_n "checking for gdFontCacheShutdown in -lgd""... $ac_c" 1>&6
-echo "configure:41090: checking for gdFontCacheShutdown in -lgd" >&5
+echo "configure:40857: checking for gdFontCacheShutdown in -lgd" >&5
ac_lib_var=`echo gd'_'gdFontCacheShutdown | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -41094,7 +40861,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 41098 "configure"
+#line 40865 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -41105,7 +40872,7 @@ int main() {
gdFontCacheShutdown()
; return 0; }
EOF
-if { (eval echo configure:41109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:40876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -41233,7 +41000,7 @@ fi
done
echo $ac_n "checking for gdFreeFontCache in -lgd""... $ac_c" 1>&6
-echo "configure:41237: checking for gdFreeFontCache in -lgd" >&5
+echo "configure:41004: checking for gdFreeFontCache in -lgd" >&5
ac_lib_var=`echo gd'_'gdFreeFontCache | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -41241,7 +41008,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 41245 "configure"
+#line 41012 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -41252,7 +41019,7 @@ int main() {
gdFreeFontCache()
; return 0; }
EOF
-if { (eval echo configure:41256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:41023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -41380,7 +41147,7 @@ fi
done
echo $ac_n "checking for gdNewDynamicCtxEx in -lgd""... $ac_c" 1>&6
-echo "configure:41384: checking for gdNewDynamicCtxEx in -lgd" >&5
+echo "configure:41151: checking for gdNewDynamicCtxEx in -lgd" >&5
ac_lib_var=`echo gd'_'gdNewDynamicCtxEx | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -41388,7 +41155,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 41392 "configure"
+#line 41159 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -41399,7 +41166,7 @@ int main() {
gdNewDynamicCtxEx()
; return 0; }
EOF
-if { (eval echo configure:41403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:41170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -41454,7 +41221,7 @@ fi
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$GD_INCLUDE
cat > conftest.$ac_ext <<EOF
-#line 41458 "configure"
+#line 41225 "configure"
#include "confdefs.h"
#include <gd.h>
@@ -41468,7 +41235,7 @@ ctx->gd_free = 1;
; return 0; }
EOF
-if { (eval echo configure:41472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:41239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
@@ -41907,7 +41674,7 @@ EOF
done
echo $ac_n "checking for gdImageCreate in -lgd""... $ac_c" 1>&6
-echo "configure:41911: checking for gdImageCreate in -lgd" >&5
+echo "configure:41678: checking for gdImageCreate in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -41915,7 +41682,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 41919 "configure"
+#line 41686 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -41926,7 +41693,7 @@ int main() {
gdImageCreate()
; return 0; }
EOF
-if { (eval echo configure:41930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:41697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -41990,7 +41757,7 @@ fi
echo $ac_n "checking for GNU gettext support""... $ac_c" 1>&6
-echo "configure:41994: checking for GNU gettext support" >&5
+echo "configure:41761: checking for GNU gettext support" >&5
# Check whether --with-gettext or --without-gettext was given.
if test "${with_gettext+set}" = set; then
withval="$with_gettext"
@@ -42048,7 +41815,7 @@ if test "$PHP_GETTEXT" != "no"; then
O_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR"
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:42052: checking for bindtextdomain in -lintl" >&5
+echo "configure:41819: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -42056,7 +41823,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 42060 "configure"
+#line 41827 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -42067,7 +41834,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:42071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:41838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -42089,7 +41856,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for bindtextdomain in -lc""... $ac_c" 1>&6
-echo "configure:42093: checking for bindtextdomain in -lc" >&5
+echo "configure:41860: checking for bindtextdomain in -lc" >&5
ac_lib_var=`echo c'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -42097,7 +41864,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 42101 "configure"
+#line 41868 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -42108,7 +41875,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:42112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:41879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -42560,7 +42327,7 @@ EOF
echo $ac_n "checking for ngettext in -l$GETTEXT_CHECK_IN_LIB""... $ac_c" 1>&6
-echo "configure:42564: checking for ngettext in -l$GETTEXT_CHECK_IN_LIB" >&5
+echo "configure:42331: checking for ngettext in -l$GETTEXT_CHECK_IN_LIB" >&5
ac_lib_var=`echo $GETTEXT_CHECK_IN_LIB'_'ngettext | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -42568,7 +42335,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$GETTEXT_CHECK_IN_LIB $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 42572 "configure"
+#line 42339 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -42579,7 +42346,7 @@ int main() {
ngettext()
; return 0; }
EOF
-if { (eval echo configure:42583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:42350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -42603,7 +42370,7 @@ else
fi
echo $ac_n "checking for dngettext in -l$GETTEXT_CHECK_IN_LIB""... $ac_c" 1>&6
-echo "configure:42607: checking for dngettext in -l$GETTEXT_CHECK_IN_LIB" >&5
+echo "configure:42374: checking for dngettext in -l$GETTEXT_CHECK_IN_LIB" >&5
ac_lib_var=`echo $GETTEXT_CHECK_IN_LIB'_'dngettext | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -42611,7 +42378,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$GETTEXT_CHECK_IN_LIB $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 42615 "configure"
+#line 42382 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -42622,7 +42389,7 @@ int main() {
dngettext()
; return 0; }
EOF
-if { (eval echo configure:42626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:42393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -42646,7 +42413,7 @@ else
fi
echo $ac_n "checking for dcngettext in -l$GETTEXT_CHECK_IN_LIB""... $ac_c" 1>&6
-echo "configure:42650: checking for dcngettext in -l$GETTEXT_CHECK_IN_LIB" >&5
+echo "configure:42417: checking for dcngettext in -l$GETTEXT_CHECK_IN_LIB" >&5
ac_lib_var=`echo $GETTEXT_CHECK_IN_LIB'_'dcngettext | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -42654,7 +42421,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$GETTEXT_CHECK_IN_LIB $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 42658 "configure"
+#line 42425 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -42665,7 +42432,7 @@ int main() {
dcngettext()
; return 0; }
EOF
-if { (eval echo configure:42669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:42436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -42689,7 +42456,7 @@ else
fi
echo $ac_n "checking for bind_textdomain_codeset in -l$GETTEXT_CHECK_IN_LIB""... $ac_c" 1>&6
-echo "configure:42693: checking for bind_textdomain_codeset in -l$GETTEXT_CHECK_IN_LIB" >&5
+echo "configure:42460: checking for bind_textdomain_codeset in -l$GETTEXT_CHECK_IN_LIB" >&5
ac_lib_var=`echo $GETTEXT_CHECK_IN_LIB'_'bind_textdomain_codeset | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -42697,7 +42464,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$GETTEXT_CHECK_IN_LIB $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 42701 "configure"
+#line 42468 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -42708,7 +42475,7 @@ int main() {
bind_textdomain_codeset()
; return 0; }
EOF
-if { (eval echo configure:42712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:42479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -42738,7 +42505,7 @@ fi
echo $ac_n "checking for GNU MP support""... $ac_c" 1>&6
-echo "configure:42742: checking for GNU MP support" >&5
+echo "configure:42509: checking for GNU MP support" >&5
# Check whether --with-gmp or --without-gmp was given.
if test "${with_gmp+set}" = set; then
withval="$with_gmp"
@@ -42888,7 +42655,7 @@ if test "$PHP_GMP" != "no"; then
done
echo $ac_n "checking for __gmp_randinit_lc_2exp_size in -lgmp""... $ac_c" 1>&6
-echo "configure:42892: checking for __gmp_randinit_lc_2exp_size in -lgmp" >&5
+echo "configure:42659: checking for __gmp_randinit_lc_2exp_size in -lgmp" >&5
ac_lib_var=`echo gmp'_'__gmp_randinit_lc_2exp_size | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -42896,7 +42663,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgmp $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 42900 "configure"
+#line 42667 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -42907,7 +42674,7 @@ int main() {
__gmp_randinit_lc_2exp_size()
; return 0; }
EOF
-if { (eval echo configure:42911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:42678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -43031,7 +42798,7 @@ else
done
echo $ac_n "checking for gmp_randinit_lc_2exp_size in -lgmp""... $ac_c" 1>&6
-echo "configure:43035: checking for gmp_randinit_lc_2exp_size in -lgmp" >&5
+echo "configure:42802: checking for gmp_randinit_lc_2exp_size in -lgmp" >&5
ac_lib_var=`echo gmp'_'gmp_randinit_lc_2exp_size | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -43039,7 +42806,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgmp $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 43043 "configure"
+#line 42810 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -43050,7 +42817,7 @@ int main() {
gmp_randinit_lc_2exp_size()
; return 0; }
EOF
-if { (eval echo configure:43054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:42821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -43509,7 +43276,7 @@ fi
echo $ac_n "checking whether to enable hash support""... $ac_c" 1>&6
-echo "configure:43513: checking whether to enable hash support" >&5
+echo "configure:43280: checking whether to enable hash support" >&5
# Check whether --enable-hash or --disable-hash was given.
if test "${enable_hash+set}" = set; then
enableval="$enable_hash"
@@ -43559,7 +43326,7 @@ EOF
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:43563: checking whether byte ordering is bigendian" >&5
+echo "configure:43330: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian_php'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -43569,7 +43336,7 @@ else
ac_cv_c_bigendian_php=unknown
else
cat > conftest.$ac_ext <<EOF
-#line 43573 "configure"
+#line 43340 "configure"
#include "confdefs.h"
int main(void)
@@ -43585,7 +43352,7 @@ int main(void)
}
EOF
-if { (eval echo configure:43589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:43356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian_php=yes
else
@@ -43610,7 +43377,7 @@ EOF
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:43614: checking size of short" >&5
+echo "configure:43381: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -43618,7 +43385,7 @@ else
ac_cv_sizeof_short=2
else
cat > conftest.$ac_ext <<EOF
-#line 43622 "configure"
+#line 43389 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -43629,7 +43396,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:43633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:43400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_short=`cat conftestval`
else
@@ -43649,7 +43416,7 @@ EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:43653: checking size of int" >&5
+echo "configure:43420: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -43657,7 +43424,7 @@ else
ac_cv_sizeof_int=4
else
cat > conftest.$ac_ext <<EOF
-#line 43661 "configure"
+#line 43428 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -43668,7 +43435,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:43672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:43439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
@@ -43688,7 +43455,7 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:43692: checking size of long" >&5
+echo "configure:43459: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -43696,7 +43463,7 @@ else
ac_cv_sizeof_long=4
else
cat > conftest.$ac_ext <<EOF
-#line 43700 "configure"
+#line 43467 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -43707,7 +43474,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:43711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:43478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
@@ -43727,7 +43494,7 @@ EOF
echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:43731: checking size of long long" >&5
+echo "configure:43498: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -43735,7 +43502,7 @@ else
ac_cv_sizeof_long_long=8
else
cat > conftest.$ac_ext <<EOF
-#line 43739 "configure"
+#line 43506 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -43746,7 +43513,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:43750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:43517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_long=`cat conftestval`
else
@@ -44081,795 +43848,8 @@ fi
-echo $ac_n "checking for hwapi support""... $ac_c" 1>&6
-echo "configure:44086: checking for hwapi support" >&5
-# Check whether --with-hwapi or --without-hwapi was given.
-if test "${with_hwapi+set}" = set; then
- withval="$with_hwapi"
- PHP_HWAPI=$withval
-else
-
- PHP_HWAPI=no
-
- if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
- PHP_HWAPI=$PHP_ENABLE_ALL
- fi
-
-fi
-
-
-
-ext_output="yes, shared"
-ext_shared=yes
-case $PHP_HWAPI in
-shared,*)
- PHP_HWAPI=`echo "$PHP_HWAPI"|$SED 's/^shared,//'`
- ;;
-shared)
- PHP_HWAPI=yes
- ;;
-no)
- ext_output=no
- ext_shared=no
- ;;
-*)
- ext_output=yes
- ext_shared=no
- ;;
-esac
-
-
-
-echo "$ac_t""$ext_output" 1>&6
-
-
-
-
-if test "$PHP_HWAPI" != "no"; then
- if test -r $PHP_HWAPI/include/sdk/api/object.h; then
- HWAPI_DIR=$PHP_HWAPI
- else
- echo $ac_n "checking for HWAPI in default path""... $ac_c" 1>&6
-echo "configure:44134: checking for HWAPI in default path" >&5
- for i in /usr/local /usr; do
- if test -r $i/include/hwapi/sdk/api/object.h; then
- HWAPI_DIR=$i
- echo "$ac_t""found in $i" 1>&6
- fi
- done
- fi
-
- if test -z "$HWAPI_DIR"; then
- echo "$ac_t""not found" 1>&6
- { echo "configure: error: Please install the hwapi >= 1.0.0 distribution" 1>&2; exit 1; }
- fi
-
-
- if test "$HWAPI_DIR/include/hwapi" != "/usr/include"; then
-
- if test -z "$HWAPI_DIR/include/hwapi" || echo "$HWAPI_DIR/include/hwapi" | grep '^/' >/dev/null ; then
- ai_p=$HWAPI_DIR/include/hwapi
- else
-
- ep_dir="`echo $HWAPI_DIR/include/hwapi|$SED 's%/*[^/][^/]*/*$%%'`"
-
- ep_realdir="`(cd \"$ep_dir\" && pwd)`"
- ai_p="$ep_realdir/`basename \"$HWAPI_DIR/include/hwapi\"`"
- fi
-
-
-
- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
-
- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
- if test -n "$unique" && test "`eval $cmd`" = "" ; then
- eval "INCLUDEPATH$unique=set"
-
- if test ""; then
- INCLUDES="-I$ai_p $INCLUDES"
- else
- INCLUDES="$INCLUDES -I$ai_p"
- fi
-
- fi
-
- fi
-
-
- PHP_VAR_SUBST="$PHP_VAR_SUBST HWAPI_SHARED_LIBADD"
-
-
-
- if test "$ext_shared" = "yes"; then
- HWAPI_SHARED_LIBADD="-lhwapi $HWAPI_SHARED_LIBADD"
- if test -n "$HWAPI_DIR/lib"; then
-
- if test "$HWAPI_DIR/lib" != "/usr/$PHP_LIBDIR" && test "$HWAPI_DIR/lib" != "/usr/lib"; then
-
- if test -z "$HWAPI_DIR/lib" || echo "$HWAPI_DIR/lib" | grep '^/' >/dev/null ; then
- ai_p=$HWAPI_DIR/lib
- else
-
- ep_dir="`echo $HWAPI_DIR/lib|$SED 's%/*[^/][^/]*/*$%%'`"
-
- ep_realdir="`(cd \"$ep_dir\" && pwd)`"
- ai_p="$ep_realdir/`basename \"$HWAPI_DIR/lib\"`"
- fi
-
-
- if test "$ext_shared" = "yes"; then
- HWAPI_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $HWAPI_SHARED_LIBADD"
- else
-
-
-
- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
-
- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
- if test -n "$unique" && test "`eval $cmd`" = "" ; then
- eval "LIBPATH$unique=set"
-
- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
- LDFLAGS="$LDFLAGS -L$ai_p"
- PHP_RPATHS="$PHP_RPATHS $ai_p"
-
- fi
-
-
- fi
-
- fi
-
- fi
- else
-
-
- if test -n "$HWAPI_DIR/lib"; then
-
- if test "$HWAPI_DIR/lib" != "/usr/$PHP_LIBDIR" && test "$HWAPI_DIR/lib" != "/usr/lib"; then
-
- if test -z "$HWAPI_DIR/lib" || echo "$HWAPI_DIR/lib" | grep '^/' >/dev/null ; then
- ai_p=$HWAPI_DIR/lib
- else
-
- ep_dir="`echo $HWAPI_DIR/lib|$SED 's%/*[^/][^/]*/*$%%'`"
-
- ep_realdir="`(cd \"$ep_dir\" && pwd)`"
- ai_p="$ep_realdir/`basename \"$HWAPI_DIR/lib\"`"
- fi
-
-
-
-
-
- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
-
- cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
- if test -n "$unique" && test "`eval $cmd`" = "" ; then
- eval "LIBPATH$unique=set"
-
- test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
- LDFLAGS="$LDFLAGS -L$ai_p"
- PHP_RPATHS="$PHP_RPATHS $ai_p"
-
- fi
-
-
-
- fi
-
- fi
-
-
- case hwapi in
- c|c_r|pthread*) ;;
- *)
- LIBS="-lhwapi $LIBS"
- ;;
- esac
-
-
-
-
- fi
-
-
- cat >> confdefs.h <<\EOF
-#define HAVE_HWAPI 1
-EOF
-
-
-
- if test -z "$php_cxx_done"; then
- for ac_prog in $CCC c++ g++ gcc CC cxx cc++ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:44290: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # 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_CXX="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CXX="$ac_cv_prog_CXX"
-if test -n "$CXX"; then
- echo "$ac_t""$CXX" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-test -n "$CXX" && break
-done
-test -n "$CXX" || CXX="gcc"
-
-
-echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:44322: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
-
-ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
-
-cat > conftest.$ac_ext << EOF
-
-#line 44333 "configure"
-#include "confdefs.h"
-
-int main(){return(0);}
-EOF
-if { (eval echo configure:44338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- ac_cv_prog_cxx_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_cxx_cross=no
- else
- ac_cv_prog_cxx_cross=yes
- fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cxx_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_cxx_works" 1>&6
-if test $ac_cv_prog_cxx_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 ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:44364: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
-cross_compiling=$ac_cv_prog_cxx_cross
-
-echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:44369: checking whether we are using GNU C++" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.C <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:44378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gxx=yes
-else
- ac_cv_prog_gxx=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gxx" 1>&6
-
-if test $ac_cv_prog_gxx = yes; then
- GXX=yes
-else
- GXX=
-fi
-
-ac_test_CXXFLAGS="${CXXFLAGS+set}"
-ac_save_CXXFLAGS="$CXXFLAGS"
-CXXFLAGS=
-echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:44397: checking whether ${CXX-g++} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.cc
-if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
- ac_cv_prog_cxx_g=yes
-else
- ac_cv_prog_cxx_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cxx_g" 1>&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 \
- ''\
- '#include <stdlib.h>' \
- '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 <<EOF
-#line 44438 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-$ac_declaration
-int main() {
-exit (42);
-; return 0; }
-EOF
-if { (eval echo configure:44446: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- continue
-fi
-rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 44456 "configure"
-#include "confdefs.h"
-$ac_declaration
-int main() {
-exit (42);
-; return 0; }
-EOF
-if { (eval echo configure:44463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- break
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-done
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-
-
- echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:44480: checking how to run the C++ preprocessor" >&5
-if test -z "$CXXCPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
- CXXCPP="${CXX-g++} -E"
- cat > conftest.$ac_ext <<EOF
-#line 44493 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:44498: \"$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*
- CXXCPP=/lib/cpp
-fi
-rm -f conftest*
- ac_cv_prog_CXXCPP="$CXXCPP"
-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
-fi
-fi
-CXXCPP="$ac_cv_prog_CXXCPP"
-echo "$ac_t""$CXXCPP" 1>&6
-
- php_cxx_done=yes
- fi
-
-
- ext_builddir=ext/hwapi
- ext_srcdir=$abs_srcdir/ext/hwapi
-
- ac_extra=
-
- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then
- PHP_HWAPI_SHARED=no
-
-
- case ext/hwapi in
- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
- /*) ac_srcdir=`echo "ext/hwapi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
- *) ac_srcdir="$abs_srcdir/ext/hwapi/"; ac_bdir="ext/hwapi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
- esac
-
-
-
- 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
- b_lo=$php_lo
-
-
- old_IFS=$IFS
- for ac_src in hwapi.cpp; do
-
- IFS=.
- set $ac_src
- ac_obj=$1
- IFS=$old_IFS
-
- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"
-
- case $ac_src in
- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
- esac
-
- cat >>Makefile.objects<<EOF
-$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
- $ac_comp
-EOF
- done
-
-
- EXT_STATIC="$EXT_STATIC hwapi"
- if test "$ext_shared" != "nocli"; then
- EXT_CLI_STATIC="$EXT_CLI_STATIC hwapi"
- fi
- else
- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then
- PHP_HWAPI_SHARED=yes
-
- case ext/hwapi in
- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
- /*) ac_srcdir=`echo "ext/hwapi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
- *) ac_srcdir="$abs_srcdir/ext/hwapi/"; ac_bdir="ext/hwapi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
- esac
-
-
-
- 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_lo=$shared_lo
-
-
- old_IFS=$IFS
- for ac_src in hwapi.cpp; do
-
- IFS=.
- set $ac_src
- ac_obj=$1
- IFS=$old_IFS
-
- shared_objects_hwapi="$shared_objects_hwapi $ac_bdir$ac_obj.lo"
-
- case $ac_src in
- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
- esac
-
- cat >>Makefile.objects<<EOF
-$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
- $ac_comp
-EOF
- done
-
- case $host_alias in
- *netware*)
-
- install_modules="install-modules"
-
- case $host_alias in
- *aix*)
- suffix=so
- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phphwapi.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hwapi) $(PHPHWAPI_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phphwapi.so '$ext_builddir'/phphwapi.so'
- ;;
- *netware*)
- suffix=nlm
- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hwapi) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPHWAPI, 3)_SHARED_LIBADD)'
- ;;
- *)
- suffix=la
- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hwapi) $(PHPHWAPI_SHARED_LIBADD)'
- ;;
- esac
-
- PHP_MODULES="$PHP_MODULES \$(phplibdir)/phphwapi.$suffix"
-
- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_hwapi"
-
- cat >>Makefile.objects<<EOF
-\$(phplibdir)/phphwapi.$suffix: $ext_builddir/phphwapi.$suffix
- \$(LIBTOOL) --mode=install cp $ext_builddir/phphwapi.$suffix \$(phplibdir)
-
-$ext_builddir/phphwapi.$suffix: \$(shared_objects_hwapi) \$(PHPHWAPI_SHARED_DEPENDENCIES)
- $link_cmd
-
-EOF
-
- ;;
- *)
-
- install_modules="install-modules"
-
- case $host_alias in
- *aix*)
- suffix=so
- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/hwapi.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hwapi) $(HWAPI_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/hwapi.so '$ext_builddir'/hwapi.so'
- ;;
- *netware*)
- suffix=nlm
- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hwapi) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(HWAPI, 3)_SHARED_LIBADD)'
- ;;
- *)
- suffix=la
- link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hwapi) $(HWAPI_SHARED_LIBADD)'
- ;;
- esac
-
- PHP_MODULES="$PHP_MODULES \$(phplibdir)/hwapi.$suffix"
-
- PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_hwapi"
-
- cat >>Makefile.objects<<EOF
-\$(phplibdir)/hwapi.$suffix: $ext_builddir/hwapi.$suffix
- \$(LIBTOOL) --mode=install cp $ext_builddir/hwapi.$suffix \$(phplibdir)
-
-$ext_builddir/hwapi.$suffix: \$(shared_objects_hwapi) \$(HWAPI_SHARED_DEPENDENCIES)
- $link_cmd
-
-EOF
-
- ;;
- esac
- cat >> confdefs.h <<EOF
-#define COMPILE_DL_HWAPI 1
-EOF
-
- fi
- fi
-
- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
- PHP_HWAPI_SHARED=no
- if test "$PHP_SAPI" = "cgi"; then
-
-
- case ext/hwapi in
- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
- /*) ac_srcdir=`echo "ext/hwapi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
- *) ac_srcdir="$abs_srcdir/ext/hwapi/"; ac_bdir="ext/hwapi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
- esac
-
-
-
- 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
- b_lo=$php_lo
-
-
- old_IFS=$IFS
- for ac_src in hwapi.cpp; do
-
- IFS=.
- set $ac_src
- ac_obj=$1
- IFS=$old_IFS
-
- PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"
-
- case $ac_src in
- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
- esac
-
- cat >>Makefile.objects<<EOF
-$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
- $ac_comp
-EOF
- done
-
-
- EXT_STATIC="$EXT_STATIC hwapi"
- else
-
-
- case ext/hwapi in
- "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
- /*) ac_srcdir=`echo "ext/hwapi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
- *) ac_srcdir="$abs_srcdir/ext/hwapi/"; ac_bdir="ext/hwapi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
- esac
-
-
-
- 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
- b_lo=$php_lo
-
-
- old_IFS=$IFS
- for ac_src in hwapi.cpp; do
-
- IFS=.
- set $ac_src
- ac_obj=$1
- IFS=$old_IFS
-
- PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"
-
- case $ac_src in
- *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
- *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
- *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
- *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
- esac
-
- cat >>Makefile.objects<<EOF
-$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
- $ac_comp
-EOF
- done
-
-
- fi
- EXT_CLI_STATIC="$EXT_CLI_STATIC hwapi"
- fi
-
-
- BUILD_DIR="$BUILD_DIR $ext_builddir"
-
-
-
- if test "$ext_builddir" = "."; then
- PHP_PECL_EXTENSION=hwapi
-
- PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION"
-
- fi
-
-
-
- case hwapi in
- c|c_r|pthread*) ;;
- *)
- LIBS="-lhwapi $LIBS"
- ;;
- esac
-
-
-
-
- case pthread in
- c|c_r|pthread*) ;;
- *)
- LIBS="-lpthread $LIBS"
- ;;
- esac
-
-
-
-
- case stdc++ in
- c|c_r|pthread*) ;;
- *)
- LIBS="-lstdc++ $LIBS"
- ;;
- esac
-
-
-
- if test "$HWAPI_DIR/include" != "/usr/include"; then
-
- if test -z "$HWAPI_DIR/include" || echo "$HWAPI_DIR/include" | grep '^/' >/dev/null ; then
- ai_p=$HWAPI_DIR/include
- else
-
- ep_dir="`echo $HWAPI_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`"
-
- ep_realdir="`(cd \"$ep_dir\" && pwd)`"
- ai_p="$ep_realdir/`basename \"$HWAPI_DIR/include\"`"
- fi
-
-
-
- unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
-
- cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
- if test -n "$unique" && test "`eval $cmd`" = "" ; then
- eval "INCLUDEPATH$unique=set"
-
- if test ""; then
- INCLUDES="-I$ai_p $INCLUDES"
- else
- INCLUDES="$INCLUDES -I$ai_p"
- fi
-
- fi
-
- fi
-
-fi
-
-
-
-
echo $ac_n "checking for iconv support""... $ac_c" 1>&6
-echo "configure:44873: checking for iconv support" >&5
+echo "configure:43853: checking for iconv support" >&5
# Check whether --with-iconv or --without-iconv was given.
if test "${with_iconv+set}" = set; then
withval="$with_iconv"
@@ -44931,12 +43911,12 @@ if test "$PHP_ICONV" != "no"; then
if test "$PHP_ICONV" = "yes"; then
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:44935: checking for iconv" >&5
+echo "configure:43915: checking for iconv" >&5
if eval "test \"`echo '$''{'ac_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 44940 "configure"
+#line 43920 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char iconv(); below. */
@@ -44959,7 +43939,7 @@ iconv();
; return 0; }
EOF
-if { (eval echo configure:44963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:43943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_iconv=yes"
else
@@ -44980,12 +43960,12 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for libiconv""... $ac_c" 1>&6
-echo "configure:44984: checking for libiconv" >&5
+echo "configure:43964: checking for libiconv" >&5
if eval "test \"`echo '$''{'ac_cv_func_libiconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 44989 "configure"
+#line 43969 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char libiconv(); below. */
@@ -45008,7 +43988,7 @@ libiconv();
; return 0; }
EOF
-if { (eval echo configure:45012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:43992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_libiconv=yes"
else
@@ -45163,7 +44143,7 @@ EOF
done
echo $ac_n "checking for libiconv in -l$iconv_lib_name""... $ac_c" 1>&6
-echo "configure:45167: checking for libiconv in -l$iconv_lib_name" >&5
+echo "configure:44147: checking for libiconv in -l$iconv_lib_name" >&5
ac_lib_var=`echo $iconv_lib_name'_'libiconv | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -45171,7 +44151,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$iconv_lib_name $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 45175 "configure"
+#line 44155 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -45182,7 +44162,7 @@ int main() {
libiconv()
; return 0; }
EOF
-if { (eval echo configure:45186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:44166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -45315,7 +44295,7 @@ else
done
echo $ac_n "checking for iconv in -l$iconv_lib_name""... $ac_c" 1>&6
-echo "configure:45319: checking for iconv in -l$iconv_lib_name" >&5
+echo "configure:44299: checking for iconv in -l$iconv_lib_name" >&5
ac_lib_var=`echo $iconv_lib_name'_'iconv | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -45323,7 +44303,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$iconv_lib_name $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 45327 "configure"
+#line 44307 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -45334,7 +44314,7 @@ int main() {
iconv()
; return 0; }
EOF
-if { (eval echo configure:45338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:44318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -45544,16 +44524,16 @@ else
fi
echo $ac_n "checking if iconv is glibc's""... $ac_c" 1>&6
-echo "configure:45548: checking if iconv is glibc's" >&5
+echo "configure:44528: checking if iconv is glibc's" >&5
cat > conftest.$ac_ext <<EOF
-#line 45550 "configure"
+#line 44530 "configure"
#include "confdefs.h"
#include <gnu/libc-version.h>
int main() {
gnu_get_libc_version();
; return 0; }
EOF
-if { (eval echo configure:45557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:44537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
@@ -45571,14 +44551,14 @@ rm -f conftest*
if test -z "$iconv_impl_name"; then
echo $ac_n "checking if using GNU libiconv""... $ac_c" 1>&6
-echo "configure:45575: checking if using GNU libiconv" >&5
+echo "configure:44555: checking if using GNU libiconv" >&5
php_iconv_old_ld="$LDFLAGS"
LDFLAGS="-liconv $LDFLAGS"
if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 45582 "configure"
+#line 44562 "configure"
#include "confdefs.h"
#include <$PHP_ICONV_H_PATH>
@@ -45588,7 +44568,7 @@ int main() {
}
EOF
-if { (eval echo configure:45592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:44572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""yes" 1>&6
@@ -45610,16 +44590,16 @@ fi
if test -z "$iconv_impl_name"; then
echo $ac_n "checking if iconv is Konstantin Chuguev's""... $ac_c" 1>&6
-echo "configure:45614: checking if iconv is Konstantin Chuguev's" >&5
+echo "configure:44594: checking if iconv is Konstantin Chuguev's" >&5
cat > conftest.$ac_ext <<EOF
-#line 45616 "configure"
+#line 44596 "configure"
#include "confdefs.h"
#include <iconv.h>
int main() {
iconv_ccs_init(NULL, NULL);
; return 0; }
EOF
-if { (eval echo configure:45623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:44603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
@@ -45786,7 +44766,7 @@ EOF
esac
echo $ac_n "checking if iconv supports errno""... $ac_c" 1>&6
-echo "configure:45790: checking if iconv supports errno" >&5
+echo "configure:44770: checking if iconv supports errno" >&5
if test "$cross_compiling" = yes; then
echo "$ac_t""no" 1>&6
@@ -45800,7 +44780,7 @@ EOF
else
cat > conftest.$ac_ext <<EOF
-#line 45804 "configure"
+#line 44784 "configure"
#include "confdefs.h"
#include <$PHP_ICONV_H_PATH>
@@ -45821,7 +44801,7 @@ int main() {
}
EOF
-if { (eval echo configure:45825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:44805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""yes" 1>&6
@@ -45853,9 +44833,9 @@ fi
echo $ac_n "checking if your cpp allows macro usage in include lines""... $ac_c" 1>&6
-echo "configure:45857: checking if your cpp allows macro usage in include lines" >&5
+echo "configure:44837: checking if your cpp allows macro usage in include lines" >&5
cat > conftest.$ac_ext <<EOF
-#line 45859 "configure"
+#line 44839 "configure"
#include "confdefs.h"
#define FOO <$PHP_ICONV_H_PATH>
@@ -45865,7 +44845,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:45869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:44849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
@@ -46209,7 +45189,7 @@ fi
echo $ac_n "checking for IMAP support""... $ac_c" 1>&6
-echo "configure:46213: checking for IMAP support" >&5
+echo "configure:45193: checking for IMAP support" >&5
# Check whether --with-imap or --without-imap was given.
if test "${with_imap+set}" = set; then
withval="$with_imap"
@@ -46255,7 +45235,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking for IMAP Kerberos support""... $ac_c" 1>&6
-echo "configure:46259: checking for IMAP Kerberos support" >&5
+echo "configure:45239: checking for IMAP Kerberos support" >&5
# Check whether --with-kerberos or --without-kerberos was given.
if test "${with_kerberos+set}" = set; then
withval="$with_kerberos"
@@ -46280,7 +45260,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking for IMAP SSL support""... $ac_c" 1>&6
-echo "configure:46284: checking for IMAP SSL support" >&5
+echo "configure:45264: checking for IMAP SSL support" >&5
# Check whether --with-imap-ssl or --without-imap-ssl was given.
if test "${with_imap_ssl+set}" = set; then
withval="$with_imap_ssl"
@@ -46676,7 +45656,7 @@ EOF
done
cat > conftest.$ac_ext <<EOF
-#line 46680 "configure"
+#line 45660 "configure"
#include "confdefs.h"
#include <$IMAP_INC_DIR/mail.h>
EOF
@@ -46692,11 +45672,29 @@ EOF
fi
rm -f conftest*
+
+ cat > conftest.$ac_ext <<EOF
+#line 45678 "configure"
+#include "confdefs.h"
+#include <$IMAP_INC_DIR/mail.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "mail_append_set" >/dev/null 2>&1; then
+ rm -rf conftest*
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_NEW_MIME2TEXT 1
+EOF
+
+
+fi
+rm -f conftest*
+
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$IMAP_INC_DIR
cat > conftest.$ac_ext <<EOF
-#line 46700 "configure"
+#line 45698 "configure"
#include "confdefs.h"
#include "imap4r1.h"
@@ -46814,7 +45812,7 @@ rm -f conftest*
done
echo $ac_n "checking for pam_start in -lpam""... $ac_c" 1>&6
-echo "configure:46818: checking for pam_start in -lpam" >&5
+echo "configure:45816: checking for pam_start in -lpam" >&5
ac_lib_var=`echo pam'_'pam_start | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -46822,7 +45820,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpam $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 46826 "configure"
+#line 45824 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -46833,7 +45831,7 @@ int main() {
pam_start()
; return 0; }
EOF
-if { (eval echo configure:46837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:45835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -46987,7 +45985,7 @@ fi
done
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:46991: checking for crypt in -lcrypt" >&5
+echo "configure:45989: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -46995,7 +45993,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 46999 "configure"
+#line 45997 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -47006,7 +46004,7 @@ int main() {
crypt()
; return 0; }
EOF
-if { (eval echo configure:47010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:46008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -47209,7 +46207,7 @@ fi
# Extract the first word of "krb5-config", so it can be a program name with args.
set dummy krb5-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:47213: checking for $ac_word" >&5
+echo "configure:46211: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_KRB5_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -47576,7 +46574,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 47580 "configure"
+#line 46578 "configure"
#include "confdefs.h"
#include <$IMAP_INC_DIR/linkage.h>
EOF
@@ -47614,7 +46612,7 @@ rm -f conftest*
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:47618: checking for $ac_word" >&5
+echo "configure:46616: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -47818,9 +46816,9 @@ fi
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$OPENSSL_INCDIR
echo $ac_n "checking for OpenSSL version""... $ac_c" 1>&6
-echo "configure:47822: checking for OpenSSL version" >&5
+echo "configure:46820: checking for OpenSSL version" >&5
cat > conftest.$ac_ext <<EOF
-#line 47824 "configure"
+#line 46822 "configure"
#include "confdefs.h"
#include <openssl/opensslv.h>
@@ -47974,7 +46972,7 @@ rm -f conftest*
done
echo $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6
-echo "configure:47978: checking for CRYPTO_free in -lcrypto" >&5
+echo "configure:46976: checking for CRYPTO_free in -lcrypto" >&5
ac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -47982,7 +46980,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcrypto $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 47986 "configure"
+#line 46984 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -47993,7 +46991,7 @@ int main() {
CRYPTO_free()
; return 0; }
EOF
-if { (eval echo configure:47997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:46995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -48149,7 +47147,7 @@ fi
done
echo $ac_n "checking for SSL_CTX_set_ssl_version in -lssl""... $ac_c" 1>&6
-echo "configure:48153: checking for SSL_CTX_set_ssl_version in -lssl" >&5
+echo "configure:47151: checking for SSL_CTX_set_ssl_version in -lssl" >&5
ac_lib_var=`echo ssl'_'SSL_CTX_set_ssl_version | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -48157,7 +47155,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lssl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 48161 "configure"
+#line 47159 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -48168,7 +47166,7 @@ int main() {
SSL_CTX_set_ssl_version()
; return 0; }
EOF
-if { (eval echo configure:48172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:47170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -48286,7 +47284,7 @@ else
elif test -f "$IMAP_INC_DIR/linkage.c"; then
cat > conftest.$ac_ext <<EOF
-#line 48290 "configure"
+#line 47288 "configure"
#include "confdefs.h"
#include <$IMAP_INC_DIR/linkage.c>
EOF
@@ -48317,7 +47315,7 @@ rm -f conftest*
else
cat > conftest.$ac_ext <<EOF
-#line 48321 "configure"
+#line 47319 "configure"
#include "confdefs.h"
@@ -48344,7 +47342,7 @@ else
}
EOF
-if { (eval echo configure:48348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:47346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBS=$old_LIBS
@@ -48371,7 +47369,7 @@ fi
echo $ac_n "checking whether build with IMAP works""... $ac_c" 1>&6
-echo "configure:48375: checking whether build with IMAP works" >&5
+echo "configure:47373: checking whether build with IMAP works" >&5
old_LIBS=$LIBS
@@ -48382,7 +47380,7 @@ echo "configure:48375: checking whether build with IMAP works" >&5
else
cat > conftest.$ac_ext <<EOF
-#line 48386 "configure"
+#line 47384 "configure"
#include "confdefs.h"
@@ -48409,7 +47407,7 @@ else
}
EOF
-if { (eval echo configure:48413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:47411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBS=$old_LIBS
@@ -48440,7 +47438,7 @@ fi
echo $ac_n "checking for Informix support""... $ac_c" 1>&6
-echo "configure:48444: checking for Informix support" >&5
+echo "configure:47442: checking for Informix support" >&5
# Check whether --with-informix or --without-informix was given.
if test "${with_informix+set}" = set; then
withval="$with_informix"
@@ -48662,7 +47660,7 @@ if test "$PHP_INFORMIX" != "no"; then
esac
echo $ac_n "checking Informix version""... $ac_c" 1>&6
-echo "configure:48666: checking Informix version" >&5
+echo "configure:47664: checking Informix version" >&5
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'`
@@ -49053,7 +48051,7 @@ fi
echo $ac_n "checking for InterBase support""... $ac_c" 1>&6
-echo "configure:49057: checking for InterBase support" >&5
+echo "configure:48055: checking for InterBase support" >&5
# Check whether --with-interbase or --without-interbase was given.
if test "${with_interbase+set}" = set; then
withval="$with_interbase"
@@ -49202,7 +48200,7 @@ if test "$PHP_INTERBASE" != "no"; then
done
echo $ac_n "checking for isc_detach_database in -lfbclient""... $ac_c" 1>&6
-echo "configure:49206: checking for isc_detach_database in -lfbclient" >&5
+echo "configure:48204: checking for isc_detach_database in -lfbclient" >&5
ac_lib_var=`echo fbclient'_'isc_detach_database | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -49210,7 +48208,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lfbclient $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 49214 "configure"
+#line 48212 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -49221,7 +48219,7 @@ int main() {
isc_detach_database()
; return 0; }
EOF
-if { (eval echo configure:49225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:48223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -49347,7 +48345,7 @@ else
done
echo $ac_n "checking for isc_detach_database in -lgds""... $ac_c" 1>&6
-echo "configure:49351: checking for isc_detach_database in -lgds" >&5
+echo "configure:48349: checking for isc_detach_database in -lgds" >&5
ac_lib_var=`echo gds'_'isc_detach_database | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -49355,7 +48353,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgds $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 49359 "configure"
+#line 48357 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -49366,7 +48364,7 @@ int main() {
isc_detach_database()
; return 0; }
EOF
-if { (eval echo configure:49370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:48368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -49492,7 +48490,7 @@ else
done
echo $ac_n "checking for isc_detach_database in -lib_util""... $ac_c" 1>&6
-echo "configure:49496: checking for isc_detach_database in -lib_util" >&5
+echo "configure:48494: checking for isc_detach_database in -lib_util" >&5
ac_lib_var=`echo ib_util'_'isc_detach_database | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -49500,7 +48498,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lib_util $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 49504 "configure"
+#line 48502 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -49511,7 +48509,7 @@ int main() {
isc_detach_database()
; return 0; }
EOF
-if { (eval echo configure:49515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:48513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -49974,12 +48972,457 @@ fi
+echo $ac_n "checking whether to enable JavaScript Object Serialization support""... $ac_c" 1>&6
+echo "configure:48977: checking whether to enable JavaScript Object Serialization support" >&5
+# Check whether --enable-json or --disable-json was given.
+if test "${enable_json+set}" = set; then
+ enableval="$enable_json"
+ PHP_JSON=$enableval
+else
+
+ PHP_JSON=yes
+
+ if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
+ PHP_JSON=$PHP_ENABLE_ALL
+ fi
+
+fi
+
+
+
+ext_output="yes, shared"
+ext_shared=yes
+case $PHP_JSON in
+shared,*)
+ PHP_JSON=`echo "$PHP_JSON"|$SED 's/^shared,//'`
+ ;;
+shared)
+ PHP_JSON=yes
+ ;;
+no)
+ ext_output=no
+ ext_shared=no
+ ;;
+*)
+ ext_output=yes
+ ext_shared=no
+ ;;
+esac
+
+
+
+echo "$ac_t""$ext_output" 1>&6
+
+
+
+
+if test "$PHP_JSON" != "no"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_JSON 1
+EOF
+
+ echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:49026: 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 <<EOF
+#line 49031 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:49039: \"$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
+#line 49056 "configure"
+#include "confdefs.h"
+#include <string.h>
+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
+#line 49074 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+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 <<EOF
+#line 49095 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#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:49106: \"$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
+
+
+
+ ext_builddir=ext/json
+ ext_srcdir=$abs_srcdir/ext/json
+
+ ac_extra=
+
+ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then
+ PHP_JSON_SHARED=no
+
+
+ case ext/json in
+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/json"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/json/"; ac_bdir="ext/json/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ esac
+
+
+
+ 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
+ b_lo=$php_lo
+
+
+ old_IFS=$IFS
+ for ac_src in json.c utf8_to_utf16.c utf8_decode.c JSON_parser.c; do
+
+ IFS=.
+ set $ac_src
+ ac_obj=$1
+ IFS=$old_IFS
+
+ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"
+
+ case $ac_src in
+ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
+ esac
+
+ cat >>Makefile.objects<<EOF
+$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
+ $ac_comp
+EOF
+ done
+
+
+ EXT_STATIC="$EXT_STATIC json"
+ if test "$ext_shared" != "nocli"; then
+ EXT_CLI_STATIC="$EXT_CLI_STATIC json"
+ fi
+ else
+ if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then
+ PHP_JSON_SHARED=yes
+
+ case ext/json in
+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/json"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/json/"; ac_bdir="ext/json/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ esac
+
+
+
+ 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_lo=$shared_lo
+
+
+ old_IFS=$IFS
+ for ac_src in json.c utf8_to_utf16.c utf8_decode.c JSON_parser.c; do
+
+ IFS=.
+ set $ac_src
+ ac_obj=$1
+ IFS=$old_IFS
+
+ shared_objects_json="$shared_objects_json $ac_bdir$ac_obj.lo"
+
+ case $ac_src in
+ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
+ esac
+
+ cat >>Makefile.objects<<EOF
+$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
+ $ac_comp
+EOF
+ done
+
+ case $host_alias in
+ *netware*)
+
+ install_modules="install-modules"
+
+ case $host_alias in
+ *aix*)
+ suffix=so
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpjson.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_json) $(PHPJSON_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpjson.so '$ext_builddir'/phpjson.so'
+ ;;
+ *netware*)
+ suffix=nlm
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_json) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPJSON, 3)_SHARED_LIBADD)'
+ ;;
+ *)
+ suffix=la
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_json) $(PHPJSON_SHARED_LIBADD)'
+ ;;
+ esac
+
+ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpjson.$suffix"
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_json"
+
+ cat >>Makefile.objects<<EOF
+\$(phplibdir)/phpjson.$suffix: $ext_builddir/phpjson.$suffix
+ \$(LIBTOOL) --mode=install cp $ext_builddir/phpjson.$suffix \$(phplibdir)
+
+$ext_builddir/phpjson.$suffix: \$(shared_objects_json) \$(PHPJSON_SHARED_DEPENDENCIES)
+ $link_cmd
+
+EOF
+
+ ;;
+ *)
+
+ install_modules="install-modules"
+
+ case $host_alias in
+ *aix*)
+ suffix=so
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/json.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_json) $(JSON_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/json.so '$ext_builddir'/json.so'
+ ;;
+ *netware*)
+ suffix=nlm
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_json) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(JSON, 3)_SHARED_LIBADD)'
+ ;;
+ *)
+ suffix=la
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_json) $(JSON_SHARED_LIBADD)'
+ ;;
+ esac
+
+ PHP_MODULES="$PHP_MODULES \$(phplibdir)/json.$suffix"
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_json"
+
+ cat >>Makefile.objects<<EOF
+\$(phplibdir)/json.$suffix: $ext_builddir/json.$suffix
+ \$(LIBTOOL) --mode=install cp $ext_builddir/json.$suffix \$(phplibdir)
+
+$ext_builddir/json.$suffix: \$(shared_objects_json) \$(JSON_SHARED_DEPENDENCIES)
+ $link_cmd
+
+EOF
+
+ ;;
+ esac
+ cat >> confdefs.h <<EOF
+#define COMPILE_DL_JSON 1
+EOF
+
+ fi
+ fi
+
+ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
+ PHP_JSON_SHARED=no
+ if test "$PHP_SAPI" = "cgi"; then
+
+
+ case ext/json in
+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/json"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/json/"; ac_bdir="ext/json/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ esac
+
+
+
+ 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
+ b_lo=$php_lo
+
+
+ old_IFS=$IFS
+ for ac_src in json.c utf8_to_utf16.c utf8_decode.c JSON_parser.c; do
+
+ IFS=.
+ set $ac_src
+ ac_obj=$1
+ IFS=$old_IFS
+
+ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"
+
+ case $ac_src in
+ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
+ esac
+
+ cat >>Makefile.objects<<EOF
+$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
+ $ac_comp
+EOF
+ done
+
+
+ EXT_STATIC="$EXT_STATIC json"
+ else
+
+
+ case ext/json in
+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/json"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/json/"; ac_bdir="ext/json/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ esac
+
+
+
+ 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
+ b_lo=$php_lo
+
+
+ old_IFS=$IFS
+ for ac_src in json.c utf8_to_utf16.c utf8_decode.c JSON_parser.c; do
+
+ IFS=.
+ set $ac_src
+ ac_obj=$1
+ IFS=$old_IFS
+
+ PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"
+
+ case $ac_src in
+ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
+ esac
+
+ cat >>Makefile.objects<<EOF
+$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
+ $ac_comp
+EOF
+ done
+
+
+ fi
+ EXT_CLI_STATIC="$EXT_CLI_STATIC json"
+ fi
+
+
+ BUILD_DIR="$BUILD_DIR $ext_builddir"
+
+
+
+ if test "$ext_builddir" = "."; then
+ PHP_PECL_EXTENSION=json
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION"
+
+ fi
+
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST JSON_SHARED_LIBADD"
+
+fi
+
+# vim600: sts=2 sw=2 et
+
+
+
+
echo $ac_n "checking for LDAP support""... $ac_c" 1>&6
-echo "configure:49983: checking for LDAP support" >&5
+echo "configure:49426: checking for LDAP support" >&5
# Check whether --with-ldap or --without-ldap was given.
if test "${with_ldap+set}" = set; then
withval="$with_ldap"
@@ -50025,7 +49468,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking for LDAP Cyrus SASL support""... $ac_c" 1>&6
-echo "configure:50029: checking for LDAP Cyrus SASL support" >&5
+echo "configure:49472: checking for LDAP Cyrus SASL support" >&5
# Check whether --with-ldap-sasl or --without-ldap-sasl was given.
if test "${with_ldap_sasl+set}" = set; then
withval="$with_ldap_sasl"
@@ -50053,7 +49496,7 @@ if test "$PHP_LDAP" != "no"; then
ext_builddir=ext/ldap
ext_srcdir=$abs_srcdir/ext/ldap
- ac_extra=
+ ac_extra=`echo "-DLDAP_DEPRECATED=1"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g`
if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then
PHP_LDAP_SHARED=no
@@ -52340,19 +51783,19 @@ EOF
LDFLAGS="$LDFLAGS $LDAP_SHARED_LIBADD"
echo $ac_n "checking for 3 arg ldap_set_rebind_proc""... $ac_c" 1>&6
-echo "configure:52344: checking for 3 arg ldap_set_rebind_proc" >&5
+echo "configure:51787: checking for 3 arg ldap_set_rebind_proc" >&5
if eval "test \"`echo '$''{'ac_cv_3arg_setrebindproc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 52349 "configure"
+#line 51792 "configure"
#include "confdefs.h"
#include <ldap.h>
int main() {
ldap_set_rebind_proc(0,0,0)
; return 0; }
EOF
-if { (eval echo configure:52356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:51799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_3arg_setrebindproc=yes
else
@@ -52375,12 +51818,12 @@ EOF
for ac_func in ldap_parse_result ldap_parse_reference ldap_start_tls_s
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:52379: checking for $ac_func" >&5
+echo "configure:51822: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 52384 "configure"
+#line 51827 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -52403,7 +51846,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:52407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:51850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -52564,7 +52007,7 @@ EOF
done
echo $ac_n "checking for sasl_version in -lldap""... $ac_c" 1>&6
-echo "configure:52568: checking for sasl_version in -lldap" >&5
+echo "configure:52011: checking for sasl_version in -lldap" >&5
ac_lib_var=`echo ldap'_'sasl_version | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -52572,7 +52015,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lldap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 52576 "configure"
+#line 52019 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -52583,7 +52026,7 @@ int main() {
sasl_version()
; return 0; }
EOF
-if { (eval echo configure:52587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:52030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -52751,12 +52194,12 @@ fi
fi
echo $ac_n "checking for ldap_bind_s""... $ac_c" 1>&6
-echo "configure:52755: checking for ldap_bind_s" >&5
+echo "configure:52198: checking for ldap_bind_s" >&5
if eval "test \"`echo '$''{'ac_cv_func_ldap_bind_s'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 52760 "configure"
+#line 52203 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char ldap_bind_s(); below. */
@@ -52779,7 +52222,7 @@ ldap_bind_s();
; return 0; }
EOF
-if { (eval echo configure:52783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:52226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_ldap_bind_s=yes"
else
@@ -52829,7 +52272,7 @@ fi
echo $ac_n "checking whether to enable multibyte string support""... $ac_c" 1>&6
-echo "configure:52833: checking whether to enable multibyte string support" >&5
+echo "configure:52276: checking whether to enable multibyte string support" >&5
# Check whether --enable-mbstring or --disable-mbstring was given.
if test "${enable_mbstring+set}" = set; then
enableval="$enable_mbstring"
@@ -52875,7 +52318,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking whether to enable multibyte regex support""... $ac_c" 1>&6
-echo "configure:52879: checking whether to enable multibyte regex support" >&5
+echo "configure:52322: checking whether to enable multibyte regex support" >&5
# Check whether --enable-mbregex or --disable-mbregex was given.
if test "${enable_mbregex+set}" = set; then
enableval="$enable_mbregex"
@@ -52899,8 +52342,33 @@ echo "$ac_t""$ext_output" 1>&6
+echo $ac_n "checking whether to check multibyte regex backtrack""... $ac_c" 1>&6
+echo "configure:52347: checking whether to check multibyte regex backtrack" >&5
+# Check whether --enable-mbregex_backtrack or --disable-mbregex_backtrack was given.
+if test "${enable_mbregex_backtrack+set}" = set; then
+ enableval="$enable_mbregex_backtrack"
+ PHP_MBREGEX_BACKTRACK=$enableval
+else
+
+ PHP_MBREGEX_BACKTRACK=yes
+
+ if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
+ PHP_MBREGEX_BACKTRACK=$PHP_ENABLE_ALL
+ fi
+
+fi
+
+
+ext_output=$PHP_MBREGEX_BACKTRACK
+echo "$ac_t""$ext_output" 1>&6
+
+
+
+
+
+
echo $ac_n "checking for external libmbfl""... $ac_c" 1>&6
-echo "configure:52904: checking for external libmbfl" >&5
+echo "configure:52372: checking for external libmbfl" >&5
# Check whether --with-libmbfl or --without-libmbfl was given.
if test "${with_libmbfl+set}" = set; then
withval="$with_libmbfl"
@@ -52936,7 +52404,7 @@ EOF
if test "$PHP_MBREGEX" = "yes"; then
echo $ac_n "checking for variable length prototypes and stdarg.h""... $ac_c" 1>&6
-echo "configure:52940: checking for variable length prototypes and stdarg.h" >&5
+echo "configure:52408: checking for variable length prototypes and stdarg.h" >&5
if eval "test \"`echo '$''{'cv_php_mbstring_stdarg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -52955,7 +52423,7 @@ esac
else
cat > conftest.$ac_ext <<EOF
-#line 52959 "configure"
+#line 52427 "configure"
#include "confdefs.h"
#include <stdarg.h>
@@ -52970,7 +52438,7 @@ int foo(int x, ...) {
int main() { return foo(10, "", 3.14); }
EOF
-if { (eval echo configure:52974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:52442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
cv_php_mbstring_stdarg=yes
else
@@ -52991,17 +52459,17 @@ echo "$ac_t""$cv_php_mbstring_stdarg" 1>&6
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:52995: checking for $ac_hdr" >&5
+echo "configure:52463: 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
-#line 53000 "configure"
+#line 52468 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:53005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:52473: \"$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*
@@ -53028,7 +52496,7 @@ fi
done
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:53032: checking size of int" >&5
+echo "configure:52500: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -53036,7 +52504,7 @@ else
ac_cv_sizeof_int=4
else
cat > conftest.$ac_ext <<EOF
-#line 53040 "configure"
+#line 52508 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -53047,7 +52515,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:53051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:52519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
@@ -53067,7 +52535,7 @@ EOF
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:53071: checking size of short" >&5
+echo "configure:52539: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -53075,7 +52543,7 @@ else
ac_cv_sizeof_short=2
else
cat > conftest.$ac_ext <<EOF
-#line 53079 "configure"
+#line 52547 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -53086,7 +52554,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:53090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:52558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_short=`cat conftestval`
else
@@ -53106,7 +52574,7 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:53110: checking size of long" >&5
+echo "configure:52578: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -53114,7 +52582,7 @@ else
ac_cv_sizeof_long=4
else
cat > conftest.$ac_ext <<EOF
-#line 53118 "configure"
+#line 52586 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -53125,7 +52593,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:53129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:52597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
@@ -53145,12 +52613,12 @@ EOF
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:53149: checking for working const" >&5
+echo "configure:52617: 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 <<EOF
-#line 53154 "configure"
+#line 52622 "configure"
#include "confdefs.h"
int main() {
@@ -53199,7 +52667,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:53203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:52671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -53220,12 +52688,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:53224: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:52692: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 53229 "configure"
+#line 52697 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -53234,7 +52702,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:53238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:52706: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -53257,19 +52725,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:53261: checking for working alloca.h" >&5
+echo "configure:52729: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 53266 "configure"
+#line 52734 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:53273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:52741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -53290,12 +52758,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:53294: checking for alloca" >&5
+echo "configure:52762: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 53299 "configure"
+#line 52767 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -53323,7 +52791,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:53327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:52795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -53355,12 +52823,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:53359: checking whether alloca needs Cray hooks" >&5
+echo "configure:52827: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 53364 "configure"
+#line 52832 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -53385,12 +52853,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:53389: checking for $ac_func" >&5
+echo "configure:52857: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 53394 "configure"
+#line 52862 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -53413,7 +52881,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:53417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:52885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -53440,7 +52908,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:53444: checking stack direction for C alloca" >&5
+echo "configure:52912: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -53448,7 +52916,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 53452 "configure"
+#line 52920 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -53467,7 +52935,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:53471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:52939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -53489,7 +52957,7 @@ EOF
fi
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:53493: checking for 8-bit clean memcmp" >&5
+echo "configure:52961: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -53497,7 +52965,7 @@ else
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 53501 "configure"
+#line 52969 "configure"
#include "confdefs.h"
main()
@@ -53507,7 +52975,7 @@ main()
}
EOF
-if { (eval echo configure:53511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:52979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_memcmp_clean=yes
else
@@ -53536,6 +53004,14 @@ EOF
EOF
+
+ if test "$PHP_MBREGEX_BACKTRACK" != "no"; then
+ cat >> confdefs.h <<\EOF
+#define USE_COMBINATION_EXPLOSION_CHECK 1
+EOF
+
+ fi
+
PHP_MBSTRING_CFLAGS="$PHP_MBSTRING_CFLAGS -DNOT_RUBY"
@@ -53597,6 +53073,7 @@ EOF
oniguruma/enc/utf16_le.c
oniguruma/enc/utf32_be.c
oniguruma/enc/utf32_le.c
+ oniguruma/enc/gb18030.c
"
fi
@@ -53845,7 +53322,7 @@ EOF
done
echo $ac_n "checking for mbfl_buffer_converter_new in -lmbfl""... $ac_c" 1>&6
-echo "configure:53849: checking for mbfl_buffer_converter_new in -lmbfl" >&5
+echo "configure:53326: checking for mbfl_buffer_converter_new in -lmbfl" >&5
ac_lib_var=`echo mbfl'_'mbfl_buffer_converter_new | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -53853,7 +53330,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lmbfl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 53857 "configure"
+#line 53334 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -53864,7 +53341,7 @@ int main() {
mbfl_buffer_converter_new()
; return 0; }
EOF
-if { (eval echo configure:53868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:53345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -54457,7 +53934,7 @@ EOF
header_path=ext/mbstring
- for header_file in libmbfl/ libmbfl/mbfl; do
+ for header_file in mbstring.h php_mbregex.h libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h oniguruma/oniguruma.h oniguruma/php_onig_compat.h; do
hp_hf="$header_path/$header_file"
@@ -54485,7 +53962,7 @@ fi
echo $ac_n "checking for mcrypt support""... $ac_c" 1>&6
-echo "configure:54489: checking for mcrypt support" >&5
+echo "configure:53966: checking for mcrypt support" >&5
# Check whether --with-mcrypt or --without-mcrypt was given.
if test "${with_mcrypt+set}" = set; then
withval="$with_mcrypt"
@@ -54541,9 +54018,9 @@ if test "$PHP_MCRYPT" != "no"; then
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$MCRYPT_DIR/include
echo $ac_n "checking for libmcrypt version""... $ac_c" 1>&6
-echo "configure:54545: checking for libmcrypt version" >&5
+echo "configure:54022: checking for libmcrypt version" >&5
cat > conftest.$ac_ext <<EOF
-#line 54547 "configure"
+#line 54024 "configure"
#include "confdefs.h"
#include <mcrypt.h>
@@ -54666,7 +54143,7 @@ rm -f conftest*
done
echo $ac_n "checking for mcrypt_module_open in -lmcrypt""... $ac_c" 1>&6
-echo "configure:54670: checking for mcrypt_module_open in -lmcrypt" >&5
+echo "configure:54147: checking for mcrypt_module_open in -lmcrypt" >&5
ac_lib_var=`echo mcrypt'_'mcrypt_module_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -54674,7 +54151,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lmcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 54678 "configure"
+#line 54155 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -54685,7 +54162,7 @@ int main() {
mcrypt_module_open()
; return 0; }
EOF
-if { (eval echo configure:54689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:54166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -54837,7 +54314,7 @@ else
done
echo $ac_n "checking for mcrypt_module_open in -lmcrypt""... $ac_c" 1>&6
-echo "configure:54841: checking for mcrypt_module_open in -lmcrypt" >&5
+echo "configure:54318: checking for mcrypt_module_open in -lmcrypt" >&5
ac_lib_var=`echo mcrypt'_'mcrypt_module_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -54845,7 +54322,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lmcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 54849 "configure"
+#line 54326 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -54856,7 +54333,7 @@ int main() {
mcrypt_module_open()
; return 0; }
EOF
-if { (eval echo configure:54860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:54337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -55316,7 +54793,7 @@ fi
echo $ac_n "checking for mhash support""... $ac_c" 1>&6
-echo "configure:55320: checking for mhash support" >&5
+echo "configure:54797: checking for mhash support" >&5
# Check whether --with-mhash or --without-mhash was given.
if test "${with_mhash+set}" = set; then
withval="$with_mhash"
@@ -55790,7 +55267,7 @@ fi
echo $ac_n "checking whether to include mime_magic support""... $ac_c" 1>&6
-echo "configure:55794: checking whether to include mime_magic support" >&5
+echo "configure:55271: checking whether to include mime_magic support" >&5
# Check whether --with-mime-magic or --without-mime-magic was given.
if test "${with_mime_magic+set}" = set; then
withval="$with_mime_magic"
@@ -56147,7 +55624,7 @@ fi
echo $ac_n "checking for MING support""... $ac_c" 1>&6
-echo "configure:56151: checking for MING support" >&5
+echo "configure:55628: checking for MING support" >&5
# Check whether --with-ming or --without-ming was given.
if test "${with_ming+set}" = set; then
withval="$with_ming"
@@ -56192,7 +55669,7 @@ echo "$ac_t""$ext_output" 1>&6
if test "$PHP_MING" != "no"; then
echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:56196: checking for sin in -lm" >&5
+echo "configure:55673: checking for sin in -lm" >&5
ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -56200,7 +55677,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 56204 "configure"
+#line 55681 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -56211,7 +55688,7 @@ int main() {
sin()
; return 0; }
EOF
-if { (eval echo configure:56215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:55692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -56357,7 +55834,7 @@ fi
done
echo $ac_n "checking for Ming_useSWFVersion in -lming""... $ac_c" 1>&6
-echo "configure:56361: checking for Ming_useSWFVersion in -lming" >&5
+echo "configure:55838: checking for Ming_useSWFVersion in -lming" >&5
ac_lib_var=`echo ming'_'Ming_useSWFVersion | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -56365,7 +55842,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lming $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 56369 "configure"
+#line 55846 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -56376,7 +55853,7 @@ int main() {
Ming_useSWFVersion()
; return 0; }
EOF
-if { (eval echo configure:56380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:55857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -56637,7 +56114,7 @@ fi
done
echo $ac_n "checking for SWFPrebuiltClip in -lming""... $ac_c" 1>&6
-echo "configure:56641: checking for SWFPrebuiltClip in -lming" >&5
+echo "configure:56118: checking for SWFPrebuiltClip in -lming" >&5
ac_lib_var=`echo ming'_'SWFPrebuiltClip | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -56645,7 +56122,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lming $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 56649 "configure"
+#line 56126 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -56656,7 +56133,7 @@ int main() {
SWFPrebuiltClip()
; return 0; }
EOF
-if { (eval echo configure:56660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:56137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -56693,14 +56170,14 @@ fi
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$MING_INC_DIR
echo $ac_n "checking for destroySWFBlock""... $ac_c" 1>&6
-echo "configure:56697: checking for destroySWFBlock" >&5
+echo "configure:56174: checking for destroySWFBlock" >&5
if test "$cross_compiling" = yes; then
echo "$ac_t""unknown" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 56704 "configure"
+#line 56181 "configure"
#include "confdefs.h"
#include "ming.h"
@@ -56712,7 +56189,7 @@ int main() {
}
EOF
-if { (eval echo configure:56716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:56193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""missing" 1>&6
@@ -56734,7 +56211,7 @@ fi
cat > conftest.$ac_ext <<EOF
-#line 56738 "configure"
+#line 56215 "configure"
#include "confdefs.h"
#include <ming.h>
@@ -56761,7 +56238,7 @@ rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 56765 "configure"
+#line 56242 "configure"
#include "confdefs.h"
#include <ming.h>
@@ -56772,7 +56249,7 @@ int main(void) { SWFMovie_output(NULL, NULL, NULL, 0); return 0; }
; return 0; }
EOF
-if { (eval echo configure:56776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:56253: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
@@ -57079,7 +56556,7 @@ fi
echo $ac_n "checking for mSQL support""... $ac_c" 1>&6
-echo "configure:57083: checking for mSQL support" >&5
+echo "configure:56560: checking for mSQL support" >&5
# Check whether --with-msql or --without-msql was given.
if test "${with_msql+set}" = set; then
withval="$with_msql"
@@ -57547,11 +57024,11 @@ EOF
echo $ac_n "checking mSQL version""... $ac_c" 1>&6
-echo "configure:57551: checking mSQL version" >&5
+echo "configure:57028: checking mSQL version" >&5
ac_php_oldcppflags=$CPPFLAGS
CPPFLAGS="$INCLUDES $CPPFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 57555 "configure"
+#line 57032 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include "msql.h"
@@ -57559,7 +57036,7 @@ int main() {
int i = IDX_TYPE
; return 0; }
EOF
-if { (eval echo configure:57563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:57040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
@@ -57590,7 +57067,7 @@ rm -f conftest*
echo $ac_n "checking for MSSQL support via FreeTDS""... $ac_c" 1>&6
-echo "configure:57594: checking for MSSQL support via FreeTDS" >&5
+echo "configure:57071: checking for MSSQL support via FreeTDS" >&5
# Check whether --with-mssql or --without-mssql was given.
if test "${with_mssql+set}" = set; then
withval="$with_mssql"
@@ -58079,7 +57556,7 @@ EOF
fi
echo $ac_n "checking for dnet_addr in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:58083: checking for dnet_addr in -ldnet_stub" >&5
+echo "configure:57560: checking for dnet_addr in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_addr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -58087,7 +57564,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 58091 "configure"
+#line 57568 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -58098,7 +57575,7 @@ int main() {
dnet_addr()
; return 0; }
EOF
-if { (eval echo configure:58102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:57579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -58240,7 +57717,7 @@ fi
echo $ac_n "checking for MySQL support""... $ac_c" 1>&6
-echo "configure:58244: checking for MySQL support" >&5
+echo "configure:57721: checking for MySQL support" >&5
# Check whether --with-mysql or --without-mysql was given.
if test "${with_mysql+set}" = set; then
withval="$with_mysql"
@@ -58286,7 +57763,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking for specified location of the MySQL UNIX socket""... $ac_c" 1>&6
-echo "configure:58290: checking for specified location of the MySQL UNIX socket" >&5
+echo "configure:57767: checking for specified location of the MySQL UNIX socket" >&5
# Check whether --with-mysql-sock or --without-mysql-sock was given.
if test "${with_mysql_sock+set}" = set; then
withval="$with_mysql_sock"
@@ -58312,7 +57789,7 @@ if test -z "$PHP_ZLIB_DIR"; then
echo $ac_n "checking for the location of libz""... $ac_c" 1>&6
-echo "configure:58316: checking for the location of libz" >&5
+echo "configure:57793: checking for the location of libz" >&5
# Check whether --with-zlib-dir or --without-zlib-dir was given.
if test "${with_zlib_dir+set}" = set; then
withval="$with_zlib_dir"
@@ -58343,7 +57820,7 @@ EOF
echo $ac_n "checking for MySQL UNIX socket location""... $ac_c" 1>&6
-echo "configure:58347: checking for MySQL UNIX socket location" >&5
+echo "configure:57824: checking for MySQL UNIX socket location" >&5
if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then
MYSQL_SOCK=$PHP_MYSQL_SOCK
cat >> confdefs.h <<EOF
@@ -58404,7 +57881,11 @@ EOF
Note that the MySQL client library is not bundled anymore!" 1>&2; exit 1; }
fi
- MYSQL_LIBNAME=mysqlclient
+ if test "$enable_maintainer_zts" = "yes"; then
+ MYSQL_LIBNAME=mysqlclient_r
+ else
+ MYSQL_LIBNAME=mysqlclient
+ fi
case $host_alias in
*netware*)
MYSQL_LIBNAME=mysql
@@ -58529,7 +58010,7 @@ Note that the MySQL client library is not bundled anymore!" 1>&2; exit 1; }
done
echo $ac_n "checking for mysql_close in -l$MYSQL_LIBNAME""... $ac_c" 1>&6
-echo "configure:58533: checking for mysql_close in -l$MYSQL_LIBNAME" >&5
+echo "configure:58014: checking for mysql_close in -l$MYSQL_LIBNAME" >&5
ac_lib_var=`echo $MYSQL_LIBNAME'_'mysql_close | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -58537,7 +58018,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$MYSQL_LIBNAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 58541 "configure"
+#line 58022 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -58548,7 +58029,7 @@ int main() {
mysql_close()
; return 0; }
EOF
-if { (eval echo configure:58552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:58033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -58769,7 +58250,7 @@ else
done
echo $ac_n "checking for mysql_error in -l$MYSQL_LIBNAME""... $ac_c" 1>&6
-echo "configure:58773: checking for mysql_error in -l$MYSQL_LIBNAME" >&5
+echo "configure:58254: checking for mysql_error in -l$MYSQL_LIBNAME" >&5
ac_lib_var=`echo $MYSQL_LIBNAME'_'mysql_error | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -58777,7 +58258,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$MYSQL_LIBNAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 58781 "configure"
+#line 58262 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -58788,7 +58269,7 @@ int main() {
mysql_error()
; return 0; }
EOF
-if { (eval echo configure:58792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:58273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -58942,7 +58423,7 @@ fi
done
echo $ac_n "checking for mysql_errno in -l$MYSQL_LIBNAME""... $ac_c" 1>&6
-echo "configure:58946: checking for mysql_errno in -l$MYSQL_LIBNAME" >&5
+echo "configure:58427: checking for mysql_errno in -l$MYSQL_LIBNAME" >&5
ac_lib_var=`echo $MYSQL_LIBNAME'_'mysql_errno | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -58950,7 +58431,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$MYSQL_LIBNAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 58954 "configure"
+#line 58435 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -58961,7 +58442,7 @@ int main() {
mysql_errno()
; return 0; }
EOF
-if { (eval echo configure:58965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:58446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -59441,7 +58922,7 @@ fi
echo $ac_n "checking for MySQLi support""... $ac_c" 1>&6
-echo "configure:59445: checking for MySQLi support" >&5
+echo "configure:58926: checking for MySQLi support" >&5
# Check whether --with-mysqli or --without-mysqli was given.
if test "${with_mysqli+set}" = set; then
withval="$with_mysqli"
@@ -59487,7 +58968,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking whether to enable embedded MySQLi support""... $ac_c" 1>&6
-echo "configure:59491: checking whether to enable embedded MySQLi support" >&5
+echo "configure:58972: checking whether to enable embedded MySQLi support" >&5
# Check whether --enable-embedded_mysqli or --disable-embedded_mysqli was given.
if test "${enable_embedded_mysqli+set}" = set; then
enableval="$enable_embedded_mysqli"
@@ -59518,12 +58999,16 @@ if test "$PHP_MYSQLI" != "no"; then
MYSQL_CONFIG=$PHP_MYSQLI
fi
+ MYSQL_LIB_NAME='mysqlclient'
if test "$PHP_EMBEDDED_MYSQLI" = "yes"; then
cat >> confdefs.h <<\EOF
#define HAVE_EMBEDDED_MYSQLI 1
EOF
MYSQL_LIB_CFG='--libmysqld-libs'
+ elif test "$enable_maintainer_zts" = "yes"; then
+ MYSQL_LIB_CFG='--libs_r'
+ MYSQL_LIB_NAME='mysqlclient_r'
else
MYSQL_LIB_CFG='--libs'
fi
@@ -59632,16 +59117,16 @@ EOF
esac
done
- echo $ac_n "checking for mysql_set_server_option in -lmysqlclient""... $ac_c" 1>&6
-echo "configure:59637: checking for mysql_set_server_option in -lmysqlclient" >&5
-ac_lib_var=`echo mysqlclient'_'mysql_set_server_option | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for mysql_set_server_option in -l$MYSQL_LIB_NAME""... $ac_c" 1>&6
+echo "configure:59122: checking for mysql_set_server_option in -l$MYSQL_LIB_NAME" >&5
+ac_lib_var=`echo $MYSQL_LIB_NAME'_'mysql_set_server_option | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lmysqlclient $LIBS"
+LIBS="-l$MYSQL_LIB_NAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 59645 "configure"
+#line 59130 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -59652,7 +59137,7 @@ int main() {
mysql_set_server_option()
; return 0; }
EOF
-if { (eval echo configure:59656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:59141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -59897,16 +59382,16 @@ EOF
esac
done
- echo $ac_n "checking for mysql_stmt_field_count in -lmysqlclient""... $ac_c" 1>&6
-echo "configure:59902: checking for mysql_stmt_field_count in -lmysqlclient" >&5
-ac_lib_var=`echo mysqlclient'_'mysql_stmt_field_count | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for mysql_stmt_field_count in -l$MYSQL_LIB_NAME""... $ac_c" 1>&6
+echo "configure:59387: checking for mysql_stmt_field_count in -l$MYSQL_LIB_NAME" >&5
+ac_lib_var=`echo $MYSQL_LIB_NAME'_'mysql_stmt_field_count | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lmysqlclient $LIBS"
+LIBS="-l$MYSQL_LIB_NAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 59910 "configure"
+#line 59395 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -59917,7 +59402,7 @@ int main() {
mysql_stmt_field_count()
; return 0; }
EOF
-if { (eval echo configure:59921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:59406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -59942,7 +59427,7 @@ else
LDFLAGS=$save_old_LDFLAGS
ext_shared=$save_ext_shared
- unset ac_cv_lib_mysqlclient_mysql_stmt_field_count
+ unset ac_cv_lib_$MYSQL_LIB_NAME_mysql_stmt_field_count
{ echo "configure: 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." 1>&2; exit 1; }
@@ -59956,7 +59441,7 @@ else
LDFLAGS=$save_old_LDFLAGS
ext_shared=$save_ext_shared
- unset ac_cv_lib_mysqlclient_mysql_set_server_option
+ unset ac_cv_lib_$MYSQL_LIB_NAME_mysql_set_server_option
{ echo "configure: error: wrong mysql library version or lib not found. Check config.log for more information." 1>&2; exit 1; }
@@ -60254,7 +59739,7 @@ fi
echo $ac_n "checking for ncurses support""... $ac_c" 1>&6
-echo "configure:60258: checking for ncurses support" >&5
+echo "configure:59743: checking for ncurses support" >&5
# Check whether --with-ncurses or --without-ncurses was given.
if test "${with_ncurses+set}" = set; then
withval="$with_ncurses"
@@ -60460,7 +59945,7 @@ EOF
done
echo $ac_n "checking for $LIBSYMBOL in -l$LIBNAME""... $ac_c" 1>&6
-echo "configure:60464: checking for $LIBSYMBOL in -l$LIBNAME" >&5
+echo "configure:59949: checking for $LIBSYMBOL in -l$LIBNAME" >&5
ac_lib_var=`echo $LIBNAME'_'$LIBSYMBOL | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -60468,7 +59953,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$LIBNAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 60472 "configure"
+#line 59957 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -60479,7 +59964,7 @@ int main() {
$LIBSYMBOL()
; return 0; }
EOF
-if { (eval echo configure:60483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:59968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -60696,7 +60181,7 @@ EOF
done
echo $ac_n "checking for new_panel in -lpanel""... $ac_c" 1>&6
-echo "configure:60700: checking for new_panel in -lpanel" >&5
+echo "configure:60185: checking for new_panel in -lpanel" >&5
ac_lib_var=`echo panel'_'new_panel | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -60704,7 +60189,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpanel $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 60708 "configure"
+#line 60193 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -60715,7 +60200,7 @@ int main() {
new_panel()
; return 0; }
EOF
-if { (eval echo configure:60719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:60204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -60862,7 +60347,7 @@ fi
echo $ac_n "checking for color_set in -l$LIBNAME""... $ac_c" 1>&6
-echo "configure:60866: checking for color_set in -l$LIBNAME" >&5
+echo "configure:60351: checking for color_set in -l$LIBNAME" >&5
ac_lib_var=`echo $LIBNAME'_'color_set | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -60870,7 +60355,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$LIBNAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 60874 "configure"
+#line 60359 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -60881,7 +60366,7 @@ int main() {
color_set()
; return 0; }
EOF
-if { (eval echo configure:60885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:60370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -60905,7 +60390,7 @@ else
fi
echo $ac_n "checking for slk_color in -l$LIBNAME""... $ac_c" 1>&6
-echo "configure:60909: checking for slk_color in -l$LIBNAME" >&5
+echo "configure:60394: checking for slk_color in -l$LIBNAME" >&5
ac_lib_var=`echo $LIBNAME'_'slk_color | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -60913,7 +60398,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$LIBNAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 60917 "configure"
+#line 60402 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -60924,7 +60409,7 @@ int main() {
slk_color()
; return 0; }
EOF
-if { (eval echo configure:60928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:60413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -60948,7 +60433,7 @@ else
fi
echo $ac_n "checking for assume_default_colors in -l$LIBNAME""... $ac_c" 1>&6
-echo "configure:60952: checking for assume_default_colors in -l$LIBNAME" >&5
+echo "configure:60437: checking for assume_default_colors in -l$LIBNAME" >&5
ac_lib_var=`echo $LIBNAME'_'assume_default_colors | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -60956,7 +60441,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$LIBNAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 60960 "configure"
+#line 60445 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -60967,7 +60452,7 @@ int main() {
assume_default_colors()
; return 0; }
EOF
-if { (eval echo configure:60971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:60456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -60991,7 +60476,7 @@ else
fi
echo $ac_n "checking for use_extended_names in -l$LIBNAME""... $ac_c" 1>&6
-echo "configure:60995: checking for use_extended_names in -l$LIBNAME" >&5
+echo "configure:60480: checking for use_extended_names in -l$LIBNAME" >&5
ac_lib_var=`echo $LIBNAME'_'use_extended_names | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -60999,7 +60484,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$LIBNAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 61003 "configure"
+#line 60488 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -61010,7 +60495,7 @@ int main() {
use_extended_names()
; return 0; }
EOF
-if { (eval echo configure:61014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:60499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -61341,7 +60826,7 @@ fi
echo $ac_n "checking for Oracle (OCI8) support""... $ac_c" 1>&6
-echo "configure:61345: checking for Oracle (OCI8) support" >&5
+echo "configure:60830: checking for Oracle (OCI8) support" >&5
# Check whether --with-oci8 or --without-oci8 was given.
if test "${with_oci8+set}" = set; then
withval="$with_oci8"
@@ -61384,6 +60869,36 @@ echo "$ac_t""$ext_output" 1>&6
+ echo $ac_n "checking checking PHP version""... $ac_c" 1>&6
+echo "configure:60874: checking checking PHP version" >&5
+
+ tmp_version=$PHP_VERSION
+ if test -z "$tmp_version"; then
+ if test -z "$PHP_CONFIG"; then
+ { echo "configure: error: php-config not found" 1>&2; exit 1; }
+ fi
+ php_version=`$PHP_CONFIG --version 2>/dev/null|head -n 1|sed -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'`
+ else
+ php_version=`echo "$tmp_version"|sed -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'`
+ fi
+
+ if test -z "$php_version"; then
+ { echo "configure: error: failed to detect PHP version, please report" 1>&2; exit 1; }
+ fi
+
+ ac_IFS=$IFS
+ IFS="."
+ set $php_version
+ IFS=$ac_IFS
+ oci8_php_version=`expr $1 \* 1000000 + $2 \* 1000 + $3`
+
+ if test "$oci8_php_version" -le "4003010"; then
+ { echo "configure: error: You need at least PHP 4.3.10 to be able to use this version of OCI8. PHP $php_version found" 1>&2; exit 1; }
+ else
+ echo "$ac_t""$php_version, ok" 1>&6
+ fi
+
+
PHP_OCI8_INSTANT_CLIENT="no"
if test "`echo $PHP_OCI8 | cut -d, -f2`" = "instantclient"; then
@@ -61403,7 +60918,7 @@ fi
if test "$PHP_OCI8" != "no" && test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then
echo $ac_n "checking Oracle Install Directory""... $ac_c" 1>&6
-echo "configure:61407: checking Oracle Install Directory" >&5
+echo "configure:60922: checking Oracle Install Directory" >&5
if test "$PHP_OCI8" = "yes"; then
OCI8_DIR=$ORACLE_HOME
else
@@ -61413,7 +60928,7 @@ echo "configure:61407: checking Oracle Install Directory" >&5
echo $ac_n "checking size of long int""... $ac_c" 1>&6
-echo "configure:61417: checking size of long int" >&5
+echo "configure:60932: checking size of long int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -61421,7 +60936,7 @@ else
ac_cv_sizeof_long_int=4
else
cat > conftest.$ac_ext <<EOF
-#line 61425 "configure"
+#line 60940 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -61432,7 +60947,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:61436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:60951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_int=`cat conftestval`
else
@@ -61452,7 +60967,7 @@ EOF
echo $ac_n "checking checking if we're at 64-bit platform""... $ac_c" 1>&6
-echo "configure:61456: checking checking if we're at 64-bit platform" >&5
+echo "configure:60971: checking checking if we're at 64-bit platform" >&5
if test "$ac_cv_sizeof_long_int" = "4" ; then
echo "$ac_t""no" 1>&6
TMP_OCI8_LIB_DIR=lib32
@@ -61462,7 +60977,7 @@ echo "configure:61456: checking checking if we're at 64-bit platform" >&5
fi
echo $ac_n "checking OCI8 libraries dir""... $ac_c" 1>&6
-echo "configure:61466: checking OCI8 libraries dir" >&5
+echo "configure:60981: checking OCI8 libraries dir" >&5
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
@@ -61794,7 +61309,7 @@ echo "configure:61466: checking OCI8 libraries dir" >&5
echo $ac_n "checking Oracle version""... $ac_c" 1>&6
-echo "configure:61798: checking Oracle version" >&5
+echo "configure:61313: checking Oracle version" >&5
if test -s "$OCI8_DIR/orainst/unix.rgs"; then
OCI8_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/ */:/g' | cut -d: -f 6 | cut -c 2-4`
test -z "$OCI8_VERSION" && OCI8_VERSION=7.3
@@ -62302,7 +61817,7 @@ echo "configure:61798: checking Oracle version" >&5
done
echo $ac_n "checking for OCIEnvCreate in -lclntsh""... $ac_c" 1>&6
-echo "configure:62306: checking for OCIEnvCreate in -lclntsh" >&5
+echo "configure:61821: checking for OCIEnvCreate in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCIEnvCreate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -62310,7 +61825,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 62314 "configure"
+#line 61829 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -62321,7 +61836,7 @@ int main() {
OCIEnvCreate()
; return 0; }
EOF
-if { (eval echo configure:62325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:61840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -62454,7 +61969,7 @@ fi
done
echo $ac_n "checking for OCIStmtPrepare2 in -lclntsh""... $ac_c" 1>&6
-echo "configure:62458: checking for OCIStmtPrepare2 in -lclntsh" >&5
+echo "configure:61973: checking for OCIStmtPrepare2 in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCIStmtPrepare2 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -62462,7 +61977,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 62466 "configure"
+#line 61981 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -62473,7 +61988,7 @@ int main() {
OCIStmtPrepare2()
; return 0; }
EOF
-if { (eval echo configure:62477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:61992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -62669,7 +62184,7 @@ fi
done
echo $ac_n "checking for OCIEnvCreate in -lclntsh""... $ac_c" 1>&6
-echo "configure:62673: checking for OCIEnvCreate in -lclntsh" >&5
+echo "configure:62188: checking for OCIEnvCreate in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCIEnvCreate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -62677,7 +62192,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 62681 "configure"
+#line 62196 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -62688,7 +62203,7 @@ int main() {
OCIEnvCreate()
; return 0; }
EOF
-if { (eval echo configure:62692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:62207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -62821,7 +62336,7 @@ fi
done
echo $ac_n "checking for OCIStmtPrepare2 in -lclntsh""... $ac_c" 1>&6
-echo "configure:62825: checking for OCIStmtPrepare2 in -lclntsh" >&5
+echo "configure:62340: checking for OCIStmtPrepare2 in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCIStmtPrepare2 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -62829,7 +62344,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 62833 "configure"
+#line 62348 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -62840,7 +62355,7 @@ int main() {
OCIStmtPrepare2()
; return 0; }
EOF
-if { (eval echo configure:62844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:62359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -62880,7 +62395,7 @@ fi
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=$OCI8_INCLUDES
cat > conftest.$ac_ext <<EOF
-#line 62884 "configure"
+#line 62399 "configure"
#include "confdefs.h"
#include <oci.h>
@@ -63073,7 +62588,7 @@ EOF
done
echo $ac_n "checking for OCIEnvNlsCreate in -lclntsh""... $ac_c" 1>&6
-echo "configure:63077: checking for OCIEnvNlsCreate in -lclntsh" >&5
+echo "configure:62592: checking for OCIEnvNlsCreate in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCIEnvNlsCreate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -63081,7 +62596,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 63085 "configure"
+#line 62600 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -63092,7 +62607,7 @@ int main() {
OCIEnvNlsCreate()
; return 0; }
EOF
-if { (eval echo configure:63096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:62611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -63208,7 +62723,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
done
echo $ac_n "checking for OCINlsCharSetNameToId in -lclntsh""... $ac_c" 1>&6
-echo "configure:63212: checking for OCINlsCharSetNameToId in -lclntsh" >&5
+echo "configure:62727: checking for OCINlsCharSetNameToId in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCINlsCharSetNameToId | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -63216,7 +62731,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 63220 "configure"
+#line 62735 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -63227,7 +62742,7 @@ int main() {
OCINlsCharSetNameToId()
; return 0; }
EOF
-if { (eval echo configure:63231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:62746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -63373,7 +62888,7 @@ fi
done
echo $ac_n "checking for OCIEnvCreate in -lclntsh""... $ac_c" 1>&6
-echo "configure:63377: checking for OCIEnvCreate in -lclntsh" >&5
+echo "configure:62892: checking for OCIEnvCreate in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCIEnvCreate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -63381,7 +62896,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 63385 "configure"
+#line 62900 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -63392,7 +62907,7 @@ int main() {
OCIEnvCreate()
; return 0; }
EOF
-if { (eval echo configure:63396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:62911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -63525,7 +63040,7 @@ fi
done
echo $ac_n "checking for OCIStmtPrepare2 in -lclntsh""... $ac_c" 1>&6
-echo "configure:63529: checking for OCIStmtPrepare2 in -lclntsh" >&5
+echo "configure:63044: checking for OCIStmtPrepare2 in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCIStmtPrepare2 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -63533,7 +63048,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 63537 "configure"
+#line 63052 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -63544,7 +63059,7 @@ int main() {
OCIStmtPrepare2()
; return 0; }
EOF
-if { (eval echo configure:63548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:63063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -63677,7 +63192,7 @@ fi
done
echo $ac_n "checking for OCILobRead2 in -lclntsh""... $ac_c" 1>&6
-echo "configure:63681: checking for OCILobRead2 in -lclntsh" >&5
+echo "configure:63196: checking for OCILobRead2 in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCILobRead2 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -63685,7 +63200,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 63689 "configure"
+#line 63204 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -63696,7 +63211,7 @@ int main() {
OCILobRead2()
; return 0; }
EOF
-if { (eval echo configure:63700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:63215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -63926,7 +63441,7 @@ EOF
done
echo $ac_n "checking for OCILobIsTemporary in -lclntsh""... $ac_c" 1>&6
-echo "configure:63930: checking for OCILobIsTemporary in -lclntsh" >&5
+echo "configure:63445: checking for OCILobIsTemporary in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCILobIsTemporary | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -63934,7 +63449,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 63938 "configure"
+#line 63453 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -63945,7 +63460,7 @@ int main() {
OCILobIsTemporary()
; return 0; }
EOF
-if { (eval echo configure:63949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:63464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -64074,7 +63589,7 @@ else
done
echo $ac_n "checking for OCILobIsTemporary in -locijdbc8""... $ac_c" 1>&6
-echo "configure:64078: checking for OCILobIsTemporary in -locijdbc8" >&5
+echo "configure:63593: checking for OCILobIsTemporary in -locijdbc8" >&5
ac_lib_var=`echo ocijdbc8'_'OCILobIsTemporary | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -64082,7 +63597,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-locijdbc8 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 64086 "configure"
+#line 63601 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -64093,7 +63608,7 @@ int main() {
OCILobIsTemporary()
; return 0; }
EOF
-if { (eval echo configure:64097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:63612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -64253,7 +63768,7 @@ fi
done
echo $ac_n "checking for OCICollAssign in -lclntsh""... $ac_c" 1>&6
-echo "configure:64257: checking for OCICollAssign in -lclntsh" >&5
+echo "configure:63772: checking for OCICollAssign in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCICollAssign | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -64261,7 +63776,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 64265 "configure"
+#line 63780 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -64272,7 +63787,7 @@ int main() {
OCICollAssign()
; return 0; }
EOF
-if { (eval echo configure:64276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:63791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -64898,7 +64413,7 @@ EOF
elif test "$PHP_OCI8" != "no" && test "$PHP_OCI8_INSTANT_CLIENT" != "no"; then
echo $ac_n "checking Oracle Instant Client directory""... $ac_c" 1>&6
-echo "configure:64902: checking Oracle Instant Client directory" >&5
+echo "configure:64417: checking Oracle Instant Client directory" >&5
if test "$PHP_OCI8_INSTANT_CLIENT" = "yes"; then
PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client/lib 2> /dev/null | tail -1`
if test -z "$PHP_OCI8_INSTANT_CLIENT"; then
@@ -64910,13 +64425,13 @@ echo "configure:64902: checking Oracle Instant Client directory" >&5
OCI8_DIR=$PHP_OCI8_INSTANT_CLIENT
echo $ac_n "checking Oracle Instant Client SDK header directory""... $ac_c" 1>&6
-echo "configure:64914: checking Oracle Instant Client SDK header directory" >&5
+echo "configure:64429: checking Oracle Instant Client SDK header directory" >&5
- OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!^/usr/lib/oracle/\(.*\)/client/lib[/]*$!/usr/include/oracle/\1/client!'`
+ OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!^/usr/lib/oracle/\(.*\)/client/lib/*$!/usr/include/oracle/\1/client!'`
OCISDKZIPINC=$PHP_OCI8_INSTANT_CLIENT/sdk/include
- OCISDKMANINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!\(.*\)/lib[/]*$!\1/include!'`
+ OCISDKMANINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!\(.*\)/lib/*$!\1/include!'`
if test -f "$OCISDKRPMINC/oci.h"; then
echo "$ac_t""$OCISDKRPMINC" 1>&6
@@ -65118,8 +64633,8 @@ echo "configure:64914: checking Oracle Instant Client SDK header directory" >&5
echo $ac_n "checking Oracle Instant Client version""... $ac_c" 1>&6
-echo "configure:65122: checking Oracle Instant Client version" >&5
- if test -f $PHP_OCI8_INSTANT_CLIENT/libociei.$SHLIB_SUFFIX_NAME; then
+echo "configure:64637: checking Oracle Instant Client version" >&5
+ if test -f $PHP_OCI8_INSTANT_CLIENT/libnnz10.$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
{ echo "configure: error: Link from $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME to libclntsh.$SHLIB_SUFFIX_NAME.10.1 not found" 1>&2; exit 1; }
@@ -65555,7 +65070,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for Adabas support""... $ac_c" 1>&6
-echo "configure:65559: checking for Adabas support" >&5
+echo "configure:65074: checking for Adabas support" >&5
# Check whether --with-adabas or --without-adabas was given.
if test "${with_adabas+set}" = set; then
withval="$with_adabas"
@@ -65753,7 +65268,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for SAP DB support""... $ac_c" 1>&6
-echo "configure:65757: checking for SAP DB support" >&5
+echo "configure:65272: checking for SAP DB support" >&5
# Check whether --with-sapdb or --without-sapdb was given.
if test "${with_sapdb+set}" = set; then
withval="$with_sapdb"
@@ -65883,7 +65398,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for Solid support""... $ac_c" 1>&6
-echo "configure:65887: checking for Solid support" >&5
+echo "configure:65402: checking for Solid support" >&5
# Check whether --with-solid or --without-solid was given.
if test "${with_solid+set}" = set; then
withval="$with_solid"
@@ -65941,7 +65456,7 @@ EOF
echo "$ac_t""yes" 1>&6
echo $ac_n "checking Solid library file""... $ac_c" 1>&6
-echo "configure:65945: checking Solid library file" >&5
+echo "configure:65460: checking Solid library file" >&5
ac_solid_uname_r=`uname -r 2>/dev/null`
ac_solid_uname_s=`uname -s 2>/dev/null`
case $ac_solid_uname_s in
@@ -66027,7 +65542,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for IBM DB2 support""... $ac_c" 1>&6
-echo "configure:66031: checking for IBM DB2 support" >&5
+echo "configure:65546: checking for IBM DB2 support" >&5
# Check whether --with-ibm-db2 or --without-ibm-db2 was given.
if test "${with_ibm_db2+set}" = set; then
withval="$with_ibm_db2"
@@ -66089,7 +65604,7 @@ fi
else
cat > conftest.$ac_ext <<EOF
-#line 66093 "configure"
+#line 65608 "configure"
#include "confdefs.h"
@@ -66100,7 +65615,7 @@ else
}
EOF
-if { (eval echo configure:66104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:65619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBS=$old_LIBS
@@ -66146,7 +65661,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for ODBCRouter.com support""... $ac_c" 1>&6
-echo "configure:66150: checking for ODBCRouter.com support" >&5
+echo "configure:65665: checking for ODBCRouter.com support" >&5
# Check whether --with-ODBCRouter or --without-ODBCRouter was given.
if test "${with_ODBCRouter+set}" = set; then
withval="$with_ODBCRouter"
@@ -66206,7 +65721,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for Empress support""... $ac_c" 1>&6
-echo "configure:66210: checking for Empress support" >&5
+echo "configure:65725: checking for Empress support" >&5
# Check whether --with-empress or --without-empress was given.
if test "${with_empress+set}" = set; then
withval="$with_empress"
@@ -66255,7 +65770,7 @@ EOF
echo "$ac_t""yes" 1>&6
echo $ac_n "checking Empress library file""... $ac_c" 1>&6
-echo "configure:66259: checking Empress library file" >&5
+echo "configure:65774: checking Empress library file" >&5
ODBC_LIBS=`echo $ODBC_LIBDIR/libempodbccl.so | cut -d' ' -f1`
if test ! -f $ODBC_LIBS; then
ODBC_LIBS=`echo $ODBC_LIBDIR/libempodbccl.so | cut -d' ' -f1`
@@ -66276,7 +65791,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for Empress local access support""... $ac_c" 1>&6
-echo "configure:66280: checking for Empress local access support" >&5
+echo "configure:65795: checking for Empress local access support" >&5
# Check whether --with-empress-bcs or --without-empress-bcs was given.
if test "${with_empress_bcs+set}" = set; then
withval="$with_empress_bcs"
@@ -66341,7 +65856,7 @@ EOF
echo "$ac_t""yes" 1>&6
echo $ac_n "checking Empress local access library file""... $ac_c" 1>&6
-echo "configure:66345: checking Empress local access library file" >&5
+echo "configure:65860: checking Empress local access library file" >&5
ODBCBCS_LIBS=`echo $ODBC_LIBDIR/libempodbcbcs.a | cut -d' ' -f1`
if test ! -f $ODBCBCS_LIBS; then
ODBCBCS_LIBS=`echo $ODBC_LIBDIR/libempodbcbcs.a | cut -d' ' -f1`
@@ -66362,7 +65877,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for Birdstep support""... $ac_c" 1>&6
-echo "configure:66366: checking for Birdstep support" >&5
+echo "configure:65881: checking for Birdstep support" >&5
# Check whether --with-birdstep or --without-birdstep was given.
if test "${with_birdstep+set}" = set; then
withval="$with_birdstep"
@@ -66472,7 +65987,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for a custom ODBC support""... $ac_c" 1>&6
-echo "configure:66476: checking for a custom ODBC support" >&5
+echo "configure:65991: checking for a custom ODBC support" >&5
# Check whether --with-custom-odbc or --without-custom-odbc was given.
if test "${with_custom_odbc+set}" = set; then
withval="$with_custom_odbc"
@@ -66506,7 +66021,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for iODBC support""... $ac_c" 1>&6
-echo "configure:66510: checking for iODBC support" >&5
+echo "configure:66025: checking for iODBC support" >&5
# Check whether --with-iodbc or --without-iodbc was given.
if test "${with_iodbc+set}" = set; then
withval="$with_iodbc"
@@ -66648,7 +66163,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for Easysoft ODBC-ODBC Bridge support""... $ac_c" 1>&6
-echo "configure:66652: checking for Easysoft ODBC-ODBC Bridge support" >&5
+echo "configure:66167: checking for Easysoft ODBC-ODBC Bridge support" >&5
# Check whether --with-esoob or --without-esoob was given.
if test "${with_esoob+set}" = set; then
withval="$with_esoob"
@@ -66708,7 +66223,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for unixODBC support""... $ac_c" 1>&6
-echo "configure:66712: checking for unixODBC support" >&5
+echo "configure:66227: checking for unixODBC support" >&5
# Check whether --with-unixODBC or --without-unixODBC was given.
if test "${with_unixODBC+set}" = set; then
withval="$with_unixODBC"
@@ -66773,7 +66288,7 @@ fi
if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for DBMaker support""... $ac_c" 1>&6
-echo "configure:66777: checking for DBMaker support" >&5
+echo "configure:66292: checking for DBMaker support" >&5
# Check whether --with-dbmaker or --without-dbmaker was given.
if test "${with_dbmaker+set}" = set; then
withval="$with_dbmaker"
@@ -67368,7 +66883,7 @@ fi
echo $ac_n "checking whether to enable pcntl support""... $ac_c" 1>&6
-echo "configure:67372: checking whether to enable pcntl support" >&5
+echo "configure:66887: checking whether to enable pcntl support" >&5
# Check whether --enable-pcntl or --disable-pcntl was given.
if test "${enable_pcntl+set}" = set; then
enableval="$enable_pcntl"
@@ -67416,12 +66931,12 @@ if test "$PHP_PCNTL" != "no"; then
for ac_func in fork
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:67420: checking for $ac_func" >&5
+echo "configure:66935: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 67425 "configure"
+#line 66940 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -67444,7 +66959,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:67448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:66963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -67475,12 +66990,12 @@ done
for ac_func in waitpid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:67479: checking for $ac_func" >&5
+echo "configure:66994: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 67484 "configure"
+#line 66999 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -67503,7 +67018,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:67507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:67022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -67534,12 +67049,12 @@ done
for ac_func in sigaction
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:67538: checking for $ac_func" >&5
+echo "configure:67053: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 67543 "configure"
+#line 67058 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -67562,7 +67077,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:67566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:67081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -67593,12 +67108,12 @@ done
for ac_func in getpriority setpriority wait3
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:67597: checking for $ac_func" >&5
+echo "configure:67112: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 67602 "configure"
+#line 67117 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -67621,7 +67136,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:67625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:67140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -67935,7 +67450,7 @@ fi
echo $ac_n "checking whether to enable PDO support""... $ac_c" 1>&6
-echo "configure:67939: checking whether to enable PDO support" >&5
+echo "configure:67454: checking whether to enable PDO support" >&5
# Check whether --enable-pdo or --disable-pdo was given.
if test "${enable_pdo+set}" = set; then
enableval="$enable_pdo"
@@ -68008,7 +67523,6 @@ Once you've upgraded, please re-try your PDO install.
if test "$ext_shared" = "yes" ; then
case $host_alias in
*darwin*)
- if test "$pdo_running_under_pear" = "1"; then
{ echo "configure: error:
Due to the way that loadable modules work on OSX/Darwin, you need to
compile the PDO package statically into the PHP core.
@@ -68016,7 +67530,6 @@ 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.
" 1>&2; exit 1; }
- fi
ext_shared=no
;;
esac
@@ -68361,7 +67874,7 @@ if test "$PHP_PDO" != "no"; then
echo $ac_n "checking for PDO_DBLIB support via FreeTDS""... $ac_c" 1>&6
-echo "configure:68365: checking for PDO_DBLIB support via FreeTDS" >&5
+echo "configure:67878: checking for PDO_DBLIB support via FreeTDS" >&5
# Check whether --with-pdo-dblib or --without-pdo-dblib was given.
if test "${with_pdo_dblib+set}" = set; then
withval="$with_pdo_dblib"
@@ -68577,13 +68090,13 @@ if test "$PHP_PDO_DBLIB" != "no"; then
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:68581: checking for PDO includes" >&5
+echo "configure:68094: checking for PDO includes" >&5
if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:68587: checking for PDO includes" >&5
+echo "configure:68100: checking for PDO includes" >&5
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
@@ -68886,7 +68399,7 @@ EOF
fi
echo $ac_n "checking for dnet_addr in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:68890: checking for dnet_addr in -ldnet_stub" >&5
+echo "configure:68403: checking for dnet_addr in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_addr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -68894,7 +68407,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 68898 "configure"
+#line 68411 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -68905,7 +68418,7 @@ int main() {
dnet_addr()
; return 0; }
EOF
-if { (eval echo configure:68909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:68422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -69068,7 +68581,7 @@ if test "$PHP_PDO" != "no"; then
echo $ac_n "checking for Firebird support for PDO""... $ac_c" 1>&6
-echo "configure:69072: checking for Firebird support for PDO" >&5
+echo "configure:68585: checking for Firebird support for PDO" >&5
# Check whether --with-pdo-firebird or --without-pdo-firebird was given.
if test "${with_pdo_firebird+set}" = set; then
withval="$with_pdo_firebird"
@@ -69217,7 +68730,7 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then
done
echo $ac_n "checking for isc_detach_database in -lfbclient""... $ac_c" 1>&6
-echo "configure:69221: checking for isc_detach_database in -lfbclient" >&5
+echo "configure:68734: checking for isc_detach_database in -lfbclient" >&5
ac_lib_var=`echo fbclient'_'isc_detach_database | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -69225,7 +68738,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lfbclient $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 69229 "configure"
+#line 68742 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -69236,7 +68749,7 @@ int main() {
isc_detach_database()
; return 0; }
EOF
-if { (eval echo configure:69240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:68753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -69362,7 +68875,7 @@ else
done
echo $ac_n "checking for isc_detach_database in -lgds""... $ac_c" 1>&6
-echo "configure:69366: checking for isc_detach_database in -lgds" >&5
+echo "configure:68879: checking for isc_detach_database in -lgds" >&5
ac_lib_var=`echo gds'_'isc_detach_database | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -69370,7 +68883,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lgds $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 69374 "configure"
+#line 68887 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -69381,7 +68894,7 @@ int main() {
isc_detach_database()
; return 0; }
EOF
-if { (eval echo configure:69385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:68898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -69507,7 +69020,7 @@ else
done
echo $ac_n "checking for isc_detach_database in -lib_util""... $ac_c" 1>&6
-echo "configure:69511: checking for isc_detach_database in -lib_util" >&5
+echo "configure:69024: checking for isc_detach_database in -lib_util" >&5
ac_lib_var=`echo ib_util'_'isc_detach_database | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -69515,7 +69028,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lib_util $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 69519 "configure"
+#line 69032 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -69526,7 +69039,7 @@ int main() {
isc_detach_database()
; return 0; }
EOF
-if { (eval echo configure:69530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:69043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -69571,13 +69084,13 @@ fi
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:69575: checking for PDO includes" >&5
+echo "configure:69088: checking for PDO includes" >&5
if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:69581: checking for PDO includes" >&5
+echo "configure:69094: checking for PDO includes" >&5
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
@@ -70042,7 +69555,7 @@ if test "$PHP_PDO" != "no"; then
echo $ac_n "checking for MySQL support for PDO""... $ac_c" 1>&6
-echo "configure:70046: checking for MySQL support for PDO" >&5
+echo "configure:69559: checking for MySQL support for PDO" >&5
# Check whether --with-pdo-mysql or --without-pdo-mysql was given.
if test "${with_pdo_mysql+set}" = set; then
withval="$with_pdo_mysql"
@@ -70092,7 +69605,7 @@ EOF
echo $ac_n "checking for mysql_config""... $ac_c" 1>&6
-echo "configure:70096: checking for mysql_config" >&5
+echo "configure:69609: checking for mysql_config" >&5
if test -f $PHP_PDO_MYSQL && test -x $PHP_PDO_MYSQL ; then
PDO_MYSQL_CONFIG=$PHP_PDO_MYSQL
@@ -70126,7 +69639,7 @@ echo "configure:70096: checking for mysql_config" >&5
# Extract the first word of "sed", so it can be a program name with args.
set dummy sed; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:70130: checking for $ac_word" >&5
+echo "configure:69643: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SED'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -70159,8 +69672,14 @@ else
fi
fi
+ if test "$enable_maintainer_zts" = "yes"; then
+ PDO_MYSQL_LIBNAME=mysqlclient_r
+ PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs_r | $SED -e "s/'//g"`
+ else
+ PDO_MYSQL_LIBNAME=mysqlclient
+ PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"`
+ fi
PDO_MYSQL_INCLUDE=`$PDO_MYSQL_CONFIG --cflags | $SED -e "s/'//g"`
- PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"`
PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket`
elif test -z "$PDO_MYSQL_DIR"; then
echo "$ac_t""not found" 1>&6
@@ -70168,12 +69687,12 @@ fi
else
echo "$ac_t""not found" 1>&6
echo $ac_n "checking for mysql install under $PDO_MYSQL_DIR""... $ac_c" 1>&6
-echo "configure:70172: checking for mysql install under $PDO_MYSQL_DIR" >&5
+echo "configure:69691: checking for mysql install under $PDO_MYSQL_DIR" >&5
if test -r $PDO_MYSQL_DIR/include/mysql; then
PDO_MYSQL_INC_DIR=$PDO_MYSQL_DIR/include/mysql
else
PDO_MYSQL_INC_DIR=$PDO_MYSQL_DIR/include
- fi
+ fi
if test -r $PDO_MYSQL_DIR/lib/mysql; then
PDO_MYSQL_LIB_DIR=$PDO_MYSQL_DIR/lib/mysql
else
@@ -70190,7 +69709,7 @@ echo "configure:70172: checking for mysql install under $PDO_MYSQL_DIR" >&5
if test "$ext_shared" = "yes"; then
- PDO_MYSQL_SHARED_LIBADD="-lmysqlclient $PDO_MYSQL_SHARED_LIBADD"
+ PDO_MYSQL_SHARED_LIBADD="-l$PDO_MYSQL_LIBNAME $PDO_MYSQL_SHARED_LIBADD"
if test -n "$PDO_MYSQL_LIB_DIR"; then
if test "$PDO_MYSQL_LIB_DIR" != "/usr/$PHP_LIBDIR" && test "$PDO_MYSQL_LIB_DIR" != "/usr/lib"; then
@@ -70270,10 +69789,10 @@ echo "configure:70172: checking for mysql install under $PDO_MYSQL_DIR" >&5
fi
- case mysqlclient in
+ case $PDO_MYSQL_LIBNAME in
c|c_r|pthread*) ;;
*)
- LIBS="-lmysqlclient $LIBS"
+ LIBS="-l$PDO_MYSQL_LIBNAME $LIBS"
;;
esac
@@ -70322,9 +69841,7 @@ echo "configure:70172: checking for mysql install under $PDO_MYSQL_DIR" >&5
EOF
-
- _SAVE_LIBS=$LIBS
- LIBS="$LIBS $PDO_MYSQL_LIBS"
+
save_old_LDFLAGS=$LDFLAGS
ac_stuff="
@@ -70421,16 +69938,16 @@ EOF
esac
done
- echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6
-echo "configure:70426: checking for mysql_query in -lmysqlclient" >&5
-ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for mysql_query in -l$PDO_MYSQL_LIBNAME""... $ac_c" 1>&6
+echo "configure:69943: checking for mysql_query in -l$PDO_MYSQL_LIBNAME" >&5
+ac_lib_var=`echo $PDO_MYSQL_LIBNAME'_'mysql_query | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lmysqlclient $LIBS"
+LIBS="-l$PDO_MYSQL_LIBNAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 70434 "configure"
+#line 69951 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -70441,7 +69958,7 @@ int main() {
mysql_query()
; return 0; }
EOF
-if { (eval echo configure:70445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:69962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -70461,6 +69978,46 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
ext_shared=$save_ext_shared
+ for ac_i in $PDO_MYSQL_INCLUDE; do
+ case $ac_i in
+ -I*)
+ ac_ii=`echo $ac_i|cut -c 3-`
+
+ if test "$ac_ii" != "/usr/include"; then
+
+ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
+ ai_p=$ac_ii
+ else
+
+ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$ac_ii\"`"
+ fi
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "INCLUDEPATH$unique=set"
+
+ if test ""; then
+ INCLUDES="-I$ai_p $INCLUDES"
+ else
+ INCLUDES="$INCLUDES -I$ai_p"
+ fi
+
+ fi
+
+ fi
+
+ ;;
+ esac
+ done
+
+
for ac_i in $PDO_MYSQL_LIBS; do
case $ac_i in
-pthread)
@@ -70555,22 +70112,24 @@ else
LDFLAGS=$save_old_LDFLAGS
ext_shared=$save_ext_shared
- unset ac_cv_lib_mysqlclient_mysql_query
+ unset ac_cv_lib_$PDO_MYSQL_LIBNAME_mysql_query
{ echo "configure: error: mysql_query missing!?" 1>&2; exit 1; }
fi
+ _SAVE_LIBS=$LIBS
+ LIBS="$LIBS $PDO_MYSQL_LIBS"
for ac_func in mysql_commit mysql_stmt_prepare mysql_next_result mysql_sqlstate
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:70569: checking for $ac_func" >&5
+echo "configure:70128: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 70574 "configure"
+#line 70133 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -70593,7 +70152,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:70597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:70156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -70622,13 +70181,13 @@ done
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:70626: checking for PDO includes" >&5
+echo "configure:70185: checking for PDO includes" >&5
if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:70632: checking for PDO includes" >&5
+echo "configure:70191: checking for PDO includes" >&5
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
@@ -70652,7 +70211,7 @@ echo "$ac_t""$pdo_inc_path" 1>&6
ext_builddir=ext/pdo_mysql
ext_srcdir=$abs_srcdir/ext/pdo_mysql
- ac_extra=`echo "-I$pdo_inc_path $PDO_MYSQL_INCLUDE"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g`
+ ac_extra=`echo "-I$pdo_inc_path"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g`
if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then
PHP_PDO_MYSQL_SHARED=no
@@ -70951,8 +70510,7 @@ but you've either not enabled pdo, or have disabled it.
PDO_MYSQL_MODULE_TYPE=external
-
- PDO_MYSQL_SHARED_LIBADD=$PDO_MYSQL_LIBS
+
PHP_VAR_SUBST="$PHP_VAR_SUBST PDO_MYSQL_SHARED_LIBADD"
@@ -70976,7 +70534,7 @@ if test "$PHP_PDO" != "no"; then
echo $ac_n "checking Oracle OCI support for PDO""... $ac_c" 1>&6
-echo "configure:70980: checking Oracle OCI support for PDO" >&5
+echo "configure:70538: checking Oracle OCI support for PDO" >&5
# Check whether --with-pdo-oci or --without-pdo-oci was given.
if test "${with_pdo_oci+set}" = set; then
withval="$with_pdo_oci"
@@ -71021,7 +70579,7 @@ echo "$ac_t""$ext_output" 1>&6
if test "$PHP_PDO_OCI" != "no"; then
echo $ac_n "checking Oracle Install-Dir""... $ac_c" 1>&6
-echo "configure:71025: checking Oracle Install-Dir" >&5
+echo "configure:70583: checking Oracle Install-Dir" >&5
if test "$PHP_PDO_OCI" = "yes" || test -z "$PHP_PDO_OCI"; then
PDO_OCI_DIR=$ORACLE_HOME
else
@@ -71030,7 +70588,7 @@ echo "configure:71025: checking Oracle Install-Dir" >&5
echo "$ac_t""$PDO_OCI_DIR :$PHP_PDO_OCI:" 1>&6
echo $ac_n "checking if that is sane""... $ac_c" 1>&6
-echo "configure:71034: checking if that is sane" >&5
+echo "configure:70592: checking if that is sane" >&5
if test -z "$PDO_OCI_DIR"; then
{ echo "configure: error:
You need to tell me where to find your oracle SDK, or set ORACLE_HOME.
@@ -71041,7 +70599,7 @@ You need to tell me where to find your oracle SDK, or set ORACLE_HOME.
echo $ac_n "checking size of long int""... $ac_c" 1>&6
-echo "configure:71045: checking size of long int" >&5
+echo "configure:70603: checking size of long int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -71049,7 +70607,7 @@ else
ac_cv_sizeof_long_int=4
else
cat > conftest.$ac_ext <<EOF
-#line 71053 "configure"
+#line 70611 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -71060,7 +70618,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:71064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:70622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_int=`cat conftestval`
else
@@ -71080,7 +70638,7 @@ EOF
echo $ac_n "checking checking if we're at 64-bit platform""... $ac_c" 1>&6
-echo "configure:71084: checking checking if we're at 64-bit platform" >&5
+echo "configure:70642: checking checking if we're at 64-bit platform" >&5
if test "$ac_cv_sizeof_long_int" = "4" ; then
echo "$ac_t""no" 1>&6
TMP_PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib32"
@@ -71090,7 +70648,7 @@ echo "configure:71084: checking checking if we're at 64-bit platform" >&5
fi
echo $ac_n "checking OCI8 libraries dir""... $ac_c" 1>&6
-echo "configure:71094: checking OCI8 libraries dir" >&5
+echo "configure:70652: checking OCI8 libraries dir" >&5
if test -d "$PDO_OCI_DIR/lib" -a ! -d "$PDO_OCI_DIR/lib32"; then
PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib"
elif ! test -d "$PDO_OCI_DIR/lib" -a -d "$PDO_OCI_DIR/lib32"; then
@@ -71107,7 +70665,7 @@ echo "configure:71094: checking OCI8 libraries dir" >&5
PDO_OCI_IC_PREFIX="`echo $PDO_OCI_DIR | cut -d, -f2`"
PDO_OCI_IC_VERS="`echo $PDO_OCI_DIR | cut -d, -f3`"
echo $ac_n "checking for oci.h""... $ac_c" 1>&6
-echo "configure:71111: checking for oci.h" >&5
+echo "configure:70669: checking for oci.h" >&5
if test -f $PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client/oci.h ; then
if test "$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" != "/usr/include"; then
@@ -71606,7 +71164,7 @@ echo "configure:71111: checking for oci.h" >&5
fi
echo $ac_n "checking Oracle version""... $ac_c" 1>&6
-echo "configure:71610: checking Oracle version" >&5
+echo "configure:71168: checking Oracle version" >&5
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
@@ -72261,7 +71819,7 @@ echo "configure:71610: checking Oracle version" >&5
done
echo $ac_n "checking for OCIEnvCreate in -lclntsh""... $ac_c" 1>&6
-echo "configure:72265: checking for OCIEnvCreate in -lclntsh" >&5
+echo "configure:71823: checking for OCIEnvCreate in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCIEnvCreate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -72269,7 +71827,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 72273 "configure"
+#line 71831 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -72280,7 +71838,7 @@ int main() {
OCIEnvCreate()
; return 0; }
EOF
-if { (eval echo configure:72284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:71842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -72413,7 +71971,7 @@ fi
done
echo $ac_n "checking for OCIEnvNlsCreate in -lclntsh""... $ac_c" 1>&6
-echo "configure:72417: checking for OCIEnvNlsCreate in -lclntsh" >&5
+echo "configure:71975: checking for OCIEnvNlsCreate in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCIEnvNlsCreate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -72421,7 +71979,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 72425 "configure"
+#line 71983 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -72432,7 +71990,7 @@ int main() {
OCIEnvNlsCreate()
; return 0; }
EOF
-if { (eval echo configure:72436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:71994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -72565,7 +72123,7 @@ fi
done
echo $ac_n "checking for OCILobIsTemporary in -lclntsh""... $ac_c" 1>&6
-echo "configure:72569: checking for OCILobIsTemporary in -lclntsh" >&5
+echo "configure:72127: checking for OCILobIsTemporary in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCILobIsTemporary | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -72573,7 +72131,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 72577 "configure"
+#line 72135 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -72584,7 +72142,7 @@ int main() {
OCILobIsTemporary()
; return 0; }
EOF
-if { (eval echo configure:72588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:72146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -72713,7 +72271,7 @@ else
done
echo $ac_n "checking for OCILobIsTemporary in -locijdbc8""... $ac_c" 1>&6
-echo "configure:72717: checking for OCILobIsTemporary in -locijdbc8" >&5
+echo "configure:72275: checking for OCILobIsTemporary in -locijdbc8" >&5
ac_lib_var=`echo ocijdbc8'_'OCILobIsTemporary | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -72721,7 +72279,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-locijdbc8 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 72725 "configure"
+#line 72283 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -72732,7 +72290,7 @@ int main() {
OCILobIsTemporary()
; return 0; }
EOF
-if { (eval echo configure:72736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:72294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -72892,7 +72450,7 @@ fi
done
echo $ac_n "checking for OCICollAssign in -lclntsh""... $ac_c" 1>&6
-echo "configure:72896: checking for OCICollAssign in -lclntsh" >&5
+echo "configure:72454: checking for OCICollAssign in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCICollAssign | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -72900,7 +72458,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 72904 "configure"
+#line 72462 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -72911,7 +72469,7 @@ int main() {
OCICollAssign()
; return 0; }
EOF
-if { (eval echo configure:72915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:72473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -73044,7 +72602,7 @@ fi
done
echo $ac_n "checking for OCIStmtFetch2 in -lclntsh""... $ac_c" 1>&6
-echo "configure:73048: checking for OCIStmtFetch2 in -lclntsh" >&5
+echo "configure:72606: checking for OCIStmtFetch2 in -lclntsh" >&5
ac_lib_var=`echo clntsh'_'OCIStmtFetch2 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -73052,7 +72610,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lclntsh $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 73056 "configure"
+#line 72614 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -73063,7 +72621,7 @@ int main() {
OCIStmtFetch2()
; return 0; }
EOF
-if { (eval echo configure:73067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:72625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -73102,13 +72660,13 @@ fi
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:73106: checking for PDO includes" >&5
+echo "configure:72664: checking for PDO includes" >&5
if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:73112: checking for PDO includes" >&5
+echo "configure:72670: checking for PDO includes" >&5
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
@@ -73463,7 +73021,7 @@ if test "$PHP_PDO" != "no"; then
echo $ac_n "checking for ODBC v3 support for PDO""... $ac_c" 1>&6
-echo "configure:73467: checking for ODBC v3 support for PDO" >&5
+echo "configure:73025: checking for ODBC v3 support for PDO" >&5
# Check whether --with-pdo-odbc or --without-pdo-odbc was given.
if test "${with_pdo_odbc+set}" = set; then
withval="$with_pdo_odbc"
@@ -73514,13 +73072,13 @@ if test "$PHP_PDO_ODBC" != "no"; then
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:73518: checking for PDO includes" >&5
+echo "configure:73076: checking for PDO includes" >&5
if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:73524: checking for PDO includes" >&5
+echo "configure:73082: checking for PDO includes" >&5
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
@@ -73541,7 +73099,7 @@ echo "$ac_t""$pdo_inc_path" 1>&6
echo $ac_n "checking for selected PDO ODBC flavour""... $ac_c" 1>&6
-echo "configure:73545: checking for selected PDO ODBC flavour" >&5
+echo "configure:73103: checking for selected PDO ODBC flavour" >&5
pdo_odbc_flavour="`echo $PHP_PDO_ODBC | cut -d, -f1`"
pdo_odbc_dir="`echo $PHP_PDO_ODBC | cut -d, -f2`"
@@ -73615,7 +73173,7 @@ echo "configure:73545: checking for selected PDO ODBC flavour" >&5
echo $ac_n "checking for odbc.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73619: checking for odbc.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73177: checking for odbc.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/odbc.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73629,7 +73187,7 @@ EOF
echo $ac_n "checking for odbcsdk.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73633: checking for odbcsdk.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73191: checking for odbcsdk.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/odbcsdk.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73643,7 +73201,7 @@ EOF
echo $ac_n "checking for iodbc.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73647: checking for iodbc.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73205: checking for iodbc.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/iodbc.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73657,7 +73215,7 @@ EOF
echo $ac_n "checking for sqlunix.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73661: checking for sqlunix.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73219: checking for sqlunix.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/sqlunix.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73671,7 +73229,7 @@ EOF
echo $ac_n "checking for sqltypes.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73675: checking for sqltypes.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73233: checking for sqltypes.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/sqltypes.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73685,7 +73243,7 @@ EOF
echo $ac_n "checking for sqlucode.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73689: checking for sqlucode.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73247: checking for sqlucode.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/sqlucode.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73699,7 +73257,7 @@ EOF
echo $ac_n "checking for sql.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73703: checking for sql.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73261: checking for sql.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/sql.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73713,7 +73271,7 @@ EOF
echo $ac_n "checking for isql.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73717: checking for isql.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73275: checking for isql.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/isql.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73727,7 +73285,7 @@ EOF
echo $ac_n "checking for sqlext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73731: checking for sqlext.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73289: checking for sqlext.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/sqlext.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73741,7 +73299,7 @@ EOF
echo $ac_n "checking for isqlext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73745: checking for isqlext.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73303: checking for isqlext.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/isqlext.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73755,7 +73313,7 @@ EOF
echo $ac_n "checking for udbcext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73759: checking for udbcext.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73317: checking for udbcext.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/udbcext.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73769,7 +73327,7 @@ EOF
echo $ac_n "checking for sqlcli1.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73773: checking for sqlcli1.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73331: checking for sqlcli1.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/sqlcli1.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73783,7 +73341,7 @@ EOF
echo $ac_n "checking for LibraryManager.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73787: checking for LibraryManager.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73345: checking for LibraryManager.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/LibraryManager.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73797,7 +73355,7 @@ EOF
echo $ac_n "checking for cli0core.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73801: checking for cli0core.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73359: checking for cli0core.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/cli0core.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73811,7 +73369,7 @@ EOF
echo $ac_n "checking for cli0ext.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73815: checking for cli0ext.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73373: checking for cli0ext.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/cli0ext.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73825,7 +73383,7 @@ EOF
echo $ac_n "checking for cli0cli.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73829: checking for cli0cli.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73387: checking for cli0cli.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/cli0cli.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73839,7 +73397,7 @@ EOF
echo $ac_n "checking for cli0defs.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73843: checking for cli0defs.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73401: checking for cli0defs.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/cli0defs.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -73853,7 +73411,7 @@ EOF
echo $ac_n "checking for cli0env.h in $PDO_ODBC_INCDIR""... $ac_c" 1>&6
-echo "configure:73857: checking for cli0env.h in $PDO_ODBC_INCDIR" >&5
+echo "configure:73415: checking for cli0env.h in $PDO_ODBC_INCDIR" >&5
if test -f "$PDO_ODBC_INCDIR/cli0env.h"; then
php_pdo_have_header=yes
cat >> confdefs.h <<\EOF
@@ -74057,7 +73615,7 @@ EOF
done
echo $ac_n "checking for SQLBindCol in -l$pdo_odbc_def_lib""... $ac_c" 1>&6
-echo "configure:74061: checking for SQLBindCol in -l$pdo_odbc_def_lib" >&5
+echo "configure:73619: checking for SQLBindCol in -l$pdo_odbc_def_lib" >&5
ac_lib_var=`echo $pdo_odbc_def_lib'_'SQLBindCol | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -74065,7 +73623,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$pdo_odbc_def_lib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 74069 "configure"
+#line 73627 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -74076,7 +73634,7 @@ int main() {
SQLBindCol()
; return 0; }
EOF
-if { (eval echo configure:74080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:73638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -74190,7 +73748,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
done
echo $ac_n "checking for SQLAllocHandle in -l$pdo_odbc_def_lib""... $ac_c" 1>&6
-echo "configure:74194: checking for SQLAllocHandle in -l$pdo_odbc_def_lib" >&5
+echo "configure:73752: checking for SQLAllocHandle in -l$pdo_odbc_def_lib" >&5
ac_lib_var=`echo $pdo_odbc_def_lib'_'SQLAllocHandle | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -74198,7 +73756,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$pdo_odbc_def_lib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 74202 "configure"
+#line 73760 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -74209,7 +73767,7 @@ int main() {
SQLAllocHandle()
; return 0; }
EOF
-if { (eval echo configure:74213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:73771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -74577,7 +74135,7 @@ if test "$PHP_PDO" != "no"; then
echo $ac_n "checking for PostgreSQL support for PDO""... $ac_c" 1>&6
-echo "configure:74581: checking for PostgreSQL support for PDO" >&5
+echo "configure:74139: checking for PostgreSQL support for PDO" >&5
# Check whether --with-pdo-pgsql or --without-pdo-pgsql was given.
if test "${with_pdo_pgsql+set}" = set; then
withval="$with_pdo_pgsql"
@@ -74634,7 +74192,7 @@ if test "$PHP_PDO_PGSQL" != "no"; then
echo $ac_n "checking for pg_config""... $ac_c" 1>&6
-echo "configure:74638: checking for pg_config" >&5
+echo "configure:74196: checking for pg_config" >&5
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"
@@ -74698,7 +74256,7 @@ EOF
echo $ac_n "checking for openssl dependencies""... $ac_c" 1>&6
-echo "configure:74702: checking for openssl dependencies" >&5
+echo "configure:74260: checking for openssl dependencies" >&5
if grep -q openssl $PGSQL_INCLUDE/libpq-fe.h ; then
echo "$ac_t""yes" 1>&6
if pkg-config openssl ; then
@@ -74712,7 +74270,7 @@ echo "configure:74702: checking for openssl dependencies" >&5
old_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR"
echo $ac_n "checking for PQescapeString in -lpq""... $ac_c" 1>&6
-echo "configure:74716: checking for PQescapeString in -lpq" >&5
+echo "configure:74274: checking for PQescapeString in -lpq" >&5
ac_lib_var=`echo pq'_'PQescapeString | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -74720,7 +74278,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 74724 "configure"
+#line 74282 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -74731,7 +74289,7 @@ int main() {
PQescapeString()
; return 0; }
EOF
-if { (eval echo configure:74735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -74754,8 +74312,94 @@ else
echo "$ac_t""no" 1>&6
fi
+ echo $ac_n "checking for PQescapeStringConn in -lpq""... $ac_c" 1>&6
+echo "configure:74317: checking for PQescapeStringConn in -lpq" >&5
+ac_lib_var=`echo pq'_'PQescapeStringConn | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lpq $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 74325 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char PQescapeStringConn();
+
+int main() {
+PQescapeStringConn()
+; return 0; }
+EOF
+if { (eval echo configure:74336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_PQESCAPE_CONN 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for PQescapeByteaConn in -lpq""... $ac_c" 1>&6
+echo "configure:74360: checking for PQescapeByteaConn in -lpq" >&5
+ac_lib_var=`echo pq'_'PQescapeByteaConn | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lpq $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 74368 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char PQescapeByteaConn();
+
+int main() {
+PQescapeByteaConn()
+; return 0; }
+EOF
+if { (eval echo configure:74379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_PQESCAPE_BYTEA_CONN 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
echo $ac_n "checking for PQsetnonblocking in -lpq""... $ac_c" 1>&6
-echo "configure:74759: checking for PQsetnonblocking in -lpq" >&5
+echo "configure:74403: checking for PQsetnonblocking in -lpq" >&5
ac_lib_var=`echo pq'_'PQsetnonblocking | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -74763,7 +74407,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 74767 "configure"
+#line 74411 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -74774,7 +74418,7 @@ int main() {
PQsetnonblocking()
; return 0; }
EOF
-if { (eval echo configure:74778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -74798,7 +74442,7 @@ else
fi
echo $ac_n "checking for PQcmdTuples in -lpq""... $ac_c" 1>&6
-echo "configure:74802: checking for PQcmdTuples in -lpq" >&5
+echo "configure:74446: checking for PQcmdTuples in -lpq" >&5
ac_lib_var=`echo pq'_'PQcmdTuples | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -74806,7 +74450,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 74810 "configure"
+#line 74454 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -74817,7 +74461,7 @@ int main() {
PQcmdTuples()
; return 0; }
EOF
-if { (eval echo configure:74821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -74841,7 +74485,7 @@ else
fi
echo $ac_n "checking for PQoidValue in -lpq""... $ac_c" 1>&6
-echo "configure:74845: checking for PQoidValue in -lpq" >&5
+echo "configure:74489: checking for PQoidValue in -lpq" >&5
ac_lib_var=`echo pq'_'PQoidValue | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -74849,7 +74493,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 74853 "configure"
+#line 74497 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -74860,7 +74504,7 @@ int main() {
PQoidValue()
; return 0; }
EOF
-if { (eval echo configure:74864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -74884,7 +74528,7 @@ else
fi
echo $ac_n "checking for PQclientEncoding in -lpq""... $ac_c" 1>&6
-echo "configure:74888: checking for PQclientEncoding in -lpq" >&5
+echo "configure:74532: checking for PQclientEncoding in -lpq" >&5
ac_lib_var=`echo pq'_'PQclientEncoding | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -74892,7 +74536,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 74896 "configure"
+#line 74540 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -74903,7 +74547,7 @@ int main() {
PQclientEncoding()
; return 0; }
EOF
-if { (eval echo configure:74907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -74927,7 +74571,7 @@ else
fi
echo $ac_n "checking for PQparameterStatus in -lpq""... $ac_c" 1>&6
-echo "configure:74931: checking for PQparameterStatus in -lpq" >&5
+echo "configure:74575: checking for PQparameterStatus in -lpq" >&5
ac_lib_var=`echo pq'_'PQparameterStatus | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -74935,7 +74579,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 74939 "configure"
+#line 74583 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -74946,7 +74590,7 @@ int main() {
PQparameterStatus()
; return 0; }
EOF
-if { (eval echo configure:74950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -74970,7 +74614,7 @@ else
fi
echo $ac_n "checking for PQprotocolVersion in -lpq""... $ac_c" 1>&6
-echo "configure:74974: checking for PQprotocolVersion in -lpq" >&5
+echo "configure:74618: checking for PQprotocolVersion in -lpq" >&5
ac_lib_var=`echo pq'_'PQprotocolVersion | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -74978,7 +74622,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 74982 "configure"
+#line 74626 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -74989,7 +74633,7 @@ int main() {
PQprotocolVersion()
; return 0; }
EOF
-if { (eval echo configure:74993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -75013,7 +74657,7 @@ else
fi
echo $ac_n "checking for PQtransactionStatus in -lpq""... $ac_c" 1>&6
-echo "configure:75017: checking for PQtransactionStatus in -lpq" >&5
+echo "configure:74661: checking for PQtransactionStatus in -lpq" >&5
ac_lib_var=`echo pq'_'PQtransactionStatus | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -75021,7 +74665,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 75025 "configure"
+#line 74669 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -75032,7 +74676,7 @@ int main() {
PQtransactionStatus()
; return 0; }
EOF
-if { (eval echo configure:75036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -75056,7 +74700,7 @@ else
fi
echo $ac_n "checking for PQunescapeBytea in -lpq""... $ac_c" 1>&6
-echo "configure:75060: checking for PQunescapeBytea in -lpq" >&5
+echo "configure:74704: checking for PQunescapeBytea in -lpq" >&5
ac_lib_var=`echo pq'_'PQunescapeBytea | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -75064,7 +74708,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 75068 "configure"
+#line 74712 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -75075,7 +74719,7 @@ int main() {
PQunescapeBytea()
; return 0; }
EOF
-if { (eval echo configure:75079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -75099,7 +74743,7 @@ else
fi
echo $ac_n "checking for PQExecParams in -lpq""... $ac_c" 1>&6
-echo "configure:75103: checking for PQExecParams in -lpq" >&5
+echo "configure:74747: checking for PQExecParams in -lpq" >&5
ac_lib_var=`echo pq'_'PQExecParams | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -75107,7 +74751,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 75111 "configure"
+#line 74755 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -75118,7 +74762,7 @@ int main() {
PQExecParams()
; return 0; }
EOF
-if { (eval echo configure:75122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -75142,7 +74786,7 @@ else
fi
echo $ac_n "checking for PQresultErrorField in -lpq""... $ac_c" 1>&6
-echo "configure:75146: checking for PQresultErrorField in -lpq" >&5
+echo "configure:74790: checking for PQresultErrorField in -lpq" >&5
ac_lib_var=`echo pq'_'PQresultErrorField | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -75150,7 +74794,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 75154 "configure"
+#line 74798 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -75161,7 +74805,7 @@ int main() {
PQresultErrorField()
; return 0; }
EOF
-if { (eval echo configure:75165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -75185,7 +74829,7 @@ else
fi
echo $ac_n "checking for pg_encoding_to_char in -lpq""... $ac_c" 1>&6
-echo "configure:75189: checking for pg_encoding_to_char in -lpq" >&5
+echo "configure:74833: checking for pg_encoding_to_char in -lpq" >&5
ac_lib_var=`echo pq'_'pg_encoding_to_char | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -75193,7 +74837,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 75197 "configure"
+#line 74841 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -75204,7 +74848,7 @@ int main() {
pg_encoding_to_char()
; return 0; }
EOF
-if { (eval echo configure:75208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -75229,7 +74873,7 @@ fi
echo $ac_n "checking for PQprepare in -lpq""... $ac_c" 1>&6
-echo "configure:75233: checking for PQprepare in -lpq" >&5
+echo "configure:74877: checking for PQprepare in -lpq" >&5
ac_lib_var=`echo pq'_'PQprepare | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -75237,7 +74881,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 75241 "configure"
+#line 74885 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -75248,7 +74892,7 @@ int main() {
PQprepare()
; return 0; }
EOF
-if { (eval echo configure:75252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:74896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -75410,13 +75054,13 @@ fi
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:75414: checking for PDO includes" >&5
+echo "configure:75058: checking for PDO includes" >&5
if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:75420: checking for PDO includes" >&5
+echo "configure:75064: checking for PDO includes" >&5
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
@@ -75747,61 +75391,15 @@ if test "$PHP_PDO" != "no"; then
-echo $ac_n "checking for sqlite 3 driver for PDO""... $ac_c" 1>&6
-echo "configure:75752: checking for sqlite 3 driver for PDO" >&5
-# Check whether --with-pdo-sqlite or --without-pdo-sqlite was given.
-if test "${with_pdo_sqlite+set}" = set; then
- withval="$with_pdo_sqlite"
- PHP_PDO_SQLITE=$withval
-else
-
- PHP_PDO_SQLITE=yes
-
- if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
- PHP_PDO_SQLITE=$PHP_ENABLE_ALL
- fi
-
-fi
-
-
-
-ext_output="yes, shared"
-ext_shared=yes
-case $PHP_PDO_SQLITE in
-shared,*)
- PHP_PDO_SQLITE=`echo "$PHP_PDO_SQLITE"|$SED 's/^shared,//'`
- ;;
-shared)
- PHP_PDO_SQLITE=yes
- ;;
-no)
- ext_output=no
- ext_shared=no
- ;;
-*)
- ext_output=yes
- ext_shared=no
- ;;
-esac
-
-
-
-echo "$ac_t""$ext_output" 1>&6
-
-
-
-
-
-
echo $ac_n "checking for sqlite 3 support for PDO""... $ac_c" 1>&6
-echo "configure:75798: checking for sqlite 3 support for PDO" >&5
+echo "configure:75396: checking for sqlite 3 support for PDO" >&5
# Check whether --with-pdo-sqlite or --without-pdo-sqlite was given.
if test "${with_pdo_sqlite+set}" = set; then
withval="$with_pdo_sqlite"
PHP_PDO_SQLITE=$withval
else
- PHP_PDO_SQLITE=no
+ PHP_PDO_SQLITE=yes
if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
PHP_PDO_SQLITE=$PHP_ENABLE_ALL
@@ -75842,13 +75440,13 @@ if test "$PHP_PDO_SQLITE" != "no"; then
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:75846: checking for PDO includes" >&5
+echo "configure:75444: checking for PDO includes" >&5
if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:75852: checking for PDO includes" >&5
+echo "configure:75450: checking for PDO includes" >&5
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
@@ -75877,7 +75475,7 @@ echo "$ac_t""$pdo_inc_path" 1>&6
PDO_SQLITE_DIR=$PHP_PDO_SQLITE
else # search default path list
echo $ac_n "checking for sqlite3 files in default path""... $ac_c" 1>&6
-echo "configure:75881: checking for sqlite3 files in default path" >&5
+echo "configure:75479: checking for sqlite3 files in default path" >&5
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
PDO_SQLITE_DIR=$i
@@ -76022,7 +75620,7 @@ echo "configure:75881: checking for sqlite3 files in default path" >&5
done
echo $ac_n "checking for $LIBSYMBOL in -l$LIBNAME""... $ac_c" 1>&6
-echo "configure:76026: checking for $LIBSYMBOL in -l$LIBNAME" >&5
+echo "configure:75624: checking for $LIBSYMBOL in -l$LIBNAME" >&5
ac_lib_var=`echo $LIBNAME'_'$LIBSYMBOL | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -76030,7 +75628,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$LIBNAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 76034 "configure"
+#line 75632 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -76041,7 +75639,7 @@ int main() {
$LIBSYMBOL()
; return 0; }
EOF
-if { (eval echo configure:76045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:75643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -76269,7 +75867,7 @@ fi
done
echo $ac_n "checking for sqlite3_key in -lsqlite3""... $ac_c" 1>&6
-echo "configure:76273: checking for sqlite3_key in -lsqlite3" >&5
+echo "configure:75871: checking for sqlite3_key in -lsqlite3" >&5
ac_lib_var=`echo sqlite3'_'sqlite3_key | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -76277,7 +75875,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsqlite3 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 76281 "configure"
+#line 75879 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -76288,7 +75886,7 @@ int main() {
sqlite3_key()
; return 0; }
EOF
-if { (eval echo configure:76292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:75890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -76613,14 +76211,14 @@ EOF
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/main.c sqlite/src/os_unix.c sqlite/src/os_win.c sqlite/src/os.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/table.c sqlite/src/tokenize.c sqlite/src/analyze.c sqlite/src/complete.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"
+ sqlite/src/alter.c sqlite/src/vdbefifo.c sqlite/src/vtab.c sqlite/src/loadext.c"
ext_builddir=ext/pdo_sqlite
@@ -76913,7 +76511,7 @@ EOF
echo $ac_n "checking size of char *""... $ac_c" 1>&6
-echo "configure:76917: checking size of char *" >&5
+echo "configure:76515: checking size of char *" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -76921,7 +76519,7 @@ else
ac_cv_sizeof_char_p=4
else
cat > conftest.$ac_ext <<EOF
-#line 76925 "configure"
+#line 76523 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -76932,7 +76530,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:76936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:76534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_char_p=`cat conftestval`
else
@@ -76979,12 +76577,12 @@ EOF
for ac_func in usleep nanosleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:76983: checking for $ac_func" >&5
+echo "configure:76581: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 76988 "configure"
+#line 76586 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -77007,7 +76605,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:77011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:76609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -77035,17 +76633,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:77039: checking for $ac_hdr" >&5
+echo "configure:76637: 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
-#line 77044 "configure"
+#line 76642 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:77049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:76647: \"$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*
@@ -77167,7 +76765,7 @@ done
done
echo $ac_n "checking for fdatasync in -lrt""... $ac_c" 1>&6
-echo "configure:77171: checking for fdatasync in -lrt" >&5
+echo "configure:76769: checking for fdatasync in -lrt" >&5
ac_lib_var=`echo rt'_'fdatasync | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77175,7 +76773,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lrt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77179 "configure"
+#line 76777 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77186,7 +76784,7 @@ int main() {
fdatasync()
; return 0; }
EOF
-if { (eval echo configure:77190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:76788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77271,7 +76869,7 @@ fi
echo $ac_n "checking for PostgreSQL support""... $ac_c" 1>&6
-echo "configure:77275: checking for PostgreSQL support" >&5
+echo "configure:76873: checking for PostgreSQL support" >&5
# Check whether --with-pgsql or --without-pgsql was given.
if test "${with_pgsql+set}" = set; then
withval="$with_pgsql"
@@ -77328,7 +76926,7 @@ if test "$PHP_PGSQL" != "no"; then
echo $ac_n "checking for pg_config""... $ac_c" 1>&6
-echo "configure:77332: checking for pg_config" >&5
+echo "configure:76930: checking for pg_config" >&5
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"
@@ -77396,7 +76994,7 @@ EOF
old_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR"
echo $ac_n "checking for PQescapeString in -lpq""... $ac_c" 1>&6
-echo "configure:77400: checking for PQescapeString in -lpq" >&5
+echo "configure:76998: checking for PQescapeString in -lpq" >&5
ac_lib_var=`echo pq'_'PQescapeString | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77404,7 +77002,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77408 "configure"
+#line 77006 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77415,7 +77013,7 @@ int main() {
PQescapeString()
; return 0; }
EOF
-if { (eval echo configure:77419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77439,7 +77037,7 @@ else
fi
echo $ac_n "checking for PQunescapeBytea in -lpq""... $ac_c" 1>&6
-echo "configure:77443: checking for PQunescapeBytea in -lpq" >&5
+echo "configure:77041: checking for PQunescapeBytea in -lpq" >&5
ac_lib_var=`echo pq'_'PQunescapeBytea | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77447,7 +77045,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77451 "configure"
+#line 77049 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77458,7 +77056,7 @@ int main() {
PQunescapeBytea()
; return 0; }
EOF
-if { (eval echo configure:77462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77482,7 +77080,7 @@ else
fi
echo $ac_n "checking for PQsetnonblocking in -lpq""... $ac_c" 1>&6
-echo "configure:77486: checking for PQsetnonblocking in -lpq" >&5
+echo "configure:77084: checking for PQsetnonblocking in -lpq" >&5
ac_lib_var=`echo pq'_'PQsetnonblocking | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77490,7 +77088,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77494 "configure"
+#line 77092 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77501,7 +77099,7 @@ int main() {
PQsetnonblocking()
; return 0; }
EOF
-if { (eval echo configure:77505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77525,7 +77123,7 @@ else
fi
echo $ac_n "checking for PQcmdTuples in -lpq""... $ac_c" 1>&6
-echo "configure:77529: checking for PQcmdTuples in -lpq" >&5
+echo "configure:77127: checking for PQcmdTuples in -lpq" >&5
ac_lib_var=`echo pq'_'PQcmdTuples | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77533,7 +77131,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77537 "configure"
+#line 77135 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77544,7 +77142,7 @@ int main() {
PQcmdTuples()
; return 0; }
EOF
-if { (eval echo configure:77548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77568,7 +77166,7 @@ else
fi
echo $ac_n "checking for PQoidValue in -lpq""... $ac_c" 1>&6
-echo "configure:77572: checking for PQoidValue in -lpq" >&5
+echo "configure:77170: checking for PQoidValue in -lpq" >&5
ac_lib_var=`echo pq'_'PQoidValue | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77576,7 +77174,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77580 "configure"
+#line 77178 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77587,7 +77185,7 @@ int main() {
PQoidValue()
; return 0; }
EOF
-if { (eval echo configure:77591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77611,7 +77209,7 @@ else
fi
echo $ac_n "checking for PQclientEncoding in -lpq""... $ac_c" 1>&6
-echo "configure:77615: checking for PQclientEncoding in -lpq" >&5
+echo "configure:77213: checking for PQclientEncoding in -lpq" >&5
ac_lib_var=`echo pq'_'PQclientEncoding | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77619,7 +77217,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77623 "configure"
+#line 77221 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77630,7 +77228,7 @@ int main() {
PQclientEncoding()
; return 0; }
EOF
-if { (eval echo configure:77634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77654,7 +77252,7 @@ else
fi
echo $ac_n "checking for PQparameterStatus in -lpq""... $ac_c" 1>&6
-echo "configure:77658: checking for PQparameterStatus in -lpq" >&5
+echo "configure:77256: checking for PQparameterStatus in -lpq" >&5
ac_lib_var=`echo pq'_'PQparameterStatus | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77662,7 +77260,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77666 "configure"
+#line 77264 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77673,7 +77271,7 @@ int main() {
PQparameterStatus()
; return 0; }
EOF
-if { (eval echo configure:77677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77697,7 +77295,7 @@ else
fi
echo $ac_n "checking for PQprotocolVersion in -lpq""... $ac_c" 1>&6
-echo "configure:77701: checking for PQprotocolVersion in -lpq" >&5
+echo "configure:77299: checking for PQprotocolVersion in -lpq" >&5
ac_lib_var=`echo pq'_'PQprotocolVersion | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77705,7 +77303,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77709 "configure"
+#line 77307 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77716,7 +77314,7 @@ int main() {
PQprotocolVersion()
; return 0; }
EOF
-if { (eval echo configure:77720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77740,7 +77338,7 @@ else
fi
echo $ac_n "checking for PQtransactionStatus in -lpq""... $ac_c" 1>&6
-echo "configure:77744: checking for PQtransactionStatus in -lpq" >&5
+echo "configure:77342: checking for PQtransactionStatus in -lpq" >&5
ac_lib_var=`echo pq'_'PQtransactionStatus | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77748,7 +77346,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77752 "configure"
+#line 77350 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77759,7 +77357,7 @@ int main() {
PQtransactionStatus()
; return 0; }
EOF
-if { (eval echo configure:77763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77783,7 +77381,7 @@ else
fi
echo $ac_n "checking for PQexecParams in -lpq""... $ac_c" 1>&6
-echo "configure:77787: checking for PQexecParams in -lpq" >&5
+echo "configure:77385: checking for PQexecParams in -lpq" >&5
ac_lib_var=`echo pq'_'PQexecParams | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77791,7 +77389,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77795 "configure"
+#line 77393 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77802,7 +77400,7 @@ int main() {
PQexecParams()
; return 0; }
EOF
-if { (eval echo configure:77806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77826,7 +77424,7 @@ else
fi
echo $ac_n "checking for PQprepare in -lpq""... $ac_c" 1>&6
-echo "configure:77830: checking for PQprepare in -lpq" >&5
+echo "configure:77428: checking for PQprepare in -lpq" >&5
ac_lib_var=`echo pq'_'PQprepare | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77834,7 +77432,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77838 "configure"
+#line 77436 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77845,7 +77443,7 @@ int main() {
PQprepare()
; return 0; }
EOF
-if { (eval echo configure:77849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77869,7 +77467,7 @@ else
fi
echo $ac_n "checking for PQexecPrepared in -lpq""... $ac_c" 1>&6
-echo "configure:77873: checking for PQexecPrepared in -lpq" >&5
+echo "configure:77471: checking for PQexecPrepared in -lpq" >&5
ac_lib_var=`echo pq'_'PQexecPrepared | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77877,7 +77475,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77881 "configure"
+#line 77479 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77888,7 +77486,7 @@ int main() {
PQexecPrepared()
; return 0; }
EOF
-if { (eval echo configure:77892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77912,7 +77510,7 @@ else
fi
echo $ac_n "checking for PQresultErrorField in -lpq""... $ac_c" 1>&6
-echo "configure:77916: checking for PQresultErrorField in -lpq" >&5
+echo "configure:77514: checking for PQresultErrorField in -lpq" >&5
ac_lib_var=`echo pq'_'PQresultErrorField | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77920,7 +77518,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77924 "configure"
+#line 77522 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77931,7 +77529,7 @@ int main() {
PQresultErrorField()
; return 0; }
EOF
-if { (eval echo configure:77935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77955,7 +77553,7 @@ else
fi
echo $ac_n "checking for PQsendQueryParams in -lpq""... $ac_c" 1>&6
-echo "configure:77959: checking for PQsendQueryParams in -lpq" >&5
+echo "configure:77557: checking for PQsendQueryParams in -lpq" >&5
ac_lib_var=`echo pq'_'PQsendQueryParams | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -77963,7 +77561,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 77967 "configure"
+#line 77565 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -77974,7 +77572,7 @@ int main() {
PQsendQueryParams()
; return 0; }
EOF
-if { (eval echo configure:77978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -77998,7 +77596,7 @@ else
fi
echo $ac_n "checking for PQsendPrepare in -lpq""... $ac_c" 1>&6
-echo "configure:78002: checking for PQsendPrepare in -lpq" >&5
+echo "configure:77600: checking for PQsendPrepare in -lpq" >&5
ac_lib_var=`echo pq'_'PQsendPrepare | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -78006,7 +77604,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 78010 "configure"
+#line 77608 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -78017,7 +77615,7 @@ int main() {
PQsendPrepare()
; return 0; }
EOF
-if { (eval echo configure:78021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -78041,7 +77639,7 @@ else
fi
echo $ac_n "checking for PQsendQueryPrepared in -lpq""... $ac_c" 1>&6
-echo "configure:78045: checking for PQsendQueryPrepared in -lpq" >&5
+echo "configure:77643: checking for PQsendQueryPrepared in -lpq" >&5
ac_lib_var=`echo pq'_'PQsendQueryPrepared | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -78049,7 +77647,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 78053 "configure"
+#line 77651 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -78060,7 +77658,7 @@ int main() {
PQsendQueryPrepared()
; return 0; }
EOF
-if { (eval echo configure:78064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -78084,7 +77682,7 @@ else
fi
echo $ac_n "checking for PQputCopyData in -lpq""... $ac_c" 1>&6
-echo "configure:78088: checking for PQputCopyData in -lpq" >&5
+echo "configure:77686: checking for PQputCopyData in -lpq" >&5
ac_lib_var=`echo pq'_'PQputCopyData | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -78092,7 +77690,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 78096 "configure"
+#line 77694 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -78103,7 +77701,7 @@ int main() {
PQputCopyData()
; return 0; }
EOF
-if { (eval echo configure:78107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -78127,7 +77725,7 @@ else
fi
echo $ac_n "checking for PQputCopyEnd in -lpq""... $ac_c" 1>&6
-echo "configure:78131: checking for PQputCopyEnd in -lpq" >&5
+echo "configure:77729: checking for PQputCopyEnd in -lpq" >&5
ac_lib_var=`echo pq'_'PQputCopyEnd | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -78135,7 +77733,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 78139 "configure"
+#line 77737 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -78146,7 +77744,7 @@ int main() {
PQputCopyEnd()
; return 0; }
EOF
-if { (eval echo configure:78150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -78170,7 +77768,7 @@ else
fi
echo $ac_n "checking for PQgetCopyData in -lpq""... $ac_c" 1>&6
-echo "configure:78174: checking for PQgetCopyData in -lpq" >&5
+echo "configure:77772: checking for PQgetCopyData in -lpq" >&5
ac_lib_var=`echo pq'_'PQgetCopyData | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -78178,7 +77776,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 78182 "configure"
+#line 77780 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -78189,7 +77787,7 @@ int main() {
PQgetCopyData()
; return 0; }
EOF
-if { (eval echo configure:78193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -78213,7 +77811,7 @@ else
fi
echo $ac_n "checking for PQsetErrorVerbosity in -lpq""... $ac_c" 1>&6
-echo "configure:78217: checking for PQsetErrorVerbosity in -lpq" >&5
+echo "configure:77815: checking for PQsetErrorVerbosity in -lpq" >&5
ac_lib_var=`echo pq'_'PQsetErrorVerbosity | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -78221,7 +77819,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 78225 "configure"
+#line 77823 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -78232,7 +77830,7 @@ int main() {
PQsetErrorVerbosity()
; return 0; }
EOF
-if { (eval echo configure:78236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:77834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -78255,8 +77853,137 @@ else
echo "$ac_t""no" 1>&6
fi
+ echo $ac_n "checking for PQftable in -lpq""... $ac_c" 1>&6
+echo "configure:77858: checking for PQftable in -lpq" >&5
+ac_lib_var=`echo pq'_'PQftable | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lpq $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 77866 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char PQftable();
+
+int main() {
+PQftable()
+; return 0; }
+EOF
+if { (eval echo configure:77877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_PQFTABLE 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for PQescapeStringConn in -lpq""... $ac_c" 1>&6
+echo "configure:77901: checking for PQescapeStringConn in -lpq" >&5
+ac_lib_var=`echo pq'_'PQescapeStringConn | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lpq $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 77909 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char PQescapeStringConn();
+
+int main() {
+PQescapeStringConn()
+; return 0; }
+EOF
+if { (eval echo configure:77920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_PQESCAPE_CONN 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for PQescapeByteaConn in -lpq""... $ac_c" 1>&6
+echo "configure:77944: checking for PQescapeByteaConn in -lpq" >&5
+ac_lib_var=`echo pq'_'PQescapeByteaConn | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lpq $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 77952 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char PQescapeByteaConn();
+
+int main() {
+PQescapeByteaConn()
+; return 0; }
+EOF
+if { (eval echo configure:77963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_PQESCAPE_BYTEA_CONN 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
echo $ac_n "checking for pg_encoding_to_char in -lpq""... $ac_c" 1>&6
-echo "configure:78260: checking for pg_encoding_to_char in -lpq" >&5
+echo "configure:77987: checking for pg_encoding_to_char in -lpq" >&5
ac_lib_var=`echo pq'_'pg_encoding_to_char | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -78264,7 +77991,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 78268 "configure"
+#line 77995 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -78275,7 +78002,7 @@ int main() {
pg_encoding_to_char()
; return 0; }
EOF
-if { (eval echo configure:78279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:78006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -78722,7 +78449,7 @@ fi
echo $ac_n "checking whether to enable POSIX-like functions""... $ac_c" 1>&6
-echo "configure:78726: checking whether to enable POSIX-like functions" >&5
+echo "configure:78453: checking whether to enable POSIX-like functions" >&5
# Check whether --enable-posix or --disable-posix was given.
if test "${enable_posix+set}" = set; then
enableval="$enable_posix"
@@ -79056,17 +78783,17 @@ EOF
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:79060: checking for $ac_hdr" >&5
+echo "configure:78787: 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
-#line 79065 "configure"
+#line 78792 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:79070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:78797: \"$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*
@@ -79093,15 +78820,15 @@ fi
done
- for ac_func in seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev
+ for ac_func in seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev initgroups
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:79100: checking for $ac_func" >&5
+echo "configure:78827: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 79105 "configure"
+#line 78832 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -79124,7 +78851,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:79128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:78855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -79154,7 +78881,7 @@ fi
echo $ac_n "checking for PSPELL support""... $ac_c" 1>&6
-echo "configure:79158: checking for PSPELL support" >&5
+echo "configure:78885: checking for PSPELL support" >&5
# Check whether --with-pspell or --without-pspell was given.
if test "${with_pspell+set}" = set; then
withval="$with_pspell"
@@ -79694,7 +79421,7 @@ EOF
done
echo $ac_n "checking for new_aspell_config in -laspell""... $ac_c" 1>&6
-echo "configure:79698: checking for new_aspell_config in -laspell" >&5
+echo "configure:79425: checking for new_aspell_config in -laspell" >&5
ac_lib_var=`echo aspell'_'new_aspell_config | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -79702,7 +79429,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-laspell $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 79706 "configure"
+#line 79433 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -79713,7 +79440,7 @@ int main() {
new_aspell_config()
; return 0; }
EOF
-if { (eval echo configure:79717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:79444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -79885,7 +79612,7 @@ fi
echo $ac_n "checking for libedit readline replacement""... $ac_c" 1>&6
-echo "configure:79889: checking for libedit readline replacement" >&5
+echo "configure:79616: checking for libedit readline replacement" >&5
# Check whether --with-libedit or --without-libedit was given.
if test "${with_libedit+set}" = set; then
withval="$with_libedit"
@@ -79932,7 +79659,7 @@ if test "$PHP_LIBEDIT" = "no"; then
echo $ac_n "checking for readline support""... $ac_c" 1>&6
-echo "configure:79936: checking for readline support" >&5
+echo "configure:79663: checking for readline support" >&5
# Check whether --with-readline or --without-readline was given.
if test "${with_readline+set}" = set; then
withval="$with_readline"
@@ -80019,7 +79746,7 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
PHP_READLINE_LIBS=""
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:80023: checking for tgetent in -lncurses" >&5
+echo "configure:79750: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -80027,7 +79754,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 80031 "configure"
+#line 79758 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -80038,7 +79765,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:80042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:79769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -80083,7 +79810,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:80087: checking for tgetent in -ltermcap" >&5
+echo "configure:79814: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -80091,7 +79818,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 80095 "configure"
+#line 79822 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -80102,7 +79829,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:80106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:79833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -80248,7 +79975,7 @@ fi
done
echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:80252: checking for readline in -lreadline" >&5
+echo "configure:79979: checking for readline in -lreadline" >&5
ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -80256,7 +79983,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lreadline $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 80260 "configure"
+#line 79987 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -80267,7 +79994,7 @@ int main() {
readline()
; return 0; }
EOF
-if { (eval echo configure:80271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:79998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -80494,7 +80221,7 @@ fi
done
echo $ac_n "checking for rl_callback_read_char in -lreadline""... $ac_c" 1>&6
-echo "configure:80498: checking for rl_callback_read_char in -lreadline" >&5
+echo "configure:80225: checking for rl_callback_read_char in -lreadline" >&5
ac_lib_var=`echo readline'_'rl_callback_read_char | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -80502,7 +80229,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lreadline $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 80506 "configure"
+#line 80233 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -80513,7 +80240,7 @@ int main() {
rl_callback_read_char()
; return 0; }
EOF
-if { (eval echo configure:80517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:80244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -80646,7 +80373,7 @@ fi
done
echo $ac_n "checking for add_history in -lhistory""... $ac_c" 1>&6
-echo "configure:80650: checking for add_history in -lhistory" >&5
+echo "configure:80377: checking for add_history in -lhistory" >&5
ac_lib_var=`echo history'_'add_history | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -80654,7 +80381,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lhistory $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 80658 "configure"
+#line 80385 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -80665,7 +80392,7 @@ int main() {
add_history()
; return 0; }
EOF
-if { (eval echo configure:80669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:80396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -80843,7 +80570,7 @@ elif test "$PHP_LIBEDIT" != "no"; then
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:80847: checking for tgetent in -lncurses" >&5
+echo "configure:80574: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -80851,7 +80578,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 80855 "configure"
+#line 80582 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -80862,7 +80589,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:80866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:80593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -80906,7 +80633,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:80910: checking for tgetent in -ltermcap" >&5
+echo "configure:80637: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -80914,7 +80641,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 80918 "configure"
+#line 80645 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -80925,7 +80652,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:80929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:80656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -81070,7 +80797,7 @@ fi
done
echo $ac_n "checking for readline in -ledit""... $ac_c" 1>&6
-echo "configure:81074: checking for readline in -ledit" >&5
+echo "configure:80801: checking for readline in -ledit" >&5
ac_lib_var=`echo edit'_'readline | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -81078,7 +80805,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ledit $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 81082 "configure"
+#line 80809 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -81089,7 +80816,7 @@ int main() {
readline()
; return 0; }
EOF
-if { (eval echo configure:81093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:80820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -81229,12 +80956,12 @@ if test "$PHP_READLINE" != "no" || test "$PHP_LIBEDIT" != "no"; then
for ac_func in rl_completion_matches
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:81233: checking for $ac_func" >&5
+echo "configure:80960: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 81238 "configure"
+#line 80965 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -81257,7 +80984,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:81261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:80988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -81571,7 +81298,7 @@ fi
echo $ac_n "checking for recode support""... $ac_c" 1>&6
-echo "configure:81575: checking for recode support" >&5
+echo "configure:81302: checking for recode support" >&5
# Check whether --with-recode or --without-recode was given.
if test "${with_recode+set}" = set; then
withval="$with_recode"
@@ -81737,7 +81464,7 @@ if test "$PHP_RECODE" != "no"; then
done
echo $ac_n "checking for recode_format_table in -lrecode""... $ac_c" 1>&6
-echo "configure:81741: checking for recode_format_table in -lrecode" >&5
+echo "configure:81468: checking for recode_format_table in -lrecode" >&5
ac_lib_var=`echo recode'_'recode_format_table | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -81745,7 +81472,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lrecode $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 81749 "configure"
+#line 81476 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -81756,7 +81483,7 @@ int main() {
recode_format_table()
; return 0; }
EOF
-if { (eval echo configure:81760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:81487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -81885,7 +81612,7 @@ else
LDFLAGS="$LDFLAGS -L$RECODE_DIR/$RECODE_LIB"
LIBS="$LIBS -lrecode"
cat > conftest.$ac_ext <<EOF
-#line 81889 "configure"
+#line 81616 "configure"
#include "confdefs.h"
char *program_name;
@@ -81896,7 +81623,7 @@ recode_format_table();
; return 0; }
EOF
-if { (eval echo configure:81900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:81627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
@@ -82058,17 +81785,17 @@ EOF
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:82062: checking for $ac_hdr" >&5
+echo "configure:81789: 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
-#line 82067 "configure"
+#line 81794 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:82072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:81799: \"$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*
@@ -82381,7 +82108,7 @@ fi
echo $ac_n "checking whether to enable reflection support""... $ac_c" 1>&6
-echo "configure:82385: checking whether to enable reflection support" >&5
+echo "configure:82112: checking whether to enable reflection support" >&5
# Check whether --enable-reflection or --disable-reflection was given.
if test "${enable_reflection+set}" = set; then
enableval="$enable_reflection"
@@ -82404,9 +82131,6 @@ echo "$ac_t""$ext_output" 1>&6
if test "$PHP_REFLECTION" != "no"; then
- if test "$ext_shared" = "yes"; then
- { echo "configure: error: Cannot build reflection as a shared module" 1>&2; exit 1; }
- fi
cat >> confdefs.h <<\EOF
#define HAVE_REFLECTION 1
EOF
@@ -82417,7 +82141,7 @@ EOF
ac_extra=
- if test "" != "shared" && test "" != "yes" && test "" != "cli"; then
+ if test "no" != "shared" && test "no" != "yes" && test "" != "cli"; then
PHP_REFLECTION_SHARED=no
@@ -82463,11 +82187,11 @@ EOF
EXT_STATIC="$EXT_STATIC reflection"
- if test "" != "nocli"; then
+ if test "no" != "nocli"; then
EXT_CLI_STATIC="$EXT_CLI_STATIC reflection"
fi
else
- if test "" = "shared" || test "" = "yes"; then
+ if test "no" = "shared" || test "no" = "yes"; then
PHP_REFLECTION_SHARED=yes
case ext/reflection in
@@ -82585,7 +82309,7 @@ EOF
fi
fi
- if test "" != "shared" && test "" != "yes" && test "" = "cli"; then
+ if test "no" != "shared" && test "no" != "yes" && test "" = "cli"; then
PHP_REFLECTION_SHARED=no
if test "$PHP_SAPI" = "cgi"; then
@@ -82698,7 +82422,7 @@ fi
echo $ac_n "checking whether to enable PHP sessions""... $ac_c" 1>&6
-echo "configure:82702: checking whether to enable PHP sessions" >&5
+echo "configure:82426: checking whether to enable PHP sessions" >&5
# Check whether --enable-session or --disable-session was given.
if test "${enable_session+set}" = set; then
enableval="$enable_session"
@@ -82744,7 +82468,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking for mm support""... $ac_c" 1>&6
-echo "configure:82748: checking for mm support" >&5
+echo "configure:82472: checking for mm support" >&5
# Check whether --with-mm or --without-mm was given.
if test "${with_mm+set}" = set; then
withval="$with_mm"
@@ -82769,7 +82493,7 @@ echo "$ac_t""$ext_output" 1>&6
if test "$PHP_SESSION" != "no"; then
echo $ac_n "checking whether pwrite works""... $ac_c" 1>&6
-echo "configure:82773: checking whether pwrite works" >&5
+echo "configure:82497: checking whether pwrite works" >&5
if eval "test \"`echo '$''{'ac_cv_pwrite'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -82781,7 +82505,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 82785 "configure"
+#line 82509 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -82802,7 +82526,7 @@ else
EOF
-if { (eval echo configure:82806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:82530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_pwrite=yes
@@ -82827,7 +82551,7 @@ fi
else
cat > conftest.$ac_ext <<EOF
-#line 82831 "configure"
+#line 82555 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -82848,7 +82572,7 @@ ssize_t pwrite(int, void *, size_t, off64_t);
EOF
-if { (eval echo configure:82852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:82576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_pwrite=yes
@@ -82889,7 +82613,7 @@ EOF
echo $ac_n "checking whether pread works""... $ac_c" 1>&6
-echo "configure:82893: checking whether pread works" >&5
+echo "configure:82617: checking whether pread works" >&5
if eval "test \"`echo '$''{'ac_cv_pread'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -82902,7 +82626,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 82906 "configure"
+#line 82630 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -82922,7 +82646,7 @@ else
}
EOF
-if { (eval echo configure:82926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:82650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_pread=yes
@@ -82949,7 +82673,7 @@ fi
else
cat > conftest.$ac_ext <<EOF
-#line 82953 "configure"
+#line 82677 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -82969,7 +82693,7 @@ ssize_t pread(int, void *, size_t, off64_t);
}
EOF
-if { (eval echo configure:82973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:82697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_pread=yes
@@ -83482,7 +83206,7 @@ fi
echo $ac_n "checking whether to enable shmop support""... $ac_c" 1>&6
-echo "configure:83486: checking whether to enable shmop support" >&5
+echo "configure:83210: checking whether to enable shmop support" >&5
# Check whether --enable-shmop or --disable-shmop was given.
if test "${enable_shmop+set}" = set; then
enableval="$enable_shmop"
@@ -83817,7 +83541,7 @@ fi
echo $ac_n "checking whether to enable SimpleXML support""... $ac_c" 1>&6
-echo "configure:83821: checking whether to enable SimpleXML support" >&5
+echo "configure:83545: checking whether to enable SimpleXML support" >&5
# Check whether --enable-simplexml or --disable-simplexml was given.
if test "${enable_simplexml+set}" = set; then
enableval="$enable_simplexml"
@@ -83864,7 +83588,7 @@ if test -z "$PHP_LIBXML_DIR"; then
echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6
-echo "configure:83868: checking libxml2 install dir" >&5
+echo "configure:83592: checking libxml2 install dir" >&5
# Check whether --with-libxml-dir or --without-libxml-dir was given.
if test "${with_libxml_dir+set}" = set; then
withval="$with_libxml_dir"
@@ -83895,7 +83619,7 @@ if test "$PHP_SIMPLEXML" != "no"; then
echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6
-echo "configure:83899: checking for xml2-config path" >&5
+echo "configure:83623: checking for xml2-config path" >&5
if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -84052,7 +83776,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6
echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6
-echo "configure:84056: checking whether libxml build works" >&5
+echo "configure:83780: checking whether libxml build works" >&5
if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -84068,7 +83792,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 84072 "configure"
+#line 83796 "configure"
#include "confdefs.h"
@@ -84079,7 +83803,7 @@ else
}
EOF
-if { (eval echo configure:84083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:83807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBS=$old_LIBS
@@ -84455,7 +84179,7 @@ fi
echo $ac_n "checking for SNMP support""... $ac_c" 1>&6
-echo "configure:84459: checking for SNMP support" >&5
+echo "configure:84183: checking for SNMP support" >&5
# Check whether --with-snmp or --without-snmp was given.
if test "${with_snmp+set}" = set; then
withval="$with_snmp"
@@ -84501,7 +84225,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking OpenSSL dir for SNMP""... $ac_c" 1>&6
-echo "configure:84505: checking OpenSSL dir for SNMP" >&5
+echo "configure:84229: checking OpenSSL dir for SNMP" >&5
# Check whether --with-openssl-dir or --without-openssl-dir was given.
if test "${with_openssl_dir+set}" = set; then
withval="$with_openssl_dir"
@@ -84529,7 +84253,7 @@ if test "$PHP_SNMP" != "no"; then
# Extract the first word of "net-snmp-config", so it can be a program name with args.
set dummy net-snmp-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:84533: checking for $ac_word" >&5
+echo "configure:84257: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SNMP_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -84729,17 +84453,17 @@ EOF
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:84733: checking for $ac_hdr" >&5
+echo "configure:84457: 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
-#line 84738 "configure"
+#line 84462 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:84743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:84467: \"$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*
@@ -84767,9 +84491,9 @@ done
if test "$ac_cv_header_default_store_h" = "yes"; then
echo $ac_n "checking for OpenSSL support in SNMP libraries""... $ac_c" 1>&6
-echo "configure:84771: checking for OpenSSL support in SNMP libraries" >&5
+echo "configure:84495: checking for OpenSSL support in SNMP libraries" >&5
cat > conftest.$ac_ext <<EOF
-#line 84773 "configure"
+#line 84497 "configure"
#include "confdefs.h"
#include <ucd-snmp-config.h>
@@ -84824,7 +84548,7 @@ rm -f conftest*
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:84828: checking for $ac_word" >&5
+echo "configure:84552: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -85028,9 +84752,9 @@ fi
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$OPENSSL_INCDIR
echo $ac_n "checking for OpenSSL version""... $ac_c" 1>&6
-echo "configure:85032: checking for OpenSSL version" >&5
+echo "configure:84756: checking for OpenSSL version" >&5
cat > conftest.$ac_ext <<EOF
-#line 85034 "configure"
+#line 84758 "configure"
#include "confdefs.h"
#include <openssl/opensslv.h>
@@ -85184,7 +84908,7 @@ rm -f conftest*
done
echo $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6
-echo "configure:85188: checking for CRYPTO_free in -lcrypto" >&5
+echo "configure:84912: checking for CRYPTO_free in -lcrypto" >&5
ac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -85192,7 +84916,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcrypto $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 85196 "configure"
+#line 84920 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -85203,7 +84927,7 @@ int main() {
CRYPTO_free()
; return 0; }
EOF
-if { (eval echo configure:85207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:84931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -85359,7 +85083,7 @@ fi
done
echo $ac_n "checking for SSL_CTX_set_ssl_version in -lssl""... $ac_c" 1>&6
-echo "configure:85363: checking for SSL_CTX_set_ssl_version in -lssl" >&5
+echo "configure:85087: checking for SSL_CTX_set_ssl_version in -lssl" >&5
ac_lib_var=`echo ssl'_'SSL_CTX_set_ssl_version | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -85367,7 +85091,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lssl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 85371 "configure"
+#line 85095 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -85378,7 +85102,7 @@ int main() {
SSL_CTX_set_ssl_version()
; return 0; }
EOF
-if { (eval echo configure:85382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:85106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -85490,7 +85214,7 @@ else
fi
echo $ac_n "checking for kstat_read in -lkstat""... $ac_c" 1>&6
-echo "configure:85494: checking for kstat_read in -lkstat" >&5
+echo "configure:85218: checking for kstat_read in -lkstat" >&5
ac_lib_var=`echo kstat'_'kstat_read | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -85498,7 +85222,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lkstat $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 85502 "configure"
+#line 85226 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -85509,7 +85233,7 @@ int main() {
kstat_read()
; return 0; }
EOF
-if { (eval echo configure:85513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:85237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -85778,7 +85502,7 @@ fi
done
echo $ac_n "checking for snmp_parse_oid in -l$SNMP_LIBNAME""... $ac_c" 1>&6
-echo "configure:85782: checking for snmp_parse_oid in -l$SNMP_LIBNAME" >&5
+echo "configure:85506: checking for snmp_parse_oid in -l$SNMP_LIBNAME" >&5
ac_lib_var=`echo $SNMP_LIBNAME'_'snmp_parse_oid | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -85786,7 +85510,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$SNMP_LIBNAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 85790 "configure"
+#line 85514 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -85797,7 +85521,7 @@ int main() {
snmp_parse_oid()
; return 0; }
EOF
-if { (eval echo configure:85801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:85525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -85930,7 +85654,7 @@ fi
done
echo $ac_n "checking for init_snmp in -l$SNMP_LIBNAME""... $ac_c" 1>&6
-echo "configure:85934: checking for init_snmp in -l$SNMP_LIBNAME" >&5
+echo "configure:85658: checking for init_snmp in -l$SNMP_LIBNAME" >&5
ac_lib_var=`echo $SNMP_LIBNAME'_'init_snmp | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -85938,7 +85662,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$SNMP_LIBNAME $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 85942 "configure"
+#line 85666 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -85949,7 +85673,7 @@ int main() {
init_snmp()
; return 0; }
EOF
-if { (eval echo configure:85953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:85677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -86274,7 +85998,7 @@ EOF
fi
echo $ac_n "checking whether to enable UCD SNMP hack""... $ac_c" 1>&6
-echo "configure:86278: checking whether to enable UCD SNMP hack" >&5
+echo "configure:86002: checking whether to enable UCD SNMP hack" >&5
# Check whether --enable-ucd-snmp-hack or --disable-ucd-snmp-hack was given.
if test "${enable_ucd_snmp_hack+set}" = set; then
enableval="$enable_ucd_snmp_hack"
@@ -86300,7 +86024,7 @@ fi
echo $ac_n "checking whether to enable SOAP support""... $ac_c" 1>&6
-echo "configure:86304: checking whether to enable SOAP support" >&5
+echo "configure:86028: checking whether to enable SOAP support" >&5
# Check whether --enable-soap or --disable-soap was given.
if test "${enable_soap+set}" = set; then
enableval="$enable_soap"
@@ -86347,7 +86071,7 @@ if test -z "$PHP_LIBXML_DIR"; then
echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6
-echo "configure:86351: checking libxml2 install dir" >&5
+echo "configure:86075: checking libxml2 install dir" >&5
# Check whether --with-libxml-dir or --without-libxml-dir was given.
if test "${with_libxml_dir+set}" = set; then
withval="$with_libxml_dir"
@@ -86378,7 +86102,7 @@ if test "$PHP_SOAP" != "no"; then
echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6
-echo "configure:86382: checking for xml2-config path" >&5
+echo "configure:86106: checking for xml2-config path" >&5
if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -86535,7 +86259,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6
echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6
-echo "configure:86539: checking whether libxml build works" >&5
+echo "configure:86263: checking whether libxml build works" >&5
if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -86551,7 +86275,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 86555 "configure"
+#line 86279 "configure"
#include "confdefs.h"
@@ -86562,7 +86286,7 @@ else
}
EOF
-if { (eval echo configure:86566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:86290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBS=$old_LIBS
@@ -86900,7 +86624,7 @@ fi
echo $ac_n "checking whether to enable sockets support""... $ac_c" 1>&6
-echo "configure:86904: checking whether to enable sockets support" >&5
+echo "configure:86628: checking whether to enable sockets support" >&5
# Check whether --enable-sockets or --disable-sockets was given.
if test "${enable_sockets+set}" = set; then
enableval="$enable_sockets"
@@ -86945,13 +86669,13 @@ echo "$ac_t""$ext_output" 1>&6
if test "$PHP_SOCKETS" != "no"; then
echo $ac_n "checking for struct cmsghdr""... $ac_c" 1>&6
-echo "configure:86949: checking for struct cmsghdr" >&5
+echo "configure:86673: checking for struct cmsghdr" >&5
if eval "test \"`echo '$''{'ac_cv_cmsghdr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 86955 "configure"
+#line 86679 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -86960,7 +86684,7 @@ int main() {
struct cmsghdr s; s
; return 0; }
EOF
-if { (eval echo configure:86964: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:86688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cmsghdr=yes
else
@@ -86985,12 +86709,12 @@ EOF
for ac_func in hstrerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:86989: checking for $ac_func" >&5
+echo "configure:86713: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 86994 "configure"
+#line 86718 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -87013,7 +86737,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:87017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:86741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -87041,17 +86765,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:87045: checking for $ac_hdr" >&5
+echo "configure:86769: 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
-#line 87050 "configure"
+#line 86774 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:87055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:86779: \"$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*
@@ -87078,7 +86802,7 @@ fi
done
cat > conftest.$ac_ext <<EOF
-#line 87082 "configure"
+#line 86806 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -87088,7 +86812,7 @@ int main() {
static struct msghdr tp; int n = (int) tp.msg_flags; return n
; return 0; }
EOF
-if { (eval echo configure:87092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:86816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
:
else
echo "configure: failed program was:" >&5
@@ -87395,12 +87119,12 @@ fi
unset found
echo $ac_n "checking for socketpair""... $ac_c" 1>&6
-echo "configure:87399: checking for socketpair" >&5
+echo "configure:87123: checking for socketpair" >&5
if eval "test \"`echo '$''{'ac_cv_func_socketpair'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 87404 "configure"
+#line 87128 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char socketpair(); below. */
@@ -87423,7 +87147,7 @@ socketpair();
; return 0; }
EOF
-if { (eval echo configure:87427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:87151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_socketpair=yes"
else
@@ -87441,12 +87165,12 @@ if eval "test \"`echo '$ac_cv_func_'socketpair`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __socketpair""... $ac_c" 1>&6
-echo "configure:87445: checking for __socketpair" >&5
+echo "configure:87169: checking for __socketpair" >&5
if eval "test \"`echo '$''{'ac_cv_func___socketpair'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 87450 "configure"
+#line 87174 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __socketpair(); below. */
@@ -87469,7 +87193,7 @@ __socketpair();
; return 0; }
EOF
-if { (eval echo configure:87473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:87197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___socketpair=yes"
else
@@ -87509,12 +87233,12 @@ EOF
unset found
echo $ac_n "checking for gethostbyname2""... $ac_c" 1>&6
-echo "configure:87513: checking for gethostbyname2" >&5
+echo "configure:87237: checking for gethostbyname2" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname2'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 87518 "configure"
+#line 87242 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname2(); below. */
@@ -87537,7 +87261,7 @@ gethostbyname2();
; return 0; }
EOF
-if { (eval echo configure:87541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:87265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname2=yes"
else
@@ -87555,12 +87279,12 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname2`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __gethostbyname2""... $ac_c" 1>&6
-echo "configure:87559: checking for __gethostbyname2" >&5
+echo "configure:87283: checking for __gethostbyname2" >&5
if eval "test \"`echo '$''{'ac_cv_func___gethostbyname2'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 87564 "configure"
+#line 87288 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __gethostbyname2(); below. */
@@ -87583,7 +87307,7 @@ __gethostbyname2();
; return 0; }
EOF
-if { (eval echo configure:87587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:87311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___gethostbyname2=yes"
else
@@ -87623,7 +87347,7 @@ EOF
echo $ac_n "checking enable SPL suppport""... $ac_c" 1>&6
-echo "configure:87627: checking enable SPL suppport" >&5
+echo "configure:87351: checking enable SPL suppport" >&5
# Check whether --enable-spl or --disable-spl was given.
if test "${enable_spl+set}" = set; then
enableval="$enable_spl"
@@ -87667,11 +87391,8 @@ echo "$ac_t""$ext_output" 1>&6
if test "$PHP_SPL" != "no"; then
- if test "$ext_shared" = "yes"; then
- { echo "configure: error: Cannot build SPL as a shared module" 1>&2; exit 1; }
- fi
echo $ac_n "checking whether zend_object_value is packed""... $ac_c" 1>&6
-echo "configure:87675: checking whether zend_object_value is packed" >&5
+echo "configure:87396: checking whether zend_object_value is packed" >&5
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$INCLUDES -I$abs_srcdir $CPPFLAGS"
if test "$cross_compiling" = yes; then
@@ -87681,7 +87402,7 @@ echo "configure:87675: checking whether zend_object_value is packed" >&5
else
cat > conftest.$ac_ext <<EOF
-#line 87685 "configure"
+#line 87406 "configure"
#include "confdefs.h"
#include "Zend/zend_types.h"
@@ -87690,7 +87411,7 @@ int main(int argc, char **argv) {
}
EOF
-if { (eval echo configure:87694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:87415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_result=1
@@ -87723,7 +87444,7 @@ EOF
ac_extra=
- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then
+ if test "no" != "shared" && test "no" != "yes" && test "" != "cli"; then
PHP_SPL_SHARED=no
@@ -87769,11 +87490,11 @@ EOF
EXT_STATIC="$EXT_STATIC spl"
- if test "$ext_shared" != "nocli"; then
+ if test "no" != "nocli"; then
EXT_CLI_STATIC="$EXT_CLI_STATIC spl"
fi
else
- if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then
+ if test "no" = "shared" || test "no" = "yes"; then
PHP_SPL_SHARED=yes
case ext/spl in
@@ -87891,7 +87612,7 @@ EOF
fi
fi
- if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
+ if test "no" != "shared" && test "no" != "yes" && test "" = "cli"; then
PHP_SPL_SHARED=no
if test "$PHP_SAPI" = "cgi"; then
@@ -88004,7 +87725,7 @@ fi
echo $ac_n "checking for sqlite support""... $ac_c" 1>&6
-echo "configure:88008: checking for sqlite support" >&5
+echo "configure:87729: checking for sqlite support" >&5
# Check whether --with-sqlite or --without-sqlite was given.
if test "${with_sqlite+set}" = set; then
withval="$with_sqlite"
@@ -88050,7 +87771,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)""... $ac_c" 1>&6
-echo "configure:88054: checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)" >&5
+echo "configure:87775: checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)" >&5
# Check whether --enable-sqlite-utf8 or --disable-sqlite-utf8 was given.
if test "${enable_sqlite_utf8+set}" = set; then
enableval="$enable_sqlite_utf8"
@@ -88081,13 +87802,13 @@ if test "$PHP_SQLITE" != "no"; then
if test "$PHP_PDO" != "no"; then
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:88085: checking for PDO includes" >&5
+echo "configure:87806: checking for PDO includes" >&5
if eval "test \"`echo '$''{'pdo_inc_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for PDO includes""... $ac_c" 1>&6
-echo "configure:88091: checking for PDO includes" >&5
+echo "configure:87812: checking for PDO includes" >&5
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
@@ -88121,7 +87842,7 @@ EOF
SQLITE_DIR=$PHP_SQLITE
else # search default path list
echo $ac_n "checking for sqlite files in default path""... $ac_c" 1>&6
-echo "configure:88125: checking for sqlite files in default path" >&5
+echo "configure:87846: checking for sqlite files in default path" >&5
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
SQLITE_DIR=$i
@@ -88232,7 +87953,7 @@ echo "configure:88125: checking for sqlite files in default path" >&5
done
echo $ac_n "checking for sqlite_open in -lsqlite""... $ac_c" 1>&6
-echo "configure:88236: checking for sqlite_open in -lsqlite" >&5
+echo "configure:87957: checking for sqlite_open in -lsqlite" >&5
ac_lib_var=`echo sqlite'_'sqlite_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -88240,7 +87961,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsqlite $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 88244 "configure"
+#line 87965 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -88251,7 +87972,7 @@ int main() {
sqlite_open()
; return 0; }
EOF
-if { (eval echo configure:88255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:87976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -88423,7 +88144,7 @@ fi
# Extract the first word of "lemon", so it can be a program name with args.
set dummy lemon; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:88427: checking for $ac_word" >&5
+echo "configure:88148: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEMON'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -88451,7 +88172,7 @@ fi
if test "$LEMON"; then
echo $ac_n "checking for lemon version""... $ac_c" 1>&6
-echo "configure:88455: checking for lemon version" >&5
+echo "configure:88176: checking for lemon version" >&5
if eval "test \"`echo '$''{'php_cv_lemon_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -88853,7 +88574,7 @@ but you've either not enabled pdo, or have disabled it.
echo $ac_n "checking size of char *""... $ac_c" 1>&6
-echo "configure:88857: checking size of char *" >&5
+echo "configure:88578: checking size of char *" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -88861,7 +88582,7 @@ else
ac_cv_sizeof_char_p=4
else
cat > conftest.$ac_ext <<EOF
-#line 88865 "configure"
+#line 88586 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -88872,7 +88593,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:88876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:88597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_char_p=`cat conftestval`
else
@@ -88934,12 +88655,12 @@ EOF
for ac_func in usleep nanosleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:88938: checking for $ac_func" >&5
+echo "configure:88659: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 88943 "configure"
+#line 88664 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -88962,7 +88683,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:88966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:88687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -88990,17 +88711,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:88994: checking for $ac_hdr" >&5
+echo "configure:88715: 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
-#line 88999 "configure"
+#line 88720 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:89004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:88725: \"$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*
@@ -89037,12 +88758,12 @@ fi
for ac_func in getcwd getwd asinh acosh atanh log1p hypot
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:89041: checking for $ac_func" >&5
+echo "configure:88762: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 89046 "configure"
+#line 88767 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -89065,7 +88786,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:89069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:88790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -89094,7 +88815,7 @@ done
if test "$ac_cv_func_crypt" = "no"; then
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:89098: checking for crypt in -lcrypt" >&5
+echo "configure:88819: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -89102,7 +88823,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 89106 "configure"
+#line 88827 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -89113,7 +88834,7 @@ int main() {
crypt()
; return 0; }
EOF
-if { (eval echo configure:89117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:88838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -89142,7 +88863,7 @@ fi
fi
echo $ac_n "checking for standard DES crypt""... $ac_c" 1>&6
-echo "configure:89146: checking for standard DES crypt" >&5
+echo "configure:88867: checking for standard DES crypt" >&5
if eval "test \"`echo '$''{'ac_cv_crypt_des'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -89153,7 +88874,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 89157 "configure"
+#line 88878 "configure"
#include "confdefs.h"
#if HAVE_UNISTD_H
@@ -89172,7 +88893,7 @@ main() {
#endif
}
EOF
-if { (eval echo configure:89176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:88897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_crypt_des=yes
@@ -89203,7 +88924,7 @@ EOF
echo $ac_n "checking for extended DES crypt""... $ac_c" 1>&6
-echo "configure:89207: checking for extended DES crypt" >&5
+echo "configure:88928: checking for extended DES crypt" >&5
if eval "test \"`echo '$''{'ac_cv_crypt_ext_des'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -89214,7 +88935,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 89218 "configure"
+#line 88939 "configure"
#include "confdefs.h"
#if HAVE_UNISTD_H
@@ -89233,7 +88954,7 @@ main() {
#endif
}
EOF
-if { (eval echo configure:89237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:88958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_crypt_ext_des=yes
@@ -89264,7 +88985,7 @@ EOF
echo $ac_n "checking for MD5 crypt""... $ac_c" 1>&6
-echo "configure:89268: checking for MD5 crypt" >&5
+echo "configure:88989: checking for MD5 crypt" >&5
if eval "test \"`echo '$''{'ac_cv_crypt_md5'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -89275,7 +88996,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 89279 "configure"
+#line 89000 "configure"
#include "confdefs.h"
#if HAVE_UNISTD_H
@@ -89303,7 +89024,7 @@ main() {
#endif
}
EOF
-if { (eval echo configure:89307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:89028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_crypt_md5=yes
@@ -89363,7 +89084,7 @@ EOF
echo $ac_n "checking for Blowfish crypt""... $ac_c" 1>&6
-echo "configure:89367: checking for Blowfish crypt" >&5
+echo "configure:89088: checking for Blowfish crypt" >&5
if eval "test \"`echo '$''{'ac_cv_crypt_blowfish'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -89374,7 +89095,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 89378 "configure"
+#line 89099 "configure"
#include "confdefs.h"
#if HAVE_UNISTD_H
@@ -89399,7 +89120,7 @@ main() {
#endif
}
EOF
-if { (eval echo configure:89403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:89124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_crypt_blowfish=yes
@@ -89431,7 +89152,7 @@ EOF
echo $ac_n "checking whether flush should be called explicitly after a buffered io""... $ac_c" 1>&6
-echo "configure:89435: checking whether flush should be called explicitly after a buffered io" >&5
+echo "configure:89156: checking whether flush should be called explicitly after a buffered io" >&5
if eval "test \"`echo '$''{'ac_cv_flush_io'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -89442,7 +89163,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 89446 "configure"
+#line 89167 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -89480,7 +89201,7 @@ int main(int argc, char **argv)
}
EOF
-if { (eval echo configure:89484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:89205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_flush_io=no
@@ -89602,13 +89323,13 @@ EOF
EOF
echo $ac_n "checking whether field re_magic exists in struct regex_t""... $ac_c" 1>&6
-echo "configure:89606: checking whether field re_magic exists in struct regex_t" >&5
+echo "configure:89327: checking whether field re_magic exists in struct regex_t" >&5
if eval "test \"`echo '$''{'ac_cv_regex_t_re_magic'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 89612 "configure"
+#line 89333 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <regex.h>
@@ -89616,7 +89337,7 @@ int main() {
regex_t rt; rt.re_magic;
; return 0; }
EOF
-if { (eval echo configure:89620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:89341: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_regex_t_re_magic=yes
else
@@ -89638,12 +89359,12 @@ EOF
fi
fi
echo $ac_n "checking which regex library to use""... $ac_c" 1>&6
-echo "configure:89642: checking which regex library to use" >&5
+echo "configure:89363: checking which regex library to use" >&5
echo "$ac_t""$REGEX_TYPE" 1>&6
echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6
-echo "configure:89647: checking for working fnmatch" >&5
+echo "configure:89368: checking for working fnmatch" >&5
if eval "test \"`echo '$''{'ac_cv_func_fnmatch_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -89654,11 +89375,11 @@ if test "$cross_compiling" = yes; then
ac_cv_func_fnmatch_works=no
else
cat > conftest.$ac_ext <<EOF
-#line 89658 "configure"
+#line 89379 "configure"
#include "confdefs.h"
main() { exit (fnmatch ("a*", "abc", 0) != 0); }
EOF
-if { (eval echo configure:89662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:89383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_fnmatch_works=yes
else
@@ -89684,7 +89405,7 @@ fi
echo $ac_n "checking whether rounding works as expected""... $ac_c" 1>&6
-echo "configure:89688: checking whether rounding works as expected" >&5
+echo "configure:89409: checking whether rounding works as expected" >&5
if test "$cross_compiling" = yes; then
PHP_ROUND_FUZZ=0.50000000001
@@ -89692,7 +89413,7 @@ if test "$cross_compiling" = yes; then
else
cat > conftest.$ac_ext <<EOF
-#line 89696 "configure"
+#line 89417 "configure"
#include "confdefs.h"
#include <math.h>
@@ -89705,7 +89426,7 @@ else
}
EOF
-if { (eval echo configure:89709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:89430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
PHP_ROUND_FUZZ=0.5
@@ -89737,12 +89458,12 @@ else
for ac_func in fork CreateProcess
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:89741: checking for $ac_func" >&5
+echo "configure:89462: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 89746 "configure"
+#line 89467 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -89765,7 +89486,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:89769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:89490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -89799,7 +89520,7 @@ fi
echo $ac_n "checking if your OS can spawn processes with inherited handles""... $ac_c" 1>&6
-echo "configure:89803: checking if your OS can spawn processes with inherited handles" >&5
+echo "configure:89524: checking if your OS can spawn processes with inherited handles" >&5
if test "$php_can_support_proc_open" = "yes"; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
@@ -89816,12 +89537,12 @@ EOF
for ac_func in glob strfmon nice
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:89820: checking for $ac_func" >&5
+echo "configure:89541: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 89825 "configure"
+#line 89546 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -89844,7 +89565,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:89848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:89569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -89882,12 +89603,12 @@ fi
unset found
echo $ac_n "checking for res_nmkquery""... $ac_c" 1>&6
-echo "configure:89886: checking for res_nmkquery" >&5
+echo "configure:89607: checking for res_nmkquery" >&5
if eval "test \"`echo '$''{'ac_cv_func_res_nmkquery'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 89891 "configure"
+#line 89612 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char res_nmkquery(); below. */
@@ -89910,7 +89631,7 @@ res_nmkquery();
; return 0; }
EOF
-if { (eval echo configure:89914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:89635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_res_nmkquery=yes"
else
@@ -89928,12 +89649,12 @@ if eval "test \"`echo '$ac_cv_func_'res_nmkquery`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __res_nmkquery""... $ac_c" 1>&6
-echo "configure:89932: checking for __res_nmkquery" >&5
+echo "configure:89653: checking for __res_nmkquery" >&5
if eval "test \"`echo '$''{'ac_cv_func___res_nmkquery'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 89937 "configure"
+#line 89658 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __res_nmkquery(); below. */
@@ -89956,7 +89677,7 @@ __res_nmkquery();
; return 0; }
EOF
-if { (eval echo configure:89960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:89681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___res_nmkquery=yes"
else
@@ -89994,7 +89715,7 @@ EOF
unset ac_cv_lib_resolv___res_nmkquery
unset found
echo $ac_n "checking for res_nmkquery in -lresolv""... $ac_c" 1>&6
-echo "configure:89998: checking for res_nmkquery in -lresolv" >&5
+echo "configure:89719: checking for res_nmkquery in -lresolv" >&5
ac_lib_var=`echo resolv'_'res_nmkquery | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -90002,7 +89723,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 90006 "configure"
+#line 89727 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -90013,7 +89734,7 @@ int main() {
res_nmkquery()
; return 0; }
EOF
-if { (eval echo configure:90017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:89738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -90033,7 +89754,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __res_nmkquery in -lresolv""... $ac_c" 1>&6
-echo "configure:90037: checking for __res_nmkquery in -lresolv" >&5
+echo "configure:89758: checking for __res_nmkquery in -lresolv" >&5
ac_lib_var=`echo resolv'_'__res_nmkquery | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -90041,7 +89762,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 90045 "configure"
+#line 89766 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -90052,7 +89773,7 @@ int main() {
__res_nmkquery()
; return 0; }
EOF
-if { (eval echo configure:90056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:89777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -90084,11 +89805,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 90088 "configure"
+#line 89809 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:90092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:89813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -90130,7 +89851,7 @@ EOF
unset ac_cv_lib_bind___res_nmkquery
unset found
echo $ac_n "checking for res_nmkquery in -lbind""... $ac_c" 1>&6
-echo "configure:90134: checking for res_nmkquery in -lbind" >&5
+echo "configure:89855: checking for res_nmkquery in -lbind" >&5
ac_lib_var=`echo bind'_'res_nmkquery | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -90138,7 +89859,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 90142 "configure"
+#line 89863 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -90149,7 +89870,7 @@ int main() {
res_nmkquery()
; return 0; }
EOF
-if { (eval echo configure:90153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:89874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -90169,7 +89890,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __res_nmkquery in -lbind""... $ac_c" 1>&6
-echo "configure:90173: checking for __res_nmkquery in -lbind" >&5
+echo "configure:89894: checking for __res_nmkquery in -lbind" >&5
ac_lib_var=`echo bind'_'__res_nmkquery | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -90177,7 +89898,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 90181 "configure"
+#line 89902 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -90188,7 +89909,7 @@ int main() {
__res_nmkquery()
; return 0; }
EOF
-if { (eval echo configure:90192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:89913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -90220,11 +89941,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 90224 "configure"
+#line 89945 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:90228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:89949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -90266,7 +89987,7 @@ EOF
unset ac_cv_lib_socket___res_nmkquery
unset found
echo $ac_n "checking for res_nmkquery in -lsocket""... $ac_c" 1>&6
-echo "configure:90270: checking for res_nmkquery in -lsocket" >&5
+echo "configure:89991: checking for res_nmkquery in -lsocket" >&5
ac_lib_var=`echo socket'_'res_nmkquery | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -90274,7 +89995,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 90278 "configure"
+#line 89999 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -90285,7 +90006,7 @@ int main() {
res_nmkquery()
; return 0; }
EOF
-if { (eval echo configure:90289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -90305,7 +90026,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __res_nmkquery in -lsocket""... $ac_c" 1>&6
-echo "configure:90309: checking for __res_nmkquery in -lsocket" >&5
+echo "configure:90030: checking for __res_nmkquery in -lsocket" >&5
ac_lib_var=`echo socket'_'__res_nmkquery | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -90313,7 +90034,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 90317 "configure"
+#line 90038 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -90324,7 +90045,7 @@ int main() {
__res_nmkquery()
; return 0; }
EOF
-if { (eval echo configure:90328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -90356,11 +90077,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 90360 "configure"
+#line 90081 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:90364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:90085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -90417,12 +90138,12 @@ EOF
unset found
echo $ac_n "checking for res_nsend""... $ac_c" 1>&6
-echo "configure:90421: checking for res_nsend" >&5
+echo "configure:90142: checking for res_nsend" >&5
if eval "test \"`echo '$''{'ac_cv_func_res_nsend'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 90426 "configure"
+#line 90147 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char res_nsend(); below. */
@@ -90445,7 +90166,7 @@ res_nsend();
; return 0; }
EOF
-if { (eval echo configure:90449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_res_nsend=yes"
else
@@ -90463,12 +90184,12 @@ if eval "test \"`echo '$ac_cv_func_'res_nsend`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __res_nsend""... $ac_c" 1>&6
-echo "configure:90467: checking for __res_nsend" >&5
+echo "configure:90188: checking for __res_nsend" >&5
if eval "test \"`echo '$''{'ac_cv_func___res_nsend'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 90472 "configure"
+#line 90193 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __res_nsend(); below. */
@@ -90491,7 +90212,7 @@ __res_nsend();
; return 0; }
EOF
-if { (eval echo configure:90495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___res_nsend=yes"
else
@@ -90529,7 +90250,7 @@ EOF
unset ac_cv_lib_resolv___res_nsend
unset found
echo $ac_n "checking for res_nsend in -lresolv""... $ac_c" 1>&6
-echo "configure:90533: checking for res_nsend in -lresolv" >&5
+echo "configure:90254: checking for res_nsend in -lresolv" >&5
ac_lib_var=`echo resolv'_'res_nsend | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -90537,7 +90258,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 90541 "configure"
+#line 90262 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -90548,7 +90269,7 @@ int main() {
res_nsend()
; return 0; }
EOF
-if { (eval echo configure:90552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -90568,7 +90289,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __res_nsend in -lresolv""... $ac_c" 1>&6
-echo "configure:90572: checking for __res_nsend in -lresolv" >&5
+echo "configure:90293: checking for __res_nsend in -lresolv" >&5
ac_lib_var=`echo resolv'_'__res_nsend | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -90576,7 +90297,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 90580 "configure"
+#line 90301 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -90587,7 +90308,7 @@ int main() {
__res_nsend()
; return 0; }
EOF
-if { (eval echo configure:90591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -90619,11 +90340,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 90623 "configure"
+#line 90344 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:90627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:90348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -90665,7 +90386,7 @@ EOF
unset ac_cv_lib_bind___res_nsend
unset found
echo $ac_n "checking for res_nsend in -lbind""... $ac_c" 1>&6
-echo "configure:90669: checking for res_nsend in -lbind" >&5
+echo "configure:90390: checking for res_nsend in -lbind" >&5
ac_lib_var=`echo bind'_'res_nsend | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -90673,7 +90394,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 90677 "configure"
+#line 90398 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -90684,7 +90405,7 @@ int main() {
res_nsend()
; return 0; }
EOF
-if { (eval echo configure:90688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -90704,7 +90425,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __res_nsend in -lbind""... $ac_c" 1>&6
-echo "configure:90708: checking for __res_nsend in -lbind" >&5
+echo "configure:90429: checking for __res_nsend in -lbind" >&5
ac_lib_var=`echo bind'_'__res_nsend | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -90712,7 +90433,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 90716 "configure"
+#line 90437 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -90723,7 +90444,7 @@ int main() {
__res_nsend()
; return 0; }
EOF
-if { (eval echo configure:90727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -90755,11 +90476,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 90759 "configure"
+#line 90480 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:90763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:90484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -90801,7 +90522,7 @@ EOF
unset ac_cv_lib_socket___res_nsend
unset found
echo $ac_n "checking for res_nsend in -lsocket""... $ac_c" 1>&6
-echo "configure:90805: checking for res_nsend in -lsocket" >&5
+echo "configure:90526: checking for res_nsend in -lsocket" >&5
ac_lib_var=`echo socket'_'res_nsend | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -90809,7 +90530,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 90813 "configure"
+#line 90534 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -90820,7 +90541,7 @@ int main() {
res_nsend()
; return 0; }
EOF
-if { (eval echo configure:90824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -90840,7 +90561,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __res_nsend in -lsocket""... $ac_c" 1>&6
-echo "configure:90844: checking for __res_nsend in -lsocket" >&5
+echo "configure:90565: checking for __res_nsend in -lsocket" >&5
ac_lib_var=`echo socket'_'__res_nsend | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -90848,7 +90569,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 90852 "configure"
+#line 90573 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -90859,7 +90580,7 @@ int main() {
__res_nsend()
; return 0; }
EOF
-if { (eval echo configure:90863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -90891,11 +90612,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 90895 "configure"
+#line 90616 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:90899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:90620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -90952,12 +90673,12 @@ EOF
unset found
echo $ac_n "checking for dn_expand""... $ac_c" 1>&6
-echo "configure:90956: checking for dn_expand" >&5
+echo "configure:90677: checking for dn_expand" >&5
if eval "test \"`echo '$''{'ac_cv_func_dn_expand'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 90961 "configure"
+#line 90682 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dn_expand(); below. */
@@ -90980,7 +90701,7 @@ dn_expand();
; return 0; }
EOF
-if { (eval echo configure:90984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dn_expand=yes"
else
@@ -90998,12 +90719,12 @@ if eval "test \"`echo '$ac_cv_func_'dn_expand`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __dn_expand""... $ac_c" 1>&6
-echo "configure:91002: checking for __dn_expand" >&5
+echo "configure:90723: checking for __dn_expand" >&5
if eval "test \"`echo '$''{'ac_cv_func___dn_expand'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 91007 "configure"
+#line 90728 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char __dn_expand(); below. */
@@ -91026,7 +90747,7 @@ __dn_expand();
; return 0; }
EOF
-if { (eval echo configure:91030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func___dn_expand=yes"
else
@@ -91064,7 +90785,7 @@ EOF
unset ac_cv_lib_resolv___dn_expand
unset found
echo $ac_n "checking for dn_expand in -lresolv""... $ac_c" 1>&6
-echo "configure:91068: checking for dn_expand in -lresolv" >&5
+echo "configure:90789: checking for dn_expand in -lresolv" >&5
ac_lib_var=`echo resolv'_'dn_expand | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -91072,7 +90793,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 91076 "configure"
+#line 90797 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -91083,7 +90804,7 @@ int main() {
dn_expand()
; return 0; }
EOF
-if { (eval echo configure:91087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -91103,7 +90824,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __dn_expand in -lresolv""... $ac_c" 1>&6
-echo "configure:91107: checking for __dn_expand in -lresolv" >&5
+echo "configure:90828: checking for __dn_expand in -lresolv" >&5
ac_lib_var=`echo resolv'_'__dn_expand | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -91111,7 +90832,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 91115 "configure"
+#line 90836 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -91122,7 +90843,7 @@ int main() {
__dn_expand()
; return 0; }
EOF
-if { (eval echo configure:91126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -91154,11 +90875,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 91158 "configure"
+#line 90879 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:91162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:90883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -91200,7 +90921,7 @@ EOF
unset ac_cv_lib_bind___dn_expand
unset found
echo $ac_n "checking for dn_expand in -lbind""... $ac_c" 1>&6
-echo "configure:91204: checking for dn_expand in -lbind" >&5
+echo "configure:90925: checking for dn_expand in -lbind" >&5
ac_lib_var=`echo bind'_'dn_expand | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -91208,7 +90929,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 91212 "configure"
+#line 90933 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -91219,7 +90940,7 @@ int main() {
dn_expand()
; return 0; }
EOF
-if { (eval echo configure:91223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -91239,7 +90960,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __dn_expand in -lbind""... $ac_c" 1>&6
-echo "configure:91243: checking for __dn_expand in -lbind" >&5
+echo "configure:90964: checking for __dn_expand in -lbind" >&5
ac_lib_var=`echo bind'_'__dn_expand | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -91247,7 +90968,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 91251 "configure"
+#line 90972 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -91258,7 +90979,7 @@ int main() {
__dn_expand()
; return 0; }
EOF
-if { (eval echo configure:91262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:90983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -91290,11 +91011,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 91294 "configure"
+#line 91015 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:91298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:91019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -91336,7 +91057,7 @@ EOF
unset ac_cv_lib_socket___dn_expand
unset found
echo $ac_n "checking for dn_expand in -lsocket""... $ac_c" 1>&6
-echo "configure:91340: checking for dn_expand in -lsocket" >&5
+echo "configure:91061: checking for dn_expand in -lsocket" >&5
ac_lib_var=`echo socket'_'dn_expand | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -91344,7 +91065,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 91348 "configure"
+#line 91069 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -91355,7 +91076,7 @@ int main() {
dn_expand()
; return 0; }
EOF
-if { (eval echo configure:91359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:91080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -91375,7 +91096,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for __dn_expand in -lsocket""... $ac_c" 1>&6
-echo "configure:91379: checking for __dn_expand in -lsocket" >&5
+echo "configure:91100: checking for __dn_expand in -lsocket" >&5
ac_lib_var=`echo socket'_'__dn_expand | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -91383,7 +91104,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 91387 "configure"
+#line 91108 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -91394,7 +91115,7 @@ int main() {
__dn_expand()
; return 0; }
EOF
-if { (eval echo configure:91398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:91119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -91426,11 +91147,11 @@ fi
found=no
else
cat > conftest.$ac_ext <<EOF
-#line 91430 "configure"
+#line 91151 "configure"
#include "confdefs.h"
main() { return (0); }
EOF
-if { (eval echo configure:91434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:91155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
found=yes
else
@@ -91487,12 +91208,12 @@ EOF
for ac_func in fpclass isinf isnan
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:91491: checking for $ac_func" >&5
+echo "configure:91212: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 91496 "configure"
+#line 91217 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -91515,7 +91236,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:91519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:91240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -91541,7 +91262,7 @@ done
echo $ac_n "checking whether atof() accepts NAN""... $ac_c" 1>&6
-echo "configure:91545: checking whether atof() accepts NAN" >&5
+echo "configure:91266: checking whether atof() accepts NAN" >&5
if eval "test \"`echo '$''{'ac_cv_atof_accept_nan'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -91552,7 +91273,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 91556 "configure"
+#line 91277 "configure"
#include "confdefs.h"
#include <math.h>
@@ -91572,7 +91293,7 @@ int main(int argc, char** argv)
}
EOF
-if { (eval echo configure:91576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:91297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_atof_accept_nan=yes
@@ -91600,7 +91321,7 @@ EOF
fi
echo $ac_n "checking whether atof() accepts INF""... $ac_c" 1>&6
-echo "configure:91604: checking whether atof() accepts INF" >&5
+echo "configure:91325: checking whether atof() accepts INF" >&5
if eval "test \"`echo '$''{'ac_cv_atof_accept_inf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -91611,7 +91332,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 91615 "configure"
+#line 91336 "configure"
#include "confdefs.h"
#include <math.h>
@@ -91634,7 +91355,7 @@ int main(int argc, char** argv)
}
EOF
-if { (eval echo configure:91638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:91359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_atof_accept_inf=yes
@@ -91662,7 +91383,7 @@ EOF
fi
echo $ac_n "checking whether HUGE_VAL == INF""... $ac_c" 1>&6
-echo "configure:91666: checking whether HUGE_VAL == INF" >&5
+echo "configure:91387: checking whether HUGE_VAL == INF" >&5
if eval "test \"`echo '$''{'ac_cv_huge_val_inf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -91673,7 +91394,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 91677 "configure"
+#line 91398 "configure"
#include "confdefs.h"
#include <math.h>
@@ -91696,7 +91417,7 @@ int main(int argc, char** argv)
}
EOF
-if { (eval echo configure:91700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:91421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_huge_val_inf=yes
@@ -91724,7 +91445,7 @@ EOF
fi
echo $ac_n "checking whether HUGE_VAL + -HUGEVAL == NAN""... $ac_c" 1>&6
-echo "configure:91728: checking whether HUGE_VAL + -HUGEVAL == NAN" >&5
+echo "configure:91449: checking whether HUGE_VAL + -HUGEVAL == NAN" >&5
if eval "test \"`echo '$''{'ac_cv_huge_val_nan'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -91735,7 +91456,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 91739 "configure"
+#line 91460 "configure"
#include "confdefs.h"
#include <math.h>
@@ -91760,7 +91481,7 @@ int main(int argc, char** argv)
}
EOF
-if { (eval echo configure:91764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:91485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_huge_val_nan=yes
@@ -91787,22 +91508,70 @@ EOF
fi
+echo $ac_n "checking whether strptime() declaration fails""... $ac_c" 1>&6
+echo "configure:91513: checking whether strptime() declaration fails" >&5
+if eval "test \"`echo '$''{'ac_cv_strptime_decl_fails'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.$ac_ext <<EOF
+#line 91519 "configure"
+#include "confdefs.h"
+
+#include <time.h>
+
+int main() {
+
+#ifndef HAVE_STRPTIME
+#error no strptime() on this platform
+#else
+/* use invalid strptime() declaration to see if it fails to compile */
+int strptime(const char *s, const char *format, struct tm *tm);
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:91535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+
+ ac_cv_strptime_decl_fails=no
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+
+ ac_cv_strptime_decl_fails=yes
+
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_strptime_decl_fails" 1>&6
+if test "$ac_cv_strptime_decl_fails" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRPTIME_DECL_FAILS 1
+EOF
+
+fi
+
for ac_hdr in wchar.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:91796: checking for $ac_hdr" >&5
+echo "configure:91565: 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
-#line 91801 "configure"
+#line 91570 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:91806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:91575: \"$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*
@@ -91831,12 +91600,12 @@ done
for ac_func in mblen
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:91835: checking for $ac_func" >&5
+echo "configure:91604: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 91840 "configure"
+#line 91609 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -91859,7 +91628,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:91863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:91632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -91886,12 +91655,12 @@ done
for ac_func in mbrlen mbsinit
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:91890: checking for $ac_func" >&5
+echo "configure:91659: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 91895 "configure"
+#line 91664 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -91914,7 +91683,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:91918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:91687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -91939,13 +91708,13 @@ fi
done
echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-echo "configure:91943: checking for mbstate_t" >&5
+echo "configure:91712: checking for mbstate_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_mbstate_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 91949 "configure"
+#line 91718 "configure"
#include "confdefs.h"
#ifdef HAVE_WCHAR_H
@@ -91958,7 +91727,7 @@ int __tmp__() { mbstate_t a; }
; return 0; }
EOF
-if { (eval echo configure:91962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:91731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_mbstate_t=yes
@@ -92337,7 +92106,7 @@ EOF
echo $ac_n "checking for Sybase support""... $ac_c" 1>&6
-echo "configure:92341: checking for Sybase support" >&5
+echo "configure:92110: checking for Sybase support" >&5
# Check whether --with-sybase or --without-sybase was given.
if test "${with_sybase+set}" = set; then
withval="$with_sybase"
@@ -92797,7 +92566,7 @@ EOF
fi
echo $ac_n "checking for dnet_addr in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:92801: checking for dnet_addr in -ldnet_stub" >&5
+echo "configure:92570: checking for dnet_addr in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_addr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -92805,7 +92574,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 92809 "configure"
+#line 92578 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -92816,7 +92585,7 @@ int main() {
dnet_addr()
; return 0; }
EOF
-if { (eval echo configure:92820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:92589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -92941,7 +92710,7 @@ fi
EOF
echo $ac_n "checking for tdsdbopen in -lsybdb""... $ac_c" 1>&6
-echo "configure:92945: checking for tdsdbopen in -lsybdb" >&5
+echo "configure:92714: checking for tdsdbopen in -lsybdb" >&5
ac_lib_var=`echo sybdb'_'tdsdbopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -92949,7 +92718,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsybdb $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 92953 "configure"
+#line 92722 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -92960,7 +92729,7 @@ int main() {
tdsdbopen()
; return 0; }
EOF
-if { (eval echo configure:92964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:92733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -93001,7 +92770,7 @@ fi
echo $ac_n "checking for Sybase-CT support""... $ac_c" 1>&6
-echo "configure:93005: checking for Sybase-CT support" >&5
+echo "configure:92774: checking for Sybase-CT support" >&5
# Check whether --with-sybase-ct or --without-sybase-ct was given.
if test "${with_sybase_ct+set}" = set; then
withval="$with_sybase_ct"
@@ -93638,7 +93407,7 @@ EOF
done
echo $ac_n "checking for netg_errstr in -ltcl""... $ac_c" 1>&6
-echo "configure:93642: checking for netg_errstr in -ltcl" >&5
+echo "configure:93411: checking for netg_errstr in -ltcl" >&5
ac_lib_var=`echo tcl'_'netg_errstr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -93646,7 +93415,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltcl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 93650 "configure"
+#line 93419 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -93657,7 +93426,7 @@ int main() {
netg_errstr()
; return 0; }
EOF
-if { (eval echo configure:93661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:93430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -93831,7 +93600,7 @@ fi
done
echo $ac_n "checking for insck__getVdate in -linsck""... $ac_c" 1>&6
-echo "configure:93835: checking for insck__getVdate in -linsck" >&5
+echo "configure:93604: checking for insck__getVdate in -linsck" >&5
ac_lib_var=`echo insck'_'insck__getVdate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -93839,7 +93608,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-linsck $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 93843 "configure"
+#line 93612 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -93850,7 +93619,7 @@ int main() {
insck__getVdate()
; return 0; }
EOF
-if { (eval echo configure:93854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:93623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -93997,7 +93766,7 @@ fi
done
echo $ac_n "checking for bsd_tcp in -linsck""... $ac_c" 1>&6
-echo "configure:94001: checking for bsd_tcp in -linsck" >&5
+echo "configure:93770: checking for bsd_tcp in -linsck" >&5
ac_lib_var=`echo insck'_'bsd_tcp | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -94005,7 +93774,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-linsck $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 94009 "configure"
+#line 93778 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -94016,7 +93785,7 @@ int main() {
bsd_tcp()
; return 0; }
EOF
-if { (eval echo configure:94020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:93789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -94075,7 +93844,7 @@ fi
echo $ac_n "checking whether to enable System V IPC support""... $ac_c" 1>&6
-echo "configure:94079: checking whether to enable System V IPC support" >&5
+echo "configure:93848: checking whether to enable System V IPC support" >&5
# Check whether --enable-sysvmsg or --disable-sysvmsg was given.
if test "${enable_sysvmsg+set}" = set; then
enableval="$enable_sysvmsg"
@@ -94119,6 +93888,42 @@ echo "$ac_t""$ext_output" 1>&6
if test "$PHP_SYSVMSG" != "no"; then
+ ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
+echo "configure:93894: checking for sys/msg.h" >&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
+#line 93899 "configure"
+#include "confdefs.h"
+#include <sys/msg.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:93904: \"$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
+ :
+else
+ echo "$ac_t""no" 1>&6
+{ echo "configure: error: Cannot enable System V IPC support, sys/msg.h is missing" 1>&2; exit 1; }
+
+fi
+
+
cat >> confdefs.h <<\EOF
#define HAVE_SYSVMSG 1
EOF
@@ -94410,7 +94215,7 @@ fi
echo $ac_n "checking whether to enable System V semaphore support""... $ac_c" 1>&6
-echo "configure:94414: checking whether to enable System V semaphore support" >&5
+echo "configure:94219: checking whether to enable System V semaphore support" >&5
# Check whether --enable-sysvsem or --disable-sysvsem was given.
if test "${enable_sysvsem+set}" = set; then
enableval="$enable_sysvsem"
@@ -94740,12 +94545,12 @@ EOF
EOF
echo $ac_n "checking for union semun""... $ac_c" 1>&6
-echo "configure:94744: checking for union semun" >&5
+echo "configure:94549: checking for union semun" >&5
if eval "test \"`echo '$''{'php_cv_semun'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 94749 "configure"
+#line 94554 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -94756,7 +94561,7 @@ int main() {
union semun x;
; return 0; }
EOF
-if { (eval echo configure:94760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:94565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
php_cv_semun=yes
@@ -94791,7 +94596,7 @@ fi
echo $ac_n "checking whether to enable System V shared memory support""... $ac_c" 1>&6
-echo "configure:94795: checking whether to enable System V shared memory support" >&5
+echo "configure:94600: checking whether to enable System V shared memory support" >&5
# Check whether --enable-sysvshm or --disable-sysvshm was given.
if test "${enable_sysvshm+set}" = set; then
enableval="$enable_sysvshm"
@@ -95126,7 +94931,7 @@ fi
echo $ac_n "checking for TIDY support""... $ac_c" 1>&6
-echo "configure:95130: checking for TIDY support" >&5
+echo "configure:94935: checking for TIDY support" >&5
# Check whether --with-tidy or --without-tidy was given.
if test "${with_tidy+set}" = set; then
withval="$with_tidy"
@@ -95416,7 +95221,7 @@ if test "$PHP_TIDY" != "no"; then
done
echo $ac_n "checking for tidyOptGetDoc in -ltidy""... $ac_c" 1>&6
-echo "configure:95420: checking for tidyOptGetDoc in -ltidy" >&5
+echo "configure:95225: checking for tidyOptGetDoc in -ltidy" >&5
ac_lib_var=`echo tidy'_'tidyOptGetDoc | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -95424,7 +95229,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltidy $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 95428 "configure"
+#line 95233 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -95435,7 +95240,7 @@ int main() {
tidyOptGetDoc()
; return 0; }
EOF
-if { (eval echo configure:95439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:95244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -95767,7 +95572,7 @@ fi
echo $ac_n "checking whether to enable tokenizer support""... $ac_c" 1>&6
-echo "configure:95771: checking whether to enable tokenizer support" >&5
+echo "configure:95576: checking whether to enable tokenizer support" >&5
# Check whether --enable-tokenizer or --disable-tokenizer was given.
if test "${enable_tokenizer+set}" = set; then
enableval="$enable_tokenizer"
@@ -96104,7 +95909,7 @@ fi
echo $ac_n "checking whether to enable WDDX support""... $ac_c" 1>&6
-echo "configure:96108: checking whether to enable WDDX support" >&5
+echo "configure:95913: checking whether to enable WDDX support" >&5
# Check whether --enable-wddx or --disable-wddx was given.
if test "${enable_wddx+set}" = set; then
enableval="$enable_wddx"
@@ -96147,11 +95952,492 @@ echo "$ac_t""$ext_output" 1>&6
+if test -z "$PHP_LIBXML_DIR"; then
+
+
+echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6
+echo "configure:95960: checking libxml2 install dir" >&5
+# Check whether --with-libxml-dir or --without-libxml-dir was given.
+if test "${with_libxml_dir+set}" = set; then
+ withval="$with_libxml_dir"
+ PHP_LIBXML_DIR=$withval
+else
+
+ PHP_LIBXML_DIR=no
+
+ if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
+ PHP_LIBXML_DIR=$PHP_ENABLE_ALL
+ fi
+
+fi
+
+
+ext_output=$PHP_LIBXML_DIR
+echo "$ac_t""$ext_output" 1>&6
+
+
+
+fi
+
+
+
+echo $ac_n "checking libexpat dir for WDDX""... $ac_c" 1>&6
+echo "configure:95986: checking libexpat dir for WDDX" >&5
+# Check whether --with-libexpat-dir or --without-libexpat-dir was given.
+if test "${with_libexpat_dir+set}" = set; then
+ withval="$with_libexpat_dir"
+ PHP_LIBEXPAT_DIR=$withval
+else
+
+ PHP_LIBEXPAT_DIR=no
+
+ if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
+ PHP_LIBEXPAT_DIR=$PHP_ENABLE_ALL
+ fi
+
+fi
+
+
+ext_output=$PHP_LIBEXPAT_DIR
+echo "$ac_t""$ext_output" 1>&6
+
+
+
+
if test "$PHP_WDDX" != "no"; then
- if test "$ext_shared" != "yes" && (test "$enable_xml" = "no" || test "${enable_xml+set}" != "set"); then
- echo "configure: warning: Activating XML" 1>&2
- enable_xml=yes
+
+ if test "$PHP_LIBEXPAT_DIR" = "no"; then
+ if test "$PHP_LIBXML" = "no"; then
+ { echo "configure: error: WDDX extension requires LIBXML extension, add --enable-libxml" 1>&2; exit 1; }
+ fi
+
+
+echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6
+echo "configure:96017: checking for xml2-config path" >&5
+if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ 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
+
+fi
+
+echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6
+
+ 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`
+
+ for ac_i in $LIBXML_LIBS; do
+ case $ac_i in
+ -pthread)
+ if test "$ext_shared" = "yes"; then
+ WDDX_SHARED_LIBADD="$WDDX_SHARED_LIBADD -pthread"
+ else
+
+
+ unique=`echo $ac_i|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$EXTRA_LDFLAGS$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "EXTRA_LDFLAGS$unique=set"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ac_i"
+ fi
+
+ fi
+ ;;
+ -l*)
+ ac_ii=`echo $ac_i|cut -c 3-`
+
+
+ case $ac_ii in
+ c|c_r|pthread*) ;;
+ *)
+ if test "$ext_shared" = "yes"; then
+ WDDX_SHARED_LIBADD="$WDDX_SHARED_LIBADD -l$ac_ii"
+ else
+
+
+ case $ac_ii in
+ c|c_r|pthread*) ;;
+ *)
+ LIBS="$LIBS -l$ac_ii"
+ ;;
+ esac
+
+
+ fi
+ ;;
+ esac
+
+
+ ;;
+ -L*)
+ ac_ii=`echo $ac_i|cut -c 3-`
+
+ if test "$ac_ii" != "/usr/$PHP_LIBDIR" && test "$ac_ii" != "/usr/lib"; then
+
+ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
+ ai_p=$ac_ii
+ else
+
+ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$ac_ii\"`"
+ fi
+
+
+ if test "$ext_shared" = "yes"; then
+ WDDX_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $WDDX_SHARED_LIBADD"
+ else
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "LIBPATH$unique=set"
+
+ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
+ LDFLAGS="$LDFLAGS -L$ai_p"
+ PHP_RPATHS="$PHP_RPATHS $ai_p"
+
+ fi
+
+
+ fi
+
+ fi
+
+ ;;
+ esac
+ done
+
+
+ for ac_i in $LIBXML_INCS; do
+ case $ac_i in
+ -I*)
+ ac_ii=`echo $ac_i|cut -c 3-`
+
+ if test "$ac_ii" != "/usr/include"; then
+
+ if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
+ ai_p=$ac_ii
+ else
+
+ ep_dir="`echo $ac_ii|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$ac_ii\"`"
fi
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "INCLUDEPATH$unique=set"
+
+ if test ""; then
+ INCLUDES="-I$ai_p $INCLUDES"
+ else
+ INCLUDES="$INCLUDES -I$ai_p"
+ fi
+
+ fi
+
+ fi
+
+ ;;
+ esac
+ done
+
+
+ echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6
+echo "configure:96174: checking whether libxml build works" >&5
+if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ old_LIBS=$LIBS
+ LIBS="
+ $WDDX_SHARED_LIBADD
+ $LIBS"
+ if test "$cross_compiling" = yes; then
+
+ LIBS=$old_LIBS
+
+else
+ cat > conftest.$ac_ext <<EOF
+#line 96190 "configure"
+#include "confdefs.h"
+
+
+ char xmlInitParser();
+ int main() {
+ xmlInitParser();
+ return 0;
+ }
+
+EOF
+if { (eval echo configure:96201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+
+ LIBS=$old_LIBS
+
+ php_cv_libxml_build_works=yes
+
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+
+ LIBS=$old_LIBS
+
+ echo "$ac_t""no" 1>&6
+ { echo "configure: error: build test failed. Please check the config.log for details." 1>&2; exit 1; }
+
+
+fi
+rm -fr conftest*
+fi
+
+
+
+fi
+
+echo "$ac_t""$php_cv_libxml_build_works" 1>&6
+ if test "$php_cv_libxml_build_works" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LIBXML 1
+EOF
+
+ fi
+
+ if test "$PHP_XML" = "no"; then
+
+
+ case ext/xml in
+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ esac
+
+
+
+ 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
+ b_lo=$php_lo
+
+
+ old_IFS=$IFS
+ for ac_src in compat.c; do
+
+ IFS=.
+ set $ac_src
+ ac_obj=$1
+ IFS=$old_IFS
+
+ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"
+
+ case $ac_src in
+ *.c) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.s) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.S) ac_comp="$b_c_pre $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
+ esac
+
+ cat >>Makefile.objects<<EOF
+$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
+ $ac_comp
+EOF
+ done
+
+
+
+
+ BUILD_DIR="$BUILD_DIR ext/xml"
+
+
+ fi
+
+ else
+ { echo "configure: error: libxml2 version 2.6.11 or greater required." 1>&2; exit 1; }
+ fi
+else
+ { echo "configure: error: xml2-config not found. Use --with-libxml-dir=<DIR>" 1>&2; exit 1; }
+
+ fi
+
+ fi
+
+ if test "$PHP_LIBEXPAT_DIR" != "no"; then
+ for i in $PHP_XML $PHP_LIBEXPAT_DIR /usr /usr/local; 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
+ { echo "configure: error: not found. Please reinstall the expat distribution." 1>&2; exit 1; }
+ fi
+
+
+ if test "$EXPAT_DIR/include" != "/usr/include"; then
+
+ if test -z "$EXPAT_DIR/include" || echo "$EXPAT_DIR/include" | grep '^/' >/dev/null ; then
+ ai_p=$EXPAT_DIR/include
+ else
+
+ ep_dir="`echo $EXPAT_DIR/include|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$EXPAT_DIR/include\"`"
+ fi
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "INCLUDEPATH$unique=set"
+
+ if test ""; then
+ INCLUDES="-I$ai_p $INCLUDES"
+ else
+ INCLUDES="$INCLUDES -I$ai_p"
+ fi
+
+ fi
+
+ fi
+
+
+
+ if test "$ext_shared" = "yes"; then
+ WDDX_SHARED_LIBADD="-lexpat $WDDX_SHARED_LIBADD"
+ if test -n "$EXPAT_DIR/$PHP_LIBDIR"; then
+
+ if test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/lib"; then
+
+ if test -z "$EXPAT_DIR/$PHP_LIBDIR" || echo "$EXPAT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then
+ ai_p=$EXPAT_DIR/$PHP_LIBDIR
+ else
+
+ ep_dir="`echo $EXPAT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$EXPAT_DIR/$PHP_LIBDIR\"`"
+ fi
+
+
+ if test "$ext_shared" = "yes"; then
+ WDDX_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $WDDX_SHARED_LIBADD"
+ else
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "LIBPATH$unique=set"
+
+ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
+ LDFLAGS="$LDFLAGS -L$ai_p"
+ PHP_RPATHS="$PHP_RPATHS $ai_p"
+
+ fi
+
+
+ fi
+
+ fi
+
+ fi
+ else
+
+
+ if test -n "$EXPAT_DIR/$PHP_LIBDIR"; then
+
+ if test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/$PHP_LIBDIR" && test "$EXPAT_DIR/$PHP_LIBDIR" != "/usr/lib"; then
+
+ if test -z "$EXPAT_DIR/$PHP_LIBDIR" || echo "$EXPAT_DIR/$PHP_LIBDIR" | grep '^/' >/dev/null ; then
+ ai_p=$EXPAT_DIR/$PHP_LIBDIR
+ else
+
+ ep_dir="`echo $EXPAT_DIR/$PHP_LIBDIR|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$EXPAT_DIR/$PHP_LIBDIR\"`"
+ fi
+
+
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "LIBPATH$unique=set"
+
+ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
+ LDFLAGS="$LDFLAGS -L$ai_p"
+ PHP_RPATHS="$PHP_RPATHS $ai_p"
+
+ fi
+
+
+
+ fi
+
+ fi
+
+
+ case expat in
+ c|c_r|pthread*) ;;
+ *)
+ LIBS="-lexpat $LIBS"
+ ;;
+ esac
+
+
+
+
+ fi
+
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_LIBEXPAT 1
+EOF
+
+ fi
+
cat >> confdefs.h <<\EOF
#define HAVE_WDDX 1
EOF
@@ -96437,13 +96723,35 @@ EOF
fi
+
+ am_i_shared=$PHP_WDDX_SHARED
+ is_it_shared=$PHP_LIBXML_SHARED
+ is_it_enabled=$PHP_LIBXML
+ if test "$am_i_shared" = "no" && test "$is_it_shared" = "yes" ; then
+ { echo "configure: error:
+You've configured extension wddx to build statically, but it
+depends on extension libxml, which you've configured to build shared.
+You either need to build wddx shared or build libxml statically for the
+build to be successful.
+" 1>&2; exit 1; }
+ fi
+ if test "x$is_it_enabled" = "xno" && test "x" != "xtrue"; then
+ { echo "configure: error:
+You've configured extension wddx, which depends on extension libxml,
+but you've either not enabled libxml, or have disabled it.
+" 1>&2; exit 1; }
+ fi
+
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST XMLRPC_SHARED_LIBADD"
+
fi
echo $ac_n "checking whether to enable XML support""... $ac_c" 1>&6
-echo "configure:96447: checking whether to enable XML support" >&5
+echo "configure:96755: checking whether to enable XML support" >&5
# Check whether --enable-xml or --disable-xml was given.
if test "${enable_xml+set}" = set; then
enableval="$enable_xml"
@@ -96490,7 +96798,7 @@ if test -z "$PHP_LIBXML_DIR"; then
echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6
-echo "configure:96494: checking libxml2 install dir" >&5
+echo "configure:96802: checking libxml2 install dir" >&5
# Check whether --with-libxml-dir or --without-libxml-dir was given.
if test "${with_libxml_dir+set}" = set; then
withval="$with_libxml_dir"
@@ -96516,7 +96824,7 @@ fi
echo $ac_n "checking libexpat install dir""... $ac_c" 1>&6
-echo "configure:96520: checking libexpat install dir" >&5
+echo "configure:96828: checking libexpat install dir" >&5
# Check whether --with-libexpat-dir or --without-libexpat-dir was given.
if test "${with_libexpat_dir+set}" = set; then
withval="$with_libexpat_dir"
@@ -96548,7 +96856,7 @@ if test "$PHP_XML" != "no"; then
echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6
-echo "configure:96552: checking for xml2-config path" >&5
+echo "configure:96860: checking for xml2-config path" >&5
if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -96705,7 +97013,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6
echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6
-echo "configure:96709: checking whether libxml build works" >&5
+echo "configure:97017: checking whether libxml build works" >&5
if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -96721,7 +97029,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 96725 "configure"
+#line 97033 "configure"
#include "confdefs.h"
@@ -96732,7 +97040,7 @@ else
}
EOF
-if { (eval echo configure:96736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:97044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBS=$old_LIBS
@@ -97255,7 +97563,7 @@ fi
echo $ac_n "checking whether to enable XMLReader support""... $ac_c" 1>&6
-echo "configure:97259: checking whether to enable XMLReader support" >&5
+echo "configure:97567: checking whether to enable XMLReader support" >&5
# Check whether --enable-xmlreader or --disable-xmlreader was given.
if test "${enable_xmlreader+set}" = set; then
enableval="$enable_xmlreader"
@@ -97302,7 +97610,7 @@ if test -z "$PHP_LIBXML_DIR"; then
echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6
-echo "configure:97306: checking libxml2 install dir" >&5
+echo "configure:97614: checking libxml2 install dir" >&5
# Check whether --with-libxml-dir or --without-libxml-dir was given.
if test "${with_libxml_dir+set}" = set; then
withval="$with_libxml_dir"
@@ -97333,7 +97641,7 @@ if test "$PHP_XMLREADER" != "no"; then
echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6
-echo "configure:97337: checking for xml2-config path" >&5
+echo "configure:97645: checking for xml2-config path" >&5
if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -97490,7 +97798,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6
echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6
-echo "configure:97494: checking whether libxml build works" >&5
+echo "configure:97802: checking whether libxml build works" >&5
if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -97506,7 +97814,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 97510 "configure"
+#line 97818 "configure"
#include "confdefs.h"
@@ -97517,7 +97825,7 @@ else
}
EOF
-if { (eval echo configure:97521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:97829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBS=$old_LIBS
@@ -97887,7 +98195,7 @@ fi
echo $ac_n "checking for XMLRPC-EPI support""... $ac_c" 1>&6
-echo "configure:97891: checking for XMLRPC-EPI support" >&5
+echo "configure:98199: checking for XMLRPC-EPI support" >&5
# Check whether --with-xmlrpc or --without-xmlrpc was given.
if test "${with_xmlrpc+set}" = set; then
withval="$with_xmlrpc"
@@ -97934,7 +98242,7 @@ if test -z "$PHP_LIBXML_DIR"; then
echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6
-echo "configure:97938: checking libxml2 install dir" >&5
+echo "configure:98246: checking libxml2 install dir" >&5
# Check whether --with-libxml-dir or --without-libxml-dir was given.
if test "${with_libxml_dir+set}" = set; then
withval="$with_libxml_dir"
@@ -97960,7 +98268,7 @@ fi
echo $ac_n "checking libexpat dir for XMLRPC-EPI""... $ac_c" 1>&6
-echo "configure:97964: checking libexpat dir for XMLRPC-EPI" >&5
+echo "configure:98272: checking libexpat dir for XMLRPC-EPI" >&5
# Check whether --with-libexpat-dir or --without-libexpat-dir was given.
if test "${with_libexpat_dir+set}" = set; then
withval="$with_libexpat_dir"
@@ -97985,7 +98293,7 @@ echo "$ac_t""$ext_output" 1>&6
echo $ac_n "checking iconv dir for XMLRPC-EPI""... $ac_c" 1>&6
-echo "configure:97989: checking iconv dir for XMLRPC-EPI" >&5
+echo "configure:98297: checking iconv dir for XMLRPC-EPI" >&5
# Check whether --with-iconv-dir or --without-iconv-dir was given.
if test "${with_iconv_dir+set}" = set; then
withval="$with_iconv_dir"
@@ -98044,7 +98352,7 @@ EOF
echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6
-echo "configure:98048: checking for xml2-config path" >&5
+echo "configure:98356: checking for xml2-config path" >&5
if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -98201,7 +98509,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6
echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6
-echo "configure:98205: checking whether libxml build works" >&5
+echo "configure:98513: checking whether libxml build works" >&5
if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -98217,7 +98525,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 98221 "configure"
+#line 98529 "configure"
#include "confdefs.h"
@@ -98228,7 +98536,7 @@ else
}
EOF
-if { (eval echo configure:98232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:98540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBS=$old_LIBS
@@ -98492,12 +98800,12 @@ EOF
if test "$PHP_ICONV" = "yes"; then
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:98496: checking for iconv" >&5
+echo "configure:98804: checking for iconv" >&5
if eval "test \"`echo '$''{'ac_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 98501 "configure"
+#line 98809 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char iconv(); below. */
@@ -98520,7 +98828,7 @@ iconv();
; return 0; }
EOF
-if { (eval echo configure:98524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:98832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_iconv=yes"
else
@@ -98541,12 +98849,12 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for libiconv""... $ac_c" 1>&6
-echo "configure:98545: checking for libiconv" >&5
+echo "configure:98853: checking for libiconv" >&5
if eval "test \"`echo '$''{'ac_cv_func_libiconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 98550 "configure"
+#line 98858 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char libiconv(); below. */
@@ -98569,7 +98877,7 @@ libiconv();
; return 0; }
EOF
-if { (eval echo configure:98573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:98881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_libiconv=yes"
else
@@ -98724,7 +99032,7 @@ EOF
done
echo $ac_n "checking for libiconv in -l$iconv_lib_name""... $ac_c" 1>&6
-echo "configure:98728: checking for libiconv in -l$iconv_lib_name" >&5
+echo "configure:99036: checking for libiconv in -l$iconv_lib_name" >&5
ac_lib_var=`echo $iconv_lib_name'_'libiconv | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -98732,7 +99040,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$iconv_lib_name $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 98736 "configure"
+#line 99044 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -98743,7 +99051,7 @@ int main() {
libiconv()
; return 0; }
EOF
-if { (eval echo configure:98747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:99055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -98876,7 +99184,7 @@ else
done
echo $ac_n "checking for iconv in -l$iconv_lib_name""... $ac_c" 1>&6
-echo "configure:98880: checking for iconv in -l$iconv_lib_name" >&5
+echo "configure:99188: checking for iconv in -l$iconv_lib_name" >&5
ac_lib_var=`echo $iconv_lib_name'_'iconv | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -98884,7 +99192,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$iconv_lib_name $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 98888 "configure"
+#line 99196 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -98895,7 +99203,7 @@ int main() {
iconv()
; return 0; }
EOF
-if { (eval echo configure:98899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:99207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -99083,7 +99391,7 @@ if test "$PHP_XMLRPC" = "yes"; then
# 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:99087: checking for $ac_word" >&5
+echo "configure:99395: 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
@@ -99111,21 +99419,21 @@ else
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:99115: checking for inline" >&5
+echo "configure:99423: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 99122 "configure"
+#line 99430 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:99129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:99437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -99163,12 +99471,12 @@ EOF
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:99167: checking for ANSI C header files" >&5
+echo "configure:99475: 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 <<EOF
-#line 99172 "configure"
+#line 99480 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -99176,7 +99484,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:99180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:99488: \"$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*
@@ -99193,7 +99501,7 @@ 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
-#line 99197 "configure"
+#line 99505 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -99211,7 +99519,7 @@ 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
-#line 99215 "configure"
+#line 99523 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -99232,7 +99540,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 99236 "configure"
+#line 99544 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -99243,7 +99551,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:99247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:99555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -99270,17 +99578,17 @@ for ac_hdr in xmlparse.h xmltok.h stdlib.h strings.h string.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:99274: checking for $ac_hdr" >&5
+echo "configure:99582: 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
-#line 99279 "configure"
+#line 99587 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:99284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:99592: \"$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*
@@ -99312,7 +99620,7 @@ done
echo $ac_n "checking size of char""... $ac_c" 1>&6
-echo "configure:99316: checking size of char" >&5
+echo "configure:99624: checking size of char" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -99320,7 +99628,7 @@ else
ac_cv_sizeof_char=1
else
cat > conftest.$ac_ext <<EOF
-#line 99324 "configure"
+#line 99632 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -99331,7 +99639,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:99335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:99643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_char=`cat conftestval`
else
@@ -99352,7 +99660,7 @@ EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:99356: checking size of int" >&5
+echo "configure:99664: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -99360,7 +99668,7 @@ else
ac_cv_sizeof_int=4
else
cat > conftest.$ac_ext <<EOF
-#line 99364 "configure"
+#line 99672 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -99371,7 +99679,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:99375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:99683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
@@ -99391,7 +99699,7 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:99395: checking size of long" >&5
+echo "configure:99703: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -99399,7 +99707,7 @@ else
ac_cv_sizeof_long=4
else
cat > conftest.$ac_ext <<EOF
-#line 99403 "configure"
+#line 99711 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -99410,7 +99718,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:99414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:99722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
@@ -99430,7 +99738,7 @@ EOF
echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:99434: checking size of long long" >&5
+echo "configure:99742: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -99438,7 +99746,7 @@ else
ac_cv_sizeof_long_long=8
else
cat > conftest.$ac_ext <<EOF
-#line 99442 "configure"
+#line 99750 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
@@ -99449,7 +99757,7 @@ int main()
return(0);
}
EOF
-if { (eval echo configure:99453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:99761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_long=`cat conftestval`
else
@@ -99469,12 +99777,12 @@ EOF
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:99473: checking for size_t" >&5
+echo "configure:99781: 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 <<EOF
-#line 99478 "configure"
+#line 99786 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -99502,12 +99810,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:99506: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:99814: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 99511 "configure"
+#line 99819 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -99516,7 +99824,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:99520: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:99828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -99537,12 +99845,12 @@ EOF
fi
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:99541: checking for uid_t in sys/types.h" >&5
+echo "configure:99849: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 99546 "configure"
+#line 99854 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -99582,12 +99890,12 @@ for ac_func in \
memcpy memmove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:99586: checking for $ac_func" >&5
+echo "configure:99894: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 99591 "configure"
+#line 99899 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -99610,7 +99918,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:99614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:99922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -99953,7 +100261,7 @@ elif test "$PHP_XMLRPC" != "no"; then
XMLRPC_DIR=$PHP_XMLRPC/include/xmlrpc-epi
else
echo $ac_n "checking for XMLRPC-EPI in default path""... $ac_c" 1>&6
-echo "configure:99957: checking for XMLRPC-EPI in default path" >&5
+echo "configure:100265: checking for XMLRPC-EPI in default path" >&5
for i in /usr/local /usr; do
if test -r $i/include/xmlrpc.h; then
XMLRPC_DIR=$i/include
@@ -100383,7 +100691,7 @@ fi
echo $ac_n "checking whether to enable XMLWriter support""... $ac_c" 1>&6
-echo "configure:100387: checking whether to enable XMLWriter support" >&5
+echo "configure:100695: checking whether to enable XMLWriter support" >&5
# Check whether --enable-xmlwriter or --disable-xmlwriter was given.
if test "${enable_xmlwriter+set}" = set; then
enableval="$enable_xmlwriter"
@@ -100430,7 +100738,7 @@ if test -z "$PHP_LIBXML_DIR"; then
echo $ac_n "checking libxml2 install dir""... $ac_c" 1>&6
-echo "configure:100434: checking libxml2 install dir" >&5
+echo "configure:100742: checking libxml2 install dir" >&5
# Check whether --with-libxml-dir or --without-libxml-dir was given.
if test "${with_libxml_dir+set}" = set; then
withval="$with_libxml_dir"
@@ -100461,7 +100769,7 @@ if test "$PHP_XMLWRITER" != "no"; then
echo $ac_n "checking for xml2-config path""... $ac_c" 1>&6
-echo "configure:100465: checking for xml2-config path" >&5
+echo "configure:100773: checking for xml2-config path" >&5
if eval "test \"`echo '$''{'ac_cv_php_xml2_config_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -100618,7 +100926,7 @@ echo "$ac_t""$ac_cv_php_xml2_config_path" 1>&6
echo $ac_n "checking whether libxml build works""... $ac_c" 1>&6
-echo "configure:100622: checking whether libxml build works" >&5
+echo "configure:100930: checking whether libxml build works" >&5
if eval "test \"`echo '$''{'php_cv_libxml_build_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -100634,7 +100942,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 100638 "configure"
+#line 100946 "configure"
#include "confdefs.h"
@@ -100645,7 +100953,7 @@ else
}
EOF
-if { (eval echo configure:100649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:100957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBS=$old_LIBS
@@ -100983,7 +101291,7 @@ fi
echo $ac_n "checking for XSL support""... $ac_c" 1>&6
-echo "configure:100987: checking for XSL support" >&5
+echo "configure:101295: checking for XSL support" >&5
# Check whether --with-xsl or --without-xsl was given.
if test "${with_xsl+set}" = set; then
withval="$with_xsl"
@@ -101044,7 +101352,7 @@ if test "$PHP_XSL" != "no"; then
done
if test -z "$XSLT_CONFIG"; then
- { echo "configure: error: xslt-config not found. Please reinstall the libxslt >= 1.0.18 distribution" 1>&2; exit 1; }
+ { echo "configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution" 1>&2; exit 1; }
else
libxslt_full_version=`$XSLT_CONFIG --version`
ac_IFS=$IFS
@@ -101052,7 +101360,7 @@ if test "$PHP_XSL" != "no"; then
set $libxslt_full_version
IFS=$ac_IFS
LIBXSLT_VERSION=`expr $1 \* 1000000 + $2 \* 1000 + $3`
- if test "$LIBXSLT_VERSION" -ge "1000018"; then
+ if test "$LIBXSLT_VERSION" -ge "1001000"; then
XSL_LIBS=`$XSLT_CONFIG --libs`
XSL_INCS=`$XSLT_CONFIG --cflags`
@@ -101185,7 +101493,7 @@ if test "$PHP_XSL" != "no"; then
echo $ac_n "checking for EXSLT support""... $ac_c" 1>&6
-echo "configure:101189: checking for EXSLT support" >&5
+echo "configure:101497: checking for EXSLT support" >&5
for i in $PHP_XSL /usr/local /usr; do
if test -r "$i/include/libexslt/exslt.h"; then
PHP_XSL_EXSL_DIR=$i
@@ -101329,7 +101637,7 @@ EOF
fi
else
- { echo "configure: error: libxslt version 1.0.18 or greater required." 1>&2; exit 1; }
+ { echo "configure: error: libxslt version 1.1.0 or greater required." 1>&2; exit 1; }
fi
@@ -101645,6 +101953,551 @@ but you've either not enabled libxml, or have disabled it.
fi
+
+
+echo $ac_n "checking for zip archive read/writesupport""... $ac_c" 1>&6
+echo "configure:101960: checking for zip archive read/writesupport" >&5
+# Check whether --enable-zip or --disable-zip was given.
+if test "${enable_zip+set}" = set; then
+ enableval="$enable_zip"
+ PHP_ZIP=$enableval
+else
+
+ PHP_ZIP=no
+
+ if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
+ PHP_ZIP=$PHP_ENABLE_ALL
+ fi
+
+fi
+
+
+
+ext_output="yes, shared"
+ext_shared=yes
+case $PHP_ZIP in
+shared,*)
+ PHP_ZIP=`echo "$PHP_ZIP"|$SED 's/^shared,//'`
+ ;;
+shared)
+ PHP_ZIP=yes
+ ;;
+no)
+ ext_output=no
+ ext_shared=no
+ ;;
+*)
+ ext_output=yes
+ ext_shared=no
+ ;;
+esac
+
+
+
+echo "$ac_t""$ext_output" 1>&6
+
+
+
+
+if test -z "$PHP_ZLIB_DIR"; then
+
+
+echo $ac_n "checking for the location of libz""... $ac_c" 1>&6
+echo "configure:102007: checking for the location of libz" >&5
+# Check whether --with-zlib-dir or --without-zlib-dir was given.
+if test "${with_zlib_dir+set}" = set; then
+ withval="$with_zlib_dir"
+ PHP_ZLIB_DIR=$withval
+else
+
+ PHP_ZLIB_DIR=no
+
+ if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
+ PHP_ZLIB_DIR=$PHP_ENABLE_ALL
+ fi
+
+fi
+
+
+ext_output=$PHP_ZLIB_DIR
+echo "$ac_t""$ext_output" 1>&6
+
+
+
+fi
+
+if test "$PHP_ZIP" != "no"; then
+
+ if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then
+ if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then
+ PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
+ PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib"
+ elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then
+ PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
+ PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include"
+ else
+ { echo "configure: error: Can't find zlib headers under "$PHP_ZLIB_DIR"" 1>&2; exit 1; }
+ fi
+ else
+ for i in /usr/local /usr; do
+ if test -f "$i/include/zlib/zlib.h"; then
+ PHP_ZLIB_DIR="$i"
+ PHP_ZLIB_INCDIR="$i/include/zlib"
+ elif test -f "$i/include/zlib.h"; then
+ PHP_ZLIB_DIR="$i"
+ PHP_ZLIB_INCDIR="$i/include"
+ fi
+ done
+ fi
+
+ echo $ac_n "checking for the location of zlib""... $ac_c" 1>&6
+echo "configure:102055: checking for the location of zlib" >&5
+ if test "$PHP_ZLIB_DIR" = "no"; then
+ { echo "configure: error: zip support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located" 1>&2; exit 1; }
+ else
+ echo "$ac_t""$PHP_ZLIB_DIR" 1>&6
+
+
+ if test "$ext_shared" = "yes"; then
+ ZIP_SHARED_LIBADD="-lz $ZIP_SHARED_LIBADD"
+ if test -n "$PHP_ZLIB_DIR/lib"; then
+
+ if test "$PHP_ZLIB_DIR/lib" != "/usr/$PHP_LIBDIR" && test "$PHP_ZLIB_DIR/lib" != "/usr/lib"; then
+
+ if test -z "$PHP_ZLIB_DIR/lib" || echo "$PHP_ZLIB_DIR/lib" | grep '^/' >/dev/null ; then
+ ai_p=$PHP_ZLIB_DIR/lib
+ else
+
+ ep_dir="`echo $PHP_ZLIB_DIR/lib|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/lib\"`"
+ fi
+
+
+ if test "$ext_shared" = "yes"; then
+ ZIP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ZIP_SHARED_LIBADD"
+ else
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "LIBPATH$unique=set"
+
+ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
+ LDFLAGS="$LDFLAGS -L$ai_p"
+ PHP_RPATHS="$PHP_RPATHS $ai_p"
+
+ fi
+
+
+ fi
+
+ fi
+
+ fi
+ else
+
+
+ if test -n "$PHP_ZLIB_DIR/lib"; then
+
+ if test "$PHP_ZLIB_DIR/lib" != "/usr/$PHP_LIBDIR" && test "$PHP_ZLIB_DIR/lib" != "/usr/lib"; then
+
+ if test -z "$PHP_ZLIB_DIR/lib" || echo "$PHP_ZLIB_DIR/lib" | grep '^/' >/dev/null ; then
+ ai_p=$PHP_ZLIB_DIR/lib
+ else
+
+ ep_dir="`echo $PHP_ZLIB_DIR/lib|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/lib\"`"
+ fi
+
+
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "LIBPATH$unique=set"
+
+ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
+ LDFLAGS="$LDFLAGS -L$ai_p"
+ PHP_RPATHS="$PHP_RPATHS $ai_p"
+
+ fi
+
+
+
+ fi
+
+ fi
+
+
+ case z in
+ c|c_r|pthread*) ;;
+ *)
+ LIBS="-lz $LIBS"
+ ;;
+ esac
+
+
+
+
+ fi
+
+
+
+ if test "$PHP_ZLIB_INCDIR" != "/usr/include"; then
+
+ if test -z "$PHP_ZLIB_INCDIR" || echo "$PHP_ZLIB_INCDIR" | grep '^/' >/dev/null ; then
+ ai_p=$PHP_ZLIB_INCDIR
+ else
+
+ ep_dir="`echo $PHP_ZLIB_INCDIR|$SED 's%/*[^/][^/]*/*$%%'`"
+
+ ep_realdir="`(cd \"$ep_dir\" && pwd)`"
+ ai_p="$ep_realdir/`basename \"$PHP_ZLIB_INCDIR\"`"
+ fi
+
+
+
+ unique=`echo $ai_p|$SED 's/[^a-zA-Z0-9]/_/g'`
+
+ cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
+ if test -n "$unique" && test "`eval $cmd`" = "" ; then
+ eval "INCLUDEPATH$unique=set"
+
+ if test ""; then
+ INCLUDES="-I$ai_p $INCLUDES"
+ else
+ INCLUDES="$INCLUDES -I$ai_p"
+ fi
+
+ fi
+
+ fi
+
+ fi
+
+ PHP_ZIP_SOURCES="$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \
+ lib/zip_fread.c lib/zip_open.c lib/zip_source_filep.c \
+ lib/zip_strerror.c lib/zip_close.c lib/zip_error_get.c \
+ lib/zip_file_error_get.c lib/zip_free.c lib/zip_rename.c \
+ lib/zip_source_free.c lib/zip_unchange_all.c lib/zip_delete.c \
+ lib/zip_error_get_sys_type.c lib/zip_file_get_offset.c \
+ lib/zip_get_name.c lib/zip_replace.c lib/zip_source_function.c \
+ lib/zip_unchange.c lib/zip_dirent.c lib/zip_error_strerror.c \
+ lib/zip_file_strerror.c lib/zip_get_num_files.c \
+ lib/zip_set_name.c lib/zip_source_zip.c lib/zip_unchange_data.c \
+ lib/zip_entry_free.c lib/zip_error_to_str.c lib/zip_fopen.c \
+ lib/zip_name_locate.c lib/zip_source_buffer.c lib/zip_stat.c \
+ lib/zip_entry_new.c lib/zip_err_str.c lib/zip_fopen_index.c \
+ lib/zip_new.c lib/zip_source_file.c lib/zip_stat_index.c lib/zip_get_archive_comment.c \
+ lib/zip_get_file_comment.c lib/zip_set_archive_comment.c lib/zip_set_file_comment.c \
+ lib/zip_unchange_archive.c lib/zip_memdup.c"
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_ZIP 1
+EOF
+
+
+ ext_builddir=ext/zip
+ ext_srcdir=$abs_srcdir/ext/zip
+
+ ac_extra=
+
+ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then
+ PHP_ZIP_SHARED=no
+
+
+ case ext/zip in
+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ esac
+
+
+
+ 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
+ b_lo=$php_lo
+
+
+ old_IFS=$IFS
+ for ac_src in php_zip.c zip_stream.c $PHP_ZIP_SOURCES; do
+
+ IFS=.
+ set $ac_src
+ ac_obj=$1
+ IFS=$old_IFS
+
+ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"
+
+ case $ac_src in
+ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
+ esac
+
+ cat >>Makefile.objects<<EOF
+$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
+ $ac_comp
+EOF
+ done
+
+
+ EXT_STATIC="$EXT_STATIC zip"
+ if test "$ext_shared" != "nocli"; then
+ EXT_CLI_STATIC="$EXT_CLI_STATIC zip"
+ fi
+ else
+ if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then
+ PHP_ZIP_SHARED=yes
+
+ case ext/zip in
+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ esac
+
+
+
+ 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_lo=$shared_lo
+
+
+ old_IFS=$IFS
+ for ac_src in php_zip.c zip_stream.c $PHP_ZIP_SOURCES; do
+
+ IFS=.
+ set $ac_src
+ ac_obj=$1
+ IFS=$old_IFS
+
+ shared_objects_zip="$shared_objects_zip $ac_bdir$ac_obj.lo"
+
+ case $ac_src in
+ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
+ esac
+
+ cat >>Makefile.objects<<EOF
+$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
+ $ac_comp
+EOF
+ done
+
+ case $host_alias in
+ *netware*)
+
+ install_modules="install-modules"
+
+ case $host_alias in
+ *aix*)
+ suffix=so
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/phpzip.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) $(PHPZIP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/phpzip.so '$ext_builddir'/phpzip.so'
+ ;;
+ *netware*)
+ suffix=nlm
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(PHPZIP, 3)_SHARED_LIBADD)'
+ ;;
+ *)
+ suffix=la
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) $(PHPZIP_SHARED_LIBADD)'
+ ;;
+ esac
+
+ PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpzip.$suffix"
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_zip"
+
+ cat >>Makefile.objects<<EOF
+\$(phplibdir)/phpzip.$suffix: $ext_builddir/phpzip.$suffix
+ \$(LIBTOOL) --mode=install cp $ext_builddir/phpzip.$suffix \$(phplibdir)
+
+$ext_builddir/phpzip.$suffix: \$(shared_objects_zip) \$(PHPZIP_SHARED_DEPENDENCIES)
+ $link_cmd
+
+EOF
+
+ ;;
+ *)
+
+ install_modules="install-modules"
+
+ case $host_alias in
+ *aix*)
+ suffix=so
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$ext_builddir'/zip.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) $(ZIP_SHARED_LIBADD) && mv -f '$ext_builddir'/.libs/zip.so '$ext_builddir'/zip.so'
+ ;;
+ *netware*)
+ suffix=nlm
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) -L$(top_builddir)/netware -lphp5lib $(M4_SUBSTR(ZIP, 3)_SHARED_LIBADD)'
+ ;;
+ *)
+ suffix=la
+ link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) $(ZIP_SHARED_LIBADD)'
+ ;;
+ esac
+
+ PHP_MODULES="$PHP_MODULES \$(phplibdir)/zip.$suffix"
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_zip"
+
+ cat >>Makefile.objects<<EOF
+\$(phplibdir)/zip.$suffix: $ext_builddir/zip.$suffix
+ \$(LIBTOOL) --mode=install cp $ext_builddir/zip.$suffix \$(phplibdir)
+
+$ext_builddir/zip.$suffix: \$(shared_objects_zip) \$(ZIP_SHARED_DEPENDENCIES)
+ $link_cmd
+
+EOF
+
+ ;;
+ esac
+ cat >> confdefs.h <<EOF
+#define COMPILE_DL_ZIP 1
+EOF
+
+ fi
+ fi
+
+ if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
+ PHP_ZIP_SHARED=no
+ if test "$PHP_SAPI" = "cgi"; then
+
+
+ case ext/zip in
+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ esac
+
+
+
+ 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
+ b_lo=$php_lo
+
+
+ old_IFS=$IFS
+ for ac_src in php_zip.c zip_stream.c $PHP_ZIP_SOURCES; do
+
+ IFS=.
+ set $ac_src
+ ac_obj=$1
+ IFS=$old_IFS
+
+ PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"
+
+ case $ac_src in
+ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
+ esac
+
+ cat >>Makefile.objects<<EOF
+$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
+ $ac_comp
+EOF
+ done
+
+
+ EXT_STATIC="$EXT_STATIC zip"
+ else
+
+
+ case ext/zip in
+ "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
+ /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
+ *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
+ esac
+
+
+
+ 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
+ b_lo=$php_lo
+
+
+ old_IFS=$IFS
+ for ac_src in php_zip.c zip_stream.c $PHP_ZIP_SOURCES; do
+
+ IFS=.
+ set $ac_src
+ ac_obj=$1
+ IFS=$old_IFS
+
+ PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"
+
+ case $ac_src in
+ *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.s) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.S) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
+ *.cpp|*.cc|*.cxx) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
+ esac
+
+ cat >>Makefile.objects<<EOF
+$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
+ $ac_comp
+EOF
+ done
+
+
+ fi
+ EXT_CLI_STATIC="$EXT_CLI_STATIC zip"
+ fi
+
+
+ BUILD_DIR="$BUILD_DIR $ext_builddir"
+
+
+
+ if test "$ext_builddir" = "."; then
+ PHP_PECL_EXTENSION=zip
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_PECL_EXTENSION"
+
+ fi
+
+
+
+ $php_shtool mkdir -p $ext_builddir/lib
+
+
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST ZIP_SHARED_LIBADD"
+
+fi
+
+
if test "$PHP_RECODE" != "no"; then
test "$PHP_IMAP" != "no" && recode_conflict="$recode_conflict imap"
test "$PHP_MYSQL" != "no" && recode_conflict="$recode_conflict mysql"
@@ -101661,6 +102514,13 @@ if test "$PHP_VERSIONING" = "yes"; then
if test -n "$PHP_MODULES"; then
{ echo "configure: error: --enable-versioning cannot be used with shared modules" 1>&2; exit 1; }
fi
+
+ case $host_alias in
+ *darwin*)
+ { echo "configure: error: --enable-versioning is not supported on your platform" 1>&2; exit 1; }
+ ;;
+ esac
+
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"
@@ -101722,7 +102582,7 @@ fi
echo $ac_n "checking whether to install PEAR""... $ac_c" 1>&6
-echo "configure:101726: checking whether to install PEAR" >&5
+echo "configure:102586: checking whether to install PEAR" >&5
# Check whether --with-pear or --without-pear was given.
if test "${with_pear+set}" = set; then
withval="$with_pear"
@@ -101832,7 +102692,7 @@ fi
bison_version=none
if test "$YACC"; then
echo $ac_n "checking for bison version""... $ac_c" 1>&6
-echo "configure:101836: checking for bison version" >&5
+echo "configure:102696: checking for bison version" >&5
if eval "test \"`echo '$''{'php_cv_bison_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -101889,17 +102749,17 @@ dlfcn.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:101893: checking for $ac_hdr" >&5
+echo "configure:102753: 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
-#line 101898 "configure"
+#line 102758 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:101903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:102763: \"$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*
@@ -101927,12 +102787,12 @@ done
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:101931: checking for size_t" >&5
+echo "configure:102791: 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 <<EOF
-#line 101936 "configure"
+#line 102796 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -101960,12 +102820,12 @@ EOF
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:101964: checking return type of signal handlers" >&5
+echo "configure:102824: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 101969 "configure"
+#line 102829 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -101982,7 +102842,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:101986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:102846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -102006,12 +102866,12 @@ EOF
echo $ac_n "checking for uint""... $ac_c" 1>&6
-echo "configure:102010: checking for uint" >&5
+echo "configure:102870: checking for uint" >&5
if eval "test \"`echo '$''{'ac_cv_type_uint'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 102015 "configure"
+#line 102875 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -102039,12 +102899,12 @@ EOF
fi
echo $ac_n "checking for ulong""... $ac_c" 1>&6
-echo "configure:102043: checking for ulong" >&5
+echo "configure:102903: checking for ulong" >&5
if eval "test \"`echo '$''{'ac_cv_type_ulong'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 102048 "configure"
+#line 102908 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -102074,9 +102934,9 @@ fi
echo $ac_n "checking for int32_t""... $ac_c" 1>&6
-echo "configure:102078: checking for int32_t" >&5
+echo "configure:102938: checking for int32_t" >&5
cat > conftest.$ac_ext <<EOF
-#line 102080 "configure"
+#line 102940 "configure"
#include "confdefs.h"
#if HAVE_SYS_TYPES_H
@@ -102095,7 +102955,7 @@ if (sizeof (int32_t))
; return 0; }
EOF
-if { (eval echo configure:102099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:102959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<EOF
@@ -102114,9 +102974,9 @@ fi
rm -f conftest*
echo $ac_n "checking for uint32_t""... $ac_c" 1>&6
-echo "configure:102118: checking for uint32_t" >&5
+echo "configure:102978: checking for uint32_t" >&5
cat > conftest.$ac_ext <<EOF
-#line 102120 "configure"
+#line 102980 "configure"
#include "confdefs.h"
#if HAVE_SYS_TYPES_H
@@ -102135,7 +102995,7 @@ if (sizeof (uint32_t))
; return 0; }
EOF
-if { (eval echo configure:102139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:102999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<EOF
@@ -102154,12 +103014,12 @@ fi
rm -f conftest*
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:102158: checking for vprintf" >&5
+echo "configure:103018: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 102163 "configure"
+#line 103023 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
@@ -102182,7 +103042,7 @@ vprintf();
; return 0; }
EOF
-if { (eval echo configure:102186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:103046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
@@ -102206,12 +103066,12 @@ fi
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:102210: checking for _doprnt" >&5
+echo "configure:103070: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 102215 "configure"
+#line 103075 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
@@ -102234,7 +103094,7 @@ _doprnt();
; return 0; }
EOF
-if { (eval echo configure:102238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:103098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
@@ -102259,7 +103119,7 @@ fi
fi
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:102263: checking for 8-bit clean memcmp" >&5
+echo "configure:103123: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -102267,7 +103127,7 @@ else
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 102271 "configure"
+#line 103131 "configure"
#include "confdefs.h"
main()
@@ -102277,7 +103137,7 @@ main()
}
EOF
-if { (eval echo configure:102281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:103141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_memcmp_clean=yes
else
@@ -102297,19 +103157,19 @@ test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:102301: checking for working alloca.h" >&5
+echo "configure:103161: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 102306 "configure"
+#line 103166 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:102313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:103173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -102330,12 +103190,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:102334: checking for alloca" >&5
+echo "configure:103194: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 102339 "configure"
+#line 103199 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -102363,7 +103223,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:102367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:103227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -102395,12 +103255,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:102399: checking whether alloca needs Cray hooks" >&5
+echo "configure:103259: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 102404 "configure"
+#line 103264 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -102425,12 +103285,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:102429: checking for $ac_func" >&5
+echo "configure:103289: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 102434 "configure"
+#line 103294 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -102453,7 +103313,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:102457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:103317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -102480,7 +103340,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:102484: checking stack direction for C alloca" >&5
+echo "configure:103344: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -102488,7 +103348,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 102492 "configure"
+#line 103352 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -102507,7 +103367,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:102511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:103371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -102531,12 +103391,12 @@ fi
for ac_func in memcpy strdup getpid kill strtod strtol finite fpclass
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:102535: checking for $ac_func" >&5
+echo "configure:103395: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 102540 "configure"
+#line 103400 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -102559,7 +103419,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:102563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:103423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -102585,7 +103445,7 @@ done
echo $ac_n "checking whether sprintf is broken""... $ac_c" 1>&6
-echo "configure:102589: checking whether sprintf is broken" >&5
+echo "configure:103449: checking whether sprintf is broken" >&5
if eval "test \"`echo '$''{'ac_cv_broken_sprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -102596,11 +103456,11 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 102600 "configure"
+#line 103460 "configure"
#include "confdefs.h"
main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }
EOF
-if { (eval echo configure:102604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:103464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_broken_sprintf=no
@@ -102634,12 +103494,12 @@ EOF
for ac_func in finite isfinite isinf isnan
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:102638: checking for $ac_func" >&5
+echo "configure:103498: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 102643 "configure"
+#line 103503 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -102662,7 +103522,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:102666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:103526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -102689,13 +103549,13 @@ done
echo $ac_n "checking whether fp_except is defined""... $ac_c" 1>&6
-echo "configure:102693: checking whether fp_except is defined" >&5
+echo "configure:103553: checking whether fp_except is defined" >&5
if eval "test \"`echo '$''{'ac_cv_type_fp_except'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 102699 "configure"
+#line 103559 "configure"
#include "confdefs.h"
#include <floatingpoint.h>
@@ -102706,7 +103566,7 @@ fp_except x = (fp_except) 0;
; return 0; }
EOF
-if { (eval echo configure:102710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:103570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_fp_except=yes
@@ -102736,17 +103596,17 @@ for ac_hdr in dlfcn.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:102740: checking for $ac_hdr" >&5
+echo "configure:103600: 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
-#line 102745 "configure"
+#line 103605 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:102750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:103610: \"$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*
@@ -102774,14 +103634,14 @@ done
echo $ac_n "checking whether dlsym() requires a leading underscore in symbol names""... $ac_c" 1>&6
-echo "configure:102778: checking whether dlsym() requires a leading underscore in symbol names" >&5
+echo "configure:103638: checking whether dlsym() requires a leading underscore in symbol names" >&5
if test "$cross_compiling" = yes; then :
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 102785 "configure"
+#line 103645 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -102842,7 +103702,7 @@ int main ()
exit (status);
}
EOF
- if { (eval echo configure:102846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ if { (eval echo configure:103706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
@@ -102885,15 +103745,11 @@ else
fi
-# Check whether --enable-zend-memory-manager or --disable-zend-memory-manager was given.
-if test "${enable_zend_memory_manager+set}" = set; then
- enableval="$enable_zend_memory_manager"
+# Check whether --enable-malloc-mm or --disable-malloc-mm was given.
+if test "${enable_malloc_mm+set}" = set; then
+ enableval="$enable_malloc_mm"
- ZEND_USE_ZEND_ALLOC=$enableval
-
-else
-
- ZEND_USE_ZEND_ALLOC=yes
+ ZEND_USE_MALLOC_MM=$enableval
fi
@@ -102951,31 +103807,27 @@ fi
echo $ac_n "checking virtual machine dispatch method""... $ac_c" 1>&6
-echo "configure:102955: checking virtual machine dispatch method" >&5
+echo "configure:103811: checking virtual machine dispatch method" >&5
echo "$ac_t""$PHP_ZEND_VM" 1>&6
-echo $ac_n "checking whether to enable the Zend memory manager""... $ac_c" 1>&6
-echo "configure:102959: checking whether to enable the Zend memory manager" >&5
-echo "$ac_t""$ZEND_USE_ZEND_ALLOC" 1>&6
-
echo $ac_n "checking whether to enable thread-safety""... $ac_c" 1>&6
-echo "configure:102963: checking whether to enable thread-safety" >&5
+echo "configure:103815: checking whether to enable thread-safety" >&5
echo "$ac_t""$ZEND_MAINTAINER_ZTS" 1>&6
echo $ac_n "checking whether to enable inline optimization for GCC""... $ac_c" 1>&6
-echo "configure:102967: checking whether to enable inline optimization for GCC" >&5
+echo "configure:103819: checking whether to enable inline optimization for GCC" >&5
echo "$ac_t""$ZEND_INLINE_OPTIMIZATION" 1>&6
echo $ac_n "checking whether to enable a memory limit""... $ac_c" 1>&6
-echo "configure:102971: checking whether to enable a memory limit" >&5
+echo "configure:103823: checking whether to enable a memory limit" >&5
echo "$ac_t""$ZEND_MEMORY_LIMIT" 1>&6
echo $ac_n "checking whether to enable Zend debugging""... $ac_c" 1>&6
-echo "configure:102975: checking whether to enable Zend debugging" >&5
+echo "configure:103827: checking whether to enable Zend debugging" >&5
echo "$ac_t""$ZEND_DEBUG" 1>&6
echo $ac_n "checking whether to enable Zend multibyte""... $ac_c" 1>&6
-echo "configure:102979: checking whether to enable Zend multibyte" >&5
+echo "configure:103831: checking whether to enable Zend multibyte" >&5
echo "$ac_t""$ZEND_MULTIBYTE" 1>&6
case $PHP_ZEND_VM in
@@ -103021,18 +103873,6 @@ fi
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
-if test "$ZEND_USE_ZEND_ALLOC" = "yes"; then
- cat >> confdefs.h <<\EOF
-#define USE_ZEND_ALLOC 1
-EOF
-
-else
- cat >> confdefs.h <<\EOF
-#define USE_ZEND_ALLOC 0
-EOF
-
-fi
-
if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
cat >> confdefs.h <<\EOF
#define ZTS 1
@@ -103072,21 +103912,21 @@ fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:103076: checking for inline" >&5
+echo "configure:103916: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 103083 "configure"
+#line 103923 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:103090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:103930: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -103115,7 +103955,7 @@ esac
echo $ac_n "checking target system is Darwin""... $ac_c" 1>&6
-echo "configure:103119: checking target system is Darwin" >&5
+echo "configure:103959: checking target system is Darwin" >&5
if echo "$target" | grep "darwin" > /dev/null; then
cat >> confdefs.h <<\EOF
#define DARWIN 1
@@ -103127,7 +103967,7 @@ else
fi
echo $ac_n "checking for MM alignment and log values""... $ac_c" 1>&6
-echo "configure:103131: checking for MM alignment and log values" >&5
+echo "configure:103971: checking for MM alignment and log values" >&5
if test "$cross_compiling" = yes; then
@@ -103135,7 +103975,7 @@ if test "$cross_compiling" = yes; then
else
cat > conftest.$ac_ext <<EOF
-#line 103139 "configure"
+#line 103979 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -103171,7 +104011,7 @@ int main()
}
EOF
-if { (eval echo configure:103175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:104015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`
@@ -103195,6 +104035,204 @@ fi
echo "$ac_t""done" 1>&6
+echo $ac_n "checking for memory allocation using mmap(MAP_ANON)""... $ac_c" 1>&6
+echo "configure:104040: checking for memory allocation using mmap(MAP_ANON)" >&5
+
+if test "$cross_compiling" = yes; then
+
+ echo "$ac_t""no" 1>&6
+
+else
+ cat > conftest.$ac_ext <<EOF
+#line 104048 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <stdlib.h>
+#include <stdio.h>
+#ifndef MAP_ANON
+# ifdef MAP_ANONYMOUS
+# define MAP_ANON MAP_ANONYMOUS
+# endif
+#endif
+#ifndef MREMAP_MAYMOVE
+# define MREMAP_MAYMOVE 0
+#endif
+#ifndef MAP_FAILED
+# define MAP_FAILED ((void*)-1)
+#endif
+
+#define SEG_SIZE (256*1024)
+
+int main()
+{
+ void *seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (seg == MAP_FAILED) {
+ return 1;
+ }
+ if (munmap(seg, SEG_SIZE) != 0) {
+ return 2;
+ }
+ return 0;
+}
+
+EOF
+if { (eval echo configure:104084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_MEM_MMAP_ANON 1
+EOF
+
+ echo "$ac_t""yes" 1>&6
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+
+ echo "$ac_t""no" 1>&6
+
+fi
+rm -fr conftest*
+fi
+
+
+echo $ac_n "checking for memory allocation using mmap("/dev/zero")""... $ac_c" 1>&6
+echo "configure:104106: checking for memory allocation using mmap("/dev/zero")" >&5
+
+if test "$cross_compiling" = yes; then
+
+ echo "$ac_t""no" 1>&6
+
+else
+ cat > conftest.$ac_ext <<EOF
+#line 104114 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <stdlib.h>
+#include <stdio.h>
+#ifndef MAP_ANON
+# ifdef MAP_ANONYMOUS
+# define MAP_ANON MAP_ANONYMOUS
+# endif
+#endif
+#ifndef MREMAP_MAYMOVE
+# define MREMAP_MAYMOVE 0
+#endif
+#ifndef MAP_FAILED
+# define MAP_FAILED ((void*)-1)
+#endif
+
+#define SEG_SIZE (256*1024)
+
+int main()
+{
+ int fd;
+ void *seg;
+
+ fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
+ if (fd < 0) {
+ return 1;
+ }
+ seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+ if (seg == MAP_FAILED) {
+ return 2;
+ }
+ if (munmap(seg, SEG_SIZE) != 0) {
+ return 3;
+ }
+ if (close(fd) != 0) {
+ return 4;
+ }
+ return 0;
+}
+
+EOF
+if { (eval echo configure:104160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_MEM_MMAP_ZERO 1
+EOF
+
+ echo "$ac_t""yes" 1>&6
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+
+ echo "$ac_t""no" 1>&6
+
+fi
+rm -fr conftest*
+fi
+
+
+for ac_func in mremap
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:104184: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 104189 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* 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_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:104212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
@@ -103237,17 +104275,17 @@ for ac_hdr in stdarg.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:103241: checking for $ac_hdr" >&5
+echo "configure:104279: 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
-#line 103246 "configure"
+#line 104284 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:103251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:104289: \"$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*
@@ -103324,7 +104362,7 @@ if test "$TSRM_PTH" != "no"; then
echo $ac_n "checking for GNU Pth""... $ac_c" 1>&6
-echo "configure:103328: checking for GNU Pth" >&5
+echo "configure:104366: checking for GNU Pth" >&5
PTH_PREFIX="`$TSRM_PTH --prefix`"
if test -z "$PTH_PREFIX"; then
echo "$ac_t""Please check your Pth installation" 1>&6
@@ -103354,17 +104392,17 @@ elif test "$TSRM_ST" != "no"; then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:103358: checking for $ac_hdr" >&5
+echo "configure:104396: 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
-#line 103363 "configure"
+#line 104401 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:103368: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:104406: \"$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*
@@ -103394,7 +104432,7 @@ done
LIBS="$LIBS -lst"
echo $ac_n "checking for SGI's State Threads""... $ac_c" 1>&6
-echo "configure:103398: checking for SGI's State Threads" >&5
+echo "configure:104436: checking for SGI's State Threads" >&5
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define TSRM_ST 1
@@ -103433,7 +104471,7 @@ if test "$cross_compiling" = yes; then
else
cat > conftest.$ac_ext <<EOF
-#line 103437 "configure"
+#line 104475 "configure"
#include "confdefs.h"
#include <pthread.h>
@@ -103451,7 +104489,7 @@ int main() {
return pthread_create(&thd, NULL, thread_routine, &data);
}
EOF
-if { (eval echo configure:103455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:104493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pthreads_working=yes
@@ -103471,7 +104509,7 @@ fi
CFLAGS=$save_CFLAGS
echo $ac_n "checking for pthreads_cflags""... $ac_c" 1>&6
-echo "configure:103475: checking for pthreads_cflags" >&5
+echo "configure:104513: checking for pthreads_cflags" >&5
if eval "test \"`echo '$''{'ac_cv_pthreads_cflags'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -103493,7 +104531,7 @@ if test "$cross_compiling" = yes; then
else
cat > conftest.$ac_ext <<EOF
-#line 103497 "configure"
+#line 104535 "configure"
#include "confdefs.h"
#include <pthread.h>
@@ -103511,7 +104549,7 @@ int main() {
return pthread_create(&thd, NULL, thread_routine, &data);
}
EOF
-if { (eval echo configure:103515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:104553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pthreads_working=yes
@@ -103541,7 +104579,7 @@ fi
echo "$ac_t""$ac_cv_pthreads_cflags" 1>&6
echo $ac_n "checking for pthreads_lib""... $ac_c" 1>&6
-echo "configure:103545: checking for pthreads_lib" >&5
+echo "configure:104583: checking for pthreads_lib" >&5
if eval "test \"`echo '$''{'ac_cv_pthreads_lib'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -103563,7 +104601,7 @@ if test "$cross_compiling" = yes; then
else
cat > conftest.$ac_ext <<EOF
-#line 103567 "configure"
+#line 104605 "configure"
#include "confdefs.h"
#include <pthread.h>
@@ -103581,7 +104619,7 @@ int main() {
return pthread_create(&thd, NULL, thread_routine, &data);
}
EOF
-if { (eval echo configure:103585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:104623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
pthreads_working=yes
@@ -103632,7 +104670,7 @@ EOF
echo $ac_n "checking for POSIX threads""... $ac_c" 1>&6
-echo "configure:103636: checking for POSIX threads" >&5
+echo "configure:104674: checking for POSIX threads" >&5
echo "$ac_t""yes" 1>&6
fi
@@ -104088,6 +105126,12 @@ fi
+
+ PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_VERSION_ID"
+
+
+
+
PHP_VAR_SUBST="$PHP_VAR_SUBST SHELL"
@@ -104214,7 +105258,7 @@ fi
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:104218: checking build system type" >&5
+echo "configure:105262: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -104243,7 +105287,7 @@ ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by $CC""... $ac_c" 1>&6
-echo "configure:104247: checking for ld used by $CC" >&5
+echo "configure:105291: checking for ld used by $CC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -104273,10 +105317,10 @@ echo "configure:104247: checking for ld used by $CC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:104277: checking for GNU ld" >&5
+echo "configure:105321: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:104280: checking for non-GNU ld" >&5
+echo "configure:105324: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -104315,7 +105359,7 @@ else
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:104319: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:105363: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -104335,7 +105379,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:104339: checking for $LD option to reload object files" >&5
+echo "configure:105383: checking for $LD option to reload object files" >&5
if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -104360,7 +105404,7 @@ case $host_os in
esac
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:104364: checking for BSD-compatible nm" >&5
+echo "configure:105408: checking for BSD-compatible nm" >&5
if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -104406,7 +105450,7 @@ echo "$ac_t""$lt_cv_path_NM" 1>&6
NM="$lt_cv_path_NM"
echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
-echo "configure:104410: checking how to recognise dependent libraries" >&5
+echo "configure:105454: checking how to recognise dependent libraries" >&5
if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -104584,13 +105628,13 @@ deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:104588: checking for object suffix" >&5
+echo "configure:105632: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:104594: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:105638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -104610,7 +105654,7 @@ ac_objext=$ac_cv_objext
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:104614: checking for executable suffix" >&5
+echo "configure:105658: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -104620,7 +105664,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:104624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:105668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -104663,7 +105707,7 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:104667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:105711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case `/usr/bin/file conftest.$ac_objext` in
*ELF-32*)
HPUX_IA64_MODE="32"
@@ -104677,8 +105721,8 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 104681 "configure"' > conftest.$ac_ext
- if { (eval echo configure:104682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 105725 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:105726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if test "$lt_cv_prog_gnu_ld" = yes; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
@@ -104711,7 +105755,7 @@ ia64-*-hpux*)
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 configure:104715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:105759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case `/usr/bin/file conftest.o` in
*32-bit*)
case $host in
@@ -104755,7 +105799,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:104759: checking whether the C compiler needs -belf" >&5
+echo "configure:105803: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -104768,14 +105812,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 104772 "configure"
+#line 105816 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:104779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:105823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_needs_belf=yes
else
@@ -104806,13 +105850,207 @@ esac
need_locks="$enable_libtool_lock"
+for ac_prog in $CCC c++ g++ gcc CC cxx cc++ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:105859: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # 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_CXX="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+ echo "$ac_t""$CXX" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CXX" && break
+done
+test -n "$CXX" || CXX="gcc"
+
+
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:105891: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+
+ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 105902 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:105907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cxx_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_cxx_cross=no
+ else
+ ac_cv_prog_cxx_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cxx_works=no
+fi
+rm -fr conftest*
+ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
+if test $ac_cv_prog_cxx_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 ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:105933: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
+cross_compiling=$ac_cv_prog_cxx_cross
+
+echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
+echo "configure:105938: checking whether we are using GNU C++" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.C <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:105947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gxx=yes
+else
+ ac_cv_prog_gxx=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gxx" 1>&6
+
+if test $ac_cv_prog_gxx = yes; then
+ GXX=yes
+else
+ GXX=
+fi
+
+ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ac_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS=
+echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
+echo "configure:105966: checking whether ${CXX-g++} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.cc
+if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
+ ac_cv_prog_cxx_g=yes
+else
+ ac_cv_prog_cxx_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cxx_g" 1>&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 \
+ ''\
+ '#include <stdlib.h>' \
+ '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 <<EOF
+#line 106007 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+$ac_declaration
+int main() {
+exit (42);
+; return 0; }
+EOF
+if { (eval echo configure:106015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ continue
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 106025 "configure"
+#include "confdefs.h"
+$ac_declaration
+int main() {
+exit (42);
+; return 0; }
+EOF
+if { (eval echo configure:106032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+
if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
(test "X$CXX" != "Xg++"))) ; then
echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:104816: checking how to run the C++ preprocessor" >&5
+echo "configure:106054: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -104825,12 +106063,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
CXXCPP="${CXX-g++} -E"
cat > conftest.$ac_ext <<EOF
-#line 104829 "configure"
+#line 106067 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:104834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:106072: \"$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
:
@@ -104861,7 +106099,7 @@ fi
# find the maximum length of command line arguments
echo $ac_n "checking the maximum length of command line arguments""... $ac_c" 1>&6
-echo "configure:104865: checking the maximum length of command line arguments" >&5
+echo "configure:106103: checking the maximum length of command line arguments" >&5
if eval "test \"`echo '$''{'lt_cv_sys_max_cmd_len'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -104962,7 +106200,7 @@ fi
# Check for command to grab the raw symbol name followed by C symbol from nm.
echo $ac_n "checking command to parse $NM output from $compiler object""... $ac_c" 1>&6
-echo "configure:104966: checking command to parse $NM output from $compiler object" >&5
+echo "configure:106204: checking command to parse $NM output from $compiler object" >&5
if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -105057,10 +106295,10 @@ void nm_test_func(){}
int main(){nm_test_var='a';nm_test_func();return(0);}
EOF
- if { (eval echo configure:105061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:106299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
# Now try to grab the symbols.
nlist=conftest.nm
- if { (eval echo configure:105064: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then
+ if { (eval echo configure:106302: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
@@ -105111,7 +106349,7 @@ EOF
lt_save_CFLAGS="$CFLAGS"
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- if { (eval echo configure:105115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ if { (eval echo configure:106353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
LIBS="$lt_save_LIBS"
@@ -105151,7 +106389,7 @@ else
fi
echo $ac_n "checking for objdir""... $ac_c" 1>&6
-echo "configure:105155: checking for objdir" >&5
+echo "configure:106393: checking for objdir" >&5
if eval "test \"`echo '$''{'lt_cv_objdir'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -105217,7 +106455,7 @@ with_gnu_ld="$lt_cv_prog_gnu_ld"
# 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:105221: checking for $ac_word" >&5
+echo "configure:106459: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -105249,7 +106487,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:105253: checking for $ac_word" >&5
+echo "configure:106491: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -105284,7 +106522,7 @@ fi
# 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:105288: checking for $ac_word" >&5
+echo "configure:106526: 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
@@ -105316,7 +106554,7 @@ if test -n "$ac_tool_prefix"; then
# 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:105320: checking for $ac_word" >&5
+echo "configure:106558: 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
@@ -105351,7 +106589,7 @@ fi
# 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:105355: checking for $ac_word" >&5
+echo "configure:106593: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -105383,7 +106621,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:105387: checking for $ac_word" >&5
+echo "configure:106625: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -105469,7 +106707,7 @@ case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:105473: checking for ${ac_tool_prefix}file" >&5
+echo "configure:106711: checking for ${ac_tool_prefix}file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -105529,7 +106767,7 @@ fi
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:105533: checking for file" >&5
+echo "configure:106771: checking for file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -105688,7 +106926,7 @@ fi
# Check to make sure the static flag actually works.
#
echo $ac_n "checking if $compiler static flag $lt_prog_compiler_static works""... $ac_c" 1>&6
-echo "configure:105692: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+echo "configure:106930: checking if $compiler static flag $lt_prog_compiler_static works" >&5
if eval "test \"`echo '$''{'lt_prog_compiler_static_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -105738,7 +106976,7 @@ if test "$GCC" = yes; then
echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
-echo "configure:105742: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo "configure:106980: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
if eval "test \"`echo '$''{'lt_cv_prog_compiler_rtti_exceptions'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -105755,11 +106993,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"configure:105759: $lt_compile\"" >&5)
+ (eval echo "\"configure:106997: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "configure:105763: \$? = $ac_status" >&5
+ echo "configure:107001: \$? = $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.
@@ -105788,7 +107026,7 @@ lt_prog_compiler_pic=
lt_prog_compiler_static=
echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
-echo "configure:105792: checking for $compiler option to produce PIC" >&5
+echo "configure:107030: checking for $compiler option to produce PIC" >&5
if test "$GCC" = yes; then
lt_prog_compiler_wl='-Wl,'
@@ -105999,7 +107237,7 @@ echo "$ac_t""$lt_prog_compiler_pic" 1>&6
if test -n "$lt_prog_compiler_pic"; then
echo $ac_n "checking if $compiler PIC flag $lt_prog_compiler_pic works""... $ac_c" 1>&6
-echo "configure:106003: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo "configure:107241: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
if eval "test \"`echo '$''{'lt_prog_compiler_pic_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -106016,11 +107254,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"configure:106020: $lt_compile\"" >&5)
+ (eval echo "\"configure:107258: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "configure:106024: \$? = $ac_status" >&5
+ echo "configure:107262: \$? = $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.
@@ -106058,7 +107296,7 @@ case $host_os in
esac
echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
-echo "configure:106062: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo "configure:107300: checking if $compiler supports -c -o file.$ac_objext" >&5
if eval "test \"`echo '$''{'lt_cv_prog_compiler_c_o'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -106078,11 +107316,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"configure:106082: $lt_compile\"" >&5)
+ (eval echo "\"configure:107320: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "configure:106086: \$? = $ac_status" >&5
+ echo "configure:107324: \$? = $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
@@ -106112,7 +107350,7 @@ 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 $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
-echo "configure:106116: checking if we can lock with hard links" >&5
+echo "configure:107354: checking if we can lock with hard links" >&5
hard_links=yes
$rm conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
@@ -106129,7 +107367,7 @@ else
fi
echo $ac_n "checking whether the $compiler linker ($LD) supports shared libraries""... $ac_c" 1>&6
-echo "configure:106133: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo "configure:107371: checking whether the $compiler linker ($LD) supports shared libraries" >&5
runpath_var=
allow_undefined_flag=
@@ -106482,12 +107720,12 @@ EOF
# Determine the default libpath from the value encoded in an empty executable.
cat > conftest.$ac_ext <<EOF
-#line 106486 "configure"
+#line 107724 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:106491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:107729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
@@ -106513,12 +107751,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# Determine the default libpath from the value encoded in an empty executable.
cat > conftest.$ac_ext <<EOF
-#line 106517 "configure"
+#line 107755 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:106522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:107760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
@@ -106990,11 +108228,11 @@ x|xyes)
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
-echo "configure:106994: checking whether -lc should be explicitly linked in" >&5
+echo "configure:108232: checking whether -lc should be explicitly linked in" >&5
$rm conftest*
printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- if { (eval echo configure:106998: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } 2>conftest.err; then
+ if { (eval echo configure:108236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } 2>conftest.err; then
soname=conftest
lib=conftest
libobjs=conftest.$ac_objext
@@ -107007,7 +108245,7 @@ echo "configure:106994: checking whether -lc should be explicitly linked in" >&5
libname=conftest
lt_save_allow_undefined_flag=$allow_undefined_flag
allow_undefined_flag=
- if { (eval echo configure:107011: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
+ if { (eval echo configure:108249: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
then
archive_cmds_need_lc=no
else
@@ -107026,7 +108264,7 @@ echo "configure:106994: checking whether -lc should be explicitly linked in" >&5
esac
echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
-echo "configure:107030: checking dynamic linker characteristics" >&5
+echo "configure:108268: checking dynamic linker characteristics" >&5
library_names_spec=
libname_spec='lib$name'
soname_spec=
@@ -107400,8 +108638,8 @@ linux*)
libsuff=
case $host_cpu in
x86_64*|s390x*|powerpc64*)
- echo '#line 107404 "configure"' > conftest.$ac_ext
- if { (eval echo configure:107405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 108642 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:108643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case `/usr/bin/file conftest.$ac_objext` in
*64-bit*)
libsuff=64
@@ -107600,7 +108838,7 @@ echo "$ac_t""$dynamic_linker" 1>&6
test "$dynamic_linker" = no && can_build_shared=no
echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
-echo "configure:107604: checking how to hardcode library paths into programs" >&5
+echo "configure:108842: checking how to hardcode library paths into programs" >&5
hardcode_action=
if test -n "$hardcode_libdir_flag_spec" || \
test -n "$runpath_var" || \
@@ -107638,7 +108876,7 @@ fi
striplib=
old_striplib=
echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
-echo "configure:107642: checking whether stripping libraries is possible" >&5
+echo "configure:108880: checking whether stripping libraries is possible" >&5
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"
@@ -107688,7 +108926,7 @@ else
darwin*)
# if libdl is installed we need to link against it
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:107692: checking for dlopen in -ldl" >&5
+echo "configure:108930: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -107696,7 +108934,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 107700 "configure"
+#line 108938 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -107707,7 +108945,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:107711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:108949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -107736,12 +108974,12 @@ fi
*)
echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "configure:107740: checking for shl_load" >&5
+echo "configure:108978: checking for shl_load" >&5
if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 107745 "configure"
+#line 108983 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load(); below. */
@@ -107764,7 +109002,7 @@ shl_load();
; return 0; }
EOF
-if { (eval echo configure:107768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:109006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shl_load=yes"
else
@@ -107782,7 +109020,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:107786: checking for shl_load in -ldld" >&5
+echo "configure:109024: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -107790,7 +109028,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 107794 "configure"
+#line 109032 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -107801,7 +109039,7 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo configure:107805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:109043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -107820,12 +109058,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:107824: checking for dlopen" >&5
+echo "configure:109062: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 107829 "configure"
+#line 109067 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
@@ -107848,7 +109086,7 @@ dlopen();
; return 0; }
EOF
-if { (eval echo configure:107852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:109090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dlopen=yes"
else
@@ -107866,7 +109104,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:107870: checking for dlopen in -ldl" >&5
+echo "configure:109108: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -107874,7 +109112,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 107878 "configure"
+#line 109116 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -107885,7 +109123,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:107889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:109127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -107904,7 +109142,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
-echo "configure:107908: checking for dlopen in -lsvld" >&5
+echo "configure:109146: checking for dlopen in -lsvld" >&5
ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -107912,7 +109150,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsvld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 107916 "configure"
+#line 109154 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -107923,7 +109161,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:107927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:109165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -107942,7 +109180,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "configure:107946: checking for dld_link in -ldld" >&5
+echo "configure:109184: checking for dld_link in -ldld" >&5
ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -107950,7 +109188,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 107954 "configure"
+#line 109192 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -107961,7 +109199,7 @@ int main() {
dld_link()
; return 0; }
EOF
-if { (eval echo configure:107965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:109203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -108017,7 +109255,7 @@ fi
LIBS="$lt_cv_dlopen_libs $LIBS"
echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
-echo "configure:108021: checking whether a program can dlopen itself" >&5
+echo "configure:109259: checking whether a program can dlopen itself" >&5
if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -108027,7 +109265,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 108031 "configure"
+#line 109269 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -108088,7 +109326,7 @@ int main ()
exit (status);
}
EOF
- if { (eval echo configure:108092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ if { (eval echo configure:109330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
@@ -108111,7 +109349,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6
if test "x$lt_cv_dlopen_self" = xyes; then
LDFLAGS="$LDFLAGS $link_static_flag"
echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
-echo "configure:108115: checking whether a statically linked program can dlopen itself" >&5
+echo "configure:109353: checking whether a statically linked program can dlopen itself" >&5
if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -108121,7 +109359,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 108125 "configure"
+#line 109363 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -108182,7 +109420,7 @@ int main ()
exit (status);
}
EOF
- if { (eval echo configure:108186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ if { (eval echo configure:109424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
@@ -108223,11 +109461,11 @@ fi
# Report which librarie types wil actually be built
echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
-echo "configure:108227: checking if libtool supports shared libraries" >&5
+echo "configure:109465: checking if libtool supports shared libraries" >&5
echo "$ac_t""$can_build_shared" 1>&6
echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
-echo "configure:108231: checking whether to build shared libraries" >&5
+echo "configure:109469: checking whether to build shared libraries" >&5
test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
@@ -108250,7 +109488,7 @@ esac
echo "$ac_t""$enable_shared" 1>&6
echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
-echo "configure:108254: checking whether to build static libraries" >&5
+echo "configure:109492: checking whether to build static libraries" >&5
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
echo "$ac_t""$enable_static" 1>&6
@@ -108919,7 +110157,7 @@ ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by $CC""... $ac_c" 1>&6
-echo "configure:108923: checking for ld used by $CC" >&5
+echo "configure:110161: checking for ld used by $CC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -108949,10 +110187,10 @@ echo "configure:108923: checking for ld used by $CC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:108953: checking for GNU ld" >&5
+echo "configure:110191: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:108956: checking for non-GNU ld" >&5
+echo "configure:110194: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -108991,7 +110229,7 @@ else
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:108995: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:110233: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -109057,7 +110295,7 @@ fi
# PORTME: fill in a description of your system's C++ link characteristics
echo $ac_n "checking whether the $compiler linker ($LD) supports shared libraries""... $ac_c" 1>&6
-echo "configure:109061: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo "configure:110299: checking whether the $compiler linker ($LD) supports shared libraries" >&5
ld_shlibs_CXX=yes
case $host_os in
aix3*)
@@ -109153,12 +110391,12 @@ case $host_os in
# Determine the default libpath from the value encoded in an empty executable.
cat > conftest.$ac_ext <<EOF
-#line 109157 "configure"
+#line 110395 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:109162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:110400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
@@ -109185,12 +110423,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# Determine the default libpath from the value encoded in an empty executable.
cat > conftest.$ac_ext <<EOF
-#line 109189 "configure"
+#line 110427 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:109194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:110432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
@@ -109897,7 +111135,7 @@ private:
};
EOF
-if { (eval echo configure:109901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:111139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
# Parse the compiler output and extract the necessary
# objects, libraries and library flags.
@@ -110007,7 +111245,7 @@ lt_prog_compiler_pic_CXX=
lt_prog_compiler_static_CXX=
echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
-echo "configure:110011: checking for $compiler option to produce PIC" >&5
+echo "configure:111249: checking for $compiler option to produce PIC" >&5
# C++ specific cases for pic, static, wl, etc.
if test "$GXX" = yes; then
@@ -110282,7 +111520,7 @@ echo "$ac_t""$lt_prog_compiler_pic_CXX" 1>&6
if test -n "$lt_prog_compiler_pic_CXX"; then
echo $ac_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works""... $ac_c" 1>&6
-echo "configure:110286: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo "configure:111524: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
if eval "test \"`echo '$''{'lt_prog_compiler_pic_works_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -110299,11 +111537,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"configure:110303: $lt_compile\"" >&5)
+ (eval echo "\"configure:111541: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "configure:110307: \$? = $ac_status" >&5
+ echo "configure:111545: \$? = $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.
@@ -110341,7 +111579,7 @@ case $host_os in
esac
echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
-echo "configure:110345: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo "configure:111583: checking if $compiler supports -c -o file.$ac_objext" >&5
if eval "test \"`echo '$''{'lt_cv_prog_compiler_c_o_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -110361,11 +111599,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"configure:110365: $lt_compile\"" >&5)
+ (eval echo "\"configure:111603: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "configure:110369: \$? = $ac_status" >&5
+ echo "configure:111607: \$? = $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
@@ -110395,7 +111633,7 @@ 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 $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
-echo "configure:110399: checking if we can lock with hard links" >&5
+echo "configure:111637: checking if we can lock with hard links" >&5
hard_links=yes
$rm conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
@@ -110412,7 +111650,7 @@ else
fi
echo $ac_n "checking whether the $compiler linker ($LD) supports shared libraries""... $ac_c" 1>&6
-echo "configure:110416: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo "configure:111654: checking whether the $compiler linker ($LD) supports shared libraries" >&5
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
case $host_os in
@@ -110462,11 +111700,11 @@ x|xyes)
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
-echo "configure:110466: checking whether -lc should be explicitly linked in" >&5
+echo "configure:111704: checking whether -lc should be explicitly linked in" >&5
$rm conftest*
printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- if { (eval echo configure:110470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } 2>conftest.err; then
+ if { (eval echo configure:111708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } 2>conftest.err; then
soname=conftest
lib=conftest
libobjs=conftest.$ac_objext
@@ -110479,7 +111717,7 @@ echo "configure:110466: checking whether -lc should be explicitly linked in" >&5
libname=conftest
lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
allow_undefined_flag_CXX=
- if { (eval echo configure:110483: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
+ if { (eval echo configure:111721: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
then
archive_cmds_need_lc_CXX=no
else
@@ -110498,7 +111736,7 @@ echo "configure:110466: checking whether -lc should be explicitly linked in" >&5
esac
echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
-echo "configure:110502: checking dynamic linker characteristics" >&5
+echo "configure:111740: checking dynamic linker characteristics" >&5
library_names_spec=
libname_spec='lib$name'
soname_spec=
@@ -110872,8 +112110,8 @@ linux*)
libsuff=
case $host_cpu in
x86_64*|s390x*|powerpc64*)
- echo '#line 110876 "configure"' > conftest.$ac_ext
- if { (eval echo configure:110877: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 112114 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:112115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case `/usr/bin/file conftest.$ac_objext` in
*64-bit*)
libsuff=64
@@ -111072,7 +112310,7 @@ echo "$ac_t""$dynamic_linker" 1>&6
test "$dynamic_linker" = no && can_build_shared=no
echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
-echo "configure:111076: checking how to hardcode library paths into programs" >&5
+echo "configure:112314: checking how to hardcode library paths into programs" >&5
hardcode_action_CXX=
if test -n "$hardcode_libdir_flag_spec_CXX" || \
test -n "$runpath_var_CXX" || \
@@ -111110,7 +112348,7 @@ fi
striplib=
old_striplib=
echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
-echo "configure:111114: checking whether stripping libraries is possible" >&5
+echo "configure:112352: checking whether stripping libraries is possible" >&5
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"
@@ -111160,7 +112398,7 @@ else
darwin*)
# if libdl is installed we need to link against it
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:111164: checking for dlopen in -ldl" >&5
+echo "configure:112402: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -111168,7 +112406,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 111172 "configure"
+#line 112410 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
@@ -111182,7 +112420,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:111186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:112424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -111211,12 +112449,12 @@ fi
*)
echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "configure:111215: checking for shl_load" >&5
+echo "configure:112453: checking for shl_load" >&5
if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 111220 "configure"
+#line 112458 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load(); below. */
@@ -111242,7 +112480,7 @@ shl_load();
; return 0; }
EOF
-if { (eval echo configure:111246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:112484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shl_load=yes"
else
@@ -111260,7 +112498,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:111264: checking for shl_load in -ldld" >&5
+echo "configure:112502: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -111268,7 +112506,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 111272 "configure"
+#line 112510 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
@@ -111282,7 +112520,7 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo configure:111286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:112524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -111301,12 +112539,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:111305: checking for dlopen" >&5
+echo "configure:112543: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 111310 "configure"
+#line 112548 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
@@ -111332,7 +112570,7 @@ dlopen();
; return 0; }
EOF
-if { (eval echo configure:111336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:112574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dlopen=yes"
else
@@ -111350,7 +112588,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:111354: checking for dlopen in -ldl" >&5
+echo "configure:112592: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -111358,7 +112596,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 111362 "configure"
+#line 112600 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
@@ -111372,7 +112610,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:111376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:112614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -111391,7 +112629,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
-echo "configure:111395: checking for dlopen in -lsvld" >&5
+echo "configure:112633: checking for dlopen in -lsvld" >&5
ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -111399,7 +112637,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsvld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 111403 "configure"
+#line 112641 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
@@ -111413,7 +112651,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:111417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:112655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -111432,7 +112670,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "configure:111436: checking for dld_link in -ldld" >&5
+echo "configure:112674: checking for dld_link in -ldld" >&5
ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -111440,7 +112678,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 111444 "configure"
+#line 112682 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
@@ -111454,7 +112692,7 @@ int main() {
dld_link()
; return 0; }
EOF
-if { (eval echo configure:111458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:112696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -111510,7 +112748,7 @@ fi
LIBS="$lt_cv_dlopen_libs $LIBS"
echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
-echo "configure:111514: checking whether a program can dlopen itself" >&5
+echo "configure:112752: checking whether a program can dlopen itself" >&5
if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -111520,7 +112758,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 111524 "configure"
+#line 112762 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -111581,7 +112819,7 @@ int main ()
exit (status);
}
EOF
- if { (eval echo configure:111585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ if { (eval echo configure:112823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
@@ -111604,7 +112842,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6
if test "x$lt_cv_dlopen_self" = xyes; then
LDFLAGS="$LDFLAGS $link_static_flag"
echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
-echo "configure:111608: checking whether a statically linked program can dlopen itself" >&5
+echo "configure:112846: checking whether a statically linked program can dlopen itself" >&5
if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -111614,7 +112852,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 111618 "configure"
+#line 112856 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -111675,7 +112913,7 @@ int main ()
exit (status);
}
EOF
- if { (eval echo configure:111679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ if { (eval echo configure:112917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
@@ -112946,20 +114184,14 @@ s%@LEXLIB@%$LEXLIB%g
s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g
s%@SHLIB_SUFFIX_NAME@%$SHLIB_SUFFIX_NAME%g
s%@SHLIB_DL_SUFFIX_NAME@%$SHLIB_DL_SUFFIX_NAME%g
-s%@PTHREAD_CC@%$PTHREAD_CC%g
-s%@PTHREAD_LIBS@%$PTHREAD_LIBS%g
-s%@PTHREAD_CFLAGS@%$PTHREAD_CFLAGS%g
-s%@THREADED@%$THREADED%g
-s%@LIBOBJS@%$LIBOBJS%g
s%@PROG_SENDMAIL@%$PROG_SENDMAIL%g
+s%@LIBOBJS@%$LIBOBJS%g
s%@ALLOCA@%$ALLOCA%g
s%@LTP@%$LTP%g
s%@LTP_GENHTML@%$LTP_GENHTML%g
s%@KRB5_CONFIG@%$KRB5_CONFIG%g
s%@PKG_CONFIG@%$PKG_CONFIG%g
s%@OPENSSL_INCDIR_OPT@%$OPENSSL_INCDIR_OPT%g
-s%@CXX@%$CXX%g
-s%@CXXCPP@%$CXXCPP%g
s%@MYSQL_MODULE_TYPE@%$MYSQL_MODULE_TYPE%g
s%@MYSQL_LIBS@%$MYSQL_LIBS%g
s%@MYSQL_INCLUDE@%$MYSQL_INCLUDE%g
@@ -113009,6 +114241,7 @@ s%@PEAR_INSTALLDIR@%$PEAR_INSTALLDIR%g
s%@PHP_LDFLAGS@%$PHP_LDFLAGS%g
s%@PHP_LIBS@%$PHP_LIBS%g
s%@PHP_VERSION@%$PHP_VERSION%g
+s%@PHP_VERSION_ID@%$PHP_VERSION_ID%g
s%@build@%$build%g
s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
@@ -113019,6 +114252,8 @@ s%@EXEEXT@%$EXEEXT%g
s%@ECHO@%$ECHO%g
s%@AR@%$AR%g
s%@STRIP@%$STRIP%g
+s%@CXX@%$CXX%g
+s%@CXXCPP@%$CXXCPP%g
s%@LIBTOOL@%$LIBTOOL%g
CEOF
diff --git a/configure.in b/configure.in
index ad10964a3..842daea42 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
- ## $Id: configure.in,v 1.579.2.56 2006/08/23 13:17:36 iliaa Exp $ -*- autoconf -*-
+ ## $Id: configure.in,v 1.579.2.52.2.24 2006/10/30 23:06:22 iliaa Exp $ -*- autoconf -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -10,6 +10,8 @@ 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
@@ -40,10 +42,11 @@ PHP_CANONICAL_HOST_TARGET
AC_CONFIG_HEADER(main/php_config.h)
MAJOR_VERSION=5
-MINOR_VERSION=1
-RELEASE_VERSION=6
+MINOR_VERSION=2
+RELEASE_VERSION=0
EXTRA_VERSION=""
-VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
+PHP_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
+PHP_VERSION_ID=`expr [$]MAJOR_VERSION \* 10000 + [$]MINOR_VERSION \* 100 + [$]RELEASE_VERSION`
dnl Define where extension directories are located in the configure context
AC_DEFUN([PHP_EXT_BUILDDIR],[ext/$1])dnl
@@ -54,7 +57,6 @@ 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
@@ -62,6 +64,7 @@ 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
+echo "#define PHP_VERSION_ID $PHP_VERSION_ID" >> 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 && \
@@ -208,6 +211,7 @@ dnl Include Zend and TSRM configurations.
dnl -------------------------------------------------------------------------
sinclude(Zend/Zend.m4)
+sinclude(TSRM/threads.m4)
sinclude(TSRM/tsrm.m4)
@@ -372,6 +376,7 @@ sys/vfs.h \
sys/sysexits.h \
sys/varargs.h \
sys/wait.h \
+sys/loadavg.h \
termios.h \
unistd.h \
unix.h \
@@ -503,6 +508,7 @@ scandir \
setitimer \
setlocale \
localeconv \
+setenv \
setpgid \
setsockopt \
setvbuf \
@@ -659,10 +665,12 @@ if test "$PHP_GCOV" = "yes"; then
dnl Remove all optimization flags from CFLAGS
changequote({,})
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+ CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
changequote([,])
dnl Add the special gcc flags
CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
+ CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
fi
PHP_ARG_ENABLE(debug, whether to include debugging symbols,
@@ -671,6 +679,12 @@ PHP_ARG_ENABLE(debug, whether to include debugging symbols,
if test "$PHP_DEBUG" = "yes"; then
PHP_DEBUG=1
ZEND_DEBUG=yes
+ changequote({,})
+ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+ CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
+ changequote([,])
+ CFLAGS="$CFLAGS -O0"
+ CXXFLAGS="$CXXFLAGS -O0"
else
PHP_DEBUG=0
ZEND_DEBUG=no
@@ -874,6 +888,13 @@ if test "$PHP_VERSIONING" = "yes"; then
if test -n "$PHP_MODULES"; then
AC_MSG_ERROR([--enable-versioning cannot be used with shared modules])
fi
+
+ case $host_alias in
+ *darwin*)
+ AC_MSG_ERROR([--enable-versioning is not supported on your platform])
+ ;;
+ esac
+
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"
@@ -1192,6 +1213,7 @@ PHP_SUBST(OVERALL_TARGET)
PHP_SUBST(PHP_RPATHS)
PHP_SUBST(PHP_SAPI)
PHP_SUBST_OLD(PHP_VERSION)
+PHP_SUBST_OLD(PHP_VERSION_ID)
PHP_SUBST(SHELL)
PHP_SUBST(SHARED_LIBTOOL)
PHP_SUBST(WARNING_LEVEL)
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index 2f7b95d21..fc8d4ee66 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: bcmath.c,v 1.62.2.2 2006/01/01 12:50:00 sniper Exp $ */
+/* $Id: bcmath.c,v 1.62.2.2.2.2 2006/06/15 18:33:06 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -32,18 +32,89 @@
#include "libbcmath/src/bcmath.h"
ZEND_DECLARE_MODULE_GLOBALS(bcmath);
+static PHP_GINIT_FUNCTION(bcmath);
+
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bcadd, 0, 0, 2)
+ ZEND_ARG_INFO(0, left_operand)
+ ZEND_ARG_INFO(0, right_operand)
+ ZEND_ARG_INFO(0, scale)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bcsub, 0, 0, 2)
+ ZEND_ARG_INFO(0, left_operand)
+ ZEND_ARG_INFO(0, right_operand)
+ ZEND_ARG_INFO(0, scale)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bcmul, 0, 0, 2)
+ ZEND_ARG_INFO(0, left_operand)
+ ZEND_ARG_INFO(0, right_operand)
+ ZEND_ARG_INFO(0, scale)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bcdiv, 0, 0, 2)
+ ZEND_ARG_INFO(0, left_operand)
+ ZEND_ARG_INFO(0, right_operand)
+ ZEND_ARG_INFO(0, scale)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_bcmod, 0)
+ ZEND_ARG_INFO(0, left_operand)
+ ZEND_ARG_INFO(0, right_operand)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bcpowmod, 0, 0, 3)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ ZEND_ARG_INFO(0, mod)
+ ZEND_ARG_INFO(0, scale)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bcpow, 0, 0, 2)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ ZEND_ARG_INFO(0, scale)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bcsqrt, 0, 0, 1)
+ ZEND_ARG_INFO(0, operand)
+ ZEND_ARG_INFO(0, scale)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bccomp, 0, 0, 2)
+ ZEND_ARG_INFO(0, left_operand)
+ ZEND_ARG_INFO(0, right_operand)
+ ZEND_ARG_INFO(0, scale)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_bcscale, 0)
+ ZEND_ARG_INFO(0, scale)
+ZEND_END_ARG_INFO()
+
+/* }}} */
zend_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)
+ PHP_FE(bcadd, arginfo_bcadd)
+ PHP_FE(bcsub, arginfo_bcsub)
+ PHP_FE(bcmul, arginfo_bcmul)
+ PHP_FE(bcdiv, arginfo_bcdiv)
+ PHP_FE(bcmod, arginfo_bcmod)
+ PHP_FE(bcpow, arginfo_bcpow)
+ PHP_FE(bcsqrt, arginfo_bcsqrt)
+ PHP_FE(bcscale, arginfo_bcscale)
+ PHP_FE(bccomp, arginfo_bccomp)
+ PHP_FE(bcpowmod, arginfo_bcpowmod)
{NULL, NULL, NULL}
};
@@ -57,7 +128,11 @@ zend_module_entry bcmath_module_entry = {
PHP_RSHUTDOWN(bcmath),
PHP_MINFO(bcmath),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(bcmath),
+ PHP_GINIT(bcmath),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
#ifdef COMPILE_DL_BCMATH
@@ -70,9 +145,9 @@ PHP_INI_BEGIN()
PHP_INI_END()
/* }}} */
-/* {{{ php_bcmath_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
-static void php_bcmath_init_globals(zend_bcmath_globals *bcmath_globals)
+static PHP_GINIT_FUNCTION(bcmath)
{
bcmath_globals->bc_precision = 0;
}
@@ -82,8 +157,6 @@ static void php_bcmath_init_globals(zend_bcmath_globals *bcmath_globals)
*/
PHP_MINIT_FUNCTION(bcmath)
{
- ZEND_INIT_MODULE_GLOBALS(bcmath, php_bcmath_init_globals, NULL);
-
REGISTER_INI_ENTRIES();
return SUCCESS;
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index 9dbf51655..b598bdd96 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: bz2.c,v 1.14.2.3 2006/01/01 12:50:00 sniper Exp $ */
+/* $Id: bz2.c,v 1.14.2.3.2.8 2006/08/17 20:46:51 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -40,17 +40,71 @@
#define PHP_BZ_ERRSTR 1
#define PHP_BZ_ERRBOTH 2
-zend_function_entry bz2_functions[] = {
- PHP_FE(bzopen, NULL)
- PHP_FE(bzread, NULL)
+static PHP_MINIT_FUNCTION(bz2);
+static PHP_MSHUTDOWN_FUNCTION(bz2);
+static PHP_MINFO_FUNCTION(bz2);
+static PHP_FUNCTION(bzopen);
+static PHP_FUNCTION(bzread);
+static PHP_FUNCTION(bzerrno);
+static PHP_FUNCTION(bzerrstr);
+static PHP_FUNCTION(bzerror);
+static PHP_FUNCTION(bzcompress);
+static PHP_FUNCTION(bzdecompress);
+
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bzread, 0, 0, 1)
+ ZEND_ARG_INFO(0, bz)
+ ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_bzopen, 0)
+ ZEND_ARG_INFO(0, file)
+ ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_bzerrno, 0)
+ ZEND_ARG_INFO(0, bz)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_bzerrstr, 0)
+ ZEND_ARG_INFO(0, bz)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_bzerror, 0)
+ ZEND_ARG_INFO(0, bz)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bzcompress, 0, 0, 2)
+ ZEND_ARG_INFO(0, source)
+ ZEND_ARG_INFO(0, blocksize)
+ ZEND_ARG_INFO(0, workfactor)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bzdecompress, 0, 0, 1)
+ ZEND_ARG_INFO(0, source)
+ ZEND_ARG_INFO(0, small)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
+static zend_function_entry bz2_functions[] = {
+ PHP_FE(bzopen, arginfo_bzopen)
+ PHP_FE(bzread, arginfo_bzread)
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)
+ PHP_FE(bzerrno, arginfo_bzerrno)
+ PHP_FE(bzerrstr, arginfo_bzerrstr)
+ PHP_FE(bzerror, arginfo_bzerror)
+ PHP_FE(bzcompress, arginfo_bzcompress)
+ PHP_FE(bzdecompress, arginfo_bzdecompress)
{NULL, NULL, NULL}
};
@@ -162,7 +216,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
if (strncasecmp("compress.bzip2://", path, 17) == 0) {
path += 17;
}
- if (mode[0] != 'w' && mode[0] != 'r' && mode[1] != '\0') {
+ if (mode[0] == '\0' || (mode[0] != 'w' && mode[0] != 'r' && mode[1] != '\0')) {
return NULL;
}
@@ -229,7 +283,7 @@ static php_stream_wrapper_ops bzip2_stream_wops = {
NULL /* rmdir */
};
-php_stream_wrapper php_stream_bzip2_wrapper = {
+static php_stream_wrapper php_stream_bzip2_wrapper = {
&bzip2_stream_wops,
NULL,
0 /* is_url */
@@ -237,14 +291,14 @@ php_stream_wrapper php_stream_bzip2_wrapper = {
static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int);
-PHP_MINIT_FUNCTION(bz2)
+static 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)
+static PHP_MSHUTDOWN_FUNCTION(bz2)
{
php_unregister_url_stream_wrapper("compress.bzip2" TSRMLS_CC);
php_stream_filter_unregister_factory("bzip2.*" TSRMLS_CC);
@@ -252,7 +306,7 @@ PHP_MSHUTDOWN_FUNCTION(bz2)
return SUCCESS;
}
-PHP_MINFO_FUNCTION(bz2)
+static PHP_MINFO_FUNCTION(bz2)
{
php_info_print_table_start();
php_info_print_table_row(2, "BZip2 Support", "Enabled");
@@ -262,9 +316,9 @@ PHP_MINFO_FUNCTION(bz2)
php_info_print_table_end();
}
-/* {{{ proto string bzread(int bz[, int length])
+/* {{{ proto string bzread(resource bz[, int length])
Reads up to length bytes from a BZip2 stream, or 1024 bytes if length is not specified */
-PHP_FUNCTION(bzread)
+static PHP_FUNCTION(bzread)
{
zval *bz;
long len = 1024;
@@ -304,7 +358,7 @@ PHP_FUNCTION(bzread)
/* {{{ proto resource bzopen(string|int file|fp, string mode)
Opens a new BZip2 stream */
-PHP_FUNCTION(bzopen)
+static PHP_FUNCTION(bzopen)
{
zval **file, /* The file to open */
**mode; /* The mode to open the stream with */
@@ -316,7 +370,7 @@ PHP_FUNCTION(bzopen)
}
convert_to_string_ex(mode);
- if (Z_STRVAL_PP(mode)[0] != 'r' && Z_STRVAL_PP(mode)[0] != 'w' && Z_STRVAL_PP(mode)[1] != '\0') {
+ if (Z_STRLEN_PP(mode) != 1 || (Z_STRVAL_PP(mode)[0] != 'r' && Z_STRVAL_PP(mode)[0] != 'w')) {
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;
}
@@ -324,6 +378,12 @@ PHP_FUNCTION(bzopen)
/* 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);
+
+ if (Z_STRLEN_PP(file) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty");
+ RETURN_FALSE;
+ }
+
stream = php_stream_bz2open(NULL,
Z_STRVAL_PP(file),
Z_STRVAL_PP(mode),
@@ -332,8 +392,40 @@ PHP_FUNCTION(bzopen)
} else {
/* If it is a resource, than its a stream resource */
int fd;
+ int stream_mode_len;
php_stream_from_zval(stream, file);
+ stream_mode_len = strlen(stream->mode);
+
+ if (stream_mode_len != 1 && !(stream_mode_len == 2 && memchr(stream->mode, 'b', 2))) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode);
+ RETURN_FALSE;
+ } else if (stream_mode_len == 1 && stream->mode[0] != 'r' && stream->mode[0] != 'w' && stream->mode[0] != 'a' && stream->mode[0] != 'x') {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode);
+ RETURN_FALSE;
+ }
+
+ switch(Z_STRVAL_PP(mode)[0]) {
+ case 'r':
+ /* only "r" and "rb" are supported */
+ if (stream->mode[0] != Z_STRVAL_PP(mode)[0] && !(stream_mode_len == 2 && stream->mode[1] != Z_STRVAL_PP(mode)[0])) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot read from a stream opened in write only mode");
+ RETURN_FALSE;
+ }
+ break;
+ case 'w':
+ /* support only "w"(b), "a"(b), "x"(b) */
+ if (stream->mode[0] != Z_STRVAL_PP(mode)[0] && !(stream_mode_len == 2 && stream->mode[1] != Z_STRVAL_PP(mode)[0])
+ && stream->mode[0] != 'a' && !(stream_mode_len == 2 && stream->mode[1] != 'a')
+ && stream->mode[0] != 'x' && !(stream_mode_len == 2 && stream->mode[1] != 'x')) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write to a stream opened in read only mode");
+ RETURN_FALSE;
+ }
+ break;
+ default:
+ /* not reachable */
+ break;
+ }
if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_FD, (void *) &fd, REPORT_ERRORS)) {
RETURN_FALSE;
@@ -354,7 +446,7 @@ PHP_FUNCTION(bzopen)
/* {{{ proto int bzerrno(resource bz)
Returns the error number */
-PHP_FUNCTION(bzerrno)
+static PHP_FUNCTION(bzerrno)
{
php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRNO);
}
@@ -362,7 +454,7 @@ PHP_FUNCTION(bzerrno)
/* {{{ proto string bzerrstr(resource bz)
Returns the error string */
-PHP_FUNCTION(bzerrstr)
+static PHP_FUNCTION(bzerrstr)
{
php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRSTR);
}
@@ -370,7 +462,7 @@ PHP_FUNCTION(bzerrstr)
/* {{{ proto array bzerror(resource bz)
Returns the error number and error string in an associative array */
-PHP_FUNCTION(bzerror)
+static PHP_FUNCTION(bzerror)
{
php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRBOTH);
}
@@ -378,7 +470,7 @@ PHP_FUNCTION(bzerror)
/* {{{ proto string bzcompress(string source [, int blocksize100k [, int workfactor]])
Compresses a string into BZip2 encoded data */
-PHP_FUNCTION(bzcompress)
+static PHP_FUNCTION(bzcompress)
{
zval **source, /* Source data to compress */
**zblock_size, /* Optional block size to use */
@@ -436,7 +528,7 @@ PHP_FUNCTION(bzcompress)
/* {{{ proto string bzdecompress(string source [, int small])
Decompresses BZip2 compressed data */
-PHP_FUNCTION(bzdecompress)
+static PHP_FUNCTION(bzdecompress)
{
char *source, *dest;
int source_len, error;
diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c
index 53802a9e6..0c74d4732 100644
--- a/ext/bz2/bz2_filter.c
+++ b/ext/bz2/bz2_filter.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: bz2_filter.c,v 1.3.2.2 2006/01/01 12:50:00 sniper Exp $ */
+/* $Id: bz2_filter.c,v 1.3.2.2.2.2 2006/06/23 07:30:26 mike Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -274,7 +274,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
/* 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));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes.", sizeof(php_bz2_filter_data));
return NULL;
}
@@ -287,14 +287,14 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu 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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes.", data->outbuf_len);
pefree(data->inbuf, persistent);
pefree(data, persistent);
return NULL;
diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h
index 9ad1fcfa0..1c0231d7d 100644
--- a/ext/bz2/php_bz2.h
+++ b/ext/bz2/php_bz2.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_bz2.h,v 1.7.2.1 2006/01/01 12:50:00 sniper Exp $ */
+/* $Id: php_bz2.h,v 1.7.2.1.2.2 2006/08/14 20:08:17 nlopess Exp $ */
#ifndef PHP_BZ2_H
#define PHP_BZ2_H
@@ -29,17 +29,6 @@ extern zend_module_entry bz2_module_entry;
/* Bzip2 includes */
#include <bzlib.h>
-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
diff --git a/ext/bz2/tests/001.phpt b/ext/bz2/tests/001.phpt
new file mode 100644
index 000000000..a4ef1a2af
--- /dev/null
+++ b/ext/bz2/tests/001.phpt
@@ -0,0 +1,43 @@
+--TEST--
+bzopen() and invalid parameters
+--SKIPIF--
+<?php if (!extension_loaded("bz2")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(bzopen());
+var_dump(bzopen("", ""));
+var_dump(bzopen("", "r"));
+var_dump(bzopen("", "w"));
+var_dump(bzopen("", "x"));
+var_dump(bzopen("", "rw"));
+var_dump(bzopen("no_such_file", "r"));
+
+$fp = fopen(__FILE__,"r");
+var_dump(bzopen($fp, "r"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for bzopen() in %s on line %d
+NULL
+
+Warning: bzopen(): '' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d
+bool(false)
+
+Warning: bzopen(): filename cannot be empty in %s on line %d
+bool(false)
+
+Warning: bzopen(): filename cannot be empty in %s on line %d
+bool(false)
+
+Warning: bzopen(): 'x' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d
+bool(false)
+
+Warning: bzopen(): 'rw' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d
+bool(false)
+
+Warning: bzopen(no_such_file): failed to open stream: No such file or directory in %s on line %d
+bool(false)
+resource(%d) of type (stream)
+Done
diff --git a/ext/bz2/tests/002.phpt b/ext/bz2/tests/002.phpt
new file mode 100644
index 000000000..7b9673275
--- /dev/null
+++ b/ext/bz2/tests/002.phpt
@@ -0,0 +1,129 @@
+--TEST--
+bzopen() using fd opened in wrong mode
+--SKIPIF--
+<?php if (!extension_loaded("bz2")) print "skip"; ?>
+--FILE--
+<?php
+
+@unlink("bz_open_002.txt");
+
+$fp = fopen("bz_open_002.txt", "w");
+var_dump(bzopen($fp, "w"));
+
+$fp = fopen("bz_open_002.txt", "r");
+var_dump(bzopen($fp, "r"));
+
+@unlink("bz_open_002.txt");
+$fp = fopen("bz_open_002.txt", "x");
+var_dump(bzopen($fp, "w"));
+
+@unlink("bz_open_002.txt");
+$fp = fopen("bz_open_002.txt", "x");
+var_dump(bzopen($fp, "r"));
+
+$fp = fopen("bz_open_002.txt", "rb");
+var_dump(bzopen($fp, "r"));
+
+$fp = fopen("bz_open_002.txt", "wb");
+var_dump(bzopen($fp, "w"));
+
+$fp = fopen("bz_open_002.txt", "br");
+var_dump(bzopen($fp, "r"));
+
+$fp = fopen("bz_open_002.txt", "br");
+var_dump(bzopen($fp, "w"));
+
+$fp = fopen("bz_open_002.txt", "r");
+var_dump(bzopen($fp, "w"));
+
+$fp = fopen("bz_open_002.txt", "w");
+var_dump(bzopen($fp, "r"));
+
+$fp = fopen("bz_open_002.txt", "rw");
+var_dump(bzopen($fp, "w"));
+
+$fp = fopen("bz_open_002.txt", "rw");
+var_dump(bzopen($fp, "r"));
+
+$fp = fopen("bz_open_002.txt", "wr");
+var_dump(bzopen($fp, "w"));
+
+$fp = fopen("bz_open_002.txt", "wr");
+var_dump(bzopen($fp, "r"));
+
+$fp = fopen("bz_open_002.txt", "r+");
+var_dump(bzopen($fp, "r"));
+
+$fp = fopen("bz_open_002.txt", "r+");
+var_dump(bzopen($fp, "w"));
+
+$fp = fopen("bz_open_002.txt", "w+");
+var_dump(bzopen($fp, "r"));
+
+$fp = fopen("bz_open_002.txt", "w+");
+var_dump(bzopen($fp, "w"));
+
+$fp = fopen("bz_open_002.txt", "a");
+var_dump(bzopen($fp, "r"));
+
+$fp = fopen("bz_open_002.txt", "a");
+var_dump(bzopen($fp, "w"));
+
+@unlink("bz_open_002.txt");
+
+echo "Done\n";
+?>
+--EXPECTF--
+resource(%d) of type (stream)
+resource(%d) of type (stream)
+resource(%d) of type (stream)
+
+Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d
+bool(false)
+resource(%d) of type (stream)
+resource(%d) of type (stream)
+
+Warning: fopen(bz_open_002.txt): failed to open stream: Bad file %s in %s on line %d
+
+Warning: bzopen(): filename cannot be empty in %s on line %d
+bool(false)
+
+Warning: fopen(bz_open_002.txt): failed to open stream: Bad file %s in %s on line %d
+
+Warning: bzopen(): filename cannot be empty in %s on line %d
+bool(false)
+
+Warning: bzopen(): cannot write to a stream opened in read only mode in %s on line %d
+bool(false)
+
+Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d
+bool(false)
+
+Warning: bzopen(): cannot use stream opened in mode 'rw' in %s on line %d
+bool(false)
+
+Warning: bzopen(): cannot use stream opened in mode 'rw' in %s on line %d
+bool(false)
+
+Warning: bzopen(): cannot use stream opened in mode 'wr' in %s on line %d
+bool(false)
+
+Warning: bzopen(): cannot use stream opened in mode 'wr' in %s on line %d
+bool(false)
+
+Warning: bzopen(): cannot use stream opened in mode 'r+' in %s on line %d
+bool(false)
+
+Warning: bzopen(): cannot use stream opened in mode 'r+' in %s on line %d
+bool(false)
+
+Warning: bzopen(): cannot use stream opened in mode 'w+' in %s on line %d
+bool(false)
+
+Warning: bzopen(): cannot use stream opened in mode 'w+' in %s on line %d
+bool(false)
+
+Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d
+bool(false)
+resource(%d) of type (stream)
+Done
diff --git a/ext/bz2/tests/003.phpt b/ext/bz2/tests/003.phpt
new file mode 100644
index 000000000..143260008
--- /dev/null
+++ b/ext/bz2/tests/003.phpt
@@ -0,0 +1,40 @@
+--TEST--
+bzread() tests
+--SKIPIF--
+<?php if (!extension_loaded("bz2")) print "skip"; ?>
+--FILE--
+<?php
+
+$fd = bzopen(dirname(__FILE__)."/003.txt.bz2","r");
+var_dump(bzread());
+var_dump(bzread($fd, 1 ,0));
+var_dump(bzread($fd, 0));
+var_dump(bzread($fd, -10));
+var_dump(bzread($fd, 1));
+var_dump(bzread($fd, 2));
+var_dump(bzread($fd, 100000));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: bzread() expects at least 1 parameter, 0 given in %s on line %d
+bool(false)
+
+Warning: bzread() expects at most 2 parameters, 3 given in %s on line %d
+bool(false)
+string(0) ""
+
+Warning: bzread(): length may not be negative in %s on line %d
+bool(false)
+string(1) "R"
+string(2) "is"
+string(251) "ing up from the heart of the desert
+Rising up for Jerusalem
+Rising up from the heat of the desert
+Building up Old Jerusalem
+Rising up from the heart of the desert
+Rising up for Jerusalem
+Rising up from the heat of the desert
+Heading out for Jerusalem
+"
+Done
diff --git a/ext/bz2/tests/003.txt.bz2 b/ext/bz2/tests/003.txt.bz2
new file mode 100644
index 000000000..034cd4d8b
--- /dev/null
+++ b/ext/bz2/tests/003.txt.bz2
Binary files differ
diff --git a/ext/bz2/tests/004.phpt b/ext/bz2/tests/004.phpt
new file mode 100644
index 000000000..a638188bc
--- /dev/null
+++ b/ext/bz2/tests/004.phpt
@@ -0,0 +1,111 @@
+--TEST--
+bzread() tests with invalid files
+--SKIPIF--
+<?php if (!extension_loaded("bz2")) print "skip"; ?>
+--FILE--
+<?php
+
+$fd = bzopen(dirname(__FILE__)."/004_1.txt.bz2","r");
+var_dump(bzerror($fd));
+var_dump(bzerrstr($fd));
+var_dump(bzerrno($fd));
+
+$fd2 = bzopen(dirname(__FILE__)."/004_2.txt.bz2","r");
+var_dump(bzerror($fd2));
+var_dump(bzerrstr($fd2));
+var_dump(bzerrno($fd2));
+
+var_dump(bzread($fd, 10));
+var_dump(bzerror($fd));
+var_dump(bzerrstr($fd));
+var_dump(bzerrno($fd));
+
+var_dump(bzread($fd2, 10));
+var_dump(bzerror($fd2));
+var_dump(bzerrstr($fd2));
+var_dump(bzerrno($fd2));
+
+var_dump(bzread($fd));
+var_dump(bzerror($fd));
+var_dump(bzerrstr($fd));
+var_dump(bzerrno($fd));
+
+var_dump(bzread($fd2));
+var_dump(bzerror($fd2));
+var_dump(bzerrstr($fd2));
+var_dump(bzerrno($fd2));
+
+bzclose($fd2);
+var_dump(bzread($fd2));
+var_dump(bzerror($fd2));
+var_dump(bzerrstr($fd2));
+var_dump(bzerrno($fd2));
+
+echo "Done\n";
+?>
+--EXPECTF--
+array(2) {
+ ["errno"]=>
+ int(0)
+ ["errstr"]=>
+ string(2) "OK"
+}
+string(2) "OK"
+int(0)
+array(2) {
+ ["errno"]=>
+ int(0)
+ ["errstr"]=>
+ string(2) "OK"
+}
+string(2) "OK"
+int(0)
+string(0) ""
+array(2) {
+ ["errno"]=>
+ int(-5)
+ ["errstr"]=>
+ string(16) "DATA_ERROR_MAGIC"
+}
+string(16) "DATA_ERROR_MAGIC"
+int(-5)
+string(0) ""
+array(2) {
+ ["errno"]=>
+ int(-4)
+ ["errstr"]=>
+ string(10) "DATA_ERROR"
+}
+string(10) "DATA_ERROR"
+int(-4)
+string(0) ""
+array(2) {
+ ["errno"]=>
+ int(-5)
+ ["errstr"]=>
+ string(16) "DATA_ERROR_MAGIC"
+}
+string(16) "DATA_ERROR_MAGIC"
+int(-5)
+string(0) ""
+array(2) {
+ ["errno"]=>
+ int(-4)
+ ["errstr"]=>
+ string(10) "DATA_ERROR"
+}
+string(10) "DATA_ERROR"
+int(-4)
+
+Warning: bzread(): %d is not a valid stream resource in %s on line %d
+bool(false)
+
+Warning: bzerror(): %d is not a valid stream resource in %s on line %d
+bool(false)
+
+Warning: bzerrstr(): %d is not a valid stream resource in %s on line %d
+bool(false)
+
+Warning: bzerrno(): %d is not a valid stream resource in %s on line %d
+bool(false)
+Done
diff --git a/ext/bz2/tests/004_1.txt.bz2 b/ext/bz2/tests/004_1.txt.bz2
new file mode 100644
index 000000000..6a5067b27
--- /dev/null
+++ b/ext/bz2/tests/004_1.txt.bz2
Binary files differ
diff --git a/ext/bz2/tests/004_2.txt.bz2 b/ext/bz2/tests/004_2.txt.bz2
new file mode 100644
index 000000000..9c19f043a
--- /dev/null
+++ b/ext/bz2/tests/004_2.txt.bz2
Binary files differ
diff --git a/ext/bz2/tests/005.phpt b/ext/bz2/tests/005.phpt
new file mode 100644
index 000000000..48323531e
--- /dev/null
+++ b/ext/bz2/tests/005.phpt
@@ -0,0 +1,71 @@
+--TEST--
+bzcompress()/bzdecompress() tests
+--SKIPIF--
+<?php if (!extension_loaded("bz2")) print "skip"; ?>
+--FILE--
+<?php
+
+$string = "Life it seems, will fade away
+Drifting further everyday
+Getting lost within myself
+Nothing matters no one else";
+
+var_dump(bzcompress());
+var_dump(bzcompress(1,1,1));
+var_dump(bzcompress($string, 100));
+var_dump(bzcompress($string, 100, -1));
+var_dump(bzcompress($string, 100, 1000));
+var_dump(bzcompress($string, -1, 1));
+
+$data = bzcompress($string);
+$data2 = bzcompress($string, 1, 10);
+
+$data3 = $data2;
+$data3{3} = 0;
+
+var_dump(bzdecompress());
+var_dump(bzdecompress(1,1,1));
+var_dump(bzdecompress(1,1));
+var_dump(bzdecompress($data3));
+var_dump(bzdecompress($data3,1));
+
+var_dump(bzdecompress($data, -1));
+var_dump(bzdecompress($data, 0));
+var_dump(bzdecompress($data, 1000));
+var_dump(bzdecompress($data));
+var_dump(bzdecompress($data2));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for bzcompress() in %s on line %d
+NULL
+string(%d) "BZ%s"
+int(-2)
+int(-2)
+int(-2)
+int(-2)
+
+Warning: bzdecompress() expects at least 1 parameter, 0 given in %s on line %d
+bool(false)
+
+Warning: bzdecompress() expects at most 2 parameters, 3 given in %s on line %d
+bool(false)
+int(-5)
+int(-5)
+int(-5)
+bool(false)
+string(110) "Life it seems, will fade away
+Drifting further everyday
+Getting lost within myself
+Nothing matters no one else"
+bool(false)
+string(110) "Life it seems, will fade away
+Drifting further everyday
+Getting lost within myself
+Nothing matters no one else"
+string(110) "Life it seems, will fade away
+Drifting further everyday
+Getting lost within myself
+Nothing matters no one else"
+Done
diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c
index 97e66a45c..d4cbc490d 100644
--- a/ext/calendar/calendar.c
+++ b/ext/calendar/calendar.c
@@ -18,7 +18,7 @@
| Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: calendar.c,v 1.46.2.2 2006/01/01 12:50:00 sniper Exp $ */
+/* $Id: calendar.c,v 1.46.2.2.2.1 2006/06/11 01:42:16 bjori Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -35,25 +35,137 @@
#include <stdio.h>
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_unixtojd, 0, 0, 0)
+ ZEND_ARG_INFO(0, timestamp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_jdtounix, 0)
+ ZEND_ARG_INFO(0, jday)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_cal_info, 0, 0, 0)
+ ZEND_ARG_INFO(0, calendar)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_cal_days_in_month, 0)
+ ZEND_ARG_INFO(0, calendar)
+ ZEND_ARG_INFO(0, month)
+ ZEND_ARG_INFO(0, year)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_cal_to_jd, 0)
+ ZEND_ARG_INFO(0, calendar)
+ ZEND_ARG_INFO(0, month)
+ ZEND_ARG_INFO(0, day)
+ ZEND_ARG_INFO(0, year)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_cal_from_jd, 0)
+ ZEND_ARG_INFO(0, jd)
+ ZEND_ARG_INFO(0, calendar)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_jdtogregorian, 0)
+ ZEND_ARG_INFO(0, juliandaycount)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gregoriantojd, 0)
+ ZEND_ARG_INFO(0, month)
+ ZEND_ARG_INFO(0, day)
+ ZEND_ARG_INFO(0, year)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_jdtojulian, 0)
+ ZEND_ARG_INFO(0, juliandaycount)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_juliantojd, 0)
+ ZEND_ARG_INFO(0, month)
+ ZEND_ARG_INFO(0, day)
+ ZEND_ARG_INFO(0, year)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_jdtojewish, 0, 0, 1)
+ ZEND_ARG_INFO(0, juliandaycount)
+ ZEND_ARG_INFO(0, hebrew)
+ ZEND_ARG_INFO(0, fl)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_jewishtojd, 0)
+ ZEND_ARG_INFO(0, month)
+ ZEND_ARG_INFO(0, day)
+ ZEND_ARG_INFO(0, year)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_jdtofrench, 0)
+ ZEND_ARG_INFO(0, juliandaycount)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_frenchtojd, 0)
+ ZEND_ARG_INFO(0, month)
+ ZEND_ARG_INFO(0, day)
+ ZEND_ARG_INFO(0, year)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_jddayofweek, 0, 0, 1)
+ ZEND_ARG_INFO(0, juliandaycount)
+ ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_jdmonthname, 0)
+ ZEND_ARG_INFO(0, juliandaycount)
+ ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_easter_date, 0, 0, 0)
+ ZEND_ARG_INFO(0, year)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_easter_days, 0, 0, 0)
+ ZEND_ARG_INFO(0, year)
+ ZEND_ARG_INFO(0, method)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
zend_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)
+ PHP_FE(jdtogregorian, arginfo_jdtogregorian)
+ PHP_FE(gregoriantojd, arginfo_gregoriantojd)
+ PHP_FE(jdtojulian, arginfo_jdtojulian)
+ PHP_FE(juliantojd, arginfo_juliantojd)
+ PHP_FE(jdtojewish, arginfo_jdtojewish)
+ PHP_FE(jewishtojd, arginfo_jewishtojd)
+ PHP_FE(jdtofrench, arginfo_jdtofrench)
+ PHP_FE(frenchtojd, arginfo_frenchtojd)
+ PHP_FE(jddayofweek, arginfo_jddayofweek)
+ PHP_FE(jdmonthname, arginfo_jdmonthname)
+ PHP_FE(easter_date, arginfo_easter_date)
+ PHP_FE(easter_days, arginfo_easter_days)
+ PHP_FE(unixtojd, arginfo_unixtojd)
+ PHP_FE(jdtounix, arginfo_jdtounix)
+ PHP_FE(cal_to_jd, arginfo_cal_to_jd)
+ PHP_FE(cal_from_jd, arginfo_cal_from_jd)
+ PHP_FE(cal_days_in_month, arginfo_cal_days_in_month)
+ PHP_FE(cal_info, arginfo_cal_info)
{NULL, NULL, NULL}
};
@@ -189,7 +301,7 @@ static void _php_cal_info(int cal, zval **ret)
}
-/* {{{ proto array cal_info(int calendar)
+/* {{{ proto array cal_info([int calendar])
Returns information about a particular calendar */
PHP_FUNCTION(cal_info)
{
diff --git a/ext/calendar/gregor.c b/ext/calendar/gregor.c
index f48950901..c9c0bf761 100644
--- a/ext/calendar/gregor.c
+++ b/ext/calendar/gregor.c
@@ -154,6 +154,13 @@ void SdnToGregorian(
}
temp = (sdn + GREGOR_SDN_OFFSET) * 4 - 1;
+ if (temp < 0) {
+ *pYear = 0;
+ *pMonth = 0;
+ *pDay = 0;
+ return;
+ }
+
/* Calculate the century (year/100). */
century = temp / DAYS_PER_400_YEARS;
diff --git a/ext/calendar/php_calendar.h b/ext/calendar/php_calendar.h
index 79c9edf73..e353fab89 100644
--- a/ext/calendar/php_calendar.h
+++ b/ext/calendar/php_calendar.h
@@ -7,8 +7,6 @@ extern zend_module_entry calendar_module_entry;
/* Functions */
PHP_MINIT_FUNCTION(calendar);
-PHP_RINIT_FUNCTION(calendar);
-PHP_RSHUTDOWN_FUNCTION(calendar);
PHP_MINFO_FUNCTION(calendar);
PHP_FUNCTION(jdtogregorian);
diff --git a/ext/calendar/tests/cal_from_jd.phpt b/ext/calendar/tests/cal_from_jd.phpt
new file mode 100644
index 000000000..9614522a0
--- /dev/null
+++ b/ext/calendar/tests/cal_from_jd.phpt
@@ -0,0 +1,60 @@
+--TEST--
+cal_from_jd()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+print_r(cal_from_jd(1748326, CAL_GREGORIAN));
+print_r(cal_from_jd(1748324, CAL_JULIAN));
+print_r(cal_from_jd( 374867, CAL_JEWISH));
+print_r(cal_from_jd( 0, CAL_FRENCH));
+?>
+--EXPECT--
+Array
+(
+ [date] => 8/26/74
+ [month] => 8
+ [day] => 26
+ [year] => 74
+ [dow] => 0
+ [abbrevdayname] => Sun
+ [dayname] => Sunday
+ [abbrevmonth] => Aug
+ [monthname] => August
+)
+Array
+(
+ [date] => 8/26/74
+ [month] => 8
+ [day] => 26
+ [year] => 74
+ [dow] => 5
+ [abbrevdayname] => Fri
+ [dayname] => Friday
+ [abbrevmonth] => Aug
+ [monthname] => August
+)
+Array
+(
+ [date] => 8/26/74
+ [month] => 8
+ [day] => 26
+ [year] => 74
+ [dow] => 4
+ [abbrevdayname] => Thu
+ [dayname] => Thursday
+ [abbrevmonth] => Nisan
+ [monthname] => Nisan
+)
+Array
+(
+ [date] => 0/0/0
+ [month] => 0
+ [day] => 0
+ [year] => 0
+ [dow] => 1
+ [abbrevdayname] => Mon
+ [dayname] => Monday
+ [abbrevmonth] =>
+ [monthname] =>
+)
diff --git a/ext/calendar/tests/cal_info.phpt b/ext/calendar/tests/cal_info.phpt
new file mode 100644
index 000000000..2e3e61292
--- /dev/null
+++ b/ext/calendar/tests/cal_info.phpt
@@ -0,0 +1,216 @@
+--TEST--
+cal_info()
+--INI--
+date.timezone=UTC
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+ print_r(cal_info());
+ print_r(cal_info(1));
+ print_r(cal_info(99999));
+?>
+--EXPECTF--
+Array
+(
+ [0] => Array
+ (
+ [months] => Array
+ (
+ [1] => January
+ [2] => February
+ [3] => March
+ [4] => April
+ [5] => May
+ [6] => June
+ [7] => July
+ [8] => August
+ [9] => September
+ [10] => October
+ [11] => November
+ [12] => December
+ )
+
+ [abbrevmonths] => Array
+ (
+ [1] => Jan
+ [2] => Feb
+ [3] => Mar
+ [4] => Apr
+ [5] => May
+ [6] => Jun
+ [7] => Jul
+ [8] => Aug
+ [9] => Sep
+ [10] => Oct
+ [11] => Nov
+ [12] => Dec
+ )
+
+ [maxdaysinmonth] => 31
+ [calname] => Gregorian
+ [calsymbol] => CAL_GREGORIAN
+ )
+
+ [1] => Array
+ (
+ [months] => Array
+ (
+ [1] => January
+ [2] => February
+ [3] => March
+ [4] => April
+ [5] => May
+ [6] => June
+ [7] => July
+ [8] => August
+ [9] => September
+ [10] => October
+ [11] => November
+ [12] => December
+ )
+
+ [abbrevmonths] => Array
+ (
+ [1] => Jan
+ [2] => Feb
+ [3] => Mar
+ [4] => Apr
+ [5] => May
+ [6] => Jun
+ [7] => Jul
+ [8] => Aug
+ [9] => Sep
+ [10] => Oct
+ [11] => Nov
+ [12] => Dec
+ )
+
+ [maxdaysinmonth] => 31
+ [calname] => Julian
+ [calsymbol] => CAL_JULIAN
+ )
+
+ [2] => Array
+ (
+ [months] => Array
+ (
+ [1] => Tishri
+ [2] => Heshvan
+ [3] => Kislev
+ [4] => Tevet
+ [5] => Shevat
+ [6] => AdarI
+ [7] => AdarII
+ [8] => Nisan
+ [9] => Iyyar
+ [10] => Sivan
+ [11] => Tammuz
+ [12] => Av
+ [13] => Elul
+ )
+
+ [abbrevmonths] => Array
+ (
+ [1] => Tishri
+ [2] => Heshvan
+ [3] => Kislev
+ [4] => Tevet
+ [5] => Shevat
+ [6] => AdarI
+ [7] => AdarII
+ [8] => Nisan
+ [9] => Iyyar
+ [10] => Sivan
+ [11] => Tammuz
+ [12] => Av
+ [13] => Elul
+ )
+
+ [maxdaysinmonth] => 30
+ [calname] => Jewish
+ [calsymbol] => CAL_JEWISH
+ )
+
+ [3] => Array
+ (
+ [months] => Array
+ (
+ [1] => Vendemiaire
+ [2] => Brumaire
+ [3] => Frimaire
+ [4] => Nivose
+ [5] => Pluviose
+ [6] => Ventose
+ [7] => Germinal
+ [8] => Floreal
+ [9] => Prairial
+ [10] => Messidor
+ [11] => Thermidor
+ [12] => Fructidor
+ [13] => Extra
+ )
+
+ [abbrevmonths] => Array
+ (
+ [1] => Vendemiaire
+ [2] => Brumaire
+ [3] => Frimaire
+ [4] => Nivose
+ [5] => Pluviose
+ [6] => Ventose
+ [7] => Germinal
+ [8] => Floreal
+ [9] => Prairial
+ [10] => Messidor
+ [11] => Thermidor
+ [12] => Fructidor
+ [13] => Extra
+ )
+
+ [maxdaysinmonth] => 30
+ [calname] => French
+ [calsymbol] => CAL_FRENCH
+ )
+
+)
+Array
+(
+ [months] => Array
+ (
+ [1] => January
+ [2] => February
+ [3] => March
+ [4] => April
+ [5] => May
+ [6] => June
+ [7] => July
+ [8] => August
+ [9] => September
+ [10] => October
+ [11] => November
+ [12] => December
+ )
+
+ [abbrevmonths] => Array
+ (
+ [1] => Jan
+ [2] => Feb
+ [3] => Mar
+ [4] => Apr
+ [5] => May
+ [6] => Jun
+ [7] => Jul
+ [8] => Aug
+ [9] => Sep
+ [10] => Oct
+ [11] => Nov
+ [12] => Dec
+ )
+
+ [maxdaysinmonth] => 31
+ [calname] => Julian
+ [calsymbol] => CAL_JULIAN
+)
+
+Warning: cal_info(): invalid calendar ID 99999. in %s on line %d
diff --git a/ext/calendar/tests/easter_date.phpt b/ext/calendar/tests/easter_date.phpt
new file mode 100644
index 000000000..55a3670da
--- /dev/null
+++ b/ext/calendar/tests/easter_date.phpt
@@ -0,0 +1,20 @@
+--TEST--
+easter_date()
+--INI--
+date.timezone=UTC
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+echo date("Y-m-d", easter_date(2000))."\n";
+echo date("Y-m-d", easter_date(2001))."\n";
+echo date("Y-m-d", easter_date(2002))."\n";
+echo date("Y-m-d", easter_date(1492))."\n";
+?>
+--EXPECTF--
+2000-04-22
+2001-04-14
+2002-03-30
+
+Warning: easter_date(): This function is only valid for years between 1970 and 2037 inclusive in %s on line %d
+1970-01-01
diff --git a/ext/calendar/tests/gregoriantojd.phpt b/ext/calendar/tests/gregoriantojd.phpt
new file mode 100644
index 000000000..ec3628e89
--- /dev/null
+++ b/ext/calendar/tests/gregoriantojd.phpt
@@ -0,0 +1,18 @@
+--TEST--
+gregoriantojd()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+echo gregoriantojd( 0, 0, 0). "\n";
+echo gregoriantojd( 1, 1, 1582). "\n";
+echo gregoriantojd(10, 5, 1582). "\n";
+echo gregoriantojd( 1, 1, 1970). "\n";
+echo gregoriantojd( 1, 1, 2999). "\n";
+?>
+--EXPECT--
+0
+2298874
+2299151
+2440588
+2816423 \ No newline at end of file
diff --git a/ext/calendar/tests/jddayofweek.phpt b/ext/calendar/tests/jddayofweek.phpt
new file mode 100644
index 000000000..c33d59892
--- /dev/null
+++ b/ext/calendar/tests/jddayofweek.phpt
@@ -0,0 +1,130 @@
+--TEST--
+jddayofweek()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+foreach (array(2440588, 2452162, 2453926, -1000) as $jd) {
+ echo "### JD $jd ###\n";
+ for ($mode = 0; $mode <= 2; $mode++) {
+ echo "--- mode $mode ---\n";
+ for ($offset = 0; $offset <= 7; $offset++) {
+ echo jddayofweek($jd + $offset, $mode). "\n";
+ }
+ }
+}
+?>
+--EXPECT--
+### JD 2440588 ###
+--- mode 0 ---
+4
+5
+6
+0
+1
+2
+3
+4
+--- mode 1 ---
+Thursday
+Friday
+Saturday
+Sunday
+Monday
+Tuesday
+Wednesday
+Thursday
+--- mode 2 ---
+Thu
+Fri
+Sat
+Sun
+Mon
+Tue
+Wed
+Thu
+### JD 2452162 ###
+--- mode 0 ---
+0
+1
+2
+3
+4
+5
+6
+0
+--- mode 1 ---
+Sunday
+Monday
+Tuesday
+Wednesday
+Thursday
+Friday
+Saturday
+Sunday
+--- mode 2 ---
+Sun
+Mon
+Tue
+Wed
+Thu
+Fri
+Sat
+Sun
+### JD 2453926 ###
+--- mode 0 ---
+0
+1
+2
+3
+4
+5
+6
+0
+--- mode 1 ---
+Sunday
+Monday
+Tuesday
+Wednesday
+Thursday
+Friday
+Saturday
+Sunday
+--- mode 2 ---
+Sun
+Mon
+Tue
+Wed
+Thu
+Fri
+Sat
+Sun
+### JD -1000 ###
+--- mode 0 ---
+2
+3
+4
+5
+6
+0
+1
+2
+--- mode 1 ---
+Tuesday
+Wednesday
+Thursday
+Friday
+Saturday
+Sunday
+Monday
+Tuesday
+--- mode 2 ---
+Tue
+Wed
+Thu
+Fri
+Sat
+Sun
+Mon
+Tue
+
diff --git a/ext/calendar/tests/jdmonthname.phpt b/ext/calendar/tests/jdmonthname.phpt
new file mode 100644
index 000000000..d05d3c595
--- /dev/null
+++ b/ext/calendar/tests/jdmonthname.phpt
@@ -0,0 +1,314 @@
+--TEST--
+jdmonthname()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+foreach (array(2440588, 2452162, 2453926) as $jd) {
+ echo "### JD $jd ###\n";
+ for ($mode = 0; $mode <= 6; $mode++) {
+ echo "--- mode $mode ---\n";
+ for ($offset = 0; $offset <= 12; $offset++) {
+ echo jdmonthname($jd + $offset * 30, $mode). "\n";
+ }
+ }
+}
+?>
+--EXPECT--
+### JD 2440588 ###
+--- mode 0 ---
+Jan
+Jan
+Mar
+Apr
+May
+May
+Jun
+Jul
+Aug
+Sep
+Oct
+Nov
+Dec
+--- mode 1 ---
+January
+January
+March
+April
+May
+May
+June
+July
+August
+September
+October
+November
+December
+--- mode 2 ---
+Dec
+Jan
+Feb
+Mar
+Apr
+May
+Jun
+Jul
+Aug
+Sep
+Oct
+Nov
+Dec
+--- mode 3 ---
+December
+January
+February
+March
+April
+May
+June
+July
+August
+September
+October
+November
+December
+--- mode 4 ---
+Tevet
+Shevat
+AdarI
+AdarII
+Nisan
+Iyyar
+Sivan
+Tammuz
+Av
+Elul
+Tishri
+Heshvan
+Kislev
+--- mode 5 ---
+
+
+
+
+
+
+
+
+
+
+
+
+
+--- mode 6 ---
+Jan
+Jan
+Mar
+Apr
+May
+May
+Jun
+Jul
+Aug
+Sep
+Oct
+Nov
+Dec
+### JD 2452162 ###
+--- mode 0 ---
+Sep
+Oct
+Nov
+Dec
+Jan
+Feb
+Mar
+Apr
+May
+Jun
+Jul
+Aug
+Sep
+--- mode 1 ---
+September
+October
+November
+December
+January
+February
+March
+April
+May
+June
+July
+August
+September
+--- mode 2 ---
+Aug
+Sep
+Oct
+Nov
+Dec
+Jan
+Feb
+Mar
+Apr
+May
+Jun
+Jul
+Aug
+--- mode 3 ---
+August
+September
+October
+November
+December
+January
+February
+March
+April
+May
+June
+July
+August
+--- mode 4 ---
+Elul
+Tishri
+Heshvan
+Kislev
+Tevet
+Shevat
+AdarI
+Nisan
+Iyyar
+Sivan
+Tammuz
+Av
+Elul
+--- mode 5 ---
+
+
+
+
+
+
+
+
+
+
+
+
+
+--- mode 6 ---
+Sep
+Oct
+Nov
+Dec
+Jan
+Feb
+Mar
+Apr
+May
+Jun
+Jul
+Aug
+Sep
+### JD 2453926 ###
+--- mode 0 ---
+Jul
+Aug
+Sep
+Oct
+Nov
+Dec
+Jan
+Feb
+Mar
+Apr
+May
+Jun
+Jul
+--- mode 1 ---
+July
+August
+September
+October
+November
+December
+January
+February
+March
+April
+May
+June
+July
+--- mode 2 ---
+Jun
+Jul
+Aug
+Sep
+Oct
+Nov
+Dec
+Jan
+Feb
+Mar
+Apr
+May
+Jun
+--- mode 3 ---
+June
+July
+August
+September
+October
+November
+December
+January
+February
+March
+April
+May
+June
+--- mode 4 ---
+Tammuz
+Av
+Elul
+Tishri
+Heshvan
+Kislev
+Tevet
+Shevat
+AdarI
+Nisan
+Iyyar
+Sivan
+Tammuz
+--- mode 5 ---
+
+
+
+
+
+
+
+
+
+
+
+
+
+--- mode 6 ---
+Jul
+Aug
+Sep
+Oct
+Nov
+Dec
+Jan
+Feb
+Mar
+Apr
+May
+Jun
+Jul
diff --git a/ext/calendar/tests/jdtofrench.phpt b/ext/calendar/tests/jdtofrench.phpt
new file mode 100644
index 000000000..27944091e
--- /dev/null
+++ b/ext/calendar/tests/jdtofrench.phpt
@@ -0,0 +1,20 @@
+--TEST--
+jdtofrench()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+echo jdtofrench(0). "\n";
+echo jdtofrench(2375840). "\n";
+echo jdtofrench(2375850). "\n";
+echo jdtofrench(2375940). "\n";
+echo jdtofrench(2376345). "\n";
+echo jdtofrench(2385940). "\n";
+?>
+--EXPECT--
+0/0/0
+1/1/1
+1/11/1
+4/11/1
+5/21/2
+0/0/0 \ No newline at end of file
diff --git a/ext/calendar/tests/jdtogregorian.phpt b/ext/calendar/tests/jdtogregorian.phpt
new file mode 100644
index 000000000..6b1956f47
--- /dev/null
+++ b/ext/calendar/tests/jdtogregorian.phpt
@@ -0,0 +1,18 @@
+--TEST--
+jdtogregorian()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+echo jdtogregorian(0). "\n";
+echo jdtogregorian(2298874). "\n";
+echo jdtogregorian(2299151). "\n";
+echo jdtogregorian(2440588). "\n";
+echo jdtogregorian(2816423). "\n";
+?>
+--EXPECT--
+0/0/0
+1/1/1582
+10/5/1582
+1/1/1970
+1/1/2999 \ No newline at end of file
diff --git a/ext/calendar/tests/jdtojulian.phpt b/ext/calendar/tests/jdtojulian.phpt
new file mode 100644
index 000000000..6c87aa7e5
--- /dev/null
+++ b/ext/calendar/tests/jdtojulian.phpt
@@ -0,0 +1,18 @@
+--TEST--
+jdtojulian()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+echo jdtojulian(0). "\n";
+echo jdtojulian(2298874). "\n";
+echo jdtojulian(2299151). "\n";
+echo jdtojulian(2440588). "\n";
+echo jdtojulian(2816423). "\n";
+?>
+--EXPECT--
+0/0/0
+12/22/1581
+9/25/1582
+12/19/1969
+12/12/2998 \ No newline at end of file
diff --git a/ext/calendar/tests/jdtomonthname.phpt b/ext/calendar/tests/jdtomonthname.phpt
new file mode 100644
index 000000000..76d127d6b
--- /dev/null
+++ b/ext/calendar/tests/jdtomonthname.phpt
@@ -0,0 +1,71 @@
+--TEST--
+jdtomonthname() test
+--SKIPIF--
+<?php if (!extension_loaded("calendar")) print "skip"; ?>
+--FILE--
+<?php
+
+$jd_days = Array(
+ 2453396,
+ 2440588,
+ -1,
+ array(),
+ 10000000
+ );
+
+foreach ($jd_days as $jd_day) {
+ var_dump(jdmonthname($jd_day,0));
+ var_dump(jdmonthname($jd_day,1));
+ var_dump(jdmonthname($jd_day,2));
+ var_dump(jdmonthname($jd_day,3));
+ var_dump(jdmonthname($jd_day,4));
+ var_dump(jdmonthname($jd_day,5));
+}
+
+echo "Done\n";
+
+?>
+--EXPECTF--
+string(3) "Jan"
+string(7) "January"
+string(3) "Jan"
+string(7) "January"
+string(6) "Shevat"
+string(0) ""
+string(3) "Jan"
+string(7) "January"
+string(3) "Dec"
+string(8) "December"
+string(5) "Tevet"
+string(0) ""
+string(0) ""
+string(0) ""
+string(0) ""
+string(0) ""
+string(0) ""
+string(0) ""
+
+Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
+bool(false)
+
+Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
+bool(false)
+
+Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
+bool(false)
+
+Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
+bool(false)
+
+Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
+bool(false)
+
+Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
+bool(false)
+string(3) "Dec"
+string(8) "December"
+string(3) "Jul"
+string(4) "July"
+string(6) "Tishri"
+string(0) ""
+Done
diff --git a/ext/calendar/tests/jdtounix.phpt b/ext/calendar/tests/jdtounix.phpt
new file mode 100644
index 000000000..8d8554330
--- /dev/null
+++ b/ext/calendar/tests/jdtounix.phpt
@@ -0,0 +1,16 @@
+--TEST--
+jdtounix()
+--INI--
+date.timezone=UTC
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+echo date("Y-m-d",jdtounix(2440588)). "\n";
+echo date("Y-m-d",jdtounix(2452162)). "\n";
+echo date("Y-m-d",jdtounix(2453926)). "\n";
+?>
+--EXPECT--
+1970-01-01
+2001-09-09
+2006-07-09
diff --git a/ext/calendar/tests/jewishtojd.phpt b/ext/calendar/tests/jewishtojd.phpt
new file mode 100644
index 000000000..a9a2ff0e3
--- /dev/null
+++ b/ext/calendar/tests/jewishtojd.phpt
@@ -0,0 +1,16 @@
+--TEST--
+jewishtojd()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+echo jewishtojd(-1,-1,-1). "\n";
+echo jewishtojd(0,0,0). "\n";
+echo jewishtojd(1,1,1). "\n";
+echo jewishtojd(2,22,5763). "\n";
+?>
+--EXPECT--
+0
+0
+347998
+2452576 \ No newline at end of file
diff --git a/ext/calendar/tests/juliantojd.phpt b/ext/calendar/tests/juliantojd.phpt
new file mode 100644
index 000000000..9563e041a
--- /dev/null
+++ b/ext/calendar/tests/juliantojd.phpt
@@ -0,0 +1,18 @@
+--TEST--
+juliantojd()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+echo juliantojd( 0, 0, 0). "\n";
+echo juliantojd( 1, 1, 1582). "\n";
+echo juliantojd(10, 5, 1582). "\n";
+echo juliantojd( 1, 1, 1970). "\n";
+echo juliantojd( 1, 1, 2999). "\n";
+?>
+--EXPECT--
+0
+2298884
+2299161
+2440601
+2816443 \ No newline at end of file
diff --git a/ext/calendar/tests/unixtojd.phpt b/ext/calendar/tests/unixtojd.phpt
new file mode 100644
index 000000000..567a8c25b
--- /dev/null
+++ b/ext/calendar/tests/unixtojd.phpt
@@ -0,0 +1,14 @@
+--TEST--
+unixtojd()
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+echo unixtojd(40000). "\n";
+echo unixtojd(1000000000). "\n";
+echo unixtojd(1152459009). "\n";
+?>
+--EXPECT--
+2440588
+2452162
+2453926
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 7d3dd5834..b48cd2ff7 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_com.c,v 1.16.2.2 2006/01/26 11:17:34 rrichards Exp $ */
+/* $Id: com_com.c,v 1.16.2.2.2.1 2006/10/10 17:32:50 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -340,7 +340,7 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
{
HRESULT hr;
unsigned int arg_err;
- EXCEPINFO e;
+ EXCEPINFO e = {0};
hr = IDispatch_Invoke(V_DISPATCH(&obj->v), id_member,
&IID_NULL, LOCALE_SYSTEM_DEFAULT, flags, disp_params, v, &e, &arg_err);
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index 6e8a82803..c043d53f9 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_extension.c,v 1.17.2.2 2006/01/01 12:50:00 sniper Exp $ */
+/* $Id: com_extension.c,v 1.17.2.2.2.4 2006/10/18 23:47:33 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -30,6 +30,8 @@
#include "Zend/zend_exceptions.h"
ZEND_DECLARE_MODULE_GLOBALS(com_dotnet)
+static PHP_GINIT_FUNCTION(com_dotnet);
+
TsHashTable php_com_typelibraries;
zend_class_entry
@@ -86,7 +88,11 @@ zend_module_entry com_dotnet_module_entry = {
PHP_RSHUTDOWN(com_dotnet),
PHP_MINFO(com_dotnet),
"0.1",
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(com_dotnet),
+ PHP_GINIT(com_dotnet),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
@@ -109,7 +115,7 @@ static PHP_INI_MH(OnTypeLibFileUpdate)
char *strtok_buf = NULL;
int cached;
- if (!new_value || (typelib_file = VCWD_FOPEN(new_value, "r"))==NULL) {
+ if (!new_value || !new_value[0] || (typelib_file = VCWD_FOPEN(new_value, "r"))==NULL) {
return FAILURE;
}
@@ -170,9 +176,9 @@ PHP_INI_BEGIN()
PHP_INI_END()
/* }}} */
-/* {{{ php_com_dotnet_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
-static void php_com_dotnet_init_globals(zend_com_dotnet_globals *com_dotnet_globals)
+static PHP_GINIT_FUNCTION(com_dotnet)
{
memset(com_dotnet_globals, 0, sizeof(*com_dotnet_globals));
com_dotnet_globals->code_page = CP_ACP;
@@ -185,14 +191,11 @@ 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(), NULL TSRMLS_CC);
+ 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; */
@@ -221,6 +224,8 @@ PHP_MINIT_FUNCTION(com_dotnet)
tmp->get_iterator = php_com_iter_get;
#endif
+ REGISTER_INI_ENTRIES();
+
#define COM_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_CS|CONST_PERSISTENT)
COM_CONST(CLSCTX_INPROC_SERVER);
diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c
index 911fc73a9..1815af9dc 100644
--- a/ext/com_dotnet/com_handlers.c
+++ b/ext/com_dotnet/com_handlers.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_handlers.c,v 1.30.2.5 2006/02/07 11:50:54 rrichards Exp $ */
+/* $Id: com_handlers.c,v 1.30.2.5.2.2 2006/10/06 12:23:30 edink Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -486,17 +486,12 @@ static int com_objects_compare(zval *object1, zval *object2 TSRMLS_DC)
return ret;
}
-static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC)
+static int com_object_cast(zval *readobj, zval *writeobj, int type 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);
@@ -538,15 +533,11 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_f
VariantClear(&v);
- if (should_free) {
- zval_dtor(&free_obj);
- }
-
if (SUCCEEDED(res)) {
return SUCCESS;
}
- return FAILURE;
+ return zend_std_cast_object_tostring(readobj, writeobj, type TSRMLS_CC);
}
static int com_object_count(zval *object, long *count TSRMLS_DC)
diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c
index 27afaa621..8756b4f4d 100644
--- a/ext/com_dotnet/com_iterator.c
+++ b/ext/com_dotnet/com_iterator.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_iterator.c,v 1.9.2.2 2006/02/07 11:50:54 rrichards Exp $ */
+/* $Id: com_iterator.c,v 1.9.2.2.2.1 2006/05/10 14:39:10 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -139,7 +139,7 @@ static zend_object_iterator_funcs com_iter_funcs = {
NULL
};
-zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC)
+zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
{
php_com_dotnet_object *obj;
struct php_com_iterator *I;
@@ -149,6 +149,10 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object TSRMLS
unsigned long n_fetched;
zval *ptr;
+ if (by_ref) {
+ zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
+ }
+
obj = CDNO_FETCH(object);
if (V_VT(&obj->v) != VT_DISPATCH && !V_ISARRAY(&obj->v)) {
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index b59d2ebb4..e53b86c23 100755
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_persist.c,v 1.5.2.3 2006/03/29 14:28:41 tony2001 Exp $ */
+/* $Id: com_persist.c,v 1.5.2.3.2.1 2006/09/16 18:10:32 iliaa Exp $ */
/* Infrastructure for working with persistent COM objects.
* Implements: IStream* wrapper for PHP streams.
@@ -390,15 +390,16 @@ CPH_METHOD(SaveToFile)
if (filename) {
fullpath = expand_filepath(filename, NULL TSRMLS_CC);
-
- if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ if (!fullpath) {
RETURN_FALSE;
}
-
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+
+ if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) ||
+ php_check_open_basedir(fullpath TSRMLS_CC)) {
+ efree(fullpath);
RETURN_FALSE;
}
-
+
olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage TSRMLS_CC);
efree(fullpath);
}
@@ -452,13 +453,13 @@ CPH_METHOD(LoadFromFile)
return;
}
- fullpath = expand_filepath(filename, NULL TSRMLS_CC);
-
- if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) {
RETURN_FALSE;
}
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) ||
+ php_check_open_basedir(fullpath TSRMLS_CC)) {
+ efree(fullpath);
RETURN_FALSE;
}
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c
index 3c7568a91..a985be0fc 100644
--- a/ext/com_dotnet/com_saproxy.c
+++ b/ext/com_dotnet/com_saproxy.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_saproxy.c,v 1.15.2.2 2006/01/01 12:50:00 sniper Exp $ */
+/* $Id: com_saproxy.c,v 1.15.2.2.2.1 2006/05/10 14:39:10 rrichards Exp $ */
/* This module implements a SafeArray proxy which is used internally
* by the engine when resolving multi-dimensional array accesses on
@@ -357,7 +357,7 @@ 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)
+static int saproxy_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
{
return FAILURE;
}
@@ -554,12 +554,16 @@ static zend_object_iterator_funcs saproxy_iter_funcs = {
};
-zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC)
+zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
{
php_com_saproxy *proxy = SA_FETCH(object);
php_com_saproxy_iter *I;
int i;
+ if (by_ref) {
+ zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
+ }
+
I = ecalloc(1, sizeof(*I));
I->iter.funcs = &saproxy_iter_funcs;
I->iter.data = I;
diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c
index eb4a20ca0..a62e32df2 100644
--- a/ext/com_dotnet/com_typeinfo.c
+++ b/ext/com_dotnet/com_typeinfo.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_typeinfo.c,v 1.7.2.1 2006/01/01 12:50:00 sniper Exp $ */
+/* $Id: com_typeinfo.c,v 1.7.2.1.2.1 2006/08/25 12:01:57 edink Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -220,7 +220,7 @@ PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC
/* Type-library stuff */
void php_com_typelibrary_dtor(void *pDest)
{
- ITypeLib *Lib = *(ITypeLib**)pDest;
+ ITypeLib *Lib = (ITypeLib*)pDest;
ITypeLib_Release(Lib);
}
diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h
index 2f4fcf173..b63ecb2b9 100644
--- a/ext/com_dotnet/php_com_dotnet_internal.h
+++ b/ext/com_dotnet/php_com_dotnet_internal.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_com_dotnet_internal.h,v 1.14.2.3 2006/01/26 11:17:34 rrichards Exp $ */
+/* $Id: php_com_dotnet_internal.h,v 1.14.2.3.2.1 2006/05/10 14:39:10 rrichards Exp $ */
#ifndef PHP_COM_DOTNET_INTERNAL_H
#define PHP_COM_DOTNET_INTERNAL_H
@@ -82,7 +82,7 @@ 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);
+zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
/* com_olechar.c */
@@ -177,7 +177,7 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
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);
+zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
#endif
diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c
index 6096b8d3c..d6e8641ab 100644
--- a/ext/ctype/ctype.c
+++ b/ext/ctype/ctype.c
@@ -40,21 +40,93 @@ ZEND_DECLARE_MODULE_GLOBALS(ctype)
/* True global resources - no need for thread safety here */
/* static int le_ctype; */
+static PHP_MINFO_FUNCTION(ctype);
+
+static PHP_FUNCTION(ctype_alnum);
+static PHP_FUNCTION(ctype_alpha);
+static PHP_FUNCTION(ctype_cntrl);
+static PHP_FUNCTION(ctype_digit);
+static PHP_FUNCTION(ctype_lower);
+static PHP_FUNCTION(ctype_graph);
+static PHP_FUNCTION(ctype_print);
+static PHP_FUNCTION(ctype_punct);
+static PHP_FUNCTION(ctype_space);
+static PHP_FUNCTION(ctype_upper);
+static PHP_FUNCTION(ctype_xdigit);
+
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ctype_alnum, 0)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ctype_alpha, 0)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ctype_cntrl, 0)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ctype_digit, 0)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ctype_lower, 0)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ctype_graph, 0)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ctype_print, 0)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ctype_punct, 0)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ctype_space, 0)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ctype_upper, 0)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ctype_xdigit, 0)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
/* {{{ ctype_functions[]
* Every user visible function must have an entry in ctype_functions[].
*/
-zend_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)
+static zend_function_entry ctype_functions[] = {
+ PHP_FE(ctype_alnum, arginfo_ctype_alnum)
+ PHP_FE(ctype_alpha, arginfo_ctype_alpha)
+ PHP_FE(ctype_cntrl, arginfo_ctype_cntrl)
+ PHP_FE(ctype_digit, arginfo_ctype_digit)
+ PHP_FE(ctype_lower, arginfo_ctype_lower)
+ PHP_FE(ctype_graph, arginfo_ctype_graph)
+ PHP_FE(ctype_print, arginfo_ctype_print)
+ PHP_FE(ctype_punct, arginfo_ctype_punct)
+ PHP_FE(ctype_space, arginfo_ctype_space)
+ PHP_FE(ctype_upper, arginfo_ctype_upper)
+ PHP_FE(ctype_xdigit, arginfo_ctype_xdigit)
{NULL, NULL, NULL} /* Must be the last line in ctype_functions[] */
};
/* }}} */
@@ -81,7 +153,7 @@ ZEND_GET_MODULE(ctype)
/* {{{ PHP_MINFO_FUNCTION
*/
-PHP_MINFO_FUNCTION(ctype)
+static PHP_MINFO_FUNCTION(ctype)
{
php_info_print_table_start();
php_info_print_table_row(2, "ctype functions", "enabled");
@@ -129,7 +201,7 @@ PHP_MINFO_FUNCTION(ctype)
/* {{{ proto bool ctype_alnum(mixed c)
Checks for alphanumeric character(s) */
-PHP_FUNCTION(ctype_alnum)
+static PHP_FUNCTION(ctype_alnum)
{
CTYPE(isalnum);
}
@@ -137,7 +209,7 @@ PHP_FUNCTION(ctype_alnum)
/* {{{ proto bool ctype_alpha(mixed c)
Checks for alphabetic character(s) */
-PHP_FUNCTION(ctype_alpha)
+static PHP_FUNCTION(ctype_alpha)
{
CTYPE(isalpha);
}
@@ -145,7 +217,7 @@ PHP_FUNCTION(ctype_alpha)
/* {{{ proto bool ctype_cntrl(mixed c)
Checks for control character(s) */
-PHP_FUNCTION(ctype_cntrl)
+static PHP_FUNCTION(ctype_cntrl)
{
CTYPE(iscntrl);
}
@@ -153,7 +225,7 @@ PHP_FUNCTION(ctype_cntrl)
/* {{{ proto bool ctype_digit(mixed c)
Checks for numeric character(s) */
-PHP_FUNCTION(ctype_digit)
+static PHP_FUNCTION(ctype_digit)
{
CTYPE(isdigit);
}
@@ -161,7 +233,7 @@ PHP_FUNCTION(ctype_digit)
/* {{{ proto bool ctype_lower(mixed c)
Checks for lowercase character(s) */
-PHP_FUNCTION(ctype_lower)
+static PHP_FUNCTION(ctype_lower)
{
CTYPE(islower);
}
@@ -169,7 +241,7 @@ PHP_FUNCTION(ctype_lower)
/* {{{ proto bool ctype_graph(mixed c)
Checks for any printable character(s) except space */
-PHP_FUNCTION(ctype_graph)
+static PHP_FUNCTION(ctype_graph)
{
CTYPE(isgraph);
}
@@ -177,7 +249,7 @@ PHP_FUNCTION(ctype_graph)
/* {{{ proto bool ctype_print(mixed c)
Checks for printable character(s) */
-PHP_FUNCTION(ctype_print)
+static PHP_FUNCTION(ctype_print)
{
CTYPE(isprint);
}
@@ -185,7 +257,7 @@ PHP_FUNCTION(ctype_print)
/* {{{ proto bool ctype_punct(mixed c)
Checks for any printable character which is not whitespace or an alphanumeric character */
-PHP_FUNCTION(ctype_punct)
+static PHP_FUNCTION(ctype_punct)
{
CTYPE(ispunct);
}
@@ -193,7 +265,7 @@ PHP_FUNCTION(ctype_punct)
/* {{{ proto bool ctype_space(mixed c)
Checks for whitespace character(s)*/
-PHP_FUNCTION(ctype_space)
+static PHP_FUNCTION(ctype_space)
{
CTYPE(isspace);
}
@@ -201,7 +273,7 @@ PHP_FUNCTION(ctype_space)
/* {{{ proto bool ctype_upper(mixed c)
Checks for uppercase character(s) */
-PHP_FUNCTION(ctype_upper)
+static PHP_FUNCTION(ctype_upper)
{
CTYPE(isupper);
}
@@ -209,7 +281,7 @@ PHP_FUNCTION(ctype_upper)
/* {{{ proto bool ctype_xdigit(mixed c)
Checks for character(s) representing a hexadecimal digit */
-PHP_FUNCTION(ctype_xdigit)
+static PHP_FUNCTION(ctype_xdigit)
{
CTYPE(isxdigit);
}
diff --git a/ext/ctype/php_ctype.h b/ext/ctype/php_ctype.h
index ec5d87384..fe88279c4 100644
--- a/ext/ctype/php_ctype.h
+++ b/ext/ctype/php_ctype.h
@@ -33,24 +33,6 @@ extern zend_module_entry ctype_module_entry;
#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:
diff --git a/ext/curl/config.m4 b/ext/curl/config.m4
index 81df11307..15b9f5e1f 100644
--- a/ext/curl/config.m4
+++ b/ext/curl/config.m4
@@ -1,19 +1,19 @@
dnl
-dnl $Id: config.m4,v 1.28.2.3 2005/11/22 22:53:34 tony2001 Exp $
+dnl $Id: config.m4,v 1.28.2.3.2.3 2006/09/15 15:42:53 tony2001 Exp $
dnl
-PHP_ARG_WITH(curl, for CURL support,
-[ --with-curl[=DIR] Include CURL support])
+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)
+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)
+ 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
@@ -101,6 +101,20 @@ if test "$PHP_CURL" != "no"; then
$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
])
+ PHP_CHECK_LIBRARY(curl,curl_easy_strerror,
+ [
+ AC_DEFINE(HAVE_CURL_EASY_STRERROR,1,[ ])
+ ],[],[
+ $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
+ ])
+
+ PHP_CHECK_LIBRARY(curl,curl_multi_strerror,
+ [
+ AC_DEFINE(HAVE_CURL_MULTI_STRERROR,1,[ ])
+ ],[],[
+ $CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR
+ ])
+
if test "$PHP_CURLWRAPPERS" != "no" ; then
AC_DEFINE(PHP_CURL_URL_WRAPPERS,1,[ ])
fi
diff --git a/ext/curl/config.w32 b/ext/curl/config.w32
index a1bdc0c05..a0b009197 100644
--- a/ext/curl/config.w32
+++ b/ext/curl/config.w32
@@ -1,7 +1,7 @@
-// $Id: config.w32,v 1.3.4.1 2005/10/25 14:32:33 mike Exp $
+// $Id: config.w32,v 1.3.4.1.2.1 2006/09/09 20:04:50 bjori Exp $
// vim:ft=javascript
-ARG_WITH("curl", "CURL support", "no");
+ARG_WITH("curl", "cURL support", "no");
if (PHP_CURL != "no") {
if (CHECK_LIB("libcurl.lib", "curl", PHP_CURL) &&
@@ -11,8 +11,8 @@ if (PHP_CURL != "no") {
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');
+ 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 {
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index dfdbfe78e..8c8bd6945 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: interface.c,v 1.62.2.16 2006/08/10 17:16:35 iliaa Exp $ */
+/* $Id: interface.c,v 1.62.2.14.2.12 2006/10/10 23:12:59 iliaa Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -163,12 +163,12 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
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); \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL '%s'", str); \
RETURN_FALSE; \
} \
\
if (php_memnstr(str, tmp_url->path, strlen(tmp_url->path), str + len)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Url '%s' contains unencoded control characters.", str); \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL '%s' contains unencoded control characters.", str); \
RETURN_FALSE; \
} \
\
@@ -181,27 +181,128 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
php_url_free(tmp_url); \
}
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_version, 0, 0, 0)
+ ZEND_ARG_INFO(0, version)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_init, 0, 0, 0)
+ ZEND_ARG_INFO(0, url)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_curl_copy_handle, 0)
+ ZEND_ARG_INFO(0, ch)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_curl_setopt, 0)
+ ZEND_ARG_INFO(0, ch)
+ ZEND_ARG_INFO(0, option)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_curl_setopt_array, 0)
+ ZEND_ARG_INFO(0, ch)
+ ZEND_ARG_INFO(0, options)/* ARRAY_INFO(0, options, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_curl_exec, 0)
+ ZEND_ARG_INFO(0, ch)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_getinfo, 0, 0, 1)
+ ZEND_ARG_INFO(0, ch)
+ ZEND_ARG_INFO(0, option)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_curl_error, 0)
+ ZEND_ARG_INFO(0, ch)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_curl_errno, 0)
+ ZEND_ARG_INFO(0, ch)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_curl_close, 0)
+ ZEND_ARG_INFO(0, ch)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_init, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_add_handle, 0)
+ ZEND_ARG_INFO(0, mh)
+ ZEND_ARG_INFO(0, ch)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_remove_handle, 0)
+ ZEND_ARG_INFO(0, mh)
+ ZEND_ARG_INFO(0, ch)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_multi_select, 0, 0, 1)
+ ZEND_ARG_INFO(0, mh)
+ ZEND_ARG_INFO(0, timeout)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_multi_exec, 0, 0, 1)
+ ZEND_ARG_INFO(0, mh)
+ ZEND_ARG_INFO(1, still_running)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_getcontent, 0)
+ ZEND_ARG_INFO(0, ch)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_multi_info_read, 0, 0, 1)
+ ZEND_ARG_INFO(0, mh)
+ ZEND_ARG_INFO(0, msgs_in_queue)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_close, 0)
+ ZEND_ARG_INFO(0, mh)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
/* {{{ curl_functions[]
*/
zend_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)
+ PHP_FE(curl_init, arginfo_curl_init)
+ PHP_FE(curl_copy_handle, arginfo_curl_copy_handle)
+ PHP_FE(curl_version, arginfo_curl_version)
+ PHP_FE(curl_setopt, arginfo_curl_setopt)
+ PHP_FE(curl_setopt_array, arginfo_curl_setopt_array)
+ PHP_FE(curl_exec, arginfo_curl_exec)
+ PHP_FE(curl_getinfo, arginfo_curl_getinfo)
+ PHP_FE(curl_error, arginfo_curl_error)
+ PHP_FE(curl_errno, arginfo_curl_errno)
+ PHP_FE(curl_close, arginfo_curl_close)
+ PHP_FE(curl_multi_init, arginfo_curl_multi_init)
+ PHP_FE(curl_multi_add_handle, arginfo_curl_multi_add_handle)
+ PHP_FE(curl_multi_remove_handle, arginfo_curl_multi_remove_handle)
+ PHP_FE(curl_multi_select, arginfo_curl_multi_select)
+ PHP_FE(curl_multi_exec, arginfo_curl_multi_exec)
+ PHP_FE(curl_multi_getcontent, arginfo_curl_multi_getcontent)
+ PHP_FE(curl_multi_info_read, arginfo_curl_multi_info_read)
+ PHP_FE(curl_multi_close, arginfo_curl_multi_close)
{NULL, NULL, NULL}
};
/* }}} */
@@ -224,9 +325,6 @@ zend_module_entry curl_module_entry = {
#ifdef COMPILE_DL_CURL
ZEND_GET_MODULE (curl)
-# ifdef PHP_WIN32
-# include "zend_arg_defs.c"
-# endif
#endif
/* {{{ PHP_MINFO_FUNCTION
@@ -234,8 +332,8 @@ ZEND_GET_MODULE (curl)
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_row(2, "cURL support", "enabled");
+ php_info_print_table_row(2, "cURL Information", curl_version());
php_info_print_table_end();
}
/* }}} */
@@ -465,13 +563,11 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLE_SSL_CIPHER);
REGISTER_CURL_CONSTANT(CURLE_SSL_CACERT);
REGISTER_CURL_CONSTANT(CURLE_BAD_CONTENT_ENCODING);
-#ifdef CURLE_LDAP_INVALID_URL
+#if LIBCURL_VERSION_NUM >= 0x070a08
REGISTER_CURL_CONSTANT(CURLE_LDAP_INVALID_URL);
-#endif
-#ifdef CURLE_FILESIZE_EXCEEDED
REGISTER_CURL_CONSTANT(CURLE_FILESIZE_EXCEEDED);
#endif
-#ifdef CURLE_FTP_SSL_FAILED
+#if LIBCURL_VERSION_NUM >= 0x070b00
REGISTER_CURL_CONSTANT(CURLE_FTP_SSL_FAILED);
#endif
@@ -495,13 +591,21 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLMSG_DONE);
-#ifdef CURLOPT_FTPSSLAUTH
+#if LIBCURL_VERSION_NUM >= 0x070c02
REGISTER_CURL_CONSTANT(CURLOPT_FTPSSLAUTH);
REGISTER_CURL_CONSTANT(CURLFTPAUTH_DEFAULT);
REGISTER_CURL_CONSTANT(CURLFTPAUTH_SSL);
REGISTER_CURL_CONSTANT(CURLFTPAUTH_TLS);
#endif
+#if LIBCURL_VERSION_NUM > 0x070b00
+ REGISTER_CURL_CONSTANT(CURLOPT_FTP_SSL);
+ REGISTER_CURL_CONSTANT(CURLFTPSSL_NONE);
+ REGISTER_CURL_CONSTANT(CURLFTPSSL_TRY);
+ REGISTER_CURL_CONSTANT(CURLFTPSSL_CONTROL);
+ REGISTER_CURL_CONSTANT(CURLFTPSSL_ALL);
+#endif
+
#ifdef PHP_CURL_NEED_OPENSSL_TSL
{
int i, c = CRYPTO_num_locks();
@@ -956,7 +1060,7 @@ static void alloc_curl_handle(php_curl **ch)
/* }}} */
/* {{{ proto resource curl_init([string url])
- Initialize a CURL session */
+ Initialize a cURL session */
PHP_FUNCTION(curl_init)
{
zval **url;
@@ -1041,7 +1145,7 @@ PHP_FUNCTION(curl_copy_handle)
}
alloc_curl_handle(&dupch);
- TSRMLS_SET_CTX(ch->thread_ctx);
+ TSRMLS_SET_CTX(dupch->thread_ctx);
dupch->cp = cp;
dupch->handlers->write->method = ch->handlers->write->method;
@@ -1049,6 +1153,38 @@ PHP_FUNCTION(curl_copy_handle)
dupch->handlers->read->method = ch->handlers->read->method;
dupch->handlers->write_header->method = ch->handlers->write_header->method;
+ dupch->handlers->write->fp = ch->handlers->write->fp;
+ dupch->handlers->write_header->fp = ch->handlers->write_header->fp;
+ dupch->handlers->read->fp = ch->handlers->read->fp;
+ dupch->handlers->read->fd = ch->handlers->read->fd;
+
+ if (ch->handlers->passwd) {
+ zval_add_ref(&ch->handlers->passwd);
+ dupch->handlers->passwd = ch->handlers->passwd;
+ curl_easy_setopt(ch->cp, CURLOPT_PASSWDDATA, (void *) dupch);
+ }
+ if (ch->handlers->write->func_name) {
+ zval_add_ref(&ch->handlers->write->func_name);
+ dupch->handlers->write->func_name = ch->handlers->write->func_name;
+ }
+ if (ch->handlers->read->func_name) {
+ zval_add_ref(&ch->handlers->read->func_name);
+ dupch->handlers->read->func_name = ch->handlers->read->func_name;
+ }
+ if (ch->handlers->write_header->func_name) {
+ zval_add_ref(&ch->handlers->write_header->func_name);
+ dupch->handlers->write_header->func_name = ch->handlers->write_header->func_name;
+ }
+
+ curl_easy_setopt(dupch->cp, CURLOPT_ERRORBUFFER, dupch->err.str);
+ curl_easy_setopt(dupch->cp, CURLOPT_FILE, (void *) dupch);
+ curl_easy_setopt(dupch->cp, CURLOPT_INFILE, (void *) dupch);
+ curl_easy_setopt(dupch->cp, CURLOPT_WRITEHEADER, (void *) dupch);
+
+ zend_llist_copy(&dupch->to_free.str, &ch->to_free.str);
+ zend_llist_copy(&dupch->to_free.slist, &ch->to_free.slist);
+ zend_llist_copy(&dupch->to_free.post, &ch->to_free.post);
+
ZEND_REGISTER_RESOURCE(return_value, dupch, le_curl);
dupch->id = Z_LVAL_P(return_value);
}
@@ -1110,9 +1246,12 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
case CURLOPT_PROXYAUTH:
#endif
-#ifdef CURLOPT_FTPSSLAUTH
+#if LIBCURL_VERSION_NUM >= 0x070c02
case CURLOPT_FTPSSLAUTH:
#endif
+#if LIBCURL_VERSION_NUM > 0x070b00
+ case CURLOPT_FTP_SSL:
+#endif
case CURLOPT_UNRESTRICTED_AUTH:
case CURLOPT_PORT:
case CURLOPT_AUTOREFERER:
@@ -1179,11 +1318,13 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
ZEND_VERIFY_RESOURCE(what);
if (FAILURE == php_stream_cast((php_stream *) what, PHP_STREAM_AS_STDIO, (void *) &fp, REPORT_ERRORS)) {
- RETURN_FALSE;
+ RETVAL_FALSE;
+ return 1;
}
if (!fp) {
- RETURN_FALSE;
+ RETVAL_FALSE;
+ return 1;
}
error = CURLE_OK;
@@ -1278,7 +1419,8 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
postfields = HASH_OF(*zvalue);
if (! postfields) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
- RETURN_FALSE;
+ RETVAL_FALSE;
+ return 1;
}
for (zend_hash_internal_pointer_reset(postfields);
@@ -1300,7 +1442,8 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
++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;
+ RETVAL_FALSE;
+ return 1;
}
error = curl_formadd(&first, &last,
CURLFORM_COPYNAME, string_key,
@@ -1319,7 +1462,8 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
SAVE_CURL_ERROR(ch, error);
if (error != CURLE_OK) {
- RETURN_FALSE;
+ RETVAL_FALSE
+ return 1;
}
zend_llist_add_element(&ch->to_free.post, &first);
@@ -1347,7 +1491,8 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
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;
+ RETVAL_FALSE;
+ return 1;
}
for (zend_hash_internal_pointer_reset(ph);
@@ -1364,7 +1509,8 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
if (!slist) {
efree(indiv);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not build curl_slist");
- RETURN_FALSE;
+ RETVAL_FALSE;
+ return 1;
}
zend_llist_add_element(&ch->to_free.str, &indiv);
}
@@ -1386,7 +1532,8 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
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;
+ RETVAL_FALSE;
+ return 1;
}
copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
@@ -1419,7 +1566,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
}
/* {{{ proto bool curl_setopt(resource ch, int option, mixed value)
- Set an option for a CURL transfer */
+ Set an option for a cURL transfer */
PHP_FUNCTION(curl_setopt)
{
zval **zid, **zoption, **zvalue;
@@ -1442,7 +1589,7 @@ PHP_FUNCTION(curl_setopt)
/* }}} */
/* {{{ proto bool curl_setopt_array(resource ch, array options)
- Set an array of option for a CURL transfer */
+ Set an array of option for a cURL transfer */
PHP_FUNCTION(curl_setopt_array)
{
zval *zid, *arr, **entry;
@@ -1491,7 +1638,7 @@ void _php_curl_cleanup_handle(php_curl *ch)
/* }}} */
/* {{{ proto bool curl_exec(resource ch)
- Perform a CURL session */
+ Perform a cURL session */
PHP_FUNCTION(curl_exec)
{
zval **zid;
@@ -1524,11 +1671,15 @@ PHP_FUNCTION(curl_exec)
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1);
}
--ch->uses;
- RETURN_TRUE;
+ if (ch->handlers->write->method == PHP_CURL_RETURN) {
+ RETURN_EMPTY_STRING();
+ } else {
+ RETURN_TRUE;
+ }
}
/* }}} */
-/* {{{ proto mixed curl_getinfo(resource ch, int opt)
+/* {{{ proto mixed curl_getinfo(resource ch [, int option])
Get information regarding a specific transfer */
PHP_FUNCTION(curl_getinfo)
{
@@ -1712,7 +1863,7 @@ PHP_FUNCTION(curl_errno)
/* }}} */
/* {{{ proto void curl_close(resource ch)
- Close a CURL session */
+ Close a cURL session */
PHP_FUNCTION(curl_close)
{
zval **zid;
@@ -1725,7 +1876,7 @@ PHP_FUNCTION(curl_close)
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");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to close cURL handle from a callback");
return;
}
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index bf21aaf59..488c16365 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: multi.c,v 1.19.2.3 2006/04/13 11:26:10 tony2001 Exp $ */
+/* $Id: multi.c,v 1.19.2.3.2.6 2006/10/06 03:48:00 sebastian Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -62,13 +62,13 @@ PHP_FUNCTION(curl_multi_init)
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_llist_init(&mh->easyh, sizeof(zval), _php_curl_multi_cleanup_list, 0);
ZEND_REGISTER_RESOURCE(return_value, mh, le_curl_multi_handle);
}
/* }}} */
-/* {{{ proto int curl_multi_add_handle(resource multi, resource ch)
+/* {{{ proto int curl_multi_add_handle(resource mh, resource ch)
Add a normal cURL handle to a cURL multi handle */
PHP_FUNCTION(curl_multi_add_handle)
{
@@ -76,6 +76,7 @@ PHP_FUNCTION(curl_multi_add_handle)
zval *z_ch;
php_curlm *mh;
php_curl *ch;
+ zval tmp_val;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &z_mh, &z_ch) == FAILURE) {
return;
@@ -84,17 +85,51 @@ PHP_FUNCTION(curl_multi_add_handle)
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);
+ /* we want to create a copy of this zval that we store in the multihandle structure element "easyh" */
+ tmp_val = *z_ch;
+ zval_copy_ctor(&tmp_val);
+
+ zend_llist_add_element(&mh->easyh, &tmp_val);
RETURN_LONG((long) curl_multi_add_handle(mh->multi, ch->cp));
}
/* }}} */
+void _php_curl_multi_cleanup_list(void *data) /* {{{ */
+{
+ zval *z_ch = (zval *)data;
+ php_curl *ch;
+ TSRMLS_FETCH();
+
+ if (!z_ch) {
+ return;
+ }
+
+ ch = (php_curl *) zend_fetch_resource(&z_ch TSRMLS_CC, -1, le_curl_name, NULL, 1, le_curl);
+ if (!ch) {
+ return;
+ }
+
+ if (ch->uses) {
+ ch->uses--;
+ } else {
+ zend_list_delete(Z_LVAL_P(z_ch));
+ }
+}
+/* }}} */
+
+/* Used internally as comparison routine passed to zend_list_del_element */
+static int curl_compare_resources( zval *z1, zval **z2 )
+{
+ return (Z_TYPE_P( z1 ) == Z_TYPE_PP( z2 ) &&
+ Z_TYPE_P( z1 ) == IS_RESOURCE &&
+ Z_LVAL_P( z1 ) == Z_LVAL_PP( z2 ) );
+}
+
+
/* {{{ 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)
@@ -112,6 +147,9 @@ PHP_FUNCTION(curl_multi_remove_handle)
ZEND_FETCH_RESOURCE(ch, php_curl *, &z_ch, -1, le_curl_name, le_curl);
--ch->uses;
+
+ zend_llist_del_element( &mh->easyh, &z_ch,
+ (int (*)(void *, void *)) curl_compare_resources );
RETURN_LONG((long) curl_multi_remove_handle(mh->multi, ch->cp));
}
@@ -199,20 +237,19 @@ PHP_FUNCTION(curl_multi_getcontent)
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1);
}
}
+/* }}} */
-/* {{{ proto array curl_multi_info_read(resource mh)
+/* {{{ proto array curl_multi_info_read(resource mh [, long msgs_in_queue])
Get information about the current transfers */
PHP_FUNCTION(curl_multi_info_read)
{
zval *z_mh;
php_curlm *mh;
- CURLMsg *tmp_msg;
+ CURLMsg *tmp_msg;
int queued_msgs;
+ zval *zmsgs_in_queue = NULL;
- /* XXX: Not Implemented */
- return;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_mh) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z", &z_mh, &zmsgs_in_queue) == FAILURE) {
return;
}
@@ -222,12 +259,46 @@ PHP_FUNCTION(curl_multi_info_read)
if (tmp_msg == NULL) {
RETURN_FALSE;
}
+ if (zmsgs_in_queue) {
+ zval_dtor(zmsgs_in_queue);
+ ZVAL_LONG(zmsgs_in_queue, queued_msgs);
+ }
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);
+
+ /* find the original easy curl handle */
+ {
+ zend_llist_position pos;
+ php_curl *ch;
+ zval *pz_ch;
+
+ /* search the list of easy handles hanging off the multi-handle */
+ for(pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch;
+ pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
+ ZEND_FETCH_RESOURCE(ch, php_curl *, &pz_ch, -1, le_curl_name, le_curl);
+ if (ch->cp == tmp_msg->easy_handle) {
+
+ /* we are adding a reference to the underlying php_curl
+ resource, so we need to add one to the resource's refcount
+ in order to ensure it doesn't get destroyed when the
+ underlying curl easy handle goes out of scope.
+ Normally you would call zval_copy_ctor( pz_ch ), or
+ SEPARATE_ZVAL, but those create new zvals, which is already
+ being done in add_assoc_resource */
+
+ zend_list_addref( Z_RESVAL_P( pz_ch ) );
+
+ /* add_assoc_resource automatically creates a new zval to
+ wrap the "resource" represented by the current pz_ch */
+
+ add_assoc_resource(return_value, "handle", Z_RESVAL_P(pz_ch));
+
+ break;
+ }
+ }
+ }
}
/* }}} */
diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h
index a250e9aed..e4cb0c3e8 100644
--- a/ext/curl/php_curl.h
+++ b/ext/curl/php_curl.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_curl.h,v 1.44.2.2 2006/01/24 20:11:14 iliaa Exp $ */
+/* $Id: php_curl.h,v 1.44.2.2.2.1 2006/10/05 15:06:40 tony2001 Exp $ */
#ifndef _PHP_CURL_H
#define _PHP_CURL_H
@@ -138,6 +138,7 @@ typedef struct {
} php_curlm;
void _php_curl_cleanup_handle(php_curl *);
+void _php_curl_multi_cleanup_list(void *data);
/* streams support */
diff --git a/ext/curl/streams.c b/ext/curl/streams.c
index a62aa1a39..1ff5a3d6d 100644
--- a/ext/curl/streams.c
+++ b/ext/curl/streams.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.14.2.3 2006/08/10 17:16:35 iliaa Exp $ */
+/* $Id: streams.c,v 1.14.2.2.2.9 2006/09/15 15:42:53 tony2001 Exp $ */
/* This file implements cURL based wrappers.
* NOTE: If you are implementing your own streams that are intended to
@@ -87,31 +87,32 @@ static size_t on_header_available(char *data, size_t size, size_t nmemb, void *c
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';
+ if (!(length == 2 && data[0] == '\r' && data[1] == '\n')) {
+ 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);
}
}
- 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;
}
@@ -251,7 +252,7 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
{
php_stream *stream;
php_curl_stream *curlstream;
- zval *tmp;
+ zval *tmp, **ctx_opt = NULL;
curlstream = emalloc(sizeof(php_curl_stream));
memset(curlstream, 0, sizeof(php_curl_stream));
@@ -288,13 +289,6 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
curl_easy_setopt(curlstream->curl, CURLOPT_HEADERFUNCTION, on_header_available);
curl_easy_setopt(curlstream->curl, CURLOPT_WRITEHEADER, stream);
- /* currently buggy (bug is in curl) */
- if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
- curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 0);
- } else {
- 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);
@@ -306,6 +300,93 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, FG(user_agent) ? FG(user_agent) : "PHP/" PHP_VERSION);
/* TODO: read cookies and options from context */
+ if (context && !strncasecmp(filename, "http", sizeof("http")-1)) {
+ if (SUCCESS == php_stream_context_get_option(context, "http", "curl_verify_ssl_host", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 1);
+ } else {
+ curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 0);
+ }
+ if (SUCCESS == php_stream_context_get_option(context, "http", "curl_verify_ssl_peer", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYPEER, 1);
+ } else {
+ curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYPEER, 0);
+ }
+
+ /* HTTP(S) */
+ if (SUCCESS == php_stream_context_get_option(context, "http", "user_agent", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, Z_STRVAL_PP(ctx_opt));
+ }
+ if (SUCCESS == php_stream_context_get_option(context, "http", "header", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_ARRAY) {
+ HashPosition pos;
+ zval **header = NULL;
+ struct curl_slist *hl = NULL;
+
+ for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(ctx_opt), &pos);
+ SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(ctx_opt), (void *)&header, &pos);
+ zend_hash_move_forward_ex(Z_ARRVAL_PP(ctx_opt), &pos)) {
+ if (Z_TYPE_PP(header) == IS_STRING) {
+ hl = curl_slist_append(hl, Z_STRVAL_PP(header));
+ }
+ }
+ if (hl) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_HTTPHEADER, hl);
+ }
+ }
+ if (SUCCESS == php_stream_context_get_option(context, "http", "method", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) {
+ if (strcasecmp(Z_STRVAL_PP(ctx_opt), "get")) {
+ if (!strcasecmp(Z_STRVAL_PP(ctx_opt), "head")) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_NOBODY, 1);
+ } else {
+ if (!strcasecmp(Z_STRVAL_PP(ctx_opt), "post")) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_POST, 1);
+ } else {
+ curl_easy_setopt(curlstream->curl, CURLOPT_CUSTOMREQUEST, Z_STRVAL_PP(ctx_opt));
+ }
+ if (SUCCESS == php_stream_context_get_option(context, "http", "content", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_POSTFIELDS, Z_STRVAL_PP(ctx_opt));
+ curl_easy_setopt(curlstream->curl, CURLOPT_POSTFIELDSIZE, (long)Z_STRLEN_PP(ctx_opt));
+ }
+ }
+ }
+ }
+ if (SUCCESS == php_stream_context_get_option(context, "http", "proxy", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_PROXY, Z_STRVAL_PP(ctx_opt));
+ }
+ if (SUCCESS == php_stream_context_get_option(context, "http", "max_redirects", &ctx_opt)) {
+ long mr = 20;
+ if (Z_TYPE_PP(ctx_opt) != IS_STRING || !is_numeric_string(Z_STRVAL_PP(ctx_opt), Z_STRLEN_PP(ctx_opt), &mr, NULL, 1)) {
+ if (Z_TYPE_PP(ctx_opt) == IS_LONG) {
+ mr = Z_LVAL_PP(ctx_opt);
+ }
+ }
+ if (mr > 1) {
+ if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 0);
+ } else {
+ curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 1);
+ }
+ curl_easy_setopt(curlstream->curl, CURLOPT_MAXREDIRS, mr);
+ }
+ } else {
+ if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 0);
+ } else {
+ curl_easy_setopt(curlstream->curl, CURLOPT_FOLLOWLOCATION, 1);
+ }
+ curl_easy_setopt(curlstream->curl, CURLOPT_MAXREDIRS, 20L);
+ }
+ } else if (context && !strncasecmp(filename, "ftps", sizeof("ftps")-1)) {
+ if (SUCCESS == php_stream_context_get_option(context, "ftp", "curl_verify_ssl_host", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 1);
+ } else {
+ curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 0);
+ }
+ if (SUCCESS == php_stream_context_get_option(context, "ftp", "curl_verify_ssl_peer", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) {
+ curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYPEER, 1);
+ } else {
+ curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYPEER, 0);
+ }
+ }
/* prepare for "pull" mode */
curl_multi_add_handle(curlstream->multi, curlstream->curl);
@@ -345,15 +426,41 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
/* fire up the connection; we need to detect a connection error here,
* otherwise the curlstream we return ends up doing nothing useful. */
CURLMcode m;
+ CURLMsg *msg;
+ int msgs_left, msg_found = 0;
while (CURLM_CALL_MULTI_PERFORM == (m = curl_multi_perform(curlstream->multi, &curlstream->pending))) {
; /* spin */
}
if (m != CURLM_OK) {
+#if HAVE_CURL_MULTI_STRERROR
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", curl_multi_strerror(m));
+#else
php_error_docref(NULL TSRMLS_CC, E_WARNING, "There was an error mcode=%d", m);
+#endif
+ php_stream_close(stream);
+ return NULL;
+ }
+
+ /* we have only one curl handle here, even though we use multi syntax,
+ * so it's ok to fail on any error */
+ while ((msg = curl_multi_info_read(curlstream->multi, &msgs_left))) {
+ if (msg->data.result == CURLE_OK) {
+ continue;
+ } else {
+#if HAVE_CURL_EASY_STRERROR
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", curl_easy_strerror(msg->data.result));
+#else
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "There was an error mcode=%d", msg->data.result);
+#endif
+ msg_found++;
+ }
+ }
+ if (msg_found) {
+ php_stream_close(stream);
+ return NULL;
}
-
}
return stream;
diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c
index c8ad75a80..c066b11c2 100644
--- a/ext/date/lib/dow.c
+++ b/ext/date/lib/dow.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dow.c,v 1.8.2.3 2006/01/01 12:50:01 sniper Exp $ */
+/* $Id: dow.c,v 1.8.2.3.2.2 2006/06/27 21:00:03 nlopess Exp $ */
#include "timelib.h"
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c
index 323482d1f..bfbb4cb68 100644
--- a/ext/date/lib/parse_date.c
+++ b/ext/date/lib/parse_date.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.12 on Tue Apr 11 20:02:18 2006 */
+/* Generated by re2c 0.9.12 on Sat Sep 9 14:19:46 2006 */
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: parse_date.c,v 1.29.2.30 2006/04/11 18:03:46 derick Exp $ */
+/* $Id: parse_date.c,v 1.29.2.30.2.7 2006/09/09 12:26:22 derick Exp $ */
#include "timelib.h"
@@ -50,6 +50,7 @@
#define TIMELIB_MONTH 5
#define TIMELIB_YEAR 6
#define TIMELIB_WEEKDAY 7
+#define TIMELIB_SPECIAL 8
#define EOI 257
#define TIME 258
@@ -102,8 +103,9 @@ typedef unsigned char uchar;
#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) { add_error(s, "Double date specification"); timelib_string_free(str); 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_RELATIVE() { s->time->have_relative = 1; s->time->relative.weekday_behavior = 1; }
#define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_weekday_relative = 1; }
+#define TIMELIB_HAVE_SPECIAL_RELATIVE() { s->time->have_special_relative = 1; }
#define TIMELIB_HAVE_TZ() { s->cur = cursor; if (s->time->have_zone) { add_warning(s, "Double timezone specification"); timelib_string_free(str); return TIMELIB_ERROR; } else { s->time->have_zone = 1; } }
#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
@@ -144,7 +146,7 @@ typedef struct Scanner {
struct timelib_error_container *errors;
struct timelib_time *time;
- timelib_tzdb *tzdb;
+ const timelib_tzdb *tzdb;
} Scanner;
typedef struct _timelib_lookup_table {
@@ -162,17 +164,17 @@ typedef struct _timelib_relunit {
#define HOUR(a) (int)(a * 60)
/* The timezone table. */
-static timelib_tz_lookup_table timelib_timezone_lookup[] = {
+const static timelib_tz_lookup_table timelib_timezone_lookup[] = {
#include "timezonemap.h"
{ NULL, 0, 0, NULL },
};
-static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = {
+const static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = {
#include "fallbackmap.h"
{ NULL, 0, 0, NULL },
};
-static timelib_tz_lookup_table timelib_timezone_utc[] = {
+const static timelib_tz_lookup_table timelib_timezone_utc[] = {
{ "utc", 0, 0, "UTC" },
};
@@ -215,6 +217,8 @@ static timelib_relunit const timelib_relunit_lookup[] = {
{ "sunday", TIMELIB_WEEKDAY, 0 },
{ "sun", TIMELIB_WEEKDAY, 0 },
+ { "weekday", TIMELIB_SPECIAL, TIMELIB_SPECIAL_WEEKDAY },
+ { "weekdays", TIMELIB_SPECIAL, TIMELIB_SPECIAL_WEEKDAY },
{ NULL, 0, 0 }
};
@@ -603,14 +607,20 @@ static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, S
s->time->relative.weekday = relunit->multiplier;
s->time->relative.weekday_behavior = behavior;
break;
+
+ case TIMELIB_SPECIAL:
+ TIMELIB_HAVE_SPECIAL_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+ s->time->special.type = relunit->multiplier;
+ s->time->special.amount = amount;
}
}
-static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst)
+const 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 = NULL;
- timelib_tz_lookup_table *fmp;
+ const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
+ const timelib_tz_lookup_table *fmp;
if (strcasecmp("utc", word) == 0 || strcasecmp("gmt", word) == 0) {
return timelib_timezone_utc;
@@ -649,7 +659,7 @@ 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;
+ const timelib_tz_lookup_table *tp;
while (**ptr != '\0' && **ptr != ')') {
++*ptr;
@@ -671,7 +681,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
return value;
}
-static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, timelib_tzdb *tzdb)
+static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
{
timelib_tzinfo *res;
long retval = 0;
@@ -868,21 +878,21 @@ yy2:
++YYCURSOR;
if((yych = *YYCURSOR) <= 'E'){
if(yych <= ')'){
- if(yych >= ')') goto yy132;
+ if(yych >= ')') goto yy136;
goto yy3;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy1405;
+ if(yych <= 'D') goto yy137;
+ goto yy1373;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
- if(yych >= 'a') goto yy138;
+ if(yych <= 'Z') goto yy137;
+ if(yych >= 'a') goto yy142;
goto yy3;
} else {
- if(yych <= 'e') goto yy1414;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'e') goto yy1382;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -907,20 +917,20 @@ yy4:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy1405;
+ if(yych <= 'D') goto yy137;
+ goto yy1373;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'e') goto yy1405;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'e') goto yy1373;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -929,35 +939,35 @@ yy5:
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= 'D'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
if(yych <= 'H'){
- if(yych <= 'E') goto yy1376;
- goto yy133;
+ if(yych <= 'E') goto yy1344;
+ goto yy137;
} else {
- if(yych <= 'I') goto yy1377;
- if(yych <= 'N') goto yy133;
- goto yy1375;
+ if(yych <= 'I') goto yy1345;
+ if(yych <= 'N') goto yy137;
+ goto yy1343;
}
}
} else {
if(yych <= 'h'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych == 'e') goto yy1392;
- goto yy138;
+ if(yych == 'e') goto yy1360;
+ goto yy142;
}
} else {
if(yych <= 'n'){
- if(yych <= 'i') goto yy1393;
- goto yy138;
+ if(yych <= 'i') goto yy1361;
+ goto yy142;
} else {
- if(yych <= 'o') goto yy1391;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'o') goto yy1359;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -967,35 +977,35 @@ yy6:
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= 'D'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
if(yych <= 'H'){
- if(yych <= 'E') goto yy1376;
- goto yy133;
+ if(yych <= 'E') goto yy1344;
+ goto yy137;
} else {
- if(yych <= 'I') goto yy1377;
- if(yych <= 'N') goto yy133;
- goto yy1375;
+ if(yych <= 'I') goto yy1345;
+ if(yych <= 'N') goto yy137;
+ goto yy1343;
}
}
} else {
if(yych <= 'h'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych == 'e') goto yy1376;
- goto yy133;
+ if(yych == 'e') goto yy1344;
+ goto yy137;
}
} else {
if(yych <= 'n'){
- if(yych <= 'i') goto yy1377;
- goto yy133;
+ if(yych <= 'i') goto yy1345;
+ goto yy137;
} else {
- if(yych <= 'o') goto yy1375;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'o') goto yy1343;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1005,27 +1015,27 @@ yy7:
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy1345;
+ goto yy1313;
} else {
- if(yych == 'I') goto yy1346;
- if(yych <= 'N') goto yy133;
- goto yy1347;
+ if(yych == 'I') goto yy1314;
+ if(yych <= 'N') goto yy137;
+ goto yy1315;
}
} else {
if(yych <= 'h'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy1360;
- goto yy138;
+ if(yych <= 'a') goto yy1328;
+ goto yy142;
} else {
if(yych <= 'n'){
- if(yych <= 'i') goto yy1361;
- goto yy138;
+ if(yych <= 'i') goto yy1329;
+ goto yy142;
} else {
- if(yych <= 'o') goto yy1362;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'o') goto yy1330;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1035,27 +1045,27 @@ yy8:
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy1345;
+ goto yy1313;
} else {
- if(yych == 'I') goto yy1346;
- if(yych <= 'N') goto yy133;
- goto yy1347;
+ if(yych == 'I') goto yy1314;
+ if(yych <= 'N') goto yy137;
+ goto yy1315;
}
} else {
if(yych <= 'h'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy1345;
- goto yy133;
+ if(yych <= 'a') goto yy1313;
+ goto yy137;
} else {
if(yych <= 'n'){
- if(yych <= 'i') goto yy1346;
- goto yy133;
+ if(yych <= 'i') goto yy1314;
+ goto yy137;
} else {
- if(yych <= 'o') goto yy1347;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'o') goto yy1315;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1066,17 +1076,17 @@ yy9:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case ')': goto yy132;
+ case ')': goto yy136;
case '0':
- case '1': goto yy1277;
- case '2': goto yy1278;
+ case '1': goto yy1245;
+ case '2': goto yy1246;
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
- case '9': goto yy1279;
+ case '9': goto yy1247;
case 'A':
case 'B':
case 'C':
@@ -1092,12 +1102,12 @@ yy9:
case 'S':
case 'T': case 'V': case 'X':
case 'Y':
- case 'Z': goto yy133;
- case 'E': goto yy1272;
- case 'H': goto yy1273;
- case 'O': goto yy1274;
- case 'U': goto yy1275;
- case 'W': goto yy1276;
+ case 'Z': goto yy137;
+ case 'E': goto yy1240;
+ case 'H': goto yy1241;
+ case 'O': goto yy1242;
+ case 'U': goto yy1243;
+ case 'W': goto yy1244;
case 'a':
case 'b':
case 'c':
@@ -1113,12 +1123,12 @@ yy9:
case 's':
case 't': case 'v': case 'x':
case 'y':
- case 'z': goto yy138;
- case 'e': goto yy1314;
- case 'h': goto yy1315;
- case 'o': goto yy1316;
- case 'u': goto yy1317;
- case 'w': goto yy1318;
+ case 'z': goto yy142;
+ case 'e': goto yy1282;
+ case 'h': goto yy1283;
+ case 'o': goto yy1284;
+ case 'u': goto yy1285;
+ case 'w': goto yy1286;
default: goto yy3;
}
yy10:
@@ -1127,17 +1137,17 @@ yy10:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case ')': goto yy132;
+ case ')': goto yy136;
case '0':
- case '1': goto yy1277;
- case '2': goto yy1278;
+ case '1': goto yy1245;
+ case '2': goto yy1246;
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
- case '9': goto yy1279;
+ case '9': goto yy1247;
case 'A':
case 'B':
case 'C':
@@ -1168,21 +1178,21 @@ yy10:
case 's':
case 't': case 'v': case 'x':
case 'y':
- case 'z': goto yy133;
- case 'E': case 'e': goto yy1272;
- case 'H': case 'h': goto yy1273;
- case 'O': case 'o': goto yy1274;
- case 'U': case 'u': goto yy1275;
- case 'W': case 'w': goto yy1276;
+ case 'z': goto yy137;
+ case 'E': case 'e': goto yy1240;
+ case 'H': case 'h': goto yy1241;
+ case 'O': case 'o': goto yy1242;
+ case 'U': case 'u': goto yy1243;
+ case 'W': case 'w': goto yy1244;
default: goto yy3;
}
yy11:
YYDEBUG(11, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '-') goto yy1268;
+ if(yych == '-') goto yy1236;
if(yych <= '/') goto yy12;
- if(yych <= '9') goto yy1269;
+ if(yych <= '9') goto yy1237;
goto yy12;
yy12:
YYDEBUG(12, *YYCURSOR);
@@ -1197,7 +1207,7 @@ yy13:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: goto yy1230;
+ case 0x09: goto yy1198;
case ' ': case 'A': case 'D': case 'F': case 'H':
case 'I':
case 'J': case 'M':
@@ -1206,11 +1216,11 @@ yy13:
case 'T': case 'V':
case 'W':
case 'X':
- case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': case 'o': case 'w': case 'y': goto yy1232;
- case '-': goto yy695;
- case '.': goto yy1234;
- case '/': goto yy694;
- case '0': goto yy1267;
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': case 'o': case 'w': case 'y': goto yy1200;
+ case '-': goto yy660;
+ case '.': goto yy1202;
+ case '/': goto yy659;
+ case '0': goto yy1235;
case '1':
case '2':
case '3':
@@ -1219,12 +1229,12 @@ yy13:
case '6':
case '7':
case '8':
- case '9': goto yy1266;
- case ':': goto yy1235;
- case 'n': goto yy692;
- case 'r': goto yy693;
- case 's': goto yy686;
- case 't': goto yy690;
+ case '9': goto yy1234;
+ case ':': goto yy1203;
+ case 'n': goto yy657;
+ case 'r': goto yy658;
+ case 's': goto yy651;
+ case 't': goto yy655;
default: goto yy12;
}
yy14:
@@ -1233,7 +1243,7 @@ yy14:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: goto yy682;
+ case 0x09: goto yy647;
case ' ': case 'A': case 'D': case 'F': case 'H':
case 'I':
case 'J': case 'M':
@@ -1244,25 +1254,25 @@ yy14:
case 'W':
case 'X':
case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': case 'o':
- case 'p': case 'w': case 'y': goto yy684;
- case '-': goto yy695;
- case '.': goto yy696;
- case '/': goto yy694;
+ case 'p': case 'w': case 'y': goto yy649;
+ case '-': goto yy660;
+ case '.': goto yy661;
+ case '/': goto yy659;
case '0':
case '1':
- case '2': goto yy1266;
+ case '2': goto yy1234;
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
- case '9': goto yy1233;
- case ':': goto yy705;
- case 'n': goto yy692;
- case 'r': goto yy693;
- case 's': goto yy686;
- case 't': goto yy690;
+ case '9': goto yy1201;
+ case ':': goto yy670;
+ case 'n': goto yy657;
+ case 'r': goto yy658;
+ case 's': goto yy651;
+ case 't': goto yy655;
default: goto yy12;
}
yy15:
@@ -1271,7 +1281,7 @@ yy15:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: goto yy682;
+ case 0x09: goto yy647;
case ' ': case 'A': case 'D': case 'F': case 'H':
case 'I':
case 'J': case 'M':
@@ -1282,25 +1292,25 @@ yy15:
case 'W':
case 'X':
case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': case 'o':
- case 'p': case 'w': case 'y': goto yy684;
- case '-': goto yy695;
- case '.': goto yy696;
- case '/': goto yy694;
+ case 'p': case 'w': case 'y': goto yy649;
+ case '-': goto yy660;
+ case '.': goto yy661;
+ case '/': goto yy659;
case '0':
case '1':
case '2':
- case '3': goto yy1233;
+ case '3': goto yy1201;
case '4':
case '5':
case '6':
case '7':
case '8':
- case '9': goto yy1229;
- case ':': goto yy705;
- case 'n': goto yy692;
- case 'r': goto yy693;
- case 's': goto yy686;
- case 't': goto yy690;
+ case '9': goto yy1197;
+ case ':': goto yy670;
+ case 'n': goto yy657;
+ case 'r': goto yy658;
+ case 's': goto yy651;
+ case 't': goto yy655;
default: goto yy12;
}
yy16:
@@ -1309,7 +1319,7 @@ yy16:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: goto yy682;
+ case 0x09: goto yy647;
case ' ': case 'A': case 'D': case 'F': case 'H':
case 'I':
case 'J': case 'M':
@@ -1320,12 +1330,12 @@ yy16:
case 'W':
case 'X':
case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': case 'o':
- case 'p': case 'w': case 'y': goto yy684;
- case '-': goto yy695;
- case '.': goto yy696;
- case '/': goto yy694;
+ case 'p': case 'w': case 'y': goto yy649;
+ case '-': goto yy660;
+ case '.': goto yy661;
+ case '/': goto yy659;
case '0':
- case '1': goto yy1229;
+ case '1': goto yy1197;
case '2':
case '3':
case '4':
@@ -1333,12 +1343,12 @@ yy16:
case '6':
case '7':
case '8':
- case '9': goto yy691;
- case ':': goto yy705;
- case 'n': goto yy692;
- case 'r': goto yy693;
- case 's': goto yy686;
- case 't': goto yy690;
+ case '9': goto yy656;
+ case ':': goto yy670;
+ case 'n': goto yy657;
+ case 'r': goto yy658;
+ case 's': goto yy651;
+ case 't': goto yy655;
default: goto yy12;
}
yy17:
@@ -1347,7 +1357,7 @@ yy17:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: goto yy682;
+ case 0x09: goto yy647;
case ' ': case 'A': case 'D': case 'F': case 'H':
case 'I':
case 'J': case 'M':
@@ -1358,10 +1368,10 @@ yy17:
case 'W':
case 'X':
case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': case 'o':
- case 'p': case 'w': case 'y': goto yy684;
- case '-': goto yy695;
- case '.': goto yy696;
- case '/': goto yy694;
+ case 'p': case 'w': case 'y': goto yy649;
+ case '-': goto yy660;
+ case '.': goto yy661;
+ case '/': goto yy659;
case '0':
case '1':
case '2':
@@ -1371,12 +1381,12 @@ yy17:
case '6':
case '7':
case '8':
- case '9': goto yy691;
- case ':': goto yy705;
- case 'n': goto yy692;
- case 'r': goto yy693;
- case 's': goto yy686;
- case 't': goto yy690;
+ case '9': goto yy656;
+ case ':': goto yy670;
+ case 'n': goto yy657;
+ case 'r': goto yy658;
+ case 's': goto yy651;
+ case 't': goto yy655;
default: goto yy12;
}
yy18:
@@ -1387,37 +1397,37 @@ yy18:
if(yych <= '('){
if(yych <= 0x09){
if(yych <= 0x08) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
+ if(yych == ' ') goto yy312;
goto yy3;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
+ if(yych <= ')') goto yy136;
goto yy3;
} else {
if(yych == '/') goto yy3;
- goto yy423;
+ goto yy312;
}
}
} else {
if(yych <= 'V'){
if(yych <= 'H'){
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'I') goto yy681;
- if(yych <= 'U') goto yy133;
- goto yy680;
+ if(yych <= 'I') goto yy646;
+ if(yych <= 'U') goto yy137;
+ goto yy645;
}
} else {
if(yych <= 'Z'){
- if(yych == 'X') goto yy680;
- goto yy133;
+ if(yych == 'X') goto yy645;
+ goto yy137;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1428,27 +1438,27 @@ yy19:
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
if(yych <= 0x1F) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= ',') goto yy3;
- goto yy423;
+ goto yy312;
}
} else {
if(yych <= 'H'){
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
if(yych <= 'Z'){
- if(yych <= 'I') goto yy678;
- goto yy133;
+ if(yych <= 'I') goto yy642;
+ goto yy137;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1459,27 +1469,27 @@ yy20:
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
if(yych <= 0x1F) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= ',') goto yy3;
- goto yy423;
+ goto yy312;
}
} else {
if(yych <= 'H'){
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
if(yych <= 'Z'){
- if(yych <= 'I') goto yy676;
- goto yy133;
+ if(yych <= 'I') goto yy640;
+ goto yy137;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1489,21 +1499,21 @@ yy21:
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'A') goto yy659;
- if(yych <= 'T') goto yy133;
- goto yy658;
+ if(yych <= 'A') goto yy623;
+ if(yych <= 'T') goto yy137;
+ goto yy622;
}
} else {
if(yych <= 'a'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy668;
+ goto yy632;
} else {
- if(yych == 'u') goto yy667;
- if(yych <= 'z') goto yy138;
+ if(yych == 'u') goto yy631;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1512,21 +1522,21 @@ yy22:
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'A') goto yy659;
- if(yych <= 'T') goto yy133;
- goto yy658;
+ if(yych <= 'A') goto yy623;
+ if(yych <= 'T') goto yy137;
+ goto yy622;
}
} else {
if(yych <= 'a'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy659;
+ goto yy623;
} else {
- if(yych == 'u') goto yy658;
- if(yych <= 'z') goto yy133;
+ if(yych == 'u') goto yy622;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1537,40 +1547,40 @@ yy23:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy620;
+ if(yych <= 'D') goto yy137;
+ goto yy584;
}
} else {
if(yych <= 'N'){
- if(yych == 'I') goto yy621;
- goto yy133;
+ if(yych == 'I') goto yy585;
+ goto yy137;
} else {
- if(yych <= 'O') goto yy622;
- if(yych <= 'Q') goto yy133;
- goto yy623;
+ if(yych <= 'O') goto yy586;
+ if(yych <= 'Q') goto yy137;
+ goto yy587;
}
}
} else {
if(yych <= 'i'){
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy138;
+ goto yy142;
} else {
- if(yych <= 'e') goto yy639;
- if(yych <= 'h') goto yy138;
- goto yy640;
+ if(yych <= 'e') goto yy603;
+ if(yych <= 'h') goto yy142;
+ goto yy604;
}
} else {
if(yych <= 'q'){
- if(yych == 'o') goto yy641;
- goto yy138;
+ if(yych == 'o') goto yy605;
+ goto yy142;
} else {
- if(yych <= 'r') goto yy642;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'r') goto yy606;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1582,40 +1592,40 @@ yy24:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy620;
+ if(yych <= 'D') goto yy137;
+ goto yy584;
}
} else {
if(yych <= 'N'){
- if(yych == 'I') goto yy621;
- goto yy133;
+ if(yych == 'I') goto yy585;
+ goto yy137;
} else {
- if(yych <= 'O') goto yy622;
- if(yych <= 'Q') goto yy133;
- goto yy623;
+ if(yych <= 'O') goto yy586;
+ if(yych <= 'Q') goto yy137;
+ goto yy587;
}
}
} else {
if(yych <= 'i'){
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'e') goto yy620;
- if(yych <= 'h') goto yy133;
- goto yy621;
+ if(yych <= 'e') goto yy584;
+ if(yych <= 'h') goto yy137;
+ goto yy585;
}
} else {
if(yych <= 'q'){
- if(yych == 'o') goto yy622;
- goto yy133;
+ if(yych == 'o') goto yy586;
+ goto yy137;
} else {
- if(yych <= 'r') goto yy623;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'r') goto yy587;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1625,35 +1635,35 @@ yy25:
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= 'F'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
if(yych <= 'O'){
- if(yych <= 'G') goto yy599;
- goto yy133;
+ if(yych <= 'G') goto yy563;
+ goto yy137;
} else {
- if(yych <= 'P') goto yy598;
- if(yych <= 'T') goto yy133;
- goto yy597;
+ if(yych <= 'P') goto yy562;
+ if(yych <= 'T') goto yy137;
+ goto yy561;
}
}
} else {
if(yych <= 'o'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych == 'g') goto yy611;
- goto yy138;
+ if(yych == 'g') goto yy575;
+ goto yy142;
}
} else {
if(yych <= 't'){
- if(yych <= 'p') goto yy610;
- goto yy138;
+ if(yych <= 'p') goto yy574;
+ goto yy142;
} else {
- if(yych <= 'u') goto yy609;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'u') goto yy573;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1663,35 +1673,35 @@ yy26:
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= 'F'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
if(yych <= 'O'){
- if(yych <= 'G') goto yy599;
- goto yy133;
+ if(yych <= 'G') goto yy563;
+ goto yy137;
} else {
- if(yych <= 'P') goto yy598;
- if(yych <= 'T') goto yy133;
- goto yy597;
+ if(yych <= 'P') goto yy562;
+ if(yych <= 'T') goto yy137;
+ goto yy561;
}
}
} else {
if(yych <= 'o'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych == 'g') goto yy599;
- goto yy133;
+ if(yych == 'g') goto yy563;
+ goto yy137;
}
} else {
if(yych <= 't'){
- if(yych <= 'p') goto yy598;
- goto yy133;
+ if(yych <= 'p') goto yy562;
+ goto yy137;
} else {
- if(yych <= 'u') goto yy597;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'u') goto yy561;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1703,39 +1713,39 @@ yy27:
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy540;
- goto yy133;
+ if(yych <= 'A') goto yy504;
+ goto yy137;
}
} else {
if(yych <= 'H'){
- if(yych <= 'E') goto yy539;
- goto yy133;
+ if(yych <= 'E') goto yy503;
+ goto yy137;
} else {
- if(yych <= 'I') goto yy541;
- if(yych <= 'T') goto yy133;
- goto yy542;
+ if(yych <= 'I') goto yy505;
+ if(yych <= 'T') goto yy137;
+ goto yy506;
}
}
} else {
if(yych <= 'e'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych <= 'a') goto yy569;
- if(yych <= 'd') goto yy138;
- goto yy568;
+ if(yych <= 'a') goto yy533;
+ if(yych <= 'd') goto yy142;
+ goto yy532;
}
} else {
if(yych <= 't'){
- if(yych == 'i') goto yy570;
- goto yy138;
+ if(yych == 'i') goto yy534;
+ goto yy142;
} else {
- if(yych <= 'u') goto yy571;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'u') goto yy535;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1747,39 +1757,39 @@ yy28:
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy540;
- goto yy133;
+ if(yych <= 'A') goto yy504;
+ goto yy137;
}
} else {
if(yych <= 'H'){
- if(yych <= 'E') goto yy539;
- goto yy133;
+ if(yych <= 'E') goto yy503;
+ goto yy137;
} else {
- if(yych <= 'I') goto yy541;
- if(yych <= 'T') goto yy133;
- goto yy542;
+ if(yych <= 'I') goto yy505;
+ if(yych <= 'T') goto yy137;
+ goto yy506;
}
}
} else {
if(yych <= 'e'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych <= 'a') goto yy540;
- if(yych <= 'd') goto yy133;
- goto yy539;
+ if(yych <= 'a') goto yy504;
+ if(yych <= 'd') goto yy137;
+ goto yy503;
}
} else {
if(yych <= 't'){
- if(yych == 'i') goto yy541;
- goto yy133;
+ if(yych == 'i') goto yy505;
+ goto yy137;
} else {
- if(yych <= 'u') goto yy542;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'u') goto yy506;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1790,20 +1800,20 @@ yy29:
if(yych <= 'C'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'B') goto yy133;
- goto yy529;
+ if(yych <= 'B') goto yy137;
+ goto yy493;
}
} else {
if(yych <= 'b'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy138;
+ goto yy142;
} else {
- if(yych <= 'c') goto yy534;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'c') goto yy498;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1813,20 +1823,20 @@ yy30:
if(yych <= 'C'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'B') goto yy133;
- goto yy529;
+ if(yych <= 'B') goto yy137;
+ goto yy493;
}
} else {
if(yych <= 'b'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'c') goto yy529;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'c') goto yy493;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1836,20 +1846,20 @@ yy31:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy420;
+ if(yych <= 'D') goto yy137;
+ goto yy308;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy138;
+ goto yy142;
} else {
- if(yych <= 'e') goto yy522;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'e') goto yy486;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1859,20 +1869,20 @@ yy32:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy420;
+ if(yych <= 'D') goto yy137;
+ goto yy308;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'e') goto yy420;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'e') goto yy308;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1882,20 +1892,20 @@ yy33:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy403;
+ if(yych <= 'D') goto yy137;
+ goto yy281;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy138;
+ goto yy142;
} else {
- if(yych <= 'e') goto yy412;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'e') goto yy295;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1905,20 +1915,20 @@ yy34:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy403;
+ if(yych <= 'D') goto yy137;
+ goto yy281;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'e') goto yy403;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'e') goto yy281;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1927,22 +1937,22 @@ yy35:
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'I') goto yy367;
- if(yych <= 'K') goto yy133;
- goto yy368;
+ if(yych == 'I') goto yy261;
+ if(yych <= 'K') goto yy137;
+ goto yy262;
}
} else {
if(yych <= 'i'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'h') goto yy138;
- goto yy385;
+ if(yych <= 'h') goto yy142;
+ goto yy271;
} else {
- if(yych == 'l') goto yy386;
- if(yych <= 'z') goto yy138;
+ if(yych == 'l') goto yy272;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1951,22 +1961,22 @@ yy36:
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'I') goto yy367;
- if(yych <= 'K') goto yy133;
- goto yy368;
+ if(yych == 'I') goto yy261;
+ if(yych <= 'K') goto yy137;
+ goto yy262;
}
} else {
if(yych <= 'i'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'h') goto yy133;
- goto yy367;
+ if(yych <= 'h') goto yy137;
+ goto yy261;
} else {
- if(yych == 'l') goto yy368;
- if(yych <= 'z') goto yy133;
+ if(yych == 'l') goto yy262;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1974,16 +1984,16 @@ yy37:
YYDEBUG(37, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy319;
+ goto yy255;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych <= 'a') goto yy343;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'a') goto yy258;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1991,16 +2001,16 @@ yy38:
YYDEBUG(38, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy319;
+ goto yy255;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych <= 'a') goto yy319;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'a') goto yy255;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -2010,20 +2020,20 @@ yy39:
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy133;
- goto yy157;
+ if(yych <= 'Q') goto yy137;
+ goto yy161;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy138;
+ goto yy142;
} else {
- if(yych <= 'r') goto yy239;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'r') goto yy248;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -2033,20 +2043,20 @@ yy40:
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy133;
- goto yy157;
+ if(yych <= 'Q') goto yy137;
+ goto yy161;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'r') goto yy157;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'r') goto yy161;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -2058,40 +2068,40 @@ yy41:
goto yy54;
}
if(yych <= '/') goto yy12;
- if(yych <= '1') goto yy150;
- if(yych <= '2') goto yy151;
- if(yych <= '9') goto yy152;
+ if(yych <= '1') goto yy154;
+ if(yych <= '2') goto yy155;
+ if(yych <= '9') goto yy156;
goto yy12;
yy42:
YYDEBUG(42, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@') goto yy12;
- if(yych <= 'Z') goto yy149;
+ if(yych <= 'Z') goto yy153;
if(yych <= '`') goto yy12;
- if(yych <= 'z') goto yy149;
+ if(yych <= 'z') goto yy153;
goto yy12;
yy43:
YYDEBUG(43, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
yy44:
YYDEBUG(44, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
yy45:
@@ -2203,30 +2213,33 @@ yy53:
YYDEBUG(53, *YYCURSOR);
YYCURSOR = YYMARKER;
switch(yyaccept){
- case 26: goto yy1413;
- case 24: goto yy1382;
- case 25: goto yy1390;
- case 23: goto yy1304;
- case 22: goto yy1301;
- case 11: goto yy713;
- case 20: goto yy1238;
- case 21: goto yy1246;
- case 13: goto yy870;
- case 18: goto yy1134;
- case 12: goto yy860;
- case 8: goto yy491;
- case 17: goto yy978;
- case 6: goto yy426;
- case 10: goto yy698;
- case 16: goto yy1032;
- case 19: goto yy1026;
- case 15: goto yy1005;
- case 14: goto yy971;
- case 9: goto yy601;
- case 5: goto yy405;
- case 4: goto yy176;
+ case 29: goto yy1381;
+ case 27: goto yy1350;
+ case 28: goto yy1358;
+ case 26: goto yy1272;
+ case 25: goto yy1269;
+ case 12: goto yy678;
+ case 23: goto yy1206;
+ case 24: goto yy1214;
+ case 14: goto yy835;
+ case 20: goto yy1100;
+ case 21: goto yy1124;
+ case 13: goto yy825;
+ case 9: goto yy409;
+ case 19: goto yy943;
+ case 7: goto yy315;
+ case 11: goto yy663;
+ case 18: goto yy998;
+ case 22: goto yy992;
+ case 17: goto yy971;
+ case 16: goto yy964;
+ case 15: goto yy936;
+ case 10: goto yy565;
+ case 5: goto yy283;
+ case 4: goto yy181;
+ case 6: goto yy310;
case 0: goto yy3;
- case 7: goto yy448;
+ case 8: goto yy339;
case 3: goto yy69;
case 2: goto yy46;
case 1: goto yy12;
@@ -2317,20 +2330,20 @@ yy58:
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= 'D'){
- if(yych == 'A') goto yy119;
+ if(yych == 'A') goto yy123;
goto yy53;
} else {
- if(yych <= 'E') goto yy120;
+ if(yych <= 'E') goto yy124;
if(yych <= 'T') goto yy53;
- goto yy118;
+ goto yy122;
}
} else {
if(yych <= 'd'){
- if(yych == 'a') goto yy119;
+ if(yych == 'a') goto yy123;
goto yy53;
} else {
- if(yych <= 'e') goto yy120;
- if(yych == 'u') goto yy118;
+ if(yych <= 'e') goto yy124;
+ if(yych == 'u') goto yy122;
goto yy53;
}
}
@@ -2338,29 +2351,29 @@ yy59:
YYDEBUG(59, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
- if(yych == 'I') goto yy110;
+ if(yych == 'I') goto yy114;
if(yych <= 'N') goto yy53;
- goto yy109;
+ goto yy113;
} else {
if(yych <= 'i'){
if(yych <= 'h') goto yy53;
- goto yy110;
+ goto yy114;
} else {
- if(yych == 'o') goto yy109;
+ if(yych == 'o') goto yy113;
goto yy53;
}
}
yy60:
YYDEBUG(60, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy107;
- if(yych == 'o') goto yy107;
+ if(yych == 'O') goto yy111;
+ if(yych == 'o') goto yy111;
goto yy53;
yy61:
YYDEBUG(61, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy106;
- if(yych == 'a') goto yy106;
+ if(yych == 'A') goto yy110;
+ if(yych == 'a') goto yy110;
goto yy53;
yy62:
YYDEBUG(62, *YYCURSOR);
@@ -2636,8 +2649,8 @@ yy98:
yy99:
YYDEBUG(99, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'K') goto yy81;
- if(yych == 'k') goto yy81;
+ if(yych == 'K') goto yy106;
+ if(yych == 'k') goto yy106;
goto yy53;
yy100:
YYDEBUG(100, *YYCURSOR);
@@ -2678,425 +2691,460 @@ yy105:
goto yy53;
yy106:
YYDEBUG(106, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy81;
- if(yych == 'y') goto yy81;
- goto yy53;
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych == 'D') goto yy107;
+ if(yych <= 'R') goto yy69;
+ goto yy73;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'c') goto yy69;
+ goto yy107;
+ } else {
+ if(yych == 's') goto yy73;
+ goto yy69;
+ }
+ }
yy107:
YYDEBUG(107, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'U') goto yy108;
- if(yych != 'u') goto yy53;
+ if(yych == 'A') goto yy108;
+ if(yych != 'a') goto yy53;
goto yy108;
yy108:
YYDEBUG(108, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy81;
- if(yych == 'r') goto yy81;
- goto yy53;
+ if(yych == 'Y') goto yy109;
+ if(yych != 'y') goto yy53;
+ goto yy109;
yy109:
YYDEBUG(109, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy114;
- if(yych == 'n') goto yy114;
- goto yy53;
+ if(yych == 'S') goto yy73;
+ if(yych == 's') goto yy73;
+ goto yy69;
yy110:
YYDEBUG(110, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy111;
- if(yych != 'n') goto yy53;
- goto yy111;
+ if(yych == 'Y') goto yy81;
+ if(yych == 'y') goto yy81;
+ goto yy53;
yy111:
YYDEBUG(111, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'U') goto yy112;
+ if(yych != 'u') goto yy53;
+ goto yy112;
+yy112:
+ YYDEBUG(112, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy81;
+ if(yych == 'r') goto yy81;
+ goto yy53;
+yy113:
+ YYDEBUG(113, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy118;
+ if(yych == 'n') goto yy118;
+ goto yy53;
+yy114:
+ YYDEBUG(114, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy115;
+ if(yych != 'n') goto yy53;
+ goto yy115;
+yy115:
+ YYDEBUG(115, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'U'){
if(yych == 'S') goto yy73;
if(yych <= 'T') goto yy69;
- goto yy112;
+ goto yy116;
} else {
if(yych <= 's'){
if(yych <= 'r') goto yy69;
goto yy73;
} else {
if(yych != 'u') goto yy69;
- goto yy112;
+ goto yy116;
}
}
-yy112:
- YYDEBUG(112, *YYCURSOR);
+yy116:
+ YYDEBUG(116, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy113;
+ if(yych == 'T') goto yy117;
if(yych != 't') goto yy53;
- goto yy113;
-yy113:
- YYDEBUG(113, *YYCURSOR);
+ goto yy117;
+yy117:
+ YYDEBUG(117, *YYCURSOR);
yych = *++YYCURSOR;
if(yych == 'E') goto yy81;
if(yych == 'e') goto yy81;
goto yy53;
-yy114:
- YYDEBUG(114, *YYCURSOR);
+yy118:
+ YYDEBUG(118, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
- if(yych == 'D') goto yy115;
+ if(yych == 'D') goto yy119;
if(yych <= 'S') goto yy69;
- goto yy116;
+ goto yy120;
} else {
if(yych <= 'd'){
if(yych <= 'c') goto yy69;
- goto yy115;
+ goto yy119;
} else {
- if(yych == 't') goto yy116;
+ if(yych == 't') goto yy120;
goto yy69;
}
}
-yy115:
- YYDEBUG(115, *YYCURSOR);
+yy119:
+ YYDEBUG(119, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy117;
- if(yych == 'a') goto yy117;
+ if(yych == 'A') goto yy121;
+ if(yych == 'a') goto yy121;
goto yy53;
-yy116:
- YYDEBUG(116, *YYCURSOR);
+yy120:
+ YYDEBUG(120, *YYCURSOR);
yych = *++YYCURSOR;
if(yych == 'H') goto yy81;
if(yych == 'h') goto yy81;
goto yy53;
-yy117:
- YYDEBUG(117, *YYCURSOR);
+yy121:
+ YYDEBUG(121, *YYCURSOR);
yych = *++YYCURSOR;
if(yych == 'Y') goto yy73;
if(yych == 'y') goto yy73;
goto yy53;
-yy118:
- YYDEBUG(118, *YYCURSOR);
+yy122:
+ YYDEBUG(122, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy129;
- if(yych == 'n') goto yy129;
+ if(yych == 'N') goto yy133;
+ if(yych == 'n') goto yy133;
goto yy53;
-yy119:
- YYDEBUG(119, *YYCURSOR);
+yy123:
+ YYDEBUG(123, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy124;
- if(yych == 't') goto yy124;
+ if(yych == 'T') goto yy128;
+ if(yych == 't') goto yy128;
goto yy53;
-yy120:
- YYDEBUG(120, *YYCURSOR);
+yy124:
+ YYDEBUG(124, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy121;
+ if(yych == 'C') goto yy125;
if(yych != 'c') goto yy53;
- goto yy121;
-yy121:
- YYDEBUG(121, *YYCURSOR);
+ goto yy125;
+yy125:
+ YYDEBUG(125, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
- if(yych == 'O') goto yy122;
+ if(yych == 'O') goto yy126;
if(yych <= 'R') goto yy69;
goto yy73;
} else {
if(yych <= 'o'){
if(yych <= 'n') goto yy69;
- goto yy122;
+ goto yy126;
} else {
if(yych == 's') goto yy73;
goto yy69;
}
}
-yy122:
- YYDEBUG(122, *YYCURSOR);
+yy126:
+ YYDEBUG(126, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy123;
+ if(yych == 'N') goto yy127;
if(yych != 'n') goto yy53;
- goto yy123;
-yy123:
- YYDEBUG(123, *YYCURSOR);
+ goto yy127;
+yy127:
+ YYDEBUG(127, *YYCURSOR);
yych = *++YYCURSOR;
if(yych == 'D') goto yy81;
if(yych == 'd') goto yy81;
goto yy53;
-yy124:
- YYDEBUG(124, *YYCURSOR);
+yy128:
+ YYDEBUG(128, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'U') goto yy125;
+ if(yych == 'U') goto yy129;
if(yych != 'u') goto yy69;
- goto yy125;
-yy125:
- YYDEBUG(125, *YYCURSOR);
+ goto yy129;
+yy129:
+ YYDEBUG(129, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy126;
+ if(yych == 'R') goto yy130;
if(yych != 'r') goto yy53;
- goto yy126;
-yy126:
- YYDEBUG(126, *YYCURSOR);
+ goto yy130;
+yy130:
+ YYDEBUG(130, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'D') goto yy127;
+ if(yych == 'D') goto yy131;
if(yych != 'd') goto yy53;
- goto yy127;
-yy127:
- YYDEBUG(127, *YYCURSOR);
+ goto yy131;
+yy131:
+ YYDEBUG(131, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy128;
+ if(yych == 'A') goto yy132;
if(yych != 'a') goto yy53;
- goto yy128;
-yy128:
- YYDEBUG(128, *YYCURSOR);
+ goto yy132;
+yy132:
+ YYDEBUG(132, *YYCURSOR);
yych = *++YYCURSOR;
if(yych == 'Y') goto yy73;
if(yych == 'y') goto yy73;
goto yy53;
-yy129:
- YYDEBUG(129, *YYCURSOR);
+yy133:
+ YYDEBUG(133, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'D') goto yy130;
+ if(yych == 'D') goto yy134;
if(yych != 'd') goto yy69;
- goto yy130;
-yy130:
- YYDEBUG(130, *YYCURSOR);
+ goto yy134;
+yy134:
+ YYDEBUG(134, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy131;
+ if(yych == 'A') goto yy135;
if(yych != 'a') goto yy53;
- goto yy131;
-yy131:
- YYDEBUG(131, *YYCURSOR);
+ goto yy135;
+yy135:
+ YYDEBUG(135, *YYCURSOR);
yych = *++YYCURSOR;
if(yych == 'Y') goto yy73;
if(yych == 'y') goto yy73;
goto yy53;
-yy132:
- YYDEBUG(132, *YYCURSOR);
+yy136:
+ YYDEBUG(136, *YYCURSOR);
yych = *++YYCURSOR;
goto yy3;
-yy133:
- YYDEBUG(133, *YYCURSOR);
+yy137:
+ YYDEBUG(137, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy134;
+ goto yy138;
}
-yy134:
- YYDEBUG(134, *YYCURSOR);
+yy138:
+ YYDEBUG(138, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy135;
+ goto yy139;
}
-yy135:
- YYDEBUG(135, *YYCURSOR);
+yy139:
+ YYDEBUG(139, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy136;
+ goto yy140;
}
-yy136:
- YYDEBUG(136, *YYCURSOR);
+yy140:
+ YYDEBUG(140, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy137;
+ goto yy141;
}
-yy137:
- YYDEBUG(137, *YYCURSOR);
+yy141:
+ YYDEBUG(141, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
-yy138:
- YYDEBUG(138, *YYCURSOR);
+yy142:
+ YYDEBUG(142, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
+ if(yych == '/') goto yy144;
goto yy3;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy139;
+ goto yy143;
}
}
-yy139:
- YYDEBUG(139, *YYCURSOR);
+yy143:
+ YYDEBUG(143, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych != '/') goto yy3;
- goto yy140;
+ goto yy144;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy144;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy140:
- YYDEBUG(140, *YYCURSOR);
+yy144:
+ YYDEBUG(144, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
if(yych <= '@') goto yy53;
if(yych >= '[') goto yy53;
- goto yy141;
-yy141:
- YYDEBUG(141, *YYCURSOR);
+ goto yy145;
+yy145:
+ YYDEBUG(145, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
if(yybm[0+yych] & 32) {
- goto yy142;
+ goto yy146;
}
goto yy53;
-yy142:
- YYDEBUG(142, *YYCURSOR);
+yy146:
+ YYDEBUG(146, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy143;
-yy143:
- YYDEBUG(143, *YYCURSOR);
+ goto yy147;
+yy147:
+ YYDEBUG(147, *YYCURSOR);
if(yybm[0+yych] & 32) {
- goto yy142;
+ goto yy146;
}
- if(yych == '/') goto yy140;
- if(yych == '_') goto yy140;
+ if(yych == '/') goto yy144;
+ if(yych == '_') goto yy144;
goto yy3;
-yy144:
- YYDEBUG(144, *YYCURSOR);
+yy148:
+ YYDEBUG(148, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
+ if(yych == '/') goto yy144;
goto yy3;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy145;
+ goto yy149;
}
}
-yy145:
- YYDEBUG(145, *YYCURSOR);
+yy149:
+ YYDEBUG(149, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
+ if(yych == '/') goto yy144;
goto yy3;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy146;
+ goto yy150;
}
}
-yy146:
- YYDEBUG(146, *YYCURSOR);
+yy150:
+ YYDEBUG(150, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '_'){
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy147;
+ goto yy151;
}
}
-yy147:
- YYDEBUG(147, *YYCURSOR);
+yy151:
+ YYDEBUG(151, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy148;
-yy148:
- YYDEBUG(148, *YYCURSOR);
+ goto yy152;
+yy152:
+ YYDEBUG(152, *YYCURSOR);
if(yych <= '^'){
- if(yych == '/') goto yy140;
+ if(yych == '/') goto yy144;
goto yy53;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy53;
- if(yych <= 'z') goto yy147;
+ if(yych <= 'z') goto yy151;
goto yy53;
}
-yy149:
- YYDEBUG(149, *YYCURSOR);
+yy153:
+ YYDEBUG(153, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
-yy150:
- YYDEBUG(150, *YYCURSOR);
+yy154:
+ YYDEBUG(154, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
@@ -3108,9 +3156,9 @@ yy150:
} else {
if(yych <= '9'){
if(yych <= '/') goto yy3;
- goto yy152;
+ goto yy156;
} else {
- if(yych <= ':') goto yy153;
+ if(yych <= ':') goto yy157;
if(yych <= 'C') goto yy3;
goto yy57;
}
@@ -3162,8 +3210,8 @@ yy150:
}
}
}
-yy151:
- YYDEBUG(151, *YYCURSOR);
+yy155:
+ YYDEBUG(155, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
@@ -3175,11 +3223,11 @@ yy151:
} else {
if(yych <= '3'){
if(yych <= '/') goto yy3;
- goto yy152;
+ goto yy156;
} else {
- if(yych <= '5') goto yy154;
- if(yych <= '9') goto yy155;
- goto yy153;
+ if(yych <= '5') goto yy158;
+ if(yych <= '9') goto yy159;
+ goto yy157;
}
}
} else {
@@ -3238,8 +3286,8 @@ yy151:
}
}
}
-yy152:
- YYDEBUG(152, *YYCURSOR);
+yy156:
+ YYDEBUG(156, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
@@ -3251,11 +3299,11 @@ yy152:
} else {
if(yych <= '5'){
if(yych <= '/') goto yy3;
- goto yy154;
+ goto yy158;
} else {
- if(yych <= '9') goto yy155;
+ if(yych <= '9') goto yy159;
if(yych >= ';') goto yy3;
- goto yy153;
+ goto yy157;
}
}
} else {
@@ -3310,15 +3358,15 @@ yy152:
}
}
}
-yy153:
- YYDEBUG(153, *YYCURSOR);
+yy157:
+ YYDEBUG(157, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy3;
- if(yych <= '5') goto yy156;
- if(yych <= '9') goto yy132;
+ if(yych <= '5') goto yy160;
+ if(yych <= '9') goto yy136;
goto yy3;
-yy154:
- YYDEBUG(154, *YYCURSOR);
+yy158:
+ YYDEBUG(158, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
@@ -3329,7 +3377,7 @@ yy154:
goto yy57;
} else {
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy155;
+ if(yych <= '9') goto yy159;
if(yych <= 'C') goto yy3;
goto yy57;
}
@@ -3380,8 +3428,8 @@ yy154:
}
}
}
-yy155:
- YYDEBUG(155, *YYCURSOR);
+yy159:
+ YYDEBUG(159, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yybm[0+yych] & 8) {
@@ -3437,304 +3485,310 @@ yy155:
}
}
}
-yy156:
- YYDEBUG(156, *YYCURSOR);
+yy160:
+ YYDEBUG(160, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy132;
+ if(yych <= '9') goto yy136;
goto yy3;
-yy157:
- YYDEBUG(157, *YYCURSOR);
+yy161:
+ YYDEBUG(161, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy158;
+ if(yych <= 'D') goto yy138;
+ goto yy162;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'e') goto yy158;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'e') goto yy162;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy158:
- YYDEBUG(158, *YYCURSOR);
+yy162:
+ YYDEBUG(162, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'V'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'U') goto yy135;
- goto yy159;
+ if(yych <= 'U') goto yy139;
+ goto yy163;
}
} else {
if(yych <= 'u'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'v') goto yy159;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'v') goto yy163;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy159:
- YYDEBUG(159, *YYCURSOR);
+yy163:
+ YYDEBUG(163, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'I'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'H') goto yy136;
- goto yy160;
+ if(yych <= 'H') goto yy140;
+ goto yy164;
}
} else {
if(yych <= 'h'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'i') goto yy160;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'i') goto yy164;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy160:
- YYDEBUG(160, *YYCURSOR);
+yy164:
+ YYDEBUG(164, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy137;
- goto yy161;
+ if(yych <= 'N') goto yy141;
+ goto yy165;
}
} else {
if(yych <= 'n'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'o') goto yy161;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'o') goto yy165;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy161:
- YYDEBUG(161, *YYCURSOR);
+yy165:
+ YYDEBUG(165, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'U') goto yy162;
+ if(yych <= 'U') goto yy166;
if(yych != 'u') goto yy3;
- goto yy162;
+ goto yy166;
}
-yy162:
- YYDEBUG(162, *YYCURSOR);
+yy166:
+ YYDEBUG(166, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'S') goto yy163;
+ if(yych == 'S') goto yy167;
if(yych != 's') goto yy53;
- goto yy163;
-yy163:
- YYDEBUG(163, *YYCURSOR);
+ goto yy167;
+yy167:
+ YYDEBUG(167, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 0x09) goto yy168;
+ if(yych != ' ') goto yy53;
+ goto yy168;
+yy168:
+ YYDEBUG(168, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
yych = *YYCURSOR;
- goto yy164;
-yy164:
- YYDEBUG(164, *YYCURSOR);
+ goto yy169;
+yy169:
+ YYDEBUG(169, *YYCURSOR);
if(yych <= 'W'){
if(yych <= 'F'){
if(yych <= ' '){
- if(yych == 0x09) goto yy163;
+ if(yych == 0x09) goto yy168;
if(yych <= 0x1F) goto yy53;
- goto yy163;
+ goto yy168;
} else {
- if(yych == 'D') goto yy168;
+ if(yych == 'D') goto yy173;
if(yych <= 'E') goto yy53;
- goto yy170;
+ goto yy175;
}
} else {
if(yych <= 'M'){
- if(yych == 'H') goto yy167;
+ if(yych == 'H') goto yy172;
if(yych <= 'L') goto yy53;
- goto yy166;
+ goto yy171;
} else {
if(yych <= 'S'){
if(yych <= 'R') goto yy53;
- goto yy165;
+ goto yy170;
} else {
- if(yych <= 'T') goto yy172;
+ if(yych <= 'T') goto yy177;
if(yych <= 'V') goto yy53;
- goto yy169;
+ goto yy174;
}
}
}
} else {
if(yych <= 'l'){
if(yych <= 'd'){
- if(yych == 'Y') goto yy171;
+ if(yych == 'Y') goto yy176;
if(yych <= 'c') goto yy53;
- goto yy168;
+ goto yy173;
} else {
if(yych <= 'f'){
if(yych <= 'e') goto yy53;
- goto yy170;
+ goto yy175;
} else {
- if(yych == 'h') goto yy167;
+ if(yych == 'h') goto yy172;
goto yy53;
}
}
} else {
if(yych <= 't'){
- if(yych <= 'm') goto yy166;
+ if(yych <= 'm') goto yy171;
if(yych <= 'r') goto yy53;
- if(yych >= 't') goto yy172;
- goto yy165;
+ if(yych >= 't') goto yy177;
+ goto yy170;
} else {
if(yych <= 'w'){
if(yych <= 'v') goto yy53;
- goto yy169;
+ goto yy174;
} else {
- if(yych == 'y') goto yy171;
+ if(yych == 'y') goto yy176;
goto yy53;
}
}
}
}
-yy165:
- YYDEBUG(165, *YYCURSOR);
+yy170:
+ YYDEBUG(170, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= 'D'){
- if(yych == 'A') goto yy226;
+ if(yych == 'A') goto yy235;
goto yy53;
} else {
- if(yych <= 'E') goto yy227;
+ if(yych <= 'E') goto yy236;
if(yych <= 'T') goto yy53;
- goto yy225;
+ goto yy234;
}
} else {
if(yych <= 'd'){
- if(yych == 'a') goto yy226;
+ if(yych == 'a') goto yy235;
goto yy53;
} else {
- if(yych <= 'e') goto yy227;
- if(yych == 'u') goto yy225;
+ if(yych <= 'e') goto yy236;
+ if(yych == 'u') goto yy234;
goto yy53;
}
}
-yy166:
- YYDEBUG(166, *YYCURSOR);
+yy171:
+ YYDEBUG(171, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
- if(yych == 'I') goto yy217;
+ if(yych == 'I') goto yy226;
if(yych <= 'N') goto yy53;
- goto yy216;
+ goto yy225;
} else {
if(yych <= 'i'){
if(yych <= 'h') goto yy53;
- goto yy217;
+ goto yy226;
} else {
- if(yych == 'o') goto yy216;
+ if(yych == 'o') goto yy225;
goto yy53;
}
}
-yy167:
- YYDEBUG(167, *YYCURSOR);
+yy172:
+ YYDEBUG(172, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy214;
- if(yych == 'o') goto yy214;
+ if(yych == 'O') goto yy223;
+ if(yych == 'o') goto yy223;
goto yy53;
-yy168:
- YYDEBUG(168, *YYCURSOR);
+yy173:
+ YYDEBUG(173, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy213;
- if(yych == 'a') goto yy213;
+ if(yych == 'A') goto yy222;
+ if(yych == 'a') goto yy222;
goto yy53;
-yy169:
- YYDEBUG(169, *YYCURSOR);
+yy174:
+ YYDEBUG(174, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy205;
- if(yych == 'e') goto yy205;
+ if(yych == 'E') goto yy210;
+ if(yych == 'e') goto yy210;
goto yy53;
-yy170:
- YYDEBUG(170, *YYCURSOR);
+yy175:
+ YYDEBUG(175, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
- if(yych == 'O') goto yy190;
+ if(yych == 'O') goto yy195;
if(yych <= 'Q') goto yy53;
- goto yy189;
+ goto yy194;
} else {
if(yych <= 'o'){
if(yych <= 'n') goto yy53;
- goto yy190;
+ goto yy195;
} else {
- if(yych == 'r') goto yy189;
+ if(yych == 'r') goto yy194;
goto yy53;
}
}
-yy171:
- YYDEBUG(171, *YYCURSOR);
+yy176:
+ YYDEBUG(176, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy186;
- if(yych == 'e') goto yy186;
+ if(yych == 'E') goto yy191;
+ if(yych == 'e') goto yy191;
goto yy53;
-yy172:
- YYDEBUG(172, *YYCURSOR);
+yy177:
+ YYDEBUG(177, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'H') goto yy173;
+ if(yych == 'H') goto yy178;
if(yych <= 'T') goto yy53;
- goto yy174;
+ goto yy179;
} else {
if(yych <= 'h'){
if(yych <= 'g') goto yy53;
- goto yy173;
+ goto yy178;
} else {
- if(yych == 'u') goto yy174;
+ if(yych == 'u') goto yy179;
goto yy53;
}
}
-yy173:
- YYDEBUG(173, *YYCURSOR);
+yy178:
+ YYDEBUG(178, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'U') goto yy181;
- if(yych == 'u') goto yy181;
+ if(yych == 'U') goto yy186;
+ if(yych == 'u') goto yy186;
goto yy53;
-yy174:
- YYDEBUG(174, *YYCURSOR);
+yy179:
+ YYDEBUG(179, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy175;
+ if(yych == 'E') goto yy180;
if(yych != 'e') goto yy53;
- goto yy175;
-yy175:
- YYDEBUG(175, *YYCURSOR);
+ goto yy180;
+yy180:
+ YYDEBUG(180, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'S') goto yy177;
- if(yych == 's') goto yy177;
- goto yy176;
-yy176:
- YYDEBUG(176, *YYCURSOR);
+ if(yych == 'S') goto yy182;
+ if(yych == 's') goto yy182;
+ goto yy181;
+yy181:
+ YYDEBUG(181, *YYCURSOR);
{
timelib_sll i;
@@ -3751,3646 +3805,1815 @@ yy176:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-yy177:
- YYDEBUG(177, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy178;
- if(yych != 'd') goto yy53;
- goto yy178;
-yy178:
- YYDEBUG(178, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy179;
- if(yych != 'a') goto yy53;
- goto yy179;
-yy179:
- YYDEBUG(179, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych != 'y') goto yy53;
- goto yy180;
-yy180:
- YYDEBUG(180, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy176;
-yy181:
- YYDEBUG(181, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'R') goto yy182;
- if(yych != 'r') goto yy176;
- goto yy182;
yy182:
YYDEBUG(182, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'S') goto yy183;
- if(yych != 's') goto yy53;
+ if(yych == 'D') goto yy183;
+ if(yych != 'd') goto yy53;
goto yy183;
yy183:
YYDEBUG(183, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'D') goto yy184;
- if(yych != 'd') goto yy53;
+ if(yych == 'A') goto yy184;
+ if(yych != 'a') goto yy53;
goto yy184;
yy184:
YYDEBUG(184, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy185;
- if(yych != 'a') goto yy53;
+ if(yych == 'Y') goto yy185;
+ if(yych != 'y') goto yy53;
goto yy185;
yy185:
YYDEBUG(185, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy180;
- goto yy53;
+ goto yy181;
yy186:
YYDEBUG(186, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy187;
- if(yych != 'a') goto yy53;
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'R') goto yy187;
+ if(yych != 'r') goto yy181;
goto yy187;
yy187:
YYDEBUG(187, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy188;
- if(yych != 'r') goto yy53;
+ if(yych == 'S') goto yy188;
+ if(yych != 's') goto yy53;
goto yy188;
yy188:
YYDEBUG(188, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'S') goto yy180;
- if(yych == 's') goto yy180;
- goto yy176;
+ if(yych == 'D') goto yy189;
+ if(yych != 'd') goto yy53;
+ goto yy189;
yy189:
YYDEBUG(189, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy202;
- if(yych == 'i') goto yy202;
- goto yy53;
+ if(yych == 'A') goto yy190;
+ if(yych != 'a') goto yy53;
+ goto yy190;
yy190:
YYDEBUG(190, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy191;
- if(yych != 'r') goto yy53;
- goto yy191;
+ if(yych == 'Y') goto yy185;
+ if(yych == 'y') goto yy185;
+ goto yy53;
yy191:
YYDEBUG(191, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy192;
- if(yych != 't') goto yy53;
+ if(yych == 'A') goto yy192;
+ if(yych != 'a') goto yy53;
goto yy192;
yy192:
YYDEBUG(192, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'N'){
- if(yych == 'H') goto yy194;
- if(yych <= 'M') goto yy53;
- goto yy193;
- } else {
- if(yych <= 'h'){
- if(yych <= 'g') goto yy53;
- goto yy194;
- } else {
- if(yych != 'n') goto yy53;
- goto yy193;
- }
- }
+ if(yych == 'R') goto yy193;
+ if(yych != 'r') goto yy53;
+ goto yy193;
yy193:
YYDEBUG(193, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy199;
- if(yych == 'i') goto yy199;
- goto yy53;
+ if(yych == 'S') goto yy185;
+ if(yych == 's') goto yy185;
+ goto yy181;
yy194:
YYDEBUG(194, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy195;
- if(yych != 'n') goto yy53;
- goto yy195;
+ if(yych == 'I') goto yy207;
+ if(yych == 'i') goto yy207;
+ goto yy53;
yy195:
YYDEBUG(195, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy196;
- if(yych != 'i') goto yy53;
+ if(yych == 'R') goto yy196;
+ if(yych != 'r') goto yy53;
goto yy196;
yy196:
YYDEBUG(196, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy197;
- if(yych != 'g') goto yy53;
+ if(yych == 'T') goto yy197;
+ if(yych != 't') goto yy53;
goto yy197;
yy197:
YYDEBUG(197, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'H') goto yy198;
- if(yych != 'h') goto yy53;
- goto yy198;
+ if(yych <= 'N'){
+ if(yych == 'H') goto yy199;
+ if(yych <= 'M') goto yy53;
+ goto yy198;
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'g') goto yy53;
+ goto yy199;
+ } else {
+ if(yych != 'n') goto yy53;
+ goto yy198;
+ }
+ }
yy198:
YYDEBUG(198, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy188;
- if(yych == 't') goto yy188;
+ if(yych == 'I') goto yy204;
+ if(yych == 'i') goto yy204;
goto yy53;
yy199:
YYDEBUG(199, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy200;
- if(yych != 'g') goto yy53;
+ if(yych == 'N') goto yy200;
+ if(yych != 'n') goto yy53;
goto yy200;
yy200:
YYDEBUG(200, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'H') goto yy201;
- if(yych != 'h') goto yy53;
+ if(yych == 'I') goto yy201;
+ if(yych != 'i') goto yy53;
goto yy201;
yy201:
YYDEBUG(201, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy188;
- if(yych == 't') goto yy188;
- goto yy53;
+ if(yych == 'G') goto yy202;
+ if(yych != 'g') goto yy53;
+ goto yy202;
yy202:
YYDEBUG(202, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'D') goto yy203;
- if(yych != 'd') goto yy176;
+ yych = *++YYCURSOR;
+ if(yych == 'H') goto yy203;
+ if(yych != 'h') goto yy53;
goto yy203;
yy203:
YYDEBUG(203, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy204;
- if(yych != 'a') goto yy53;
- goto yy204;
+ if(yych == 'T') goto yy193;
+ if(yych == 't') goto yy193;
+ goto yy53;
yy204:
YYDEBUG(204, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy180;
- goto yy53;
+ if(yych == 'G') goto yy205;
+ if(yych != 'g') goto yy53;
+ goto yy205;
yy205:
YYDEBUG(205, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'E'){
- if(yych <= 'C') goto yy53;
- if(yych <= 'D') goto yy207;
- goto yy206;
- } else {
- if(yych <= 'c') goto yy53;
- if(yych <= 'd') goto yy207;
- if(yych >= 'f') goto yy53;
- goto yy206;
- }
+ if(yych == 'H') goto yy206;
+ if(yych != 'h') goto yy53;
+ goto yy206;
yy206:
YYDEBUG(206, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'K') goto yy188;
- if(yych == 'k') goto yy188;
+ if(yych == 'T') goto yy193;
+ if(yych == 't') goto yy193;
goto yy53;
yy207:
YYDEBUG(207, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'N') goto yy208;
- if(yych != 'n') goto yy176;
+ if(yych == 'D') goto yy208;
+ if(yych != 'd') goto yy181;
goto yy208;
yy208:
YYDEBUG(208, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy209;
- if(yych != 'e') goto yy53;
+ if(yych == 'A') goto yy209;
+ if(yych != 'a') goto yy53;
goto yy209;
yy209:
YYDEBUG(209, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'S') goto yy210;
- if(yych != 's') goto yy53;
- goto yy210;
+ if(yych == 'Y') goto yy185;
+ if(yych == 'y') goto yy185;
+ goto yy53;
yy210:
YYDEBUG(210, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'D') goto yy211;
- if(yych != 'd') goto yy53;
- goto yy211;
+ if(yych <= 'E'){
+ if(yych <= 'C') goto yy53;
+ if(yych <= 'D') goto yy212;
+ goto yy211;
+ } else {
+ if(yych <= 'c') goto yy53;
+ if(yych <= 'd') goto yy212;
+ if(yych >= 'f') goto yy53;
+ goto yy211;
+ }
yy211:
YYDEBUG(211, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy212;
- if(yych != 'a') goto yy53;
- goto yy212;
+ if(yych == 'K') goto yy218;
+ if(yych == 'k') goto yy218;
+ goto yy53;
yy212:
YYDEBUG(212, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy180;
- goto yy53;
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'N') goto yy213;
+ if(yych != 'n') goto yy181;
+ goto yy213;
yy213:
YYDEBUG(213, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy188;
- if(yych == 'y') goto yy188;
- goto yy53;
+ if(yych == 'E') goto yy214;
+ if(yych != 'e') goto yy53;
+ goto yy214;
yy214:
YYDEBUG(214, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'U') goto yy215;
- if(yych != 'u') goto yy53;
+ if(yych == 'S') goto yy215;
+ if(yych != 's') goto yy53;
goto yy215;
yy215:
YYDEBUG(215, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy188;
- if(yych == 'r') goto yy188;
- goto yy53;
+ if(yych == 'D') goto yy216;
+ if(yych != 'd') goto yy53;
+ goto yy216;
yy216:
YYDEBUG(216, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy221;
- if(yych == 'n') goto yy221;
- goto yy53;
+ if(yych == 'A') goto yy217;
+ if(yych != 'a') goto yy53;
+ goto yy217;
yy217:
YYDEBUG(217, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy218;
- if(yych != 'n') goto yy53;
- goto yy218;
+ if(yych == 'Y') goto yy185;
+ if(yych == 'y') goto yy185;
+ goto yy53;
yy218:
YYDEBUG(218, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
- if(yych == 'S') goto yy180;
- if(yych <= 'T') goto yy176;
- goto yy219;
+ if(yych <= 'S'){
+ if(yych == 'D') goto yy219;
+ if(yych <= 'R') goto yy181;
+ goto yy185;
} else {
- if(yych <= 's'){
- if(yych <= 'r') goto yy176;
- goto yy180;
- } else {
- if(yych != 'u') goto yy176;
+ if(yych <= 'd'){
+ if(yych <= 'c') goto yy181;
goto yy219;
+ } else {
+ if(yych == 's') goto yy185;
+ goto yy181;
}
}
yy219:
YYDEBUG(219, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy220;
- if(yych != 't') goto yy53;
+ if(yych == 'A') goto yy220;
+ if(yych != 'a') goto yy53;
goto yy220;
yy220:
YYDEBUG(220, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy188;
- if(yych == 'e') goto yy188;
- goto yy53;
+ if(yych == 'Y') goto yy221;
+ if(yych != 'y') goto yy53;
+ goto yy221;
yy221:
YYDEBUG(221, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'T'){
- if(yych == 'D') goto yy222;
- if(yych <= 'S') goto yy176;
- goto yy223;
- } else {
- if(yych <= 'd'){
- if(yych <= 'c') goto yy176;
- goto yy222;
- } else {
- if(yych == 't') goto yy223;
- goto yy176;
- }
- }
+ yych = *++YYCURSOR;
+ if(yych == 'S') goto yy185;
+ if(yych == 's') goto yy185;
+ goto yy181;
yy222:
YYDEBUG(222, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy224;
- if(yych == 'a') goto yy224;
+ if(yych == 'Y') goto yy193;
+ if(yych == 'y') goto yy193;
goto yy53;
yy223:
YYDEBUG(223, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'H') goto yy188;
- if(yych == 'h') goto yy188;
- goto yy53;
+ if(yych == 'U') goto yy224;
+ if(yych != 'u') goto yy53;
+ goto yy224;
yy224:
YYDEBUG(224, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy180;
+ if(yych == 'R') goto yy193;
+ if(yych == 'r') goto yy193;
goto yy53;
yy225:
YYDEBUG(225, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy236;
- if(yych == 'n') goto yy236;
+ if(yych == 'N') goto yy230;
+ if(yych == 'n') goto yy230;
goto yy53;
yy226:
YYDEBUG(226, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy231;
- if(yych == 't') goto yy231;
- goto yy53;
+ if(yych == 'N') goto yy227;
+ if(yych != 'n') goto yy53;
+ goto yy227;
yy227:
YYDEBUG(227, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'C') goto yy228;
- if(yych != 'c') goto yy53;
- goto yy228;
-yy228:
- YYDEBUG(228, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'S'){
- if(yych == 'O') goto yy229;
- if(yych <= 'R') goto yy176;
- goto yy180;
+ if(yych <= 'U'){
+ if(yych == 'S') goto yy185;
+ if(yych <= 'T') goto yy181;
+ goto yy228;
} else {
- if(yych <= 'o'){
- if(yych <= 'n') goto yy176;
- goto yy229;
+ if(yych <= 's'){
+ if(yych <= 'r') goto yy181;
+ goto yy185;
} else {
- if(yych == 's') goto yy180;
- goto yy176;
+ if(yych != 'u') goto yy181;
+ goto yy228;
}
}
+yy228:
+ YYDEBUG(228, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy229;
+ if(yych != 't') goto yy53;
+ goto yy229;
yy229:
YYDEBUG(229, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy230;
- if(yych != 'n') goto yy53;
- goto yy230;
+ if(yych == 'E') goto yy193;
+ if(yych == 'e') goto yy193;
+ goto yy53;
yy230:
YYDEBUG(230, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy188;
- if(yych == 'd') goto yy188;
- goto yy53;
-yy231:
- YYDEBUG(231, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'U') goto yy232;
- if(yych != 'u') goto yy176;
- goto yy232;
+ if(yych <= 'T'){
+ if(yych == 'D') goto yy231;
+ if(yych <= 'S') goto yy181;
+ goto yy232;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'c') goto yy181;
+ goto yy231;
+ } else {
+ if(yych == 't') goto yy232;
+ goto yy181;
+ }
+ }
+yy231:
+ YYDEBUG(231, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy233;
+ if(yych == 'a') goto yy233;
+ goto yy53;
yy232:
YYDEBUG(232, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy233;
- if(yych != 'r') goto yy53;
- goto yy233;
+ if(yych == 'H') goto yy193;
+ if(yych == 'h') goto yy193;
+ goto yy53;
yy233:
YYDEBUG(233, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'D') goto yy234;
- if(yych != 'd') goto yy53;
- goto yy234;
+ if(yych == 'Y') goto yy185;
+ if(yych == 'y') goto yy185;
+ goto yy53;
yy234:
YYDEBUG(234, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy235;
- if(yych != 'a') goto yy53;
- goto yy235;
+ if(yych == 'N') goto yy245;
+ if(yych == 'n') goto yy245;
+ goto yy53;
yy235:
YYDEBUG(235, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy180;
+ if(yych == 'T') goto yy240;
+ if(yych == 't') goto yy240;
goto yy53;
yy236:
YYDEBUG(236, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'D') goto yy237;
- if(yych != 'd') goto yy176;
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy237;
+ if(yych != 'c') goto yy53;
goto yy237;
yy237:
YYDEBUG(237, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy238;
- if(yych != 'a') goto yy53;
- goto yy238;
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych == 'O') goto yy238;
+ if(yych <= 'R') goto yy181;
+ goto yy185;
+ } else {
+ if(yych <= 'o'){
+ if(yych <= 'n') goto yy181;
+ goto yy238;
+ } else {
+ if(yych == 's') goto yy185;
+ goto yy181;
+ }
+ }
yy238:
YYDEBUG(238, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy180;
- goto yy53;
+ if(yych == 'N') goto yy239;
+ if(yych != 'n') goto yy53;
+ goto yy239;
yy239:
YYDEBUG(239, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy193;
+ if(yych == 'd') goto yy193;
+ goto yy53;
+yy240:
+ YYDEBUG(240, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'U') goto yy241;
+ if(yych != 'u') goto yy181;
+ goto yy241;
+yy241:
+ YYDEBUG(241, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy242;
+ if(yych != 'r') goto yy53;
+ goto yy242;
+yy242:
+ YYDEBUG(242, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy243;
+ if(yych != 'd') goto yy53;
+ goto yy243;
+yy243:
+ YYDEBUG(243, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy244;
+ if(yych != 'a') goto yy53;
+ goto yy244;
+yy244:
+ YYDEBUG(244, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy185;
+ if(yych == 'y') goto yy185;
+ goto yy53;
+yy245:
+ YYDEBUG(245, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'D') goto yy246;
+ if(yych != 'd') goto yy181;
+ goto yy246;
+yy246:
+ YYDEBUG(246, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy247;
+ if(yych != 'a') goto yy53;
+ goto yy247;
+yy247:
+ YYDEBUG(247, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy185;
+ if(yych == 'y') goto yy185;
+ goto yy53;
+yy248:
+ YYDEBUG(248, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy158;
+ if(yych <= 'D') goto yy138;
+ goto yy162;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy240;
- if(yych <= 'z') goto yy139;
+ if(yych == 'e') goto yy249;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy240:
- YYDEBUG(240, *YYCURSOR);
+yy249:
+ YYDEBUG(249, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'U') goto yy135;
- goto yy159;
+ if(yych <= 'U') goto yy139;
+ goto yy163;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'v') goto yy241;
- if(yych <= 'z') goto yy144;
+ if(yych == 'v') goto yy250;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy241:
- YYDEBUG(241, *YYCURSOR);
+yy250:
+ YYDEBUG(250, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'I'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'H') goto yy136;
- goto yy160;
+ if(yych <= 'H') goto yy140;
+ goto yy164;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'i') goto yy242;
- if(yych <= 'z') goto yy145;
+ if(yych == 'i') goto yy251;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy242:
- YYDEBUG(242, *YYCURSOR);
+yy251:
+ YYDEBUG(251, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'O'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy137;
- goto yy161;
+ if(yych <= 'N') goto yy141;
+ goto yy165;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'o') goto yy243;
- if(yych <= 'z') goto yy146;
+ if(yych == 'o') goto yy252;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy243:
- YYDEBUG(243, *YYCURSOR);
+yy252:
+ YYDEBUG(252, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'U'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'T') goto yy3;
- goto yy162;
+ goto yy166;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'u') goto yy244;
- if(yych <= 'z') goto yy147;
+ if(yych == 'u') goto yy253;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy244:
- YYDEBUG(244, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy53;
- goto yy140;
- } else {
- if(yych == 'S') goto yy163;
- goto yy53;
- }
- } else {
- if(yych <= 'r'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy53;
- goto yy147;
- } else {
- if(yych <= 's') goto yy245;
- if(yych <= 'z') goto yy147;
- goto yy53;
- }
- }
-yy245:
- YYDEBUG(245, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'h'){
- if(yych <= '`'){
- if(yych <= '/'){
- if(yych <= '.') goto yy164;
- goto yy140;
- } else {
- if(yych == '_') goto yy140;
- goto yy164;
- }
- } else {
- if(yych <= 'e'){
- if(yych == 'd') goto yy249;
- goto yy147;
- } else {
- if(yych <= 'f') goto yy251;
- if(yych <= 'g') goto yy147;
- goto yy248;
- }
- }
- } else {
- if(yych <= 't'){
- if(yych <= 'm'){
- if(yych <= 'l') goto yy147;
- goto yy247;
- } else {
- if(yych <= 'r') goto yy147;
- if(yych >= 't') goto yy253;
- goto yy246;
- }
- } else {
- if(yych <= 'x'){
- if(yych == 'w') goto yy250;
- goto yy147;
- } else {
- if(yych <= 'y') goto yy252;
- if(yych <= 'z') goto yy147;
- goto yy164;
- }
- }
- }
-yy246:
- YYDEBUG(246, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'U'){
- if(yych <= 'D'){
- if(yych == 'A') goto yy226;
- goto yy148;
- } else {
- if(yych <= 'E') goto yy227;
- if(yych <= 'T') goto yy148;
- goto yy225;
- }
- } else {
- if(yych <= 'd'){
- if(yych == 'a') goto yy305;
- goto yy148;
- } else {
- if(yych <= 'e') goto yy306;
- if(yych == 'u') goto yy307;
- goto yy148;
- }
- }
-yy247:
- YYDEBUG(247, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'O'){
- if(yych == 'I') goto yy217;
- if(yych <= 'N') goto yy148;
- goto yy216;
- } else {
- if(yych <= 'i'){
- if(yych <= 'h') goto yy148;
- goto yy296;
- } else {
- if(yych == 'o') goto yy297;
- goto yy148;
- }
- }
-yy248:
- YYDEBUG(248, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'O') goto yy214;
- if(yych == 'o') goto yy294;
- goto yy148;
-yy249:
- YYDEBUG(249, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy213;
- if(yych == 'a') goto yy293;
- goto yy148;
-yy250:
- YYDEBUG(250, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'E') goto yy205;
- if(yych == 'e') goto yy285;
- goto yy148;
-yy251:
- YYDEBUG(251, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'R'){
- if(yych == 'O') goto yy190;
- if(yych <= 'Q') goto yy148;
- goto yy189;
- } else {
- if(yych <= 'o'){
- if(yych <= 'n') goto yy148;
- goto yy269;
- } else {
- if(yych == 'r') goto yy270;
- goto yy148;
- }
- }
-yy252:
- YYDEBUG(252, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'E') goto yy186;
- if(yych == 'e') goto yy266;
- goto yy148;
yy253:
YYDEBUG(253, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'U'){
- if(yych == 'H') goto yy173;
- if(yych <= 'T') goto yy148;
- goto yy174;
- } else {
- if(yych <= 'h'){
- if(yych <= 'g') goto yy148;
- goto yy254;
- } else {
- if(yych == 'u') goto yy255;
- goto yy148;
- }
- }
+ if(yych == 'S') goto yy167;
+ if(yych != 's') goto yy152;
+ goto yy254;
yy254:
YYDEBUG(254, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'U') goto yy181;
- if(yych == 'u') goto yy261;
- goto yy148;
-yy255:
- YYDEBUG(255, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'E') goto yy175;
- if(yych != 'e') goto yy148;
- goto yy256;
-yy256:
- YYDEBUG(256, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
- goto yy140;
- } else {
- if(yych == 'S') goto yy177;
- goto yy176;
- }
- } else {
- if(yych <= 'r'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
- } else {
- if(yych <= 's') goto yy257;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
- }
-yy257:
- YYDEBUG(257, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy178;
- if(yych != 'd') goto yy148;
- goto yy258;
-yy258:
- YYDEBUG(258, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy179;
- if(yych != 'a') goto yy148;
- goto yy259;
-yy259:
- YYDEBUG(259, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych != 'y') goto yy148;
- goto yy260;
-yy260:
- YYDEBUG(260, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych == '/') goto yy140;
- goto yy176;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
-yy261:
- YYDEBUG(261, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
- goto yy140;
+ if(yych <= '.'){
+ if(yych <= 0x09){
+ if(yych <= 0x08) goto yy53;
+ goto yy168;
} else {
- if(yych == 'R') goto yy182;
- goto yy176;
+ if(yych == ' ') goto yy168;
+ goto yy53;
}
} else {
- if(yych <= 'q'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
+ if(yych <= '_'){
+ if(yych <= '/') goto yy144;
+ if(yych <= '^') goto yy53;
+ goto yy144;
} else {
- if(yych <= 'r') goto yy262;
- if(yych <= 'z') goto yy147;
- goto yy176;
+ if(yych <= '`') goto yy53;
+ if(yych <= 'z') goto yy151;
+ goto yy53;
}
}
-yy262:
- YYDEBUG(262, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'S') goto yy183;
- if(yych != 's') goto yy148;
- goto yy263;
-yy263:
- YYDEBUG(263, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy184;
- if(yych != 'd') goto yy148;
- goto yy264;
-yy264:
- YYDEBUG(264, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy185;
- if(yych != 'a') goto yy148;
- goto yy265;
-yy265:
- YYDEBUG(265, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy260;
- goto yy148;
-yy266:
- YYDEBUG(266, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy187;
- if(yych != 'a') goto yy148;
- goto yy267;
-yy267:
- YYDEBUG(267, *YYCURSOR);
+yy255:
+ YYDEBUG(255, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy188;
- if(yych != 'r') goto yy148;
- goto yy268;
-yy268:
- YYDEBUG(268, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
- goto yy140;
+ if(yych <= 'S'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy136;
} else {
- if(yych == 'S') goto yy180;
- goto yy176;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'R') goto yy138;
+ goto yy256;
}
} else {
if(yych <= 'r'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
- } else {
- if(yych <= 's') goto yy260;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
- }
-yy269:
- YYDEBUG(269, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'R') goto yy191;
- if(yych == 'r') goto yy274;
- goto yy148;
-yy270:
- YYDEBUG(270, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'I') goto yy202;
- if(yych != 'i') goto yy148;
- goto yy271;
-yy271:
- YYDEBUG(271, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
- goto yy140;
- } else {
- if(yych == 'D') goto yy203;
- goto yy176;
- }
- } else {
- if(yych <= 'c'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
- } else {
- if(yych <= 'd') goto yy272;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
- }
-yy272:
- YYDEBUG(272, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy204;
- if(yych != 'a') goto yy148;
- goto yy273;
-yy273:
- YYDEBUG(273, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy260;
- goto yy148;
-yy274:
- YYDEBUG(274, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'T') goto yy192;
- if(yych != 't') goto yy148;
- goto yy275;
-yy275:
- YYDEBUG(275, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'N'){
- if(yych == 'H') goto yy194;
- if(yych <= 'M') goto yy148;
- goto yy193;
- } else {
- if(yych <= 'h'){
- if(yych <= 'g') goto yy148;
- goto yy277;
- } else {
- if(yych != 'n') goto yy148;
- goto yy276;
- }
- }
-yy276:
- YYDEBUG(276, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'I') goto yy199;
- if(yych == 'i') goto yy282;
- goto yy148;
-yy277:
- YYDEBUG(277, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'N') goto yy195;
- if(yych != 'n') goto yy148;
- goto yy278;
-yy278:
- YYDEBUG(278, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'I') goto yy196;
- if(yych != 'i') goto yy148;
- goto yy279;
-yy279:
- YYDEBUG(279, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'G') goto yy197;
- if(yych != 'g') goto yy148;
- goto yy280;
-yy280:
- YYDEBUG(280, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'H') goto yy198;
- if(yych != 'h') goto yy148;
- goto yy281;
-yy281:
- YYDEBUG(281, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'T') goto yy188;
- if(yych == 't') goto yy268;
- goto yy148;
-yy282:
- YYDEBUG(282, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'G') goto yy200;
- if(yych != 'g') goto yy148;
- goto yy283;
-yy283:
- YYDEBUG(283, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'H') goto yy201;
- if(yych != 'h') goto yy148;
- goto yy284;
-yy284:
- YYDEBUG(284, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'T') goto yy188;
- if(yych == 't') goto yy268;
- goto yy148;
-yy285:
- YYDEBUG(285, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'E'){
- if(yych <= 'C') goto yy148;
- if(yych <= 'D') goto yy207;
- goto yy206;
- } else {
- if(yych <= 'c') goto yy148;
- if(yych <= 'd') goto yy287;
- if(yych >= 'f') goto yy148;
- goto yy286;
- }
-yy286:
- YYDEBUG(286, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'K') goto yy188;
- if(yych == 'k') goto yy268;
- goto yy148;
-yy287:
- YYDEBUG(287, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
- goto yy140;
- } else {
- if(yych == 'N') goto yy208;
- goto yy176;
- }
- } else {
- if(yych <= 'm'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
- } else {
- if(yych <= 'n') goto yy288;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
- }
-yy288:
- YYDEBUG(288, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'E') goto yy209;
- if(yych != 'e') goto yy148;
- goto yy289;
-yy289:
- YYDEBUG(289, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'S') goto yy210;
- if(yych != 's') goto yy148;
- goto yy290;
-yy290:
- YYDEBUG(290, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy211;
- if(yych != 'd') goto yy148;
- goto yy291;
-yy291:
- YYDEBUG(291, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy212;
- if(yych != 'a') goto yy148;
- goto yy292;
-yy292:
- YYDEBUG(292, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy260;
- goto yy148;
-yy293:
- YYDEBUG(293, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy188;
- if(yych == 'y') goto yy268;
- goto yy148;
-yy294:
- YYDEBUG(294, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'U') goto yy215;
- if(yych != 'u') goto yy148;
- goto yy295;
-yy295:
- YYDEBUG(295, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'R') goto yy188;
- if(yych == 'r') goto yy268;
- goto yy148;
-yy296:
- YYDEBUG(296, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'N') goto yy218;
- if(yych == 'n') goto yy302;
- goto yy148;
-yy297:
- YYDEBUG(297, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'N') goto yy221;
- if(yych != 'n') goto yy148;
- goto yy298;
-yy298:
- YYDEBUG(298, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= 'C'){
- if(yych == '/') goto yy140;
- goto yy176;
- } else {
- if(yych <= 'D') goto yy222;
- if(yych == 'T') goto yy223;
- goto yy176;
- }
- } else {
- if(yych <= 'd'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- if(yych <= 'c') goto yy147;
- goto yy299;
+ if(yych <= 'Z') goto yy138;
+ if(yych <= '`') goto yy3;
+ goto yy138;
} else {
- if(yych == 't') goto yy300;
- if(yych <= 'z') goto yy147;
- goto yy176;
+ if(yych <= 's') goto yy256;
+ if(yych <= 'z') goto yy138;
+ goto yy3;
}
}
-yy299:
- YYDEBUG(299, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy224;
- if(yych == 'a') goto yy301;
- goto yy148;
-yy300:
- YYDEBUG(300, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'H') goto yy188;
- if(yych == 'h') goto yy268;
- goto yy148;
-yy301:
- YYDEBUG(301, *YYCURSOR);
+yy256:
+ YYDEBUG(256, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy260;
- goto yy148;
-yy302:
- YYDEBUG(302, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= 'R'){
- if(yych == '/') goto yy140;
- goto yy176;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy136;
} else {
- if(yych <= 'S') goto yy180;
- if(yych == 'U') goto yy219;
- goto yy176;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy139;
+ goto yy257;
}
} else {
if(yych <= 's'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- if(yych <= 'r') goto yy147;
- goto yy260;
- } else {
- if(yych == 'u') goto yy303;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
- }
-yy303:
- YYDEBUG(303, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'T') goto yy220;
- if(yych != 't') goto yy148;
- goto yy304;
-yy304:
- YYDEBUG(304, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'E') goto yy188;
- if(yych == 'e') goto yy268;
- goto yy148;
-yy305:
- YYDEBUG(305, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'T') goto yy231;
- if(yych == 't') goto yy314;
- goto yy148;
-yy306:
- YYDEBUG(306, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'C') goto yy228;
- if(yych == 'c') goto yy311;
- goto yy148;
-yy307:
- YYDEBUG(307, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'N') goto yy236;
- if(yych != 'n') goto yy148;
- goto yy308;
-yy308:
- YYDEBUG(308, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
- goto yy140;
- } else {
- if(yych == 'D') goto yy237;
- goto yy176;
- }
- } else {
- if(yych <= 'c'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy3;
+ goto yy139;
} else {
- if(yych <= 'd') goto yy309;
- if(yych <= 'z') goto yy147;
- goto yy176;
+ if(yych <= 't') goto yy257;
+ if(yych <= 'z') goto yy139;
+ goto yy3;
}
}
-yy309:
- YYDEBUG(309, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy238;
- if(yych != 'a') goto yy148;
- goto yy310;
-yy310:
- YYDEBUG(310, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy260;
- goto yy148;
-yy311:
- YYDEBUG(311, *YYCURSOR);
- yyaccept = 4;
+yy257:
+ YYDEBUG(257, *YYCURSOR);
+ yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= 'N'){
- if(yych == '/') goto yy140;
- goto yy176;
+ if(yych <= '('){
+ if(yych <= 0x09){
+ if(yych <= 0x08) goto yy3;
+ goto yy168;
} else {
- if(yych <= 'O') goto yy229;
- if(yych == 'S') goto yy180;
- goto yy176;
+ if(yych == ' ') goto yy168;
+ goto yy3;
}
} else {
- if(yych <= 'o'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- if(yych <= 'n') goto yy147;
- goto yy312;
- } else {
- if(yych == 's') goto yy260;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
- }
-yy312:
- YYDEBUG(312, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'N') goto yy230;
- if(yych != 'n') goto yy148;
- goto yy313;
-yy313:
- YYDEBUG(313, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy188;
- if(yych == 'd') goto yy268;
- goto yy148;
-yy314:
- YYDEBUG(314, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
+ if(yych <= 'Z'){
+ if(yych <= ')') goto yy136;
+ if(yych <= '@') goto yy3;
goto yy140;
} else {
- if(yych == 'U') goto yy232;
- goto yy176;
- }
- } else {
- if(yych <= 't'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
- } else {
- if(yych <= 'u') goto yy315;
- if(yych <= 'z') goto yy147;
- goto yy176;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy140;
+ goto yy3;
}
}
-yy315:
- YYDEBUG(315, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'R') goto yy233;
- if(yych != 'r') goto yy148;
- goto yy316;
-yy316:
- YYDEBUG(316, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy234;
- if(yych != 'd') goto yy148;
- goto yy317;
-yy317:
- YYDEBUG(317, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy235;
- if(yych != 'a') goto yy148;
- goto yy318;
-yy318:
- YYDEBUG(318, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy260;
- goto yy148;
-yy319:
- YYDEBUG(319, *YYCURSOR);
- yych = *++YYCURSOR;
+yy258:
+ YYDEBUG(258, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
+ if(yych <= '.'){
+ if(yych == ')') goto yy136;
+ goto yy3;
} else {
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy134;
- goto yy320;
+ if(yych <= 'R') goto yy138;
+ goto yy256;
}
} else {
- if(yych <= 'r'){
- if(yych <= 'Z') goto yy134;
- if(yych <= '`') goto yy3;
- goto yy134;
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
+ goto yy3;
} else {
- if(yych <= 's') goto yy320;
- if(yych <= 'z') goto yy134;
+ if(yych == 's') goto yy259;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy320:
- YYDEBUG(320, *YYCURSOR);
- yych = *++YYCURSOR;
+yy259:
+ YYDEBUG(259, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
+ if(yych <= '.'){
+ if(yych == ')') goto yy136;
+ goto yy3;
} else {
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy321;
+ if(yych <= 'S') goto yy139;
+ goto yy257;
}
} else {
- if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy3;
} else {
- if(yych <= 't') goto yy321;
- if(yych <= 'z') goto yy135;
+ if(yych == 't') goto yy260;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy321:
- YYDEBUG(321, *YYCURSOR);
+yy260:
+ YYDEBUG(260, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- YYDEBUG(-1, yych);
- switch(yych){
- case 0x09: case ' ': goto yy163;
- case ')': goto yy132;
- 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': 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 yy136;
- case 'D': case 'd': goto yy325;
- case 'F': case 'f': goto yy327;
- case 'H': case 'h': goto yy324;
- case 'M': case 'm': goto yy323;
- case 'S': case 's': goto yy322;
- case 'T': case 't': goto yy329;
- case 'W': case 'w': goto yy326;
- case 'Y': case 'y': goto yy328;
- default: goto yy3;
- }
-yy322:
- YYDEBUG(322, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'U'){
- if(yych <= 'A'){
- if(yych == ')') goto yy132;
- if(yych <= '@') goto yy3;
- goto yy340;
+ if(yych <= '.'){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy168;
+ goto yy3;
} else {
- if(yych == 'E') goto yy341;
- if(yych <= 'T') goto yy137;
- goto yy342;
+ if(yych <= ' ') goto yy168;
+ if(yych == ')') goto yy136;
+ goto yy3;
}
} else {
- if(yych <= 'd'){
- if(yych <= 'Z') goto yy137;
- if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy340;
- goto yy137;
- } else {
- if(yych <= 't'){
- if(yych <= 'e') goto yy341;
- goto yy137;
- } else {
- if(yych <= 'u') goto yy342;
- if(yych <= 'z') goto yy137;
- goto yy3;
- }
- }
- }
-yy323:
- YYDEBUG(323, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'O'){
- if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych <= '^'){
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Z') goto yy140;
goto yy3;
} else {
- if(yych == 'I') goto yy338;
- if(yych <= 'N') goto yy137;
- goto yy339;
- }
- } else {
- if(yych <= 'i'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- if(yych <= 'h') goto yy137;
- goto yy338;
- } else {
- if(yych == 'o') goto yy339;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy324:
- YYDEBUG(324, *YYCURSOR);
+yy261:
+ YYDEBUG(261, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'O'){
+ if(yych <= 'G'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy137;
- goto yy337;
+ if(yych <= 'F') goto yy138;
+ goto yy268;
}
} else {
- if(yych <= 'n'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'f'){
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy137;
- } else {
- if(yych <= 'o') goto yy337;
- if(yych <= 'z') goto yy137;
- goto yy3;
- }
- }
-yy325:
- YYDEBUG(325, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'A'){
- if(yych == ')') goto yy132;
- if(yych <= '@') goto yy3;
- goto yy336;
- } else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- goto yy3;
+ goto yy138;
} else {
- if(yych <= 'a') goto yy336;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'g') goto yy268;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy326:
- YYDEBUG(326, *YYCURSOR);
+yy262:
+ YYDEBUG(262, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy137;
- goto yy335;
+ if(yych <= 'D') goto yy138;
+ goto yy263;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy138;
} else {
- if(yych <= 'e') goto yy335;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'e') goto yy263;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy327:
- YYDEBUG(327, *YYCURSOR);
+yy263:
+ YYDEBUG(263, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'R'){
- if(yych <= '@'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= 'V'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy136;
} else {
- if(yych == 'O') goto yy333;
- if(yych <= 'Q') goto yy137;
- goto yy334;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy139;
+ goto yy264;
}
} else {
- if(yych <= 'o'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'u'){
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- if(yych <= 'n') goto yy137;
- goto yy333;
+ goto yy139;
} else {
- if(yych == 'r') goto yy334;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'v') goto yy264;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy328:
- YYDEBUG(328, *YYCURSOR);
+yy264:
+ YYDEBUG(264, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy137;
- goto yy332;
+ if(yych <= 'D') goto yy140;
+ goto yy265;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy140;
} else {
- if(yych <= 'e') goto yy332;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'e') goto yy265;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy329:
- YYDEBUG(329, *YYCURSOR);
+yy265:
+ YYDEBUG(265, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'U'){
- if(yych <= '@'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= 'N'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy136;
} else {
- if(yych == 'H') goto yy330;
- if(yych <= 'T') goto yy137;
- goto yy331;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy141;
+ goto yy266;
}
} else {
- if(yych <= 'h'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- if(yych <= 'g') goto yy137;
- goto yy330;
- } else {
- if(yych == 'u') goto yy331;
- if(yych <= 'z') goto yy137;
- goto yy3;
- }
- }
-yy330:
- YYDEBUG(330, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'T'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'U') goto yy181;
- if(yych == 'u') goto yy181;
- goto yy3;
- }
-yy331:
- YYDEBUG(331, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'D'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'E') goto yy175;
- if(yych == 'e') goto yy175;
- goto yy3;
- }
-yy332:
- YYDEBUG(332, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '@'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'A') goto yy187;
- if(yych == 'a') goto yy187;
- goto yy3;
- }
-yy333:
- YYDEBUG(333, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'Q'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'R') goto yy191;
- if(yych == 'r') goto yy191;
- goto yy3;
- }
-yy334:
- YYDEBUG(334, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'H'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'I') goto yy202;
- if(yych == 'i') goto yy202;
- goto yy3;
- }
-yy335:
- YYDEBUG(335, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'D'){
- if(yych == ')') goto yy132;
- if(yych <= 'C') goto yy3;
- goto yy207;
- } else {
- if(yych <= 'c'){
- if(yych <= 'E') goto yy206;
- goto yy3;
+ goto yy141;
} else {
- if(yych <= 'd') goto yy207;
- if(yych <= 'e') goto yy206;
+ if(yych <= 'n') goto yy266;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy336:
- YYDEBUG(336, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'X'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'Y') goto yy188;
- if(yych == 'y') goto yy188;
- goto yy3;
- }
-yy337:
- YYDEBUG(337, *YYCURSOR);
+yy266:
+ YYDEBUG(266, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'T'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'U') goto yy215;
- if(yych == 'u') goto yy215;
- goto yy3;
- }
-yy338:
- YYDEBUG(338, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'M'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'N') goto yy218;
- if(yych == 'n') goto yy218;
- goto yy3;
- }
-yy339:
- YYDEBUG(339, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'M'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'N') goto yy221;
- if(yych == 'n') goto yy221;
- goto yy3;
- }
-yy340:
- YYDEBUG(340, *YYCURSOR);
- yych = *++YYCURSOR;
if(yych <= 'S'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'T') goto yy231;
- if(yych == 't') goto yy231;
- goto yy3;
+ if(yych <= 'T') goto yy267;
+ if(yych != 't') goto yy3;
+ goto yy267;
}
-yy341:
- YYDEBUG(341, *YYCURSOR);
+yy267:
+ YYDEBUG(267, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'B'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'C') goto yy228;
- if(yych == 'c') goto yy228;
- goto yy3;
- }
-yy342:
- YYDEBUG(342, *YYCURSOR);
+ if(yych == 'H') goto yy167;
+ if(yych == 'h') goto yy167;
+ goto yy53;
+yy268:
+ YYDEBUG(268, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'M'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'N') goto yy236;
- if(yych == 'n') goto yy236;
- goto yy3;
- }
-yy343:
- YYDEBUG(343, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'S'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= 'H'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy136;
} else {
- if(yych <= '/') goto yy140;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy134;
- goto yy320;
+ if(yych <= 'G') goto yy139;
+ goto yy269;
}
} else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
- goto yy3;
+ if(yych <= 'g'){
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy3;
+ goto yy139;
} else {
- if(yych == 's') goto yy344;
+ if(yych <= 'h') goto yy269;
if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy344:
- YYDEBUG(344, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
+yy269:
+ YYDEBUG(269, *YYCURSOR);
+ yych = *++YYCURSOR;
if(yych <= 'T'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy136;
} else {
- if(yych <= '/') goto yy140;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy321;
+ if(yych <= 'S') goto yy140;
+ goto yy270;
}
} else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy3;
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy140;
+ if(yych <= '`') goto yy3;
+ goto yy140;
} else {
- if(yych == 't') goto yy345;
- if(yych <= 'z') goto yy144;
+ if(yych <= 't') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy345:
- YYDEBUG(345, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- YYDEBUG(-1, yych);
- switch(yych){
- case 0x09: case ' ': goto yy163;
- case ')': goto yy132;
- case '/': case '_': goto yy140;
- 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 yy136;
- case 'D': goto yy325;
- case 'F': goto yy327;
- case 'H': goto yy324;
- case 'M': goto yy323;
- case 'S': goto yy322;
- case 'T': goto yy329;
- case 'W': goto yy326;
- case 'Y': goto yy328;
- 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 yy145;
- case 'd': goto yy349;
- case 'f': goto yy351;
- case 'h': goto yy348;
- case 'm': goto yy347;
- case 's': goto yy346;
- case 't': goto yy353;
- case 'w': goto yy350;
- case 'y': goto yy352;
- default: goto yy3;
- }
-yy346:
- YYDEBUG(346, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
- if(yych <= '@'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych == '/') goto yy140;
- goto yy3;
- }
- } else {
- if(yych <= 'D'){
- if(yych <= 'A') goto yy340;
- goto yy137;
- } else {
- if(yych <= 'E') goto yy341;
- if(yych <= 'T') goto yy137;
- goto yy342;
- }
- }
- } else {
- if(yych <= 'a'){
- if(yych <= '^'){
- if(yych <= 'Z') goto yy137;
- goto yy3;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy364;
- }
- } else {
- if(yych <= 't'){
- if(yych == 'e') goto yy365;
- goto yy146;
- } else {
- if(yych <= 'u') goto yy366;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
- }
-yy347:
- YYDEBUG(347, *YYCURSOR);
+yy270:
+ YYDEBUG(270, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'O'){
- if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy3;
- goto yy140;
- } else {
- if(yych <= 'H'){
- if(yych <= '@') goto yy3;
- goto yy137;
- } else {
- if(yych <= 'I') goto yy338;
- if(yych <= 'N') goto yy137;
- goto yy339;
- }
- }
- } else {
- if(yych <= 'h'){
- if(yych <= '^'){
- if(yych <= 'Z') goto yy137;
- goto yy3;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy146;
- }
+ if(yych <= '('){
+ if(yych <= 0x09){
+ if(yych <= 0x08) goto yy3;
+ goto yy168;
} else {
- if(yych <= 'n'){
- if(yych <= 'i') goto yy362;
- goto yy146;
- } else {
- if(yych <= 'o') goto yy363;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
- }
-yy348:
- YYDEBUG(348, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'O'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ' ') goto yy168;
goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy137;
- goto yy337;
}
} else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'o') goto yy361;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
-yy349:
- YYDEBUG(349, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'A'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
+ if(yych <= 'Z'){
+ if(yych <= ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy336;
- }
- } else {
- if(yych <= '_'){
- if(yych <= 'Z') goto yy137;
- if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy141;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy360;
- if(yych <= 'z') goto yy146;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy350:
- YYDEBUG(350, *YYCURSOR);
+yy271:
+ YYDEBUG(271, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'E'){
+ if(yych <= 'G'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy137;
- goto yy335;
+ if(yych <= 'F') goto yy138;
+ goto yy268;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy359;
- if(yych <= 'z') goto yy146;
+ if(yych == 'g') goto yy278;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy351:
- YYDEBUG(351, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'R'){
- if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy3;
- goto yy140;
- } else {
- if(yych <= 'N'){
- if(yych <= '@') goto yy3;
- goto yy137;
- } else {
- if(yych <= 'O') goto yy333;
- if(yych <= 'Q') goto yy137;
- goto yy334;
- }
- }
- } else {
- if(yych <= 'n'){
- if(yych <= '^'){
- if(yych <= 'Z') goto yy137;
- goto yy3;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy146;
- }
- } else {
- if(yych <= 'q'){
- if(yych <= 'o') goto yy357;
- goto yy146;
- } else {
- if(yych <= 'r') goto yy358;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
- }
-yy352:
- YYDEBUG(352, *YYCURSOR);
+yy272:
+ YYDEBUG(272, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy137;
- goto yy332;
- }
- } else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'e') goto yy356;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
-yy353:
- YYDEBUG(353, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
- if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy3;
- goto yy140;
- } else {
- if(yych <= 'G'){
- if(yych <= '@') goto yy3;
- goto yy137;
- } else {
- if(yych <= 'H') goto yy330;
- if(yych <= 'T') goto yy137;
- goto yy331;
- }
- }
- } else {
- if(yych <= 'g'){
- if(yych <= '^'){
- if(yych <= 'Z') goto yy137;
- goto yy3;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy146;
- }
- } else {
- if(yych <= 't'){
- if(yych >= 'i') goto yy146;
- goto yy354;
- } else {
- if(yych <= 'u') goto yy355;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
- }
-yy354:
- YYDEBUG(354, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'T') goto yy3;
- goto yy181;
+ if(yych <= 'D') goto yy138;
+ goto yy263;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'u') goto yy261;
- if(yych <= 'z') goto yy147;
+ if(yych == 'e') goto yy273;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy355:
- YYDEBUG(355, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'E'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'D') goto yy3;
- goto yy175;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'e') goto yy256;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy356:
- YYDEBUG(356, *YYCURSOR);
+yy273:
+ YYDEBUG(273, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'A'){
+ if(yych <= 'V'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy187;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych <= 'a') goto yy267;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy357:
- YYDEBUG(357, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'R'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'Q') goto yy3;
- goto yy191;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'r') goto yy274;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy358:
- YYDEBUG(358, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'I'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'H') goto yy3;
- goto yy202;
+ if(yych <= 'U') goto yy139;
+ goto yy264;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'i') goto yy271;
- if(yych <= 'z') goto yy147;
+ if(yych == 'v') goto yy274;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy359:
- YYDEBUG(359, *YYCURSOR);
+yy274:
+ YYDEBUG(274, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'C') goto yy3;
- if(yych <= 'D') goto yy207;
- goto yy206;
- }
- } else {
- if(yych <= 'c'){
- if(yych == '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy147;
- } else {
- if(yych <= 'd') goto yy287;
- if(yych <= 'e') goto yy286;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy360:
- YYDEBUG(360, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'Y'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'X') goto yy3;
- goto yy188;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy140;
+ goto yy265;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy268;
- if(yych <= 'z') goto yy147;
+ if(yych == 'e') goto yy275;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy361:
- YYDEBUG(361, *YYCURSOR);
+yy275:
+ YYDEBUG(275, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
+ if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'T') goto yy3;
- goto yy215;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy141;
+ goto yy266;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'u') goto yy295;
- if(yych <= 'z') goto yy147;
+ if(yych == 'n') goto yy276;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy362:
- YYDEBUG(362, *YYCURSOR);
+yy276:
+ YYDEBUG(276, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'N'){
+ if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'M') goto yy3;
- goto yy218;
+ if(yych <= '/') goto yy144;
+ if(yych <= 'S') goto yy3;
+ goto yy267;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy302;
- if(yych <= 'z') goto yy147;
+ if(yych == 't') goto yy277;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy363:
- YYDEBUG(363, *YYCURSOR);
+yy277:
+ YYDEBUG(277, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'H') goto yy167;
+ if(yych == 'h') goto yy254;
+ goto yy152;
+yy278:
+ YYDEBUG(278, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'N'){
+ if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'M') goto yy3;
- goto yy221;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'G') goto yy139;
+ goto yy269;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy298;
- if(yych <= 'z') goto yy147;
+ if(yych == 'h') goto yy279;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy364:
- YYDEBUG(364, *YYCURSOR);
+yy279:
+ YYDEBUG(279, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'S') goto yy3;
- goto yy231;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy314;
- if(yych <= 'z') goto yy147;
+ if(yych == 't') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy365:
- YYDEBUG(365, *YYCURSOR);
+yy280:
+ YYDEBUG(280, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'C'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'B') goto yy3;
- goto yy228;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= '.'){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy168;
goto yy3;
} else {
- if(yych == 'c') goto yy311;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy366:
- YYDEBUG(366, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'N'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych <= ' ') goto yy168;
+ if(yych == ')') goto yy136;
goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'M') goto yy3;
- goto yy236;
}
} else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= '^'){
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Z') goto yy141;
goto yy3;
} else {
- if(yych == 'n') goto yy308;
- if(yych <= 'z') goto yy147;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy367:
- YYDEBUG(367, *YYCURSOR);
+yy281:
+ YYDEBUG(281, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'G'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
+ if(yych <= 'E'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy136;
+ goto yy3;
} else {
- if(yych <= '@') goto yy3;
- if(yych <= 'F') goto yy134;
- goto yy374;
+ if(yych <= 'C') goto yy138;
+ if(yych >= 'E') goto yy284;
+ goto yy282;
}
} else {
- if(yych <= 'f'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'c'){
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'g') goto yy374;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'd') goto yy282;
+ if(yych <= 'e') goto yy284;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy368:
- YYDEBUG(368, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'E'){
+yy282:
+ YYDEBUG(282, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= 'N'){
if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
+ if(yych >= ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy369;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'M') goto yy139;
+ goto yy290;
}
} else {
- if(yych <= 'd'){
- if(yych <= 'Z') goto yy134;
- if(yych <= '`') goto yy3;
- goto yy134;
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy139;
+ if(yych >= 'a') goto yy139;
+ goto yy283;
} else {
- if(yych <= 'e') goto yy369;
- if(yych <= 'z') goto yy134;
- goto yy3;
+ if(yych <= 'n') goto yy290;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy369:
- YYDEBUG(369, *YYCURSOR);
+yy283:
+ YYDEBUG(283, *YYCURSOR);
+
+{
+ const timelib_relunit* relunit;
+ DEBUG_OUTPUT("daytext");
+ 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_WEEKDAY;
+ }
+yy284:
+ YYDEBUG(284, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'V'){
+ if(yych <= 'K'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'U') goto yy135;
- goto yy370;
+ if(yych <= 'J') goto yy139;
+ goto yy285;
}
} else {
- if(yych <= 'u'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'j'){
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'v') goto yy370;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'k') goto yy285;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy370:
- YYDEBUG(370, *YYCURSOR);
+yy285:
+ YYDEBUG(285, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'E'){
+ if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy136;
- goto yy371;
+ if(yych <= 'C') goto yy140;
+ goto yy286;
}
} else {
- if(yych <= 'd'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'c'){
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'e') goto yy371;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'd') goto yy286;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy371:
- YYDEBUG(371, *YYCURSOR);
+yy286:
+ YYDEBUG(286, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'N'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy137;
- goto yy372;
- }
+ if(yych <= 'A'){
+ if(yych == ')') goto yy136;
+ if(yych <= '@') goto yy3;
+ goto yy287;
} else {
- if(yych <= 'm'){
- if(yych <= 'Z') goto yy137;
- if(yych <= '`') goto yy3;
- goto yy137;
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy141;
+ goto yy3;
} else {
- if(yych <= 'n') goto yy372;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'a') goto yy287;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy372:
- YYDEBUG(372, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'S'){
- if(yych == ')') goto yy132;
+yy287:
+ YYDEBUG(287, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'X'){
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'T') goto yy373;
- if(yych != 't') goto yy3;
- goto yy373;
+ if(yych <= 'Y') goto yy288;
+ if(yych != 'y') goto yy3;
+ goto yy288;
}
-yy373:
- YYDEBUG(373, *YYCURSOR);
+yy288:
+ YYDEBUG(288, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'H') goto yy163;
- if(yych == 'h') goto yy163;
- goto yy53;
-yy374:
- YYDEBUG(374, *YYCURSOR);
+ if(yych == 'S') goto yy289;
+ if(yych != 's') goto yy283;
+ goto yy289;
+yy289:
+ YYDEBUG(289, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'H'){
+ goto yy283;
+yy290:
+ YYDEBUG(290, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy135;
- goto yy375;
+ if(yych <= 'D') goto yy140;
+ goto yy291;
}
} else {
- if(yych <= 'g'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy140;
} else {
- if(yych <= 'h') goto yy375;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'e') goto yy291;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy375:
- YYDEBUG(375, *YYCURSOR);
+yy291:
+ YYDEBUG(291, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'T'){
+ if(yych <= 'S'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy136;
- goto yy376;
+ if(yych <= 'R') goto yy141;
+ goto yy292;
}
} else {
- if(yych <= 's'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'r'){
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy136;
- } else {
- if(yych <= 't') goto yy376;
- if(yych <= 'z') goto yy136;
- goto yy3;
- }
- }
-yy376:
- YYDEBUG(376, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- YYDEBUG(-1, yych);
- switch(yych){
- case 0x09: case ' ': goto yy163;
- case ')': goto yy132;
- 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': 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 yy137;
- case 'D': case 'd': goto yy377;
- case 'F': case 'f': goto yy378;
- case 'H': case 'h': goto yy379;
- case 'M': case 'm': goto yy380;
- case 'S': case 's': goto yy381;
- case 'T': case 't': goto yy382;
- case 'W': case 'w': goto yy383;
- case 'Y': case 'y': goto yy384;
- default: goto yy3;
- }
-yy377:
- YYDEBUG(377, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '@'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'A') goto yy213;
- if(yych == 'a') goto yy213;
- goto yy3;
- }
-yy378:
- YYDEBUG(378, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'Q'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych == 'O') goto yy190;
- goto yy3;
- }
- } else {
- if(yych <= 'o'){
- if(yych <= 'R') goto yy189;
- if(yych <= 'n') goto yy3;
- goto yy190;
- } else {
- if(yych == 'r') goto yy189;
- goto yy3;
- }
- }
-yy379:
- YYDEBUG(379, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'N'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'O') goto yy214;
- if(yych == 'o') goto yy214;
- goto yy3;
- }
-yy380:
- YYDEBUG(380, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'N'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych == 'I') goto yy217;
- goto yy3;
- }
- } else {
- if(yych <= 'i'){
- if(yych <= 'O') goto yy216;
- if(yych <= 'h') goto yy3;
- goto yy217;
- } else {
- if(yych == 'o') goto yy216;
- goto yy3;
- }
- }
-yy381:
- YYDEBUG(381, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'T'){
- if(yych <= '@'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'A') goto yy226;
- if(yych == 'E') goto yy227;
- goto yy3;
- }
- } else {
- if(yych <= 'd'){
- if(yych <= 'U') goto yy225;
- if(yych == 'a') goto yy226;
- goto yy3;
+ goto yy141;
} else {
- if(yych <= 'e') goto yy227;
- if(yych == 'u') goto yy225;
+ if(yych <= 's') goto yy292;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy382:
- YYDEBUG(382, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'T'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych == 'H') goto yy173;
- goto yy3;
- }
- } else {
- if(yych <= 'h'){
- if(yych <= 'U') goto yy174;
- if(yych <= 'g') goto yy3;
- goto yy173;
- } else {
- if(yych == 'u') goto yy174;
- goto yy3;
- }
- }
-yy383:
- YYDEBUG(383, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'D'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'E') goto yy205;
- if(yych == 'e') goto yy205;
- goto yy3;
- }
-yy384:
- YYDEBUG(384, *YYCURSOR);
+yy292:
+ YYDEBUG(292, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'D'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'E') goto yy186;
- if(yych == 'e') goto yy186;
+ if(yych <= 'C'){
+ if(yych == ')') goto yy136;
goto yy3;
- }
-yy385:
- YYDEBUG(385, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'G'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy3;
- if(yych <= 'F') goto yy134;
- goto yy374;
- }
} else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'g') goto yy392;
- if(yych <= 'z') goto yy139;
- goto yy3;
- }
- }
-yy386:
- YYDEBUG(386, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'E'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy369;
- }
- } else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'e') goto yy387;
- if(yych <= 'z') goto yy139;
- goto yy3;
- }
- }
-yy387:
- YYDEBUG(387, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'V'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy3;
- if(yych <= 'U') goto yy135;
- goto yy370;
- }
- } else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'v') goto yy388;
- if(yych <= 'z') goto yy144;
- goto yy3;
- }
+ if(yych <= 'D') goto yy293;
+ if(yych != 'd') goto yy3;
+ goto yy293;
}
-yy388:
- YYDEBUG(388, *YYCURSOR);
+yy293:
+ YYDEBUG(293, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy294;
+ if(yych != 'a') goto yy53;
+ goto yy294;
+yy294:
+ YYDEBUG(294, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy289;
+ if(yych == 'y') goto yy289;
+ goto yy53;
+yy295:
+ YYDEBUG(295, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= '/'){
+ if(yych == ')') goto yy136;
+ if(yych <= '.') goto yy3;
+ goto yy144;
} else {
- if(yych <= '/') goto yy140;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy136;
- goto yy371;
+ if(yych <= 'C') goto yy138;
+ if(yych <= 'D') goto yy282;
+ goto yy284;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy389;
- if(yych <= 'z') goto yy145;
- goto yy3;
+ if(yych <= 'd'){
+ if(yych <= 'c') goto yy143;
+ goto yy296;
+ } else {
+ if(yych <= 'e') goto yy297;
+ if(yych <= 'z') goto yy143;
+ goto yy3;
+ }
}
}
-yy389:
- YYDEBUG(389, *YYCURSOR);
- yyaccept = 0;
+yy296:
+ YYDEBUG(296, *YYCURSOR);
+ yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy137;
- goto yy372;
- }
- } else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'n') goto yy390;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
-yy390:
- YYDEBUG(390, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'T'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'S') goto yy3;
- goto yy373;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'M') goto yy139;
+ goto yy290;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 't') goto yy391;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy391:
- YYDEBUG(391, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy53;
- goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 'H') goto yy163;
- goto yy53;
- }
- } else {
- if(yych <= 'g'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy53;
- goto yy147;
- } else {
- if(yych <= 'h') goto yy245;
- if(yych <= 'z') goto yy147;
- goto yy53;
+ if(yych == 'n') goto yy303;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy392:
- YYDEBUG(392, *YYCURSOR);
+yy297:
+ YYDEBUG(297, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'H'){
+ if(yych <= 'K'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy135;
- goto yy375;
+ if(yych <= 'J') goto yy139;
+ goto yy285;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy393;
- if(yych <= 'z') goto yy144;
+ if(yych == 'k') goto yy298;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy393:
- YYDEBUG(393, *YYCURSOR);
+yy298:
+ YYDEBUG(298, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'T'){
+ if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy136;
- goto yy376;
+ if(yych <= 'C') goto yy140;
+ goto yy286;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 'd') goto yy299;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy394:
- YYDEBUG(394, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- YYDEBUG(-1, yych);
- switch(yych){
- case 0x09: case ' ': goto yy163;
- case ')': goto yy132;
- case '/': case '_': goto yy140;
- 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 yy137;
- case 'D': goto yy377;
- case 'F': goto yy378;
- case 'H': goto yy379;
- case 'M': goto yy380;
- case 'S': goto yy381;
- case 'T': goto yy382;
- case 'W': goto yy383;
- case 'Y': goto yy384;
- 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 yy146;
- case 'd': goto yy395;
- case 'f': goto yy396;
- case 'h': goto yy397;
- case 'm': goto yy398;
- case 's': goto yy399;
- case 't': goto yy400;
- case 'w': goto yy401;
- case 'y': goto yy402;
- default: goto yy3;
- }
-yy395:
- YYDEBUG(395, *YYCURSOR);
+yy299:
+ YYDEBUG(299, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy213;
+ goto yy287;
}
} else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych <= 'a') goto yy293;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy396:
- YYDEBUG(396, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'R'){
- if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy3;
- goto yy140;
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy141;
+ if(yych <= '^') goto yy3;
+ goto yy144;
} else {
- if(yych == 'O') goto yy190;
- if(yych <= 'Q') goto yy3;
- goto yy189;
- }
- } else {
- if(yych <= 'n'){
- if(yych == '_') goto yy140;
if(yych <= '`') goto yy3;
- goto yy147;
- } else {
- if(yych <= 'q'){
- if(yych <= 'o') goto yy269;
- goto yy147;
- } else {
- if(yych <= 'r') goto yy270;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
- }
-yy397:
- YYDEBUG(397, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'O'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych <= 'a') goto yy300;
+ if(yych <= 'z') goto yy150;
goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'N') goto yy3;
- goto yy214;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'o') goto yy294;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy398:
- YYDEBUG(398, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'O'){
- if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy3;
- goto yy140;
- } else {
- if(yych == 'I') goto yy217;
- if(yych <= 'N') goto yy3;
- goto yy216;
- }
- } else {
- if(yych <= 'h'){
- if(yych == '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy147;
- } else {
- if(yych <= 'n'){
- if(yych <= 'i') goto yy296;
- goto yy147;
- } else {
- if(yych <= 'o') goto yy297;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
- }
-yy399:
- YYDEBUG(399, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
- if(yych <= '@'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych == '/') goto yy140;
- goto yy3;
- }
- } else {
- if(yych <= 'D'){
- if(yych <= 'A') goto yy226;
- goto yy3;
- } else {
- if(yych <= 'E') goto yy227;
- if(yych <= 'T') goto yy3;
- goto yy225;
- }
- }
- } else {
- if(yych <= 'd'){
- if(yych <= '_'){
- if(yych <= '^') goto yy3;
- goto yy140;
- } else {
- if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy305;
- goto yy147;
- }
- } else {
- if(yych <= 't'){
- if(yych <= 'e') goto yy306;
- goto yy147;
- } else {
- if(yych <= 'u') goto yy307;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
}
}
-yy400:
- YYDEBUG(400, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
- if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy3;
- goto yy140;
- } else {
- if(yych == 'H') goto yy173;
- if(yych <= 'T') goto yy3;
- goto yy174;
- }
- } else {
- if(yych <= 'g'){
- if(yych == '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy147;
- } else {
- if(yych <= 't'){
- if(yych <= 'h') goto yy254;
- goto yy147;
- } else {
- if(yych <= 'u') goto yy255;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
- }
-yy401:
- YYDEBUG(401, *YYCURSOR);
+yy300:
+ YYDEBUG(300, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'E'){
+ if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'D') goto yy3;
- goto yy205;
+ if(yych <= '/') goto yy144;
+ if(yych <= 'X') goto yy3;
+ goto yy288;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy285;
- if(yych <= 'z') goto yy147;
+ if(yych == 'y') goto yy301;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy402:
- YYDEBUG(402, *YYCURSOR);
- yyaccept = 0;
+yy301:
+ YYDEBUG(301, *YYCURSOR);
+ yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'E'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'D') goto yy3;
- goto yy186;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'e') goto yy266;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy403:
- YYDEBUG(403, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'D'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy134;
- goto yy404;
- }
- } else {
- if(yych <= 'c'){
- if(yych <= 'Z') goto yy134;
- if(yych <= '`') goto yy3;
- goto yy134;
- } else {
- if(yych <= 'd') goto yy404;
- if(yych <= 'z') goto yy134;
- goto yy3;
- }
- }
-yy404:
- YYDEBUG(404, *YYCURSOR);
- ++YYCURSOR;
- if((yych = *YYCURSOR) <= 'N'){
- if(yych <= ')'){
- if(yych >= ')') goto yy132;
- goto yy405;
- } else {
- if(yych <= '@') goto yy405;
- if(yych <= 'M') goto yy135;
- goto yy406;
- }
- } else {
- if(yych <= 'm'){
- if(yych <= 'Z') goto yy135;
- if(yych >= 'a') goto yy135;
- goto yy405;
- } else {
- if(yych <= 'n') goto yy406;
- if(yych <= 'z') goto yy135;
- goto yy405;
- }
- }
-yy405:
- YYDEBUG(405, *YYCURSOR);
-
-{
- const timelib_relunit* relunit;
- DEBUG_OUTPUT("daytext");
- 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_WEEKDAY;
- }
-yy406:
- YYDEBUG(406, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'E'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy136;
- goto yy407;
- }
- } else {
- if(yych <= 'd'){
- if(yych <= 'Z') goto yy136;
- if(yych <= '`') goto yy3;
- goto yy136;
- } else {
- if(yych <= 'e') goto yy407;
- if(yych <= 'z') goto yy136;
- goto yy3;
- }
- }
-yy407:
- YYDEBUG(407, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'S'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy283;
+ goto yy144;
} else {
- if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy137;
- goto yy408;
+ if(yych == 'S') goto yy289;
+ goto yy283;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy137;
- if(yych <= '`') goto yy3;
- goto yy137;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy283;
+ goto yy151;
} else {
- if(yych <= 's') goto yy408;
- if(yych <= 'z') goto yy137;
- goto yy3;
+ if(yych <= 's') goto yy302;
+ if(yych <= 'z') goto yy151;
+ goto yy283;
}
}
-yy408:
- YYDEBUG(408, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'C'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'D') goto yy409;
- if(yych != 'd') goto yy3;
- goto yy409;
- }
-yy409:
- YYDEBUG(409, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy410;
- if(yych != 'a') goto yy53;
- goto yy410;
-yy410:
- YYDEBUG(410, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy411;
- if(yych != 'y') goto yy53;
- goto yy411;
-yy411:
- YYDEBUG(411, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy405;
-yy412:
- YYDEBUG(412, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'D'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy134;
- goto yy404;
- }
- } else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'd') goto yy413;
- if(yych <= 'z') goto yy139;
- goto yy3;
- }
- }
-yy413:
- YYDEBUG(413, *YYCURSOR);
+yy302:
+ YYDEBUG(302, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'N'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'M') goto yy135;
- goto yy406;
- }
+ if(yych <= '^'){
+ if(yych == '/') goto yy144;
+ goto yy283;
} else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
- } else {
- if(yych == 'n') goto yy414;
- if(yych <= 'z') goto yy144;
- goto yy405;
- }
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy283;
+ if(yych <= 'z') goto yy151;
+ goto yy283;
}
-yy414:
- YYDEBUG(414, *YYCURSOR);
+yy303:
+ YYDEBUG(303, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy136;
- goto yy407;
+ if(yych <= 'D') goto yy140;
+ goto yy291;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy415;
- if(yych <= 'z') goto yy145;
+ if(yych == 'e') goto yy304;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy415:
- YYDEBUG(415, *YYCURSOR);
+yy304:
+ YYDEBUG(304, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy137;
- goto yy408;
+ if(yych <= 'R') goto yy141;
+ goto yy292;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 's') goto yy416;
- if(yych <= 'z') goto yy146;
+ if(yych == 's') goto yy305;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy416:
- YYDEBUG(416, *YYCURSOR);
+yy305:
+ YYDEBUG(305, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'C') goto yy3;
- goto yy409;
+ goto yy293;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy417;
- if(yych <= 'z') goto yy147;
+ if(yych == 'd') goto yy306;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy417:
- YYDEBUG(417, *YYCURSOR);
+yy306:
+ YYDEBUG(306, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy410;
- if(yych != 'a') goto yy148;
- goto yy418;
-yy418:
- YYDEBUG(418, *YYCURSOR);
+ if(yych == 'A') goto yy294;
+ if(yych != 'a') goto yy152;
+ goto yy307;
+yy307:
+ YYDEBUG(307, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy411;
- if(yych != 'y') goto yy148;
- goto yy419;
-yy419:
- YYDEBUG(419, *YYCURSOR);
- yyaccept = 5;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych == '/') goto yy140;
- goto yy405;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy405;
- if(yych <= 'z') goto yy147;
- goto yy405;
- }
-yy420:
- YYDEBUG(420, *YYCURSOR);
+ if(yych == 'Y') goto yy289;
+ if(yych == 'y') goto yy302;
+ goto yy152;
+yy308:
+ YYDEBUG(308, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'C'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'B') goto yy134;
- goto yy421;
+ if(yych <= 'B') goto yy138;
+ goto yy309;
}
} else {
if(yych <= 'b'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'c') goto yy421;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'c') goto yy309;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy421:
- YYDEBUG(421, *YYCURSOR);
- yyaccept = 0;
+yy309:
+ YYDEBUG(309, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych >= 0x09) goto yy312;
+ goto yy310;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych == 'E') goto yy429;
- goto yy135;
+ if(yych == 'E') goto yy318;
+ goto yy139;
}
} else {
if(yych <= 'd'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych >= 'a') goto yy139;
+ goto yy310;
} else {
- if(yych <= 'e') goto yy429;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'e') goto yy318;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy422:
- YYDEBUG(422, *YYCURSOR);
+yy310:
+ YYDEBUG(310, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("monthtext");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_lookup_month((char **) &ptr);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_TEXT;
+ }
+yy311:
+ YYDEBUG(311, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 20) YYFILL(20);
yych = *YYCURSOR;
- goto yy423;
-yy423:
- YYDEBUG(423, *YYCURSOR);
+ goto yy312;
+yy312:
+ YYDEBUG(312, *YYCURSOR);
if(yybm[0+yych] & 64) {
- goto yy422;
+ goto yy311;
}
if(yych <= '/') goto yy53;
- if(yych <= '2') goto yy425;
- if(yych <= '3') goto yy427;
- if(yych <= '9') goto yy428;
+ if(yych <= '2') goto yy314;
+ if(yych <= '3') goto yy316;
+ if(yych <= '9') goto yy317;
goto yy53;
-yy424:
- YYDEBUG(424, *YYCURSOR);
+yy313:
+ YYDEBUG(313, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy423;
- if(yych <= '0') goto yy511;
- if(yych <= '2') goto yy512;
- if(yych <= '3') goto yy513;
- goto yy423;
-yy425:
- YYDEBUG(425, *YYCURSOR);
- yyaccept = 6;
+ if(yych <= '/') goto yy312;
+ if(yych <= '0') goto yy473;
+ if(yych <= '2') goto yy474;
+ if(yych <= '3') goto yy475;
+ goto yy312;
+yy314:
+ YYDEBUG(314, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy441;
- goto yy493;
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy412;
+ goto yy413;
} else {
- if(yych <= '2') goto yy510;
- if(yych <= '9') goto yy493;
- goto yy441;
+ if(yych <= '2') goto yy471;
+ if(yych <= '9') goto yy472;
+ goto yy332;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy437;
- if(yych <= 'q') goto yy441;
- goto yy438;
+ if(yych <= 'n') goto yy328;
+ if(yych <= 'q') goto yy332;
+ goto yy329;
} else {
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy426:
- YYDEBUG(426, *YYCURSOR);
+yy315:
+ YYDEBUG(315, *YYCURSOR);
{
DEBUG_OUTPUT("datetextual | datenoyear");
@@ -7403,253 +5626,288 @@ yy426:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
-yy427:
- YYDEBUG(427, *YYCURSOR);
- yyaccept = 6;
+yy316:
+ YYDEBUG(316, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy441;
- goto yy493;
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy412;
+ goto yy413;
} else {
- if(yych <= '2') goto yy434;
- if(yych <= '9') goto yy435;
- goto yy441;
+ if(yych <= '2') goto yy325;
+ if(yych <= '9') goto yy326;
+ goto yy332;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy437;
- if(yych <= 'q') goto yy441;
- goto yy438;
+ if(yych <= 'n') goto yy328;
+ if(yych <= 'q') goto yy332;
+ goto yy329;
} else {
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy428:
- YYDEBUG(428, *YYCURSOR);
- yyaccept = 6;
+yy317:
+ YYDEBUG(317, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy441;
- goto yy433;
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy323;
+ goto yy324;
} else {
- if(yych <= '2') goto yy434;
- if(yych <= '9') goto yy435;
- goto yy441;
+ if(yych <= '2') goto yy325;
+ if(yych <= '9') goto yy326;
+ goto yy332;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy437;
- if(yych <= 'q') goto yy441;
- goto yy438;
+ if(yych <= 'n') goto yy328;
+ if(yych <= 'q') goto yy332;
+ goto yy329;
} else {
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy429:
- YYDEBUG(429, *YYCURSOR);
+yy318:
+ YYDEBUG(318, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'M'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'L') goto yy136;
- goto yy430;
+ if(yych <= 'L') goto yy140;
+ goto yy319;
}
} else {
if(yych <= 'l'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'm') goto yy430;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'm') goto yy319;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy430:
- YYDEBUG(430, *YYCURSOR);
+yy319:
+ YYDEBUG(319, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'B'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy137;
- goto yy431;
+ if(yych <= 'A') goto yy141;
+ goto yy320;
}
} else {
if(yych <= 'a'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'b') goto yy431;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'b') goto yy320;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy431:
- YYDEBUG(431, *YYCURSOR);
+yy320:
+ YYDEBUG(320, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'E') goto yy432;
+ if(yych <= 'E') goto yy321;
if(yych != 'e') goto yy3;
- goto yy432;
+ goto yy321;
}
-yy432:
- YYDEBUG(432, *YYCURSOR);
+yy321:
+ YYDEBUG(321, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy422;
- if(yych == 'r') goto yy422;
- goto yy53;
-yy433:
- YYDEBUG(433, *YYCURSOR);
+ if(yych == 'R') goto yy322;
+ if(yych != 'r') goto yy53;
+ goto yy322;
+yy322:
+ YYDEBUG(322, *YYCURSOR);
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy312;
+ if(yych <= 0x1F) goto yy310;
+ goto yy312;
+ } else {
+ if(yych <= '.'){
+ if(yych <= ',') goto yy310;
+ goto yy312;
+ } else {
+ if(yych <= '/') goto yy310;
+ if(yych <= '9') goto yy312;
+ goto yy310;
+ }
+ }
+yy323:
+ YYDEBUG(323, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy337;
+ goto yy315;
} else {
- if(yych <= '9') goto yy492;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '0') goto yy410;
+ if(yych <= '9') goto yy411;
+ if(yych <= ':') goto yy337;
+ goto yy315;
}
-yy434:
- YYDEBUG(434, *YYCURSOR);
- yyaccept = 6;
+yy324:
+ YYDEBUG(324, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '3') goto yy492;
- if(yych <= '9') goto yy489;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '2') goto yy411;
+ if(yych <= '9') goto yy410;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy435:
- YYDEBUG(435, *YYCURSOR);
- yyaccept = 6;
+yy325:
+ YYDEBUG(325, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '9') goto yy489;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '3') goto yy410;
+ if(yych <= '9') goto yy407;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy436:
- YYDEBUG(436, *YYCURSOR);
- yyaccept = 6;
+yy326:
+ YYDEBUG(326, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy441;
-yy437:
- YYDEBUG(437, *YYCURSOR);
- yyaccept = 6;
+ if(yych <= '/'){
+ if(yych == '.') goto yy378;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy407;
+ if(yych <= ':') goto yy378;
+ goto yy315;
+ }
+yy327:
+ YYDEBUG(327, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy441;
-yy438:
- YYDEBUG(438, *YYCURSOR);
- yyaccept = 6;
+ goto yy332;
+yy328:
+ YYDEBUG(328, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy441;
-yy439:
- YYDEBUG(439, *YYCURSOR);
- yyaccept = 6;
+ goto yy332;
+yy329:
+ YYDEBUG(329, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy441;
-yy440:
- YYDEBUG(440, *YYCURSOR);
- yyaccept = 6;
+ goto yy332;
+yy330:
+ YYDEBUG(330, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy332;
+yy331:
+ YYDEBUG(331, *YYCURSOR);
+ yyaccept = 7;
YYMARKER = ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 17) YYFILL(17);
yych = *YYCURSOR;
- goto yy441;
-yy441:
- YYDEBUG(441, *YYCURSOR);
+ goto yy332;
+yy332:
+ YYDEBUG(332, *YYCURSOR);
if(yybm[0+yych] & 128) {
- goto yy440;
+ goto yy331;
}
if(yych <= '2'){
- if(yych <= '/') goto yy426;
- if(yych <= '1') goto yy482;
- goto yy483;
+ if(yych <= '/') goto yy315;
+ if(yych <= '0') goto yy373;
+ if(yych <= '1') goto yy374;
+ goto yy375;
} else {
- if(yych <= '9') goto yy484;
- if(yych != 'T') goto yy426;
- goto yy442;
+ if(yych <= '9') goto yy376;
+ if(yych != 'T') goto yy315;
+ goto yy333;
}
-yy442:
- YYDEBUG(442, *YYCURSOR);
+yy333:
+ YYDEBUG(333, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy443;
- if(yych <= '2') goto yy444;
- if(yych <= '9') goto yy445;
+ if(yych <= '1') goto yy334;
+ if(yych <= '2') goto yy335;
+ if(yych <= '9') goto yy336;
goto yy53;
-yy443:
- YYDEBUG(443, *YYCURSOR);
+yy334:
+ YYDEBUG(334, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/'){
- if(yych == '.') goto yy446;
+ if(yych == '.') goto yy337;
goto yy53;
} else {
- if(yych <= '9') goto yy445;
- if(yych <= ':') goto yy446;
+ if(yych <= '9') goto yy336;
+ if(yych <= ':') goto yy337;
goto yy53;
}
-yy444:
- YYDEBUG(444, *YYCURSOR);
+yy335:
+ YYDEBUG(335, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/'){
- if(yych == '.') goto yy446;
+ if(yych == '.') goto yy337;
goto yy53;
} else {
- if(yych <= '3') goto yy445;
- if(yych == ':') goto yy446;
+ if(yych <= '3') goto yy336;
+ if(yych == ':') goto yy337;
goto yy53;
}
-yy445:
- YYDEBUG(445, *YYCURSOR);
+yy336:
+ YYDEBUG(336, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '.') goto yy446;
+ if(yych == '.') goto yy337;
if(yych != ':') goto yy53;
- goto yy446;
-yy446:
- YYDEBUG(446, *YYCURSOR);
+ goto yy337;
+yy337:
+ YYDEBUG(337, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy447;
- if(yych <= '9') goto yy449;
+ if(yych <= '5') goto yy338;
+ if(yych <= '9') goto yy340;
goto yy53;
-yy447:
- YYDEBUG(447, *YYCURSOR);
- yyaccept = 7;
+yy338:
+ YYDEBUG(338, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy450;
- goto yy448;
+ if(yych == '.') goto yy341;
+ goto yy339;
} else {
- if(yych <= '9') goto yy449;
- if(yych <= ':') goto yy450;
- goto yy448;
+ if(yych <= '9') goto yy340;
+ if(yych <= ':') goto yy341;
+ goto yy339;
}
-yy448:
- YYDEBUG(448, *YYCURSOR);
+yy339:
+ YYDEBUG(339, *YYCURSOR);
{
int tz_not_found;
@@ -7679,463 +5937,864 @@ yy448:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
-yy449:
- YYDEBUG(449, *YYCURSOR);
- yyaccept = 7;
+yy340:
+ YYDEBUG(340, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy450;
- if(yych != ':') goto yy448;
- goto yy450;
-yy450:
- YYDEBUG(450, *YYCURSOR);
+ if(yych == '.') goto yy341;
+ if(yych != ':') goto yy339;
+ goto yy341;
+yy341:
+ YYDEBUG(341, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy451;
- if(yych <= '6') goto yy452;
- if(yych <= '9') goto yy453;
+ if(yych <= '5') goto yy342;
+ if(yych <= '6') goto yy343;
+ if(yych <= '9') goto yy344;
goto yy53;
-yy451:
- YYDEBUG(451, *YYCURSOR);
+yy342:
+ YYDEBUG(342, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy448;
- if(yych <= '9') goto yy454;
- goto yy448;
-yy452:
- YYDEBUG(452, *YYCURSOR);
+ if(yych <= '/') goto yy339;
+ if(yych <= '9') goto yy345;
+ goto yy339;
+yy343:
+ YYDEBUG(343, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '0') goto yy454;
- goto yy448;
-yy453:
- YYDEBUG(453, *YYCURSOR);
+ if(yych == '0') goto yy345;
+ goto yy339;
+yy344:
+ YYDEBUG(344, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy448;
-yy454:
- YYDEBUG(454, *YYCURSOR);
- yyaccept = 7;
+ goto yy339;
+yy345:
+ YYDEBUG(345, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '*'){
if(yych <= 0x1F){
- if(yych != 0x09) goto yy448;
- goto yy455;
+ if(yych != 0x09) goto yy339;
+ goto yy346;
} else {
- if(yych <= ' ') goto yy455;
- if(yych == '(') goto yy458;
- goto yy448;
+ if(yych <= ' ') goto yy346;
+ if(yych == '(') goto yy349;
+ goto yy339;
}
} else {
if(yych <= '@'){
- if(yych == ',') goto yy448;
- if(yych <= '-') goto yy457;
- goto yy448;
+ if(yych == ',') goto yy339;
+ if(yych <= '-') goto yy348;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy459;
- if(yych <= '`') goto yy448;
- if(yych <= 'z') goto yy460;
- goto yy448;
+ if(yych <= 'Z') goto yy350;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy351;
+ goto yy339;
}
}
-yy455:
- YYDEBUG(455, *YYCURSOR);
+yy346:
+ YYDEBUG(346, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
yych = *YYCURSOR;
- goto yy456;
-yy456:
- YYDEBUG(456, *YYCURSOR);
+ goto yy347;
+yy347:
+ YYDEBUG(347, *YYCURSOR);
if(yych <= '*'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy455;
+ if(yych == 0x09) goto yy346;
goto yy53;
} else {
- if(yych <= ' ') goto yy455;
- if(yych == '(') goto yy458;
+ if(yych <= ' ') goto yy346;
+ if(yych == '(') goto yy349;
goto yy53;
}
} else {
if(yych <= '@'){
if(yych == ',') goto yy53;
if(yych >= '.') goto yy53;
- goto yy457;
+ goto yy348;
} else {
- if(yych <= 'Z') goto yy459;
+ if(yych <= 'Z') goto yy350;
if(yych <= '`') goto yy53;
- if(yych <= 'z') goto yy460;
+ if(yych <= 'z') goto yy351;
goto yy53;
}
}
-yy457:
- YYDEBUG(457, *YYCURSOR);
+yy348:
+ YYDEBUG(348, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy477;
- if(yych <= '2') goto yy478;
- if(yych <= '9') goto yy479;
+ if(yych <= '1') goto yy368;
+ if(yych <= '2') goto yy369;
+ if(yych <= '9') goto yy370;
goto yy53;
-yy458:
- YYDEBUG(458, *YYCURSOR);
+yy349:
+ YYDEBUG(349, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@') goto yy53;
- if(yych <= 'Z') goto yy460;
+ if(yych <= 'Z') goto yy351;
if(yych <= '`') goto yy53;
- if(yych <= 'z') goto yy460;
+ if(yych <= 'z') goto yy351;
goto yy53;
-yy459:
- YYDEBUG(459, *YYCURSOR);
+yy350:
+ YYDEBUG(350, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy453;
- goto yy448;
+ if(yych == ')') goto yy344;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy461;
- if(yych <= '`') goto yy448;
- if(yych <= 'z') goto yy466;
- goto yy448;
+ if(yych <= 'Z') goto yy352;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy357;
+ goto yy339;
}
-yy460:
- YYDEBUG(460, *YYCURSOR);
+yy351:
+ YYDEBUG(351, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy453;
- goto yy448;
+ if(yych == ')') goto yy344;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy461;
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy461;
+ if(yych <= 'Z') goto yy352;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy352;
}
-yy461:
- YYDEBUG(461, *YYCURSOR);
+yy352:
+ YYDEBUG(352, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy453;
- goto yy448;
+ if(yych == ')') goto yy344;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy462;
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy462;
+ if(yych <= 'Z') goto yy353;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy353;
}
-yy462:
- YYDEBUG(462, *YYCURSOR);
+yy353:
+ YYDEBUG(353, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy453;
- goto yy448;
+ if(yych == ')') goto yy344;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy463;
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy463;
+ if(yych <= 'Z') goto yy354;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy354;
}
-yy463:
- YYDEBUG(463, *YYCURSOR);
+yy354:
+ YYDEBUG(354, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy453;
- goto yy448;
+ if(yych == ')') goto yy344;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy464;
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy464;
+ if(yych <= 'Z') goto yy355;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy355;
}
-yy464:
- YYDEBUG(464, *YYCURSOR);
+yy355:
+ YYDEBUG(355, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy453;
- goto yy448;
+ if(yych == ')') goto yy344;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy465;
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy465;
+ if(yych <= 'Z') goto yy356;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy356;
}
-yy465:
- YYDEBUG(465, *YYCURSOR);
+yy356:
+ YYDEBUG(356, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == ')') goto yy453;
- goto yy448;
-yy466:
- YYDEBUG(466, *YYCURSOR);
- yyaccept = 7;
+ if(yych == ')') goto yy344;
+ goto yy339;
+yy357:
+ YYDEBUG(357, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy448;
- goto yy453;
+ if(yych <= '(') goto yy339;
+ goto yy344;
} else {
- if(yych == '/') goto yy468;
- goto yy448;
+ if(yych == '/') goto yy359;
+ goto yy339;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy462;
- if(yych <= '^') goto yy448;
- goto yy468;
+ if(yych <= 'Z') goto yy353;
+ if(yych <= '^') goto yy339;
+ goto yy359;
} else {
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy467;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy358;
}
}
-yy467:
- YYDEBUG(467, *YYCURSOR);
- yyaccept = 7;
+yy358:
+ YYDEBUG(358, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy448;
- goto yy453;
+ if(yych <= '(') goto yy339;
+ goto yy344;
} else {
- if(yych != '/') goto yy448;
- goto yy468;
+ if(yych != '/') goto yy339;
+ goto yy359;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy463;
- if(yych <= '^') goto yy448;
- goto yy468;
+ if(yych <= 'Z') goto yy354;
+ if(yych <= '^') goto yy339;
+ goto yy359;
} else {
- if(yych <= '`') goto yy448;
- if(yych <= 'z') goto yy472;
- goto yy448;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy363;
+ goto yy339;
}
}
-yy468:
- YYDEBUG(468, *YYCURSOR);
+yy359:
+ YYDEBUG(359, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
if(yych <= '@') goto yy53;
if(yych >= '[') goto yy53;
- goto yy469;
-yy469:
- YYDEBUG(469, *YYCURSOR);
+ goto yy360;
+yy360:
+ YYDEBUG(360, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
if(yych <= '`') goto yy53;
if(yych >= '{') goto yy53;
- goto yy470;
-yy470:
- YYDEBUG(470, *YYCURSOR);
- yyaccept = 7;
+ goto yy361;
+yy361:
+ YYDEBUG(361, *YYCURSOR);
+ yyaccept = 8;
YYMARKER = ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy471;
-yy471:
- YYDEBUG(471, *YYCURSOR);
+ goto yy362;
+yy362:
+ YYDEBUG(362, *YYCURSOR);
if(yych <= '^'){
- if(yych == '/') goto yy468;
- goto yy448;
+ if(yych == '/') goto yy359;
+ goto yy339;
} else {
- if(yych <= '_') goto yy468;
- if(yych <= '`') goto yy448;
- if(yych <= 'z') goto yy470;
- goto yy448;
+ if(yych <= '_') goto yy359;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy361;
+ goto yy339;
}
-yy472:
- YYDEBUG(472, *YYCURSOR);
- yyaccept = 7;
+yy363:
+ YYDEBUG(363, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy448;
- goto yy453;
+ if(yych <= '(') goto yy339;
+ goto yy344;
} else {
- if(yych == '/') goto yy468;
- goto yy448;
+ if(yych == '/') goto yy359;
+ goto yy339;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy464;
- if(yych <= '^') goto yy448;
- goto yy468;
+ if(yych <= 'Z') goto yy355;
+ if(yych <= '^') goto yy339;
+ goto yy359;
} else {
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy473;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy364;
}
}
-yy473:
- YYDEBUG(473, *YYCURSOR);
- yyaccept = 7;
+yy364:
+ YYDEBUG(364, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy448;
- goto yy453;
+ if(yych <= '(') goto yy339;
+ goto yy344;
} else {
- if(yych == '/') goto yy468;
- goto yy448;
+ if(yych == '/') goto yy359;
+ goto yy339;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy465;
- if(yych <= '^') goto yy448;
- goto yy468;
+ if(yych <= 'Z') goto yy356;
+ if(yych <= '^') goto yy339;
+ goto yy359;
} else {
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy474;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy365;
}
}
-yy474:
- YYDEBUG(474, *YYCURSOR);
- yyaccept = 7;
+yy365:
+ YYDEBUG(365, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == ')') goto yy453;
- if(yych <= '.') goto yy448;
- goto yy468;
+ if(yych == ')') goto yy344;
+ if(yych <= '.') goto yy339;
+ goto yy359;
} else {
if(yych <= '_'){
- if(yych <= '^') goto yy448;
- goto yy468;
+ if(yych <= '^') goto yy339;
+ goto yy359;
} else {
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy475;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy366;
}
}
-yy475:
- YYDEBUG(475, *YYCURSOR);
+yy366:
+ YYDEBUG(366, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy476;
-yy476:
- YYDEBUG(476, *YYCURSOR);
+ goto yy367;
+yy367:
+ YYDEBUG(367, *YYCURSOR);
if(yych <= '^'){
- if(yych == '/') goto yy468;
+ if(yych == '/') goto yy359;
goto yy53;
} else {
- if(yych <= '_') goto yy468;
+ if(yych <= '_') goto yy359;
if(yych <= '`') goto yy53;
- if(yych <= 'z') goto yy475;
+ if(yych <= 'z') goto yy366;
goto yy53;
}
-yy477:
- YYDEBUG(477, *YYCURSOR);
+yy368:
+ YYDEBUG(368, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy448;
- if(yych <= '9') goto yy479;
- if(yych <= ':') goto yy480;
- goto yy448;
-yy478:
- YYDEBUG(478, *YYCURSOR);
+ if(yych <= '/') goto yy339;
+ if(yych <= '9') goto yy370;
+ if(yych <= ':') goto yy371;
+ goto yy339;
+yy369:
+ YYDEBUG(369, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '5'){
- if(yych <= '/') goto yy448;
- if(yych >= '4') goto yy481;
- goto yy479;
+ if(yych <= '/') goto yy339;
+ if(yych >= '4') goto yy372;
+ goto yy370;
} else {
- if(yych <= '9') goto yy453;
- if(yych <= ':') goto yy480;
- goto yy448;
+ if(yych <= '9') goto yy344;
+ if(yych <= ':') goto yy371;
+ goto yy339;
}
-yy479:
- YYDEBUG(479, *YYCURSOR);
+yy370:
+ YYDEBUG(370, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy448;
- if(yych <= '5') goto yy481;
- if(yych <= '9') goto yy453;
- if(yych >= ';') goto yy448;
- goto yy480;
-yy480:
- YYDEBUG(480, *YYCURSOR);
+ if(yych <= '/') goto yy339;
+ if(yych <= '5') goto yy372;
+ if(yych <= '9') goto yy344;
+ if(yych >= ';') goto yy339;
+ goto yy371;
+yy371:
+ YYDEBUG(371, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy448;
- if(yych <= '5') goto yy481;
- if(yych <= '9') goto yy453;
- goto yy448;
-yy481:
- YYDEBUG(481, *YYCURSOR);
+ if(yych <= '/') goto yy339;
+ if(yych <= '5') goto yy372;
+ if(yych <= '9') goto yy344;
+ goto yy339;
+yy372:
+ YYDEBUG(372, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy448;
- if(yych <= '9') goto yy453;
- goto yy448;
-yy482:
- YYDEBUG(482, *YYCURSOR);
- yyaccept = 6;
+ if(yych <= '/') goto yy339;
+ if(yych <= '9') goto yy344;
+ goto yy339;
+yy373:
+ YYDEBUG(373, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy337;
+ goto yy315;
} else {
- if(yych <= '9') goto yy488;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '0') goto yy405;
+ if(yych <= '9') goto yy406;
+ if(yych <= ':') goto yy337;
+ goto yy315;
}
-yy483:
- YYDEBUG(483, *YYCURSOR);
- yyaccept = 6;
+yy374:
+ YYDEBUG(374, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '3') goto yy488;
- if(yych <= '9') goto yy485;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '2') goto yy406;
+ if(yych <= '9') goto yy405;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy484:
- YYDEBUG(484, *YYCURSOR);
- yyaccept = 6;
+yy375:
+ YYDEBUG(375, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '9') goto yy485;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '3') goto yy405;
+ if(yych <= '9') goto yy377;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy485:
- YYDEBUG(485, *YYCURSOR);
+yy376:
+ YYDEBUG(376, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy378;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy377;
+ if(yych <= ':') goto yy378;
+ goto yy315;
+ }
+yy377:
+ YYDEBUG(377, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy426;
- if(yych >= ':') goto yy426;
- goto yy486;
-yy486:
- YYDEBUG(486, *YYCURSOR);
+ if(yych <= '/') goto yy315;
+ if(yych <= '9') goto yy403;
+ goto yy315;
+yy378:
+ YYDEBUG(378, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy426;
- if(yych >= ':') goto yy426;
- goto yy487;
-yy487:
- YYDEBUG(487, *YYCURSOR);
+ if(yych <= '/') goto yy53;
+ if(yych <= '5') goto yy379;
+ if(yych <= '9') goto yy380;
+ goto yy53;
+yy379:
+ YYDEBUG(379, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy381;
+ goto yy339;
+ } else {
+ if(yych <= '9') goto yy396;
+ if(yych <= ':') goto yy381;
+ goto yy339;
+ }
+yy380:
+ YYDEBUG(380, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy381;
+ if(yych != ':') goto yy339;
+ goto yy381;
+yy381:
+ YYDEBUG(381, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy426;
-yy488:
- YYDEBUG(488, *YYCURSOR);
- yyaccept = 6;
+ if(yych <= '/') goto yy53;
+ if(yych <= '5') goto yy382;
+ if(yych <= '6') goto yy383;
+ if(yych <= '9') goto yy344;
+ goto yy53;
+yy382:
+ YYDEBUG(382, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy339;
+ if(yych <= '9') goto yy384;
+ goto yy339;
+yy383:
+ YYDEBUG(383, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '0') goto yy339;
+ goto yy384;
+yy384:
+ YYDEBUG(384, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '*'){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy386;
+ goto yy339;
+ } else {
+ if(yych <= ' ') goto yy386;
+ if(yych == '(') goto yy386;
+ goto yy339;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych == ',') goto yy339;
+ if(yych <= '-') goto yy386;
+ goto yy339;
+ } else {
+ if(yych <= 'Z') goto yy386;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy386;
+ goto yy339;
+ }
+ }
+yy385:
+ YYDEBUG(385, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
+ yych = *YYCURSOR;
+ goto yy386;
+yy386:
+ YYDEBUG(386, *YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= '\''){
+ if(yych <= 0x09){
+ if(yych <= 0x08) goto yy53;
+ goto yy385;
+ } else {
+ if(yych == ' ') goto yy385;
+ goto yy53;
+ }
+ } else {
+ if(yych <= '*'){
+ if(yych <= '(') goto yy349;
+ goto yy53;
+ } else {
+ if(yych == ',') goto yy53;
+ goto yy348;
+ }
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= 'A'){
+ if(yych <= '@') goto yy53;
+ goto yy387;
+ } else {
+ if(yych != 'P') goto yy350;
+ goto yy387;
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '`') goto yy53;
+ if(yych <= 'a') goto yy388;
+ goto yy351;
+ } else {
+ if(yych <= 'p') goto yy388;
+ if(yych <= 'z') goto yy351;
+ goto yy53;
+ }
+ }
+ }
+yy387:
+ YYDEBUG(387, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '-'){
+ if(yych == ')') goto yy344;
+ goto yy339;
+ } else {
+ if(yych <= '.') goto yy389;
+ if(yych <= '@') goto yy339;
+ goto yy352;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'M') goto yy390;
+ if(yych <= 'Z') goto yy352;
+ goto yy339;
+ } else {
+ if(yych == 'm') goto yy395;
+ if(yych <= 'z') goto yy357;
+ goto yy339;
+ }
+ }
+yy388:
+ YYDEBUG(388, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '-'){
+ if(yych == ')') goto yy344;
+ goto yy339;
+ } else {
+ if(yych <= '.') goto yy389;
+ if(yych <= '@') goto yy339;
+ goto yy352;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'M') goto yy390;
+ if(yych <= 'Z') goto yy352;
+ goto yy339;
+ } else {
+ if(yych == 'm') goto yy390;
+ if(yych <= 'z') goto yy352;
+ goto yy339;
+ }
+ }
+yy389:
+ YYDEBUG(389, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy394;
+ if(yych == 'm') goto yy394;
+ goto yy53;
+yy390:
+ YYDEBUG(390, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ')'){
+ if(yych <= 0x09){
+ if(yych <= 0x00) goto yy392;
+ if(yych <= 0x08) goto yy339;
+ goto yy392;
+ } else {
+ if(yych == ' ') goto yy392;
+ if(yych <= '(') goto yy339;
+ goto yy344;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych != '.') goto yy339;
+ goto yy391;
+ } else {
+ if(yych <= 'Z') goto yy353;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy353;
+ goto yy339;
+ }
+ }
+yy391:
+ YYDEBUG(391, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 0x09){
+ if(yych <= 0x00) goto yy392;
+ if(yych <= 0x08) goto yy53;
+ goto yy392;
+ } else {
+ if(yych != ' ') goto yy53;
+ goto yy392;
+ }
+yy392:
+ YYDEBUG(392, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy393;
+yy393:
+ YYDEBUG(393, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
+ 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 == ':' || *ptr == '.') {
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+
+ if (*ptr == '.') {
+ s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
+ }
+ }
+
+ s->time->h += timelib_meridian((char **) &ptr, s->time->h);
+ TIMELIB_DEINIT;
+ return TIMELIB_SHORTDATE_WITH_TIME;
+ }
+yy394:
+ YYDEBUG(394, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 0x1F){
+ if(yych <= 0x00) goto yy392;
+ if(yych == 0x09) goto yy392;
+ goto yy53;
+ } else {
+ if(yych <= ' ') goto yy392;
+ if(yych == '.') goto yy391;
+ goto yy53;
+ }
+yy395:
+ YYDEBUG(395, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= 0x1F){
+ if(yych <= 0x00) goto yy392;
+ if(yych == 0x09) goto yy392;
+ goto yy339;
+ } else {
+ if(yych <= ' ') goto yy392;
+ if(yych == ')') goto yy344;
+ goto yy339;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '.') goto yy391;
+ if(yych <= '/') goto yy359;
+ if(yych <= '@') goto yy339;
+ goto yy353;
+ } else {
+ if(yych <= '_'){
+ if(yych <= '^') goto yy339;
+ goto yy359;
+ } else {
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy358;
+ goto yy339;
+ }
+ }
+ }
+yy396:
+ YYDEBUG(396, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ':'){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy397;
+ if(yych <= 0x1F) goto yy339;
+ goto yy397;
+ } else {
+ if(yych == '.') goto yy381;
+ if(yych <= '9') goto yy339;
+ goto yy381;
+ }
+ } else {
+ if(yych <= 'P'){
+ if(yych == 'A') goto yy399;
+ if(yych <= 'O') goto yy339;
+ goto yy399;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy339;
+ goto yy399;
+ } else {
+ if(yych == 'p') goto yy399;
+ goto yy339;
+ }
+ }
+ }
+yy397:
+ YYDEBUG(397, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
+ yych = *YYCURSOR;
+ goto yy398;
+yy398:
+ YYDEBUG(398, *YYCURSOR);
+ if(yych <= 'A'){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy397;
+ goto yy53;
+ } else {
+ if(yych <= ' ') goto yy397;
+ if(yych <= '@') goto yy53;
+ goto yy399;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych != 'P') goto yy53;
+ goto yy399;
+ } else {
+ if(yych <= 'a') goto yy399;
+ if(yych != 'p') goto yy53;
+ goto yy399;
+ }
+ }
+yy399:
+ YYDEBUG(399, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych != '.') goto yy53;
+ goto yy400;
+ } else {
+ if(yych <= 'M') goto yy401;
+ if(yych == 'm') goto yy401;
+ goto yy53;
+ }
+yy400:
+ YYDEBUG(400, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy401;
+ if(yych != 'm') goto yy53;
+ goto yy401;
+yy401:
+ YYDEBUG(401, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 0x1F){
+ if(yych <= 0x00) goto yy392;
+ if(yych == 0x09) goto yy392;
+ goto yy53;
+ } else {
+ if(yych <= ' ') goto yy392;
+ if(yych != '.') goto yy53;
+ goto yy402;
+ }
+yy402:
+ YYDEBUG(402, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 0x09){
+ if(yych <= 0x00) goto yy392;
+ if(yych <= 0x08) goto yy53;
+ goto yy392;
+ } else {
+ if(yych == ' ') goto yy392;
+ goto yy53;
+ }
+yy403:
+ YYDEBUG(403, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy315;
+ if(yych >= ':') goto yy315;
+ goto yy404;
+yy404:
+ YYDEBUG(404, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy315;
+yy405:
+ YYDEBUG(405, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy337;
+ goto yy315;
} else {
- if(yych <= '9') goto yy486;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '9') goto yy403;
+ if(yych <= ':') goto yy337;
+ goto yy315;
}
-yy489:
- YYDEBUG(489, *YYCURSOR);
+yy406:
+ YYDEBUG(406, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy378;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy403;
+ if(yych <= ':') goto yy378;
+ goto yy315;
+ }
+yy407:
+ YYDEBUG(407, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy426;
- if(yych >= ':') goto yy426;
- goto yy490;
-yy490:
- YYDEBUG(490, *YYCURSOR);
+ if(yych <= '/') goto yy315;
+ if(yych >= ':') goto yy315;
+ goto yy408;
+yy408:
+ YYDEBUG(408, *YYCURSOR);
++YYCURSOR;
- if((yych = *YYCURSOR) <= '/') goto yy491;
- if(yych <= '9') goto yy487;
- goto yy491;
-yy491:
- YYDEBUG(491, *YYCURSOR);
+ if((yych = *YYCURSOR) <= '/') goto yy409;
+ if(yych <= '9') goto yy404;
+ goto yy409;
+yy409:
+ YYDEBUG(409, *YYCURSOR);
{
DEBUG_OUTPUT("datenoday");
@@ -8148,390 +6807,1264 @@ yy491:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
-yy492:
- YYDEBUG(492, *YYCURSOR);
- yyaccept = 6;
+yy410:
+ YYDEBUG(410, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy337;
+ goto yy315;
} else {
- if(yych <= '9') goto yy490;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '9') goto yy408;
+ if(yych <= ':') goto yy337;
+ goto yy315;
}
-yy493:
- YYDEBUG(493, *YYCURSOR);
- yyaccept = 6;
+yy411:
+ YYDEBUG(411, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= ':'){
+ if(yych <= '/'){
+ if(yych == '.') goto yy378;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy408;
+ if(yych <= ':') goto yy378;
+ goto yy315;
+ }
+yy412:
+ YYDEBUG(412, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
if(yych <= '/'){
- if(yych != '.') goto yy441;
- goto yy494;
+ if(yych == '.') goto yy447;
+ goto yy332;
} else {
- if(yych <= '1') goto yy495;
- if(yych <= '2') goto yy496;
- if(yych <= '9') goto yy497;
- goto yy446;
+ if(yych <= '0') goto yy448;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
}
} else {
if(yych <= 'q'){
- if(yych == 'n') goto yy437;
- goto yy441;
+ if(yych <= ':') goto yy337;
+ if(yych == 'n') goto yy328;
+ goto yy332;
} else {
- if(yych <= 'r') goto yy438;
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy494:
- YYDEBUG(494, *YYCURSOR);
- yyaccept = 6;
+yy413:
+ YYDEBUG(413, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '2'){
- if(yych <= '/') goto yy441;
- if(yych <= '1') goto yy500;
- goto yy501;
+ if(yych <= '9'){
+ if(yych <= '/'){
+ if(yych != '.') goto yy332;
+ goto yy414;
+ } else {
+ if(yych <= '0') goto yy415;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
+ }
} else {
- if(yych <= '5') goto yy502;
- if(yych <= '9') goto yy503;
- goto yy441;
+ if(yych <= 'q'){
+ if(yych <= ':') goto yy378;
+ if(yych == 'n') goto yy328;
+ goto yy332;
+ } else {
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
+ }
}
-yy495:
- YYDEBUG(495, *YYCURSOR);
- yyaccept = 6;
+yy414:
+ YYDEBUG(414, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '1'){
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy422;
+ goto yy423;
+ } else {
+ if(yych <= '2') goto yy424;
+ if(yych <= '5') goto yy425;
+ if(yych <= '9') goto yy426;
+ goto yy332;
+ }
+yy415:
+ YYDEBUG(415, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '9') goto yy499;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '0') goto yy420;
+ if(yych <= '9') goto yy421;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy496:
- YYDEBUG(496, *YYCURSOR);
- yyaccept = 6;
+yy416:
+ YYDEBUG(416, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '3') goto yy499;
- if(yych <= '9') goto yy498;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '2') goto yy421;
+ if(yych <= '9') goto yy420;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy497:
- YYDEBUG(497, *YYCURSOR);
- yyaccept = 6;
+yy417:
+ YYDEBUG(417, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '9') goto yy498;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '3') goto yy420;
+ if(yych <= '9') goto yy419;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy498:
- YYDEBUG(498, *YYCURSOR);
+yy418:
+ YYDEBUG(418, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy378;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy419;
+ if(yych <= ':') goto yy378;
+ goto yy315;
+ }
+yy419:
+ YYDEBUG(419, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy491;
- if(yych <= '9') goto yy486;
- goto yy491;
-yy499:
- YYDEBUG(499, *YYCURSOR);
- yyaccept = 8;
+ if(yych <= '/') goto yy409;
+ if(yych <= '9') goto yy403;
+ goto yy409;
+yy420:
+ YYDEBUG(420, *YYCURSOR);
+ yyaccept = 9;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy491;
+ if(yych == '.') goto yy337;
+ goto yy409;
} else {
- if(yych <= '9') goto yy486;
- if(yych <= ':') goto yy446;
- goto yy491;
+ if(yych <= '9') goto yy403;
+ if(yych <= ':') goto yy337;
+ goto yy409;
}
-yy500:
- YYDEBUG(500, *YYCURSOR);
- yyaccept = 6;
+yy421:
+ YYDEBUG(421, *YYCURSOR);
+ yyaccept = 9;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy504;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy409;
} else {
- if(yych <= '9') goto yy509;
- if(yych <= ':') goto yy504;
- goto yy426;
+ if(yych <= '9') goto yy403;
+ if(yych <= ':') goto yy378;
+ goto yy409;
}
-yy501:
- YYDEBUG(501, *YYCURSOR);
- yyaccept = 6;
+yy422:
+ YYDEBUG(422, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy504;
- goto yy426;
+ if(yych == '.') goto yy442;
+ goto yy315;
} else {
- if(yych <= '3') goto yy509;
- if(yych <= '9') goto yy508;
- if(yych <= ':') goto yy504;
- goto yy426;
+ if(yych <= '0') goto yy441;
+ if(yych <= '9') goto yy446;
+ if(yych <= ':') goto yy442;
+ goto yy315;
}
-yy502:
- YYDEBUG(502, *YYCURSOR);
- yyaccept = 6;
+yy423:
+ YYDEBUG(423, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy504;
- goto yy426;
+ if(yych == '.') goto yy427;
+ goto yy315;
} else {
- if(yych <= '9') goto yy508;
- if(yych <= ':') goto yy504;
- goto yy426;
+ if(yych <= '2') goto yy446;
+ if(yych <= '9') goto yy441;
+ if(yych <= ':') goto yy427;
+ goto yy315;
}
-yy503:
- YYDEBUG(503, *YYCURSOR);
- yyaccept = 6;
+yy424:
+ YYDEBUG(424, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych != '.') goto yy426;
- goto yy504;
+ if(yych == '.') goto yy427;
+ goto yy315;
} else {
- if(yych <= '9') goto yy485;
- if(yych >= ';') goto yy426;
- goto yy504;
+ if(yych <= '3') goto yy441;
+ if(yych <= '9') goto yy440;
+ if(yych <= ':') goto yy427;
+ goto yy315;
}
-yy504:
- YYDEBUG(504, *YYCURSOR);
+yy425:
+ YYDEBUG(425, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy427;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy440;
+ if(yych <= ':') goto yy427;
+ goto yy315;
+ }
+yy426:
+ YYDEBUG(426, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych != '.') goto yy315;
+ goto yy427;
+ } else {
+ if(yych <= '9') goto yy377;
+ if(yych >= ';') goto yy315;
+ goto yy427;
+ }
+yy427:
+ YYDEBUG(427, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy505;
- if(yych <= '6') goto yy506;
- if(yych <= '9') goto yy449;
+ if(yych <= '5') goto yy428;
+ if(yych <= '6') goto yy429;
+ if(yych <= '9') goto yy380;
goto yy53;
-yy505:
- YYDEBUG(505, *YYCURSOR);
+yy428:
+ YYDEBUG(428, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy381;
+ goto yy339;
+ } else {
+ if(yych <= '9') goto yy430;
+ if(yych <= ':') goto yy381;
+ goto yy339;
+ }
+yy429:
+ YYDEBUG(429, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy381;
+ goto yy339;
+ } else {
+ if(yych <= '0') goto yy384;
+ if(yych == ':') goto yy381;
+ goto yy339;
+ }
+yy430:
+ YYDEBUG(430, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ','){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy432;
+ if(yych <= 0x1F) goto yy339;
+ goto yy432;
+ } else {
+ if(yych <= '('){
+ if(yych <= '\'') goto yy339;
+ goto yy432;
+ } else {
+ if(yych == '+') goto yy432;
+ goto yy339;
+ }
+ }
+ } else {
+ if(yych <= ':'){
+ if(yych <= '-') goto yy432;
+ if(yych <= '.') goto yy381;
+ if(yych <= '9') goto yy339;
+ goto yy381;
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy339;
+ goto yy432;
+ } else {
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy432;
+ goto yy339;
+ }
+ }
+ }
+yy431:
+ YYDEBUG(431, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
+ yych = *YYCURSOR;
+ goto yy432;
+yy432:
+ YYDEBUG(432, *YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= '\''){
+ if(yych <= 0x09){
+ if(yych <= 0x08) goto yy53;
+ goto yy431;
+ } else {
+ if(yych == ' ') goto yy431;
+ goto yy53;
+ }
+ } else {
+ if(yych <= '*'){
+ if(yych <= '(') goto yy349;
+ goto yy53;
+ } else {
+ if(yych == ',') goto yy53;
+ goto yy348;
+ }
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= 'A'){
+ if(yych <= '@') goto yy53;
+ goto yy433;
+ } else {
+ if(yych != 'P') goto yy350;
+ goto yy433;
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '`') goto yy53;
+ if(yych <= 'a') goto yy434;
+ goto yy351;
+ } else {
+ if(yych <= 'p') goto yy434;
+ if(yych <= 'z') goto yy351;
+ goto yy53;
+ }
+ }
+ }
+yy433:
+ YYDEBUG(433, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '-'){
+ if(yych == ')') goto yy344;
+ goto yy339;
+ } else {
+ if(yych <= '.') goto yy436;
+ if(yych <= '@') goto yy339;
+ goto yy352;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'M') goto yy435;
+ if(yych <= 'Z') goto yy352;
+ goto yy339;
+ } else {
+ if(yych == 'm') goto yy439;
+ if(yych <= 'z') goto yy357;
+ goto yy339;
+ }
+ }
+yy434:
+ YYDEBUG(434, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '-'){
+ if(yych == ')') goto yy344;
+ goto yy339;
+ } else {
+ if(yych <= '.') goto yy436;
+ if(yych <= '@') goto yy339;
+ goto yy352;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'M') goto yy435;
+ if(yych <= 'Z') goto yy352;
+ goto yy339;
+ } else {
+ if(yych == 'm') goto yy435;
+ if(yych <= 'z') goto yy352;
+ goto yy339;
+ }
+ }
+yy435:
+ YYDEBUG(435, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ')'){
+ if(yych <= 0x09){
+ if(yych <= 0x00) goto yy392;
+ if(yych <= 0x08) goto yy339;
+ goto yy392;
+ } else {
+ if(yych == ' ') goto yy392;
+ if(yych <= '(') goto yy339;
+ goto yy344;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych == '.') goto yy438;
+ goto yy339;
+ } else {
+ if(yych <= 'Z') goto yy353;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy353;
+ goto yy339;
+ }
+ }
+yy436:
+ YYDEBUG(436, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy437;
+ if(yych != 'm') goto yy53;
+ goto yy437;
+yy437:
+ YYDEBUG(437, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 0x1F){
+ if(yych <= 0x00) goto yy392;
+ if(yych == 0x09) goto yy392;
+ goto yy53;
+ } else {
+ if(yych <= ' ') goto yy392;
+ if(yych != '.') goto yy53;
+ goto yy438;
+ }
+yy438:
+ YYDEBUG(438, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 0x09){
+ if(yych <= 0x00) goto yy392;
+ if(yych <= 0x08) goto yy53;
+ goto yy392;
+ } else {
+ if(yych == ' ') goto yy392;
+ goto yy53;
+ }
+yy439:
+ YYDEBUG(439, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= 0x1F){
+ if(yych <= 0x00) goto yy392;
+ if(yych == 0x09) goto yy392;
+ goto yy339;
+ } else {
+ if(yych <= ' ') goto yy392;
+ if(yych == ')') goto yy344;
+ goto yy339;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '.') goto yy438;
+ if(yych <= '/') goto yy359;
+ if(yych <= '@') goto yy339;
+ goto yy353;
+ } else {
+ if(yych <= '_'){
+ if(yych <= '^') goto yy339;
+ goto yy359;
+ } else {
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy358;
+ goto yy339;
+ }
+ }
+ }
+yy440:
+ YYDEBUG(440, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ':'){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy397;
+ if(yych <= 0x1F) goto yy315;
+ goto yy397;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy315;
+ goto yy381;
+ } else {
+ if(yych <= '/') goto yy315;
+ if(yych <= '9') goto yy403;
+ goto yy381;
+ }
+ }
+ } else {
+ if(yych <= 'P'){
+ if(yych == 'A') goto yy399;
+ if(yych <= 'O') goto yy315;
+ goto yy399;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy315;
+ goto yy399;
+ } else {
+ if(yych == 'p') goto yy399;
+ goto yy315;
+ }
+ }
+ }
+yy441:
+ YYDEBUG(441, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ':'){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy397;
+ if(yych <= 0x1F) goto yy315;
+ goto yy397;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy315;
+ goto yy442;
+ } else {
+ if(yych <= '/') goto yy315;
+ if(yych <= '9') goto yy403;
+ goto yy442;
+ }
+ }
+ } else {
+ if(yych <= 'P'){
+ if(yych == 'A') goto yy399;
+ if(yych <= 'O') goto yy315;
+ goto yy399;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy315;
+ goto yy399;
+ } else {
+ if(yych == 'p') goto yy399;
+ goto yy315;
+ }
+ }
+ }
+yy442:
+ YYDEBUG(442, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy53;
+ if(yych <= '5') goto yy443;
+ if(yych <= '6') goto yy444;
+ if(yych <= '9') goto yy340;
+ goto yy53;
+yy443:
+ YYDEBUG(443, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy341;
+ goto yy339;
+ } else {
+ if(yych <= '9') goto yy445;
+ if(yych <= ':') goto yy341;
+ goto yy339;
+ }
+yy444:
+ YYDEBUG(444, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy341;
+ goto yy339;
+ } else {
+ if(yych <= '0') goto yy384;
+ if(yych == ':') goto yy341;
+ goto yy339;
+ }
+yy445:
+ YYDEBUG(445, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ','){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy386;
+ if(yych <= 0x1F) goto yy339;
+ goto yy386;
+ } else {
+ if(yych <= '('){
+ if(yych <= '\'') goto yy339;
+ goto yy386;
+ } else {
+ if(yych == '+') goto yy386;
+ goto yy339;
+ }
+ }
+ } else {
+ if(yych <= ':'){
+ if(yych <= '-') goto yy386;
+ if(yych <= '.') goto yy341;
+ if(yych <= '9') goto yy339;
+ goto yy341;
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy339;
+ goto yy386;
+ } else {
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy386;
+ goto yy339;
+ }
+ }
+ }
+yy446:
+ YYDEBUG(446, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ':'){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy397;
+ if(yych <= 0x1F) goto yy315;
+ goto yy397;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy315;
+ goto yy427;
+ } else {
+ if(yych <= '/') goto yy315;
+ if(yych <= '9') goto yy403;
+ goto yy427;
+ }
+ }
+ } else {
+ if(yych <= 'P'){
+ if(yych == 'A') goto yy399;
+ if(yych <= 'O') goto yy315;
+ goto yy399;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy315;
+ goto yy399;
+ } else {
+ if(yych == 'p') goto yy399;
+ goto yy315;
+ }
+ }
+ }
+yy447:
+ YYDEBUG(447, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '1'){
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy449;
+ goto yy450;
+ } else {
+ if(yych <= '2') goto yy451;
+ if(yych <= '5') goto yy452;
+ if(yych <= '9') goto yy453;
+ goto yy332;
+ }
+yy448:
+ YYDEBUG(448, *YYCURSOR);
yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy450;
- goto yy448;
+ if(yych == '.') goto yy337;
+ goto yy315;
} else {
- if(yych <= '9') goto yy507;
- if(yych <= ':') goto yy450;
- goto yy448;
+ if(yych <= '0') goto yy420;
+ if(yych <= '9') goto yy421;
+ if(yych <= ':') goto yy337;
+ goto yy315;
}
-yy506:
- YYDEBUG(506, *YYCURSOR);
+yy449:
+ YYDEBUG(449, *YYCURSOR);
yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy450;
- goto yy448;
+ if(yych == '.') goto yy466;
+ goto yy315;
} else {
- if(yych <= '0') goto yy454;
- if(yych == ':') goto yy450;
- goto yy448;
+ if(yych <= '0') goto yy465;
+ if(yych <= '9') goto yy470;
+ if(yych <= ':') goto yy466;
+ goto yy315;
}
-yy507:
- YYDEBUG(507, *YYCURSOR);
+yy450:
+ YYDEBUG(450, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy454;
+ goto yy315;
+ } else {
+ if(yych <= '2') goto yy470;
+ if(yych <= '9') goto yy465;
+ if(yych <= ':') goto yy454;
+ goto yy315;
+ }
+yy451:
+ YYDEBUG(451, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy454;
+ goto yy315;
+ } else {
+ if(yych <= '3') goto yy465;
+ if(yych <= '9') goto yy464;
+ if(yych <= ':') goto yy454;
+ goto yy315;
+ }
+yy452:
+ YYDEBUG(452, *YYCURSOR);
yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy454;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy464;
+ if(yych <= ':') goto yy454;
+ goto yy315;
+ }
+yy453:
+ YYDEBUG(453, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych != '.') goto yy315;
+ goto yy454;
+ } else {
+ if(yych <= '9') goto yy377;
+ if(yych >= ';') goto yy315;
+ goto yy454;
+ }
+yy454:
+ YYDEBUG(454, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy53;
+ if(yych <= '5') goto yy455;
+ if(yych <= '6') goto yy456;
+ if(yych <= '9') goto yy380;
+ goto yy53;
+yy455:
+ YYDEBUG(455, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy381;
+ goto yy339;
+ } else {
+ if(yych <= '9') goto yy457;
+ if(yych <= ':') goto yy381;
+ goto yy339;
+ }
+yy456:
+ YYDEBUG(456, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy381;
+ goto yy339;
+ } else {
+ if(yych <= '0') goto yy345;
+ if(yych == ':') goto yy381;
+ goto yy339;
+ }
+yy457:
+ YYDEBUG(457, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= ' '){
- if(yych == 0x09) goto yy455;
- if(yych <= 0x1F) goto yy448;
- goto yy455;
+ if(yych == 0x09) goto yy459;
+ if(yych <= 0x1F) goto yy339;
+ goto yy459;
} else {
if(yych <= '('){
- if(yych <= '\'') goto yy448;
- goto yy458;
+ if(yych <= '\'') goto yy339;
+ goto yy459;
} else {
- if(yych == '+') goto yy457;
- goto yy448;
+ if(yych == '+') goto yy459;
+ goto yy339;
}
}
} else {
if(yych <= ':'){
- if(yych <= '-') goto yy457;
- if(yych <= '.') goto yy450;
- if(yych <= '9') goto yy448;
- goto yy450;
+ if(yych <= '-') goto yy459;
+ if(yych <= '.') goto yy381;
+ if(yych <= '9') goto yy339;
+ goto yy381;
} else {
if(yych <= 'Z'){
- if(yych <= '@') goto yy448;
+ if(yych <= '@') goto yy339;
goto yy459;
} else {
- if(yych <= '`') goto yy448;
- if(yych <= 'z') goto yy460;
- goto yy448;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy459;
+ goto yy339;
}
}
}
-yy508:
- YYDEBUG(508, *YYCURSOR);
- yyaccept = 6;
+yy458:
+ YYDEBUG(458, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
+ yych = *YYCURSOR;
+ goto yy459;
+yy459:
+ YYDEBUG(459, *YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= '\''){
+ if(yych <= 0x09){
+ if(yych <= 0x08) goto yy53;
+ goto yy458;
+ } else {
+ if(yych == ' ') goto yy458;
+ goto yy53;
+ }
+ } else {
+ if(yych <= '*'){
+ if(yych <= '(') goto yy349;
+ goto yy53;
+ } else {
+ if(yych == ',') goto yy53;
+ goto yy348;
+ }
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= 'A'){
+ if(yych <= '@') goto yy53;
+ goto yy460;
+ } else {
+ if(yych != 'P') goto yy350;
+ goto yy460;
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '`') goto yy53;
+ if(yych <= 'a') goto yy461;
+ goto yy351;
+ } else {
+ if(yych <= 'p') goto yy461;
+ if(yych <= 'z') goto yy351;
+ goto yy53;
+ }
+ }
+ }
+yy460:
+ YYDEBUG(460, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '-'){
+ if(yych == ')') goto yy344;
+ goto yy339;
+ } else {
+ if(yych <= '.') goto yy400;
+ if(yych <= '@') goto yy339;
+ goto yy352;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'M') goto yy462;
+ if(yych <= 'Z') goto yy352;
+ goto yy339;
+ } else {
+ if(yych == 'm') goto yy463;
+ if(yych <= 'z') goto yy357;
+ goto yy339;
+ }
+ }
+yy461:
+ YYDEBUG(461, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '-'){
+ if(yych == ')') goto yy344;
+ goto yy339;
+ } else {
+ if(yych <= '.') goto yy400;
+ if(yych <= '@') goto yy339;
+ goto yy352;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'M') goto yy462;
+ if(yych <= 'Z') goto yy352;
+ goto yy339;
+ } else {
+ if(yych == 'm') goto yy462;
+ if(yych <= 'z') goto yy352;
+ goto yy339;
+ }
+ }
+yy462:
+ YYDEBUG(462, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ')'){
+ if(yych <= 0x09){
+ if(yych <= 0x00) goto yy392;
+ if(yych <= 0x08) goto yy339;
+ goto yy392;
+ } else {
+ if(yych == ' ') goto yy392;
+ if(yych <= '(') goto yy339;
+ goto yy344;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych == '.') goto yy402;
+ goto yy339;
+ } else {
+ if(yych <= 'Z') goto yy353;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy353;
+ goto yy339;
+ }
+ }
+yy463:
+ YYDEBUG(463, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= 0x1F){
+ if(yych <= 0x00) goto yy392;
+ if(yych == 0x09) goto yy392;
+ goto yy339;
+ } else {
+ if(yych <= ' ') goto yy392;
+ if(yych == ')') goto yy344;
+ goto yy339;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '.') goto yy402;
+ if(yych <= '/') goto yy359;
+ if(yych <= '@') goto yy339;
+ goto yy353;
+ } else {
+ if(yych <= '_'){
+ if(yych <= '^') goto yy339;
+ goto yy359;
+ } else {
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy358;
+ goto yy339;
+ }
+ }
+ }
+yy464:
+ YYDEBUG(464, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy450;
- goto yy426;
+ if(yych == '.') goto yy341;
+ goto yy315;
} else {
- if(yych <= '9') goto yy486;
- if(yych <= ':') goto yy450;
- goto yy426;
+ if(yych <= '9') goto yy403;
+ if(yych <= ':') goto yy341;
+ goto yy315;
}
-yy509:
- YYDEBUG(509, *YYCURSOR);
- yyaccept = 6;
+yy465:
+ YYDEBUG(465, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy504;
- goto yy426;
+ if(yych != '.') goto yy315;
+ goto yy466;
} else {
- if(yych <= '9') goto yy486;
- if(yych <= ':') goto yy504;
- goto yy426;
+ if(yych <= '9') goto yy403;
+ if(yych >= ';') goto yy315;
+ goto yy466;
}
-yy510:
- YYDEBUG(510, *YYCURSOR);
- yyaccept = 6;
+yy466:
+ YYDEBUG(466, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy53;
+ if(yych <= '5') goto yy467;
+ if(yych <= '6') goto yy468;
+ if(yych <= '9') goto yy340;
+ goto yy53;
+yy467:
+ YYDEBUG(467, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= ':'){
+ if(yych <= '/'){
+ if(yych == '.') goto yy341;
+ goto yy339;
+ } else {
+ if(yych <= '9') goto yy469;
+ if(yych <= ':') goto yy341;
+ goto yy339;
+ }
+yy468:
+ YYDEBUG(468, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy341;
+ goto yy339;
+ } else {
+ if(yych <= '0') goto yy345;
+ if(yych == ':') goto yy341;
+ goto yy339;
+ }
+yy469:
+ YYDEBUG(469, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ','){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy346;
+ if(yych <= 0x1F) goto yy339;
+ goto yy346;
+ } else {
+ if(yych <= '('){
+ if(yych <= '\'') goto yy339;
+ goto yy349;
+ } else {
+ if(yych == '+') goto yy348;
+ goto yy339;
+ }
+ }
+ } else {
+ if(yych <= ':'){
+ if(yych <= '-') goto yy348;
+ if(yych <= '.') goto yy341;
+ if(yych <= '9') goto yy339;
+ goto yy341;
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy339;
+ goto yy350;
+ } else {
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy351;
+ goto yy339;
+ }
+ }
+ }
+yy470:
+ YYDEBUG(470, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy454;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy403;
+ if(yych <= ':') goto yy454;
+ goto yy315;
+ }
+yy471:
+ YYDEBUG(471, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
if(yych <= '/'){
- if(yych == '.') goto yy494;
- goto yy441;
+ if(yych == '.') goto yy414;
+ goto yy332;
} else {
- if(yych <= '1') goto yy495;
- if(yych <= '2') goto yy496;
- if(yych <= '9') goto yy497;
- goto yy446;
+ if(yych <= '0') goto yy448;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
}
} else {
if(yych <= 'q'){
- if(yych == 'n') goto yy437;
- goto yy441;
+ if(yych <= ':') goto yy378;
+ if(yych == 'n') goto yy328;
+ goto yy332;
} else {
- if(yych <= 'r') goto yy438;
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy511:
- YYDEBUG(511, *YYCURSOR);
- yyaccept = 6;
+yy472:
+ YYDEBUG(472, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= '/'){
+ if(yych == '.') goto yy414;
+ goto yy332;
+ } else {
+ if(yych <= '0') goto yy448;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= ':') goto yy378;
+ if(yych == 'n') goto yy328;
+ goto yy332;
+ } else {
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
+ }
+ }
+yy473:
+ YYDEBUG(473, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy441;
- if(yych <= '0') goto yy493;
- goto yy514;
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy412;
+ goto yy477;
} else {
- if(yych <= '2') goto yy521;
- if(yych <= '9') goto yy514;
- goto yy441;
+ if(yych <= '2') goto yy484;
+ if(yych <= '9') goto yy485;
+ goto yy332;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy437;
- if(yych <= 'q') goto yy441;
- goto yy438;
+ if(yych <= 'n') goto yy328;
+ if(yych <= 'q') goto yy332;
+ goto yy329;
} else {
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy512:
- YYDEBUG(512, *YYCURSOR);
- yyaccept = 6;
+yy474:
+ YYDEBUG(474, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy441;
- goto yy514;
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy476;
+ goto yy477;
} else {
- if(yych <= '2') goto yy521;
- if(yych <= '9') goto yy514;
- goto yy441;
+ if(yych <= '2') goto yy484;
+ if(yych <= '9') goto yy485;
+ goto yy332;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy437;
- if(yych <= 'q') goto yy441;
- goto yy438;
+ if(yych <= 'n') goto yy328;
+ if(yych <= 'q') goto yy332;
+ goto yy329;
} else {
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy513:
- YYDEBUG(513, *YYCURSOR);
- yyaccept = 6;
+yy475:
+ YYDEBUG(475, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy441;
- goto yy514;
+ if(yych <= '/') goto yy332;
+ if(yych >= '1') goto yy477;
+ goto yy476;
} else {
- if(yych <= '2') goto yy434;
- if(yych <= '9') goto yy435;
- goto yy441;
+ if(yych <= '2') goto yy325;
+ if(yych <= '9') goto yy326;
+ goto yy332;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy437;
- if(yych <= 'q') goto yy441;
- goto yy438;
+ if(yych <= 'n') goto yy328;
+ if(yych <= 'q') goto yy332;
+ goto yy329;
} else {
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy514:
- YYDEBUG(514, *YYCURSOR);
- yyaccept = 6;
+yy476:
+ YYDEBUG(476, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
- if(yych <= '.'){
- if(yych <= ',') goto yy441;
- if(yych >= '.') goto yy494;
- goto yy515;
+ if(yych <= '/'){
+ if(yych <= ',') goto yy332;
+ if(yych <= '-') goto yy478;
+ if(yych <= '.') goto yy447;
+ goto yy332;
} else {
- if(yych <= '/') goto yy441;
- if(yych <= '1') goto yy495;
- if(yych <= '2') goto yy496;
- goto yy497;
+ if(yych <= '0') goto yy448;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
}
} else {
if(yych <= 'q'){
- if(yych <= ':') goto yy446;
- if(yych == 'n') goto yy437;
- goto yy441;
+ if(yych <= ':') goto yy337;
+ if(yych == 'n') goto yy328;
+ goto yy332;
} else {
- if(yych <= 'r') goto yy438;
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy515:
- YYDEBUG(515, *YYCURSOR);
+yy477:
+ YYDEBUG(477, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= '/'){
+ if(yych <= ',') goto yy332;
+ if(yych <= '-') goto yy478;
+ if(yych <= '.') goto yy414;
+ goto yy332;
+ } else {
+ if(yych <= '0') goto yy415;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= ':') goto yy378;
+ if(yych == 'n') goto yy328;
+ goto yy332;
+ } else {
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
+ }
+ }
+yy478:
+ YYDEBUG(478, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy516;
-yy516:
- YYDEBUG(516, *YYCURSOR);
+ goto yy479;
+yy479:
+ YYDEBUG(479, *YYCURSOR);
++YYCURSOR;
- if((yych = *YYCURSOR) <= '/') goto yy517;
- if(yych <= '9') goto yy518;
- goto yy517;
-yy517:
- YYDEBUG(517, *YYCURSOR);
+ if((yych = *YYCURSOR) <= '/') goto yy480;
+ if(yych <= '9') goto yy481;
+ goto yy480;
+yy480:
+ YYDEBUG(480, *YYCURSOR);
{
DEBUG_OUTPUT("pgtextshort");
@@ -8544,1966 +8077,1918 @@ yy517:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
-yy518:
- YYDEBUG(518, *YYCURSOR);
+yy481:
+ YYDEBUG(481, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy517;
- if(yych >= ':') goto yy517;
- goto yy519;
-yy519:
- YYDEBUG(519, *YYCURSOR);
+ if(yych <= '/') goto yy480;
+ if(yych >= ':') goto yy480;
+ goto yy482;
+yy482:
+ YYDEBUG(482, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy517;
- if(yych >= ':') goto yy517;
- goto yy520;
-yy520:
- YYDEBUG(520, *YYCURSOR);
+ if(yych <= '/') goto yy480;
+ if(yych >= ':') goto yy480;
+ goto yy483;
+yy483:
+ YYDEBUG(483, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy517;
-yy521:
- YYDEBUG(521, *YYCURSOR);
- yyaccept = 6;
+ goto yy480;
+yy484:
+ YYDEBUG(484, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
- if(yych <= '.'){
- if(yych <= ',') goto yy441;
- if(yych <= '-') goto yy515;
- goto yy494;
+ if(yych <= '/'){
+ if(yych <= ',') goto yy332;
+ if(yych <= '-') goto yy478;
+ if(yych <= '.') goto yy414;
+ goto yy332;
} else {
- if(yych <= '/') goto yy441;
- if(yych <= '1') goto yy495;
- if(yych <= '2') goto yy496;
- goto yy497;
+ if(yych <= '0') goto yy448;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
}
} else {
if(yych <= 'q'){
- if(yych <= ':') goto yy446;
- if(yych == 'n') goto yy437;
- goto yy441;
+ if(yych <= ':') goto yy378;
+ if(yych == 'n') goto yy328;
+ goto yy332;
} else {
- if(yych <= 'r') goto yy438;
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy522:
- YYDEBUG(522, *YYCURSOR);
+yy485:
+ YYDEBUG(485, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= '/'){
+ if(yych <= ',') goto yy332;
+ if(yych <= '-') goto yy478;
+ if(yych <= '.') goto yy414;
+ goto yy332;
+ } else {
+ if(yych <= '0') goto yy448;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= ':') goto yy378;
+ if(yych == 'n') goto yy328;
+ goto yy332;
+ } else {
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
+ }
+ }
+yy486:
+ YYDEBUG(486, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'C'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'B') goto yy134;
- goto yy421;
+ if(yych <= 'B') goto yy138;
+ goto yy309;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'c') goto yy523;
- if(yych <= 'z') goto yy139;
+ if(yych == 'c') goto yy487;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy523:
- YYDEBUG(523, *YYCURSOR);
- yyaccept = 0;
+yy487:
+ YYDEBUG(487, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'D'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'E') goto yy429;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'E') goto yy318;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'd'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'e') goto yy524;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'e') goto yy488;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy524:
- YYDEBUG(524, *YYCURSOR);
+yy488:
+ YYDEBUG(488, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'M'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'L') goto yy136;
- goto yy430;
+ if(yych <= 'L') goto yy140;
+ goto yy319;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'm') goto yy525;
- if(yych <= 'z') goto yy145;
+ if(yych == 'm') goto yy489;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy525:
- YYDEBUG(525, *YYCURSOR);
+yy489:
+ YYDEBUG(489, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'B'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy137;
- goto yy431;
+ if(yych <= 'A') goto yy141;
+ goto yy320;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'b') goto yy526;
- if(yych <= 'z') goto yy146;
+ if(yych == 'b') goto yy490;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy526:
- YYDEBUG(526, *YYCURSOR);
+yy490:
+ YYDEBUG(490, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'D') goto yy3;
- goto yy432;
+ goto yy321;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy527;
- if(yych <= 'z') goto yy147;
+ if(yych == 'e') goto yy491;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy527:
- YYDEBUG(527, *YYCURSOR);
+yy491:
+ YYDEBUG(491, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy53;
- goto yy140;
+ if(yych == 'R') goto yy322;
+ if(yych != 'r') goto yy152;
+ goto yy492;
+yy492:
+ YYDEBUG(492, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '.'){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy312;
+ goto yy310;
} else {
- if(yych == 'R') goto yy422;
- goto yy53;
+ if(yych <= ' ') goto yy312;
+ if(yych <= ',') goto yy310;
+ goto yy312;
}
} else {
- if(yych <= 'q'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy53;
- goto yy147;
+ if(yych <= '^'){
+ if(yych <= '/') goto yy144;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych <= 'r') goto yy528;
- if(yych <= 'z') goto yy147;
- goto yy53;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy151;
+ goto yy310;
}
}
-yy528:
- YYDEBUG(528, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych == '/') goto yy140;
- goto yy423;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy423;
- if(yych <= 'z') goto yy147;
- goto yy423;
- }
-yy529:
- YYDEBUG(529, *YYCURSOR);
+yy493:
+ YYDEBUG(493, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy134;
- goto yy530;
+ if(yych <= 'S') goto yy138;
+ goto yy494;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 't') goto yy530;
- if(yych <= 'z') goto yy134;
+ if(yych <= 't') goto yy494;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy530:
- YYDEBUG(530, *YYCURSOR);
- yyaccept = 0;
+yy494:
+ YYDEBUG(494, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'O') goto yy135;
- goto yy531;
+ if(yych != 'O') goto yy139;
+ goto yy495;
}
} else {
if(yych <= 'n'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'o') goto yy531;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'o') goto yy495;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy531:
- YYDEBUG(531, *YYCURSOR);
+yy495:
+ YYDEBUG(495, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'B'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy136;
- goto yy532;
+ if(yych <= 'A') goto yy140;
+ goto yy496;
}
} else {
if(yych <= 'a'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'b') goto yy532;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'b') goto yy496;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy532:
- YYDEBUG(532, *YYCURSOR);
+yy496:
+ YYDEBUG(496, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy137;
- goto yy533;
+ if(yych <= 'D') goto yy141;
+ goto yy497;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'e') goto yy533;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'e') goto yy497;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy533:
- YYDEBUG(533, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
+yy497:
+ YYDEBUG(497, *YYCURSOR);
+ yych = *++YYCURSOR;
if(yych <= 'Q'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'R') goto yy422;
- if(yych == 'r') goto yy422;
+ if(yych <= 'R') goto yy322;
+ if(yych == 'r') goto yy322;
goto yy3;
}
-yy534:
- YYDEBUG(534, *YYCURSOR);
+yy498:
+ YYDEBUG(498, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy134;
- goto yy530;
+ if(yych <= 'S') goto yy138;
+ goto yy494;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy535;
- if(yych <= 'z') goto yy139;
+ if(yych == 't') goto yy499;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy535:
- YYDEBUG(535, *YYCURSOR);
- yyaccept = 0;
+yy499:
+ YYDEBUG(499, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'N'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'O') goto yy531;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'O') goto yy495;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'n'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'o') goto yy536;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'o') goto yy500;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy536:
- YYDEBUG(536, *YYCURSOR);
+yy500:
+ YYDEBUG(500, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'B'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy136;
- goto yy532;
+ if(yych <= 'A') goto yy140;
+ goto yy496;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'b') goto yy537;
- if(yych <= 'z') goto yy145;
+ if(yych == 'b') goto yy501;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy537:
- YYDEBUG(537, *YYCURSOR);
+yy501:
+ YYDEBUG(501, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy137;
- goto yy533;
+ if(yych <= 'D') goto yy141;
+ goto yy497;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy538;
- if(yych <= 'z') goto yy146;
+ if(yych == 'e') goto yy502;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy538:
- YYDEBUG(538, *YYCURSOR);
+yy502:
+ YYDEBUG(502, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'Q') goto yy3;
- goto yy422;
+ goto yy322;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy528;
- if(yych <= 'z') goto yy147;
+ if(yych == 'r') goto yy492;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy539:
- YYDEBUG(539, *YYCURSOR);
+yy503:
+ YYDEBUG(503, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'V'){
if(yych <= 'B'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
if(yych <= 'O'){
- if(yych <= 'C') goto yy555;
- goto yy134;
+ if(yych <= 'C') goto yy519;
+ goto yy138;
} else {
- if(yych <= 'P') goto yy554;
- if(yych <= 'U') goto yy134;
- goto yy556;
+ if(yych <= 'P') goto yy518;
+ if(yych <= 'U') goto yy138;
+ goto yy520;
}
}
} else {
if(yych <= 'o'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych == 'c') goto yy555;
- goto yy134;
+ if(yych == 'c') goto yy519;
+ goto yy138;
}
} else {
if(yych <= 'u'){
- if(yych <= 'p') goto yy554;
- goto yy134;
+ if(yych <= 'p') goto yy518;
+ goto yy138;
} else {
- if(yych <= 'v') goto yy556;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'v') goto yy520;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
}
-yy540:
- YYDEBUG(540, *YYCURSOR);
+yy504:
+ YYDEBUG(504, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy134;
- goto yy549;
+ if(yych <= 'S') goto yy138;
+ goto yy513;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 't') goto yy549;
- if(yych <= 'z') goto yy134;
+ if(yych <= 't') goto yy513;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy541:
- YYDEBUG(541, *YYCURSOR);
+yy505:
+ YYDEBUG(505, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'X'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'W') goto yy134;
- goto yy547;
+ if(yych <= 'W') goto yy138;
+ goto yy511;
}
} else {
if(yych <= 'w'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'x') goto yy547;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'x') goto yy511;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy542:
- YYDEBUG(542, *YYCURSOR);
+yy506:
+ YYDEBUG(506, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy543;
+ if(yych <= 'M') goto yy138;
+ goto yy507;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'n') goto yy543;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'n') goto yy507;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy543:
- YYDEBUG(543, *YYCURSOR);
+yy507:
+ YYDEBUG(507, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
- if(yych <= '(') goto yy405;
- goto yy132;
+ if(yych <= '(') goto yy283;
+ goto yy136;
} else {
- if(yych <= '@') goto yy405;
- if(yych <= 'C') goto yy135;
- goto yy544;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'C') goto yy139;
+ goto yy508;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy405;
- goto yy135;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy283;
+ goto yy139;
} else {
- if(yych <= 'd') goto yy544;
- if(yych <= 'z') goto yy135;
- goto yy405;
+ if(yych <= 'd') goto yy508;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy544:
- YYDEBUG(544, *YYCURSOR);
+yy508:
+ YYDEBUG(508, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy545;
+ goto yy509;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
goto yy3;
} else {
- if(yych <= 'a') goto yy545;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'a') goto yy509;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy545:
- YYDEBUG(545, *YYCURSOR);
+yy509:
+ YYDEBUG(509, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy137;
- goto yy546;
+ if(yych <= 'X') goto yy141;
+ goto yy510;
}
} else {
if(yych <= 'x'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'y') goto yy546;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'y') goto yy510;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy546:
- YYDEBUG(546, *YYCURSOR);
+yy510:
+ YYDEBUG(510, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == ')') goto yy132;
- goto yy405;
-yy547:
- YYDEBUG(547, *YYCURSOR);
+ if(yych == ')') goto yy136;
+ goto yy283;
+yy511:
+ YYDEBUG(511, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy548;
+ if(yych <= 'S') goto yy139;
+ goto yy512;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 't') goto yy548;
- if(yych <= 'z') goto yy135;
+ if(yych <= 't') goto yy512;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy548:
- YYDEBUG(548, *YYCURSOR);
+yy512:
+ YYDEBUG(512, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= 'g'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'h') goto yy376;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'h') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy549:
- YYDEBUG(549, *YYCURSOR);
+yy513:
+ YYDEBUG(513, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= ')'){
- if(yych <= '(') goto yy405;
- goto yy132;
+ if(yych <= '(') goto yy283;
+ goto yy136;
} else {
- if(yych <= '@') goto yy405;
- if(yych <= 'T') goto yy135;
- goto yy550;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'T') goto yy139;
+ goto yy514;
}
} else {
if(yych <= 't'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy405;
- goto yy135;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy283;
+ goto yy139;
} else {
- if(yych <= 'u') goto yy550;
- if(yych <= 'z') goto yy135;
- goto yy405;
+ if(yych <= 'u') goto yy514;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy550:
- YYDEBUG(550, *YYCURSOR);
+yy514:
+ YYDEBUG(514, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy136;
- goto yy551;
+ if(yych <= 'Q') goto yy140;
+ goto yy515;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'r') goto yy551;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'r') goto yy515;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy551:
- YYDEBUG(551, *YYCURSOR);
+yy515:
+ YYDEBUG(515, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy137;
- goto yy552;
+ if(yych <= 'C') goto yy141;
+ goto yy516;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'd') goto yy552;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'd') goto yy516;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy552:
- YYDEBUG(552, *YYCURSOR);
+yy516:
+ YYDEBUG(516, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'A') goto yy553;
+ if(yych <= 'A') goto yy517;
if(yych != 'a') goto yy3;
- goto yy553;
+ goto yy517;
}
-yy553:
- YYDEBUG(553, *YYCURSOR);
+yy517:
+ YYDEBUG(517, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy411;
- if(yych == 'y') goto yy411;
+ if(yych == 'Y') goto yy289;
+ if(yych == 'y') goto yy289;
goto yy53;
-yy554:
- YYDEBUG(554, *YYCURSOR);
- yyaccept = 0;
+yy518:
+ YYDEBUG(518, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych == 'T') goto yy563;
- goto yy135;
+ if(yych == 'T') goto yy527;
+ goto yy139;
}
} else {
if(yych <= 's'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 't') goto yy563;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 't') goto yy527;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy555:
- YYDEBUG(555, *YYCURSOR);
+yy519:
+ YYDEBUG(519, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy135;
- goto yy560;
+ if(yych <= 'N') goto yy139;
+ goto yy524;
}
} else {
if(yych <= 'n'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'o') goto yy560;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'o') goto yy524;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy556:
- YYDEBUG(556, *YYCURSOR);
+yy520:
+ YYDEBUG(520, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy135;
- goto yy557;
+ if(yych <= 'D') goto yy139;
+ goto yy521;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'e') goto yy557;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'e') goto yy521;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy557:
- YYDEBUG(557, *YYCURSOR);
+yy521:
+ YYDEBUG(521, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy136;
- goto yy558;
+ if(yych <= 'M') goto yy140;
+ goto yy522;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'n') goto yy558;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'n') goto yy522;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy558:
- YYDEBUG(558, *YYCURSOR);
+yy522:
+ YYDEBUG(522, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy137;
- goto yy559;
+ if(yych <= 'S') goto yy141;
+ goto yy523;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 't') goto yy559;
- if(yych <= 'z') goto yy137;
+ if(yych <= 't') goto yy523;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy559:
- YYDEBUG(559, *YYCURSOR);
+yy523:
+ YYDEBUG(523, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'G'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'H') goto yy163;
- if(yych == 'h') goto yy163;
+ if(yych <= 'H') goto yy167;
+ if(yych == 'h') goto yy167;
goto yy3;
}
-yy560:
- YYDEBUG(560, *YYCURSOR);
+yy524:
+ YYDEBUG(524, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy136;
- goto yy561;
+ if(yych <= 'M') goto yy140;
+ goto yy525;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'n') goto yy561;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'n') goto yy525;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy561:
- YYDEBUG(561, *YYCURSOR);
+yy525:
+ YYDEBUG(525, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy137;
- goto yy562;
+ if(yych <= 'C') goto yy141;
+ goto yy526;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'd') goto yy562;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'd') goto yy526;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy562:
- YYDEBUG(562, *YYCURSOR);
+yy526:
+ YYDEBUG(526, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'V'){
- if(yych <= 'D'){
- if(yych <= ' '){
- if(yych == 0x09) goto yy164;
- if(yych <= 0x1F) goto yy3;
- goto yy164;
- } else {
- if(yych == ')') goto yy132;
- if(yych <= 'C') goto yy3;
- goto yy164;
- }
- } else {
- if(yych <= 'H'){
- if(yych == 'F') goto yy164;
- if(yych <= 'G') goto yy3;
- goto yy164;
- } else {
- if(yych <= 'M'){
- if(yych <= 'L') goto yy3;
- goto yy164;
- } else {
- if(yych <= 'R') goto yy3;
- if(yych <= 'T') goto yy164;
- goto yy3;
- }
- }
- }
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy168;
+ goto yy3;
} else {
- if(yych <= 'h'){
- if(yych <= 'c'){
- if(yych == 'X') goto yy3;
- if(yych <= 'Y') goto yy164;
- goto yy3;
- } else {
- if(yych <= 'e'){
- if(yych <= 'd') goto yy164;
- goto yy3;
- } else {
- if(yych == 'g') goto yy3;
- goto yy164;
- }
- }
- } else {
- if(yych <= 't'){
- if(yych == 'm') goto yy164;
- if(yych <= 'r') goto yy3;
- goto yy164;
- } else {
- if(yych <= 'w'){
- if(yych <= 'v') goto yy3;
- goto yy164;
- } else {
- if(yych == 'y') goto yy164;
- goto yy3;
- }
- }
- }
+ if(yych <= ' ') goto yy168;
+ if(yych == ')') goto yy136;
+ goto yy3;
}
-yy563:
- YYDEBUG(563, *YYCURSOR);
- yyaccept = 0;
+yy527:
+ YYDEBUG(527, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'E') goto yy136;
- goto yy564;
+ if(yych != 'E') goto yy140;
+ goto yy528;
}
} else {
if(yych <= 'd'){
- if(yych <= '`') goto yy3;
- goto yy136;
+ if(yych <= '`') goto yy310;
+ goto yy140;
} else {
- if(yych <= 'e') goto yy564;
- if(yych <= 'z') goto yy136;
- goto yy3;
+ if(yych <= 'e') goto yy528;
+ if(yych <= 'z') goto yy140;
+ goto yy310;
}
}
}
-yy564:
- YYDEBUG(564, *YYCURSOR);
+yy528:
+ YYDEBUG(528, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'M'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'L') goto yy137;
- goto yy565;
+ if(yych <= 'L') goto yy141;
+ goto yy529;
}
} else {
if(yych <= 'l'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'm') goto yy565;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'm') goto yy529;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy565:
- YYDEBUG(565, *YYCURSOR);
+yy529:
+ YYDEBUG(529, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'B') goto yy566;
+ if(yych <= 'B') goto yy530;
if(yych != 'b') goto yy3;
- goto yy566;
+ goto yy530;
}
-yy566:
- YYDEBUG(566, *YYCURSOR);
+yy530:
+ YYDEBUG(530, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy567;
+ if(yych == 'E') goto yy531;
if(yych != 'e') goto yy53;
- goto yy567;
-yy567:
- YYDEBUG(567, *YYCURSOR);
+ goto yy531;
+yy531:
+ YYDEBUG(531, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy422;
- if(yych == 'r') goto yy422;
+ if(yych == 'R') goto yy322;
+ if(yych == 'r') goto yy322;
goto yy53;
-yy568:
- YYDEBUG(568, *YYCURSOR);
+yy532:
+ YYDEBUG(532, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= '@'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
+ if(yych == '/') goto yy144;
goto yy3;
}
} else {
if(yych <= 'O'){
- if(yych == 'C') goto yy555;
- goto yy134;
+ if(yych == 'C') goto yy519;
+ goto yy138;
} else {
- if(yych <= 'P') goto yy554;
- if(yych <= 'U') goto yy134;
- goto yy556;
+ if(yych <= 'P') goto yy518;
+ if(yych <= 'U') goto yy138;
+ goto yy520;
}
}
} else {
if(yych <= 'c'){
if(yych <= '_'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'b') goto yy139;
- goto yy584;
+ if(yych <= 'b') goto yy143;
+ goto yy548;
}
} else {
if(yych <= 'u'){
- if(yych == 'p') goto yy583;
- goto yy139;
+ if(yych == 'p') goto yy547;
+ goto yy143;
} else {
- if(yych <= 'v') goto yy585;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'v') goto yy549;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy569:
- YYDEBUG(569, *YYCURSOR);
+yy533:
+ YYDEBUG(533, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy134;
- goto yy549;
+ if(yych <= 'S') goto yy138;
+ goto yy513;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy578;
- if(yych <= 'z') goto yy139;
+ if(yych == 't') goto yy542;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy570:
- YYDEBUG(570, *YYCURSOR);
+yy534:
+ YYDEBUG(534, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'X'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'W') goto yy134;
- goto yy547;
+ if(yych <= 'W') goto yy138;
+ goto yy511;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'x') goto yy576;
- if(yych <= 'z') goto yy139;
+ if(yych == 'x') goto yy540;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy571:
- YYDEBUG(571, *YYCURSOR);
+yy535:
+ YYDEBUG(535, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy543;
+ if(yych <= 'M') goto yy138;
+ goto yy507;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy572;
- if(yych <= 'z') goto yy139;
+ if(yych == 'n') goto yy536;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy572:
- YYDEBUG(572, *YYCURSOR);
+yy536:
+ YYDEBUG(536, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'C') goto yy135;
- goto yy544;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'C') goto yy139;
+ goto yy508;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 'd') goto yy573;
- if(yych <= 'z') goto yy144;
- goto yy405;
+ if(yych == 'd') goto yy537;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy573:
- YYDEBUG(573, *YYCURSOR);
+yy537:
+ YYDEBUG(537, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy545;
+ goto yy509;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy574;
- if(yych <= 'z') goto yy145;
+ if(yych <= 'a') goto yy538;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy574:
- YYDEBUG(574, *YYCURSOR);
+yy538:
+ YYDEBUG(538, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy137;
- goto yy546;
+ if(yych <= 'X') goto yy141;
+ goto yy510;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy575;
- if(yych <= 'z') goto yy146;
+ if(yych == 'y') goto yy539;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy575:
- YYDEBUG(575, *YYCURSOR);
+yy539:
+ YYDEBUG(539, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy405;
- goto yy140;
+ if(yych == ')') goto yy136;
+ if(yych <= '.') goto yy283;
+ goto yy144;
} else {
if(yych <= '_'){
- if(yych <= '^') goto yy405;
- goto yy140;
+ if(yych <= '^') goto yy283;
+ goto yy144;
} else {
- if(yych <= '`') goto yy405;
- if(yych <= 'z') goto yy147;
- goto yy405;
+ if(yych <= '`') goto yy283;
+ if(yych <= 'z') goto yy151;
+ goto yy283;
}
}
-yy576:
- YYDEBUG(576, *YYCURSOR);
+yy540:
+ YYDEBUG(540, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy548;
+ if(yych <= 'S') goto yy139;
+ goto yy512;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy577;
- if(yych <= 'z') goto yy144;
+ if(yych == 't') goto yy541;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy577:
- YYDEBUG(577, *YYCURSOR);
+yy541:
+ YYDEBUG(541, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 'h') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy578:
- YYDEBUG(578, *YYCURSOR);
+yy542:
+ YYDEBUG(542, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'U'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'T') goto yy135;
- goto yy550;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'T') goto yy139;
+ goto yy514;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 'u') goto yy579;
- if(yych <= 'z') goto yy144;
- goto yy405;
+ if(yych == 'u') goto yy543;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy579:
- YYDEBUG(579, *YYCURSOR);
+yy543:
+ YYDEBUG(543, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy136;
- goto yy551;
+ if(yych <= 'Q') goto yy140;
+ goto yy515;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy580;
- if(yych <= 'z') goto yy145;
+ if(yych == 'r') goto yy544;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy580:
- YYDEBUG(580, *YYCURSOR);
+yy544:
+ YYDEBUG(544, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy137;
- goto yy552;
+ if(yych <= 'C') goto yy141;
+ goto yy516;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy581;
- if(yych <= 'z') goto yy146;
+ if(yych == 'd') goto yy545;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy581:
- YYDEBUG(581, *YYCURSOR);
+yy545:
+ YYDEBUG(545, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy553;
+ goto yy517;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych <= 'a') goto yy582;
- if(yych <= 'z') goto yy147;
+ if(yych <= 'a') goto yy546;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy582:
- YYDEBUG(582, *YYCURSOR);
+yy546:
+ YYDEBUG(546, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy411;
- if(yych == 'y') goto yy419;
- goto yy148;
-yy583:
- YYDEBUG(583, *YYCURSOR);
- yyaccept = 0;
+ if(yych == 'Y') goto yy289;
+ if(yych == 'y') goto yy302;
+ goto yy152;
+yy547:
+ YYDEBUG(547, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'S'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'T') goto yy563;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'T') goto yy527;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 's'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 't') goto yy592;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 't') goto yy556;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy584:
- YYDEBUG(584, *YYCURSOR);
+yy548:
+ YYDEBUG(548, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'O'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy135;
- goto yy560;
+ if(yych <= 'N') goto yy139;
+ goto yy524;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'o') goto yy589;
- if(yych <= 'z') goto yy144;
+ if(yych == 'o') goto yy553;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy585:
- YYDEBUG(585, *YYCURSOR);
+yy549:
+ YYDEBUG(549, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy135;
- goto yy557;
+ if(yych <= 'D') goto yy139;
+ goto yy521;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy586;
- if(yych <= 'z') goto yy144;
+ if(yych == 'e') goto yy550;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy586:
- YYDEBUG(586, *YYCURSOR);
+yy550:
+ YYDEBUG(550, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy136;
- goto yy558;
+ if(yych <= 'M') goto yy140;
+ goto yy522;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy587;
- if(yych <= 'z') goto yy145;
+ if(yych == 'n') goto yy551;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy587:
- YYDEBUG(587, *YYCURSOR);
+yy551:
+ YYDEBUG(551, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy137;
- goto yy559;
+ if(yych <= 'S') goto yy141;
+ goto yy523;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy588;
- if(yych <= 'z') goto yy146;
+ if(yych == 't') goto yy552;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy588:
- YYDEBUG(588, *YYCURSOR);
+yy552:
+ YYDEBUG(552, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'G') goto yy3;
- goto yy163;
+ goto yy167;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy245;
- if(yych <= 'z') goto yy147;
+ if(yych == 'h') goto yy254;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy589:
- YYDEBUG(589, *YYCURSOR);
+yy553:
+ YYDEBUG(553, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy136;
- goto yy561;
+ if(yych <= 'M') goto yy140;
+ goto yy525;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy590;
- if(yych <= 'z') goto yy145;
+ if(yych == 'n') goto yy554;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy590:
- YYDEBUG(590, *YYCURSOR);
+yy554:
+ YYDEBUG(554, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy137;
- goto yy562;
+ if(yych <= 'C') goto yy141;
+ goto yy526;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy591;
- if(yych <= 'z') goto yy146;
+ if(yych == 'd') goto yy555;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy591:
- YYDEBUG(591, *YYCURSOR);
+yy555:
+ YYDEBUG(555, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- YYDEBUG(-1, yych);
- switch(yych){
- case 0x09: case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
- case 'T': case 'W': case 'Y': goto yy164;
- case ')': goto yy132;
- case '/': case '_': goto yy140;
- 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 yy147;
- case 'd': goto yy249;
- case 'f': goto yy251;
- case 'h': goto yy248;
- case 'm': goto yy247;
- case 's': goto yy246;
- case 't': goto yy253;
- case 'w': goto yy250;
- case 'y': goto yy252;
- default: goto yy3;
+ if(yych <= ')'){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy168;
+ goto yy3;
+ } else {
+ if(yych <= ' ') goto yy168;
+ if(yych <= '(') goto yy3;
+ goto yy136;
+ }
+ } else {
+ if(yych <= '^'){
+ if(yych == '/') goto yy144;
+ goto yy3;
+ } else {
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy151;
+ goto yy3;
+ }
}
-yy592:
- YYDEBUG(592, *YYCURSOR);
- yyaccept = 0;
+yy556:
+ YYDEBUG(556, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'D'){
- if(yych <= '@') goto yy3;
- goto yy136;
+ if(yych <= '@') goto yy310;
+ goto yy140;
} else {
- if(yych <= 'E') goto yy564;
- if(yych <= 'Z') goto yy136;
- goto yy3;
+ if(yych <= 'E') goto yy528;
+ if(yych <= 'Z') goto yy140;
+ goto yy310;
}
} else {
if(yych <= 'd'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy145;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy149;
} else {
- if(yych <= 'e') goto yy593;
- if(yych <= 'z') goto yy145;
- goto yy3;
+ if(yych <= 'e') goto yy557;
+ if(yych <= 'z') goto yy149;
+ goto yy310;
}
}
}
-yy593:
- YYDEBUG(593, *YYCURSOR);
+yy557:
+ YYDEBUG(557, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'M'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'L') goto yy137;
- goto yy565;
+ if(yych <= 'L') goto yy141;
+ goto yy529;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'm') goto yy594;
- if(yych <= 'z') goto yy146;
+ if(yych == 'm') goto yy558;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy594:
- YYDEBUG(594, *YYCURSOR);
+yy558:
+ YYDEBUG(558, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'B'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'A') goto yy3;
- goto yy566;
+ goto yy530;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'b') goto yy595;
- if(yych <= 'z') goto yy147;
+ if(yych == 'b') goto yy559;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy595:
- YYDEBUG(595, *YYCURSOR);
+yy559:
+ YYDEBUG(559, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy567;
- if(yych != 'e') goto yy148;
- goto yy596;
-yy596:
- YYDEBUG(596, *YYCURSOR);
+ if(yych == 'E') goto yy531;
+ if(yych != 'e') goto yy152;
+ goto yy560;
+yy560:
+ YYDEBUG(560, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy53;
- goto yy140;
- } else {
- if(yych == 'R') goto yy422;
- goto yy53;
- }
- } else {
- if(yych <= 'q'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy53;
- goto yy147;
- } else {
- if(yych <= 'r') goto yy528;
- if(yych <= 'z') goto yy147;
- goto yy53;
- }
- }
-yy597:
- YYDEBUG(597, *YYCURSOR);
+ if(yych == 'R') goto yy322;
+ if(yych == 'r') goto yy492;
+ goto yy152;
+yy561:
+ YYDEBUG(561, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'G'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'F') goto yy134;
- goto yy605;
+ if(yych <= 'F') goto yy138;
+ goto yy569;
}
} else {
if(yych <= 'f'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'g') goto yy605;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'g') goto yy569;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy598:
- YYDEBUG(598, *YYCURSOR);
+yy562:
+ YYDEBUG(562, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy134;
- goto yy602;
+ if(yych <= 'Q') goto yy138;
+ goto yy566;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'r') goto yy602;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'r') goto yy566;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy599:
- YYDEBUG(599, *YYCURSOR);
+yy563:
+ YYDEBUG(563, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy134;
- goto yy600;
+ if(yych <= 'N') goto yy138;
+ goto yy564;
}
} else {
if(yych <= 'n'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'o') goto yy600;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'o') goto yy564;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy600:
- YYDEBUG(600, *YYCURSOR);
+yy564:
+ YYDEBUG(564, *YYCURSOR);
++YYCURSOR;
if((yych = *YYCURSOR) <= '@'){
- if(yych == ')') goto yy132;
- goto yy601;
+ if(yych == ')') goto yy136;
+ goto yy565;
} else {
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy601;
- if(yych <= 'z') goto yy135;
- goto yy601;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy565;
+ if(yych <= 'z') goto yy139;
+ goto yy565;
}
-yy601:
- YYDEBUG(601, *YYCURSOR);
+yy565:
+ YYDEBUG(565, *YYCURSOR);
{
DEBUG_OUTPUT("ago");
@@ -10515,2314 +10000,2325 @@ yy601:
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;
+ if (s->time->have_special_relative && s->time->special.type == TIMELIB_SPECIAL_WEEKDAY) {
+ s->time->special.amount = 0 - s->time->special.amount;
+ }
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
-yy602:
- YYDEBUG(602, *YYCURSOR);
- yyaccept = 0;
+yy566:
+ YYDEBUG(566, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'I') goto yy135;
- goto yy603;
+ if(yych != 'I') goto yy139;
+ goto yy567;
}
} else {
if(yych <= 'h'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'i') goto yy603;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'i') goto yy567;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy603:
- YYDEBUG(603, *YYCURSOR);
+yy567:
+ YYDEBUG(567, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'K') goto yy136;
- goto yy604;
+ if(yych <= 'K') goto yy140;
+ goto yy568;
}
} else {
if(yych <= 'k'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'l') goto yy604;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'l') goto yy568;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy604:
- YYDEBUG(604, *YYCURSOR);
- yyaccept = 0;
+yy568:
+ YYDEBUG(568, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy423;
- goto yy3;
+ if(yych == 0x09) goto yy312;
+ goto yy310;
} else {
- if(yych <= ' ') goto yy423;
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= ' ') goto yy312;
+ if(yych == ')') goto yy136;
+ goto yy310;
}
} else {
if(yych <= '@'){
- if(yych == '/') goto yy3;
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych == '/') goto yy310;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych <= 'Z') goto yy137;
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy137;
- goto yy3;
+ if(yych <= 'Z') goto yy141;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy141;
+ goto yy310;
}
}
-yy605:
- YYDEBUG(605, *YYCURSOR);
- yyaccept = 0;
+yy569:
+ YYDEBUG(569, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'U') goto yy135;
- goto yy606;
+ if(yych != 'U') goto yy139;
+ goto yy570;
}
} else {
if(yych <= 't'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'u') goto yy606;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'u') goto yy570;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy606:
- YYDEBUG(606, *YYCURSOR);
+yy570:
+ YYDEBUG(570, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy136;
- goto yy607;
+ if(yych <= 'R') goto yy140;
+ goto yy571;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 's') goto yy607;
- if(yych <= 'z') goto yy136;
+ if(yych <= 's') goto yy571;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy607:
- YYDEBUG(607, *YYCURSOR);
+yy571:
+ YYDEBUG(571, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy137;
- goto yy608;
+ if(yych <= 'S') goto yy141;
+ goto yy572;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 't') goto yy608;
- if(yych <= 'z') goto yy137;
+ if(yych <= 't') goto yy572;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy608:
- YYDEBUG(608, *YYCURSOR);
- yyaccept = 0;
+yy572:
+ YYDEBUG(572, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '.'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy423;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy312;
} else {
- if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '/') goto yy310;
+ if(yych <= '9') goto yy312;
+ goto yy310;
}
}
-yy609:
- YYDEBUG(609, *YYCURSOR);
+yy573:
+ YYDEBUG(573, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'G'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'F') goto yy134;
- goto yy605;
+ if(yych <= 'F') goto yy138;
+ goto yy569;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'g') goto yy616;
- if(yych <= 'z') goto yy139;
+ if(yych == 'g') goto yy580;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy610:
- YYDEBUG(610, *YYCURSOR);
+yy574:
+ YYDEBUG(574, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy134;
- goto yy602;
+ if(yych <= 'Q') goto yy138;
+ goto yy566;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy613;
- if(yych <= 'z') goto yy139;
+ if(yych == 'r') goto yy577;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy611:
- YYDEBUG(611, *YYCURSOR);
+yy575:
+ YYDEBUG(575, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'O'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy134;
- goto yy600;
+ if(yych <= 'N') goto yy138;
+ goto yy564;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'o') goto yy612;
- if(yych <= 'z') goto yy139;
+ if(yych == 'o') goto yy576;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy612:
- YYDEBUG(612, *YYCURSOR);
- yyaccept = 9;
+yy576:
+ YYDEBUG(576, *YYCURSOR);
+ yyaccept = 10;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy601;
- goto yy132;
+ if(yych <= '(') goto yy565;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
- goto yy601;
+ if(yych == '/') goto yy144;
+ goto yy565;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '^') goto yy601;
- goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '^') goto yy565;
+ goto yy144;
} else {
- if(yych <= '`') goto yy601;
- if(yych <= 'z') goto yy144;
- goto yy601;
+ if(yych <= '`') goto yy565;
+ if(yych <= 'z') goto yy148;
+ goto yy565;
}
}
-yy613:
- YYDEBUG(613, *YYCURSOR);
- yyaccept = 0;
+yy577:
+ YYDEBUG(577, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'H'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'I') goto yy603;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'I') goto yy567;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'h'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'i') goto yy614;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'i') goto yy578;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy614:
- YYDEBUG(614, *YYCURSOR);
+yy578:
+ YYDEBUG(578, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'L'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'K') goto yy136;
- goto yy604;
+ if(yych <= 'K') goto yy140;
+ goto yy568;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'l') goto yy615;
- if(yych <= 'z') goto yy145;
+ if(yych == 'l') goto yy579;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy615:
- YYDEBUG(615, *YYCURSOR);
- yyaccept = 0;
+yy579:
+ YYDEBUG(579, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
- if(yych <= 0x1F) goto yy3;
- goto yy423;
+ if(yych == 0x09) goto yy312;
+ if(yych <= 0x1F) goto yy310;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy423;
+ if(yych == ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy312;
}
} else {
if(yych <= 'Z'){
- if(yych <= '/') goto yy140;
- if(yych <= '9') goto yy423;
- if(yych <= '@') goto yy3;
- goto yy137;
+ if(yych <= '/') goto yy144;
+ if(yych <= '9') goto yy312;
+ if(yych <= '@') goto yy310;
+ goto yy141;
} else {
if(yych <= '_'){
- if(yych <= '^') goto yy3;
- goto yy140;
+ if(yych <= '^') goto yy310;
+ goto yy144;
} else {
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy146;
- goto yy3;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy150;
+ goto yy310;
}
}
}
-yy616:
- YYDEBUG(616, *YYCURSOR);
- yyaccept = 0;
+yy580:
+ YYDEBUG(580, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'T'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'U') goto yy606;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'U') goto yy570;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 't'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'u') goto yy617;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'u') goto yy581;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy617:
- YYDEBUG(617, *YYCURSOR);
+yy581:
+ YYDEBUG(581, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy136;
- goto yy607;
+ if(yych <= 'R') goto yy140;
+ goto yy571;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 's') goto yy618;
- if(yych <= 'z') goto yy145;
+ if(yych == 's') goto yy582;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy618:
- YYDEBUG(618, *YYCURSOR);
+yy582:
+ YYDEBUG(582, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy137;
- goto yy608;
+ if(yych <= 'S') goto yy141;
+ goto yy572;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy619;
- if(yych <= 'z') goto yy146;
+ if(yych == 't') goto yy583;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy619:
- YYDEBUG(619, *YYCURSOR);
- yyaccept = 0;
+yy583:
+ YYDEBUG(583, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy423;
- goto yy3;
+ if(yych == 0x09) goto yy312;
+ goto yy310;
} else {
- if(yych <= ' ') goto yy423;
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= ' ') goto yy312;
+ if(yych == ')') goto yy136;
+ goto yy310;
}
} else {
if(yych <= '^'){
- if(yych == '/') goto yy140;
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych == '/') goto yy144;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy147;
- goto yy3;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy151;
+ goto yy310;
}
}
-yy620:
- YYDEBUG(620, *YYCURSOR);
+yy584:
+ YYDEBUG(584, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'B'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy134;
- goto yy634;
+ if(yych <= 'A') goto yy138;
+ goto yy598;
}
} else {
if(yych <= 'a'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'b') goto yy634;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'b') goto yy598;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy621:
- YYDEBUG(621, *YYCURSOR);
+yy585:
+ YYDEBUG(585, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'F') goto yy631;
- if(yych <= 'Q') goto yy134;
- goto yy630;
+ if(yych == 'F') goto yy595;
+ if(yych <= 'Q') goto yy138;
+ goto yy594;
}
} else {
if(yych <= 'f'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- if(yych <= 'e') goto yy134;
- goto yy631;
+ if(yych <= 'e') goto yy138;
+ goto yy595;
} else {
- if(yych == 'r') goto yy630;
- if(yych <= 'z') goto yy134;
+ if(yych == 'r') goto yy594;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy622:
- YYDEBUG(622, *YYCURSOR);
+yy586:
+ YYDEBUG(586, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'T') goto yy134;
- goto yy627;
+ if(yych <= 'T') goto yy138;
+ goto yy591;
}
} else {
if(yych <= 't'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'u') goto yy627;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'u') goto yy591;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy623:
- YYDEBUG(623, *YYCURSOR);
+yy587:
+ YYDEBUG(587, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'I'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'H') goto yy134;
- goto yy624;
+ if(yych <= 'H') goto yy138;
+ goto yy588;
}
} else {
if(yych <= 'h'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'i') goto yy624;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'i') goto yy588;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy624:
- YYDEBUG(624, *YYCURSOR);
+yy588:
+ YYDEBUG(588, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
- if(yych <= '(') goto yy405;
- goto yy132;
+ if(yych <= '(') goto yy283;
+ goto yy136;
} else {
- if(yych <= '@') goto yy405;
- if(yych <= 'C') goto yy135;
- goto yy625;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'C') goto yy139;
+ goto yy589;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy405;
- goto yy135;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy283;
+ goto yy139;
} else {
- if(yych <= 'd') goto yy625;
- if(yych <= 'z') goto yy135;
- goto yy405;
+ if(yych <= 'd') goto yy589;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy625:
- YYDEBUG(625, *YYCURSOR);
+yy589:
+ YYDEBUG(589, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy626;
+ goto yy590;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
goto yy3;
} else {
- if(yych <= 'a') goto yy626;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'a') goto yy590;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy626:
- YYDEBUG(626, *YYCURSOR);
+yy590:
+ YYDEBUG(590, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy137;
- goto yy546;
+ if(yych <= 'X') goto yy141;
+ goto yy510;
}
} else {
if(yych <= 'x'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'y') goto yy546;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'y') goto yy510;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy627:
- YYDEBUG(627, *YYCURSOR);
+yy591:
+ YYDEBUG(591, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy135;
- goto yy628;
+ if(yych <= 'Q') goto yy139;
+ goto yy592;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'r') goto yy628;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'r') goto yy592;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy628:
- YYDEBUG(628, *YYCURSOR);
+yy592:
+ YYDEBUG(592, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy136;
- goto yy629;
+ if(yych <= 'S') goto yy140;
+ goto yy593;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 't') goto yy629;
- if(yych <= 'z') goto yy136;
+ if(yych <= 't') goto yy593;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy629:
- YYDEBUG(629, *YYCURSOR);
+yy593:
+ YYDEBUG(593, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy137;
- goto yy562;
+ if(yych <= 'G') goto yy141;
+ goto yy526;
}
} else {
if(yych <= 'g'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'h') goto yy562;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'h') goto yy526;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy630:
- YYDEBUG(630, *YYCURSOR);
+yy594:
+ YYDEBUG(594, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy135;
- goto yy633;
+ if(yych <= 'R') goto yy139;
+ goto yy597;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 's') goto yy633;
- if(yych <= 'z') goto yy135;
+ if(yych <= 's') goto yy597;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy631:
- YYDEBUG(631, *YYCURSOR);
+yy595:
+ YYDEBUG(595, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy632;
+ if(yych <= 'S') goto yy139;
+ goto yy596;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 't') goto yy632;
- if(yych <= 'z') goto yy135;
+ if(yych <= 't') goto yy596;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy632:
- YYDEBUG(632, *YYCURSOR);
+yy596:
+ YYDEBUG(596, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= 'g'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'h') goto yy376;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'h') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy633:
- YYDEBUG(633, *YYCURSOR);
+yy597:
+ YYDEBUG(597, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy136;
- goto yy376;
+ if(yych <= 'S') goto yy140;
+ goto yy270;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 't') goto yy376;
- if(yych <= 'z') goto yy136;
+ if(yych <= 't') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy634:
- YYDEBUG(634, *YYCURSOR);
- yyaccept = 0;
+yy598:
+ YYDEBUG(598, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'R') goto yy135;
- goto yy635;
+ if(yych != 'R') goto yy139;
+ goto yy599;
}
} else {
if(yych <= 'q'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'r') goto yy635;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'r') goto yy599;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy635:
- YYDEBUG(635, *YYCURSOR);
+yy599:
+ YYDEBUG(599, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'T') goto yy136;
- goto yy636;
+ if(yych <= 'T') goto yy140;
+ goto yy600;
}
} else {
if(yych <= 't'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'u') goto yy636;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'u') goto yy600;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy636:
- YYDEBUG(636, *YYCURSOR);
+yy600:
+ YYDEBUG(600, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy637;
+ goto yy601;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
goto yy3;
} else {
- if(yych <= 'a') goto yy637;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'a') goto yy601;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy637:
- YYDEBUG(637, *YYCURSOR);
+yy601:
+ YYDEBUG(601, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Q'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'R') goto yy638;
+ if(yych <= 'R') goto yy602;
if(yych != 'r') goto yy3;
- goto yy638;
+ goto yy602;
}
-yy638:
- YYDEBUG(638, *YYCURSOR);
+yy602:
+ YYDEBUG(602, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy422;
- if(yych == 'y') goto yy422;
+ if(yych == 'Y') goto yy322;
+ if(yych == 'y') goto yy322;
goto yy53;
-yy639:
- YYDEBUG(639, *YYCURSOR);
+yy603:
+ YYDEBUG(603, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'B'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy134;
- goto yy634;
+ if(yych <= 'A') goto yy138;
+ goto yy598;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'b') goto yy653;
- if(yych <= 'z') goto yy139;
+ if(yych == 'b') goto yy617;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy640:
- YYDEBUG(640, *YYCURSOR);
+yy604:
+ YYDEBUG(604, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= 'E'){
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'F') goto yy631;
- if(yych <= 'Q') goto yy134;
- goto yy630;
+ if(yych <= 'F') goto yy595;
+ if(yych <= 'Q') goto yy138;
+ goto yy594;
}
}
} else {
if(yych <= 'e'){
if(yych <= '^'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- goto yy139;
+ goto yy143;
}
} else {
if(yych <= 'q'){
- if(yych <= 'f') goto yy650;
- goto yy139;
+ if(yych <= 'f') goto yy614;
+ goto yy143;
} else {
- if(yych <= 'r') goto yy649;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'r') goto yy613;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy641:
- YYDEBUG(641, *YYCURSOR);
+yy605:
+ YYDEBUG(605, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'U'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'T') goto yy134;
- goto yy627;
+ if(yych <= 'T') goto yy138;
+ goto yy591;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'u') goto yy646;
- if(yych <= 'z') goto yy139;
+ if(yych == 'u') goto yy610;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy642:
- YYDEBUG(642, *YYCURSOR);
+yy606:
+ YYDEBUG(606, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'I'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'H') goto yy134;
- goto yy624;
+ if(yych <= 'H') goto yy138;
+ goto yy588;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'i') goto yy643;
- if(yych <= 'z') goto yy139;
+ if(yych == 'i') goto yy607;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy643:
- YYDEBUG(643, *YYCURSOR);
+yy607:
+ YYDEBUG(607, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'C') goto yy135;
- goto yy625;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'C') goto yy139;
+ goto yy589;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 'd') goto yy644;
- if(yych <= 'z') goto yy144;
- goto yy405;
+ if(yych == 'd') goto yy608;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy644:
- YYDEBUG(644, *YYCURSOR);
+yy608:
+ YYDEBUG(608, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy626;
+ goto yy590;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy645;
- if(yych <= 'z') goto yy145;
+ if(yych <= 'a') goto yy609;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy645:
- YYDEBUG(645, *YYCURSOR);
+yy609:
+ YYDEBUG(609, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy137;
- goto yy546;
+ if(yych <= 'X') goto yy141;
+ goto yy510;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy575;
- if(yych <= 'z') goto yy146;
+ if(yych == 'y') goto yy539;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy646:
- YYDEBUG(646, *YYCURSOR);
+yy610:
+ YYDEBUG(610, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy135;
- goto yy628;
+ if(yych <= 'Q') goto yy139;
+ goto yy592;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy647;
- if(yych <= 'z') goto yy144;
+ if(yych == 'r') goto yy611;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy647:
- YYDEBUG(647, *YYCURSOR);
+yy611:
+ YYDEBUG(611, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy136;
- goto yy629;
+ if(yych <= 'S') goto yy140;
+ goto yy593;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy648;
- if(yych <= 'z') goto yy145;
+ if(yych == 't') goto yy612;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy648:
- YYDEBUG(648, *YYCURSOR);
+yy612:
+ YYDEBUG(612, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy137;
- goto yy562;
+ if(yych <= 'G') goto yy141;
+ goto yy526;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy591;
- if(yych <= 'z') goto yy146;
+ if(yych == 'h') goto yy555;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy649:
- YYDEBUG(649, *YYCURSOR);
+yy613:
+ YYDEBUG(613, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy135;
- goto yy633;
+ if(yych <= 'R') goto yy139;
+ goto yy597;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 's') goto yy652;
- if(yych <= 'z') goto yy144;
+ if(yych == 's') goto yy616;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy650:
- YYDEBUG(650, *YYCURSOR);
+yy614:
+ YYDEBUG(614, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy632;
+ if(yych <= 'S') goto yy139;
+ goto yy596;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy651;
- if(yych <= 'z') goto yy144;
+ if(yych == 't') goto yy615;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy651:
- YYDEBUG(651, *YYCURSOR);
+yy615:
+ YYDEBUG(615, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 'h') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy652:
- YYDEBUG(652, *YYCURSOR);
+yy616:
+ YYDEBUG(616, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy136;
- goto yy376;
+ if(yych <= 'S') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 't') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy653:
- YYDEBUG(653, *YYCURSOR);
- yyaccept = 0;
+yy617:
+ YYDEBUG(617, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'Q'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'R') goto yy635;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'R') goto yy599;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'q'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'r') goto yy654;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'r') goto yy618;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy654:
- YYDEBUG(654, *YYCURSOR);
+yy618:
+ YYDEBUG(618, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'U'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'T') goto yy136;
- goto yy636;
+ if(yych <= 'T') goto yy140;
+ goto yy600;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'u') goto yy655;
- if(yych <= 'z') goto yy145;
+ if(yych == 'u') goto yy619;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy655:
- YYDEBUG(655, *YYCURSOR);
+yy619:
+ YYDEBUG(619, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy637;
+ goto yy601;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy656;
- if(yych <= 'z') goto yy146;
+ if(yych <= 'a') goto yy620;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy656:
- YYDEBUG(656, *YYCURSOR);
+yy620:
+ YYDEBUG(620, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'Q') goto yy3;
- goto yy638;
+ goto yy602;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy657;
- if(yych <= 'z') goto yy147;
+ if(yych == 'r') goto yy621;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy657:
- YYDEBUG(657, *YYCURSOR);
+yy621:
+ YYDEBUG(621, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy53;
- goto yy140;
- } else {
- if(yych == 'Y') goto yy422;
- goto yy53;
- }
- } else {
- if(yych <= 'x'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy53;
- goto yy147;
- } else {
- if(yych <= 'y') goto yy528;
- if(yych <= 'z') goto yy147;
- goto yy53;
- }
- }
-yy658:
- YYDEBUG(658, *YYCURSOR);
+ if(yych == 'Y') goto yy322;
+ if(yych == 'y') goto yy492;
+ goto yy152;
+yy622:
+ YYDEBUG(622, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'L') goto yy665;
- if(yych <= 'M') goto yy134;
- goto yy664;
+ if(yych == 'L') goto yy629;
+ if(yych <= 'M') goto yy138;
+ goto yy628;
}
} else {
if(yych <= 'l'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- if(yych <= 'k') goto yy134;
- goto yy665;
+ if(yych <= 'k') goto yy138;
+ goto yy629;
} else {
- if(yych == 'n') goto yy664;
- if(yych <= 'z') goto yy134;
+ if(yych == 'n') goto yy628;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy659:
- YYDEBUG(659, *YYCURSOR);
+yy623:
+ YYDEBUG(623, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy660;
+ if(yych <= 'M') goto yy138;
+ goto yy624;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'n') goto yy660;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'n') goto yy624;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy660:
- YYDEBUG(660, *YYCURSOR);
- yyaccept = 0;
+yy624:
+ YYDEBUG(624, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'U') goto yy135;
- goto yy661;
+ if(yych != 'U') goto yy139;
+ goto yy625;
}
} else {
if(yych <= 't'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'u') goto yy661;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'u') goto yy625;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy661:
- YYDEBUG(661, *YYCURSOR);
+yy625:
+ YYDEBUG(625, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy662;
+ goto yy626;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
goto yy3;
} else {
- if(yych <= 'a') goto yy662;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'a') goto yy626;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy662:
- YYDEBUG(662, *YYCURSOR);
+yy626:
+ YYDEBUG(626, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy137;
- goto yy663;
+ if(yych <= 'Q') goto yy141;
+ goto yy627;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'r') goto yy663;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'r') goto yy627;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy663:
- YYDEBUG(663, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
+yy627:
+ YYDEBUG(627, *YYCURSOR);
+ yych = *++YYCURSOR;
if(yych <= 'X'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Y') goto yy422;
- if(yych == 'y') goto yy422;
+ if(yych <= 'Y') goto yy322;
+ if(yych == 'y') goto yy322;
goto yy3;
}
-yy664:
- YYDEBUG(664, *YYCURSOR);
- yyaccept = 0;
+yy628:
+ YYDEBUG(628, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych == 'E') goto yy666;
- goto yy135;
+ if(yych == 'E') goto yy630;
+ goto yy139;
}
} else {
if(yych <= 'd'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'e') goto yy666;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'e') goto yy630;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy665:
- YYDEBUG(665, *YYCURSOR);
- yyaccept = 0;
+yy629:
+ YYDEBUG(629, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'Y') goto yy135;
- goto yy666;
+ if(yych != 'Y') goto yy139;
+ goto yy630;
}
} else {
if(yych <= 'x'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'y') goto yy666;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'y') goto yy630;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy666:
- YYDEBUG(666, *YYCURSOR);
- yyaccept = 0;
+yy630:
+ YYDEBUG(630, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy423;
- goto yy3;
+ if(yych == 0x09) goto yy312;
+ goto yy310;
} else {
- if(yych <= ' ') goto yy423;
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= ' ') goto yy312;
+ if(yych == ')') goto yy136;
+ goto yy310;
}
} else {
if(yych <= '@'){
- if(yych == '/') goto yy3;
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych == '/') goto yy310;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych <= 'Z') goto yy136;
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy136;
- goto yy3;
+ if(yych <= 'Z') goto yy140;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy140;
+ goto yy310;
}
}
-yy667:
- YYDEBUG(667, *YYCURSOR);
+yy631:
+ YYDEBUG(631, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= 'K'){
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'L') goto yy665;
- if(yych <= 'M') goto yy134;
- goto yy664;
+ if(yych <= 'L') goto yy629;
+ if(yych <= 'M') goto yy138;
+ goto yy628;
}
}
} else {
if(yych <= 'k'){
if(yych <= '^'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- goto yy139;
+ goto yy143;
}
} else {
if(yych <= 'm'){
- if(yych <= 'l') goto yy674;
- goto yy139;
+ if(yych <= 'l') goto yy638;
+ goto yy143;
} else {
- if(yych <= 'n') goto yy673;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'n') goto yy637;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy668:
- YYDEBUG(668, *YYCURSOR);
+yy632:
+ YYDEBUG(632, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy660;
+ if(yych <= 'M') goto yy138;
+ goto yy624;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy669;
- if(yych <= 'z') goto yy139;
+ if(yych == 'n') goto yy633;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy669:
- YYDEBUG(669, *YYCURSOR);
- yyaccept = 0;
+yy633:
+ YYDEBUG(633, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'T'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'U') goto yy661;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'U') goto yy625;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 't'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'u') goto yy670;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'u') goto yy634;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy670:
- YYDEBUG(670, *YYCURSOR);
+yy634:
+ YYDEBUG(634, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy662;
+ goto yy626;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy671;
- if(yych <= 'z') goto yy145;
+ if(yych <= 'a') goto yy635;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy671:
- YYDEBUG(671, *YYCURSOR);
+yy635:
+ YYDEBUG(635, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy137;
- goto yy663;
+ if(yych <= 'Q') goto yy141;
+ goto yy627;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy672;
- if(yych <= 'z') goto yy146;
+ if(yych == 'r') goto yy636;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy672:
- YYDEBUG(672, *YYCURSOR);
+yy636:
+ YYDEBUG(636, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'X') goto yy3;
- goto yy422;
+ goto yy322;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy528;
- if(yych <= 'z') goto yy147;
+ if(yych == 'y') goto yy492;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy673:
- YYDEBUG(673, *YYCURSOR);
- yyaccept = 0;
+yy637:
+ YYDEBUG(637, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'D'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'E') goto yy666;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'E') goto yy630;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'd'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'e') goto yy675;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'e') goto yy639;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy674:
- YYDEBUG(674, *YYCURSOR);
- yyaccept = 0;
+yy638:
+ YYDEBUG(638, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'X'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'Y') goto yy666;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'Y') goto yy630;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'x'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'y') goto yy675;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'y') goto yy639;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy675:
- YYDEBUG(675, *YYCURSOR);
- yyaccept = 0;
+yy639:
+ YYDEBUG(639, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
- if(yych <= 0x1F) goto yy3;
- goto yy423;
+ if(yych == 0x09) goto yy312;
+ if(yych <= 0x1F) goto yy310;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy423;
+ if(yych == ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy312;
}
} else {
if(yych <= 'Z'){
- if(yych <= '/') goto yy140;
- if(yych <= '9') goto yy423;
- if(yych <= '@') goto yy3;
- goto yy136;
+ if(yych <= '/') goto yy144;
+ if(yych <= '9') goto yy312;
+ if(yych <= '@') goto yy310;
+ goto yy140;
} else {
if(yych <= '_'){
- if(yych <= '^') goto yy3;
- goto yy140;
+ if(yych <= '^') goto yy310;
+ goto yy144;
} else {
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy145;
- goto yy3;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy149;
+ goto yy310;
}
}
}
-yy676:
- YYDEBUG(676, *YYCURSOR);
+yy640:
+ YYDEBUG(640, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
if(yych <= 0x1F) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= ',') goto yy3;
- goto yy423;
+ goto yy312;
}
} else {
if(yych <= 'H'){
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
if(yych <= 'Z'){
- if(yych >= 'J') goto yy134;
- goto yy677;
+ if(yych >= 'J') goto yy138;
+ goto yy641;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
}
-yy677:
- YYDEBUG(677, *YYCURSOR);
+yy641:
+ YYDEBUG(641, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
goto yy3;
} else {
- if(yych <= ' ') goto yy423;
- if(yych == ')') goto yy132;
+ if(yych <= ' ') goto yy312;
+ if(yych == ')') goto yy136;
goto yy3;
}
} else {
if(yych <= '@'){
if(yych == '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
goto yy3;
} else {
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy678:
- YYDEBUG(678, *YYCURSOR);
+yy642:
+ YYDEBUG(642, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
if(yych <= 0x1F) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= ',') goto yy3;
- goto yy423;
+ goto yy312;
}
} else {
if(yych <= 'H'){
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
if(yych <= 'Z'){
- if(yych >= 'J') goto yy134;
- goto yy679;
+ if(yych >= 'J') goto yy138;
+ goto yy643;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
}
-yy679:
- YYDEBUG(679, *YYCURSOR);
+yy643:
+ YYDEBUG(643, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
if(yych <= 0x1F) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= ',') goto yy3;
- goto yy423;
+ goto yy312;
}
} else {
if(yych <= 'H'){
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
if(yych <= '@') goto yy3;
- goto yy135;
+ goto yy139;
} else {
if(yych <= 'Z'){
- if(yych <= 'I') goto yy666;
- goto yy135;
+ if(yych >= 'J') goto yy139;
+ goto yy644;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
}
-yy680:
- YYDEBUG(680, *YYCURSOR);
+yy644:
+ YYDEBUG(644, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
goto yy3;
} else {
- if(yych <= ' ') goto yy423;
- if(yych == ')') goto yy132;
+ if(yych <= ' ') goto yy312;
+ if(yych == ')') goto yy136;
goto yy3;
}
} else {
if(yych <= '@'){
if(yych == '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
goto yy3;
} else {
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy681:
- YYDEBUG(681, *YYCURSOR);
+yy645:
+ YYDEBUG(645, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ','){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy312;
+ goto yy3;
+ } else {
+ if(yych <= ' ') goto yy312;
+ if(yych == ')') goto yy136;
+ goto yy3;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych == '/') goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy138;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy138;
+ goto yy3;
+ }
+ }
+yy646:
+ YYDEBUG(646, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
if(yych <= 0x1F) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= ',') goto yy3;
- goto yy423;
+ goto yy312;
}
} else {
if(yych <= 'H'){
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
if(yych <= 'Z'){
- if(yych <= 'I') goto yy677;
- goto yy134;
+ if(yych <= 'I') goto yy641;
+ goto yy138;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
}
-yy682:
- YYDEBUG(682, *YYCURSOR);
+yy647:
+ YYDEBUG(647, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy684;
- if(yych <= '0') goto yy932;
- if(yych <= '1') goto yy933;
- if(yych <= '9') goto yy934;
- goto yy684;
-yy683:
- YYDEBUG(683, *YYCURSOR);
+ if(yych <= '/') goto yy649;
+ if(yych <= '0') goto yy897;
+ if(yych <= '1') goto yy898;
+ if(yych <= '9') goto yy899;
+ goto yy649;
+yy648:
+ YYDEBUG(648, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
yych = *YYCURSOR;
- goto yy684;
-yy684:
- YYDEBUG(684, *YYCURSOR);
+ goto yy649;
+yy649:
+ YYDEBUG(649, *YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: case ' ': goto yy683;
+ case 0x09: case ' ': goto yy648;
case '-':
- case '.': goto yy783;
- case 'A': case 'a': goto yy702;
- case 'D': case 'd': goto yy688;
- case 'F': case 'f': goto yy689;
+ case '.': goto yy748;
+ case 'A': case 'a': goto yy667;
+ case 'D': case 'd': goto yy653;
+ case 'F': case 'f': goto yy654;
case 'H': case 'h': goto yy60;
- case 'I': goto yy697;
- case 'J': case 'j': goto yy701;
- case 'M': case 'm': goto yy687;
- case 'N': case 'n': goto yy704;
- case 'O': case 'o': goto yy703;
- case 'P': case 'p': goto yy706;
- case 'S': case 's': goto yy685;
+ case 'I': goto yy662;
+ case 'J': case 'j': goto yy666;
+ case 'M': case 'm': goto yy652;
+ case 'N': case 'n': goto yy669;
+ case 'O': case 'o': goto yy668;
+ case 'P': case 'p': goto yy671;
+ case 'S': case 's': goto yy650;
case 'T': case 't': goto yy65;
- case 'V': goto yy699;
+ case 'V': goto yy664;
case 'W': case 'w': goto yy62;
- case 'X': goto yy700;
+ case 'X': goto yy665;
case 'Y': case 'y': goto yy64;
default: goto yy53;
}
-yy685:
- YYDEBUG(685, *YYCURSOR);
+yy650:
+ YYDEBUG(650, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= 'D'){
- if(yych == 'A') goto yy119;
+ if(yych == 'A') goto yy123;
goto yy53;
} else {
- if(yych <= 'E') goto yy1228;
+ if(yych <= 'E') goto yy1196;
if(yych <= 'T') goto yy53;
- goto yy118;
+ goto yy122;
}
} else {
if(yych <= 'd'){
- if(yych == 'a') goto yy119;
+ if(yych == 'a') goto yy123;
goto yy53;
} else {
- if(yych <= 'e') goto yy1228;
- if(yych == 'u') goto yy118;
+ if(yych <= 'e') goto yy1196;
+ if(yych == 'u') goto yy122;
goto yy53;
}
}
-yy686:
- YYDEBUG(686, *YYCURSOR);
+yy651:
+ YYDEBUG(651, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '`'){
if(yych <= 'D'){
- if(yych == 'A') goto yy119;
+ if(yych == 'A') goto yy123;
goto yy53;
} else {
- if(yych <= 'E') goto yy1228;
- if(yych == 'U') goto yy118;
+ if(yych <= 'E') goto yy1196;
+ if(yych == 'U') goto yy122;
goto yy53;
}
} else {
if(yych <= 'e'){
- if(yych <= 'a') goto yy119;
+ if(yych <= 'a') goto yy123;
if(yych <= 'd') goto yy53;
- goto yy1228;
+ goto yy1196;
} else {
if(yych <= 's') goto yy53;
- if(yych <= 't') goto yy929;
- if(yych <= 'u') goto yy118;
+ if(yych <= 't') goto yy894;
+ if(yych <= 'u') goto yy122;
goto yy53;
}
}
-yy687:
- YYDEBUG(687, *YYCURSOR);
+yy652:
+ YYDEBUG(652, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= 'H'){
- if(yych == 'A') goto yy798;
+ if(yych == 'A') goto yy763;
goto yy53;
} else {
- if(yych <= 'I') goto yy110;
+ if(yych <= 'I') goto yy114;
if(yych <= 'N') goto yy53;
- goto yy109;
+ goto yy113;
}
} else {
if(yych <= 'h'){
- if(yych == 'a') goto yy798;
+ if(yych == 'a') goto yy763;
goto yy53;
} else {
- if(yych <= 'i') goto yy110;
- if(yych == 'o') goto yy109;
+ if(yych <= 'i') goto yy114;
+ if(yych == 'o') goto yy113;
goto yy53;
}
}
-yy688:
- YYDEBUG(688, *YYCURSOR);
+yy653:
+ YYDEBUG(653, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
- if(yych == 'A') goto yy106;
+ if(yych == 'A') goto yy110;
if(yych <= 'D') goto yy53;
- goto yy785;
+ goto yy750;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy106;
+ goto yy110;
} else {
- if(yych == 'e') goto yy785;
+ if(yych == 'e') goto yy750;
goto yy53;
}
}
-yy689:
- YYDEBUG(689, *YYCURSOR);
+yy654:
+ YYDEBUG(654, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= 'N'){
- if(yych == 'E') goto yy801;
+ if(yych == 'E') goto yy766;
goto yy53;
} else {
if(yych <= 'O') goto yy83;
@@ -12831,7 +12327,7 @@ yy689:
}
} else {
if(yych <= 'n'){
- if(yych == 'e') goto yy801;
+ if(yych == 'e') goto yy766;
goto yy53;
} else {
if(yych <= 'o') goto yy83;
@@ -12839,8 +12335,8 @@ yy689:
goto yy53;
}
}
-yy690:
- YYDEBUG(690, *YYCURSOR);
+yy655:
+ YYDEBUG(655, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych == 'H') goto yy66;
@@ -12849,67 +12345,67 @@ yy690:
} else {
if(yych <= 'h'){
if(yych <= 'g') goto yy53;
- goto yy1227;
+ goto yy1195;
} else {
if(yych == 'u') goto yy67;
goto yy53;
}
}
-yy691:
- YYDEBUG(691, *YYCURSOR);
+yy656:
+ YYDEBUG(656, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '-') goto yy936;
+ if(yych == '-') goto yy901;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy935;
+ if(yych <= '9') goto yy900;
goto yy57;
-yy692:
- YYDEBUG(692, *YYCURSOR);
+yy657:
+ YYDEBUG(657, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'c'){
- if(yych == 'O') goto yy736;
+ if(yych == 'O') goto yy701;
goto yy53;
} else {
- if(yych <= 'd') goto yy929;
- if(yych == 'o') goto yy736;
+ if(yych <= 'd') goto yy894;
+ if(yych == 'o') goto yy701;
goto yy53;
}
-yy693:
- YYDEBUG(693, *YYCURSOR);
+yy658:
+ YYDEBUG(658, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy929;
+ if(yych == 'd') goto yy894;
goto yy53;
-yy694:
- YYDEBUG(694, *YYCURSOR);
+yy659:
+ YYDEBUG(659, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(-1, yych);
switch(yych){
case '0':
case '1':
- case '2': goto yy869;
- case '3': goto yy871;
+ case '2': goto yy834;
+ case '3': goto yy836;
case '4':
case '5':
case '6':
case '7':
case '8':
- case '9': goto yy872;
- case 'A': case 'a': goto yy876;
- case 'D': case 'd': goto yy880;
- case 'F': case 'f': goto yy874;
- case 'J': case 'j': goto yy873;
- case 'M': case 'm': goto yy875;
- case 'N': case 'n': goto yy879;
- case 'O': case 'o': goto yy878;
- case 'S': case 's': goto yy877;
+ case '9': goto yy837;
+ case 'A': case 'a': goto yy841;
+ case 'D': case 'd': goto yy845;
+ case 'F': case 'f': goto yy839;
+ case 'J': case 'j': goto yy838;
+ case 'M': case 'm': goto yy840;
+ case 'N': case 'n': goto yy844;
+ case 'O': case 'o': goto yy843;
+ case 'S': case 's': goto yy842;
default: goto yy53;
}
-yy695:
- YYDEBUG(695, *YYCURSOR);
+yy660:
+ YYDEBUG(660, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(-1, yych);
switch(yych){
- case '0': goto yy819;
- case '1': goto yy820;
+ case '0': goto yy784;
+ case '1': goto yy785;
case '2':
case '3':
case '4':
@@ -12917,56 +12413,56 @@ yy695:
case '6':
case '7':
case '8':
- case '9': goto yy821;
- case 'A': case 'a': goto yy825;
- case 'D': case 'd': goto yy829;
- case 'F': case 'f': goto yy823;
- case 'J': case 'j': goto yy822;
- case 'M': case 'm': goto yy824;
- case 'N': case 'n': goto yy828;
- case 'O': case 'o': goto yy827;
- case 'S': case 's': goto yy826;
- default: goto yy784;
+ case '9': goto yy786;
+ case 'A': case 'a': goto yy790;
+ case 'D': case 'd': goto yy794;
+ case 'F': case 'f': goto yy788;
+ case 'J': case 'j': goto yy787;
+ case 'M': case 'm': goto yy789;
+ case 'N': case 'n': goto yy793;
+ case 'O': case 'o': goto yy792;
+ case 'S': case 's': goto yy791;
+ default: goto yy749;
}
-yy696:
- YYDEBUG(696, *YYCURSOR);
+yy661:
+ YYDEBUG(661, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '1'){
- if(yych <= '/') goto yy784;
- if(yych <= '0') goto yy774;
- goto yy775;
+ if(yych <= '/') goto yy749;
+ if(yych <= '0') goto yy739;
+ goto yy740;
} else {
- if(yych <= '5') goto yy776;
- if(yych <= '9') goto yy777;
- goto yy784;
+ if(yych <= '5') goto yy741;
+ if(yych <= '9') goto yy742;
+ goto yy749;
}
-yy697:
- YYDEBUG(697, *YYCURSOR);
- yyaccept = 10;
+yy662:
+ YYDEBUG(662, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '.') goto yy738;
- goto yy698;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '.') goto yy703;
+ goto yy663;
}
} else {
if(yych <= 'U'){
- if(yych <= '9') goto yy740;
- if(yych == 'I') goto yy773;
- goto yy698;
+ if(yych <= '9') goto yy705;
+ if(yych == 'I') goto yy738;
+ goto yy663;
} else {
- if(yych == 'W') goto yy698;
- if(yych <= 'X') goto yy746;
- goto yy698;
+ if(yych == 'W') goto yy663;
+ if(yych <= 'X') goto yy711;
+ goto yy663;
}
}
-yy698:
- YYDEBUG(698, *YYCURSOR);
+yy663:
+ YYDEBUG(663, *YYCURSOR);
{
DEBUG_OUTPUT("datenoyearrev");
@@ -12978,154 +12474,154 @@ yy698:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
-yy699:
- YYDEBUG(699, *YYCURSOR);
- yyaccept = 10;
+yy664:
+ YYDEBUG(664, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '9'){
- if(yych <= '.') goto yy738;
- if(yych <= '/') goto yy698;
- goto yy740;
+ if(yych <= '.') goto yy703;
+ if(yych <= '/') goto yy663;
+ goto yy705;
} else {
- if(yych == 'I') goto yy771;
- goto yy698;
+ if(yych == 'I') goto yy736;
+ goto yy663;
}
}
-yy700:
- YYDEBUG(700, *YYCURSOR);
- yyaccept = 10;
+yy665:
+ YYDEBUG(665, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '9'){
- if(yych <= '.') goto yy738;
- if(yych <= '/') goto yy698;
- goto yy740;
+ if(yych <= '.') goto yy703;
+ if(yych <= '/') goto yy663;
+ goto yy705;
} else {
- if(yych == 'I') goto yy770;
- goto yy698;
+ if(yych == 'I') goto yy735;
+ goto yy663;
}
}
-yy701:
- YYDEBUG(701, *YYCURSOR);
+yy666:
+ YYDEBUG(666, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'A') goto yy763;
+ if(yych == 'A') goto yy728;
if(yych <= 'T') goto yy53;
- goto yy762;
+ goto yy727;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy763;
+ goto yy728;
} else {
- if(yych == 'u') goto yy762;
+ if(yych == 'u') goto yy727;
goto yy53;
}
}
-yy702:
- YYDEBUG(702, *YYCURSOR);
+yy667:
+ YYDEBUG(667, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= 'L'){
- if(yych == '.') goto yy707;
+ if(yych == '.') goto yy672;
goto yy53;
} else {
- if(yych <= 'M') goto yy708;
- if(yych == 'P') goto yy756;
+ if(yych <= 'M') goto yy673;
+ if(yych == 'P') goto yy721;
goto yy53;
}
} else {
if(yych <= 'o'){
- if(yych <= 'U') goto yy755;
- if(yych == 'm') goto yy708;
+ if(yych <= 'U') goto yy720;
+ if(yych == 'm') goto yy673;
goto yy53;
} else {
- if(yych <= 'p') goto yy756;
- if(yych == 'u') goto yy755;
+ if(yych <= 'p') goto yy721;
+ if(yych == 'u') goto yy720;
goto yy53;
}
}
-yy703:
- YYDEBUG(703, *YYCURSOR);
+yy668:
+ YYDEBUG(668, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy750;
- if(yych == 'c') goto yy750;
+ if(yych == 'C') goto yy715;
+ if(yych == 'c') goto yy715;
goto yy53;
-yy704:
- YYDEBUG(704, *YYCURSOR);
+yy669:
+ YYDEBUG(669, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy736;
- if(yych == 'o') goto yy736;
+ if(yych == 'O') goto yy701;
+ if(yych == 'o') goto yy701;
goto yy53;
-yy705:
- YYDEBUG(705, *YYCURSOR);
+yy670:
+ YYDEBUG(670, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy712;
- if(yych <= '9') goto yy714;
+ if(yych <= '5') goto yy677;
+ if(yych <= '9') goto yy679;
goto yy53;
-yy706:
- YYDEBUG(706, *YYCURSOR);
+yy671:
+ YYDEBUG(671, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych != '.') goto yy53;
- goto yy707;
+ goto yy672;
} else {
- if(yych <= 'M') goto yy708;
- if(yych == 'm') goto yy708;
+ if(yych <= 'M') goto yy673;
+ if(yych == 'm') goto yy673;
goto yy53;
}
-yy707:
- YYDEBUG(707, *YYCURSOR);
+yy672:
+ YYDEBUG(672, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy708;
+ if(yych == 'M') goto yy673;
if(yych != 'm') goto yy53;
- goto yy708;
-yy708:
- YYDEBUG(708, *YYCURSOR);
+ goto yy673;
+yy673:
+ YYDEBUG(673, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 0x1F){
- if(yych <= 0x00) goto yy710;
- if(yych == 0x09) goto yy710;
+ if(yych <= 0x00) goto yy675;
+ if(yych == 0x09) goto yy675;
goto yy53;
} else {
- if(yych <= ' ') goto yy710;
+ if(yych <= ' ') goto yy675;
if(yych != '.') goto yy53;
- goto yy709;
+ goto yy674;
}
-yy709:
- YYDEBUG(709, *YYCURSOR);
+yy674:
+ YYDEBUG(674, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 0x09){
- if(yych <= 0x00) goto yy710;
+ if(yych <= 0x00) goto yy675;
if(yych <= 0x08) goto yy53;
- goto yy710;
+ goto yy675;
} else {
if(yych != ' ') goto yy53;
- goto yy710;
+ goto yy675;
}
-yy710:
- YYDEBUG(710, *YYCURSOR);
+yy675:
+ YYDEBUG(675, *YYCURSOR);
++YYCURSOR;
- goto yy711;
-yy711:
- YYDEBUG(711, *YYCURSOR);
+ goto yy676;
+yy676:
+ YYDEBUG(676, *YYCURSOR);
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
@@ -13142,20 +12638,20 @@ yy711:
TIMELIB_DEINIT;
return TIMELIB_TIME12;
}
-yy712:
- YYDEBUG(712, *YYCURSOR);
- yyaccept = 11;
+yy677:
+ YYDEBUG(677, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy715;
- goto yy713;
+ if(yych == '.') goto yy680;
+ goto yy678;
} else {
- if(yych <= '9') goto yy729;
- if(yych <= ':') goto yy715;
- goto yy713;
+ if(yych <= '9') goto yy694;
+ if(yych <= ':') goto yy680;
+ goto yy678;
}
-yy713:
- YYDEBUG(713, *YYCURSOR);
+yy678:
+ YYDEBUG(678, *YYCURSOR);
{
int tz_not_found;
@@ -13181,306 +12677,306 @@ yy713:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
-yy714:
- YYDEBUG(714, *YYCURSOR);
- yyaccept = 11;
+yy679:
+ YYDEBUG(679, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy715;
- if(yych != ':') goto yy713;
- goto yy715;
-yy715:
- YYDEBUG(715, *YYCURSOR);
+ if(yych == '.') goto yy680;
+ if(yych != ':') goto yy678;
+ goto yy680;
+yy680:
+ YYDEBUG(680, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy716;
- if(yych <= '6') goto yy717;
- if(yych <= '9') goto yy718;
+ if(yych <= '5') goto yy681;
+ if(yych <= '6') goto yy682;
+ if(yych <= '9') goto yy683;
goto yy53;
-yy716:
- YYDEBUG(716, *YYCURSOR);
- yyaccept = 11;
+yy681:
+ YYDEBUG(681, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy722;
- goto yy713;
-yy717:
- YYDEBUG(717, *YYCURSOR);
- yyaccept = 11;
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy687;
+ goto yy678;
+yy682:
+ YYDEBUG(682, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych == '0') goto yy722;
- goto yy713;
-yy718:
- YYDEBUG(718, *YYCURSOR);
- yyaccept = 11;
+ if(yych == '.') goto yy684;
+ if(yych == '0') goto yy687;
+ goto yy678;
+yy683:
+ YYDEBUG(683, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych != '.') goto yy713;
- goto yy719;
-yy719:
- YYDEBUG(719, *YYCURSOR);
+ if(yych != '.') goto yy678;
+ goto yy684;
+yy684:
+ YYDEBUG(684, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy720;
-yy720:
- YYDEBUG(720, *YYCURSOR);
+ goto yy685;
+yy685:
+ YYDEBUG(685, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy721;
-yy721:
- YYDEBUG(721, *YYCURSOR);
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy720;
- goto yy713;
-yy722:
- YYDEBUG(722, *YYCURSOR);
- yyaccept = 11;
+ goto yy686;
+yy686:
+ YYDEBUG(686, *YYCURSOR);
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy685;
+ goto yy678;
+yy687:
+ YYDEBUG(687, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= 0x1F){
- if(yych != 0x09) goto yy713;
- goto yy723;
+ if(yych != 0x09) goto yy678;
+ goto yy688;
} else {
- if(yych <= ' ') goto yy723;
- if(yych == '.') goto yy719;
- goto yy713;
+ if(yych <= ' ') goto yy688;
+ if(yych == '.') goto yy684;
+ goto yy678;
}
} else {
if(yych <= '`'){
- if(yych <= 'A') goto yy725;
- if(yych == 'P') goto yy725;
- goto yy713;
+ if(yych <= 'A') goto yy690;
+ if(yych == 'P') goto yy690;
+ goto yy678;
} else {
- if(yych <= 'a') goto yy725;
- if(yych == 'p') goto yy725;
- goto yy713;
+ if(yych <= 'a') goto yy690;
+ if(yych == 'p') goto yy690;
+ goto yy678;
}
}
-yy723:
- YYDEBUG(723, *YYCURSOR);
+yy688:
+ YYDEBUG(688, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
yych = *YYCURSOR;
- goto yy724;
-yy724:
- YYDEBUG(724, *YYCURSOR);
+ goto yy689;
+yy689:
+ YYDEBUG(689, *YYCURSOR);
if(yych <= 'A'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy723;
+ if(yych == 0x09) goto yy688;
goto yy53;
} else {
- if(yych <= ' ') goto yy723;
+ if(yych <= ' ') goto yy688;
if(yych <= '@') goto yy53;
- goto yy725;
+ goto yy690;
}
} else {
if(yych <= '`'){
if(yych != 'P') goto yy53;
- goto yy725;
+ goto yy690;
} else {
- if(yych <= 'a') goto yy725;
+ if(yych <= 'a') goto yy690;
if(yych != 'p') goto yy53;
- goto yy725;
+ goto yy690;
}
}
-yy725:
- YYDEBUG(725, *YYCURSOR);
+yy690:
+ YYDEBUG(690, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych != '.') goto yy53;
- goto yy726;
+ goto yy691;
} else {
- if(yych <= 'M') goto yy727;
- if(yych == 'm') goto yy727;
+ if(yych <= 'M') goto yy692;
+ if(yych == 'm') goto yy692;
goto yy53;
}
-yy726:
- YYDEBUG(726, *YYCURSOR);
+yy691:
+ YYDEBUG(691, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy727;
+ if(yych == 'M') goto yy692;
if(yych != 'm') goto yy53;
- goto yy727;
-yy727:
- YYDEBUG(727, *YYCURSOR);
+ goto yy692;
+yy692:
+ YYDEBUG(692, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 0x1F){
- if(yych <= 0x00) goto yy710;
- if(yych == 0x09) goto yy710;
+ if(yych <= 0x00) goto yy675;
+ if(yych == 0x09) goto yy675;
goto yy53;
} else {
- if(yych <= ' ') goto yy710;
+ if(yych <= ' ') goto yy675;
if(yych != '.') goto yy53;
- goto yy728;
+ goto yy693;
}
-yy728:
- YYDEBUG(728, *YYCURSOR);
+yy693:
+ YYDEBUG(693, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 0x09){
- if(yych <= 0x00) goto yy710;
+ if(yych <= 0x00) goto yy675;
if(yych <= 0x08) goto yy53;
- goto yy710;
+ goto yy675;
} else {
- if(yych == ' ') goto yy710;
+ if(yych == ' ') goto yy675;
goto yy53;
}
-yy729:
- YYDEBUG(729, *YYCURSOR);
- yyaccept = 11;
+yy694:
+ YYDEBUG(694, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ':'){
if(yych <= ' '){
- if(yych == 0x09) goto yy730;
- if(yych <= 0x1F) goto yy713;
- goto yy730;
+ if(yych == 0x09) goto yy695;
+ if(yych <= 0x1F) goto yy678;
+ goto yy695;
} else {
- if(yych == '.') goto yy715;
- if(yych <= '9') goto yy713;
- goto yy715;
+ if(yych == '.') goto yy680;
+ if(yych <= '9') goto yy678;
+ goto yy680;
}
} else {
if(yych <= 'P'){
- if(yych == 'A') goto yy732;
- if(yych <= 'O') goto yy713;
- goto yy732;
+ if(yych == 'A') goto yy697;
+ if(yych <= 'O') goto yy678;
+ goto yy697;
} else {
if(yych <= 'a'){
- if(yych <= '`') goto yy713;
- goto yy732;
+ if(yych <= '`') goto yy678;
+ goto yy697;
} else {
- if(yych == 'p') goto yy732;
- goto yy713;
+ if(yych == 'p') goto yy697;
+ goto yy678;
}
}
}
-yy730:
- YYDEBUG(730, *YYCURSOR);
+yy695:
+ YYDEBUG(695, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
yych = *YYCURSOR;
- goto yy731;
-yy731:
- YYDEBUG(731, *YYCURSOR);
+ goto yy696;
+yy696:
+ YYDEBUG(696, *YYCURSOR);
if(yych <= 'A'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy730;
+ if(yych == 0x09) goto yy695;
goto yy53;
} else {
- if(yych <= ' ') goto yy730;
+ if(yych <= ' ') goto yy695;
if(yych <= '@') goto yy53;
- goto yy732;
+ goto yy697;
}
} else {
if(yych <= '`'){
if(yych != 'P') goto yy53;
- goto yy732;
+ goto yy697;
} else {
- if(yych <= 'a') goto yy732;
+ if(yych <= 'a') goto yy697;
if(yych != 'p') goto yy53;
- goto yy732;
+ goto yy697;
}
}
-yy732:
- YYDEBUG(732, *YYCURSOR);
+yy697:
+ YYDEBUG(697, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych != '.') goto yy53;
- goto yy733;
+ goto yy698;
} else {
- if(yych <= 'M') goto yy734;
- if(yych == 'm') goto yy734;
+ if(yych <= 'M') goto yy699;
+ if(yych == 'm') goto yy699;
goto yy53;
}
-yy733:
- YYDEBUG(733, *YYCURSOR);
+yy698:
+ YYDEBUG(698, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy734;
+ if(yych == 'M') goto yy699;
if(yych != 'm') goto yy53;
- goto yy734;
-yy734:
- YYDEBUG(734, *YYCURSOR);
+ goto yy699;
+yy699:
+ YYDEBUG(699, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 0x1F){
- if(yych <= 0x00) goto yy710;
- if(yych == 0x09) goto yy710;
+ if(yych <= 0x00) goto yy675;
+ if(yych == 0x09) goto yy675;
goto yy53;
} else {
- if(yych <= ' ') goto yy710;
+ if(yych <= ' ') goto yy675;
if(yych != '.') goto yy53;
- goto yy735;
+ goto yy700;
}
-yy735:
- YYDEBUG(735, *YYCURSOR);
+yy700:
+ YYDEBUG(700, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 0x09){
- if(yych <= 0x00) goto yy710;
+ if(yych <= 0x00) goto yy675;
if(yych <= 0x08) goto yy53;
- goto yy710;
+ goto yy675;
} else {
- if(yych == ' ') goto yy710;
+ if(yych == ' ') goto yy675;
goto yy53;
}
-yy736:
- YYDEBUG(736, *YYCURSOR);
+yy701:
+ YYDEBUG(701, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'V') goto yy737;
+ if(yych == 'V') goto yy702;
if(yych != 'v') goto yy53;
- goto yy737;
-yy737:
- YYDEBUG(737, *YYCURSOR);
- yyaccept = 10;
+ goto yy702;
+yy702:
+ YYDEBUG(702, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych != 0x09) goto yy698;
- goto yy738;
+ if(yych != 0x09) goto yy663;
+ goto yy703;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy742;
- if(yych == 'e') goto yy742;
- goto yy698;
+ if(yych <= 'E') goto yy707;
+ if(yych == 'e') goto yy707;
+ goto yy663;
}
}
-yy738:
- YYDEBUG(738, *YYCURSOR);
+yy703:
+ YYDEBUG(703, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
- goto yy739;
-yy739:
- YYDEBUG(739, *YYCURSOR);
+ goto yy704;
+yy704:
+ YYDEBUG(704, *YYCURSOR);
if(yych <= ' '){
- if(yych == 0x09) goto yy738;
+ if(yych == 0x09) goto yy703;
if(yych <= 0x1F) goto yy53;
- goto yy738;
+ goto yy703;
} else {
if(yych <= '.'){
if(yych <= ',') goto yy53;
- goto yy738;
+ goto yy703;
} else {
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy740;
+ goto yy705;
}
}
-yy740:
- YYDEBUG(740, *YYCURSOR);
+yy705:
+ YYDEBUG(705, *YYCURSOR);
++YYCURSOR;
- if((yych = *YYCURSOR) <= '/') goto yy741;
- if(yych <= '9') goto yy747;
- goto yy741;
-yy741:
- YYDEBUG(741, *YYCURSOR);
+ if((yych = *YYCURSOR) <= '/') goto yy706;
+ if(yych <= '9') goto yy712;
+ goto yy706;
+yy706:
+ YYDEBUG(706, *YYCURSOR);
{
DEBUG_OUTPUT("datefull");
@@ -13494,792 +12990,792 @@ yy741:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
-yy742:
- YYDEBUG(742, *YYCURSOR);
+yy707:
+ YYDEBUG(707, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy743;
+ if(yych == 'M') goto yy708;
if(yych != 'm') goto yy53;
- goto yy743;
-yy743:
- YYDEBUG(743, *YYCURSOR);
+ goto yy708;
+yy708:
+ YYDEBUG(708, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy744;
+ if(yych == 'B') goto yy709;
if(yych != 'b') goto yy53;
- goto yy744;
-yy744:
- YYDEBUG(744, *YYCURSOR);
+ goto yy709;
+yy709:
+ YYDEBUG(709, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy745;
+ if(yych == 'E') goto yy710;
if(yych != 'e') goto yy53;
- goto yy745;
-yy745:
- YYDEBUG(745, *YYCURSOR);
+ goto yy710;
+yy710:
+ YYDEBUG(710, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy746;
+ if(yych == 'R') goto yy711;
if(yych != 'r') goto yy53;
- goto yy746;
-yy746:
- YYDEBUG(746, *YYCURSOR);
- yyaccept = 10;
+ goto yy711;
+yy711:
+ YYDEBUG(711, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ' '){
- if(yych == 0x09) goto yy738;
- if(yych <= 0x1F) goto yy698;
- goto yy738;
+ if(yych == 0x09) goto yy703;
+ if(yych <= 0x1F) goto yy663;
+ goto yy703;
} else {
if(yych <= '.'){
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ',') goto yy663;
+ goto yy703;
} else {
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
}
}
-yy747:
- YYDEBUG(747, *YYCURSOR);
+yy712:
+ YYDEBUG(712, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy741;
- if(yych >= ':') goto yy741;
- goto yy748;
-yy748:
- YYDEBUG(748, *YYCURSOR);
+ if(yych <= '/') goto yy706;
+ if(yych >= ':') goto yy706;
+ goto yy713;
+yy713:
+ YYDEBUG(713, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy741;
- if(yych >= ':') goto yy741;
- goto yy749;
-yy749:
- YYDEBUG(749, *YYCURSOR);
+ if(yych <= '/') goto yy706;
+ if(yych >= ':') goto yy706;
+ goto yy714;
+yy714:
+ YYDEBUG(714, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy741;
-yy750:
- YYDEBUG(750, *YYCURSOR);
+ goto yy706;
+yy715:
+ YYDEBUG(715, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy751;
+ if(yych == 'T') goto yy716;
if(yych != 't') goto yy53;
- goto yy751;
-yy751:
- YYDEBUG(751, *YYCURSOR);
- yyaccept = 10;
+ goto yy716;
+yy716:
+ YYDEBUG(716, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'N'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'O') goto yy752;
- if(yych != 'o') goto yy698;
- goto yy752;
+ if(yych <= 'O') goto yy717;
+ if(yych != 'o') goto yy663;
+ goto yy717;
}
}
-yy752:
- YYDEBUG(752, *YYCURSOR);
+yy717:
+ YYDEBUG(717, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy753;
+ if(yych == 'B') goto yy718;
if(yych != 'b') goto yy53;
- goto yy753;
-yy753:
- YYDEBUG(753, *YYCURSOR);
+ goto yy718;
+yy718:
+ YYDEBUG(718, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy754;
+ if(yych == 'E') goto yy719;
if(yych != 'e') goto yy53;
- goto yy754;
-yy754:
- YYDEBUG(754, *YYCURSOR);
+ goto yy719;
+yy719:
+ YYDEBUG(719, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy746;
- if(yych == 'r') goto yy746;
+ if(yych == 'R') goto yy711;
+ if(yych == 'r') goto yy711;
goto yy53;
-yy755:
- YYDEBUG(755, *YYCURSOR);
+yy720:
+ YYDEBUG(720, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy759;
- if(yych == 'g') goto yy759;
+ if(yych == 'G') goto yy724;
+ if(yych == 'g') goto yy724;
goto yy53;
-yy756:
- YYDEBUG(756, *YYCURSOR);
+yy721:
+ YYDEBUG(721, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy757;
+ if(yych == 'R') goto yy722;
if(yych != 'r') goto yy53;
- goto yy757;
-yy757:
- YYDEBUG(757, *YYCURSOR);
- yyaccept = 10;
+ goto yy722;
+yy722:
+ YYDEBUG(722, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'H'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'I') goto yy758;
- if(yych != 'i') goto yy698;
- goto yy758;
+ if(yych <= 'I') goto yy723;
+ if(yych != 'i') goto yy663;
+ goto yy723;
}
}
-yy758:
- YYDEBUG(758, *YYCURSOR);
+yy723:
+ YYDEBUG(723, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'L') goto yy746;
- if(yych == 'l') goto yy746;
+ if(yych == 'L') goto yy711;
+ if(yych == 'l') goto yy711;
goto yy53;
-yy759:
- YYDEBUG(759, *YYCURSOR);
- yyaccept = 10;
+yy724:
+ YYDEBUG(724, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'T'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'U') goto yy760;
- if(yych != 'u') goto yy698;
- goto yy760;
+ if(yych <= 'U') goto yy725;
+ if(yych != 'u') goto yy663;
+ goto yy725;
}
}
-yy760:
- YYDEBUG(760, *YYCURSOR);
+yy725:
+ YYDEBUG(725, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'S') goto yy761;
+ if(yych == 'S') goto yy726;
if(yych != 's') goto yy53;
- goto yy761;
-yy761:
- YYDEBUG(761, *YYCURSOR);
+ goto yy726;
+yy726:
+ YYDEBUG(726, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy746;
- if(yych == 't') goto yy746;
+ if(yych == 'T') goto yy711;
+ if(yych == 't') goto yy711;
goto yy53;
-yy762:
- YYDEBUG(762, *YYCURSOR);
+yy727:
+ YYDEBUG(727, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
- if(yych == 'L') goto yy769;
+ if(yych == 'L') goto yy734;
if(yych <= 'M') goto yy53;
- goto yy768;
+ goto yy733;
} else {
if(yych <= 'l'){
if(yych <= 'k') goto yy53;
- goto yy769;
+ goto yy734;
} else {
- if(yych == 'n') goto yy768;
+ if(yych == 'n') goto yy733;
goto yy53;
}
}
-yy763:
- YYDEBUG(763, *YYCURSOR);
+yy728:
+ YYDEBUG(728, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy764;
+ if(yych == 'N') goto yy729;
if(yych != 'n') goto yy53;
- goto yy764;
-yy764:
- YYDEBUG(764, *YYCURSOR);
- yyaccept = 10;
+ goto yy729;
+yy729:
+ YYDEBUG(729, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'T'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'U') goto yy765;
- if(yych != 'u') goto yy698;
- goto yy765;
+ if(yych <= 'U') goto yy730;
+ if(yych != 'u') goto yy663;
+ goto yy730;
}
}
-yy765:
- YYDEBUG(765, *YYCURSOR);
+yy730:
+ YYDEBUG(730, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy766;
+ if(yych == 'A') goto yy731;
if(yych != 'a') goto yy53;
- goto yy766;
-yy766:
- YYDEBUG(766, *YYCURSOR);
+ goto yy731;
+yy731:
+ YYDEBUG(731, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy767;
+ if(yych == 'R') goto yy732;
if(yych != 'r') goto yy53;
- goto yy767;
-yy767:
- YYDEBUG(767, *YYCURSOR);
+ goto yy732;
+yy732:
+ YYDEBUG(732, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy746;
- if(yych == 'y') goto yy746;
+ if(yych == 'Y') goto yy711;
+ if(yych == 'y') goto yy711;
goto yy53;
-yy768:
- YYDEBUG(768, *YYCURSOR);
- yyaccept = 10;
+yy733:
+ YYDEBUG(733, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy746;
- if(yych == 'e') goto yy746;
- goto yy698;
+ if(yych <= 'E') goto yy711;
+ if(yych == 'e') goto yy711;
+ goto yy663;
}
}
-yy769:
- YYDEBUG(769, *YYCURSOR);
- yyaccept = 10;
+yy734:
+ YYDEBUG(734, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'X'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'Y') goto yy746;
- if(yych == 'y') goto yy746;
- goto yy698;
+ if(yych <= 'Y') goto yy711;
+ if(yych == 'y') goto yy711;
+ goto yy663;
}
}
-yy770:
- YYDEBUG(770, *YYCURSOR);
- yyaccept = 10;
+yy735:
+ YYDEBUG(735, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '9'){
- if(yych <= '.') goto yy738;
- if(yych <= '/') goto yy698;
- goto yy740;
+ if(yych <= '.') goto yy703;
+ if(yych <= '/') goto yy663;
+ goto yy705;
} else {
- if(yych == 'I') goto yy746;
- goto yy698;
+ if(yych == 'I') goto yy711;
+ goto yy663;
}
}
-yy771:
- YYDEBUG(771, *YYCURSOR);
- yyaccept = 10;
+yy736:
+ YYDEBUG(736, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '9'){
- if(yych <= '.') goto yy738;
- if(yych <= '/') goto yy698;
- goto yy740;
+ if(yych <= '.') goto yy703;
+ if(yych <= '/') goto yy663;
+ goto yy705;
} else {
- if(yych != 'I') goto yy698;
- goto yy772;
+ if(yych != 'I') goto yy663;
+ goto yy737;
}
}
-yy772:
- YYDEBUG(772, *YYCURSOR);
- yyaccept = 10;
+yy737:
+ YYDEBUG(737, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '9'){
- if(yych <= '.') goto yy738;
- if(yych <= '/') goto yy698;
- goto yy740;
+ if(yych <= '.') goto yy703;
+ if(yych <= '/') goto yy663;
+ goto yy705;
} else {
- if(yych == 'I') goto yy746;
- goto yy698;
+ if(yych == 'I') goto yy711;
+ goto yy663;
}
}
-yy773:
- YYDEBUG(773, *YYCURSOR);
- yyaccept = 10;
+yy738:
+ YYDEBUG(738, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '9'){
- if(yych <= '.') goto yy738;
- if(yych <= '/') goto yy698;
- goto yy740;
+ if(yych <= '.') goto yy703;
+ if(yych <= '/') goto yy663;
+ goto yy705;
} else {
- if(yych == 'I') goto yy746;
- goto yy698;
+ if(yych == 'I') goto yy711;
+ goto yy663;
}
}
-yy774:
- YYDEBUG(774, *YYCURSOR);
- yyaccept = 11;
+yy739:
+ YYDEBUG(739, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- goto yy808;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ goto yy773;
} else {
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy818;
- if(yych <= ':') goto yy715;
- goto yy713;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy783;
+ if(yych <= ':') goto yy680;
+ goto yy678;
}
-yy775:
- YYDEBUG(775, *YYCURSOR);
- yyaccept = 11;
+yy740:
+ YYDEBUG(740, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- if(yych <= '.') goto yy808;
- goto yy713;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ if(yych <= '.') goto yy773;
+ goto yy678;
} else {
- if(yych <= '2') goto yy818;
- if(yych <= '9') goto yy729;
- if(yych <= ':') goto yy715;
- goto yy713;
+ if(yych <= '2') goto yy783;
+ if(yych <= '9') goto yy694;
+ if(yych <= ':') goto yy680;
+ goto yy678;
}
-yy776:
- YYDEBUG(776, *YYCURSOR);
- yyaccept = 11;
+yy741:
+ YYDEBUG(741, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- goto yy808;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ goto yy773;
} else {
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy729;
- if(yych <= ':') goto yy715;
- goto yy713;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy694;
+ if(yych <= ':') goto yy680;
+ goto yy678;
}
-yy777:
- YYDEBUG(777, *YYCURSOR);
- yyaccept = 11;
+yy742:
+ YYDEBUG(742, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- goto yy808;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ goto yy773;
} else {
- if(yych == ':') goto yy715;
- goto yy713;
+ if(yych == ':') goto yy680;
+ goto yy678;
}
-yy778:
- YYDEBUG(778, *YYCURSOR);
+yy743:
+ YYDEBUG(743, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy801;
- if(yych == 'e') goto yy801;
+ if(yych == 'E') goto yy766;
+ if(yych == 'e') goto yy766;
goto yy53;
-yy779:
- YYDEBUG(779, *YYCURSOR);
+yy744:
+ YYDEBUG(744, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy798;
- if(yych == 'a') goto yy798;
+ if(yych == 'A') goto yy763;
+ if(yych == 'a') goto yy763;
goto yy53;
-yy780:
- YYDEBUG(780, *YYCURSOR);
+yy745:
+ YYDEBUG(745, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'P') goto yy756;
+ if(yych == 'P') goto yy721;
if(yych <= 'T') goto yy53;
- goto yy755;
+ goto yy720;
} else {
if(yych <= 'p'){
if(yych <= 'o') goto yy53;
- goto yy756;
+ goto yy721;
} else {
- if(yych == 'u') goto yy755;
+ if(yych == 'u') goto yy720;
goto yy53;
}
}
-yy781:
- YYDEBUG(781, *YYCURSOR);
+yy746:
+ YYDEBUG(746, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy791;
- if(yych == 'e') goto yy791;
+ if(yych == 'E') goto yy756;
+ if(yych == 'e') goto yy756;
goto yy53;
-yy782:
- YYDEBUG(782, *YYCURSOR);
+yy747:
+ YYDEBUG(747, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy785;
- if(yych == 'e') goto yy785;
+ if(yych == 'E') goto yy750;
+ if(yych == 'e') goto yy750;
goto yy53;
-yy783:
- YYDEBUG(783, *YYCURSOR);
+yy748:
+ YYDEBUG(748, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
yych = *YYCURSOR;
- goto yy784;
-yy784:
- YYDEBUG(784, *YYCURSOR);
+ goto yy749;
+yy749:
+ YYDEBUG(749, *YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
case 0x09: case ' ': case '-':
- case '.': goto yy783;
- case 'A': case 'a': goto yy780;
- case 'D': case 'd': goto yy782;
- case 'F': case 'f': goto yy778;
- case 'I': goto yy697;
- case 'J': case 'j': goto yy701;
- case 'M': case 'm': goto yy779;
- case 'N': case 'n': goto yy704;
- case 'O': case 'o': goto yy703;
- case 'S': case 's': goto yy781;
- case 'V': goto yy699;
- case 'X': goto yy700;
+ case '.': goto yy748;
+ case 'A': case 'a': goto yy745;
+ case 'D': case 'd': goto yy747;
+ case 'F': case 'f': goto yy743;
+ case 'I': goto yy662;
+ case 'J': case 'j': goto yy666;
+ case 'M': case 'm': goto yy744;
+ case 'N': case 'n': goto yy669;
+ case 'O': case 'o': goto yy668;
+ case 'S': case 's': goto yy746;
+ case 'V': goto yy664;
+ case 'X': goto yy665;
default: goto yy53;
}
-yy785:
- YYDEBUG(785, *YYCURSOR);
+yy750:
+ YYDEBUG(750, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy786;
+ if(yych == 'C') goto yy751;
if(yych != 'c') goto yy53;
- goto yy786;
-yy786:
- YYDEBUG(786, *YYCURSOR);
- yyaccept = 10;
+ goto yy751;
+yy751:
+ YYDEBUG(751, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy787;
- if(yych != 'e') goto yy698;
- goto yy787;
+ if(yych <= 'E') goto yy752;
+ if(yych != 'e') goto yy663;
+ goto yy752;
}
}
-yy787:
- YYDEBUG(787, *YYCURSOR);
+yy752:
+ YYDEBUG(752, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy788;
+ if(yych == 'M') goto yy753;
if(yych != 'm') goto yy53;
- goto yy788;
-yy788:
- YYDEBUG(788, *YYCURSOR);
+ goto yy753;
+yy753:
+ YYDEBUG(753, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy789;
+ if(yych == 'B') goto yy754;
if(yych != 'b') goto yy53;
- goto yy789;
-yy789:
- YYDEBUG(789, *YYCURSOR);
+ goto yy754;
+yy754:
+ YYDEBUG(754, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy790;
+ if(yych == 'E') goto yy755;
if(yych != 'e') goto yy53;
- goto yy790;
-yy790:
- YYDEBUG(790, *YYCURSOR);
+ goto yy755;
+yy755:
+ YYDEBUG(755, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy746;
- if(yych == 'r') goto yy746;
+ if(yych == 'R') goto yy711;
+ if(yych == 'r') goto yy711;
goto yy53;
-yy791:
- YYDEBUG(791, *YYCURSOR);
+yy756:
+ YYDEBUG(756, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'P') goto yy792;
+ if(yych == 'P') goto yy757;
if(yych != 'p') goto yy53;
- goto yy792;
-yy792:
- YYDEBUG(792, *YYCURSOR);
- yyaccept = 10;
+ goto yy757;
+yy757:
+ YYDEBUG(757, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'S'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'T') goto yy793;
- if(yych != 't') goto yy698;
- goto yy793;
+ if(yych <= 'T') goto yy758;
+ if(yych != 't') goto yy663;
+ goto yy758;
}
}
-yy793:
- YYDEBUG(793, *YYCURSOR);
- yyaccept = 10;
+yy758:
+ YYDEBUG(758, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy794;
- if(yych != 'e') goto yy698;
- goto yy794;
+ if(yych <= 'E') goto yy759;
+ if(yych != 'e') goto yy663;
+ goto yy759;
}
}
-yy794:
- YYDEBUG(794, *YYCURSOR);
+yy759:
+ YYDEBUG(759, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy795;
+ if(yych == 'M') goto yy760;
if(yych != 'm') goto yy53;
- goto yy795;
-yy795:
- YYDEBUG(795, *YYCURSOR);
+ goto yy760;
+yy760:
+ YYDEBUG(760, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy796;
+ if(yych == 'B') goto yy761;
if(yych != 'b') goto yy53;
- goto yy796;
-yy796:
- YYDEBUG(796, *YYCURSOR);
+ goto yy761;
+yy761:
+ YYDEBUG(761, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy797;
+ if(yych == 'E') goto yy762;
if(yych != 'e') goto yy53;
- goto yy797;
-yy797:
- YYDEBUG(797, *YYCURSOR);
+ goto yy762;
+yy762:
+ YYDEBUG(762, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy746;
- if(yych == 'r') goto yy746;
+ if(yych == 'R') goto yy711;
+ if(yych == 'r') goto yy711;
goto yy53;
-yy798:
- YYDEBUG(798, *YYCURSOR);
+yy763:
+ YYDEBUG(763, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
- if(yych == 'R') goto yy799;
+ if(yych == 'R') goto yy764;
if(yych <= 'X') goto yy53;
- goto yy746;
+ goto yy711;
} else {
if(yych <= 'r'){
if(yych <= 'q') goto yy53;
- goto yy799;
+ goto yy764;
} else {
- if(yych == 'y') goto yy746;
+ if(yych == 'y') goto yy711;
goto yy53;
}
}
-yy799:
- YYDEBUG(799, *YYCURSOR);
- yyaccept = 10;
+yy764:
+ YYDEBUG(764, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'B'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'C') goto yy800;
- if(yych != 'c') goto yy698;
- goto yy800;
+ if(yych <= 'C') goto yy765;
+ if(yych != 'c') goto yy663;
+ goto yy765;
}
}
-yy800:
- YYDEBUG(800, *YYCURSOR);
+yy765:
+ YYDEBUG(765, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'H') goto yy746;
- if(yych == 'h') goto yy746;
+ if(yych == 'H') goto yy711;
+ if(yych == 'h') goto yy711;
goto yy53;
-yy801:
- YYDEBUG(801, *YYCURSOR);
+yy766:
+ YYDEBUG(766, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy802;
+ if(yych == 'B') goto yy767;
if(yych != 'b') goto yy53;
- goto yy802;
-yy802:
- YYDEBUG(802, *YYCURSOR);
- yyaccept = 10;
+ goto yy767;
+yy767:
+ YYDEBUG(767, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'Q'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'R') goto yy803;
- if(yych != 'r') goto yy698;
- goto yy803;
+ if(yych <= 'R') goto yy768;
+ if(yych != 'r') goto yy663;
+ goto yy768;
}
}
-yy803:
- YYDEBUG(803, *YYCURSOR);
+yy768:
+ YYDEBUG(768, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'U') goto yy804;
+ if(yych == 'U') goto yy769;
if(yych != 'u') goto yy53;
- goto yy804;
-yy804:
- YYDEBUG(804, *YYCURSOR);
+ goto yy769;
+yy769:
+ YYDEBUG(769, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy805;
+ if(yych == 'A') goto yy770;
if(yych != 'a') goto yy53;
- goto yy805;
-yy805:
- YYDEBUG(805, *YYCURSOR);
+ goto yy770;
+yy770:
+ YYDEBUG(770, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy806;
+ if(yych == 'R') goto yy771;
if(yych != 'r') goto yy53;
- goto yy806;
-yy806:
- YYDEBUG(806, *YYCURSOR);
+ goto yy771;
+yy771:
+ YYDEBUG(771, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy746;
- if(yych == 'y') goto yy746;
+ if(yych == 'Y') goto yy711;
+ if(yych == 'y') goto yy711;
goto yy53;
-yy807:
- YYDEBUG(807, *YYCURSOR);
+yy772:
+ YYDEBUG(772, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy817;
+ if(yych <= '9') goto yy782;
goto yy53;
-yy808:
- YYDEBUG(808, *YYCURSOR);
+yy773:
+ YYDEBUG(773, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy809;
- if(yych <= '6') goto yy810;
- if(yych <= '9') goto yy811;
+ if(yych <= '5') goto yy774;
+ if(yych <= '6') goto yy775;
+ if(yych <= '9') goto yy776;
goto yy53;
-yy809:
- YYDEBUG(809, *YYCURSOR);
- yyaccept = 11;
+yy774:
+ YYDEBUG(774, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy816;
- goto yy713;
-yy810:
- YYDEBUG(810, *YYCURSOR);
- yyaccept = 11;
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy781;
+ goto yy678;
+yy775:
+ YYDEBUG(775, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy719;
- goto yy713;
+ if(yych == '.') goto yy684;
+ goto yy678;
} else {
- if(yych <= '0') goto yy816;
- if(yych <= '9') goto yy812;
- goto yy713;
+ if(yych <= '0') goto yy781;
+ if(yych <= '9') goto yy777;
+ goto yy678;
}
-yy811:
- YYDEBUG(811, *YYCURSOR);
- yyaccept = 11;
+yy776:
+ YYDEBUG(776, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- if(yych >= ':') goto yy713;
- goto yy812;
-yy812:
- YYDEBUG(812, *YYCURSOR);
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ if(yych >= ':') goto yy678;
+ goto yy777;
+yy777:
+ YYDEBUG(777, *YYCURSOR);
++YYCURSOR;
- if((yych = *YYCURSOR) <= '/') goto yy813;
- if(yych <= '9') goto yy814;
- goto yy813;
-yy813:
- YYDEBUG(813, *YYCURSOR);
+ if((yych = *YYCURSOR) <= '/') goto yy778;
+ if(yych <= '9') goto yy779;
+ goto yy778;
+yy778:
+ YYDEBUG(778, *YYCURSOR);
{
DEBUG_OUTPUT("pointed date");
@@ -14292,649 +13788,649 @@ yy813:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
-yy814:
- YYDEBUG(814, *YYCURSOR);
+yy779:
+ YYDEBUG(779, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy813;
- if(yych >= ':') goto yy813;
- goto yy815;
-yy815:
- YYDEBUG(815, *YYCURSOR);
+ if(yych <= '/') goto yy778;
+ if(yych >= ':') goto yy778;
+ goto yy780;
+yy780:
+ YYDEBUG(780, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy813;
-yy816:
- YYDEBUG(816, *YYCURSOR);
- yyaccept = 11;
+ goto yy778;
+yy781:
+ YYDEBUG(781, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= ' '){
- if(yych == 0x09) goto yy723;
- if(yych <= 0x1F) goto yy713;
- goto yy723;
+ if(yych == 0x09) goto yy688;
+ if(yych <= 0x1F) goto yy678;
+ goto yy688;
} else {
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- goto yy814;
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ goto yy779;
}
} else {
if(yych <= 'P'){
- if(yych == 'A') goto yy725;
- if(yych <= 'O') goto yy713;
- goto yy725;
+ if(yych == 'A') goto yy690;
+ if(yych <= 'O') goto yy678;
+ goto yy690;
} else {
if(yych <= 'a'){
- if(yych <= '`') goto yy713;
- goto yy725;
+ if(yych <= '`') goto yy678;
+ goto yy690;
} else {
- if(yych == 'p') goto yy725;
- goto yy713;
+ if(yych == 'p') goto yy690;
+ goto yy678;
}
}
}
-yy817:
- YYDEBUG(817, *YYCURSOR);
+yy782:
+ YYDEBUG(782, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy813;
- if(yych <= '9') goto yy812;
- goto yy813;
-yy818:
- YYDEBUG(818, *YYCURSOR);
- yyaccept = 11;
+ if(yych <= '/') goto yy778;
+ if(yych <= '9') goto yy777;
+ goto yy778;
+yy783:
+ YYDEBUG(783, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ':'){
if(yych <= ' '){
- if(yych == 0x09) goto yy730;
- if(yych <= 0x1F) goto yy713;
- goto yy730;
+ if(yych == 0x09) goto yy695;
+ if(yych <= 0x1F) goto yy678;
+ goto yy695;
} else {
if(yych <= '-'){
- if(yych <= ',') goto yy713;
- goto yy807;
+ if(yych <= ',') goto yy678;
+ goto yy772;
} else {
- if(yych <= '.') goto yy808;
- if(yych <= '9') goto yy713;
- goto yy715;
+ if(yych <= '.') goto yy773;
+ if(yych <= '9') goto yy678;
+ goto yy680;
}
}
} else {
if(yych <= 'P'){
- if(yych == 'A') goto yy732;
- if(yych <= 'O') goto yy713;
- goto yy732;
+ if(yych == 'A') goto yy697;
+ if(yych <= 'O') goto yy678;
+ goto yy697;
} else {
if(yych <= 'a'){
- if(yych <= '`') goto yy713;
- goto yy732;
+ if(yych <= '`') goto yy678;
+ goto yy697;
} else {
- if(yych == 'p') goto yy732;
- goto yy713;
+ if(yych == 'p') goto yy697;
+ goto yy678;
}
}
}
-yy819:
- YYDEBUG(819, *YYCURSOR);
+yy784:
+ YYDEBUG(784, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '.'){
if(yych <= ',') goto yy53;
- if(yych <= '-') goto yy858;
- goto yy807;
+ if(yych <= '-') goto yy823;
+ goto yy772;
} else {
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy821;
+ if(yych <= '9') goto yy786;
goto yy53;
}
-yy820:
- YYDEBUG(820, *YYCURSOR);
+yy785:
+ YYDEBUG(785, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '.'){
if(yych <= ',') goto yy53;
- if(yych <= '-') goto yy858;
- goto yy807;
+ if(yych <= '-') goto yy823;
+ goto yy772;
} else {
if(yych <= '/') goto yy53;
if(yych >= '3') goto yy53;
- goto yy821;
+ goto yy786;
}
-yy821:
- YYDEBUG(821, *YYCURSOR);
+yy786:
+ YYDEBUG(786, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= ',') goto yy53;
- if(yych <= '-') goto yy858;
- if(yych <= '.') goto yy807;
+ if(yych <= '-') goto yy823;
+ if(yych <= '.') goto yy772;
goto yy53;
-yy822:
- YYDEBUG(822, *YYCURSOR);
+yy787:
+ YYDEBUG(787, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'A') goto yy854;
+ if(yych == 'A') goto yy819;
if(yych <= 'T') goto yy53;
- goto yy853;
+ goto yy818;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy854;
+ goto yy819;
} else {
- if(yych == 'u') goto yy853;
+ if(yych == 'u') goto yy818;
goto yy53;
}
}
-yy823:
- YYDEBUG(823, *YYCURSOR);
+yy788:
+ YYDEBUG(788, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy851;
- if(yych == 'e') goto yy851;
+ if(yych == 'E') goto yy816;
+ if(yych == 'e') goto yy816;
goto yy53;
-yy824:
- YYDEBUG(824, *YYCURSOR);
+yy789:
+ YYDEBUG(789, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy848;
- if(yych == 'a') goto yy848;
+ if(yych == 'A') goto yy813;
+ if(yych == 'a') goto yy813;
goto yy53;
-yy825:
- YYDEBUG(825, *YYCURSOR);
+yy790:
+ YYDEBUG(790, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'P') goto yy845;
+ if(yych == 'P') goto yy810;
if(yych <= 'T') goto yy53;
- goto yy844;
+ goto yy809;
} else {
if(yych <= 'p'){
if(yych <= 'o') goto yy53;
- goto yy845;
+ goto yy810;
} else {
- if(yych == 'u') goto yy844;
+ if(yych == 'u') goto yy809;
goto yy53;
}
}
-yy826:
- YYDEBUG(826, *YYCURSOR);
+yy791:
+ YYDEBUG(791, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy841;
- if(yych == 'e') goto yy841;
+ if(yych == 'E') goto yy806;
+ if(yych == 'e') goto yy806;
goto yy53;
-yy827:
- YYDEBUG(827, *YYCURSOR);
+yy792:
+ YYDEBUG(792, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy839;
- if(yych == 'c') goto yy839;
+ if(yych == 'C') goto yy804;
+ if(yych == 'c') goto yy804;
goto yy53;
-yy828:
- YYDEBUG(828, *YYCURSOR);
+yy793:
+ YYDEBUG(793, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy837;
- if(yych == 'o') goto yy837;
+ if(yych == 'O') goto yy802;
+ if(yych == 'o') goto yy802;
goto yy53;
-yy829:
- YYDEBUG(829, *YYCURSOR);
+yy794:
+ YYDEBUG(794, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy830;
+ if(yych == 'E') goto yy795;
if(yych != 'e') goto yy53;
- goto yy830;
-yy830:
- YYDEBUG(830, *YYCURSOR);
+ goto yy795;
+yy795:
+ YYDEBUG(795, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy831;
+ if(yych == 'C') goto yy796;
if(yych != 'c') goto yy53;
- goto yy831;
-yy831:
- YYDEBUG(831, *YYCURSOR);
- yyaccept = 10;
+ goto yy796;
+yy796:
+ YYDEBUG(796, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych >= '.') goto yy738;
- goto yy832;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych >= '.') goto yy703;
+ goto yy797;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy787;
- if(yych == 'e') goto yy787;
- goto yy698;
+ if(yych <= 'E') goto yy752;
+ if(yych == 'e') goto yy752;
+ goto yy663;
}
}
-yy832:
- YYDEBUG(832, *YYCURSOR);
+yy797:
+ YYDEBUG(797, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy739;
- if(yych <= '0') goto yy833;
- if(yych <= '2') goto yy834;
- if(yych <= '3') goto yy835;
- goto yy739;
-yy833:
- YYDEBUG(833, *YYCURSOR);
+ if(yych <= '/') goto yy704;
+ if(yych <= '0') goto yy798;
+ if(yych <= '2') goto yy799;
+ if(yych <= '3') goto yy800;
+ goto yy704;
+yy798:
+ YYDEBUG(798, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy741;
- if(yych <= '0') goto yy747;
- if(yych <= '9') goto yy836;
- goto yy741;
-yy834:
- YYDEBUG(834, *YYCURSOR);
+ if(yych <= '/') goto yy706;
+ if(yych <= '0') goto yy712;
+ if(yych <= '9') goto yy801;
+ goto yy706;
+yy799:
+ YYDEBUG(799, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy741;
- if(yych <= '9') goto yy836;
- goto yy741;
-yy835:
- YYDEBUG(835, *YYCURSOR);
+ if(yych <= '/') goto yy706;
+ if(yych <= '9') goto yy801;
+ goto yy706;
+yy800:
+ YYDEBUG(800, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy741;
- if(yych <= '1') goto yy836;
- if(yych <= '9') goto yy747;
- goto yy741;
-yy836:
- YYDEBUG(836, *YYCURSOR);
+ if(yych <= '/') goto yy706;
+ if(yych <= '1') goto yy801;
+ if(yych <= '9') goto yy712;
+ goto yy706;
+yy801:
+ YYDEBUG(801, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy741;
- if(yych <= '9') goto yy748;
- goto yy741;
-yy837:
- YYDEBUG(837, *YYCURSOR);
+ if(yych <= '/') goto yy706;
+ if(yych <= '9') goto yy713;
+ goto yy706;
+yy802:
+ YYDEBUG(802, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'V') goto yy838;
+ if(yych == 'V') goto yy803;
if(yych != 'v') goto yy53;
- goto yy838;
-yy838:
- YYDEBUG(838, *YYCURSOR);
- yyaccept = 10;
+ goto yy803;
+yy803:
+ YYDEBUG(803, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy742;
- if(yych == 'e') goto yy742;
- goto yy698;
+ if(yych <= 'E') goto yy707;
+ if(yych == 'e') goto yy707;
+ goto yy663;
}
}
-yy839:
- YYDEBUG(839, *YYCURSOR);
+yy804:
+ YYDEBUG(804, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy840;
+ if(yych == 'T') goto yy805;
if(yych != 't') goto yy53;
- goto yy840;
-yy840:
- YYDEBUG(840, *YYCURSOR);
- yyaccept = 10;
+ goto yy805;
+yy805:
+ YYDEBUG(805, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'N'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'O') goto yy752;
- if(yych == 'o') goto yy752;
- goto yy698;
+ if(yych <= 'O') goto yy717;
+ if(yych == 'o') goto yy717;
+ goto yy663;
}
}
-yy841:
- YYDEBUG(841, *YYCURSOR);
+yy806:
+ YYDEBUG(806, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'P') goto yy842;
+ if(yych == 'P') goto yy807;
if(yych != 'p') goto yy53;
- goto yy842;
-yy842:
- YYDEBUG(842, *YYCURSOR);
- yyaccept = 10;
+ goto yy807;
+yy807:
+ YYDEBUG(807, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'S'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'T') goto yy843;
- if(yych != 't') goto yy698;
- goto yy843;
+ if(yych <= 'T') goto yy808;
+ if(yych != 't') goto yy663;
+ goto yy808;
}
}
-yy843:
- YYDEBUG(843, *YYCURSOR);
- yyaccept = 10;
+yy808:
+ YYDEBUG(808, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy794;
- if(yych == 'e') goto yy794;
- goto yy698;
+ if(yych <= 'E') goto yy759;
+ if(yych == 'e') goto yy759;
+ goto yy663;
}
}
-yy844:
- YYDEBUG(844, *YYCURSOR);
+yy809:
+ YYDEBUG(809, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy847;
- if(yych == 'g') goto yy847;
+ if(yych == 'G') goto yy812;
+ if(yych == 'g') goto yy812;
goto yy53;
-yy845:
- YYDEBUG(845, *YYCURSOR);
+yy810:
+ YYDEBUG(810, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy846;
+ if(yych == 'R') goto yy811;
if(yych != 'r') goto yy53;
- goto yy846;
-yy846:
- YYDEBUG(846, *YYCURSOR);
- yyaccept = 10;
+ goto yy811;
+yy811:
+ YYDEBUG(811, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'H'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'I') goto yy758;
- if(yych == 'i') goto yy758;
- goto yy698;
+ if(yych <= 'I') goto yy723;
+ if(yych == 'i') goto yy723;
+ goto yy663;
}
}
-yy847:
- YYDEBUG(847, *YYCURSOR);
- yyaccept = 10;
+yy812:
+ YYDEBUG(812, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'T'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'U') goto yy760;
- if(yych == 'u') goto yy760;
- goto yy698;
+ if(yych <= 'U') goto yy725;
+ if(yych == 'u') goto yy725;
+ goto yy663;
}
}
-yy848:
- YYDEBUG(848, *YYCURSOR);
+yy813:
+ YYDEBUG(813, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
- if(yych == 'R') goto yy849;
+ if(yych == 'R') goto yy814;
if(yych <= 'X') goto yy53;
- goto yy850;
+ goto yy815;
} else {
if(yych <= 'r'){
if(yych <= 'q') goto yy53;
- goto yy849;
+ goto yy814;
} else {
- if(yych == 'y') goto yy850;
+ if(yych == 'y') goto yy815;
goto yy53;
}
}
-yy849:
- YYDEBUG(849, *YYCURSOR);
- yyaccept = 10;
+yy814:
+ YYDEBUG(814, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'B'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'C') goto yy800;
- if(yych == 'c') goto yy800;
- goto yy698;
+ if(yych <= 'C') goto yy765;
+ if(yych == 'c') goto yy765;
+ goto yy663;
}
}
-yy850:
- YYDEBUG(850, *YYCURSOR);
- yyaccept = 10;
+yy815:
+ YYDEBUG(815, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '.'){
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= '-') goto yy797;
+ goto yy703;
} else {
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
}
}
-yy851:
- YYDEBUG(851, *YYCURSOR);
+yy816:
+ YYDEBUG(816, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy852;
+ if(yych == 'B') goto yy817;
if(yych != 'b') goto yy53;
- goto yy852;
-yy852:
- YYDEBUG(852, *YYCURSOR);
- yyaccept = 10;
+ goto yy817;
+yy817:
+ YYDEBUG(817, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'Q'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'R') goto yy803;
- if(yych == 'r') goto yy803;
- goto yy698;
+ if(yych <= 'R') goto yy768;
+ if(yych == 'r') goto yy768;
+ goto yy663;
}
}
-yy853:
- YYDEBUG(853, *YYCURSOR);
+yy818:
+ YYDEBUG(818, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
- if(yych == 'L') goto yy857;
+ if(yych == 'L') goto yy822;
if(yych <= 'M') goto yy53;
- goto yy856;
+ goto yy821;
} else {
if(yych <= 'l'){
if(yych <= 'k') goto yy53;
- goto yy857;
+ goto yy822;
} else {
- if(yych == 'n') goto yy856;
+ if(yych == 'n') goto yy821;
goto yy53;
}
}
-yy854:
- YYDEBUG(854, *YYCURSOR);
+yy819:
+ YYDEBUG(819, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy855;
+ if(yych == 'N') goto yy820;
if(yych != 'n') goto yy53;
- goto yy855;
-yy855:
- YYDEBUG(855, *YYCURSOR);
- yyaccept = 10;
+ goto yy820;
+yy820:
+ YYDEBUG(820, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'T'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'U') goto yy765;
- if(yych == 'u') goto yy765;
- goto yy698;
+ if(yych <= 'U') goto yy730;
+ if(yych == 'u') goto yy730;
+ goto yy663;
}
}
-yy856:
- YYDEBUG(856, *YYCURSOR);
- yyaccept = 10;
+yy821:
+ YYDEBUG(821, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy746;
- if(yych == 'e') goto yy746;
- goto yy698;
+ if(yych <= 'E') goto yy711;
+ if(yych == 'e') goto yy711;
+ goto yy663;
}
}
-yy857:
- YYDEBUG(857, *YYCURSOR);
- yyaccept = 10;
+yy822:
+ YYDEBUG(822, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'X'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'Y') goto yy746;
- if(yych == 'y') goto yy746;
- goto yy698;
+ if(yych <= 'Y') goto yy711;
+ if(yych == 'y') goto yy711;
+ goto yy663;
}
}
-yy858:
- YYDEBUG(858, *YYCURSOR);
+yy823:
+ YYDEBUG(823, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '2') goto yy859;
- if(yych <= '3') goto yy861;
- if(yych <= '9') goto yy862;
+ if(yych <= '2') goto yy824;
+ if(yych <= '3') goto yy826;
+ if(yych <= '9') goto yy827;
goto yy53;
-yy859:
- YYDEBUG(859, *YYCURSOR);
- yyaccept = 12;
+yy824:
+ YYDEBUG(824, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy860;
- if(yych <= '9') goto yy868;
- if(yych >= 'n') goto yy864;
- goto yy860;
+ if(yych <= '/') goto yy825;
+ if(yych <= '9') goto yy833;
+ if(yych >= 'n') goto yy829;
+ goto yy825;
} else {
if(yych <= 'r'){
- if(yych >= 'r') goto yy865;
- goto yy860;
+ if(yych >= 'r') goto yy830;
+ goto yy825;
} else {
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
}
-yy860:
- YYDEBUG(860, *YYCURSOR);
+yy825:
+ YYDEBUG(825, *YYCURSOR);
{
DEBUG_OUTPUT("gnudateshort");
@@ -14947,116 +14443,116 @@ yy860:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
-yy861:
- YYDEBUG(861, *YYCURSOR);
- yyaccept = 12;
+yy826:
+ YYDEBUG(826, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
if(yych <= '1'){
- if(yych <= '/') goto yy860;
- goto yy868;
+ if(yych <= '/') goto yy825;
+ goto yy833;
} else {
- if(yych <= '9') goto yy812;
- if(yych <= 'm') goto yy860;
- goto yy864;
+ if(yych <= '9') goto yy777;
+ if(yych <= 'm') goto yy825;
+ goto yy829;
}
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy860;
- goto yy865;
+ if(yych <= 'q') goto yy825;
+ goto yy830;
} else {
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
}
-yy862:
- YYDEBUG(862, *YYCURSOR);
- yyaccept = 12;
+yy827:
+ YYDEBUG(827, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy860;
- if(yych <= '9') goto yy812;
- if(yych <= 'm') goto yy860;
- goto yy864;
+ if(yych <= '/') goto yy825;
+ if(yych <= '9') goto yy777;
+ if(yych <= 'm') goto yy825;
+ goto yy829;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy860;
- goto yy865;
+ if(yych <= 'q') goto yy825;
+ goto yy830;
} else {
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
}
-yy863:
- YYDEBUG(863, *YYCURSOR);
+yy828:
+ YYDEBUG(828, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 't') goto yy867;
+ if(yych == 't') goto yy832;
goto yy53;
-yy864:
- YYDEBUG(864, *YYCURSOR);
+yy829:
+ YYDEBUG(829, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy867;
+ if(yych == 'd') goto yy832;
goto yy53;
-yy865:
- YYDEBUG(865, *YYCURSOR);
+yy830:
+ YYDEBUG(830, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy867;
+ if(yych == 'd') goto yy832;
goto yy53;
-yy866:
- YYDEBUG(866, *YYCURSOR);
+yy831:
+ YYDEBUG(831, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != 'h') goto yy53;
- goto yy867;
-yy867:
- YYDEBUG(867, *YYCURSOR);
+ goto yy832;
+yy832:
+ YYDEBUG(832, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy860;
-yy868:
- YYDEBUG(868, *YYCURSOR);
- yyaccept = 12;
+ goto yy825;
+yy833:
+ YYDEBUG(833, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy860;
- if(yych <= '9') goto yy814;
- if(yych <= 'm') goto yy860;
- goto yy864;
+ if(yych <= '/') goto yy825;
+ if(yych <= '9') goto yy779;
+ if(yych <= 'm') goto yy825;
+ goto yy829;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy860;
- goto yy865;
+ if(yych <= 'q') goto yy825;
+ goto yy830;
} else {
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
}
-yy869:
- YYDEBUG(869, *YYCURSOR);
- yyaccept = 13;
+yy834:
+ YYDEBUG(834, *YYCURSOR);
+ yyaccept = 14;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
if(yych <= '/'){
- if(yych >= '/') goto yy923;
- goto yy870;
+ if(yych >= '/') goto yy888;
+ goto yy835;
} else {
- if(yych <= '9') goto yy872;
- if(yych >= 'n') goto yy920;
- goto yy870;
+ if(yych <= '9') goto yy837;
+ if(yych >= 'n') goto yy885;
+ goto yy835;
}
} else {
if(yych <= 'r'){
- if(yych >= 'r') goto yy921;
- goto yy870;
+ if(yych >= 'r') goto yy886;
+ goto yy835;
} else {
- if(yych <= 's') goto yy919;
- if(yych <= 't') goto yy922;
- goto yy870;
+ if(yych <= 's') goto yy884;
+ if(yych <= 't') goto yy887;
+ goto yy835;
}
}
-yy870:
- YYDEBUG(870, *YYCURSOR);
+yy835:
+ YYDEBUG(835, *YYCURSOR);
{
DEBUG_OUTPUT("americanshort | american");
@@ -15071,258 +14567,258 @@ yy870:
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
}
-yy871:
- YYDEBUG(871, *YYCURSOR);
- yyaccept = 13;
+yy836:
+ YYDEBUG(836, *YYCURSOR);
+ yyaccept = 14;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
if(yych <= '/'){
- if(yych <= '.') goto yy870;
- goto yy923;
+ if(yych <= '.') goto yy835;
+ goto yy888;
} else {
- if(yych <= '1') goto yy872;
- if(yych <= 'm') goto yy870;
- goto yy920;
+ if(yych <= '1') goto yy837;
+ if(yych <= 'm') goto yy835;
+ goto yy885;
}
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy870;
- goto yy921;
+ if(yych <= 'q') goto yy835;
+ goto yy886;
} else {
- if(yych <= 's') goto yy919;
- if(yych <= 't') goto yy922;
- goto yy870;
+ if(yych <= 's') goto yy884;
+ if(yych <= 't') goto yy887;
+ goto yy835;
}
}
-yy872:
- YYDEBUG(872, *YYCURSOR);
- yyaccept = 13;
+yy837:
+ YYDEBUG(837, *YYCURSOR);
+ yyaccept = 14;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych == '/') goto yy923;
- if(yych <= 'm') goto yy870;
- goto yy920;
+ if(yych == '/') goto yy888;
+ if(yych <= 'm') goto yy835;
+ goto yy885;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy870;
- goto yy921;
+ if(yych <= 'q') goto yy835;
+ goto yy886;
} else {
- if(yych <= 's') goto yy919;
- if(yych <= 't') goto yy922;
- goto yy870;
+ if(yych <= 's') goto yy884;
+ if(yych <= 't') goto yy887;
+ goto yy835;
}
}
-yy873:
- YYDEBUG(873, *YYCURSOR);
+yy838:
+ YYDEBUG(838, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'A') goto yy918;
+ if(yych == 'A') goto yy883;
if(yych <= 'T') goto yy53;
- goto yy917;
+ goto yy882;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy918;
+ goto yy883;
} else {
- if(yych == 'u') goto yy917;
+ if(yych == 'u') goto yy882;
goto yy53;
}
}
-yy874:
- YYDEBUG(874, *YYCURSOR);
+yy839:
+ YYDEBUG(839, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy916;
- if(yych == 'e') goto yy916;
+ if(yych == 'E') goto yy881;
+ if(yych == 'e') goto yy881;
goto yy53;
-yy875:
- YYDEBUG(875, *YYCURSOR);
+yy840:
+ YYDEBUG(840, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy915;
- if(yych == 'a') goto yy915;
+ if(yych == 'A') goto yy880;
+ if(yych == 'a') goto yy880;
goto yy53;
-yy876:
- YYDEBUG(876, *YYCURSOR);
+yy841:
+ YYDEBUG(841, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'P') goto yy914;
+ if(yych == 'P') goto yy879;
if(yych <= 'T') goto yy53;
- goto yy913;
+ goto yy878;
} else {
if(yych <= 'p'){
if(yych <= 'o') goto yy53;
- goto yy914;
+ goto yy879;
} else {
- if(yych == 'u') goto yy913;
+ if(yych == 'u') goto yy878;
goto yy53;
}
}
-yy877:
- YYDEBUG(877, *YYCURSOR);
+yy842:
+ YYDEBUG(842, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy911;
- if(yych == 'e') goto yy911;
+ if(yych == 'E') goto yy876;
+ if(yych == 'e') goto yy876;
goto yy53;
-yy878:
- YYDEBUG(878, *YYCURSOR);
+yy843:
+ YYDEBUG(843, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy910;
- if(yych == 'c') goto yy910;
+ if(yych == 'C') goto yy875;
+ if(yych == 'c') goto yy875;
goto yy53;
-yy879:
- YYDEBUG(879, *YYCURSOR);
+yy844:
+ YYDEBUG(844, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy909;
- if(yych == 'o') goto yy909;
+ if(yych == 'O') goto yy874;
+ if(yych == 'o') goto yy874;
goto yy53;
-yy880:
- YYDEBUG(880, *YYCURSOR);
+yy845:
+ YYDEBUG(845, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy881;
+ if(yych == 'E') goto yy846;
if(yych != 'e') goto yy53;
- goto yy881;
-yy881:
- YYDEBUG(881, *YYCURSOR);
+ goto yy846;
+yy846:
+ YYDEBUG(846, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy882;
+ if(yych == 'C') goto yy847;
if(yych != 'c') goto yy53;
- goto yy882;
-yy882:
- YYDEBUG(882, *YYCURSOR);
+ goto yy847;
+yy847:
+ YYDEBUG(847, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '/') goto yy53;
- goto yy883;
-yy883:
- YYDEBUG(883, *YYCURSOR);
+ goto yy848;
+yy848:
+ YYDEBUG(848, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy884;
-yy884:
- YYDEBUG(884, *YYCURSOR);
+ goto yy849;
+yy849:
+ YYDEBUG(849, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy885;
-yy885:
- YYDEBUG(885, *YYCURSOR);
+ goto yy850;
+yy850:
+ YYDEBUG(850, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy886;
-yy886:
- YYDEBUG(886, *YYCURSOR);
+ goto yy851;
+yy851:
+ YYDEBUG(851, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy887;
-yy887:
- YYDEBUG(887, *YYCURSOR);
+ goto yy852;
+yy852:
+ YYDEBUG(852, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy888;
-yy888:
- YYDEBUG(888, *YYCURSOR);
+ goto yy853;
+yy853:
+ YYDEBUG(853, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy889;
- if(yych <= '2') goto yy890;
+ if(yych <= '1') goto yy854;
+ if(yych <= '2') goto yy855;
goto yy53;
-yy889:
- YYDEBUG(889, *YYCURSOR);
+yy854:
+ YYDEBUG(854, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy891;
+ if(yych <= '9') goto yy856;
goto yy53;
-yy890:
- YYDEBUG(890, *YYCURSOR);
+yy855:
+ YYDEBUG(855, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '4') goto yy53;
- goto yy891;
-yy891:
- YYDEBUG(891, *YYCURSOR);
+ goto yy856;
+yy856:
+ YYDEBUG(856, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy892;
-yy892:
- YYDEBUG(892, *YYCURSOR);
+ goto yy857;
+yy857:
+ YYDEBUG(857, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '6') goto yy53;
- goto yy893;
-yy893:
- YYDEBUG(893, *YYCURSOR);
+ goto yy858;
+yy858:
+ YYDEBUG(858, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy894;
-yy894:
- YYDEBUG(894, *YYCURSOR);
+ goto yy859;
+yy859:
+ YYDEBUG(859, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy895;
-yy895:
- YYDEBUG(895, *YYCURSOR);
+ goto yy860;
+yy860:
+ YYDEBUG(860, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy896;
- if(yych <= '6') goto yy897;
+ if(yych <= '5') goto yy861;
+ if(yych <= '6') goto yy862;
goto yy53;
-yy896:
- YYDEBUG(896, *YYCURSOR);
+yy861:
+ YYDEBUG(861, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy898;
+ if(yych <= '9') goto yy863;
goto yy53;
-yy897:
- YYDEBUG(897, *YYCURSOR);
+yy862:
+ YYDEBUG(862, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '0') goto yy53;
- goto yy898;
-yy898:
- YYDEBUG(898, *YYCURSOR);
+ goto yy863;
+yy863:
+ YYDEBUG(863, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 0x09) goto yy899;
+ if(yych == 0x09) goto yy864;
if(yych != ' ') goto yy53;
- goto yy899;
-yy899:
- YYDEBUG(899, *YYCURSOR);
+ goto yy864;
+yy864:
+ YYDEBUG(864, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
yych = *YYCURSOR;
- goto yy900;
-yy900:
- YYDEBUG(900, *YYCURSOR);
+ goto yy865;
+yy865:
+ YYDEBUG(865, *YYCURSOR);
if(yych <= ' '){
- if(yych == 0x09) goto yy899;
+ if(yych == 0x09) goto yy864;
if(yych <= 0x1F) goto yy53;
- goto yy899;
+ goto yy864;
} else {
if(yych <= '+'){
if(yych <= '*') goto yy53;
- goto yy901;
+ goto yy866;
} else {
if(yych != '-') goto yy53;
- goto yy901;
+ goto yy866;
}
}
-yy901:
- YYDEBUG(901, *YYCURSOR);
+yy866:
+ YYDEBUG(866, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy902;
- if(yych <= '2') goto yy904;
- if(yych <= '9') goto yy905;
+ if(yych <= '1') goto yy867;
+ if(yych <= '2') goto yy869;
+ if(yych <= '9') goto yy870;
goto yy53;
-yy902:
- YYDEBUG(902, *YYCURSOR);
+yy867:
+ YYDEBUG(867, *YYCURSOR);
++YYCURSOR;
- if((yych = *YYCURSOR) <= '/') goto yy903;
- if(yych <= '9') goto yy905;
- if(yych <= ':') goto yy906;
- goto yy903;
-yy903:
- YYDEBUG(903, *YYCURSOR);
+ if((yych = *YYCURSOR) <= '/') goto yy868;
+ if(yych <= '9') goto yy870;
+ if(yych <= ':') goto yy871;
+ goto yy868;
+yy868:
+ YYDEBUG(868, *YYCURSOR);
{
int tz_not_found;
@@ -15343,252 +14839,252 @@ yy903:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
-yy904:
- YYDEBUG(904, *YYCURSOR);
+yy869:
+ YYDEBUG(869, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '5'){
- if(yych <= '/') goto yy903;
- if(yych >= '4') goto yy907;
- goto yy905;
+ if(yych <= '/') goto yy868;
+ if(yych >= '4') goto yy872;
+ goto yy870;
} else {
- if(yych <= '9') goto yy908;
- if(yych <= ':') goto yy906;
- goto yy903;
+ if(yych <= '9') goto yy873;
+ if(yych <= ':') goto yy871;
+ goto yy868;
}
-yy905:
- YYDEBUG(905, *YYCURSOR);
+yy870:
+ YYDEBUG(870, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy903;
- if(yych <= '5') goto yy907;
- if(yych <= '9') goto yy908;
- if(yych >= ';') goto yy903;
- goto yy906;
-yy906:
- YYDEBUG(906, *YYCURSOR);
+ if(yych <= '/') goto yy868;
+ if(yych <= '5') goto yy872;
+ if(yych <= '9') goto yy873;
+ if(yych >= ';') goto yy868;
+ goto yy871;
+yy871:
+ YYDEBUG(871, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy903;
- if(yych <= '5') goto yy907;
- if(yych <= '9') goto yy908;
- goto yy903;
-yy907:
- YYDEBUG(907, *YYCURSOR);
+ if(yych <= '/') goto yy868;
+ if(yych <= '5') goto yy872;
+ if(yych <= '9') goto yy873;
+ goto yy868;
+yy872:
+ YYDEBUG(872, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy903;
- if(yych >= ':') goto yy903;
- goto yy908;
-yy908:
- YYDEBUG(908, *YYCURSOR);
+ if(yych <= '/') goto yy868;
+ if(yych >= ':') goto yy868;
+ goto yy873;
+yy873:
+ YYDEBUG(873, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy903;
-yy909:
- YYDEBUG(909, *YYCURSOR);
+ goto yy868;
+yy874:
+ YYDEBUG(874, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'V') goto yy882;
- if(yych == 'v') goto yy882;
+ if(yych == 'V') goto yy847;
+ if(yych == 'v') goto yy847;
goto yy53;
-yy910:
- YYDEBUG(910, *YYCURSOR);
+yy875:
+ YYDEBUG(875, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy882;
- if(yych == 't') goto yy882;
+ if(yych == 'T') goto yy847;
+ if(yych == 't') goto yy847;
goto yy53;
-yy911:
- YYDEBUG(911, *YYCURSOR);
+yy876:
+ YYDEBUG(876, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'P') goto yy912;
+ if(yych == 'P') goto yy877;
if(yych != 'p') goto yy53;
- goto yy912;
-yy912:
- YYDEBUG(912, *YYCURSOR);
+ goto yy877;
+yy877:
+ YYDEBUG(877, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
- if(yych == '/') goto yy883;
+ if(yych == '/') goto yy848;
goto yy53;
} else {
- if(yych <= 'T') goto yy882;
- if(yych == 't') goto yy882;
+ if(yych <= 'T') goto yy847;
+ if(yych == 't') goto yy847;
goto yy53;
}
-yy913:
- YYDEBUG(913, *YYCURSOR);
+yy878:
+ YYDEBUG(878, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy882;
- if(yych == 'g') goto yy882;
+ if(yych == 'G') goto yy847;
+ if(yych == 'g') goto yy847;
goto yy53;
-yy914:
- YYDEBUG(914, *YYCURSOR);
+yy879:
+ YYDEBUG(879, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy882;
- if(yych == 'r') goto yy882;
+ if(yych == 'R') goto yy847;
+ if(yych == 'r') goto yy847;
goto yy53;
-yy915:
- YYDEBUG(915, *YYCURSOR);
+yy880:
+ YYDEBUG(880, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
- if(yych == 'R') goto yy882;
+ if(yych == 'R') goto yy847;
if(yych <= 'X') goto yy53;
- goto yy882;
+ goto yy847;
} else {
if(yych <= 'r'){
if(yych <= 'q') goto yy53;
- goto yy882;
+ goto yy847;
} else {
- if(yych == 'y') goto yy882;
+ if(yych == 'y') goto yy847;
goto yy53;
}
}
-yy916:
- YYDEBUG(916, *YYCURSOR);
+yy881:
+ YYDEBUG(881, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy882;
- if(yych == 'b') goto yy882;
+ if(yych == 'B') goto yy847;
+ if(yych == 'b') goto yy847;
goto yy53;
-yy917:
- YYDEBUG(917, *YYCURSOR);
+yy882:
+ YYDEBUG(882, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
- if(yych == 'L') goto yy882;
+ if(yych == 'L') goto yy847;
if(yych <= 'M') goto yy53;
- goto yy882;
+ goto yy847;
} else {
if(yych <= 'l'){
if(yych <= 'k') goto yy53;
- goto yy882;
+ goto yy847;
} else {
- if(yych == 'n') goto yy882;
+ if(yych == 'n') goto yy847;
goto yy53;
}
}
-yy918:
- YYDEBUG(918, *YYCURSOR);
+yy883:
+ YYDEBUG(883, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy882;
- if(yych == 'n') goto yy882;
+ if(yych == 'N') goto yy847;
+ if(yych == 'n') goto yy847;
goto yy53;
-yy919:
- YYDEBUG(919, *YYCURSOR);
+yy884:
+ YYDEBUG(884, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 't') goto yy928;
+ if(yych == 't') goto yy893;
goto yy53;
-yy920:
- YYDEBUG(920, *YYCURSOR);
+yy885:
+ YYDEBUG(885, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy928;
+ if(yych == 'd') goto yy893;
goto yy53;
-yy921:
- YYDEBUG(921, *YYCURSOR);
+yy886:
+ YYDEBUG(886, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy928;
+ if(yych == 'd') goto yy893;
goto yy53;
-yy922:
- YYDEBUG(922, *YYCURSOR);
+yy887:
+ YYDEBUG(887, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'h') goto yy928;
+ if(yych == 'h') goto yy893;
goto yy53;
-yy923:
- YYDEBUG(923, *YYCURSOR);
+yy888:
+ YYDEBUG(888, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy924;
-yy924:
- YYDEBUG(924, *YYCURSOR);
+ goto yy889;
+yy889:
+ YYDEBUG(889, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy870;
- if(yych >= ':') goto yy870;
- goto yy925;
-yy925:
- YYDEBUG(925, *YYCURSOR);
+ if(yych <= '/') goto yy835;
+ if(yych >= ':') goto yy835;
+ goto yy890;
+yy890:
+ YYDEBUG(890, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy870;
- if(yych >= ':') goto yy870;
- goto yy926;
-yy926:
- YYDEBUG(926, *YYCURSOR);
+ if(yych <= '/') goto yy835;
+ if(yych >= ':') goto yy835;
+ goto yy891;
+yy891:
+ YYDEBUG(891, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy870;
- if(yych >= ':') goto yy870;
- goto yy927;
-yy927:
- YYDEBUG(927, *YYCURSOR);
+ if(yych <= '/') goto yy835;
+ if(yych >= ':') goto yy835;
+ goto yy892;
+yy892:
+ YYDEBUG(892, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy870;
-yy928:
- YYDEBUG(928, *YYCURSOR);
- yyaccept = 13;
+ goto yy835;
+yy893:
+ YYDEBUG(893, *YYCURSOR);
+ yyaccept = 14;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '/') goto yy923;
- goto yy870;
-yy929:
- YYDEBUG(929, *YYCURSOR);
+ if(yych == '/') goto yy888;
+ goto yy835;
+yy894:
+ YYDEBUG(894, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= ','){
- if(yych == 0x09) goto yy931;
- goto yy784;
+ if(yych == 0x09) goto yy896;
+ goto yy749;
} else {
- if(yych <= '.') goto yy931;
- if(yych >= '0') goto yy784;
- goto yy930;
+ if(yych <= '.') goto yy896;
+ if(yych >= '0') goto yy749;
+ goto yy895;
}
-yy930:
- YYDEBUG(930, *YYCURSOR);
+yy895:
+ YYDEBUG(895, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(-1, yych);
switch(yych){
- case 'A': case 'a': goto yy876;
- case 'D': case 'd': goto yy880;
- case 'F': case 'f': goto yy874;
- case 'J': case 'j': goto yy873;
- case 'M': case 'm': goto yy875;
- case 'N': case 'n': goto yy879;
- case 'O': case 'o': goto yy878;
- case 'S': case 's': goto yy877;
+ case 'A': case 'a': goto yy841;
+ case 'D': case 'd': goto yy845;
+ case 'F': case 'f': goto yy839;
+ case 'J': case 'j': goto yy838;
+ case 'M': case 'm': goto yy840;
+ case 'N': case 'n': goto yy844;
+ case 'O': case 'o': goto yy843;
+ case 'S': case 's': goto yy842;
default: goto yy53;
}
-yy931:
- YYDEBUG(931, *YYCURSOR);
+yy896:
+ YYDEBUG(896, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy784;
- if(yych <= '0') goto yy932;
- if(yych <= '1') goto yy933;
- if(yych <= '9') goto yy934;
- goto yy784;
-yy932:
- YYDEBUG(932, *YYCURSOR);
+ if(yych <= '/') goto yy749;
+ if(yych <= '0') goto yy897;
+ if(yych <= '1') goto yy898;
+ if(yych <= '9') goto yy899;
+ goto yy749;
+yy897:
+ YYDEBUG(897, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= ',') goto yy53;
- if(yych <= '.') goto yy807;
+ if(yych <= '.') goto yy772;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy934;
+ if(yych <= '9') goto yy899;
goto yy53;
-yy933:
- YYDEBUG(933, *YYCURSOR);
+yy898:
+ YYDEBUG(898, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= ',') goto yy53;
- if(yych <= '.') goto yy807;
+ if(yych <= '.') goto yy772;
if(yych <= '/') goto yy53;
if(yych >= '3') goto yy53;
- goto yy934;
-yy934:
- YYDEBUG(934, *YYCURSOR);
+ goto yy899;
+yy899:
+ YYDEBUG(899, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= ',') goto yy53;
- if(yych <= '.') goto yy807;
+ if(yych <= '.') goto yy772;
goto yy53;
-yy935:
- YYDEBUG(935, *YYCURSOR);
+yy900:
+ YYDEBUG(900, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '-') goto yy936;
+ if(yych == '-') goto yy901;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy970;
+ if(yych <= '9') goto yy935;
goto yy57;
-yy936:
- YYDEBUG(936, *YYCURSOR);
+yy901:
+ YYDEBUG(901, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(-1, yych);
switch(yych){
- case '0': goto yy945;
- case '1': goto yy946;
+ case '0': goto yy910;
+ case '1': goto yy911;
case '2':
case '3':
case '4':
@@ -15596,206 +15092,206 @@ yy936:
case '6':
case '7':
case '8':
- case '9': goto yy947;
- case 'A': case 'a': goto yy940;
- case 'D': case 'd': goto yy944;
- case 'F': case 'f': goto yy938;
- case 'J': case 'j': goto yy937;
- case 'M': case 'm': goto yy939;
- case 'N': case 'n': goto yy943;
- case 'O': case 'o': goto yy942;
- case 'S': case 's': goto yy941;
+ case '9': goto yy912;
+ case 'A': case 'a': goto yy905;
+ case 'D': case 'd': goto yy909;
+ case 'F': case 'f': goto yy903;
+ case 'J': case 'j': goto yy902;
+ case 'M': case 'm': goto yy904;
+ case 'N': case 'n': goto yy908;
+ case 'O': case 'o': goto yy907;
+ case 'S': case 's': goto yy906;
default: goto yy53;
}
-yy937:
- YYDEBUG(937, *YYCURSOR);
+yy902:
+ YYDEBUG(902, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'A') goto yy969;
+ if(yych == 'A') goto yy934;
if(yych <= 'T') goto yy53;
- goto yy968;
+ goto yy933;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy969;
+ goto yy934;
} else {
- if(yych == 'u') goto yy968;
+ if(yych == 'u') goto yy933;
goto yy53;
}
}
-yy938:
- YYDEBUG(938, *YYCURSOR);
+yy903:
+ YYDEBUG(903, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy967;
- if(yych == 'e') goto yy967;
+ if(yych == 'E') goto yy932;
+ if(yych == 'e') goto yy932;
goto yy53;
-yy939:
- YYDEBUG(939, *YYCURSOR);
+yy904:
+ YYDEBUG(904, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy966;
- if(yych == 'a') goto yy966;
+ if(yych == 'A') goto yy931;
+ if(yych == 'a') goto yy931;
goto yy53;
-yy940:
- YYDEBUG(940, *YYCURSOR);
+yy905:
+ YYDEBUG(905, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'P') goto yy965;
+ if(yych == 'P') goto yy930;
if(yych <= 'T') goto yy53;
- goto yy964;
+ goto yy929;
} else {
if(yych <= 'p'){
if(yych <= 'o') goto yy53;
- goto yy965;
+ goto yy930;
} else {
- if(yych == 'u') goto yy964;
+ if(yych == 'u') goto yy929;
goto yy53;
}
}
-yy941:
- YYDEBUG(941, *YYCURSOR);
+yy906:
+ YYDEBUG(906, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy962;
- if(yych == 'e') goto yy962;
+ if(yych == 'E') goto yy927;
+ if(yych == 'e') goto yy927;
goto yy53;
-yy942:
- YYDEBUG(942, *YYCURSOR);
+yy907:
+ YYDEBUG(907, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy961;
- if(yych == 'c') goto yy961;
+ if(yych == 'C') goto yy926;
+ if(yych == 'c') goto yy926;
goto yy53;
-yy943:
- YYDEBUG(943, *YYCURSOR);
+yy908:
+ YYDEBUG(908, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy960;
- if(yych == 'o') goto yy960;
+ if(yych == 'O') goto yy925;
+ if(yych == 'o') goto yy925;
goto yy53;
-yy944:
- YYDEBUG(944, *YYCURSOR);
+yy909:
+ YYDEBUG(909, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy952;
- if(yych == 'e') goto yy952;
+ if(yych == 'E') goto yy917;
+ if(yych == 'e') goto yy917;
goto yy53;
-yy945:
- YYDEBUG(945, *YYCURSOR);
+yy910:
+ YYDEBUG(910, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '-') goto yy948;
+ if(yych == '-') goto yy913;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy947;
+ if(yych <= '9') goto yy912;
goto yy53;
-yy946:
- YYDEBUG(946, *YYCURSOR);
+yy911:
+ YYDEBUG(911, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '-') goto yy948;
+ if(yych == '-') goto yy913;
if(yych <= '/') goto yy53;
if(yych >= '3') goto yy53;
- goto yy947;
-yy947:
- YYDEBUG(947, *YYCURSOR);
+ goto yy912;
+yy912:
+ YYDEBUG(912, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '-') goto yy53;
- goto yy948;
-yy948:
- YYDEBUG(948, *YYCURSOR);
+ goto yy913;
+yy913:
+ YYDEBUG(913, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '2') goto yy949;
- if(yych <= '3') goto yy950;
- if(yych <= '9') goto yy951;
+ if(yych <= '2') goto yy914;
+ if(yych <= '3') goto yy915;
+ if(yych <= '9') goto yy916;
goto yy53;
-yy949:
- YYDEBUG(949, *YYCURSOR);
- yyaccept = 12;
+yy914:
+ YYDEBUG(914, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy860;
- if(yych <= '9') goto yy951;
- if(yych <= 'm') goto yy860;
- goto yy864;
+ if(yych <= '/') goto yy825;
+ if(yych <= '9') goto yy916;
+ if(yych <= 'm') goto yy825;
+ goto yy829;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy860;
- goto yy865;
+ if(yych <= 'q') goto yy825;
+ goto yy830;
} else {
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
}
-yy950:
- YYDEBUG(950, *YYCURSOR);
- yyaccept = 12;
+yy915:
+ YYDEBUG(915, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy860;
- if(yych <= '1') goto yy951;
- if(yych <= 'm') goto yy860;
- goto yy864;
+ if(yych <= '/') goto yy825;
+ if(yych <= '1') goto yy916;
+ if(yych <= 'm') goto yy825;
+ goto yy829;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy860;
- goto yy865;
+ if(yych <= 'q') goto yy825;
+ goto yy830;
} else {
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
}
-yy951:
- YYDEBUG(951, *YYCURSOR);
- yyaccept = 12;
+yy916:
+ YYDEBUG(916, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'q'){
- if(yych == 'n') goto yy864;
- goto yy860;
+ if(yych == 'n') goto yy829;
+ goto yy825;
} else {
- if(yych <= 'r') goto yy865;
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 'r') goto yy830;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
-yy952:
- YYDEBUG(952, *YYCURSOR);
+yy917:
+ YYDEBUG(917, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy953;
+ if(yych == 'C') goto yy918;
if(yych != 'c') goto yy53;
- goto yy953;
-yy953:
- YYDEBUG(953, *YYCURSOR);
+ goto yy918;
+yy918:
+ YYDEBUG(918, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '-') goto yy53;
- goto yy954;
-yy954:
- YYDEBUG(954, *YYCURSOR);
+ goto yy919;
+yy919:
+ YYDEBUG(919, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy955;
- if(yych <= '2') goto yy956;
- if(yych <= '3') goto yy957;
+ if(yych <= '0') goto yy920;
+ if(yych <= '2') goto yy921;
+ if(yych <= '3') goto yy922;
goto yy53;
-yy955:
- YYDEBUG(955, *YYCURSOR);
+yy920:
+ YYDEBUG(920, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '0') goto yy53;
- if(yych <= '9') goto yy958;
+ if(yych <= '9') goto yy923;
goto yy53;
-yy956:
- YYDEBUG(956, *YYCURSOR);
+yy921:
+ YYDEBUG(921, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy958;
+ if(yych <= '9') goto yy923;
goto yy53;
-yy957:
- YYDEBUG(957, *YYCURSOR);
+yy922:
+ YYDEBUG(922, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '2') goto yy53;
- goto yy958;
-yy958:
- YYDEBUG(958, *YYCURSOR);
+ goto yy923;
+yy923:
+ YYDEBUG(923, *YYCURSOR);
++YYCURSOR;
- goto yy959;
-yy959:
- YYDEBUG(959, *YYCURSOR);
+ goto yy924;
+yy924:
+ YYDEBUG(924, *YYCURSOR);
{
DEBUG_OUTPUT("pgtextreverse");
@@ -15808,94 +15304,94 @@ yy959:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
-yy960:
- YYDEBUG(960, *YYCURSOR);
+yy925:
+ YYDEBUG(925, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'V') goto yy953;
- if(yych == 'v') goto yy953;
+ if(yych == 'V') goto yy918;
+ if(yych == 'v') goto yy918;
goto yy53;
-yy961:
- YYDEBUG(961, *YYCURSOR);
+yy926:
+ YYDEBUG(926, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy953;
- if(yych == 't') goto yy953;
+ if(yych == 'T') goto yy918;
+ if(yych == 't') goto yy918;
goto yy53;
-yy962:
- YYDEBUG(962, *YYCURSOR);
+yy927:
+ YYDEBUG(927, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'P') goto yy963;
+ if(yych == 'P') goto yy928;
if(yych != 'p') goto yy53;
- goto yy963;
-yy963:
- YYDEBUG(963, *YYCURSOR);
+ goto yy928;
+yy928:
+ YYDEBUG(928, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
- if(yych == '-') goto yy954;
+ if(yych == '-') goto yy919;
goto yy53;
} else {
- if(yych <= 'T') goto yy953;
- if(yych == 't') goto yy953;
+ if(yych <= 'T') goto yy918;
+ if(yych == 't') goto yy918;
goto yy53;
}
-yy964:
- YYDEBUG(964, *YYCURSOR);
+yy929:
+ YYDEBUG(929, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy953;
- if(yych == 'g') goto yy953;
+ if(yych == 'G') goto yy918;
+ if(yych == 'g') goto yy918;
goto yy53;
-yy965:
- YYDEBUG(965, *YYCURSOR);
+yy930:
+ YYDEBUG(930, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy953;
- if(yych == 'r') goto yy953;
+ if(yych == 'R') goto yy918;
+ if(yych == 'r') goto yy918;
goto yy53;
-yy966:
- YYDEBUG(966, *YYCURSOR);
+yy931:
+ YYDEBUG(931, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
- if(yych == 'R') goto yy953;
+ if(yych == 'R') goto yy918;
if(yych <= 'X') goto yy53;
- goto yy953;
+ goto yy918;
} else {
if(yych <= 'r'){
if(yych <= 'q') goto yy53;
- goto yy953;
+ goto yy918;
} else {
- if(yych == 'y') goto yy953;
+ if(yych == 'y') goto yy918;
goto yy53;
}
}
-yy967:
- YYDEBUG(967, *YYCURSOR);
+yy932:
+ YYDEBUG(932, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy953;
- if(yych == 'b') goto yy953;
+ if(yych == 'B') goto yy918;
+ if(yych == 'b') goto yy918;
goto yy53;
-yy968:
- YYDEBUG(968, *YYCURSOR);
+yy933:
+ YYDEBUG(933, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
- if(yych == 'L') goto yy953;
+ if(yych == 'L') goto yy918;
if(yych <= 'M') goto yy53;
- goto yy953;
+ goto yy918;
} else {
if(yych <= 'l'){
if(yych <= 'k') goto yy53;
- goto yy953;
+ goto yy918;
} else {
- if(yych == 'n') goto yy953;
+ if(yych == 'n') goto yy918;
goto yy53;
}
}
-yy969:
- YYDEBUG(969, *YYCURSOR);
+yy934:
+ YYDEBUG(934, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy953;
- if(yych == 'n') goto yy953;
+ if(yych == 'N') goto yy918;
+ if(yych == 'n') goto yy918;
goto yy53;
-yy970:
- YYDEBUG(970, *YYCURSOR);
- yyaccept = 14;
+yy935:
+ YYDEBUG(935, *YYCURSOR);
+ yyaccept = 15;
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
@@ -15908,26 +15404,26 @@ yy970:
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 yy975;
- case '-': goto yy972;
- case '.': goto yy976;
- case '/': goto yy973;
- case '0': goto yy989;
- case '1': goto yy990;
- case '2': goto yy992;
- case '3': goto yy993;
+ case 't': case 'w': case 'y': goto yy940;
+ case '-': goto yy937;
+ case '.': goto yy941;
+ case '/': goto yy938;
+ case '0': goto yy954;
+ case '1': goto yy955;
+ case '2': goto yy957;
+ case '3': goto yy958;
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy51;
- case ':': goto yy991;
- case 'W': goto yy994;
- default: goto yy971;
+ case ':': goto yy956;
+ case 'W': goto yy959;
+ default: goto yy936;
}
-yy971:
- YYDEBUG(971, *YYCURSOR);
+yy936:
+ YYDEBUG(936, *YYCURSOR);
{
DEBUG_OUTPUT("year4");
@@ -15936,13 +15432,13 @@ yy971:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
-yy972:
- YYDEBUG(972, *YYCURSOR);
+yy937:
+ YYDEBUG(937, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(-1, yych);
switch(yych){
- case '0': goto yy1156;
- case '1': goto yy1157;
+ case '0': goto yy1123;
+ case '1': goto yy1125;
case '2':
case '3':
case '4':
@@ -15950,76 +15446,77 @@ yy972:
case '6':
case '7':
case '8':
- case '9': goto yy1158;
- case 'A': case 'a': goto yy1151;
- case 'D': case 'd': goto yy1155;
- case 'F': case 'f': goto yy1149;
- case 'J': case 'j': goto yy1148;
- case 'M': case 'm': goto yy1150;
- case 'N': case 'n': goto yy1154;
- case 'O': case 'o': goto yy1153;
- case 'S': case 's': goto yy1152;
- default: goto yy1121;
+ case '9': goto yy1126;
+ case 'A': case 'a': goto yy1117;
+ case 'D': case 'd': goto yy1121;
+ case 'F': case 'f': goto yy1115;
+ case 'J': case 'j': goto yy1114;
+ case 'M': case 'm': goto yy1116;
+ case 'N': case 'n': goto yy1120;
+ case 'O': case 'o': goto yy1119;
+ case 'S': case 's': goto yy1118;
+ case 'W': goto yy1122;
+ default: goto yy1087;
}
-yy973:
- YYDEBUG(973, *YYCURSOR);
+yy938:
+ YYDEBUG(938, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy1129;
- if(yych <= '1') goto yy1130;
- if(yych <= '9') goto yy1131;
+ if(yych <= '0') goto yy1095;
+ if(yych <= '1') goto yy1096;
+ if(yych <= '9') goto yy1097;
goto yy53;
-yy974:
- YYDEBUG(974, *YYCURSOR);
+yy939:
+ YYDEBUG(939, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
yych = *YYCURSOR;
- goto yy975;
-yy975:
- YYDEBUG(975, *YYCURSOR);
+ goto yy940;
+yy940:
+ YYDEBUG(940, *YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: case ' ': goto yy974;
+ case 0x09: case ' ': goto yy939;
case '-':
- case '.': goto yy1120;
- case 'A': case 'a': goto yy984;
- case 'D': case 'd': goto yy988;
- case 'F': case 'f': goto yy982;
+ case '.': goto yy1086;
+ case 'A': case 'a': goto yy949;
+ case 'D': case 'd': goto yy953;
+ case 'F': case 'f': goto yy947;
case 'H': case 'h': goto yy60;
- case 'I': goto yy977;
- case 'J': case 'j': goto yy981;
- case 'M': case 'm': goto yy983;
- case 'N': case 'n': goto yy987;
- case 'O': case 'o': goto yy986;
- case 'S': case 's': goto yy985;
+ case 'I': goto yy942;
+ case 'J': case 'j': goto yy946;
+ case 'M': case 'm': goto yy948;
+ case 'N': case 'n': goto yy952;
+ case 'O': case 'o': goto yy951;
+ case 'S': case 's': goto yy950;
case 'T': case 't': goto yy65;
- case 'V': goto yy979;
+ case 'V': goto yy944;
case 'W': case 'w': goto yy62;
- case 'X': goto yy980;
+ case 'X': goto yy945;
case 'Y': case 'y': goto yy64;
default: goto yy53;
}
-yy976:
- YYDEBUG(976, *YYCURSOR);
+yy941:
+ YYDEBUG(941, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1121;
- if(yych <= '0') goto yy1113;
- if(yych <= '2') goto yy1114;
- if(yych <= '3') goto yy1115;
- goto yy1121;
-yy977:
- YYDEBUG(977, *YYCURSOR);
+ if(yych <= '/') goto yy1087;
+ if(yych <= '0') goto yy1079;
+ if(yych <= '2') goto yy1080;
+ if(yych <= '3') goto yy1081;
+ goto yy1087;
+yy942:
+ YYDEBUG(942, *YYCURSOR);
++YYCURSOR;
if((yych = *YYCURSOR) <= 'U'){
- if(yych == 'I') goto yy1112;
- goto yy978;
+ if(yych == 'I') goto yy1078;
+ goto yy943;
} else {
- if(yych == 'W') goto yy978;
- if(yych <= 'X') goto yy1066;
- goto yy978;
+ if(yych == 'W') goto yy943;
+ if(yych <= 'X') goto yy1032;
+ goto yy943;
}
-yy978:
- YYDEBUG(978, *YYCURSOR);
+yy943:
+ YYDEBUG(943, *YYCURSOR);
{
DEBUG_OUTPUT("datenodayrev");
@@ -16032,38 +15529,38 @@ yy978:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
-yy979:
- YYDEBUG(979, *YYCURSOR);
+yy944:
+ YYDEBUG(944, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy1110;
- goto yy978;
-yy980:
- YYDEBUG(980, *YYCURSOR);
+ if(yych == 'I') goto yy1076;
+ goto yy943;
+yy945:
+ YYDEBUG(945, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy1109;
- goto yy978;
-yy981:
- YYDEBUG(981, *YYCURSOR);
+ if(yych == 'I') goto yy1075;
+ goto yy943;
+yy946:
+ YYDEBUG(946, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'A') goto yy1102;
+ if(yych == 'A') goto yy1068;
if(yych <= 'T') goto yy53;
- goto yy1101;
+ goto yy1067;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy1102;
+ goto yy1068;
} else {
- if(yych == 'u') goto yy1101;
+ if(yych == 'u') goto yy1067;
goto yy53;
}
}
-yy982:
- YYDEBUG(982, *YYCURSOR);
+yy947:
+ YYDEBUG(947, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= 'N'){
- if(yych == 'E') goto yy1095;
+ if(yych == 'E') goto yy1061;
goto yy53;
} else {
if(yych <= 'O') goto yy83;
@@ -16072,7 +15569,7 @@ yy982:
}
} else {
if(yych <= 'n'){
- if(yych == 'e') goto yy1095;
+ if(yych == 'e') goto yy1061;
goto yy53;
} else {
if(yych <= 'o') goto yy83;
@@ -16080,137 +15577,137 @@ yy982:
goto yy53;
}
}
-yy983:
- YYDEBUG(983, *YYCURSOR);
+yy948:
+ YYDEBUG(948, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= 'H'){
- if(yych == 'A') goto yy1092;
+ if(yych == 'A') goto yy1058;
goto yy53;
} else {
- if(yych <= 'I') goto yy110;
+ if(yych <= 'I') goto yy114;
if(yych <= 'N') goto yy53;
- goto yy109;
+ goto yy113;
}
} else {
if(yych <= 'h'){
- if(yych == 'a') goto yy1092;
+ if(yych == 'a') goto yy1058;
goto yy53;
} else {
- if(yych <= 'i') goto yy110;
- if(yych == 'o') goto yy109;
+ if(yych <= 'i') goto yy114;
+ if(yych == 'o') goto yy113;
goto yy53;
}
}
-yy984:
- YYDEBUG(984, *YYCURSOR);
+yy949:
+ YYDEBUG(949, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'P') goto yy1086;
+ if(yych == 'P') goto yy1052;
if(yych <= 'T') goto yy53;
- goto yy1085;
+ goto yy1051;
} else {
if(yych <= 'p'){
if(yych <= 'o') goto yy53;
- goto yy1086;
+ goto yy1052;
} else {
- if(yych == 'u') goto yy1085;
+ if(yych == 'u') goto yy1051;
goto yy53;
}
}
-yy985:
- YYDEBUG(985, *YYCURSOR);
+yy950:
+ YYDEBUG(950, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= 'D'){
- if(yych == 'A') goto yy119;
+ if(yych == 'A') goto yy123;
goto yy53;
} else {
- if(yych <= 'E') goto yy1078;
+ if(yych <= 'E') goto yy1044;
if(yych <= 'T') goto yy53;
- goto yy118;
+ goto yy122;
}
} else {
if(yych <= 'd'){
- if(yych == 'a') goto yy119;
+ if(yych == 'a') goto yy123;
goto yy53;
} else {
- if(yych <= 'e') goto yy1078;
- if(yych == 'u') goto yy118;
+ if(yych <= 'e') goto yy1044;
+ if(yych == 'u') goto yy122;
goto yy53;
}
}
-yy986:
- YYDEBUG(986, *YYCURSOR);
+yy951:
+ YYDEBUG(951, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy1073;
- if(yych == 'c') goto yy1073;
+ if(yych == 'C') goto yy1039;
+ if(yych == 'c') goto yy1039;
goto yy53;
-yy987:
- YYDEBUG(987, *YYCURSOR);
+yy952:
+ YYDEBUG(952, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy1067;
- if(yych == 'o') goto yy1067;
+ if(yych == 'O') goto yy1033;
+ if(yych == 'o') goto yy1033;
goto yy53;
-yy988:
- YYDEBUG(988, *YYCURSOR);
+yy953:
+ YYDEBUG(953, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
- if(yych == 'A') goto yy106;
+ if(yych == 'A') goto yy110;
if(yych <= 'D') goto yy53;
- goto yy1060;
+ goto yy1026;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy106;
+ goto yy110;
} else {
- if(yych == 'e') goto yy1060;
+ if(yych == 'e') goto yy1026;
goto yy53;
}
}
-yy989:
- YYDEBUG(989, *YYCURSOR);
+yy954:
+ YYDEBUG(954, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '0') goto yy1058;
- if(yych <= '9') goto yy1059;
+ if(yych <= '0') goto yy1024;
+ if(yych <= '9') goto yy1025;
goto yy57;
-yy990:
- YYDEBUG(990, *YYCURSOR);
+yy955:
+ YYDEBUG(955, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '2') goto yy1027;
- if(yych <= '9') goto yy1006;
+ if(yych <= '2') goto yy993;
+ if(yych <= '9') goto yy972;
goto yy57;
-yy991:
- YYDEBUG(991, *YYCURSOR);
+yy956:
+ YYDEBUG(956, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy1007;
- if(yych <= '1') goto yy1008;
+ if(yych <= '0') goto yy973;
+ if(yych <= '1') goto yy974;
goto yy53;
-yy992:
- YYDEBUG(992, *YYCURSOR);
+yy957:
+ YYDEBUG(957, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy1006;
+ if(yych <= '9') goto yy972;
goto yy57;
-yy993:
- YYDEBUG(993, *YYCURSOR);
+yy958:
+ YYDEBUG(958, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '5') goto yy1002;
- if(yych <= '6') goto yy1003;
+ if(yych <= '5') goto yy968;
+ if(yych <= '6') goto yy969;
if(yych <= '9') goto yy51;
goto yy57;
-yy994:
- YYDEBUG(994, *YYCURSOR);
+yy959:
+ YYDEBUG(959, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '5'){
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy995;
- if(yych <= '4') goto yy996;
- goto yy997;
+ if(yych <= '0') goto yy960;
+ if(yych <= '4') goto yy961;
+ goto yy962;
} else {
if(yych <= 'E'){
if(yych <= 'D') goto yy53;
@@ -16220,32 +15717,34 @@ yy994:
goto yy53;
}
}
-yy995:
- YYDEBUG(995, *YYCURSOR);
+yy960:
+ YYDEBUG(960, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '0') goto yy53;
- if(yych <= '9') goto yy998;
+ if(yych <= '9') goto yy963;
goto yy53;
-yy996:
- YYDEBUG(996, *YYCURSOR);
+yy961:
+ YYDEBUG(961, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy998;
+ if(yych <= '9') goto yy963;
goto yy53;
-yy997:
- YYDEBUG(997, *YYCURSOR);
+yy962:
+ YYDEBUG(962, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '4') goto yy53;
- goto yy998;
-yy998:
- YYDEBUG(998, *YYCURSOR);
- ++YYCURSOR;
- if((yych = *YYCURSOR) <= '/') goto yy999;
- if(yych <= '7') goto yy1000;
- goto yy999;
-yy999:
- YYDEBUG(999, *YYCURSOR);
+ goto yy963;
+yy963:
+ YYDEBUG(963, *YYCURSOR);
+ yyaccept = 16;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '-') goto yy965;
+ if(yych <= '/') goto yy964;
+ if(yych <= '7') goto yy966;
+ goto yy964;
+yy964:
+ YYDEBUG(964, *YYCURSOR);
{
timelib_sll w, d;
@@ -16264,12 +15763,18 @@ yy999:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
-yy1000:
- YYDEBUG(1000, *YYCURSOR);
+yy965:
+ YYDEBUG(965, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy53;
+ if(yych >= '8') goto yy53;
+ goto yy966;
+yy966:
+ YYDEBUG(966, *YYCURSOR);
++YYCURSOR;
- goto yy1001;
-yy1001:
- YYDEBUG(1001, *YYCURSOR);
+ goto yy967;
+yy967:
+ YYDEBUG(967, *YYCURSOR);
{
timelib_sll w, d;
@@ -16288,22 +15793,22 @@ yy1001:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
-yy1002:
- YYDEBUG(1002, *YYCURSOR);
+yy968:
+ YYDEBUG(968, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy1004;
+ if(yych <= '9') goto yy970;
goto yy57;
-yy1003:
- YYDEBUG(1003, *YYCURSOR);
+yy969:
+ YYDEBUG(969, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '6') goto yy1004;
+ if(yych <= '6') goto yy970;
if(yych <= '9') goto yy51;
goto yy57;
-yy1004:
- YYDEBUG(1004, *YYCURSOR);
- yyaccept = 15;
+yy970:
+ YYDEBUG(970, *YYCURSOR);
+ yyaccept = 17;
yych = *(YYMARKER = ++YYCURSOR);
if(yybm[0+yych] & 8) {
goto yy51;
@@ -16313,22 +15818,22 @@ yy1004:
if(yych <= ' '){
if(yych == 0x09) goto yy57;
if(yych >= ' ') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych == 'D') goto yy57;
if(yych >= 'F') goto yy57;
- goto yy1005;
+ goto yy971;
}
} else {
if(yych <= 'M'){
if(yych == 'H') goto yy57;
if(yych >= 'M') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
- if(yych <= 'R') goto yy1005;
+ if(yych <= 'R') goto yy971;
if(yych <= 'T') goto yy57;
if(yych >= 'W') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
} else {
@@ -16336,30 +15841,30 @@ yy1004:
if(yych <= 'd'){
if(yych == 'Y') goto yy57;
if(yych >= 'd') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych == 'f') goto yy57;
if(yych >= 'h') goto yy57;
- goto yy1005;
+ goto yy971;
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
if(yych >= 's') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych <= 'w'){
if(yych >= 'w') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych == 'y') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
}
-yy1005:
- YYDEBUG(1005, *YYCURSOR);
+yy971:
+ YYDEBUG(971, *YYCURSOR);
{
DEBUG_OUTPUT("pgydotd");
@@ -16372,125 +15877,125 @@ yy1005:
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
-yy1006:
- YYDEBUG(1006, *YYCURSOR);
+yy972:
+ YYDEBUG(972, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy1004;
+ if(yych <= '9') goto yy970;
goto yy57;
-yy1007:
- YYDEBUG(1007, *YYCURSOR);
+yy973:
+ YYDEBUG(973, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '0') goto yy53;
- if(yych <= '9') goto yy1009;
+ if(yych <= '9') goto yy975;
goto yy53;
-yy1008:
- YYDEBUG(1008, *YYCURSOR);
+yy974:
+ YYDEBUG(974, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '3') goto yy53;
- goto yy1009;
-yy1009:
- YYDEBUG(1009, *YYCURSOR);
+ goto yy975;
+yy975:
+ YYDEBUG(975, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1010;
-yy1010:
- YYDEBUG(1010, *YYCURSOR);
+ goto yy976;
+yy976:
+ YYDEBUG(976, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy1011;
- if(yych <= '2') goto yy1012;
- if(yych <= '3') goto yy1013;
+ if(yych <= '0') goto yy977;
+ if(yych <= '2') goto yy978;
+ if(yych <= '3') goto yy979;
goto yy53;
-yy1011:
- YYDEBUG(1011, *YYCURSOR);
+yy977:
+ YYDEBUG(977, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '0') goto yy53;
- if(yych <= '9') goto yy1014;
+ if(yych <= '9') goto yy980;
goto yy53;
-yy1012:
- YYDEBUG(1012, *YYCURSOR);
+yy978:
+ YYDEBUG(978, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1014;
+ if(yych <= '9') goto yy980;
goto yy53;
-yy1013:
- YYDEBUG(1013, *YYCURSOR);
+yy979:
+ YYDEBUG(979, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '2') goto yy53;
- goto yy1014;
-yy1014:
- YYDEBUG(1014, *YYCURSOR);
+ goto yy980;
+yy980:
+ YYDEBUG(980, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ' ') goto yy53;
- goto yy1015;
-yy1015:
- YYDEBUG(1015, *YYCURSOR);
+ goto yy981;
+yy981:
+ YYDEBUG(981, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy1016;
- if(yych <= '2') goto yy1017;
+ if(yych <= '1') goto yy982;
+ if(yych <= '2') goto yy983;
goto yy53;
-yy1016:
- YYDEBUG(1016, *YYCURSOR);
+yy982:
+ YYDEBUG(982, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1018;
+ if(yych <= '9') goto yy984;
goto yy53;
-yy1017:
- YYDEBUG(1017, *YYCURSOR);
+yy983:
+ YYDEBUG(983, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '4') goto yy53;
- goto yy1018;
-yy1018:
- YYDEBUG(1018, *YYCURSOR);
+ goto yy984;
+yy984:
+ YYDEBUG(984, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1019;
-yy1019:
- YYDEBUG(1019, *YYCURSOR);
+ goto yy985;
+yy985:
+ YYDEBUG(985, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '6') goto yy53;
- goto yy1020;
-yy1020:
- YYDEBUG(1020, *YYCURSOR);
+ goto yy986;
+yy986:
+ YYDEBUG(986, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1021;
-yy1021:
- YYDEBUG(1021, *YYCURSOR);
+ goto yy987;
+yy987:
+ YYDEBUG(987, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1022;
-yy1022:
- YYDEBUG(1022, *YYCURSOR);
+ goto yy988;
+yy988:
+ YYDEBUG(988, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1023;
- if(yych <= '6') goto yy1024;
+ if(yych <= '5') goto yy989;
+ if(yych <= '6') goto yy990;
goto yy53;
-yy1023:
- YYDEBUG(1023, *YYCURSOR);
+yy989:
+ YYDEBUG(989, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1025;
+ if(yych <= '9') goto yy991;
goto yy53;
-yy1024:
- YYDEBUG(1024, *YYCURSOR);
+yy990:
+ YYDEBUG(990, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '0') goto yy53;
- goto yy1025;
-yy1025:
- YYDEBUG(1025, *YYCURSOR);
+ goto yy991;
+yy991:
+ YYDEBUG(991, *YYCURSOR);
++YYCURSOR;
- goto yy1026;
-yy1026:
- YYDEBUG(1026, *YYCURSOR);
+ goto yy992;
+yy992:
+ YYDEBUG(992, *YYCURSOR);
{
int tz_not_found;
@@ -16516,218 +16021,218 @@ yy1026:
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
-yy1027:
- YYDEBUG(1027, *YYCURSOR);
+yy993:
+ YYDEBUG(993, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '2'){
if(yych <= '/') goto yy57;
- if(yych >= '1') goto yy1029;
- goto yy1028;
+ if(yych >= '1') goto yy995;
+ goto yy994;
} else {
- if(yych <= '3') goto yy1030;
- if(yych <= '9') goto yy1004;
+ if(yych <= '3') goto yy996;
+ if(yych <= '9') goto yy970;
goto yy57;
}
-yy1028:
- YYDEBUG(1028, *YYCURSOR);
- yyaccept = 15;
+yy994:
+ YYDEBUG(994, *YYCURSOR);
+ yyaccept = 17;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1005;
+ if(yych <= 0x1F) goto yy971;
goto yy57;
} else {
if(yych <= '0'){
- if(yych <= '/') goto yy1005;
+ if(yych <= '/') goto yy971;
goto yy51;
} else {
- if(yych <= '9') goto yy1031;
- if(yych <= 'C') goto yy1005;
+ if(yych <= '9') goto yy997;
+ if(yych <= 'C') goto yy971;
goto yy57;
}
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1005;
+ if(yych <= 'G') goto yy971;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1005;
+ if(yych <= 'L') goto yy971;
goto yy57;
} else {
- if(yych <= 'R') goto yy1005;
+ if(yych <= 'R') goto yy971;
if(yych <= 'T') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1005;
+ if(yych == 'X') goto yy971;
if(yych <= 'Y') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
- if(yych == 'g') goto yy1005;
+ if(yych == 'g') goto yy971;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1005;
+ if(yych <= 'r') goto yy971;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1005;
+ if(yych <= 'v') goto yy971;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
}
-yy1029:
- YYDEBUG(1029, *YYCURSOR);
- yyaccept = 15;
+yy995:
+ YYDEBUG(995, *YYCURSOR);
+ yyaccept = 17;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1005;
+ if(yych <= 0x1F) goto yy971;
goto yy57;
} else {
- if(yych <= '/') goto yy1005;
- if(yych <= '9') goto yy1031;
- if(yych <= 'C') goto yy1005;
+ if(yych <= '/') goto yy971;
+ if(yych <= '9') goto yy997;
+ if(yych <= 'C') goto yy971;
goto yy57;
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1005;
+ if(yych <= 'G') goto yy971;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1005;
+ if(yych <= 'L') goto yy971;
goto yy57;
} else {
- if(yych <= 'R') goto yy1005;
+ if(yych <= 'R') goto yy971;
if(yych <= 'T') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1005;
+ if(yych == 'X') goto yy971;
if(yych <= 'Y') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
- if(yych == 'g') goto yy1005;
+ if(yych == 'g') goto yy971;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1005;
+ if(yych <= 'r') goto yy971;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1005;
+ if(yych <= 'v') goto yy971;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
}
-yy1030:
- YYDEBUG(1030, *YYCURSOR);
- yyaccept = 15;
+yy996:
+ YYDEBUG(996, *YYCURSOR);
+ yyaccept = 17;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1005;
+ if(yych <= 0x1F) goto yy971;
goto yy57;
} else {
if(yych <= '1'){
- if(yych <= '/') goto yy1005;
- goto yy1031;
+ if(yych <= '/') goto yy971;
+ goto yy997;
} else {
if(yych <= '9') goto yy51;
- if(yych <= 'C') goto yy1005;
+ if(yych <= 'C') goto yy971;
goto yy57;
}
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1005;
+ if(yych <= 'G') goto yy971;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1005;
+ if(yych <= 'L') goto yy971;
goto yy57;
} else {
- if(yych <= 'R') goto yy1005;
+ if(yych <= 'R') goto yy971;
if(yych <= 'T') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1005;
+ if(yych == 'X') goto yy971;
if(yych <= 'Y') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
- if(yych == 'g') goto yy1005;
+ if(yych == 'g') goto yy971;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1005;
+ if(yych <= 'r') goto yy971;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1005;
+ if(yych <= 'v') goto yy971;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
}
-yy1031:
- YYDEBUG(1031, *YYCURSOR);
- yyaccept = 16;
+yy997:
+ YYDEBUG(997, *YYCURSOR);
+ yyaccept = 18;
yych = *(YYMARKER = ++YYCURSOR);
if(yybm[0+yych] & 8) {
goto yy51;
@@ -16737,25 +16242,25 @@ yy1031:
if(yych <= ' '){
if(yych == 0x09) goto yy56;
if(yych >= ' ') goto yy56;
- goto yy1032;
+ goto yy998;
} else {
if(yych == 'D') goto yy61;
if(yych >= 'F') goto yy63;
- goto yy1032;
+ goto yy998;
}
} else {
if(yych <= 'M'){
if(yych == 'H') goto yy60;
if(yych >= 'M') goto yy59;
- goto yy1032;
+ goto yy998;
} else {
if(yych <= 'S'){
if(yych >= 'S') goto yy58;
- goto yy1032;
+ goto yy998;
} else {
- if(yych <= 'T') goto yy1033;
+ if(yych <= 'T') goto yy999;
if(yych >= 'W') goto yy62;
- goto yy1032;
+ goto yy998;
}
}
}
@@ -16764,35 +16269,35 @@ yy1031:
if(yych <= 'd'){
if(yych == 'Y') goto yy64;
if(yych >= 'd') goto yy61;
- goto yy1032;
+ goto yy998;
} else {
if(yych <= 'f'){
if(yych >= 'f') goto yy63;
- goto yy1032;
+ goto yy998;
} else {
if(yych == 'h') goto yy60;
- goto yy1032;
+ goto yy998;
}
}
} else {
if(yych <= 't'){
if(yych <= 'm') goto yy59;
- if(yych <= 'r') goto yy1032;
+ if(yych <= 'r') goto yy998;
if(yych <= 's') goto yy58;
- goto yy1034;
+ goto yy1000;
} else {
if(yych <= 'w'){
if(yych >= 'w') goto yy62;
- goto yy1032;
+ goto yy998;
} else {
if(yych == 'y') goto yy64;
- goto yy1032;
+ goto yy998;
}
}
}
}
-yy1032:
- YYDEBUG(1032, *YYCURSOR);
+yy998:
+ YYDEBUG(998, *YYCURSOR);
{
DEBUG_OUTPUT("datenocolon");
@@ -16804,16 +16309,16 @@ yy1032:
TIMELIB_DEINIT;
return TIMELIB_DATE_NOCOLON;
}
-yy1033:
- YYDEBUG(1033, *YYCURSOR);
+yy999:
+ YYDEBUG(999, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= '2'){
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy1048;
- goto yy1049;
+ if(yych <= '1') goto yy1014;
+ goto yy1015;
} else {
- if(yych <= '9') goto yy1050;
+ if(yych <= '9') goto yy1016;
if(yych <= 'G') goto yy53;
goto yy66;
}
@@ -16827,16 +16332,16 @@ yy1033:
goto yy53;
}
}
-yy1034:
- YYDEBUG(1034, *YYCURSOR);
+yy1000:
+ YYDEBUG(1000, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= '2'){
if(yych <= '/') goto yy53;
- if(yych >= '2') goto yy1036;
- goto yy1035;
+ if(yych >= '2') goto yy1002;
+ goto yy1001;
} else {
- if(yych <= '9') goto yy1037;
+ if(yych <= '9') goto yy1003;
if(yych <= 'G') goto yy53;
goto yy66;
}
@@ -16850,689 +16355,689 @@ yy1034:
goto yy53;
}
}
-yy1035:
- YYDEBUG(1035, *YYCURSOR);
+yy1001:
+ YYDEBUG(1001, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1042;
- if(yych <= '9') goto yy1037;
+ if(yych <= '5') goto yy1008;
+ if(yych <= '9') goto yy1003;
goto yy53;
-yy1036:
- YYDEBUG(1036, *YYCURSOR);
+yy1002:
+ YYDEBUG(1002, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '3') goto yy1042;
- if(yych <= '5') goto yy1038;
+ if(yych <= '3') goto yy1008;
+ if(yych <= '5') goto yy1004;
goto yy53;
-yy1037:
- YYDEBUG(1037, *YYCURSOR);
+yy1003:
+ YYDEBUG(1003, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '6') goto yy53;
- goto yy1038;
-yy1038:
- YYDEBUG(1038, *YYCURSOR);
+ goto yy1004;
+yy1004:
+ YYDEBUG(1004, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1039;
-yy1039:
- YYDEBUG(1039, *YYCURSOR);
+ goto yy1005;
+yy1005:
+ YYDEBUG(1005, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1040;
- if(yych <= '6') goto yy1041;
+ if(yych <= '5') goto yy1006;
+ if(yych <= '6') goto yy1007;
goto yy53;
-yy1040:
- YYDEBUG(1040, *YYCURSOR);
+yy1006:
+ YYDEBUG(1006, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1025;
+ if(yych <= '9') goto yy991;
goto yy53;
-yy1041:
- YYDEBUG(1041, *YYCURSOR);
+yy1007:
+ YYDEBUG(1007, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '0') goto yy1025;
+ if(yych == '0') goto yy991;
goto yy53;
-yy1042:
- YYDEBUG(1042, *YYCURSOR);
+yy1008:
+ YYDEBUG(1008, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1043;
- if(yych <= '9') goto yy1039;
+ if(yych <= '5') goto yy1009;
+ if(yych <= '9') goto yy1005;
goto yy53;
-yy1043:
- YYDEBUG(1043, *YYCURSOR);
+yy1009:
+ YYDEBUG(1009, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1044;
- if(yych <= '6') goto yy1045;
- if(yych <= '9') goto yy1039;
+ if(yych <= '5') goto yy1010;
+ if(yych <= '6') goto yy1011;
+ if(yych <= '9') goto yy1005;
goto yy53;
-yy1044:
- YYDEBUG(1044, *YYCURSOR);
+yy1010:
+ YYDEBUG(1010, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1046;
- if(yych <= '6') goto yy1047;
- if(yych <= '9') goto yy1025;
+ if(yych <= '5') goto yy1012;
+ if(yych <= '6') goto yy1013;
+ if(yych <= '9') goto yy991;
goto yy53;
-yy1045:
- YYDEBUG(1045, *YYCURSOR);
+yy1011:
+ YYDEBUG(1011, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy1046;
- if(yych <= '5') goto yy1040;
- if(yych <= '6') goto yy1041;
+ if(yych <= '0') goto yy1012;
+ if(yych <= '5') goto yy1006;
+ if(yych <= '6') goto yy1007;
goto yy53;
-yy1046:
- YYDEBUG(1046, *YYCURSOR);
+yy1012:
+ YYDEBUG(1012, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '9') goto yy1025;
- goto yy1026;
-yy1047:
- YYDEBUG(1047, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '9') goto yy991;
+ goto yy992;
+yy1013:
+ YYDEBUG(1013, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '0') goto yy1025;
- goto yy1026;
-yy1048:
- YYDEBUG(1048, *YYCURSOR);
+ if(yych == '0') goto yy991;
+ goto yy992;
+yy1014:
+ YYDEBUG(1014, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1057;
- if(yych <= '9') goto yy1050;
- if(yych <= ':') goto yy1051;
+ if(yych <= '5') goto yy1023;
+ if(yych <= '9') goto yy1016;
+ if(yych <= ':') goto yy1017;
goto yy53;
-yy1049:
- YYDEBUG(1049, *YYCURSOR);
+yy1015:
+ YYDEBUG(1015, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '5'){
if(yych <= '/') goto yy53;
- if(yych <= '3') goto yy1057;
- goto yy1038;
+ if(yych <= '3') goto yy1023;
+ goto yy1004;
} else {
- if(yych == ':') goto yy1051;
+ if(yych == ':') goto yy1017;
goto yy53;
}
-yy1050:
- YYDEBUG(1050, *YYCURSOR);
+yy1016:
+ YYDEBUG(1016, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1038;
+ if(yych <= '5') goto yy1004;
if(yych != ':') goto yy53;
- goto yy1051;
-yy1051:
- YYDEBUG(1051, *YYCURSOR);
+ goto yy1017;
+yy1017:
+ YYDEBUG(1017, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '6') goto yy53;
- goto yy1052;
-yy1052:
- YYDEBUG(1052, *YYCURSOR);
+ goto yy1018;
+yy1018:
+ YYDEBUG(1018, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1053;
-yy1053:
- YYDEBUG(1053, *YYCURSOR);
+ goto yy1019;
+yy1019:
+ YYDEBUG(1019, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1054;
-yy1054:
- YYDEBUG(1054, *YYCURSOR);
+ goto yy1020;
+yy1020:
+ YYDEBUG(1020, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1055;
- if(yych <= '6') goto yy1056;
+ if(yych <= '5') goto yy1021;
+ if(yych <= '6') goto yy1022;
goto yy53;
-yy1055:
- YYDEBUG(1055, *YYCURSOR);
+yy1021:
+ YYDEBUG(1021, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1025;
+ if(yych <= '9') goto yy991;
goto yy53;
-yy1056:
- YYDEBUG(1056, *YYCURSOR);
+yy1022:
+ YYDEBUG(1022, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '0') goto yy1025;
+ if(yych == '0') goto yy991;
goto yy53;
-yy1057:
- YYDEBUG(1057, *YYCURSOR);
+yy1023:
+ YYDEBUG(1023, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1043;
- if(yych <= '9') goto yy1039;
- if(yych <= ':') goto yy1051;
+ if(yych <= '5') goto yy1009;
+ if(yych <= '9') goto yy1005;
+ if(yych <= ':') goto yy1017;
goto yy53;
-yy1058:
- YYDEBUG(1058, *YYCURSOR);
+yy1024:
+ YYDEBUG(1024, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
if(yych <= '0') goto yy51;
- if(yych <= '9') goto yy1004;
+ if(yych <= '9') goto yy970;
goto yy57;
-yy1059:
- YYDEBUG(1059, *YYCURSOR);
+yy1025:
+ YYDEBUG(1025, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '2'){
if(yych <= '/') goto yy57;
- if(yych <= '0') goto yy1028;
- goto yy1029;
+ if(yych <= '0') goto yy994;
+ goto yy995;
} else {
- if(yych <= '3') goto yy1030;
- if(yych <= '9') goto yy1004;
+ if(yych <= '3') goto yy996;
+ if(yych <= '9') goto yy970;
goto yy57;
}
-yy1060:
- YYDEBUG(1060, *YYCURSOR);
+yy1026:
+ YYDEBUG(1026, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy1061;
+ if(yych == 'C') goto yy1027;
if(yych != 'c') goto yy53;
- goto yy1061;
-yy1061:
- YYDEBUG(1061, *YYCURSOR);
- yyaccept = 17;
+ goto yy1027;
+yy1027:
+ YYDEBUG(1027, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'E') goto yy1062;
- if(yych != 'e') goto yy978;
- goto yy1062;
-yy1062:
- YYDEBUG(1062, *YYCURSOR);
+ if(yych == 'E') goto yy1028;
+ if(yych != 'e') goto yy943;
+ goto yy1028;
+yy1028:
+ YYDEBUG(1028, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy1063;
+ if(yych == 'M') goto yy1029;
if(yych != 'm') goto yy53;
- goto yy1063;
-yy1063:
- YYDEBUG(1063, *YYCURSOR);
+ goto yy1029;
+yy1029:
+ YYDEBUG(1029, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy1064;
+ if(yych == 'B') goto yy1030;
if(yych != 'b') goto yy53;
- goto yy1064;
-yy1064:
- YYDEBUG(1064, *YYCURSOR);
+ goto yy1030;
+yy1030:
+ YYDEBUG(1030, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1065;
+ if(yych == 'E') goto yy1031;
if(yych != 'e') goto yy53;
- goto yy1065;
-yy1065:
- YYDEBUG(1065, *YYCURSOR);
+ goto yy1031;
+yy1031:
+ YYDEBUG(1031, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1066;
+ if(yych == 'R') goto yy1032;
if(yych != 'r') goto yy53;
- goto yy1066;
-yy1066:
- YYDEBUG(1066, *YYCURSOR);
+ goto yy1032;
+yy1032:
+ YYDEBUG(1032, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy978;
-yy1067:
- YYDEBUG(1067, *YYCURSOR);
+ goto yy943;
+yy1033:
+ YYDEBUG(1033, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'V') goto yy1068;
+ if(yych == 'V') goto yy1034;
if(yych != 'v') goto yy53;
- goto yy1068;
-yy1068:
- YYDEBUG(1068, *YYCURSOR);
- yyaccept = 17;
+ goto yy1034;
+yy1034:
+ YYDEBUG(1034, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'E') goto yy1069;
- if(yych != 'e') goto yy978;
- goto yy1069;
-yy1069:
- YYDEBUG(1069, *YYCURSOR);
+ if(yych == 'E') goto yy1035;
+ if(yych != 'e') goto yy943;
+ goto yy1035;
+yy1035:
+ YYDEBUG(1035, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy1070;
+ if(yych == 'M') goto yy1036;
if(yych != 'm') goto yy53;
- goto yy1070;
-yy1070:
- YYDEBUG(1070, *YYCURSOR);
+ goto yy1036;
+yy1036:
+ YYDEBUG(1036, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy1071;
+ if(yych == 'B') goto yy1037;
if(yych != 'b') goto yy53;
- goto yy1071;
-yy1071:
- YYDEBUG(1071, *YYCURSOR);
+ goto yy1037;
+yy1037:
+ YYDEBUG(1037, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1072;
+ if(yych == 'E') goto yy1038;
if(yych != 'e') goto yy53;
- goto yy1072;
-yy1072:
- YYDEBUG(1072, *YYCURSOR);
+ goto yy1038;
+yy1038:
+ YYDEBUG(1038, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1066;
- if(yych == 'r') goto yy1066;
+ if(yych == 'R') goto yy1032;
+ if(yych == 'r') goto yy1032;
goto yy53;
-yy1073:
- YYDEBUG(1073, *YYCURSOR);
+yy1039:
+ YYDEBUG(1039, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy1074;
+ if(yych == 'T') goto yy1040;
if(yych != 't') goto yy53;
- goto yy1074;
-yy1074:
- YYDEBUG(1074, *YYCURSOR);
- yyaccept = 17;
+ goto yy1040;
+yy1040:
+ YYDEBUG(1040, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'O') goto yy1075;
- if(yych != 'o') goto yy978;
- goto yy1075;
-yy1075:
- YYDEBUG(1075, *YYCURSOR);
+ if(yych == 'O') goto yy1041;
+ if(yych != 'o') goto yy943;
+ goto yy1041;
+yy1041:
+ YYDEBUG(1041, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy1076;
+ if(yych == 'B') goto yy1042;
if(yych != 'b') goto yy53;
- goto yy1076;
-yy1076:
- YYDEBUG(1076, *YYCURSOR);
+ goto yy1042;
+yy1042:
+ YYDEBUG(1042, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1077;
+ if(yych == 'E') goto yy1043;
if(yych != 'e') goto yy53;
- goto yy1077;
-yy1077:
- YYDEBUG(1077, *YYCURSOR);
+ goto yy1043;
+yy1043:
+ YYDEBUG(1043, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1066;
- if(yych == 'r') goto yy1066;
+ if(yych == 'R') goto yy1032;
+ if(yych == 'r') goto yy1032;
goto yy53;
-yy1078:
- YYDEBUG(1078, *YYCURSOR);
+yy1044:
+ YYDEBUG(1044, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'P'){
- if(yych == 'C') goto yy121;
+ if(yych == 'C') goto yy125;
if(yych <= 'O') goto yy53;
- goto yy1079;
+ goto yy1045;
} else {
if(yych <= 'c'){
if(yych <= 'b') goto yy53;
- goto yy121;
+ goto yy125;
} else {
if(yych != 'p') goto yy53;
- goto yy1079;
+ goto yy1045;
}
}
-yy1079:
- YYDEBUG(1079, *YYCURSOR);
+yy1045:
+ YYDEBUG(1045, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy1080;
- if(yych != 't') goto yy978;
- goto yy1080;
-yy1080:
- YYDEBUG(1080, *YYCURSOR);
- yyaccept = 17;
+ if(yych == 'T') goto yy1046;
+ if(yych != 't') goto yy943;
+ goto yy1046;
+yy1046:
+ YYDEBUG(1046, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'E') goto yy1081;
- if(yych != 'e') goto yy978;
- goto yy1081;
-yy1081:
- YYDEBUG(1081, *YYCURSOR);
+ if(yych == 'E') goto yy1047;
+ if(yych != 'e') goto yy943;
+ goto yy1047;
+yy1047:
+ YYDEBUG(1047, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy1082;
+ if(yych == 'M') goto yy1048;
if(yych != 'm') goto yy53;
- goto yy1082;
-yy1082:
- YYDEBUG(1082, *YYCURSOR);
+ goto yy1048;
+yy1048:
+ YYDEBUG(1048, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy1083;
+ if(yych == 'B') goto yy1049;
if(yych != 'b') goto yy53;
- goto yy1083;
-yy1083:
- YYDEBUG(1083, *YYCURSOR);
+ goto yy1049;
+yy1049:
+ YYDEBUG(1049, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1084;
+ if(yych == 'E') goto yy1050;
if(yych != 'e') goto yy53;
- goto yy1084;
-yy1084:
- YYDEBUG(1084, *YYCURSOR);
+ goto yy1050;
+yy1050:
+ YYDEBUG(1050, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1066;
- if(yych == 'r') goto yy1066;
+ if(yych == 'R') goto yy1032;
+ if(yych == 'r') goto yy1032;
goto yy53;
-yy1085:
- YYDEBUG(1085, *YYCURSOR);
+yy1051:
+ YYDEBUG(1051, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy1089;
- if(yych == 'g') goto yy1089;
+ if(yych == 'G') goto yy1055;
+ if(yych == 'g') goto yy1055;
goto yy53;
-yy1086:
- YYDEBUG(1086, *YYCURSOR);
+yy1052:
+ YYDEBUG(1052, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1087;
+ if(yych == 'R') goto yy1053;
if(yych != 'r') goto yy53;
- goto yy1087;
-yy1087:
- YYDEBUG(1087, *YYCURSOR);
- yyaccept = 17;
+ goto yy1053;
+yy1053:
+ YYDEBUG(1053, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'I') goto yy1088;
- if(yych != 'i') goto yy978;
- goto yy1088;
-yy1088:
- YYDEBUG(1088, *YYCURSOR);
+ if(yych == 'I') goto yy1054;
+ if(yych != 'i') goto yy943;
+ goto yy1054;
+yy1054:
+ YYDEBUG(1054, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'L') goto yy1066;
- if(yych == 'l') goto yy1066;
+ if(yych == 'L') goto yy1032;
+ if(yych == 'l') goto yy1032;
goto yy53;
-yy1089:
- YYDEBUG(1089, *YYCURSOR);
- yyaccept = 17;
+yy1055:
+ YYDEBUG(1055, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'U') goto yy1090;
- if(yych != 'u') goto yy978;
- goto yy1090;
-yy1090:
- YYDEBUG(1090, *YYCURSOR);
+ if(yych == 'U') goto yy1056;
+ if(yych != 'u') goto yy943;
+ goto yy1056;
+yy1056:
+ YYDEBUG(1056, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'S') goto yy1091;
+ if(yych == 'S') goto yy1057;
if(yych != 's') goto yy53;
- goto yy1091;
-yy1091:
- YYDEBUG(1091, *YYCURSOR);
+ goto yy1057;
+yy1057:
+ YYDEBUG(1057, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy1066;
- if(yych == 't') goto yy1066;
+ if(yych == 'T') goto yy1032;
+ if(yych == 't') goto yy1032;
goto yy53;
-yy1092:
- YYDEBUG(1092, *YYCURSOR);
+yy1058:
+ YYDEBUG(1058, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
- if(yych == 'R') goto yy1093;
+ if(yych == 'R') goto yy1059;
if(yych <= 'X') goto yy53;
- goto yy1066;
+ goto yy1032;
} else {
if(yych <= 'r'){
if(yych <= 'q') goto yy53;
- goto yy1093;
+ goto yy1059;
} else {
- if(yych == 'y') goto yy1066;
+ if(yych == 'y') goto yy1032;
goto yy53;
}
}
-yy1093:
- YYDEBUG(1093, *YYCURSOR);
- yyaccept = 17;
+yy1059:
+ YYDEBUG(1059, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'C') goto yy1094;
- if(yych != 'c') goto yy978;
- goto yy1094;
-yy1094:
- YYDEBUG(1094, *YYCURSOR);
+ if(yych == 'C') goto yy1060;
+ if(yych != 'c') goto yy943;
+ goto yy1060;
+yy1060:
+ YYDEBUG(1060, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'H') goto yy1066;
- if(yych == 'h') goto yy1066;
+ if(yych == 'H') goto yy1032;
+ if(yych == 'h') goto yy1032;
goto yy53;
-yy1095:
- YYDEBUG(1095, *YYCURSOR);
+yy1061:
+ YYDEBUG(1061, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy1096;
+ if(yych == 'B') goto yy1062;
if(yych != 'b') goto yy53;
- goto yy1096;
-yy1096:
- YYDEBUG(1096, *YYCURSOR);
- yyaccept = 17;
+ goto yy1062;
+yy1062:
+ YYDEBUG(1062, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'R') goto yy1097;
- if(yych != 'r') goto yy978;
- goto yy1097;
-yy1097:
- YYDEBUG(1097, *YYCURSOR);
+ if(yych == 'R') goto yy1063;
+ if(yych != 'r') goto yy943;
+ goto yy1063;
+yy1063:
+ YYDEBUG(1063, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'U') goto yy1098;
+ if(yych == 'U') goto yy1064;
if(yych != 'u') goto yy53;
- goto yy1098;
-yy1098:
- YYDEBUG(1098, *YYCURSOR);
+ goto yy1064;
+yy1064:
+ YYDEBUG(1064, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy1099;
+ if(yych == 'A') goto yy1065;
if(yych != 'a') goto yy53;
- goto yy1099;
-yy1099:
- YYDEBUG(1099, *YYCURSOR);
+ goto yy1065;
+yy1065:
+ YYDEBUG(1065, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1100;
+ if(yych == 'R') goto yy1066;
if(yych != 'r') goto yy53;
- goto yy1100;
-yy1100:
- YYDEBUG(1100, *YYCURSOR);
+ goto yy1066;
+yy1066:
+ YYDEBUG(1066, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy1066;
- if(yych == 'y') goto yy1066;
+ if(yych == 'Y') goto yy1032;
+ if(yych == 'y') goto yy1032;
goto yy53;
-yy1101:
- YYDEBUG(1101, *YYCURSOR);
+yy1067:
+ YYDEBUG(1067, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
- if(yych == 'L') goto yy1108;
+ if(yych == 'L') goto yy1074;
if(yych <= 'M') goto yy53;
- goto yy1107;
+ goto yy1073;
} else {
if(yych <= 'l'){
if(yych <= 'k') goto yy53;
- goto yy1108;
+ goto yy1074;
} else {
- if(yych == 'n') goto yy1107;
+ if(yych == 'n') goto yy1073;
goto yy53;
}
}
-yy1102:
- YYDEBUG(1102, *YYCURSOR);
+yy1068:
+ YYDEBUG(1068, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy1103;
+ if(yych == 'N') goto yy1069;
if(yych != 'n') goto yy53;
- goto yy1103;
-yy1103:
- YYDEBUG(1103, *YYCURSOR);
- yyaccept = 17;
+ goto yy1069;
+yy1069:
+ YYDEBUG(1069, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'U') goto yy1104;
- if(yych != 'u') goto yy978;
- goto yy1104;
-yy1104:
- YYDEBUG(1104, *YYCURSOR);
+ if(yych == 'U') goto yy1070;
+ if(yych != 'u') goto yy943;
+ goto yy1070;
+yy1070:
+ YYDEBUG(1070, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy1105;
+ if(yych == 'A') goto yy1071;
if(yych != 'a') goto yy53;
- goto yy1105;
-yy1105:
- YYDEBUG(1105, *YYCURSOR);
+ goto yy1071;
+yy1071:
+ YYDEBUG(1071, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1106;
+ if(yych == 'R') goto yy1072;
if(yych != 'r') goto yy53;
- goto yy1106;
-yy1106:
- YYDEBUG(1106, *YYCURSOR);
+ goto yy1072;
+yy1072:
+ YYDEBUG(1072, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy1066;
- if(yych == 'y') goto yy1066;
+ if(yych == 'Y') goto yy1032;
+ if(yych == 'y') goto yy1032;
goto yy53;
-yy1107:
- YYDEBUG(1107, *YYCURSOR);
+yy1073:
+ YYDEBUG(1073, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1066;
- if(yych == 'e') goto yy1066;
- goto yy978;
-yy1108:
- YYDEBUG(1108, *YYCURSOR);
+ if(yych == 'E') goto yy1032;
+ if(yych == 'e') goto yy1032;
+ goto yy943;
+yy1074:
+ YYDEBUG(1074, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy1066;
- if(yych == 'y') goto yy1066;
- goto yy978;
-yy1109:
- YYDEBUG(1109, *YYCURSOR);
+ if(yych == 'Y') goto yy1032;
+ if(yych == 'y') goto yy1032;
+ goto yy943;
+yy1075:
+ YYDEBUG(1075, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy1066;
- goto yy978;
-yy1110:
- YYDEBUG(1110, *YYCURSOR);
+ if(yych == 'I') goto yy1032;
+ goto yy943;
+yy1076:
+ YYDEBUG(1076, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych != 'I') goto yy978;
- goto yy1111;
-yy1111:
- YYDEBUG(1111, *YYCURSOR);
+ if(yych != 'I') goto yy943;
+ goto yy1077;
+yy1077:
+ YYDEBUG(1077, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy1066;
- goto yy978;
-yy1112:
- YYDEBUG(1112, *YYCURSOR);
+ if(yych == 'I') goto yy1032;
+ goto yy943;
+yy1078:
+ YYDEBUG(1078, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy1066;
- goto yy978;
-yy1113:
- YYDEBUG(1113, *YYCURSOR);
+ if(yych == 'I') goto yy1032;
+ goto yy943;
+yy1079:
+ YYDEBUG(1079, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy1128;
- if(yych <= '9') goto yy1127;
+ if(yych <= '0') goto yy1094;
+ if(yych <= '9') goto yy1093;
goto yy53;
-yy1114:
- YYDEBUG(1114, *YYCURSOR);
+yy1080:
+ YYDEBUG(1080, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1126;
+ if(yych <= '9') goto yy1092;
goto yy53;
-yy1115:
- YYDEBUG(1115, *YYCURSOR);
+yy1081:
+ YYDEBUG(1081, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1124;
- if(yych <= '6') goto yy1123;
+ if(yych <= '5') goto yy1090;
+ if(yych <= '6') goto yy1089;
goto yy53;
-yy1116:
- YYDEBUG(1116, *YYCURSOR);
+yy1082:
+ YYDEBUG(1082, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1095;
- if(yych == 'e') goto yy1095;
+ if(yych == 'E') goto yy1061;
+ if(yych == 'e') goto yy1061;
goto yy53;
-yy1117:
- YYDEBUG(1117, *YYCURSOR);
+yy1083:
+ YYDEBUG(1083, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy1092;
- if(yych == 'a') goto yy1092;
+ if(yych == 'A') goto yy1058;
+ if(yych == 'a') goto yy1058;
goto yy53;
-yy1118:
- YYDEBUG(1118, *YYCURSOR);
+yy1084:
+ YYDEBUG(1084, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1122;
- if(yych == 'e') goto yy1122;
+ if(yych == 'E') goto yy1088;
+ if(yych == 'e') goto yy1088;
goto yy53;
-yy1119:
- YYDEBUG(1119, *YYCURSOR);
+yy1085:
+ YYDEBUG(1085, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1060;
- if(yych == 'e') goto yy1060;
+ if(yych == 'E') goto yy1026;
+ if(yych == 'e') goto yy1026;
goto yy53;
-yy1120:
- YYDEBUG(1120, *YYCURSOR);
+yy1086:
+ YYDEBUG(1086, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 9) YYFILL(9);
yych = *YYCURSOR;
- goto yy1121;
-yy1121:
- YYDEBUG(1121, *YYCURSOR);
+ goto yy1087;
+yy1087:
+ YYDEBUG(1087, *YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
case 0x09: case ' ': case '-':
- case '.': goto yy1120;
- case 'A': case 'a': goto yy984;
- case 'D': case 'd': goto yy1119;
- case 'F': case 'f': goto yy1116;
- case 'I': goto yy977;
- case 'J': case 'j': goto yy981;
- case 'M': case 'm': goto yy1117;
- case 'N': case 'n': goto yy987;
- case 'O': case 'o': goto yy986;
- case 'S': case 's': goto yy1118;
- case 'V': goto yy979;
- case 'X': goto yy980;
+ case '.': goto yy1086;
+ case 'A': case 'a': goto yy949;
+ case 'D': case 'd': goto yy1085;
+ case 'F': case 'f': goto yy1082;
+ case 'I': goto yy942;
+ case 'J': case 'j': goto yy946;
+ case 'M': case 'm': goto yy1083;
+ case 'N': case 'n': goto yy952;
+ case 'O': case 'o': goto yy951;
+ case 'S': case 's': goto yy1084;
+ case 'V': goto yy944;
+ case 'X': goto yy945;
default: goto yy53;
}
-yy1122:
- YYDEBUG(1122, *YYCURSOR);
+yy1088:
+ YYDEBUG(1088, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'P') goto yy1079;
- if(yych == 'p') goto yy1079;
+ if(yych == 'P') goto yy1045;
+ if(yych == 'p') goto yy1045;
goto yy53;
-yy1123:
- YYDEBUG(1123, *YYCURSOR);
+yy1089:
+ YYDEBUG(1089, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '6') goto yy1125;
+ if(yych <= '6') goto yy1091;
goto yy53;
-yy1124:
- YYDEBUG(1124, *YYCURSOR);
+yy1090:
+ YYDEBUG(1090, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1125;
-yy1125:
- YYDEBUG(1125, *YYCURSOR);
+ goto yy1091;
+yy1091:
+ YYDEBUG(1091, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy1005;
-yy1126:
- YYDEBUG(1126, *YYCURSOR);
+ goto yy971;
+yy1092:
+ YYDEBUG(1092, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1125;
+ if(yych <= '9') goto yy1091;
goto yy53;
-yy1127:
- YYDEBUG(1127, *YYCURSOR);
+yy1093:
+ YYDEBUG(1093, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1125;
+ if(yych <= '9') goto yy1091;
goto yy53;
-yy1128:
- YYDEBUG(1128, *YYCURSOR);
+yy1094:
+ YYDEBUG(1094, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '0') goto yy53;
- if(yych <= '9') goto yy1125;
+ if(yych <= '9') goto yy1091;
goto yy53;
-yy1129:
- YYDEBUG(1129, *YYCURSOR);
+yy1095:
+ YYDEBUG(1095, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '.') goto yy53;
- if(yych <= '/') goto yy1132;
- if(yych <= '0') goto yy1131;
- if(yych <= '9') goto yy1142;
+ if(yych <= '/') goto yy1098;
+ if(yych <= '0') goto yy1097;
+ if(yych <= '9') goto yy1108;
goto yy53;
-yy1130:
- YYDEBUG(1130, *YYCURSOR);
+yy1096:
+ YYDEBUG(1096, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '.') goto yy53;
- if(yych <= '/') goto yy1132;
- if(yych <= '2') goto yy1142;
+ if(yych <= '/') goto yy1098;
+ if(yych <= '2') goto yy1108;
goto yy53;
-yy1131:
- YYDEBUG(1131, *YYCURSOR);
+yy1097:
+ YYDEBUG(1097, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '/') goto yy53;
- goto yy1132;
-yy1132:
- YYDEBUG(1132, *YYCURSOR);
+ goto yy1098;
+yy1098:
+ YYDEBUG(1098, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '2') goto yy1133;
- if(yych <= '3') goto yy1135;
- if(yych <= '9') goto yy1136;
+ if(yych <= '2') goto yy1099;
+ if(yych <= '3') goto yy1101;
+ if(yych <= '9') goto yy1102;
goto yy53;
-yy1133:
- YYDEBUG(1133, *YYCURSOR);
- yyaccept = 18;
+yy1099:
+ YYDEBUG(1099, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy1134;
- if(yych <= '9') goto yy1136;
- if(yych >= 'n') goto yy1138;
- goto yy1134;
+ if(yych <= '/') goto yy1100;
+ if(yych <= '9') goto yy1102;
+ if(yych >= 'n') goto yy1104;
+ goto yy1100;
} else {
if(yych <= 'r'){
- if(yych >= 'r') goto yy1139;
- goto yy1134;
+ if(yych >= 'r') goto yy1105;
+ goto yy1100;
} else {
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
}
-yy1134:
- YYDEBUG(1134, *YYCURSOR);
+yy1100:
+ YYDEBUG(1100, *YYCURSOR);
{
DEBUG_OUTPUT("iso8601date | iso8601dateslash | dateslash");
@@ -17544,1044 +17049,1069 @@ yy1134:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
-yy1135:
- YYDEBUG(1135, *YYCURSOR);
- yyaccept = 18;
+yy1101:
+ YYDEBUG(1101, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy1134;
- if(yych <= '1') goto yy1136;
- if(yych <= 'm') goto yy1134;
- goto yy1138;
+ if(yych <= '/') goto yy1100;
+ if(yych <= '1') goto yy1102;
+ if(yych <= 'm') goto yy1100;
+ goto yy1104;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy1134;
- goto yy1139;
+ if(yych <= 'q') goto yy1100;
+ goto yy1105;
} else {
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
}
-yy1136:
- YYDEBUG(1136, *YYCURSOR);
- yyaccept = 18;
+yy1102:
+ YYDEBUG(1102, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'q'){
- if(yych == 'n') goto yy1138;
- goto yy1134;
+ if(yych == 'n') goto yy1104;
+ goto yy1100;
} else {
- if(yych <= 'r') goto yy1139;
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 'r') goto yy1105;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
-yy1137:
- YYDEBUG(1137, *YYCURSOR);
+yy1103:
+ YYDEBUG(1103, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 't') goto yy1141;
+ if(yych == 't') goto yy1107;
goto yy53;
-yy1138:
- YYDEBUG(1138, *YYCURSOR);
+yy1104:
+ YYDEBUG(1104, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy1141;
+ if(yych == 'd') goto yy1107;
goto yy53;
-yy1139:
- YYDEBUG(1139, *YYCURSOR);
+yy1105:
+ YYDEBUG(1105, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy1141;
+ if(yych == 'd') goto yy1107;
goto yy53;
-yy1140:
- YYDEBUG(1140, *YYCURSOR);
+yy1106:
+ YYDEBUG(1106, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != 'h') goto yy53;
- goto yy1141;
-yy1141:
- YYDEBUG(1141, *YYCURSOR);
+ goto yy1107;
+yy1107:
+ YYDEBUG(1107, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy1134;
-yy1142:
- YYDEBUG(1142, *YYCURSOR);
+ goto yy1100;
+yy1108:
+ YYDEBUG(1108, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '/') goto yy53;
- goto yy1143;
-yy1143:
- YYDEBUG(1143, *YYCURSOR);
+ goto yy1109;
+yy1109:
+ YYDEBUG(1109, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '2'){
if(yych <= '/') goto yy53;
- if(yych >= '1') goto yy1145;
- goto yy1144;
+ if(yych >= '1') goto yy1111;
+ goto yy1110;
} else {
- if(yych <= '3') goto yy1146;
- if(yych <= '9') goto yy1136;
+ if(yych <= '3') goto yy1112;
+ if(yych <= '9') goto yy1102;
goto yy53;
}
-yy1144:
- YYDEBUG(1144, *YYCURSOR);
- yyaccept = 18;
+yy1110:
+ YYDEBUG(1110, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
if(yych <= '0'){
- if(yych <= '/') goto yy1134;
- goto yy1136;
+ if(yych <= '/') goto yy1100;
+ goto yy1102;
} else {
- if(yych <= '9') goto yy1147;
- if(yych <= 'm') goto yy1134;
- goto yy1138;
+ if(yych <= '9') goto yy1113;
+ if(yych <= 'm') goto yy1100;
+ goto yy1104;
}
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy1134;
- goto yy1139;
+ if(yych <= 'q') goto yy1100;
+ goto yy1105;
} else {
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
}
-yy1145:
- YYDEBUG(1145, *YYCURSOR);
- yyaccept = 18;
+yy1111:
+ YYDEBUG(1111, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy1134;
- if(yych <= '9') goto yy1147;
- if(yych <= 'm') goto yy1134;
- goto yy1138;
+ if(yych <= '/') goto yy1100;
+ if(yych <= '9') goto yy1113;
+ if(yych <= 'm') goto yy1100;
+ goto yy1104;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy1134;
- goto yy1139;
+ if(yych <= 'q') goto yy1100;
+ goto yy1105;
} else {
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
}
-yy1146:
- YYDEBUG(1146, *YYCURSOR);
- yyaccept = 18;
+yy1112:
+ YYDEBUG(1112, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy1134;
- if(yych <= '1') goto yy1147;
- if(yych <= 'm') goto yy1134;
- goto yy1138;
+ if(yych <= '/') goto yy1100;
+ if(yych <= '1') goto yy1113;
+ if(yych <= 'm') goto yy1100;
+ goto yy1104;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy1134;
- goto yy1139;
+ if(yych <= 'q') goto yy1100;
+ goto yy1105;
} else {
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
}
-yy1147:
- YYDEBUG(1147, *YYCURSOR);
- yyaccept = 18;
+yy1113:
+ YYDEBUG(1113, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych == '/') goto yy1141;
- if(yych <= 'm') goto yy1134;
- goto yy1138;
+ if(yych == '/') goto yy1107;
+ if(yych <= 'm') goto yy1100;
+ goto yy1104;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy1134;
- goto yy1139;
+ if(yych <= 'q') goto yy1100;
+ goto yy1105;
} else {
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
}
-yy1148:
- YYDEBUG(1148, *YYCURSOR);
+yy1114:
+ YYDEBUG(1114, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'A') goto yy1223;
+ if(yych == 'A') goto yy1191;
if(yych <= 'T') goto yy53;
- goto yy1222;
+ goto yy1190;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy1223;
+ goto yy1191;
} else {
- if(yych == 'u') goto yy1222;
+ if(yych == 'u') goto yy1190;
goto yy53;
}
}
-yy1149:
- YYDEBUG(1149, *YYCURSOR);
+yy1115:
+ YYDEBUG(1115, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1220;
- if(yych == 'e') goto yy1220;
+ if(yych == 'E') goto yy1188;
+ if(yych == 'e') goto yy1188;
goto yy53;
-yy1150:
- YYDEBUG(1150, *YYCURSOR);
+yy1116:
+ YYDEBUG(1116, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy1217;
- if(yych == 'a') goto yy1217;
+ if(yych == 'A') goto yy1185;
+ if(yych == 'a') goto yy1185;
goto yy53;
-yy1151:
- YYDEBUG(1151, *YYCURSOR);
+yy1117:
+ YYDEBUG(1117, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'P') goto yy1214;
+ if(yych == 'P') goto yy1182;
if(yych <= 'T') goto yy53;
- goto yy1213;
+ goto yy1181;
} else {
if(yych <= 'p'){
if(yych <= 'o') goto yy53;
- goto yy1214;
+ goto yy1182;
} else {
- if(yych == 'u') goto yy1213;
+ if(yych == 'u') goto yy1181;
goto yy53;
}
}
-yy1152:
- YYDEBUG(1152, *YYCURSOR);
+yy1118:
+ YYDEBUG(1118, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1210;
- if(yych == 'e') goto yy1210;
+ if(yych == 'E') goto yy1178;
+ if(yych == 'e') goto yy1178;
goto yy53;
-yy1153:
- YYDEBUG(1153, *YYCURSOR);
+yy1119:
+ YYDEBUG(1119, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy1208;
- if(yych == 'c') goto yy1208;
+ if(yych == 'C') goto yy1176;
+ if(yych == 'c') goto yy1176;
goto yy53;
-yy1154:
- YYDEBUG(1154, *YYCURSOR);
+yy1120:
+ YYDEBUG(1120, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy1206;
- if(yych == 'o') goto yy1206;
+ if(yych == 'O') goto yy1174;
+ if(yych == 'o') goto yy1174;
goto yy53;
-yy1155:
- YYDEBUG(1155, *YYCURSOR);
+yy1121:
+ YYDEBUG(1121, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1204;
- if(yych == 'e') goto yy1204;
+ if(yych == 'E') goto yy1172;
+ if(yych == 'e') goto yy1172;
goto yy53;
-yy1156:
- YYDEBUG(1156, *YYCURSOR);
+yy1122:
+ YYDEBUG(1122, *YYCURSOR);
yych = *++YYCURSOR;
+ if(yych <= '/') goto yy53;
+ if(yych <= '0') goto yy960;
+ if(yych <= '4') goto yy961;
+ if(yych <= '5') goto yy962;
+ goto yy53;
+yy1123:
+ YYDEBUG(1123, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '-') goto yy1159;
- goto yy53;
+ if(yych == '-') goto yy1127;
+ goto yy1124;
} else {
- if(yych <= '0') goto yy1158;
- if(yych <= '9') goto yy1178;
- goto yy53;
+ if(yych <= '0') goto yy1126;
+ if(yych <= '9') goto yy1146;
+ goto yy1124;
}
-yy1157:
- YYDEBUG(1157, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == '-') goto yy1159;
- if(yych <= '/') goto yy53;
- if(yych <= '2') goto yy1178;
- goto yy53;
-yy1158:
- YYDEBUG(1158, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych != '-') goto yy53;
- goto yy1159;
-yy1159:
- YYDEBUG(1159, *YYCURSOR);
+yy1124:
+ YYDEBUG(1124, *YYCURSOR);
+
+{
+ DEBUG_OUTPUT("gnudateshorter");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_DATE;
+ }
+yy1125:
+ YYDEBUG(1125, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '-') goto yy1127;
+ if(yych <= '/') goto yy1124;
+ if(yych <= '2') goto yy1146;
+ goto yy1124;
+yy1126:
+ YYDEBUG(1126, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych != '-') goto yy1124;
+ goto yy1127;
+yy1127:
+ YYDEBUG(1127, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '2') goto yy1160;
- if(yych <= '3') goto yy1161;
- if(yych <= '9') goto yy1162;
+ if(yych <= '2') goto yy1128;
+ if(yych <= '3') goto yy1129;
+ if(yych <= '9') goto yy1130;
goto yy53;
-yy1160:
- YYDEBUG(1160, *YYCURSOR);
- yyaccept = 12;
+yy1128:
+ YYDEBUG(1128, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '9'){
- if(yych <= '/') goto yy860;
- goto yy1162;
+ if(yych <= '/') goto yy825;
+ goto yy1130;
} else {
- if(yych == 'T') goto yy1167;
- goto yy860;
+ if(yych == 'T') goto yy1135;
+ goto yy825;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy1164;
- if(yych <= 'q') goto yy860;
- goto yy1165;
+ if(yych <= 'n') goto yy1132;
+ if(yych <= 'q') goto yy825;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy860;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy825;
}
}
-yy1161:
- YYDEBUG(1161, *YYCURSOR);
- yyaccept = 12;
+yy1129:
+ YYDEBUG(1129, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy860;
- goto yy1162;
+ if(yych <= '/') goto yy825;
+ goto yy1130;
} else {
- if(yych == 'T') goto yy1167;
- goto yy860;
+ if(yych == 'T') goto yy1135;
+ goto yy825;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy1164;
- if(yych <= 'q') goto yy860;
- goto yy1165;
+ if(yych <= 'n') goto yy1132;
+ if(yych <= 'q') goto yy825;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy860;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy825;
}
}
-yy1162:
- YYDEBUG(1162, *YYCURSOR);
- yyaccept = 12;
+yy1130:
+ YYDEBUG(1130, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych == 'T') goto yy1167;
- if(yych <= 'm') goto yy860;
- goto yy1164;
+ if(yych == 'T') goto yy1135;
+ if(yych <= 'm') goto yy825;
+ goto yy1132;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy860;
- goto yy1165;
+ if(yych <= 'q') goto yy825;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy860;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy825;
}
}
-yy1163:
- YYDEBUG(1163, *YYCURSOR);
+yy1131:
+ YYDEBUG(1131, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 't') goto yy1177;
+ if(yych == 't') goto yy1145;
goto yy53;
-yy1164:
- YYDEBUG(1164, *YYCURSOR);
+yy1132:
+ YYDEBUG(1132, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy1177;
+ if(yych == 'd') goto yy1145;
goto yy53;
-yy1165:
- YYDEBUG(1165, *YYCURSOR);
+yy1133:
+ YYDEBUG(1133, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy1177;
+ if(yych == 'd') goto yy1145;
goto yy53;
-yy1166:
- YYDEBUG(1166, *YYCURSOR);
+yy1134:
+ YYDEBUG(1134, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'h') goto yy1177;
+ if(yych == 'h') goto yy1145;
goto yy53;
-yy1167:
- YYDEBUG(1167, *YYCURSOR);
+yy1135:
+ YYDEBUG(1135, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy1168;
- if(yych <= '2') goto yy1169;
- if(yych <= '9') goto yy1170;
+ if(yych <= '1') goto yy1136;
+ if(yych <= '2') goto yy1137;
+ if(yych <= '9') goto yy1138;
goto yy53;
-yy1168:
- YYDEBUG(1168, *YYCURSOR);
+yy1136:
+ YYDEBUG(1136, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1170;
- if(yych <= ':') goto yy1171;
+ if(yych <= '9') goto yy1138;
+ if(yych <= ':') goto yy1139;
goto yy53;
-yy1169:
- YYDEBUG(1169, *YYCURSOR);
+yy1137:
+ YYDEBUG(1137, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '3') goto yy1170;
- if(yych == ':') goto yy1171;
+ if(yych <= '3') goto yy1138;
+ if(yych == ':') goto yy1139;
goto yy53;
-yy1170:
- YYDEBUG(1170, *YYCURSOR);
+yy1138:
+ YYDEBUG(1138, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1171;
-yy1171:
- YYDEBUG(1171, *YYCURSOR);
+ goto yy1139;
+yy1139:
+ YYDEBUG(1139, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1172;
- if(yych <= '9') goto yy1173;
+ if(yych <= '5') goto yy1140;
+ if(yych <= '9') goto yy1141;
goto yy53;
-yy1172:
- YYDEBUG(1172, *YYCURSOR);
+yy1140:
+ YYDEBUG(1140, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1173;
- if(yych <= ':') goto yy1174;
+ if(yych <= '9') goto yy1141;
+ if(yych <= ':') goto yy1142;
goto yy53;
-yy1173:
- YYDEBUG(1173, *YYCURSOR);
+yy1141:
+ YYDEBUG(1141, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1174;
-yy1174:
- YYDEBUG(1174, *YYCURSOR);
+ goto yy1142;
+yy1142:
+ YYDEBUG(1142, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1175;
- if(yych <= '6') goto yy1176;
- if(yych <= '9') goto yy1025;
+ if(yych <= '5') goto yy1143;
+ if(yych <= '6') goto yy1144;
+ if(yych <= '9') goto yy991;
goto yy53;
-yy1175:
- YYDEBUG(1175, *YYCURSOR);
+yy1143:
+ YYDEBUG(1143, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '9') goto yy1025;
- goto yy1026;
-yy1176:
- YYDEBUG(1176, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '9') goto yy991;
+ goto yy992;
+yy1144:
+ YYDEBUG(1144, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '0') goto yy1025;
- goto yy1026;
-yy1177:
- YYDEBUG(1177, *YYCURSOR);
- yyaccept = 12;
+ if(yych == '0') goto yy991;
+ goto yy992;
+yy1145:
+ YYDEBUG(1145, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'T') goto yy1167;
- goto yy860;
-yy1178:
- YYDEBUG(1178, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych != '-') goto yy53;
- goto yy1179;
-yy1179:
- YYDEBUG(1179, *YYCURSOR);
+ if(yych == 'T') goto yy1135;
+ goto yy825;
+yy1146:
+ YYDEBUG(1146, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych != '-') goto yy1124;
+ goto yy1147;
+yy1147:
+ YYDEBUG(1147, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '2'){
if(yych <= '/') goto yy53;
- if(yych >= '1') goto yy1181;
- goto yy1180;
+ if(yych >= '1') goto yy1149;
+ goto yy1148;
} else {
- if(yych <= '3') goto yy1182;
- if(yych <= '9') goto yy1162;
+ if(yych <= '3') goto yy1150;
+ if(yych <= '9') goto yy1130;
goto yy53;
}
-yy1180:
- YYDEBUG(1180, *YYCURSOR);
- yyaccept = 12;
+yy1148:
+ YYDEBUG(1148, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '9'){
- if(yych <= '/') goto yy860;
- if(yych <= '0') goto yy1162;
- goto yy1183;
+ if(yych <= '/') goto yy825;
+ if(yych <= '0') goto yy1130;
+ goto yy1151;
} else {
- if(yych == 'T') goto yy1167;
- goto yy860;
+ if(yych == 'T') goto yy1135;
+ goto yy825;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy1164;
- if(yych <= 'q') goto yy860;
- goto yy1165;
+ if(yych <= 'n') goto yy1132;
+ if(yych <= 'q') goto yy825;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy860;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy825;
}
}
-yy1181:
- YYDEBUG(1181, *YYCURSOR);
- yyaccept = 12;
+yy1149:
+ YYDEBUG(1149, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '9'){
- if(yych <= '/') goto yy860;
- goto yy1183;
+ if(yych <= '/') goto yy825;
+ goto yy1151;
} else {
- if(yych == 'T') goto yy1167;
- goto yy860;
+ if(yych == 'T') goto yy1135;
+ goto yy825;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy1164;
- if(yych <= 'q') goto yy860;
- goto yy1165;
+ if(yych <= 'n') goto yy1132;
+ if(yych <= 'q') goto yy825;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy860;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy825;
}
}
-yy1182:
- YYDEBUG(1182, *YYCURSOR);
- yyaccept = 12;
+yy1150:
+ YYDEBUG(1150, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy860;
- goto yy1183;
+ if(yych <= '/') goto yy825;
+ goto yy1151;
} else {
- if(yych == 'T') goto yy1167;
- goto yy860;
+ if(yych == 'T') goto yy1135;
+ goto yy825;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy1164;
- if(yych <= 'q') goto yy860;
- goto yy1165;
+ if(yych <= 'n') goto yy1132;
+ if(yych <= 'q') goto yy825;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy860;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy825;
}
}
-yy1183:
- YYDEBUG(1183, *YYCURSOR);
- yyaccept = 18;
+yy1151:
+ YYDEBUG(1151, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych == 'T') goto yy1184;
- if(yych <= 'm') goto yy1134;
- goto yy1164;
+ if(yych == 'T') goto yy1152;
+ if(yych <= 'm') goto yy1100;
+ goto yy1132;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy1134;
- goto yy1165;
+ if(yych <= 'q') goto yy1100;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy1134;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy1100;
}
}
-yy1184:
- YYDEBUG(1184, *YYCURSOR);
+yy1152:
+ YYDEBUG(1152, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy1185;
- if(yych <= '2') goto yy1186;
- if(yych <= '9') goto yy1170;
+ if(yych <= '1') goto yy1153;
+ if(yych <= '2') goto yy1154;
+ if(yych <= '9') goto yy1138;
goto yy53;
-yy1185:
- YYDEBUG(1185, *YYCURSOR);
+yy1153:
+ YYDEBUG(1153, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1187;
- if(yych <= ':') goto yy1171;
+ if(yych <= '9') goto yy1155;
+ if(yych <= ':') goto yy1139;
goto yy53;
-yy1186:
- YYDEBUG(1186, *YYCURSOR);
+yy1154:
+ YYDEBUG(1154, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '3') goto yy1187;
- if(yych == ':') goto yy1171;
+ if(yych <= '3') goto yy1155;
+ if(yych == ':') goto yy1139;
goto yy53;
-yy1187:
- YYDEBUG(1187, *YYCURSOR);
+yy1155:
+ YYDEBUG(1155, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1188;
-yy1188:
- YYDEBUG(1188, *YYCURSOR);
+ goto yy1156;
+yy1156:
+ YYDEBUG(1156, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1189;
- if(yych <= '9') goto yy1173;
+ if(yych <= '5') goto yy1157;
+ if(yych <= '9') goto yy1141;
goto yy53;
-yy1189:
- YYDEBUG(1189, *YYCURSOR);
+yy1157:
+ YYDEBUG(1157, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1190;
- if(yych <= ':') goto yy1174;
+ if(yych <= '9') goto yy1158;
+ if(yych <= ':') goto yy1142;
goto yy53;
-yy1190:
- YYDEBUG(1190, *YYCURSOR);
+yy1158:
+ YYDEBUG(1158, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1191;
-yy1191:
- YYDEBUG(1191, *YYCURSOR);
+ goto yy1159;
+yy1159:
+ YYDEBUG(1159, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1192;
- if(yych <= '6') goto yy1193;
- if(yych <= '9') goto yy1025;
+ if(yych <= '5') goto yy1160;
+ if(yych <= '6') goto yy1161;
+ if(yych <= '9') goto yy991;
goto yy53;
-yy1192:
- YYDEBUG(1192, *YYCURSOR);
+yy1160:
+ YYDEBUG(1160, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '9') goto yy1194;
- goto yy1026;
-yy1193:
- YYDEBUG(1193, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '9') goto yy1162;
+ goto yy992;
+yy1161:
+ YYDEBUG(1161, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych != '0') goto yy1026;
- goto yy1194;
-yy1194:
- YYDEBUG(1194, *YYCURSOR);
- yyaccept = 19;
+ if(yych != '0') goto yy992;
+ goto yy1162;
+yy1162:
+ YYDEBUG(1162, *YYCURSOR);
+ yyaccept = 22;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych != '.') goto yy1026;
- goto yy1195;
-yy1195:
- YYDEBUG(1195, *YYCURSOR);
+ if(yych != '.') goto yy992;
+ goto yy1163;
+yy1163:
+ YYDEBUG(1163, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1196;
-yy1196:
- YYDEBUG(1196, *YYCURSOR);
- yyaccept = 19;
+ goto yy1164;
+yy1164:
+ YYDEBUG(1164, *YYCURSOR);
+ yyaccept = 22;
YYMARKER = ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
yych = *YYCURSOR;
- goto yy1197;
-yy1197:
- YYDEBUG(1197, *YYCURSOR);
+ goto yy1165;
+yy1165:
+ YYDEBUG(1165, *YYCURSOR);
if(yych <= ','){
- if(yych != '+') goto yy1026;
- goto yy1198;
+ if(yych != '+') goto yy992;
+ goto yy1166;
} else {
- if(yych <= '-') goto yy1198;
- if(yych <= '/') goto yy1026;
- if(yych <= '9') goto yy1196;
- goto yy1026;
+ if(yych <= '-') goto yy1166;
+ if(yych <= '/') goto yy992;
+ if(yych <= '9') goto yy1164;
+ goto yy992;
}
-yy1198:
- YYDEBUG(1198, *YYCURSOR);
+yy1166:
+ YYDEBUG(1166, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy1199;
- if(yych <= '2') goto yy1200;
- if(yych <= '9') goto yy1201;
+ if(yych <= '1') goto yy1167;
+ if(yych <= '2') goto yy1168;
+ if(yych <= '9') goto yy1169;
goto yy53;
-yy1199:
- YYDEBUG(1199, *YYCURSOR);
+yy1167:
+ YYDEBUG(1167, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '9') goto yy1201;
- if(yych <= ':') goto yy1202;
- goto yy1026;
-yy1200:
- YYDEBUG(1200, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '9') goto yy1169;
+ if(yych <= ':') goto yy1170;
+ goto yy992;
+yy1168:
+ YYDEBUG(1168, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '5'){
- if(yych <= '/') goto yy1026;
- if(yych >= '4') goto yy1203;
- goto yy1201;
+ if(yych <= '/') goto yy992;
+ if(yych >= '4') goto yy1171;
+ goto yy1169;
} else {
- if(yych <= '9') goto yy1025;
- if(yych <= ':') goto yy1202;
- goto yy1026;
+ if(yych <= '9') goto yy991;
+ if(yych <= ':') goto yy1170;
+ goto yy992;
}
-yy1201:
- YYDEBUG(1201, *YYCURSOR);
+yy1169:
+ YYDEBUG(1169, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '5') goto yy1203;
- if(yych <= '9') goto yy1025;
- if(yych >= ';') goto yy1026;
- goto yy1202;
-yy1202:
- YYDEBUG(1202, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '5') goto yy1171;
+ if(yych <= '9') goto yy991;
+ if(yych >= ';') goto yy992;
+ goto yy1170;
+yy1170:
+ YYDEBUG(1170, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '5') goto yy1203;
- if(yych <= '9') goto yy1025;
- goto yy1026;
-yy1203:
- YYDEBUG(1203, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '5') goto yy1171;
+ if(yych <= '9') goto yy991;
+ goto yy992;
+yy1171:
+ YYDEBUG(1171, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '9') goto yy1025;
- goto yy1026;
-yy1204:
- YYDEBUG(1204, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '9') goto yy991;
+ goto yy992;
+yy1172:
+ YYDEBUG(1172, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy1205;
+ if(yych == 'C') goto yy1173;
if(yych != 'c') goto yy53;
- goto yy1205;
-yy1205:
- YYDEBUG(1205, *YYCURSOR);
- yyaccept = 17;
+ goto yy1173;
+yy1173:
+ YYDEBUG(1173, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'E') goto yy1062;
- if(yych == 'e') goto yy1062;
- goto yy978;
+ if(yych <= 'E') goto yy1028;
+ if(yych == 'e') goto yy1028;
+ goto yy943;
}
-yy1206:
- YYDEBUG(1206, *YYCURSOR);
+yy1174:
+ YYDEBUG(1174, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'V') goto yy1207;
+ if(yych == 'V') goto yy1175;
if(yych != 'v') goto yy53;
- goto yy1207;
-yy1207:
- YYDEBUG(1207, *YYCURSOR);
- yyaccept = 17;
+ goto yy1175;
+yy1175:
+ YYDEBUG(1175, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'E') goto yy1069;
- if(yych == 'e') goto yy1069;
- goto yy978;
+ if(yych <= 'E') goto yy1035;
+ if(yych == 'e') goto yy1035;
+ goto yy943;
}
-yy1208:
- YYDEBUG(1208, *YYCURSOR);
+yy1176:
+ YYDEBUG(1176, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy1209;
+ if(yych == 'T') goto yy1177;
if(yych != 't') goto yy53;
- goto yy1209;
-yy1209:
- YYDEBUG(1209, *YYCURSOR);
- yyaccept = 17;
+ goto yy1177;
+yy1177:
+ YYDEBUG(1177, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'O') goto yy1075;
- if(yych == 'o') goto yy1075;
- goto yy978;
+ if(yych <= 'O') goto yy1041;
+ if(yych == 'o') goto yy1041;
+ goto yy943;
}
-yy1210:
- YYDEBUG(1210, *YYCURSOR);
+yy1178:
+ YYDEBUG(1178, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'P') goto yy1211;
+ if(yych == 'P') goto yy1179;
if(yych != 'p') goto yy53;
- goto yy1211;
-yy1211:
- YYDEBUG(1211, *YYCURSOR);
- yyaccept = 17;
+ goto yy1179;
+yy1179:
+ YYDEBUG(1179, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'T') goto yy1212;
- if(yych != 't') goto yy978;
- goto yy1212;
+ if(yych <= 'T') goto yy1180;
+ if(yych != 't') goto yy943;
+ goto yy1180;
}
-yy1212:
- YYDEBUG(1212, *YYCURSOR);
- yyaccept = 17;
+yy1180:
+ YYDEBUG(1180, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'E') goto yy1081;
- if(yych == 'e') goto yy1081;
- goto yy978;
+ if(yych <= 'E') goto yy1047;
+ if(yych == 'e') goto yy1047;
+ goto yy943;
}
-yy1213:
- YYDEBUG(1213, *YYCURSOR);
+yy1181:
+ YYDEBUG(1181, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy1216;
- if(yych == 'g') goto yy1216;
+ if(yych == 'G') goto yy1184;
+ if(yych == 'g') goto yy1184;
goto yy53;
-yy1214:
- YYDEBUG(1214, *YYCURSOR);
+yy1182:
+ YYDEBUG(1182, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1215;
+ if(yych == 'R') goto yy1183;
if(yych != 'r') goto yy53;
- goto yy1215;
-yy1215:
- YYDEBUG(1215, *YYCURSOR);
- yyaccept = 17;
+ goto yy1183;
+yy1183:
+ YYDEBUG(1183, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'I') goto yy1088;
- if(yych == 'i') goto yy1088;
- goto yy978;
+ if(yych <= 'I') goto yy1054;
+ if(yych == 'i') goto yy1054;
+ goto yy943;
}
-yy1216:
- YYDEBUG(1216, *YYCURSOR);
- yyaccept = 17;
+yy1184:
+ YYDEBUG(1184, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'U') goto yy1090;
- if(yych == 'u') goto yy1090;
- goto yy978;
+ if(yych <= 'U') goto yy1056;
+ if(yych == 'u') goto yy1056;
+ goto yy943;
}
-yy1217:
- YYDEBUG(1217, *YYCURSOR);
+yy1185:
+ YYDEBUG(1185, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
- if(yych == 'R') goto yy1218;
+ if(yych == 'R') goto yy1186;
if(yych <= 'X') goto yy53;
- goto yy1219;
+ goto yy1187;
} else {
if(yych <= 'r'){
if(yych <= 'q') goto yy53;
- goto yy1218;
+ goto yy1186;
} else {
- if(yych == 'y') goto yy1219;
+ if(yych == 'y') goto yy1187;
goto yy53;
}
}
-yy1218:
- YYDEBUG(1218, *YYCURSOR);
- yyaccept = 17;
+yy1186:
+ YYDEBUG(1186, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'B'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'C') goto yy1094;
- if(yych == 'c') goto yy1094;
- goto yy978;
+ if(yych <= 'C') goto yy1060;
+ if(yych == 'c') goto yy1060;
+ goto yy943;
}
-yy1219:
- YYDEBUG(1219, *YYCURSOR);
- yyaccept = 17;
+yy1187:
+ YYDEBUG(1187, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '-') goto yy954;
- goto yy978;
-yy1220:
- YYDEBUG(1220, *YYCURSOR);
+ if(yych == '-') goto yy919;
+ goto yy943;
+yy1188:
+ YYDEBUG(1188, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy1221;
+ if(yych == 'B') goto yy1189;
if(yych != 'b') goto yy53;
- goto yy1221;
-yy1221:
- YYDEBUG(1221, *YYCURSOR);
- yyaccept = 17;
+ goto yy1189;
+yy1189:
+ YYDEBUG(1189, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Q'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'R') goto yy1097;
- if(yych == 'r') goto yy1097;
- goto yy978;
+ if(yych <= 'R') goto yy1063;
+ if(yych == 'r') goto yy1063;
+ goto yy943;
}
-yy1222:
- YYDEBUG(1222, *YYCURSOR);
+yy1190:
+ YYDEBUG(1190, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
- if(yych == 'L') goto yy1226;
+ if(yych == 'L') goto yy1194;
if(yych <= 'M') goto yy53;
- goto yy1225;
+ goto yy1193;
} else {
if(yych <= 'l'){
if(yych <= 'k') goto yy53;
- goto yy1226;
+ goto yy1194;
} else {
- if(yych == 'n') goto yy1225;
+ if(yych == 'n') goto yy1193;
goto yy53;
}
}
-yy1223:
- YYDEBUG(1223, *YYCURSOR);
+yy1191:
+ YYDEBUG(1191, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy1224;
+ if(yych == 'N') goto yy1192;
if(yych != 'n') goto yy53;
- goto yy1224;
-yy1224:
- YYDEBUG(1224, *YYCURSOR);
- yyaccept = 17;
+ goto yy1192;
+yy1192:
+ YYDEBUG(1192, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'U') goto yy1104;
- if(yych == 'u') goto yy1104;
- goto yy978;
+ if(yych <= 'U') goto yy1070;
+ if(yych == 'u') goto yy1070;
+ goto yy943;
}
-yy1225:
- YYDEBUG(1225, *YYCURSOR);
- yyaccept = 17;
+yy1193:
+ YYDEBUG(1193, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'E') goto yy1066;
- if(yych == 'e') goto yy1066;
- goto yy978;
+ if(yych <= 'E') goto yy1032;
+ if(yych == 'e') goto yy1032;
+ goto yy943;
}
-yy1226:
- YYDEBUG(1226, *YYCURSOR);
- yyaccept = 17;
+yy1194:
+ YYDEBUG(1194, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'X'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'Y') goto yy1066;
- if(yych == 'y') goto yy1066;
- goto yy978;
+ if(yych <= 'Y') goto yy1032;
+ if(yych == 'y') goto yy1032;
+ goto yy943;
}
-yy1227:
- YYDEBUG(1227, *YYCURSOR);
+yy1195:
+ YYDEBUG(1195, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/'){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy784;
- goto yy931;
+ if(yych <= 0x08) goto yy749;
+ goto yy896;
} else {
- if(yych <= ',') goto yy784;
- if(yych <= '.') goto yy931;
- goto yy930;
+ if(yych <= ',') goto yy749;
+ if(yych <= '.') goto yy896;
+ goto yy895;
}
} else {
if(yych <= 'U'){
- if(yych <= 'T') goto yy784;
+ if(yych <= 'T') goto yy749;
goto yy74;
} else {
if(yych == 'u') goto yy74;
- goto yy784;
+ goto yy749;
}
}
-yy1228:
- YYDEBUG(1228, *YYCURSOR);
+yy1196:
+ YYDEBUG(1196, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'P'){
- if(yych == 'C') goto yy121;
+ if(yych == 'C') goto yy125;
if(yych <= 'O') goto yy53;
- goto yy792;
+ goto yy757;
} else {
if(yych <= 'c'){
if(yych <= 'b') goto yy53;
- goto yy121;
+ goto yy125;
} else {
- if(yych == 'p') goto yy792;
+ if(yych == 'p') goto yy757;
goto yy53;
}
}
-yy1229:
- YYDEBUG(1229, *YYCURSOR);
+yy1197:
+ YYDEBUG(1197, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '9'){
if(yych <= ','){
- if(yych != 0x09) goto yy1232;
- goto yy1230;
+ if(yych != 0x09) goto yy1200;
+ goto yy1198;
} else {
- if(yych <= '-') goto yy695;
- if(yych <= '.') goto yy931;
- if(yych <= '/') goto yy930;
- goto yy935;
+ if(yych <= '-') goto yy660;
+ if(yych <= '.') goto yy896;
+ if(yych <= '/') goto yy895;
+ goto yy900;
}
} else {
if(yych <= 'q'){
- if(yych == 'n') goto yy692;
- goto yy1232;
+ if(yych == 'n') goto yy657;
+ goto yy1200;
} else {
- if(yych <= 'r') goto yy693;
- if(yych <= 's') goto yy686;
- if(yych <= 't') goto yy690;
- goto yy1232;
+ if(yych <= 'r') goto yy658;
+ if(yych <= 's') goto yy651;
+ if(yych <= 't') goto yy655;
+ goto yy1200;
}
}
-yy1230:
- YYDEBUG(1230, *YYCURSOR);
+yy1198:
+ YYDEBUG(1198, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1232;
- if(yych <= '0') goto yy932;
- if(yych <= '1') goto yy933;
- if(yych <= '9') goto yy934;
- goto yy1232;
-yy1231:
- YYDEBUG(1231, *YYCURSOR);
+ if(yych <= '/') goto yy1200;
+ if(yych <= '0') goto yy897;
+ if(yych <= '1') goto yy898;
+ if(yych <= '9') goto yy899;
+ goto yy1200;
+yy1199:
+ YYDEBUG(1199, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
yych = *YYCURSOR;
- goto yy1232;
-yy1232:
- YYDEBUG(1232, *YYCURSOR);
+ goto yy1200;
+yy1200:
+ YYDEBUG(1200, *YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: case ' ': goto yy1231;
+ case 0x09: case ' ': goto yy1199;
case '-':
- case '.': goto yy783;
- case 'A': case 'a': goto yy780;
- case 'D': case 'd': goto yy688;
- case 'F': case 'f': goto yy689;
+ case '.': goto yy748;
+ case 'A': case 'a': goto yy745;
+ case 'D': case 'd': goto yy653;
+ case 'F': case 'f': goto yy654;
case 'H': case 'h': goto yy60;
- case 'I': goto yy697;
- case 'J': case 'j': goto yy701;
- case 'M': case 'm': goto yy687;
- case 'N': case 'n': goto yy704;
- case 'O': case 'o': goto yy703;
- case 'S': case 's': goto yy685;
+ case 'I': goto yy662;
+ case 'J': case 'j': goto yy666;
+ case 'M': case 'm': goto yy652;
+ case 'N': case 'n': goto yy669;
+ case 'O': case 'o': goto yy668;
+ case 'S': case 's': goto yy650;
case 'T': case 't': goto yy65;
- case 'V': goto yy699;
+ case 'V': goto yy664;
case 'W': case 'w': goto yy62;
- case 'X': goto yy700;
+ case 'X': goto yy665;
case 'Y': case 'y': goto yy64;
default: goto yy53;
}
-yy1233:
- YYDEBUG(1233, *YYCURSOR);
+yy1201:
+ YYDEBUG(1201, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '9'){
if(yych <= '-'){
- if(yych == 0x09) goto yy1230;
- if(yych <= ',') goto yy1232;
- goto yy695;
+ if(yych == 0x09) goto yy1198;
+ if(yych <= ',') goto yy1200;
+ goto yy660;
} else {
- if(yych <= '.') goto yy1234;
- if(yych <= '/') goto yy930;
- if(yych <= '5') goto yy1236;
- goto yy935;
+ if(yych <= '.') goto yy1202;
+ if(yych <= '/') goto yy895;
+ if(yych <= '5') goto yy1204;
+ goto yy900;
}
} else {
if(yych <= 'q'){
- if(yych <= ':') goto yy1235;
- if(yych == 'n') goto yy692;
- goto yy1232;
+ if(yych <= ':') goto yy1203;
+ if(yych == 'n') goto yy657;
+ goto yy1200;
} else {
- if(yych <= 'r') goto yy693;
- if(yych <= 's') goto yy686;
- if(yych <= 't') goto yy690;
- goto yy1232;
+ if(yych <= 'r') goto yy658;
+ if(yych <= 's') goto yy651;
+ if(yych <= 't') goto yy655;
+ goto yy1200;
}
}
-yy1234:
- YYDEBUG(1234, *YYCURSOR);
+yy1202:
+ YYDEBUG(1202, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '1'){
- if(yych <= '/') goto yy784;
- if(yych <= '0') goto yy1258;
- goto yy1259;
+ if(yych <= '/') goto yy749;
+ if(yych <= '0') goto yy1226;
+ goto yy1227;
} else {
- if(yych <= '5') goto yy1260;
- if(yych <= '9') goto yy1261;
- goto yy784;
+ if(yych <= '5') goto yy1228;
+ if(yych <= '9') goto yy1229;
+ goto yy749;
}
-yy1235:
- YYDEBUG(1235, *YYCURSOR);
+yy1203:
+ YYDEBUG(1203, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1253;
- if(yych <= '9') goto yy1254;
+ if(yych <= '5') goto yy1221;
+ if(yych <= '9') goto yy1222;
goto yy53;
-yy1236:
- YYDEBUG(1236, *YYCURSOR);
+yy1204:
+ YYDEBUG(1204, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '-') goto yy936;
+ if(yych == '-') goto yy901;
if(yych <= '/') goto yy57;
if(yych >= ':') goto yy57;
- goto yy1237;
-yy1237:
- YYDEBUG(1237, *YYCURSOR);
- yyaccept = 20;
+ goto yy1205;
+yy1205:
+ YYDEBUG(1205, *YYCURSOR);
+ yyaccept = 23;
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
@@ -18594,26 +18124,26 @@ yy1237:
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 yy975;
- case '-': goto yy972;
- case '.': goto yy976;
- case '/': goto yy973;
- case '0': goto yy1239;
- case '1': goto yy1240;
- case '2': goto yy1241;
- case '3': goto yy1242;
+ case 't': case 'w': case 'y': goto yy940;
+ case '-': goto yy937;
+ case '.': goto yy941;
+ case '/': goto yy938;
+ case '0': goto yy1207;
+ case '1': goto yy1208;
+ case '2': goto yy1209;
+ case '3': goto yy1210;
case '4':
- case '5': goto yy1243;
- case '6': goto yy1244;
+ case '5': goto yy1211;
+ case '6': goto yy1212;
case '7':
case '8':
case '9': goto yy51;
- case ':': goto yy991;
- case 'W': goto yy994;
- default: goto yy1238;
+ case ':': goto yy956;
+ case 'W': goto yy959;
+ default: goto yy1206;
}
-yy1238:
- YYDEBUG(1238, *YYCURSOR);
+yy1206:
+ YYDEBUG(1206, *YYCURSOR);
{
DEBUG_OUTPUT("gnunocolon");
@@ -18636,50 +18166,50 @@ yy1238:
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
-yy1239:
- YYDEBUG(1239, *YYCURSOR);
+yy1207:
+ YYDEBUG(1207, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '0') goto yy1251;
- if(yych <= '9') goto yy1252;
+ if(yych <= '0') goto yy1219;
+ if(yych <= '9') goto yy1220;
goto yy57;
-yy1240:
- YYDEBUG(1240, *YYCURSOR);
+yy1208:
+ YYDEBUG(1208, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '2') goto yy1250;
- if(yych <= '9') goto yy1249;
+ if(yych <= '2') goto yy1218;
+ if(yych <= '9') goto yy1217;
goto yy57;
-yy1241:
- YYDEBUG(1241, *YYCURSOR);
+yy1209:
+ YYDEBUG(1209, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy1249;
+ if(yych <= '9') goto yy1217;
goto yy57;
-yy1242:
- YYDEBUG(1242, *YYCURSOR);
+yy1210:
+ YYDEBUG(1210, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '5') goto yy1247;
- if(yych <= '6') goto yy1248;
- if(yych <= '9') goto yy1245;
+ if(yych <= '5') goto yy1215;
+ if(yych <= '6') goto yy1216;
+ if(yych <= '9') goto yy1213;
goto yy57;
-yy1243:
- YYDEBUG(1243, *YYCURSOR);
+yy1211:
+ YYDEBUG(1211, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy1245;
+ if(yych <= '9') goto yy1213;
goto yy57;
-yy1244:
- YYDEBUG(1244, *YYCURSOR);
+yy1212:
+ YYDEBUG(1212, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '0') goto yy1245;
+ if(yych <= '0') goto yy1213;
if(yych <= '9') goto yy51;
goto yy57;
-yy1245:
- YYDEBUG(1245, *YYCURSOR);
- yyaccept = 21;
+yy1213:
+ YYDEBUG(1213, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yybm[0+yych] & 8) {
goto yy51;
@@ -18689,22 +18219,22 @@ yy1245:
if(yych <= ' '){
if(yych == 0x09) goto yy57;
if(yych >= ' ') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych == 'D') goto yy57;
if(yych >= 'F') goto yy57;
- goto yy1246;
+ goto yy1214;
}
} else {
if(yych <= 'M'){
if(yych == 'H') goto yy57;
if(yych >= 'M') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
if(yych <= 'T') goto yy57;
if(yych >= 'W') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
} else {
@@ -18712,30 +18242,30 @@ yy1245:
if(yych <= 'd'){
if(yych == 'Y') goto yy57;
if(yych >= 'd') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych == 'f') goto yy57;
if(yych >= 'h') goto yy57;
- goto yy1246;
+ goto yy1214;
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
if(yych >= 's') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'w'){
if(yych >= 'w') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1246:
- YYDEBUG(1246, *YYCURSOR);
+yy1214:
+ YYDEBUG(1214, *YYCURSOR);
{
int tz_not_found;
@@ -18755,235 +18285,235 @@ yy1246:
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
-yy1247:
- YYDEBUG(1247, *YYCURSOR);
- yyaccept = 21;
+yy1215:
+ YYDEBUG(1215, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1246;
+ if(yych <= 0x1F) goto yy1214;
goto yy57;
} else {
- if(yych <= '/') goto yy1246;
- if(yych <= '9') goto yy1004;
- if(yych <= 'C') goto yy1246;
+ if(yych <= '/') goto yy1214;
+ if(yych <= '9') goto yy970;
+ if(yych <= 'C') goto yy1214;
goto yy57;
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1246;
+ if(yych <= 'G') goto yy1214;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1246;
+ if(yych <= 'L') goto yy1214;
goto yy57;
} else {
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
if(yych <= 'T') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1246;
+ if(yych == 'X') goto yy1214;
if(yych <= 'Y') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
- if(yych == 'g') goto yy1246;
+ if(yych == 'g') goto yy1214;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1246;
+ if(yych <= 'r') goto yy1214;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1246;
+ if(yych <= 'v') goto yy1214;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1248:
- YYDEBUG(1248, *YYCURSOR);
- yyaccept = 21;
+yy1216:
+ YYDEBUG(1216, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1246;
+ if(yych <= 0x1F) goto yy1214;
goto yy57;
} else {
if(yych <= '6'){
- if(yych <= '/') goto yy1246;
- goto yy1004;
+ if(yych <= '/') goto yy1214;
+ goto yy970;
} else {
if(yych <= '9') goto yy51;
- if(yych <= 'C') goto yy1246;
+ if(yych <= 'C') goto yy1214;
goto yy57;
}
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1246;
+ if(yych <= 'G') goto yy1214;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1246;
+ if(yych <= 'L') goto yy1214;
goto yy57;
} else {
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
if(yych <= 'T') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1246;
+ if(yych == 'X') goto yy1214;
if(yych <= 'Y') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
- if(yych == 'g') goto yy1246;
+ if(yych == 'g') goto yy1214;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1246;
+ if(yych <= 'r') goto yy1214;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1246;
+ if(yych <= 'v') goto yy1214;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1249:
- YYDEBUG(1249, *YYCURSOR);
- yyaccept = 21;
+yy1217:
+ YYDEBUG(1217, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1246;
+ if(yych <= 0x1F) goto yy1214;
goto yy57;
} else {
- if(yych <= '/') goto yy1246;
- if(yych <= '9') goto yy1004;
- if(yych <= 'C') goto yy1246;
+ if(yych <= '/') goto yy1214;
+ if(yych <= '9') goto yy970;
+ if(yych <= 'C') goto yy1214;
goto yy57;
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1246;
+ if(yych <= 'G') goto yy1214;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1246;
+ if(yych <= 'L') goto yy1214;
goto yy57;
} else {
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
if(yych <= 'T') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1246;
+ if(yych == 'X') goto yy1214;
if(yych <= 'Y') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
- if(yych == 'g') goto yy1246;
+ if(yych == 'g') goto yy1214;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1246;
+ if(yych <= 'r') goto yy1214;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1246;
+ if(yych <= 'v') goto yy1214;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1250:
- YYDEBUG(1250, *YYCURSOR);
- yyaccept = 21;
+yy1218:
+ YYDEBUG(1218, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '9'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1246;
+ if(yych <= 0x1F) goto yy1214;
goto yy57;
} else {
if(yych <= '0'){
- if(yych <= '/') goto yy1246;
- goto yy1028;
+ if(yych <= '/') goto yy1214;
+ goto yy994;
} else {
- if(yych <= '2') goto yy1029;
- if(yych <= '3') goto yy1030;
- goto yy1004;
+ if(yych <= '2') goto yy995;
+ if(yych <= '3') goto yy996;
+ goto yy970;
}
}
} else {
if(yych <= 'G'){
if(yych <= 'D'){
- if(yych <= 'C') goto yy1246;
+ if(yych <= 'C') goto yy1214;
goto yy57;
} else {
if(yych == 'F') goto yy57;
- goto yy1246;
+ goto yy1214;
}
} else {
if(yych <= 'L'){
if(yych <= 'H') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'M') goto yy57;
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
goto yy57;
}
}
@@ -18992,141 +18522,141 @@ yy1250:
if(yych <= 'g'){
if(yych <= 'Y'){
if(yych == 'W') goto yy57;
- if(yych <= 'X') goto yy1246;
+ if(yych <= 'X') goto yy1214;
goto yy57;
} else {
if(yych <= 'd'){
- if(yych <= 'c') goto yy1246;
+ if(yych <= 'c') goto yy1214;
goto yy57;
} else {
if(yych == 'f') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
} else {
if(yych <= 't'){
if(yych <= 'l'){
if(yych <= 'h') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'm') goto yy57;
- if(yych <= 'r') goto yy1246;
+ if(yych <= 'r') goto yy1214;
goto yy57;
}
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1246;
+ if(yych <= 'v') goto yy1214;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1251:
- YYDEBUG(1251, *YYCURSOR);
- yyaccept = 21;
+yy1219:
+ YYDEBUG(1219, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1246;
+ if(yych <= 0x1F) goto yy1214;
goto yy57;
} else {
if(yych <= '0'){
- if(yych <= '/') goto yy1246;
+ if(yych <= '/') goto yy1214;
goto yy51;
} else {
- if(yych <= '9') goto yy1004;
- if(yych <= 'C') goto yy1246;
+ if(yych <= '9') goto yy970;
+ if(yych <= 'C') goto yy1214;
goto yy57;
}
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1246;
+ if(yych <= 'G') goto yy1214;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1246;
+ if(yych <= 'L') goto yy1214;
goto yy57;
} else {
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
if(yych <= 'T') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1246;
+ if(yych == 'X') goto yy1214;
if(yych <= 'Y') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
- if(yych == 'g') goto yy1246;
+ if(yych == 'g') goto yy1214;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1246;
+ if(yych <= 'r') goto yy1214;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1246;
+ if(yych <= 'v') goto yy1214;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1252:
- YYDEBUG(1252, *YYCURSOR);
- yyaccept = 21;
+yy1220:
+ YYDEBUG(1220, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '9'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1246;
+ if(yych <= 0x1F) goto yy1214;
goto yy57;
} else {
if(yych <= '0'){
- if(yych <= '/') goto yy1246;
- goto yy1028;
+ if(yych <= '/') goto yy1214;
+ goto yy994;
} else {
- if(yych <= '2') goto yy1029;
- if(yych <= '3') goto yy1030;
- goto yy1004;
+ if(yych <= '2') goto yy995;
+ if(yych <= '3') goto yy996;
+ goto yy970;
}
}
} else {
if(yych <= 'G'){
if(yych <= 'D'){
- if(yych <= 'C') goto yy1246;
+ if(yych <= 'C') goto yy1214;
goto yy57;
} else {
if(yych == 'F') goto yy57;
- goto yy1246;
+ goto yy1214;
}
} else {
if(yych <= 'L'){
if(yych <= 'H') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'M') goto yy57;
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
goto yy57;
}
}
@@ -19135,242 +18665,242 @@ yy1252:
if(yych <= 'g'){
if(yych <= 'Y'){
if(yych == 'W') goto yy57;
- if(yych <= 'X') goto yy1246;
+ if(yych <= 'X') goto yy1214;
goto yy57;
} else {
if(yych <= 'd'){
- if(yych <= 'c') goto yy1246;
+ if(yych <= 'c') goto yy1214;
goto yy57;
} else {
if(yych == 'f') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
} else {
if(yych <= 't'){
if(yych <= 'l'){
if(yych <= 'h') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'm') goto yy57;
- if(yych <= 'r') goto yy1246;
+ if(yych <= 'r') goto yy1214;
goto yy57;
}
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1246;
+ if(yych <= 'v') goto yy1214;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1253:
- YYDEBUG(1253, *YYCURSOR);
- yyaccept = 11;
+yy1221:
+ YYDEBUG(1221, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy1255;
- goto yy713;
+ if(yych == '.') goto yy1223;
+ goto yy678;
} else {
- if(yych <= '9') goto yy1254;
- if(yych <= ':') goto yy1255;
- goto yy713;
+ if(yych <= '9') goto yy1222;
+ if(yych <= ':') goto yy1223;
+ goto yy678;
}
-yy1254:
- YYDEBUG(1254, *YYCURSOR);
- yyaccept = 11;
+yy1222:
+ YYDEBUG(1222, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy1255;
- if(yych != ':') goto yy713;
- goto yy1255;
-yy1255:
- YYDEBUG(1255, *YYCURSOR);
+ if(yych == '.') goto yy1223;
+ if(yych != ':') goto yy678;
+ goto yy1223;
+yy1223:
+ YYDEBUG(1223, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1256;
- if(yych <= '6') goto yy1257;
- if(yych <= '9') goto yy718;
+ if(yych <= '5') goto yy1224;
+ if(yych <= '6') goto yy1225;
+ if(yych <= '9') goto yy683;
goto yy53;
-yy1256:
- YYDEBUG(1256, *YYCURSOR);
- yyaccept = 11;
+yy1224:
+ YYDEBUG(1224, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy718;
- goto yy713;
-yy1257:
- YYDEBUG(1257, *YYCURSOR);
- yyaccept = 11;
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy683;
+ goto yy678;
+yy1225:
+ YYDEBUG(1225, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych == '0') goto yy718;
- goto yy713;
-yy1258:
- YYDEBUG(1258, *YYCURSOR);
- yyaccept = 11;
+ if(yych == '.') goto yy684;
+ if(yych == '0') goto yy683;
+ goto yy678;
+yy1226:
+ YYDEBUG(1226, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- goto yy1262;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ goto yy1230;
} else {
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy1261;
- if(yych <= ':') goto yy1255;
- goto yy713;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy1229;
+ if(yych <= ':') goto yy1223;
+ goto yy678;
}
-yy1259:
- YYDEBUG(1259, *YYCURSOR);
- yyaccept = 11;
+yy1227:
+ YYDEBUG(1227, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- if(yych <= '.') goto yy1262;
- goto yy713;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ if(yych <= '.') goto yy1230;
+ goto yy678;
} else {
- if(yych <= '2') goto yy1261;
- if(yych <= '9') goto yy1254;
- if(yych <= ':') goto yy1255;
- goto yy713;
+ if(yych <= '2') goto yy1229;
+ if(yych <= '9') goto yy1222;
+ if(yych <= ':') goto yy1223;
+ goto yy678;
}
-yy1260:
- YYDEBUG(1260, *YYCURSOR);
- yyaccept = 11;
+yy1228:
+ YYDEBUG(1228, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- goto yy1262;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ goto yy1230;
} else {
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy1254;
- if(yych <= ':') goto yy1255;
- goto yy713;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy1222;
+ if(yych <= ':') goto yy1223;
+ goto yy678;
}
-yy1261:
- YYDEBUG(1261, *YYCURSOR);
- yyaccept = 11;
+yy1229:
+ YYDEBUG(1229, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- goto yy1262;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ goto yy1230;
} else {
- if(yych == ':') goto yy1255;
- goto yy713;
+ if(yych == ':') goto yy1223;
+ goto yy678;
}
-yy1262:
- YYDEBUG(1262, *YYCURSOR);
+yy1230:
+ YYDEBUG(1230, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1263;
- if(yych <= '6') goto yy1264;
- if(yych <= '9') goto yy811;
+ if(yych <= '5') goto yy1231;
+ if(yych <= '6') goto yy1232;
+ if(yych <= '9') goto yy776;
goto yy53;
-yy1263:
- YYDEBUG(1263, *YYCURSOR);
- yyaccept = 11;
+yy1231:
+ YYDEBUG(1231, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy1265;
- goto yy713;
-yy1264:
- YYDEBUG(1264, *YYCURSOR);
- yyaccept = 11;
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy1233;
+ goto yy678;
+yy1232:
+ YYDEBUG(1232, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy719;
- goto yy713;
+ if(yych == '.') goto yy684;
+ goto yy678;
} else {
- if(yych <= '0') goto yy1265;
- if(yych <= '9') goto yy812;
- goto yy713;
+ if(yych <= '0') goto yy1233;
+ if(yych <= '9') goto yy777;
+ goto yy678;
}
-yy1265:
- YYDEBUG(1265, *YYCURSOR);
- yyaccept = 11;
+yy1233:
+ YYDEBUG(1233, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy814;
- goto yy713;
-yy1266:
- YYDEBUG(1266, *YYCURSOR);
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy779;
+ goto yy678;
+yy1234:
+ YYDEBUG(1234, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '9'){
if(yych <= '-'){
- if(yych == 0x09) goto yy682;
- if(yych <= ',') goto yy684;
- goto yy695;
+ if(yych == 0x09) goto yy647;
+ if(yych <= ',') goto yy649;
+ goto yy660;
} else {
- if(yych <= '.') goto yy696;
- if(yych <= '/') goto yy694;
- if(yych <= '5') goto yy1236;
- goto yy935;
+ if(yych <= '.') goto yy661;
+ if(yych <= '/') goto yy659;
+ if(yych <= '5') goto yy1204;
+ goto yy900;
}
} else {
if(yych <= 'q'){
- if(yych <= ':') goto yy705;
- if(yych == 'n') goto yy692;
- goto yy684;
+ if(yych <= ':') goto yy670;
+ if(yych == 'n') goto yy657;
+ goto yy649;
} else {
- if(yych <= 'r') goto yy693;
- if(yych <= 's') goto yy686;
- if(yych <= 't') goto yy690;
- goto yy684;
+ if(yych <= 'r') goto yy658;
+ if(yych <= 's') goto yy651;
+ if(yych <= 't') goto yy655;
+ goto yy649;
}
}
-yy1267:
- YYDEBUG(1267, *YYCURSOR);
+yy1235:
+ YYDEBUG(1235, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '9'){
if(yych <= '-'){
- if(yych == 0x09) goto yy1230;
- if(yych <= ',') goto yy1232;
- goto yy695;
+ if(yych == 0x09) goto yy1198;
+ if(yych <= ',') goto yy1200;
+ goto yy660;
} else {
- if(yych <= '.') goto yy1234;
- if(yych <= '/') goto yy694;
- if(yych <= '5') goto yy1236;
- goto yy935;
+ if(yych <= '.') goto yy1202;
+ if(yych <= '/') goto yy659;
+ if(yych <= '5') goto yy1204;
+ goto yy900;
}
} else {
if(yych <= 'q'){
- if(yych <= ':') goto yy1235;
- if(yych == 'n') goto yy692;
- goto yy1232;
+ if(yych <= ':') goto yy1203;
+ if(yych == 'n') goto yy657;
+ goto yy1200;
} else {
- if(yych <= 'r') goto yy693;
- if(yych <= 's') goto yy686;
- if(yych <= 't') goto yy690;
- goto yy1232;
+ if(yych <= 'r') goto yy658;
+ if(yych <= 's') goto yy651;
+ if(yych <= 't') goto yy655;
+ goto yy1200;
}
}
-yy1268:
- YYDEBUG(1268, *YYCURSOR);
+yy1236:
+ YYDEBUG(1236, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1269;
-yy1269:
- YYDEBUG(1269, *YYCURSOR);
+ goto yy1237;
+yy1237:
+ YYDEBUG(1237, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy1270;
-yy1270:
- YYDEBUG(1270, *YYCURSOR);
- if(yych <= '/') goto yy1271;
- if(yych <= '9') goto yy1269;
- goto yy1271;
-yy1271:
- YYDEBUG(1271, *YYCURSOR);
+ goto yy1238;
+yy1238:
+ YYDEBUG(1238, *YYCURSOR);
+ if(yych <= '/') goto yy1239;
+ if(yych <= '9') goto yy1237;
+ goto yy1239;
+yy1239:
+ YYDEBUG(1239, *YYCURSOR);
{
timelib_ull i;
@@ -19394,456 +18924,456 @@ yy1271:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-yy1272:
- YYDEBUG(1272, *YYCURSOR);
+yy1240:
+ YYDEBUG(1240, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy1312;
+ if(yych <= 'M') goto yy138;
+ goto yy1280;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'n') goto yy1312;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'n') goto yy1280;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1273:
- YYDEBUG(1273, *YYCURSOR);
+yy1241:
+ YYDEBUG(1241, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'I') goto yy1306;
- if(yych <= 'T') goto yy134;
- goto yy1305;
+ if(yych == 'I') goto yy1274;
+ if(yych <= 'T') goto yy138;
+ goto yy1273;
}
} else {
if(yych <= 'i'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- if(yych <= 'h') goto yy134;
- goto yy1306;
+ if(yych <= 'h') goto yy138;
+ goto yy1274;
} else {
- if(yych == 'u') goto yy1305;
- if(yych <= 'z') goto yy134;
+ if(yych == 'u') goto yy1273;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1274:
- YYDEBUG(1274, *YYCURSOR);
+yy1242:
+ YYDEBUG(1242, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'M'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'D') goto yy1294;
- if(yych <= 'L') goto yy134;
- goto yy1295;
+ if(yych == 'D') goto yy1262;
+ if(yych <= 'L') goto yy138;
+ goto yy1263;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- if(yych <= 'c') goto yy134;
- goto yy1294;
+ if(yych <= 'c') goto yy138;
+ goto yy1262;
} else {
- if(yych == 'm') goto yy1295;
- if(yych <= 'z') goto yy134;
+ if(yych == 'm') goto yy1263;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1275:
- YYDEBUG(1275, *YYCURSOR);
+yy1243:
+ YYDEBUG(1243, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy1290;
+ if(yych <= 'D') goto yy138;
+ goto yy1258;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'e') goto yy1290;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'e') goto yy1258;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1276:
- YYDEBUG(1276, *YYCURSOR);
+yy1244:
+ YYDEBUG(1244, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy1286;
+ if(yych <= 'D') goto yy138;
+ goto yy1254;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'e') goto yy1286;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'e') goto yy1254;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1277:
- YYDEBUG(1277, *YYCURSOR);
+yy1245:
+ YYDEBUG(1245, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/'){
- if(yych == '.') goto yy1235;
+ if(yych == '.') goto yy1203;
goto yy53;
} else {
- if(yych <= '9') goto yy1280;
- if(yych <= ':') goto yy1235;
+ if(yych <= '9') goto yy1248;
+ if(yych <= ':') goto yy1203;
goto yy53;
}
-yy1278:
- YYDEBUG(1278, *YYCURSOR);
+yy1246:
+ YYDEBUG(1246, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/'){
- if(yych == '.') goto yy1235;
+ if(yych == '.') goto yy1203;
goto yy53;
} else {
- if(yych <= '3') goto yy1280;
- if(yych == ':') goto yy1235;
+ if(yych <= '3') goto yy1248;
+ if(yych == ':') goto yy1203;
goto yy53;
}
-yy1279:
- YYDEBUG(1279, *YYCURSOR);
+yy1247:
+ YYDEBUG(1247, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '.') goto yy1235;
- if(yych == ':') goto yy1235;
+ if(yych == '.') goto yy1203;
+ if(yych == ':') goto yy1203;
goto yy53;
-yy1280:
- YYDEBUG(1280, *YYCURSOR);
+yy1248:
+ YYDEBUG(1248, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/'){
- if(yych == '.') goto yy1235;
+ if(yych == '.') goto yy1203;
goto yy53;
} else {
- if(yych <= '5') goto yy1281;
- if(yych == ':') goto yy1235;
+ if(yych <= '5') goto yy1249;
+ if(yych == ':') goto yy1203;
goto yy53;
}
-yy1281:
- YYDEBUG(1281, *YYCURSOR);
+yy1249:
+ YYDEBUG(1249, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1282;
-yy1282:
- YYDEBUG(1282, *YYCURSOR);
- yyaccept = 20;
+ goto yy1250;
+yy1250:
+ YYDEBUG(1250, *YYCURSOR);
+ yyaccept = 23;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '/') goto yy1238;
- if(yych <= '5') goto yy1283;
- if(yych <= '6') goto yy1284;
- goto yy1238;
-yy1283:
- YYDEBUG(1283, *YYCURSOR);
+ if(yych <= '/') goto yy1206;
+ if(yych <= '5') goto yy1251;
+ if(yych <= '6') goto yy1252;
+ goto yy1206;
+yy1251:
+ YYDEBUG(1251, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1285;
+ if(yych <= '9') goto yy1253;
goto yy53;
-yy1284:
- YYDEBUG(1284, *YYCURSOR);
+yy1252:
+ YYDEBUG(1252, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '0') goto yy53;
- goto yy1285;
-yy1285:
- YYDEBUG(1285, *YYCURSOR);
+ goto yy1253;
+yy1253:
+ YYDEBUG(1253, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy1246;
-yy1286:
- YYDEBUG(1286, *YYCURSOR);
+ goto yy1214;
+yy1254:
+ YYDEBUG(1254, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'K') goto yy135;
- goto yy1287;
+ if(yych <= 'K') goto yy139;
+ goto yy1255;
}
} else {
if(yych <= 'k'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'l') goto yy1287;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'l') goto yy1255;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1287:
- YYDEBUG(1287, *YYCURSOR);
+yy1255:
+ YYDEBUG(1255, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'F'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'E') goto yy136;
- goto yy1288;
+ if(yych <= 'E') goto yy140;
+ goto yy1256;
}
} else {
if(yych <= 'e'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'f') goto yy1288;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'f') goto yy1256;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1288:
- YYDEBUG(1288, *YYCURSOR);
+yy1256:
+ YYDEBUG(1256, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy137;
- goto yy1289;
+ if(yych <= 'S') goto yy141;
+ goto yy1257;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 't') goto yy1289;
- if(yych <= 'z') goto yy137;
+ if(yych <= 't') goto yy1257;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1289:
- YYDEBUG(1289, *YYCURSOR);
+yy1257:
+ YYDEBUG(1257, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'G'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'H') goto yy163;
- if(yych == 'h') goto yy163;
+ if(yych <= 'H') goto yy167;
+ if(yych == 'h') goto yy167;
goto yy3;
}
-yy1290:
- YYDEBUG(1290, *YYCURSOR);
+yy1258:
+ YYDEBUG(1258, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
if(yych <= ')'){
- if(yych <= '(') goto yy405;
- goto yy132;
+ if(yych <= '(') goto yy283;
+ goto yy136;
} else {
- if(yych <= '@') goto yy405;
- if(yych <= 'R') goto yy135;
- goto yy1291;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'R') goto yy139;
+ goto yy1259;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy405;
- goto yy135;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy283;
+ goto yy139;
} else {
- if(yych <= 's') goto yy1291;
- if(yych <= 'z') goto yy135;
- goto yy405;
+ if(yych <= 's') goto yy1259;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy1291:
- YYDEBUG(1291, *YYCURSOR);
+yy1259:
+ YYDEBUG(1259, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy136;
- goto yy1292;
+ if(yych <= 'C') goto yy140;
+ goto yy1260;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'd') goto yy1292;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'd') goto yy1260;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1292:
- YYDEBUG(1292, *YYCURSOR);
+yy1260:
+ YYDEBUG(1260, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy1293;
+ goto yy1261;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
goto yy3;
} else {
- if(yych <= 'a') goto yy1293;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'a') goto yy1261;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1293:
- YYDEBUG(1293, *YYCURSOR);
+yy1261:
+ YYDEBUG(1261, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'X'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Y') goto yy411;
- if(yych == 'y') goto yy411;
+ if(yych <= 'Y') goto yy289;
+ if(yych == 'y') goto yy289;
goto yy3;
}
-yy1294:
- YYDEBUG(1294, *YYCURSOR);
+yy1262:
+ YYDEBUG(1262, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy1302;
+ goto yy1270;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
goto yy3;
} else {
- if(yych <= 'a') goto yy1302;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'a') goto yy1270;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1295:
- YYDEBUG(1295, *YYCURSOR);
+yy1263:
+ YYDEBUG(1263, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy135;
- goto yy1296;
+ if(yych <= 'N') goto yy139;
+ goto yy1264;
}
} else {
if(yych <= 'n'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'o') goto yy1296;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'o') goto yy1264;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1296:
- YYDEBUG(1296, *YYCURSOR);
+yy1264:
+ YYDEBUG(1264, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy136;
- goto yy1297;
+ if(yych <= 'Q') goto yy140;
+ goto yy1265;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'r') goto yy1297;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'r') goto yy1265;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1297:
- YYDEBUG(1297, *YYCURSOR);
+yy1265:
+ YYDEBUG(1265, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy137;
- goto yy1298;
+ if(yych <= 'Q') goto yy141;
+ goto yy1266;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'r') goto yy1298;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'r') goto yy1266;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1298:
- YYDEBUG(1298, *YYCURSOR);
+yy1266:
+ YYDEBUG(1266, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'O') goto yy1299;
+ if(yych <= 'O') goto yy1267;
if(yych != 'o') goto yy3;
- goto yy1299;
+ goto yy1267;
}
-yy1299:
- YYDEBUG(1299, *YYCURSOR);
+yy1267:
+ YYDEBUG(1267, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'W') goto yy1300;
+ if(yych == 'W') goto yy1268;
if(yych != 'w') goto yy53;
- goto yy1300;
-yy1300:
- YYDEBUG(1300, *YYCURSOR);
+ goto yy1268;
+yy1268:
+ YYDEBUG(1268, *YYCURSOR);
++YYCURSOR;
- goto yy1301;
-yy1301:
- YYDEBUG(1301, *YYCURSOR);
+ goto yy1269;
+yy1269:
+ YYDEBUG(1269, *YYCURSOR);
{
DEBUG_OUTPUT("tomorrow");
@@ -19855,43 +19385,43 @@ yy1301:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-yy1302:
- YYDEBUG(1302, *YYCURSOR);
+yy1270:
+ YYDEBUG(1270, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy136;
- goto yy1303;
+ if(yych <= 'X') goto yy140;
+ goto yy1271;
}
} else {
if(yych <= 'x'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'y') goto yy1303;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'y') goto yy1271;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1303:
- YYDEBUG(1303, *YYCURSOR);
+yy1271:
+ YYDEBUG(1271, *YYCURSOR);
++YYCURSOR;
if((yych = *YYCURSOR) <= '@'){
- if(yych == ')') goto yy132;
- goto yy1304;
+ if(yych == ')') goto yy136;
+ goto yy1272;
} else {
- if(yych <= 'Z') goto yy137;
- if(yych <= '`') goto yy1304;
- if(yych <= 'z') goto yy137;
- goto yy1304;
+ if(yych <= 'Z') goto yy141;
+ if(yych <= '`') goto yy1272;
+ if(yych <= 'z') goto yy141;
+ goto yy1272;
}
-yy1304:
- YYDEBUG(1304, *YYCURSOR);
+yy1272:
+ YYDEBUG(1272, *YYCURSOR);
{
DEBUG_OUTPUT("midnight | today");
@@ -19901,1801 +19431,1801 @@ yy1304:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-yy1305:
- YYDEBUG(1305, *YYCURSOR);
+yy1273:
+ YYDEBUG(1273, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
- if(yych <= '(') goto yy405;
- goto yy132;
+ if(yych <= '(') goto yy283;
+ goto yy136;
} else {
- if(yych <= '@') goto yy405;
- if(yych <= 'Q') goto yy135;
- goto yy1308;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'Q') goto yy139;
+ goto yy1276;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy405;
- goto yy135;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy283;
+ goto yy139;
} else {
- if(yych <= 'r') goto yy1308;
- if(yych <= 'z') goto yy135;
- goto yy405;
+ if(yych <= 'r') goto yy1276;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy1306:
- YYDEBUG(1306, *YYCURSOR);
+yy1274:
+ YYDEBUG(1274, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Q') goto yy135;
- if(yych >= 'S') goto yy321;
- goto yy1307;
+ if(yych <= 'Q') goto yy139;
+ if(yych >= 'S') goto yy257;
+ goto yy1275;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'r') goto yy1307;
- if(yych <= 's') goto yy321;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'r') goto yy1275;
+ if(yych <= 's') goto yy257;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1307:
- YYDEBUG(1307, *YYCURSOR);
+yy1275:
+ YYDEBUG(1275, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy136;
- goto yy376;
+ if(yych <= 'C') goto yy140;
+ goto yy270;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'd') goto yy376;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'd') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1308:
- YYDEBUG(1308, *YYCURSOR);
+yy1276:
+ YYDEBUG(1276, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy136;
- goto yy1309;
+ if(yych <= 'R') goto yy140;
+ goto yy1277;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 's') goto yy1309;
- if(yych <= 'z') goto yy136;
+ if(yych <= 's') goto yy1277;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1309:
- YYDEBUG(1309, *YYCURSOR);
+yy1277:
+ YYDEBUG(1277, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy137;
- goto yy1310;
+ if(yych <= 'C') goto yy141;
+ goto yy1278;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'd') goto yy1310;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'd') goto yy1278;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1310:
- YYDEBUG(1310, *YYCURSOR);
+yy1278:
+ YYDEBUG(1278, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'A') goto yy1311;
+ if(yych <= 'A') goto yy1279;
if(yych != 'a') goto yy3;
- goto yy1311;
+ goto yy1279;
}
-yy1311:
- YYDEBUG(1311, *YYCURSOR);
+yy1279:
+ YYDEBUG(1279, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy411;
- if(yych == 'y') goto yy411;
+ if(yych == 'Y') goto yy289;
+ if(yych == 'y') goto yy289;
goto yy53;
-yy1312:
- YYDEBUG(1312, *YYCURSOR);
+yy1280:
+ YYDEBUG(1280, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy1313;
+ if(yych <= 'S') goto yy139;
+ goto yy1281;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 't') goto yy1313;
- if(yych <= 'z') goto yy135;
+ if(yych <= 't') goto yy1281;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1313:
- YYDEBUG(1313, *YYCURSOR);
+yy1281:
+ YYDEBUG(1281, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= 'g'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'h') goto yy376;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'h') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1314:
- YYDEBUG(1314, *YYCURSOR);
+yy1282:
+ YYDEBUG(1282, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy1312;
+ if(yych <= 'M') goto yy138;
+ goto yy1280;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy1343;
- if(yych <= 'z') goto yy139;
+ if(yych == 'n') goto yy1311;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1315:
- YYDEBUG(1315, *YYCURSOR);
+yy1283:
+ YYDEBUG(1283, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'U'){
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= 'H'){
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'I') goto yy1306;
- if(yych <= 'T') goto yy134;
- goto yy1305;
+ if(yych <= 'I') goto yy1274;
+ if(yych <= 'T') goto yy138;
+ goto yy1273;
}
}
} else {
if(yych <= 'h'){
if(yych <= '^'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- goto yy139;
+ goto yy143;
}
} else {
if(yych <= 't'){
- if(yych <= 'i') goto yy1337;
- goto yy139;
+ if(yych <= 'i') goto yy1305;
+ goto yy143;
} else {
- if(yych <= 'u') goto yy1336;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'u') goto yy1304;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy1316:
- YYDEBUG(1316, *YYCURSOR);
+yy1284:
+ YYDEBUG(1284, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'M'){
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= 'C'){
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'D') goto yy1294;
- if(yych <= 'L') goto yy134;
- goto yy1295;
+ if(yych <= 'D') goto yy1262;
+ if(yych <= 'L') goto yy138;
+ goto yy1263;
}
}
} else {
if(yych <= 'c'){
if(yych <= '^'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- goto yy139;
+ goto yy143;
}
} else {
if(yych <= 'l'){
- if(yych <= 'd') goto yy1327;
- goto yy139;
+ if(yych <= 'd') goto yy1295;
+ goto yy143;
} else {
- if(yych <= 'm') goto yy1328;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'm') goto yy1296;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy1317:
- YYDEBUG(1317, *YYCURSOR);
+yy1285:
+ YYDEBUG(1285, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy1290;
+ if(yych <= 'D') goto yy138;
+ goto yy1258;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy1323;
- if(yych <= 'z') goto yy139;
+ if(yych == 'e') goto yy1291;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1318:
- YYDEBUG(1318, *YYCURSOR);
+yy1286:
+ YYDEBUG(1286, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy1286;
+ if(yych <= 'D') goto yy138;
+ goto yy1254;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy1319;
- if(yych <= 'z') goto yy139;
+ if(yych == 'e') goto yy1287;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1319:
- YYDEBUG(1319, *YYCURSOR);
+yy1287:
+ YYDEBUG(1287, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'L'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'K') goto yy135;
- goto yy1287;
+ if(yych <= 'K') goto yy139;
+ goto yy1255;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'l') goto yy1320;
- if(yych <= 'z') goto yy144;
+ if(yych == 'l') goto yy1288;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1320:
- YYDEBUG(1320, *YYCURSOR);
+yy1288:
+ YYDEBUG(1288, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'F'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'E') goto yy136;
- goto yy1288;
+ if(yych <= 'E') goto yy140;
+ goto yy1256;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'f') goto yy1321;
- if(yych <= 'z') goto yy145;
+ if(yych == 'f') goto yy1289;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1321:
- YYDEBUG(1321, *YYCURSOR);
+yy1289:
+ YYDEBUG(1289, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy137;
- goto yy1289;
+ if(yych <= 'S') goto yy141;
+ goto yy1257;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy1322;
- if(yych <= 'z') goto yy146;
+ if(yych == 't') goto yy1290;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1322:
- YYDEBUG(1322, *YYCURSOR);
+yy1290:
+ YYDEBUG(1290, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'G') goto yy3;
- goto yy163;
+ goto yy167;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy245;
- if(yych <= 'z') goto yy147;
+ if(yych == 'h') goto yy254;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1323:
- YYDEBUG(1323, *YYCURSOR);
+yy1291:
+ YYDEBUG(1291, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'R') goto yy135;
- goto yy1291;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'R') goto yy139;
+ goto yy1259;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 's') goto yy1324;
- if(yych <= 'z') goto yy144;
- goto yy405;
+ if(yych == 's') goto yy1292;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy1324:
- YYDEBUG(1324, *YYCURSOR);
+yy1292:
+ YYDEBUG(1292, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy136;
- goto yy1292;
+ if(yych <= 'C') goto yy140;
+ goto yy1260;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy1325;
- if(yych <= 'z') goto yy145;
+ if(yych == 'd') goto yy1293;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1325:
- YYDEBUG(1325, *YYCURSOR);
+yy1293:
+ YYDEBUG(1293, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy1293;
+ goto yy1261;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy1326;
- if(yych <= 'z') goto yy146;
+ if(yych <= 'a') goto yy1294;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1326:
- YYDEBUG(1326, *YYCURSOR);
+yy1294:
+ YYDEBUG(1294, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'X') goto yy3;
- goto yy411;
+ goto yy289;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy419;
- if(yych <= 'z') goto yy147;
+ if(yych == 'y') goto yy302;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1327:
- YYDEBUG(1327, *YYCURSOR);
+yy1295:
+ YYDEBUG(1295, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy1302;
+ goto yy1270;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy1334;
- if(yych <= 'z') goto yy144;
+ if(yych <= 'a') goto yy1302;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1328:
- YYDEBUG(1328, *YYCURSOR);
+yy1296:
+ YYDEBUG(1296, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'O'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy135;
- goto yy1296;
+ if(yych <= 'N') goto yy139;
+ goto yy1264;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'o') goto yy1329;
- if(yych <= 'z') goto yy144;
+ if(yych == 'o') goto yy1297;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1329:
- YYDEBUG(1329, *YYCURSOR);
+yy1297:
+ YYDEBUG(1297, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy136;
- goto yy1297;
+ if(yych <= 'Q') goto yy140;
+ goto yy1265;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy1330;
- if(yych <= 'z') goto yy145;
+ if(yych == 'r') goto yy1298;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1330:
- YYDEBUG(1330, *YYCURSOR);
+yy1298:
+ YYDEBUG(1298, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy137;
- goto yy1298;
+ if(yych <= 'Q') goto yy141;
+ goto yy1266;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy1331;
- if(yych <= 'z') goto yy146;
+ if(yych == 'r') goto yy1299;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1331:
- YYDEBUG(1331, *YYCURSOR);
+yy1299:
+ YYDEBUG(1299, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'O'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'N') goto yy3;
- goto yy1299;
+ goto yy1267;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'o') goto yy1332;
- if(yych <= 'z') goto yy147;
+ if(yych == 'o') goto yy1300;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1332:
- YYDEBUG(1332, *YYCURSOR);
+yy1300:
+ YYDEBUG(1300, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'W') goto yy1300;
- if(yych != 'w') goto yy148;
- goto yy1333;
-yy1333:
- YYDEBUG(1333, *YYCURSOR);
- yyaccept = 22;
+ if(yych == 'W') goto yy1268;
+ if(yych != 'w') goto yy152;
+ goto yy1301;
+yy1301:
+ YYDEBUG(1301, *YYCURSOR);
+ yyaccept = 25;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '^'){
- if(yych == '/') goto yy140;
- goto yy1301;
+ if(yych == '/') goto yy144;
+ goto yy1269;
} else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy1301;
- if(yych <= 'z') goto yy147;
- goto yy1301;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy1269;
+ if(yych <= 'z') goto yy151;
+ goto yy1269;
}
-yy1334:
- YYDEBUG(1334, *YYCURSOR);
+yy1302:
+ YYDEBUG(1302, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy136;
- goto yy1303;
+ if(yych <= 'X') goto yy140;
+ goto yy1271;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy1335;
- if(yych <= 'z') goto yy145;
+ if(yych == 'y') goto yy1303;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1335:
- YYDEBUG(1335, *YYCURSOR);
- yyaccept = 23;
+yy1303:
+ YYDEBUG(1303, *YYCURSOR);
+ yyaccept = 26;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy1304;
- goto yy132;
+ if(yych <= '(') goto yy1272;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
- goto yy1304;
+ if(yych == '/') goto yy144;
+ goto yy1272;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy137;
- if(yych <= '^') goto yy1304;
- goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych <= '^') goto yy1272;
+ goto yy144;
} else {
- if(yych <= '`') goto yy1304;
- if(yych <= 'z') goto yy146;
- goto yy1304;
+ if(yych <= '`') goto yy1272;
+ if(yych <= 'z') goto yy150;
+ goto yy1272;
}
}
-yy1336:
- YYDEBUG(1336, *YYCURSOR);
+yy1304:
+ YYDEBUG(1304, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'Q') goto yy135;
- goto yy1308;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'Q') goto yy139;
+ goto yy1276;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 'r') goto yy1339;
- if(yych <= 'z') goto yy144;
- goto yy405;
+ if(yych == 'r') goto yy1307;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy1337:
- YYDEBUG(1337, *YYCURSOR);
+yy1305:
+ YYDEBUG(1305, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy135;
- if(yych <= 'R') goto yy1307;
- goto yy321;
+ if(yych <= 'Q') goto yy139;
+ if(yych <= 'R') goto yy1275;
+ goto yy257;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy144;
- goto yy1338;
+ if(yych <= 'q') goto yy148;
+ goto yy1306;
} else {
- if(yych <= 's') goto yy345;
- if(yych <= 'z') goto yy144;
+ if(yych <= 's') goto yy260;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
}
-yy1338:
- YYDEBUG(1338, *YYCURSOR);
+yy1306:
+ YYDEBUG(1306, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy136;
- goto yy376;
+ if(yych <= 'C') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 'd') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1339:
- YYDEBUG(1339, *YYCURSOR);
+yy1307:
+ YYDEBUG(1307, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy136;
- goto yy1309;
+ if(yych <= 'R') goto yy140;
+ goto yy1277;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 's') goto yy1340;
- if(yych <= 'z') goto yy145;
+ if(yych == 's') goto yy1308;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1340:
- YYDEBUG(1340, *YYCURSOR);
+yy1308:
+ YYDEBUG(1308, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy137;
- goto yy1310;
+ if(yych <= 'C') goto yy141;
+ goto yy1278;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy1341;
- if(yych <= 'z') goto yy146;
+ if(yych == 'd') goto yy1309;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1341:
- YYDEBUG(1341, *YYCURSOR);
+yy1309:
+ YYDEBUG(1309, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy1311;
+ goto yy1279;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych <= 'a') goto yy1342;
- if(yych <= 'z') goto yy147;
+ if(yych <= 'a') goto yy1310;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1342:
- YYDEBUG(1342, *YYCURSOR);
+yy1310:
+ YYDEBUG(1310, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy411;
- if(yych == 'y') goto yy419;
- goto yy148;
-yy1343:
- YYDEBUG(1343, *YYCURSOR);
+ if(yych == 'Y') goto yy289;
+ if(yych == 'y') goto yy302;
+ goto yy152;
+yy1311:
+ YYDEBUG(1311, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy1313;
+ if(yych <= 'S') goto yy139;
+ goto yy1281;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy1344;
- if(yych <= 'z') goto yy144;
+ if(yych == 't') goto yy1312;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1344:
- YYDEBUG(1344, *YYCURSOR);
+yy1312:
+ YYDEBUG(1312, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 'h') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1345:
- YYDEBUG(1345, *YYCURSOR);
+yy1313:
+ YYDEBUG(1313, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'R') goto yy1357;
- if(yych <= 'X') goto yy134;
- goto yy1358;
+ if(yych == 'R') goto yy1325;
+ if(yych <= 'X') goto yy138;
+ goto yy1326;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- if(yych <= 'q') goto yy134;
- goto yy1357;
+ if(yych <= 'q') goto yy138;
+ goto yy1325;
} else {
- if(yych == 'y') goto yy1358;
- if(yych <= 'z') goto yy134;
+ if(yych == 'y') goto yy1326;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1346:
- YYDEBUG(1346, *YYCURSOR);
+yy1314:
+ YYDEBUG(1314, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy134;
- goto yy1351;
+ if(yych <= 'C') goto yy138;
+ goto yy1319;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'd') goto yy1351;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'd') goto yy1319;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1347:
- YYDEBUG(1347, *YYCURSOR);
+yy1315:
+ YYDEBUG(1315, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy1348;
+ if(yych <= 'M') goto yy138;
+ goto yy1316;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'n') goto yy1348;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'n') goto yy1316;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1348:
- YYDEBUG(1348, *YYCURSOR);
+yy1316:
+ YYDEBUG(1316, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
- if(yych <= '(') goto yy405;
- goto yy132;
+ if(yych <= '(') goto yy283;
+ goto yy136;
} else {
- if(yych <= '@') goto yy405;
- if(yych <= 'C') goto yy135;
- goto yy1349;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'C') goto yy139;
+ goto yy1317;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy405;
- goto yy135;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy283;
+ goto yy139;
} else {
- if(yych <= 'd') goto yy1349;
- if(yych <= 'z') goto yy135;
- goto yy405;
+ if(yych <= 'd') goto yy1317;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy1349:
- YYDEBUG(1349, *YYCURSOR);
+yy1317:
+ YYDEBUG(1317, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy1350;
+ goto yy1318;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
goto yy3;
} else {
- if(yych <= 'a') goto yy1350;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'a') goto yy1318;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1350:
- YYDEBUG(1350, *YYCURSOR);
+yy1318:
+ YYDEBUG(1318, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy137;
- goto yy546;
+ if(yych <= 'X') goto yy141;
+ goto yy510;
}
} else {
if(yych <= 'x'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'y') goto yy546;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'y') goto yy510;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1351:
- YYDEBUG(1351, *YYCURSOR);
+yy1319:
+ YYDEBUG(1319, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy135;
- goto yy1352;
+ if(yych <= 'M') goto yy139;
+ goto yy1320;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'n') goto yy1352;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'n') goto yy1320;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1352:
- YYDEBUG(1352, *YYCURSOR);
+yy1320:
+ YYDEBUG(1320, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'I'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'H') goto yy136;
- goto yy1353;
+ if(yych <= 'H') goto yy140;
+ goto yy1321;
}
} else {
if(yych <= 'h'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'i') goto yy1353;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'i') goto yy1321;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1353:
- YYDEBUG(1353, *YYCURSOR);
+yy1321:
+ YYDEBUG(1321, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'G'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'F') goto yy137;
- goto yy1354;
+ if(yych <= 'F') goto yy141;
+ goto yy1322;
}
} else {
if(yych <= 'f'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'g') goto yy1354;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'g') goto yy1322;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1354:
- YYDEBUG(1354, *YYCURSOR);
+yy1322:
+ YYDEBUG(1322, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'G'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'H') goto yy1355;
+ if(yych <= 'H') goto yy1323;
if(yych != 'h') goto yy3;
- goto yy1355;
+ goto yy1323;
}
-yy1355:
- YYDEBUG(1355, *YYCURSOR);
+yy1323:
+ YYDEBUG(1323, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy1356;
+ if(yych == 'T') goto yy1324;
if(yych != 't') goto yy53;
- goto yy1356;
-yy1356:
- YYDEBUG(1356, *YYCURSOR);
+ goto yy1324;
+yy1324:
+ YYDEBUG(1324, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy1304;
-yy1357:
- YYDEBUG(1357, *YYCURSOR);
- yyaccept = 0;
+ goto yy1272;
+yy1325:
+ YYDEBUG(1325, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych == 'C') goto yy1359;
- goto yy135;
+ if(yych == 'C') goto yy1327;
+ goto yy139;
}
} else {
if(yych <= 'b'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'c') goto yy1359;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'c') goto yy1327;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy1358:
- YYDEBUG(1358, *YYCURSOR);
- yyaccept = 0;
+yy1326:
+ YYDEBUG(1326, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '-'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
- if(yych <= 0x1F) goto yy3;
- goto yy423;
+ if(yych == 0x09) goto yy312;
+ if(yych <= 0x1F) goto yy310;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych == ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
}
} else {
if(yych <= '@'){
- if(yych == '/') goto yy3;
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych == '/') goto yy310;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
-yy1359:
- YYDEBUG(1359, *YYCURSOR);
+yy1327:
+ YYDEBUG(1327, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy604;
+ if(yych <= 'G') goto yy140;
+ goto yy568;
}
} else {
if(yych <= 'g'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'h') goto yy604;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'h') goto yy568;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1360:
- YYDEBUG(1360, *YYCURSOR);
+yy1328:
+ YYDEBUG(1328, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= 'Q'){
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'R') goto yy1357;
- if(yych <= 'X') goto yy134;
- goto yy1358;
+ if(yych <= 'R') goto yy1325;
+ if(yych <= 'X') goto yy138;
+ goto yy1326;
}
}
} else {
if(yych <= 'q'){
if(yych <= '^'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- goto yy139;
+ goto yy143;
}
} else {
if(yych <= 'x'){
- if(yych <= 'r') goto yy1372;
- goto yy139;
+ if(yych <= 'r') goto yy1340;
+ goto yy143;
} else {
- if(yych <= 'y') goto yy1373;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'y') goto yy1341;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy1361:
- YYDEBUG(1361, *YYCURSOR);
+yy1329:
+ YYDEBUG(1329, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy134;
- goto yy1351;
+ if(yych <= 'C') goto yy138;
+ goto yy1319;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy1366;
- if(yych <= 'z') goto yy139;
+ if(yych == 'd') goto yy1334;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1362:
- YYDEBUG(1362, *YYCURSOR);
+yy1330:
+ YYDEBUG(1330, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy1348;
+ if(yych <= 'M') goto yy138;
+ goto yy1316;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy1363;
- if(yych <= 'z') goto yy139;
+ if(yych == 'n') goto yy1331;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1363:
- YYDEBUG(1363, *YYCURSOR);
+yy1331:
+ YYDEBUG(1331, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'C') goto yy135;
- goto yy1349;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'C') goto yy139;
+ goto yy1317;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 'd') goto yy1364;
- if(yych <= 'z') goto yy144;
- goto yy405;
+ if(yych == 'd') goto yy1332;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy1364:
- YYDEBUG(1364, *YYCURSOR);
+yy1332:
+ YYDEBUG(1332, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy1350;
+ goto yy1318;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy1365;
- if(yych <= 'z') goto yy145;
+ if(yych <= 'a') goto yy1333;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1365:
- YYDEBUG(1365, *YYCURSOR);
+yy1333:
+ YYDEBUG(1333, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy137;
- goto yy546;
+ if(yych <= 'X') goto yy141;
+ goto yy510;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy575;
- if(yych <= 'z') goto yy146;
+ if(yych == 'y') goto yy539;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1366:
- YYDEBUG(1366, *YYCURSOR);
+yy1334:
+ YYDEBUG(1334, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy135;
- goto yy1352;
+ if(yych <= 'M') goto yy139;
+ goto yy1320;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy1367;
- if(yych <= 'z') goto yy144;
+ if(yych == 'n') goto yy1335;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1367:
- YYDEBUG(1367, *YYCURSOR);
+yy1335:
+ YYDEBUG(1335, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'I'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'H') goto yy136;
- goto yy1353;
+ if(yych <= 'H') goto yy140;
+ goto yy1321;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'i') goto yy1368;
- if(yych <= 'z') goto yy145;
+ if(yych == 'i') goto yy1336;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1368:
- YYDEBUG(1368, *YYCURSOR);
+yy1336:
+ YYDEBUG(1336, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'G'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'F') goto yy137;
- goto yy1354;
+ if(yych <= 'F') goto yy141;
+ goto yy1322;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'g') goto yy1369;
- if(yych <= 'z') goto yy146;
+ if(yych == 'g') goto yy1337;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1369:
- YYDEBUG(1369, *YYCURSOR);
+yy1337:
+ YYDEBUG(1337, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'G') goto yy3;
- goto yy1355;
+ goto yy1323;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy1370;
- if(yych <= 'z') goto yy147;
+ if(yych == 'h') goto yy1338;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1370:
- YYDEBUG(1370, *YYCURSOR);
+yy1338:
+ YYDEBUG(1338, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy1356;
- if(yych != 't') goto yy148;
- goto yy1371;
-yy1371:
- YYDEBUG(1371, *YYCURSOR);
- yyaccept = 23;
+ if(yych == 'T') goto yy1324;
+ if(yych != 't') goto yy152;
+ goto yy1339;
+yy1339:
+ YYDEBUG(1339, *YYCURSOR);
+ yyaccept = 26;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '^'){
- if(yych == '/') goto yy140;
- goto yy1304;
+ if(yych == '/') goto yy144;
+ goto yy1272;
} else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy1304;
- if(yych <= 'z') goto yy147;
- goto yy1304;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy1272;
+ if(yych <= 'z') goto yy151;
+ goto yy1272;
}
-yy1372:
- YYDEBUG(1372, *YYCURSOR);
- yyaccept = 0;
+yy1340:
+ YYDEBUG(1340, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'B'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'C') goto yy1359;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'C') goto yy1327;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'b'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'c') goto yy1374;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'c') goto yy1342;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy1373:
- YYDEBUG(1373, *YYCURSOR);
- yyaccept = 0;
+yy1341:
+ YYDEBUG(1341, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
- if(yych <= 0x1F) goto yy3;
- goto yy423;
+ if(yych == 0x09) goto yy312;
+ if(yych <= 0x1F) goto yy310;
+ goto yy312;
} else {
if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
+ if(yych <= '(') goto yy310;
+ goto yy136;
} else {
- if(yych <= ',') goto yy3;
- if(yych <= '-') goto yy424;
- goto yy423;
+ if(yych <= ',') goto yy310;
+ if(yych <= '-') goto yy313;
+ goto yy312;
}
}
} else {
if(yych <= 'Z'){
- if(yych <= '/') goto yy140;
- if(yych <= '9') goto yy423;
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '/') goto yy144;
+ if(yych <= '9') goto yy312;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
if(yych <= '_'){
- if(yych <= '^') goto yy3;
- goto yy140;
+ if(yych <= '^') goto yy310;
+ goto yy144;
} else {
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy1374:
- YYDEBUG(1374, *YYCURSOR);
+yy1342:
+ YYDEBUG(1342, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy604;
+ if(yych <= 'G') goto yy140;
+ goto yy568;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy615;
- if(yych <= 'z') goto yy145;
+ if(yych == 'h') goto yy579;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1375:
- YYDEBUG(1375, *YYCURSOR);
+yy1343:
+ YYDEBUG(1343, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'W'){
if(yych <= 'N'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'O') goto yy1383;
- if(yych <= 'U') goto yy134;
- if(yych <= 'V') goto yy1384;
- goto yy1381;
+ if(yych <= 'O') goto yy1351;
+ if(yych <= 'U') goto yy138;
+ if(yych <= 'V') goto yy1352;
+ goto yy1349;
}
} else {
if(yych <= 'o'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- if(yych <= 'n') goto yy134;
- goto yy1383;
+ if(yych <= 'n') goto yy138;
+ goto yy1351;
} else {
if(yych <= 'v'){
- if(yych <= 'u') goto yy134;
- goto yy1384;
+ if(yych <= 'u') goto yy138;
+ goto yy1352;
} else {
- if(yych <= 'w') goto yy1381;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'w') goto yy1349;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
}
-yy1376:
- YYDEBUG(1376, *YYCURSOR);
+yy1344:
+ YYDEBUG(1344, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'X'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'W') goto yy134;
- goto yy1380;
+ if(yych <= 'W') goto yy138;
+ goto yy1348;
}
} else {
if(yych <= 'w'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'x') goto yy1380;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'x') goto yy1348;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1377:
- YYDEBUG(1377, *YYCURSOR);
+yy1345:
+ YYDEBUG(1345, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy1378;
+ if(yych <= 'M') goto yy138;
+ goto yy1346;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'n') goto yy1378;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'n') goto yy1346;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1378:
- YYDEBUG(1378, *YYCURSOR);
+yy1346:
+ YYDEBUG(1346, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy1379;
+ if(yych <= 'S') goto yy139;
+ goto yy1347;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 't') goto yy1379;
- if(yych <= 'z') goto yy135;
+ if(yych <= 't') goto yy1347;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1379:
- YYDEBUG(1379, *YYCURSOR);
+yy1347:
+ YYDEBUG(1347, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= 'g'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'h') goto yy376;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'h') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1380:
- YYDEBUG(1380, *YYCURSOR);
+yy1348:
+ YYDEBUG(1348, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy321;
+ if(yych <= 'S') goto yy139;
+ goto yy257;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 't') goto yy321;
- if(yych <= 'z') goto yy135;
+ if(yych <= 't') goto yy257;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1381:
- YYDEBUG(1381, *YYCURSOR);
+yy1349:
+ YYDEBUG(1349, *YYCURSOR);
++YYCURSOR;
if((yych = *YYCURSOR) <= '@'){
- if(yych == ')') goto yy132;
- goto yy1382;
+ if(yych == ')') goto yy136;
+ goto yy1350;
} else {
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy1382;
- if(yych <= 'z') goto yy135;
- goto yy1382;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy1350;
+ if(yych <= 'z') goto yy139;
+ goto yy1350;
}
-yy1382:
- YYDEBUG(1382, *YYCURSOR);
+yy1350:
+ YYDEBUG(1350, *YYCURSOR);
{
DEBUG_OUTPUT("now");
@@ -21704,150 +21234,150 @@ yy1382:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-yy1383:
- YYDEBUG(1383, *YYCURSOR);
+yy1351:
+ YYDEBUG(1351, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy135;
- goto yy1389;
+ if(yych <= 'M') goto yy139;
+ goto yy1357;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'n') goto yy1389;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'n') goto yy1357;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1384:
- YYDEBUG(1384, *YYCURSOR);
- yyaccept = 0;
+yy1352:
+ YYDEBUG(1352, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'E') goto yy135;
- goto yy1385;
+ if(yych != 'E') goto yy139;
+ goto yy1353;
}
} else {
if(yych <= 'd'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'e') goto yy1385;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'e') goto yy1353;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy1385:
- YYDEBUG(1385, *YYCURSOR);
+yy1353:
+ YYDEBUG(1353, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'M'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'L') goto yy136;
- goto yy1386;
+ if(yych <= 'L') goto yy140;
+ goto yy1354;
}
} else {
if(yych <= 'l'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'm') goto yy1386;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'm') goto yy1354;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1386:
- YYDEBUG(1386, *YYCURSOR);
+yy1354:
+ YYDEBUG(1354, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'B'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy137;
- goto yy1387;
+ if(yych <= 'A') goto yy141;
+ goto yy1355;
}
} else {
if(yych <= 'a'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'b') goto yy1387;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'b') goto yy1355;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1387:
- YYDEBUG(1387, *YYCURSOR);
+yy1355:
+ YYDEBUG(1355, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'E') goto yy1388;
+ if(yych <= 'E') goto yy1356;
if(yych != 'e') goto yy3;
- goto yy1388;
+ goto yy1356;
}
-yy1388:
- YYDEBUG(1388, *YYCURSOR);
+yy1356:
+ YYDEBUG(1356, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy422;
- if(yych == 'r') goto yy422;
+ if(yych == 'R') goto yy322;
+ if(yych == 'r') goto yy322;
goto yy53;
-yy1389:
- YYDEBUG(1389, *YYCURSOR);
+yy1357:
+ YYDEBUG(1357, *YYCURSOR);
++YYCURSOR;
if((yych = *YYCURSOR) <= '@'){
- if(yych == ')') goto yy132;
- goto yy1390;
+ if(yych == ')') goto yy136;
+ goto yy1358;
} else {
- if(yych <= 'Z') goto yy136;
- if(yych <= '`') goto yy1390;
- if(yych <= 'z') goto yy136;
- goto yy1390;
+ if(yych <= 'Z') goto yy140;
+ if(yych <= '`') goto yy1358;
+ if(yych <= 'z') goto yy140;
+ goto yy1358;
}
-yy1390:
- YYDEBUG(1390, *YYCURSOR);
+yy1358:
+ YYDEBUG(1358, *YYCURSOR);
{
DEBUG_OUTPUT("noon");
@@ -21859,509 +21389,493 @@ yy1390:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-yy1391:
- YYDEBUG(1391, *YYCURSOR);
+yy1359:
+ YYDEBUG(1359, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'W'){
if(yych <= '@'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
+ if(yych == '/') goto yy144;
goto yy3;
}
} else {
if(yych <= 'O'){
- if(yych <= 'N') goto yy134;
- goto yy1383;
+ if(yych <= 'N') goto yy138;
+ goto yy1351;
} else {
- if(yych <= 'U') goto yy134;
- if(yych <= 'V') goto yy1384;
- goto yy1381;
+ if(yych <= 'U') goto yy138;
+ if(yych <= 'V') goto yy1352;
+ goto yy1349;
}
}
} else {
if(yych <= 'n'){
if(yych <= '^'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- goto yy139;
+ goto yy143;
}
} else {
if(yych <= 'v'){
- if(yych <= 'o') goto yy1398;
- if(yych <= 'u') goto yy139;
- goto yy1399;
+ if(yych <= 'o') goto yy1366;
+ if(yych <= 'u') goto yy143;
+ goto yy1367;
} else {
- if(yych <= 'w') goto yy1397;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'w') goto yy1365;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy1392:
- YYDEBUG(1392, *YYCURSOR);
+yy1360:
+ YYDEBUG(1360, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'X'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'W') goto yy134;
- goto yy1380;
+ if(yych <= 'W') goto yy138;
+ goto yy1348;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'x') goto yy1396;
- if(yych <= 'z') goto yy139;
+ if(yych == 'x') goto yy1364;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1393:
- YYDEBUG(1393, *YYCURSOR);
+yy1361:
+ YYDEBUG(1361, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy1378;
+ if(yych <= 'M') goto yy138;
+ goto yy1346;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy1394;
- if(yych <= 'z') goto yy139;
+ if(yych == 'n') goto yy1362;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1394:
- YYDEBUG(1394, *YYCURSOR);
+yy1362:
+ YYDEBUG(1362, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy1379;
+ if(yych <= 'S') goto yy139;
+ goto yy1347;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy1395;
- if(yych <= 'z') goto yy144;
+ if(yych == 't') goto yy1363;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1395:
- YYDEBUG(1395, *YYCURSOR);
+yy1363:
+ YYDEBUG(1363, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 'h') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1396:
- YYDEBUG(1396, *YYCURSOR);
+yy1364:
+ YYDEBUG(1364, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy321;
+ if(yych <= 'S') goto yy139;
+ goto yy257;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy345;
- if(yych <= 'z') goto yy144;
+ if(yych == 't') goto yy260;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1397:
- YYDEBUG(1397, *YYCURSOR);
- yyaccept = 24;
+yy1365:
+ YYDEBUG(1365, *YYCURSOR);
+ yyaccept = 27;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy1382;
- goto yy132;
+ if(yych <= '(') goto yy1350;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
- goto yy1382;
+ if(yych == '/') goto yy144;
+ goto yy1350;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '^') goto yy1382;
- goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '^') goto yy1350;
+ goto yy144;
} else {
- if(yych <= '`') goto yy1382;
- if(yych <= 'z') goto yy144;
- goto yy1382;
+ if(yych <= '`') goto yy1350;
+ if(yych <= 'z') goto yy148;
+ goto yy1350;
}
}
-yy1398:
- YYDEBUG(1398, *YYCURSOR);
+yy1366:
+ YYDEBUG(1366, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy135;
- goto yy1389;
+ if(yych <= 'M') goto yy139;
+ goto yy1357;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy1404;
- if(yych <= 'z') goto yy144;
+ if(yych == 'n') goto yy1372;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1399:
- YYDEBUG(1399, *YYCURSOR);
- yyaccept = 0;
+yy1367:
+ YYDEBUG(1367, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'D'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'E') goto yy1385;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'E') goto yy1353;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'd'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'e') goto yy1400;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'e') goto yy1368;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy1400:
- YYDEBUG(1400, *YYCURSOR);
+yy1368:
+ YYDEBUG(1368, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'M'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'L') goto yy136;
- goto yy1386;
+ if(yych <= 'L') goto yy140;
+ goto yy1354;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'm') goto yy1401;
- if(yych <= 'z') goto yy145;
+ if(yych == 'm') goto yy1369;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1401:
- YYDEBUG(1401, *YYCURSOR);
+yy1369:
+ YYDEBUG(1369, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'B'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy137;
- goto yy1387;
+ if(yych <= 'A') goto yy141;
+ goto yy1355;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'b') goto yy1402;
- if(yych <= 'z') goto yy146;
+ if(yych == 'b') goto yy1370;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1402:
- YYDEBUG(1402, *YYCURSOR);
+yy1370:
+ YYDEBUG(1370, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'D') goto yy3;
- goto yy1388;
+ goto yy1356;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy1403;
- if(yych <= 'z') goto yy147;
+ if(yych == 'e') goto yy1371;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1403:
- YYDEBUG(1403, *YYCURSOR);
+yy1371:
+ YYDEBUG(1371, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy53;
- goto yy140;
- } else {
- if(yych == 'R') goto yy422;
- goto yy53;
- }
- } else {
- if(yych <= 'q'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy53;
- goto yy147;
- } else {
- if(yych <= 'r') goto yy528;
- if(yych <= 'z') goto yy147;
- goto yy53;
- }
- }
-yy1404:
- YYDEBUG(1404, *YYCURSOR);
- yyaccept = 25;
+ if(yych == 'R') goto yy322;
+ if(yych == 'r') goto yy492;
+ goto yy152;
+yy1372:
+ YYDEBUG(1372, *YYCURSOR);
+ yyaccept = 28;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy1390;
- goto yy132;
+ if(yych <= '(') goto yy1358;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
- goto yy1390;
+ if(yych == '/') goto yy144;
+ goto yy1358;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy136;
- if(yych <= '^') goto yy1390;
- goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych <= '^') goto yy1358;
+ goto yy144;
} else {
- if(yych <= '`') goto yy1390;
- if(yych <= 'z') goto yy145;
- goto yy1390;
+ if(yych <= '`') goto yy1358;
+ if(yych <= 'z') goto yy149;
+ goto yy1358;
}
}
-yy1405:
- YYDEBUG(1405, *YYCURSOR);
+yy1373:
+ YYDEBUG(1373, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy134;
- goto yy1406;
+ if(yych <= 'R') goto yy138;
+ goto yy1374;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 's') goto yy1406;
- if(yych <= 'z') goto yy134;
+ if(yych <= 's') goto yy1374;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1406:
- YYDEBUG(1406, *YYCURSOR);
+yy1374:
+ YYDEBUG(1374, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy1407;
+ if(yych <= 'S') goto yy139;
+ goto yy1375;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 't') goto yy1407;
- if(yych <= 'z') goto yy135;
+ if(yych <= 't') goto yy1375;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1407:
- YYDEBUG(1407, *YYCURSOR);
+yy1375:
+ YYDEBUG(1375, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy136;
- goto yy1408;
+ if(yych <= 'D') goto yy140;
+ goto yy1376;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'e') goto yy1408;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'e') goto yy1376;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1408:
- YYDEBUG(1408, *YYCURSOR);
+yy1376:
+ YYDEBUG(1376, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy137;
- goto yy1409;
+ if(yych <= 'Q') goto yy141;
+ goto yy1377;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'r') goto yy1409;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'r') goto yy1377;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1409:
- YYDEBUG(1409, *YYCURSOR);
+yy1377:
+ YYDEBUG(1377, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'C'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'D') goto yy1410;
+ if(yych <= 'D') goto yy1378;
if(yych != 'd') goto yy3;
- goto yy1410;
+ goto yy1378;
}
-yy1410:
- YYDEBUG(1410, *YYCURSOR);
+yy1378:
+ YYDEBUG(1378, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy1411;
+ if(yych == 'A') goto yy1379;
if(yych != 'a') goto yy53;
- goto yy1411;
-yy1411:
- YYDEBUG(1411, *YYCURSOR);
+ goto yy1379;
+yy1379:
+ YYDEBUG(1379, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy1412;
+ if(yych == 'Y') goto yy1380;
if(yych != 'y') goto yy53;
- goto yy1412;
-yy1412:
- YYDEBUG(1412, *YYCURSOR);
+ goto yy1380;
+yy1380:
+ YYDEBUG(1380, *YYCURSOR);
++YYCURSOR;
- goto yy1413;
-yy1413:
- YYDEBUG(1413, *YYCURSOR);
+ goto yy1381;
+yy1381:
+ YYDEBUG(1381, *YYCURSOR);
{
DEBUG_OUTPUT("yesterday");
@@ -22373,153 +21887,153 @@ yy1413:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-yy1414:
- YYDEBUG(1414, *YYCURSOR);
+yy1382:
+ YYDEBUG(1382, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy134;
- goto yy1406;
+ if(yych <= 'R') goto yy138;
+ goto yy1374;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 's') goto yy1415;
- if(yych <= 'z') goto yy139;
+ if(yych == 's') goto yy1383;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1415:
- YYDEBUG(1415, *YYCURSOR);
+yy1383:
+ YYDEBUG(1383, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy1407;
+ if(yych <= 'S') goto yy139;
+ goto yy1375;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy1416;
- if(yych <= 'z') goto yy144;
+ if(yych == 't') goto yy1384;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1416:
- YYDEBUG(1416, *YYCURSOR);
+yy1384:
+ YYDEBUG(1384, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy136;
- goto yy1408;
+ if(yych <= 'D') goto yy140;
+ goto yy1376;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy1417;
- if(yych <= 'z') goto yy145;
+ if(yych == 'e') goto yy1385;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1417:
- YYDEBUG(1417, *YYCURSOR);
+yy1385:
+ YYDEBUG(1385, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy137;
- goto yy1409;
+ if(yych <= 'Q') goto yy141;
+ goto yy1377;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy1418;
- if(yych <= 'z') goto yy146;
+ if(yych == 'r') goto yy1386;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1418:
- YYDEBUG(1418, *YYCURSOR);
+yy1386:
+ YYDEBUG(1386, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'C') goto yy3;
- goto yy1410;
+ goto yy1378;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy1419;
- if(yych <= 'z') goto yy147;
+ if(yych == 'd') goto yy1387;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1419:
- YYDEBUG(1419, *YYCURSOR);
+yy1387:
+ YYDEBUG(1387, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy1411;
- if(yych != 'a') goto yy148;
- goto yy1420;
-yy1420:
- YYDEBUG(1420, *YYCURSOR);
+ if(yych == 'A') goto yy1379;
+ if(yych != 'a') goto yy152;
+ goto yy1388;
+yy1388:
+ YYDEBUG(1388, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy1412;
- if(yych != 'y') goto yy148;
- goto yy1421;
-yy1421:
- YYDEBUG(1421, *YYCURSOR);
- yyaccept = 26;
+ if(yych == 'Y') goto yy1380;
+ if(yych != 'y') goto yy152;
+ goto yy1389;
+yy1389:
+ YYDEBUG(1389, *YYCURSOR);
+ yyaccept = 29;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '^'){
- if(yych == '/') goto yy140;
- goto yy1413;
+ if(yych == '/') goto yy144;
+ goto yy1381;
} else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy1413;
- if(yych <= 'z') goto yy147;
- goto yy1413;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy1381;
+ if(yych <= 'z') goto yy151;
+ goto yy1381;
}
}
}
@@ -22529,7 +22043,7 @@ yy1421:
#define YYMAXFILL 29
-timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, timelib_tzdb *tzdb)
+timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb)
{
Scanner in;
int t;
@@ -22542,11 +22056,13 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
in.errors->error_count = 0;
in.errors->error_messages = NULL;
- while (isspace(*s) && s < e) {
- s++;
- }
- while (isspace(*e) && e > s) {
- e--;
+ if (len > 0) {
+ while (isspace(*s) && s < e) {
+ s++;
+ }
+ while (isspace(*e) && e > s) {
+ e--;
+ }
}
if (e - s < 1) {
in.time = timelib_time_ctor();
@@ -22634,7 +22150,7 @@ 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 *tp;
+ const timelib_tz_lookup_table *tp;
tp = zone_search(abbr, gmtoffset, isdst);
if (tp) {
@@ -22644,7 +22160,7 @@ char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
}
}
-timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void)
+const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void)
{
return timelib_timezone_lookup;
}
diff --git a/ext/date/lib/parse_date.c.orig b/ext/date/lib/parse_date.c.orig
index 2b4a3aead..9b5e4238e 100644
--- a/ext/date/lib/parse_date.c.orig
+++ b/ext/date/lib/parse_date.c.orig
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.12 on Tue Apr 11 20:02:18 2006 */
+/* Generated by re2c 0.9.12 on Sat Sep 9 14:19:46 2006 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: parse_date.c,v 1.29.2.30 2006/04/11 18:03:46 derick Exp $ */
+/* $Id: parse_date.c,v 1.29.2.30.2.7 2006/09/09 12:26:22 derick Exp $ */
#include "timelib.h"
@@ -51,6 +51,7 @@
#define TIMELIB_MONTH 5
#define TIMELIB_YEAR 6
#define TIMELIB_WEEKDAY 7
+#define TIMELIB_SPECIAL 8
#define EOI 257
#define TIME 258
@@ -103,8 +104,9 @@ typedef unsigned char uchar;
#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) { add_error(s, "Double date specification"); timelib_string_free(str); 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_RELATIVE() { s->time->have_relative = 1; s->time->relative.weekday_behavior = 1; }
#define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_weekday_relative = 1; }
+#define TIMELIB_HAVE_SPECIAL_RELATIVE() { s->time->have_special_relative = 1; }
#define TIMELIB_HAVE_TZ() { s->cur = cursor; if (s->time->have_zone) { add_warning(s, "Double timezone specification"); timelib_string_free(str); return TIMELIB_ERROR; } else { s->time->have_zone = 1; } }
#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
@@ -145,7 +147,7 @@ typedef struct Scanner {
struct timelib_error_container *errors;
struct timelib_time *time;
- timelib_tzdb *tzdb;
+ const timelib_tzdb *tzdb;
} Scanner;
typedef struct _timelib_lookup_table {
@@ -163,17 +165,17 @@ typedef struct _timelib_relunit {
#define HOUR(a) (int)(a * 60)
/* The timezone table. */
-static timelib_tz_lookup_table timelib_timezone_lookup[] = {
+const static timelib_tz_lookup_table timelib_timezone_lookup[] = {
#include "timezonemap.h"
{ NULL, 0, 0, NULL },
};
-static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = {
+const static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = {
#include "fallbackmap.h"
{ NULL, 0, 0, NULL },
};
-static timelib_tz_lookup_table timelib_timezone_utc[] = {
+const static timelib_tz_lookup_table timelib_timezone_utc[] = {
{ "utc", 0, 0, "UTC" },
};
@@ -216,6 +218,8 @@ static timelib_relunit const timelib_relunit_lookup[] = {
{ "sunday", TIMELIB_WEEKDAY, 0 },
{ "sun", TIMELIB_WEEKDAY, 0 },
+ { "weekday", TIMELIB_SPECIAL, TIMELIB_SPECIAL_WEEKDAY },
+ { "weekdays", TIMELIB_SPECIAL, TIMELIB_SPECIAL_WEEKDAY },
{ NULL, 0, 0 }
};
@@ -604,14 +608,20 @@ static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, S
s->time->relative.weekday = relunit->multiplier;
s->time->relative.weekday_behavior = behavior;
break;
+
+ case TIMELIB_SPECIAL:
+ TIMELIB_HAVE_SPECIAL_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+ s->time->special.type = relunit->multiplier;
+ s->time->special.amount = amount;
}
}
-static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst)
+const 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 = NULL;
- timelib_tz_lookup_table *fmp;
+ const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
+ const timelib_tz_lookup_table *fmp;
if (strcasecmp("utc", word) == 0 || strcasecmp("gmt", word) == 0) {
return timelib_timezone_utc;
@@ -650,7 +660,7 @@ 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;
+ const timelib_tz_lookup_table *tp;
while (**ptr != '\0' && **ptr != ')') {
++*ptr;
@@ -672,7 +682,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
return value;
}
-static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, timelib_tzdb *tzdb)
+static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
{
timelib_tzinfo *res;
long retval = 0;
@@ -755,7 +765,7 @@ static int scan(Scanner *s)
std:
s->tok = cursor;
s->len = 0;
-#line 865 "ext/date/lib/parse_date.re"
+#line 879 "ext/date/lib/parse_date.re"
{
@@ -794,7 +804,7 @@ std:
0, 0, 0, 0, 0, 0, 0, 0,
};
-#line 798 "ext/date/lib/parse_date.c"
+#line 808 "ext/date/lib/parse_date.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -871,28 +881,28 @@ yy2:
++YYCURSOR;
if((yych = *YYCURSOR) <= 'E'){
if(yych <= ')'){
- if(yych >= ')') goto yy132;
+ if(yych >= ')') goto yy136;
goto yy3;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy1405;
+ if(yych <= 'D') goto yy137;
+ goto yy1373;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
- if(yych >= 'a') goto yy138;
+ if(yych <= 'Z') goto yy137;
+ if(yych >= 'a') goto yy142;
goto yy3;
} else {
- if(yych <= 'e') goto yy1414;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'e') goto yy1382;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
yy3:
YYDEBUG(3, *YYCURSOR);
-#line 1369 "ext/date/lib/parse_date.re"
+#line 1408 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@@ -905,27 +915,27 @@ yy3:
TIMELIB_DEINIT;
return TIMELIB_TIMEZONE;
}
-#line 902 "ext/date/lib/parse_date.c"
+#line 912 "ext/date/lib/parse_date.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy1405;
+ if(yych <= 'D') goto yy137;
+ goto yy1373;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'e') goto yy1405;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'e') goto yy1373;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -934,35 +944,35 @@ yy5:
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= 'D'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
if(yych <= 'H'){
- if(yych <= 'E') goto yy1376;
- goto yy133;
+ if(yych <= 'E') goto yy1344;
+ goto yy137;
} else {
- if(yych <= 'I') goto yy1377;
- if(yych <= 'N') goto yy133;
- goto yy1375;
+ if(yych <= 'I') goto yy1345;
+ if(yych <= 'N') goto yy137;
+ goto yy1343;
}
}
} else {
if(yych <= 'h'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych == 'e') goto yy1392;
- goto yy138;
+ if(yych == 'e') goto yy1360;
+ goto yy142;
}
} else {
if(yych <= 'n'){
- if(yych <= 'i') goto yy1393;
- goto yy138;
+ if(yych <= 'i') goto yy1361;
+ goto yy142;
} else {
- if(yych <= 'o') goto yy1391;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'o') goto yy1359;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -972,35 +982,35 @@ yy6:
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= 'D'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
if(yych <= 'H'){
- if(yych <= 'E') goto yy1376;
- goto yy133;
+ if(yych <= 'E') goto yy1344;
+ goto yy137;
} else {
- if(yych <= 'I') goto yy1377;
- if(yych <= 'N') goto yy133;
- goto yy1375;
+ if(yych <= 'I') goto yy1345;
+ if(yych <= 'N') goto yy137;
+ goto yy1343;
}
}
} else {
if(yych <= 'h'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych == 'e') goto yy1376;
- goto yy133;
+ if(yych == 'e') goto yy1344;
+ goto yy137;
}
} else {
if(yych <= 'n'){
- if(yych <= 'i') goto yy1377;
- goto yy133;
+ if(yych <= 'i') goto yy1345;
+ goto yy137;
} else {
- if(yych <= 'o') goto yy1375;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'o') goto yy1343;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1010,27 +1020,27 @@ yy7:
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy1345;
+ goto yy1313;
} else {
- if(yych == 'I') goto yy1346;
- if(yych <= 'N') goto yy133;
- goto yy1347;
+ if(yych == 'I') goto yy1314;
+ if(yych <= 'N') goto yy137;
+ goto yy1315;
}
} else {
if(yych <= 'h'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy1360;
- goto yy138;
+ if(yych <= 'a') goto yy1328;
+ goto yy142;
} else {
if(yych <= 'n'){
- if(yych <= 'i') goto yy1361;
- goto yy138;
+ if(yych <= 'i') goto yy1329;
+ goto yy142;
} else {
- if(yych <= 'o') goto yy1362;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'o') goto yy1330;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1040,27 +1050,27 @@ yy8:
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy1345;
+ goto yy1313;
} else {
- if(yych == 'I') goto yy1346;
- if(yych <= 'N') goto yy133;
- goto yy1347;
+ if(yych == 'I') goto yy1314;
+ if(yych <= 'N') goto yy137;
+ goto yy1315;
}
} else {
if(yych <= 'h'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy1345;
- goto yy133;
+ if(yych <= 'a') goto yy1313;
+ goto yy137;
} else {
if(yych <= 'n'){
- if(yych <= 'i') goto yy1346;
- goto yy133;
+ if(yych <= 'i') goto yy1314;
+ goto yy137;
} else {
- if(yych <= 'o') goto yy1347;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'o') goto yy1315;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1071,17 +1081,17 @@ yy9:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case ')': goto yy132;
+ case ')': goto yy136;
case '0':
- case '1': goto yy1277;
- case '2': goto yy1278;
+ case '1': goto yy1245;
+ case '2': goto yy1246;
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
- case '9': goto yy1279;
+ case '9': goto yy1247;
case 'A':
case 'B':
case 'C':
@@ -1097,12 +1107,12 @@ yy9:
case 'S':
case 'T': case 'V': case 'X':
case 'Y':
- case 'Z': goto yy133;
- case 'E': goto yy1272;
- case 'H': goto yy1273;
- case 'O': goto yy1274;
- case 'U': goto yy1275;
- case 'W': goto yy1276;
+ case 'Z': goto yy137;
+ case 'E': goto yy1240;
+ case 'H': goto yy1241;
+ case 'O': goto yy1242;
+ case 'U': goto yy1243;
+ case 'W': goto yy1244;
case 'a':
case 'b':
case 'c':
@@ -1118,12 +1128,12 @@ yy9:
case 's':
case 't': case 'v': case 'x':
case 'y':
- case 'z': goto yy138;
- case 'e': goto yy1314;
- case 'h': goto yy1315;
- case 'o': goto yy1316;
- case 'u': goto yy1317;
- case 'w': goto yy1318;
+ case 'z': goto yy142;
+ case 'e': goto yy1282;
+ case 'h': goto yy1283;
+ case 'o': goto yy1284;
+ case 'u': goto yy1285;
+ case 'w': goto yy1286;
default: goto yy3;
}
yy10:
@@ -1132,17 +1142,17 @@ yy10:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case ')': goto yy132;
+ case ')': goto yy136;
case '0':
- case '1': goto yy1277;
- case '2': goto yy1278;
+ case '1': goto yy1245;
+ case '2': goto yy1246;
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
- case '9': goto yy1279;
+ case '9': goto yy1247;
case 'A':
case 'B':
case 'C':
@@ -1173,38 +1183,38 @@ yy10:
case 's':
case 't': case 'v': case 'x':
case 'y':
- case 'z': goto yy133;
- case 'E': case 'e': goto yy1272;
- case 'H': case 'h': goto yy1273;
- case 'O': case 'o': goto yy1274;
- case 'U': case 'u': goto yy1275;
- case 'W': case 'w': goto yy1276;
+ case 'z': goto yy137;
+ case 'E': case 'e': goto yy1240;
+ case 'H': case 'h': goto yy1241;
+ case 'O': case 'o': goto yy1242;
+ case 'U': case 'u': goto yy1243;
+ case 'W': case 'w': goto yy1244;
default: goto yy3;
}
yy11:
YYDEBUG(11, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '-') goto yy1268;
+ if(yych == '-') goto yy1236;
if(yych <= '/') goto yy12;
- if(yych <= '9') goto yy1269;
+ if(yych <= '9') goto yy1237;
goto yy12;
yy12:
YYDEBUG(12, *YYCURSOR);
-#line 1440 "ext/date/lib/parse_date.re"
+#line 1503 "ext/date/lib/parse_date.re"
{
add_error(s, "Unexpected character");
goto std;
}
-#line 1174 "ext/date/lib/parse_date.c"
+#line 1184 "ext/date/lib/parse_date.c"
yy13:
YYDEBUG(13, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: goto yy1230;
+ case 0x09: goto yy1198;
case ' ': case 'A': case 'D': case 'F': case 'H':
case 'I':
case 'J': case 'M':
@@ -1213,11 +1223,11 @@ yy13:
case 'T': case 'V':
case 'W':
case 'X':
- case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': case 'o': case 'w': case 'y': goto yy1232;
- case '-': goto yy695;
- case '.': goto yy1234;
- case '/': goto yy694;
- case '0': goto yy1267;
+ case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': case 'o': case 'w': case 'y': goto yy1200;
+ case '-': goto yy660;
+ case '.': goto yy1202;
+ case '/': goto yy659;
+ case '0': goto yy1235;
case '1':
case '2':
case '3':
@@ -1226,12 +1236,12 @@ yy13:
case '6':
case '7':
case '8':
- case '9': goto yy1266;
- case ':': goto yy1235;
- case 'n': goto yy692;
- case 'r': goto yy693;
- case 's': goto yy686;
- case 't': goto yy690;
+ case '9': goto yy1234;
+ case ':': goto yy1203;
+ case 'n': goto yy657;
+ case 'r': goto yy658;
+ case 's': goto yy651;
+ case 't': goto yy655;
default: goto yy12;
}
yy14:
@@ -1240,7 +1250,7 @@ yy14:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: goto yy682;
+ case 0x09: goto yy647;
case ' ': case 'A': case 'D': case 'F': case 'H':
case 'I':
case 'J': case 'M':
@@ -1251,25 +1261,25 @@ yy14:
case 'W':
case 'X':
case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': case 'o':
- case 'p': case 'w': case 'y': goto yy684;
- case '-': goto yy695;
- case '.': goto yy696;
- case '/': goto yy694;
+ case 'p': case 'w': case 'y': goto yy649;
+ case '-': goto yy660;
+ case '.': goto yy661;
+ case '/': goto yy659;
case '0':
case '1':
- case '2': goto yy1266;
+ case '2': goto yy1234;
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
- case '9': goto yy1233;
- case ':': goto yy705;
- case 'n': goto yy692;
- case 'r': goto yy693;
- case 's': goto yy686;
- case 't': goto yy690;
+ case '9': goto yy1201;
+ case ':': goto yy670;
+ case 'n': goto yy657;
+ case 'r': goto yy658;
+ case 's': goto yy651;
+ case 't': goto yy655;
default: goto yy12;
}
yy15:
@@ -1278,7 +1288,7 @@ yy15:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: goto yy682;
+ case 0x09: goto yy647;
case ' ': case 'A': case 'D': case 'F': case 'H':
case 'I':
case 'J': case 'M':
@@ -1289,25 +1299,25 @@ yy15:
case 'W':
case 'X':
case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': case 'o':
- case 'p': case 'w': case 'y': goto yy684;
- case '-': goto yy695;
- case '.': goto yy696;
- case '/': goto yy694;
+ case 'p': case 'w': case 'y': goto yy649;
+ case '-': goto yy660;
+ case '.': goto yy661;
+ case '/': goto yy659;
case '0':
case '1':
case '2':
- case '3': goto yy1233;
+ case '3': goto yy1201;
case '4':
case '5':
case '6':
case '7':
case '8':
- case '9': goto yy1229;
- case ':': goto yy705;
- case 'n': goto yy692;
- case 'r': goto yy693;
- case 's': goto yy686;
- case 't': goto yy690;
+ case '9': goto yy1197;
+ case ':': goto yy670;
+ case 'n': goto yy657;
+ case 'r': goto yy658;
+ case 's': goto yy651;
+ case 't': goto yy655;
default: goto yy12;
}
yy16:
@@ -1316,7 +1326,7 @@ yy16:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: goto yy682;
+ case 0x09: goto yy647;
case ' ': case 'A': case 'D': case 'F': case 'H':
case 'I':
case 'J': case 'M':
@@ -1327,12 +1337,12 @@ yy16:
case 'W':
case 'X':
case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': case 'o':
- case 'p': case 'w': case 'y': goto yy684;
- case '-': goto yy695;
- case '.': goto yy696;
- case '/': goto yy694;
+ case 'p': case 'w': case 'y': goto yy649;
+ case '-': goto yy660;
+ case '.': goto yy661;
+ case '/': goto yy659;
case '0':
- case '1': goto yy1229;
+ case '1': goto yy1197;
case '2':
case '3':
case '4':
@@ -1340,12 +1350,12 @@ yy16:
case '6':
case '7':
case '8':
- case '9': goto yy691;
- case ':': goto yy705;
- case 'n': goto yy692;
- case 'r': goto yy693;
- case 's': goto yy686;
- case 't': goto yy690;
+ case '9': goto yy656;
+ case ':': goto yy670;
+ case 'n': goto yy657;
+ case 'r': goto yy658;
+ case 's': goto yy651;
+ case 't': goto yy655;
default: goto yy12;
}
yy17:
@@ -1354,7 +1364,7 @@ yy17:
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: goto yy682;
+ case 0x09: goto yy647;
case ' ': case 'A': case 'D': case 'F': case 'H':
case 'I':
case 'J': case 'M':
@@ -1365,10 +1375,10 @@ yy17:
case 'W':
case 'X':
case 'Y': case 'a': case 'd': case 'f': case 'h': case 'j': case 'm': case 'o':
- case 'p': case 'w': case 'y': goto yy684;
- case '-': goto yy695;
- case '.': goto yy696;
- case '/': goto yy694;
+ case 'p': case 'w': case 'y': goto yy649;
+ case '-': goto yy660;
+ case '.': goto yy661;
+ case '/': goto yy659;
case '0':
case '1':
case '2':
@@ -1378,12 +1388,12 @@ yy17:
case '6':
case '7':
case '8':
- case '9': goto yy691;
- case ':': goto yy705;
- case 'n': goto yy692;
- case 'r': goto yy693;
- case 's': goto yy686;
- case 't': goto yy690;
+ case '9': goto yy656;
+ case ':': goto yy670;
+ case 'n': goto yy657;
+ case 'r': goto yy658;
+ case 's': goto yy651;
+ case 't': goto yy655;
default: goto yy12;
}
yy18:
@@ -1394,37 +1404,37 @@ yy18:
if(yych <= '('){
if(yych <= 0x09){
if(yych <= 0x08) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
+ if(yych == ' ') goto yy312;
goto yy3;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
+ if(yych <= ')') goto yy136;
goto yy3;
} else {
if(yych == '/') goto yy3;
- goto yy423;
+ goto yy312;
}
}
} else {
if(yych <= 'V'){
if(yych <= 'H'){
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'I') goto yy681;
- if(yych <= 'U') goto yy133;
- goto yy680;
+ if(yych <= 'I') goto yy646;
+ if(yych <= 'U') goto yy137;
+ goto yy645;
}
} else {
if(yych <= 'Z'){
- if(yych == 'X') goto yy680;
- goto yy133;
+ if(yych == 'X') goto yy645;
+ goto yy137;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1435,27 +1445,27 @@ yy19:
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
if(yych <= 0x1F) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= ',') goto yy3;
- goto yy423;
+ goto yy312;
}
} else {
if(yych <= 'H'){
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
if(yych <= 'Z'){
- if(yych <= 'I') goto yy678;
- goto yy133;
+ if(yych <= 'I') goto yy642;
+ goto yy137;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1466,27 +1476,27 @@ yy20:
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
if(yych <= 0x1F) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= ',') goto yy3;
- goto yy423;
+ goto yy312;
}
} else {
if(yych <= 'H'){
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
if(yych <= 'Z'){
- if(yych <= 'I') goto yy676;
- goto yy133;
+ if(yych <= 'I') goto yy640;
+ goto yy137;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1496,21 +1506,21 @@ yy21:
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'A') goto yy659;
- if(yych <= 'T') goto yy133;
- goto yy658;
+ if(yych <= 'A') goto yy623;
+ if(yych <= 'T') goto yy137;
+ goto yy622;
}
} else {
if(yych <= 'a'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy668;
+ goto yy632;
} else {
- if(yych == 'u') goto yy667;
- if(yych <= 'z') goto yy138;
+ if(yych == 'u') goto yy631;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1519,21 +1529,21 @@ yy22:
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'A') goto yy659;
- if(yych <= 'T') goto yy133;
- goto yy658;
+ if(yych <= 'A') goto yy623;
+ if(yych <= 'T') goto yy137;
+ goto yy622;
}
} else {
if(yych <= 'a'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy659;
+ goto yy623;
} else {
- if(yych == 'u') goto yy658;
- if(yych <= 'z') goto yy133;
+ if(yych == 'u') goto yy622;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1544,40 +1554,40 @@ yy23:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy620;
+ if(yych <= 'D') goto yy137;
+ goto yy584;
}
} else {
if(yych <= 'N'){
- if(yych == 'I') goto yy621;
- goto yy133;
+ if(yych == 'I') goto yy585;
+ goto yy137;
} else {
- if(yych <= 'O') goto yy622;
- if(yych <= 'Q') goto yy133;
- goto yy623;
+ if(yych <= 'O') goto yy586;
+ if(yych <= 'Q') goto yy137;
+ goto yy587;
}
}
} else {
if(yych <= 'i'){
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy138;
+ goto yy142;
} else {
- if(yych <= 'e') goto yy639;
- if(yych <= 'h') goto yy138;
- goto yy640;
+ if(yych <= 'e') goto yy603;
+ if(yych <= 'h') goto yy142;
+ goto yy604;
}
} else {
if(yych <= 'q'){
- if(yych == 'o') goto yy641;
- goto yy138;
+ if(yych == 'o') goto yy605;
+ goto yy142;
} else {
- if(yych <= 'r') goto yy642;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'r') goto yy606;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1589,40 +1599,40 @@ yy24:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy620;
+ if(yych <= 'D') goto yy137;
+ goto yy584;
}
} else {
if(yych <= 'N'){
- if(yych == 'I') goto yy621;
- goto yy133;
+ if(yych == 'I') goto yy585;
+ goto yy137;
} else {
- if(yych <= 'O') goto yy622;
- if(yych <= 'Q') goto yy133;
- goto yy623;
+ if(yych <= 'O') goto yy586;
+ if(yych <= 'Q') goto yy137;
+ goto yy587;
}
}
} else {
if(yych <= 'i'){
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'e') goto yy620;
- if(yych <= 'h') goto yy133;
- goto yy621;
+ if(yych <= 'e') goto yy584;
+ if(yych <= 'h') goto yy137;
+ goto yy585;
}
} else {
if(yych <= 'q'){
- if(yych == 'o') goto yy622;
- goto yy133;
+ if(yych == 'o') goto yy586;
+ goto yy137;
} else {
- if(yych <= 'r') goto yy623;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'r') goto yy587;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1632,35 +1642,35 @@ yy25:
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= 'F'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
if(yych <= 'O'){
- if(yych <= 'G') goto yy599;
- goto yy133;
+ if(yych <= 'G') goto yy563;
+ goto yy137;
} else {
- if(yych <= 'P') goto yy598;
- if(yych <= 'T') goto yy133;
- goto yy597;
+ if(yych <= 'P') goto yy562;
+ if(yych <= 'T') goto yy137;
+ goto yy561;
}
}
} else {
if(yych <= 'o'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych == 'g') goto yy611;
- goto yy138;
+ if(yych == 'g') goto yy575;
+ goto yy142;
}
} else {
if(yych <= 't'){
- if(yych <= 'p') goto yy610;
- goto yy138;
+ if(yych <= 'p') goto yy574;
+ goto yy142;
} else {
- if(yych <= 'u') goto yy609;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'u') goto yy573;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1670,35 +1680,35 @@ yy26:
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= 'F'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy133;
+ goto yy137;
} else {
if(yych <= 'O'){
- if(yych <= 'G') goto yy599;
- goto yy133;
+ if(yych <= 'G') goto yy563;
+ goto yy137;
} else {
- if(yych <= 'P') goto yy598;
- if(yych <= 'T') goto yy133;
- goto yy597;
+ if(yych <= 'P') goto yy562;
+ if(yych <= 'T') goto yy137;
+ goto yy561;
}
}
} else {
if(yych <= 'o'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych == 'g') goto yy599;
- goto yy133;
+ if(yych == 'g') goto yy563;
+ goto yy137;
}
} else {
if(yych <= 't'){
- if(yych <= 'p') goto yy598;
- goto yy133;
+ if(yych <= 'p') goto yy562;
+ goto yy137;
} else {
- if(yych <= 'u') goto yy597;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'u') goto yy561;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1710,39 +1720,39 @@ yy27:
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy540;
- goto yy133;
+ if(yych <= 'A') goto yy504;
+ goto yy137;
}
} else {
if(yych <= 'H'){
- if(yych <= 'E') goto yy539;
- goto yy133;
+ if(yych <= 'E') goto yy503;
+ goto yy137;
} else {
- if(yych <= 'I') goto yy541;
- if(yych <= 'T') goto yy133;
- goto yy542;
+ if(yych <= 'I') goto yy505;
+ if(yych <= 'T') goto yy137;
+ goto yy506;
}
}
} else {
if(yych <= 'e'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych <= 'a') goto yy569;
- if(yych <= 'd') goto yy138;
- goto yy568;
+ if(yych <= 'a') goto yy533;
+ if(yych <= 'd') goto yy142;
+ goto yy532;
}
} else {
if(yych <= 't'){
- if(yych == 'i') goto yy570;
- goto yy138;
+ if(yych == 'i') goto yy534;
+ goto yy142;
} else {
- if(yych <= 'u') goto yy571;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'u') goto yy535;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1754,39 +1764,39 @@ yy28:
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy540;
- goto yy133;
+ if(yych <= 'A') goto yy504;
+ goto yy137;
}
} else {
if(yych <= 'H'){
- if(yych <= 'E') goto yy539;
- goto yy133;
+ if(yych <= 'E') goto yy503;
+ goto yy137;
} else {
- if(yych <= 'I') goto yy541;
- if(yych <= 'T') goto yy133;
- goto yy542;
+ if(yych <= 'I') goto yy505;
+ if(yych <= 'T') goto yy137;
+ goto yy506;
}
}
} else {
if(yych <= 'e'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych <= 'a') goto yy540;
- if(yych <= 'd') goto yy133;
- goto yy539;
+ if(yych <= 'a') goto yy504;
+ if(yych <= 'd') goto yy137;
+ goto yy503;
}
} else {
if(yych <= 't'){
- if(yych == 'i') goto yy541;
- goto yy133;
+ if(yych == 'i') goto yy505;
+ goto yy137;
} else {
- if(yych <= 'u') goto yy542;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'u') goto yy506;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1797,20 +1807,20 @@ yy29:
if(yych <= 'C'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'B') goto yy133;
- goto yy529;
+ if(yych <= 'B') goto yy137;
+ goto yy493;
}
} else {
if(yych <= 'b'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy138;
+ goto yy142;
} else {
- if(yych <= 'c') goto yy534;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'c') goto yy498;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1820,20 +1830,20 @@ yy30:
if(yych <= 'C'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'B') goto yy133;
- goto yy529;
+ if(yych <= 'B') goto yy137;
+ goto yy493;
}
} else {
if(yych <= 'b'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'c') goto yy529;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'c') goto yy493;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1843,20 +1853,20 @@ yy31:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy420;
+ if(yych <= 'D') goto yy137;
+ goto yy308;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy138;
+ goto yy142;
} else {
- if(yych <= 'e') goto yy522;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'e') goto yy486;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1866,20 +1876,20 @@ yy32:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy420;
+ if(yych <= 'D') goto yy137;
+ goto yy308;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'e') goto yy420;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'e') goto yy308;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1889,20 +1899,20 @@ yy33:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy403;
+ if(yych <= 'D') goto yy137;
+ goto yy281;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy138;
+ goto yy142;
} else {
- if(yych <= 'e') goto yy412;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'e') goto yy295;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1912,20 +1922,20 @@ yy34:
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy133;
- goto yy403;
+ if(yych <= 'D') goto yy137;
+ goto yy281;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'e') goto yy403;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'e') goto yy281;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1934,22 +1944,22 @@ yy35:
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'I') goto yy367;
- if(yych <= 'K') goto yy133;
- goto yy368;
+ if(yych == 'I') goto yy261;
+ if(yych <= 'K') goto yy137;
+ goto yy262;
}
} else {
if(yych <= 'i'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'h') goto yy138;
- goto yy385;
+ if(yych <= 'h') goto yy142;
+ goto yy271;
} else {
- if(yych == 'l') goto yy386;
- if(yych <= 'z') goto yy138;
+ if(yych == 'l') goto yy272;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1958,22 +1968,22 @@ yy36:
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'I') goto yy367;
- if(yych <= 'K') goto yy133;
- goto yy368;
+ if(yych == 'I') goto yy261;
+ if(yych <= 'K') goto yy137;
+ goto yy262;
}
} else {
if(yych <= 'i'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'h') goto yy133;
- goto yy367;
+ if(yych <= 'h') goto yy137;
+ goto yy261;
} else {
- if(yych == 'l') goto yy368;
- if(yych <= 'z') goto yy133;
+ if(yych == 'l') goto yy262;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -1981,16 +1991,16 @@ yy37:
YYDEBUG(37, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy319;
+ goto yy255;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych <= 'a') goto yy343;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'a') goto yy258;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -1998,16 +2008,16 @@ yy38:
YYDEBUG(38, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy319;
+ goto yy255;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
goto yy3;
} else {
- if(yych <= 'a') goto yy319;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'a') goto yy255;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -2017,20 +2027,20 @@ yy39:
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy133;
- goto yy157;
+ if(yych <= 'Q') goto yy137;
+ goto yy161;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy138;
+ goto yy142;
} else {
- if(yych <= 'r') goto yy239;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'r') goto yy248;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
}
@@ -2040,20 +2050,20 @@ yy40:
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy133;
- goto yy157;
+ if(yych <= 'Q') goto yy137;
+ goto yy161;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- goto yy133;
+ goto yy137;
} else {
- if(yych <= 'r') goto yy157;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'r') goto yy161;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
}
@@ -2065,40 +2075,40 @@ yy41:
goto yy54;
}
if(yych <= '/') goto yy12;
- if(yych <= '1') goto yy150;
- if(yych <= '2') goto yy151;
- if(yych <= '9') goto yy152;
+ if(yych <= '1') goto yy154;
+ if(yych <= '2') goto yy155;
+ if(yych <= '9') goto yy156;
goto yy12;
yy42:
YYDEBUG(42, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@') goto yy12;
- if(yych <= 'Z') goto yy149;
+ if(yych <= 'Z') goto yy153;
if(yych <= '`') goto yy12;
- if(yych <= 'z') goto yy149;
+ if(yych <= 'z') goto yy153;
goto yy12;
yy43:
YYDEBUG(43, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy138;
+ if(yych <= 'z') goto yy142;
goto yy3;
}
yy44:
YYDEBUG(44, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
yy45:
@@ -2114,11 +2124,11 @@ yy45:
yy46:
YYDEBUG(46, *YYCURSOR);
-#line 1429 "ext/date/lib/parse_date.re"
+#line 1492 "ext/date/lib/parse_date.re"
{
goto std;
}
-#line 2022 "ext/date/lib/parse_date.c"
+#line 2032 "ext/date/lib/parse_date.c"
yy47:
YYDEBUG(47, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2130,12 +2140,12 @@ yy48:
yy49:
YYDEBUG(49, *YYCURSOR);
-#line 1434 "ext/date/lib/parse_date.re"
+#line 1497 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
}
-#line 2033 "ext/date/lib/parse_date.c"
+#line 2043 "ext/date/lib/parse_date.c"
yy50:
YYDEBUG(50, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2214,30 +2224,33 @@ yy53:
YYDEBUG(53, *YYCURSOR);
YYCURSOR = YYMARKER;
switch(yyaccept){
- case 26: goto yy1413;
- case 24: goto yy1382;
- case 25: goto yy1390;
- case 23: goto yy1304;
- case 22: goto yy1301;
- case 11: goto yy713;
- case 20: goto yy1238;
- case 21: goto yy1246;
- case 13: goto yy870;
- case 18: goto yy1134;
- case 12: goto yy860;
- case 8: goto yy491;
- case 17: goto yy978;
- case 6: goto yy426;
- case 10: goto yy698;
- case 16: goto yy1032;
- case 19: goto yy1026;
- case 15: goto yy1005;
- case 14: goto yy971;
- case 9: goto yy601;
- case 5: goto yy405;
- case 4: goto yy176;
+ case 29: goto yy1381;
+ case 27: goto yy1350;
+ case 28: goto yy1358;
+ case 26: goto yy1272;
+ case 25: goto yy1269;
+ case 12: goto yy678;
+ case 23: goto yy1206;
+ case 24: goto yy1214;
+ case 14: goto yy835;
+ case 20: goto yy1100;
+ case 21: goto yy1124;
+ case 13: goto yy825;
+ case 9: goto yy409;
+ case 19: goto yy943;
+ case 7: goto yy315;
+ case 11: goto yy663;
+ case 18: goto yy998;
+ case 22: goto yy992;
+ case 17: goto yy971;
+ case 16: goto yy964;
+ case 15: goto yy936;
+ case 10: goto yy565;
+ case 5: goto yy283;
+ case 4: goto yy181;
+ case 6: goto yy310;
case 0: goto yy3;
- case 7: goto yy448;
+ case 8: goto yy339;
case 3: goto yy69;
case 2: goto yy46;
case 1: goto yy12;
@@ -2328,20 +2341,20 @@ yy58:
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= 'D'){
- if(yych == 'A') goto yy119;
+ if(yych == 'A') goto yy123;
goto yy53;
} else {
- if(yych <= 'E') goto yy120;
+ if(yych <= 'E') goto yy124;
if(yych <= 'T') goto yy53;
- goto yy118;
+ goto yy122;
}
} else {
if(yych <= 'd'){
- if(yych == 'a') goto yy119;
+ if(yych == 'a') goto yy123;
goto yy53;
} else {
- if(yych <= 'e') goto yy120;
- if(yych == 'u') goto yy118;
+ if(yych <= 'e') goto yy124;
+ if(yych == 'u') goto yy122;
goto yy53;
}
}
@@ -2349,29 +2362,29 @@ yy59:
YYDEBUG(59, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
- if(yych == 'I') goto yy110;
+ if(yych == 'I') goto yy114;
if(yych <= 'N') goto yy53;
- goto yy109;
+ goto yy113;
} else {
if(yych <= 'i'){
if(yych <= 'h') goto yy53;
- goto yy110;
+ goto yy114;
} else {
- if(yych == 'o') goto yy109;
+ if(yych == 'o') goto yy113;
goto yy53;
}
}
yy60:
YYDEBUG(60, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy107;
- if(yych == 'o') goto yy107;
+ if(yych == 'O') goto yy111;
+ if(yych == 'o') goto yy111;
goto yy53;
yy61:
YYDEBUG(61, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy106;
- if(yych == 'a') goto yy106;
+ if(yych == 'A') goto yy110;
+ if(yych == 'a') goto yy110;
goto yy53;
yy62:
YYDEBUG(62, *YYCURSOR);
@@ -2439,7 +2452,7 @@ yy68:
yy69:
YYDEBUG(69, *YYCURSOR);
-#line 1413 "ext/date/lib/parse_date.re"
+#line 1476 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@@ -2454,7 +2467,7 @@ yy69:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 2312 "ext/date/lib/parse_date.c"
+#line 2325 "ext/date/lib/parse_date.c"
yy70:
YYDEBUG(70, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2649,8 +2662,8 @@ yy98:
yy99:
YYDEBUG(99, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'K') goto yy81;
- if(yych == 'k') goto yy81;
+ if(yych == 'K') goto yy106;
+ if(yych == 'k') goto yy106;
goto yy53;
yy100:
YYDEBUG(100, *YYCURSOR);
@@ -2691,425 +2704,460 @@ yy105:
goto yy53;
yy106:
YYDEBUG(106, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy81;
- if(yych == 'y') goto yy81;
- goto yy53;
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych == 'D') goto yy107;
+ if(yych <= 'R') goto yy69;
+ goto yy73;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'c') goto yy69;
+ goto yy107;
+ } else {
+ if(yych == 's') goto yy73;
+ goto yy69;
+ }
+ }
yy107:
YYDEBUG(107, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'U') goto yy108;
- if(yych != 'u') goto yy53;
+ if(yych == 'A') goto yy108;
+ if(yych != 'a') goto yy53;
goto yy108;
yy108:
YYDEBUG(108, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy81;
- if(yych == 'r') goto yy81;
- goto yy53;
+ if(yych == 'Y') goto yy109;
+ if(yych != 'y') goto yy53;
+ goto yy109;
yy109:
YYDEBUG(109, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy114;
- if(yych == 'n') goto yy114;
- goto yy53;
+ if(yych == 'S') goto yy73;
+ if(yych == 's') goto yy73;
+ goto yy69;
yy110:
YYDEBUG(110, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy111;
- if(yych != 'n') goto yy53;
- goto yy111;
+ if(yych == 'Y') goto yy81;
+ if(yych == 'y') goto yy81;
+ goto yy53;
yy111:
YYDEBUG(111, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'U') goto yy112;
+ if(yych != 'u') goto yy53;
+ goto yy112;
+yy112:
+ YYDEBUG(112, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy81;
+ if(yych == 'r') goto yy81;
+ goto yy53;
+yy113:
+ YYDEBUG(113, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy118;
+ if(yych == 'n') goto yy118;
+ goto yy53;
+yy114:
+ YYDEBUG(114, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'N') goto yy115;
+ if(yych != 'n') goto yy53;
+ goto yy115;
+yy115:
+ YYDEBUG(115, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'U'){
if(yych == 'S') goto yy73;
if(yych <= 'T') goto yy69;
- goto yy112;
+ goto yy116;
} else {
if(yych <= 's'){
if(yych <= 'r') goto yy69;
goto yy73;
} else {
if(yych != 'u') goto yy69;
- goto yy112;
+ goto yy116;
}
}
-yy112:
- YYDEBUG(112, *YYCURSOR);
+yy116:
+ YYDEBUG(116, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy113;
+ if(yych == 'T') goto yy117;
if(yych != 't') goto yy53;
- goto yy113;
-yy113:
- YYDEBUG(113, *YYCURSOR);
+ goto yy117;
+yy117:
+ YYDEBUG(117, *YYCURSOR);
yych = *++YYCURSOR;
if(yych == 'E') goto yy81;
if(yych == 'e') goto yy81;
goto yy53;
-yy114:
- YYDEBUG(114, *YYCURSOR);
+yy118:
+ YYDEBUG(118, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
- if(yych == 'D') goto yy115;
+ if(yych == 'D') goto yy119;
if(yych <= 'S') goto yy69;
- goto yy116;
+ goto yy120;
} else {
if(yych <= 'd'){
if(yych <= 'c') goto yy69;
- goto yy115;
+ goto yy119;
} else {
- if(yych == 't') goto yy116;
+ if(yych == 't') goto yy120;
goto yy69;
}
}
-yy115:
- YYDEBUG(115, *YYCURSOR);
+yy119:
+ YYDEBUG(119, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy117;
- if(yych == 'a') goto yy117;
+ if(yych == 'A') goto yy121;
+ if(yych == 'a') goto yy121;
goto yy53;
-yy116:
- YYDEBUG(116, *YYCURSOR);
+yy120:
+ YYDEBUG(120, *YYCURSOR);
yych = *++YYCURSOR;
if(yych == 'H') goto yy81;
if(yych == 'h') goto yy81;
goto yy53;
-yy117:
- YYDEBUG(117, *YYCURSOR);
+yy121:
+ YYDEBUG(121, *YYCURSOR);
yych = *++YYCURSOR;
if(yych == 'Y') goto yy73;
if(yych == 'y') goto yy73;
goto yy53;
-yy118:
- YYDEBUG(118, *YYCURSOR);
+yy122:
+ YYDEBUG(122, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy129;
- if(yych == 'n') goto yy129;
+ if(yych == 'N') goto yy133;
+ if(yych == 'n') goto yy133;
goto yy53;
-yy119:
- YYDEBUG(119, *YYCURSOR);
+yy123:
+ YYDEBUG(123, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy124;
- if(yych == 't') goto yy124;
+ if(yych == 'T') goto yy128;
+ if(yych == 't') goto yy128;
goto yy53;
-yy120:
- YYDEBUG(120, *YYCURSOR);
+yy124:
+ YYDEBUG(124, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy121;
+ if(yych == 'C') goto yy125;
if(yych != 'c') goto yy53;
- goto yy121;
-yy121:
- YYDEBUG(121, *YYCURSOR);
+ goto yy125;
+yy125:
+ YYDEBUG(125, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
- if(yych == 'O') goto yy122;
+ if(yych == 'O') goto yy126;
if(yych <= 'R') goto yy69;
goto yy73;
} else {
if(yych <= 'o'){
if(yych <= 'n') goto yy69;
- goto yy122;
+ goto yy126;
} else {
if(yych == 's') goto yy73;
goto yy69;
}
}
-yy122:
- YYDEBUG(122, *YYCURSOR);
+yy126:
+ YYDEBUG(126, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy123;
+ if(yych == 'N') goto yy127;
if(yych != 'n') goto yy53;
- goto yy123;
-yy123:
- YYDEBUG(123, *YYCURSOR);
+ goto yy127;
+yy127:
+ YYDEBUG(127, *YYCURSOR);
yych = *++YYCURSOR;
if(yych == 'D') goto yy81;
if(yych == 'd') goto yy81;
goto yy53;
-yy124:
- YYDEBUG(124, *YYCURSOR);
+yy128:
+ YYDEBUG(128, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'U') goto yy125;
+ if(yych == 'U') goto yy129;
if(yych != 'u') goto yy69;
- goto yy125;
-yy125:
- YYDEBUG(125, *YYCURSOR);
+ goto yy129;
+yy129:
+ YYDEBUG(129, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy126;
+ if(yych == 'R') goto yy130;
if(yych != 'r') goto yy53;
- goto yy126;
-yy126:
- YYDEBUG(126, *YYCURSOR);
+ goto yy130;
+yy130:
+ YYDEBUG(130, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'D') goto yy127;
+ if(yych == 'D') goto yy131;
if(yych != 'd') goto yy53;
- goto yy127;
-yy127:
- YYDEBUG(127, *YYCURSOR);
+ goto yy131;
+yy131:
+ YYDEBUG(131, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy128;
+ if(yych == 'A') goto yy132;
if(yych != 'a') goto yy53;
- goto yy128;
-yy128:
- YYDEBUG(128, *YYCURSOR);
+ goto yy132;
+yy132:
+ YYDEBUG(132, *YYCURSOR);
yych = *++YYCURSOR;
if(yych == 'Y') goto yy73;
if(yych == 'y') goto yy73;
goto yy53;
-yy129:
- YYDEBUG(129, *YYCURSOR);
+yy133:
+ YYDEBUG(133, *YYCURSOR);
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'D') goto yy130;
+ if(yych == 'D') goto yy134;
if(yych != 'd') goto yy69;
- goto yy130;
-yy130:
- YYDEBUG(130, *YYCURSOR);
+ goto yy134;
+yy134:
+ YYDEBUG(134, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy131;
+ if(yych == 'A') goto yy135;
if(yych != 'a') goto yy53;
- goto yy131;
-yy131:
- YYDEBUG(131, *YYCURSOR);
+ goto yy135;
+yy135:
+ YYDEBUG(135, *YYCURSOR);
yych = *++YYCURSOR;
if(yych == 'Y') goto yy73;
if(yych == 'y') goto yy73;
goto yy53;
-yy132:
- YYDEBUG(132, *YYCURSOR);
+yy136:
+ YYDEBUG(136, *YYCURSOR);
yych = *++YYCURSOR;
goto yy3;
-yy133:
- YYDEBUG(133, *YYCURSOR);
+yy137:
+ YYDEBUG(137, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy134;
+ goto yy138;
}
-yy134:
- YYDEBUG(134, *YYCURSOR);
+yy138:
+ YYDEBUG(138, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy135;
+ goto yy139;
}
-yy135:
- YYDEBUG(135, *YYCURSOR);
+yy139:
+ YYDEBUG(139, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy136;
+ goto yy140;
}
-yy136:
- YYDEBUG(136, *YYCURSOR);
+yy140:
+ YYDEBUG(140, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy137;
+ goto yy141;
}
-yy137:
- YYDEBUG(137, *YYCURSOR);
+yy141:
+ YYDEBUG(141, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
-yy138:
- YYDEBUG(138, *YYCURSOR);
+yy142:
+ YYDEBUG(142, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
+ if(yych == '/') goto yy144;
goto yy3;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy139;
+ goto yy143;
}
}
-yy139:
- YYDEBUG(139, *YYCURSOR);
+yy143:
+ YYDEBUG(143, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych != '/') goto yy3;
- goto yy140;
+ goto yy144;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy144;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy140:
- YYDEBUG(140, *YYCURSOR);
+yy144:
+ YYDEBUG(144, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
if(yych <= '@') goto yy53;
if(yych >= '[') goto yy53;
- goto yy141;
-yy141:
- YYDEBUG(141, *YYCURSOR);
+ goto yy145;
+yy145:
+ YYDEBUG(145, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
if(yybm[0+yych] & 32) {
- goto yy142;
+ goto yy146;
}
goto yy53;
-yy142:
- YYDEBUG(142, *YYCURSOR);
+yy146:
+ YYDEBUG(146, *YYCURSOR);
yyaccept = 0;
YYMARKER = ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy143;
-yy143:
- YYDEBUG(143, *YYCURSOR);
+ goto yy147;
+yy147:
+ YYDEBUG(147, *YYCURSOR);
if(yybm[0+yych] & 32) {
- goto yy142;
+ goto yy146;
}
- if(yych == '/') goto yy140;
- if(yych == '_') goto yy140;
+ if(yych == '/') goto yy144;
+ if(yych == '_') goto yy144;
goto yy3;
-yy144:
- YYDEBUG(144, *YYCURSOR);
+yy148:
+ YYDEBUG(148, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
+ if(yych == '/') goto yy144;
goto yy3;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy145;
+ goto yy149;
}
}
-yy145:
- YYDEBUG(145, *YYCURSOR);
+yy149:
+ YYDEBUG(149, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
+ if(yych == '/') goto yy144;
goto yy3;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy146;
+ goto yy150;
}
}
-yy146:
- YYDEBUG(146, *YYCURSOR);
+yy150:
+ YYDEBUG(150, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '_'){
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
if(yych >= '{') goto yy3;
- goto yy147;
+ goto yy151;
}
}
-yy147:
- YYDEBUG(147, *YYCURSOR);
+yy151:
+ YYDEBUG(151, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy148;
-yy148:
- YYDEBUG(148, *YYCURSOR);
+ goto yy152;
+yy152:
+ YYDEBUG(152, *YYCURSOR);
if(yych <= '^'){
- if(yych == '/') goto yy140;
+ if(yych == '/') goto yy144;
goto yy53;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy53;
- if(yych <= 'z') goto yy147;
+ if(yych <= 'z') goto yy151;
goto yy53;
}
-yy149:
- YYDEBUG(149, *YYCURSOR);
+yy153:
+ YYDEBUG(153, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Z') goto yy133;
+ if(yych <= 'Z') goto yy137;
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy133;
+ if(yych <= 'z') goto yy137;
goto yy3;
}
-yy150:
- YYDEBUG(150, *YYCURSOR);
+yy154:
+ YYDEBUG(154, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
@@ -3121,9 +3169,9 @@ yy150:
} else {
if(yych <= '9'){
if(yych <= '/') goto yy3;
- goto yy152;
+ goto yy156;
} else {
- if(yych <= ':') goto yy153;
+ if(yych <= ':') goto yy157;
if(yych <= 'C') goto yy3;
goto yy57;
}
@@ -3175,8 +3223,8 @@ yy150:
}
}
}
-yy151:
- YYDEBUG(151, *YYCURSOR);
+yy155:
+ YYDEBUG(155, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
@@ -3188,11 +3236,11 @@ yy151:
} else {
if(yych <= '3'){
if(yych <= '/') goto yy3;
- goto yy152;
+ goto yy156;
} else {
- if(yych <= '5') goto yy154;
- if(yych <= '9') goto yy155;
- goto yy153;
+ if(yych <= '5') goto yy158;
+ if(yych <= '9') goto yy159;
+ goto yy157;
}
}
} else {
@@ -3251,8 +3299,8 @@ yy151:
}
}
}
-yy152:
- YYDEBUG(152, *YYCURSOR);
+yy156:
+ YYDEBUG(156, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
@@ -3264,11 +3312,11 @@ yy152:
} else {
if(yych <= '5'){
if(yych <= '/') goto yy3;
- goto yy154;
+ goto yy158;
} else {
- if(yych <= '9') goto yy155;
+ if(yych <= '9') goto yy159;
if(yych >= ';') goto yy3;
- goto yy153;
+ goto yy157;
}
}
} else {
@@ -3323,15 +3371,15 @@ yy152:
}
}
}
-yy153:
- YYDEBUG(153, *YYCURSOR);
+yy157:
+ YYDEBUG(157, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy3;
- if(yych <= '5') goto yy156;
- if(yych <= '9') goto yy132;
+ if(yych <= '5') goto yy160;
+ if(yych <= '9') goto yy136;
goto yy3;
-yy154:
- YYDEBUG(154, *YYCURSOR);
+yy158:
+ YYDEBUG(158, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
@@ -3342,7 +3390,7 @@ yy154:
goto yy57;
} else {
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy155;
+ if(yych <= '9') goto yy159;
if(yych <= 'C') goto yy3;
goto yy57;
}
@@ -3393,8 +3441,8 @@ yy154:
}
}
}
-yy155:
- YYDEBUG(155, *YYCURSOR);
+yy159:
+ YYDEBUG(159, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yybm[0+yych] & 8) {
@@ -3450,306 +3498,312 @@ yy155:
}
}
}
-yy156:
- YYDEBUG(156, *YYCURSOR);
+yy160:
+ YYDEBUG(160, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy132;
+ if(yych <= '9') goto yy136;
goto yy3;
-yy157:
- YYDEBUG(157, *YYCURSOR);
+yy161:
+ YYDEBUG(161, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy158;
+ if(yych <= 'D') goto yy138;
+ goto yy162;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'e') goto yy158;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'e') goto yy162;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy158:
- YYDEBUG(158, *YYCURSOR);
+yy162:
+ YYDEBUG(162, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'V'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'U') goto yy135;
- goto yy159;
+ if(yych <= 'U') goto yy139;
+ goto yy163;
}
} else {
if(yych <= 'u'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'v') goto yy159;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'v') goto yy163;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy159:
- YYDEBUG(159, *YYCURSOR);
+yy163:
+ YYDEBUG(163, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'I'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'H') goto yy136;
- goto yy160;
+ if(yych <= 'H') goto yy140;
+ goto yy164;
}
} else {
if(yych <= 'h'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'i') goto yy160;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'i') goto yy164;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy160:
- YYDEBUG(160, *YYCURSOR);
+yy164:
+ YYDEBUG(164, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy137;
- goto yy161;
+ if(yych <= 'N') goto yy141;
+ goto yy165;
}
} else {
if(yych <= 'n'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'o') goto yy161;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'o') goto yy165;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy161:
- YYDEBUG(161, *YYCURSOR);
+yy165:
+ YYDEBUG(165, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'U') goto yy162;
+ if(yych <= 'U') goto yy166;
if(yych != 'u') goto yy3;
- goto yy162;
+ goto yy166;
}
-yy162:
- YYDEBUG(162, *YYCURSOR);
+yy166:
+ YYDEBUG(166, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'S') goto yy163;
+ if(yych == 'S') goto yy167;
if(yych != 's') goto yy53;
- goto yy163;
-yy163:
- YYDEBUG(163, *YYCURSOR);
+ goto yy167;
+yy167:
+ YYDEBUG(167, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 0x09) goto yy168;
+ if(yych != ' ') goto yy53;
+ goto yy168;
+yy168:
+ YYDEBUG(168, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
yych = *YYCURSOR;
- goto yy164;
-yy164:
- YYDEBUG(164, *YYCURSOR);
+ goto yy169;
+yy169:
+ YYDEBUG(169, *YYCURSOR);
if(yych <= 'W'){
if(yych <= 'F'){
if(yych <= ' '){
- if(yych == 0x09) goto yy163;
+ if(yych == 0x09) goto yy168;
if(yych <= 0x1F) goto yy53;
- goto yy163;
+ goto yy168;
} else {
- if(yych == 'D') goto yy168;
+ if(yych == 'D') goto yy173;
if(yych <= 'E') goto yy53;
- goto yy170;
+ goto yy175;
}
} else {
if(yych <= 'M'){
- if(yych == 'H') goto yy167;
+ if(yych == 'H') goto yy172;
if(yych <= 'L') goto yy53;
- goto yy166;
+ goto yy171;
} else {
if(yych <= 'S'){
if(yych <= 'R') goto yy53;
- goto yy165;
+ goto yy170;
} else {
- if(yych <= 'T') goto yy172;
+ if(yych <= 'T') goto yy177;
if(yych <= 'V') goto yy53;
- goto yy169;
+ goto yy174;
}
}
}
} else {
if(yych <= 'l'){
if(yych <= 'd'){
- if(yych == 'Y') goto yy171;
+ if(yych == 'Y') goto yy176;
if(yych <= 'c') goto yy53;
- goto yy168;
+ goto yy173;
} else {
if(yych <= 'f'){
if(yych <= 'e') goto yy53;
- goto yy170;
+ goto yy175;
} else {
- if(yych == 'h') goto yy167;
+ if(yych == 'h') goto yy172;
goto yy53;
}
}
} else {
if(yych <= 't'){
- if(yych <= 'm') goto yy166;
+ if(yych <= 'm') goto yy171;
if(yych <= 'r') goto yy53;
- if(yych >= 't') goto yy172;
- goto yy165;
+ if(yych >= 't') goto yy177;
+ goto yy170;
} else {
if(yych <= 'w'){
if(yych <= 'v') goto yy53;
- goto yy169;
+ goto yy174;
} else {
- if(yych == 'y') goto yy171;
+ if(yych == 'y') goto yy176;
goto yy53;
}
}
}
}
-yy165:
- YYDEBUG(165, *YYCURSOR);
+yy170:
+ YYDEBUG(170, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= 'D'){
- if(yych == 'A') goto yy226;
+ if(yych == 'A') goto yy235;
goto yy53;
} else {
- if(yych <= 'E') goto yy227;
+ if(yych <= 'E') goto yy236;
if(yych <= 'T') goto yy53;
- goto yy225;
+ goto yy234;
}
} else {
if(yych <= 'd'){
- if(yych == 'a') goto yy226;
+ if(yych == 'a') goto yy235;
goto yy53;
} else {
- if(yych <= 'e') goto yy227;
- if(yych == 'u') goto yy225;
+ if(yych <= 'e') goto yy236;
+ if(yych == 'u') goto yy234;
goto yy53;
}
}
-yy166:
- YYDEBUG(166, *YYCURSOR);
+yy171:
+ YYDEBUG(171, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
- if(yych == 'I') goto yy217;
+ if(yych == 'I') goto yy226;
if(yych <= 'N') goto yy53;
- goto yy216;
+ goto yy225;
} else {
if(yych <= 'i'){
if(yych <= 'h') goto yy53;
- goto yy217;
+ goto yy226;
} else {
- if(yych == 'o') goto yy216;
+ if(yych == 'o') goto yy225;
goto yy53;
}
}
-yy167:
- YYDEBUG(167, *YYCURSOR);
+yy172:
+ YYDEBUG(172, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy214;
- if(yych == 'o') goto yy214;
+ if(yych == 'O') goto yy223;
+ if(yych == 'o') goto yy223;
goto yy53;
-yy168:
- YYDEBUG(168, *YYCURSOR);
+yy173:
+ YYDEBUG(173, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy213;
- if(yych == 'a') goto yy213;
+ if(yych == 'A') goto yy222;
+ if(yych == 'a') goto yy222;
goto yy53;
-yy169:
- YYDEBUG(169, *YYCURSOR);
+yy174:
+ YYDEBUG(174, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy205;
- if(yych == 'e') goto yy205;
+ if(yych == 'E') goto yy210;
+ if(yych == 'e') goto yy210;
goto yy53;
-yy170:
- YYDEBUG(170, *YYCURSOR);
+yy175:
+ YYDEBUG(175, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
- if(yych == 'O') goto yy190;
+ if(yych == 'O') goto yy195;
if(yych <= 'Q') goto yy53;
- goto yy189;
+ goto yy194;
} else {
if(yych <= 'o'){
if(yych <= 'n') goto yy53;
- goto yy190;
+ goto yy195;
} else {
- if(yych == 'r') goto yy189;
+ if(yych == 'r') goto yy194;
goto yy53;
}
}
-yy171:
- YYDEBUG(171, *YYCURSOR);
+yy176:
+ YYDEBUG(176, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy186;
- if(yych == 'e') goto yy186;
+ if(yych == 'E') goto yy191;
+ if(yych == 'e') goto yy191;
goto yy53;
-yy172:
- YYDEBUG(172, *YYCURSOR);
+yy177:
+ YYDEBUG(177, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'H') goto yy173;
+ if(yych == 'H') goto yy178;
if(yych <= 'T') goto yy53;
- goto yy174;
+ goto yy179;
} else {
if(yych <= 'h'){
if(yych <= 'g') goto yy53;
- goto yy173;
+ goto yy178;
} else {
- if(yych == 'u') goto yy174;
+ if(yych == 'u') goto yy179;
goto yy53;
}
}
-yy173:
- YYDEBUG(173, *YYCURSOR);
+yy178:
+ YYDEBUG(178, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'U') goto yy181;
- if(yych == 'u') goto yy181;
+ if(yych == 'U') goto yy186;
+ if(yych == 'u') goto yy186;
goto yy53;
-yy174:
- YYDEBUG(174, *YYCURSOR);
+yy179:
+ YYDEBUG(179, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy175;
+ if(yych == 'E') goto yy180;
if(yych != 'e') goto yy53;
- goto yy175;
-yy175:
- YYDEBUG(175, *YYCURSOR);
+ goto yy180;
+yy180:
+ YYDEBUG(180, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'S') goto yy177;
- if(yych == 's') goto yy177;
- goto yy176;
-yy176:
- YYDEBUG(176, *YYCURSOR);
+ if(yych == 'S') goto yy182;
+ if(yych == 's') goto yy182;
+ goto yy181;
+yy181:
+ YYDEBUG(181, *YYCURSOR);
-#line 1352 "ext/date/lib/parse_date.re"
+#line 1381 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -3765,3651 +3819,1822 @@ yy176:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 3409 "ext/date/lib/parse_date.c"
-yy177:
- YYDEBUG(177, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy178;
- if(yych != 'd') goto yy53;
- goto yy178;
-yy178:
- YYDEBUG(178, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy179;
- if(yych != 'a') goto yy53;
- goto yy179;
-yy179:
- YYDEBUG(179, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych != 'y') goto yy53;
- goto yy180;
-yy180:
- YYDEBUG(180, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy176;
-yy181:
- YYDEBUG(181, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'R') goto yy182;
- if(yych != 'r') goto yy176;
- goto yy182;
+#line 3453 "ext/date/lib/parse_date.c"
yy182:
YYDEBUG(182, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'S') goto yy183;
- if(yych != 's') goto yy53;
+ if(yych == 'D') goto yy183;
+ if(yych != 'd') goto yy53;
goto yy183;
yy183:
YYDEBUG(183, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'D') goto yy184;
- if(yych != 'd') goto yy53;
+ if(yych == 'A') goto yy184;
+ if(yych != 'a') goto yy53;
goto yy184;
yy184:
YYDEBUG(184, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy185;
- if(yych != 'a') goto yy53;
+ if(yych == 'Y') goto yy185;
+ if(yych != 'y') goto yy53;
goto yy185;
yy185:
YYDEBUG(185, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy180;
- goto yy53;
+ goto yy181;
yy186:
YYDEBUG(186, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy187;
- if(yych != 'a') goto yy53;
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'R') goto yy187;
+ if(yych != 'r') goto yy181;
goto yy187;
yy187:
YYDEBUG(187, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy188;
- if(yych != 'r') goto yy53;
+ if(yych == 'S') goto yy188;
+ if(yych != 's') goto yy53;
goto yy188;
yy188:
YYDEBUG(188, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'S') goto yy180;
- if(yych == 's') goto yy180;
- goto yy176;
+ if(yych == 'D') goto yy189;
+ if(yych != 'd') goto yy53;
+ goto yy189;
yy189:
YYDEBUG(189, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy202;
- if(yych == 'i') goto yy202;
- goto yy53;
+ if(yych == 'A') goto yy190;
+ if(yych != 'a') goto yy53;
+ goto yy190;
yy190:
YYDEBUG(190, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy191;
- if(yych != 'r') goto yy53;
- goto yy191;
+ if(yych == 'Y') goto yy185;
+ if(yych == 'y') goto yy185;
+ goto yy53;
yy191:
YYDEBUG(191, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy192;
- if(yych != 't') goto yy53;
+ if(yych == 'A') goto yy192;
+ if(yych != 'a') goto yy53;
goto yy192;
yy192:
YYDEBUG(192, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'N'){
- if(yych == 'H') goto yy194;
- if(yych <= 'M') goto yy53;
- goto yy193;
- } else {
- if(yych <= 'h'){
- if(yych <= 'g') goto yy53;
- goto yy194;
- } else {
- if(yych != 'n') goto yy53;
- goto yy193;
- }
- }
+ if(yych == 'R') goto yy193;
+ if(yych != 'r') goto yy53;
+ goto yy193;
yy193:
YYDEBUG(193, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy199;
- if(yych == 'i') goto yy199;
- goto yy53;
+ if(yych == 'S') goto yy185;
+ if(yych == 's') goto yy185;
+ goto yy181;
yy194:
YYDEBUG(194, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy195;
- if(yych != 'n') goto yy53;
- goto yy195;
+ if(yych == 'I') goto yy207;
+ if(yych == 'i') goto yy207;
+ goto yy53;
yy195:
YYDEBUG(195, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy196;
- if(yych != 'i') goto yy53;
+ if(yych == 'R') goto yy196;
+ if(yych != 'r') goto yy53;
goto yy196;
yy196:
YYDEBUG(196, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy197;
- if(yych != 'g') goto yy53;
+ if(yych == 'T') goto yy197;
+ if(yych != 't') goto yy53;
goto yy197;
yy197:
YYDEBUG(197, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'H') goto yy198;
- if(yych != 'h') goto yy53;
- goto yy198;
+ if(yych <= 'N'){
+ if(yych == 'H') goto yy199;
+ if(yych <= 'M') goto yy53;
+ goto yy198;
+ } else {
+ if(yych <= 'h'){
+ if(yych <= 'g') goto yy53;
+ goto yy199;
+ } else {
+ if(yych != 'n') goto yy53;
+ goto yy198;
+ }
+ }
yy198:
YYDEBUG(198, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy188;
- if(yych == 't') goto yy188;
+ if(yych == 'I') goto yy204;
+ if(yych == 'i') goto yy204;
goto yy53;
yy199:
YYDEBUG(199, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy200;
- if(yych != 'g') goto yy53;
+ if(yych == 'N') goto yy200;
+ if(yych != 'n') goto yy53;
goto yy200;
yy200:
YYDEBUG(200, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'H') goto yy201;
- if(yych != 'h') goto yy53;
+ if(yych == 'I') goto yy201;
+ if(yych != 'i') goto yy53;
goto yy201;
yy201:
YYDEBUG(201, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy188;
- if(yych == 't') goto yy188;
- goto yy53;
+ if(yych == 'G') goto yy202;
+ if(yych != 'g') goto yy53;
+ goto yy202;
yy202:
YYDEBUG(202, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'D') goto yy203;
- if(yych != 'd') goto yy176;
+ yych = *++YYCURSOR;
+ if(yych == 'H') goto yy203;
+ if(yych != 'h') goto yy53;
goto yy203;
yy203:
YYDEBUG(203, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy204;
- if(yych != 'a') goto yy53;
- goto yy204;
+ if(yych == 'T') goto yy193;
+ if(yych == 't') goto yy193;
+ goto yy53;
yy204:
YYDEBUG(204, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy180;
- goto yy53;
+ if(yych == 'G') goto yy205;
+ if(yych != 'g') goto yy53;
+ goto yy205;
yy205:
YYDEBUG(205, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'E'){
- if(yych <= 'C') goto yy53;
- if(yych <= 'D') goto yy207;
- goto yy206;
- } else {
- if(yych <= 'c') goto yy53;
- if(yych <= 'd') goto yy207;
- if(yych >= 'f') goto yy53;
- goto yy206;
- }
+ if(yych == 'H') goto yy206;
+ if(yych != 'h') goto yy53;
+ goto yy206;
yy206:
YYDEBUG(206, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'K') goto yy188;
- if(yych == 'k') goto yy188;
+ if(yych == 'T') goto yy193;
+ if(yych == 't') goto yy193;
goto yy53;
yy207:
YYDEBUG(207, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'N') goto yy208;
- if(yych != 'n') goto yy176;
+ if(yych == 'D') goto yy208;
+ if(yych != 'd') goto yy181;
goto yy208;
yy208:
YYDEBUG(208, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy209;
- if(yych != 'e') goto yy53;
+ if(yych == 'A') goto yy209;
+ if(yych != 'a') goto yy53;
goto yy209;
yy209:
YYDEBUG(209, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'S') goto yy210;
- if(yych != 's') goto yy53;
- goto yy210;
+ if(yych == 'Y') goto yy185;
+ if(yych == 'y') goto yy185;
+ goto yy53;
yy210:
YYDEBUG(210, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'D') goto yy211;
- if(yych != 'd') goto yy53;
- goto yy211;
+ if(yych <= 'E'){
+ if(yych <= 'C') goto yy53;
+ if(yych <= 'D') goto yy212;
+ goto yy211;
+ } else {
+ if(yych <= 'c') goto yy53;
+ if(yych <= 'd') goto yy212;
+ if(yych >= 'f') goto yy53;
+ goto yy211;
+ }
yy211:
YYDEBUG(211, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy212;
- if(yych != 'a') goto yy53;
- goto yy212;
+ if(yych == 'K') goto yy218;
+ if(yych == 'k') goto yy218;
+ goto yy53;
yy212:
YYDEBUG(212, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy180;
- goto yy53;
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'N') goto yy213;
+ if(yych != 'n') goto yy181;
+ goto yy213;
yy213:
YYDEBUG(213, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy188;
- if(yych == 'y') goto yy188;
- goto yy53;
+ if(yych == 'E') goto yy214;
+ if(yych != 'e') goto yy53;
+ goto yy214;
yy214:
YYDEBUG(214, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'U') goto yy215;
- if(yych != 'u') goto yy53;
+ if(yych == 'S') goto yy215;
+ if(yych != 's') goto yy53;
goto yy215;
yy215:
YYDEBUG(215, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy188;
- if(yych == 'r') goto yy188;
- goto yy53;
+ if(yych == 'D') goto yy216;
+ if(yych != 'd') goto yy53;
+ goto yy216;
yy216:
YYDEBUG(216, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy221;
- if(yych == 'n') goto yy221;
- goto yy53;
+ if(yych == 'A') goto yy217;
+ if(yych != 'a') goto yy53;
+ goto yy217;
yy217:
YYDEBUG(217, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy218;
- if(yych != 'n') goto yy53;
- goto yy218;
+ if(yych == 'Y') goto yy185;
+ if(yych == 'y') goto yy185;
+ goto yy53;
yy218:
YYDEBUG(218, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
- if(yych == 'S') goto yy180;
- if(yych <= 'T') goto yy176;
- goto yy219;
+ if(yych <= 'S'){
+ if(yych == 'D') goto yy219;
+ if(yych <= 'R') goto yy181;
+ goto yy185;
} else {
- if(yych <= 's'){
- if(yych <= 'r') goto yy176;
- goto yy180;
- } else {
- if(yych != 'u') goto yy176;
+ if(yych <= 'd'){
+ if(yych <= 'c') goto yy181;
goto yy219;
+ } else {
+ if(yych == 's') goto yy185;
+ goto yy181;
}
}
yy219:
YYDEBUG(219, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy220;
- if(yych != 't') goto yy53;
+ if(yych == 'A') goto yy220;
+ if(yych != 'a') goto yy53;
goto yy220;
yy220:
YYDEBUG(220, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy188;
- if(yych == 'e') goto yy188;
- goto yy53;
+ if(yych == 'Y') goto yy221;
+ if(yych != 'y') goto yy53;
+ goto yy221;
yy221:
YYDEBUG(221, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'T'){
- if(yych == 'D') goto yy222;
- if(yych <= 'S') goto yy176;
- goto yy223;
- } else {
- if(yych <= 'd'){
- if(yych <= 'c') goto yy176;
- goto yy222;
- } else {
- if(yych == 't') goto yy223;
- goto yy176;
- }
- }
+ yych = *++YYCURSOR;
+ if(yych == 'S') goto yy185;
+ if(yych == 's') goto yy185;
+ goto yy181;
yy222:
YYDEBUG(222, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy224;
- if(yych == 'a') goto yy224;
+ if(yych == 'Y') goto yy193;
+ if(yych == 'y') goto yy193;
goto yy53;
yy223:
YYDEBUG(223, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'H') goto yy188;
- if(yych == 'h') goto yy188;
- goto yy53;
+ if(yych == 'U') goto yy224;
+ if(yych != 'u') goto yy53;
+ goto yy224;
yy224:
YYDEBUG(224, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy180;
+ if(yych == 'R') goto yy193;
+ if(yych == 'r') goto yy193;
goto yy53;
yy225:
YYDEBUG(225, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy236;
- if(yych == 'n') goto yy236;
+ if(yych == 'N') goto yy230;
+ if(yych == 'n') goto yy230;
goto yy53;
yy226:
YYDEBUG(226, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy231;
- if(yych == 't') goto yy231;
- goto yy53;
+ if(yych == 'N') goto yy227;
+ if(yych != 'n') goto yy53;
+ goto yy227;
yy227:
YYDEBUG(227, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'C') goto yy228;
- if(yych != 'c') goto yy53;
- goto yy228;
-yy228:
- YYDEBUG(228, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'S'){
- if(yych == 'O') goto yy229;
- if(yych <= 'R') goto yy176;
- goto yy180;
+ if(yych <= 'U'){
+ if(yych == 'S') goto yy185;
+ if(yych <= 'T') goto yy181;
+ goto yy228;
} else {
- if(yych <= 'o'){
- if(yych <= 'n') goto yy176;
- goto yy229;
+ if(yych <= 's'){
+ if(yych <= 'r') goto yy181;
+ goto yy185;
} else {
- if(yych == 's') goto yy180;
- goto yy176;
+ if(yych != 'u') goto yy181;
+ goto yy228;
}
}
+yy228:
+ YYDEBUG(228, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'T') goto yy229;
+ if(yych != 't') goto yy53;
+ goto yy229;
yy229:
YYDEBUG(229, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy230;
- if(yych != 'n') goto yy53;
- goto yy230;
+ if(yych == 'E') goto yy193;
+ if(yych == 'e') goto yy193;
+ goto yy53;
yy230:
YYDEBUG(230, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy188;
- if(yych == 'd') goto yy188;
- goto yy53;
-yy231:
- YYDEBUG(231, *YYCURSOR);
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'U') goto yy232;
- if(yych != 'u') goto yy176;
- goto yy232;
+ if(yych <= 'T'){
+ if(yych == 'D') goto yy231;
+ if(yych <= 'S') goto yy181;
+ goto yy232;
+ } else {
+ if(yych <= 'd'){
+ if(yych <= 'c') goto yy181;
+ goto yy231;
+ } else {
+ if(yych == 't') goto yy232;
+ goto yy181;
+ }
+ }
+yy231:
+ YYDEBUG(231, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy233;
+ if(yych == 'a') goto yy233;
+ goto yy53;
yy232:
YYDEBUG(232, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy233;
- if(yych != 'r') goto yy53;
- goto yy233;
+ if(yych == 'H') goto yy193;
+ if(yych == 'h') goto yy193;
+ goto yy53;
yy233:
YYDEBUG(233, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'D') goto yy234;
- if(yych != 'd') goto yy53;
- goto yy234;
+ if(yych == 'Y') goto yy185;
+ if(yych == 'y') goto yy185;
+ goto yy53;
yy234:
YYDEBUG(234, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy235;
- if(yych != 'a') goto yy53;
- goto yy235;
+ if(yych == 'N') goto yy245;
+ if(yych == 'n') goto yy245;
+ goto yy53;
yy235:
YYDEBUG(235, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy180;
+ if(yych == 'T') goto yy240;
+ if(yych == 't') goto yy240;
goto yy53;
yy236:
YYDEBUG(236, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'D') goto yy237;
- if(yych != 'd') goto yy176;
+ yych = *++YYCURSOR;
+ if(yych == 'C') goto yy237;
+ if(yych != 'c') goto yy53;
goto yy237;
yy237:
YYDEBUG(237, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy238;
- if(yych != 'a') goto yy53;
- goto yy238;
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'S'){
+ if(yych == 'O') goto yy238;
+ if(yych <= 'R') goto yy181;
+ goto yy185;
+ } else {
+ if(yych <= 'o'){
+ if(yych <= 'n') goto yy181;
+ goto yy238;
+ } else {
+ if(yych == 's') goto yy185;
+ goto yy181;
+ }
+ }
yy238:
YYDEBUG(238, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy180;
- goto yy53;
+ if(yych == 'N') goto yy239;
+ if(yych != 'n') goto yy53;
+ goto yy239;
yy239:
YYDEBUG(239, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy193;
+ if(yych == 'd') goto yy193;
+ goto yy53;
+yy240:
+ YYDEBUG(240, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'U') goto yy241;
+ if(yych != 'u') goto yy181;
+ goto yy241;
+yy241:
+ YYDEBUG(241, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'R') goto yy242;
+ if(yych != 'r') goto yy53;
+ goto yy242;
+yy242:
+ YYDEBUG(242, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'D') goto yy243;
+ if(yych != 'd') goto yy53;
+ goto yy243;
+yy243:
+ YYDEBUG(243, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy244;
+ if(yych != 'a') goto yy53;
+ goto yy244;
+yy244:
+ YYDEBUG(244, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy185;
+ if(yych == 'y') goto yy185;
+ goto yy53;
+yy245:
+ YYDEBUG(245, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == 'D') goto yy246;
+ if(yych != 'd') goto yy181;
+ goto yy246;
+yy246:
+ YYDEBUG(246, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy247;
+ if(yych != 'a') goto yy53;
+ goto yy247;
+yy247:
+ YYDEBUG(247, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy185;
+ if(yych == 'y') goto yy185;
+ goto yy53;
+yy248:
+ YYDEBUG(248, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy158;
+ if(yych <= 'D') goto yy138;
+ goto yy162;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy240;
- if(yych <= 'z') goto yy139;
+ if(yych == 'e') goto yy249;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy240:
- YYDEBUG(240, *YYCURSOR);
+yy249:
+ YYDEBUG(249, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'U') goto yy135;
- goto yy159;
+ if(yych <= 'U') goto yy139;
+ goto yy163;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'v') goto yy241;
- if(yych <= 'z') goto yy144;
+ if(yych == 'v') goto yy250;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy241:
- YYDEBUG(241, *YYCURSOR);
+yy250:
+ YYDEBUG(250, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'I'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'H') goto yy136;
- goto yy160;
+ if(yych <= 'H') goto yy140;
+ goto yy164;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'i') goto yy242;
- if(yych <= 'z') goto yy145;
+ if(yych == 'i') goto yy251;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy242:
- YYDEBUG(242, *YYCURSOR);
+yy251:
+ YYDEBUG(251, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'O'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy137;
- goto yy161;
+ if(yych <= 'N') goto yy141;
+ goto yy165;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'o') goto yy243;
- if(yych <= 'z') goto yy146;
+ if(yych == 'o') goto yy252;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy243:
- YYDEBUG(243, *YYCURSOR);
+yy252:
+ YYDEBUG(252, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'U'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'T') goto yy3;
- goto yy162;
+ goto yy166;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'u') goto yy244;
- if(yych <= 'z') goto yy147;
+ if(yych == 'u') goto yy253;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy244:
- YYDEBUG(244, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy53;
- goto yy140;
- } else {
- if(yych == 'S') goto yy163;
- goto yy53;
- }
- } else {
- if(yych <= 'r'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy53;
- goto yy147;
- } else {
- if(yych <= 's') goto yy245;
- if(yych <= 'z') goto yy147;
- goto yy53;
- }
- }
-yy245:
- YYDEBUG(245, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'h'){
- if(yych <= '`'){
- if(yych <= '/'){
- if(yych <= '.') goto yy164;
- goto yy140;
- } else {
- if(yych == '_') goto yy140;
- goto yy164;
- }
- } else {
- if(yych <= 'e'){
- if(yych == 'd') goto yy249;
- goto yy147;
- } else {
- if(yych <= 'f') goto yy251;
- if(yych <= 'g') goto yy147;
- goto yy248;
- }
- }
- } else {
- if(yych <= 't'){
- if(yych <= 'm'){
- if(yych <= 'l') goto yy147;
- goto yy247;
- } else {
- if(yych <= 'r') goto yy147;
- if(yych >= 't') goto yy253;
- goto yy246;
- }
- } else {
- if(yych <= 'x'){
- if(yych == 'w') goto yy250;
- goto yy147;
- } else {
- if(yych <= 'y') goto yy252;
- if(yych <= 'z') goto yy147;
- goto yy164;
- }
- }
- }
-yy246:
- YYDEBUG(246, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'U'){
- if(yych <= 'D'){
- if(yych == 'A') goto yy226;
- goto yy148;
- } else {
- if(yych <= 'E') goto yy227;
- if(yych <= 'T') goto yy148;
- goto yy225;
- }
- } else {
- if(yych <= 'd'){
- if(yych == 'a') goto yy305;
- goto yy148;
- } else {
- if(yych <= 'e') goto yy306;
- if(yych == 'u') goto yy307;
- goto yy148;
- }
- }
-yy247:
- YYDEBUG(247, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'O'){
- if(yych == 'I') goto yy217;
- if(yych <= 'N') goto yy148;
- goto yy216;
- } else {
- if(yych <= 'i'){
- if(yych <= 'h') goto yy148;
- goto yy296;
- } else {
- if(yych == 'o') goto yy297;
- goto yy148;
- }
- }
-yy248:
- YYDEBUG(248, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'O') goto yy214;
- if(yych == 'o') goto yy294;
- goto yy148;
-yy249:
- YYDEBUG(249, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy213;
- if(yych == 'a') goto yy293;
- goto yy148;
-yy250:
- YYDEBUG(250, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'E') goto yy205;
- if(yych == 'e') goto yy285;
- goto yy148;
-yy251:
- YYDEBUG(251, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'R'){
- if(yych == 'O') goto yy190;
- if(yych <= 'Q') goto yy148;
- goto yy189;
- } else {
- if(yych <= 'o'){
- if(yych <= 'n') goto yy148;
- goto yy269;
- } else {
- if(yych == 'r') goto yy270;
- goto yy148;
- }
- }
-yy252:
- YYDEBUG(252, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'E') goto yy186;
- if(yych == 'e') goto yy266;
- goto yy148;
yy253:
YYDEBUG(253, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'U'){
- if(yych == 'H') goto yy173;
- if(yych <= 'T') goto yy148;
- goto yy174;
- } else {
- if(yych <= 'h'){
- if(yych <= 'g') goto yy148;
- goto yy254;
- } else {
- if(yych == 'u') goto yy255;
- goto yy148;
- }
- }
+ if(yych == 'S') goto yy167;
+ if(yych != 's') goto yy152;
+ goto yy254;
yy254:
YYDEBUG(254, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'U') goto yy181;
- if(yych == 'u') goto yy261;
- goto yy148;
-yy255:
- YYDEBUG(255, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'E') goto yy175;
- if(yych != 'e') goto yy148;
- goto yy256;
-yy256:
- YYDEBUG(256, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
- goto yy140;
- } else {
- if(yych == 'S') goto yy177;
- goto yy176;
- }
- } else {
- if(yych <= 'r'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
- } else {
- if(yych <= 's') goto yy257;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
- }
-yy257:
- YYDEBUG(257, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy178;
- if(yych != 'd') goto yy148;
- goto yy258;
-yy258:
- YYDEBUG(258, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy179;
- if(yych != 'a') goto yy148;
- goto yy259;
-yy259:
- YYDEBUG(259, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych != 'y') goto yy148;
- goto yy260;
-yy260:
- YYDEBUG(260, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych == '/') goto yy140;
- goto yy176;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
-yy261:
- YYDEBUG(261, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
- goto yy140;
+ if(yych <= '.'){
+ if(yych <= 0x09){
+ if(yych <= 0x08) goto yy53;
+ goto yy168;
} else {
- if(yych == 'R') goto yy182;
- goto yy176;
+ if(yych == ' ') goto yy168;
+ goto yy53;
}
} else {
- if(yych <= 'q'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
+ if(yych <= '_'){
+ if(yych <= '/') goto yy144;
+ if(yych <= '^') goto yy53;
+ goto yy144;
} else {
- if(yych <= 'r') goto yy262;
- if(yych <= 'z') goto yy147;
- goto yy176;
+ if(yych <= '`') goto yy53;
+ if(yych <= 'z') goto yy151;
+ goto yy53;
}
}
-yy262:
- YYDEBUG(262, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'S') goto yy183;
- if(yych != 's') goto yy148;
- goto yy263;
-yy263:
- YYDEBUG(263, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy184;
- if(yych != 'd') goto yy148;
- goto yy264;
-yy264:
- YYDEBUG(264, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy185;
- if(yych != 'a') goto yy148;
- goto yy265;
-yy265:
- YYDEBUG(265, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy260;
- goto yy148;
-yy266:
- YYDEBUG(266, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy187;
- if(yych != 'a') goto yy148;
- goto yy267;
-yy267:
- YYDEBUG(267, *YYCURSOR);
+yy255:
+ YYDEBUG(255, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy188;
- if(yych != 'r') goto yy148;
- goto yy268;
-yy268:
- YYDEBUG(268, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
- goto yy140;
+ if(yych <= 'S'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy136;
} else {
- if(yych == 'S') goto yy180;
- goto yy176;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'R') goto yy138;
+ goto yy256;
}
} else {
if(yych <= 'r'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
- } else {
- if(yych <= 's') goto yy260;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
- }
-yy269:
- YYDEBUG(269, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'R') goto yy191;
- if(yych == 'r') goto yy274;
- goto yy148;
-yy270:
- YYDEBUG(270, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'I') goto yy202;
- if(yych != 'i') goto yy148;
- goto yy271;
-yy271:
- YYDEBUG(271, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
- goto yy140;
- } else {
- if(yych == 'D') goto yy203;
- goto yy176;
- }
- } else {
- if(yych <= 'c'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
- } else {
- if(yych <= 'd') goto yy272;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
- }
-yy272:
- YYDEBUG(272, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy204;
- if(yych != 'a') goto yy148;
- goto yy273;
-yy273:
- YYDEBUG(273, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy260;
- goto yy148;
-yy274:
- YYDEBUG(274, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'T') goto yy192;
- if(yych != 't') goto yy148;
- goto yy275;
-yy275:
- YYDEBUG(275, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'N'){
- if(yych == 'H') goto yy194;
- if(yych <= 'M') goto yy148;
- goto yy193;
- } else {
- if(yych <= 'h'){
- if(yych <= 'g') goto yy148;
- goto yy277;
- } else {
- if(yych != 'n') goto yy148;
- goto yy276;
- }
- }
-yy276:
- YYDEBUG(276, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'I') goto yy199;
- if(yych == 'i') goto yy282;
- goto yy148;
-yy277:
- YYDEBUG(277, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'N') goto yy195;
- if(yych != 'n') goto yy148;
- goto yy278;
-yy278:
- YYDEBUG(278, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'I') goto yy196;
- if(yych != 'i') goto yy148;
- goto yy279;
-yy279:
- YYDEBUG(279, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'G') goto yy197;
- if(yych != 'g') goto yy148;
- goto yy280;
-yy280:
- YYDEBUG(280, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'H') goto yy198;
- if(yych != 'h') goto yy148;
- goto yy281;
-yy281:
- YYDEBUG(281, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'T') goto yy188;
- if(yych == 't') goto yy268;
- goto yy148;
-yy282:
- YYDEBUG(282, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'G') goto yy200;
- if(yych != 'g') goto yy148;
- goto yy283;
-yy283:
- YYDEBUG(283, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'H') goto yy201;
- if(yych != 'h') goto yy148;
- goto yy284;
-yy284:
- YYDEBUG(284, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'T') goto yy188;
- if(yych == 't') goto yy268;
- goto yy148;
-yy285:
- YYDEBUG(285, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'E'){
- if(yych <= 'C') goto yy148;
- if(yych <= 'D') goto yy207;
- goto yy206;
- } else {
- if(yych <= 'c') goto yy148;
- if(yych <= 'd') goto yy287;
- if(yych >= 'f') goto yy148;
- goto yy286;
- }
-yy286:
- YYDEBUG(286, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'K') goto yy188;
- if(yych == 'k') goto yy268;
- goto yy148;
-yy287:
- YYDEBUG(287, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
- goto yy140;
- } else {
- if(yych == 'N') goto yy208;
- goto yy176;
- }
- } else {
- if(yych <= 'm'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
- } else {
- if(yych <= 'n') goto yy288;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
- }
-yy288:
- YYDEBUG(288, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'E') goto yy209;
- if(yych != 'e') goto yy148;
- goto yy289;
-yy289:
- YYDEBUG(289, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'S') goto yy210;
- if(yych != 's') goto yy148;
- goto yy290;
-yy290:
- YYDEBUG(290, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy211;
- if(yych != 'd') goto yy148;
- goto yy291;
-yy291:
- YYDEBUG(291, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy212;
- if(yych != 'a') goto yy148;
- goto yy292;
-yy292:
- YYDEBUG(292, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy260;
- goto yy148;
-yy293:
- YYDEBUG(293, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy188;
- if(yych == 'y') goto yy268;
- goto yy148;
-yy294:
- YYDEBUG(294, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'U') goto yy215;
- if(yych != 'u') goto yy148;
- goto yy295;
-yy295:
- YYDEBUG(295, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'R') goto yy188;
- if(yych == 'r') goto yy268;
- goto yy148;
-yy296:
- YYDEBUG(296, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'N') goto yy218;
- if(yych == 'n') goto yy302;
- goto yy148;
-yy297:
- YYDEBUG(297, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'N') goto yy221;
- if(yych != 'n') goto yy148;
- goto yy298;
-yy298:
- YYDEBUG(298, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= 'C'){
- if(yych == '/') goto yy140;
- goto yy176;
- } else {
- if(yych <= 'D') goto yy222;
- if(yych == 'T') goto yy223;
- goto yy176;
- }
- } else {
- if(yych <= 'd'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- if(yych <= 'c') goto yy147;
- goto yy299;
+ if(yych <= 'Z') goto yy138;
+ if(yych <= '`') goto yy3;
+ goto yy138;
} else {
- if(yych == 't') goto yy300;
- if(yych <= 'z') goto yy147;
- goto yy176;
+ if(yych <= 's') goto yy256;
+ if(yych <= 'z') goto yy138;
+ goto yy3;
}
}
-yy299:
- YYDEBUG(299, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy224;
- if(yych == 'a') goto yy301;
- goto yy148;
-yy300:
- YYDEBUG(300, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'H') goto yy188;
- if(yych == 'h') goto yy268;
- goto yy148;
-yy301:
- YYDEBUG(301, *YYCURSOR);
+yy256:
+ YYDEBUG(256, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy260;
- goto yy148;
-yy302:
- YYDEBUG(302, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= 'R'){
- if(yych == '/') goto yy140;
- goto yy176;
+ if(yych <= 'T'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy136;
} else {
- if(yych <= 'S') goto yy180;
- if(yych == 'U') goto yy219;
- goto yy176;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy139;
+ goto yy257;
}
} else {
if(yych <= 's'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- if(yych <= 'r') goto yy147;
- goto yy260;
- } else {
- if(yych == 'u') goto yy303;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
- }
-yy303:
- YYDEBUG(303, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'T') goto yy220;
- if(yych != 't') goto yy148;
- goto yy304;
-yy304:
- YYDEBUG(304, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'E') goto yy188;
- if(yych == 'e') goto yy268;
- goto yy148;
-yy305:
- YYDEBUG(305, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'T') goto yy231;
- if(yych == 't') goto yy314;
- goto yy148;
-yy306:
- YYDEBUG(306, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'C') goto yy228;
- if(yych == 'c') goto yy311;
- goto yy148;
-yy307:
- YYDEBUG(307, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'N') goto yy236;
- if(yych != 'n') goto yy148;
- goto yy308;
-yy308:
- YYDEBUG(308, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
- goto yy140;
- } else {
- if(yych == 'D') goto yy237;
- goto yy176;
- }
- } else {
- if(yych <= 'c'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy3;
+ goto yy139;
} else {
- if(yych <= 'd') goto yy309;
- if(yych <= 'z') goto yy147;
- goto yy176;
+ if(yych <= 't') goto yy257;
+ if(yych <= 'z') goto yy139;
+ goto yy3;
}
}
-yy309:
- YYDEBUG(309, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy238;
- if(yych != 'a') goto yy148;
- goto yy310;
-yy310:
- YYDEBUG(310, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy260;
- goto yy148;
-yy311:
- YYDEBUG(311, *YYCURSOR);
- yyaccept = 4;
+yy257:
+ YYDEBUG(257, *YYCURSOR);
+ yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= 'N'){
- if(yych == '/') goto yy140;
- goto yy176;
+ if(yych <= '('){
+ if(yych <= 0x09){
+ if(yych <= 0x08) goto yy3;
+ goto yy168;
} else {
- if(yych <= 'O') goto yy229;
- if(yych == 'S') goto yy180;
- goto yy176;
+ if(yych == ' ') goto yy168;
+ goto yy3;
}
} else {
- if(yych <= 'o'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- if(yych <= 'n') goto yy147;
- goto yy312;
- } else {
- if(yych == 's') goto yy260;
- if(yych <= 'z') goto yy147;
- goto yy176;
- }
- }
-yy312:
- YYDEBUG(312, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'N') goto yy230;
- if(yych != 'n') goto yy148;
- goto yy313;
-yy313:
- YYDEBUG(313, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy188;
- if(yych == 'd') goto yy268;
- goto yy148;
-yy314:
- YYDEBUG(314, *YYCURSOR);
- yyaccept = 4;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy176;
+ if(yych <= 'Z'){
+ if(yych <= ')') goto yy136;
+ if(yych <= '@') goto yy3;
goto yy140;
} else {
- if(yych == 'U') goto yy232;
- goto yy176;
- }
- } else {
- if(yych <= 't'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy176;
- goto yy147;
- } else {
- if(yych <= 'u') goto yy315;
- if(yych <= 'z') goto yy147;
- goto yy176;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy140;
+ goto yy3;
}
}
-yy315:
- YYDEBUG(315, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'R') goto yy233;
- if(yych != 'r') goto yy148;
- goto yy316;
-yy316:
- YYDEBUG(316, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'D') goto yy234;
- if(yych != 'd') goto yy148;
- goto yy317;
-yy317:
- YYDEBUG(317, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy235;
- if(yych != 'a') goto yy148;
- goto yy318;
-yy318:
- YYDEBUG(318, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy180;
- if(yych == 'y') goto yy260;
- goto yy148;
-yy319:
- YYDEBUG(319, *YYCURSOR);
- yych = *++YYCURSOR;
+yy258:
+ YYDEBUG(258, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
+ if(yych <= '.'){
+ if(yych == ')') goto yy136;
+ goto yy3;
} else {
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy134;
- goto yy320;
+ if(yych <= 'R') goto yy138;
+ goto yy256;
}
} else {
- if(yych <= 'r'){
- if(yych <= 'Z') goto yy134;
- if(yych <= '`') goto yy3;
- goto yy134;
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
+ goto yy3;
} else {
- if(yych <= 's') goto yy320;
- if(yych <= 'z') goto yy134;
+ if(yych == 's') goto yy259;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy320:
- YYDEBUG(320, *YYCURSOR);
- yych = *++YYCURSOR;
+yy259:
+ YYDEBUG(259, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
+ if(yych <= '.'){
+ if(yych == ')') goto yy136;
+ goto yy3;
} else {
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy321;
+ if(yych <= 'S') goto yy139;
+ goto yy257;
}
} else {
- if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy3;
} else {
- if(yych <= 't') goto yy321;
- if(yych <= 'z') goto yy135;
+ if(yych == 't') goto yy260;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy321:
- YYDEBUG(321, *YYCURSOR);
+yy260:
+ YYDEBUG(260, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- YYDEBUG(-1, yych);
- switch(yych){
- case 0x09: case ' ': goto yy163;
- case ')': goto yy132;
- 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': 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 yy136;
- case 'D': case 'd': goto yy325;
- case 'F': case 'f': goto yy327;
- case 'H': case 'h': goto yy324;
- case 'M': case 'm': goto yy323;
- case 'S': case 's': goto yy322;
- case 'T': case 't': goto yy329;
- case 'W': case 'w': goto yy326;
- case 'Y': case 'y': goto yy328;
- default: goto yy3;
- }
-yy322:
- YYDEBUG(322, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'U'){
- if(yych <= 'A'){
- if(yych == ')') goto yy132;
- if(yych <= '@') goto yy3;
- goto yy340;
+ if(yych <= '.'){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy168;
+ goto yy3;
} else {
- if(yych == 'E') goto yy341;
- if(yych <= 'T') goto yy137;
- goto yy342;
+ if(yych <= ' ') goto yy168;
+ if(yych == ')') goto yy136;
+ goto yy3;
}
} else {
- if(yych <= 'd'){
- if(yych <= 'Z') goto yy137;
- if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy340;
- goto yy137;
- } else {
- if(yych <= 't'){
- if(yych <= 'e') goto yy341;
- goto yy137;
- } else {
- if(yych <= 'u') goto yy342;
- if(yych <= 'z') goto yy137;
- goto yy3;
- }
- }
- }
-yy323:
- YYDEBUG(323, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'O'){
- if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych <= '^'){
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Z') goto yy140;
goto yy3;
} else {
- if(yych == 'I') goto yy338;
- if(yych <= 'N') goto yy137;
- goto yy339;
- }
- } else {
- if(yych <= 'i'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- if(yych <= 'h') goto yy137;
- goto yy338;
- } else {
- if(yych == 'o') goto yy339;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy324:
- YYDEBUG(324, *YYCURSOR);
+yy261:
+ YYDEBUG(261, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'O'){
+ if(yych <= 'G'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy137;
- goto yy337;
+ if(yych <= 'F') goto yy138;
+ goto yy268;
}
} else {
- if(yych <= 'n'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'f'){
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy137;
- } else {
- if(yych <= 'o') goto yy337;
- if(yych <= 'z') goto yy137;
- goto yy3;
- }
- }
-yy325:
- YYDEBUG(325, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'A'){
- if(yych == ')') goto yy132;
- if(yych <= '@') goto yy3;
- goto yy336;
- } else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- goto yy3;
+ goto yy138;
} else {
- if(yych <= 'a') goto yy336;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'g') goto yy268;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy326:
- YYDEBUG(326, *YYCURSOR);
+yy262:
+ YYDEBUG(262, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy137;
- goto yy335;
+ if(yych <= 'D') goto yy138;
+ goto yy263;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy138;
} else {
- if(yych <= 'e') goto yy335;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'e') goto yy263;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy327:
- YYDEBUG(327, *YYCURSOR);
+yy263:
+ YYDEBUG(263, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'R'){
- if(yych <= '@'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= 'V'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy136;
} else {
- if(yych == 'O') goto yy333;
- if(yych <= 'Q') goto yy137;
- goto yy334;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'U') goto yy139;
+ goto yy264;
}
} else {
- if(yych <= 'o'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'u'){
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- if(yych <= 'n') goto yy137;
- goto yy333;
+ goto yy139;
} else {
- if(yych == 'r') goto yy334;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'v') goto yy264;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy328:
- YYDEBUG(328, *YYCURSOR);
+yy264:
+ YYDEBUG(264, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy137;
- goto yy332;
+ if(yych <= 'D') goto yy140;
+ goto yy265;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy140;
} else {
- if(yych <= 'e') goto yy332;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'e') goto yy265;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy329:
- YYDEBUG(329, *YYCURSOR);
+yy265:
+ YYDEBUG(265, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'U'){
- if(yych <= '@'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= 'N'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy136;
} else {
- if(yych == 'H') goto yy330;
- if(yych <= 'T') goto yy137;
- goto yy331;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy141;
+ goto yy266;
}
} else {
- if(yych <= 'h'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- if(yych <= 'g') goto yy137;
- goto yy330;
+ goto yy141;
} else {
- if(yych == 'u') goto yy331;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'n') goto yy266;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy330:
- YYDEBUG(330, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'T'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'U') goto yy181;
- if(yych == 'u') goto yy181;
- goto yy3;
- }
-yy331:
- YYDEBUG(331, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'D'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'E') goto yy175;
- if(yych == 'e') goto yy175;
- goto yy3;
- }
-yy332:
- YYDEBUG(332, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '@'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'A') goto yy187;
- if(yych == 'a') goto yy187;
- goto yy3;
- }
-yy333:
- YYDEBUG(333, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'Q'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'R') goto yy191;
- if(yych == 'r') goto yy191;
- goto yy3;
- }
-yy334:
- YYDEBUG(334, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'H'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'I') goto yy202;
- if(yych == 'i') goto yy202;
- goto yy3;
- }
-yy335:
- YYDEBUG(335, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'D'){
- if(yych == ')') goto yy132;
- if(yych <= 'C') goto yy3;
- goto yy207;
- } else {
- if(yych <= 'c'){
- if(yych <= 'E') goto yy206;
- goto yy3;
- } else {
- if(yych <= 'd') goto yy207;
- if(yych <= 'e') goto yy206;
- goto yy3;
- }
- }
-yy336:
- YYDEBUG(336, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'X'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'Y') goto yy188;
- if(yych == 'y') goto yy188;
- goto yy3;
- }
-yy337:
- YYDEBUG(337, *YYCURSOR);
+yy266:
+ YYDEBUG(266, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'T'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'U') goto yy215;
- if(yych == 'u') goto yy215;
- goto yy3;
- }
-yy338:
- YYDEBUG(338, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'M'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'N') goto yy218;
- if(yych == 'n') goto yy218;
- goto yy3;
- }
-yy339:
- YYDEBUG(339, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'M'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'N') goto yy221;
- if(yych == 'n') goto yy221;
- goto yy3;
- }
-yy340:
- YYDEBUG(340, *YYCURSOR);
- yych = *++YYCURSOR;
if(yych <= 'S'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'T') goto yy231;
- if(yych == 't') goto yy231;
- goto yy3;
+ if(yych <= 'T') goto yy267;
+ if(yych != 't') goto yy3;
+ goto yy267;
}
-yy341:
- YYDEBUG(341, *YYCURSOR);
+yy267:
+ YYDEBUG(267, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'B'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'C') goto yy228;
- if(yych == 'c') goto yy228;
- goto yy3;
- }
-yy342:
- YYDEBUG(342, *YYCURSOR);
+ if(yych == 'H') goto yy167;
+ if(yych == 'h') goto yy167;
+ goto yy53;
+yy268:
+ YYDEBUG(268, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'M'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'N') goto yy236;
- if(yych == 'n') goto yy236;
- goto yy3;
- }
-yy343:
- YYDEBUG(343, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'S'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= 'H'){
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy136;
} else {
- if(yych <= '/') goto yy140;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy134;
- goto yy320;
+ if(yych <= 'G') goto yy139;
+ goto yy269;
}
} else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
- goto yy3;
+ if(yych <= 'g'){
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy3;
+ goto yy139;
} else {
- if(yych == 's') goto yy344;
+ if(yych <= 'h') goto yy269;
if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy344:
- YYDEBUG(344, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
+yy269:
+ YYDEBUG(269, *YYCURSOR);
+ yych = *++YYCURSOR;
if(yych <= 'T'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= ')'){
+ if(yych <= '(') goto yy3;
+ goto yy136;
} else {
- if(yych <= '/') goto yy140;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy321;
+ if(yych <= 'S') goto yy140;
+ goto yy270;
}
} else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy3;
+ if(yych <= 's'){
+ if(yych <= 'Z') goto yy140;
+ if(yych <= '`') goto yy3;
+ goto yy140;
} else {
- if(yych == 't') goto yy345;
- if(yych <= 'z') goto yy144;
+ if(yych <= 't') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy345:
- YYDEBUG(345, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- YYDEBUG(-1, yych);
- switch(yych){
- case 0x09: case ' ': goto yy163;
- case ')': goto yy132;
- case '/': case '_': goto yy140;
- 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 yy136;
- case 'D': goto yy325;
- case 'F': goto yy327;
- case 'H': goto yy324;
- case 'M': goto yy323;
- case 'S': goto yy322;
- case 'T': goto yy329;
- case 'W': goto yy326;
- case 'Y': goto yy328;
- 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 yy145;
- case 'd': goto yy349;
- case 'f': goto yy351;
- case 'h': goto yy348;
- case 'm': goto yy347;
- case 's': goto yy346;
- case 't': goto yy353;
- case 'w': goto yy350;
- case 'y': goto yy352;
- default: goto yy3;
- }
-yy346:
- YYDEBUG(346, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
- if(yych <= '@'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych == '/') goto yy140;
- goto yy3;
- }
- } else {
- if(yych <= 'D'){
- if(yych <= 'A') goto yy340;
- goto yy137;
- } else {
- if(yych <= 'E') goto yy341;
- if(yych <= 'T') goto yy137;
- goto yy342;
- }
- }
- } else {
- if(yych <= 'a'){
- if(yych <= '^'){
- if(yych <= 'Z') goto yy137;
- goto yy3;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy364;
- }
- } else {
- if(yych <= 't'){
- if(yych == 'e') goto yy365;
- goto yy146;
- } else {
- if(yych <= 'u') goto yy366;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
- }
-yy347:
- YYDEBUG(347, *YYCURSOR);
+yy270:
+ YYDEBUG(270, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'O'){
- if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy3;
- goto yy140;
- } else {
- if(yych <= 'H'){
- if(yych <= '@') goto yy3;
- goto yy137;
- } else {
- if(yych <= 'I') goto yy338;
- if(yych <= 'N') goto yy137;
- goto yy339;
- }
- }
- } else {
- if(yych <= 'h'){
- if(yych <= '^'){
- if(yych <= 'Z') goto yy137;
- goto yy3;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy146;
- }
+ if(yych <= '('){
+ if(yych <= 0x09){
+ if(yych <= 0x08) goto yy3;
+ goto yy168;
} else {
- if(yych <= 'n'){
- if(yych <= 'i') goto yy362;
- goto yy146;
- } else {
- if(yych <= 'o') goto yy363;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
- }
-yy348:
- YYDEBUG(348, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'O'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ' ') goto yy168;
goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy137;
- goto yy337;
}
} else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'o') goto yy361;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
-yy349:
- YYDEBUG(349, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'A'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
+ if(yych <= 'Z'){
+ if(yych <= ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy336;
- }
- } else {
- if(yych <= '_'){
- if(yych <= 'Z') goto yy137;
- if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy141;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy360;
- if(yych <= 'z') goto yy146;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy350:
- YYDEBUG(350, *YYCURSOR);
+yy271:
+ YYDEBUG(271, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'E'){
+ if(yych <= 'G'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy137;
- goto yy335;
+ if(yych <= 'F') goto yy138;
+ goto yy268;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy359;
- if(yych <= 'z') goto yy146;
+ if(yych == 'g') goto yy278;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy351:
- YYDEBUG(351, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'R'){
- if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy3;
- goto yy140;
- } else {
- if(yych <= 'N'){
- if(yych <= '@') goto yy3;
- goto yy137;
- } else {
- if(yych <= 'O') goto yy333;
- if(yych <= 'Q') goto yy137;
- goto yy334;
- }
- }
- } else {
- if(yych <= 'n'){
- if(yych <= '^'){
- if(yych <= 'Z') goto yy137;
- goto yy3;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy146;
- }
- } else {
- if(yych <= 'q'){
- if(yych <= 'o') goto yy357;
- goto yy146;
- } else {
- if(yych <= 'r') goto yy358;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
- }
-yy352:
- YYDEBUG(352, *YYCURSOR);
+yy272:
+ YYDEBUG(272, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy137;
- goto yy332;
+ if(yych <= 'D') goto yy138;
+ goto yy263;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy356;
- if(yych <= 'z') goto yy146;
+ if(yych == 'e') goto yy273;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy353:
- YYDEBUG(353, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
- if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy3;
- goto yy140;
- } else {
- if(yych <= 'G'){
- if(yych <= '@') goto yy3;
- goto yy137;
- } else {
- if(yych <= 'H') goto yy330;
- if(yych <= 'T') goto yy137;
- goto yy331;
- }
- }
- } else {
- if(yych <= 'g'){
- if(yych <= '^'){
- if(yych <= 'Z') goto yy137;
- goto yy3;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy146;
- }
- } else {
- if(yych <= 't'){
- if(yych >= 'i') goto yy146;
- goto yy354;
- } else {
- if(yych <= 'u') goto yy355;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
- }
-yy354:
- YYDEBUG(354, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'T') goto yy3;
- goto yy181;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'u') goto yy261;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy355:
- YYDEBUG(355, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'E'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'D') goto yy3;
- goto yy175;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'e') goto yy256;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy356:
- YYDEBUG(356, *YYCURSOR);
+yy273:
+ YYDEBUG(273, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'A'){
+ if(yych <= 'V'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy187;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych <= 'a') goto yy267;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy357:
- YYDEBUG(357, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'R'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'Q') goto yy3;
- goto yy191;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'r') goto yy274;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy358:
- YYDEBUG(358, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'I'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'H') goto yy3;
- goto yy202;
+ if(yych <= 'U') goto yy139;
+ goto yy264;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'i') goto yy271;
- if(yych <= 'z') goto yy147;
+ if(yych == 'v') goto yy274;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy359:
- YYDEBUG(359, *YYCURSOR);
+yy274:
+ YYDEBUG(274, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'C') goto yy3;
- if(yych <= 'D') goto yy207;
- goto yy206;
- }
- } else {
- if(yych <= 'c'){
- if(yych == '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy147;
- } else {
- if(yych <= 'd') goto yy287;
- if(yych <= 'e') goto yy286;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy360:
- YYDEBUG(360, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'Y'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'X') goto yy3;
- goto yy188;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'D') goto yy140;
+ goto yy265;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy268;
- if(yych <= 'z') goto yy147;
+ if(yych == 'e') goto yy275;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy361:
- YYDEBUG(361, *YYCURSOR);
+yy275:
+ YYDEBUG(275, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
+ if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'T') goto yy3;
- goto yy215;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'M') goto yy141;
+ goto yy266;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'u') goto yy295;
- if(yych <= 'z') goto yy147;
+ if(yych == 'n') goto yy276;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy362:
- YYDEBUG(362, *YYCURSOR);
+yy276:
+ YYDEBUG(276, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'N'){
+ if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'M') goto yy3;
- goto yy218;
+ if(yych <= '/') goto yy144;
+ if(yych <= 'S') goto yy3;
+ goto yy267;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy302;
- if(yych <= 'z') goto yy147;
+ if(yych == 't') goto yy277;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy363:
- YYDEBUG(363, *YYCURSOR);
+yy277:
+ YYDEBUG(277, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'H') goto yy167;
+ if(yych == 'h') goto yy254;
+ goto yy152;
+yy278:
+ YYDEBUG(278, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'N'){
+ if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'M') goto yy3;
- goto yy221;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'G') goto yy139;
+ goto yy269;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy298;
- if(yych <= 'z') goto yy147;
+ if(yych == 'h') goto yy279;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy364:
- YYDEBUG(364, *YYCURSOR);
+yy279:
+ YYDEBUG(279, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'S') goto yy3;
- goto yy231;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'S') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy314;
- if(yych <= 'z') goto yy147;
+ if(yych == 't') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy365:
- YYDEBUG(365, *YYCURSOR);
+yy280:
+ YYDEBUG(280, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'C'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'B') goto yy3;
- goto yy228;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= '.'){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy168;
goto yy3;
} else {
- if(yych == 'c') goto yy311;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy366:
- YYDEBUG(366, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'N'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych <= ' ') goto yy168;
+ if(yych == ')') goto yy136;
goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'M') goto yy3;
- goto yy236;
}
} else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= '^'){
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy3;
+ if(yych <= 'Z') goto yy141;
goto yy3;
} else {
- if(yych == 'n') goto yy308;
- if(yych <= 'z') goto yy147;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy367:
- YYDEBUG(367, *YYCURSOR);
+yy281:
+ YYDEBUG(281, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'G'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
+ if(yych <= 'E'){
+ if(yych <= '@'){
+ if(yych == ')') goto yy136;
+ goto yy3;
} else {
- if(yych <= '@') goto yy3;
- if(yych <= 'F') goto yy134;
- goto yy374;
+ if(yych <= 'C') goto yy138;
+ if(yych >= 'E') goto yy284;
+ goto yy282;
}
} else {
- if(yych <= 'f'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'c'){
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'g') goto yy374;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'd') goto yy282;
+ if(yych <= 'e') goto yy284;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy368:
- YYDEBUG(368, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'E'){
+yy282:
+ YYDEBUG(282, *YYCURSOR);
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= 'N'){
if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
+ if(yych >= ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy369;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'M') goto yy139;
+ goto yy290;
}
} else {
- if(yych <= 'd'){
- if(yych <= 'Z') goto yy134;
- if(yych <= '`') goto yy3;
- goto yy134;
+ if(yych <= 'm'){
+ if(yych <= 'Z') goto yy139;
+ if(yych >= 'a') goto yy139;
+ goto yy283;
} else {
- if(yych <= 'e') goto yy369;
- if(yych <= 'z') goto yy134;
- goto yy3;
+ if(yych <= 'n') goto yy290;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy369:
- YYDEBUG(369, *YYCURSOR);
+yy283:
+ YYDEBUG(283, *YYCURSOR);
+
+#line 1365 "ext/date/lib/parse_date.re"
+{
+ const timelib_relunit* relunit;
+ DEBUG_OUTPUT("daytext");
+ 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_WEEKDAY;
+ }
+#line 4503 "ext/date/lib/parse_date.c"
+yy284:
+ YYDEBUG(284, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'V'){
+ if(yych <= 'K'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'U') goto yy135;
- goto yy370;
+ if(yych <= 'J') goto yy139;
+ goto yy285;
}
} else {
- if(yych <= 'u'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'j'){
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'v') goto yy370;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'k') goto yy285;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy370:
- YYDEBUG(370, *YYCURSOR);
+yy285:
+ YYDEBUG(285, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'E'){
+ if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy136;
- goto yy371;
+ if(yych <= 'C') goto yy140;
+ goto yy286;
}
} else {
- if(yych <= 'd'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'c'){
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'e') goto yy371;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'd') goto yy286;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy371:
- YYDEBUG(371, *YYCURSOR);
+yy286:
+ YYDEBUG(286, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'N'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy137;
- goto yy372;
- }
+ if(yych <= 'A'){
+ if(yych == ')') goto yy136;
+ if(yych <= '@') goto yy3;
+ goto yy287;
} else {
- if(yych <= 'm'){
- if(yych <= 'Z') goto yy137;
- if(yych <= '`') goto yy3;
- goto yy137;
+ if(yych <= '`'){
+ if(yych <= 'Z') goto yy141;
+ goto yy3;
} else {
- if(yych <= 'n') goto yy372;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'a') goto yy287;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy372:
- YYDEBUG(372, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'S'){
- if(yych == ')') goto yy132;
+yy287:
+ YYDEBUG(287, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'X'){
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'T') goto yy373;
- if(yych != 't') goto yy3;
- goto yy373;
+ if(yych <= 'Y') goto yy288;
+ if(yych != 'y') goto yy3;
+ goto yy288;
}
-yy373:
- YYDEBUG(373, *YYCURSOR);
+yy288:
+ YYDEBUG(288, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'H') goto yy163;
- if(yych == 'h') goto yy163;
- goto yy53;
-yy374:
- YYDEBUG(374, *YYCURSOR);
+ if(yych == 'S') goto yy289;
+ if(yych != 's') goto yy283;
+ goto yy289;
+yy289:
+ YYDEBUG(289, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'H'){
+ goto yy283;
+yy290:
+ YYDEBUG(290, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy135;
- goto yy375;
+ if(yych <= 'D') goto yy140;
+ goto yy291;
}
} else {
- if(yych <= 'g'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'd'){
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy140;
} else {
- if(yych <= 'h') goto yy375;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'e') goto yy291;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy375:
- YYDEBUG(375, *YYCURSOR);
+yy291:
+ YYDEBUG(291, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= 'T'){
+ if(yych <= 'S'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy136;
- goto yy376;
+ if(yych <= 'R') goto yy141;
+ goto yy292;
}
} else {
- if(yych <= 's'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'r'){
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy136;
- } else {
- if(yych <= 't') goto yy376;
- if(yych <= 'z') goto yy136;
- goto yy3;
- }
- }
-yy376:
- YYDEBUG(376, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- YYDEBUG(-1, yych);
- switch(yych){
- case 0x09: case ' ': goto yy163;
- case ')': goto yy132;
- 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': 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 yy137;
- case 'D': case 'd': goto yy377;
- case 'F': case 'f': goto yy378;
- case 'H': case 'h': goto yy379;
- case 'M': case 'm': goto yy380;
- case 'S': case 's': goto yy381;
- case 'T': case 't': goto yy382;
- case 'W': case 'w': goto yy383;
- case 'Y': case 'y': goto yy384;
- default: goto yy3;
- }
-yy377:
- YYDEBUG(377, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '@'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'A') goto yy213;
- if(yych == 'a') goto yy213;
- goto yy3;
- }
-yy378:
- YYDEBUG(378, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'Q'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych == 'O') goto yy190;
- goto yy3;
- }
- } else {
- if(yych <= 'o'){
- if(yych <= 'R') goto yy189;
- if(yych <= 'n') goto yy3;
- goto yy190;
- } else {
- if(yych == 'r') goto yy189;
- goto yy3;
- }
- }
-yy379:
- YYDEBUG(379, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'N'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'O') goto yy214;
- if(yych == 'o') goto yy214;
- goto yy3;
- }
-yy380:
- YYDEBUG(380, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'N'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych == 'I') goto yy217;
- goto yy3;
- }
- } else {
- if(yych <= 'i'){
- if(yych <= 'O') goto yy216;
- if(yych <= 'h') goto yy3;
- goto yy217;
- } else {
- if(yych == 'o') goto yy216;
- goto yy3;
- }
- }
-yy381:
- YYDEBUG(381, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'T'){
- if(yych <= '@'){
- if(yych == ')') goto yy132;
- goto yy3;
+ goto yy141;
} else {
- if(yych <= 'A') goto yy226;
- if(yych == 'E') goto yy227;
- goto yy3;
- }
- } else {
- if(yych <= 'd'){
- if(yych <= 'U') goto yy225;
- if(yych == 'a') goto yy226;
- goto yy3;
- } else {
- if(yych <= 'e') goto yy227;
- if(yych == 'u') goto yy225;
+ if(yych <= 's') goto yy292;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy382:
- YYDEBUG(382, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'T'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych == 'H') goto yy173;
- goto yy3;
- }
- } else {
- if(yych <= 'h'){
- if(yych <= 'U') goto yy174;
- if(yych <= 'g') goto yy3;
- goto yy173;
- } else {
- if(yych == 'u') goto yy174;
- goto yy3;
- }
- }
-yy383:
- YYDEBUG(383, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'D'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'E') goto yy205;
- if(yych == 'e') goto yy205;
- goto yy3;
- }
-yy384:
- YYDEBUG(384, *YYCURSOR);
+yy292:
+ YYDEBUG(292, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'D'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'E') goto yy186;
- if(yych == 'e') goto yy186;
+ if(yych <= 'C'){
+ if(yych == ')') goto yy136;
goto yy3;
- }
-yy385:
- YYDEBUG(385, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'G'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy3;
- if(yych <= 'F') goto yy134;
- goto yy374;
- }
- } else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'g') goto yy392;
- if(yych <= 'z') goto yy139;
- goto yy3;
- }
- }
-yy386:
- YYDEBUG(386, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'E'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy369;
- }
- } else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'e') goto yy387;
- if(yych <= 'z') goto yy139;
- goto yy3;
- }
- }
-yy387:
- YYDEBUG(387, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'V'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy3;
- if(yych <= 'U') goto yy135;
- goto yy370;
- }
} else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'v') goto yy388;
- if(yych <= 'z') goto yy144;
- goto yy3;
- }
+ if(yych <= 'D') goto yy293;
+ if(yych != 'd') goto yy3;
+ goto yy293;
}
-yy388:
- YYDEBUG(388, *YYCURSOR);
+yy293:
+ YYDEBUG(293, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'A') goto yy294;
+ if(yych != 'a') goto yy53;
+ goto yy294;
+yy294:
+ YYDEBUG(294, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'Y') goto yy289;
+ if(yych == 'y') goto yy289;
+ goto yy53;
+yy295:
+ YYDEBUG(295, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= '/'){
+ if(yych == ')') goto yy136;
+ if(yych <= '.') goto yy3;
+ goto yy144;
} else {
- if(yych <= '/') goto yy140;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy136;
- goto yy371;
+ if(yych <= 'C') goto yy138;
+ if(yych <= 'D') goto yy282;
+ goto yy284;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy389;
- if(yych <= 'z') goto yy145;
- goto yy3;
+ if(yych <= 'd'){
+ if(yych <= 'c') goto yy143;
+ goto yy296;
+ } else {
+ if(yych <= 'e') goto yy297;
+ if(yych <= 'z') goto yy143;
+ goto yy3;
+ }
}
}
-yy389:
- YYDEBUG(389, *YYCURSOR);
- yyaccept = 0;
+yy296:
+ YYDEBUG(296, *YYCURSOR);
+ yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy137;
- goto yy372;
- }
- } else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'n') goto yy390;
- if(yych <= 'z') goto yy146;
- goto yy3;
- }
- }
-yy390:
- YYDEBUG(390, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'T'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'S') goto yy3;
- goto yy373;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'M') goto yy139;
+ goto yy290;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 't') goto yy391;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy391:
- YYDEBUG(391, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy53;
- goto yy140;
- } else {
- if(yych == 'H') goto yy163;
- goto yy53;
- }
- } else {
- if(yych <= 'g'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy53;
- goto yy147;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych <= 'h') goto yy245;
- if(yych <= 'z') goto yy147;
- goto yy53;
+ if(yych == 'n') goto yy303;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy392:
- YYDEBUG(392, *YYCURSOR);
+yy297:
+ YYDEBUG(297, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'H'){
+ if(yych <= 'K'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy135;
- goto yy375;
+ if(yych <= 'J') goto yy139;
+ goto yy285;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy393;
- if(yych <= 'z') goto yy144;
+ if(yych == 'k') goto yy298;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy393:
- YYDEBUG(393, *YYCURSOR);
+yy298:
+ YYDEBUG(298, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'T'){
+ if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy136;
- goto yy376;
+ if(yych <= 'C') goto yy140;
+ goto yy286;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 'd') goto yy299;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy394:
- YYDEBUG(394, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- YYDEBUG(-1, yych);
- switch(yych){
- case 0x09: case ' ': goto yy163;
- case ')': goto yy132;
- case '/': case '_': goto yy140;
- 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 yy137;
- case 'D': goto yy377;
- case 'F': goto yy378;
- case 'H': goto yy379;
- case 'M': goto yy380;
- case 'S': goto yy381;
- case 'T': goto yy382;
- case 'W': goto yy383;
- case 'Y': goto yy384;
- 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 yy146;
- case 'd': goto yy395;
- case 'f': goto yy396;
- case 'h': goto yy397;
- case 'm': goto yy398;
- case 's': goto yy399;
- case 't': goto yy400;
- case 'w': goto yy401;
- case 'y': goto yy402;
- default: goto yy3;
- }
-yy395:
- YYDEBUG(395, *YYCURSOR);
+yy299:
+ YYDEBUG(299, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy213;
+ goto yy287;
}
} else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych <= 'a') goto yy293;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy396:
- YYDEBUG(396, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'R'){
- if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy3;
- goto yy140;
+ if(yych <= '_'){
+ if(yych <= 'Z') goto yy141;
+ if(yych <= '^') goto yy3;
+ goto yy144;
} else {
- if(yych == 'O') goto yy190;
- if(yych <= 'Q') goto yy3;
- goto yy189;
- }
- } else {
- if(yych <= 'n'){
- if(yych == '_') goto yy140;
if(yych <= '`') goto yy3;
- goto yy147;
- } else {
- if(yych <= 'q'){
- if(yych <= 'o') goto yy269;
- goto yy147;
- } else {
- if(yych <= 'r') goto yy270;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
- }
-yy397:
- YYDEBUG(397, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'O'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'N') goto yy3;
- goto yy214;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych <= 'a') goto yy300;
+ if(yych <= 'z') goto yy150;
goto yy3;
- } else {
- if(yych == 'o') goto yy294;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy398:
- YYDEBUG(398, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'O'){
- if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy3;
- goto yy140;
- } else {
- if(yych == 'I') goto yy217;
- if(yych <= 'N') goto yy3;
- goto yy216;
- }
- } else {
- if(yych <= 'h'){
- if(yych == '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy147;
- } else {
- if(yych <= 'n'){
- if(yych <= 'i') goto yy296;
- goto yy147;
- } else {
- if(yych <= 'o') goto yy297;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
}
}
-yy399:
- YYDEBUG(399, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
- if(yych <= '@'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych == '/') goto yy140;
- goto yy3;
- }
- } else {
- if(yych <= 'D'){
- if(yych <= 'A') goto yy226;
- goto yy3;
- } else {
- if(yych <= 'E') goto yy227;
- if(yych <= 'T') goto yy3;
- goto yy225;
- }
- }
- } else {
- if(yych <= 'd'){
- if(yych <= '_'){
- if(yych <= '^') goto yy3;
- goto yy140;
- } else {
- if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy305;
- goto yy147;
- }
- } else {
- if(yych <= 't'){
- if(yych <= 'e') goto yy306;
- goto yy147;
- } else {
- if(yych <= 'u') goto yy307;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
- }
-yy400:
- YYDEBUG(400, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'U'){
- if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy3;
- goto yy140;
- } else {
- if(yych == 'H') goto yy173;
- if(yych <= 'T') goto yy3;
- goto yy174;
- }
- } else {
- if(yych <= 'g'){
- if(yych == '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy147;
- } else {
- if(yych <= 't'){
- if(yych <= 'h') goto yy254;
- goto yy147;
- } else {
- if(yych <= 'u') goto yy255;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
- }
-yy401:
- YYDEBUG(401, *YYCURSOR);
+yy300:
+ YYDEBUG(300, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'E'){
+ if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= 'D') goto yy3;
- goto yy205;
+ if(yych <= '/') goto yy144;
+ if(yych <= 'X') goto yy3;
+ goto yy288;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy285;
- if(yych <= 'z') goto yy147;
+ if(yych == 'y') goto yy301;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy402:
- YYDEBUG(402, *YYCURSOR);
- yyaccept = 0;
+yy301:
+ YYDEBUG(301, *YYCURSOR);
+ yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'E'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= 'D') goto yy3;
- goto yy186;
- }
- } else {
- if(yych <= '`'){
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'e') goto yy266;
- if(yych <= 'z') goto yy147;
- goto yy3;
- }
- }
-yy403:
- YYDEBUG(403, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'D'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy134;
- goto yy404;
- }
- } else {
- if(yych <= 'c'){
- if(yych <= 'Z') goto yy134;
- if(yych <= '`') goto yy3;
- goto yy134;
- } else {
- if(yych <= 'd') goto yy404;
- if(yych <= 'z') goto yy134;
- goto yy3;
- }
- }
-yy404:
- YYDEBUG(404, *YYCURSOR);
- ++YYCURSOR;
- if((yych = *YYCURSOR) <= 'N'){
- if(yych <= ')'){
- if(yych >= ')') goto yy132;
- goto yy405;
- } else {
- if(yych <= '@') goto yy405;
- if(yych <= 'M') goto yy135;
- goto yy406;
- }
- } else {
- if(yych <= 'm'){
- if(yych <= 'Z') goto yy135;
- if(yych >= 'a') goto yy135;
- goto yy405;
- } else {
- if(yych <= 'n') goto yy406;
- if(yych <= 'z') goto yy135;
- goto yy405;
- }
- }
-yy405:
- YYDEBUG(405, *YYCURSOR);
-
-#line 1336 "ext/date/lib/parse_date.re"
-{
- const timelib_relunit* relunit;
- DEBUG_OUTPUT("daytext");
- 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_WEEKDAY;
- }
-#line 6251 "ext/date/lib/parse_date.c"
-yy406:
- YYDEBUG(406, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'E'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
- } else {
- if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy136;
- goto yy407;
- }
- } else {
- if(yych <= 'd'){
- if(yych <= 'Z') goto yy136;
- if(yych <= '`') goto yy3;
- goto yy136;
- } else {
- if(yych <= 'e') goto yy407;
- if(yych <= 'z') goto yy136;
- goto yy3;
- }
- }
-yy407:
- YYDEBUG(407, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= 'S'){
- if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
+ if(yych <= '^'){
+ if(yych <= '/'){
+ if(yych <= '.') goto yy283;
+ goto yy144;
} else {
- if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy137;
- goto yy408;
+ if(yych == 'S') goto yy289;
+ goto yy283;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy137;
- if(yych <= '`') goto yy3;
- goto yy137;
- } else {
- if(yych <= 's') goto yy408;
- if(yych <= 'z') goto yy137;
- goto yy3;
- }
- }
-yy408:
- YYDEBUG(408, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'C'){
- if(yych == ')') goto yy132;
- goto yy3;
- } else {
- if(yych <= 'D') goto yy409;
- if(yych != 'd') goto yy3;
- goto yy409;
- }
-yy409:
- YYDEBUG(409, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'A') goto yy410;
- if(yych != 'a') goto yy53;
- goto yy410;
-yy410:
- YYDEBUG(410, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == 'Y') goto yy411;
- if(yych != 'y') goto yy53;
- goto yy411;
-yy411:
- YYDEBUG(411, *YYCURSOR);
- yych = *++YYCURSOR;
- goto yy405;
-yy412:
- YYDEBUG(412, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'D'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy283;
+ goto yy151;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy134;
- goto yy404;
- }
- } else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
- goto yy3;
- } else {
- if(yych == 'd') goto yy413;
- if(yych <= 'z') goto yy139;
- goto yy3;
+ if(yych <= 's') goto yy302;
+ if(yych <= 'z') goto yy151;
+ goto yy283;
}
}
-yy413:
- YYDEBUG(413, *YYCURSOR);
+yy302:
+ YYDEBUG(302, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'N'){
- if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
- } else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'M') goto yy135;
- goto yy406;
- }
+ if(yych <= '^'){
+ if(yych == '/') goto yy144;
+ goto yy283;
} else {
- if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
- } else {
- if(yych == 'n') goto yy414;
- if(yych <= 'z') goto yy144;
- goto yy405;
- }
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy283;
+ if(yych <= 'z') goto yy151;
+ goto yy283;
}
-yy414:
- YYDEBUG(414, *YYCURSOR);
+yy303:
+ YYDEBUG(303, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy136;
- goto yy407;
+ if(yych <= 'D') goto yy140;
+ goto yy291;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy415;
- if(yych <= 'z') goto yy145;
+ if(yych == 'e') goto yy304;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy415:
- YYDEBUG(415, *YYCURSOR);
+yy304:
+ YYDEBUG(304, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy137;
- goto yy408;
+ if(yych <= 'R') goto yy141;
+ goto yy292;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 's') goto yy416;
- if(yych <= 'z') goto yy146;
+ if(yych == 's') goto yy305;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy416:
- YYDEBUG(416, *YYCURSOR);
+yy305:
+ YYDEBUG(305, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'C') goto yy3;
- goto yy409;
+ goto yy293;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy417;
- if(yych <= 'z') goto yy147;
+ if(yych == 'd') goto yy306;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy417:
- YYDEBUG(417, *YYCURSOR);
+yy306:
+ YYDEBUG(306, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy410;
- if(yych != 'a') goto yy148;
- goto yy418;
-yy418:
- YYDEBUG(418, *YYCURSOR);
+ if(yych == 'A') goto yy294;
+ if(yych != 'a') goto yy152;
+ goto yy307;
+yy307:
+ YYDEBUG(307, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy411;
- if(yych != 'y') goto yy148;
- goto yy419;
-yy419:
- YYDEBUG(419, *YYCURSOR);
- yyaccept = 5;
- yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '^'){
- if(yych == '/') goto yy140;
- goto yy405;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy405;
- if(yych <= 'z') goto yy147;
- goto yy405;
- }
-yy420:
- YYDEBUG(420, *YYCURSOR);
+ if(yych == 'Y') goto yy289;
+ if(yych == 'y') goto yy302;
+ goto yy152;
+yy308:
+ YYDEBUG(308, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'C'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'B') goto yy134;
- goto yy421;
+ if(yych <= 'B') goto yy138;
+ goto yy309;
}
} else {
if(yych <= 'b'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'c') goto yy421;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'c') goto yy309;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy421:
- YYDEBUG(421, *YYCURSOR);
- yyaccept = 0;
+yy309:
+ YYDEBUG(309, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych >= 0x09) goto yy312;
+ goto yy310;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych == 'E') goto yy429;
- goto yy135;
+ if(yych == 'E') goto yy318;
+ goto yy139;
}
} else {
if(yych <= 'd'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych >= 'a') goto yy139;
+ goto yy310;
} else {
- if(yych <= 'e') goto yy429;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'e') goto yy318;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy422:
- YYDEBUG(422, *YYCURSOR);
+yy310:
+ YYDEBUG(310, *YYCURSOR);
+
+#line 1398 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("monthtext");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_lookup_month((char **) &ptr);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_TEXT;
+ }
+#line 4957 "ext/date/lib/parse_date.c"
+yy311:
+ YYDEBUG(311, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 20) YYFILL(20);
yych = *YYCURSOR;
- goto yy423;
-yy423:
- YYDEBUG(423, *YYCURSOR);
+ goto yy312;
+yy312:
+ YYDEBUG(312, *YYCURSOR);
if(yybm[0+yych] & 64) {
- goto yy422;
+ goto yy311;
}
if(yych <= '/') goto yy53;
- if(yych <= '2') goto yy425;
- if(yych <= '3') goto yy427;
- if(yych <= '9') goto yy428;
+ if(yych <= '2') goto yy314;
+ if(yych <= '3') goto yy316;
+ if(yych <= '9') goto yy317;
goto yy53;
-yy424:
- YYDEBUG(424, *YYCURSOR);
+yy313:
+ YYDEBUG(313, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy423;
- if(yych <= '0') goto yy511;
- if(yych <= '2') goto yy512;
- if(yych <= '3') goto yy513;
- goto yy423;
-yy425:
- YYDEBUG(425, *YYCURSOR);
- yyaccept = 6;
+ if(yych <= '/') goto yy312;
+ if(yych <= '0') goto yy473;
+ if(yych <= '2') goto yy474;
+ if(yych <= '3') goto yy475;
+ goto yy312;
+yy314:
+ YYDEBUG(314, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy441;
- goto yy493;
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy412;
+ goto yy413;
} else {
- if(yych <= '2') goto yy510;
- if(yych <= '9') goto yy493;
- goto yy441;
+ if(yych <= '2') goto yy471;
+ if(yych <= '9') goto yy472;
+ goto yy332;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy437;
- if(yych <= 'q') goto yy441;
- goto yy438;
+ if(yych <= 'n') goto yy328;
+ if(yych <= 'q') goto yy332;
+ goto yy329;
} else {
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy426:
- YYDEBUG(426, *YYCURSOR);
+yy315:
+ YYDEBUG(315, *YYCURSOR);
-#line 1151 "ext/date/lib/parse_date.re"
+#line 1177 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datetextual | datenoyear");
TIMELIB_INIT;
@@ -7421,256 +5646,291 @@ yy426:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
-#line 6561 "ext/date/lib/parse_date.c"
-yy427:
- YYDEBUG(427, *YYCURSOR);
- yyaccept = 6;
+#line 5012 "ext/date/lib/parse_date.c"
+yy316:
+ YYDEBUG(316, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy441;
- goto yy493;
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy412;
+ goto yy413;
} else {
- if(yych <= '2') goto yy434;
- if(yych <= '9') goto yy435;
- goto yy441;
+ if(yych <= '2') goto yy325;
+ if(yych <= '9') goto yy326;
+ goto yy332;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy437;
- if(yych <= 'q') goto yy441;
- goto yy438;
+ if(yych <= 'n') goto yy328;
+ if(yych <= 'q') goto yy332;
+ goto yy329;
} else {
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy428:
- YYDEBUG(428, *YYCURSOR);
- yyaccept = 6;
+yy317:
+ YYDEBUG(317, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy441;
- goto yy433;
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy323;
+ goto yy324;
} else {
- if(yych <= '2') goto yy434;
- if(yych <= '9') goto yy435;
- goto yy441;
+ if(yych <= '2') goto yy325;
+ if(yych <= '9') goto yy326;
+ goto yy332;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy437;
- if(yych <= 'q') goto yy441;
- goto yy438;
+ if(yych <= 'n') goto yy328;
+ if(yych <= 'q') goto yy332;
+ goto yy329;
} else {
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy429:
- YYDEBUG(429, *YYCURSOR);
+yy318:
+ YYDEBUG(318, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'M'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'L') goto yy136;
- goto yy430;
+ if(yych <= 'L') goto yy140;
+ goto yy319;
}
} else {
if(yych <= 'l'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'm') goto yy430;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'm') goto yy319;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy430:
- YYDEBUG(430, *YYCURSOR);
+yy319:
+ YYDEBUG(319, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'B'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy137;
- goto yy431;
+ if(yych <= 'A') goto yy141;
+ goto yy320;
}
} else {
if(yych <= 'a'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'b') goto yy431;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'b') goto yy320;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy431:
- YYDEBUG(431, *YYCURSOR);
+yy320:
+ YYDEBUG(320, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'E') goto yy432;
+ if(yych <= 'E') goto yy321;
if(yych != 'e') goto yy3;
- goto yy432;
+ goto yy321;
}
-yy432:
- YYDEBUG(432, *YYCURSOR);
+yy321:
+ YYDEBUG(321, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy422;
- if(yych == 'r') goto yy422;
- goto yy53;
-yy433:
- YYDEBUG(433, *YYCURSOR);
+ if(yych == 'R') goto yy322;
+ if(yych != 'r') goto yy53;
+ goto yy322;
+yy322:
+ YYDEBUG(322, *YYCURSOR);
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy312;
+ if(yych <= 0x1F) goto yy310;
+ goto yy312;
+ } else {
+ if(yych <= '.'){
+ if(yych <= ',') goto yy310;
+ goto yy312;
+ } else {
+ if(yych <= '/') goto yy310;
+ if(yych <= '9') goto yy312;
+ goto yy310;
+ }
+ }
+yy323:
+ YYDEBUG(323, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy337;
+ goto yy315;
} else {
- if(yych <= '9') goto yy492;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '0') goto yy410;
+ if(yych <= '9') goto yy411;
+ if(yych <= ':') goto yy337;
+ goto yy315;
}
-yy434:
- YYDEBUG(434, *YYCURSOR);
- yyaccept = 6;
+yy324:
+ YYDEBUG(324, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '3') goto yy492;
- if(yych <= '9') goto yy489;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '2') goto yy411;
+ if(yych <= '9') goto yy410;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy435:
- YYDEBUG(435, *YYCURSOR);
- yyaccept = 6;
+yy325:
+ YYDEBUG(325, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '9') goto yy489;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '3') goto yy410;
+ if(yych <= '9') goto yy407;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy436:
- YYDEBUG(436, *YYCURSOR);
- yyaccept = 6;
+yy326:
+ YYDEBUG(326, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy441;
-yy437:
- YYDEBUG(437, *YYCURSOR);
- yyaccept = 6;
+ if(yych <= '/'){
+ if(yych == '.') goto yy378;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy407;
+ if(yych <= ':') goto yy378;
+ goto yy315;
+ }
+yy327:
+ YYDEBUG(327, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy441;
-yy438:
- YYDEBUG(438, *YYCURSOR);
- yyaccept = 6;
+ goto yy332;
+yy328:
+ YYDEBUG(328, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy441;
-yy439:
- YYDEBUG(439, *YYCURSOR);
- yyaccept = 6;
+ goto yy332;
+yy329:
+ YYDEBUG(329, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
- goto yy441;
-yy440:
- YYDEBUG(440, *YYCURSOR);
- yyaccept = 6;
+ goto yy332;
+yy330:
+ YYDEBUG(330, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy332;
+yy331:
+ YYDEBUG(331, *YYCURSOR);
+ yyaccept = 7;
YYMARKER = ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 17) YYFILL(17);
yych = *YYCURSOR;
- goto yy441;
-yy441:
- YYDEBUG(441, *YYCURSOR);
+ goto yy332;
+yy332:
+ YYDEBUG(332, *YYCURSOR);
if(yybm[0+yych] & 128) {
- goto yy440;
+ goto yy331;
}
if(yych <= '2'){
- if(yych <= '/') goto yy426;
- if(yych <= '1') goto yy482;
- goto yy483;
+ if(yych <= '/') goto yy315;
+ if(yych <= '0') goto yy373;
+ if(yych <= '1') goto yy374;
+ goto yy375;
} else {
- if(yych <= '9') goto yy484;
- if(yych != 'T') goto yy426;
- goto yy442;
+ if(yych <= '9') goto yy376;
+ if(yych != 'T') goto yy315;
+ goto yy333;
}
-yy442:
- YYDEBUG(442, *YYCURSOR);
+yy333:
+ YYDEBUG(333, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy443;
- if(yych <= '2') goto yy444;
- if(yych <= '9') goto yy445;
+ if(yych <= '1') goto yy334;
+ if(yych <= '2') goto yy335;
+ if(yych <= '9') goto yy336;
goto yy53;
-yy443:
- YYDEBUG(443, *YYCURSOR);
+yy334:
+ YYDEBUG(334, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/'){
- if(yych == '.') goto yy446;
+ if(yych == '.') goto yy337;
goto yy53;
} else {
- if(yych <= '9') goto yy445;
- if(yych <= ':') goto yy446;
+ if(yych <= '9') goto yy336;
+ if(yych <= ':') goto yy337;
goto yy53;
}
-yy444:
- YYDEBUG(444, *YYCURSOR);
+yy335:
+ YYDEBUG(335, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/'){
- if(yych == '.') goto yy446;
+ if(yych == '.') goto yy337;
goto yy53;
} else {
- if(yych <= '3') goto yy445;
- if(yych == ':') goto yy446;
+ if(yych <= '3') goto yy336;
+ if(yych == ':') goto yy337;
goto yy53;
}
-yy445:
- YYDEBUG(445, *YYCURSOR);
+yy336:
+ YYDEBUG(336, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '.') goto yy446;
+ if(yych == '.') goto yy337;
if(yych != ':') goto yy53;
- goto yy446;
-yy446:
- YYDEBUG(446, *YYCURSOR);
+ goto yy337;
+yy337:
+ YYDEBUG(337, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy447;
- if(yych <= '9') goto yy449;
+ if(yych <= '5') goto yy338;
+ if(yych <= '9') goto yy340;
goto yy53;
-yy447:
- YYDEBUG(447, *YYCURSOR);
- yyaccept = 7;
+yy338:
+ YYDEBUG(338, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy450;
- goto yy448;
+ if(yych == '.') goto yy341;
+ goto yy339;
} else {
- if(yych <= '9') goto yy449;
- if(yych <= ':') goto yy450;
- goto yy448;
+ if(yych <= '9') goto yy340;
+ if(yych <= ':') goto yy341;
+ goto yy339;
}
-yy448:
- YYDEBUG(448, *YYCURSOR);
+yy339:
+ YYDEBUG(339, *YYCURSOR);
-#line 1383 "ext/date/lib/parse_date.re"
+#line 1446 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
@@ -7699,466 +5959,869 @@ yy448:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
-#line 6795 "ext/date/lib/parse_date.c"
-yy449:
- YYDEBUG(449, *YYCURSOR);
- yyaccept = 7;
+#line 5277 "ext/date/lib/parse_date.c"
+yy340:
+ YYDEBUG(340, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy450;
- if(yych != ':') goto yy448;
- goto yy450;
-yy450:
- YYDEBUG(450, *YYCURSOR);
+ if(yych == '.') goto yy341;
+ if(yych != ':') goto yy339;
+ goto yy341;
+yy341:
+ YYDEBUG(341, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy451;
- if(yych <= '6') goto yy452;
- if(yych <= '9') goto yy453;
+ if(yych <= '5') goto yy342;
+ if(yych <= '6') goto yy343;
+ if(yych <= '9') goto yy344;
goto yy53;
-yy451:
- YYDEBUG(451, *YYCURSOR);
+yy342:
+ YYDEBUG(342, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy448;
- if(yych <= '9') goto yy454;
- goto yy448;
-yy452:
- YYDEBUG(452, *YYCURSOR);
+ if(yych <= '/') goto yy339;
+ if(yych <= '9') goto yy345;
+ goto yy339;
+yy343:
+ YYDEBUG(343, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '0') goto yy454;
- goto yy448;
-yy453:
- YYDEBUG(453, *YYCURSOR);
+ if(yych == '0') goto yy345;
+ goto yy339;
+yy344:
+ YYDEBUG(344, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy448;
-yy454:
- YYDEBUG(454, *YYCURSOR);
- yyaccept = 7;
+ goto yy339;
+yy345:
+ YYDEBUG(345, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '*'){
if(yych <= 0x1F){
- if(yych != 0x09) goto yy448;
- goto yy455;
+ if(yych != 0x09) goto yy339;
+ goto yy346;
} else {
- if(yych <= ' ') goto yy455;
- if(yych == '(') goto yy458;
- goto yy448;
+ if(yych <= ' ') goto yy346;
+ if(yych == '(') goto yy349;
+ goto yy339;
}
} else {
if(yych <= '@'){
- if(yych == ',') goto yy448;
- if(yych <= '-') goto yy457;
- goto yy448;
+ if(yych == ',') goto yy339;
+ if(yych <= '-') goto yy348;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy459;
- if(yych <= '`') goto yy448;
- if(yych <= 'z') goto yy460;
- goto yy448;
+ if(yych <= 'Z') goto yy350;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy351;
+ goto yy339;
}
}
-yy455:
- YYDEBUG(455, *YYCURSOR);
+yy346:
+ YYDEBUG(346, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
yych = *YYCURSOR;
- goto yy456;
-yy456:
- YYDEBUG(456, *YYCURSOR);
+ goto yy347;
+yy347:
+ YYDEBUG(347, *YYCURSOR);
if(yych <= '*'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy455;
+ if(yych == 0x09) goto yy346;
goto yy53;
} else {
- if(yych <= ' ') goto yy455;
- if(yych == '(') goto yy458;
+ if(yych <= ' ') goto yy346;
+ if(yych == '(') goto yy349;
goto yy53;
}
} else {
if(yych <= '@'){
if(yych == ',') goto yy53;
if(yych >= '.') goto yy53;
- goto yy457;
+ goto yy348;
} else {
- if(yych <= 'Z') goto yy459;
+ if(yych <= 'Z') goto yy350;
if(yych <= '`') goto yy53;
- if(yych <= 'z') goto yy460;
+ if(yych <= 'z') goto yy351;
goto yy53;
}
}
-yy457:
- YYDEBUG(457, *YYCURSOR);
+yy348:
+ YYDEBUG(348, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy477;
- if(yych <= '2') goto yy478;
- if(yych <= '9') goto yy479;
+ if(yych <= '1') goto yy368;
+ if(yych <= '2') goto yy369;
+ if(yych <= '9') goto yy370;
goto yy53;
-yy458:
- YYDEBUG(458, *YYCURSOR);
+yy349:
+ YYDEBUG(349, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@') goto yy53;
- if(yych <= 'Z') goto yy460;
+ if(yych <= 'Z') goto yy351;
if(yych <= '`') goto yy53;
- if(yych <= 'z') goto yy460;
+ if(yych <= 'z') goto yy351;
goto yy53;
-yy459:
- YYDEBUG(459, *YYCURSOR);
+yy350:
+ YYDEBUG(350, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy453;
- goto yy448;
+ if(yych == ')') goto yy344;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy461;
- if(yych <= '`') goto yy448;
- if(yych <= 'z') goto yy466;
- goto yy448;
+ if(yych <= 'Z') goto yy352;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy357;
+ goto yy339;
}
-yy460:
- YYDEBUG(460, *YYCURSOR);
+yy351:
+ YYDEBUG(351, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy453;
- goto yy448;
+ if(yych == ')') goto yy344;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy461;
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy461;
+ if(yych <= 'Z') goto yy352;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy352;
}
-yy461:
- YYDEBUG(461, *YYCURSOR);
+yy352:
+ YYDEBUG(352, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy453;
- goto yy448;
+ if(yych == ')') goto yy344;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy462;
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy462;
+ if(yych <= 'Z') goto yy353;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy353;
}
-yy462:
- YYDEBUG(462, *YYCURSOR);
+yy353:
+ YYDEBUG(353, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy453;
- goto yy448;
+ if(yych == ')') goto yy344;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy463;
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy463;
+ if(yych <= 'Z') goto yy354;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy354;
}
-yy463:
- YYDEBUG(463, *YYCURSOR);
+yy354:
+ YYDEBUG(354, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy453;
- goto yy448;
+ if(yych == ')') goto yy344;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy464;
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy464;
+ if(yych <= 'Z') goto yy355;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy355;
}
-yy464:
- YYDEBUG(464, *YYCURSOR);
+yy355:
+ YYDEBUG(355, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '@'){
- if(yych == ')') goto yy453;
- goto yy448;
+ if(yych == ')') goto yy344;
+ goto yy339;
} else {
- if(yych <= 'Z') goto yy465;
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy465;
+ if(yych <= 'Z') goto yy356;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy356;
}
-yy465:
- YYDEBUG(465, *YYCURSOR);
+yy356:
+ YYDEBUG(356, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == ')') goto yy453;
- goto yy448;
-yy466:
- YYDEBUG(466, *YYCURSOR);
- yyaccept = 7;
+ if(yych == ')') goto yy344;
+ goto yy339;
+yy357:
+ YYDEBUG(357, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy448;
- goto yy453;
+ if(yych <= '(') goto yy339;
+ goto yy344;
} else {
- if(yych == '/') goto yy468;
- goto yy448;
+ if(yych == '/') goto yy359;
+ goto yy339;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy462;
- if(yych <= '^') goto yy448;
- goto yy468;
+ if(yych <= 'Z') goto yy353;
+ if(yych <= '^') goto yy339;
+ goto yy359;
} else {
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy467;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy358;
}
}
-yy467:
- YYDEBUG(467, *YYCURSOR);
- yyaccept = 7;
+yy358:
+ YYDEBUG(358, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy448;
- goto yy453;
+ if(yych <= '(') goto yy339;
+ goto yy344;
} else {
- if(yych != '/') goto yy448;
- goto yy468;
+ if(yych != '/') goto yy339;
+ goto yy359;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy463;
- if(yych <= '^') goto yy448;
- goto yy468;
+ if(yych <= 'Z') goto yy354;
+ if(yych <= '^') goto yy339;
+ goto yy359;
} else {
- if(yych <= '`') goto yy448;
- if(yych <= 'z') goto yy472;
- goto yy448;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy363;
+ goto yy339;
}
}
-yy468:
- YYDEBUG(468, *YYCURSOR);
+yy359:
+ YYDEBUG(359, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
if(yych <= '@') goto yy53;
if(yych >= '[') goto yy53;
- goto yy469;
-yy469:
- YYDEBUG(469, *YYCURSOR);
+ goto yy360;
+yy360:
+ YYDEBUG(360, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
if(yych <= '`') goto yy53;
if(yych >= '{') goto yy53;
- goto yy470;
-yy470:
- YYDEBUG(470, *YYCURSOR);
- yyaccept = 7;
+ goto yy361;
+yy361:
+ YYDEBUG(361, *YYCURSOR);
+ yyaccept = 8;
YYMARKER = ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy471;
-yy471:
- YYDEBUG(471, *YYCURSOR);
+ goto yy362;
+yy362:
+ YYDEBUG(362, *YYCURSOR);
if(yych <= '^'){
- if(yych == '/') goto yy468;
- goto yy448;
+ if(yych == '/') goto yy359;
+ goto yy339;
} else {
- if(yych <= '_') goto yy468;
- if(yych <= '`') goto yy448;
- if(yych <= 'z') goto yy470;
- goto yy448;
+ if(yych <= '_') goto yy359;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy361;
+ goto yy339;
}
-yy472:
- YYDEBUG(472, *YYCURSOR);
- yyaccept = 7;
+yy363:
+ YYDEBUG(363, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy448;
- goto yy453;
+ if(yych <= '(') goto yy339;
+ goto yy344;
} else {
- if(yych == '/') goto yy468;
- goto yy448;
+ if(yych == '/') goto yy359;
+ goto yy339;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy464;
- if(yych <= '^') goto yy448;
- goto yy468;
+ if(yych <= 'Z') goto yy355;
+ if(yych <= '^') goto yy339;
+ goto yy359;
} else {
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy473;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy364;
}
}
-yy473:
- YYDEBUG(473, *YYCURSOR);
- yyaccept = 7;
+yy364:
+ YYDEBUG(364, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy448;
- goto yy453;
+ if(yych <= '(') goto yy339;
+ goto yy344;
} else {
- if(yych == '/') goto yy468;
- goto yy448;
+ if(yych == '/') goto yy359;
+ goto yy339;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy465;
- if(yych <= '^') goto yy448;
- goto yy468;
+ if(yych <= 'Z') goto yy356;
+ if(yych <= '^') goto yy339;
+ goto yy359;
} else {
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy474;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy365;
}
}
-yy474:
- YYDEBUG(474, *YYCURSOR);
- yyaccept = 7;
+yy365:
+ YYDEBUG(365, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == ')') goto yy453;
- if(yych <= '.') goto yy448;
- goto yy468;
+ if(yych == ')') goto yy344;
+ if(yych <= '.') goto yy339;
+ goto yy359;
} else {
if(yych <= '_'){
- if(yych <= '^') goto yy448;
- goto yy468;
+ if(yych <= '^') goto yy339;
+ goto yy359;
} else {
- if(yych <= '`') goto yy448;
- if(yych >= '{') goto yy448;
- goto yy475;
+ if(yych <= '`') goto yy339;
+ if(yych >= '{') goto yy339;
+ goto yy366;
}
}
-yy475:
- YYDEBUG(475, *YYCURSOR);
+yy366:
+ YYDEBUG(366, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy476;
-yy476:
- YYDEBUG(476, *YYCURSOR);
+ goto yy367;
+yy367:
+ YYDEBUG(367, *YYCURSOR);
if(yych <= '^'){
- if(yych == '/') goto yy468;
+ if(yych == '/') goto yy359;
goto yy53;
} else {
- if(yych <= '_') goto yy468;
+ if(yych <= '_') goto yy359;
if(yych <= '`') goto yy53;
- if(yych <= 'z') goto yy475;
+ if(yych <= 'z') goto yy366;
goto yy53;
}
-yy477:
- YYDEBUG(477, *YYCURSOR);
+yy368:
+ YYDEBUG(368, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy448;
- if(yych <= '9') goto yy479;
- if(yych <= ':') goto yy480;
- goto yy448;
-yy478:
- YYDEBUG(478, *YYCURSOR);
+ if(yych <= '/') goto yy339;
+ if(yych <= '9') goto yy370;
+ if(yych <= ':') goto yy371;
+ goto yy339;
+yy369:
+ YYDEBUG(369, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '5'){
- if(yych <= '/') goto yy448;
- if(yych >= '4') goto yy481;
- goto yy479;
+ if(yych <= '/') goto yy339;
+ if(yych >= '4') goto yy372;
+ goto yy370;
} else {
- if(yych <= '9') goto yy453;
- if(yych <= ':') goto yy480;
- goto yy448;
+ if(yych <= '9') goto yy344;
+ if(yych <= ':') goto yy371;
+ goto yy339;
}
-yy479:
- YYDEBUG(479, *YYCURSOR);
+yy370:
+ YYDEBUG(370, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy448;
- if(yych <= '5') goto yy481;
- if(yych <= '9') goto yy453;
- if(yych >= ';') goto yy448;
- goto yy480;
-yy480:
- YYDEBUG(480, *YYCURSOR);
+ if(yych <= '/') goto yy339;
+ if(yych <= '5') goto yy372;
+ if(yych <= '9') goto yy344;
+ if(yych >= ';') goto yy339;
+ goto yy371;
+yy371:
+ YYDEBUG(371, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy448;
- if(yych <= '5') goto yy481;
- if(yych <= '9') goto yy453;
- goto yy448;
-yy481:
- YYDEBUG(481, *YYCURSOR);
+ if(yych <= '/') goto yy339;
+ if(yych <= '5') goto yy372;
+ if(yych <= '9') goto yy344;
+ goto yy339;
+yy372:
+ YYDEBUG(372, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy448;
- if(yych <= '9') goto yy453;
- goto yy448;
-yy482:
- YYDEBUG(482, *YYCURSOR);
- yyaccept = 6;
+ if(yych <= '/') goto yy339;
+ if(yych <= '9') goto yy344;
+ goto yy339;
+yy373:
+ YYDEBUG(373, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy337;
+ goto yy315;
} else {
- if(yych <= '9') goto yy488;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '0') goto yy405;
+ if(yych <= '9') goto yy406;
+ if(yych <= ':') goto yy337;
+ goto yy315;
}
-yy483:
- YYDEBUG(483, *YYCURSOR);
- yyaccept = 6;
+yy374:
+ YYDEBUG(374, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '3') goto yy488;
- if(yych <= '9') goto yy485;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '2') goto yy406;
+ if(yych <= '9') goto yy405;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy484:
- YYDEBUG(484, *YYCURSOR);
- yyaccept = 6;
+yy375:
+ YYDEBUG(375, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '9') goto yy485;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '3') goto yy405;
+ if(yych <= '9') goto yy377;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy485:
- YYDEBUG(485, *YYCURSOR);
+yy376:
+ YYDEBUG(376, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy378;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy377;
+ if(yych <= ':') goto yy378;
+ goto yy315;
+ }
+yy377:
+ YYDEBUG(377, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy426;
- if(yych >= ':') goto yy426;
- goto yy486;
-yy486:
- YYDEBUG(486, *YYCURSOR);
+ if(yych <= '/') goto yy315;
+ if(yych <= '9') goto yy403;
+ goto yy315;
+yy378:
+ YYDEBUG(378, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy426;
- if(yych >= ':') goto yy426;
- goto yy487;
-yy487:
- YYDEBUG(487, *YYCURSOR);
+ if(yych <= '/') goto yy53;
+ if(yych <= '5') goto yy379;
+ if(yych <= '9') goto yy380;
+ goto yy53;
+yy379:
+ YYDEBUG(379, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy381;
+ goto yy339;
+ } else {
+ if(yych <= '9') goto yy396;
+ if(yych <= ':') goto yy381;
+ goto yy339;
+ }
+yy380:
+ YYDEBUG(380, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '.') goto yy381;
+ if(yych != ':') goto yy339;
+ goto yy381;
+yy381:
+ YYDEBUG(381, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy426;
-yy488:
- YYDEBUG(488, *YYCURSOR);
- yyaccept = 6;
+ if(yych <= '/') goto yy53;
+ if(yych <= '5') goto yy382;
+ if(yych <= '6') goto yy383;
+ if(yych <= '9') goto yy344;
+ goto yy53;
+yy382:
+ YYDEBUG(382, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy339;
+ if(yych <= '9') goto yy384;
+ goto yy339;
+yy383:
+ YYDEBUG(383, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych != '0') goto yy339;
+ goto yy384;
+yy384:
+ YYDEBUG(384, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '*'){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy386;
+ goto yy339;
+ } else {
+ if(yych <= ' ') goto yy386;
+ if(yych == '(') goto yy386;
+ goto yy339;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych == ',') goto yy339;
+ if(yych <= '-') goto yy386;
+ goto yy339;
+ } else {
+ if(yych <= 'Z') goto yy386;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy386;
+ goto yy339;
+ }
+ }
+yy385:
+ YYDEBUG(385, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
+ yych = *YYCURSOR;
+ goto yy386;
+yy386:
+ YYDEBUG(386, *YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= '\''){
+ if(yych <= 0x09){
+ if(yych <= 0x08) goto yy53;
+ goto yy385;
+ } else {
+ if(yych == ' ') goto yy385;
+ goto yy53;
+ }
+ } else {
+ if(yych <= '*'){
+ if(yych <= '(') goto yy349;
+ goto yy53;
+ } else {
+ if(yych == ',') goto yy53;
+ goto yy348;
+ }
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= 'A'){
+ if(yych <= '@') goto yy53;
+ goto yy387;
+ } else {
+ if(yych != 'P') goto yy350;
+ goto yy387;
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '`') goto yy53;
+ if(yych <= 'a') goto yy388;
+ goto yy351;
+ } else {
+ if(yych <= 'p') goto yy388;
+ if(yych <= 'z') goto yy351;
+ goto yy53;
+ }
+ }
+ }
+yy387:
+ YYDEBUG(387, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '-'){
+ if(yych == ')') goto yy344;
+ goto yy339;
+ } else {
+ if(yych <= '.') goto yy389;
+ if(yych <= '@') goto yy339;
+ goto yy352;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'M') goto yy390;
+ if(yych <= 'Z') goto yy352;
+ goto yy339;
+ } else {
+ if(yych == 'm') goto yy395;
+ if(yych <= 'z') goto yy357;
+ goto yy339;
+ }
+ }
+yy388:
+ YYDEBUG(388, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '-'){
+ if(yych == ')') goto yy344;
+ goto yy339;
+ } else {
+ if(yych <= '.') goto yy389;
+ if(yych <= '@') goto yy339;
+ goto yy352;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'M') goto yy390;
+ if(yych <= 'Z') goto yy352;
+ goto yy339;
+ } else {
+ if(yych == 'm') goto yy390;
+ if(yych <= 'z') goto yy352;
+ goto yy339;
+ }
+ }
+yy389:
+ YYDEBUG(389, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy394;
+ if(yych == 'm') goto yy394;
+ goto yy53;
+yy390:
+ YYDEBUG(390, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ')'){
+ if(yych <= 0x09){
+ if(yych <= 0x00) goto yy392;
+ if(yych <= 0x08) goto yy339;
+ goto yy392;
+ } else {
+ if(yych == ' ') goto yy392;
+ if(yych <= '(') goto yy339;
+ goto yy344;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych != '.') goto yy339;
+ goto yy391;
+ } else {
+ if(yych <= 'Z') goto yy353;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy353;
+ goto yy339;
+ }
+ }
+yy391:
+ YYDEBUG(391, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 0x09){
+ if(yych <= 0x00) goto yy392;
+ if(yych <= 0x08) goto yy53;
+ goto yy392;
+ } else {
+ if(yych != ' ') goto yy53;
+ goto yy392;
+ }
+yy392:
+ YYDEBUG(392, *YYCURSOR);
+ ++YYCURSOR;
+ goto yy393;
+yy393:
+ YYDEBUG(393, *YYCURSOR);
+
+#line 1422 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
+ 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 == ':' || *ptr == '.') {
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+
+ if (*ptr == '.') {
+ s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
+ }
+ }
+
+ s->time->h += timelib_meridian((char **) &ptr, s->time->h);
+ TIMELIB_DEINIT;
+ return TIMELIB_SHORTDATE_WITH_TIME;
+ }
+#line 5842 "ext/date/lib/parse_date.c"
+yy394:
+ YYDEBUG(394, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 0x1F){
+ if(yych <= 0x00) goto yy392;
+ if(yych == 0x09) goto yy392;
+ goto yy53;
+ } else {
+ if(yych <= ' ') goto yy392;
+ if(yych == '.') goto yy391;
+ goto yy53;
+ }
+yy395:
+ YYDEBUG(395, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= 0x1F){
+ if(yych <= 0x00) goto yy392;
+ if(yych == 0x09) goto yy392;
+ goto yy339;
+ } else {
+ if(yych <= ' ') goto yy392;
+ if(yych == ')') goto yy344;
+ goto yy339;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '.') goto yy391;
+ if(yych <= '/') goto yy359;
+ if(yych <= '@') goto yy339;
+ goto yy353;
+ } else {
+ if(yych <= '_'){
+ if(yych <= '^') goto yy339;
+ goto yy359;
+ } else {
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy358;
+ goto yy339;
+ }
+ }
+ }
+yy396:
+ YYDEBUG(396, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ':'){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy397;
+ if(yych <= 0x1F) goto yy339;
+ goto yy397;
+ } else {
+ if(yych == '.') goto yy381;
+ if(yych <= '9') goto yy339;
+ goto yy381;
+ }
+ } else {
+ if(yych <= 'P'){
+ if(yych == 'A') goto yy399;
+ if(yych <= 'O') goto yy339;
+ goto yy399;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy339;
+ goto yy399;
+ } else {
+ if(yych == 'p') goto yy399;
+ goto yy339;
+ }
+ }
+ }
+yy397:
+ YYDEBUG(397, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
+ yych = *YYCURSOR;
+ goto yy398;
+yy398:
+ YYDEBUG(398, *YYCURSOR);
+ if(yych <= 'A'){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy397;
+ goto yy53;
+ } else {
+ if(yych <= ' ') goto yy397;
+ if(yych <= '@') goto yy53;
+ goto yy399;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych != 'P') goto yy53;
+ goto yy399;
+ } else {
+ if(yych <= 'a') goto yy399;
+ if(yych != 'p') goto yy53;
+ goto yy399;
+ }
+ }
+yy399:
+ YYDEBUG(399, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 'L'){
+ if(yych != '.') goto yy53;
+ goto yy400;
+ } else {
+ if(yych <= 'M') goto yy401;
+ if(yych == 'm') goto yy401;
+ goto yy53;
+ }
+yy400:
+ YYDEBUG(400, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy401;
+ if(yych != 'm') goto yy53;
+ goto yy401;
+yy401:
+ YYDEBUG(401, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 0x1F){
+ if(yych <= 0x00) goto yy392;
+ if(yych == 0x09) goto yy392;
+ goto yy53;
+ } else {
+ if(yych <= ' ') goto yy392;
+ if(yych != '.') goto yy53;
+ goto yy402;
+ }
+yy402:
+ YYDEBUG(402, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 0x09){
+ if(yych <= 0x00) goto yy392;
+ if(yych <= 0x08) goto yy53;
+ goto yy392;
+ } else {
+ if(yych == ' ') goto yy392;
+ goto yy53;
+ }
+yy403:
+ YYDEBUG(403, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy315;
+ if(yych >= ':') goto yy315;
+ goto yy404;
+yy404:
+ YYDEBUG(404, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy315;
+yy405:
+ YYDEBUG(405, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy337;
+ goto yy315;
} else {
- if(yych <= '9') goto yy486;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '9') goto yy403;
+ if(yych <= ':') goto yy337;
+ goto yy315;
}
-yy489:
- YYDEBUG(489, *YYCURSOR);
+yy406:
+ YYDEBUG(406, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy378;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy403;
+ if(yych <= ':') goto yy378;
+ goto yy315;
+ }
+yy407:
+ YYDEBUG(407, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy426;
- if(yych >= ':') goto yy426;
- goto yy490;
-yy490:
- YYDEBUG(490, *YYCURSOR);
+ if(yych <= '/') goto yy315;
+ if(yych >= ':') goto yy315;
+ goto yy408;
+yy408:
+ YYDEBUG(408, *YYCURSOR);
++YYCURSOR;
- if((yych = *YYCURSOR) <= '/') goto yy491;
- if(yych <= '9') goto yy487;
- goto yy491;
-yy491:
- YYDEBUG(491, *YYCURSOR);
+ if((yych = *YYCURSOR) <= '/') goto yy409;
+ if(yych <= '9') goto yy404;
+ goto yy409;
+yy409:
+ YYDEBUG(409, *YYCURSOR);
-#line 1125 "ext/date/lib/parse_date.re"
+#line 1151 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoday");
TIMELIB_INIT;
@@ -8170,393 +6833,1267 @@ yy491:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
-#line 7180 "ext/date/lib/parse_date.c"
-yy492:
- YYDEBUG(492, *YYCURSOR);
- yyaccept = 6;
+#line 6011 "ext/date/lib/parse_date.c"
+yy410:
+ YYDEBUG(410, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy337;
+ goto yy315;
} else {
- if(yych <= '9') goto yy490;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '9') goto yy408;
+ if(yych <= ':') goto yy337;
+ goto yy315;
}
-yy493:
- YYDEBUG(493, *YYCURSOR);
- yyaccept = 6;
+yy411:
+ YYDEBUG(411, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= ':'){
+ if(yych <= '/'){
+ if(yych == '.') goto yy378;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy408;
+ if(yych <= ':') goto yy378;
+ goto yy315;
+ }
+yy412:
+ YYDEBUG(412, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
if(yych <= '/'){
- if(yych != '.') goto yy441;
- goto yy494;
+ if(yych == '.') goto yy447;
+ goto yy332;
} else {
- if(yych <= '1') goto yy495;
- if(yych <= '2') goto yy496;
- if(yych <= '9') goto yy497;
- goto yy446;
+ if(yych <= '0') goto yy448;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
}
} else {
if(yych <= 'q'){
- if(yych == 'n') goto yy437;
- goto yy441;
+ if(yych <= ':') goto yy337;
+ if(yych == 'n') goto yy328;
+ goto yy332;
} else {
- if(yych <= 'r') goto yy438;
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy494:
- YYDEBUG(494, *YYCURSOR);
- yyaccept = 6;
+yy413:
+ YYDEBUG(413, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '2'){
- if(yych <= '/') goto yy441;
- if(yych <= '1') goto yy500;
- goto yy501;
+ if(yych <= '9'){
+ if(yych <= '/'){
+ if(yych != '.') goto yy332;
+ goto yy414;
+ } else {
+ if(yych <= '0') goto yy415;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
+ }
} else {
- if(yych <= '5') goto yy502;
- if(yych <= '9') goto yy503;
- goto yy441;
+ if(yych <= 'q'){
+ if(yych <= ':') goto yy378;
+ if(yych == 'n') goto yy328;
+ goto yy332;
+ } else {
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
+ }
}
-yy495:
- YYDEBUG(495, *YYCURSOR);
- yyaccept = 6;
+yy414:
+ YYDEBUG(414, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '1'){
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy422;
+ goto yy423;
+ } else {
+ if(yych <= '2') goto yy424;
+ if(yych <= '5') goto yy425;
+ if(yych <= '9') goto yy426;
+ goto yy332;
+ }
+yy415:
+ YYDEBUG(415, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '9') goto yy499;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '0') goto yy420;
+ if(yych <= '9') goto yy421;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy496:
- YYDEBUG(496, *YYCURSOR);
- yyaccept = 6;
+yy416:
+ YYDEBUG(416, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '3') goto yy499;
- if(yych <= '9') goto yy498;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '2') goto yy421;
+ if(yych <= '9') goto yy420;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy497:
- YYDEBUG(497, *YYCURSOR);
- yyaccept = 6;
+yy417:
+ YYDEBUG(417, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy315;
} else {
- if(yych <= '9') goto yy498;
- if(yych <= ':') goto yy446;
- goto yy426;
+ if(yych <= '3') goto yy420;
+ if(yych <= '9') goto yy419;
+ if(yych <= ':') goto yy378;
+ goto yy315;
}
-yy498:
- YYDEBUG(498, *YYCURSOR);
+yy418:
+ YYDEBUG(418, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy378;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy419;
+ if(yych <= ':') goto yy378;
+ goto yy315;
+ }
+yy419:
+ YYDEBUG(419, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy491;
- if(yych <= '9') goto yy486;
- goto yy491;
-yy499:
- YYDEBUG(499, *YYCURSOR);
- yyaccept = 8;
+ if(yych <= '/') goto yy409;
+ if(yych <= '9') goto yy403;
+ goto yy409;
+yy420:
+ YYDEBUG(420, *YYCURSOR);
+ yyaccept = 9;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy446;
- goto yy491;
+ if(yych == '.') goto yy337;
+ goto yy409;
} else {
- if(yych <= '9') goto yy486;
- if(yych <= ':') goto yy446;
- goto yy491;
+ if(yych <= '9') goto yy403;
+ if(yych <= ':') goto yy337;
+ goto yy409;
}
-yy500:
- YYDEBUG(500, *YYCURSOR);
- yyaccept = 6;
+yy421:
+ YYDEBUG(421, *YYCURSOR);
+ yyaccept = 9;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy504;
- goto yy426;
+ if(yych == '.') goto yy378;
+ goto yy409;
} else {
- if(yych <= '9') goto yy509;
- if(yych <= ':') goto yy504;
- goto yy426;
+ if(yych <= '9') goto yy403;
+ if(yych <= ':') goto yy378;
+ goto yy409;
}
-yy501:
- YYDEBUG(501, *YYCURSOR);
- yyaccept = 6;
+yy422:
+ YYDEBUG(422, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy504;
- goto yy426;
+ if(yych == '.') goto yy442;
+ goto yy315;
} else {
- if(yych <= '3') goto yy509;
- if(yych <= '9') goto yy508;
- if(yych <= ':') goto yy504;
- goto yy426;
+ if(yych <= '0') goto yy441;
+ if(yych <= '9') goto yy446;
+ if(yych <= ':') goto yy442;
+ goto yy315;
}
-yy502:
- YYDEBUG(502, *YYCURSOR);
- yyaccept = 6;
+yy423:
+ YYDEBUG(423, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy504;
- goto yy426;
+ if(yych == '.') goto yy427;
+ goto yy315;
} else {
- if(yych <= '9') goto yy508;
- if(yych <= ':') goto yy504;
- goto yy426;
+ if(yych <= '2') goto yy446;
+ if(yych <= '9') goto yy441;
+ if(yych <= ':') goto yy427;
+ goto yy315;
}
-yy503:
- YYDEBUG(503, *YYCURSOR);
- yyaccept = 6;
+yy424:
+ YYDEBUG(424, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych != '.') goto yy426;
- goto yy504;
+ if(yych == '.') goto yy427;
+ goto yy315;
} else {
- if(yych <= '9') goto yy485;
- if(yych >= ';') goto yy426;
- goto yy504;
+ if(yych <= '3') goto yy441;
+ if(yych <= '9') goto yy440;
+ if(yych <= ':') goto yy427;
+ goto yy315;
}
-yy504:
- YYDEBUG(504, *YYCURSOR);
+yy425:
+ YYDEBUG(425, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy427;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy440;
+ if(yych <= ':') goto yy427;
+ goto yy315;
+ }
+yy426:
+ YYDEBUG(426, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych != '.') goto yy315;
+ goto yy427;
+ } else {
+ if(yych <= '9') goto yy377;
+ if(yych >= ';') goto yy315;
+ goto yy427;
+ }
+yy427:
+ YYDEBUG(427, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy505;
- if(yych <= '6') goto yy506;
- if(yych <= '9') goto yy449;
+ if(yych <= '5') goto yy428;
+ if(yych <= '6') goto yy429;
+ if(yych <= '9') goto yy380;
goto yy53;
-yy505:
- YYDEBUG(505, *YYCURSOR);
+yy428:
+ YYDEBUG(428, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy381;
+ goto yy339;
+ } else {
+ if(yych <= '9') goto yy430;
+ if(yych <= ':') goto yy381;
+ goto yy339;
+ }
+yy429:
+ YYDEBUG(429, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy381;
+ goto yy339;
+ } else {
+ if(yych <= '0') goto yy384;
+ if(yych == ':') goto yy381;
+ goto yy339;
+ }
+yy430:
+ YYDEBUG(430, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ','){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy432;
+ if(yych <= 0x1F) goto yy339;
+ goto yy432;
+ } else {
+ if(yych <= '('){
+ if(yych <= '\'') goto yy339;
+ goto yy432;
+ } else {
+ if(yych == '+') goto yy432;
+ goto yy339;
+ }
+ }
+ } else {
+ if(yych <= ':'){
+ if(yych <= '-') goto yy432;
+ if(yych <= '.') goto yy381;
+ if(yych <= '9') goto yy339;
+ goto yy381;
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy339;
+ goto yy432;
+ } else {
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy432;
+ goto yy339;
+ }
+ }
+ }
+yy431:
+ YYDEBUG(431, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
+ yych = *YYCURSOR;
+ goto yy432;
+yy432:
+ YYDEBUG(432, *YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= '\''){
+ if(yych <= 0x09){
+ if(yych <= 0x08) goto yy53;
+ goto yy431;
+ } else {
+ if(yych == ' ') goto yy431;
+ goto yy53;
+ }
+ } else {
+ if(yych <= '*'){
+ if(yych <= '(') goto yy349;
+ goto yy53;
+ } else {
+ if(yych == ',') goto yy53;
+ goto yy348;
+ }
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= 'A'){
+ if(yych <= '@') goto yy53;
+ goto yy433;
+ } else {
+ if(yych != 'P') goto yy350;
+ goto yy433;
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '`') goto yy53;
+ if(yych <= 'a') goto yy434;
+ goto yy351;
+ } else {
+ if(yych <= 'p') goto yy434;
+ if(yych <= 'z') goto yy351;
+ goto yy53;
+ }
+ }
+ }
+yy433:
+ YYDEBUG(433, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '-'){
+ if(yych == ')') goto yy344;
+ goto yy339;
+ } else {
+ if(yych <= '.') goto yy436;
+ if(yych <= '@') goto yy339;
+ goto yy352;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'M') goto yy435;
+ if(yych <= 'Z') goto yy352;
+ goto yy339;
+ } else {
+ if(yych == 'm') goto yy439;
+ if(yych <= 'z') goto yy357;
+ goto yy339;
+ }
+ }
+yy434:
+ YYDEBUG(434, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '-'){
+ if(yych == ')') goto yy344;
+ goto yy339;
+ } else {
+ if(yych <= '.') goto yy436;
+ if(yych <= '@') goto yy339;
+ goto yy352;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'M') goto yy435;
+ if(yych <= 'Z') goto yy352;
+ goto yy339;
+ } else {
+ if(yych == 'm') goto yy435;
+ if(yych <= 'z') goto yy352;
+ goto yy339;
+ }
+ }
+yy435:
+ YYDEBUG(435, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ')'){
+ if(yych <= 0x09){
+ if(yych <= 0x00) goto yy392;
+ if(yych <= 0x08) goto yy339;
+ goto yy392;
+ } else {
+ if(yych == ' ') goto yy392;
+ if(yych <= '(') goto yy339;
+ goto yy344;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych == '.') goto yy438;
+ goto yy339;
+ } else {
+ if(yych <= 'Z') goto yy353;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy353;
+ goto yy339;
+ }
+ }
+yy436:
+ YYDEBUG(436, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych == 'M') goto yy437;
+ if(yych != 'm') goto yy53;
+ goto yy437;
+yy437:
+ YYDEBUG(437, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 0x1F){
+ if(yych <= 0x00) goto yy392;
+ if(yych == 0x09) goto yy392;
+ goto yy53;
+ } else {
+ if(yych <= ' ') goto yy392;
+ if(yych != '.') goto yy53;
+ goto yy438;
+ }
+yy438:
+ YYDEBUG(438, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= 0x09){
+ if(yych <= 0x00) goto yy392;
+ if(yych <= 0x08) goto yy53;
+ goto yy392;
+ } else {
+ if(yych == ' ') goto yy392;
+ goto yy53;
+ }
+yy439:
+ YYDEBUG(439, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= 0x1F){
+ if(yych <= 0x00) goto yy392;
+ if(yych == 0x09) goto yy392;
+ goto yy339;
+ } else {
+ if(yych <= ' ') goto yy392;
+ if(yych == ')') goto yy344;
+ goto yy339;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '.') goto yy438;
+ if(yych <= '/') goto yy359;
+ if(yych <= '@') goto yy339;
+ goto yy353;
+ } else {
+ if(yych <= '_'){
+ if(yych <= '^') goto yy339;
+ goto yy359;
+ } else {
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy358;
+ goto yy339;
+ }
+ }
+ }
+yy440:
+ YYDEBUG(440, *YYCURSOR);
yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ':'){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy397;
+ if(yych <= 0x1F) goto yy315;
+ goto yy397;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy315;
+ goto yy381;
+ } else {
+ if(yych <= '/') goto yy315;
+ if(yych <= '9') goto yy403;
+ goto yy381;
+ }
+ }
+ } else {
+ if(yych <= 'P'){
+ if(yych == 'A') goto yy399;
+ if(yych <= 'O') goto yy315;
+ goto yy399;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy315;
+ goto yy399;
+ } else {
+ if(yych == 'p') goto yy399;
+ goto yy315;
+ }
+ }
+ }
+yy441:
+ YYDEBUG(441, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ':'){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy397;
+ if(yych <= 0x1F) goto yy315;
+ goto yy397;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy315;
+ goto yy442;
+ } else {
+ if(yych <= '/') goto yy315;
+ if(yych <= '9') goto yy403;
+ goto yy442;
+ }
+ }
+ } else {
+ if(yych <= 'P'){
+ if(yych == 'A') goto yy399;
+ if(yych <= 'O') goto yy315;
+ goto yy399;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy315;
+ goto yy399;
+ } else {
+ if(yych == 'p') goto yy399;
+ goto yy315;
+ }
+ }
+ }
+yy442:
+ YYDEBUG(442, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy53;
+ if(yych <= '5') goto yy443;
+ if(yych <= '6') goto yy444;
+ if(yych <= '9') goto yy340;
+ goto yy53;
+yy443:
+ YYDEBUG(443, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy450;
- goto yy448;
+ if(yych == '.') goto yy341;
+ goto yy339;
} else {
- if(yych <= '9') goto yy507;
- if(yych <= ':') goto yy450;
- goto yy448;
+ if(yych <= '9') goto yy445;
+ if(yych <= ':') goto yy341;
+ goto yy339;
}
-yy506:
- YYDEBUG(506, *YYCURSOR);
+yy444:
+ YYDEBUG(444, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy341;
+ goto yy339;
+ } else {
+ if(yych <= '0') goto yy384;
+ if(yych == ':') goto yy341;
+ goto yy339;
+ }
+yy445:
+ YYDEBUG(445, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ','){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy386;
+ if(yych <= 0x1F) goto yy339;
+ goto yy386;
+ } else {
+ if(yych <= '('){
+ if(yych <= '\'') goto yy339;
+ goto yy386;
+ } else {
+ if(yych == '+') goto yy386;
+ goto yy339;
+ }
+ }
+ } else {
+ if(yych <= ':'){
+ if(yych <= '-') goto yy386;
+ if(yych <= '.') goto yy341;
+ if(yych <= '9') goto yy339;
+ goto yy341;
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy339;
+ goto yy386;
+ } else {
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy386;
+ goto yy339;
+ }
+ }
+ }
+yy446:
+ YYDEBUG(446, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ':'){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy397;
+ if(yych <= 0x1F) goto yy315;
+ goto yy397;
+ } else {
+ if(yych <= '.'){
+ if(yych <= '-') goto yy315;
+ goto yy427;
+ } else {
+ if(yych <= '/') goto yy315;
+ if(yych <= '9') goto yy403;
+ goto yy427;
+ }
+ }
+ } else {
+ if(yych <= 'P'){
+ if(yych == 'A') goto yy399;
+ if(yych <= 'O') goto yy315;
+ goto yy399;
+ } else {
+ if(yych <= 'a'){
+ if(yych <= '`') goto yy315;
+ goto yy399;
+ } else {
+ if(yych == 'p') goto yy399;
+ goto yy315;
+ }
+ }
+ }
+yy447:
+ YYDEBUG(447, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '1'){
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy449;
+ goto yy450;
+ } else {
+ if(yych <= '2') goto yy451;
+ if(yych <= '5') goto yy452;
+ if(yych <= '9') goto yy453;
+ goto yy332;
+ }
+yy448:
+ YYDEBUG(448, *YYCURSOR);
yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy450;
- goto yy448;
+ if(yych == '.') goto yy337;
+ goto yy315;
} else {
- if(yych <= '0') goto yy454;
- if(yych == ':') goto yy450;
- goto yy448;
+ if(yych <= '0') goto yy420;
+ if(yych <= '9') goto yy421;
+ if(yych <= ':') goto yy337;
+ goto yy315;
}
-yy507:
- YYDEBUG(507, *YYCURSOR);
+yy449:
+ YYDEBUG(449, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy466;
+ goto yy315;
+ } else {
+ if(yych <= '0') goto yy465;
+ if(yych <= '9') goto yy470;
+ if(yych <= ':') goto yy466;
+ goto yy315;
+ }
+yy450:
+ YYDEBUG(450, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy454;
+ goto yy315;
+ } else {
+ if(yych <= '2') goto yy470;
+ if(yych <= '9') goto yy465;
+ if(yych <= ':') goto yy454;
+ goto yy315;
+ }
+yy451:
+ YYDEBUG(451, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy454;
+ goto yy315;
+ } else {
+ if(yych <= '3') goto yy465;
+ if(yych <= '9') goto yy464;
+ if(yych <= ':') goto yy454;
+ goto yy315;
+ }
+yy452:
+ YYDEBUG(452, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy454;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy464;
+ if(yych <= ':') goto yy454;
+ goto yy315;
+ }
+yy453:
+ YYDEBUG(453, *YYCURSOR);
yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych != '.') goto yy315;
+ goto yy454;
+ } else {
+ if(yych <= '9') goto yy377;
+ if(yych >= ';') goto yy315;
+ goto yy454;
+ }
+yy454:
+ YYDEBUG(454, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy53;
+ if(yych <= '5') goto yy455;
+ if(yych <= '6') goto yy456;
+ if(yych <= '9') goto yy380;
+ goto yy53;
+yy455:
+ YYDEBUG(455, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy381;
+ goto yy339;
+ } else {
+ if(yych <= '9') goto yy457;
+ if(yych <= ':') goto yy381;
+ goto yy339;
+ }
+yy456:
+ YYDEBUG(456, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy381;
+ goto yy339;
+ } else {
+ if(yych <= '0') goto yy345;
+ if(yych == ':') goto yy381;
+ goto yy339;
+ }
+yy457:
+ YYDEBUG(457, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= ' '){
- if(yych == 0x09) goto yy455;
- if(yych <= 0x1F) goto yy448;
- goto yy455;
+ if(yych == 0x09) goto yy459;
+ if(yych <= 0x1F) goto yy339;
+ goto yy459;
} else {
if(yych <= '('){
- if(yych <= '\'') goto yy448;
- goto yy458;
+ if(yych <= '\'') goto yy339;
+ goto yy459;
} else {
- if(yych == '+') goto yy457;
- goto yy448;
+ if(yych == '+') goto yy459;
+ goto yy339;
}
}
} else {
if(yych <= ':'){
- if(yych <= '-') goto yy457;
- if(yych <= '.') goto yy450;
- if(yych <= '9') goto yy448;
- goto yy450;
+ if(yych <= '-') goto yy459;
+ if(yych <= '.') goto yy381;
+ if(yych <= '9') goto yy339;
+ goto yy381;
} else {
if(yych <= 'Z'){
- if(yych <= '@') goto yy448;
+ if(yych <= '@') goto yy339;
goto yy459;
} else {
- if(yych <= '`') goto yy448;
- if(yych <= 'z') goto yy460;
- goto yy448;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy459;
+ goto yy339;
}
}
}
-yy508:
- YYDEBUG(508, *YYCURSOR);
- yyaccept = 6;
+yy458:
+ YYDEBUG(458, *YYCURSOR);
+ ++YYCURSOR;
+ if((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
+ yych = *YYCURSOR;
+ goto yy459;
+yy459:
+ YYDEBUG(459, *YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= '\''){
+ if(yych <= 0x09){
+ if(yych <= 0x08) goto yy53;
+ goto yy458;
+ } else {
+ if(yych == ' ') goto yy458;
+ goto yy53;
+ }
+ } else {
+ if(yych <= '*'){
+ if(yych <= '(') goto yy349;
+ goto yy53;
+ } else {
+ if(yych == ',') goto yy53;
+ goto yy348;
+ }
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= 'A'){
+ if(yych <= '@') goto yy53;
+ goto yy460;
+ } else {
+ if(yych != 'P') goto yy350;
+ goto yy460;
+ }
+ } else {
+ if(yych <= 'o'){
+ if(yych <= '`') goto yy53;
+ if(yych <= 'a') goto yy461;
+ goto yy351;
+ } else {
+ if(yych <= 'p') goto yy461;
+ if(yych <= 'z') goto yy351;
+ goto yy53;
+ }
+ }
+ }
+yy460:
+ YYDEBUG(460, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '-'){
+ if(yych == ')') goto yy344;
+ goto yy339;
+ } else {
+ if(yych <= '.') goto yy400;
+ if(yych <= '@') goto yy339;
+ goto yy352;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'M') goto yy462;
+ if(yych <= 'Z') goto yy352;
+ goto yy339;
+ } else {
+ if(yych == 'm') goto yy463;
+ if(yych <= 'z') goto yy357;
+ goto yy339;
+ }
+ }
+yy461:
+ YYDEBUG(461, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= 'L'){
+ if(yych <= '-'){
+ if(yych == ')') goto yy344;
+ goto yy339;
+ } else {
+ if(yych <= '.') goto yy400;
+ if(yych <= '@') goto yy339;
+ goto yy352;
+ }
+ } else {
+ if(yych <= '`'){
+ if(yych <= 'M') goto yy462;
+ if(yych <= 'Z') goto yy352;
+ goto yy339;
+ } else {
+ if(yych == 'm') goto yy462;
+ if(yych <= 'z') goto yy352;
+ goto yy339;
+ }
+ }
+yy462:
+ YYDEBUG(462, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ')'){
+ if(yych <= 0x09){
+ if(yych <= 0x00) goto yy392;
+ if(yych <= 0x08) goto yy339;
+ goto yy392;
+ } else {
+ if(yych == ' ') goto yy392;
+ if(yych <= '(') goto yy339;
+ goto yy344;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych == '.') goto yy402;
+ goto yy339;
+ } else {
+ if(yych <= 'Z') goto yy353;
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy353;
+ goto yy339;
+ }
+ }
+yy463:
+ YYDEBUG(463, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '-'){
+ if(yych <= 0x1F){
+ if(yych <= 0x00) goto yy392;
+ if(yych == 0x09) goto yy392;
+ goto yy339;
+ } else {
+ if(yych <= ' ') goto yy392;
+ if(yych == ')') goto yy344;
+ goto yy339;
+ }
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '.') goto yy402;
+ if(yych <= '/') goto yy359;
+ if(yych <= '@') goto yy339;
+ goto yy353;
+ } else {
+ if(yych <= '_'){
+ if(yych <= '^') goto yy339;
+ goto yy359;
+ } else {
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy358;
+ goto yy339;
+ }
+ }
+ }
+yy464:
+ YYDEBUG(464, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy450;
- goto yy426;
+ if(yych == '.') goto yy341;
+ goto yy315;
} else {
- if(yych <= '9') goto yy486;
- if(yych <= ':') goto yy450;
- goto yy426;
+ if(yych <= '9') goto yy403;
+ if(yych <= ':') goto yy341;
+ goto yy315;
}
-yy509:
- YYDEBUG(509, *YYCURSOR);
- yyaccept = 6;
+yy465:
+ YYDEBUG(465, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy504;
- goto yy426;
+ if(yych != '.') goto yy315;
+ goto yy466;
} else {
- if(yych <= '9') goto yy486;
- if(yych <= ':') goto yy504;
- goto yy426;
+ if(yych <= '9') goto yy403;
+ if(yych >= ';') goto yy315;
+ goto yy466;
}
-yy510:
- YYDEBUG(510, *YYCURSOR);
- yyaccept = 6;
+yy466:
+ YYDEBUG(466, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy53;
+ if(yych <= '5') goto yy467;
+ if(yych <= '6') goto yy468;
+ if(yych <= '9') goto yy340;
+ goto yy53;
+yy467:
+ YYDEBUG(467, *YYCURSOR);
+ yyaccept = 8;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= ':'){
+ if(yych <= '/'){
+ if(yych == '.') goto yy341;
+ goto yy339;
+ } else {
+ if(yych <= '9') goto yy469;
+ if(yych <= ':') goto yy341;
+ goto yy339;
+ }
+yy468:
+ YYDEBUG(468, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy341;
+ goto yy339;
+ } else {
+ if(yych <= '0') goto yy345;
+ if(yych == ':') goto yy341;
+ goto yy339;
+ }
+yy469:
+ YYDEBUG(469, *YYCURSOR);
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ','){
+ if(yych <= ' '){
+ if(yych == 0x09) goto yy346;
+ if(yych <= 0x1F) goto yy339;
+ goto yy346;
+ } else {
+ if(yych <= '('){
+ if(yych <= '\'') goto yy339;
+ goto yy349;
+ } else {
+ if(yych == '+') goto yy348;
+ goto yy339;
+ }
+ }
+ } else {
+ if(yych <= ':'){
+ if(yych <= '-') goto yy348;
+ if(yych <= '.') goto yy341;
+ if(yych <= '9') goto yy339;
+ goto yy341;
+ } else {
+ if(yych <= 'Z'){
+ if(yych <= '@') goto yy339;
+ goto yy350;
+ } else {
+ if(yych <= '`') goto yy339;
+ if(yych <= 'z') goto yy351;
+ goto yy339;
+ }
+ }
+ }
+yy470:
+ YYDEBUG(470, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '/'){
+ if(yych == '.') goto yy454;
+ goto yy315;
+ } else {
+ if(yych <= '9') goto yy403;
+ if(yych <= ':') goto yy454;
+ goto yy315;
+ }
+yy471:
+ YYDEBUG(471, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
if(yych <= '/'){
- if(yych == '.') goto yy494;
- goto yy441;
+ if(yych == '.') goto yy414;
+ goto yy332;
} else {
- if(yych <= '1') goto yy495;
- if(yych <= '2') goto yy496;
- if(yych <= '9') goto yy497;
- goto yy446;
+ if(yych <= '0') goto yy448;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
}
} else {
if(yych <= 'q'){
- if(yych == 'n') goto yy437;
- goto yy441;
+ if(yych <= ':') goto yy378;
+ if(yych == 'n') goto yy328;
+ goto yy332;
} else {
- if(yych <= 'r') goto yy438;
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy511:
- YYDEBUG(511, *YYCURSOR);
- yyaccept = 6;
+yy472:
+ YYDEBUG(472, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= '/'){
+ if(yych == '.') goto yy414;
+ goto yy332;
+ } else {
+ if(yych <= '0') goto yy448;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= ':') goto yy378;
+ if(yych == 'n') goto yy328;
+ goto yy332;
+ } else {
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
+ }
+ }
+yy473:
+ YYDEBUG(473, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy441;
- if(yych <= '0') goto yy493;
- goto yy514;
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy412;
+ goto yy477;
} else {
- if(yych <= '2') goto yy521;
- if(yych <= '9') goto yy514;
- goto yy441;
+ if(yych <= '2') goto yy484;
+ if(yych <= '9') goto yy485;
+ goto yy332;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy437;
- if(yych <= 'q') goto yy441;
- goto yy438;
+ if(yych <= 'n') goto yy328;
+ if(yych <= 'q') goto yy332;
+ goto yy329;
} else {
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy512:
- YYDEBUG(512, *YYCURSOR);
- yyaccept = 6;
+yy474:
+ YYDEBUG(474, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy441;
- goto yy514;
+ if(yych <= '/') goto yy332;
+ if(yych <= '0') goto yy476;
+ goto yy477;
} else {
- if(yych <= '2') goto yy521;
- if(yych <= '9') goto yy514;
- goto yy441;
+ if(yych <= '2') goto yy484;
+ if(yych <= '9') goto yy485;
+ goto yy332;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy437;
- if(yych <= 'q') goto yy441;
- goto yy438;
+ if(yych <= 'n') goto yy328;
+ if(yych <= 'q') goto yy332;
+ goto yy329;
} else {
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy513:
- YYDEBUG(513, *YYCURSOR);
- yyaccept = 6;
+yy475:
+ YYDEBUG(475, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy441;
- goto yy514;
+ if(yych <= '/') goto yy332;
+ if(yych >= '1') goto yy477;
+ goto yy476;
} else {
- if(yych <= '2') goto yy434;
- if(yych <= '9') goto yy435;
- goto yy441;
+ if(yych <= '2') goto yy325;
+ if(yych <= '9') goto yy326;
+ goto yy332;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy437;
- if(yych <= 'q') goto yy441;
- goto yy438;
+ if(yych <= 'n') goto yy328;
+ if(yych <= 'q') goto yy332;
+ goto yy329;
} else {
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy514:
- YYDEBUG(514, *YYCURSOR);
- yyaccept = 6;
+yy476:
+ YYDEBUG(476, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
- if(yych <= '.'){
- if(yych <= ',') goto yy441;
- if(yych >= '.') goto yy494;
- goto yy515;
+ if(yych <= '/'){
+ if(yych <= ',') goto yy332;
+ if(yych <= '-') goto yy478;
+ if(yych <= '.') goto yy447;
+ goto yy332;
} else {
- if(yych <= '/') goto yy441;
- if(yych <= '1') goto yy495;
- if(yych <= '2') goto yy496;
- goto yy497;
+ if(yych <= '0') goto yy448;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
}
} else {
if(yych <= 'q'){
- if(yych <= ':') goto yy446;
- if(yych == 'n') goto yy437;
- goto yy441;
+ if(yych <= ':') goto yy337;
+ if(yych == 'n') goto yy328;
+ goto yy332;
} else {
- if(yych <= 'r') goto yy438;
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy515:
- YYDEBUG(515, *YYCURSOR);
+yy477:
+ YYDEBUG(477, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= '/'){
+ if(yych <= ',') goto yy332;
+ if(yych <= '-') goto yy478;
+ if(yych <= '.') goto yy414;
+ goto yy332;
+ } else {
+ if(yych <= '0') goto yy415;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= ':') goto yy378;
+ if(yych == 'n') goto yy328;
+ goto yy332;
+ } else {
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
+ }
+ }
+yy478:
+ YYDEBUG(478, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy516;
-yy516:
- YYDEBUG(516, *YYCURSOR);
+ goto yy479;
+yy479:
+ YYDEBUG(479, *YYCURSOR);
++YYCURSOR;
- if((yych = *YYCURSOR) <= '/') goto yy517;
- if(yych <= '9') goto yy518;
- goto yy517;
-yy517:
- YYDEBUG(517, *YYCURSOR);
+ if((yych = *YYCURSOR) <= '/') goto yy480;
+ if(yych <= '9') goto yy481;
+ goto yy480;
+yy480:
+ YYDEBUG(480, *YYCURSOR);
-#line 1265 "ext/date/lib/parse_date.re"
+#line 1291 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pgtextshort");
TIMELIB_INIT;
@@ -8568,1969 +8105,1921 @@ yy517:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
-#line 7526 "ext/date/lib/parse_date.c"
-yy518:
- YYDEBUG(518, *YYCURSOR);
+#line 7141 "ext/date/lib/parse_date.c"
+yy481:
+ YYDEBUG(481, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy517;
- if(yych >= ':') goto yy517;
- goto yy519;
-yy519:
- YYDEBUG(519, *YYCURSOR);
+ if(yych <= '/') goto yy480;
+ if(yych >= ':') goto yy480;
+ goto yy482;
+yy482:
+ YYDEBUG(482, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy517;
- if(yych >= ':') goto yy517;
- goto yy520;
-yy520:
- YYDEBUG(520, *YYCURSOR);
+ if(yych <= '/') goto yy480;
+ if(yych >= ':') goto yy480;
+ goto yy483;
+yy483:
+ YYDEBUG(483, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy517;
-yy521:
- YYDEBUG(521, *YYCURSOR);
- yyaccept = 6;
+ goto yy480;
+yy484:
+ YYDEBUG(484, *YYCURSOR);
+ yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
- if(yych <= '.'){
- if(yych <= ',') goto yy441;
- if(yych <= '-') goto yy515;
- goto yy494;
+ if(yych <= '/'){
+ if(yych <= ',') goto yy332;
+ if(yych <= '-') goto yy478;
+ if(yych <= '.') goto yy414;
+ goto yy332;
} else {
- if(yych <= '/') goto yy441;
- if(yych <= '1') goto yy495;
- if(yych <= '2') goto yy496;
- goto yy497;
+ if(yych <= '0') goto yy448;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
}
} else {
if(yych <= 'q'){
- if(yych <= ':') goto yy446;
- if(yych == 'n') goto yy437;
- goto yy441;
+ if(yych <= ':') goto yy378;
+ if(yych == 'n') goto yy328;
+ goto yy332;
} else {
- if(yych <= 'r') goto yy438;
- if(yych <= 's') goto yy436;
- if(yych <= 't') goto yy439;
- goto yy441;
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
}
}
-yy522:
- YYDEBUG(522, *YYCURSOR);
+yy485:
+ YYDEBUG(485, *YYCURSOR);
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '9'){
+ if(yych <= '/'){
+ if(yych <= ',') goto yy332;
+ if(yych <= '-') goto yy478;
+ if(yych <= '.') goto yy414;
+ goto yy332;
+ } else {
+ if(yych <= '0') goto yy448;
+ if(yych <= '1') goto yy416;
+ if(yych <= '2') goto yy417;
+ goto yy418;
+ }
+ } else {
+ if(yych <= 'q'){
+ if(yych <= ':') goto yy378;
+ if(yych == 'n') goto yy328;
+ goto yy332;
+ } else {
+ if(yych <= 'r') goto yy329;
+ if(yych <= 's') goto yy327;
+ if(yych <= 't') goto yy330;
+ goto yy332;
+ }
+ }
+yy486:
+ YYDEBUG(486, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'C'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'B') goto yy134;
- goto yy421;
+ if(yych <= 'B') goto yy138;
+ goto yy309;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'c') goto yy523;
- if(yych <= 'z') goto yy139;
+ if(yych == 'c') goto yy487;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy523:
- YYDEBUG(523, *YYCURSOR);
- yyaccept = 0;
+yy487:
+ YYDEBUG(487, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'D'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'E') goto yy429;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'E') goto yy318;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'd'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'e') goto yy524;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'e') goto yy488;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy524:
- YYDEBUG(524, *YYCURSOR);
+yy488:
+ YYDEBUG(488, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'M'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'L') goto yy136;
- goto yy430;
+ if(yych <= 'L') goto yy140;
+ goto yy319;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'm') goto yy525;
- if(yych <= 'z') goto yy145;
+ if(yych == 'm') goto yy489;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy525:
- YYDEBUG(525, *YYCURSOR);
+yy489:
+ YYDEBUG(489, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'B'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy137;
- goto yy431;
+ if(yych <= 'A') goto yy141;
+ goto yy320;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'b') goto yy526;
- if(yych <= 'z') goto yy146;
+ if(yych == 'b') goto yy490;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy526:
- YYDEBUG(526, *YYCURSOR);
+yy490:
+ YYDEBUG(490, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'D') goto yy3;
- goto yy432;
+ goto yy321;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy527;
- if(yych <= 'z') goto yy147;
+ if(yych == 'e') goto yy491;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy527:
- YYDEBUG(527, *YYCURSOR);
+yy491:
+ YYDEBUG(491, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy53;
- goto yy140;
+ if(yych == 'R') goto yy322;
+ if(yych != 'r') goto yy152;
+ goto yy492;
+yy492:
+ YYDEBUG(492, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= '.'){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy312;
+ goto yy310;
} else {
- if(yych == 'R') goto yy422;
- goto yy53;
+ if(yych <= ' ') goto yy312;
+ if(yych <= ',') goto yy310;
+ goto yy312;
}
} else {
- if(yych <= 'q'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy53;
- goto yy147;
+ if(yych <= '^'){
+ if(yych <= '/') goto yy144;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych <= 'r') goto yy528;
- if(yych <= 'z') goto yy147;
- goto yy53;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy151;
+ goto yy310;
}
}
-yy528:
- YYDEBUG(528, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych == '/') goto yy140;
- goto yy423;
- } else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy423;
- if(yych <= 'z') goto yy147;
- goto yy423;
- }
-yy529:
- YYDEBUG(529, *YYCURSOR);
+yy493:
+ YYDEBUG(493, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy134;
- goto yy530;
+ if(yych <= 'S') goto yy138;
+ goto yy494;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 't') goto yy530;
- if(yych <= 'z') goto yy134;
+ if(yych <= 't') goto yy494;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy530:
- YYDEBUG(530, *YYCURSOR);
- yyaccept = 0;
+yy494:
+ YYDEBUG(494, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'O') goto yy135;
- goto yy531;
+ if(yych != 'O') goto yy139;
+ goto yy495;
}
} else {
if(yych <= 'n'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'o') goto yy531;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'o') goto yy495;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy531:
- YYDEBUG(531, *YYCURSOR);
+yy495:
+ YYDEBUG(495, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'B'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy136;
- goto yy532;
+ if(yych <= 'A') goto yy140;
+ goto yy496;
}
} else {
if(yych <= 'a'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'b') goto yy532;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'b') goto yy496;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy532:
- YYDEBUG(532, *YYCURSOR);
+yy496:
+ YYDEBUG(496, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy137;
- goto yy533;
+ if(yych <= 'D') goto yy141;
+ goto yy497;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'e') goto yy533;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'e') goto yy497;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy533:
- YYDEBUG(533, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
+yy497:
+ YYDEBUG(497, *YYCURSOR);
+ yych = *++YYCURSOR;
if(yych <= 'Q'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'R') goto yy422;
- if(yych == 'r') goto yy422;
+ if(yych <= 'R') goto yy322;
+ if(yych == 'r') goto yy322;
goto yy3;
}
-yy534:
- YYDEBUG(534, *YYCURSOR);
+yy498:
+ YYDEBUG(498, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy134;
- goto yy530;
+ if(yych <= 'S') goto yy138;
+ goto yy494;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy535;
- if(yych <= 'z') goto yy139;
+ if(yych == 't') goto yy499;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy535:
- YYDEBUG(535, *YYCURSOR);
- yyaccept = 0;
+yy499:
+ YYDEBUG(499, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'N'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'O') goto yy531;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'O') goto yy495;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'n'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'o') goto yy536;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'o') goto yy500;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy536:
- YYDEBUG(536, *YYCURSOR);
+yy500:
+ YYDEBUG(500, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'B'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy136;
- goto yy532;
+ if(yych <= 'A') goto yy140;
+ goto yy496;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'b') goto yy537;
- if(yych <= 'z') goto yy145;
+ if(yych == 'b') goto yy501;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy537:
- YYDEBUG(537, *YYCURSOR);
+yy501:
+ YYDEBUG(501, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy137;
- goto yy533;
+ if(yych <= 'D') goto yy141;
+ goto yy497;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy538;
- if(yych <= 'z') goto yy146;
+ if(yych == 'e') goto yy502;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy538:
- YYDEBUG(538, *YYCURSOR);
+yy502:
+ YYDEBUG(502, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'Q') goto yy3;
- goto yy422;
+ goto yy322;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy528;
- if(yych <= 'z') goto yy147;
+ if(yych == 'r') goto yy492;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy539:
- YYDEBUG(539, *YYCURSOR);
+yy503:
+ YYDEBUG(503, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'V'){
if(yych <= 'B'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
if(yych <= 'O'){
- if(yych <= 'C') goto yy555;
- goto yy134;
+ if(yych <= 'C') goto yy519;
+ goto yy138;
} else {
- if(yych <= 'P') goto yy554;
- if(yych <= 'U') goto yy134;
- goto yy556;
+ if(yych <= 'P') goto yy518;
+ if(yych <= 'U') goto yy138;
+ goto yy520;
}
}
} else {
if(yych <= 'o'){
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych == 'c') goto yy555;
- goto yy134;
+ if(yych == 'c') goto yy519;
+ goto yy138;
}
} else {
if(yych <= 'u'){
- if(yych <= 'p') goto yy554;
- goto yy134;
+ if(yych <= 'p') goto yy518;
+ goto yy138;
} else {
- if(yych <= 'v') goto yy556;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'v') goto yy520;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
}
-yy540:
- YYDEBUG(540, *YYCURSOR);
+yy504:
+ YYDEBUG(504, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy134;
- goto yy549;
+ if(yych <= 'S') goto yy138;
+ goto yy513;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 't') goto yy549;
- if(yych <= 'z') goto yy134;
+ if(yych <= 't') goto yy513;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy541:
- YYDEBUG(541, *YYCURSOR);
+yy505:
+ YYDEBUG(505, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'X'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'W') goto yy134;
- goto yy547;
+ if(yych <= 'W') goto yy138;
+ goto yy511;
}
} else {
if(yych <= 'w'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'x') goto yy547;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'x') goto yy511;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy542:
- YYDEBUG(542, *YYCURSOR);
+yy506:
+ YYDEBUG(506, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy543;
+ if(yych <= 'M') goto yy138;
+ goto yy507;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'n') goto yy543;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'n') goto yy507;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy543:
- YYDEBUG(543, *YYCURSOR);
+yy507:
+ YYDEBUG(507, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
- if(yych <= '(') goto yy405;
- goto yy132;
+ if(yych <= '(') goto yy283;
+ goto yy136;
} else {
- if(yych <= '@') goto yy405;
- if(yych <= 'C') goto yy135;
- goto yy544;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'C') goto yy139;
+ goto yy508;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy405;
- goto yy135;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy283;
+ goto yy139;
} else {
- if(yych <= 'd') goto yy544;
- if(yych <= 'z') goto yy135;
- goto yy405;
+ if(yych <= 'd') goto yy508;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy544:
- YYDEBUG(544, *YYCURSOR);
+yy508:
+ YYDEBUG(508, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy545;
+ goto yy509;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
goto yy3;
} else {
- if(yych <= 'a') goto yy545;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'a') goto yy509;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy545:
- YYDEBUG(545, *YYCURSOR);
+yy509:
+ YYDEBUG(509, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy137;
- goto yy546;
+ if(yych <= 'X') goto yy141;
+ goto yy510;
}
} else {
if(yych <= 'x'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'y') goto yy546;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'y') goto yy510;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy546:
- YYDEBUG(546, *YYCURSOR);
+yy510:
+ YYDEBUG(510, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == ')') goto yy132;
- goto yy405;
-yy547:
- YYDEBUG(547, *YYCURSOR);
+ if(yych == ')') goto yy136;
+ goto yy283;
+yy511:
+ YYDEBUG(511, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy548;
+ if(yych <= 'S') goto yy139;
+ goto yy512;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 't') goto yy548;
- if(yych <= 'z') goto yy135;
+ if(yych <= 't') goto yy512;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy548:
- YYDEBUG(548, *YYCURSOR);
+yy512:
+ YYDEBUG(512, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= 'g'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'h') goto yy376;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'h') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy549:
- YYDEBUG(549, *YYCURSOR);
+yy513:
+ YYDEBUG(513, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= ')'){
- if(yych <= '(') goto yy405;
- goto yy132;
+ if(yych <= '(') goto yy283;
+ goto yy136;
} else {
- if(yych <= '@') goto yy405;
- if(yych <= 'T') goto yy135;
- goto yy550;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'T') goto yy139;
+ goto yy514;
}
} else {
if(yych <= 't'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy405;
- goto yy135;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy283;
+ goto yy139;
} else {
- if(yych <= 'u') goto yy550;
- if(yych <= 'z') goto yy135;
- goto yy405;
+ if(yych <= 'u') goto yy514;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy550:
- YYDEBUG(550, *YYCURSOR);
+yy514:
+ YYDEBUG(514, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy136;
- goto yy551;
+ if(yych <= 'Q') goto yy140;
+ goto yy515;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'r') goto yy551;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'r') goto yy515;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy551:
- YYDEBUG(551, *YYCURSOR);
+yy515:
+ YYDEBUG(515, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy137;
- goto yy552;
+ if(yych <= 'C') goto yy141;
+ goto yy516;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'd') goto yy552;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'd') goto yy516;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy552:
- YYDEBUG(552, *YYCURSOR);
+yy516:
+ YYDEBUG(516, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'A') goto yy553;
+ if(yych <= 'A') goto yy517;
if(yych != 'a') goto yy3;
- goto yy553;
+ goto yy517;
}
-yy553:
- YYDEBUG(553, *YYCURSOR);
+yy517:
+ YYDEBUG(517, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy411;
- if(yych == 'y') goto yy411;
+ if(yych == 'Y') goto yy289;
+ if(yych == 'y') goto yy289;
goto yy53;
-yy554:
- YYDEBUG(554, *YYCURSOR);
- yyaccept = 0;
+yy518:
+ YYDEBUG(518, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych == 'T') goto yy563;
- goto yy135;
+ if(yych == 'T') goto yy527;
+ goto yy139;
}
} else {
if(yych <= 's'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 't') goto yy563;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 't') goto yy527;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy555:
- YYDEBUG(555, *YYCURSOR);
+yy519:
+ YYDEBUG(519, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy135;
- goto yy560;
+ if(yych <= 'N') goto yy139;
+ goto yy524;
}
} else {
if(yych <= 'n'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'o') goto yy560;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'o') goto yy524;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy556:
- YYDEBUG(556, *YYCURSOR);
+yy520:
+ YYDEBUG(520, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy135;
- goto yy557;
+ if(yych <= 'D') goto yy139;
+ goto yy521;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'e') goto yy557;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'e') goto yy521;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy557:
- YYDEBUG(557, *YYCURSOR);
+yy521:
+ YYDEBUG(521, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy136;
- goto yy558;
+ if(yych <= 'M') goto yy140;
+ goto yy522;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'n') goto yy558;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'n') goto yy522;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy558:
- YYDEBUG(558, *YYCURSOR);
+yy522:
+ YYDEBUG(522, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy137;
- goto yy559;
+ if(yych <= 'S') goto yy141;
+ goto yy523;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 't') goto yy559;
- if(yych <= 'z') goto yy137;
+ if(yych <= 't') goto yy523;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy559:
- YYDEBUG(559, *YYCURSOR);
+yy523:
+ YYDEBUG(523, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'G'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'H') goto yy163;
- if(yych == 'h') goto yy163;
+ if(yych <= 'H') goto yy167;
+ if(yych == 'h') goto yy167;
goto yy3;
}
-yy560:
- YYDEBUG(560, *YYCURSOR);
+yy524:
+ YYDEBUG(524, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy136;
- goto yy561;
+ if(yych <= 'M') goto yy140;
+ goto yy525;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'n') goto yy561;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'n') goto yy525;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy561:
- YYDEBUG(561, *YYCURSOR);
+yy525:
+ YYDEBUG(525, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy137;
- goto yy562;
+ if(yych <= 'C') goto yy141;
+ goto yy526;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'd') goto yy562;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'd') goto yy526;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy562:
- YYDEBUG(562, *YYCURSOR);
+yy526:
+ YYDEBUG(526, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= 'V'){
- if(yych <= 'D'){
- if(yych <= ' '){
- if(yych == 0x09) goto yy164;
- if(yych <= 0x1F) goto yy3;
- goto yy164;
- } else {
- if(yych == ')') goto yy132;
- if(yych <= 'C') goto yy3;
- goto yy164;
- }
- } else {
- if(yych <= 'H'){
- if(yych == 'F') goto yy164;
- if(yych <= 'G') goto yy3;
- goto yy164;
- } else {
- if(yych <= 'M'){
- if(yych <= 'L') goto yy3;
- goto yy164;
- } else {
- if(yych <= 'R') goto yy3;
- if(yych <= 'T') goto yy164;
- goto yy3;
- }
- }
- }
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy168;
+ goto yy3;
} else {
- if(yych <= 'h'){
- if(yych <= 'c'){
- if(yych == 'X') goto yy3;
- if(yych <= 'Y') goto yy164;
- goto yy3;
- } else {
- if(yych <= 'e'){
- if(yych <= 'd') goto yy164;
- goto yy3;
- } else {
- if(yych == 'g') goto yy3;
- goto yy164;
- }
- }
- } else {
- if(yych <= 't'){
- if(yych == 'm') goto yy164;
- if(yych <= 'r') goto yy3;
- goto yy164;
- } else {
- if(yych <= 'w'){
- if(yych <= 'v') goto yy3;
- goto yy164;
- } else {
- if(yych == 'y') goto yy164;
- goto yy3;
- }
- }
- }
+ if(yych <= ' ') goto yy168;
+ if(yych == ')') goto yy136;
+ goto yy3;
}
-yy563:
- YYDEBUG(563, *YYCURSOR);
- yyaccept = 0;
+yy527:
+ YYDEBUG(527, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'E') goto yy136;
- goto yy564;
+ if(yych != 'E') goto yy140;
+ goto yy528;
}
} else {
if(yych <= 'd'){
- if(yych <= '`') goto yy3;
- goto yy136;
+ if(yych <= '`') goto yy310;
+ goto yy140;
} else {
- if(yych <= 'e') goto yy564;
- if(yych <= 'z') goto yy136;
- goto yy3;
+ if(yych <= 'e') goto yy528;
+ if(yych <= 'z') goto yy140;
+ goto yy310;
}
}
}
-yy564:
- YYDEBUG(564, *YYCURSOR);
+yy528:
+ YYDEBUG(528, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'M'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'L') goto yy137;
- goto yy565;
+ if(yych <= 'L') goto yy141;
+ goto yy529;
}
} else {
if(yych <= 'l'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'm') goto yy565;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'm') goto yy529;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy565:
- YYDEBUG(565, *YYCURSOR);
+yy529:
+ YYDEBUG(529, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'B') goto yy566;
+ if(yych <= 'B') goto yy530;
if(yych != 'b') goto yy3;
- goto yy566;
+ goto yy530;
}
-yy566:
- YYDEBUG(566, *YYCURSOR);
+yy530:
+ YYDEBUG(530, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy567;
+ if(yych == 'E') goto yy531;
if(yych != 'e') goto yy53;
- goto yy567;
-yy567:
- YYDEBUG(567, *YYCURSOR);
+ goto yy531;
+yy531:
+ YYDEBUG(531, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy422;
- if(yych == 'r') goto yy422;
+ if(yych == 'R') goto yy322;
+ if(yych == 'r') goto yy322;
goto yy53;
-yy568:
- YYDEBUG(568, *YYCURSOR);
+yy532:
+ YYDEBUG(532, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= '@'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
+ if(yych == '/') goto yy144;
goto yy3;
}
} else {
if(yych <= 'O'){
- if(yych == 'C') goto yy555;
- goto yy134;
+ if(yych == 'C') goto yy519;
+ goto yy138;
} else {
- if(yych <= 'P') goto yy554;
- if(yych <= 'U') goto yy134;
- goto yy556;
+ if(yych <= 'P') goto yy518;
+ if(yych <= 'U') goto yy138;
+ goto yy520;
}
}
} else {
if(yych <= 'c'){
if(yych <= '_'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'b') goto yy139;
- goto yy584;
+ if(yych <= 'b') goto yy143;
+ goto yy548;
}
} else {
if(yych <= 'u'){
- if(yych == 'p') goto yy583;
- goto yy139;
+ if(yych == 'p') goto yy547;
+ goto yy143;
} else {
- if(yych <= 'v') goto yy585;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'v') goto yy549;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy569:
- YYDEBUG(569, *YYCURSOR);
+yy533:
+ YYDEBUG(533, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy134;
- goto yy549;
+ if(yych <= 'S') goto yy138;
+ goto yy513;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy578;
- if(yych <= 'z') goto yy139;
+ if(yych == 't') goto yy542;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy570:
- YYDEBUG(570, *YYCURSOR);
+yy534:
+ YYDEBUG(534, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'X'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'W') goto yy134;
- goto yy547;
+ if(yych <= 'W') goto yy138;
+ goto yy511;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'x') goto yy576;
- if(yych <= 'z') goto yy139;
+ if(yych == 'x') goto yy540;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy571:
- YYDEBUG(571, *YYCURSOR);
+yy535:
+ YYDEBUG(535, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy543;
+ if(yych <= 'M') goto yy138;
+ goto yy507;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy572;
- if(yych <= 'z') goto yy139;
+ if(yych == 'n') goto yy536;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy572:
- YYDEBUG(572, *YYCURSOR);
+yy536:
+ YYDEBUG(536, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'C') goto yy135;
- goto yy544;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'C') goto yy139;
+ goto yy508;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 'd') goto yy573;
- if(yych <= 'z') goto yy144;
- goto yy405;
+ if(yych == 'd') goto yy537;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy573:
- YYDEBUG(573, *YYCURSOR);
+yy537:
+ YYDEBUG(537, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy545;
+ goto yy509;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy574;
- if(yych <= 'z') goto yy145;
+ if(yych <= 'a') goto yy538;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy574:
- YYDEBUG(574, *YYCURSOR);
+yy538:
+ YYDEBUG(538, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy137;
- goto yy546;
+ if(yych <= 'X') goto yy141;
+ goto yy510;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy575;
- if(yych <= 'z') goto yy146;
+ if(yych == 'y') goto yy539;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy575:
- YYDEBUG(575, *YYCURSOR);
+yy539:
+ YYDEBUG(539, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == ')') goto yy132;
- if(yych <= '.') goto yy405;
- goto yy140;
+ if(yych == ')') goto yy136;
+ if(yych <= '.') goto yy283;
+ goto yy144;
} else {
if(yych <= '_'){
- if(yych <= '^') goto yy405;
- goto yy140;
+ if(yych <= '^') goto yy283;
+ goto yy144;
} else {
- if(yych <= '`') goto yy405;
- if(yych <= 'z') goto yy147;
- goto yy405;
+ if(yych <= '`') goto yy283;
+ if(yych <= 'z') goto yy151;
+ goto yy283;
}
}
-yy576:
- YYDEBUG(576, *YYCURSOR);
+yy540:
+ YYDEBUG(540, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy548;
+ if(yych <= 'S') goto yy139;
+ goto yy512;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy577;
- if(yych <= 'z') goto yy144;
+ if(yych == 't') goto yy541;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy577:
- YYDEBUG(577, *YYCURSOR);
+yy541:
+ YYDEBUG(541, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 'h') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy578:
- YYDEBUG(578, *YYCURSOR);
+yy542:
+ YYDEBUG(542, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'U'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'T') goto yy135;
- goto yy550;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'T') goto yy139;
+ goto yy514;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 'u') goto yy579;
- if(yych <= 'z') goto yy144;
- goto yy405;
+ if(yych == 'u') goto yy543;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy579:
- YYDEBUG(579, *YYCURSOR);
+yy543:
+ YYDEBUG(543, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy136;
- goto yy551;
+ if(yych <= 'Q') goto yy140;
+ goto yy515;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy580;
- if(yych <= 'z') goto yy145;
+ if(yych == 'r') goto yy544;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy580:
- YYDEBUG(580, *YYCURSOR);
+yy544:
+ YYDEBUG(544, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy137;
- goto yy552;
+ if(yych <= 'C') goto yy141;
+ goto yy516;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy581;
- if(yych <= 'z') goto yy146;
+ if(yych == 'd') goto yy545;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy581:
- YYDEBUG(581, *YYCURSOR);
+yy545:
+ YYDEBUG(545, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy553;
+ goto yy517;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych <= 'a') goto yy582;
- if(yych <= 'z') goto yy147;
+ if(yych <= 'a') goto yy546;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy582:
- YYDEBUG(582, *YYCURSOR);
+yy546:
+ YYDEBUG(546, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy411;
- if(yych == 'y') goto yy419;
- goto yy148;
-yy583:
- YYDEBUG(583, *YYCURSOR);
- yyaccept = 0;
+ if(yych == 'Y') goto yy289;
+ if(yych == 'y') goto yy302;
+ goto yy152;
+yy547:
+ YYDEBUG(547, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'S'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'T') goto yy563;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'T') goto yy527;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 's'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 't') goto yy592;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 't') goto yy556;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy584:
- YYDEBUG(584, *YYCURSOR);
+yy548:
+ YYDEBUG(548, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'O'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy135;
- goto yy560;
+ if(yych <= 'N') goto yy139;
+ goto yy524;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'o') goto yy589;
- if(yych <= 'z') goto yy144;
+ if(yych == 'o') goto yy553;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy585:
- YYDEBUG(585, *YYCURSOR);
+yy549:
+ YYDEBUG(549, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy135;
- goto yy557;
+ if(yych <= 'D') goto yy139;
+ goto yy521;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy586;
- if(yych <= 'z') goto yy144;
+ if(yych == 'e') goto yy550;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy586:
- YYDEBUG(586, *YYCURSOR);
+yy550:
+ YYDEBUG(550, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy136;
- goto yy558;
+ if(yych <= 'M') goto yy140;
+ goto yy522;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy587;
- if(yych <= 'z') goto yy145;
+ if(yych == 'n') goto yy551;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy587:
- YYDEBUG(587, *YYCURSOR);
+yy551:
+ YYDEBUG(551, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy137;
- goto yy559;
+ if(yych <= 'S') goto yy141;
+ goto yy523;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy588;
- if(yych <= 'z') goto yy146;
+ if(yych == 't') goto yy552;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy588:
- YYDEBUG(588, *YYCURSOR);
+yy552:
+ YYDEBUG(552, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'G') goto yy3;
- goto yy163;
+ goto yy167;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy245;
- if(yych <= 'z') goto yy147;
+ if(yych == 'h') goto yy254;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy589:
- YYDEBUG(589, *YYCURSOR);
+yy553:
+ YYDEBUG(553, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy136;
- goto yy561;
+ if(yych <= 'M') goto yy140;
+ goto yy525;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy590;
- if(yych <= 'z') goto yy145;
+ if(yych == 'n') goto yy554;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy590:
- YYDEBUG(590, *YYCURSOR);
+yy554:
+ YYDEBUG(554, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy137;
- goto yy562;
+ if(yych <= 'C') goto yy141;
+ goto yy526;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy591;
- if(yych <= 'z') goto yy146;
+ if(yych == 'd') goto yy555;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy591:
- YYDEBUG(591, *YYCURSOR);
+yy555:
+ YYDEBUG(555, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- YYDEBUG(-1, yych);
- switch(yych){
- case 0x09: case ' ': case 'D': case 'F': case 'H': case 'M': case 'S':
- case 'T': case 'W': case 'Y': goto yy164;
- case ')': goto yy132;
- case '/': case '_': goto yy140;
- 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 yy147;
- case 'd': goto yy249;
- case 'f': goto yy251;
- case 'h': goto yy248;
- case 'm': goto yy247;
- case 's': goto yy246;
- case 't': goto yy253;
- case 'w': goto yy250;
- case 'y': goto yy252;
- default: goto yy3;
+ if(yych <= ')'){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy168;
+ goto yy3;
+ } else {
+ if(yych <= ' ') goto yy168;
+ if(yych <= '(') goto yy3;
+ goto yy136;
+ }
+ } else {
+ if(yych <= '^'){
+ if(yych == '/') goto yy144;
+ goto yy3;
+ } else {
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy151;
+ goto yy3;
+ }
}
-yy592:
- YYDEBUG(592, *YYCURSOR);
- yyaccept = 0;
+yy556:
+ YYDEBUG(556, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'D'){
- if(yych <= '@') goto yy3;
- goto yy136;
+ if(yych <= '@') goto yy310;
+ goto yy140;
} else {
- if(yych <= 'E') goto yy564;
- if(yych <= 'Z') goto yy136;
- goto yy3;
+ if(yych <= 'E') goto yy528;
+ if(yych <= 'Z') goto yy140;
+ goto yy310;
}
} else {
if(yych <= 'd'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy145;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy149;
} else {
- if(yych <= 'e') goto yy593;
- if(yych <= 'z') goto yy145;
- goto yy3;
+ if(yych <= 'e') goto yy557;
+ if(yych <= 'z') goto yy149;
+ goto yy310;
}
}
}
-yy593:
- YYDEBUG(593, *YYCURSOR);
+yy557:
+ YYDEBUG(557, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'M'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'L') goto yy137;
- goto yy565;
+ if(yych <= 'L') goto yy141;
+ goto yy529;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'm') goto yy594;
- if(yych <= 'z') goto yy146;
+ if(yych == 'm') goto yy558;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy594:
- YYDEBUG(594, *YYCURSOR);
+yy558:
+ YYDEBUG(558, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'B'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'A') goto yy3;
- goto yy566;
+ goto yy530;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'b') goto yy595;
- if(yych <= 'z') goto yy147;
+ if(yych == 'b') goto yy559;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy595:
- YYDEBUG(595, *YYCURSOR);
+yy559:
+ YYDEBUG(559, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy567;
- if(yych != 'e') goto yy148;
- goto yy596;
-yy596:
- YYDEBUG(596, *YYCURSOR);
+ if(yych == 'E') goto yy531;
+ if(yych != 'e') goto yy152;
+ goto yy560;
+yy560:
+ YYDEBUG(560, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy53;
- goto yy140;
- } else {
- if(yych == 'R') goto yy422;
- goto yy53;
- }
- } else {
- if(yych <= 'q'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy53;
- goto yy147;
- } else {
- if(yych <= 'r') goto yy528;
- if(yych <= 'z') goto yy147;
- goto yy53;
- }
- }
-yy597:
- YYDEBUG(597, *YYCURSOR);
+ if(yych == 'R') goto yy322;
+ if(yych == 'r') goto yy492;
+ goto yy152;
+yy561:
+ YYDEBUG(561, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'G'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'F') goto yy134;
- goto yy605;
+ if(yych <= 'F') goto yy138;
+ goto yy569;
}
} else {
if(yych <= 'f'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'g') goto yy605;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'g') goto yy569;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy598:
- YYDEBUG(598, *YYCURSOR);
+yy562:
+ YYDEBUG(562, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy134;
- goto yy602;
+ if(yych <= 'Q') goto yy138;
+ goto yy566;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'r') goto yy602;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'r') goto yy566;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy599:
- YYDEBUG(599, *YYCURSOR);
+yy563:
+ YYDEBUG(563, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy134;
- goto yy600;
+ if(yych <= 'N') goto yy138;
+ goto yy564;
}
} else {
if(yych <= 'n'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'o') goto yy600;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'o') goto yy564;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy600:
- YYDEBUG(600, *YYCURSOR);
+yy564:
+ YYDEBUG(564, *YYCURSOR);
++YYCURSOR;
if((yych = *YYCURSOR) <= '@'){
- if(yych == ')') goto yy132;
- goto yy601;
+ if(yych == ')') goto yy136;
+ goto yy565;
} else {
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy601;
- if(yych <= 'z') goto yy135;
- goto yy601;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy565;
+ if(yych <= 'z') goto yy139;
+ goto yy565;
}
-yy601:
- YYDEBUG(601, *YYCURSOR);
+yy565:
+ YYDEBUG(565, *YYCURSOR);
-#line 1321 "ext/date/lib/parse_date.re"
+#line 1347 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@@ -10541,2315 +10030,2326 @@ yy601:
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;
+ if (s->time->have_special_relative && s->time->special.type == TIMELIB_SPECIAL_WEEKDAY) {
+ s->time->special.amount = 0 - s->time->special.amount;
+ }
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
-#line 9333 "ext/date/lib/parse_date.c"
-yy602:
- YYDEBUG(602, *YYCURSOR);
- yyaccept = 0;
+#line 8902 "ext/date/lib/parse_date.c"
+yy566:
+ YYDEBUG(566, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'I') goto yy135;
- goto yy603;
+ if(yych != 'I') goto yy139;
+ goto yy567;
}
} else {
if(yych <= 'h'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'i') goto yy603;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'i') goto yy567;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy603:
- YYDEBUG(603, *YYCURSOR);
+yy567:
+ YYDEBUG(567, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'K') goto yy136;
- goto yy604;
+ if(yych <= 'K') goto yy140;
+ goto yy568;
}
} else {
if(yych <= 'k'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'l') goto yy604;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'l') goto yy568;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy604:
- YYDEBUG(604, *YYCURSOR);
- yyaccept = 0;
+yy568:
+ YYDEBUG(568, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy423;
- goto yy3;
+ if(yych == 0x09) goto yy312;
+ goto yy310;
} else {
- if(yych <= ' ') goto yy423;
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= ' ') goto yy312;
+ if(yych == ')') goto yy136;
+ goto yy310;
}
} else {
if(yych <= '@'){
- if(yych == '/') goto yy3;
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych == '/') goto yy310;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych <= 'Z') goto yy137;
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy137;
- goto yy3;
+ if(yych <= 'Z') goto yy141;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy141;
+ goto yy310;
}
}
-yy605:
- YYDEBUG(605, *YYCURSOR);
- yyaccept = 0;
+yy569:
+ YYDEBUG(569, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'U') goto yy135;
- goto yy606;
+ if(yych != 'U') goto yy139;
+ goto yy570;
}
} else {
if(yych <= 't'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'u') goto yy606;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'u') goto yy570;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy606:
- YYDEBUG(606, *YYCURSOR);
+yy570:
+ YYDEBUG(570, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy136;
- goto yy607;
+ if(yych <= 'R') goto yy140;
+ goto yy571;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 's') goto yy607;
- if(yych <= 'z') goto yy136;
+ if(yych <= 's') goto yy571;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy607:
- YYDEBUG(607, *YYCURSOR);
+yy571:
+ YYDEBUG(571, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy137;
- goto yy608;
+ if(yych <= 'S') goto yy141;
+ goto yy572;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 't') goto yy608;
- if(yych <= 'z') goto yy137;
+ if(yych <= 't') goto yy572;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy608:
- YYDEBUG(608, *YYCURSOR);
- yyaccept = 0;
+yy572:
+ YYDEBUG(572, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '.'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy423;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy312;
} else {
- if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '/') goto yy310;
+ if(yych <= '9') goto yy312;
+ goto yy310;
}
}
-yy609:
- YYDEBUG(609, *YYCURSOR);
+yy573:
+ YYDEBUG(573, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'G'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'F') goto yy134;
- goto yy605;
+ if(yych <= 'F') goto yy138;
+ goto yy569;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'g') goto yy616;
- if(yych <= 'z') goto yy139;
+ if(yych == 'g') goto yy580;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy610:
- YYDEBUG(610, *YYCURSOR);
+yy574:
+ YYDEBUG(574, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy134;
- goto yy602;
+ if(yych <= 'Q') goto yy138;
+ goto yy566;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy613;
- if(yych <= 'z') goto yy139;
+ if(yych == 'r') goto yy577;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy611:
- YYDEBUG(611, *YYCURSOR);
+yy575:
+ YYDEBUG(575, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'O'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy134;
- goto yy600;
+ if(yych <= 'N') goto yy138;
+ goto yy564;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'o') goto yy612;
- if(yych <= 'z') goto yy139;
+ if(yych == 'o') goto yy576;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy612:
- YYDEBUG(612, *YYCURSOR);
- yyaccept = 9;
+yy576:
+ YYDEBUG(576, *YYCURSOR);
+ yyaccept = 10;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy601;
- goto yy132;
+ if(yych <= '(') goto yy565;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
- goto yy601;
+ if(yych == '/') goto yy144;
+ goto yy565;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '^') goto yy601;
- goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '^') goto yy565;
+ goto yy144;
} else {
- if(yych <= '`') goto yy601;
- if(yych <= 'z') goto yy144;
- goto yy601;
+ if(yych <= '`') goto yy565;
+ if(yych <= 'z') goto yy148;
+ goto yy565;
}
}
-yy613:
- YYDEBUG(613, *YYCURSOR);
- yyaccept = 0;
+yy577:
+ YYDEBUG(577, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'H'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'I') goto yy603;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'I') goto yy567;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'h'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'i') goto yy614;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'i') goto yy578;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy614:
- YYDEBUG(614, *YYCURSOR);
+yy578:
+ YYDEBUG(578, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'L'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'K') goto yy136;
- goto yy604;
+ if(yych <= 'K') goto yy140;
+ goto yy568;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'l') goto yy615;
- if(yych <= 'z') goto yy145;
+ if(yych == 'l') goto yy579;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy615:
- YYDEBUG(615, *YYCURSOR);
- yyaccept = 0;
+yy579:
+ YYDEBUG(579, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
- if(yych <= 0x1F) goto yy3;
- goto yy423;
+ if(yych == 0x09) goto yy312;
+ if(yych <= 0x1F) goto yy310;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy423;
+ if(yych == ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy312;
}
} else {
if(yych <= 'Z'){
- if(yych <= '/') goto yy140;
- if(yych <= '9') goto yy423;
- if(yych <= '@') goto yy3;
- goto yy137;
+ if(yych <= '/') goto yy144;
+ if(yych <= '9') goto yy312;
+ if(yych <= '@') goto yy310;
+ goto yy141;
} else {
if(yych <= '_'){
- if(yych <= '^') goto yy3;
- goto yy140;
+ if(yych <= '^') goto yy310;
+ goto yy144;
} else {
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy146;
- goto yy3;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy150;
+ goto yy310;
}
}
}
-yy616:
- YYDEBUG(616, *YYCURSOR);
- yyaccept = 0;
+yy580:
+ YYDEBUG(580, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'T'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'U') goto yy606;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'U') goto yy570;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 't'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'u') goto yy617;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'u') goto yy581;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy617:
- YYDEBUG(617, *YYCURSOR);
+yy581:
+ YYDEBUG(581, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy136;
- goto yy607;
+ if(yych <= 'R') goto yy140;
+ goto yy571;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 's') goto yy618;
- if(yych <= 'z') goto yy145;
+ if(yych == 's') goto yy582;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy618:
- YYDEBUG(618, *YYCURSOR);
+yy582:
+ YYDEBUG(582, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy137;
- goto yy608;
+ if(yych <= 'S') goto yy141;
+ goto yy572;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy619;
- if(yych <= 'z') goto yy146;
+ if(yych == 't') goto yy583;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy619:
- YYDEBUG(619, *YYCURSOR);
- yyaccept = 0;
+yy583:
+ YYDEBUG(583, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy423;
- goto yy3;
+ if(yych == 0x09) goto yy312;
+ goto yy310;
} else {
- if(yych <= ' ') goto yy423;
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= ' ') goto yy312;
+ if(yych == ')') goto yy136;
+ goto yy310;
}
} else {
if(yych <= '^'){
- if(yych == '/') goto yy140;
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych == '/') goto yy144;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy147;
- goto yy3;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy151;
+ goto yy310;
}
}
-yy620:
- YYDEBUG(620, *YYCURSOR);
+yy584:
+ YYDEBUG(584, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'B'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy134;
- goto yy634;
+ if(yych <= 'A') goto yy138;
+ goto yy598;
}
} else {
if(yych <= 'a'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'b') goto yy634;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'b') goto yy598;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy621:
- YYDEBUG(621, *YYCURSOR);
+yy585:
+ YYDEBUG(585, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'F') goto yy631;
- if(yych <= 'Q') goto yy134;
- goto yy630;
+ if(yych == 'F') goto yy595;
+ if(yych <= 'Q') goto yy138;
+ goto yy594;
}
} else {
if(yych <= 'f'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- if(yych <= 'e') goto yy134;
- goto yy631;
+ if(yych <= 'e') goto yy138;
+ goto yy595;
} else {
- if(yych == 'r') goto yy630;
- if(yych <= 'z') goto yy134;
+ if(yych == 'r') goto yy594;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy622:
- YYDEBUG(622, *YYCURSOR);
+yy586:
+ YYDEBUG(586, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'T') goto yy134;
- goto yy627;
+ if(yych <= 'T') goto yy138;
+ goto yy591;
}
} else {
if(yych <= 't'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'u') goto yy627;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'u') goto yy591;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy623:
- YYDEBUG(623, *YYCURSOR);
+yy587:
+ YYDEBUG(587, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'I'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'H') goto yy134;
- goto yy624;
+ if(yych <= 'H') goto yy138;
+ goto yy588;
}
} else {
if(yych <= 'h'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'i') goto yy624;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'i') goto yy588;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy624:
- YYDEBUG(624, *YYCURSOR);
+yy588:
+ YYDEBUG(588, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
- if(yych <= '(') goto yy405;
- goto yy132;
+ if(yych <= '(') goto yy283;
+ goto yy136;
} else {
- if(yych <= '@') goto yy405;
- if(yych <= 'C') goto yy135;
- goto yy625;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'C') goto yy139;
+ goto yy589;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy405;
- goto yy135;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy283;
+ goto yy139;
} else {
- if(yych <= 'd') goto yy625;
- if(yych <= 'z') goto yy135;
- goto yy405;
+ if(yych <= 'd') goto yy589;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy625:
- YYDEBUG(625, *YYCURSOR);
+yy589:
+ YYDEBUG(589, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy626;
+ goto yy590;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
goto yy3;
} else {
- if(yych <= 'a') goto yy626;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'a') goto yy590;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy626:
- YYDEBUG(626, *YYCURSOR);
+yy590:
+ YYDEBUG(590, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy137;
- goto yy546;
+ if(yych <= 'X') goto yy141;
+ goto yy510;
}
} else {
if(yych <= 'x'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'y') goto yy546;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'y') goto yy510;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy627:
- YYDEBUG(627, *YYCURSOR);
+yy591:
+ YYDEBUG(591, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy135;
- goto yy628;
+ if(yych <= 'Q') goto yy139;
+ goto yy592;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'r') goto yy628;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'r') goto yy592;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy628:
- YYDEBUG(628, *YYCURSOR);
+yy592:
+ YYDEBUG(592, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy136;
- goto yy629;
+ if(yych <= 'S') goto yy140;
+ goto yy593;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 't') goto yy629;
- if(yych <= 'z') goto yy136;
+ if(yych <= 't') goto yy593;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy629:
- YYDEBUG(629, *YYCURSOR);
+yy593:
+ YYDEBUG(593, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy137;
- goto yy562;
+ if(yych <= 'G') goto yy141;
+ goto yy526;
}
} else {
if(yych <= 'g'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'h') goto yy562;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'h') goto yy526;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy630:
- YYDEBUG(630, *YYCURSOR);
+yy594:
+ YYDEBUG(594, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy135;
- goto yy633;
+ if(yych <= 'R') goto yy139;
+ goto yy597;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 's') goto yy633;
- if(yych <= 'z') goto yy135;
+ if(yych <= 's') goto yy597;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy631:
- YYDEBUG(631, *YYCURSOR);
+yy595:
+ YYDEBUG(595, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy632;
+ if(yych <= 'S') goto yy139;
+ goto yy596;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 't') goto yy632;
- if(yych <= 'z') goto yy135;
+ if(yych <= 't') goto yy596;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy632:
- YYDEBUG(632, *YYCURSOR);
+yy596:
+ YYDEBUG(596, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= 'g'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'h') goto yy376;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'h') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy633:
- YYDEBUG(633, *YYCURSOR);
+yy597:
+ YYDEBUG(597, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy136;
- goto yy376;
+ if(yych <= 'S') goto yy140;
+ goto yy270;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 't') goto yy376;
- if(yych <= 'z') goto yy136;
+ if(yych <= 't') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy634:
- YYDEBUG(634, *YYCURSOR);
- yyaccept = 0;
+yy598:
+ YYDEBUG(598, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'R') goto yy135;
- goto yy635;
+ if(yych != 'R') goto yy139;
+ goto yy599;
}
} else {
if(yych <= 'q'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'r') goto yy635;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'r') goto yy599;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy635:
- YYDEBUG(635, *YYCURSOR);
+yy599:
+ YYDEBUG(599, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'T') goto yy136;
- goto yy636;
+ if(yych <= 'T') goto yy140;
+ goto yy600;
}
} else {
if(yych <= 't'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'u') goto yy636;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'u') goto yy600;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy636:
- YYDEBUG(636, *YYCURSOR);
+yy600:
+ YYDEBUG(600, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy637;
+ goto yy601;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
goto yy3;
} else {
- if(yych <= 'a') goto yy637;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'a') goto yy601;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy637:
- YYDEBUG(637, *YYCURSOR);
+yy601:
+ YYDEBUG(601, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Q'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'R') goto yy638;
+ if(yych <= 'R') goto yy602;
if(yych != 'r') goto yy3;
- goto yy638;
+ goto yy602;
}
-yy638:
- YYDEBUG(638, *YYCURSOR);
+yy602:
+ YYDEBUG(602, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy422;
- if(yych == 'y') goto yy422;
+ if(yych == 'Y') goto yy322;
+ if(yych == 'y') goto yy322;
goto yy53;
-yy639:
- YYDEBUG(639, *YYCURSOR);
+yy603:
+ YYDEBUG(603, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'B'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy134;
- goto yy634;
+ if(yych <= 'A') goto yy138;
+ goto yy598;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'b') goto yy653;
- if(yych <= 'z') goto yy139;
+ if(yych == 'b') goto yy617;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy640:
- YYDEBUG(640, *YYCURSOR);
+yy604:
+ YYDEBUG(604, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= 'E'){
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'F') goto yy631;
- if(yych <= 'Q') goto yy134;
- goto yy630;
+ if(yych <= 'F') goto yy595;
+ if(yych <= 'Q') goto yy138;
+ goto yy594;
}
}
} else {
if(yych <= 'e'){
if(yych <= '^'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- goto yy139;
+ goto yy143;
}
} else {
if(yych <= 'q'){
- if(yych <= 'f') goto yy650;
- goto yy139;
+ if(yych <= 'f') goto yy614;
+ goto yy143;
} else {
- if(yych <= 'r') goto yy649;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'r') goto yy613;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy641:
- YYDEBUG(641, *YYCURSOR);
+yy605:
+ YYDEBUG(605, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'U'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'T') goto yy134;
- goto yy627;
+ if(yych <= 'T') goto yy138;
+ goto yy591;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'u') goto yy646;
- if(yych <= 'z') goto yy139;
+ if(yych == 'u') goto yy610;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy642:
- YYDEBUG(642, *YYCURSOR);
+yy606:
+ YYDEBUG(606, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'I'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'H') goto yy134;
- goto yy624;
+ if(yych <= 'H') goto yy138;
+ goto yy588;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'i') goto yy643;
- if(yych <= 'z') goto yy139;
+ if(yych == 'i') goto yy607;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy643:
- YYDEBUG(643, *YYCURSOR);
+yy607:
+ YYDEBUG(607, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'C') goto yy135;
- goto yy625;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'C') goto yy139;
+ goto yy589;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 'd') goto yy644;
- if(yych <= 'z') goto yy144;
- goto yy405;
+ if(yych == 'd') goto yy608;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy644:
- YYDEBUG(644, *YYCURSOR);
+yy608:
+ YYDEBUG(608, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy626;
+ goto yy590;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy645;
- if(yych <= 'z') goto yy145;
+ if(yych <= 'a') goto yy609;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy645:
- YYDEBUG(645, *YYCURSOR);
+yy609:
+ YYDEBUG(609, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy137;
- goto yy546;
+ if(yych <= 'X') goto yy141;
+ goto yy510;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy575;
- if(yych <= 'z') goto yy146;
+ if(yych == 'y') goto yy539;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy646:
- YYDEBUG(646, *YYCURSOR);
+yy610:
+ YYDEBUG(610, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy135;
- goto yy628;
+ if(yych <= 'Q') goto yy139;
+ goto yy592;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy647;
- if(yych <= 'z') goto yy144;
+ if(yych == 'r') goto yy611;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy647:
- YYDEBUG(647, *YYCURSOR);
+yy611:
+ YYDEBUG(611, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy136;
- goto yy629;
+ if(yych <= 'S') goto yy140;
+ goto yy593;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy648;
- if(yych <= 'z') goto yy145;
+ if(yych == 't') goto yy612;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy648:
- YYDEBUG(648, *YYCURSOR);
+yy612:
+ YYDEBUG(612, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy137;
- goto yy562;
+ if(yych <= 'G') goto yy141;
+ goto yy526;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy591;
- if(yych <= 'z') goto yy146;
+ if(yych == 'h') goto yy555;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy649:
- YYDEBUG(649, *YYCURSOR);
+yy613:
+ YYDEBUG(613, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy135;
- goto yy633;
+ if(yych <= 'R') goto yy139;
+ goto yy597;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 's') goto yy652;
- if(yych <= 'z') goto yy144;
+ if(yych == 's') goto yy616;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy650:
- YYDEBUG(650, *YYCURSOR);
+yy614:
+ YYDEBUG(614, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy632;
+ if(yych <= 'S') goto yy139;
+ goto yy596;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy651;
- if(yych <= 'z') goto yy144;
+ if(yych == 't') goto yy615;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy651:
- YYDEBUG(651, *YYCURSOR);
+yy615:
+ YYDEBUG(615, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 'h') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy652:
- YYDEBUG(652, *YYCURSOR);
+yy616:
+ YYDEBUG(616, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy136;
- goto yy376;
+ if(yych <= 'S') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 't') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy653:
- YYDEBUG(653, *YYCURSOR);
- yyaccept = 0;
+yy617:
+ YYDEBUG(617, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'Q'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'R') goto yy635;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'R') goto yy599;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'q'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'r') goto yy654;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'r') goto yy618;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy654:
- YYDEBUG(654, *YYCURSOR);
+yy618:
+ YYDEBUG(618, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'U'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'T') goto yy136;
- goto yy636;
+ if(yych <= 'T') goto yy140;
+ goto yy600;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'u') goto yy655;
- if(yych <= 'z') goto yy145;
+ if(yych == 'u') goto yy619;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy655:
- YYDEBUG(655, *YYCURSOR);
+yy619:
+ YYDEBUG(619, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy637;
+ goto yy601;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy656;
- if(yych <= 'z') goto yy146;
+ if(yych <= 'a') goto yy620;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy656:
- YYDEBUG(656, *YYCURSOR);
+yy620:
+ YYDEBUG(620, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'Q') goto yy3;
- goto yy638;
+ goto yy602;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy657;
- if(yych <= 'z') goto yy147;
+ if(yych == 'r') goto yy621;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy657:
- YYDEBUG(657, *YYCURSOR);
+yy621:
+ YYDEBUG(621, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy53;
- goto yy140;
- } else {
- if(yych == 'Y') goto yy422;
- goto yy53;
- }
- } else {
- if(yych <= 'x'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy53;
- goto yy147;
- } else {
- if(yych <= 'y') goto yy528;
- if(yych <= 'z') goto yy147;
- goto yy53;
- }
- }
-yy658:
- YYDEBUG(658, *YYCURSOR);
+ if(yych == 'Y') goto yy322;
+ if(yych == 'y') goto yy492;
+ goto yy152;
+yy622:
+ YYDEBUG(622, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'L') goto yy665;
- if(yych <= 'M') goto yy134;
- goto yy664;
+ if(yych == 'L') goto yy629;
+ if(yych <= 'M') goto yy138;
+ goto yy628;
}
} else {
if(yych <= 'l'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- if(yych <= 'k') goto yy134;
- goto yy665;
+ if(yych <= 'k') goto yy138;
+ goto yy629;
} else {
- if(yych == 'n') goto yy664;
- if(yych <= 'z') goto yy134;
+ if(yych == 'n') goto yy628;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy659:
- YYDEBUG(659, *YYCURSOR);
+yy623:
+ YYDEBUG(623, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy660;
+ if(yych <= 'M') goto yy138;
+ goto yy624;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'n') goto yy660;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'n') goto yy624;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy660:
- YYDEBUG(660, *YYCURSOR);
- yyaccept = 0;
+yy624:
+ YYDEBUG(624, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'U') goto yy135;
- goto yy661;
+ if(yych != 'U') goto yy139;
+ goto yy625;
}
} else {
if(yych <= 't'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'u') goto yy661;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'u') goto yy625;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy661:
- YYDEBUG(661, *YYCURSOR);
+yy625:
+ YYDEBUG(625, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy662;
+ goto yy626;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
goto yy3;
} else {
- if(yych <= 'a') goto yy662;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'a') goto yy626;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy662:
- YYDEBUG(662, *YYCURSOR);
+yy626:
+ YYDEBUG(626, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy137;
- goto yy663;
+ if(yych <= 'Q') goto yy141;
+ goto yy627;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'r') goto yy663;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'r') goto yy627;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy663:
- YYDEBUG(663, *YYCURSOR);
- yyaccept = 0;
- yych = *(YYMARKER = ++YYCURSOR);
+yy627:
+ YYDEBUG(627, *YYCURSOR);
+ yych = *++YYCURSOR;
if(yych <= 'X'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Y') goto yy422;
- if(yych == 'y') goto yy422;
+ if(yych <= 'Y') goto yy322;
+ if(yych == 'y') goto yy322;
goto yy3;
}
-yy664:
- YYDEBUG(664, *YYCURSOR);
- yyaccept = 0;
+yy628:
+ YYDEBUG(628, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych == 'E') goto yy666;
- goto yy135;
+ if(yych == 'E') goto yy630;
+ goto yy139;
}
} else {
if(yych <= 'd'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'e') goto yy666;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'e') goto yy630;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy665:
- YYDEBUG(665, *YYCURSOR);
- yyaccept = 0;
+yy629:
+ YYDEBUG(629, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'Y') goto yy135;
- goto yy666;
+ if(yych != 'Y') goto yy139;
+ goto yy630;
}
} else {
if(yych <= 'x'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'y') goto yy666;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'y') goto yy630;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy666:
- YYDEBUG(666, *YYCURSOR);
- yyaccept = 0;
+yy630:
+ YYDEBUG(630, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy423;
- goto yy3;
+ if(yych == 0x09) goto yy312;
+ goto yy310;
} else {
- if(yych <= ' ') goto yy423;
- if(yych == ')') goto yy132;
- goto yy3;
+ if(yych <= ' ') goto yy312;
+ if(yych == ')') goto yy136;
+ goto yy310;
}
} else {
if(yych <= '@'){
- if(yych == '/') goto yy3;
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych == '/') goto yy310;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych <= 'Z') goto yy136;
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy136;
- goto yy3;
+ if(yych <= 'Z') goto yy140;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy140;
+ goto yy310;
}
}
-yy667:
- YYDEBUG(667, *YYCURSOR);
+yy631:
+ YYDEBUG(631, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= 'K'){
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'L') goto yy665;
- if(yych <= 'M') goto yy134;
- goto yy664;
+ if(yych <= 'L') goto yy629;
+ if(yych <= 'M') goto yy138;
+ goto yy628;
}
}
} else {
if(yych <= 'k'){
if(yych <= '^'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- goto yy139;
+ goto yy143;
}
} else {
if(yych <= 'm'){
- if(yych <= 'l') goto yy674;
- goto yy139;
+ if(yych <= 'l') goto yy638;
+ goto yy143;
} else {
- if(yych <= 'n') goto yy673;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'n') goto yy637;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy668:
- YYDEBUG(668, *YYCURSOR);
+yy632:
+ YYDEBUG(632, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy660;
+ if(yych <= 'M') goto yy138;
+ goto yy624;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy669;
- if(yych <= 'z') goto yy139;
+ if(yych == 'n') goto yy633;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy669:
- YYDEBUG(669, *YYCURSOR);
- yyaccept = 0;
+yy633:
+ YYDEBUG(633, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'T'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'U') goto yy661;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'U') goto yy625;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 't'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'u') goto yy670;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'u') goto yy634;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy670:
- YYDEBUG(670, *YYCURSOR);
+yy634:
+ YYDEBUG(634, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy662;
+ goto yy626;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy671;
- if(yych <= 'z') goto yy145;
+ if(yych <= 'a') goto yy635;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy671:
- YYDEBUG(671, *YYCURSOR);
+yy635:
+ YYDEBUG(635, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy137;
- goto yy663;
+ if(yych <= 'Q') goto yy141;
+ goto yy627;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy672;
- if(yych <= 'z') goto yy146;
+ if(yych == 'r') goto yy636;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy672:
- YYDEBUG(672, *YYCURSOR);
+yy636:
+ YYDEBUG(636, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'X') goto yy3;
- goto yy422;
+ goto yy322;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy528;
- if(yych <= 'z') goto yy147;
+ if(yych == 'y') goto yy492;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy673:
- YYDEBUG(673, *YYCURSOR);
- yyaccept = 0;
+yy637:
+ YYDEBUG(637, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'D'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'E') goto yy666;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'E') goto yy630;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'd'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'e') goto yy675;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'e') goto yy639;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy674:
- YYDEBUG(674, *YYCURSOR);
- yyaccept = 0;
+yy638:
+ YYDEBUG(638, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'X'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'Y') goto yy666;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'Y') goto yy630;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'x'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'y') goto yy675;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'y') goto yy639;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy675:
- YYDEBUG(675, *YYCURSOR);
- yyaccept = 0;
+yy639:
+ YYDEBUG(639, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
- if(yych <= 0x1F) goto yy3;
- goto yy423;
+ if(yych == 0x09) goto yy312;
+ if(yych <= 0x1F) goto yy310;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy423;
+ if(yych == ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy312;
}
} else {
if(yych <= 'Z'){
- if(yych <= '/') goto yy140;
- if(yych <= '9') goto yy423;
- if(yych <= '@') goto yy3;
- goto yy136;
+ if(yych <= '/') goto yy144;
+ if(yych <= '9') goto yy312;
+ if(yych <= '@') goto yy310;
+ goto yy140;
} else {
if(yych <= '_'){
- if(yych <= '^') goto yy3;
- goto yy140;
+ if(yych <= '^') goto yy310;
+ goto yy144;
} else {
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy145;
- goto yy3;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy149;
+ goto yy310;
}
}
}
-yy676:
- YYDEBUG(676, *YYCURSOR);
+yy640:
+ YYDEBUG(640, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
if(yych <= 0x1F) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= ',') goto yy3;
- goto yy423;
+ goto yy312;
}
} else {
if(yych <= 'H'){
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
if(yych <= 'Z'){
- if(yych >= 'J') goto yy134;
- goto yy677;
+ if(yych >= 'J') goto yy138;
+ goto yy641;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
}
-yy677:
- YYDEBUG(677, *YYCURSOR);
+yy641:
+ YYDEBUG(641, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
goto yy3;
} else {
- if(yych <= ' ') goto yy423;
- if(yych == ')') goto yy132;
+ if(yych <= ' ') goto yy312;
+ if(yych == ')') goto yy136;
goto yy3;
}
} else {
if(yych <= '@'){
if(yych == '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
goto yy3;
} else {
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy678:
- YYDEBUG(678, *YYCURSOR);
+yy642:
+ YYDEBUG(642, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
if(yych <= 0x1F) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= ',') goto yy3;
- goto yy423;
+ goto yy312;
}
} else {
if(yych <= 'H'){
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
if(yych <= 'Z'){
- if(yych >= 'J') goto yy134;
- goto yy679;
+ if(yych >= 'J') goto yy138;
+ goto yy643;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
}
-yy679:
- YYDEBUG(679, *YYCURSOR);
+yy643:
+ YYDEBUG(643, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
if(yych <= 0x1F) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= ',') goto yy3;
- goto yy423;
+ goto yy312;
}
} else {
if(yych <= 'H'){
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
if(yych <= '@') goto yy3;
- goto yy135;
+ goto yy139;
} else {
if(yych <= 'Z'){
- if(yych <= 'I') goto yy666;
- goto yy135;
+ if(yych >= 'J') goto yy139;
+ goto yy644;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
}
-yy680:
- YYDEBUG(680, *YYCURSOR);
+yy644:
+ YYDEBUG(644, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
goto yy3;
} else {
- if(yych <= ' ') goto yy423;
- if(yych == ')') goto yy132;
+ if(yych <= ' ') goto yy312;
+ if(yych == ')') goto yy136;
goto yy3;
}
} else {
if(yych <= '@'){
if(yych == '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
goto yy3;
} else {
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy681:
- YYDEBUG(681, *YYCURSOR);
+yy645:
+ YYDEBUG(645, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych <= ','){
+ if(yych <= 0x1F){
+ if(yych == 0x09) goto yy312;
+ goto yy3;
+ } else {
+ if(yych <= ' ') goto yy312;
+ if(yych == ')') goto yy136;
+ goto yy3;
+ }
+ } else {
+ if(yych <= '@'){
+ if(yych == '/') goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy3;
+ } else {
+ if(yych <= 'Z') goto yy138;
+ if(yych <= '`') goto yy3;
+ if(yych <= 'z') goto yy138;
+ goto yy3;
+ }
+ }
+yy646:
+ YYDEBUG(646, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
+ if(yych == 0x09) goto yy312;
if(yych <= 0x1F) goto yy3;
- goto yy423;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= ',') goto yy3;
- goto yy423;
+ goto yy312;
}
} else {
if(yych <= 'H'){
if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy423;
+ if(yych <= '9') goto yy312;
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
if(yych <= 'Z'){
- if(yych <= 'I') goto yy677;
- goto yy134;
+ if(yych <= 'I') goto yy641;
+ goto yy138;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
}
-yy682:
- YYDEBUG(682, *YYCURSOR);
+yy647:
+ YYDEBUG(647, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy684;
- if(yych <= '0') goto yy932;
- if(yych <= '1') goto yy933;
- if(yych <= '9') goto yy934;
- goto yy684;
-yy683:
- YYDEBUG(683, *YYCURSOR);
+ if(yych <= '/') goto yy649;
+ if(yych <= '0') goto yy897;
+ if(yych <= '1') goto yy898;
+ if(yych <= '9') goto yy899;
+ goto yy649;
+yy648:
+ YYDEBUG(648, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
yych = *YYCURSOR;
- goto yy684;
-yy684:
- YYDEBUG(684, *YYCURSOR);
+ goto yy649;
+yy649:
+ YYDEBUG(649, *YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: case ' ': goto yy683;
+ case 0x09: case ' ': goto yy648;
case '-':
- case '.': goto yy783;
- case 'A': case 'a': goto yy702;
- case 'D': case 'd': goto yy688;
- case 'F': case 'f': goto yy689;
+ case '.': goto yy748;
+ case 'A': case 'a': goto yy667;
+ case 'D': case 'd': goto yy653;
+ case 'F': case 'f': goto yy654;
case 'H': case 'h': goto yy60;
- case 'I': goto yy697;
- case 'J': case 'j': goto yy701;
- case 'M': case 'm': goto yy687;
- case 'N': case 'n': goto yy704;
- case 'O': case 'o': goto yy703;
- case 'P': case 'p': goto yy706;
- case 'S': case 's': goto yy685;
+ case 'I': goto yy662;
+ case 'J': case 'j': goto yy666;
+ case 'M': case 'm': goto yy652;
+ case 'N': case 'n': goto yy669;
+ case 'O': case 'o': goto yy668;
+ case 'P': case 'p': goto yy671;
+ case 'S': case 's': goto yy650;
case 'T': case 't': goto yy65;
- case 'V': goto yy699;
+ case 'V': goto yy664;
case 'W': case 'w': goto yy62;
- case 'X': goto yy700;
+ case 'X': goto yy665;
case 'Y': case 'y': goto yy64;
default: goto yy53;
}
-yy685:
- YYDEBUG(685, *YYCURSOR);
+yy650:
+ YYDEBUG(650, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= 'D'){
- if(yych == 'A') goto yy119;
+ if(yych == 'A') goto yy123;
goto yy53;
} else {
- if(yych <= 'E') goto yy1228;
+ if(yych <= 'E') goto yy1196;
if(yych <= 'T') goto yy53;
- goto yy118;
+ goto yy122;
}
} else {
if(yych <= 'd'){
- if(yych == 'a') goto yy119;
+ if(yych == 'a') goto yy123;
goto yy53;
} else {
- if(yych <= 'e') goto yy1228;
- if(yych == 'u') goto yy118;
+ if(yych <= 'e') goto yy1196;
+ if(yych == 'u') goto yy122;
goto yy53;
}
}
-yy686:
- YYDEBUG(686, *YYCURSOR);
+yy651:
+ YYDEBUG(651, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '`'){
if(yych <= 'D'){
- if(yych == 'A') goto yy119;
+ if(yych == 'A') goto yy123;
goto yy53;
} else {
- if(yych <= 'E') goto yy1228;
- if(yych == 'U') goto yy118;
+ if(yych <= 'E') goto yy1196;
+ if(yych == 'U') goto yy122;
goto yy53;
}
} else {
if(yych <= 'e'){
- if(yych <= 'a') goto yy119;
+ if(yych <= 'a') goto yy123;
if(yych <= 'd') goto yy53;
- goto yy1228;
+ goto yy1196;
} else {
if(yych <= 's') goto yy53;
- if(yych <= 't') goto yy929;
- if(yych <= 'u') goto yy118;
+ if(yych <= 't') goto yy894;
+ if(yych <= 'u') goto yy122;
goto yy53;
}
}
-yy687:
- YYDEBUG(687, *YYCURSOR);
+yy652:
+ YYDEBUG(652, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= 'H'){
- if(yych == 'A') goto yy798;
+ if(yych == 'A') goto yy763;
goto yy53;
} else {
- if(yych <= 'I') goto yy110;
+ if(yych <= 'I') goto yy114;
if(yych <= 'N') goto yy53;
- goto yy109;
+ goto yy113;
}
} else {
if(yych <= 'h'){
- if(yych == 'a') goto yy798;
+ if(yych == 'a') goto yy763;
goto yy53;
} else {
- if(yych <= 'i') goto yy110;
- if(yych == 'o') goto yy109;
+ if(yych <= 'i') goto yy114;
+ if(yych == 'o') goto yy113;
goto yy53;
}
}
-yy688:
- YYDEBUG(688, *YYCURSOR);
+yy653:
+ YYDEBUG(653, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
- if(yych == 'A') goto yy106;
+ if(yych == 'A') goto yy110;
if(yych <= 'D') goto yy53;
- goto yy785;
+ goto yy750;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy106;
+ goto yy110;
} else {
- if(yych == 'e') goto yy785;
+ if(yych == 'e') goto yy750;
goto yy53;
}
}
-yy689:
- YYDEBUG(689, *YYCURSOR);
+yy654:
+ YYDEBUG(654, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= 'N'){
- if(yych == 'E') goto yy801;
+ if(yych == 'E') goto yy766;
goto yy53;
} else {
if(yych <= 'O') goto yy83;
@@ -12858,7 +12358,7 @@ yy689:
}
} else {
if(yych <= 'n'){
- if(yych == 'e') goto yy801;
+ if(yych == 'e') goto yy766;
goto yy53;
} else {
if(yych <= 'o') goto yy83;
@@ -12866,8 +12366,8 @@ yy689:
goto yy53;
}
}
-yy690:
- YYDEBUG(690, *YYCURSOR);
+yy655:
+ YYDEBUG(655, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych == 'H') goto yy66;
@@ -12876,67 +12376,67 @@ yy690:
} else {
if(yych <= 'h'){
if(yych <= 'g') goto yy53;
- goto yy1227;
+ goto yy1195;
} else {
if(yych == 'u') goto yy67;
goto yy53;
}
}
-yy691:
- YYDEBUG(691, *YYCURSOR);
+yy656:
+ YYDEBUG(656, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '-') goto yy936;
+ if(yych == '-') goto yy901;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy935;
+ if(yych <= '9') goto yy900;
goto yy57;
-yy692:
- YYDEBUG(692, *YYCURSOR);
+yy657:
+ YYDEBUG(657, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'c'){
- if(yych == 'O') goto yy736;
+ if(yych == 'O') goto yy701;
goto yy53;
} else {
- if(yych <= 'd') goto yy929;
- if(yych == 'o') goto yy736;
+ if(yych <= 'd') goto yy894;
+ if(yych == 'o') goto yy701;
goto yy53;
}
-yy693:
- YYDEBUG(693, *YYCURSOR);
+yy658:
+ YYDEBUG(658, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy929;
+ if(yych == 'd') goto yy894;
goto yy53;
-yy694:
- YYDEBUG(694, *YYCURSOR);
+yy659:
+ YYDEBUG(659, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(-1, yych);
switch(yych){
case '0':
case '1':
- case '2': goto yy869;
- case '3': goto yy871;
+ case '2': goto yy834;
+ case '3': goto yy836;
case '4':
case '5':
case '6':
case '7':
case '8':
- case '9': goto yy872;
- case 'A': case 'a': goto yy876;
- case 'D': case 'd': goto yy880;
- case 'F': case 'f': goto yy874;
- case 'J': case 'j': goto yy873;
- case 'M': case 'm': goto yy875;
- case 'N': case 'n': goto yy879;
- case 'O': case 'o': goto yy878;
- case 'S': case 's': goto yy877;
+ case '9': goto yy837;
+ case 'A': case 'a': goto yy841;
+ case 'D': case 'd': goto yy845;
+ case 'F': case 'f': goto yy839;
+ case 'J': case 'j': goto yy838;
+ case 'M': case 'm': goto yy840;
+ case 'N': case 'n': goto yy844;
+ case 'O': case 'o': goto yy843;
+ case 'S': case 's': goto yy842;
default: goto yy53;
}
-yy695:
- YYDEBUG(695, *YYCURSOR);
+yy660:
+ YYDEBUG(660, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(-1, yych);
switch(yych){
- case '0': goto yy819;
- case '1': goto yy820;
+ case '0': goto yy784;
+ case '1': goto yy785;
case '2':
case '3':
case '4':
@@ -12944,58 +12444,58 @@ yy695:
case '6':
case '7':
case '8':
- case '9': goto yy821;
- case 'A': case 'a': goto yy825;
- case 'D': case 'd': goto yy829;
- case 'F': case 'f': goto yy823;
- case 'J': case 'j': goto yy822;
- case 'M': case 'm': goto yy824;
- case 'N': case 'n': goto yy828;
- case 'O': case 'o': goto yy827;
- case 'S': case 's': goto yy826;
- default: goto yy784;
+ case '9': goto yy786;
+ case 'A': case 'a': goto yy790;
+ case 'D': case 'd': goto yy794;
+ case 'F': case 'f': goto yy788;
+ case 'J': case 'j': goto yy787;
+ case 'M': case 'm': goto yy789;
+ case 'N': case 'n': goto yy793;
+ case 'O': case 'o': goto yy792;
+ case 'S': case 's': goto yy791;
+ default: goto yy749;
}
-yy696:
- YYDEBUG(696, *YYCURSOR);
+yy661:
+ YYDEBUG(661, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '1'){
- if(yych <= '/') goto yy784;
- if(yych <= '0') goto yy774;
- goto yy775;
+ if(yych <= '/') goto yy749;
+ if(yych <= '0') goto yy739;
+ goto yy740;
} else {
- if(yych <= '5') goto yy776;
- if(yych <= '9') goto yy777;
- goto yy784;
+ if(yych <= '5') goto yy741;
+ if(yych <= '9') goto yy742;
+ goto yy749;
}
-yy697:
- YYDEBUG(697, *YYCURSOR);
- yyaccept = 10;
+yy662:
+ YYDEBUG(662, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '.') goto yy738;
- goto yy698;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '.') goto yy703;
+ goto yy663;
}
} else {
if(yych <= 'U'){
- if(yych <= '9') goto yy740;
- if(yych == 'I') goto yy773;
- goto yy698;
+ if(yych <= '9') goto yy705;
+ if(yych == 'I') goto yy738;
+ goto yy663;
} else {
- if(yych == 'W') goto yy698;
- if(yych <= 'X') goto yy746;
- goto yy698;
+ if(yych == 'W') goto yy663;
+ if(yych <= 'X') goto yy711;
+ goto yy663;
}
}
-yy698:
- YYDEBUG(698, *YYCURSOR);
+yy663:
+ YYDEBUG(663, *YYCURSOR);
-#line 1164 "ext/date/lib/parse_date.re"
+#line 1190 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
@@ -13006,157 +12506,157 @@ yy698:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
-#line 11598 "ext/date/lib/parse_date.c"
-yy699:
- YYDEBUG(699, *YYCURSOR);
- yyaccept = 10;
+#line 11173 "ext/date/lib/parse_date.c"
+yy664:
+ YYDEBUG(664, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '9'){
- if(yych <= '.') goto yy738;
- if(yych <= '/') goto yy698;
- goto yy740;
+ if(yych <= '.') goto yy703;
+ if(yych <= '/') goto yy663;
+ goto yy705;
} else {
- if(yych == 'I') goto yy771;
- goto yy698;
+ if(yych == 'I') goto yy736;
+ goto yy663;
}
}
-yy700:
- YYDEBUG(700, *YYCURSOR);
- yyaccept = 10;
+yy665:
+ YYDEBUG(665, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '9'){
- if(yych <= '.') goto yy738;
- if(yych <= '/') goto yy698;
- goto yy740;
+ if(yych <= '.') goto yy703;
+ if(yych <= '/') goto yy663;
+ goto yy705;
} else {
- if(yych == 'I') goto yy770;
- goto yy698;
+ if(yych == 'I') goto yy735;
+ goto yy663;
}
}
-yy701:
- YYDEBUG(701, *YYCURSOR);
+yy666:
+ YYDEBUG(666, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'A') goto yy763;
+ if(yych == 'A') goto yy728;
if(yych <= 'T') goto yy53;
- goto yy762;
+ goto yy727;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy763;
+ goto yy728;
} else {
- if(yych == 'u') goto yy762;
+ if(yych == 'u') goto yy727;
goto yy53;
}
}
-yy702:
- YYDEBUG(702, *YYCURSOR);
+yy667:
+ YYDEBUG(667, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= 'L'){
- if(yych == '.') goto yy707;
+ if(yych == '.') goto yy672;
goto yy53;
} else {
- if(yych <= 'M') goto yy708;
- if(yych == 'P') goto yy756;
+ if(yych <= 'M') goto yy673;
+ if(yych == 'P') goto yy721;
goto yy53;
}
} else {
if(yych <= 'o'){
- if(yych <= 'U') goto yy755;
- if(yych == 'm') goto yy708;
+ if(yych <= 'U') goto yy720;
+ if(yych == 'm') goto yy673;
goto yy53;
} else {
- if(yych <= 'p') goto yy756;
- if(yych == 'u') goto yy755;
+ if(yych <= 'p') goto yy721;
+ if(yych == 'u') goto yy720;
goto yy53;
}
}
-yy703:
- YYDEBUG(703, *YYCURSOR);
+yy668:
+ YYDEBUG(668, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy750;
- if(yych == 'c') goto yy750;
+ if(yych == 'C') goto yy715;
+ if(yych == 'c') goto yy715;
goto yy53;
-yy704:
- YYDEBUG(704, *YYCURSOR);
+yy669:
+ YYDEBUG(669, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy736;
- if(yych == 'o') goto yy736;
+ if(yych == 'O') goto yy701;
+ if(yych == 'o') goto yy701;
goto yy53;
-yy705:
- YYDEBUG(705, *YYCURSOR);
+yy670:
+ YYDEBUG(670, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy712;
- if(yych <= '9') goto yy714;
+ if(yych <= '5') goto yy677;
+ if(yych <= '9') goto yy679;
goto yy53;
-yy706:
- YYDEBUG(706, *YYCURSOR);
+yy671:
+ YYDEBUG(671, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych != '.') goto yy53;
- goto yy707;
+ goto yy672;
} else {
- if(yych <= 'M') goto yy708;
- if(yych == 'm') goto yy708;
+ if(yych <= 'M') goto yy673;
+ if(yych == 'm') goto yy673;
goto yy53;
}
-yy707:
- YYDEBUG(707, *YYCURSOR);
+yy672:
+ YYDEBUG(672, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy708;
+ if(yych == 'M') goto yy673;
if(yych != 'm') goto yy53;
- goto yy708;
-yy708:
- YYDEBUG(708, *YYCURSOR);
+ goto yy673;
+yy673:
+ YYDEBUG(673, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 0x1F){
- if(yych <= 0x00) goto yy710;
- if(yych == 0x09) goto yy710;
+ if(yych <= 0x00) goto yy675;
+ if(yych == 0x09) goto yy675;
goto yy53;
} else {
- if(yych <= ' ') goto yy710;
+ if(yych <= ' ') goto yy675;
if(yych != '.') goto yy53;
- goto yy709;
+ goto yy674;
}
-yy709:
- YYDEBUG(709, *YYCURSOR);
+yy674:
+ YYDEBUG(674, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 0x09){
- if(yych <= 0x00) goto yy710;
+ if(yych <= 0x00) goto yy675;
if(yych <= 0x08) goto yy53;
- goto yy710;
+ goto yy675;
} else {
if(yych != ' ') goto yy53;
- goto yy710;
+ goto yy675;
}
-yy710:
- YYDEBUG(710, *YYCURSOR);
+yy675:
+ YYDEBUG(675, *YYCURSOR);
++YYCURSOR;
- goto yy711;
-yy711:
- YYDEBUG(711, *YYCURSOR);
+ goto yy676;
+yy676:
+ YYDEBUG(676, *YYCURSOR);
-#line 949 "ext/date/lib/parse_date.re"
+#line 963 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
@@ -13172,23 +12672,23 @@ yy711:
TIMELIB_DEINIT;
return TIMELIB_TIME12;
}
-#line 11738 "ext/date/lib/parse_date.c"
-yy712:
- YYDEBUG(712, *YYCURSOR);
- yyaccept = 11;
+#line 11313 "ext/date/lib/parse_date.c"
+yy677:
+ YYDEBUG(677, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy715;
- goto yy713;
+ if(yych == '.') goto yy680;
+ goto yy678;
} else {
- if(yych <= '9') goto yy729;
- if(yych <= ':') goto yy715;
- goto yy713;
+ if(yych <= '9') goto yy694;
+ if(yych <= ':') goto yy680;
+ goto yy678;
}
-yy713:
- YYDEBUG(713, *YYCURSOR);
+yy678:
+ YYDEBUG(678, *YYCURSOR);
-#line 966 "ext/date/lib/parse_date.re"
+#line 980 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
@@ -13213,309 +12713,309 @@ yy713:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
-#line 11775 "ext/date/lib/parse_date.c"
-yy714:
- YYDEBUG(714, *YYCURSOR);
- yyaccept = 11;
+#line 11350 "ext/date/lib/parse_date.c"
+yy679:
+ YYDEBUG(679, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy715;
- if(yych != ':') goto yy713;
- goto yy715;
-yy715:
- YYDEBUG(715, *YYCURSOR);
+ if(yych == '.') goto yy680;
+ if(yych != ':') goto yy678;
+ goto yy680;
+yy680:
+ YYDEBUG(680, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy716;
- if(yych <= '6') goto yy717;
- if(yych <= '9') goto yy718;
+ if(yych <= '5') goto yy681;
+ if(yych <= '6') goto yy682;
+ if(yych <= '9') goto yy683;
goto yy53;
-yy716:
- YYDEBUG(716, *YYCURSOR);
- yyaccept = 11;
+yy681:
+ YYDEBUG(681, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy722;
- goto yy713;
-yy717:
- YYDEBUG(717, *YYCURSOR);
- yyaccept = 11;
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy687;
+ goto yy678;
+yy682:
+ YYDEBUG(682, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych == '0') goto yy722;
- goto yy713;
-yy718:
- YYDEBUG(718, *YYCURSOR);
- yyaccept = 11;
+ if(yych == '.') goto yy684;
+ if(yych == '0') goto yy687;
+ goto yy678;
+yy683:
+ YYDEBUG(683, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych != '.') goto yy713;
- goto yy719;
-yy719:
- YYDEBUG(719, *YYCURSOR);
+ if(yych != '.') goto yy678;
+ goto yy684;
+yy684:
+ YYDEBUG(684, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy720;
-yy720:
- YYDEBUG(720, *YYCURSOR);
+ goto yy685;
+yy685:
+ YYDEBUG(685, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy721;
-yy721:
- YYDEBUG(721, *YYCURSOR);
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy720;
- goto yy713;
-yy722:
- YYDEBUG(722, *YYCURSOR);
- yyaccept = 11;
+ goto yy686;
+yy686:
+ YYDEBUG(686, *YYCURSOR);
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy685;
+ goto yy678;
+yy687:
+ YYDEBUG(687, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= 0x1F){
- if(yych != 0x09) goto yy713;
- goto yy723;
+ if(yych != 0x09) goto yy678;
+ goto yy688;
} else {
- if(yych <= ' ') goto yy723;
- if(yych == '.') goto yy719;
- goto yy713;
+ if(yych <= ' ') goto yy688;
+ if(yych == '.') goto yy684;
+ goto yy678;
}
} else {
if(yych <= '`'){
- if(yych <= 'A') goto yy725;
- if(yych == 'P') goto yy725;
- goto yy713;
+ if(yych <= 'A') goto yy690;
+ if(yych == 'P') goto yy690;
+ goto yy678;
} else {
- if(yych <= 'a') goto yy725;
- if(yych == 'p') goto yy725;
- goto yy713;
+ if(yych <= 'a') goto yy690;
+ if(yych == 'p') goto yy690;
+ goto yy678;
}
}
-yy723:
- YYDEBUG(723, *YYCURSOR);
+yy688:
+ YYDEBUG(688, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
yych = *YYCURSOR;
- goto yy724;
-yy724:
- YYDEBUG(724, *YYCURSOR);
+ goto yy689;
+yy689:
+ YYDEBUG(689, *YYCURSOR);
if(yych <= 'A'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy723;
+ if(yych == 0x09) goto yy688;
goto yy53;
} else {
- if(yych <= ' ') goto yy723;
+ if(yych <= ' ') goto yy688;
if(yych <= '@') goto yy53;
- goto yy725;
+ goto yy690;
}
} else {
if(yych <= '`'){
if(yych != 'P') goto yy53;
- goto yy725;
+ goto yy690;
} else {
- if(yych <= 'a') goto yy725;
+ if(yych <= 'a') goto yy690;
if(yych != 'p') goto yy53;
- goto yy725;
+ goto yy690;
}
}
-yy725:
- YYDEBUG(725, *YYCURSOR);
+yy690:
+ YYDEBUG(690, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych != '.') goto yy53;
- goto yy726;
+ goto yy691;
} else {
- if(yych <= 'M') goto yy727;
- if(yych == 'm') goto yy727;
+ if(yych <= 'M') goto yy692;
+ if(yych == 'm') goto yy692;
goto yy53;
}
-yy726:
- YYDEBUG(726, *YYCURSOR);
+yy691:
+ YYDEBUG(691, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy727;
+ if(yych == 'M') goto yy692;
if(yych != 'm') goto yy53;
- goto yy727;
-yy727:
- YYDEBUG(727, *YYCURSOR);
+ goto yy692;
+yy692:
+ YYDEBUG(692, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 0x1F){
- if(yych <= 0x00) goto yy710;
- if(yych == 0x09) goto yy710;
+ if(yych <= 0x00) goto yy675;
+ if(yych == 0x09) goto yy675;
goto yy53;
} else {
- if(yych <= ' ') goto yy710;
+ if(yych <= ' ') goto yy675;
if(yych != '.') goto yy53;
- goto yy728;
+ goto yy693;
}
-yy728:
- YYDEBUG(728, *YYCURSOR);
+yy693:
+ YYDEBUG(693, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 0x09){
- if(yych <= 0x00) goto yy710;
+ if(yych <= 0x00) goto yy675;
if(yych <= 0x08) goto yy53;
- goto yy710;
+ goto yy675;
} else {
- if(yych == ' ') goto yy710;
+ if(yych == ' ') goto yy675;
goto yy53;
}
-yy729:
- YYDEBUG(729, *YYCURSOR);
- yyaccept = 11;
+yy694:
+ YYDEBUG(694, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ':'){
if(yych <= ' '){
- if(yych == 0x09) goto yy730;
- if(yych <= 0x1F) goto yy713;
- goto yy730;
+ if(yych == 0x09) goto yy695;
+ if(yych <= 0x1F) goto yy678;
+ goto yy695;
} else {
- if(yych == '.') goto yy715;
- if(yych <= '9') goto yy713;
- goto yy715;
+ if(yych == '.') goto yy680;
+ if(yych <= '9') goto yy678;
+ goto yy680;
}
} else {
if(yych <= 'P'){
- if(yych == 'A') goto yy732;
- if(yych <= 'O') goto yy713;
- goto yy732;
+ if(yych == 'A') goto yy697;
+ if(yych <= 'O') goto yy678;
+ goto yy697;
} else {
if(yych <= 'a'){
- if(yych <= '`') goto yy713;
- goto yy732;
+ if(yych <= '`') goto yy678;
+ goto yy697;
} else {
- if(yych == 'p') goto yy732;
- goto yy713;
+ if(yych == 'p') goto yy697;
+ goto yy678;
}
}
}
-yy730:
- YYDEBUG(730, *YYCURSOR);
+yy695:
+ YYDEBUG(695, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
yych = *YYCURSOR;
- goto yy731;
-yy731:
- YYDEBUG(731, *YYCURSOR);
+ goto yy696;
+yy696:
+ YYDEBUG(696, *YYCURSOR);
if(yych <= 'A'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy730;
+ if(yych == 0x09) goto yy695;
goto yy53;
} else {
- if(yych <= ' ') goto yy730;
+ if(yych <= ' ') goto yy695;
if(yych <= '@') goto yy53;
- goto yy732;
+ goto yy697;
}
} else {
if(yych <= '`'){
if(yych != 'P') goto yy53;
- goto yy732;
+ goto yy697;
} else {
- if(yych <= 'a') goto yy732;
+ if(yych <= 'a') goto yy697;
if(yych != 'p') goto yy53;
- goto yy732;
+ goto yy697;
}
}
-yy732:
- YYDEBUG(732, *YYCURSOR);
+yy697:
+ YYDEBUG(697, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych != '.') goto yy53;
- goto yy733;
+ goto yy698;
} else {
- if(yych <= 'M') goto yy734;
- if(yych == 'm') goto yy734;
+ if(yych <= 'M') goto yy699;
+ if(yych == 'm') goto yy699;
goto yy53;
}
-yy733:
- YYDEBUG(733, *YYCURSOR);
+yy698:
+ YYDEBUG(698, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy734;
+ if(yych == 'M') goto yy699;
if(yych != 'm') goto yy53;
- goto yy734;
-yy734:
- YYDEBUG(734, *YYCURSOR);
+ goto yy699;
+yy699:
+ YYDEBUG(699, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 0x1F){
- if(yych <= 0x00) goto yy710;
- if(yych == 0x09) goto yy710;
+ if(yych <= 0x00) goto yy675;
+ if(yych == 0x09) goto yy675;
goto yy53;
} else {
- if(yych <= ' ') goto yy710;
+ if(yych <= ' ') goto yy675;
if(yych != '.') goto yy53;
- goto yy735;
+ goto yy700;
}
-yy735:
- YYDEBUG(735, *YYCURSOR);
+yy700:
+ YYDEBUG(700, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 0x09){
- if(yych <= 0x00) goto yy710;
+ if(yych <= 0x00) goto yy675;
if(yych <= 0x08) goto yy53;
- goto yy710;
+ goto yy675;
} else {
- if(yych == ' ') goto yy710;
+ if(yych == ' ') goto yy675;
goto yy53;
}
-yy736:
- YYDEBUG(736, *YYCURSOR);
+yy701:
+ YYDEBUG(701, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'V') goto yy737;
+ if(yych == 'V') goto yy702;
if(yych != 'v') goto yy53;
- goto yy737;
-yy737:
- YYDEBUG(737, *YYCURSOR);
- yyaccept = 10;
+ goto yy702;
+yy702:
+ YYDEBUG(702, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych != 0x09) goto yy698;
- goto yy738;
+ if(yych != 0x09) goto yy663;
+ goto yy703;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy742;
- if(yych == 'e') goto yy742;
- goto yy698;
+ if(yych <= 'E') goto yy707;
+ if(yych == 'e') goto yy707;
+ goto yy663;
}
}
-yy738:
- YYDEBUG(738, *YYCURSOR);
+yy703:
+ YYDEBUG(703, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yych = *YYCURSOR;
- goto yy739;
-yy739:
- YYDEBUG(739, *YYCURSOR);
+ goto yy704;
+yy704:
+ YYDEBUG(704, *YYCURSOR);
if(yych <= ' '){
- if(yych == 0x09) goto yy738;
+ if(yych == 0x09) goto yy703;
if(yych <= 0x1F) goto yy53;
- goto yy738;
+ goto yy703;
} else {
if(yych <= '.'){
if(yych <= ',') goto yy53;
- goto yy738;
+ goto yy703;
} else {
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy740;
+ goto yy705;
}
}
-yy740:
- YYDEBUG(740, *YYCURSOR);
+yy705:
+ YYDEBUG(705, *YYCURSOR);
++YYCURSOR;
- if((yych = *YYCURSOR) <= '/') goto yy741;
- if(yych <= '9') goto yy747;
- goto yy741;
-yy741:
- YYDEBUG(741, *YYCURSOR);
+ if((yych = *YYCURSOR) <= '/') goto yy706;
+ if(yych <= '9') goto yy712;
+ goto yy706;
+yy706:
+ YYDEBUG(706, *YYCURSOR);
-#line 1098 "ext/date/lib/parse_date.re"
+#line 1124 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datefull");
TIMELIB_INIT;
@@ -13528,795 +13028,795 @@ yy741:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
-#line 12034 "ext/date/lib/parse_date.c"
-yy742:
- YYDEBUG(742, *YYCURSOR);
+#line 11609 "ext/date/lib/parse_date.c"
+yy707:
+ YYDEBUG(707, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy743;
+ if(yych == 'M') goto yy708;
if(yych != 'm') goto yy53;
- goto yy743;
-yy743:
- YYDEBUG(743, *YYCURSOR);
+ goto yy708;
+yy708:
+ YYDEBUG(708, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy744;
+ if(yych == 'B') goto yy709;
if(yych != 'b') goto yy53;
- goto yy744;
-yy744:
- YYDEBUG(744, *YYCURSOR);
+ goto yy709;
+yy709:
+ YYDEBUG(709, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy745;
+ if(yych == 'E') goto yy710;
if(yych != 'e') goto yy53;
- goto yy745;
-yy745:
- YYDEBUG(745, *YYCURSOR);
+ goto yy710;
+yy710:
+ YYDEBUG(710, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy746;
+ if(yych == 'R') goto yy711;
if(yych != 'r') goto yy53;
- goto yy746;
-yy746:
- YYDEBUG(746, *YYCURSOR);
- yyaccept = 10;
+ goto yy711;
+yy711:
+ YYDEBUG(711, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ' '){
- if(yych == 0x09) goto yy738;
- if(yych <= 0x1F) goto yy698;
- goto yy738;
+ if(yych == 0x09) goto yy703;
+ if(yych <= 0x1F) goto yy663;
+ goto yy703;
} else {
if(yych <= '.'){
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ',') goto yy663;
+ goto yy703;
} else {
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
}
}
-yy747:
- YYDEBUG(747, *YYCURSOR);
+yy712:
+ YYDEBUG(712, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy741;
- if(yych >= ':') goto yy741;
- goto yy748;
-yy748:
- YYDEBUG(748, *YYCURSOR);
+ if(yych <= '/') goto yy706;
+ if(yych >= ':') goto yy706;
+ goto yy713;
+yy713:
+ YYDEBUG(713, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy741;
- if(yych >= ':') goto yy741;
- goto yy749;
-yy749:
- YYDEBUG(749, *YYCURSOR);
+ if(yych <= '/') goto yy706;
+ if(yych >= ':') goto yy706;
+ goto yy714;
+yy714:
+ YYDEBUG(714, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy741;
-yy750:
- YYDEBUG(750, *YYCURSOR);
+ goto yy706;
+yy715:
+ YYDEBUG(715, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy751;
+ if(yych == 'T') goto yy716;
if(yych != 't') goto yy53;
- goto yy751;
-yy751:
- YYDEBUG(751, *YYCURSOR);
- yyaccept = 10;
+ goto yy716;
+yy716:
+ YYDEBUG(716, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'N'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'O') goto yy752;
- if(yych != 'o') goto yy698;
- goto yy752;
+ if(yych <= 'O') goto yy717;
+ if(yych != 'o') goto yy663;
+ goto yy717;
}
}
-yy752:
- YYDEBUG(752, *YYCURSOR);
+yy717:
+ YYDEBUG(717, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy753;
+ if(yych == 'B') goto yy718;
if(yych != 'b') goto yy53;
- goto yy753;
-yy753:
- YYDEBUG(753, *YYCURSOR);
+ goto yy718;
+yy718:
+ YYDEBUG(718, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy754;
+ if(yych == 'E') goto yy719;
if(yych != 'e') goto yy53;
- goto yy754;
-yy754:
- YYDEBUG(754, *YYCURSOR);
+ goto yy719;
+yy719:
+ YYDEBUG(719, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy746;
- if(yych == 'r') goto yy746;
+ if(yych == 'R') goto yy711;
+ if(yych == 'r') goto yy711;
goto yy53;
-yy755:
- YYDEBUG(755, *YYCURSOR);
+yy720:
+ YYDEBUG(720, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy759;
- if(yych == 'g') goto yy759;
+ if(yych == 'G') goto yy724;
+ if(yych == 'g') goto yy724;
goto yy53;
-yy756:
- YYDEBUG(756, *YYCURSOR);
+yy721:
+ YYDEBUG(721, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy757;
+ if(yych == 'R') goto yy722;
if(yych != 'r') goto yy53;
- goto yy757;
-yy757:
- YYDEBUG(757, *YYCURSOR);
- yyaccept = 10;
+ goto yy722;
+yy722:
+ YYDEBUG(722, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'H'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'I') goto yy758;
- if(yych != 'i') goto yy698;
- goto yy758;
+ if(yych <= 'I') goto yy723;
+ if(yych != 'i') goto yy663;
+ goto yy723;
}
}
-yy758:
- YYDEBUG(758, *YYCURSOR);
+yy723:
+ YYDEBUG(723, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'L') goto yy746;
- if(yych == 'l') goto yy746;
+ if(yych == 'L') goto yy711;
+ if(yych == 'l') goto yy711;
goto yy53;
-yy759:
- YYDEBUG(759, *YYCURSOR);
- yyaccept = 10;
+yy724:
+ YYDEBUG(724, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'T'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'U') goto yy760;
- if(yych != 'u') goto yy698;
- goto yy760;
+ if(yych <= 'U') goto yy725;
+ if(yych != 'u') goto yy663;
+ goto yy725;
}
}
-yy760:
- YYDEBUG(760, *YYCURSOR);
+yy725:
+ YYDEBUG(725, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'S') goto yy761;
+ if(yych == 'S') goto yy726;
if(yych != 's') goto yy53;
- goto yy761;
-yy761:
- YYDEBUG(761, *YYCURSOR);
+ goto yy726;
+yy726:
+ YYDEBUG(726, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy746;
- if(yych == 't') goto yy746;
+ if(yych == 'T') goto yy711;
+ if(yych == 't') goto yy711;
goto yy53;
-yy762:
- YYDEBUG(762, *YYCURSOR);
+yy727:
+ YYDEBUG(727, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
- if(yych == 'L') goto yy769;
+ if(yych == 'L') goto yy734;
if(yych <= 'M') goto yy53;
- goto yy768;
+ goto yy733;
} else {
if(yych <= 'l'){
if(yych <= 'k') goto yy53;
- goto yy769;
+ goto yy734;
} else {
- if(yych == 'n') goto yy768;
+ if(yych == 'n') goto yy733;
goto yy53;
}
}
-yy763:
- YYDEBUG(763, *YYCURSOR);
+yy728:
+ YYDEBUG(728, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy764;
+ if(yych == 'N') goto yy729;
if(yych != 'n') goto yy53;
- goto yy764;
-yy764:
- YYDEBUG(764, *YYCURSOR);
- yyaccept = 10;
+ goto yy729;
+yy729:
+ YYDEBUG(729, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'T'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'U') goto yy765;
- if(yych != 'u') goto yy698;
- goto yy765;
+ if(yych <= 'U') goto yy730;
+ if(yych != 'u') goto yy663;
+ goto yy730;
}
}
-yy765:
- YYDEBUG(765, *YYCURSOR);
+yy730:
+ YYDEBUG(730, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy766;
+ if(yych == 'A') goto yy731;
if(yych != 'a') goto yy53;
- goto yy766;
-yy766:
- YYDEBUG(766, *YYCURSOR);
+ goto yy731;
+yy731:
+ YYDEBUG(731, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy767;
+ if(yych == 'R') goto yy732;
if(yych != 'r') goto yy53;
- goto yy767;
-yy767:
- YYDEBUG(767, *YYCURSOR);
+ goto yy732;
+yy732:
+ YYDEBUG(732, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy746;
- if(yych == 'y') goto yy746;
+ if(yych == 'Y') goto yy711;
+ if(yych == 'y') goto yy711;
goto yy53;
-yy768:
- YYDEBUG(768, *YYCURSOR);
- yyaccept = 10;
+yy733:
+ YYDEBUG(733, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy746;
- if(yych == 'e') goto yy746;
- goto yy698;
+ if(yych <= 'E') goto yy711;
+ if(yych == 'e') goto yy711;
+ goto yy663;
}
}
-yy769:
- YYDEBUG(769, *YYCURSOR);
- yyaccept = 10;
+yy734:
+ YYDEBUG(734, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'X'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'Y') goto yy746;
- if(yych == 'y') goto yy746;
- goto yy698;
+ if(yych <= 'Y') goto yy711;
+ if(yych == 'y') goto yy711;
+ goto yy663;
}
}
-yy770:
- YYDEBUG(770, *YYCURSOR);
- yyaccept = 10;
+yy735:
+ YYDEBUG(735, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '9'){
- if(yych <= '.') goto yy738;
- if(yych <= '/') goto yy698;
- goto yy740;
+ if(yych <= '.') goto yy703;
+ if(yych <= '/') goto yy663;
+ goto yy705;
} else {
- if(yych == 'I') goto yy746;
- goto yy698;
+ if(yych == 'I') goto yy711;
+ goto yy663;
}
}
-yy771:
- YYDEBUG(771, *YYCURSOR);
- yyaccept = 10;
+yy736:
+ YYDEBUG(736, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '9'){
- if(yych <= '.') goto yy738;
- if(yych <= '/') goto yy698;
- goto yy740;
+ if(yych <= '.') goto yy703;
+ if(yych <= '/') goto yy663;
+ goto yy705;
} else {
- if(yych != 'I') goto yy698;
- goto yy772;
+ if(yych != 'I') goto yy663;
+ goto yy737;
}
}
-yy772:
- YYDEBUG(772, *YYCURSOR);
- yyaccept = 10;
+yy737:
+ YYDEBUG(737, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '9'){
- if(yych <= '.') goto yy738;
- if(yych <= '/') goto yy698;
- goto yy740;
+ if(yych <= '.') goto yy703;
+ if(yych <= '/') goto yy663;
+ goto yy705;
} else {
- if(yych == 'I') goto yy746;
- goto yy698;
+ if(yych == 'I') goto yy711;
+ goto yy663;
}
}
-yy773:
- YYDEBUG(773, *YYCURSOR);
- yyaccept = 10;
+yy738:
+ YYDEBUG(738, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '9'){
- if(yych <= '.') goto yy738;
- if(yych <= '/') goto yy698;
- goto yy740;
+ if(yych <= '.') goto yy703;
+ if(yych <= '/') goto yy663;
+ goto yy705;
} else {
- if(yych == 'I') goto yy746;
- goto yy698;
+ if(yych == 'I') goto yy711;
+ goto yy663;
}
}
-yy774:
- YYDEBUG(774, *YYCURSOR);
- yyaccept = 11;
+yy739:
+ YYDEBUG(739, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- goto yy808;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ goto yy773;
} else {
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy818;
- if(yych <= ':') goto yy715;
- goto yy713;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy783;
+ if(yych <= ':') goto yy680;
+ goto yy678;
}
-yy775:
- YYDEBUG(775, *YYCURSOR);
- yyaccept = 11;
+yy740:
+ YYDEBUG(740, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- if(yych <= '.') goto yy808;
- goto yy713;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ if(yych <= '.') goto yy773;
+ goto yy678;
} else {
- if(yych <= '2') goto yy818;
- if(yych <= '9') goto yy729;
- if(yych <= ':') goto yy715;
- goto yy713;
+ if(yych <= '2') goto yy783;
+ if(yych <= '9') goto yy694;
+ if(yych <= ':') goto yy680;
+ goto yy678;
}
-yy776:
- YYDEBUG(776, *YYCURSOR);
- yyaccept = 11;
+yy741:
+ YYDEBUG(741, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- goto yy808;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ goto yy773;
} else {
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy729;
- if(yych <= ':') goto yy715;
- goto yy713;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy694;
+ if(yych <= ':') goto yy680;
+ goto yy678;
}
-yy777:
- YYDEBUG(777, *YYCURSOR);
- yyaccept = 11;
+yy742:
+ YYDEBUG(742, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- goto yy808;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ goto yy773;
} else {
- if(yych == ':') goto yy715;
- goto yy713;
+ if(yych == ':') goto yy680;
+ goto yy678;
}
-yy778:
- YYDEBUG(778, *YYCURSOR);
+yy743:
+ YYDEBUG(743, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy801;
- if(yych == 'e') goto yy801;
+ if(yych == 'E') goto yy766;
+ if(yych == 'e') goto yy766;
goto yy53;
-yy779:
- YYDEBUG(779, *YYCURSOR);
+yy744:
+ YYDEBUG(744, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy798;
- if(yych == 'a') goto yy798;
+ if(yych == 'A') goto yy763;
+ if(yych == 'a') goto yy763;
goto yy53;
-yy780:
- YYDEBUG(780, *YYCURSOR);
+yy745:
+ YYDEBUG(745, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'P') goto yy756;
+ if(yych == 'P') goto yy721;
if(yych <= 'T') goto yy53;
- goto yy755;
+ goto yy720;
} else {
if(yych <= 'p'){
if(yych <= 'o') goto yy53;
- goto yy756;
+ goto yy721;
} else {
- if(yych == 'u') goto yy755;
+ if(yych == 'u') goto yy720;
goto yy53;
}
}
-yy781:
- YYDEBUG(781, *YYCURSOR);
+yy746:
+ YYDEBUG(746, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy791;
- if(yych == 'e') goto yy791;
+ if(yych == 'E') goto yy756;
+ if(yych == 'e') goto yy756;
goto yy53;
-yy782:
- YYDEBUG(782, *YYCURSOR);
+yy747:
+ YYDEBUG(747, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy785;
- if(yych == 'e') goto yy785;
+ if(yych == 'E') goto yy750;
+ if(yych == 'e') goto yy750;
goto yy53;
-yy783:
- YYDEBUG(783, *YYCURSOR);
+yy748:
+ YYDEBUG(748, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
yych = *YYCURSOR;
- goto yy784;
-yy784:
- YYDEBUG(784, *YYCURSOR);
+ goto yy749;
+yy749:
+ YYDEBUG(749, *YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
case 0x09: case ' ': case '-':
- case '.': goto yy783;
- case 'A': case 'a': goto yy780;
- case 'D': case 'd': goto yy782;
- case 'F': case 'f': goto yy778;
- case 'I': goto yy697;
- case 'J': case 'j': goto yy701;
- case 'M': case 'm': goto yy779;
- case 'N': case 'n': goto yy704;
- case 'O': case 'o': goto yy703;
- case 'S': case 's': goto yy781;
- case 'V': goto yy699;
- case 'X': goto yy700;
+ case '.': goto yy748;
+ case 'A': case 'a': goto yy745;
+ case 'D': case 'd': goto yy747;
+ case 'F': case 'f': goto yy743;
+ case 'I': goto yy662;
+ case 'J': case 'j': goto yy666;
+ case 'M': case 'm': goto yy744;
+ case 'N': case 'n': goto yy669;
+ case 'O': case 'o': goto yy668;
+ case 'S': case 's': goto yy746;
+ case 'V': goto yy664;
+ case 'X': goto yy665;
default: goto yy53;
}
-yy785:
- YYDEBUG(785, *YYCURSOR);
+yy750:
+ YYDEBUG(750, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy786;
+ if(yych == 'C') goto yy751;
if(yych != 'c') goto yy53;
- goto yy786;
-yy786:
- YYDEBUG(786, *YYCURSOR);
- yyaccept = 10;
+ goto yy751;
+yy751:
+ YYDEBUG(751, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy787;
- if(yych != 'e') goto yy698;
- goto yy787;
+ if(yych <= 'E') goto yy752;
+ if(yych != 'e') goto yy663;
+ goto yy752;
}
}
-yy787:
- YYDEBUG(787, *YYCURSOR);
+yy752:
+ YYDEBUG(752, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy788;
+ if(yych == 'M') goto yy753;
if(yych != 'm') goto yy53;
- goto yy788;
-yy788:
- YYDEBUG(788, *YYCURSOR);
+ goto yy753;
+yy753:
+ YYDEBUG(753, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy789;
+ if(yych == 'B') goto yy754;
if(yych != 'b') goto yy53;
- goto yy789;
-yy789:
- YYDEBUG(789, *YYCURSOR);
+ goto yy754;
+yy754:
+ YYDEBUG(754, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy790;
+ if(yych == 'E') goto yy755;
if(yych != 'e') goto yy53;
- goto yy790;
-yy790:
- YYDEBUG(790, *YYCURSOR);
+ goto yy755;
+yy755:
+ YYDEBUG(755, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy746;
- if(yych == 'r') goto yy746;
+ if(yych == 'R') goto yy711;
+ if(yych == 'r') goto yy711;
goto yy53;
-yy791:
- YYDEBUG(791, *YYCURSOR);
+yy756:
+ YYDEBUG(756, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'P') goto yy792;
+ if(yych == 'P') goto yy757;
if(yych != 'p') goto yy53;
- goto yy792;
-yy792:
- YYDEBUG(792, *YYCURSOR);
- yyaccept = 10;
+ goto yy757;
+yy757:
+ YYDEBUG(757, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'S'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'T') goto yy793;
- if(yych != 't') goto yy698;
- goto yy793;
+ if(yych <= 'T') goto yy758;
+ if(yych != 't') goto yy663;
+ goto yy758;
}
}
-yy793:
- YYDEBUG(793, *YYCURSOR);
- yyaccept = 10;
+yy758:
+ YYDEBUG(758, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy794;
- if(yych != 'e') goto yy698;
- goto yy794;
+ if(yych <= 'E') goto yy759;
+ if(yych != 'e') goto yy663;
+ goto yy759;
}
}
-yy794:
- YYDEBUG(794, *YYCURSOR);
+yy759:
+ YYDEBUG(759, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy795;
+ if(yych == 'M') goto yy760;
if(yych != 'm') goto yy53;
- goto yy795;
-yy795:
- YYDEBUG(795, *YYCURSOR);
+ goto yy760;
+yy760:
+ YYDEBUG(760, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy796;
+ if(yych == 'B') goto yy761;
if(yych != 'b') goto yy53;
- goto yy796;
-yy796:
- YYDEBUG(796, *YYCURSOR);
+ goto yy761;
+yy761:
+ YYDEBUG(761, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy797;
+ if(yych == 'E') goto yy762;
if(yych != 'e') goto yy53;
- goto yy797;
-yy797:
- YYDEBUG(797, *YYCURSOR);
+ goto yy762;
+yy762:
+ YYDEBUG(762, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy746;
- if(yych == 'r') goto yy746;
+ if(yych == 'R') goto yy711;
+ if(yych == 'r') goto yy711;
goto yy53;
-yy798:
- YYDEBUG(798, *YYCURSOR);
+yy763:
+ YYDEBUG(763, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
- if(yych == 'R') goto yy799;
+ if(yych == 'R') goto yy764;
if(yych <= 'X') goto yy53;
- goto yy746;
+ goto yy711;
} else {
if(yych <= 'r'){
if(yych <= 'q') goto yy53;
- goto yy799;
+ goto yy764;
} else {
- if(yych == 'y') goto yy746;
+ if(yych == 'y') goto yy711;
goto yy53;
}
}
-yy799:
- YYDEBUG(799, *YYCURSOR);
- yyaccept = 10;
+yy764:
+ YYDEBUG(764, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'B'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'C') goto yy800;
- if(yych != 'c') goto yy698;
- goto yy800;
+ if(yych <= 'C') goto yy765;
+ if(yych != 'c') goto yy663;
+ goto yy765;
}
}
-yy800:
- YYDEBUG(800, *YYCURSOR);
+yy765:
+ YYDEBUG(765, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'H') goto yy746;
- if(yych == 'h') goto yy746;
+ if(yych == 'H') goto yy711;
+ if(yych == 'h') goto yy711;
goto yy53;
-yy801:
- YYDEBUG(801, *YYCURSOR);
+yy766:
+ YYDEBUG(766, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy802;
+ if(yych == 'B') goto yy767;
if(yych != 'b') goto yy53;
- goto yy802;
-yy802:
- YYDEBUG(802, *YYCURSOR);
- yyaccept = 10;
+ goto yy767;
+yy767:
+ YYDEBUG(767, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ goto yy703;
}
} else {
if(yych <= 'Q'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'R') goto yy803;
- if(yych != 'r') goto yy698;
- goto yy803;
+ if(yych <= 'R') goto yy768;
+ if(yych != 'r') goto yy663;
+ goto yy768;
}
}
-yy803:
- YYDEBUG(803, *YYCURSOR);
+yy768:
+ YYDEBUG(768, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'U') goto yy804;
+ if(yych == 'U') goto yy769;
if(yych != 'u') goto yy53;
- goto yy804;
-yy804:
- YYDEBUG(804, *YYCURSOR);
+ goto yy769;
+yy769:
+ YYDEBUG(769, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy805;
+ if(yych == 'A') goto yy770;
if(yych != 'a') goto yy53;
- goto yy805;
-yy805:
- YYDEBUG(805, *YYCURSOR);
+ goto yy770;
+yy770:
+ YYDEBUG(770, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy806;
+ if(yych == 'R') goto yy771;
if(yych != 'r') goto yy53;
- goto yy806;
-yy806:
- YYDEBUG(806, *YYCURSOR);
+ goto yy771;
+yy771:
+ YYDEBUG(771, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy746;
- if(yych == 'y') goto yy746;
+ if(yych == 'Y') goto yy711;
+ if(yych == 'y') goto yy711;
goto yy53;
-yy807:
- YYDEBUG(807, *YYCURSOR);
+yy772:
+ YYDEBUG(772, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy817;
+ if(yych <= '9') goto yy782;
goto yy53;
-yy808:
- YYDEBUG(808, *YYCURSOR);
+yy773:
+ YYDEBUG(773, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy809;
- if(yych <= '6') goto yy810;
- if(yych <= '9') goto yy811;
+ if(yych <= '5') goto yy774;
+ if(yych <= '6') goto yy775;
+ if(yych <= '9') goto yy776;
goto yy53;
-yy809:
- YYDEBUG(809, *YYCURSOR);
- yyaccept = 11;
+yy774:
+ YYDEBUG(774, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy816;
- goto yy713;
-yy810:
- YYDEBUG(810, *YYCURSOR);
- yyaccept = 11;
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy781;
+ goto yy678;
+yy775:
+ YYDEBUG(775, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy719;
- goto yy713;
+ if(yych == '.') goto yy684;
+ goto yy678;
} else {
- if(yych <= '0') goto yy816;
- if(yych <= '9') goto yy812;
- goto yy713;
+ if(yych <= '0') goto yy781;
+ if(yych <= '9') goto yy777;
+ goto yy678;
}
-yy811:
- YYDEBUG(811, *YYCURSOR);
- yyaccept = 11;
+yy776:
+ YYDEBUG(776, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- if(yych >= ':') goto yy713;
- goto yy812;
-yy812:
- YYDEBUG(812, *YYCURSOR);
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ if(yych >= ':') goto yy678;
+ goto yy777;
+yy777:
+ YYDEBUG(777, *YYCURSOR);
++YYCURSOR;
- if((yych = *YYCURSOR) <= '/') goto yy813;
- if(yych <= '9') goto yy814;
- goto yy813;
-yy813:
- YYDEBUG(813, *YYCURSOR);
+ if((yych = *YYCURSOR) <= '/') goto yy778;
+ if(yych <= '9') goto yy779;
+ goto yy778;
+yy778:
+ YYDEBUG(778, *YYCURSOR);
-#line 1112 "ext/date/lib/parse_date.re"
+#line 1138 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date");
TIMELIB_INIT;
@@ -14328,652 +13828,652 @@ yy813:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
-#line 12689 "ext/date/lib/parse_date.c"
-yy814:
- YYDEBUG(814, *YYCURSOR);
+#line 12264 "ext/date/lib/parse_date.c"
+yy779:
+ YYDEBUG(779, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy813;
- if(yych >= ':') goto yy813;
- goto yy815;
-yy815:
- YYDEBUG(815, *YYCURSOR);
+ if(yych <= '/') goto yy778;
+ if(yych >= ':') goto yy778;
+ goto yy780;
+yy780:
+ YYDEBUG(780, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy813;
-yy816:
- YYDEBUG(816, *YYCURSOR);
- yyaccept = 11;
+ goto yy778;
+yy781:
+ YYDEBUG(781, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= ' '){
- if(yych == 0x09) goto yy723;
- if(yych <= 0x1F) goto yy713;
- goto yy723;
+ if(yych == 0x09) goto yy688;
+ if(yych <= 0x1F) goto yy678;
+ goto yy688;
} else {
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- goto yy814;
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ goto yy779;
}
} else {
if(yych <= 'P'){
- if(yych == 'A') goto yy725;
- if(yych <= 'O') goto yy713;
- goto yy725;
+ if(yych == 'A') goto yy690;
+ if(yych <= 'O') goto yy678;
+ goto yy690;
} else {
if(yych <= 'a'){
- if(yych <= '`') goto yy713;
- goto yy725;
+ if(yych <= '`') goto yy678;
+ goto yy690;
} else {
- if(yych == 'p') goto yy725;
- goto yy713;
+ if(yych == 'p') goto yy690;
+ goto yy678;
}
}
}
-yy817:
- YYDEBUG(817, *YYCURSOR);
+yy782:
+ YYDEBUG(782, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy813;
- if(yych <= '9') goto yy812;
- goto yy813;
-yy818:
- YYDEBUG(818, *YYCURSOR);
- yyaccept = 11;
+ if(yych <= '/') goto yy778;
+ if(yych <= '9') goto yy777;
+ goto yy778;
+yy783:
+ YYDEBUG(783, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ':'){
if(yych <= ' '){
- if(yych == 0x09) goto yy730;
- if(yych <= 0x1F) goto yy713;
- goto yy730;
+ if(yych == 0x09) goto yy695;
+ if(yych <= 0x1F) goto yy678;
+ goto yy695;
} else {
if(yych <= '-'){
- if(yych <= ',') goto yy713;
- goto yy807;
+ if(yych <= ',') goto yy678;
+ goto yy772;
} else {
- if(yych <= '.') goto yy808;
- if(yych <= '9') goto yy713;
- goto yy715;
+ if(yych <= '.') goto yy773;
+ if(yych <= '9') goto yy678;
+ goto yy680;
}
}
} else {
if(yych <= 'P'){
- if(yych == 'A') goto yy732;
- if(yych <= 'O') goto yy713;
- goto yy732;
+ if(yych == 'A') goto yy697;
+ if(yych <= 'O') goto yy678;
+ goto yy697;
} else {
if(yych <= 'a'){
- if(yych <= '`') goto yy713;
- goto yy732;
+ if(yych <= '`') goto yy678;
+ goto yy697;
} else {
- if(yych == 'p') goto yy732;
- goto yy713;
+ if(yych == 'p') goto yy697;
+ goto yy678;
}
}
}
-yy819:
- YYDEBUG(819, *YYCURSOR);
+yy784:
+ YYDEBUG(784, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '.'){
if(yych <= ',') goto yy53;
- if(yych <= '-') goto yy858;
- goto yy807;
+ if(yych <= '-') goto yy823;
+ goto yy772;
} else {
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy821;
+ if(yych <= '9') goto yy786;
goto yy53;
}
-yy820:
- YYDEBUG(820, *YYCURSOR);
+yy785:
+ YYDEBUG(785, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '.'){
if(yych <= ',') goto yy53;
- if(yych <= '-') goto yy858;
- goto yy807;
+ if(yych <= '-') goto yy823;
+ goto yy772;
} else {
if(yych <= '/') goto yy53;
if(yych >= '3') goto yy53;
- goto yy821;
+ goto yy786;
}
-yy821:
- YYDEBUG(821, *YYCURSOR);
+yy786:
+ YYDEBUG(786, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= ',') goto yy53;
- if(yych <= '-') goto yy858;
- if(yych <= '.') goto yy807;
+ if(yych <= '-') goto yy823;
+ if(yych <= '.') goto yy772;
goto yy53;
-yy822:
- YYDEBUG(822, *YYCURSOR);
+yy787:
+ YYDEBUG(787, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'A') goto yy854;
+ if(yych == 'A') goto yy819;
if(yych <= 'T') goto yy53;
- goto yy853;
+ goto yy818;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy854;
+ goto yy819;
} else {
- if(yych == 'u') goto yy853;
+ if(yych == 'u') goto yy818;
goto yy53;
}
}
-yy823:
- YYDEBUG(823, *YYCURSOR);
+yy788:
+ YYDEBUG(788, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy851;
- if(yych == 'e') goto yy851;
+ if(yych == 'E') goto yy816;
+ if(yych == 'e') goto yy816;
goto yy53;
-yy824:
- YYDEBUG(824, *YYCURSOR);
+yy789:
+ YYDEBUG(789, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy848;
- if(yych == 'a') goto yy848;
+ if(yych == 'A') goto yy813;
+ if(yych == 'a') goto yy813;
goto yy53;
-yy825:
- YYDEBUG(825, *YYCURSOR);
+yy790:
+ YYDEBUG(790, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'P') goto yy845;
+ if(yych == 'P') goto yy810;
if(yych <= 'T') goto yy53;
- goto yy844;
+ goto yy809;
} else {
if(yych <= 'p'){
if(yych <= 'o') goto yy53;
- goto yy845;
+ goto yy810;
} else {
- if(yych == 'u') goto yy844;
+ if(yych == 'u') goto yy809;
goto yy53;
}
}
-yy826:
- YYDEBUG(826, *YYCURSOR);
+yy791:
+ YYDEBUG(791, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy841;
- if(yych == 'e') goto yy841;
+ if(yych == 'E') goto yy806;
+ if(yych == 'e') goto yy806;
goto yy53;
-yy827:
- YYDEBUG(827, *YYCURSOR);
+yy792:
+ YYDEBUG(792, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy839;
- if(yych == 'c') goto yy839;
+ if(yych == 'C') goto yy804;
+ if(yych == 'c') goto yy804;
goto yy53;
-yy828:
- YYDEBUG(828, *YYCURSOR);
+yy793:
+ YYDEBUG(793, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy837;
- if(yych == 'o') goto yy837;
+ if(yych == 'O') goto yy802;
+ if(yych == 'o') goto yy802;
goto yy53;
-yy829:
- YYDEBUG(829, *YYCURSOR);
+yy794:
+ YYDEBUG(794, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy830;
+ if(yych == 'E') goto yy795;
if(yych != 'e') goto yy53;
- goto yy830;
-yy830:
- YYDEBUG(830, *YYCURSOR);
+ goto yy795;
+yy795:
+ YYDEBUG(795, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy831;
+ if(yych == 'C') goto yy796;
if(yych != 'c') goto yy53;
- goto yy831;
-yy831:
- YYDEBUG(831, *YYCURSOR);
- yyaccept = 10;
+ goto yy796;
+yy796:
+ YYDEBUG(796, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych >= '.') goto yy738;
- goto yy832;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych >= '.') goto yy703;
+ goto yy797;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy787;
- if(yych == 'e') goto yy787;
- goto yy698;
+ if(yych <= 'E') goto yy752;
+ if(yych == 'e') goto yy752;
+ goto yy663;
}
}
-yy832:
- YYDEBUG(832, *YYCURSOR);
+yy797:
+ YYDEBUG(797, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy739;
- if(yych <= '0') goto yy833;
- if(yych <= '2') goto yy834;
- if(yych <= '3') goto yy835;
- goto yy739;
-yy833:
- YYDEBUG(833, *YYCURSOR);
+ if(yych <= '/') goto yy704;
+ if(yych <= '0') goto yy798;
+ if(yych <= '2') goto yy799;
+ if(yych <= '3') goto yy800;
+ goto yy704;
+yy798:
+ YYDEBUG(798, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy741;
- if(yych <= '0') goto yy747;
- if(yych <= '9') goto yy836;
- goto yy741;
-yy834:
- YYDEBUG(834, *YYCURSOR);
+ if(yych <= '/') goto yy706;
+ if(yych <= '0') goto yy712;
+ if(yych <= '9') goto yy801;
+ goto yy706;
+yy799:
+ YYDEBUG(799, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy741;
- if(yych <= '9') goto yy836;
- goto yy741;
-yy835:
- YYDEBUG(835, *YYCURSOR);
+ if(yych <= '/') goto yy706;
+ if(yych <= '9') goto yy801;
+ goto yy706;
+yy800:
+ YYDEBUG(800, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy741;
- if(yych <= '1') goto yy836;
- if(yych <= '9') goto yy747;
- goto yy741;
-yy836:
- YYDEBUG(836, *YYCURSOR);
+ if(yych <= '/') goto yy706;
+ if(yych <= '1') goto yy801;
+ if(yych <= '9') goto yy712;
+ goto yy706;
+yy801:
+ YYDEBUG(801, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy741;
- if(yych <= '9') goto yy748;
- goto yy741;
-yy837:
- YYDEBUG(837, *YYCURSOR);
+ if(yych <= '/') goto yy706;
+ if(yych <= '9') goto yy713;
+ goto yy706;
+yy802:
+ YYDEBUG(802, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'V') goto yy838;
+ if(yych == 'V') goto yy803;
if(yych != 'v') goto yy53;
- goto yy838;
-yy838:
- YYDEBUG(838, *YYCURSOR);
- yyaccept = 10;
+ goto yy803;
+yy803:
+ YYDEBUG(803, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy742;
- if(yych == 'e') goto yy742;
- goto yy698;
+ if(yych <= 'E') goto yy707;
+ if(yych == 'e') goto yy707;
+ goto yy663;
}
}
-yy839:
- YYDEBUG(839, *YYCURSOR);
+yy804:
+ YYDEBUG(804, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy840;
+ if(yych == 'T') goto yy805;
if(yych != 't') goto yy53;
- goto yy840;
-yy840:
- YYDEBUG(840, *YYCURSOR);
- yyaccept = 10;
+ goto yy805;
+yy805:
+ YYDEBUG(805, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'N'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'O') goto yy752;
- if(yych == 'o') goto yy752;
- goto yy698;
+ if(yych <= 'O') goto yy717;
+ if(yych == 'o') goto yy717;
+ goto yy663;
}
}
-yy841:
- YYDEBUG(841, *YYCURSOR);
+yy806:
+ YYDEBUG(806, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'P') goto yy842;
+ if(yych == 'P') goto yy807;
if(yych != 'p') goto yy53;
- goto yy842;
-yy842:
- YYDEBUG(842, *YYCURSOR);
- yyaccept = 10;
+ goto yy807;
+yy807:
+ YYDEBUG(807, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'S'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'T') goto yy843;
- if(yych != 't') goto yy698;
- goto yy843;
+ if(yych <= 'T') goto yy808;
+ if(yych != 't') goto yy663;
+ goto yy808;
}
}
-yy843:
- YYDEBUG(843, *YYCURSOR);
- yyaccept = 10;
+yy808:
+ YYDEBUG(808, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy794;
- if(yych == 'e') goto yy794;
- goto yy698;
+ if(yych <= 'E') goto yy759;
+ if(yych == 'e') goto yy759;
+ goto yy663;
}
}
-yy844:
- YYDEBUG(844, *YYCURSOR);
+yy809:
+ YYDEBUG(809, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy847;
- if(yych == 'g') goto yy847;
+ if(yych == 'G') goto yy812;
+ if(yych == 'g') goto yy812;
goto yy53;
-yy845:
- YYDEBUG(845, *YYCURSOR);
+yy810:
+ YYDEBUG(810, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy846;
+ if(yych == 'R') goto yy811;
if(yych != 'r') goto yy53;
- goto yy846;
-yy846:
- YYDEBUG(846, *YYCURSOR);
- yyaccept = 10;
+ goto yy811;
+yy811:
+ YYDEBUG(811, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'H'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'I') goto yy758;
- if(yych == 'i') goto yy758;
- goto yy698;
+ if(yych <= 'I') goto yy723;
+ if(yych == 'i') goto yy723;
+ goto yy663;
}
}
-yy847:
- YYDEBUG(847, *YYCURSOR);
- yyaccept = 10;
+yy812:
+ YYDEBUG(812, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'T'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'U') goto yy760;
- if(yych == 'u') goto yy760;
- goto yy698;
+ if(yych <= 'U') goto yy725;
+ if(yych == 'u') goto yy725;
+ goto yy663;
}
}
-yy848:
- YYDEBUG(848, *YYCURSOR);
+yy813:
+ YYDEBUG(813, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
- if(yych == 'R') goto yy849;
+ if(yych == 'R') goto yy814;
if(yych <= 'X') goto yy53;
- goto yy850;
+ goto yy815;
} else {
if(yych <= 'r'){
if(yych <= 'q') goto yy53;
- goto yy849;
+ goto yy814;
} else {
- if(yych == 'y') goto yy850;
+ if(yych == 'y') goto yy815;
goto yy53;
}
}
-yy849:
- YYDEBUG(849, *YYCURSOR);
- yyaccept = 10;
+yy814:
+ YYDEBUG(814, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'B'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'C') goto yy800;
- if(yych == 'c') goto yy800;
- goto yy698;
+ if(yych <= 'C') goto yy765;
+ if(yych == 'c') goto yy765;
+ goto yy663;
}
}
-yy850:
- YYDEBUG(850, *YYCURSOR);
- yyaccept = 10;
+yy815:
+ YYDEBUG(815, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= ','){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy698;
- goto yy738;
+ if(yych <= 0x08) goto yy663;
+ goto yy703;
} else {
- if(yych == ' ') goto yy738;
- goto yy698;
+ if(yych == ' ') goto yy703;
+ goto yy663;
}
} else {
if(yych <= '.'){
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= '-') goto yy797;
+ goto yy703;
} else {
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
}
}
-yy851:
- YYDEBUG(851, *YYCURSOR);
+yy816:
+ YYDEBUG(816, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy852;
+ if(yych == 'B') goto yy817;
if(yych != 'b') goto yy53;
- goto yy852;
-yy852:
- YYDEBUG(852, *YYCURSOR);
- yyaccept = 10;
+ goto yy817;
+yy817:
+ YYDEBUG(817, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'Q'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'R') goto yy803;
- if(yych == 'r') goto yy803;
- goto yy698;
+ if(yych <= 'R') goto yy768;
+ if(yych == 'r') goto yy768;
+ goto yy663;
}
}
-yy853:
- YYDEBUG(853, *YYCURSOR);
+yy818:
+ YYDEBUG(818, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
- if(yych == 'L') goto yy857;
+ if(yych == 'L') goto yy822;
if(yych <= 'M') goto yy53;
- goto yy856;
+ goto yy821;
} else {
if(yych <= 'l'){
if(yych <= 'k') goto yy53;
- goto yy857;
+ goto yy822;
} else {
- if(yych == 'n') goto yy856;
+ if(yych == 'n') goto yy821;
goto yy53;
}
}
-yy854:
- YYDEBUG(854, *YYCURSOR);
+yy819:
+ YYDEBUG(819, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy855;
+ if(yych == 'N') goto yy820;
if(yych != 'n') goto yy53;
- goto yy855;
-yy855:
- YYDEBUG(855, *YYCURSOR);
- yyaccept = 10;
+ goto yy820;
+yy820:
+ YYDEBUG(820, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'T'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'U') goto yy765;
- if(yych == 'u') goto yy765;
- goto yy698;
+ if(yych <= 'U') goto yy730;
+ if(yych == 'u') goto yy730;
+ goto yy663;
}
}
-yy856:
- YYDEBUG(856, *YYCURSOR);
- yyaccept = 10;
+yy821:
+ YYDEBUG(821, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'D'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'E') goto yy746;
- if(yych == 'e') goto yy746;
- goto yy698;
+ if(yych <= 'E') goto yy711;
+ if(yych == 'e') goto yy711;
+ goto yy663;
}
}
-yy857:
- YYDEBUG(857, *YYCURSOR);
- yyaccept = 10;
+yy822:
+ YYDEBUG(822, *YYCURSOR);
+ yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= 0x1F){
- if(yych == 0x09) goto yy738;
- goto yy698;
+ if(yych == 0x09) goto yy703;
+ goto yy663;
} else {
- if(yych <= ' ') goto yy738;
- if(yych <= ',') goto yy698;
- if(yych <= '-') goto yy832;
- goto yy738;
+ if(yych <= ' ') goto yy703;
+ if(yych <= ',') goto yy663;
+ if(yych <= '-') goto yy797;
+ goto yy703;
}
} else {
if(yych <= 'X'){
- if(yych <= '/') goto yy698;
- if(yych <= '9') goto yy740;
- goto yy698;
+ if(yych <= '/') goto yy663;
+ if(yych <= '9') goto yy705;
+ goto yy663;
} else {
- if(yych <= 'Y') goto yy746;
- if(yych == 'y') goto yy746;
- goto yy698;
+ if(yych <= 'Y') goto yy711;
+ if(yych == 'y') goto yy711;
+ goto yy663;
}
}
-yy858:
- YYDEBUG(858, *YYCURSOR);
+yy823:
+ YYDEBUG(823, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '2') goto yy859;
- if(yych <= '3') goto yy861;
- if(yych <= '9') goto yy862;
+ if(yych <= '2') goto yy824;
+ if(yych <= '3') goto yy826;
+ if(yych <= '9') goto yy827;
goto yy53;
-yy859:
- YYDEBUG(859, *YYCURSOR);
- yyaccept = 12;
+yy824:
+ YYDEBUG(824, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy860;
- if(yych <= '9') goto yy868;
- if(yych >= 'n') goto yy864;
- goto yy860;
+ if(yych <= '/') goto yy825;
+ if(yych <= '9') goto yy833;
+ if(yych >= 'n') goto yy829;
+ goto yy825;
} else {
if(yych <= 'r'){
- if(yych >= 'r') goto yy865;
- goto yy860;
+ if(yych >= 'r') goto yy830;
+ goto yy825;
} else {
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
}
-yy860:
- YYDEBUG(860, *YYCURSOR);
+yy825:
+ YYDEBUG(825, *YYCURSOR);
-#line 1085 "ext/date/lib/parse_date.re"
+#line 1111 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnudateshort");
TIMELIB_INIT;
@@ -14985,119 +14485,119 @@ yy860:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
-#line 13252 "ext/date/lib/parse_date.c"
-yy861:
- YYDEBUG(861, *YYCURSOR);
- yyaccept = 12;
+#line 12827 "ext/date/lib/parse_date.c"
+yy826:
+ YYDEBUG(826, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
if(yych <= '1'){
- if(yych <= '/') goto yy860;
- goto yy868;
+ if(yych <= '/') goto yy825;
+ goto yy833;
} else {
- if(yych <= '9') goto yy812;
- if(yych <= 'm') goto yy860;
- goto yy864;
+ if(yych <= '9') goto yy777;
+ if(yych <= 'm') goto yy825;
+ goto yy829;
}
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy860;
- goto yy865;
+ if(yych <= 'q') goto yy825;
+ goto yy830;
} else {
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
}
-yy862:
- YYDEBUG(862, *YYCURSOR);
- yyaccept = 12;
+yy827:
+ YYDEBUG(827, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy860;
- if(yych <= '9') goto yy812;
- if(yych <= 'm') goto yy860;
- goto yy864;
+ if(yych <= '/') goto yy825;
+ if(yych <= '9') goto yy777;
+ if(yych <= 'm') goto yy825;
+ goto yy829;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy860;
- goto yy865;
+ if(yych <= 'q') goto yy825;
+ goto yy830;
} else {
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
}
-yy863:
- YYDEBUG(863, *YYCURSOR);
+yy828:
+ YYDEBUG(828, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 't') goto yy867;
+ if(yych == 't') goto yy832;
goto yy53;
-yy864:
- YYDEBUG(864, *YYCURSOR);
+yy829:
+ YYDEBUG(829, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy867;
+ if(yych == 'd') goto yy832;
goto yy53;
-yy865:
- YYDEBUG(865, *YYCURSOR);
+yy830:
+ YYDEBUG(830, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy867;
+ if(yych == 'd') goto yy832;
goto yy53;
-yy866:
- YYDEBUG(866, *YYCURSOR);
+yy831:
+ YYDEBUG(831, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != 'h') goto yy53;
- goto yy867;
-yy867:
- YYDEBUG(867, *YYCURSOR);
+ goto yy832;
+yy832:
+ YYDEBUG(832, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy860;
-yy868:
- YYDEBUG(868, *YYCURSOR);
- yyaccept = 12;
+ goto yy825;
+yy833:
+ YYDEBUG(833, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy860;
- if(yych <= '9') goto yy814;
- if(yych <= 'm') goto yy860;
- goto yy864;
+ if(yych <= '/') goto yy825;
+ if(yych <= '9') goto yy779;
+ if(yych <= 'm') goto yy825;
+ goto yy829;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy860;
- goto yy865;
+ if(yych <= 'q') goto yy825;
+ goto yy830;
} else {
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
}
-yy869:
- YYDEBUG(869, *YYCURSOR);
- yyaccept = 13;
+yy834:
+ YYDEBUG(834, *YYCURSOR);
+ yyaccept = 14;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
if(yych <= '/'){
- if(yych >= '/') goto yy923;
- goto yy870;
+ if(yych >= '/') goto yy888;
+ goto yy835;
} else {
- if(yych <= '9') goto yy872;
- if(yych >= 'n') goto yy920;
- goto yy870;
+ if(yych <= '9') goto yy837;
+ if(yych >= 'n') goto yy885;
+ goto yy835;
}
} else {
if(yych <= 'r'){
- if(yych >= 'r') goto yy921;
- goto yy870;
+ if(yych >= 'r') goto yy886;
+ goto yy835;
} else {
- if(yych <= 's') goto yy919;
- if(yych <= 't') goto yy922;
- goto yy870;
+ if(yych <= 's') goto yy884;
+ if(yych <= 't') goto yy887;
+ goto yy835;
}
}
-yy870:
- YYDEBUG(870, *YYCURSOR);
+yy835:
+ YYDEBUG(835, *YYCURSOR);
-#line 1058 "ext/date/lib/parse_date.re"
+#line 1072 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("americanshort | american");
TIMELIB_INIT;
@@ -15111,261 +14611,261 @@ yy870:
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
}
-#line 13358 "ext/date/lib/parse_date.c"
-yy871:
- YYDEBUG(871, *YYCURSOR);
- yyaccept = 13;
+#line 12933 "ext/date/lib/parse_date.c"
+yy836:
+ YYDEBUG(836, *YYCURSOR);
+ yyaccept = 14;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
if(yych <= '/'){
- if(yych <= '.') goto yy870;
- goto yy923;
+ if(yych <= '.') goto yy835;
+ goto yy888;
} else {
- if(yych <= '1') goto yy872;
- if(yych <= 'm') goto yy870;
- goto yy920;
+ if(yych <= '1') goto yy837;
+ if(yych <= 'm') goto yy835;
+ goto yy885;
}
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy870;
- goto yy921;
+ if(yych <= 'q') goto yy835;
+ goto yy886;
} else {
- if(yych <= 's') goto yy919;
- if(yych <= 't') goto yy922;
- goto yy870;
+ if(yych <= 's') goto yy884;
+ if(yych <= 't') goto yy887;
+ goto yy835;
}
}
-yy872:
- YYDEBUG(872, *YYCURSOR);
- yyaccept = 13;
+yy837:
+ YYDEBUG(837, *YYCURSOR);
+ yyaccept = 14;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych == '/') goto yy923;
- if(yych <= 'm') goto yy870;
- goto yy920;
+ if(yych == '/') goto yy888;
+ if(yych <= 'm') goto yy835;
+ goto yy885;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy870;
- goto yy921;
+ if(yych <= 'q') goto yy835;
+ goto yy886;
} else {
- if(yych <= 's') goto yy919;
- if(yych <= 't') goto yy922;
- goto yy870;
+ if(yych <= 's') goto yy884;
+ if(yych <= 't') goto yy887;
+ goto yy835;
}
}
-yy873:
- YYDEBUG(873, *YYCURSOR);
+yy838:
+ YYDEBUG(838, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'A') goto yy918;
+ if(yych == 'A') goto yy883;
if(yych <= 'T') goto yy53;
- goto yy917;
+ goto yy882;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy918;
+ goto yy883;
} else {
- if(yych == 'u') goto yy917;
+ if(yych == 'u') goto yy882;
goto yy53;
}
}
-yy874:
- YYDEBUG(874, *YYCURSOR);
+yy839:
+ YYDEBUG(839, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy916;
- if(yych == 'e') goto yy916;
+ if(yych == 'E') goto yy881;
+ if(yych == 'e') goto yy881;
goto yy53;
-yy875:
- YYDEBUG(875, *YYCURSOR);
+yy840:
+ YYDEBUG(840, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy915;
- if(yych == 'a') goto yy915;
+ if(yych == 'A') goto yy880;
+ if(yych == 'a') goto yy880;
goto yy53;
-yy876:
- YYDEBUG(876, *YYCURSOR);
+yy841:
+ YYDEBUG(841, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'P') goto yy914;
+ if(yych == 'P') goto yy879;
if(yych <= 'T') goto yy53;
- goto yy913;
+ goto yy878;
} else {
if(yych <= 'p'){
if(yych <= 'o') goto yy53;
- goto yy914;
+ goto yy879;
} else {
- if(yych == 'u') goto yy913;
+ if(yych == 'u') goto yy878;
goto yy53;
}
}
-yy877:
- YYDEBUG(877, *YYCURSOR);
+yy842:
+ YYDEBUG(842, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy911;
- if(yych == 'e') goto yy911;
+ if(yych == 'E') goto yy876;
+ if(yych == 'e') goto yy876;
goto yy53;
-yy878:
- YYDEBUG(878, *YYCURSOR);
+yy843:
+ YYDEBUG(843, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy910;
- if(yych == 'c') goto yy910;
+ if(yych == 'C') goto yy875;
+ if(yych == 'c') goto yy875;
goto yy53;
-yy879:
- YYDEBUG(879, *YYCURSOR);
+yy844:
+ YYDEBUG(844, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy909;
- if(yych == 'o') goto yy909;
+ if(yych == 'O') goto yy874;
+ if(yych == 'o') goto yy874;
goto yy53;
-yy880:
- YYDEBUG(880, *YYCURSOR);
+yy845:
+ YYDEBUG(845, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy881;
+ if(yych == 'E') goto yy846;
if(yych != 'e') goto yy53;
- goto yy881;
-yy881:
- YYDEBUG(881, *YYCURSOR);
+ goto yy846;
+yy846:
+ YYDEBUG(846, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy882;
+ if(yych == 'C') goto yy847;
if(yych != 'c') goto yy53;
- goto yy882;
-yy882:
- YYDEBUG(882, *YYCURSOR);
+ goto yy847;
+yy847:
+ YYDEBUG(847, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '/') goto yy53;
- goto yy883;
-yy883:
- YYDEBUG(883, *YYCURSOR);
+ goto yy848;
+yy848:
+ YYDEBUG(848, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy884;
-yy884:
- YYDEBUG(884, *YYCURSOR);
+ goto yy849;
+yy849:
+ YYDEBUG(849, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy885;
-yy885:
- YYDEBUG(885, *YYCURSOR);
+ goto yy850;
+yy850:
+ YYDEBUG(850, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy886;
-yy886:
- YYDEBUG(886, *YYCURSOR);
+ goto yy851;
+yy851:
+ YYDEBUG(851, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy887;
-yy887:
- YYDEBUG(887, *YYCURSOR);
+ goto yy852;
+yy852:
+ YYDEBUG(852, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy888;
-yy888:
- YYDEBUG(888, *YYCURSOR);
+ goto yy853;
+yy853:
+ YYDEBUG(853, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy889;
- if(yych <= '2') goto yy890;
+ if(yych <= '1') goto yy854;
+ if(yych <= '2') goto yy855;
goto yy53;
-yy889:
- YYDEBUG(889, *YYCURSOR);
+yy854:
+ YYDEBUG(854, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy891;
+ if(yych <= '9') goto yy856;
goto yy53;
-yy890:
- YYDEBUG(890, *YYCURSOR);
+yy855:
+ YYDEBUG(855, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '4') goto yy53;
- goto yy891;
-yy891:
- YYDEBUG(891, *YYCURSOR);
+ goto yy856;
+yy856:
+ YYDEBUG(856, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy892;
-yy892:
- YYDEBUG(892, *YYCURSOR);
+ goto yy857;
+yy857:
+ YYDEBUG(857, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '6') goto yy53;
- goto yy893;
-yy893:
- YYDEBUG(893, *YYCURSOR);
+ goto yy858;
+yy858:
+ YYDEBUG(858, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy894;
-yy894:
- YYDEBUG(894, *YYCURSOR);
+ goto yy859;
+yy859:
+ YYDEBUG(859, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy895;
-yy895:
- YYDEBUG(895, *YYCURSOR);
+ goto yy860;
+yy860:
+ YYDEBUG(860, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy896;
- if(yych <= '6') goto yy897;
+ if(yych <= '5') goto yy861;
+ if(yych <= '6') goto yy862;
goto yy53;
-yy896:
- YYDEBUG(896, *YYCURSOR);
+yy861:
+ YYDEBUG(861, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy898;
+ if(yych <= '9') goto yy863;
goto yy53;
-yy897:
- YYDEBUG(897, *YYCURSOR);
+yy862:
+ YYDEBUG(862, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '0') goto yy53;
- goto yy898;
-yy898:
- YYDEBUG(898, *YYCURSOR);
+ goto yy863;
+yy863:
+ YYDEBUG(863, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 0x09) goto yy899;
+ if(yych == 0x09) goto yy864;
if(yych != ' ') goto yy53;
- goto yy899;
-yy899:
- YYDEBUG(899, *YYCURSOR);
+ goto yy864;
+yy864:
+ YYDEBUG(864, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
yych = *YYCURSOR;
- goto yy900;
-yy900:
- YYDEBUG(900, *YYCURSOR);
+ goto yy865;
+yy865:
+ YYDEBUG(865, *YYCURSOR);
if(yych <= ' '){
- if(yych == 0x09) goto yy899;
+ if(yych == 0x09) goto yy864;
if(yych <= 0x1F) goto yy53;
- goto yy899;
+ goto yy864;
} else {
if(yych <= '+'){
if(yych <= '*') goto yy53;
- goto yy901;
+ goto yy866;
} else {
if(yych != '-') goto yy53;
- goto yy901;
+ goto yy866;
}
}
-yy901:
- YYDEBUG(901, *YYCURSOR);
+yy866:
+ YYDEBUG(866, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy902;
- if(yych <= '2') goto yy904;
- if(yych <= '9') goto yy905;
+ if(yych <= '1') goto yy867;
+ if(yych <= '2') goto yy869;
+ if(yych <= '9') goto yy870;
goto yy53;
-yy902:
- YYDEBUG(902, *YYCURSOR);
+yy867:
+ YYDEBUG(867, *YYCURSOR);
++YYCURSOR;
- if((yych = *YYCURSOR) <= '/') goto yy903;
- if(yych <= '9') goto yy905;
- if(yych <= ':') goto yy906;
- goto yy903;
-yy903:
- YYDEBUG(903, *YYCURSOR);
+ if((yych = *YYCURSOR) <= '/') goto yy868;
+ if(yych <= '9') goto yy870;
+ if(yych <= ':') goto yy871;
+ goto yy868;
+yy868:
+ YYDEBUG(868, *YYCURSOR);
-#line 1291 "ext/date/lib/parse_date.re"
+#line 1317 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@@ -15385,253 +14885,253 @@ yy903:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
-#line 13566 "ext/date/lib/parse_date.c"
-yy904:
- YYDEBUG(904, *YYCURSOR);
+#line 13141 "ext/date/lib/parse_date.c"
+yy869:
+ YYDEBUG(869, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '5'){
- if(yych <= '/') goto yy903;
- if(yych >= '4') goto yy907;
- goto yy905;
+ if(yych <= '/') goto yy868;
+ if(yych >= '4') goto yy872;
+ goto yy870;
} else {
- if(yych <= '9') goto yy908;
- if(yych <= ':') goto yy906;
- goto yy903;
+ if(yych <= '9') goto yy873;
+ if(yych <= ':') goto yy871;
+ goto yy868;
}
-yy905:
- YYDEBUG(905, *YYCURSOR);
+yy870:
+ YYDEBUG(870, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy903;
- if(yych <= '5') goto yy907;
- if(yych <= '9') goto yy908;
- if(yych >= ';') goto yy903;
- goto yy906;
-yy906:
- YYDEBUG(906, *YYCURSOR);
+ if(yych <= '/') goto yy868;
+ if(yych <= '5') goto yy872;
+ if(yych <= '9') goto yy873;
+ if(yych >= ';') goto yy868;
+ goto yy871;
+yy871:
+ YYDEBUG(871, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy903;
- if(yych <= '5') goto yy907;
- if(yych <= '9') goto yy908;
- goto yy903;
-yy907:
- YYDEBUG(907, *YYCURSOR);
+ if(yych <= '/') goto yy868;
+ if(yych <= '5') goto yy872;
+ if(yych <= '9') goto yy873;
+ goto yy868;
+yy872:
+ YYDEBUG(872, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy903;
- if(yych >= ':') goto yy903;
- goto yy908;
-yy908:
- YYDEBUG(908, *YYCURSOR);
+ if(yych <= '/') goto yy868;
+ if(yych >= ':') goto yy868;
+ goto yy873;
+yy873:
+ YYDEBUG(873, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy903;
-yy909:
- YYDEBUG(909, *YYCURSOR);
+ goto yy868;
+yy874:
+ YYDEBUG(874, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'V') goto yy882;
- if(yych == 'v') goto yy882;
+ if(yych == 'V') goto yy847;
+ if(yych == 'v') goto yy847;
goto yy53;
-yy910:
- YYDEBUG(910, *YYCURSOR);
+yy875:
+ YYDEBUG(875, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy882;
- if(yych == 't') goto yy882;
+ if(yych == 'T') goto yy847;
+ if(yych == 't') goto yy847;
goto yy53;
-yy911:
- YYDEBUG(911, *YYCURSOR);
+yy876:
+ YYDEBUG(876, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'P') goto yy912;
+ if(yych == 'P') goto yy877;
if(yych != 'p') goto yy53;
- goto yy912;
-yy912:
- YYDEBUG(912, *YYCURSOR);
+ goto yy877;
+yy877:
+ YYDEBUG(877, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
- if(yych == '/') goto yy883;
+ if(yych == '/') goto yy848;
goto yy53;
} else {
- if(yych <= 'T') goto yy882;
- if(yych == 't') goto yy882;
+ if(yych <= 'T') goto yy847;
+ if(yych == 't') goto yy847;
goto yy53;
}
-yy913:
- YYDEBUG(913, *YYCURSOR);
+yy878:
+ YYDEBUG(878, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy882;
- if(yych == 'g') goto yy882;
+ if(yych == 'G') goto yy847;
+ if(yych == 'g') goto yy847;
goto yy53;
-yy914:
- YYDEBUG(914, *YYCURSOR);
+yy879:
+ YYDEBUG(879, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy882;
- if(yych == 'r') goto yy882;
+ if(yych == 'R') goto yy847;
+ if(yych == 'r') goto yy847;
goto yy53;
-yy915:
- YYDEBUG(915, *YYCURSOR);
+yy880:
+ YYDEBUG(880, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
- if(yych == 'R') goto yy882;
+ if(yych == 'R') goto yy847;
if(yych <= 'X') goto yy53;
- goto yy882;
+ goto yy847;
} else {
if(yych <= 'r'){
if(yych <= 'q') goto yy53;
- goto yy882;
+ goto yy847;
} else {
- if(yych == 'y') goto yy882;
+ if(yych == 'y') goto yy847;
goto yy53;
}
}
-yy916:
- YYDEBUG(916, *YYCURSOR);
+yy881:
+ YYDEBUG(881, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy882;
- if(yych == 'b') goto yy882;
+ if(yych == 'B') goto yy847;
+ if(yych == 'b') goto yy847;
goto yy53;
-yy917:
- YYDEBUG(917, *YYCURSOR);
+yy882:
+ YYDEBUG(882, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
- if(yych == 'L') goto yy882;
+ if(yych == 'L') goto yy847;
if(yych <= 'M') goto yy53;
- goto yy882;
+ goto yy847;
} else {
if(yych <= 'l'){
if(yych <= 'k') goto yy53;
- goto yy882;
+ goto yy847;
} else {
- if(yych == 'n') goto yy882;
+ if(yych == 'n') goto yy847;
goto yy53;
}
}
-yy918:
- YYDEBUG(918, *YYCURSOR);
+yy883:
+ YYDEBUG(883, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy882;
- if(yych == 'n') goto yy882;
+ if(yych == 'N') goto yy847;
+ if(yych == 'n') goto yy847;
goto yy53;
-yy919:
- YYDEBUG(919, *YYCURSOR);
+yy884:
+ YYDEBUG(884, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 't') goto yy928;
+ if(yych == 't') goto yy893;
goto yy53;
-yy920:
- YYDEBUG(920, *YYCURSOR);
+yy885:
+ YYDEBUG(885, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy928;
+ if(yych == 'd') goto yy893;
goto yy53;
-yy921:
- YYDEBUG(921, *YYCURSOR);
+yy886:
+ YYDEBUG(886, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy928;
+ if(yych == 'd') goto yy893;
goto yy53;
-yy922:
- YYDEBUG(922, *YYCURSOR);
+yy887:
+ YYDEBUG(887, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'h') goto yy928;
+ if(yych == 'h') goto yy893;
goto yy53;
-yy923:
- YYDEBUG(923, *YYCURSOR);
+yy888:
+ YYDEBUG(888, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy924;
-yy924:
- YYDEBUG(924, *YYCURSOR);
+ goto yy889;
+yy889:
+ YYDEBUG(889, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy870;
- if(yych >= ':') goto yy870;
- goto yy925;
-yy925:
- YYDEBUG(925, *YYCURSOR);
+ if(yych <= '/') goto yy835;
+ if(yych >= ':') goto yy835;
+ goto yy890;
+yy890:
+ YYDEBUG(890, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy870;
- if(yych >= ':') goto yy870;
- goto yy926;
-yy926:
- YYDEBUG(926, *YYCURSOR);
+ if(yych <= '/') goto yy835;
+ if(yych >= ':') goto yy835;
+ goto yy891;
+yy891:
+ YYDEBUG(891, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy870;
- if(yych >= ':') goto yy870;
- goto yy927;
-yy927:
- YYDEBUG(927, *YYCURSOR);
+ if(yych <= '/') goto yy835;
+ if(yych >= ':') goto yy835;
+ goto yy892;
+yy892:
+ YYDEBUG(892, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy870;
-yy928:
- YYDEBUG(928, *YYCURSOR);
- yyaccept = 13;
+ goto yy835;
+yy893:
+ YYDEBUG(893, *YYCURSOR);
+ yyaccept = 14;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '/') goto yy923;
- goto yy870;
-yy929:
- YYDEBUG(929, *YYCURSOR);
+ if(yych == '/') goto yy888;
+ goto yy835;
+yy894:
+ YYDEBUG(894, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= ','){
- if(yych == 0x09) goto yy931;
- goto yy784;
+ if(yych == 0x09) goto yy896;
+ goto yy749;
} else {
- if(yych <= '.') goto yy931;
- if(yych >= '0') goto yy784;
- goto yy930;
+ if(yych <= '.') goto yy896;
+ if(yych >= '0') goto yy749;
+ goto yy895;
}
-yy930:
- YYDEBUG(930, *YYCURSOR);
+yy895:
+ YYDEBUG(895, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(-1, yych);
switch(yych){
- case 'A': case 'a': goto yy876;
- case 'D': case 'd': goto yy880;
- case 'F': case 'f': goto yy874;
- case 'J': case 'j': goto yy873;
- case 'M': case 'm': goto yy875;
- case 'N': case 'n': goto yy879;
- case 'O': case 'o': goto yy878;
- case 'S': case 's': goto yy877;
+ case 'A': case 'a': goto yy841;
+ case 'D': case 'd': goto yy845;
+ case 'F': case 'f': goto yy839;
+ case 'J': case 'j': goto yy838;
+ case 'M': case 'm': goto yy840;
+ case 'N': case 'n': goto yy844;
+ case 'O': case 'o': goto yy843;
+ case 'S': case 's': goto yy842;
default: goto yy53;
}
-yy931:
- YYDEBUG(931, *YYCURSOR);
+yy896:
+ YYDEBUG(896, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy784;
- if(yych <= '0') goto yy932;
- if(yych <= '1') goto yy933;
- if(yych <= '9') goto yy934;
- goto yy784;
-yy932:
- YYDEBUG(932, *YYCURSOR);
+ if(yych <= '/') goto yy749;
+ if(yych <= '0') goto yy897;
+ if(yych <= '1') goto yy898;
+ if(yych <= '9') goto yy899;
+ goto yy749;
+yy897:
+ YYDEBUG(897, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= ',') goto yy53;
- if(yych <= '.') goto yy807;
+ if(yych <= '.') goto yy772;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy934;
+ if(yych <= '9') goto yy899;
goto yy53;
-yy933:
- YYDEBUG(933, *YYCURSOR);
+yy898:
+ YYDEBUG(898, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= ',') goto yy53;
- if(yych <= '.') goto yy807;
+ if(yych <= '.') goto yy772;
if(yych <= '/') goto yy53;
if(yych >= '3') goto yy53;
- goto yy934;
-yy934:
- YYDEBUG(934, *YYCURSOR);
+ goto yy899;
+yy899:
+ YYDEBUG(899, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= ',') goto yy53;
- if(yych <= '.') goto yy807;
+ if(yych <= '.') goto yy772;
goto yy53;
-yy935:
- YYDEBUG(935, *YYCURSOR);
+yy900:
+ YYDEBUG(900, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '-') goto yy936;
+ if(yych == '-') goto yy901;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy970;
+ if(yych <= '9') goto yy935;
goto yy57;
-yy936:
- YYDEBUG(936, *YYCURSOR);
+yy901:
+ YYDEBUG(901, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(-1, yych);
switch(yych){
- case '0': goto yy945;
- case '1': goto yy946;
+ case '0': goto yy910;
+ case '1': goto yy911;
case '2':
case '3':
case '4':
@@ -15639,208 +15139,208 @@ yy936:
case '6':
case '7':
case '8':
- case '9': goto yy947;
- case 'A': case 'a': goto yy940;
- case 'D': case 'd': goto yy944;
- case 'F': case 'f': goto yy938;
- case 'J': case 'j': goto yy937;
- case 'M': case 'm': goto yy939;
- case 'N': case 'n': goto yy943;
- case 'O': case 'o': goto yy942;
- case 'S': case 's': goto yy941;
+ case '9': goto yy912;
+ case 'A': case 'a': goto yy905;
+ case 'D': case 'd': goto yy909;
+ case 'F': case 'f': goto yy903;
+ case 'J': case 'j': goto yy902;
+ case 'M': case 'm': goto yy904;
+ case 'N': case 'n': goto yy908;
+ case 'O': case 'o': goto yy907;
+ case 'S': case 's': goto yy906;
default: goto yy53;
}
-yy937:
- YYDEBUG(937, *YYCURSOR);
+yy902:
+ YYDEBUG(902, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'A') goto yy969;
+ if(yych == 'A') goto yy934;
if(yych <= 'T') goto yy53;
- goto yy968;
+ goto yy933;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy969;
+ goto yy934;
} else {
- if(yych == 'u') goto yy968;
+ if(yych == 'u') goto yy933;
goto yy53;
}
}
-yy938:
- YYDEBUG(938, *YYCURSOR);
+yy903:
+ YYDEBUG(903, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy967;
- if(yych == 'e') goto yy967;
+ if(yych == 'E') goto yy932;
+ if(yych == 'e') goto yy932;
goto yy53;
-yy939:
- YYDEBUG(939, *YYCURSOR);
+yy904:
+ YYDEBUG(904, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy966;
- if(yych == 'a') goto yy966;
+ if(yych == 'A') goto yy931;
+ if(yych == 'a') goto yy931;
goto yy53;
-yy940:
- YYDEBUG(940, *YYCURSOR);
+yy905:
+ YYDEBUG(905, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'P') goto yy965;
+ if(yych == 'P') goto yy930;
if(yych <= 'T') goto yy53;
- goto yy964;
+ goto yy929;
} else {
if(yych <= 'p'){
if(yych <= 'o') goto yy53;
- goto yy965;
+ goto yy930;
} else {
- if(yych == 'u') goto yy964;
+ if(yych == 'u') goto yy929;
goto yy53;
}
}
-yy941:
- YYDEBUG(941, *YYCURSOR);
+yy906:
+ YYDEBUG(906, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy962;
- if(yych == 'e') goto yy962;
+ if(yych == 'E') goto yy927;
+ if(yych == 'e') goto yy927;
goto yy53;
-yy942:
- YYDEBUG(942, *YYCURSOR);
+yy907:
+ YYDEBUG(907, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy961;
- if(yych == 'c') goto yy961;
+ if(yych == 'C') goto yy926;
+ if(yych == 'c') goto yy926;
goto yy53;
-yy943:
- YYDEBUG(943, *YYCURSOR);
+yy908:
+ YYDEBUG(908, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy960;
- if(yych == 'o') goto yy960;
+ if(yych == 'O') goto yy925;
+ if(yych == 'o') goto yy925;
goto yy53;
-yy944:
- YYDEBUG(944, *YYCURSOR);
+yy909:
+ YYDEBUG(909, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy952;
- if(yych == 'e') goto yy952;
+ if(yych == 'E') goto yy917;
+ if(yych == 'e') goto yy917;
goto yy53;
-yy945:
- YYDEBUG(945, *YYCURSOR);
+yy910:
+ YYDEBUG(910, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '-') goto yy948;
+ if(yych == '-') goto yy913;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy947;
+ if(yych <= '9') goto yy912;
goto yy53;
-yy946:
- YYDEBUG(946, *YYCURSOR);
+yy911:
+ YYDEBUG(911, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '-') goto yy948;
+ if(yych == '-') goto yy913;
if(yych <= '/') goto yy53;
if(yych >= '3') goto yy53;
- goto yy947;
-yy947:
- YYDEBUG(947, *YYCURSOR);
+ goto yy912;
+yy912:
+ YYDEBUG(912, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '-') goto yy53;
- goto yy948;
-yy948:
- YYDEBUG(948, *YYCURSOR);
+ goto yy913;
+yy913:
+ YYDEBUG(913, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '2') goto yy949;
- if(yych <= '3') goto yy950;
- if(yych <= '9') goto yy951;
+ if(yych <= '2') goto yy914;
+ if(yych <= '3') goto yy915;
+ if(yych <= '9') goto yy916;
goto yy53;
-yy949:
- YYDEBUG(949, *YYCURSOR);
- yyaccept = 12;
+yy914:
+ YYDEBUG(914, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy860;
- if(yych <= '9') goto yy951;
- if(yych <= 'm') goto yy860;
- goto yy864;
+ if(yych <= '/') goto yy825;
+ if(yych <= '9') goto yy916;
+ if(yych <= 'm') goto yy825;
+ goto yy829;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy860;
- goto yy865;
+ if(yych <= 'q') goto yy825;
+ goto yy830;
} else {
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
}
-yy950:
- YYDEBUG(950, *YYCURSOR);
- yyaccept = 12;
+yy915:
+ YYDEBUG(915, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy860;
- if(yych <= '1') goto yy951;
- if(yych <= 'm') goto yy860;
- goto yy864;
+ if(yych <= '/') goto yy825;
+ if(yych <= '1') goto yy916;
+ if(yych <= 'm') goto yy825;
+ goto yy829;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy860;
- goto yy865;
+ if(yych <= 'q') goto yy825;
+ goto yy830;
} else {
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
}
-yy951:
- YYDEBUG(951, *YYCURSOR);
- yyaccept = 12;
+yy916:
+ YYDEBUG(916, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'q'){
- if(yych == 'n') goto yy864;
- goto yy860;
+ if(yych == 'n') goto yy829;
+ goto yy825;
} else {
- if(yych <= 'r') goto yy865;
- if(yych <= 's') goto yy863;
- if(yych <= 't') goto yy866;
- goto yy860;
+ if(yych <= 'r') goto yy830;
+ if(yych <= 's') goto yy828;
+ if(yych <= 't') goto yy831;
+ goto yy825;
}
-yy952:
- YYDEBUG(952, *YYCURSOR);
+yy917:
+ YYDEBUG(917, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy953;
+ if(yych == 'C') goto yy918;
if(yych != 'c') goto yy53;
- goto yy953;
-yy953:
- YYDEBUG(953, *YYCURSOR);
+ goto yy918;
+yy918:
+ YYDEBUG(918, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '-') goto yy53;
- goto yy954;
-yy954:
- YYDEBUG(954, *YYCURSOR);
+ goto yy919;
+yy919:
+ YYDEBUG(919, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy955;
- if(yych <= '2') goto yy956;
- if(yych <= '3') goto yy957;
+ if(yych <= '0') goto yy920;
+ if(yych <= '2') goto yy921;
+ if(yych <= '3') goto yy922;
goto yy53;
-yy955:
- YYDEBUG(955, *YYCURSOR);
+yy920:
+ YYDEBUG(920, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '0') goto yy53;
- if(yych <= '9') goto yy958;
+ if(yych <= '9') goto yy923;
goto yy53;
-yy956:
- YYDEBUG(956, *YYCURSOR);
+yy921:
+ YYDEBUG(921, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy958;
+ if(yych <= '9') goto yy923;
goto yy53;
-yy957:
- YYDEBUG(957, *YYCURSOR);
+yy922:
+ YYDEBUG(922, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '2') goto yy53;
- goto yy958;
-yy958:
- YYDEBUG(958, *YYCURSOR);
+ goto yy923;
+yy923:
+ YYDEBUG(923, *YYCURSOR);
++YYCURSOR;
- goto yy959;
-yy959:
- YYDEBUG(959, *YYCURSOR);
+ goto yy924;
+yy924:
+ YYDEBUG(924, *YYCURSOR);
-#line 1278 "ext/date/lib/parse_date.re"
+#line 1304 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pgtextreverse");
TIMELIB_INIT;
@@ -15852,95 +15352,95 @@ yy959:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
-#line 13919 "ext/date/lib/parse_date.c"
-yy960:
- YYDEBUG(960, *YYCURSOR);
+#line 13494 "ext/date/lib/parse_date.c"
+yy925:
+ YYDEBUG(925, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'V') goto yy953;
- if(yych == 'v') goto yy953;
+ if(yych == 'V') goto yy918;
+ if(yych == 'v') goto yy918;
goto yy53;
-yy961:
- YYDEBUG(961, *YYCURSOR);
+yy926:
+ YYDEBUG(926, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy953;
- if(yych == 't') goto yy953;
+ if(yych == 'T') goto yy918;
+ if(yych == 't') goto yy918;
goto yy53;
-yy962:
- YYDEBUG(962, *YYCURSOR);
+yy927:
+ YYDEBUG(927, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'P') goto yy963;
+ if(yych == 'P') goto yy928;
if(yych != 'p') goto yy53;
- goto yy963;
-yy963:
- YYDEBUG(963, *YYCURSOR);
+ goto yy928;
+yy928:
+ YYDEBUG(928, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
- if(yych == '-') goto yy954;
+ if(yych == '-') goto yy919;
goto yy53;
} else {
- if(yych <= 'T') goto yy953;
- if(yych == 't') goto yy953;
+ if(yych <= 'T') goto yy918;
+ if(yych == 't') goto yy918;
goto yy53;
}
-yy964:
- YYDEBUG(964, *YYCURSOR);
+yy929:
+ YYDEBUG(929, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy953;
- if(yych == 'g') goto yy953;
+ if(yych == 'G') goto yy918;
+ if(yych == 'g') goto yy918;
goto yy53;
-yy965:
- YYDEBUG(965, *YYCURSOR);
+yy930:
+ YYDEBUG(930, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy953;
- if(yych == 'r') goto yy953;
+ if(yych == 'R') goto yy918;
+ if(yych == 'r') goto yy918;
goto yy53;
-yy966:
- YYDEBUG(966, *YYCURSOR);
+yy931:
+ YYDEBUG(931, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
- if(yych == 'R') goto yy953;
+ if(yych == 'R') goto yy918;
if(yych <= 'X') goto yy53;
- goto yy953;
+ goto yy918;
} else {
if(yych <= 'r'){
if(yych <= 'q') goto yy53;
- goto yy953;
+ goto yy918;
} else {
- if(yych == 'y') goto yy953;
+ if(yych == 'y') goto yy918;
goto yy53;
}
}
-yy967:
- YYDEBUG(967, *YYCURSOR);
+yy932:
+ YYDEBUG(932, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy953;
- if(yych == 'b') goto yy953;
+ if(yych == 'B') goto yy918;
+ if(yych == 'b') goto yy918;
goto yy53;
-yy968:
- YYDEBUG(968, *YYCURSOR);
+yy933:
+ YYDEBUG(933, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
- if(yych == 'L') goto yy953;
+ if(yych == 'L') goto yy918;
if(yych <= 'M') goto yy53;
- goto yy953;
+ goto yy918;
} else {
if(yych <= 'l'){
if(yych <= 'k') goto yy53;
- goto yy953;
+ goto yy918;
} else {
- if(yych == 'n') goto yy953;
+ if(yych == 'n') goto yy918;
goto yy53;
}
}
-yy969:
- YYDEBUG(969, *YYCURSOR);
+yy934:
+ YYDEBUG(934, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy953;
- if(yych == 'n') goto yy953;
+ if(yych == 'N') goto yy918;
+ if(yych == 'n') goto yy918;
goto yy53;
-yy970:
- YYDEBUG(970, *YYCURSOR);
- yyaccept = 14;
+yy935:
+ YYDEBUG(935, *YYCURSOR);
+ yyaccept = 15;
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
@@ -15953,28 +15453,28 @@ yy970:
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 yy975;
- case '-': goto yy972;
- case '.': goto yy976;
- case '/': goto yy973;
- case '0': goto yy989;
- case '1': goto yy990;
- case '2': goto yy992;
- case '3': goto yy993;
+ case 't': case 'w': case 'y': goto yy940;
+ case '-': goto yy937;
+ case '.': goto yy941;
+ case '/': goto yy938;
+ case '0': goto yy954;
+ case '1': goto yy955;
+ case '2': goto yy957;
+ case '3': goto yy958;
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy51;
- case ':': goto yy991;
- case 'W': goto yy994;
- default: goto yy971;
+ case ':': goto yy956;
+ case 'W': goto yy959;
+ default: goto yy936;
}
-yy971:
- YYDEBUG(971, *YYCURSOR);
+yy936:
+ YYDEBUG(936, *YYCURSOR);
-#line 1312 "ext/date/lib/parse_date.re"
+#line 1338 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@@ -15982,14 +15482,14 @@ yy971:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
-#line 14024 "ext/date/lib/parse_date.c"
-yy972:
- YYDEBUG(972, *YYCURSOR);
+#line 13599 "ext/date/lib/parse_date.c"
+yy937:
+ YYDEBUG(937, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(-1, yych);
switch(yych){
- case '0': goto yy1156;
- case '1': goto yy1157;
+ case '0': goto yy1123;
+ case '1': goto yy1125;
case '2':
case '3':
case '4':
@@ -15997,78 +15497,79 @@ yy972:
case '6':
case '7':
case '8':
- case '9': goto yy1158;
- case 'A': case 'a': goto yy1151;
- case 'D': case 'd': goto yy1155;
- case 'F': case 'f': goto yy1149;
- case 'J': case 'j': goto yy1148;
- case 'M': case 'm': goto yy1150;
- case 'N': case 'n': goto yy1154;
- case 'O': case 'o': goto yy1153;
- case 'S': case 's': goto yy1152;
- default: goto yy1121;
+ case '9': goto yy1126;
+ case 'A': case 'a': goto yy1117;
+ case 'D': case 'd': goto yy1121;
+ case 'F': case 'f': goto yy1115;
+ case 'J': case 'j': goto yy1114;
+ case 'M': case 'm': goto yy1116;
+ case 'N': case 'n': goto yy1120;
+ case 'O': case 'o': goto yy1119;
+ case 'S': case 's': goto yy1118;
+ case 'W': goto yy1122;
+ default: goto yy1087;
}
-yy973:
- YYDEBUG(973, *YYCURSOR);
+yy938:
+ YYDEBUG(938, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy1129;
- if(yych <= '1') goto yy1130;
- if(yych <= '9') goto yy1131;
+ if(yych <= '0') goto yy1095;
+ if(yych <= '1') goto yy1096;
+ if(yych <= '9') goto yy1097;
goto yy53;
-yy974:
- YYDEBUG(974, *YYCURSOR);
+yy939:
+ YYDEBUG(939, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
yych = *YYCURSOR;
- goto yy975;
-yy975:
- YYDEBUG(975, *YYCURSOR);
+ goto yy940;
+yy940:
+ YYDEBUG(940, *YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: case ' ': goto yy974;
+ case 0x09: case ' ': goto yy939;
case '-':
- case '.': goto yy1120;
- case 'A': case 'a': goto yy984;
- case 'D': case 'd': goto yy988;
- case 'F': case 'f': goto yy982;
+ case '.': goto yy1086;
+ case 'A': case 'a': goto yy949;
+ case 'D': case 'd': goto yy953;
+ case 'F': case 'f': goto yy947;
case 'H': case 'h': goto yy60;
- case 'I': goto yy977;
- case 'J': case 'j': goto yy981;
- case 'M': case 'm': goto yy983;
- case 'N': case 'n': goto yy987;
- case 'O': case 'o': goto yy986;
- case 'S': case 's': goto yy985;
+ case 'I': goto yy942;
+ case 'J': case 'j': goto yy946;
+ case 'M': case 'm': goto yy948;
+ case 'N': case 'n': goto yy952;
+ case 'O': case 'o': goto yy951;
+ case 'S': case 's': goto yy950;
case 'T': case 't': goto yy65;
- case 'V': goto yy979;
+ case 'V': goto yy944;
case 'W': case 'w': goto yy62;
- case 'X': goto yy980;
+ case 'X': goto yy945;
case 'Y': case 'y': goto yy64;
default: goto yy53;
}
-yy976:
- YYDEBUG(976, *YYCURSOR);
+yy941:
+ YYDEBUG(941, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1121;
- if(yych <= '0') goto yy1113;
- if(yych <= '2') goto yy1114;
- if(yych <= '3') goto yy1115;
- goto yy1121;
-yy977:
- YYDEBUG(977, *YYCURSOR);
+ if(yych <= '/') goto yy1087;
+ if(yych <= '0') goto yy1079;
+ if(yych <= '2') goto yy1080;
+ if(yych <= '3') goto yy1081;
+ goto yy1087;
+yy942:
+ YYDEBUG(942, *YYCURSOR);
++YYCURSOR;
if((yych = *YYCURSOR) <= 'U'){
- if(yych == 'I') goto yy1112;
- goto yy978;
+ if(yych == 'I') goto yy1078;
+ goto yy943;
} else {
- if(yych == 'W') goto yy978;
- if(yych <= 'X') goto yy1066;
- goto yy978;
+ if(yych == 'W') goto yy943;
+ if(yych <= 'X') goto yy1032;
+ goto yy943;
}
-yy978:
- YYDEBUG(978, *YYCURSOR);
+yy943:
+ YYDEBUG(943, *YYCURSOR);
-#line 1138 "ext/date/lib/parse_date.re"
+#line 1164 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenodayrev");
TIMELIB_INIT;
@@ -16080,39 +15581,39 @@ yy978:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
-#line 14106 "ext/date/lib/parse_date.c"
-yy979:
- YYDEBUG(979, *YYCURSOR);
+#line 13682 "ext/date/lib/parse_date.c"
+yy944:
+ YYDEBUG(944, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy1110;
- goto yy978;
-yy980:
- YYDEBUG(980, *YYCURSOR);
+ if(yych == 'I') goto yy1076;
+ goto yy943;
+yy945:
+ YYDEBUG(945, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy1109;
- goto yy978;
-yy981:
- YYDEBUG(981, *YYCURSOR);
+ if(yych == 'I') goto yy1075;
+ goto yy943;
+yy946:
+ YYDEBUG(946, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'A') goto yy1102;
+ if(yych == 'A') goto yy1068;
if(yych <= 'T') goto yy53;
- goto yy1101;
+ goto yy1067;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy1102;
+ goto yy1068;
} else {
- if(yych == 'u') goto yy1101;
+ if(yych == 'u') goto yy1067;
goto yy53;
}
}
-yy982:
- YYDEBUG(982, *YYCURSOR);
+yy947:
+ YYDEBUG(947, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= 'N'){
- if(yych == 'E') goto yy1095;
+ if(yych == 'E') goto yy1061;
goto yy53;
} else {
if(yych <= 'O') goto yy83;
@@ -16121,7 +15622,7 @@ yy982:
}
} else {
if(yych <= 'n'){
- if(yych == 'e') goto yy1095;
+ if(yych == 'e') goto yy1061;
goto yy53;
} else {
if(yych <= 'o') goto yy83;
@@ -16129,137 +15630,137 @@ yy982:
goto yy53;
}
}
-yy983:
- YYDEBUG(983, *YYCURSOR);
+yy948:
+ YYDEBUG(948, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= 'H'){
- if(yych == 'A') goto yy1092;
+ if(yych == 'A') goto yy1058;
goto yy53;
} else {
- if(yych <= 'I') goto yy110;
+ if(yych <= 'I') goto yy114;
if(yych <= 'N') goto yy53;
- goto yy109;
+ goto yy113;
}
} else {
if(yych <= 'h'){
- if(yych == 'a') goto yy1092;
+ if(yych == 'a') goto yy1058;
goto yy53;
} else {
- if(yych <= 'i') goto yy110;
- if(yych == 'o') goto yy109;
+ if(yych <= 'i') goto yy114;
+ if(yych == 'o') goto yy113;
goto yy53;
}
}
-yy984:
- YYDEBUG(984, *YYCURSOR);
+yy949:
+ YYDEBUG(949, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'P') goto yy1086;
+ if(yych == 'P') goto yy1052;
if(yych <= 'T') goto yy53;
- goto yy1085;
+ goto yy1051;
} else {
if(yych <= 'p'){
if(yych <= 'o') goto yy53;
- goto yy1086;
+ goto yy1052;
} else {
- if(yych == 'u') goto yy1085;
+ if(yych == 'u') goto yy1051;
goto yy53;
}
}
-yy985:
- YYDEBUG(985, *YYCURSOR);
+yy950:
+ YYDEBUG(950, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= 'D'){
- if(yych == 'A') goto yy119;
+ if(yych == 'A') goto yy123;
goto yy53;
} else {
- if(yych <= 'E') goto yy1078;
+ if(yych <= 'E') goto yy1044;
if(yych <= 'T') goto yy53;
- goto yy118;
+ goto yy122;
}
} else {
if(yych <= 'd'){
- if(yych == 'a') goto yy119;
+ if(yych == 'a') goto yy123;
goto yy53;
} else {
- if(yych <= 'e') goto yy1078;
- if(yych == 'u') goto yy118;
+ if(yych <= 'e') goto yy1044;
+ if(yych == 'u') goto yy122;
goto yy53;
}
}
-yy986:
- YYDEBUG(986, *YYCURSOR);
+yy951:
+ YYDEBUG(951, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy1073;
- if(yych == 'c') goto yy1073;
+ if(yych == 'C') goto yy1039;
+ if(yych == 'c') goto yy1039;
goto yy53;
-yy987:
- YYDEBUG(987, *YYCURSOR);
+yy952:
+ YYDEBUG(952, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy1067;
- if(yych == 'o') goto yy1067;
+ if(yych == 'O') goto yy1033;
+ if(yych == 'o') goto yy1033;
goto yy53;
-yy988:
- YYDEBUG(988, *YYCURSOR);
+yy953:
+ YYDEBUG(953, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
- if(yych == 'A') goto yy106;
+ if(yych == 'A') goto yy110;
if(yych <= 'D') goto yy53;
- goto yy1060;
+ goto yy1026;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy106;
+ goto yy110;
} else {
- if(yych == 'e') goto yy1060;
+ if(yych == 'e') goto yy1026;
goto yy53;
}
}
-yy989:
- YYDEBUG(989, *YYCURSOR);
+yy954:
+ YYDEBUG(954, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '0') goto yy1058;
- if(yych <= '9') goto yy1059;
+ if(yych <= '0') goto yy1024;
+ if(yych <= '9') goto yy1025;
goto yy57;
-yy990:
- YYDEBUG(990, *YYCURSOR);
+yy955:
+ YYDEBUG(955, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '2') goto yy1027;
- if(yych <= '9') goto yy1006;
+ if(yych <= '2') goto yy993;
+ if(yych <= '9') goto yy972;
goto yy57;
-yy991:
- YYDEBUG(991, *YYCURSOR);
+yy956:
+ YYDEBUG(956, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy1007;
- if(yych <= '1') goto yy1008;
+ if(yych <= '0') goto yy973;
+ if(yych <= '1') goto yy974;
goto yy53;
-yy992:
- YYDEBUG(992, *YYCURSOR);
+yy957:
+ YYDEBUG(957, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy1006;
+ if(yych <= '9') goto yy972;
goto yy57;
-yy993:
- YYDEBUG(993, *YYCURSOR);
+yy958:
+ YYDEBUG(958, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '5') goto yy1002;
- if(yych <= '6') goto yy1003;
+ if(yych <= '5') goto yy968;
+ if(yych <= '6') goto yy969;
if(yych <= '9') goto yy51;
goto yy57;
-yy994:
- YYDEBUG(994, *YYCURSOR);
+yy959:
+ YYDEBUG(959, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '5'){
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy995;
- if(yych <= '4') goto yy996;
- goto yy997;
+ if(yych <= '0') goto yy960;
+ if(yych <= '4') goto yy961;
+ goto yy962;
} else {
if(yych <= 'E'){
if(yych <= 'D') goto yy53;
@@ -16269,34 +15770,36 @@ yy994:
goto yy53;
}
}
-yy995:
- YYDEBUG(995, *YYCURSOR);
+yy960:
+ YYDEBUG(960, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '0') goto yy53;
- if(yych <= '9') goto yy998;
+ if(yych <= '9') goto yy963;
goto yy53;
-yy996:
- YYDEBUG(996, *YYCURSOR);
+yy961:
+ YYDEBUG(961, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy998;
+ if(yych <= '9') goto yy963;
goto yy53;
-yy997:
- YYDEBUG(997, *YYCURSOR);
+yy962:
+ YYDEBUG(962, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '4') goto yy53;
- goto yy998;
-yy998:
- YYDEBUG(998, *YYCURSOR);
- ++YYCURSOR;
- if((yych = *YYCURSOR) <= '/') goto yy999;
- if(yych <= '7') goto yy1000;
- goto yy999;
-yy999:
- YYDEBUG(999, *YYCURSOR);
+ goto yy963;
+yy963:
+ YYDEBUG(963, *YYCURSOR);
+ yyaccept = 16;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '-') goto yy965;
+ if(yych <= '/') goto yy964;
+ if(yych <= '7') goto yy966;
+ goto yy964;
+yy964:
+ YYDEBUG(964, *YYCURSOR);
-#line 1246 "ext/date/lib/parse_date.re"
+#line 1272 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@@ -16314,15 +15817,21 @@ yy999:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
-#line 14298 "ext/date/lib/parse_date.c"
-yy1000:
- YYDEBUG(1000, *YYCURSOR);
+#line 13876 "ext/date/lib/parse_date.c"
+yy965:
+ YYDEBUG(965, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if(yych <= '/') goto yy53;
+ if(yych >= '8') goto yy53;
+ goto yy966;
+yy966:
+ YYDEBUG(966, *YYCURSOR);
++YYCURSOR;
- goto yy1001;
-yy1001:
- YYDEBUG(1001, *YYCURSOR);
+ goto yy967;
+yy967:
+ YYDEBUG(967, *YYCURSOR);
-#line 1227 "ext/date/lib/parse_date.re"
+#line 1253 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@@ -16340,23 +15849,23 @@ yy1001:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
-#line 14320 "ext/date/lib/parse_date.c"
-yy1002:
- YYDEBUG(1002, *YYCURSOR);
+#line 13902 "ext/date/lib/parse_date.c"
+yy968:
+ YYDEBUG(968, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy1004;
+ if(yych <= '9') goto yy970;
goto yy57;
-yy1003:
- YYDEBUG(1003, *YYCURSOR);
+yy969:
+ YYDEBUG(969, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '6') goto yy1004;
+ if(yych <= '6') goto yy970;
if(yych <= '9') goto yy51;
goto yy57;
-yy1004:
- YYDEBUG(1004, *YYCURSOR);
- yyaccept = 15;
+yy970:
+ YYDEBUG(970, *YYCURSOR);
+ yyaccept = 17;
yych = *(YYMARKER = ++YYCURSOR);
if(yybm[0+yych] & 8) {
goto yy51;
@@ -16366,22 +15875,22 @@ yy1004:
if(yych <= ' '){
if(yych == 0x09) goto yy57;
if(yych >= ' ') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych == 'D') goto yy57;
if(yych >= 'F') goto yy57;
- goto yy1005;
+ goto yy971;
}
} else {
if(yych <= 'M'){
if(yych == 'H') goto yy57;
if(yych >= 'M') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
- if(yych <= 'R') goto yy1005;
+ if(yych <= 'R') goto yy971;
if(yych <= 'T') goto yy57;
if(yych >= 'W') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
} else {
@@ -16389,32 +15898,32 @@ yy1004:
if(yych <= 'd'){
if(yych == 'Y') goto yy57;
if(yych >= 'd') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych == 'f') goto yy57;
if(yych >= 'h') goto yy57;
- goto yy1005;
+ goto yy971;
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
if(yych >= 's') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych <= 'w'){
if(yych >= 'w') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych == 'y') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
}
-yy1005:
- YYDEBUG(1005, *YYCURSOR);
+yy971:
+ YYDEBUG(971, *YYCURSOR);
-#line 1214 "ext/date/lib/parse_date.re"
+#line 1240 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pgydotd");
TIMELIB_INIT;
@@ -16426,128 +15935,128 @@ yy1005:
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
-#line 14398 "ext/date/lib/parse_date.c"
-yy1006:
- YYDEBUG(1006, *YYCURSOR);
+#line 13980 "ext/date/lib/parse_date.c"
+yy972:
+ YYDEBUG(972, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy1004;
+ if(yych <= '9') goto yy970;
goto yy57;
-yy1007:
- YYDEBUG(1007, *YYCURSOR);
+yy973:
+ YYDEBUG(973, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '0') goto yy53;
- if(yych <= '9') goto yy1009;
+ if(yych <= '9') goto yy975;
goto yy53;
-yy1008:
- YYDEBUG(1008, *YYCURSOR);
+yy974:
+ YYDEBUG(974, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '3') goto yy53;
- goto yy1009;
-yy1009:
- YYDEBUG(1009, *YYCURSOR);
+ goto yy975;
+yy975:
+ YYDEBUG(975, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1010;
-yy1010:
- YYDEBUG(1010, *YYCURSOR);
+ goto yy976;
+yy976:
+ YYDEBUG(976, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy1011;
- if(yych <= '2') goto yy1012;
- if(yych <= '3') goto yy1013;
+ if(yych <= '0') goto yy977;
+ if(yych <= '2') goto yy978;
+ if(yych <= '3') goto yy979;
goto yy53;
-yy1011:
- YYDEBUG(1011, *YYCURSOR);
+yy977:
+ YYDEBUG(977, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '0') goto yy53;
- if(yych <= '9') goto yy1014;
+ if(yych <= '9') goto yy980;
goto yy53;
-yy1012:
- YYDEBUG(1012, *YYCURSOR);
+yy978:
+ YYDEBUG(978, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1014;
+ if(yych <= '9') goto yy980;
goto yy53;
-yy1013:
- YYDEBUG(1013, *YYCURSOR);
+yy979:
+ YYDEBUG(979, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '2') goto yy53;
- goto yy1014;
-yy1014:
- YYDEBUG(1014, *YYCURSOR);
+ goto yy980;
+yy980:
+ YYDEBUG(980, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ' ') goto yy53;
- goto yy1015;
-yy1015:
- YYDEBUG(1015, *YYCURSOR);
+ goto yy981;
+yy981:
+ YYDEBUG(981, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy1016;
- if(yych <= '2') goto yy1017;
+ if(yych <= '1') goto yy982;
+ if(yych <= '2') goto yy983;
goto yy53;
-yy1016:
- YYDEBUG(1016, *YYCURSOR);
+yy982:
+ YYDEBUG(982, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1018;
+ if(yych <= '9') goto yy984;
goto yy53;
-yy1017:
- YYDEBUG(1017, *YYCURSOR);
+yy983:
+ YYDEBUG(983, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '4') goto yy53;
- goto yy1018;
-yy1018:
- YYDEBUG(1018, *YYCURSOR);
+ goto yy984;
+yy984:
+ YYDEBUG(984, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1019;
-yy1019:
- YYDEBUG(1019, *YYCURSOR);
+ goto yy985;
+yy985:
+ YYDEBUG(985, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '6') goto yy53;
- goto yy1020;
-yy1020:
- YYDEBUG(1020, *YYCURSOR);
+ goto yy986;
+yy986:
+ YYDEBUG(986, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1021;
-yy1021:
- YYDEBUG(1021, *YYCURSOR);
+ goto yy987;
+yy987:
+ YYDEBUG(987, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1022;
-yy1022:
- YYDEBUG(1022, *YYCURSOR);
+ goto yy988;
+yy988:
+ YYDEBUG(988, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1023;
- if(yych <= '6') goto yy1024;
+ if(yych <= '5') goto yy989;
+ if(yych <= '6') goto yy990;
goto yy53;
-yy1023:
- YYDEBUG(1023, *YYCURSOR);
+yy989:
+ YYDEBUG(989, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1025;
+ if(yych <= '9') goto yy991;
goto yy53;
-yy1024:
- YYDEBUG(1024, *YYCURSOR);
+yy990:
+ YYDEBUG(990, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '0') goto yy53;
- goto yy1025;
-yy1025:
- YYDEBUG(1025, *YYCURSOR);
+ goto yy991;
+yy991:
+ YYDEBUG(991, *YYCURSOR);
++YYCURSOR;
- goto yy1026;
-yy1026:
- YYDEBUG(1026, *YYCURSOR);
+ goto yy992;
+yy992:
+ YYDEBUG(992, *YYCURSOR);
-#line 1188 "ext/date/lib/parse_date.re"
+#line 1214 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
@@ -16572,219 +16081,219 @@ yy1026:
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
-#line 14502 "ext/date/lib/parse_date.c"
-yy1027:
- YYDEBUG(1027, *YYCURSOR);
+#line 14084 "ext/date/lib/parse_date.c"
+yy993:
+ YYDEBUG(993, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '2'){
if(yych <= '/') goto yy57;
- if(yych >= '1') goto yy1029;
- goto yy1028;
+ if(yych >= '1') goto yy995;
+ goto yy994;
} else {
- if(yych <= '3') goto yy1030;
- if(yych <= '9') goto yy1004;
+ if(yych <= '3') goto yy996;
+ if(yych <= '9') goto yy970;
goto yy57;
}
-yy1028:
- YYDEBUG(1028, *YYCURSOR);
- yyaccept = 15;
+yy994:
+ YYDEBUG(994, *YYCURSOR);
+ yyaccept = 17;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1005;
+ if(yych <= 0x1F) goto yy971;
goto yy57;
} else {
if(yych <= '0'){
- if(yych <= '/') goto yy1005;
+ if(yych <= '/') goto yy971;
goto yy51;
} else {
- if(yych <= '9') goto yy1031;
- if(yych <= 'C') goto yy1005;
+ if(yych <= '9') goto yy997;
+ if(yych <= 'C') goto yy971;
goto yy57;
}
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1005;
+ if(yych <= 'G') goto yy971;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1005;
+ if(yych <= 'L') goto yy971;
goto yy57;
} else {
- if(yych <= 'R') goto yy1005;
+ if(yych <= 'R') goto yy971;
if(yych <= 'T') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1005;
+ if(yych == 'X') goto yy971;
if(yych <= 'Y') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
- if(yych == 'g') goto yy1005;
+ if(yych == 'g') goto yy971;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1005;
+ if(yych <= 'r') goto yy971;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1005;
+ if(yych <= 'v') goto yy971;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
}
-yy1029:
- YYDEBUG(1029, *YYCURSOR);
- yyaccept = 15;
+yy995:
+ YYDEBUG(995, *YYCURSOR);
+ yyaccept = 17;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1005;
+ if(yych <= 0x1F) goto yy971;
goto yy57;
} else {
- if(yych <= '/') goto yy1005;
- if(yych <= '9') goto yy1031;
- if(yych <= 'C') goto yy1005;
+ if(yych <= '/') goto yy971;
+ if(yych <= '9') goto yy997;
+ if(yych <= 'C') goto yy971;
goto yy57;
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1005;
+ if(yych <= 'G') goto yy971;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1005;
+ if(yych <= 'L') goto yy971;
goto yy57;
} else {
- if(yych <= 'R') goto yy1005;
+ if(yych <= 'R') goto yy971;
if(yych <= 'T') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1005;
+ if(yych == 'X') goto yy971;
if(yych <= 'Y') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
- if(yych == 'g') goto yy1005;
+ if(yych == 'g') goto yy971;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1005;
+ if(yych <= 'r') goto yy971;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1005;
+ if(yych <= 'v') goto yy971;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
}
-yy1030:
- YYDEBUG(1030, *YYCURSOR);
- yyaccept = 15;
+yy996:
+ YYDEBUG(996, *YYCURSOR);
+ yyaccept = 17;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1005;
+ if(yych <= 0x1F) goto yy971;
goto yy57;
} else {
if(yych <= '1'){
- if(yych <= '/') goto yy1005;
- goto yy1031;
+ if(yych <= '/') goto yy971;
+ goto yy997;
} else {
if(yych <= '9') goto yy51;
- if(yych <= 'C') goto yy1005;
+ if(yych <= 'C') goto yy971;
goto yy57;
}
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1005;
+ if(yych <= 'G') goto yy971;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1005;
+ if(yych <= 'L') goto yy971;
goto yy57;
} else {
- if(yych <= 'R') goto yy1005;
+ if(yych <= 'R') goto yy971;
if(yych <= 'T') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1005;
+ if(yych == 'X') goto yy971;
if(yych <= 'Y') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1005;
+ goto yy971;
} else {
- if(yych == 'g') goto yy1005;
+ if(yych == 'g') goto yy971;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1005;
+ if(yych <= 'r') goto yy971;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1005;
+ if(yych <= 'v') goto yy971;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1005;
+ goto yy971;
}
}
}
}
-yy1031:
- YYDEBUG(1031, *YYCURSOR);
- yyaccept = 16;
+yy997:
+ YYDEBUG(997, *YYCURSOR);
+ yyaccept = 18;
yych = *(YYMARKER = ++YYCURSOR);
if(yybm[0+yych] & 8) {
goto yy51;
@@ -16794,25 +16303,25 @@ yy1031:
if(yych <= ' '){
if(yych == 0x09) goto yy56;
if(yych >= ' ') goto yy56;
- goto yy1032;
+ goto yy998;
} else {
if(yych == 'D') goto yy61;
if(yych >= 'F') goto yy63;
- goto yy1032;
+ goto yy998;
}
} else {
if(yych <= 'M'){
if(yych == 'H') goto yy60;
if(yych >= 'M') goto yy59;
- goto yy1032;
+ goto yy998;
} else {
if(yych <= 'S'){
if(yych >= 'S') goto yy58;
- goto yy1032;
+ goto yy998;
} else {
- if(yych <= 'T') goto yy1033;
+ if(yych <= 'T') goto yy999;
if(yych >= 'W') goto yy62;
- goto yy1032;
+ goto yy998;
}
}
}
@@ -16821,37 +16330,37 @@ yy1031:
if(yych <= 'd'){
if(yych == 'Y') goto yy64;
if(yych >= 'd') goto yy61;
- goto yy1032;
+ goto yy998;
} else {
if(yych <= 'f'){
if(yych >= 'f') goto yy63;
- goto yy1032;
+ goto yy998;
} else {
if(yych == 'h') goto yy60;
- goto yy1032;
+ goto yy998;
}
}
} else {
if(yych <= 't'){
if(yych <= 'm') goto yy59;
- if(yych <= 'r') goto yy1032;
+ if(yych <= 'r') goto yy998;
if(yych <= 's') goto yy58;
- goto yy1034;
+ goto yy1000;
} else {
if(yych <= 'w'){
if(yych >= 'w') goto yy62;
- goto yy1032;
+ goto yy998;
} else {
if(yych == 'y') goto yy64;
- goto yy1032;
+ goto yy998;
}
}
}
}
-yy1032:
- YYDEBUG(1032, *YYCURSOR);
+yy998:
+ YYDEBUG(998, *YYCURSOR);
-#line 1176 "ext/date/lib/parse_date.re"
+#line 1202 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
@@ -16862,17 +16371,17 @@ yy1032:
TIMELIB_DEINIT;
return TIMELIB_DATE_NOCOLON;
}
-#line 14780 "ext/date/lib/parse_date.c"
-yy1033:
- YYDEBUG(1033, *YYCURSOR);
+#line 14362 "ext/date/lib/parse_date.c"
+yy999:
+ YYDEBUG(999, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= '2'){
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy1048;
- goto yy1049;
+ if(yych <= '1') goto yy1014;
+ goto yy1015;
} else {
- if(yych <= '9') goto yy1050;
+ if(yych <= '9') goto yy1016;
if(yych <= 'G') goto yy53;
goto yy66;
}
@@ -16886,16 +16395,16 @@ yy1033:
goto yy53;
}
}
-yy1034:
- YYDEBUG(1034, *YYCURSOR);
+yy1000:
+ YYDEBUG(1000, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= '2'){
if(yych <= '/') goto yy53;
- if(yych >= '2') goto yy1036;
- goto yy1035;
+ if(yych >= '2') goto yy1002;
+ goto yy1001;
} else {
- if(yych <= '9') goto yy1037;
+ if(yych <= '9') goto yy1003;
if(yych <= 'G') goto yy53;
goto yy66;
}
@@ -16909,691 +16418,691 @@ yy1034:
goto yy53;
}
}
-yy1035:
- YYDEBUG(1035, *YYCURSOR);
+yy1001:
+ YYDEBUG(1001, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1042;
- if(yych <= '9') goto yy1037;
+ if(yych <= '5') goto yy1008;
+ if(yych <= '9') goto yy1003;
goto yy53;
-yy1036:
- YYDEBUG(1036, *YYCURSOR);
+yy1002:
+ YYDEBUG(1002, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '3') goto yy1042;
- if(yych <= '5') goto yy1038;
+ if(yych <= '3') goto yy1008;
+ if(yych <= '5') goto yy1004;
goto yy53;
-yy1037:
- YYDEBUG(1037, *YYCURSOR);
+yy1003:
+ YYDEBUG(1003, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '6') goto yy53;
- goto yy1038;
-yy1038:
- YYDEBUG(1038, *YYCURSOR);
+ goto yy1004;
+yy1004:
+ YYDEBUG(1004, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1039;
-yy1039:
- YYDEBUG(1039, *YYCURSOR);
+ goto yy1005;
+yy1005:
+ YYDEBUG(1005, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1040;
- if(yych <= '6') goto yy1041;
+ if(yych <= '5') goto yy1006;
+ if(yych <= '6') goto yy1007;
goto yy53;
-yy1040:
- YYDEBUG(1040, *YYCURSOR);
+yy1006:
+ YYDEBUG(1006, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1025;
+ if(yych <= '9') goto yy991;
goto yy53;
-yy1041:
- YYDEBUG(1041, *YYCURSOR);
+yy1007:
+ YYDEBUG(1007, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '0') goto yy1025;
+ if(yych == '0') goto yy991;
goto yy53;
-yy1042:
- YYDEBUG(1042, *YYCURSOR);
+yy1008:
+ YYDEBUG(1008, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1043;
- if(yych <= '9') goto yy1039;
+ if(yych <= '5') goto yy1009;
+ if(yych <= '9') goto yy1005;
goto yy53;
-yy1043:
- YYDEBUG(1043, *YYCURSOR);
+yy1009:
+ YYDEBUG(1009, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1044;
- if(yych <= '6') goto yy1045;
- if(yych <= '9') goto yy1039;
+ if(yych <= '5') goto yy1010;
+ if(yych <= '6') goto yy1011;
+ if(yych <= '9') goto yy1005;
goto yy53;
-yy1044:
- YYDEBUG(1044, *YYCURSOR);
+yy1010:
+ YYDEBUG(1010, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1046;
- if(yych <= '6') goto yy1047;
- if(yych <= '9') goto yy1025;
+ if(yych <= '5') goto yy1012;
+ if(yych <= '6') goto yy1013;
+ if(yych <= '9') goto yy991;
goto yy53;
-yy1045:
- YYDEBUG(1045, *YYCURSOR);
+yy1011:
+ YYDEBUG(1011, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy1046;
- if(yych <= '5') goto yy1040;
- if(yych <= '6') goto yy1041;
+ if(yych <= '0') goto yy1012;
+ if(yych <= '5') goto yy1006;
+ if(yych <= '6') goto yy1007;
goto yy53;
-yy1046:
- YYDEBUG(1046, *YYCURSOR);
+yy1012:
+ YYDEBUG(1012, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '9') goto yy1025;
- goto yy1026;
-yy1047:
- YYDEBUG(1047, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '9') goto yy991;
+ goto yy992;
+yy1013:
+ YYDEBUG(1013, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '0') goto yy1025;
- goto yy1026;
-yy1048:
- YYDEBUG(1048, *YYCURSOR);
+ if(yych == '0') goto yy991;
+ goto yy992;
+yy1014:
+ YYDEBUG(1014, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1057;
- if(yych <= '9') goto yy1050;
- if(yych <= ':') goto yy1051;
+ if(yych <= '5') goto yy1023;
+ if(yych <= '9') goto yy1016;
+ if(yych <= ':') goto yy1017;
goto yy53;
-yy1049:
- YYDEBUG(1049, *YYCURSOR);
+yy1015:
+ YYDEBUG(1015, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '5'){
if(yych <= '/') goto yy53;
- if(yych <= '3') goto yy1057;
- goto yy1038;
+ if(yych <= '3') goto yy1023;
+ goto yy1004;
} else {
- if(yych == ':') goto yy1051;
+ if(yych == ':') goto yy1017;
goto yy53;
}
-yy1050:
- YYDEBUG(1050, *YYCURSOR);
+yy1016:
+ YYDEBUG(1016, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1038;
+ if(yych <= '5') goto yy1004;
if(yych != ':') goto yy53;
- goto yy1051;
-yy1051:
- YYDEBUG(1051, *YYCURSOR);
+ goto yy1017;
+yy1017:
+ YYDEBUG(1017, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= '6') goto yy53;
- goto yy1052;
-yy1052:
- YYDEBUG(1052, *YYCURSOR);
+ goto yy1018;
+yy1018:
+ YYDEBUG(1018, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1053;
-yy1053:
- YYDEBUG(1053, *YYCURSOR);
+ goto yy1019;
+yy1019:
+ YYDEBUG(1019, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1054;
-yy1054:
- YYDEBUG(1054, *YYCURSOR);
+ goto yy1020;
+yy1020:
+ YYDEBUG(1020, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1055;
- if(yych <= '6') goto yy1056;
+ if(yych <= '5') goto yy1021;
+ if(yych <= '6') goto yy1022;
goto yy53;
-yy1055:
- YYDEBUG(1055, *YYCURSOR);
+yy1021:
+ YYDEBUG(1021, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1025;
+ if(yych <= '9') goto yy991;
goto yy53;
-yy1056:
- YYDEBUG(1056, *YYCURSOR);
+yy1022:
+ YYDEBUG(1022, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '0') goto yy1025;
+ if(yych == '0') goto yy991;
goto yy53;
-yy1057:
- YYDEBUG(1057, *YYCURSOR);
+yy1023:
+ YYDEBUG(1023, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1043;
- if(yych <= '9') goto yy1039;
- if(yych <= ':') goto yy1051;
+ if(yych <= '5') goto yy1009;
+ if(yych <= '9') goto yy1005;
+ if(yych <= ':') goto yy1017;
goto yy53;
-yy1058:
- YYDEBUG(1058, *YYCURSOR);
+yy1024:
+ YYDEBUG(1024, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
if(yych <= '0') goto yy51;
- if(yych <= '9') goto yy1004;
+ if(yych <= '9') goto yy970;
goto yy57;
-yy1059:
- YYDEBUG(1059, *YYCURSOR);
+yy1025:
+ YYDEBUG(1025, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '2'){
if(yych <= '/') goto yy57;
- if(yych <= '0') goto yy1028;
- goto yy1029;
+ if(yych <= '0') goto yy994;
+ goto yy995;
} else {
- if(yych <= '3') goto yy1030;
- if(yych <= '9') goto yy1004;
+ if(yych <= '3') goto yy996;
+ if(yych <= '9') goto yy970;
goto yy57;
}
-yy1060:
- YYDEBUG(1060, *YYCURSOR);
+yy1026:
+ YYDEBUG(1026, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy1061;
+ if(yych == 'C') goto yy1027;
if(yych != 'c') goto yy53;
- goto yy1061;
-yy1061:
- YYDEBUG(1061, *YYCURSOR);
- yyaccept = 17;
+ goto yy1027;
+yy1027:
+ YYDEBUG(1027, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'E') goto yy1062;
- if(yych != 'e') goto yy978;
- goto yy1062;
-yy1062:
- YYDEBUG(1062, *YYCURSOR);
+ if(yych == 'E') goto yy1028;
+ if(yych != 'e') goto yy943;
+ goto yy1028;
+yy1028:
+ YYDEBUG(1028, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy1063;
+ if(yych == 'M') goto yy1029;
if(yych != 'm') goto yy53;
- goto yy1063;
-yy1063:
- YYDEBUG(1063, *YYCURSOR);
+ goto yy1029;
+yy1029:
+ YYDEBUG(1029, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy1064;
+ if(yych == 'B') goto yy1030;
if(yych != 'b') goto yy53;
- goto yy1064;
-yy1064:
- YYDEBUG(1064, *YYCURSOR);
+ goto yy1030;
+yy1030:
+ YYDEBUG(1030, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1065;
+ if(yych == 'E') goto yy1031;
if(yych != 'e') goto yy53;
- goto yy1065;
-yy1065:
- YYDEBUG(1065, *YYCURSOR);
+ goto yy1031;
+yy1031:
+ YYDEBUG(1031, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1066;
+ if(yych == 'R') goto yy1032;
if(yych != 'r') goto yy53;
- goto yy1066;
-yy1066:
- YYDEBUG(1066, *YYCURSOR);
+ goto yy1032;
+yy1032:
+ YYDEBUG(1032, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy978;
-yy1067:
- YYDEBUG(1067, *YYCURSOR);
+ goto yy943;
+yy1033:
+ YYDEBUG(1033, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'V') goto yy1068;
+ if(yych == 'V') goto yy1034;
if(yych != 'v') goto yy53;
- goto yy1068;
-yy1068:
- YYDEBUG(1068, *YYCURSOR);
- yyaccept = 17;
+ goto yy1034;
+yy1034:
+ YYDEBUG(1034, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'E') goto yy1069;
- if(yych != 'e') goto yy978;
- goto yy1069;
-yy1069:
- YYDEBUG(1069, *YYCURSOR);
+ if(yych == 'E') goto yy1035;
+ if(yych != 'e') goto yy943;
+ goto yy1035;
+yy1035:
+ YYDEBUG(1035, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy1070;
+ if(yych == 'M') goto yy1036;
if(yych != 'm') goto yy53;
- goto yy1070;
-yy1070:
- YYDEBUG(1070, *YYCURSOR);
+ goto yy1036;
+yy1036:
+ YYDEBUG(1036, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy1071;
+ if(yych == 'B') goto yy1037;
if(yych != 'b') goto yy53;
- goto yy1071;
-yy1071:
- YYDEBUG(1071, *YYCURSOR);
+ goto yy1037;
+yy1037:
+ YYDEBUG(1037, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1072;
+ if(yych == 'E') goto yy1038;
if(yych != 'e') goto yy53;
- goto yy1072;
-yy1072:
- YYDEBUG(1072, *YYCURSOR);
+ goto yy1038;
+yy1038:
+ YYDEBUG(1038, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1066;
- if(yych == 'r') goto yy1066;
+ if(yych == 'R') goto yy1032;
+ if(yych == 'r') goto yy1032;
goto yy53;
-yy1073:
- YYDEBUG(1073, *YYCURSOR);
+yy1039:
+ YYDEBUG(1039, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy1074;
+ if(yych == 'T') goto yy1040;
if(yych != 't') goto yy53;
- goto yy1074;
-yy1074:
- YYDEBUG(1074, *YYCURSOR);
- yyaccept = 17;
+ goto yy1040;
+yy1040:
+ YYDEBUG(1040, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'O') goto yy1075;
- if(yych != 'o') goto yy978;
- goto yy1075;
-yy1075:
- YYDEBUG(1075, *YYCURSOR);
+ if(yych == 'O') goto yy1041;
+ if(yych != 'o') goto yy943;
+ goto yy1041;
+yy1041:
+ YYDEBUG(1041, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy1076;
+ if(yych == 'B') goto yy1042;
if(yych != 'b') goto yy53;
- goto yy1076;
-yy1076:
- YYDEBUG(1076, *YYCURSOR);
+ goto yy1042;
+yy1042:
+ YYDEBUG(1042, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1077;
+ if(yych == 'E') goto yy1043;
if(yych != 'e') goto yy53;
- goto yy1077;
-yy1077:
- YYDEBUG(1077, *YYCURSOR);
+ goto yy1043;
+yy1043:
+ YYDEBUG(1043, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1066;
- if(yych == 'r') goto yy1066;
+ if(yych == 'R') goto yy1032;
+ if(yych == 'r') goto yy1032;
goto yy53;
-yy1078:
- YYDEBUG(1078, *YYCURSOR);
+yy1044:
+ YYDEBUG(1044, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'P'){
- if(yych == 'C') goto yy121;
+ if(yych == 'C') goto yy125;
if(yych <= 'O') goto yy53;
- goto yy1079;
+ goto yy1045;
} else {
if(yych <= 'c'){
if(yych <= 'b') goto yy53;
- goto yy121;
+ goto yy125;
} else {
if(yych != 'p') goto yy53;
- goto yy1079;
+ goto yy1045;
}
}
-yy1079:
- YYDEBUG(1079, *YYCURSOR);
+yy1045:
+ YYDEBUG(1045, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy1080;
- if(yych != 't') goto yy978;
- goto yy1080;
-yy1080:
- YYDEBUG(1080, *YYCURSOR);
- yyaccept = 17;
+ if(yych == 'T') goto yy1046;
+ if(yych != 't') goto yy943;
+ goto yy1046;
+yy1046:
+ YYDEBUG(1046, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'E') goto yy1081;
- if(yych != 'e') goto yy978;
- goto yy1081;
-yy1081:
- YYDEBUG(1081, *YYCURSOR);
+ if(yych == 'E') goto yy1047;
+ if(yych != 'e') goto yy943;
+ goto yy1047;
+yy1047:
+ YYDEBUG(1047, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'M') goto yy1082;
+ if(yych == 'M') goto yy1048;
if(yych != 'm') goto yy53;
- goto yy1082;
-yy1082:
- YYDEBUG(1082, *YYCURSOR);
+ goto yy1048;
+yy1048:
+ YYDEBUG(1048, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy1083;
+ if(yych == 'B') goto yy1049;
if(yych != 'b') goto yy53;
- goto yy1083;
-yy1083:
- YYDEBUG(1083, *YYCURSOR);
+ goto yy1049;
+yy1049:
+ YYDEBUG(1049, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1084;
+ if(yych == 'E') goto yy1050;
if(yych != 'e') goto yy53;
- goto yy1084;
-yy1084:
- YYDEBUG(1084, *YYCURSOR);
+ goto yy1050;
+yy1050:
+ YYDEBUG(1050, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1066;
- if(yych == 'r') goto yy1066;
+ if(yych == 'R') goto yy1032;
+ if(yych == 'r') goto yy1032;
goto yy53;
-yy1085:
- YYDEBUG(1085, *YYCURSOR);
+yy1051:
+ YYDEBUG(1051, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy1089;
- if(yych == 'g') goto yy1089;
+ if(yych == 'G') goto yy1055;
+ if(yych == 'g') goto yy1055;
goto yy53;
-yy1086:
- YYDEBUG(1086, *YYCURSOR);
+yy1052:
+ YYDEBUG(1052, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1087;
+ if(yych == 'R') goto yy1053;
if(yych != 'r') goto yy53;
- goto yy1087;
-yy1087:
- YYDEBUG(1087, *YYCURSOR);
- yyaccept = 17;
+ goto yy1053;
+yy1053:
+ YYDEBUG(1053, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'I') goto yy1088;
- if(yych != 'i') goto yy978;
- goto yy1088;
-yy1088:
- YYDEBUG(1088, *YYCURSOR);
+ if(yych == 'I') goto yy1054;
+ if(yych != 'i') goto yy943;
+ goto yy1054;
+yy1054:
+ YYDEBUG(1054, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'L') goto yy1066;
- if(yych == 'l') goto yy1066;
+ if(yych == 'L') goto yy1032;
+ if(yych == 'l') goto yy1032;
goto yy53;
-yy1089:
- YYDEBUG(1089, *YYCURSOR);
- yyaccept = 17;
+yy1055:
+ YYDEBUG(1055, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'U') goto yy1090;
- if(yych != 'u') goto yy978;
- goto yy1090;
-yy1090:
- YYDEBUG(1090, *YYCURSOR);
+ if(yych == 'U') goto yy1056;
+ if(yych != 'u') goto yy943;
+ goto yy1056;
+yy1056:
+ YYDEBUG(1056, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'S') goto yy1091;
+ if(yych == 'S') goto yy1057;
if(yych != 's') goto yy53;
- goto yy1091;
-yy1091:
- YYDEBUG(1091, *YYCURSOR);
+ goto yy1057;
+yy1057:
+ YYDEBUG(1057, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy1066;
- if(yych == 't') goto yy1066;
+ if(yych == 'T') goto yy1032;
+ if(yych == 't') goto yy1032;
goto yy53;
-yy1092:
- YYDEBUG(1092, *YYCURSOR);
+yy1058:
+ YYDEBUG(1058, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
- if(yych == 'R') goto yy1093;
+ if(yych == 'R') goto yy1059;
if(yych <= 'X') goto yy53;
- goto yy1066;
+ goto yy1032;
} else {
if(yych <= 'r'){
if(yych <= 'q') goto yy53;
- goto yy1093;
+ goto yy1059;
} else {
- if(yych == 'y') goto yy1066;
+ if(yych == 'y') goto yy1032;
goto yy53;
}
}
-yy1093:
- YYDEBUG(1093, *YYCURSOR);
- yyaccept = 17;
+yy1059:
+ YYDEBUG(1059, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'C') goto yy1094;
- if(yych != 'c') goto yy978;
- goto yy1094;
-yy1094:
- YYDEBUG(1094, *YYCURSOR);
+ if(yych == 'C') goto yy1060;
+ if(yych != 'c') goto yy943;
+ goto yy1060;
+yy1060:
+ YYDEBUG(1060, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'H') goto yy1066;
- if(yych == 'h') goto yy1066;
+ if(yych == 'H') goto yy1032;
+ if(yych == 'h') goto yy1032;
goto yy53;
-yy1095:
- YYDEBUG(1095, *YYCURSOR);
+yy1061:
+ YYDEBUG(1061, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy1096;
+ if(yych == 'B') goto yy1062;
if(yych != 'b') goto yy53;
- goto yy1096;
-yy1096:
- YYDEBUG(1096, *YYCURSOR);
- yyaccept = 17;
+ goto yy1062;
+yy1062:
+ YYDEBUG(1062, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'R') goto yy1097;
- if(yych != 'r') goto yy978;
- goto yy1097;
-yy1097:
- YYDEBUG(1097, *YYCURSOR);
+ if(yych == 'R') goto yy1063;
+ if(yych != 'r') goto yy943;
+ goto yy1063;
+yy1063:
+ YYDEBUG(1063, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'U') goto yy1098;
+ if(yych == 'U') goto yy1064;
if(yych != 'u') goto yy53;
- goto yy1098;
-yy1098:
- YYDEBUG(1098, *YYCURSOR);
+ goto yy1064;
+yy1064:
+ YYDEBUG(1064, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy1099;
+ if(yych == 'A') goto yy1065;
if(yych != 'a') goto yy53;
- goto yy1099;
-yy1099:
- YYDEBUG(1099, *YYCURSOR);
+ goto yy1065;
+yy1065:
+ YYDEBUG(1065, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1100;
+ if(yych == 'R') goto yy1066;
if(yych != 'r') goto yy53;
- goto yy1100;
-yy1100:
- YYDEBUG(1100, *YYCURSOR);
+ goto yy1066;
+yy1066:
+ YYDEBUG(1066, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy1066;
- if(yych == 'y') goto yy1066;
+ if(yych == 'Y') goto yy1032;
+ if(yych == 'y') goto yy1032;
goto yy53;
-yy1101:
- YYDEBUG(1101, *YYCURSOR);
+yy1067:
+ YYDEBUG(1067, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
- if(yych == 'L') goto yy1108;
+ if(yych == 'L') goto yy1074;
if(yych <= 'M') goto yy53;
- goto yy1107;
+ goto yy1073;
} else {
if(yych <= 'l'){
if(yych <= 'k') goto yy53;
- goto yy1108;
+ goto yy1074;
} else {
- if(yych == 'n') goto yy1107;
+ if(yych == 'n') goto yy1073;
goto yy53;
}
}
-yy1102:
- YYDEBUG(1102, *YYCURSOR);
+yy1068:
+ YYDEBUG(1068, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy1103;
+ if(yych == 'N') goto yy1069;
if(yych != 'n') goto yy53;
- goto yy1103;
-yy1103:
- YYDEBUG(1103, *YYCURSOR);
- yyaccept = 17;
+ goto yy1069;
+yy1069:
+ YYDEBUG(1069, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'U') goto yy1104;
- if(yych != 'u') goto yy978;
- goto yy1104;
-yy1104:
- YYDEBUG(1104, *YYCURSOR);
+ if(yych == 'U') goto yy1070;
+ if(yych != 'u') goto yy943;
+ goto yy1070;
+yy1070:
+ YYDEBUG(1070, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy1105;
+ if(yych == 'A') goto yy1071;
if(yych != 'a') goto yy53;
- goto yy1105;
-yy1105:
- YYDEBUG(1105, *YYCURSOR);
+ goto yy1071;
+yy1071:
+ YYDEBUG(1071, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1106;
+ if(yych == 'R') goto yy1072;
if(yych != 'r') goto yy53;
- goto yy1106;
-yy1106:
- YYDEBUG(1106, *YYCURSOR);
+ goto yy1072;
+yy1072:
+ YYDEBUG(1072, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy1066;
- if(yych == 'y') goto yy1066;
+ if(yych == 'Y') goto yy1032;
+ if(yych == 'y') goto yy1032;
goto yy53;
-yy1107:
- YYDEBUG(1107, *YYCURSOR);
+yy1073:
+ YYDEBUG(1073, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1066;
- if(yych == 'e') goto yy1066;
- goto yy978;
-yy1108:
- YYDEBUG(1108, *YYCURSOR);
+ if(yych == 'E') goto yy1032;
+ if(yych == 'e') goto yy1032;
+ goto yy943;
+yy1074:
+ YYDEBUG(1074, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy1066;
- if(yych == 'y') goto yy1066;
- goto yy978;
-yy1109:
- YYDEBUG(1109, *YYCURSOR);
+ if(yych == 'Y') goto yy1032;
+ if(yych == 'y') goto yy1032;
+ goto yy943;
+yy1075:
+ YYDEBUG(1075, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy1066;
- goto yy978;
-yy1110:
- YYDEBUG(1110, *YYCURSOR);
+ if(yych == 'I') goto yy1032;
+ goto yy943;
+yy1076:
+ YYDEBUG(1076, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych != 'I') goto yy978;
- goto yy1111;
-yy1111:
- YYDEBUG(1111, *YYCURSOR);
+ if(yych != 'I') goto yy943;
+ goto yy1077;
+yy1077:
+ YYDEBUG(1077, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy1066;
- goto yy978;
-yy1112:
- YYDEBUG(1112, *YYCURSOR);
+ if(yych == 'I') goto yy1032;
+ goto yy943;
+yy1078:
+ YYDEBUG(1078, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'I') goto yy1066;
- goto yy978;
-yy1113:
- YYDEBUG(1113, *YYCURSOR);
+ if(yych == 'I') goto yy1032;
+ goto yy943;
+yy1079:
+ YYDEBUG(1079, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '0') goto yy1128;
- if(yych <= '9') goto yy1127;
+ if(yych <= '0') goto yy1094;
+ if(yych <= '9') goto yy1093;
goto yy53;
-yy1114:
- YYDEBUG(1114, *YYCURSOR);
+yy1080:
+ YYDEBUG(1080, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1126;
+ if(yych <= '9') goto yy1092;
goto yy53;
-yy1115:
- YYDEBUG(1115, *YYCURSOR);
+yy1081:
+ YYDEBUG(1081, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1124;
- if(yych <= '6') goto yy1123;
+ if(yych <= '5') goto yy1090;
+ if(yych <= '6') goto yy1089;
goto yy53;
-yy1116:
- YYDEBUG(1116, *YYCURSOR);
+yy1082:
+ YYDEBUG(1082, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1095;
- if(yych == 'e') goto yy1095;
+ if(yych == 'E') goto yy1061;
+ if(yych == 'e') goto yy1061;
goto yy53;
-yy1117:
- YYDEBUG(1117, *YYCURSOR);
+yy1083:
+ YYDEBUG(1083, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy1092;
- if(yych == 'a') goto yy1092;
+ if(yych == 'A') goto yy1058;
+ if(yych == 'a') goto yy1058;
goto yy53;
-yy1118:
- YYDEBUG(1118, *YYCURSOR);
+yy1084:
+ YYDEBUG(1084, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1122;
- if(yych == 'e') goto yy1122;
+ if(yych == 'E') goto yy1088;
+ if(yych == 'e') goto yy1088;
goto yy53;
-yy1119:
- YYDEBUG(1119, *YYCURSOR);
+yy1085:
+ YYDEBUG(1085, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1060;
- if(yych == 'e') goto yy1060;
+ if(yych == 'E') goto yy1026;
+ if(yych == 'e') goto yy1026;
goto yy53;
-yy1120:
- YYDEBUG(1120, *YYCURSOR);
+yy1086:
+ YYDEBUG(1086, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 9) YYFILL(9);
yych = *YYCURSOR;
- goto yy1121;
-yy1121:
- YYDEBUG(1121, *YYCURSOR);
+ goto yy1087;
+yy1087:
+ YYDEBUG(1087, *YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
case 0x09: case ' ': case '-':
- case '.': goto yy1120;
- case 'A': case 'a': goto yy984;
- case 'D': case 'd': goto yy1119;
- case 'F': case 'f': goto yy1116;
- case 'I': goto yy977;
- case 'J': case 'j': goto yy981;
- case 'M': case 'm': goto yy1117;
- case 'N': case 'n': goto yy987;
- case 'O': case 'o': goto yy986;
- case 'S': case 's': goto yy1118;
- case 'V': goto yy979;
- case 'X': goto yy980;
+ case '.': goto yy1086;
+ case 'A': case 'a': goto yy949;
+ case 'D': case 'd': goto yy1085;
+ case 'F': case 'f': goto yy1082;
+ case 'I': goto yy942;
+ case 'J': case 'j': goto yy946;
+ case 'M': case 'm': goto yy1083;
+ case 'N': case 'n': goto yy952;
+ case 'O': case 'o': goto yy951;
+ case 'S': case 's': goto yy1084;
+ case 'V': goto yy944;
+ case 'X': goto yy945;
default: goto yy53;
}
-yy1122:
- YYDEBUG(1122, *YYCURSOR);
+yy1088:
+ YYDEBUG(1088, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'P') goto yy1079;
- if(yych == 'p') goto yy1079;
+ if(yych == 'P') goto yy1045;
+ if(yych == 'p') goto yy1045;
goto yy53;
-yy1123:
- YYDEBUG(1123, *YYCURSOR);
+yy1089:
+ YYDEBUG(1089, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '6') goto yy1125;
+ if(yych <= '6') goto yy1091;
goto yy53;
-yy1124:
- YYDEBUG(1124, *YYCURSOR);
+yy1090:
+ YYDEBUG(1090, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1125;
-yy1125:
- YYDEBUG(1125, *YYCURSOR);
+ goto yy1091;
+yy1091:
+ YYDEBUG(1091, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy1005;
-yy1126:
- YYDEBUG(1126, *YYCURSOR);
+ goto yy971;
+yy1092:
+ YYDEBUG(1092, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1125;
+ if(yych <= '9') goto yy1091;
goto yy53;
-yy1127:
- YYDEBUG(1127, *YYCURSOR);
+yy1093:
+ YYDEBUG(1093, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1125;
+ if(yych <= '9') goto yy1091;
goto yy53;
-yy1128:
- YYDEBUG(1128, *YYCURSOR);
+yy1094:
+ YYDEBUG(1094, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '0') goto yy53;
- if(yych <= '9') goto yy1125;
+ if(yych <= '9') goto yy1091;
goto yy53;
-yy1129:
- YYDEBUG(1129, *YYCURSOR);
+yy1095:
+ YYDEBUG(1095, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '.') goto yy53;
- if(yych <= '/') goto yy1132;
- if(yych <= '0') goto yy1131;
- if(yych <= '9') goto yy1142;
+ if(yych <= '/') goto yy1098;
+ if(yych <= '0') goto yy1097;
+ if(yych <= '9') goto yy1108;
goto yy53;
-yy1130:
- YYDEBUG(1130, *YYCURSOR);
+yy1096:
+ YYDEBUG(1096, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '.') goto yy53;
- if(yych <= '/') goto yy1132;
- if(yych <= '2') goto yy1142;
+ if(yych <= '/') goto yy1098;
+ if(yych <= '2') goto yy1108;
goto yy53;
-yy1131:
- YYDEBUG(1131, *YYCURSOR);
+yy1097:
+ YYDEBUG(1097, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '/') goto yy53;
- goto yy1132;
-yy1132:
- YYDEBUG(1132, *YYCURSOR);
+ goto yy1098;
+yy1098:
+ YYDEBUG(1098, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '2') goto yy1133;
- if(yych <= '3') goto yy1135;
- if(yych <= '9') goto yy1136;
+ if(yych <= '2') goto yy1099;
+ if(yych <= '3') goto yy1101;
+ if(yych <= '9') goto yy1102;
goto yy53;
-yy1133:
- YYDEBUG(1133, *YYCURSOR);
- yyaccept = 18;
+yy1099:
+ YYDEBUG(1099, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy1134;
- if(yych <= '9') goto yy1136;
- if(yych >= 'n') goto yy1138;
- goto yy1134;
+ if(yych <= '/') goto yy1100;
+ if(yych <= '9') goto yy1102;
+ if(yych >= 'n') goto yy1104;
+ goto yy1100;
} else {
if(yych <= 'r'){
- if(yych >= 'r') goto yy1139;
- goto yy1134;
+ if(yych >= 'r') goto yy1105;
+ goto yy1100;
} else {
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
}
-yy1134:
- YYDEBUG(1134, *YYCURSOR);
+yy1100:
+ YYDEBUG(1100, *YYCURSOR);
-#line 1073 "ext/date/lib/parse_date.re"
+#line 1087 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date | iso8601dateslash | dateslash");
TIMELIB_INIT;
@@ -17604,1045 +17113,1072 @@ yy1134:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
-#line 15317 "ext/date/lib/parse_date.c"
-yy1135:
- YYDEBUG(1135, *YYCURSOR);
- yyaccept = 18;
+#line 14899 "ext/date/lib/parse_date.c"
+yy1101:
+ YYDEBUG(1101, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy1134;
- if(yych <= '1') goto yy1136;
- if(yych <= 'm') goto yy1134;
- goto yy1138;
+ if(yych <= '/') goto yy1100;
+ if(yych <= '1') goto yy1102;
+ if(yych <= 'm') goto yy1100;
+ goto yy1104;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy1134;
- goto yy1139;
+ if(yych <= 'q') goto yy1100;
+ goto yy1105;
} else {
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
}
-yy1136:
- YYDEBUG(1136, *YYCURSOR);
- yyaccept = 18;
+yy1102:
+ YYDEBUG(1102, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'q'){
- if(yych == 'n') goto yy1138;
- goto yy1134;
+ if(yych == 'n') goto yy1104;
+ goto yy1100;
} else {
- if(yych <= 'r') goto yy1139;
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 'r') goto yy1105;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
-yy1137:
- YYDEBUG(1137, *YYCURSOR);
+yy1103:
+ YYDEBUG(1103, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 't') goto yy1141;
+ if(yych == 't') goto yy1107;
goto yy53;
-yy1138:
- YYDEBUG(1138, *YYCURSOR);
+yy1104:
+ YYDEBUG(1104, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy1141;
+ if(yych == 'd') goto yy1107;
goto yy53;
-yy1139:
- YYDEBUG(1139, *YYCURSOR);
+yy1105:
+ YYDEBUG(1105, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy1141;
+ if(yych == 'd') goto yy1107;
goto yy53;
-yy1140:
- YYDEBUG(1140, *YYCURSOR);
+yy1106:
+ YYDEBUG(1106, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != 'h') goto yy53;
- goto yy1141;
-yy1141:
- YYDEBUG(1141, *YYCURSOR);
+ goto yy1107;
+yy1107:
+ YYDEBUG(1107, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy1134;
-yy1142:
- YYDEBUG(1142, *YYCURSOR);
+ goto yy1100;
+yy1108:
+ YYDEBUG(1108, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '/') goto yy53;
- goto yy1143;
-yy1143:
- YYDEBUG(1143, *YYCURSOR);
+ goto yy1109;
+yy1109:
+ YYDEBUG(1109, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '2'){
if(yych <= '/') goto yy53;
- if(yych >= '1') goto yy1145;
- goto yy1144;
+ if(yych >= '1') goto yy1111;
+ goto yy1110;
} else {
- if(yych <= '3') goto yy1146;
- if(yych <= '9') goto yy1136;
+ if(yych <= '3') goto yy1112;
+ if(yych <= '9') goto yy1102;
goto yy53;
}
-yy1144:
- YYDEBUG(1144, *YYCURSOR);
- yyaccept = 18;
+yy1110:
+ YYDEBUG(1110, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
if(yych <= '0'){
- if(yych <= '/') goto yy1134;
- goto yy1136;
+ if(yych <= '/') goto yy1100;
+ goto yy1102;
} else {
- if(yych <= '9') goto yy1147;
- if(yych <= 'm') goto yy1134;
- goto yy1138;
+ if(yych <= '9') goto yy1113;
+ if(yych <= 'm') goto yy1100;
+ goto yy1104;
}
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy1134;
- goto yy1139;
+ if(yych <= 'q') goto yy1100;
+ goto yy1105;
} else {
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
}
-yy1145:
- YYDEBUG(1145, *YYCURSOR);
- yyaccept = 18;
+yy1111:
+ YYDEBUG(1111, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy1134;
- if(yych <= '9') goto yy1147;
- if(yych <= 'm') goto yy1134;
- goto yy1138;
+ if(yych <= '/') goto yy1100;
+ if(yych <= '9') goto yy1113;
+ if(yych <= 'm') goto yy1100;
+ goto yy1104;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy1134;
- goto yy1139;
+ if(yych <= 'q') goto yy1100;
+ goto yy1105;
} else {
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
}
-yy1146:
- YYDEBUG(1146, *YYCURSOR);
- yyaccept = 18;
+yy1112:
+ YYDEBUG(1112, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych <= '/') goto yy1134;
- if(yych <= '1') goto yy1147;
- if(yych <= 'm') goto yy1134;
- goto yy1138;
+ if(yych <= '/') goto yy1100;
+ if(yych <= '1') goto yy1113;
+ if(yych <= 'm') goto yy1100;
+ goto yy1104;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy1134;
- goto yy1139;
+ if(yych <= 'q') goto yy1100;
+ goto yy1105;
} else {
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
}
-yy1147:
- YYDEBUG(1147, *YYCURSOR);
- yyaccept = 18;
+yy1113:
+ YYDEBUG(1113, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych == '/') goto yy1141;
- if(yych <= 'm') goto yy1134;
- goto yy1138;
+ if(yych == '/') goto yy1107;
+ if(yych <= 'm') goto yy1100;
+ goto yy1104;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy1134;
- goto yy1139;
+ if(yych <= 'q') goto yy1100;
+ goto yy1105;
} else {
- if(yych <= 's') goto yy1137;
- if(yych <= 't') goto yy1140;
- goto yy1134;
+ if(yych <= 's') goto yy1103;
+ if(yych <= 't') goto yy1106;
+ goto yy1100;
}
}
-yy1148:
- YYDEBUG(1148, *YYCURSOR);
+yy1114:
+ YYDEBUG(1114, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'A') goto yy1223;
+ if(yych == 'A') goto yy1191;
if(yych <= 'T') goto yy53;
- goto yy1222;
+ goto yy1190;
} else {
if(yych <= 'a'){
if(yych <= '`') goto yy53;
- goto yy1223;
+ goto yy1191;
} else {
- if(yych == 'u') goto yy1222;
+ if(yych == 'u') goto yy1190;
goto yy53;
}
}
-yy1149:
- YYDEBUG(1149, *YYCURSOR);
+yy1115:
+ YYDEBUG(1115, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1220;
- if(yych == 'e') goto yy1220;
+ if(yych == 'E') goto yy1188;
+ if(yych == 'e') goto yy1188;
goto yy53;
-yy1150:
- YYDEBUG(1150, *YYCURSOR);
+yy1116:
+ YYDEBUG(1116, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy1217;
- if(yych == 'a') goto yy1217;
+ if(yych == 'A') goto yy1185;
+ if(yych == 'a') goto yy1185;
goto yy53;
-yy1151:
- YYDEBUG(1151, *YYCURSOR);
+yy1117:
+ YYDEBUG(1117, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
- if(yych == 'P') goto yy1214;
+ if(yych == 'P') goto yy1182;
if(yych <= 'T') goto yy53;
- goto yy1213;
+ goto yy1181;
} else {
if(yych <= 'p'){
if(yych <= 'o') goto yy53;
- goto yy1214;
+ goto yy1182;
} else {
- if(yych == 'u') goto yy1213;
+ if(yych == 'u') goto yy1181;
goto yy53;
}
}
-yy1152:
- YYDEBUG(1152, *YYCURSOR);
+yy1118:
+ YYDEBUG(1118, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1210;
- if(yych == 'e') goto yy1210;
+ if(yych == 'E') goto yy1178;
+ if(yych == 'e') goto yy1178;
goto yy53;
-yy1153:
- YYDEBUG(1153, *YYCURSOR);
+yy1119:
+ YYDEBUG(1119, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy1208;
- if(yych == 'c') goto yy1208;
+ if(yych == 'C') goto yy1176;
+ if(yych == 'c') goto yy1176;
goto yy53;
-yy1154:
- YYDEBUG(1154, *YYCURSOR);
+yy1120:
+ YYDEBUG(1120, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'O') goto yy1206;
- if(yych == 'o') goto yy1206;
+ if(yych == 'O') goto yy1174;
+ if(yych == 'o') goto yy1174;
goto yy53;
-yy1155:
- YYDEBUG(1155, *YYCURSOR);
+yy1121:
+ YYDEBUG(1121, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'E') goto yy1204;
- if(yych == 'e') goto yy1204;
+ if(yych == 'E') goto yy1172;
+ if(yych == 'e') goto yy1172;
goto yy53;
-yy1156:
- YYDEBUG(1156, *YYCURSOR);
+yy1122:
+ YYDEBUG(1122, *YYCURSOR);
yych = *++YYCURSOR;
+ if(yych <= '/') goto yy53;
+ if(yych <= '0') goto yy960;
+ if(yych <= '4') goto yy961;
+ if(yych <= '5') goto yy962;
+ goto yy53;
+yy1123:
+ YYDEBUG(1123, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '-') goto yy1159;
- goto yy53;
+ if(yych == '-') goto yy1127;
+ goto yy1124;
} else {
- if(yych <= '0') goto yy1158;
- if(yych <= '9') goto yy1178;
- goto yy53;
+ if(yych <= '0') goto yy1126;
+ if(yych <= '9') goto yy1146;
+ goto yy1124;
}
-yy1157:
- YYDEBUG(1157, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych == '-') goto yy1159;
- if(yych <= '/') goto yy53;
- if(yych <= '2') goto yy1178;
- goto yy53;
-yy1158:
- YYDEBUG(1158, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych != '-') goto yy53;
- goto yy1159;
-yy1159:
- YYDEBUG(1159, *YYCURSOR);
+yy1124:
+ YYDEBUG(1124, *YYCURSOR);
+
+#line 1099 "ext/date/lib/parse_date.re"
+{
+ DEBUG_OUTPUT("gnudateshorter");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_DATE;
+ }
+#line 15106 "ext/date/lib/parse_date.c"
+yy1125:
+ YYDEBUG(1125, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych == '-') goto yy1127;
+ if(yych <= '/') goto yy1124;
+ if(yych <= '2') goto yy1146;
+ goto yy1124;
+yy1126:
+ YYDEBUG(1126, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych != '-') goto yy1124;
+ goto yy1127;
+yy1127:
+ YYDEBUG(1127, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '2') goto yy1160;
- if(yych <= '3') goto yy1161;
- if(yych <= '9') goto yy1162;
+ if(yych <= '2') goto yy1128;
+ if(yych <= '3') goto yy1129;
+ if(yych <= '9') goto yy1130;
goto yy53;
-yy1160:
- YYDEBUG(1160, *YYCURSOR);
- yyaccept = 12;
+yy1128:
+ YYDEBUG(1128, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '9'){
- if(yych <= '/') goto yy860;
- goto yy1162;
+ if(yych <= '/') goto yy825;
+ goto yy1130;
} else {
- if(yych == 'T') goto yy1167;
- goto yy860;
+ if(yych == 'T') goto yy1135;
+ goto yy825;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy1164;
- if(yych <= 'q') goto yy860;
- goto yy1165;
+ if(yych <= 'n') goto yy1132;
+ if(yych <= 'q') goto yy825;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy860;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy825;
}
}
-yy1161:
- YYDEBUG(1161, *YYCURSOR);
- yyaccept = 12;
+yy1129:
+ YYDEBUG(1129, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy860;
- goto yy1162;
+ if(yych <= '/') goto yy825;
+ goto yy1130;
} else {
- if(yych == 'T') goto yy1167;
- goto yy860;
+ if(yych == 'T') goto yy1135;
+ goto yy825;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy1164;
- if(yych <= 'q') goto yy860;
- goto yy1165;
+ if(yych <= 'n') goto yy1132;
+ if(yych <= 'q') goto yy825;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy860;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy825;
}
}
-yy1162:
- YYDEBUG(1162, *YYCURSOR);
- yyaccept = 12;
+yy1130:
+ YYDEBUG(1130, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych == 'T') goto yy1167;
- if(yych <= 'm') goto yy860;
- goto yy1164;
+ if(yych == 'T') goto yy1135;
+ if(yych <= 'm') goto yy825;
+ goto yy1132;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy860;
- goto yy1165;
+ if(yych <= 'q') goto yy825;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy860;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy825;
}
}
-yy1163:
- YYDEBUG(1163, *YYCURSOR);
+yy1131:
+ YYDEBUG(1131, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 't') goto yy1177;
+ if(yych == 't') goto yy1145;
goto yy53;
-yy1164:
- YYDEBUG(1164, *YYCURSOR);
+yy1132:
+ YYDEBUG(1132, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy1177;
+ if(yych == 'd') goto yy1145;
goto yy53;
-yy1165:
- YYDEBUG(1165, *YYCURSOR);
+yy1133:
+ YYDEBUG(1133, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'd') goto yy1177;
+ if(yych == 'd') goto yy1145;
goto yy53;
-yy1166:
- YYDEBUG(1166, *YYCURSOR);
+yy1134:
+ YYDEBUG(1134, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'h') goto yy1177;
+ if(yych == 'h') goto yy1145;
goto yy53;
-yy1167:
- YYDEBUG(1167, *YYCURSOR);
+yy1135:
+ YYDEBUG(1135, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy1168;
- if(yych <= '2') goto yy1169;
- if(yych <= '9') goto yy1170;
+ if(yych <= '1') goto yy1136;
+ if(yych <= '2') goto yy1137;
+ if(yych <= '9') goto yy1138;
goto yy53;
-yy1168:
- YYDEBUG(1168, *YYCURSOR);
+yy1136:
+ YYDEBUG(1136, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1170;
- if(yych <= ':') goto yy1171;
+ if(yych <= '9') goto yy1138;
+ if(yych <= ':') goto yy1139;
goto yy53;
-yy1169:
- YYDEBUG(1169, *YYCURSOR);
+yy1137:
+ YYDEBUG(1137, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '3') goto yy1170;
- if(yych == ':') goto yy1171;
+ if(yych <= '3') goto yy1138;
+ if(yych == ':') goto yy1139;
goto yy53;
-yy1170:
- YYDEBUG(1170, *YYCURSOR);
+yy1138:
+ YYDEBUG(1138, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1171;
-yy1171:
- YYDEBUG(1171, *YYCURSOR);
+ goto yy1139;
+yy1139:
+ YYDEBUG(1139, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1172;
- if(yych <= '9') goto yy1173;
+ if(yych <= '5') goto yy1140;
+ if(yych <= '9') goto yy1141;
goto yy53;
-yy1172:
- YYDEBUG(1172, *YYCURSOR);
+yy1140:
+ YYDEBUG(1140, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1173;
- if(yych <= ':') goto yy1174;
+ if(yych <= '9') goto yy1141;
+ if(yych <= ':') goto yy1142;
goto yy53;
-yy1173:
- YYDEBUG(1173, *YYCURSOR);
+yy1141:
+ YYDEBUG(1141, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1174;
-yy1174:
- YYDEBUG(1174, *YYCURSOR);
+ goto yy1142;
+yy1142:
+ YYDEBUG(1142, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1175;
- if(yych <= '6') goto yy1176;
- if(yych <= '9') goto yy1025;
+ if(yych <= '5') goto yy1143;
+ if(yych <= '6') goto yy1144;
+ if(yych <= '9') goto yy991;
goto yy53;
-yy1175:
- YYDEBUG(1175, *YYCURSOR);
+yy1143:
+ YYDEBUG(1143, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '9') goto yy1025;
- goto yy1026;
-yy1176:
- YYDEBUG(1176, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '9') goto yy991;
+ goto yy992;
+yy1144:
+ YYDEBUG(1144, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '0') goto yy1025;
- goto yy1026;
-yy1177:
- YYDEBUG(1177, *YYCURSOR);
- yyaccept = 12;
+ if(yych == '0') goto yy991;
+ goto yy992;
+yy1145:
+ YYDEBUG(1145, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == 'T') goto yy1167;
- goto yy860;
-yy1178:
- YYDEBUG(1178, *YYCURSOR);
- yych = *++YYCURSOR;
- if(yych != '-') goto yy53;
- goto yy1179;
-yy1179:
- YYDEBUG(1179, *YYCURSOR);
+ if(yych == 'T') goto yy1135;
+ goto yy825;
+yy1146:
+ YYDEBUG(1146, *YYCURSOR);
+ yyaccept = 21;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if(yych != '-') goto yy1124;
+ goto yy1147;
+yy1147:
+ YYDEBUG(1147, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '2'){
if(yych <= '/') goto yy53;
- if(yych >= '1') goto yy1181;
- goto yy1180;
+ if(yych >= '1') goto yy1149;
+ goto yy1148;
} else {
- if(yych <= '3') goto yy1182;
- if(yych <= '9') goto yy1162;
+ if(yych <= '3') goto yy1150;
+ if(yych <= '9') goto yy1130;
goto yy53;
}
-yy1180:
- YYDEBUG(1180, *YYCURSOR);
- yyaccept = 12;
+yy1148:
+ YYDEBUG(1148, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '9'){
- if(yych <= '/') goto yy860;
- if(yych <= '0') goto yy1162;
- goto yy1183;
+ if(yych <= '/') goto yy825;
+ if(yych <= '0') goto yy1130;
+ goto yy1151;
} else {
- if(yych == 'T') goto yy1167;
- goto yy860;
+ if(yych == 'T') goto yy1135;
+ goto yy825;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy1164;
- if(yych <= 'q') goto yy860;
- goto yy1165;
+ if(yych <= 'n') goto yy1132;
+ if(yych <= 'q') goto yy825;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy860;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy825;
}
}
-yy1181:
- YYDEBUG(1181, *YYCURSOR);
- yyaccept = 12;
+yy1149:
+ YYDEBUG(1149, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '9'){
- if(yych <= '/') goto yy860;
- goto yy1183;
+ if(yych <= '/') goto yy825;
+ goto yy1151;
} else {
- if(yych == 'T') goto yy1167;
- goto yy860;
+ if(yych == 'T') goto yy1135;
+ goto yy825;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy1164;
- if(yych <= 'q') goto yy860;
- goto yy1165;
+ if(yych <= 'n') goto yy1132;
+ if(yych <= 'q') goto yy825;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy860;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy825;
}
}
-yy1182:
- YYDEBUG(1182, *YYCURSOR);
- yyaccept = 12;
+yy1150:
+ YYDEBUG(1150, *YYCURSOR);
+ yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'm'){
if(yych <= '1'){
- if(yych <= '/') goto yy860;
- goto yy1183;
+ if(yych <= '/') goto yy825;
+ goto yy1151;
} else {
- if(yych == 'T') goto yy1167;
- goto yy860;
+ if(yych == 'T') goto yy1135;
+ goto yy825;
}
} else {
if(yych <= 'r'){
- if(yych <= 'n') goto yy1164;
- if(yych <= 'q') goto yy860;
- goto yy1165;
+ if(yych <= 'n') goto yy1132;
+ if(yych <= 'q') goto yy825;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy860;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy825;
}
}
-yy1183:
- YYDEBUG(1183, *YYCURSOR);
- yyaccept = 18;
+yy1151:
+ YYDEBUG(1151, *YYCURSOR);
+ yyaccept = 20;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'n'){
- if(yych == 'T') goto yy1184;
- if(yych <= 'm') goto yy1134;
- goto yy1164;
+ if(yych == 'T') goto yy1152;
+ if(yych <= 'm') goto yy1100;
+ goto yy1132;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy1134;
- goto yy1165;
+ if(yych <= 'q') goto yy1100;
+ goto yy1133;
} else {
- if(yych <= 's') goto yy1163;
- if(yych <= 't') goto yy1166;
- goto yy1134;
+ if(yych <= 's') goto yy1131;
+ if(yych <= 't') goto yy1134;
+ goto yy1100;
}
}
-yy1184:
- YYDEBUG(1184, *YYCURSOR);
+yy1152:
+ YYDEBUG(1152, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy1185;
- if(yych <= '2') goto yy1186;
- if(yych <= '9') goto yy1170;
+ if(yych <= '1') goto yy1153;
+ if(yych <= '2') goto yy1154;
+ if(yych <= '9') goto yy1138;
goto yy53;
-yy1185:
- YYDEBUG(1185, *YYCURSOR);
+yy1153:
+ YYDEBUG(1153, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1187;
- if(yych <= ':') goto yy1171;
+ if(yych <= '9') goto yy1155;
+ if(yych <= ':') goto yy1139;
goto yy53;
-yy1186:
- YYDEBUG(1186, *YYCURSOR);
+yy1154:
+ YYDEBUG(1154, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '3') goto yy1187;
- if(yych == ':') goto yy1171;
+ if(yych <= '3') goto yy1155;
+ if(yych == ':') goto yy1139;
goto yy53;
-yy1187:
- YYDEBUG(1187, *YYCURSOR);
+yy1155:
+ YYDEBUG(1155, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1188;
-yy1188:
- YYDEBUG(1188, *YYCURSOR);
+ goto yy1156;
+yy1156:
+ YYDEBUG(1156, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1189;
- if(yych <= '9') goto yy1173;
+ if(yych <= '5') goto yy1157;
+ if(yych <= '9') goto yy1141;
goto yy53;
-yy1189:
- YYDEBUG(1189, *YYCURSOR);
+yy1157:
+ YYDEBUG(1157, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1190;
- if(yych <= ':') goto yy1174;
+ if(yych <= '9') goto yy1158;
+ if(yych <= ':') goto yy1142;
goto yy53;
-yy1190:
- YYDEBUG(1190, *YYCURSOR);
+yy1158:
+ YYDEBUG(1158, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != ':') goto yy53;
- goto yy1191;
-yy1191:
- YYDEBUG(1191, *YYCURSOR);
+ goto yy1159;
+yy1159:
+ YYDEBUG(1159, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1192;
- if(yych <= '6') goto yy1193;
- if(yych <= '9') goto yy1025;
+ if(yych <= '5') goto yy1160;
+ if(yych <= '6') goto yy1161;
+ if(yych <= '9') goto yy991;
goto yy53;
-yy1192:
- YYDEBUG(1192, *YYCURSOR);
+yy1160:
+ YYDEBUG(1160, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '9') goto yy1194;
- goto yy1026;
-yy1193:
- YYDEBUG(1193, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '9') goto yy1162;
+ goto yy992;
+yy1161:
+ YYDEBUG(1161, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych != '0') goto yy1026;
- goto yy1194;
-yy1194:
- YYDEBUG(1194, *YYCURSOR);
- yyaccept = 19;
+ if(yych != '0') goto yy992;
+ goto yy1162;
+yy1162:
+ YYDEBUG(1162, *YYCURSOR);
+ yyaccept = 22;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych != '.') goto yy1026;
- goto yy1195;
-yy1195:
- YYDEBUG(1195, *YYCURSOR);
+ if(yych != '.') goto yy992;
+ goto yy1163;
+yy1163:
+ YYDEBUG(1163, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1196;
-yy1196:
- YYDEBUG(1196, *YYCURSOR);
- yyaccept = 19;
+ goto yy1164;
+yy1164:
+ YYDEBUG(1164, *YYCURSOR);
+ yyaccept = 22;
YYMARKER = ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
yych = *YYCURSOR;
- goto yy1197;
-yy1197:
- YYDEBUG(1197, *YYCURSOR);
+ goto yy1165;
+yy1165:
+ YYDEBUG(1165, *YYCURSOR);
if(yych <= ','){
- if(yych != '+') goto yy1026;
- goto yy1198;
+ if(yych != '+') goto yy992;
+ goto yy1166;
} else {
- if(yych <= '-') goto yy1198;
- if(yych <= '/') goto yy1026;
- if(yych <= '9') goto yy1196;
- goto yy1026;
+ if(yych <= '-') goto yy1166;
+ if(yych <= '/') goto yy992;
+ if(yych <= '9') goto yy1164;
+ goto yy992;
}
-yy1198:
- YYDEBUG(1198, *YYCURSOR);
+yy1166:
+ YYDEBUG(1166, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '1') goto yy1199;
- if(yych <= '2') goto yy1200;
- if(yych <= '9') goto yy1201;
+ if(yych <= '1') goto yy1167;
+ if(yych <= '2') goto yy1168;
+ if(yych <= '9') goto yy1169;
goto yy53;
-yy1199:
- YYDEBUG(1199, *YYCURSOR);
+yy1167:
+ YYDEBUG(1167, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '9') goto yy1201;
- if(yych <= ':') goto yy1202;
- goto yy1026;
-yy1200:
- YYDEBUG(1200, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '9') goto yy1169;
+ if(yych <= ':') goto yy1170;
+ goto yy992;
+yy1168:
+ YYDEBUG(1168, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '5'){
- if(yych <= '/') goto yy1026;
- if(yych >= '4') goto yy1203;
- goto yy1201;
+ if(yych <= '/') goto yy992;
+ if(yych >= '4') goto yy1171;
+ goto yy1169;
} else {
- if(yych <= '9') goto yy1025;
- if(yych <= ':') goto yy1202;
- goto yy1026;
+ if(yych <= '9') goto yy991;
+ if(yych <= ':') goto yy1170;
+ goto yy992;
}
-yy1201:
- YYDEBUG(1201, *YYCURSOR);
+yy1169:
+ YYDEBUG(1169, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '5') goto yy1203;
- if(yych <= '9') goto yy1025;
- if(yych >= ';') goto yy1026;
- goto yy1202;
-yy1202:
- YYDEBUG(1202, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '5') goto yy1171;
+ if(yych <= '9') goto yy991;
+ if(yych >= ';') goto yy992;
+ goto yy1170;
+yy1170:
+ YYDEBUG(1170, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '5') goto yy1203;
- if(yych <= '9') goto yy1025;
- goto yy1026;
-yy1203:
- YYDEBUG(1203, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '5') goto yy1171;
+ if(yych <= '9') goto yy991;
+ goto yy992;
+yy1171:
+ YYDEBUG(1171, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1026;
- if(yych <= '9') goto yy1025;
- goto yy1026;
-yy1204:
- YYDEBUG(1204, *YYCURSOR);
+ if(yych <= '/') goto yy992;
+ if(yych <= '9') goto yy991;
+ goto yy992;
+yy1172:
+ YYDEBUG(1172, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'C') goto yy1205;
+ if(yych == 'C') goto yy1173;
if(yych != 'c') goto yy53;
- goto yy1205;
-yy1205:
- YYDEBUG(1205, *YYCURSOR);
- yyaccept = 17;
+ goto yy1173;
+yy1173:
+ YYDEBUG(1173, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'E') goto yy1062;
- if(yych == 'e') goto yy1062;
- goto yy978;
+ if(yych <= 'E') goto yy1028;
+ if(yych == 'e') goto yy1028;
+ goto yy943;
}
-yy1206:
- YYDEBUG(1206, *YYCURSOR);
+yy1174:
+ YYDEBUG(1174, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'V') goto yy1207;
+ if(yych == 'V') goto yy1175;
if(yych != 'v') goto yy53;
- goto yy1207;
-yy1207:
- YYDEBUG(1207, *YYCURSOR);
- yyaccept = 17;
+ goto yy1175;
+yy1175:
+ YYDEBUG(1175, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'E') goto yy1069;
- if(yych == 'e') goto yy1069;
- goto yy978;
+ if(yych <= 'E') goto yy1035;
+ if(yych == 'e') goto yy1035;
+ goto yy943;
}
-yy1208:
- YYDEBUG(1208, *YYCURSOR);
+yy1176:
+ YYDEBUG(1176, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy1209;
+ if(yych == 'T') goto yy1177;
if(yych != 't') goto yy53;
- goto yy1209;
-yy1209:
- YYDEBUG(1209, *YYCURSOR);
- yyaccept = 17;
+ goto yy1177;
+yy1177:
+ YYDEBUG(1177, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'O') goto yy1075;
- if(yych == 'o') goto yy1075;
- goto yy978;
+ if(yych <= 'O') goto yy1041;
+ if(yych == 'o') goto yy1041;
+ goto yy943;
}
-yy1210:
- YYDEBUG(1210, *YYCURSOR);
+yy1178:
+ YYDEBUG(1178, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'P') goto yy1211;
+ if(yych == 'P') goto yy1179;
if(yych != 'p') goto yy53;
- goto yy1211;
-yy1211:
- YYDEBUG(1211, *YYCURSOR);
- yyaccept = 17;
+ goto yy1179;
+yy1179:
+ YYDEBUG(1179, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'T') goto yy1212;
- if(yych != 't') goto yy978;
- goto yy1212;
+ if(yych <= 'T') goto yy1180;
+ if(yych != 't') goto yy943;
+ goto yy1180;
}
-yy1212:
- YYDEBUG(1212, *YYCURSOR);
- yyaccept = 17;
+yy1180:
+ YYDEBUG(1180, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'E') goto yy1081;
- if(yych == 'e') goto yy1081;
- goto yy978;
+ if(yych <= 'E') goto yy1047;
+ if(yych == 'e') goto yy1047;
+ goto yy943;
}
-yy1213:
- YYDEBUG(1213, *YYCURSOR);
+yy1181:
+ YYDEBUG(1181, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'G') goto yy1216;
- if(yych == 'g') goto yy1216;
+ if(yych == 'G') goto yy1184;
+ if(yych == 'g') goto yy1184;
goto yy53;
-yy1214:
- YYDEBUG(1214, *YYCURSOR);
+yy1182:
+ YYDEBUG(1182, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy1215;
+ if(yych == 'R') goto yy1183;
if(yych != 'r') goto yy53;
- goto yy1215;
-yy1215:
- YYDEBUG(1215, *YYCURSOR);
- yyaccept = 17;
+ goto yy1183;
+yy1183:
+ YYDEBUG(1183, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'I') goto yy1088;
- if(yych == 'i') goto yy1088;
- goto yy978;
+ if(yych <= 'I') goto yy1054;
+ if(yych == 'i') goto yy1054;
+ goto yy943;
}
-yy1216:
- YYDEBUG(1216, *YYCURSOR);
- yyaccept = 17;
+yy1184:
+ YYDEBUG(1184, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'U') goto yy1090;
- if(yych == 'u') goto yy1090;
- goto yy978;
+ if(yych <= 'U') goto yy1056;
+ if(yych == 'u') goto yy1056;
+ goto yy943;
}
-yy1217:
- YYDEBUG(1217, *YYCURSOR);
+yy1185:
+ YYDEBUG(1185, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
- if(yych == 'R') goto yy1218;
+ if(yych == 'R') goto yy1186;
if(yych <= 'X') goto yy53;
- goto yy1219;
+ goto yy1187;
} else {
if(yych <= 'r'){
if(yych <= 'q') goto yy53;
- goto yy1218;
+ goto yy1186;
} else {
- if(yych == 'y') goto yy1219;
+ if(yych == 'y') goto yy1187;
goto yy53;
}
}
-yy1218:
- YYDEBUG(1218, *YYCURSOR);
- yyaccept = 17;
+yy1186:
+ YYDEBUG(1186, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'B'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'C') goto yy1094;
- if(yych == 'c') goto yy1094;
- goto yy978;
+ if(yych <= 'C') goto yy1060;
+ if(yych == 'c') goto yy1060;
+ goto yy943;
}
-yy1219:
- YYDEBUG(1219, *YYCURSOR);
- yyaccept = 17;
+yy1187:
+ YYDEBUG(1187, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '-') goto yy954;
- goto yy978;
-yy1220:
- YYDEBUG(1220, *YYCURSOR);
+ if(yych == '-') goto yy919;
+ goto yy943;
+yy1188:
+ YYDEBUG(1188, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'B') goto yy1221;
+ if(yych == 'B') goto yy1189;
if(yych != 'b') goto yy53;
- goto yy1221;
-yy1221:
- YYDEBUG(1221, *YYCURSOR);
- yyaccept = 17;
+ goto yy1189;
+yy1189:
+ YYDEBUG(1189, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Q'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'R') goto yy1097;
- if(yych == 'r') goto yy1097;
- goto yy978;
+ if(yych <= 'R') goto yy1063;
+ if(yych == 'r') goto yy1063;
+ goto yy943;
}
-yy1222:
- YYDEBUG(1222, *YYCURSOR);
+yy1190:
+ YYDEBUG(1190, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
- if(yych == 'L') goto yy1226;
+ if(yych == 'L') goto yy1194;
if(yych <= 'M') goto yy53;
- goto yy1225;
+ goto yy1193;
} else {
if(yych <= 'l'){
if(yych <= 'k') goto yy53;
- goto yy1226;
+ goto yy1194;
} else {
- if(yych == 'n') goto yy1225;
+ if(yych == 'n') goto yy1193;
goto yy53;
}
}
-yy1223:
- YYDEBUG(1223, *YYCURSOR);
+yy1191:
+ YYDEBUG(1191, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'N') goto yy1224;
+ if(yych == 'N') goto yy1192;
if(yych != 'n') goto yy53;
- goto yy1224;
-yy1224:
- YYDEBUG(1224, *YYCURSOR);
- yyaccept = 17;
+ goto yy1192;
+yy1192:
+ YYDEBUG(1192, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'U') goto yy1104;
- if(yych == 'u') goto yy1104;
- goto yy978;
+ if(yych <= 'U') goto yy1070;
+ if(yych == 'u') goto yy1070;
+ goto yy943;
}
-yy1225:
- YYDEBUG(1225, *YYCURSOR);
- yyaccept = 17;
+yy1193:
+ YYDEBUG(1193, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'E') goto yy1066;
- if(yych == 'e') goto yy1066;
- goto yy978;
+ if(yych <= 'E') goto yy1032;
+ if(yych == 'e') goto yy1032;
+ goto yy943;
}
-yy1226:
- YYDEBUG(1226, *YYCURSOR);
- yyaccept = 17;
+yy1194:
+ YYDEBUG(1194, *YYCURSOR);
+ yyaccept = 19;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'X'){
- if(yych == '-') goto yy954;
- goto yy978;
+ if(yych == '-') goto yy919;
+ goto yy943;
} else {
- if(yych <= 'Y') goto yy1066;
- if(yych == 'y') goto yy1066;
- goto yy978;
+ if(yych <= 'Y') goto yy1032;
+ if(yych == 'y') goto yy1032;
+ goto yy943;
}
-yy1227:
- YYDEBUG(1227, *YYCURSOR);
+yy1195:
+ YYDEBUG(1195, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/'){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy784;
- goto yy931;
+ if(yych <= 0x08) goto yy749;
+ goto yy896;
} else {
- if(yych <= ',') goto yy784;
- if(yych <= '.') goto yy931;
- goto yy930;
+ if(yych <= ',') goto yy749;
+ if(yych <= '.') goto yy896;
+ goto yy895;
}
} else {
if(yych <= 'U'){
- if(yych <= 'T') goto yy784;
+ if(yych <= 'T') goto yy749;
goto yy74;
} else {
if(yych == 'u') goto yy74;
- goto yy784;
+ goto yy749;
}
}
-yy1228:
- YYDEBUG(1228, *YYCURSOR);
+yy1196:
+ YYDEBUG(1196, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'P'){
- if(yych == 'C') goto yy121;
+ if(yych == 'C') goto yy125;
if(yych <= 'O') goto yy53;
- goto yy792;
+ goto yy757;
} else {
if(yych <= 'c'){
if(yych <= 'b') goto yy53;
- goto yy121;
+ goto yy125;
} else {
- if(yych == 'p') goto yy792;
+ if(yych == 'p') goto yy757;
goto yy53;
}
}
-yy1229:
- YYDEBUG(1229, *YYCURSOR);
+yy1197:
+ YYDEBUG(1197, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '9'){
if(yych <= ','){
- if(yych != 0x09) goto yy1232;
- goto yy1230;
+ if(yych != 0x09) goto yy1200;
+ goto yy1198;
} else {
- if(yych <= '-') goto yy695;
- if(yych <= '.') goto yy931;
- if(yych <= '/') goto yy930;
- goto yy935;
+ if(yych <= '-') goto yy660;
+ if(yych <= '.') goto yy896;
+ if(yych <= '/') goto yy895;
+ goto yy900;
}
} else {
if(yych <= 'q'){
- if(yych == 'n') goto yy692;
- goto yy1232;
+ if(yych == 'n') goto yy657;
+ goto yy1200;
} else {
- if(yych <= 'r') goto yy693;
- if(yych <= 's') goto yy686;
- if(yych <= 't') goto yy690;
- goto yy1232;
+ if(yych <= 'r') goto yy658;
+ if(yych <= 's') goto yy651;
+ if(yych <= 't') goto yy655;
+ goto yy1200;
}
}
-yy1230:
- YYDEBUG(1230, *YYCURSOR);
+yy1198:
+ YYDEBUG(1198, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '/') goto yy1232;
- if(yych <= '0') goto yy932;
- if(yych <= '1') goto yy933;
- if(yych <= '9') goto yy934;
- goto yy1232;
-yy1231:
- YYDEBUG(1231, *YYCURSOR);
+ if(yych <= '/') goto yy1200;
+ if(yych <= '0') goto yy897;
+ if(yych <= '1') goto yy898;
+ if(yych <= '9') goto yy899;
+ goto yy1200;
+yy1199:
+ YYDEBUG(1199, *YYCURSOR);
++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
yych = *YYCURSOR;
- goto yy1232;
-yy1232:
- YYDEBUG(1232, *YYCURSOR);
+ goto yy1200;
+yy1200:
+ YYDEBUG(1200, *YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
- case 0x09: case ' ': goto yy1231;
+ case 0x09: case ' ': goto yy1199;
case '-':
- case '.': goto yy783;
- case 'A': case 'a': goto yy780;
- case 'D': case 'd': goto yy688;
- case 'F': case 'f': goto yy689;
+ case '.': goto yy748;
+ case 'A': case 'a': goto yy745;
+ case 'D': case 'd': goto yy653;
+ case 'F': case 'f': goto yy654;
case 'H': case 'h': goto yy60;
- case 'I': goto yy697;
- case 'J': case 'j': goto yy701;
- case 'M': case 'm': goto yy687;
- case 'N': case 'n': goto yy704;
- case 'O': case 'o': goto yy703;
- case 'S': case 's': goto yy685;
+ case 'I': goto yy662;
+ case 'J': case 'j': goto yy666;
+ case 'M': case 'm': goto yy652;
+ case 'N': case 'n': goto yy669;
+ case 'O': case 'o': goto yy668;
+ case 'S': case 's': goto yy650;
case 'T': case 't': goto yy65;
- case 'V': goto yy699;
+ case 'V': goto yy664;
case 'W': case 'w': goto yy62;
- case 'X': goto yy700;
+ case 'X': goto yy665;
case 'Y': case 'y': goto yy64;
default: goto yy53;
}
-yy1233:
- YYDEBUG(1233, *YYCURSOR);
+yy1201:
+ YYDEBUG(1201, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '9'){
if(yych <= '-'){
- if(yych == 0x09) goto yy1230;
- if(yych <= ',') goto yy1232;
- goto yy695;
+ if(yych == 0x09) goto yy1198;
+ if(yych <= ',') goto yy1200;
+ goto yy660;
} else {
- if(yych <= '.') goto yy1234;
- if(yych <= '/') goto yy930;
- if(yych <= '5') goto yy1236;
- goto yy935;
+ if(yych <= '.') goto yy1202;
+ if(yych <= '/') goto yy895;
+ if(yych <= '5') goto yy1204;
+ goto yy900;
}
} else {
if(yych <= 'q'){
- if(yych <= ':') goto yy1235;
- if(yych == 'n') goto yy692;
- goto yy1232;
+ if(yych <= ':') goto yy1203;
+ if(yych == 'n') goto yy657;
+ goto yy1200;
} else {
- if(yych <= 'r') goto yy693;
- if(yych <= 's') goto yy686;
- if(yych <= 't') goto yy690;
- goto yy1232;
+ if(yych <= 'r') goto yy658;
+ if(yych <= 's') goto yy651;
+ if(yych <= 't') goto yy655;
+ goto yy1200;
}
}
-yy1234:
- YYDEBUG(1234, *YYCURSOR);
+yy1202:
+ YYDEBUG(1202, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '1'){
- if(yych <= '/') goto yy784;
- if(yych <= '0') goto yy1258;
- goto yy1259;
+ if(yych <= '/') goto yy749;
+ if(yych <= '0') goto yy1226;
+ goto yy1227;
} else {
- if(yych <= '5') goto yy1260;
- if(yych <= '9') goto yy1261;
- goto yy784;
+ if(yych <= '5') goto yy1228;
+ if(yych <= '9') goto yy1229;
+ goto yy749;
}
-yy1235:
- YYDEBUG(1235, *YYCURSOR);
+yy1203:
+ YYDEBUG(1203, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1253;
- if(yych <= '9') goto yy1254;
+ if(yych <= '5') goto yy1221;
+ if(yych <= '9') goto yy1222;
goto yy53;
-yy1236:
- YYDEBUG(1236, *YYCURSOR);
+yy1204:
+ YYDEBUG(1204, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '-') goto yy936;
+ if(yych == '-') goto yy901;
if(yych <= '/') goto yy57;
if(yych >= ':') goto yy57;
- goto yy1237;
-yy1237:
- YYDEBUG(1237, *YYCURSOR);
- yyaccept = 20;
+ goto yy1205;
+yy1205:
+ YYDEBUG(1205, *YYCURSOR);
+ yyaccept = 23;
yych = *(YYMARKER = ++YYCURSOR);
YYDEBUG(-1, yych);
switch(yych){
@@ -18655,28 +18191,28 @@ yy1237:
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 yy975;
- case '-': goto yy972;
- case '.': goto yy976;
- case '/': goto yy973;
- case '0': goto yy1239;
- case '1': goto yy1240;
- case '2': goto yy1241;
- case '3': goto yy1242;
+ case 't': case 'w': case 'y': goto yy940;
+ case '-': goto yy937;
+ case '.': goto yy941;
+ case '/': goto yy938;
+ case '0': goto yy1207;
+ case '1': goto yy1208;
+ case '2': goto yy1209;
+ case '3': goto yy1210;
case '4':
- case '5': goto yy1243;
- case '6': goto yy1244;
+ case '5': goto yy1211;
+ case '6': goto yy1212;
case '7':
case '8':
case '9': goto yy51;
- case ':': goto yy991;
- case 'W': goto yy994;
- default: goto yy1238;
+ case ':': goto yy956;
+ case 'W': goto yy959;
+ default: goto yy1206;
}
-yy1238:
- YYDEBUG(1238, *YYCURSOR);
+yy1206:
+ YYDEBUG(1206, *YYCURSOR);
-#line 992 "ext/date/lib/parse_date.re"
+#line 1006 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
@@ -18698,51 +18234,51 @@ yy1238:
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
-#line 16201 "ext/date/lib/parse_date.c"
-yy1239:
- YYDEBUG(1239, *YYCURSOR);
+#line 15806 "ext/date/lib/parse_date.c"
+yy1207:
+ YYDEBUG(1207, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '0') goto yy1251;
- if(yych <= '9') goto yy1252;
+ if(yych <= '0') goto yy1219;
+ if(yych <= '9') goto yy1220;
goto yy57;
-yy1240:
- YYDEBUG(1240, *YYCURSOR);
+yy1208:
+ YYDEBUG(1208, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '2') goto yy1250;
- if(yych <= '9') goto yy1249;
+ if(yych <= '2') goto yy1218;
+ if(yych <= '9') goto yy1217;
goto yy57;
-yy1241:
- YYDEBUG(1241, *YYCURSOR);
+yy1209:
+ YYDEBUG(1209, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy1249;
+ if(yych <= '9') goto yy1217;
goto yy57;
-yy1242:
- YYDEBUG(1242, *YYCURSOR);
+yy1210:
+ YYDEBUG(1210, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '5') goto yy1247;
- if(yych <= '6') goto yy1248;
- if(yych <= '9') goto yy1245;
+ if(yych <= '5') goto yy1215;
+ if(yych <= '6') goto yy1216;
+ if(yych <= '9') goto yy1213;
goto yy57;
-yy1243:
- YYDEBUG(1243, *YYCURSOR);
+yy1211:
+ YYDEBUG(1211, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '9') goto yy1245;
+ if(yych <= '9') goto yy1213;
goto yy57;
-yy1244:
- YYDEBUG(1244, *YYCURSOR);
+yy1212:
+ YYDEBUG(1212, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy57;
- if(yych <= '0') goto yy1245;
+ if(yych <= '0') goto yy1213;
if(yych <= '9') goto yy51;
goto yy57;
-yy1245:
- YYDEBUG(1245, *YYCURSOR);
- yyaccept = 21;
+yy1213:
+ YYDEBUG(1213, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yybm[0+yych] & 8) {
goto yy51;
@@ -18752,22 +18288,22 @@ yy1245:
if(yych <= ' '){
if(yych == 0x09) goto yy57;
if(yych >= ' ') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych == 'D') goto yy57;
if(yych >= 'F') goto yy57;
- goto yy1246;
+ goto yy1214;
}
} else {
if(yych <= 'M'){
if(yych == 'H') goto yy57;
if(yych >= 'M') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
if(yych <= 'T') goto yy57;
if(yych >= 'W') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
} else {
@@ -18775,32 +18311,32 @@ yy1245:
if(yych <= 'd'){
if(yych == 'Y') goto yy57;
if(yych >= 'd') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych == 'f') goto yy57;
if(yych >= 'h') goto yy57;
- goto yy1246;
+ goto yy1214;
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
if(yych >= 's') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'w'){
if(yych >= 'w') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1246:
- YYDEBUG(1246, *YYCURSOR);
+yy1214:
+ YYDEBUG(1214, *YYCURSOR);
-#line 1038 "ext/date/lib/parse_date.re"
+#line 1052 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
@@ -18819,236 +18355,236 @@ yy1246:
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
-#line 16306 "ext/date/lib/parse_date.c"
-yy1247:
- YYDEBUG(1247, *YYCURSOR);
- yyaccept = 21;
+#line 15911 "ext/date/lib/parse_date.c"
+yy1215:
+ YYDEBUG(1215, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1246;
+ if(yych <= 0x1F) goto yy1214;
goto yy57;
} else {
- if(yych <= '/') goto yy1246;
- if(yych <= '9') goto yy1004;
- if(yych <= 'C') goto yy1246;
+ if(yych <= '/') goto yy1214;
+ if(yych <= '9') goto yy970;
+ if(yych <= 'C') goto yy1214;
goto yy57;
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1246;
+ if(yych <= 'G') goto yy1214;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1246;
+ if(yych <= 'L') goto yy1214;
goto yy57;
} else {
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
if(yych <= 'T') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1246;
+ if(yych == 'X') goto yy1214;
if(yych <= 'Y') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
- if(yych == 'g') goto yy1246;
+ if(yych == 'g') goto yy1214;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1246;
+ if(yych <= 'r') goto yy1214;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1246;
+ if(yych <= 'v') goto yy1214;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1248:
- YYDEBUG(1248, *YYCURSOR);
- yyaccept = 21;
+yy1216:
+ YYDEBUG(1216, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1246;
+ if(yych <= 0x1F) goto yy1214;
goto yy57;
} else {
if(yych <= '6'){
- if(yych <= '/') goto yy1246;
- goto yy1004;
+ if(yych <= '/') goto yy1214;
+ goto yy970;
} else {
if(yych <= '9') goto yy51;
- if(yych <= 'C') goto yy1246;
+ if(yych <= 'C') goto yy1214;
goto yy57;
}
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1246;
+ if(yych <= 'G') goto yy1214;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1246;
+ if(yych <= 'L') goto yy1214;
goto yy57;
} else {
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
if(yych <= 'T') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1246;
+ if(yych == 'X') goto yy1214;
if(yych <= 'Y') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
- if(yych == 'g') goto yy1246;
+ if(yych == 'g') goto yy1214;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1246;
+ if(yych <= 'r') goto yy1214;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1246;
+ if(yych <= 'v') goto yy1214;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1249:
- YYDEBUG(1249, *YYCURSOR);
- yyaccept = 21;
+yy1217:
+ YYDEBUG(1217, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1246;
+ if(yych <= 0x1F) goto yy1214;
goto yy57;
} else {
- if(yych <= '/') goto yy1246;
- if(yych <= '9') goto yy1004;
- if(yych <= 'C') goto yy1246;
+ if(yych <= '/') goto yy1214;
+ if(yych <= '9') goto yy970;
+ if(yych <= 'C') goto yy1214;
goto yy57;
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1246;
+ if(yych <= 'G') goto yy1214;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1246;
+ if(yych <= 'L') goto yy1214;
goto yy57;
} else {
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
if(yych <= 'T') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1246;
+ if(yych == 'X') goto yy1214;
if(yych <= 'Y') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
- if(yych == 'g') goto yy1246;
+ if(yych == 'g') goto yy1214;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1246;
+ if(yych <= 'r') goto yy1214;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1246;
+ if(yych <= 'v') goto yy1214;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1250:
- YYDEBUG(1250, *YYCURSOR);
- yyaccept = 21;
+yy1218:
+ YYDEBUG(1218, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '9'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1246;
+ if(yych <= 0x1F) goto yy1214;
goto yy57;
} else {
if(yych <= '0'){
- if(yych <= '/') goto yy1246;
- goto yy1028;
+ if(yych <= '/') goto yy1214;
+ goto yy994;
} else {
- if(yych <= '2') goto yy1029;
- if(yych <= '3') goto yy1030;
- goto yy1004;
+ if(yych <= '2') goto yy995;
+ if(yych <= '3') goto yy996;
+ goto yy970;
}
}
} else {
if(yych <= 'G'){
if(yych <= 'D'){
- if(yych <= 'C') goto yy1246;
+ if(yych <= 'C') goto yy1214;
goto yy57;
} else {
if(yych == 'F') goto yy57;
- goto yy1246;
+ goto yy1214;
}
} else {
if(yych <= 'L'){
if(yych <= 'H') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'M') goto yy57;
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
goto yy57;
}
}
@@ -19057,141 +18593,141 @@ yy1250:
if(yych <= 'g'){
if(yych <= 'Y'){
if(yych == 'W') goto yy57;
- if(yych <= 'X') goto yy1246;
+ if(yych <= 'X') goto yy1214;
goto yy57;
} else {
if(yych <= 'd'){
- if(yych <= 'c') goto yy1246;
+ if(yych <= 'c') goto yy1214;
goto yy57;
} else {
if(yych == 'f') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
} else {
if(yych <= 't'){
if(yych <= 'l'){
if(yych <= 'h') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'm') goto yy57;
- if(yych <= 'r') goto yy1246;
+ if(yych <= 'r') goto yy1214;
goto yy57;
}
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1246;
+ if(yych <= 'v') goto yy1214;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1251:
- YYDEBUG(1251, *YYCURSOR);
- yyaccept = 21;
+yy1219:
+ YYDEBUG(1219, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'V'){
if(yych <= 'D'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1246;
+ if(yych <= 0x1F) goto yy1214;
goto yy57;
} else {
if(yych <= '0'){
- if(yych <= '/') goto yy1246;
+ if(yych <= '/') goto yy1214;
goto yy51;
} else {
- if(yych <= '9') goto yy1004;
- if(yych <= 'C') goto yy1246;
+ if(yych <= '9') goto yy970;
+ if(yych <= 'C') goto yy1214;
goto yy57;
}
}
} else {
if(yych <= 'H'){
if(yych == 'F') goto yy57;
- if(yych <= 'G') goto yy1246;
+ if(yych <= 'G') goto yy1214;
goto yy57;
} else {
if(yych <= 'M'){
- if(yych <= 'L') goto yy1246;
+ if(yych <= 'L') goto yy1214;
goto yy57;
} else {
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
if(yych <= 'T') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
} else {
if(yych <= 'h'){
if(yych <= 'c'){
- if(yych == 'X') goto yy1246;
+ if(yych == 'X') goto yy1214;
if(yych <= 'Y') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'e'){
if(yych <= 'd') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
- if(yych == 'g') goto yy1246;
+ if(yych == 'g') goto yy1214;
goto yy57;
}
}
} else {
if(yych <= 't'){
if(yych == 'm') goto yy57;
- if(yych <= 'r') goto yy1246;
+ if(yych <= 'r') goto yy1214;
goto yy57;
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1246;
+ if(yych <= 'v') goto yy1214;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1252:
- YYDEBUG(1252, *YYCURSOR);
- yyaccept = 21;
+yy1220:
+ YYDEBUG(1220, *YYCURSOR);
+ yyaccept = 24;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '9'){
if(yych <= ' '){
if(yych == 0x09) goto yy57;
- if(yych <= 0x1F) goto yy1246;
+ if(yych <= 0x1F) goto yy1214;
goto yy57;
} else {
if(yych <= '0'){
- if(yych <= '/') goto yy1246;
- goto yy1028;
+ if(yych <= '/') goto yy1214;
+ goto yy994;
} else {
- if(yych <= '2') goto yy1029;
- if(yych <= '3') goto yy1030;
- goto yy1004;
+ if(yych <= '2') goto yy995;
+ if(yych <= '3') goto yy996;
+ goto yy970;
}
}
} else {
if(yych <= 'G'){
if(yych <= 'D'){
- if(yych <= 'C') goto yy1246;
+ if(yych <= 'C') goto yy1214;
goto yy57;
} else {
if(yych == 'F') goto yy57;
- goto yy1246;
+ goto yy1214;
}
} else {
if(yych <= 'L'){
if(yych <= 'H') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'M') goto yy57;
- if(yych <= 'R') goto yy1246;
+ if(yych <= 'R') goto yy1214;
goto yy57;
}
}
@@ -19200,244 +18736,244 @@ yy1252:
if(yych <= 'g'){
if(yych <= 'Y'){
if(yych == 'W') goto yy57;
- if(yych <= 'X') goto yy1246;
+ if(yych <= 'X') goto yy1214;
goto yy57;
} else {
if(yych <= 'd'){
- if(yych <= 'c') goto yy1246;
+ if(yych <= 'c') goto yy1214;
goto yy57;
} else {
if(yych == 'f') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
} else {
if(yych <= 't'){
if(yych <= 'l'){
if(yych <= 'h') goto yy57;
- goto yy1246;
+ goto yy1214;
} else {
if(yych <= 'm') goto yy57;
- if(yych <= 'r') goto yy1246;
+ if(yych <= 'r') goto yy1214;
goto yy57;
}
} else {
if(yych <= 'w'){
- if(yych <= 'v') goto yy1246;
+ if(yych <= 'v') goto yy1214;
goto yy57;
} else {
if(yych == 'y') goto yy57;
- goto yy1246;
+ goto yy1214;
}
}
}
}
-yy1253:
- YYDEBUG(1253, *YYCURSOR);
- yyaccept = 11;
+yy1221:
+ YYDEBUG(1221, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy1255;
- goto yy713;
+ if(yych == '.') goto yy1223;
+ goto yy678;
} else {
- if(yych <= '9') goto yy1254;
- if(yych <= ':') goto yy1255;
- goto yy713;
+ if(yych <= '9') goto yy1222;
+ if(yych <= ':') goto yy1223;
+ goto yy678;
}
-yy1254:
- YYDEBUG(1254, *YYCURSOR);
- yyaccept = 11;
+yy1222:
+ YYDEBUG(1222, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy1255;
- if(yych != ':') goto yy713;
- goto yy1255;
-yy1255:
- YYDEBUG(1255, *YYCURSOR);
+ if(yych == '.') goto yy1223;
+ if(yych != ':') goto yy678;
+ goto yy1223;
+yy1223:
+ YYDEBUG(1223, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1256;
- if(yych <= '6') goto yy1257;
- if(yych <= '9') goto yy718;
+ if(yych <= '5') goto yy1224;
+ if(yych <= '6') goto yy1225;
+ if(yych <= '9') goto yy683;
goto yy53;
-yy1256:
- YYDEBUG(1256, *YYCURSOR);
- yyaccept = 11;
+yy1224:
+ YYDEBUG(1224, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy718;
- goto yy713;
-yy1257:
- YYDEBUG(1257, *YYCURSOR);
- yyaccept = 11;
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy683;
+ goto yy678;
+yy1225:
+ YYDEBUG(1225, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych == '0') goto yy718;
- goto yy713;
-yy1258:
- YYDEBUG(1258, *YYCURSOR);
- yyaccept = 11;
+ if(yych == '.') goto yy684;
+ if(yych == '0') goto yy683;
+ goto yy678;
+yy1226:
+ YYDEBUG(1226, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- goto yy1262;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ goto yy1230;
} else {
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy1261;
- if(yych <= ':') goto yy1255;
- goto yy713;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy1229;
+ if(yych <= ':') goto yy1223;
+ goto yy678;
}
-yy1259:
- YYDEBUG(1259, *YYCURSOR);
- yyaccept = 11;
+yy1227:
+ YYDEBUG(1227, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- if(yych <= '.') goto yy1262;
- goto yy713;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ if(yych <= '.') goto yy1230;
+ goto yy678;
} else {
- if(yych <= '2') goto yy1261;
- if(yych <= '9') goto yy1254;
- if(yych <= ':') goto yy1255;
- goto yy713;
+ if(yych <= '2') goto yy1229;
+ if(yych <= '9') goto yy1222;
+ if(yych <= ':') goto yy1223;
+ goto yy678;
}
-yy1260:
- YYDEBUG(1260, *YYCURSOR);
- yyaccept = 11;
+yy1228:
+ YYDEBUG(1228, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- goto yy1262;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ goto yy1230;
} else {
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy1254;
- if(yych <= ':') goto yy1255;
- goto yy713;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy1222;
+ if(yych <= ':') goto yy1223;
+ goto yy678;
}
-yy1261:
- YYDEBUG(1261, *YYCURSOR);
- yyaccept = 11;
+yy1229:
+ YYDEBUG(1229, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
- if(yych <= ',') goto yy713;
- if(yych <= '-') goto yy807;
- goto yy1262;
+ if(yych <= ',') goto yy678;
+ if(yych <= '-') goto yy772;
+ goto yy1230;
} else {
- if(yych == ':') goto yy1255;
- goto yy713;
+ if(yych == ':') goto yy1223;
+ goto yy678;
}
-yy1262:
- YYDEBUG(1262, *YYCURSOR);
+yy1230:
+ YYDEBUG(1230, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '5') goto yy1263;
- if(yych <= '6') goto yy1264;
- if(yych <= '9') goto yy811;
+ if(yych <= '5') goto yy1231;
+ if(yych <= '6') goto yy1232;
+ if(yych <= '9') goto yy776;
goto yy53;
-yy1263:
- YYDEBUG(1263, *YYCURSOR);
- yyaccept = 11;
+yy1231:
+ YYDEBUG(1231, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy1265;
- goto yy713;
-yy1264:
- YYDEBUG(1264, *YYCURSOR);
- yyaccept = 11;
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy1233;
+ goto yy678;
+yy1232:
+ YYDEBUG(1232, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
- if(yych == '.') goto yy719;
- goto yy713;
+ if(yych == '.') goto yy684;
+ goto yy678;
} else {
- if(yych <= '0') goto yy1265;
- if(yych <= '9') goto yy812;
- goto yy713;
+ if(yych <= '0') goto yy1233;
+ if(yych <= '9') goto yy777;
+ goto yy678;
}
-yy1265:
- YYDEBUG(1265, *YYCURSOR);
- yyaccept = 11;
+yy1233:
+ YYDEBUG(1233, *YYCURSOR);
+ yyaccept = 12;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych == '.') goto yy719;
- if(yych <= '/') goto yy713;
- if(yych <= '9') goto yy814;
- goto yy713;
-yy1266:
- YYDEBUG(1266, *YYCURSOR);
+ if(yych == '.') goto yy684;
+ if(yych <= '/') goto yy678;
+ if(yych <= '9') goto yy779;
+ goto yy678;
+yy1234:
+ YYDEBUG(1234, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '9'){
if(yych <= '-'){
- if(yych == 0x09) goto yy682;
- if(yych <= ',') goto yy684;
- goto yy695;
+ if(yych == 0x09) goto yy647;
+ if(yych <= ',') goto yy649;
+ goto yy660;
} else {
- if(yych <= '.') goto yy696;
- if(yych <= '/') goto yy694;
- if(yych <= '5') goto yy1236;
- goto yy935;
+ if(yych <= '.') goto yy661;
+ if(yych <= '/') goto yy659;
+ if(yych <= '5') goto yy1204;
+ goto yy900;
}
} else {
if(yych <= 'q'){
- if(yych <= ':') goto yy705;
- if(yych == 'n') goto yy692;
- goto yy684;
+ if(yych <= ':') goto yy670;
+ if(yych == 'n') goto yy657;
+ goto yy649;
} else {
- if(yych <= 'r') goto yy693;
- if(yych <= 's') goto yy686;
- if(yych <= 't') goto yy690;
- goto yy684;
+ if(yych <= 'r') goto yy658;
+ if(yych <= 's') goto yy651;
+ if(yych <= 't') goto yy655;
+ goto yy649;
}
}
-yy1267:
- YYDEBUG(1267, *YYCURSOR);
+yy1235:
+ YYDEBUG(1235, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '9'){
if(yych <= '-'){
- if(yych == 0x09) goto yy1230;
- if(yych <= ',') goto yy1232;
- goto yy695;
+ if(yych == 0x09) goto yy1198;
+ if(yych <= ',') goto yy1200;
+ goto yy660;
} else {
- if(yych <= '.') goto yy1234;
- if(yych <= '/') goto yy694;
- if(yych <= '5') goto yy1236;
- goto yy935;
+ if(yych <= '.') goto yy1202;
+ if(yych <= '/') goto yy659;
+ if(yych <= '5') goto yy1204;
+ goto yy900;
}
} else {
if(yych <= 'q'){
- if(yych <= ':') goto yy1235;
- if(yych == 'n') goto yy692;
- goto yy1232;
+ if(yych <= ':') goto yy1203;
+ if(yych == 'n') goto yy657;
+ goto yy1200;
} else {
- if(yych <= 'r') goto yy693;
- if(yych <= 's') goto yy686;
- if(yych <= 't') goto yy690;
- goto yy1232;
+ if(yych <= 'r') goto yy658;
+ if(yych <= 's') goto yy651;
+ if(yych <= 't') goto yy655;
+ goto yy1200;
}
}
-yy1268:
- YYDEBUG(1268, *YYCURSOR);
+yy1236:
+ YYDEBUG(1236, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1269;
-yy1269:
- YYDEBUG(1269, *YYCURSOR);
+ goto yy1237;
+yy1237:
+ YYDEBUG(1237, *YYCURSOR);
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy1270;
-yy1270:
- YYDEBUG(1270, *YYCURSOR);
- if(yych <= '/') goto yy1271;
- if(yych <= '9') goto yy1269;
- goto yy1271;
-yy1271:
- YYDEBUG(1271, *YYCURSOR);
+ goto yy1238;
+yy1238:
+ YYDEBUG(1238, *YYCURSOR);
+ if(yych <= '/') goto yy1239;
+ if(yych <= '9') goto yy1237;
+ goto yy1239;
+yy1239:
+ YYDEBUG(1239, *YYCURSOR);
-#line 925 "ext/date/lib/parse_date.re"
+#line 939 "ext/date/lib/parse_date.re"
{
timelib_ull i;
@@ -19460,459 +18996,459 @@ yy1271:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 16897 "ext/date/lib/parse_date.c"
-yy1272:
- YYDEBUG(1272, *YYCURSOR);
+#line 16502 "ext/date/lib/parse_date.c"
+yy1240:
+ YYDEBUG(1240, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy1312;
+ if(yych <= 'M') goto yy138;
+ goto yy1280;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'n') goto yy1312;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'n') goto yy1280;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1273:
- YYDEBUG(1273, *YYCURSOR);
+yy1241:
+ YYDEBUG(1241, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'U'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'I') goto yy1306;
- if(yych <= 'T') goto yy134;
- goto yy1305;
+ if(yych == 'I') goto yy1274;
+ if(yych <= 'T') goto yy138;
+ goto yy1273;
}
} else {
if(yych <= 'i'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- if(yych <= 'h') goto yy134;
- goto yy1306;
+ if(yych <= 'h') goto yy138;
+ goto yy1274;
} else {
- if(yych == 'u') goto yy1305;
- if(yych <= 'z') goto yy134;
+ if(yych == 'u') goto yy1273;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1274:
- YYDEBUG(1274, *YYCURSOR);
+yy1242:
+ YYDEBUG(1242, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'M'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'D') goto yy1294;
- if(yych <= 'L') goto yy134;
- goto yy1295;
+ if(yych == 'D') goto yy1262;
+ if(yych <= 'L') goto yy138;
+ goto yy1263;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- if(yych <= 'c') goto yy134;
- goto yy1294;
+ if(yych <= 'c') goto yy138;
+ goto yy1262;
} else {
- if(yych == 'm') goto yy1295;
- if(yych <= 'z') goto yy134;
+ if(yych == 'm') goto yy1263;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1275:
- YYDEBUG(1275, *YYCURSOR);
+yy1243:
+ YYDEBUG(1243, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy1290;
+ if(yych <= 'D') goto yy138;
+ goto yy1258;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'e') goto yy1290;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'e') goto yy1258;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1276:
- YYDEBUG(1276, *YYCURSOR);
+yy1244:
+ YYDEBUG(1244, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy1286;
+ if(yych <= 'D') goto yy138;
+ goto yy1254;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'e') goto yy1286;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'e') goto yy1254;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1277:
- YYDEBUG(1277, *YYCURSOR);
+yy1245:
+ YYDEBUG(1245, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/'){
- if(yych == '.') goto yy1235;
+ if(yych == '.') goto yy1203;
goto yy53;
} else {
- if(yych <= '9') goto yy1280;
- if(yych <= ':') goto yy1235;
+ if(yych <= '9') goto yy1248;
+ if(yych <= ':') goto yy1203;
goto yy53;
}
-yy1278:
- YYDEBUG(1278, *YYCURSOR);
+yy1246:
+ YYDEBUG(1246, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/'){
- if(yych == '.') goto yy1235;
+ if(yych == '.') goto yy1203;
goto yy53;
} else {
- if(yych <= '3') goto yy1280;
- if(yych == ':') goto yy1235;
+ if(yych <= '3') goto yy1248;
+ if(yych == ':') goto yy1203;
goto yy53;
}
-yy1279:
- YYDEBUG(1279, *YYCURSOR);
+yy1247:
+ YYDEBUG(1247, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == '.') goto yy1235;
- if(yych == ':') goto yy1235;
+ if(yych == '.') goto yy1203;
+ if(yych == ':') goto yy1203;
goto yy53;
-yy1280:
- YYDEBUG(1280, *YYCURSOR);
+yy1248:
+ YYDEBUG(1248, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/'){
- if(yych == '.') goto yy1235;
+ if(yych == '.') goto yy1203;
goto yy53;
} else {
- if(yych <= '5') goto yy1281;
- if(yych == ':') goto yy1235;
+ if(yych <= '5') goto yy1249;
+ if(yych == ':') goto yy1203;
goto yy53;
}
-yy1281:
- YYDEBUG(1281, *YYCURSOR);
+yy1249:
+ YYDEBUG(1249, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
if(yych >= ':') goto yy53;
- goto yy1282;
-yy1282:
- YYDEBUG(1282, *YYCURSOR);
- yyaccept = 20;
+ goto yy1250;
+yy1250:
+ YYDEBUG(1250, *YYCURSOR);
+ yyaccept = 23;
yych = *(YYMARKER = ++YYCURSOR);
- if(yych <= '/') goto yy1238;
- if(yych <= '5') goto yy1283;
- if(yych <= '6') goto yy1284;
- goto yy1238;
-yy1283:
- YYDEBUG(1283, *YYCURSOR);
+ if(yych <= '/') goto yy1206;
+ if(yych <= '5') goto yy1251;
+ if(yych <= '6') goto yy1252;
+ goto yy1206;
+yy1251:
+ YYDEBUG(1251, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= '/') goto yy53;
- if(yych <= '9') goto yy1285;
+ if(yych <= '9') goto yy1253;
goto yy53;
-yy1284:
- YYDEBUG(1284, *YYCURSOR);
+yy1252:
+ YYDEBUG(1252, *YYCURSOR);
yych = *++YYCURSOR;
if(yych != '0') goto yy53;
- goto yy1285;
-yy1285:
- YYDEBUG(1285, *YYCURSOR);
+ goto yy1253;
+yy1253:
+ YYDEBUG(1253, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy1246;
-yy1286:
- YYDEBUG(1286, *YYCURSOR);
+ goto yy1214;
+yy1254:
+ YYDEBUG(1254, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'L'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'K') goto yy135;
- goto yy1287;
+ if(yych <= 'K') goto yy139;
+ goto yy1255;
}
} else {
if(yych <= 'k'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'l') goto yy1287;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'l') goto yy1255;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1287:
- YYDEBUG(1287, *YYCURSOR);
+yy1255:
+ YYDEBUG(1255, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'F'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'E') goto yy136;
- goto yy1288;
+ if(yych <= 'E') goto yy140;
+ goto yy1256;
}
} else {
if(yych <= 'e'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'f') goto yy1288;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'f') goto yy1256;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1288:
- YYDEBUG(1288, *YYCURSOR);
+yy1256:
+ YYDEBUG(1256, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy137;
- goto yy1289;
+ if(yych <= 'S') goto yy141;
+ goto yy1257;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 't') goto yy1289;
- if(yych <= 'z') goto yy137;
+ if(yych <= 't') goto yy1257;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1289:
- YYDEBUG(1289, *YYCURSOR);
+yy1257:
+ YYDEBUG(1257, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'G'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'H') goto yy163;
- if(yych == 'h') goto yy163;
+ if(yych <= 'H') goto yy167;
+ if(yych == 'h') goto yy167;
goto yy3;
}
-yy1290:
- YYDEBUG(1290, *YYCURSOR);
+yy1258:
+ YYDEBUG(1258, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
if(yych <= ')'){
- if(yych <= '(') goto yy405;
- goto yy132;
+ if(yych <= '(') goto yy283;
+ goto yy136;
} else {
- if(yych <= '@') goto yy405;
- if(yych <= 'R') goto yy135;
- goto yy1291;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'R') goto yy139;
+ goto yy1259;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy405;
- goto yy135;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy283;
+ goto yy139;
} else {
- if(yych <= 's') goto yy1291;
- if(yych <= 'z') goto yy135;
- goto yy405;
+ if(yych <= 's') goto yy1259;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy1291:
- YYDEBUG(1291, *YYCURSOR);
+yy1259:
+ YYDEBUG(1259, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy136;
- goto yy1292;
+ if(yych <= 'C') goto yy140;
+ goto yy1260;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'd') goto yy1292;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'd') goto yy1260;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1292:
- YYDEBUG(1292, *YYCURSOR);
+yy1260:
+ YYDEBUG(1260, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy1293;
+ goto yy1261;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
goto yy3;
} else {
- if(yych <= 'a') goto yy1293;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'a') goto yy1261;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1293:
- YYDEBUG(1293, *YYCURSOR);
+yy1261:
+ YYDEBUG(1261, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'X'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Y') goto yy411;
- if(yych == 'y') goto yy411;
+ if(yych <= 'Y') goto yy289;
+ if(yych == 'y') goto yy289;
goto yy3;
}
-yy1294:
- YYDEBUG(1294, *YYCURSOR);
+yy1262:
+ YYDEBUG(1262, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy1302;
+ goto yy1270;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
goto yy3;
} else {
- if(yych <= 'a') goto yy1302;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'a') goto yy1270;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1295:
- YYDEBUG(1295, *YYCURSOR);
+yy1263:
+ YYDEBUG(1263, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'O'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy135;
- goto yy1296;
+ if(yych <= 'N') goto yy139;
+ goto yy1264;
}
} else {
if(yych <= 'n'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'o') goto yy1296;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'o') goto yy1264;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1296:
- YYDEBUG(1296, *YYCURSOR);
+yy1264:
+ YYDEBUG(1264, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy136;
- goto yy1297;
+ if(yych <= 'Q') goto yy140;
+ goto yy1265;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'r') goto yy1297;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'r') goto yy1265;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1297:
- YYDEBUG(1297, *YYCURSOR);
+yy1265:
+ YYDEBUG(1265, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy137;
- goto yy1298;
+ if(yych <= 'Q') goto yy141;
+ goto yy1266;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'r') goto yy1298;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'r') goto yy1266;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1298:
- YYDEBUG(1298, *YYCURSOR);
+yy1266:
+ YYDEBUG(1266, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'O') goto yy1299;
+ if(yych <= 'O') goto yy1267;
if(yych != 'o') goto yy3;
- goto yy1299;
+ goto yy1267;
}
-yy1299:
- YYDEBUG(1299, *YYCURSOR);
+yy1267:
+ YYDEBUG(1267, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'W') goto yy1300;
+ if(yych == 'W') goto yy1268;
if(yych != 'w') goto yy53;
- goto yy1300;
-yy1300:
- YYDEBUG(1300, *YYCURSOR);
+ goto yy1268;
+yy1268:
+ YYDEBUG(1268, *YYCURSOR);
++YYCURSOR;
- goto yy1301;
-yy1301:
- YYDEBUG(1301, *YYCURSOR);
+ goto yy1269;
+yy1269:
+ YYDEBUG(1269, *YYCURSOR);
-#line 913 "ext/date/lib/parse_date.re"
+#line 927 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("tomorrow");
TIMELIB_INIT;
@@ -19923,46 +19459,46 @@ yy1301:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 17300 "ext/date/lib/parse_date.c"
-yy1302:
- YYDEBUG(1302, *YYCURSOR);
+#line 16905 "ext/date/lib/parse_date.c"
+yy1270:
+ YYDEBUG(1270, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy136;
- goto yy1303;
+ if(yych <= 'X') goto yy140;
+ goto yy1271;
}
} else {
if(yych <= 'x'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'y') goto yy1303;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'y') goto yy1271;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1303:
- YYDEBUG(1303, *YYCURSOR);
+yy1271:
+ YYDEBUG(1271, *YYCURSOR);
++YYCURSOR;
if((yych = *YYCURSOR) <= '@'){
- if(yych == ')') goto yy132;
- goto yy1304;
+ if(yych == ')') goto yy136;
+ goto yy1272;
} else {
- if(yych <= 'Z') goto yy137;
- if(yych <= '`') goto yy1304;
- if(yych <= 'z') goto yy137;
- goto yy1304;
+ if(yych <= 'Z') goto yy141;
+ if(yych <= '`') goto yy1272;
+ if(yych <= 'z') goto yy141;
+ goto yy1272;
}
-yy1304:
- YYDEBUG(1304, *YYCURSOR);
+yy1272:
+ YYDEBUG(1272, *YYCURSOR);
-#line 903 "ext/date/lib/parse_date.re"
+#line 917 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("midnight | today");
TIMELIB_INIT;
@@ -19971,1804 +19507,1804 @@ yy1304:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 17342 "ext/date/lib/parse_date.c"
-yy1305:
- YYDEBUG(1305, *YYCURSOR);
+#line 16947 "ext/date/lib/parse_date.c"
+yy1273:
+ YYDEBUG(1273, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
- if(yych <= '(') goto yy405;
- goto yy132;
+ if(yych <= '(') goto yy283;
+ goto yy136;
} else {
- if(yych <= '@') goto yy405;
- if(yych <= 'Q') goto yy135;
- goto yy1308;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'Q') goto yy139;
+ goto yy1276;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy405;
- goto yy135;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy283;
+ goto yy139;
} else {
- if(yych <= 'r') goto yy1308;
- if(yych <= 'z') goto yy135;
- goto yy405;
+ if(yych <= 'r') goto yy1276;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy1306:
- YYDEBUG(1306, *YYCURSOR);
+yy1274:
+ YYDEBUG(1274, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'Q') goto yy135;
- if(yych >= 'S') goto yy321;
- goto yy1307;
+ if(yych <= 'Q') goto yy139;
+ if(yych >= 'S') goto yy257;
+ goto yy1275;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'r') goto yy1307;
- if(yych <= 's') goto yy321;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'r') goto yy1275;
+ if(yych <= 's') goto yy257;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1307:
- YYDEBUG(1307, *YYCURSOR);
+yy1275:
+ YYDEBUG(1275, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy136;
- goto yy376;
+ if(yych <= 'C') goto yy140;
+ goto yy270;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'd') goto yy376;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'd') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1308:
- YYDEBUG(1308, *YYCURSOR);
+yy1276:
+ YYDEBUG(1276, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy136;
- goto yy1309;
+ if(yych <= 'R') goto yy140;
+ goto yy1277;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 's') goto yy1309;
- if(yych <= 'z') goto yy136;
+ if(yych <= 's') goto yy1277;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1309:
- YYDEBUG(1309, *YYCURSOR);
+yy1277:
+ YYDEBUG(1277, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy137;
- goto yy1310;
+ if(yych <= 'C') goto yy141;
+ goto yy1278;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'd') goto yy1310;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'd') goto yy1278;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1310:
- YYDEBUG(1310, *YYCURSOR);
+yy1278:
+ YYDEBUG(1278, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'A') goto yy1311;
+ if(yych <= 'A') goto yy1279;
if(yych != 'a') goto yy3;
- goto yy1311;
+ goto yy1279;
}
-yy1311:
- YYDEBUG(1311, *YYCURSOR);
+yy1279:
+ YYDEBUG(1279, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy411;
- if(yych == 'y') goto yy411;
+ if(yych == 'Y') goto yy289;
+ if(yych == 'y') goto yy289;
goto yy53;
-yy1312:
- YYDEBUG(1312, *YYCURSOR);
+yy1280:
+ YYDEBUG(1280, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy1313;
+ if(yych <= 'S') goto yy139;
+ goto yy1281;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 't') goto yy1313;
- if(yych <= 'z') goto yy135;
+ if(yych <= 't') goto yy1281;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1313:
- YYDEBUG(1313, *YYCURSOR);
+yy1281:
+ YYDEBUG(1281, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= 'g'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'h') goto yy376;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'h') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1314:
- YYDEBUG(1314, *YYCURSOR);
+yy1282:
+ YYDEBUG(1282, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy1312;
+ if(yych <= 'M') goto yy138;
+ goto yy1280;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy1343;
- if(yych <= 'z') goto yy139;
+ if(yych == 'n') goto yy1311;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1315:
- YYDEBUG(1315, *YYCURSOR);
+yy1283:
+ YYDEBUG(1283, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'U'){
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= 'H'){
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'I') goto yy1306;
- if(yych <= 'T') goto yy134;
- goto yy1305;
+ if(yych <= 'I') goto yy1274;
+ if(yych <= 'T') goto yy138;
+ goto yy1273;
}
}
} else {
if(yych <= 'h'){
if(yych <= '^'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- goto yy139;
+ goto yy143;
}
} else {
if(yych <= 't'){
- if(yych <= 'i') goto yy1337;
- goto yy139;
+ if(yych <= 'i') goto yy1305;
+ goto yy143;
} else {
- if(yych <= 'u') goto yy1336;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'u') goto yy1304;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy1316:
- YYDEBUG(1316, *YYCURSOR);
+yy1284:
+ YYDEBUG(1284, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'M'){
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= 'C'){
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'D') goto yy1294;
- if(yych <= 'L') goto yy134;
- goto yy1295;
+ if(yych <= 'D') goto yy1262;
+ if(yych <= 'L') goto yy138;
+ goto yy1263;
}
}
} else {
if(yych <= 'c'){
if(yych <= '^'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- goto yy139;
+ goto yy143;
}
} else {
if(yych <= 'l'){
- if(yych <= 'd') goto yy1327;
- goto yy139;
+ if(yych <= 'd') goto yy1295;
+ goto yy143;
} else {
- if(yych <= 'm') goto yy1328;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'm') goto yy1296;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy1317:
- YYDEBUG(1317, *YYCURSOR);
+yy1285:
+ YYDEBUG(1285, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy1290;
+ if(yych <= 'D') goto yy138;
+ goto yy1258;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy1323;
- if(yych <= 'z') goto yy139;
+ if(yych == 'e') goto yy1291;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1318:
- YYDEBUG(1318, *YYCURSOR);
+yy1286:
+ YYDEBUG(1286, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy134;
- goto yy1286;
+ if(yych <= 'D') goto yy138;
+ goto yy1254;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy1319;
- if(yych <= 'z') goto yy139;
+ if(yych == 'e') goto yy1287;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1319:
- YYDEBUG(1319, *YYCURSOR);
+yy1287:
+ YYDEBUG(1287, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'L'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'K') goto yy135;
- goto yy1287;
+ if(yych <= 'K') goto yy139;
+ goto yy1255;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'l') goto yy1320;
- if(yych <= 'z') goto yy144;
+ if(yych == 'l') goto yy1288;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1320:
- YYDEBUG(1320, *YYCURSOR);
+yy1288:
+ YYDEBUG(1288, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'F'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'E') goto yy136;
- goto yy1288;
+ if(yych <= 'E') goto yy140;
+ goto yy1256;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'f') goto yy1321;
- if(yych <= 'z') goto yy145;
+ if(yych == 'f') goto yy1289;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1321:
- YYDEBUG(1321, *YYCURSOR);
+yy1289:
+ YYDEBUG(1289, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy137;
- goto yy1289;
+ if(yych <= 'S') goto yy141;
+ goto yy1257;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy1322;
- if(yych <= 'z') goto yy146;
+ if(yych == 't') goto yy1290;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1322:
- YYDEBUG(1322, *YYCURSOR);
+yy1290:
+ YYDEBUG(1290, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'G') goto yy3;
- goto yy163;
+ goto yy167;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy245;
- if(yych <= 'z') goto yy147;
+ if(yych == 'h') goto yy254;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1323:
- YYDEBUG(1323, *YYCURSOR);
+yy1291:
+ YYDEBUG(1291, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'R') goto yy135;
- goto yy1291;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'R') goto yy139;
+ goto yy1259;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 's') goto yy1324;
- if(yych <= 'z') goto yy144;
- goto yy405;
+ if(yych == 's') goto yy1292;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy1324:
- YYDEBUG(1324, *YYCURSOR);
+yy1292:
+ YYDEBUG(1292, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy136;
- goto yy1292;
+ if(yych <= 'C') goto yy140;
+ goto yy1260;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy1325;
- if(yych <= 'z') goto yy145;
+ if(yych == 'd') goto yy1293;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1325:
- YYDEBUG(1325, *YYCURSOR);
+yy1293:
+ YYDEBUG(1293, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy1293;
+ goto yy1261;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy1326;
- if(yych <= 'z') goto yy146;
+ if(yych <= 'a') goto yy1294;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1326:
- YYDEBUG(1326, *YYCURSOR);
+yy1294:
+ YYDEBUG(1294, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'X') goto yy3;
- goto yy411;
+ goto yy289;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy419;
- if(yych <= 'z') goto yy147;
+ if(yych == 'y') goto yy302;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1327:
- YYDEBUG(1327, *YYCURSOR);
+yy1295:
+ YYDEBUG(1295, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy1302;
+ goto yy1270;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy1334;
- if(yych <= 'z') goto yy144;
+ if(yych <= 'a') goto yy1302;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1328:
- YYDEBUG(1328, *YYCURSOR);
+yy1296:
+ YYDEBUG(1296, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'O'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'N') goto yy135;
- goto yy1296;
+ if(yych <= 'N') goto yy139;
+ goto yy1264;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'o') goto yy1329;
- if(yych <= 'z') goto yy144;
+ if(yych == 'o') goto yy1297;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1329:
- YYDEBUG(1329, *YYCURSOR);
+yy1297:
+ YYDEBUG(1297, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy136;
- goto yy1297;
+ if(yych <= 'Q') goto yy140;
+ goto yy1265;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy1330;
- if(yych <= 'z') goto yy145;
+ if(yych == 'r') goto yy1298;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1330:
- YYDEBUG(1330, *YYCURSOR);
+yy1298:
+ YYDEBUG(1298, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy137;
- goto yy1298;
+ if(yych <= 'Q') goto yy141;
+ goto yy1266;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy1331;
- if(yych <= 'z') goto yy146;
+ if(yych == 'r') goto yy1299;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1331:
- YYDEBUG(1331, *YYCURSOR);
+yy1299:
+ YYDEBUG(1299, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'O'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'N') goto yy3;
- goto yy1299;
+ goto yy1267;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'o') goto yy1332;
- if(yych <= 'z') goto yy147;
+ if(yych == 'o') goto yy1300;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1332:
- YYDEBUG(1332, *YYCURSOR);
+yy1300:
+ YYDEBUG(1300, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'W') goto yy1300;
- if(yych != 'w') goto yy148;
- goto yy1333;
-yy1333:
- YYDEBUG(1333, *YYCURSOR);
- yyaccept = 22;
+ if(yych == 'W') goto yy1268;
+ if(yych != 'w') goto yy152;
+ goto yy1301;
+yy1301:
+ YYDEBUG(1301, *YYCURSOR);
+ yyaccept = 25;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '^'){
- if(yych == '/') goto yy140;
- goto yy1301;
+ if(yych == '/') goto yy144;
+ goto yy1269;
} else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy1301;
- if(yych <= 'z') goto yy147;
- goto yy1301;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy1269;
+ if(yych <= 'z') goto yy151;
+ goto yy1269;
}
-yy1334:
- YYDEBUG(1334, *YYCURSOR);
+yy1302:
+ YYDEBUG(1302, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy136;
- goto yy1303;
+ if(yych <= 'X') goto yy140;
+ goto yy1271;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy1335;
- if(yych <= 'z') goto yy145;
+ if(yych == 'y') goto yy1303;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1335:
- YYDEBUG(1335, *YYCURSOR);
- yyaccept = 23;
+yy1303:
+ YYDEBUG(1303, *YYCURSOR);
+ yyaccept = 26;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy1304;
- goto yy132;
+ if(yych <= '(') goto yy1272;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
- goto yy1304;
+ if(yych == '/') goto yy144;
+ goto yy1272;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy137;
- if(yych <= '^') goto yy1304;
- goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych <= '^') goto yy1272;
+ goto yy144;
} else {
- if(yych <= '`') goto yy1304;
- if(yych <= 'z') goto yy146;
- goto yy1304;
+ if(yych <= '`') goto yy1272;
+ if(yych <= 'z') goto yy150;
+ goto yy1272;
}
}
-yy1336:
- YYDEBUG(1336, *YYCURSOR);
+yy1304:
+ YYDEBUG(1304, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'Q') goto yy135;
- goto yy1308;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'Q') goto yy139;
+ goto yy1276;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 'r') goto yy1339;
- if(yych <= 'z') goto yy144;
- goto yy405;
+ if(yych == 'r') goto yy1307;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy1337:
- YYDEBUG(1337, *YYCURSOR);
+yy1305:
+ YYDEBUG(1305, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy135;
- if(yych <= 'R') goto yy1307;
- goto yy321;
+ if(yych <= 'Q') goto yy139;
+ if(yych <= 'R') goto yy1275;
+ goto yy257;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
if(yych <= 'r'){
- if(yych <= 'q') goto yy144;
- goto yy1338;
+ if(yych <= 'q') goto yy148;
+ goto yy1306;
} else {
- if(yych <= 's') goto yy345;
- if(yych <= 'z') goto yy144;
+ if(yych <= 's') goto yy260;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
}
-yy1338:
- YYDEBUG(1338, *YYCURSOR);
+yy1306:
+ YYDEBUG(1306, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy136;
- goto yy376;
+ if(yych <= 'C') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 'd') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1339:
- YYDEBUG(1339, *YYCURSOR);
+yy1307:
+ YYDEBUG(1307, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy136;
- goto yy1309;
+ if(yych <= 'R') goto yy140;
+ goto yy1277;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 's') goto yy1340;
- if(yych <= 'z') goto yy145;
+ if(yych == 's') goto yy1308;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1340:
- YYDEBUG(1340, *YYCURSOR);
+yy1308:
+ YYDEBUG(1308, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy137;
- goto yy1310;
+ if(yych <= 'C') goto yy141;
+ goto yy1278;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy1341;
- if(yych <= 'z') goto yy146;
+ if(yych == 'd') goto yy1309;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1341:
- YYDEBUG(1341, *YYCURSOR);
+yy1309:
+ YYDEBUG(1309, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy1311;
+ goto yy1279;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych <= 'a') goto yy1342;
- if(yych <= 'z') goto yy147;
+ if(yych <= 'a') goto yy1310;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1342:
- YYDEBUG(1342, *YYCURSOR);
+yy1310:
+ YYDEBUG(1310, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy411;
- if(yych == 'y') goto yy419;
- goto yy148;
-yy1343:
- YYDEBUG(1343, *YYCURSOR);
+ if(yych == 'Y') goto yy289;
+ if(yych == 'y') goto yy302;
+ goto yy152;
+yy1311:
+ YYDEBUG(1311, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy1313;
+ if(yych <= 'S') goto yy139;
+ goto yy1281;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy1344;
- if(yych <= 'z') goto yy144;
+ if(yych == 't') goto yy1312;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1344:
- YYDEBUG(1344, *YYCURSOR);
+yy1312:
+ YYDEBUG(1312, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 'h') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1345:
- YYDEBUG(1345, *YYCURSOR);
+yy1313:
+ YYDEBUG(1313, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
if(yych <= '@'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych == 'R') goto yy1357;
- if(yych <= 'X') goto yy134;
- goto yy1358;
+ if(yych == 'R') goto yy1325;
+ if(yych <= 'X') goto yy138;
+ goto yy1326;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- if(yych <= 'q') goto yy134;
- goto yy1357;
+ if(yych <= 'q') goto yy138;
+ goto yy1325;
} else {
- if(yych == 'y') goto yy1358;
- if(yych <= 'z') goto yy134;
+ if(yych == 'y') goto yy1326;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1346:
- YYDEBUG(1346, *YYCURSOR);
+yy1314:
+ YYDEBUG(1314, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy134;
- goto yy1351;
+ if(yych <= 'C') goto yy138;
+ goto yy1319;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'd') goto yy1351;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'd') goto yy1319;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1347:
- YYDEBUG(1347, *YYCURSOR);
+yy1315:
+ YYDEBUG(1315, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy1348;
+ if(yych <= 'M') goto yy138;
+ goto yy1316;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'n') goto yy1348;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'n') goto yy1316;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1348:
- YYDEBUG(1348, *YYCURSOR);
+yy1316:
+ YYDEBUG(1316, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'D'){
if(yych <= ')'){
- if(yych <= '(') goto yy405;
- goto yy132;
+ if(yych <= '(') goto yy283;
+ goto yy136;
} else {
- if(yych <= '@') goto yy405;
- if(yych <= 'C') goto yy135;
- goto yy1349;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'C') goto yy139;
+ goto yy1317;
}
} else {
if(yych <= 'c'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy405;
- goto yy135;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy283;
+ goto yy139;
} else {
- if(yych <= 'd') goto yy1349;
- if(yych <= 'z') goto yy135;
- goto yy405;
+ if(yych <= 'd') goto yy1317;
+ if(yych <= 'z') goto yy139;
+ goto yy283;
}
}
-yy1349:
- YYDEBUG(1349, *YYCURSOR);
+yy1317:
+ YYDEBUG(1317, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'A'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy1350;
+ goto yy1318;
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
goto yy3;
} else {
- if(yych <= 'a') goto yy1350;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'a') goto yy1318;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1350:
- YYDEBUG(1350, *YYCURSOR);
+yy1318:
+ YYDEBUG(1318, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'Y'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy137;
- goto yy546;
+ if(yych <= 'X') goto yy141;
+ goto yy510;
}
} else {
if(yych <= 'x'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'y') goto yy546;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'y') goto yy510;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1351:
- YYDEBUG(1351, *YYCURSOR);
+yy1319:
+ YYDEBUG(1319, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy135;
- goto yy1352;
+ if(yych <= 'M') goto yy139;
+ goto yy1320;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'n') goto yy1352;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'n') goto yy1320;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1352:
- YYDEBUG(1352, *YYCURSOR);
+yy1320:
+ YYDEBUG(1320, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'I'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'H') goto yy136;
- goto yy1353;
+ if(yych <= 'H') goto yy140;
+ goto yy1321;
}
} else {
if(yych <= 'h'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'i') goto yy1353;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'i') goto yy1321;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1353:
- YYDEBUG(1353, *YYCURSOR);
+yy1321:
+ YYDEBUG(1321, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'G'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'F') goto yy137;
- goto yy1354;
+ if(yych <= 'F') goto yy141;
+ goto yy1322;
}
} else {
if(yych <= 'f'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'g') goto yy1354;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'g') goto yy1322;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1354:
- YYDEBUG(1354, *YYCURSOR);
+yy1322:
+ YYDEBUG(1322, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'G'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'H') goto yy1355;
+ if(yych <= 'H') goto yy1323;
if(yych != 'h') goto yy3;
- goto yy1355;
+ goto yy1323;
}
-yy1355:
- YYDEBUG(1355, *YYCURSOR);
+yy1323:
+ YYDEBUG(1323, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy1356;
+ if(yych == 'T') goto yy1324;
if(yych != 't') goto yy53;
- goto yy1356;
-yy1356:
- YYDEBUG(1356, *YYCURSOR);
+ goto yy1324;
+yy1324:
+ YYDEBUG(1324, *YYCURSOR);
yych = *++YYCURSOR;
- goto yy1304;
-yy1357:
- YYDEBUG(1357, *YYCURSOR);
- yyaccept = 0;
+ goto yy1272;
+yy1325:
+ YYDEBUG(1325, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych == 'C') goto yy1359;
- goto yy135;
+ if(yych == 'C') goto yy1327;
+ goto yy139;
}
} else {
if(yych <= 'b'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'c') goto yy1359;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'c') goto yy1327;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy1358:
- YYDEBUG(1358, *YYCURSOR);
- yyaccept = 0;
+yy1326:
+ YYDEBUG(1326, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '-'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
- if(yych <= 0x1F) goto yy3;
- goto yy423;
+ if(yych == 0x09) goto yy312;
+ if(yych <= 0x1F) goto yy310;
+ goto yy312;
} else {
- if(yych == ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych == ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
}
} else {
if(yych <= '@'){
- if(yych == '/') goto yy3;
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych == '/') goto yy310;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
-yy1359:
- YYDEBUG(1359, *YYCURSOR);
+yy1327:
+ YYDEBUG(1327, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy604;
+ if(yych <= 'G') goto yy140;
+ goto yy568;
}
} else {
if(yych <= 'g'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'h') goto yy604;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'h') goto yy568;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1360:
- YYDEBUG(1360, *YYCURSOR);
+yy1328:
+ YYDEBUG(1328, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '/'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '.') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= 'Q'){
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'R') goto yy1357;
- if(yych <= 'X') goto yy134;
- goto yy1358;
+ if(yych <= 'R') goto yy1325;
+ if(yych <= 'X') goto yy138;
+ goto yy1326;
}
}
} else {
if(yych <= 'q'){
if(yych <= '^'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- goto yy139;
+ goto yy143;
}
} else {
if(yych <= 'x'){
- if(yych <= 'r') goto yy1372;
- goto yy139;
+ if(yych <= 'r') goto yy1340;
+ goto yy143;
} else {
- if(yych <= 'y') goto yy1373;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'y') goto yy1341;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy1361:
- YYDEBUG(1361, *YYCURSOR);
+yy1329:
+ YYDEBUG(1329, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'C') goto yy134;
- goto yy1351;
+ if(yych <= 'C') goto yy138;
+ goto yy1319;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy1366;
- if(yych <= 'z') goto yy139;
+ if(yych == 'd') goto yy1334;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1362:
- YYDEBUG(1362, *YYCURSOR);
+yy1330:
+ YYDEBUG(1330, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy1348;
+ if(yych <= 'M') goto yy138;
+ goto yy1316;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy1363;
- if(yych <= 'z') goto yy139;
+ if(yych == 'n') goto yy1331;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1363:
- YYDEBUG(1363, *YYCURSOR);
+yy1331:
+ YYDEBUG(1331, *YYCURSOR);
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
- goto yy405;
+ if(yych == ')') goto yy136;
+ goto yy283;
} else {
- if(yych <= '/') goto yy140;
- if(yych <= '@') goto yy405;
- if(yych <= 'C') goto yy135;
- goto yy1349;
+ if(yych <= '/') goto yy144;
+ if(yych <= '@') goto yy283;
+ if(yych <= 'C') goto yy139;
+ goto yy1317;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
- goto yy405;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
+ goto yy283;
} else {
- if(yych == 'd') goto yy1364;
- if(yych <= 'z') goto yy144;
- goto yy405;
+ if(yych == 'd') goto yy1332;
+ if(yych <= 'z') goto yy148;
+ goto yy283;
}
}
-yy1364:
- YYDEBUG(1364, *YYCURSOR);
+yy1332:
+ YYDEBUG(1332, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'A'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- goto yy1350;
+ goto yy1318;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '^') goto yy3;
- goto yy140;
+ goto yy144;
} else {
if(yych <= '`') goto yy3;
- if(yych <= 'a') goto yy1365;
- if(yych <= 'z') goto yy145;
+ if(yych <= 'a') goto yy1333;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1365:
- YYDEBUG(1365, *YYCURSOR);
+yy1333:
+ YYDEBUG(1333, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'Y'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'X') goto yy137;
- goto yy546;
+ if(yych <= 'X') goto yy141;
+ goto yy510;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'y') goto yy575;
- if(yych <= 'z') goto yy146;
+ if(yych == 'y') goto yy539;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1366:
- YYDEBUG(1366, *YYCURSOR);
+yy1334:
+ YYDEBUG(1334, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy135;
- goto yy1352;
+ if(yych <= 'M') goto yy139;
+ goto yy1320;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy1367;
- if(yych <= 'z') goto yy144;
+ if(yych == 'n') goto yy1335;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1367:
- YYDEBUG(1367, *YYCURSOR);
+yy1335:
+ YYDEBUG(1335, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'I'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'H') goto yy136;
- goto yy1353;
+ if(yych <= 'H') goto yy140;
+ goto yy1321;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'i') goto yy1368;
- if(yych <= 'z') goto yy145;
+ if(yych == 'i') goto yy1336;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1368:
- YYDEBUG(1368, *YYCURSOR);
+yy1336:
+ YYDEBUG(1336, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'G'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'F') goto yy137;
- goto yy1354;
+ if(yych <= 'F') goto yy141;
+ goto yy1322;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'g') goto yy1369;
- if(yych <= 'z') goto yy146;
+ if(yych == 'g') goto yy1337;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1369:
- YYDEBUG(1369, *YYCURSOR);
+yy1337:
+ YYDEBUG(1337, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'G') goto yy3;
- goto yy1355;
+ goto yy1323;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy1370;
- if(yych <= 'z') goto yy147;
+ if(yych == 'h') goto yy1338;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1370:
- YYDEBUG(1370, *YYCURSOR);
+yy1338:
+ YYDEBUG(1338, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'T') goto yy1356;
- if(yych != 't') goto yy148;
- goto yy1371;
-yy1371:
- YYDEBUG(1371, *YYCURSOR);
- yyaccept = 23;
+ if(yych == 'T') goto yy1324;
+ if(yych != 't') goto yy152;
+ goto yy1339;
+yy1339:
+ YYDEBUG(1339, *YYCURSOR);
+ yyaccept = 26;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '^'){
- if(yych == '/') goto yy140;
- goto yy1304;
+ if(yych == '/') goto yy144;
+ goto yy1272;
} else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy1304;
- if(yych <= 'z') goto yy147;
- goto yy1304;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy1272;
+ if(yych <= 'z') goto yy151;
+ goto yy1272;
}
-yy1372:
- YYDEBUG(1372, *YYCURSOR);
- yyaccept = 0;
+yy1340:
+ YYDEBUG(1340, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'B'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'C') goto yy1359;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'C') goto yy1327;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'b'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'c') goto yy1374;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'c') goto yy1342;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy1373:
- YYDEBUG(1373, *YYCURSOR);
- yyaccept = 0;
+yy1341:
+ YYDEBUG(1341, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '.'){
if(yych <= ' '){
- if(yych == 0x09) goto yy423;
- if(yych <= 0x1F) goto yy3;
- goto yy423;
+ if(yych == 0x09) goto yy312;
+ if(yych <= 0x1F) goto yy310;
+ goto yy312;
} else {
if(yych <= ')'){
- if(yych <= '(') goto yy3;
- goto yy132;
+ if(yych <= '(') goto yy310;
+ goto yy136;
} else {
- if(yych <= ',') goto yy3;
- if(yych <= '-') goto yy424;
- goto yy423;
+ if(yych <= ',') goto yy310;
+ if(yych <= '-') goto yy313;
+ goto yy312;
}
}
} else {
if(yych <= 'Z'){
- if(yych <= '/') goto yy140;
- if(yych <= '9') goto yy423;
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '/') goto yy144;
+ if(yych <= '9') goto yy312;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
if(yych <= '_'){
- if(yych <= '^') goto yy3;
- goto yy140;
+ if(yych <= '^') goto yy310;
+ goto yy144;
} else {
- if(yych <= '`') goto yy3;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= '`') goto yy310;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy1374:
- YYDEBUG(1374, *YYCURSOR);
+yy1342:
+ YYDEBUG(1342, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy604;
+ if(yych <= 'G') goto yy140;
+ goto yy568;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy615;
- if(yych <= 'z') goto yy145;
+ if(yych == 'h') goto yy579;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1375:
- YYDEBUG(1375, *YYCURSOR);
+yy1343:
+ YYDEBUG(1343, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'W'){
if(yych <= 'N'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
if(yych <= '@') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'O') goto yy1383;
- if(yych <= 'U') goto yy134;
- if(yych <= 'V') goto yy1384;
- goto yy1381;
+ if(yych <= 'O') goto yy1351;
+ if(yych <= 'U') goto yy138;
+ if(yych <= 'V') goto yy1352;
+ goto yy1349;
}
} else {
if(yych <= 'o'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- if(yych <= 'n') goto yy134;
- goto yy1383;
+ if(yych <= 'n') goto yy138;
+ goto yy1351;
} else {
if(yych <= 'v'){
- if(yych <= 'u') goto yy134;
- goto yy1384;
+ if(yych <= 'u') goto yy138;
+ goto yy1352;
} else {
- if(yych <= 'w') goto yy1381;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'w') goto yy1349;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
}
-yy1376:
- YYDEBUG(1376, *YYCURSOR);
+yy1344:
+ YYDEBUG(1344, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'X'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'W') goto yy134;
- goto yy1380;
+ if(yych <= 'W') goto yy138;
+ goto yy1348;
}
} else {
if(yych <= 'w'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'x') goto yy1380;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'x') goto yy1348;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1377:
- YYDEBUG(1377, *YYCURSOR);
+yy1345:
+ YYDEBUG(1345, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy1378;
+ if(yych <= 'M') goto yy138;
+ goto yy1346;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 'n') goto yy1378;
- if(yych <= 'z') goto yy134;
+ if(yych <= 'n') goto yy1346;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1378:
- YYDEBUG(1378, *YYCURSOR);
+yy1346:
+ YYDEBUG(1346, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy1379;
+ if(yych <= 'S') goto yy139;
+ goto yy1347;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 't') goto yy1379;
- if(yych <= 'z') goto yy135;
+ if(yych <= 't') goto yy1347;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1379:
- YYDEBUG(1379, *YYCURSOR);
+yy1347:
+ YYDEBUG(1347, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'H'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= 'g'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'h') goto yy376;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'h') goto yy270;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1380:
- YYDEBUG(1380, *YYCURSOR);
+yy1348:
+ YYDEBUG(1348, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy321;
+ if(yych <= 'S') goto yy139;
+ goto yy257;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 't') goto yy321;
- if(yych <= 'z') goto yy135;
+ if(yych <= 't') goto yy257;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1381:
- YYDEBUG(1381, *YYCURSOR);
+yy1349:
+ YYDEBUG(1349, *YYCURSOR);
++YYCURSOR;
if((yych = *YYCURSOR) <= '@'){
- if(yych == ')') goto yy132;
- goto yy1382;
+ if(yych == ')') goto yy136;
+ goto yy1350;
} else {
- if(yych <= 'Z') goto yy135;
- if(yych <= '`') goto yy1382;
- if(yych <= 'z') goto yy135;
- goto yy1382;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '`') goto yy1350;
+ if(yych <= 'z') goto yy139;
+ goto yy1350;
}
-yy1382:
- YYDEBUG(1382, *YYCURSOR);
+yy1350:
+ YYDEBUG(1350, *YYCURSOR);
-#line 882 "ext/date/lib/parse_date.re"
+#line 896 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("now");
TIMELIB_INIT;
@@ -21776,153 +21312,153 @@ yy1382:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 18991 "ext/date/lib/parse_date.c"
-yy1383:
- YYDEBUG(1383, *YYCURSOR);
+#line 18596 "ext/date/lib/parse_date.c"
+yy1351:
+ YYDEBUG(1351, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'N'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy135;
- goto yy1389;
+ if(yych <= 'M') goto yy139;
+ goto yy1357;
}
} else {
if(yych <= 'm'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 'n') goto yy1389;
- if(yych <= 'z') goto yy135;
+ if(yych <= 'n') goto yy1357;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1384:
- YYDEBUG(1384, *YYCURSOR);
- yyaccept = 0;
+yy1352:
+ YYDEBUG(1352, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '/'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= ','){
- if(yych <= ')') goto yy132;
- goto yy3;
+ if(yych <= ')') goto yy136;
+ goto yy310;
} else {
- if(yych <= '-') goto yy424;
- if(yych <= '.') goto yy423;
- goto yy3;
+ if(yych <= '-') goto yy313;
+ if(yych <= '.') goto yy312;
+ goto yy310;
}
}
} else {
if(yych <= 'Z'){
if(yych <= '@'){
- if(yych <= '9') goto yy423;
- goto yy3;
+ if(yych <= '9') goto yy312;
+ goto yy310;
} else {
- if(yych != 'E') goto yy135;
- goto yy1385;
+ if(yych != 'E') goto yy139;
+ goto yy1353;
}
} else {
if(yych <= 'd'){
- if(yych <= '`') goto yy3;
- goto yy135;
+ if(yych <= '`') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'e') goto yy1385;
- if(yych <= 'z') goto yy135;
- goto yy3;
+ if(yych <= 'e') goto yy1353;
+ if(yych <= 'z') goto yy139;
+ goto yy310;
}
}
}
-yy1385:
- YYDEBUG(1385, *YYCURSOR);
+yy1353:
+ YYDEBUG(1353, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'M'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'L') goto yy136;
- goto yy1386;
+ if(yych <= 'L') goto yy140;
+ goto yy1354;
}
} else {
if(yych <= 'l'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'm') goto yy1386;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'm') goto yy1354;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1386:
- YYDEBUG(1386, *YYCURSOR);
+yy1354:
+ YYDEBUG(1354, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'B'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy137;
- goto yy1387;
+ if(yych <= 'A') goto yy141;
+ goto yy1355;
}
} else {
if(yych <= 'a'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'b') goto yy1387;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'b') goto yy1355;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1387:
- YYDEBUG(1387, *YYCURSOR);
+yy1355:
+ YYDEBUG(1355, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'E') goto yy1388;
+ if(yych <= 'E') goto yy1356;
if(yych != 'e') goto yy3;
- goto yy1388;
+ goto yy1356;
}
-yy1388:
- YYDEBUG(1388, *YYCURSOR);
+yy1356:
+ YYDEBUG(1356, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'R') goto yy422;
- if(yych == 'r') goto yy422;
+ if(yych == 'R') goto yy322;
+ if(yych == 'r') goto yy322;
goto yy53;
-yy1389:
- YYDEBUG(1389, *YYCURSOR);
+yy1357:
+ YYDEBUG(1357, *YYCURSOR);
++YYCURSOR;
if((yych = *YYCURSOR) <= '@'){
- if(yych == ')') goto yy132;
- goto yy1390;
+ if(yych == ')') goto yy136;
+ goto yy1358;
} else {
- if(yych <= 'Z') goto yy136;
- if(yych <= '`') goto yy1390;
- if(yych <= 'z') goto yy136;
- goto yy1390;
+ if(yych <= 'Z') goto yy140;
+ if(yych <= '`') goto yy1358;
+ if(yych <= 'z') goto yy140;
+ goto yy1358;
}
-yy1390:
- YYDEBUG(1390, *YYCURSOR);
+yy1358:
+ YYDEBUG(1358, *YYCURSOR);
-#line 891 "ext/date/lib/parse_date.re"
+#line 905 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("noon");
TIMELIB_INIT;
@@ -21933,512 +21469,496 @@ yy1390:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 19132 "ext/date/lib/parse_date.c"
-yy1391:
- YYDEBUG(1391, *YYCURSOR);
+#line 18737 "ext/date/lib/parse_date.c"
+yy1359:
+ YYDEBUG(1359, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'W'){
if(yych <= '@'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
+ if(yych == '/') goto yy144;
goto yy3;
}
} else {
if(yych <= 'O'){
- if(yych <= 'N') goto yy134;
- goto yy1383;
+ if(yych <= 'N') goto yy138;
+ goto yy1351;
} else {
- if(yych <= 'U') goto yy134;
- if(yych <= 'V') goto yy1384;
- goto yy1381;
+ if(yych <= 'U') goto yy138;
+ if(yych <= 'V') goto yy1352;
+ goto yy1349;
}
}
} else {
if(yych <= 'n'){
if(yych <= '^'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
goto yy3;
} else {
- if(yych <= '_') goto yy140;
+ if(yych <= '_') goto yy144;
if(yych <= '`') goto yy3;
- goto yy139;
+ goto yy143;
}
} else {
if(yych <= 'v'){
- if(yych <= 'o') goto yy1398;
- if(yych <= 'u') goto yy139;
- goto yy1399;
+ if(yych <= 'o') goto yy1366;
+ if(yych <= 'u') goto yy143;
+ goto yy1367;
} else {
- if(yych <= 'w') goto yy1397;
- if(yych <= 'z') goto yy139;
+ if(yych <= 'w') goto yy1365;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
}
-yy1392:
- YYDEBUG(1392, *YYCURSOR);
+yy1360:
+ YYDEBUG(1360, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'X'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'W') goto yy134;
- goto yy1380;
+ if(yych <= 'W') goto yy138;
+ goto yy1348;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'x') goto yy1396;
- if(yych <= 'z') goto yy139;
+ if(yych == 'x') goto yy1364;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1393:
- YYDEBUG(1393, *YYCURSOR);
+yy1361:
+ YYDEBUG(1361, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy134;
- goto yy1378;
+ if(yych <= 'M') goto yy138;
+ goto yy1346;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy1394;
- if(yych <= 'z') goto yy139;
+ if(yych == 'n') goto yy1362;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1394:
- YYDEBUG(1394, *YYCURSOR);
+yy1362:
+ YYDEBUG(1362, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy1379;
+ if(yych <= 'S') goto yy139;
+ goto yy1347;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy1395;
- if(yych <= 'z') goto yy144;
+ if(yych == 't') goto yy1363;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1395:
- YYDEBUG(1395, *YYCURSOR);
+yy1363:
+ YYDEBUG(1363, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'H'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'G') goto yy136;
- goto yy376;
+ if(yych <= 'G') goto yy140;
+ goto yy270;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'h') goto yy394;
- if(yych <= 'z') goto yy145;
+ if(yych == 'h') goto yy280;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1396:
- YYDEBUG(1396, *YYCURSOR);
+yy1364:
+ YYDEBUG(1364, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy321;
+ if(yych <= 'S') goto yy139;
+ goto yy257;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy345;
- if(yych <= 'z') goto yy144;
+ if(yych == 't') goto yy260;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1397:
- YYDEBUG(1397, *YYCURSOR);
- yyaccept = 24;
+yy1365:
+ YYDEBUG(1365, *YYCURSOR);
+ yyaccept = 27;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy1382;
- goto yy132;
+ if(yych <= '(') goto yy1350;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
- goto yy1382;
+ if(yych == '/') goto yy144;
+ goto yy1350;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy135;
- if(yych <= '^') goto yy1382;
- goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych <= '^') goto yy1350;
+ goto yy144;
} else {
- if(yych <= '`') goto yy1382;
- if(yych <= 'z') goto yy144;
- goto yy1382;
+ if(yych <= '`') goto yy1350;
+ if(yych <= 'z') goto yy148;
+ goto yy1350;
}
}
-yy1398:
- YYDEBUG(1398, *YYCURSOR);
+yy1366:
+ YYDEBUG(1366, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'N'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'M') goto yy135;
- goto yy1389;
+ if(yych <= 'M') goto yy139;
+ goto yy1357;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'n') goto yy1404;
- if(yych <= 'z') goto yy144;
+ if(yych == 'n') goto yy1372;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1399:
- YYDEBUG(1399, *YYCURSOR);
- yyaccept = 0;
+yy1367:
+ YYDEBUG(1367, *YYCURSOR);
+ yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '9'){
if(yych <= '('){
if(yych <= 0x09){
- if(yych <= 0x08) goto yy3;
- goto yy423;
+ if(yych <= 0x08) goto yy310;
+ goto yy312;
} else {
- if(yych == ' ') goto yy423;
- goto yy3;
+ if(yych == ' ') goto yy312;
+ goto yy310;
}
} else {
if(yych <= '-'){
- if(yych <= ')') goto yy132;
- if(yych <= ',') goto yy3;
- goto yy424;
+ if(yych <= ')') goto yy136;
+ if(yych <= ',') goto yy310;
+ goto yy313;
} else {
- if(yych == '/') goto yy140;
- goto yy423;
+ if(yych == '/') goto yy144;
+ goto yy312;
}
}
} else {
if(yych <= '^'){
if(yych <= 'D'){
- if(yych <= '@') goto yy3;
- goto yy135;
+ if(yych <= '@') goto yy310;
+ goto yy139;
} else {
- if(yych <= 'E') goto yy1385;
- if(yych <= 'Z') goto yy135;
- goto yy3;
+ if(yych <= 'E') goto yy1353;
+ if(yych <= 'Z') goto yy139;
+ goto yy310;
}
} else {
if(yych <= 'd'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy3;
- goto yy144;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy310;
+ goto yy148;
} else {
- if(yych <= 'e') goto yy1400;
- if(yych <= 'z') goto yy144;
- goto yy3;
+ if(yych <= 'e') goto yy1368;
+ if(yych <= 'z') goto yy148;
+ goto yy310;
}
}
}
-yy1400:
- YYDEBUG(1400, *YYCURSOR);
+yy1368:
+ YYDEBUG(1368, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'M'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'L') goto yy136;
- goto yy1386;
+ if(yych <= 'L') goto yy140;
+ goto yy1354;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'm') goto yy1401;
- if(yych <= 'z') goto yy145;
+ if(yych == 'm') goto yy1369;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1401:
- YYDEBUG(1401, *YYCURSOR);
+yy1369:
+ YYDEBUG(1369, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'B'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'A') goto yy137;
- goto yy1387;
+ if(yych <= 'A') goto yy141;
+ goto yy1355;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'b') goto yy1402;
- if(yych <= 'z') goto yy146;
+ if(yych == 'b') goto yy1370;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1402:
- YYDEBUG(1402, *YYCURSOR);
+yy1370:
+ YYDEBUG(1370, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'D') goto yy3;
- goto yy1388;
+ goto yy1356;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy1403;
- if(yych <= 'z') goto yy147;
+ if(yych == 'e') goto yy1371;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1403:
- YYDEBUG(1403, *YYCURSOR);
+yy1371:
+ YYDEBUG(1371, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych <= '^'){
- if(yych <= '/'){
- if(yych <= '.') goto yy53;
- goto yy140;
- } else {
- if(yych == 'R') goto yy422;
- goto yy53;
- }
- } else {
- if(yych <= 'q'){
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy53;
- goto yy147;
- } else {
- if(yych <= 'r') goto yy528;
- if(yych <= 'z') goto yy147;
- goto yy53;
- }
- }
-yy1404:
- YYDEBUG(1404, *YYCURSOR);
- yyaccept = 25;
+ if(yych == 'R') goto yy322;
+ if(yych == 'r') goto yy492;
+ goto yy152;
+yy1372:
+ YYDEBUG(1372, *YYCURSOR);
+ yyaccept = 28;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '@'){
if(yych <= ')'){
- if(yych <= '(') goto yy1390;
- goto yy132;
+ if(yych <= '(') goto yy1358;
+ goto yy136;
} else {
- if(yych == '/') goto yy140;
- goto yy1390;
+ if(yych == '/') goto yy144;
+ goto yy1358;
}
} else {
if(yych <= '_'){
- if(yych <= 'Z') goto yy136;
- if(yych <= '^') goto yy1390;
- goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych <= '^') goto yy1358;
+ goto yy144;
} else {
- if(yych <= '`') goto yy1390;
- if(yych <= 'z') goto yy145;
- goto yy1390;
+ if(yych <= '`') goto yy1358;
+ if(yych <= 'z') goto yy149;
+ goto yy1358;
}
}
-yy1405:
- YYDEBUG(1405, *YYCURSOR);
+yy1373:
+ YYDEBUG(1373, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'S'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy134;
- goto yy1406;
+ if(yych <= 'R') goto yy138;
+ goto yy1374;
}
} else {
if(yych <= 'r'){
- if(yych <= 'Z') goto yy134;
+ if(yych <= 'Z') goto yy138;
if(yych <= '`') goto yy3;
- goto yy134;
+ goto yy138;
} else {
- if(yych <= 's') goto yy1406;
- if(yych <= 'z') goto yy134;
+ if(yych <= 's') goto yy1374;
+ if(yych <= 'z') goto yy138;
goto yy3;
}
}
-yy1406:
- YYDEBUG(1406, *YYCURSOR);
+yy1374:
+ YYDEBUG(1374, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'T'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy1407;
+ if(yych <= 'S') goto yy139;
+ goto yy1375;
}
} else {
if(yych <= 's'){
- if(yych <= 'Z') goto yy135;
+ if(yych <= 'Z') goto yy139;
if(yych <= '`') goto yy3;
- goto yy135;
+ goto yy139;
} else {
- if(yych <= 't') goto yy1407;
- if(yych <= 'z') goto yy135;
+ if(yych <= 't') goto yy1375;
+ if(yych <= 'z') goto yy139;
goto yy3;
}
}
-yy1407:
- YYDEBUG(1407, *YYCURSOR);
+yy1375:
+ YYDEBUG(1375, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'E'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy136;
- goto yy1408;
+ if(yych <= 'D') goto yy140;
+ goto yy1376;
}
} else {
if(yych <= 'd'){
- if(yych <= 'Z') goto yy136;
+ if(yych <= 'Z') goto yy140;
if(yych <= '`') goto yy3;
- goto yy136;
+ goto yy140;
} else {
- if(yych <= 'e') goto yy1408;
- if(yych <= 'z') goto yy136;
+ if(yych <= 'e') goto yy1376;
+ if(yych <= 'z') goto yy140;
goto yy3;
}
}
-yy1408:
- YYDEBUG(1408, *YYCURSOR);
+yy1376:
+ YYDEBUG(1376, *YYCURSOR);
yych = *++YYCURSOR;
if(yych <= 'R'){
if(yych <= ')'){
if(yych <= '(') goto yy3;
- goto yy132;
+ goto yy136;
} else {
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy137;
- goto yy1409;
+ if(yych <= 'Q') goto yy141;
+ goto yy1377;
}
} else {
if(yych <= 'q'){
- if(yych <= 'Z') goto yy137;
+ if(yych <= 'Z') goto yy141;
if(yych <= '`') goto yy3;
- goto yy137;
+ goto yy141;
} else {
- if(yych <= 'r') goto yy1409;
- if(yych <= 'z') goto yy137;
+ if(yych <= 'r') goto yy1377;
+ if(yych <= 'z') goto yy141;
goto yy3;
}
}
-yy1409:
- YYDEBUG(1409, *YYCURSOR);
+yy1377:
+ YYDEBUG(1377, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'C'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= 'D') goto yy1410;
+ if(yych <= 'D') goto yy1378;
if(yych != 'd') goto yy3;
- goto yy1410;
+ goto yy1378;
}
-yy1410:
- YYDEBUG(1410, *YYCURSOR);
+yy1378:
+ YYDEBUG(1378, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy1411;
+ if(yych == 'A') goto yy1379;
if(yych != 'a') goto yy53;
- goto yy1411;
-yy1411:
- YYDEBUG(1411, *YYCURSOR);
+ goto yy1379;
+yy1379:
+ YYDEBUG(1379, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy1412;
+ if(yych == 'Y') goto yy1380;
if(yych != 'y') goto yy53;
- goto yy1412;
-yy1412:
- YYDEBUG(1412, *YYCURSOR);
+ goto yy1380;
+yy1380:
+ YYDEBUG(1380, *YYCURSOR);
++YYCURSOR;
- goto yy1413;
-yy1413:
- YYDEBUG(1413, *YYCURSOR);
+ goto yy1381;
+yy1381:
+ YYDEBUG(1381, *YYCURSOR);
-#line 870 "ext/date/lib/parse_date.re"
+#line 884 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("yesterday");
TIMELIB_INIT;
@@ -22449,165 +21969,165 @@ yy1413:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 19602 "ext/date/lib/parse_date.c"
-yy1414:
- YYDEBUG(1414, *YYCURSOR);
+#line 19191 "ext/date/lib/parse_date.c"
+yy1382:
+ YYDEBUG(1382, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'S'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'R') goto yy134;
- goto yy1406;
+ if(yych <= 'R') goto yy138;
+ goto yy1374;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy134;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy138;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 's') goto yy1415;
- if(yych <= 'z') goto yy139;
+ if(yych == 's') goto yy1383;
+ if(yych <= 'z') goto yy143;
goto yy3;
}
}
-yy1415:
- YYDEBUG(1415, *YYCURSOR);
+yy1383:
+ YYDEBUG(1383, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'T'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'S') goto yy135;
- goto yy1407;
+ if(yych <= 'S') goto yy139;
+ goto yy1375;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy135;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy139;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 't') goto yy1416;
- if(yych <= 'z') goto yy144;
+ if(yych == 't') goto yy1384;
+ if(yych <= 'z') goto yy148;
goto yy3;
}
}
-yy1416:
- YYDEBUG(1416, *YYCURSOR);
+yy1384:
+ YYDEBUG(1384, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'E'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'D') goto yy136;
- goto yy1408;
+ if(yych <= 'D') goto yy140;
+ goto yy1376;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy136;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'e') goto yy1417;
- if(yych <= 'z') goto yy145;
+ if(yych == 'e') goto yy1385;
+ if(yych <= 'z') goto yy149;
goto yy3;
}
}
-yy1417:
- YYDEBUG(1417, *YYCURSOR);
+yy1385:
+ YYDEBUG(1385, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'R'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= '@') goto yy3;
- if(yych <= 'Q') goto yy137;
- goto yy1409;
+ if(yych <= 'Q') goto yy141;
+ goto yy1377;
}
} else {
if(yych <= '`'){
- if(yych <= 'Z') goto yy137;
- if(yych == '_') goto yy140;
+ if(yych <= 'Z') goto yy141;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'r') goto yy1418;
- if(yych <= 'z') goto yy146;
+ if(yych == 'r') goto yy1386;
+ if(yych <= 'z') goto yy150;
goto yy3;
}
}
-yy1418:
- YYDEBUG(1418, *YYCURSOR);
+yy1386:
+ YYDEBUG(1386, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= 'D'){
if(yych <= '.'){
- if(yych == ')') goto yy132;
+ if(yych == ')') goto yy136;
goto yy3;
} else {
- if(yych <= '/') goto yy140;
+ if(yych <= '/') goto yy144;
if(yych <= 'C') goto yy3;
- goto yy1410;
+ goto yy1378;
}
} else {
if(yych <= '`'){
- if(yych == '_') goto yy140;
+ if(yych == '_') goto yy144;
goto yy3;
} else {
- if(yych == 'd') goto yy1419;
- if(yych <= 'z') goto yy147;
+ if(yych == 'd') goto yy1387;
+ if(yych <= 'z') goto yy151;
goto yy3;
}
}
-yy1419:
- YYDEBUG(1419, *YYCURSOR);
+yy1387:
+ YYDEBUG(1387, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'A') goto yy1411;
- if(yych != 'a') goto yy148;
- goto yy1420;
-yy1420:
- YYDEBUG(1420, *YYCURSOR);
+ if(yych == 'A') goto yy1379;
+ if(yych != 'a') goto yy152;
+ goto yy1388;
+yy1388:
+ YYDEBUG(1388, *YYCURSOR);
yych = *++YYCURSOR;
- if(yych == 'Y') goto yy1412;
- if(yych != 'y') goto yy148;
- goto yy1421;
-yy1421:
- YYDEBUG(1421, *YYCURSOR);
- yyaccept = 26;
+ if(yych == 'Y') goto yy1380;
+ if(yych != 'y') goto yy152;
+ goto yy1389;
+yy1389:
+ YYDEBUG(1389, *YYCURSOR);
+ yyaccept = 29;
yych = *(YYMARKER = ++YYCURSOR);
if(yych <= '^'){
- if(yych == '/') goto yy140;
- goto yy1413;
+ if(yych == '/') goto yy144;
+ goto yy1381;
} else {
- if(yych <= '_') goto yy140;
- if(yych <= '`') goto yy1413;
- if(yych <= 'z') goto yy147;
- goto yy1413;
+ if(yych <= '_') goto yy144;
+ if(yych <= '`') goto yy1381;
+ if(yych <= 'z') goto yy151;
+ goto yy1381;
}
}
}
-#line 1444 "ext/date/lib/parse_date.re"
+#line 1507 "ext/date/lib/parse_date.re"
}
#define YYMAXFILL 29
-timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, timelib_tzdb *tzdb)
+timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb)
{
Scanner in;
int t;
@@ -22620,11 +22140,13 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
in.errors->error_count = 0;
in.errors->error_messages = NULL;
- while (isspace(*s) && s < e) {
- s++;
- }
- while (isspace(*e) && e > s) {
- e--;
+ if (len > 0) {
+ while (isspace(*s) && s < e) {
+ s++;
+ }
+ while (isspace(*e) && e > s) {
+ e--;
+ }
}
if (e - s < 1) {
in.time = timelib_time_ctor();
@@ -22712,7 +22234,7 @@ 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 *tp;
+ const timelib_tz_lookup_table *tp;
tp = zone_search(abbr, gmtoffset, isdst);
if (tp) {
@@ -22722,7 +22244,7 @@ char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
}
}
-timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void)
+const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void)
{
return timelib_timezone_lookup;
}
diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re
index 32501efef..5400cdb14 100644
--- a/ext/date/lib/parse_date.re
+++ b/ext/date/lib/parse_date.re
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: parse_date.re,v 1.26.2.27 2006/04/11 18:03:52 derick Exp $ */
+/* $Id: parse_date.re,v 1.26.2.27.2.6 2006/09/09 12:26:33 derick Exp $ */
#include "timelib.h"
@@ -49,6 +49,7 @@
#define TIMELIB_MONTH 5
#define TIMELIB_YEAR 6
#define TIMELIB_WEEKDAY 7
+#define TIMELIB_SPECIAL 8
#define EOI 257
#define TIME 258
@@ -101,8 +102,9 @@ typedef unsigned char uchar;
#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) { add_error(s, "Double date specification"); timelib_string_free(str); 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_RELATIVE() { s->time->have_relative = 1; s->time->relative.weekday_behavior = 1; }
#define TIMELIB_HAVE_WEEKDAY_RELATIVE() { s->time->have_weekday_relative = 1; }
+#define TIMELIB_HAVE_SPECIAL_RELATIVE() { s->time->have_special_relative = 1; }
#define TIMELIB_HAVE_TZ() { s->cur = cursor; if (s->time->have_zone) { add_warning(s, "Double timezone specification"); timelib_string_free(str); return TIMELIB_ERROR; } else { s->time->have_zone = 1; } }
#define TIMELIB_INIT s->cur = cursor; str = timelib_string(s); ptr = str
@@ -143,7 +145,7 @@ typedef struct Scanner {
struct timelib_error_container *errors;
struct timelib_time *time;
- timelib_tzdb *tzdb;
+ const timelib_tzdb *tzdb;
} Scanner;
typedef struct _timelib_lookup_table {
@@ -161,17 +163,17 @@ typedef struct _timelib_relunit {
#define HOUR(a) (int)(a * 60)
/* The timezone table. */
-static timelib_tz_lookup_table timelib_timezone_lookup[] = {
+const static timelib_tz_lookup_table timelib_timezone_lookup[] = {
#include "timezonemap.h"
{ NULL, 0, 0, NULL },
};
-static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = {
+const static timelib_tz_lookup_table timelib_timezone_fallbackmap[] = {
#include "fallbackmap.h"
{ NULL, 0, 0, NULL },
};
-static timelib_tz_lookup_table timelib_timezone_utc[] = {
+const static timelib_tz_lookup_table timelib_timezone_utc[] = {
{ "utc", 0, 0, "UTC" },
};
@@ -214,6 +216,8 @@ static timelib_relunit const timelib_relunit_lookup[] = {
{ "sunday", TIMELIB_WEEKDAY, 0 },
{ "sun", TIMELIB_WEEKDAY, 0 },
+ { "weekday", TIMELIB_SPECIAL, TIMELIB_SPECIAL_WEEKDAY },
+ { "weekdays", TIMELIB_SPECIAL, TIMELIB_SPECIAL_WEEKDAY },
{ NULL, 0, 0 }
};
@@ -602,14 +606,20 @@ static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, S
s->time->relative.weekday = relunit->multiplier;
s->time->relative.weekday_behavior = behavior;
break;
+
+ case TIMELIB_SPECIAL:
+ TIMELIB_HAVE_SPECIAL_RELATIVE();
+ TIMELIB_UNHAVE_TIME();
+ s->time->special.type = relunit->multiplier;
+ s->time->special.amount = amount;
}
}
-static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst)
+const 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 = NULL;
- timelib_tz_lookup_table *fmp;
+ const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
+ const timelib_tz_lookup_table *fmp;
if (strcasecmp("utc", word) == 0 || strcasecmp("gmt", word) == 0) {
return timelib_timezone_utc;
@@ -648,7 +658,7 @@ 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;
+ const timelib_tz_lookup_table *tp;
while (**ptr != '\0' && **ptr != ')') {
++*ptr;
@@ -670,7 +680,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
return value;
}
-static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, timelib_tzdb *tzdb)
+static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
{
timelib_tzinfo *res;
long retval = 0;
@@ -788,7 +798,8 @@ 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;
+dayspecial = 'weekday' | 'weekdays';
+daytext = dayfull | dayabbr | dayspecial;
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';
@@ -818,6 +829,7 @@ americanshort = month "/" day;
american = month "/" day "/" year;
iso8601dateslash = year4 "/" monthlz "/" daylz "/"?;
dateslash = year4 "/" month "/" day;
+gnudateshorter = year4 "-" month;
gnudateshort = year "-" month "-" day;
iso8601date = year4 "-" monthlz "-" daylz;
pointeddate = day [.\t-] month [.-] year;
@@ -837,8 +849,8 @@ wddx = year4 "-" month "-" day "T" hour24 ":" minute ":" second;
pgydotd = year4 "."? dayofyear;
pgtextshort = monthabbr "-" daylz "-" year;
pgtextreverse = year "-" monthabbr "-" daylz;
-isoweekday = year4 "W" weekofyear [0-7];
-isoweek = year4 "W" weekofyear;
+isoweekday = year4 "-"? "W" weekofyear "-"? [0-7];
+isoweek = year4 "-"? "W" weekofyear;
exif = year4 ":" monthlz ":" daylz " " hour24lz ":" minutelz ":" secondlz;
/* Common Log Format: 10/Oct/2000:13:55:36 -0700 */
@@ -848,6 +860,8 @@ clf = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" sec
timestamp = "@" "-"? [0-9]+;
/* To fix some ambiguities */
+dateshortwithtimeshort12 = datenoyear timeshort12;
+dateshortwithtimelong12 = datenoyear timelong12;
dateshortwithtimeshort = datenoyear timeshort24;
dateshortwithtimelong = datenoyear timelong24;
dateshortwithtimelongtz = datenoyear iso8601normtz;
@@ -860,7 +874,7 @@ reltextunit = (('sec'|'second'|'min'|'minute'|'hour'|'day'|'week'|'fortnight'|'f
relnumber = ([+-]?[ \t]*[0-9]+);
relative = relnumber space? reltextunit;
-relativetext = reltextnumber space? reltextunit;
+relativetext = reltextnumber space reltextunit;
*/
@@ -1081,6 +1095,18 @@ relativetext = reltextnumber space? reltextunit;
return TIMELIB_ISO_DATE;
}
+ gnudateshorter
+ {
+ DEBUG_OUTPUT("gnudateshorter");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->y = timelib_get_nr((char **) &ptr, 4);
+ s->time->m = timelib_get_nr((char **) &ptr, 2);
+ TIMELIB_PROCESS_YEAR(s->time->y);
+ TIMELIB_DEINIT;
+ return TIMELIB_ISO_DATE;
+ }
+
gnudateshort
{
DEBUG_OUTPUT("gnudateshort");
@@ -1328,6 +1354,9 @@ relativetext = reltextnumber space? reltextunit;
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;
+ if (s->time->have_special_relative && s->time->special.type == TIMELIB_SPECIAL_WEEKDAY) {
+ s->time->special.amount = 0 - s->time->special.amount;
+ }
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
@@ -1365,6 +1394,16 @@ relativetext = reltextnumber space? reltextunit;
return TIMELIB_RELATIVE;
}
+ monthfull | monthabbr
+ {
+ DEBUG_OUTPUT("monthtext");
+ TIMELIB_INIT;
+ TIMELIB_HAVE_DATE();
+ s->time->m = timelib_lookup_month((char **) &ptr);
+ TIMELIB_DEINIT;
+ return TIMELIB_DATE_TEXT;
+ }
+
tzcorrection | tz
{
int tz_not_found;
@@ -1379,6 +1418,30 @@ relativetext = reltextnumber space? reltextunit;
return TIMELIB_TIMEZONE;
}
+ dateshortwithtimeshort12 | dateshortwithtimelong12
+ {
+ DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
+ 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 == ':' || *ptr == '.') {
+ s->time->s = timelib_get_nr((char **) &ptr, 2);
+
+ if (*ptr == '.') {
+ s->time->f = timelib_get_frac_nr((char **) &ptr, 8);
+ }
+ }
+
+ s->time->h += timelib_meridian((char **) &ptr, s->time->h);
+ TIMELIB_DEINIT;
+ return TIMELIB_SHORTDATE_WITH_TIME;
+ }
+
dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz
{
int tz_not_found;
@@ -1446,7 +1509,7 @@ relativetext = reltextnumber space? reltextunit;
/*!max:re2c */
-timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, timelib_tzdb *tzdb)
+timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb)
{
Scanner in;
int t;
@@ -1459,11 +1522,13 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
in.errors->error_count = 0;
in.errors->error_messages = NULL;
- while (isspace(*s) && s < e) {
- s++;
- }
- while (isspace(*e) && e > s) {
- e--;
+ if (len > 0) {
+ while (isspace(*s) && s < e) {
+ s++;
+ }
+ while (isspace(*e) && e > s) {
+ e--;
+ }
}
if (e - s < 1) {
in.time = timelib_time_ctor();
@@ -1551,7 +1616,7 @@ 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 *tp;
+ const timelib_tz_lookup_table *tp;
tp = zone_search(abbr, gmtoffset, isdst);
if (tp) {
@@ -1561,7 +1626,7 @@ char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
}
}
-timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void)
+const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void)
{
return timelib_timezone_lookup;
}
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
index ccd30c892..d7a4bf5b9 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: parse_tz.c,v 1.20.2.6 2006/03/18 23:43:48 tony2001 Exp $ */
+/* $Id: parse_tz.c,v 1.20.2.6.2.6 2006/09/01 23:25:29 nlopess Exp $ */
#include "timelib.h"
@@ -192,7 +192,7 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
}
}
-static int tz_search(char *timezone, int left, int right, timelib_tzdb *tzdb)
+static int tz_search(char *timezone, int left, int right, const timelib_tzdb *tzdb)
{
int mid, cmp;
@@ -213,11 +213,11 @@ static int tz_search(char *timezone, int left, int right, timelib_tzdb *tzdb)
}
-static int seek_to_tz_position(char **tzf, char *timezone, timelib_tzdb *tzdb)
+static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
{
int pos;
- pos = tz_search(timezone, 0, tzdb->index_size, tzdb);
+ pos = tz_search(timezone, 0, tzdb->index_size - 1, tzdb);
if (pos == -1) {
return 0;
@@ -227,29 +227,29 @@ static int seek_to_tz_position(char **tzf, char *timezone, timelib_tzdb *tzdb)
return 1;
}
-timelib_tzdb *timelib_builtin_db(void)
+const timelib_tzdb *timelib_builtin_db(void)
{
return &timezonedb_builtin;
}
-timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count)
+const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count)
{
*count = sizeof(timezonedb_idx_builtin) / sizeof(*timezonedb_idx_builtin);
return timezonedb_idx_builtin;
}
-int timelib_timezone_id_is_valid(char *timezone, timelib_tzdb *tzdb)
+int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb)
{
- char *tzf;
- return (seek_to_tz_position((char**) &tzf, timezone, tzdb));
+ const unsigned char *tzf;
+ return (seek_to_tz_position(&tzf, timezone, tzdb));
}
-timelib_tzinfo *timelib_parse_tzfile(char *timezone, timelib_tzdb *tzdb)
+timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb)
{
- char *tzf;
+ const unsigned char *tzf;
timelib_tzinfo *tmp;
- if (seek_to_tz_position((char**) &tzf, timezone, tzdb)) {
+ if (seek_to_tz_position(&tzf, timezone, tzdb)) {
tmp = timelib_tzinfo_ctor(timezone);
read_header((char**) &tzf, tmp);
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c
index f08bbe2ec..f6691f268 100644
--- a/ext/date/lib/timelib.c
+++ b/ext/date/lib/timelib.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: timelib.c,v 1.7.2.4 2006/04/11 18:03:52 derick Exp $ */
+/* $Id: timelib.c,v 1.7.2.4.2.1 2006/05/14 17:36:04 derick Exp $ */
#include "timelib.h"
#include <ctype.h>
@@ -205,6 +205,13 @@ void timelib_dump_date(timelib_time *d, int options)
if (d->have_weekday_relative) {
printf(" / %d.%d", d->relative.weekday, d->relative.weekday_behavior);
}
+ if (d->have_special_relative) {
+ switch (d->special.type) {
+ case TIMELIB_SPECIAL_WEEKDAY:
+ printf(" / %lld weekday", d->special.amount);
+ break;
+ }
+ }
}
printf("\n");
}
diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h
index c6a99afca..4abd4f103 100644
--- a/ext/date/lib/timelib.h
+++ b/ext/date/lib/timelib.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: timelib.h,v 1.10.2.11 2006/04/11 18:03:52 derick Exp $ */
+/* $Id: timelib.h,v 1.10.2.11.2.1 2006/05/14 17:36:04 derick Exp $ */
#ifndef __TIMELIB_H__
#define __TIMELIB_H__
@@ -26,6 +26,8 @@
#define TIMELIB_NONE 0x00
#define TIMELIB_OVERRIDE_TIME 0x01
+#define TIMELIB_SPECIAL_WEEKDAY 0x01
+
#ifndef LONG_MAX
#define LONG_MAX 2147483647L
#endif
@@ -51,10 +53,10 @@ 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 len, timelib_error_container **errors, timelib_tzdb *tzdb);
+timelib_time *timelib_strtotime(char *s, int len, timelib_error_container **errors, const 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);
+const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void);
/* From tm2unixtime.c */
void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi);
@@ -67,14 +69,14 @@ void timelib_update_from_sse(timelib_time *tm);
void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz);
/* From parse_tz.c */
-int timelib_timezone_id_is_valid(char *timezone, timelib_tzdb *tzdb);
-timelib_tzinfo *timelib_parse_tzfile(char *timezone, timelib_tzdb *tzdb);
+int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb);
+timelib_tzinfo *timelib_parse_tzfile(char *timezone, const 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);
timelib_sll timelib_get_current_offset(timelib_time *t);
void timelib_dump_tzinfo(timelib_tzinfo *tz);
-timelib_tzdb *timelib_builtin_db(void);
-timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count);
+const timelib_tzdb *timelib_builtin_db(void);
+const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count);
/* From timelib.c */
timelib_tzinfo* timelib_tzinfo_ctor();
diff --git a/ext/date/lib/timelib_config.h.win32 b/ext/date/lib/timelib_config.h.win32
new file mode 100755
index 000000000..4f88201a6
--- /dev/null
+++ b/ext/date/lib/timelib_config.h.win32
@@ -0,0 +1 @@
+# include "config.w32.h"
diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h
index eb1460319..35de98cd5 100644
--- a/ext/date/lib/timelib_structs.h
+++ b/ext/date/lib/timelib_structs.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: timelib_structs.h,v 1.13.2.6 2006/04/11 18:03:52 derick Exp $ */
+/* $Id: timelib_structs.h,v 1.13.2.6.2.2 2006/05/15 08:54:16 derick Exp $ */
#ifndef __TIMELIB_STRUCTS_H__
#define __TIMELIB_STRUCTS_H__
@@ -74,6 +74,13 @@ typedef signed long long timelib_sll;
#define uint32_t unsigned __int32
#endif
+#if defined(_MSC_VER)
+#define TIMELIB_LL_CONST(n) n ## i64
+#else
+#define TIMELIB_LL_CONST(n) n ## ll
+#endif
+
+
typedef struct ttinfo
{
int32_t offset;
@@ -125,6 +132,11 @@ typedef struct timelib_time_offset {
timelib_sll transistion_time;
} timelib_time_offset;
+typedef struct timelib_special {
+ unsigned int type;
+ timelib_sll amount;
+} timelib_special;
+
typedef struct timelib_time {
timelib_sll y, m, d; /* Year, Month, Day */
timelib_sll h, i, s; /* Hour, mInute, Second */
@@ -134,10 +146,11 @@ typedef struct timelib_time {
timelib_tzinfo *tz_info; /* Timezone structure */
signed int dst; /* Flag if we were parsing a DST zone */
timelib_rel_time relative;
+ timelib_special special;
timelib_sll sse; /* Seconds since epoch */
- unsigned int have_time, have_date, have_zone, have_relative, have_weekday_relative, have_weeknr_day;
+ unsigned int have_time, have_date, have_zone, have_relative, have_weekday_relative, have_special_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 */
@@ -173,20 +186,20 @@ typedef struct _timelib_tzdb_index_entry {
} timelib_tzdb_index_entry;
typedef struct _timelib_tzdb {
- char *version;
- int index_size;
- timelib_tzdb_index_entry *index;
- char *data;
+ char *version;
+ int index_size;
+ const timelib_tzdb_index_entry *index;
+ const unsigned char *data;
} timelib_tzdb;
#define TIMELIB_ZONETYPE_OFFSET 1
#define TIMELIB_ZONETYPE_ABBR 2
#define TIMELIB_ZONETYPE_ID 3
-#define SECS_PER_ERA 12622780800L
-#define SECS_PER_DAY 86400
-#define DAYS_PER_YEAR 365
-#define DAYS_PER_LYEAR 366
+#define SECS_PER_ERA TIMELIB_LL_CONST(12622780800)
+#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))
diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h
index 1831b341c..ac4f78fd9 100644
--- a/ext/date/lib/timezonedb.h
+++ b/ext/date/lib/timezonedb.h
@@ -1,4 +1,4 @@
-timelib_tzdb_index_entry timezonedb_idx_builtin[538] = {
+const timelib_tzdb_index_entry timezonedb_idx_builtin[546] = {
{ "Africa/Abidjan" , 0x000000 },
{ "Africa/Accra" , 0x000049 },
{ "Africa/Addis_Ababa" , 0x0000E5 },
@@ -50,496 +50,504 @@ timelib_tzdb_index_entry timezonedb_idx_builtin[538] = {
{ "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" , 0x008DB8 },
- { "America/Indiana/Indianapolis" , 0x008E6B },
- { "America/Indiana/Knox" , 0x0090C9 },
- { "America/Indiana/Marengo" , 0x00942E },
- { "America/Indiana/Petersburg" , 0x0096A0 },
- { "America/Indiana/Vevay" , 0x009BA5 },
- { "America/Indiana/Vincennes" , 0x009DA9 },
- { "America/Indianapolis" , 0x009947 },
- { "America/Inuvik" , 0x00A011 },
- { "America/Iqaluit" , 0x00A308 },
- { "America/Jamaica" , 0x00A5FA },
- { "America/Jujuy" , 0x00A6B3 },
- { "America/Juneau" , 0x00A847 },
- { "America/Kentucky/Louisville" , 0x00AB9B },
- { "America/Kentucky/Monticello" , 0x00AF84 },
- { "America/Knox_IN" , 0x00B2D7 },
- { "America/La_Paz" , 0x00B63C },
- { "America/Lima" , 0x00B697 },
- { "America/Los_Angeles" , 0x00B733 },
- { "America/Louisville" , 0x00BB2C },
- { "America/Maceio" , 0x00BF15 },
- { "America/Managua" , 0x00C033 },
- { "America/Manaus" , 0x00C0D0 },
- { "America/Martinique" , 0x00C1BC },
- { "America/Mazatlan" , 0x00C21C },
- { "America/Mendoza" , 0x00C455 },
- { "America/Menominee" , 0x00C5F3 },
- { "America/Merida" , 0x00C921 },
- { "America/Mexico_City" , 0x00CB30 },
- { "America/Miquelon" , 0x00CD82 },
- { "America/Moncton" , 0x00CFE8 },
- { "America/Monterrey" , 0x00D456 },
- { "America/Montevideo" , 0x00D659 },
- { "America/Montreal" , 0x00D81F },
- { "America/Montserrat" , 0x00DD03 },
- { "America/Nassau" , 0x00DD4C },
- { "America/New_York" , 0x00E085 },
- { "America/Nipigon" , 0x00E578 },
- { "America/Nome" , 0x00E872 },
- { "America/Noronha" , 0x00EBCB },
- { "America/North_Dakota/Center" , 0x00ECDF },
- { "America/Panama" , 0x00F03C },
- { "America/Pangnirtung" , 0x00F085 },
- { "America/Paramaribo" , 0x00F38F },
- { "America/Phoenix" , 0x00F415 },
- { "America/Port-au-Prince" , 0x00F497 },
- { "America/Port_of_Spain" , 0x00F67F },
- { "America/Porto_Acre" , 0x00F59D },
- { "America/Porto_Velho" , 0x00F6C8 },
- { "America/Puerto_Rico" , 0x00F7AA },
- { "America/Rainy_River" , 0x00F7F8 },
- { "America/Rankin_Inlet" , 0x00FAF2 },
- { "America/Recife" , 0x00FDD8 },
- { "America/Regina" , 0x00FEEC },
- { "America/Rio_Branco" , 0x010069 },
- { "America/Rosario" , 0x01014B },
- { "America/Santiago" , 0x0102D1 },
- { "America/Santo_Domingo" , 0x01064B },
- { "America/Sao_Paulo" , 0x010705 },
- { "America/Scoresbysund" , 0x0109D6 },
- { "America/Shiprock" , 0x010C99 },
- { "America/St_Johns" , 0x011006 },
- { "America/St_Kitts" , 0x011525 },
- { "America/St_Lucia" , 0x01156E },
- { "America/St_Thomas" , 0x0115B7 },
- { "America/St_Vincent" , 0x011600 },
- { "America/Swift_Current" , 0x011649 },
- { "America/Tegucigalpa" , 0x011730 },
- { "America/Thule" , 0x011799 },
- { "America/Thunder_Bay" , 0x0119C4 },
- { "America/Tijuana" , 0x011CDE },
- { "America/Toronto" , 0x01202A },
- { "America/Tortola" , 0x01250E },
- { "America/Vancouver" , 0x012557 },
- { "America/Virgin" , 0x012964 },
- { "America/Whitehorse" , 0x0129AD },
- { "America/Winnipeg" , 0x012CA4 },
- { "America/Yakutat" , 0x0130AD },
- { "America/Yellowknife" , 0x0133E9 },
- { "Antarctica/Casey" , 0x0136C3 },
- { "Antarctica/Davis" , 0x01370C },
- { "Antarctica/DumontDUrville" , 0x013760 },
- { "Antarctica/Mawson" , 0x0137C0 },
- { "Antarctica/McMurdo" , 0x01380A },
- { "Antarctica/Palmer" , 0x013AE4 },
- { "Antarctica/Rothera" , 0x013DED },
- { "Antarctica/South_Pole" , 0x013E37 },
- { "Antarctica/Syowa" , 0x014111 },
- { "Antarctica/Vostok" , 0x01415B },
- { "Arctic/Longyearbyen" , 0x0141A5 },
- { "Asia/Aden" , 0x0144CB },
- { "Asia/Almaty" , 0x014514 },
- { "Asia/Amman" , 0x014679 },
- { "Asia/Anadyr" , 0x01492D },
- { "Asia/Aqtau" , 0x014BF9 },
- { "Asia/Aqtobe" , 0x014DBB },
- { "Asia/Ashgabat" , 0x014F58 },
- { "Asia/Ashkhabad" , 0x015069 },
- { "Asia/Baghdad" , 0x01517A },
- { "Asia/Bahrain" , 0x01540F },
- { "Asia/Baku" , 0x015469 },
- { "Asia/Bangkok" , 0x01574A },
- { "Asia/Beirut" , 0x015793 },
- { "Asia/Bishkek" , 0x015A94 },
- { "Asia/Brunei" , 0x015C34 },
- { "Asia/Calcutta" , 0x015C8A },
- { "Asia/Choibalsan" , 0x015CF7 },
- { "Asia/Chongqing" , 0x015F8B },
- { "Asia/Chungking" , 0x01602E },
- { "Asia/Colombo" , 0x0160D1 },
- { "Asia/Dacca" , 0x01615C },
- { "Asia/Damascus" , 0x0161DF },
- { "Asia/Dhaka" , 0x016523 },
- { "Asia/Dili" , 0x0165A6 },
- { "Asia/Dubai" , 0x016623 },
- { "Asia/Dushanbe" , 0x01666C },
- { "Asia/Gaza" , 0x016763 },
- { "Asia/Harbin" , 0x016AA0 },
- { "Asia/Hong_Kong" , 0x016B5A },
- { "Asia/Hovd" , 0x016D04 },
- { "Asia/Irkutsk" , 0x016F8B },
- { "Asia/Istanbul" , 0x01724F },
- { "Asia/Jakarta" , 0x017630 },
- { "Asia/Jayapura" , 0x0176C0 },
- { "Asia/Jerusalem" , 0x01771F },
- { "Asia/Kabul" , 0x017A42 },
- { "Asia/Kamchatka" , 0x017A87 },
- { "Asia/Karachi" , 0x017D4B },
- { "Asia/Kashgar" , 0x017DE0 },
- { "Asia/Katmandu" , 0x017E90 },
- { "Asia/Krasnoyarsk" , 0x017EEA },
- { "Asia/Kuala_Lumpur" , 0x0181AE },
- { "Asia/Kuching" , 0x01824C },
- { "Asia/Kuwait" , 0x01831F },
- { "Asia/Macao" , 0x018368 },
- { "Asia/Macau" , 0x018497 },
- { "Asia/Magadan" , 0x0185C6 },
- { "Asia/Makassar" , 0x01888A },
- { "Asia/Manila" , 0x0188FA },
- { "Asia/Muscat" , 0x018973 },
- { "Asia/Nicosia" , 0x0189BC },
- { "Asia/Novosibirsk" , 0x018C98 },
- { "Asia/Omsk" , 0x018F69 },
- { "Asia/Oral" , 0x01922D },
- { "Asia/Phnom_Penh" , 0x0193E2 },
- { "Asia/Pontianak" , 0x01944E },
- { "Asia/Pyongyang" , 0x0194EE },
- { "Asia/Qatar" , 0x01954F },
- { "Asia/Qyzylorda" , 0x0195A9 },
- { "Asia/Rangoon" , 0x019753 },
- { "Asia/Riyadh" , 0x0197BF },
- { "Asia/Saigon" , 0x019808 },
- { "Asia/Sakhalin" , 0x019874 },
- { "Asia/Samarkand" , 0x019B4D },
- { "Asia/Seoul" , 0x019C90 },
- { "Asia/Shanghai" , 0x019D28 },
- { "Asia/Singapore" , 0x019DCD },
- { "Asia/Taipei" , 0x019E78 },
- { "Asia/Tashkent" , 0x019F84 },
- { "Asia/Tbilisi" , 0x01A0AC },
- { "Asia/Tehran" , 0x01A25A },
- { "Asia/Tel_Aviv" , 0x01A4D0 },
- { "Asia/Thimbu" , 0x01A7F3 },
- { "Asia/Thimphu" , 0x01A84D },
- { "Asia/Tokyo" , 0x01A8A7 },
- { "Asia/Ujung_Pandang" , 0x01A924 },
- { "Asia/Ulaanbaatar" , 0x01A994 },
- { "Asia/Ulan_Bator" , 0x01AC1B },
- { "Asia/Urumqi" , 0x01AEA2 },
- { "Asia/Vientiane" , 0x01AF45 },
- { "Asia/Vladivostok" , 0x01AFB1 },
- { "Asia/Yakutsk" , 0x01B27C },
- { "Asia/Yekaterinburg" , 0x01B540 },
- { "Asia/Yerevan" , 0x01B82F },
- { "Atlantic/Azores" , 0x01BB27 },
- { "Atlantic/Bermuda" , 0x01C018 },
- { "Atlantic/Canary" , 0x01C2ED },
- { "Atlantic/Cape_Verde" , 0x01C5A9 },
- { "Atlantic/Faeroe" , 0x01C616 },
- { "Atlantic/Jan_Mayen" , 0x01C8AE },
- { "Atlantic/Madeira" , 0x01CBD4 },
- { "Atlantic/Reykjavik" , 0x01D0C2 },
- { "Atlantic/South_Georgia" , 0x01D26F },
- { "Atlantic/St_Helena" , 0x01D56F },
- { "Atlantic/Stanley" , 0x01D2A7 },
- { "Australia/ACT" , 0x01D5B8 },
- { "Australia/Adelaide" , 0x01D8C9 },
- { "Australia/Brisbane" , 0x01DBDA },
- { "Australia/Broken_Hill" , 0x01DC7A },
- { "Australia/Canberra" , 0x01DF90 },
- { "Australia/Currie" , 0x01E2A1 },
- { "Australia/Darwin" , 0x01E5B2 },
- { "Australia/Hobart" , 0x01E61A },
- { "Australia/LHI" , 0x01E953 },
- { "Australia/Lindeman" , 0x01EBE2 },
- { "Australia/Lord_Howe" , 0x01EC9B },
- { "Australia/Melbourne" , 0x01EF2A },
- { "Australia/North" , 0x01F23B },
- { "Australia/NSW" , 0x01F2A3 },
- { "Australia/Perth" , 0x01F5B4 },
- { "Australia/Queensland" , 0x01F640 },
- { "Australia/South" , 0x01F6E0 },
- { "Australia/Sydney" , 0x01F9F1 },
- { "Australia/Tasmania" , 0x01FD02 },
- { "Australia/Victoria" , 0x02003B },
- { "Australia/West" , 0x02034C },
- { "Australia/Yancowinna" , 0x0203D8 },
- { "Brazil/Acre" , 0x0206EE },
- { "Brazil/DeNoronha" , 0x0207D0 },
- { "Brazil/East" , 0x0208E4 },
- { "Brazil/West" , 0x020BB5 },
- { "Canada/Atlantic" , 0x020CA1 },
- { "Canada/Central" , 0x02117D },
- { "Canada/East-Saskatchewan" , 0x021A6A },
- { "Canada/Eastern" , 0x021586 },
- { "Canada/Mountain" , 0x021BE7 },
- { "Canada/Newfoundland" , 0x021F51 },
- { "Canada/Pacific" , 0x022470 },
- { "Canada/Saskatchewan" , 0x02287D },
- { "Canada/Yukon" , 0x0229FA },
- { "CET" , 0x022CF1 },
- { "Chile/Continental" , 0x022FE4 },
- { "Chile/EasterIsland" , 0x02335E },
- { "CST6CDT" , 0x0236A6 },
- { "Cuba" , 0x0239EB },
- { "EET" , 0x023D52 },
- { "Egypt" , 0x023FF9 },
- { "Eire" , 0x0243B4 },
- { "EST" , 0x0248B9 },
- { "EST5EDT" , 0x0248F1 },
- { "Etc/GMT" , 0x024C36 },
- { "Etc/GMT+0" , 0x024CDE },
- { "Etc/GMT+1" , 0x024D50 },
- { "Etc/GMT+10" , 0x024DC5 },
- { "Etc/GMT+11" , 0x024E3B },
- { "Etc/GMT+12" , 0x024EB1 },
- { "Etc/GMT+2" , 0x024F9C },
- { "Etc/GMT+3" , 0x025010 },
- { "Etc/GMT+4" , 0x025084 },
- { "Etc/GMT+5" , 0x0250F8 },
- { "Etc/GMT+6" , 0x02516C },
- { "Etc/GMT+7" , 0x0251E0 },
- { "Etc/GMT+8" , 0x025254 },
- { "Etc/GMT+9" , 0x0252C8 },
- { "Etc/GMT-0" , 0x024CA6 },
- { "Etc/GMT-1" , 0x024D16 },
- { "Etc/GMT-10" , 0x024D8A },
- { "Etc/GMT-11" , 0x024E00 },
- { "Etc/GMT-12" , 0x024E76 },
- { "Etc/GMT-13" , 0x024EEC },
- { "Etc/GMT-14" , 0x024F27 },
- { "Etc/GMT-2" , 0x024F62 },
- { "Etc/GMT-3" , 0x024FD6 },
- { "Etc/GMT-4" , 0x02504A },
- { "Etc/GMT-5" , 0x0250BE },
- { "Etc/GMT-6" , 0x025132 },
- { "Etc/GMT-7" , 0x0251A6 },
- { "Etc/GMT-8" , 0x02521A },
- { "Etc/GMT-9" , 0x02528E },
- { "Etc/GMT0" , 0x024C6E },
- { "Etc/Greenwich" , 0x025302 },
- { "Etc/UCT" , 0x02533A },
- { "Etc/Universal" , 0x025372 },
- { "Etc/UTC" , 0x0253AA },
- { "Etc/Zulu" , 0x0253E2 },
- { "Europe/Amsterdam" , 0x02541A },
- { "Europe/Andorra" , 0x02584C },
- { "Europe/Athens" , 0x025ABC },
- { "Europe/Belfast" , 0x025DF3 },
- { "Europe/Belgrade" , 0x02631E },
- { "Europe/Berlin" , 0x0265D6 },
- { "Europe/Bratislava" , 0x02691B },
- { "Europe/Brussels" , 0x026C41 },
- { "Europe/Bucharest" , 0x02706C },
- { "Europe/Budapest" , 0x02738A },
- { "Europe/Chisinau" , 0x0276EC },
- { "Europe/Copenhagen" , 0x027A6E },
- { "Europe/Dublin" , 0x027D6C },
- { "Europe/Gibraltar" , 0x028271 },
- { "Europe/Helsinki" , 0x0286BC },
- { "Europe/Istanbul" , 0x028966 },
- { "Europe/Kaliningrad" , 0x028D47 },
- { "Europe/Kiev" , 0x029087 },
- { "Europe/Lisbon" , 0x029384 },
- { "Europe/Ljubljana" , 0x029874 },
- { "Europe/London" , 0x029B2C },
- { "Europe/Luxembourg" , 0x02A057 },
- { "Europe/Madrid" , 0x02A4A1 },
- { "Europe/Malta" , 0x02A853 },
- { "Europe/Mariehamn" , 0x02AC00 },
- { "Europe/Minsk" , 0x02AEAA },
- { "Europe/Monaco" , 0x02B1A9 },
- { "Europe/Moscow" , 0x02B5D8 },
- { "Europe/Nicosia" , 0x02B907 },
- { "Europe/Oslo" , 0x02BBE3 },
- { "Europe/Paris" , 0x02BF09 },
- { "Europe/Prague" , 0x02C343 },
- { "Europe/Riga" , 0x02C669 },
- { "Europe/Rome" , 0x02C9A2 },
- { "Europe/Samara" , 0x02CD59 },
- { "Europe/San_Marino" , 0x02D058 },
- { "Europe/Sarajevo" , 0x02D40F },
- { "Europe/Simferopol" , 0x02D6C7 },
- { "Europe/Skopje" , 0x02D9D8 },
- { "Europe/Sofia" , 0x02DC90 },
- { "Europe/Stockholm" , 0x02DF7F },
- { "Europe/Tallinn" , 0x02E222 },
- { "Europe/Tirane" , 0x02E550 },
- { "Europe/Tiraspol" , 0x02E84A },
- { "Europe/Uzhgorod" , 0x02EBCC },
- { "Europe/Vaduz" , 0x02EECF },
- { "Europe/Vatican" , 0x02F156 },
- { "Europe/Vienna" , 0x02F50D },
- { "Europe/Vilnius" , 0x02F82E },
- { "Europe/Warsaw" , 0x02FB61 },
- { "Europe/Zagreb" , 0x02FF31 },
- { "Europe/Zaporozhye" , 0x0301E9 },
- { "Europe/Zurich" , 0x0304F0 },
- { "Factory" , 0x03079D },
- { "GB" , 0x030802 },
- { "GB-Eire" , 0x030D2D },
- { "GMT" , 0x031258 },
- { "GMT+0" , 0x031300 },
- { "GMT-0" , 0x0312C8 },
- { "GMT0" , 0x031290 },
- { "Greenwich" , 0x031338 },
- { "Hongkong" , 0x031370 },
- { "HST" , 0x03151A },
- { "Iceland" , 0x031552 },
- { "Indian/Antananarivo" , 0x0316FF },
- { "Indian/Chagos" , 0x031767 },
- { "Indian/Christmas" , 0x0317BD },
- { "Indian/Cocos" , 0x0317F5 },
- { "Indian/Comoro" , 0x03182D },
- { "Indian/Kerguelen" , 0x031876 },
- { "Indian/Mahe" , 0x0318BF },
- { "Indian/Maldives" , 0x031908 },
- { "Indian/Mauritius" , 0x031951 },
- { "Indian/Mayotte" , 0x03199A },
- { "Indian/Reunion" , 0x0319E3 },
- { "Iran" , 0x031A2C },
- { "Israel" , 0x031CA2 },
- { "Jamaica" , 0x031FC5 },
- { "Japan" , 0x03207E },
- { "Kwajalein" , 0x0320FB },
- { "Libya" , 0x032152 },
- { "MET" , 0x032240 },
- { "Mexico/BajaNorte" , 0x032533 },
- { "Mexico/BajaSur" , 0x03287F },
- { "Mexico/General" , 0x032AB8 },
- { "MST" , 0x032D0A },
- { "MST7MDT" , 0x032D42 },
- { "Navajo" , 0x033087 },
- { "NZ" , 0x0333F4 },
- { "NZ-CHAT" , 0x033766 },
- { "Pacific/Apia" , 0x033A42 },
- { "Pacific/Auckland" , 0x033A9D },
- { "Pacific/Chatham" , 0x033E0F },
- { "Pacific/Easter" , 0x0340EB },
- { "Pacific/Efate" , 0x034433 },
- { "Pacific/Enderbury" , 0x0344ED },
- { "Pacific/Fakaofo" , 0x034540 },
- { "Pacific/Fiji" , 0x034578 },
- { "Pacific/Funafuti" , 0x0345E2 },
- { "Pacific/Galapagos" , 0x03461A },
- { "Pacific/Gambier" , 0x034675 },
- { "Pacific/Guadalcanal" , 0x0346BF },
- { "Pacific/Guam" , 0x034708 },
- { "Pacific/Honolulu" , 0x034752 },
- { "Pacific/Johnston" , 0x0347D4 },
- { "Pacific/Kiritimati" , 0x03480C },
- { "Pacific/Kosrae" , 0x03485F },
- { "Pacific/Kwajalein" , 0x0348AA },
- { "Pacific/Majuro" , 0x034901 },
- { "Pacific/Marquesas" , 0x034946 },
- { "Pacific/Midway" , 0x034990 },
- { "Pacific/Nauru" , 0x034A00 },
- { "Pacific/Niue" , 0x034A6C },
- { "Pacific/Norfolk" , 0x034ABE },
- { "Pacific/Noumea" , 0x034B07 },
- { "Pacific/Pago_Pago" , 0x034B8B },
- { "Pacific/Palau" , 0x034C08 },
- { "Pacific/Pitcairn" , 0x034C40 },
- { "Pacific/Ponape" , 0x034C89 },
- { "Pacific/Port_Moresby" , 0x034CC2 },
- { "Pacific/Rarotonga" , 0x034CFA },
- { "Pacific/Saipan" , 0x034DCA },
- { "Pacific/Samoa" , 0x034E21 },
- { "Pacific/Tahiti" , 0x034E9E },
- { "Pacific/Tarawa" , 0x034EE8 },
- { "Pacific/Tongatapu" , 0x034F21 },
- { "Pacific/Truk" , 0x034FA1 },
- { "Pacific/Wake" , 0x034FDA },
- { "Pacific/Wallis" , 0x035013 },
- { "Pacific/Yap" , 0x03504B },
- { "Poland" , 0x035084 },
- { "Portugal" , 0x035454 },
- { "PRC" , 0x035944 },
- { "PST8PDT" , 0x0359E9 },
- { "ROC" , 0x035D2E },
- { "ROK" , 0x035E3A },
- { "Singapore" , 0x035ED2 },
- { "Turkey" , 0x035F7D },
- { "UCT" , 0x03635E },
- { "Universal" , 0x036396 },
- { "US/Alaska" , 0x0363CE },
- { "US/Aleutian" , 0x036726 },
- { "US/Arizona" , 0x036A80 },
- { "US/Central" , 0x036B02 },
- { "US/East-Indiana" , 0x0374F4 },
- { "US/Eastern" , 0x037001 },
- { "US/Hawaii" , 0x037752 },
- { "US/Indiana-Starke" , 0x0377D4 },
- { "US/Michigan" , 0x037B39 },
- { "US/Mountain" , 0x037E64 },
- { "US/Pacific" , 0x0381D1 },
- { "US/Pacific-New" , 0x0385CA },
- { "US/Samoa" , 0x0389C3 },
- { "UTC" , 0x038A40 },
- { "W-SU" , 0x038D1F },
- { "WET" , 0x038A78 },
- { "Zulu" , 0x03904E },
+ { "Africa/Windhoek" , 0x001BB0 },
+ { "America/Adak" , 0x001DEB },
+ { "America/Anchorage" , 0x002145 },
+ { "America/Anguilla" , 0x0024A2 },
+ { "America/Antigua" , 0x0024EB },
+ { "America/Araguaina" , 0x002545 },
+ { "America/Argentina/Buenos_Aires" , 0x00268B },
+ { "America/Argentina/Catamarca" , 0x002804 },
+ { "America/Argentina/ComodRivadavia" , 0x002994 },
+ { "America/Argentina/Cordoba" , 0x002B24 },
+ { "America/Argentina/Jujuy" , 0x002CAA },
+ { "America/Argentina/La_Rioja" , 0x002E3E },
+ { "America/Argentina/Mendoza" , 0x002FD3 },
+ { "America/Argentina/Rio_Gallegos" , 0x003171 },
+ { "America/Argentina/San_Juan" , 0x003301 },
+ { "America/Argentina/Tucuman" , 0x003496 },
+ { "America/Argentina/Ushuaia" , 0x003626 },
+ { "America/Aruba" , 0x0037B6 },
+ { "America/Asuncion" , 0x003810 },
+ { "America/Atikokan" , 0x003AE9 },
+ { "America/Atka" , 0x003B6F },
+ { "America/Bahia" , 0x003EC9 },
+ { "America/Barbados" , 0x004041 },
+ { "America/Belem" , 0x0040CF },
+ { "America/Belize" , 0x0041B1 },
+ { "America/Blanc-Sablon" , 0x004321 },
+ { "America/Boa_Vista" , 0x004396 },
+ { "America/Bogota" , 0x00448C },
+ { "America/Boise" , 0x0044EC },
+ { "America/Buenos_Aires" , 0x00484E },
+ { "America/Cambridge_Bay" , 0x0049C7 },
+ { "America/Campo_Grande" , 0x004CCA },
+ { "America/Cancun" , 0x004F9B },
+ { "America/Caracas" , 0x0051B6 },
+ { "America/Catamarca" , 0x00520C },
+ { "America/Cayenne" , 0x00539C },
+ { "America/Cayman" , 0x0053F2 },
+ { "America/Chicago" , 0x00543B },
+ { "America/Chihuahua" , 0x00593A },
+ { "America/Coral_Harbour" , 0x005B64 },
+ { "America/Cordoba" , 0x005BEA },
+ { "America/Costa_Rica" , 0x005D70 },
+ { "America/Cuiaba" , 0x005DEE },
+ { "America/Curacao" , 0x0060B5 },
+ { "America/Danmarkshavn" , 0x00610F },
+ { "America/Dawson" , 0x006226 },
+ { "America/Dawson_Creek" , 0x00651D },
+ { "America/Denver" , 0x0066A2 },
+ { "America/Detroit" , 0x006A0F },
+ { "America/Dominica" , 0x006D3A },
+ { "America/Edmonton" , 0x006D83 },
+ { "America/Eirunepe" , 0x0070ED },
+ { "America/El_Salvador" , 0x0071D9 },
+ { "America/Ensenada" , 0x007242 },
+ { "America/Fort_Wayne" , 0x0076B3 },
+ { "America/Fortaleza" , 0x00759F },
+ { "America/Glace_Bay" , 0x007911 },
+ { "America/Godthab" , 0x007C35 },
+ { "America/Goose_Bay" , 0x007EDF },
+ { "America/Grand_Turk" , 0x008367 },
+ { "America/Grenada" , 0x00860A },
+ { "America/Guadeloupe" , 0x008653 },
+ { "America/Guatemala" , 0x00869C },
+ { "America/Guayaquil" , 0x008719 },
+ { "America/Guyana" , 0x008762 },
+ { "America/Halifax" , 0x0087D7 },
+ { "America/Havana" , 0x008CB3 },
+ { "America/Hermosillo" , 0x009010 },
+ { "America/Indiana/Indianapolis" , 0x0090C3 },
+ { "America/Indiana/Knox" , 0x009321 },
+ { "America/Indiana/Marengo" , 0x009686 },
+ { "America/Indiana/Petersburg" , 0x0098F8 },
+ { "America/Indiana/Vevay" , 0x009DFD },
+ { "America/Indiana/Vincennes" , 0x00A001 },
+ { "America/Indianapolis" , 0x009B9F },
+ { "America/Inuvik" , 0x00A269 },
+ { "America/Iqaluit" , 0x00A560 },
+ { "America/Jamaica" , 0x00A852 },
+ { "America/Jujuy" , 0x00A90B },
+ { "America/Juneau" , 0x00AA9F },
+ { "America/Kentucky/Louisville" , 0x00ADF3 },
+ { "America/Kentucky/Monticello" , 0x00B1DC },
+ { "America/Knox_IN" , 0x00B52F },
+ { "America/La_Paz" , 0x00B894 },
+ { "America/Lima" , 0x00B8EF },
+ { "America/Los_Angeles" , 0x00B98B },
+ { "America/Louisville" , 0x00BD84 },
+ { "America/Maceio" , 0x00C16D },
+ { "America/Managua" , 0x00C28B },
+ { "America/Manaus" , 0x00C332 },
+ { "America/Martinique" , 0x00C41E },
+ { "America/Mazatlan" , 0x00C47E },
+ { "America/Mendoza" , 0x00C6B7 },
+ { "America/Menominee" , 0x00C855 },
+ { "America/Merida" , 0x00CB83 },
+ { "America/Mexico_City" , 0x00CD92 },
+ { "America/Miquelon" , 0x00CFE4 },
+ { "America/Moncton" , 0x00D24A },
+ { "America/Monterrey" , 0x00D6B8 },
+ { "America/Montevideo" , 0x00D8BB },
+ { "America/Montreal" , 0x00DBC1 },
+ { "America/Montserrat" , 0x00E0A5 },
+ { "America/Nassau" , 0x00E0EE },
+ { "America/New_York" , 0x00E427 },
+ { "America/Nipigon" , 0x00E91A },
+ { "America/Nome" , 0x00EC14 },
+ { "America/Noronha" , 0x00EF6D },
+ { "America/North_Dakota/Center" , 0x00F081 },
+ { "America/North_Dakota/New_Salem" , 0x00F3DE },
+ { "America/Panama" , 0x00F73B },
+ { "America/Pangnirtung" , 0x00F784 },
+ { "America/Paramaribo" , 0x00FA8E },
+ { "America/Phoenix" , 0x00FB14 },
+ { "America/Port-au-Prince" , 0x00FB96 },
+ { "America/Port_of_Spain" , 0x00FEBE },
+ { "America/Porto_Acre" , 0x00FDDC },
+ { "America/Porto_Velho" , 0x00FF07 },
+ { "America/Puerto_Rico" , 0x00FFE9 },
+ { "America/Rainy_River" , 0x010048 },
+ { "America/Rankin_Inlet" , 0x010342 },
+ { "America/Recife" , 0x010628 },
+ { "America/Regina" , 0x01073C },
+ { "America/Rio_Branco" , 0x0108B9 },
+ { "America/Rosario" , 0x01099B },
+ { "America/Santiago" , 0x010B21 },
+ { "America/Santo_Domingo" , 0x010E9B },
+ { "America/Sao_Paulo" , 0x010F55 },
+ { "America/Scoresbysund" , 0x011226 },
+ { "America/Shiprock" , 0x0114E9 },
+ { "America/St_Johns" , 0x011856 },
+ { "America/St_Kitts" , 0x011D75 },
+ { "America/St_Lucia" , 0x011DBE },
+ { "America/St_Thomas" , 0x011E07 },
+ { "America/St_Vincent" , 0x011E50 },
+ { "America/Swift_Current" , 0x011E99 },
+ { "America/Tegucigalpa" , 0x011F80 },
+ { "America/Thule" , 0x012011 },
+ { "America/Thunder_Bay" , 0x01223C },
+ { "America/Tijuana" , 0x012556 },
+ { "America/Toronto" , 0x0128B3 },
+ { "America/Tortola" , 0x012D97 },
+ { "America/Vancouver" , 0x012DE0 },
+ { "America/Virgin" , 0x0131ED },
+ { "America/Whitehorse" , 0x013236 },
+ { "America/Winnipeg" , 0x01352D },
+ { "America/Yakutat" , 0x01393B },
+ { "America/Yellowknife" , 0x013C77 },
+ { "Antarctica/Casey" , 0x013F51 },
+ { "Antarctica/Davis" , 0x013F9A },
+ { "Antarctica/DumontDUrville" , 0x013FEE },
+ { "Antarctica/Mawson" , 0x01404E },
+ { "Antarctica/McMurdo" , 0x014098 },
+ { "Antarctica/Palmer" , 0x014372 },
+ { "Antarctica/Rothera" , 0x01467B },
+ { "Antarctica/South_Pole" , 0x0146C5 },
+ { "Antarctica/Syowa" , 0x01499F },
+ { "Antarctica/Vostok" , 0x0149E9 },
+ { "Arctic/Longyearbyen" , 0x014A33 },
+ { "Asia/Aden" , 0x014D59 },
+ { "Asia/Almaty" , 0x014DA2 },
+ { "Asia/Amman" , 0x014F07 },
+ { "Asia/Anadyr" , 0x0151BB },
+ { "Asia/Aqtau" , 0x015487 },
+ { "Asia/Aqtobe" , 0x015649 },
+ { "Asia/Ashgabat" , 0x0157E6 },
+ { "Asia/Ashkhabad" , 0x0158F7 },
+ { "Asia/Baghdad" , 0x015A08 },
+ { "Asia/Bahrain" , 0x015C9D },
+ { "Asia/Baku" , 0x015CF7 },
+ { "Asia/Bangkok" , 0x015FD3 },
+ { "Asia/Beirut" , 0x01601C },
+ { "Asia/Bishkek" , 0x01631D },
+ { "Asia/Brunei" , 0x0164BD },
+ { "Asia/Calcutta" , 0x016513 },
+ { "Asia/Choibalsan" , 0x016580 },
+ { "Asia/Chongqing" , 0x016804 },
+ { "Asia/Chungking" , 0x0168A7 },
+ { "Asia/Colombo" , 0x01694A },
+ { "Asia/Dacca" , 0x0169DA },
+ { "Asia/Damascus" , 0x016A5D },
+ { "Asia/Dhaka" , 0x016DA1 },
+ { "Asia/Dili" , 0x016E24 },
+ { "Asia/Dubai" , 0x016EA1 },
+ { "Asia/Dushanbe" , 0x016EEA },
+ { "Asia/Gaza" , 0x016FE1 },
+ { "Asia/Harbin" , 0x01731E },
+ { "Asia/Hong_Kong" , 0x0173D8 },
+ { "Asia/Hovd" , 0x017582 },
+ { "Asia/Irkutsk" , 0x0177F9 },
+ { "Asia/Istanbul" , 0x017ABD },
+ { "Asia/Jakarta" , 0x017E9E },
+ { "Asia/Jayapura" , 0x017F2E },
+ { "Asia/Jerusalem" , 0x017F8D },
+ { "Asia/Kabul" , 0x0182B0 },
+ { "Asia/Kamchatka" , 0x0182F5 },
+ { "Asia/Karachi" , 0x0185B9 },
+ { "Asia/Kashgar" , 0x01864E },
+ { "Asia/Katmandu" , 0x0186FE },
+ { "Asia/Krasnoyarsk" , 0x018758 },
+ { "Asia/Kuala_Lumpur" , 0x018A1C },
+ { "Asia/Kuching" , 0x018ABA },
+ { "Asia/Kuwait" , 0x018B8D },
+ { "Asia/Macao" , 0x018BD6 },
+ { "Asia/Macau" , 0x018D05 },
+ { "Asia/Magadan" , 0x018E34 },
+ { "Asia/Makassar" , 0x0190F8 },
+ { "Asia/Manila" , 0x019168 },
+ { "Asia/Muscat" , 0x0191E1 },
+ { "Asia/Nicosia" , 0x01922A },
+ { "Asia/Novosibirsk" , 0x019506 },
+ { "Asia/Omsk" , 0x0197D7 },
+ { "Asia/Oral" , 0x019A9B },
+ { "Asia/Phnom_Penh" , 0x019C50 },
+ { "Asia/Pontianak" , 0x019CBC },
+ { "Asia/Pyongyang" , 0x019D5C },
+ { "Asia/Qatar" , 0x019DBD },
+ { "Asia/Qyzylorda" , 0x019E17 },
+ { "Asia/Rangoon" , 0x019FC1 },
+ { "Asia/Riyadh" , 0x01A02D },
+ { "Asia/Saigon" , 0x01A076 },
+ { "Asia/Sakhalin" , 0x01A0E2 },
+ { "Asia/Samarkand" , 0x01A3BB },
+ { "Asia/Seoul" , 0x01A4D6 },
+ { "Asia/Shanghai" , 0x01A56E },
+ { "Asia/Singapore" , 0x01A613 },
+ { "Asia/Taipei" , 0x01A6BE },
+ { "Asia/Tashkent" , 0x01A7CA },
+ { "Asia/Tbilisi" , 0x01A8E0 },
+ { "Asia/Tehran" , 0x01AA8E },
+ { "Asia/Tel_Aviv" , 0x01ABC4 },
+ { "Asia/Thimbu" , 0x01AEE7 },
+ { "Asia/Thimphu" , 0x01AF41 },
+ { "Asia/Tokyo" , 0x01AF9B },
+ { "Asia/Ujung_Pandang" , 0x01B018 },
+ { "Asia/Ulaanbaatar" , 0x01B088 },
+ { "Asia/Ulan_Bator" , 0x01B2FF },
+ { "Asia/Urumqi" , 0x01B576 },
+ { "Asia/Vientiane" , 0x01B619 },
+ { "Asia/Vladivostok" , 0x01B685 },
+ { "Asia/Yakutsk" , 0x01B950 },
+ { "Asia/Yekaterinburg" , 0x01BC14 },
+ { "Asia/Yerevan" , 0x01BF03 },
+ { "Atlantic/Azores" , 0x01C1FB },
+ { "Atlantic/Bermuda" , 0x01C6EC },
+ { "Atlantic/Canary" , 0x01C9C1 },
+ { "Atlantic/Cape_Verde" , 0x01CC7D },
+ { "Atlantic/Faeroe" , 0x01CCEA },
+ { "Atlantic/Jan_Mayen" , 0x01CF82 },
+ { "Atlantic/Madeira" , 0x01D2A8 },
+ { "Atlantic/Reykjavik" , 0x01D796 },
+ { "Atlantic/South_Georgia" , 0x01D943 },
+ { "Atlantic/St_Helena" , 0x01DC43 },
+ { "Atlantic/Stanley" , 0x01D97B },
+ { "Australia/ACT" , 0x01DC8C },
+ { "Australia/Adelaide" , 0x01DF9D },
+ { "Australia/Brisbane" , 0x01E2AE },
+ { "Australia/Broken_Hill" , 0x01E34E },
+ { "Australia/Canberra" , 0x01E664 },
+ { "Australia/Currie" , 0x01E975 },
+ { "Australia/Darwin" , 0x01EC86 },
+ { "Australia/Hobart" , 0x01ECEE },
+ { "Australia/LHI" , 0x01F027 },
+ { "Australia/Lindeman" , 0x01F2B6 },
+ { "Australia/Lord_Howe" , 0x01F36F },
+ { "Australia/Melbourne" , 0x01F5FE },
+ { "Australia/North" , 0x01F90F },
+ { "Australia/NSW" , 0x01F977 },
+ { "Australia/Perth" , 0x01FC88 },
+ { "Australia/Queensland" , 0x01FD14 },
+ { "Australia/South" , 0x01FDB4 },
+ { "Australia/Sydney" , 0x0200C5 },
+ { "Australia/Tasmania" , 0x0203D6 },
+ { "Australia/Victoria" , 0x02070F },
+ { "Australia/West" , 0x020A20 },
+ { "Australia/Yancowinna" , 0x020AAC },
+ { "Brazil/Acre" , 0x020DC2 },
+ { "Brazil/DeNoronha" , 0x020EA4 },
+ { "Brazil/East" , 0x020FB8 },
+ { "Brazil/West" , 0x021289 },
+ { "Canada/Atlantic" , 0x021375 },
+ { "Canada/Central" , 0x021851 },
+ { "Canada/East-Saskatchewan" , 0x022143 },
+ { "Canada/Eastern" , 0x021C5F },
+ { "Canada/Mountain" , 0x0222C0 },
+ { "Canada/Newfoundland" , 0x02262A },
+ { "Canada/Pacific" , 0x022B49 },
+ { "Canada/Saskatchewan" , 0x022F56 },
+ { "Canada/Yukon" , 0x0230D3 },
+ { "CET" , 0x0233CA },
+ { "Chile/Continental" , 0x0236BD },
+ { "Chile/EasterIsland" , 0x023A37 },
+ { "CST6CDT" , 0x023D72 },
+ { "Cuba" , 0x0240B7 },
+ { "EET" , 0x024414 },
+ { "Egypt" , 0x0246BB },
+ { "Eire" , 0x024A76 },
+ { "EST" , 0x024F7B },
+ { "EST5EDT" , 0x024FB3 },
+ { "Etc/GMT" , 0x0252F8 },
+ { "Etc/GMT+0" , 0x0253A0 },
+ { "Etc/GMT+1" , 0x025412 },
+ { "Etc/GMT+10" , 0x025487 },
+ { "Etc/GMT+11" , 0x0254FD },
+ { "Etc/GMT+12" , 0x025573 },
+ { "Etc/GMT+2" , 0x02565E },
+ { "Etc/GMT+3" , 0x0256D2 },
+ { "Etc/GMT+4" , 0x025746 },
+ { "Etc/GMT+5" , 0x0257BA },
+ { "Etc/GMT+6" , 0x02582E },
+ { "Etc/GMT+7" , 0x0258A2 },
+ { "Etc/GMT+8" , 0x025916 },
+ { "Etc/GMT+9" , 0x02598A },
+ { "Etc/GMT-0" , 0x025368 },
+ { "Etc/GMT-1" , 0x0253D8 },
+ { "Etc/GMT-10" , 0x02544C },
+ { "Etc/GMT-11" , 0x0254C2 },
+ { "Etc/GMT-12" , 0x025538 },
+ { "Etc/GMT-13" , 0x0255AE },
+ { "Etc/GMT-14" , 0x0255E9 },
+ { "Etc/GMT-2" , 0x025624 },
+ { "Etc/GMT-3" , 0x025698 },
+ { "Etc/GMT-4" , 0x02570C },
+ { "Etc/GMT-5" , 0x025780 },
+ { "Etc/GMT-6" , 0x0257F4 },
+ { "Etc/GMT-7" , 0x025868 },
+ { "Etc/GMT-8" , 0x0258DC },
+ { "Etc/GMT-9" , 0x025950 },
+ { "Etc/GMT0" , 0x025330 },
+ { "Etc/Greenwich" , 0x0259C4 },
+ { "Etc/UCT" , 0x0259FC },
+ { "Etc/Universal" , 0x025A34 },
+ { "Etc/UTC" , 0x025A6C },
+ { "Etc/Zulu" , 0x025AA4 },
+ { "Europe/Amsterdam" , 0x025ADC },
+ { "Europe/Andorra" , 0x025F0E },
+ { "Europe/Athens" , 0x02617E },
+ { "Europe/Belfast" , 0x0264B5 },
+ { "Europe/Belgrade" , 0x0269E0 },
+ { "Europe/Berlin" , 0x026C98 },
+ { "Europe/Bratislava" , 0x026FDD },
+ { "Europe/Brussels" , 0x027303 },
+ { "Europe/Bucharest" , 0x02772E },
+ { "Europe/Budapest" , 0x027A4C },
+ { "Europe/Chisinau" , 0x027DAE },
+ { "Europe/Copenhagen" , 0x028130 },
+ { "Europe/Dublin" , 0x02842E },
+ { "Europe/Gibraltar" , 0x028933 },
+ { "Europe/Guernsey" , 0x028D7E },
+ { "Europe/Helsinki" , 0x0292A9 },
+ { "Europe/Isle_of_Man" , 0x029553 },
+ { "Europe/Istanbul" , 0x029A7E },
+ { "Europe/Jersey" , 0x029E5F },
+ { "Europe/Kaliningrad" , 0x02A38A },
+ { "Europe/Kiev" , 0x02A6CA },
+ { "Europe/Lisbon" , 0x02A9C7 },
+ { "Europe/Ljubljana" , 0x02AEB7 },
+ { "Europe/London" , 0x02B16F },
+ { "Europe/Luxembourg" , 0x02B69A },
+ { "Europe/Madrid" , 0x02BAE4 },
+ { "Europe/Malta" , 0x02BE96 },
+ { "Europe/Mariehamn" , 0x02C243 },
+ { "Europe/Minsk" , 0x02C4ED },
+ { "Europe/Monaco" , 0x02C7EC },
+ { "Europe/Moscow" , 0x02CC1B },
+ { "Europe/Nicosia" , 0x02CF4A },
+ { "Europe/Oslo" , 0x02D226 },
+ { "Europe/Paris" , 0x02D54C },
+ { "Europe/Podgorica" , 0x02D986 },
+ { "Europe/Prague" , 0x02DC3E },
+ { "Europe/Riga" , 0x02DF64 },
+ { "Europe/Rome" , 0x02E29D },
+ { "Europe/Samara" , 0x02E654 },
+ { "Europe/San_Marino" , 0x02E958 },
+ { "Europe/Sarajevo" , 0x02ED0F },
+ { "Europe/Simferopol" , 0x02EFC7 },
+ { "Europe/Skopje" , 0x02F2D8 },
+ { "Europe/Sofia" , 0x02F590 },
+ { "Europe/Stockholm" , 0x02F87F },
+ { "Europe/Tallinn" , 0x02FB22 },
+ { "Europe/Tirane" , 0x02FE50 },
+ { "Europe/Tiraspol" , 0x03014A },
+ { "Europe/Uzhgorod" , 0x0304CC },
+ { "Europe/Vaduz" , 0x0307CF },
+ { "Europe/Vatican" , 0x030A56 },
+ { "Europe/Vienna" , 0x030E0D },
+ { "Europe/Vilnius" , 0x03112E },
+ { "Europe/Volgograd" , 0x031461 },
+ { "Europe/Warsaw" , 0x031747 },
+ { "Europe/Zagreb" , 0x031B1C },
+ { "Europe/Zaporozhye" , 0x031DD4 },
+ { "Europe/Zurich" , 0x0320DB },
+ { "Factory" , 0x032388 },
+ { "GB" , 0x0323ED },
+ { "GB-Eire" , 0x032918 },
+ { "GMT" , 0x032E43 },
+ { "GMT+0" , 0x032EEB },
+ { "GMT-0" , 0x032EB3 },
+ { "GMT0" , 0x032E7B },
+ { "Greenwich" , 0x032F23 },
+ { "Hongkong" , 0x032F5B },
+ { "HST" , 0x033105 },
+ { "Iceland" , 0x03313D },
+ { "Indian/Antananarivo" , 0x0332EA },
+ { "Indian/Chagos" , 0x033352 },
+ { "Indian/Christmas" , 0x0333A8 },
+ { "Indian/Cocos" , 0x0333E0 },
+ { "Indian/Comoro" , 0x033418 },
+ { "Indian/Kerguelen" , 0x033461 },
+ { "Indian/Mahe" , 0x0334AA },
+ { "Indian/Maldives" , 0x0334F3 },
+ { "Indian/Mauritius" , 0x03353C },
+ { "Indian/Mayotte" , 0x033585 },
+ { "Indian/Reunion" , 0x0335CE },
+ { "Iran" , 0x033617 },
+ { "Israel" , 0x03374D },
+ { "Jamaica" , 0x033A70 },
+ { "Japan" , 0x033B29 },
+ { "Kwajalein" , 0x033BA6 },
+ { "Libya" , 0x033BFD },
+ { "MET" , 0x033CEB },
+ { "Mexico/BajaNorte" , 0x033FDE },
+ { "Mexico/BajaSur" , 0x03433B },
+ { "Mexico/General" , 0x034574 },
+ { "MST" , 0x0347C6 },
+ { "MST7MDT" , 0x0347FE },
+ { "Navajo" , 0x034B43 },
+ { "NZ" , 0x034EB0 },
+ { "NZ-CHAT" , 0x035222 },
+ { "Pacific/Apia" , 0x0354FE },
+ { "Pacific/Auckland" , 0x035559 },
+ { "Pacific/Chatham" , 0x0358CB },
+ { "Pacific/Easter" , 0x035BA7 },
+ { "Pacific/Efate" , 0x035EE2 },
+ { "Pacific/Enderbury" , 0x035F9C },
+ { "Pacific/Fakaofo" , 0x035FEF },
+ { "Pacific/Fiji" , 0x036027 },
+ { "Pacific/Funafuti" , 0x036091 },
+ { "Pacific/Galapagos" , 0x0360C9 },
+ { "Pacific/Gambier" , 0x036124 },
+ { "Pacific/Guadalcanal" , 0x03616E },
+ { "Pacific/Guam" , 0x0361B7 },
+ { "Pacific/Honolulu" , 0x036201 },
+ { "Pacific/Johnston" , 0x036283 },
+ { "Pacific/Kiritimati" , 0x0362BB },
+ { "Pacific/Kosrae" , 0x03630E },
+ { "Pacific/Kwajalein" , 0x036359 },
+ { "Pacific/Majuro" , 0x0363B0 },
+ { "Pacific/Marquesas" , 0x0363F5 },
+ { "Pacific/Midway" , 0x03643F },
+ { "Pacific/Nauru" , 0x0364AF },
+ { "Pacific/Niue" , 0x03651B },
+ { "Pacific/Norfolk" , 0x03656D },
+ { "Pacific/Noumea" , 0x0365B6 },
+ { "Pacific/Pago_Pago" , 0x03663A },
+ { "Pacific/Palau" , 0x0366B7 },
+ { "Pacific/Pitcairn" , 0x0366EF },
+ { "Pacific/Ponape" , 0x036738 },
+ { "Pacific/Port_Moresby" , 0x036771 },
+ { "Pacific/Rarotonga" , 0x0367A9 },
+ { "Pacific/Saipan" , 0x036879 },
+ { "Pacific/Samoa" , 0x0368D0 },
+ { "Pacific/Tahiti" , 0x03694D },
+ { "Pacific/Tarawa" , 0x036997 },
+ { "Pacific/Tongatapu" , 0x0369D0 },
+ { "Pacific/Truk" , 0x036A50 },
+ { "Pacific/Wake" , 0x036A89 },
+ { "Pacific/Wallis" , 0x036AC2 },
+ { "Pacific/Yap" , 0x036AFA },
+ { "Poland" , 0x036B33 },
+ { "Portugal" , 0x036F08 },
+ { "PRC" , 0x0373F8 },
+ { "PST8PDT" , 0x03749D },
+ { "ROC" , 0x0377E2 },
+ { "ROK" , 0x0378EE },
+ { "Singapore" , 0x037986 },
+ { "Turkey" , 0x037A31 },
+ { "UCT" , 0x037E12 },
+ { "Universal" , 0x037E4A },
+ { "US/Alaska" , 0x037E82 },
+ { "US/Aleutian" , 0x0381DF },
+ { "US/Arizona" , 0x038539 },
+ { "US/Central" , 0x0385BB },
+ { "US/East-Indiana" , 0x038FAD },
+ { "US/Eastern" , 0x038ABA },
+ { "US/Hawaii" , 0x03920B },
+ { "US/Indiana-Starke" , 0x03928D },
+ { "US/Michigan" , 0x0395F2 },
+ { "US/Mountain" , 0x03991D },
+ { "US/Pacific" , 0x039C8A },
+ { "US/Pacific-New" , 0x03A083 },
+ { "US/Samoa" , 0x03A47C },
+ { "UTC" , 0x03A4F9 },
+ { "W-SU" , 0x03A7D8 },
+ { "WET" , 0x03A531 },
+ { "Zulu" , 0x03AB07 },
};
/* This is a generated file, do not modify */
-unsigned char timelib_timezone_db_data_builtin[233606] = {
+const unsigned char timelib_timezone_db_data_builtin[240447] = {
/* Africa/Abidjan */
@@ -678,7 +686,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x12, 0xFD, 0x50, 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,
@@ -1074,15 +1082,35 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x5B, 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,
+0x42, 0x74, 0x0D, 0xF0, 0x43, 0x3C, 0x80, 0x00, 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, 0x03, 0x04, 0x03, 0x04,
0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 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, 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,
@@ -1185,7 +1213,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x26, 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,
@@ -1231,12 +1259,12 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 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,
+0x70, 0x01, 0x04, 0xFF, 0xFF, 0x81, 0x70, 0x01, 0x09, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x0E, 0xFF,
+0xFF, 0x81, 0x70, 0x01, 0x13, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x18, 0xFF, 0xFF, 0x8F, 0x80, 0x01,
+0x1C, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x21, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x57, 0x54, 0x00,
+0x43, 0x41, 0x50, 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,
@@ -1637,6 +1665,17 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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/Atikokan */
+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, 0x14, 0x9E, 0xB8, 0xA1, 0x80,
+0x9F, 0xC0, 0x3F, 0x70, 0xC8, 0xF8, 0x57, 0x60, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70,
+0xD2, 0x61, 0x09, 0xF0, 0x00, 0x01, 0x00, 0x02, 0x03, 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, 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/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,
@@ -1773,6 +1812,16 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
0x43, 0x53, 0x54, 0x00, 0x43, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+/* America/Blanc-Sablon */
+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, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x9E, 0xB8, 0x85, 0x60,
+0x9F, 0xC0, 0x23, 0x50, 0xCB, 0x88, 0xE2, 0x60, 0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0,
+0x00, 0x01, 0x02, 0x03, 0x01, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00,
+0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x0C, 0x41, 0x44, 0x54,
+0x00, 0x41, 0x53, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x41, 0x50, 0x54, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x00, 0x00, 0x01,
+
/* 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,
@@ -1795,7 +1844,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x2A, 0x03, 0x73, 0x50, 0x2B, 0xBE, 0x5D, 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,
@@ -1954,22 +2003,22 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x45, 0x4D, 0x61, 0xC0, 0x45, 0xE0, 0xFB, 0xB0, 0x47, 0x2D, 0x43, 0xC0, 0x47, 0xC0, 0xDD, 0xB0,
+0x49, 0x0D, 0x25, 0xC0, 0x49, 0xA0, 0xBF, 0xB0, 0x4A, 0xED, 0x07, 0xC0, 0x4B, 0x89, 0xDC, 0x30,
+0x4C, 0xD6, 0x24, 0x40, 0x4D, 0x69, 0xBE, 0x30, 0x4E, 0xB6, 0x06, 0x40, 0x4F, 0x49, 0xA0, 0x30,
+0x50, 0x95, 0xE8, 0x40, 0x51, 0x29, 0x82, 0x30, 0x52, 0x75, 0xCA, 0x40, 0x53, 0x09, 0x64, 0x30,
+0x54, 0x55, 0xAC, 0x40, 0x54, 0xE9, 0x46, 0x30, 0x56, 0x35, 0x8E, 0x40, 0x56, 0xD2, 0x62, 0xB0,
+0x58, 0x1E, 0xAA, 0xC0, 0x58, 0xB2, 0x44, 0xB0, 0x59, 0xFE, 0x8C, 0xC0, 0x5A, 0x92, 0x26, 0xB0,
+0x5B, 0xDE, 0x6E, 0xC0, 0x5C, 0x72, 0x08, 0xB0, 0x5D, 0xBE, 0x50, 0xC0, 0x5E, 0x51, 0xEA, 0xB0,
+0x5F, 0x9E, 0x32, 0xC0, 0x60, 0x3B, 0x07, 0x30, 0x61, 0x87, 0x4F, 0x40, 0x62, 0x1A, 0xE9, 0x30,
+0x63, 0x67, 0x31, 0x40, 0x63, 0xFA, 0xCB, 0x30, 0x65, 0x47, 0x13, 0x40, 0x65, 0xDA, 0xAD, 0x30,
+0x67, 0x26, 0xF5, 0x40, 0x67, 0xBA, 0x8F, 0x30, 0x69, 0x06, 0xD7, 0x40, 0x69, 0x9A, 0x71, 0x30,
+0x6A, 0xE6, 0xB9, 0x40, 0x6B, 0x83, 0x8D, 0xB0, 0x6C, 0xCF, 0xD5, 0xC0, 0x6D, 0x63, 0x6F, 0xB0,
+0x6E, 0xAF, 0xB7, 0xC0, 0x6F, 0x43, 0x51, 0xB0, 0x70, 0x8F, 0x99, 0xC0, 0x71, 0x23, 0x33, 0xB0,
+0x72, 0x6F, 0x7B, 0xC0, 0x73, 0x03, 0x15, 0xB0, 0x74, 0x4F, 0x5D, 0xC0, 0x74, 0xEC, 0x32, 0x30,
+0x76, 0x38, 0x7A, 0x40, 0x76, 0xCC, 0x14, 0x30, 0x78, 0x18, 0x5C, 0x40, 0x78, 0xAB, 0xF6, 0x30,
+0x79, 0xF8, 0x3E, 0x40, 0x7A, 0x8B, 0xD8, 0x30, 0x7B, 0xD8, 0x20, 0x40, 0x7C, 0x6B, 0xBA, 0x30,
+0x7D, 0xB8, 0x02, 0x40, 0x7E, 0x4B, 0x9C, 0x30, 0x7F, 0x97, 0xE4, 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,
@@ -2190,13 +2239,14 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+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, 0x14, 0x9E, 0xB8, 0xA1, 0x80,
+0x9F, 0xC0, 0x3F, 0x70, 0xC8, 0xF8, 0x57, 0x60, 0xCB, 0x88, 0xFE, 0x80, 0xD2, 0x23, 0xF4, 0x70,
+0xD2, 0x61, 0x09, 0xF0, 0x00, 0x01, 0x00, 0x02, 0x03, 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, 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/Cordoba */
0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -2254,23 +2304,23 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x43, 0x51, 0xD0, 0x40, 0x43, 0xF7, 0xDF, 0x30, 0x45, 0x4D, 0x61, 0xC0, 0x45, 0xE0, 0xFB, 0xB0,
+0x47, 0x2D, 0x43, 0xC0, 0x47, 0xC0, 0xDD, 0xB0, 0x49, 0x0D, 0x25, 0xC0, 0x49, 0xA0, 0xBF, 0xB0,
+0x4A, 0xED, 0x07, 0xC0, 0x4B, 0x89, 0xDC, 0x30, 0x4C, 0xD6, 0x24, 0x40, 0x4D, 0x69, 0xBE, 0x30,
+0x4E, 0xB6, 0x06, 0x40, 0x4F, 0x49, 0xA0, 0x30, 0x50, 0x95, 0xE8, 0x40, 0x51, 0x29, 0x82, 0x30,
+0x52, 0x75, 0xCA, 0x40, 0x53, 0x09, 0x64, 0x30, 0x54, 0x55, 0xAC, 0x40, 0x54, 0xE9, 0x46, 0x30,
+0x56, 0x35, 0x8E, 0x40, 0x56, 0xD2, 0x62, 0xB0, 0x58, 0x1E, 0xAA, 0xC0, 0x58, 0xB2, 0x44, 0xB0,
+0x59, 0xFE, 0x8C, 0xC0, 0x5A, 0x92, 0x26, 0xB0, 0x5B, 0xDE, 0x6E, 0xC0, 0x5C, 0x72, 0x08, 0xB0,
+0x5D, 0xBE, 0x50, 0xC0, 0x5E, 0x51, 0xEA, 0xB0, 0x5F, 0x9E, 0x32, 0xC0, 0x60, 0x3B, 0x07, 0x30,
+0x61, 0x87, 0x4F, 0x40, 0x62, 0x1A, 0xE9, 0x30, 0x63, 0x67, 0x31, 0x40, 0x63, 0xFA, 0xCB, 0x30,
+0x65, 0x47, 0x13, 0x40, 0x65, 0xDA, 0xAD, 0x30, 0x67, 0x26, 0xF5, 0x40, 0x67, 0xBA, 0x8F, 0x30,
+0x69, 0x06, 0xD7, 0x40, 0x69, 0x9A, 0x71, 0x30, 0x6A, 0xE6, 0xB9, 0x40, 0x6B, 0x83, 0x8D, 0xB0,
+0x6C, 0xCF, 0xD5, 0xC0, 0x6D, 0x63, 0x6F, 0xB0, 0x6E, 0xAF, 0xB7, 0xC0, 0x6F, 0x43, 0x51, 0xB0,
+0x70, 0x8F, 0x99, 0xC0, 0x71, 0x23, 0x33, 0xB0, 0x72, 0x6F, 0x7B, 0xC0, 0x73, 0x03, 0x15, 0xB0,
+0x74, 0x4F, 0x5D, 0xC0, 0x74, 0xEC, 0x32, 0x30, 0x76, 0x38, 0x7A, 0x40, 0x76, 0xCC, 0x14, 0x30,
+0x78, 0x18, 0x5C, 0x40, 0x78, 0xAB, 0xF6, 0x30, 0x79, 0xF8, 0x3E, 0x40, 0x7A, 0x8B, 0xD8, 0x30,
+0x7B, 0xD8, 0x20, 0x40, 0x7C, 0x6B, 0xBA, 0x30, 0x7D, 0xB8, 0x02, 0x40, 0x7E, 0x4B, 0x9C, 0x30,
+0x7F, 0x97, 0xE4, 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,
@@ -2329,35 +2379,35 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+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, 0x04, 0x01, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 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,
+0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x15, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 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, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
/* America/Dawson_Creek */
@@ -2530,23 +2580,23 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+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, 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,
@@ -2589,58 +2639,59 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+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, 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,
+0xB8, 0x0A, 0xF2, 0xF0, 0xCB, 0xEA, 0x8D, 0x80, 0xD2, 0x23, 0xF4, 0x70, 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, 0x05, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 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, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54,
+0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
/* America/Fortaleza */
0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -2839,22 +2890,22 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x45, 0xF3, 0x7E, 0xFC, 0x47, 0x2D, 0x35, 0xEC, 0x47, 0xD3, 0x60, 0xFC, 0x49, 0x0D, 0x17, 0xEC,
+0x49, 0xB3, 0x42, 0xFC, 0x4A, 0xEC, 0xF9, 0xEC, 0x4B, 0x9C, 0x5F, 0x7C, 0x4C, 0xD6, 0x16, 0x6C,
+0x4D, 0x7C, 0x41, 0x7C, 0x4E, 0xB5, 0xF8, 0x6C, 0x4F, 0x5C, 0x23, 0x7C, 0x50, 0x95, 0xDA, 0x6C,
+0x51, 0x3C, 0x05, 0x7C, 0x52, 0x75, 0xBC, 0x6C, 0x53, 0x1B, 0xE7, 0x7C, 0x54, 0x55, 0x9E, 0x6C,
+0x54, 0xFB, 0xC9, 0x7C, 0x56, 0x35, 0x80, 0x6C, 0x56, 0xE4, 0xE5, 0xFC, 0x58, 0x1E, 0x9C, 0xEC,
+0x58, 0xC4, 0xC7, 0xFC, 0x59, 0xFE, 0x7E, 0xEC, 0x5A, 0xA4, 0xA9, 0xFC, 0x5B, 0xDE, 0x60, 0xEC,
+0x5C, 0x84, 0x8B, 0xFC, 0x5D, 0xBE, 0x42, 0xEC, 0x5E, 0x64, 0x6D, 0xFC, 0x5F, 0x9E, 0x24, 0xEC,
+0x60, 0x4D, 0x8A, 0x7C, 0x61, 0x87, 0x41, 0x6C, 0x62, 0x2D, 0x6C, 0x7C, 0x63, 0x67, 0x23, 0x6C,
+0x64, 0x0D, 0x4E, 0x7C, 0x65, 0x47, 0x05, 0x6C, 0x65, 0xED, 0x30, 0x7C, 0x67, 0x26, 0xE7, 0x6C,
+0x67, 0xCD, 0x12, 0x7C, 0x69, 0x06, 0xC9, 0x6C, 0x69, 0xAC, 0xF4, 0x7C, 0x6A, 0xE6, 0xAB, 0x6C,
+0x6B, 0x96, 0x10, 0xFC, 0x6C, 0xCF, 0xC7, 0xEC, 0x6D, 0x75, 0xF2, 0xFC, 0x6E, 0xAF, 0xA9, 0xEC,
+0x6F, 0x55, 0xD4, 0xFC, 0x70, 0x8F, 0x8B, 0xEC, 0x71, 0x35, 0xB6, 0xFC, 0x72, 0x6F, 0x6D, 0xEC,
+0x73, 0x15, 0x98, 0xFC, 0x74, 0x4F, 0x4F, 0xEC, 0x74, 0xFE, 0xB5, 0x7C, 0x76, 0x38, 0x6C, 0x6C,
+0x76, 0xDE, 0x97, 0x7C, 0x78, 0x18, 0x4E, 0x6C, 0x78, 0xBE, 0x79, 0x7C, 0x79, 0xF8, 0x30, 0x6C,
+0x7A, 0x9E, 0x5B, 0x7C, 0x7B, 0xD8, 0x12, 0x6C, 0x7C, 0x7E, 0x3D, 0x7C, 0x7D, 0xB7, 0xF4, 0x6C,
+0x7E, 0x5E, 0x1F, 0x7C, 0x7F, 0x97, 0xD6, 0x6C, 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,
@@ -2937,12 +2988,12 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x09, 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,
+0x27, 0xEA, 0xEE, 0xE0, 0x28, 0xC8, 0x5C, 0xD0, 0x44, 0x54, 0x52, 0x60, 0x45, 0x1F, 0x4B, 0x50,
+0x02, 0x01, 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,
@@ -3044,7 +3095,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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, 0x9B, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0C, 0xAC, 0x62, 0xC2, 0x80,
+0x00, 0x00, 0x00, 0x99, 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,
@@ -3067,36 +3118,35 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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, 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,
+0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 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, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01,
-0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+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, 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,
+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,
@@ -3431,35 +3481,35 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+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, 0x02, 0x03, 0x01, 0x04, 0x01, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 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,
+0xFF, 0xFF, 0x9D, 0x90, 0x00, 0x15, 0xFF, 0xFF, 0xAB, 0xA0, 0x01, 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, 0x4D, 0x53, 0x54, 0x00, 0x4D, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
/* America/Iqaluit */
@@ -3962,14 +4012,15 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x0F, 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, 0x3F, 0x69, 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,
+0x2B, 0x43, 0xDD, 0xE0, 0x32, 0xC9, 0xEF, 0x50, 0x42, 0x58, 0xC0, 0xE0, 0x43, 0x3F, 0x69, 0x50,
+0x44, 0x54, 0x6E, 0x80, 0x45, 0x1F, 0x59, 0x60, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x02,
+0x01, 0x02, 0x01, 0x03, 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,
@@ -4271,23 +4322,23 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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, 0x45, 0xF3, 0x7E, 0xFC,
-0x47, 0x2D, 0x35, 0xEC, 0x47, 0xD3, 0x60, 0xFC, 0x49, 0x0D, 0x17, 0xEC, 0x49, 0xB3, 0x42, 0xFC,
-0x4A, 0xEC, 0xF9, 0xEC, 0x4B, 0x9C, 0x5F, 0x7C, 0x4C, 0xD6, 0x16, 0x6C, 0x4D, 0x7C, 0x41, 0x7C,
-0x4E, 0xB5, 0xF8, 0x6C, 0x4F, 0x5C, 0x23, 0x7C, 0x50, 0x95, 0xDA, 0x6C, 0x51, 0x3C, 0x05, 0x7C,
-0x52, 0x75, 0xBC, 0x6C, 0x53, 0x1B, 0xE7, 0x7C, 0x54, 0x55, 0x9E, 0x6C, 0x54, 0xFB, 0xC9, 0x7C,
-0x56, 0x35, 0x80, 0x6C, 0x56, 0xE4, 0xE5, 0xFC, 0x58, 0x1E, 0x9C, 0xEC, 0x58, 0xC4, 0xC7, 0xFC,
-0x59, 0xFE, 0x7E, 0xEC, 0x5A, 0xA4, 0xA9, 0xFC, 0x5B, 0xDE, 0x60, 0xEC, 0x5C, 0x84, 0x8B, 0xFC,
-0x5D, 0xBE, 0x42, 0xEC, 0x5E, 0x64, 0x6D, 0xFC, 0x5F, 0x9E, 0x24, 0xEC, 0x60, 0x4D, 0x8A, 0x7C,
-0x61, 0x87, 0x41, 0x6C, 0x62, 0x2D, 0x6C, 0x7C, 0x63, 0x67, 0x23, 0x6C, 0x64, 0x0D, 0x4E, 0x7C,
-0x65, 0x47, 0x05, 0x6C, 0x65, 0xED, 0x30, 0x7C, 0x67, 0x26, 0xE7, 0x6C, 0x67, 0xCD, 0x12, 0x7C,
-0x69, 0x06, 0xC9, 0x6C, 0x69, 0xAC, 0xF4, 0x7C, 0x6A, 0xE6, 0xAB, 0x6C, 0x6B, 0x96, 0x10, 0xFC,
-0x6C, 0xCF, 0xC7, 0xEC, 0x6D, 0x75, 0xF2, 0xFC, 0x6E, 0xAF, 0xA9, 0xEC, 0x6F, 0x55, 0xD4, 0xFC,
-0x70, 0x8F, 0x8B, 0xEC, 0x71, 0x35, 0xB6, 0xFC, 0x72, 0x6F, 0x6D, 0xEC, 0x73, 0x15, 0x98, 0xFC,
-0x74, 0x4F, 0x4F, 0xEC, 0x74, 0xFE, 0xB5, 0x7C, 0x76, 0x38, 0x6C, 0x6C, 0x76, 0xDE, 0x97, 0x7C,
-0x78, 0x18, 0x4E, 0x6C, 0x78, 0xBE, 0x79, 0x7C, 0x79, 0xF8, 0x30, 0x6C, 0x7A, 0x9E, 0x5B, 0x7C,
-0x7B, 0xD8, 0x12, 0x6C, 0x7C, 0x7E, 0x3D, 0x7C, 0x7D, 0xB7, 0xF4, 0x6C, 0x7E, 0x5E, 0x1F, 0x7C,
-0x7F, 0x97, 0xD6, 0x6C, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x43, 0x64, 0x37, 0x6C, 0x44, 0x2F, 0x4C, 0x7C, 0x45, 0x44, 0x19, 0x6C, 0x45, 0xF3, 0x9A, 0xE0,
+0x47, 0x2D, 0x51, 0xD0, 0x47, 0xD3, 0x7C, 0xE0, 0x49, 0x0D, 0x33, 0xD0, 0x49, 0xB3, 0x5E, 0xE0,
+0x4A, 0xED, 0x15, 0xD0, 0x4B, 0x9C, 0x7B, 0x60, 0x4C, 0xD6, 0x32, 0x50, 0x4D, 0x7C, 0x5D, 0x60,
+0x4E, 0xB6, 0x14, 0x50, 0x4F, 0x5C, 0x3F, 0x60, 0x50, 0x95, 0xF6, 0x50, 0x51, 0x3C, 0x21, 0x60,
+0x52, 0x75, 0xD8, 0x50, 0x53, 0x1C, 0x03, 0x60, 0x54, 0x55, 0xBA, 0x50, 0x54, 0xFB, 0xE5, 0x60,
+0x56, 0x35, 0x9C, 0x50, 0x56, 0xE5, 0x01, 0xE0, 0x58, 0x1E, 0xB8, 0xD0, 0x58, 0xC4, 0xE3, 0xE0,
+0x59, 0xFE, 0x9A, 0xD0, 0x5A, 0xA4, 0xC5, 0xE0, 0x5B, 0xDE, 0x7C, 0xD0, 0x5C, 0x84, 0xA7, 0xE0,
+0x5D, 0xBE, 0x5E, 0xD0, 0x5E, 0x64, 0x89, 0xE0, 0x5F, 0x9E, 0x40, 0xD0, 0x60, 0x4D, 0xA6, 0x60,
+0x61, 0x87, 0x5D, 0x50, 0x62, 0x2D, 0x88, 0x60, 0x63, 0x67, 0x3F, 0x50, 0x64, 0x0D, 0x6A, 0x60,
+0x65, 0x47, 0x21, 0x50, 0x65, 0xED, 0x4C, 0x60, 0x67, 0x27, 0x03, 0x50, 0x67, 0xCD, 0x2E, 0x60,
+0x69, 0x06, 0xE5, 0x50, 0x69, 0xAD, 0x10, 0x60, 0x6A, 0xE6, 0xC7, 0x50, 0x6B, 0x96, 0x2C, 0xE0,
+0x6C, 0xCF, 0xE3, 0xD0, 0x6D, 0x76, 0x0E, 0xE0, 0x6E, 0xAF, 0xC5, 0xD0, 0x6F, 0x55, 0xF0, 0xE0,
+0x70, 0x8F, 0xA7, 0xD0, 0x71, 0x35, 0xD2, 0xE0, 0x72, 0x6F, 0x89, 0xD0, 0x73, 0x15, 0xB4, 0xE0,
+0x74, 0x4F, 0x6B, 0xD0, 0x74, 0xFE, 0xD1, 0x60, 0x76, 0x38, 0x88, 0x50, 0x76, 0xDE, 0xB3, 0x60,
+0x78, 0x18, 0x6A, 0x50, 0x78, 0xBE, 0x95, 0x60, 0x79, 0xF8, 0x4C, 0x50, 0x7A, 0x9E, 0x77, 0x60,
+0x7B, 0xD8, 0x2E, 0x50, 0x7C, 0x7E, 0x59, 0x60, 0x7D, 0xB8, 0x10, 0x50, 0x7E, 0x5E, 0x3B, 0x60,
+0x7F, 0x97, 0xF2, 0x50, 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,
@@ -4343,28 +4394,48 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x83, 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,
+0xC9, 0x1D, 0x1E, 0x38, 0xC9, 0xE8, 0x1E, 0x30, 0xCA, 0x8B, 0x9F, 0x38, 0xCB, 0x55, 0x4D, 0xB0,
+0xCD, 0x1E, 0xCD, 0x38, 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, 0x45, 0x1F, 0x4B, 0x50,
+0x45, 0xF3, 0x7E, 0xC0, 0x47, 0x08, 0x67, 0xD0, 0x47, 0xD3, 0x60, 0xC0, 0x48, 0xE8, 0x49, 0xD0,
+0x49, 0xB3, 0x42, 0xC0, 0x4A, 0xC8, 0x2B, 0xD0, 0x4B, 0x9C, 0x5F, 0x40, 0x4C, 0xA8, 0x0D, 0xD0,
+0x4D, 0x7C, 0x41, 0x40, 0x4E, 0x87, 0xEF, 0xD0, 0x4F, 0x5C, 0x23, 0x40, 0x50, 0x71, 0x0C, 0x50,
+0x51, 0x3C, 0x05, 0x40, 0x52, 0x50, 0xEE, 0x50, 0x53, 0x1B, 0xE7, 0x40, 0x54, 0x30, 0xD0, 0x50,
+0x54, 0xFB, 0xC9, 0x40, 0x56, 0x10, 0xB2, 0x50, 0x56, 0xE4, 0xE5, 0xC0, 0x57, 0xF0, 0x94, 0x50,
+0x58, 0xC4, 0xC7, 0xC0, 0x59, 0xD0, 0x76, 0x50, 0x5A, 0xA4, 0xA9, 0xC0, 0x5B, 0xB9, 0x92, 0xD0,
+0x5C, 0x84, 0x8B, 0xC0, 0x5D, 0x99, 0x74, 0xD0, 0x5E, 0x64, 0x6D, 0xC0, 0x5F, 0x79, 0x56, 0xD0,
+0x60, 0x4D, 0x8A, 0x40, 0x61, 0x59, 0x38, 0xD0, 0x62, 0x2D, 0x6C, 0x40, 0x63, 0x39, 0x1A, 0xD0,
+0x64, 0x0D, 0x4E, 0x40, 0x65, 0x18, 0xFC, 0xD0, 0x65, 0xED, 0x30, 0x40, 0x67, 0x02, 0x19, 0x50,
+0x67, 0xCD, 0x12, 0x40, 0x68, 0xE1, 0xFB, 0x50, 0x69, 0xAC, 0xF4, 0x40, 0x6A, 0xC1, 0xDD, 0x50,
+0x6B, 0x96, 0x10, 0xC0, 0x6C, 0xA1, 0xBF, 0x50, 0x6D, 0x75, 0xF2, 0xC0, 0x6E, 0x81, 0xA1, 0x50,
+0x6F, 0x55, 0xD4, 0xC0, 0x70, 0x6A, 0xBD, 0xD0, 0x71, 0x35, 0xB6, 0xC0, 0x72, 0x4A, 0x9F, 0xD0,
+0x73, 0x15, 0x98, 0xC0, 0x74, 0x2A, 0x81, 0xD0, 0x74, 0xFE, 0xB5, 0x40, 0x76, 0x0A, 0x63, 0xD0,
+0x76, 0xDE, 0x97, 0x40, 0x77, 0xEA, 0x45, 0xD0, 0x78, 0xBE, 0x79, 0x40, 0x79, 0xCA, 0x27, 0xD0,
+0x7A, 0x9E, 0x5B, 0x40, 0x7B, 0xB3, 0x44, 0x50, 0x7C, 0x7E, 0x3D, 0x40, 0x7D, 0x93, 0x26, 0x50,
+0x7E, 0x5E, 0x1F, 0x40, 0x7F, 0x73, 0x08, 0x50, 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,
+0x02, 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, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+0x05, 0x04, 0x05, 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, 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,
@@ -4777,6 +4848,62 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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/North_Dakota/New_Salem */
+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, 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, 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, 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, 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,
@@ -4860,7 +4987,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x61, 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,
@@ -4869,8 +4996,28 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+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, 0x03, 0x04, 0x03, 0x04, 0x03,
0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 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, 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,
@@ -4919,10 +5066,11 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+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, 0xCB, 0xF6, 0x32, 0xC0,
+0xD2, 0x23, 0xF4, 0x70, 0xD2, 0x60, 0xED, 0xD0, 0x02, 0x01, 0x00, 0xFF, 0xFF, 0xC7, 0xC0, 0x00,
+0x00, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x04, 0xFF, 0xFF, 0xD5, 0xD0, 0x01, 0x08, 0x41, 0x53, 0x54,
+0x00, 0x41, 0x50, 0x54, 0x00, 0x41, 0x57, 0x54, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00,
/* America/Rainy_River */
0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -5205,22 +5353,22 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x45, 0x4D, 0x53, 0xB0, 0x45, 0xE0, 0xED, 0xA0, 0x47, 0x2D, 0x35, 0xB0, 0x47, 0xC0, 0xCF, 0xA0,
+0x49, 0x0D, 0x17, 0xB0, 0x49, 0xA0, 0xB1, 0xA0, 0x4A, 0xEC, 0xF9, 0xB0, 0x4B, 0x89, 0xCE, 0x20,
+0x4C, 0xD6, 0x16, 0x30, 0x4D, 0x69, 0xB0, 0x20, 0x4E, 0xB5, 0xF8, 0x30, 0x4F, 0x49, 0x92, 0x20,
+0x50, 0x95, 0xDA, 0x30, 0x51, 0x29, 0x74, 0x20, 0x52, 0x75, 0xBC, 0x30, 0x53, 0x09, 0x56, 0x20,
+0x54, 0x55, 0x9E, 0x30, 0x54, 0xE9, 0x38, 0x20, 0x56, 0x35, 0x80, 0x30, 0x56, 0xD2, 0x54, 0xA0,
+0x58, 0x1E, 0x9C, 0xB0, 0x58, 0xB2, 0x36, 0xA0, 0x59, 0xFE, 0x7E, 0xB0, 0x5A, 0x92, 0x18, 0xA0,
+0x5B, 0xDE, 0x60, 0xB0, 0x5C, 0x71, 0xFA, 0xA0, 0x5D, 0xBE, 0x42, 0xB0, 0x5E, 0x51, 0xDC, 0xA0,
+0x5F, 0x9E, 0x24, 0xB0, 0x60, 0x3A, 0xF9, 0x20, 0x61, 0x87, 0x41, 0x30, 0x62, 0x1A, 0xDB, 0x20,
+0x63, 0x67, 0x23, 0x30, 0x63, 0xFA, 0xBD, 0x20, 0x65, 0x47, 0x05, 0x30, 0x65, 0xDA, 0x9F, 0x20,
+0x67, 0x26, 0xE7, 0x30, 0x67, 0xBA, 0x81, 0x20, 0x69, 0x06, 0xC9, 0x30, 0x69, 0x9A, 0x63, 0x20,
+0x6A, 0xE6, 0xAB, 0x30, 0x6B, 0x83, 0x7F, 0xA0, 0x6C, 0xCF, 0xC7, 0xB0, 0x6D, 0x63, 0x61, 0xA0,
+0x6E, 0xAF, 0xA9, 0xB0, 0x6F, 0x43, 0x43, 0xA0, 0x70, 0x8F, 0x8B, 0xB0, 0x71, 0x23, 0x25, 0xA0,
+0x72, 0x6F, 0x6D, 0xB0, 0x73, 0x03, 0x07, 0xA0, 0x74, 0x4F, 0x4F, 0xB0, 0x74, 0xEC, 0x24, 0x20,
+0x76, 0x38, 0x6C, 0x30, 0x76, 0xCC, 0x06, 0x20, 0x78, 0x18, 0x4E, 0x30, 0x78, 0xAB, 0xE8, 0x20,
+0x79, 0xF8, 0x30, 0x30, 0x7A, 0x8B, 0xCA, 0x20, 0x7B, 0xD8, 0x12, 0x30, 0x7C, 0x6B, 0xAC, 0x20,
+0x7D, 0xB7, 0xF4, 0x30, 0x7E, 0x4B, 0x8E, 0x20, 0x7F, 0x97, 0xD6, 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,
@@ -5236,7 +5384,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x9B, 0x80, 0x4C, 0x18,
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,
@@ -5273,7 +5421,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 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, 0x05, 0x04, 0x05, 0x04, 0xFF, 0xFF, 0xEB, 0x68, 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,
@@ -5384,23 +5532,23 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x43, 0x64, 0x30, 0x64, 0x44, 0x2F, 0x45, 0x74, 0x45, 0x44, 0x12, 0x64, 0x45, 0xF3, 0x77, 0xF4,
+0x47, 0x2D, 0x2E, 0xE4, 0x47, 0xD3, 0x59, 0xF4, 0x49, 0x0D, 0x10, 0xE4, 0x49, 0xB3, 0x3B, 0xF4,
+0x4A, 0xEC, 0xF2, 0xE4, 0x4B, 0x9C, 0x58, 0x74, 0x4C, 0xD6, 0x0F, 0x64, 0x4D, 0x7C, 0x3A, 0x74,
+0x4E, 0xB5, 0xF1, 0x64, 0x4F, 0x5C, 0x1C, 0x74, 0x50, 0x95, 0xD3, 0x64, 0x51, 0x3B, 0xFE, 0x74,
+0x52, 0x75, 0xB5, 0x64, 0x53, 0x1B, 0xE0, 0x74, 0x54, 0x55, 0x97, 0x64, 0x54, 0xFB, 0xC2, 0x74,
+0x56, 0x35, 0x79, 0x64, 0x56, 0xE4, 0xDE, 0xF4, 0x58, 0x1E, 0x95, 0xE4, 0x58, 0xC4, 0xC0, 0xF4,
+0x59, 0xFE, 0x77, 0xE4, 0x5A, 0xA4, 0xA2, 0xF4, 0x5B, 0xDE, 0x59, 0xE4, 0x5C, 0x84, 0x84, 0xF4,
+0x5D, 0xBE, 0x3B, 0xE4, 0x5E, 0x64, 0x66, 0xF4, 0x5F, 0x9E, 0x1D, 0xE4, 0x60, 0x4D, 0x83, 0x74,
+0x61, 0x87, 0x3A, 0x64, 0x62, 0x2D, 0x65, 0x74, 0x63, 0x67, 0x1C, 0x64, 0x64, 0x0D, 0x47, 0x74,
+0x65, 0x46, 0xFE, 0x64, 0x65, 0xED, 0x29, 0x74, 0x67, 0x26, 0xE0, 0x64, 0x67, 0xCD, 0x0B, 0x74,
+0x69, 0x06, 0xC2, 0x64, 0x69, 0xAC, 0xED, 0x74, 0x6A, 0xE6, 0xA4, 0x64, 0x6B, 0x96, 0x09, 0xF4,
+0x6C, 0xCF, 0xC0, 0xE4, 0x6D, 0x75, 0xEB, 0xF4, 0x6E, 0xAF, 0xA2, 0xE4, 0x6F, 0x55, 0xCD, 0xF4,
+0x70, 0x8F, 0x84, 0xE4, 0x71, 0x35, 0xAF, 0xF4, 0x72, 0x6F, 0x66, 0xE4, 0x73, 0x15, 0x91, 0xF4,
+0x74, 0x4F, 0x48, 0xE4, 0x74, 0xFE, 0xAE, 0x74, 0x76, 0x38, 0x65, 0x64, 0x76, 0xDE, 0x90, 0x74,
+0x78, 0x18, 0x47, 0x64, 0x78, 0xBE, 0x72, 0x74, 0x79, 0xF8, 0x29, 0x64, 0x7A, 0x9E, 0x54, 0x74,
+0x7B, 0xD8, 0x0B, 0x64, 0x7C, 0x7E, 0x36, 0x74, 0x7D, 0xB7, 0xED, 0x64, 0x7E, 0x5E, 0x18, 0x74,
+0x7F, 0x97, 0xCF, 0x64, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
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,
@@ -5469,11 +5617,14 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x0D, 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,
+0x44, 0x5D, 0x8C, 0xE0, 0x44, 0xD6, 0xC8, 0xD0, 0x46, 0x3D, 0x6E, 0xE0, 0x46, 0xB6, 0xAA, 0xD0,
+0x48, 0x1D, 0x50, 0xE0, 0x48, 0x96, 0x8C, 0xD0, 0x49, 0xFD, 0x32, 0xE0, 0x4A, 0x76, 0x6E, 0xD0,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 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,
@@ -5487,22 +5638,22 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x45, 0xF3, 0x9A, 0xE0, 0x47, 0x2D, 0x51, 0xD0, 0x47, 0xD3, 0x7C, 0xE0, 0x49, 0x0D, 0x33, 0xD0,
+0x49, 0xB3, 0x5E, 0xE0, 0x4A, 0xED, 0x15, 0xD0, 0x4B, 0x9C, 0x7B, 0x60, 0x4C, 0xD6, 0x32, 0x50,
+0x4D, 0x7C, 0x5D, 0x60, 0x4E, 0xB6, 0x14, 0x50, 0x4F, 0x5C, 0x3F, 0x60, 0x50, 0x95, 0xF6, 0x50,
+0x51, 0x3C, 0x21, 0x60, 0x52, 0x75, 0xD8, 0x50, 0x53, 0x1C, 0x03, 0x60, 0x54, 0x55, 0xBA, 0x50,
+0x54, 0xFB, 0xE5, 0x60, 0x56, 0x35, 0x9C, 0x50, 0x56, 0xE5, 0x01, 0xE0, 0x58, 0x1E, 0xB8, 0xD0,
+0x58, 0xC4, 0xE3, 0xE0, 0x59, 0xFE, 0x9A, 0xD0, 0x5A, 0xA4, 0xC5, 0xE0, 0x5B, 0xDE, 0x7C, 0xD0,
+0x5C, 0x84, 0xA7, 0xE0, 0x5D, 0xBE, 0x5E, 0xD0, 0x5E, 0x64, 0x89, 0xE0, 0x5F, 0x9E, 0x40, 0xD0,
+0x60, 0x4D, 0xA6, 0x60, 0x61, 0x87, 0x5D, 0x50, 0x62, 0x2D, 0x88, 0x60, 0x63, 0x67, 0x3F, 0x50,
+0x64, 0x0D, 0x6A, 0x60, 0x65, 0x47, 0x21, 0x50, 0x65, 0xED, 0x4C, 0x60, 0x67, 0x27, 0x03, 0x50,
+0x67, 0xCD, 0x2E, 0x60, 0x69, 0x06, 0xE5, 0x50, 0x69, 0xAD, 0x10, 0x60, 0x6A, 0xE6, 0xC7, 0x50,
+0x6B, 0x96, 0x2C, 0xE0, 0x6C, 0xCF, 0xE3, 0xD0, 0x6D, 0x76, 0x0E, 0xE0, 0x6E, 0xAF, 0xC5, 0xD0,
+0x6F, 0x55, 0xF0, 0xE0, 0x70, 0x8F, 0xA7, 0xD0, 0x71, 0x35, 0xD2, 0xE0, 0x72, 0x6F, 0x89, 0xD0,
+0x73, 0x15, 0xB4, 0xE0, 0x74, 0x4F, 0x6B, 0xD0, 0x74, 0xFE, 0xD1, 0x60, 0x76, 0x38, 0x88, 0x50,
+0x76, 0xDE, 0xB3, 0x60, 0x78, 0x18, 0x6A, 0x50, 0x78, 0xBE, 0x95, 0x60, 0x79, 0xF8, 0x4C, 0x50,
+0x7A, 0x9E, 0x77, 0x60, 0x7B, 0xD8, 0x2E, 0x50, 0x7C, 0x7E, 0x59, 0x60, 0x7D, 0xB8, 0x10, 0x50,
+0x7E, 0x5E, 0x3B, 0x60, 0x7F, 0x97, 0xF2, 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,
@@ -5566,58 +5717,59 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+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, 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,
+0xB8, 0x0A, 0xF2, 0xF0, 0xCB, 0xEA, 0x8D, 0x80, 0xD2, 0x23, 0xF4, 0x70, 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, 0x05, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 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, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54,
+0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
/* America/Toronto */
0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -5742,22 +5894,22 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+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, 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,
@@ -5800,41 +5952,41 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+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, 0x04, 0x01, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 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,
+0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x15, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 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, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 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, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x01, 0xFB, 0xE0,
+0x00, 0x00, 0x00, 0xBA, 0x00, 0x00, 0x00, 0x06, 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,
@@ -5845,17 +5997,17 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x58, 0x00,
+0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x1C, 0x00,
+0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x1A, 0x80,
+0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xDE, 0x80,
+0x08, 0x20, 0xCF, 0x80, 0x09, 0x10, 0xC0, 0x80, 0x0A, 0x00, 0xB1, 0x80, 0x0A, 0xF0, 0xA2, 0x80,
+0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0xA1, 0x00,
+0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x65, 0x00,
+0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x29, 0x00,
+0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x45, 0x80, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x27, 0x80,
+0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xEB, 0x80,
+0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xCD, 0x80, 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,
@@ -5865,38 +6017,38 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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, 0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x7C, 0x00,
-0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x40, 0x00,
-0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x3E, 0x80,
-0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x3D, 0x80, 0x52, 0x76, 0x02, 0x80,
-0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xC6, 0x80,
-0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xC5, 0x00,
-0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x89, 0x00,
-0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x87, 0x80,
-0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x4B, 0x80,
-0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x0F, 0x80,
-0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x49, 0x00, 0x6C, 0xD0, 0x0E, 0x00,
-0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xD2, 0x00,
-0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x96, 0x00,
-0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x94, 0x80,
-0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x58, 0x80,
-0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x1C, 0x80,
-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,
+0x43, 0xB7, 0x6F, 0xE0, 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, 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, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
-0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+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, 0x04, 0x05, 0x04, 0x05, 0x04,
0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
0x05, 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, 0xB9, 0xB0, 0x01, 0x00, 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, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 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, 0x01, 0x00, 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, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
/* America/Yakutat */
0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -5971,22 +6123,22 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+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, 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,
@@ -6301,23 +6453,23 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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, 0x98, 0x4F, 0x60, 0x40, 0x62, 0x04, 0xE0, 0x41, 0x6E, 0xF6, 0xE0,
-0x42, 0x4B, 0x21, 0x60, 0x43, 0x3C, 0x63, 0xE0, 0x44, 0x2B, 0x03, 0x60, 0x45, 0x1C, 0x45, 0xE0,
-0x46, 0x0A, 0xE5, 0x60, 0x46, 0xFC, 0x27, 0xE0, 0x47, 0xEA, 0xC7, 0x60, 0x48, 0xDC, 0x09, 0xE0,
-0x49, 0xCA, 0xA9, 0x60, 0x4A, 0xBB, 0xEB, 0xE0, 0x4B, 0xAA, 0x8B, 0x60, 0x4C, 0x9B, 0xCD, 0xE0,
-0x4D, 0x93, 0xA7, 0xE0, 0x4E, 0x84, 0xEA, 0x60, 0x4F, 0x73, 0x89, 0xE0, 0x50, 0x64, 0xCC, 0x60,
-0x51, 0x53, 0x6B, 0xE0, 0x52, 0x44, 0xAE, 0x60, 0x53, 0x33, 0x4D, 0xE0, 0x54, 0x24, 0x90, 0x60,
-0x55, 0x13, 0x2F, 0xE0, 0x56, 0x04, 0x72, 0x60, 0x56, 0xFC, 0x4C, 0x60, 0x57, 0xED, 0x8E, 0xE0,
-0x58, 0xDC, 0x2E, 0x60, 0x59, 0xCD, 0x70, 0xE0, 0x5A, 0xBC, 0x10, 0x60, 0x5B, 0xAD, 0x52, 0xE0,
-0x5C, 0x9B, 0xF2, 0x60, 0x5D, 0x8D, 0x34, 0xE0, 0x5E, 0x7B, 0xD4, 0x60, 0x5F, 0x6D, 0x16, 0xE0,
-0x60, 0x5B, 0xB6, 0x60, 0x61, 0x4C, 0xF8, 0xE0, 0x62, 0x44, 0xD2, 0xE0, 0x63, 0x36, 0x15, 0x60,
-0x64, 0x24, 0xB4, 0xE0, 0x65, 0x15, 0xF7, 0x60, 0x66, 0x04, 0x96, 0xE0, 0x66, 0xF5, 0xD9, 0x60,
-0x67, 0xE4, 0x78, 0xE0, 0x68, 0xD5, 0xBB, 0x60, 0x69, 0xC4, 0x5A, 0xE0, 0x6A, 0xB5, 0x9D, 0x60,
-0x6B, 0xA4, 0x3C, 0xE0, 0x6C, 0x95, 0x7F, 0x60, 0x6D, 0x8D, 0x59, 0x60, 0x6E, 0x7E, 0x9B, 0xE0,
-0x6F, 0x6D, 0x3B, 0x60, 0x70, 0x5E, 0x7D, 0xE0, 0x71, 0x4D, 0x1D, 0x60, 0x72, 0x3E, 0x5F, 0xE0,
-0x73, 0x2C, 0xFF, 0x60, 0x74, 0x1E, 0x41, 0xE0, 0x75, 0x0C, 0xE1, 0x60, 0x75, 0xFE, 0x23, 0xE0,
-0x76, 0xF5, 0xFD, 0xE0, 0x77, 0xE7, 0x40, 0x60, 0x78, 0xD5, 0xDF, 0xE0, 0x79, 0xC7, 0x22, 0x60,
-0x7A, 0xB5, 0xC1, 0xE0, 0x7B, 0xA7, 0x04, 0x60, 0x7C, 0x95, 0xA3, 0xE0, 0x7D, 0x86, 0xE6, 0x60,
-0x7E, 0x75, 0x85, 0xE0, 0x7F, 0x66, 0xC8, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x42, 0x4B, 0x21, 0x60, 0x43, 0x3C, 0x63, 0xE0, 0x44, 0x2B, 0x03, 0x60, 0x45, 0x41, 0x2F, 0xE0,
+0x46, 0x0A, 0xE5, 0x60, 0x47, 0x21, 0x11, 0xE0, 0x47, 0xEA, 0xC7, 0x60, 0x49, 0x0A, 0x2E, 0x60,
+0x49, 0xCA, 0xA9, 0x60, 0x4A, 0xEA, 0x10, 0x60, 0x4B, 0xAA, 0x8B, 0x60, 0x4C, 0xC9, 0xF2, 0x60,
+0x4D, 0x93, 0xA7, 0xE0, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x73, 0x89, 0xE0, 0x50, 0x89, 0xB6, 0x60,
+0x51, 0x53, 0x6B, 0xE0, 0x52, 0x69, 0x98, 0x60, 0x53, 0x33, 0x4D, 0xE0, 0x54, 0x52, 0xB4, 0xE0,
+0x55, 0x13, 0x2F, 0xE0, 0x56, 0x32, 0x96, 0xE0, 0x56, 0xFC, 0x4C, 0x60, 0x58, 0x12, 0x78, 0xE0,
+0x58, 0xDC, 0x2E, 0x60, 0x59, 0xF2, 0x5A, 0xE0, 0x5A, 0xBC, 0x10, 0x60, 0x5B, 0xD2, 0x3C, 0xE0,
+0x5C, 0x9B, 0xF2, 0x60, 0x5D, 0xB2, 0x1E, 0xE0, 0x5E, 0x7B, 0xD4, 0x60, 0x5F, 0x9B, 0x3B, 0x60,
+0x60, 0x5B, 0xB6, 0x60, 0x61, 0x7B, 0x1D, 0x60, 0x62, 0x44, 0xD2, 0xE0, 0x63, 0x5A, 0xFF, 0x60,
+0x64, 0x24, 0xB4, 0xE0, 0x65, 0x3A, 0xE1, 0x60, 0x66, 0x04, 0x96, 0xE0, 0x67, 0x1A, 0xC3, 0x60,
+0x67, 0xE4, 0x78, 0xE0, 0x69, 0x03, 0xDF, 0xE0, 0x69, 0xC4, 0x5A, 0xE0, 0x6A, 0xE3, 0xC1, 0xE0,
+0x6B, 0xA4, 0x3C, 0xE0, 0x6C, 0xC3, 0xA3, 0xE0, 0x6D, 0x8D, 0x59, 0x60, 0x6E, 0xA3, 0x85, 0xE0,
+0x6F, 0x6D, 0x3B, 0x60, 0x70, 0x83, 0x67, 0xE0, 0x71, 0x4D, 0x1D, 0x60, 0x72, 0x63, 0x49, 0xE0,
+0x73, 0x2C, 0xFF, 0x60, 0x74, 0x4C, 0x66, 0x60, 0x75, 0x0C, 0xE1, 0x60, 0x76, 0x2C, 0x48, 0x60,
+0x76, 0xF5, 0xFD, 0xE0, 0x78, 0x0C, 0x2A, 0x60, 0x78, 0xD5, 0xDF, 0xE0, 0x79, 0xEC, 0x0C, 0x60,
+0x7A, 0xB5, 0xC1, 0xE0, 0x7B, 0xCB, 0xEE, 0x60, 0x7C, 0x95, 0xA3, 0xE0, 0x7D, 0xB5, 0x0A, 0xE0,
+0x7E, 0x75, 0x85, 0xE0, 0x7F, 0x94, 0xEC, 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,
@@ -6531,51 +6683,50 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x70, 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, 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, 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,
+0x29, 0xD4, 0xD0, 0x40, 0x2A, 0xC4, 0xB3, 0x30, 0x31, 0x5D, 0xD9, 0x10, 0x32, 0x72, 0xB4, 0x10,
+0x32, 0xC9, 0x70, 0xC0, 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, 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, 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,
@@ -6683,17 +6834,17 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x05, 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,
+0x1B, 0xBC, 0x22, 0x60, 0x1C, 0xAC, 0x21, 0x70, 0x1D, 0x9C, 0x04, 0x60, 0x1E, 0x8C, 0x03, 0x70,
+0x1F, 0x7B, 0xE6, 0x60, 0x20, 0x6B, 0xE5, 0x70, 0x21, 0x5B, 0xC8, 0x60, 0x22, 0x4B, 0xC7, 0x70,
+0x23, 0x3B, 0xAA, 0x60, 0x24, 0x2B, 0xA9, 0x70, 0x25, 0x1B, 0x8C, 0x60, 0x26, 0x0B, 0x8B, 0x70,
+0x27, 0x04, 0xA8, 0xE0, 0x27, 0xF4, 0xA7, 0xF0, 0x28, 0xE4, 0x8A, 0xE0, 0x29, 0xD4, 0x89, 0xF0,
+0x2A, 0xC4, 0x6C, 0xE0, 0x2B, 0xB4, 0x6B, 0xF0, 0x2C, 0xA4, 0x4E, 0xE0, 0x2D, 0x94, 0x4D, 0xF0,
+0x2E, 0x84, 0x30, 0xE0, 0x2F, 0x74, 0x2F, 0xF0, 0x30, 0x64, 0x12, 0xE0, 0x31, 0x5D, 0x4C, 0x70,
+0x32, 0x4D, 0x2F, 0x60, 0x33, 0x3D, 0x2E, 0x70, 0x34, 0x2D, 0x11, 0x60, 0x35, 0x1D, 0x10, 0x70,
+0x36, 0x0C, 0xF3, 0x60, 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,
@@ -6712,17 +6863,16 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03,
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, 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, 0x00,
0x00, 0x00, 0x00, 0x00,
/* Asia/Chongqing */
@@ -6754,13 +6904,14 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x07, 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,
+0x32, 0x71, 0x00, 0x20, 0x44, 0x3F, 0xEA, 0x28, 0x01, 0x02, 0x03, 0x01, 0x04, 0x05, 0x01, 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,
@@ -6798,7 +6949,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x42, 0x4C, 0x72, 0xE0, 0x43, 0x3D, 0xA7, 0x50, 0x44, 0x2D, 0xA6, 0x60, 0x45, 0x12, 0xFD, 0x50,
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,
@@ -6897,23 +7048,23 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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, 0x5C, 0x81, 0xE0, 0x42, 0x5E, 0xE7, 0xE0, 0x43, 0x41, 0xB7, 0xF0, 0x44, 0x48, 0x04, 0x60,
-0x45, 0x22, 0xEB, 0x70, 0x46, 0x27, 0xE6, 0x60, 0x47, 0x04, 0x1E, 0xF0, 0x48, 0x07, 0xC8, 0x60,
-0x48, 0xE6, 0xA3, 0xF0, 0x49, 0xE7, 0xAA, 0x60, 0x4A, 0xC7, 0xD7, 0x70, 0x4B, 0xC7, 0x8C, 0x60,
-0x4C, 0xA9, 0x0A, 0xF0, 0x4D, 0xA7, 0x6E, 0x60, 0x4E, 0x8A, 0x3E, 0x70, 0x4F, 0x90, 0x8A, 0xE0,
-0x50, 0x6C, 0xC3, 0x70, 0x51, 0x70, 0x6C, 0xE0, 0x52, 0x4D, 0xF6, 0xF0, 0x53, 0x50, 0x4E, 0xE0,
-0x54, 0x2F, 0x2A, 0x70, 0x55, 0x30, 0x30, 0xE0, 0x56, 0x10, 0x5D, 0xF0, 0x57, 0x10, 0x12, 0xE0,
-0x57, 0xF2, 0xE2, 0xF0, 0x58, 0xF9, 0x2F, 0x60, 0x59, 0xD4, 0x16, 0x70, 0x5A, 0xD9, 0x11, 0x60,
-0x5B, 0xB5, 0x49, 0xF0, 0x5C, 0xB8, 0xF3, 0x60, 0x5D, 0x96, 0x7D, 0x70, 0x5E, 0x98, 0xD5, 0x60,
-0x5F, 0x79, 0x02, 0x70, 0x60, 0x78, 0xB7, 0x60, 0x61, 0x5A, 0x35, 0xF0, 0x62, 0x58, 0x99, 0x60,
-0x63, 0x3B, 0x69, 0x70, 0x64, 0x41, 0xB5, 0xE0, 0x65, 0x1C, 0x9C, 0xF0, 0x66, 0x21, 0x97, 0xE0,
-0x66, 0xFF, 0x21, 0xF0, 0x68, 0x01, 0x79, 0xE0, 0x68, 0xE0, 0x55, 0x70, 0x69, 0xE1, 0x5B, 0xE0,
-0x6A, 0xC1, 0x88, 0xF0, 0x6B, 0xC1, 0x3D, 0xE0, 0x6C, 0xA2, 0xBC, 0x70, 0x6D, 0xAA, 0x5A, 0x60,
-0x6E, 0x85, 0x41, 0x70, 0x6F, 0x8A, 0x3C, 0x60, 0x70, 0x66, 0x74, 0xF0, 0x71, 0x6A, 0x1E, 0x60,
-0x72, 0x47, 0xA8, 0x70, 0x73, 0x4A, 0x00, 0x60, 0x74, 0x28, 0xDB, 0xF0, 0x75, 0x29, 0xE2, 0x60,
-0x76, 0x0B, 0x60, 0xF0, 0x77, 0x09, 0xC4, 0x60, 0x77, 0xEC, 0x94, 0x70, 0x78, 0xF2, 0xE0, 0xE0,
-0x79, 0xCD, 0xC7, 0xF0, 0x7A, 0xD2, 0xC2, 0xE0, 0x7B, 0xAE, 0xFB, 0x70, 0x7C, 0xB2, 0xA4, 0xE0,
-0x7D, 0x91, 0x80, 0x70, 0x7E, 0x92, 0x86, 0xE0, 0x7F, 0x72, 0xB3, 0xF0, 0x00, 0x01, 0x00, 0x01,
+0x41, 0x5C, 0x81, 0xE0, 0x42, 0x5E, 0xE7, 0xE0, 0x43, 0x41, 0xB7, 0xF0, 0x44, 0x2D, 0xA6, 0x60,
+0x45, 0x12, 0xFD, 0x50, 0x46, 0x0E, 0xD9, 0xE0, 0x47, 0x17, 0xC9, 0x50, 0x47, 0xF1, 0x5E, 0xE0,
+0x48, 0xF7, 0xAB, 0x50, 0x49, 0xD2, 0x92, 0x60, 0x4A, 0xD7, 0x8D, 0x50, 0x4B, 0xB3, 0xC5, 0xE0,
+0x4C, 0xB7, 0x6F, 0x50, 0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA0, 0x8B, 0xD0, 0x4F, 0x77, 0x7E, 0x60,
+0x50, 0x80, 0x6D, 0xD0, 0x51, 0x58, 0xB1, 0xE0, 0x52, 0x60, 0x4F, 0xD0, 0x53, 0x39, 0xE5, 0x60,
+0x54, 0x40, 0x31, 0xD0, 0x55, 0x1B, 0x18, 0xE0, 0x56, 0x20, 0x13, 0xD0, 0x56, 0xFD, 0x9D, 0xE0,
+0x58, 0x09, 0x30, 0x50, 0x58, 0xDE, 0xD1, 0x60, 0x59, 0xE9, 0x12, 0x50, 0x5A, 0xC0, 0x04, 0xE0,
+0x5B, 0xC8, 0xF4, 0x50, 0x5C, 0xA1, 0x38, 0x60, 0x5D, 0xA8, 0xD6, 0x50, 0x5E, 0x83, 0xBD, 0x60,
+0x5F, 0x88, 0xB8, 0x50, 0x60, 0x64, 0xF0, 0xE0, 0x61, 0x68, 0x9A, 0x50, 0x62, 0x46, 0x24, 0x60,
+0x63, 0x51, 0xB6, 0xD0, 0x64, 0x27, 0x57, 0xE0, 0x65, 0x31, 0x98, 0xD0, 0x66, 0x09, 0xDC, 0xE0,
+0x67, 0x11, 0x7A, 0xD0, 0x67, 0xEB, 0x10, 0x60, 0x68, 0xF1, 0x5C, 0xD0, 0x69, 0xCC, 0x43, 0xE0,
+0x6A, 0xD1, 0x3E, 0xD0, 0x6B, 0xAD, 0x77, 0x60, 0x6C, 0xB1, 0x20, 0xD0, 0x6D, 0x8F, 0xFC, 0x60,
+0x6E, 0x9A, 0x3D, 0x50, 0x6F, 0x71, 0x2F, 0xE0, 0x70, 0x7A, 0x1F, 0x50, 0x71, 0x52, 0x63, 0x60,
+0x72, 0x5A, 0x01, 0x50, 0x73, 0x33, 0x96, 0xE0, 0x74, 0x39, 0xE3, 0x50, 0x75, 0x16, 0x1B, 0xE0,
+0x76, 0x19, 0xC5, 0x50, 0x76, 0xF7, 0x4F, 0x60, 0x78, 0x02, 0xE1, 0xD0, 0x78, 0xD8, 0x82, 0xE0,
+0x79, 0xE2, 0xC3, 0xD0, 0x7A, 0xB9, 0xB6, 0x60, 0x7B, 0xC2, 0xA5, 0xD0, 0x7C, 0x9C, 0x3B, 0x60,
+0x7D, 0xA2, 0x87, 0xD0, 0x7E, 0x7D, 0x6E, 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,
@@ -6973,17 +7124,17 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x04, 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,
+0x1B, 0xBC, 0x3E, 0x80, 0x1C, 0xAC, 0x3D, 0x90, 0x1D, 0x9C, 0x20, 0x80, 0x1E, 0x8C, 0x1F, 0x90,
+0x1F, 0x7C, 0x02, 0x80, 0x20, 0x6C, 0x01, 0x90, 0x21, 0x5B, 0xE4, 0x80, 0x22, 0x4B, 0xE3, 0x90,
+0x23, 0x3B, 0xC6, 0x80, 0x24, 0x2B, 0xC5, 0x90, 0x25, 0x1B, 0xA8, 0x80, 0x26, 0x0B, 0xA7, 0x90,
+0x27, 0x04, 0xC5, 0x00, 0x27, 0xF4, 0xC4, 0x10, 0x28, 0xE4, 0xA7, 0x00, 0x29, 0xD4, 0xA6, 0x10,
+0x2A, 0xC4, 0x89, 0x00, 0x2B, 0xB4, 0x88, 0x10, 0x2C, 0xA4, 0x6B, 0x00, 0x2D, 0x94, 0x6A, 0x10,
+0x2E, 0x84, 0x4D, 0x00, 0x2F, 0x74, 0x4C, 0x10, 0x30, 0x64, 0x2F, 0x00, 0x31, 0x5D, 0x68, 0x90,
+0x32, 0x4D, 0x4B, 0x80, 0x33, 0x3D, 0x4A, 0x90, 0x34, 0x2D, 0x2D, 0x80, 0x35, 0x1D, 0x2C, 0x90,
+0x36, 0x0D, 0x0F, 0x80, 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,
@@ -7002,17 +7153,16 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
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,
+0x4C, 0x4D, 0x54, 0x00, 0x48, 0x4F, 0x56, 0x54, 0x00, 0x48, 0x4F, 0x56, 0x53, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* Asia/Irkutsk */
0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -7801,26 +7951,23 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+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, 0x1D, 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,
+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, 0xBF, 0xD9, 0x20, 0x28, 0xE4, 0xED, 0x50,
+0x29, 0x60, 0xBE, 0x30, 0x01, 0x02, 0x03, 0x04, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x08, 0x07, 0x09, 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, 0x54, 0x60, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50,
+0x00, 0x04, 0x00, 0x00, 0x54, 0x60, 0x01, 0x09, 0x00, 0x00, 0x46, 0x50, 0x00, 0x14, 0x00, 0x00,
+0x54, 0x60, 0x01, 0x18, 0x00, 0x00, 0x46, 0x50, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x41,
+0x4D, 0x54, 0x00, 0x53, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x54, 0x41, 0x53, 0x54, 0x00, 0x55, 0x5A,
+0x54, 0x00, 0x55, 0x5A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 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,
@@ -7881,24 +8028,23 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+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, 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,
+0x29, 0x60, 0xBE, 0x30, 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, 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, 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,
+0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 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,
@@ -7932,7 +8078,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x28, 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,
@@ -7942,29 +8088,9 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x41, 0x4F, 0x2F, 0xB8, 0x42, 0x3F, 0x2E, 0xC8, 0x43, 0x31, 0xB4, 0xB8, 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,
@@ -8062,17 +8188,17 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x04, 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,
+0x1B, 0xBC, 0x30, 0x70, 0x1C, 0xAC, 0x2F, 0x80, 0x1D, 0x9C, 0x12, 0x70, 0x1E, 0x8C, 0x11, 0x80,
+0x1F, 0x7B, 0xF4, 0x70, 0x20, 0x6B, 0xF3, 0x80, 0x21, 0x5B, 0xD6, 0x70, 0x22, 0x4B, 0xD5, 0x80,
+0x23, 0x3B, 0xB8, 0x70, 0x24, 0x2B, 0xB7, 0x80, 0x25, 0x1B, 0x9A, 0x70, 0x26, 0x0B, 0x99, 0x80,
+0x27, 0x04, 0xB6, 0xF0, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xE4, 0x98, 0xF0, 0x29, 0xD4, 0x98, 0x00,
+0x2A, 0xC4, 0x7A, 0xF0, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xA4, 0x5C, 0xF0, 0x2D, 0x94, 0x5C, 0x00,
+0x2E, 0x84, 0x3E, 0xF0, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x64, 0x20, 0xF0, 0x31, 0x5D, 0x5A, 0x80,
+0x32, 0x4D, 0x3D, 0x70, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x2D, 0x1F, 0x70, 0x35, 0x1D, 0x1E, 0x80,
+0x36, 0x0D, 0x01, 0x70, 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,
@@ -8091,31 +8217,30 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
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,
+0x4C, 0x4D, 0x54, 0x00, 0x55, 0x4C, 0x41, 0x54, 0x00, 0x55, 0x4C, 0x41, 0x53, 0x54, 0x00, 0x00,
+0x00, 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,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x04, 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,
+0x1B, 0xBC, 0x30, 0x70, 0x1C, 0xAC, 0x2F, 0x80, 0x1D, 0x9C, 0x12, 0x70, 0x1E, 0x8C, 0x11, 0x80,
+0x1F, 0x7B, 0xF4, 0x70, 0x20, 0x6B, 0xF3, 0x80, 0x21, 0x5B, 0xD6, 0x70, 0x22, 0x4B, 0xD5, 0x80,
+0x23, 0x3B, 0xB8, 0x70, 0x24, 0x2B, 0xB7, 0x80, 0x25, 0x1B, 0x9A, 0x70, 0x26, 0x0B, 0x99, 0x80,
+0x27, 0x04, 0xB6, 0xF0, 0x27, 0xF4, 0xB6, 0x00, 0x28, 0xE4, 0x98, 0xF0, 0x29, 0xD4, 0x98, 0x00,
+0x2A, 0xC4, 0x7A, 0xF0, 0x2B, 0xB4, 0x7A, 0x00, 0x2C, 0xA4, 0x5C, 0xF0, 0x2D, 0x94, 0x5C, 0x00,
+0x2E, 0x84, 0x3E, 0xF0, 0x2F, 0x74, 0x3E, 0x00, 0x30, 0x64, 0x20, 0xF0, 0x31, 0x5D, 0x5A, 0x80,
+0x32, 0x4D, 0x3D, 0x70, 0x33, 0x3D, 0x3C, 0x80, 0x34, 0x2D, 0x1F, 0x70, 0x35, 0x1D, 0x1E, 0x80,
+0x36, 0x0D, 0x01, 0x70, 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,
@@ -8134,17 +8259,16 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
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,
+0x4C, 0x4D, 0x54, 0x00, 0x55, 0x4C, 0x41, 0x54, 0x00, 0x55, 0x4C, 0x41, 0x53, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* Asia/Urumqi */
0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8463,22 +8587,22 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x44, 0x2F, 0x68, 0x60, 0x45, 0x44, 0x35, 0x50, 0x45, 0xF3, 0x9A, 0xE0, 0x47, 0x2D, 0x51, 0xD0,
+0x47, 0xD3, 0x7C, 0xE0, 0x49, 0x0D, 0x33, 0xD0, 0x49, 0xB3, 0x5E, 0xE0, 0x4A, 0xED, 0x15, 0xD0,
+0x4B, 0x9C, 0x7B, 0x60, 0x4C, 0xD6, 0x32, 0x50, 0x4D, 0x7C, 0x5D, 0x60, 0x4E, 0xB6, 0x14, 0x50,
+0x4F, 0x5C, 0x3F, 0x60, 0x50, 0x95, 0xF6, 0x50, 0x51, 0x3C, 0x21, 0x60, 0x52, 0x75, 0xD8, 0x50,
+0x53, 0x1C, 0x03, 0x60, 0x54, 0x55, 0xBA, 0x50, 0x54, 0xFB, 0xE5, 0x60, 0x56, 0x35, 0x9C, 0x50,
+0x56, 0xE5, 0x01, 0xE0, 0x58, 0x1E, 0xB8, 0xD0, 0x58, 0xC4, 0xE3, 0xE0, 0x59, 0xFE, 0x9A, 0xD0,
+0x5A, 0xA4, 0xC5, 0xE0, 0x5B, 0xDE, 0x7C, 0xD0, 0x5C, 0x84, 0xA7, 0xE0, 0x5D, 0xBE, 0x5E, 0xD0,
+0x5E, 0x64, 0x89, 0xE0, 0x5F, 0x9E, 0x40, 0xD0, 0x60, 0x4D, 0xA6, 0x60, 0x61, 0x87, 0x5D, 0x50,
+0x62, 0x2D, 0x88, 0x60, 0x63, 0x67, 0x3F, 0x50, 0x64, 0x0D, 0x6A, 0x60, 0x65, 0x47, 0x21, 0x50,
+0x65, 0xED, 0x4C, 0x60, 0x67, 0x27, 0x03, 0x50, 0x67, 0xCD, 0x2E, 0x60, 0x69, 0x06, 0xE5, 0x50,
+0x69, 0xAD, 0x10, 0x60, 0x6A, 0xE6, 0xC7, 0x50, 0x6B, 0x96, 0x2C, 0xE0, 0x6C, 0xCF, 0xE3, 0xD0,
+0x6D, 0x76, 0x0E, 0xE0, 0x6E, 0xAF, 0xC5, 0xD0, 0x6F, 0x55, 0xF0, 0xE0, 0x70, 0x8F, 0xA7, 0xD0,
+0x71, 0x35, 0xD2, 0xE0, 0x72, 0x6F, 0x89, 0xD0, 0x73, 0x15, 0xB4, 0xE0, 0x74, 0x4F, 0x6B, 0xD0,
+0x74, 0xFE, 0xD1, 0x60, 0x76, 0x38, 0x88, 0x50, 0x76, 0xDE, 0xB3, 0x60, 0x78, 0x18, 0x6A, 0x50,
+0x78, 0xBE, 0x95, 0x60, 0x79, 0xF8, 0x4C, 0x50, 0x7A, 0x9E, 0x77, 0x60, 0x7B, 0xD8, 0x2E, 0x50,
+0x7C, 0x7E, 0x59, 0x60, 0x7D, 0xB8, 0x10, 0x50, 0x7E, 0x5E, 0x3B, 0x60, 0x7F, 0x97, 0xF2, 0x50,
0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
@@ -9716,22 +9840,22 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x45, 0x4D, 0x53, 0xB0, 0x45, 0xE0, 0xED, 0xA0, 0x47, 0x2D, 0x35, 0xB0, 0x47, 0xC0, 0xCF, 0xA0,
+0x49, 0x0D, 0x17, 0xB0, 0x49, 0xA0, 0xB1, 0xA0, 0x4A, 0xEC, 0xF9, 0xB0, 0x4B, 0x89, 0xCE, 0x20,
+0x4C, 0xD6, 0x16, 0x30, 0x4D, 0x69, 0xB0, 0x20, 0x4E, 0xB5, 0xF8, 0x30, 0x4F, 0x49, 0x92, 0x20,
+0x50, 0x95, 0xDA, 0x30, 0x51, 0x29, 0x74, 0x20, 0x52, 0x75, 0xBC, 0x30, 0x53, 0x09, 0x56, 0x20,
+0x54, 0x55, 0x9E, 0x30, 0x54, 0xE9, 0x38, 0x20, 0x56, 0x35, 0x80, 0x30, 0x56, 0xD2, 0x54, 0xA0,
+0x58, 0x1E, 0x9C, 0xB0, 0x58, 0xB2, 0x36, 0xA0, 0x59, 0xFE, 0x7E, 0xB0, 0x5A, 0x92, 0x18, 0xA0,
+0x5B, 0xDE, 0x60, 0xB0, 0x5C, 0x71, 0xFA, 0xA0, 0x5D, 0xBE, 0x42, 0xB0, 0x5E, 0x51, 0xDC, 0xA0,
+0x5F, 0x9E, 0x24, 0xB0, 0x60, 0x3A, 0xF9, 0x20, 0x61, 0x87, 0x41, 0x30, 0x62, 0x1A, 0xDB, 0x20,
+0x63, 0x67, 0x23, 0x30, 0x63, 0xFA, 0xBD, 0x20, 0x65, 0x47, 0x05, 0x30, 0x65, 0xDA, 0x9F, 0x20,
+0x67, 0x26, 0xE7, 0x30, 0x67, 0xBA, 0x81, 0x20, 0x69, 0x06, 0xC9, 0x30, 0x69, 0x9A, 0x63, 0x20,
+0x6A, 0xE6, 0xAB, 0x30, 0x6B, 0x83, 0x7F, 0xA0, 0x6C, 0xCF, 0xC7, 0xB0, 0x6D, 0x63, 0x61, 0xA0,
+0x6E, 0xAF, 0xA9, 0xB0, 0x6F, 0x43, 0x43, 0xA0, 0x70, 0x8F, 0x8B, 0xB0, 0x71, 0x23, 0x25, 0xA0,
+0x72, 0x6F, 0x6D, 0xB0, 0x73, 0x03, 0x07, 0xA0, 0x74, 0x4F, 0x4F, 0xB0, 0x74, 0xEC, 0x24, 0x20,
+0x76, 0x38, 0x6C, 0x30, 0x76, 0xCC, 0x06, 0x20, 0x78, 0x18, 0x4E, 0x30, 0x78, 0xAB, 0xE8, 0x20,
+0x79, 0xF8, 0x30, 0x30, 0x7A, 0x8B, 0xCA, 0x20, 0x7B, 0xD8, 0x12, 0x30, 0x7C, 0x6B, 0xAC, 0x20,
+0x7D, 0xB7, 0xF4, 0x30, 0x7E, 0x4B, 0x8E, 0x20, 0x7F, 0x97, 0xD6, 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,
@@ -9844,7 +9968,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x9B, 0x01, 0xFB, 0xE0,
+0x00, 0x00, 0x00, 0xBA, 0x00, 0x00, 0x00, 0x06, 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,
@@ -9855,17 +9979,17 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0xF9, 0x0F, 0x4A, 0x80, 0xFA, 0x08, 0x76, 0x00, 0xFA, 0xF8, 0x67, 0x00, 0xFB, 0xE8, 0x58, 0x00,
+0xFC, 0xD8, 0x49, 0x00, 0xFD, 0xC8, 0x3A, 0x00, 0xFE, 0xB8, 0x2B, 0x00, 0xFF, 0xA8, 0x1C, 0x00,
+0x00, 0x98, 0x0D, 0x00, 0x01, 0x87, 0xFE, 0x00, 0x02, 0x77, 0xEF, 0x00, 0x03, 0x71, 0x1A, 0x80,
+0x04, 0x61, 0x0B, 0x80, 0x05, 0x50, 0xFC, 0x80, 0x06, 0x40, 0xED, 0x80, 0x07, 0x30, 0xDE, 0x80,
+0x08, 0x20, 0xCF, 0x80, 0x09, 0x10, 0xC0, 0x80, 0x0A, 0x00, 0xB1, 0x80, 0x0A, 0xF0, 0xA2, 0x80,
+0x0B, 0xE0, 0x93, 0x80, 0x0C, 0xD9, 0xBF, 0x00, 0x0D, 0xC0, 0x75, 0x80, 0x0E, 0xB9, 0xA1, 0x00,
+0x0F, 0xA9, 0x92, 0x00, 0x10, 0x99, 0x83, 0x00, 0x11, 0x89, 0x74, 0x00, 0x12, 0x79, 0x65, 0x00,
+0x13, 0x69, 0x56, 0x00, 0x14, 0x59, 0x47, 0x00, 0x15, 0x49, 0x38, 0x00, 0x16, 0x39, 0x29, 0x00,
+0x17, 0x29, 0x1A, 0x00, 0x18, 0x22, 0x45, 0x80, 0x19, 0x08, 0xFC, 0x00, 0x1A, 0x02, 0x27, 0x80,
+0x1A, 0xF2, 0x18, 0x80, 0x1B, 0xE2, 0x09, 0x80, 0x1C, 0xD1, 0xFA, 0x80, 0x1D, 0xC1, 0xEB, 0x80,
+0x1E, 0xB1, 0xDC, 0x80, 0x1F, 0xA1, 0xCD, 0x80, 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,
@@ -9875,38 +9999,38 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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, 0x45, 0xF3, 0xB7, 0x00, 0x47, 0x2D, 0x7C, 0x00,
-0x47, 0xD3, 0x99, 0x00, 0x49, 0x0D, 0x5E, 0x00, 0x49, 0xB3, 0x7B, 0x00, 0x4A, 0xED, 0x40, 0x00,
-0x4B, 0x9C, 0x97, 0x80, 0x4C, 0xD6, 0x5C, 0x80, 0x4D, 0x7C, 0x79, 0x80, 0x4E, 0xB6, 0x3E, 0x80,
-0x4F, 0x5C, 0x5B, 0x80, 0x50, 0x96, 0x20, 0x80, 0x51, 0x3C, 0x3D, 0x80, 0x52, 0x76, 0x02, 0x80,
-0x53, 0x1C, 0x1F, 0x80, 0x54, 0x55, 0xE4, 0x80, 0x54, 0xFC, 0x01, 0x80, 0x56, 0x35, 0xC6, 0x80,
-0x56, 0xE5, 0x1E, 0x00, 0x58, 0x1E, 0xE3, 0x00, 0x58, 0xC5, 0x00, 0x00, 0x59, 0xFE, 0xC5, 0x00,
-0x5A, 0xA4, 0xE2, 0x00, 0x5B, 0xDE, 0xA7, 0x00, 0x5C, 0x84, 0xC4, 0x00, 0x5D, 0xBE, 0x89, 0x00,
-0x5E, 0x64, 0xA6, 0x00, 0x5F, 0x9E, 0x6B, 0x00, 0x60, 0x4D, 0xC2, 0x80, 0x61, 0x87, 0x87, 0x80,
-0x62, 0x2D, 0xA4, 0x80, 0x63, 0x67, 0x69, 0x80, 0x64, 0x0D, 0x86, 0x80, 0x65, 0x47, 0x4B, 0x80,
-0x65, 0xED, 0x68, 0x80, 0x67, 0x27, 0x2D, 0x80, 0x67, 0xCD, 0x4A, 0x80, 0x69, 0x07, 0x0F, 0x80,
-0x69, 0xAD, 0x2C, 0x80, 0x6A, 0xE6, 0xF1, 0x80, 0x6B, 0x96, 0x49, 0x00, 0x6C, 0xD0, 0x0E, 0x00,
-0x6D, 0x76, 0x2B, 0x00, 0x6E, 0xAF, 0xF0, 0x00, 0x6F, 0x56, 0x0D, 0x00, 0x70, 0x8F, 0xD2, 0x00,
-0x71, 0x35, 0xEF, 0x00, 0x72, 0x6F, 0xB4, 0x00, 0x73, 0x15, 0xD1, 0x00, 0x74, 0x4F, 0x96, 0x00,
-0x74, 0xFE, 0xED, 0x80, 0x76, 0x38, 0xB2, 0x80, 0x76, 0xDE, 0xCF, 0x80, 0x78, 0x18, 0x94, 0x80,
-0x78, 0xBE, 0xB1, 0x80, 0x79, 0xF8, 0x76, 0x80, 0x7A, 0x9E, 0x93, 0x80, 0x7B, 0xD8, 0x58, 0x80,
-0x7C, 0x7E, 0x75, 0x80, 0x7D, 0xB8, 0x3A, 0x80, 0x7E, 0x5E, 0x57, 0x80, 0x7F, 0x98, 0x1C, 0x80,
-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,
+0x43, 0xB7, 0x6F, 0xE0, 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, 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, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
+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, 0x04, 0x05, 0x04, 0x05, 0x04,
0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04,
-0x05, 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, 0xB9, 0xB0, 0x01, 0x00, 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, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 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, 0x01, 0x00, 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, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
/* Canada/Eastern */
0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10041,23 +10165,23 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+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, 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,
@@ -10119,23 +10243,23 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x43, 0x64, 0x30, 0x64, 0x44, 0x2F, 0x45, 0x74, 0x45, 0x44, 0x12, 0x64, 0x45, 0xF3, 0x77, 0xF4,
+0x47, 0x2D, 0x2E, 0xE4, 0x47, 0xD3, 0x59, 0xF4, 0x49, 0x0D, 0x10, 0xE4, 0x49, 0xB3, 0x3B, 0xF4,
+0x4A, 0xEC, 0xF2, 0xE4, 0x4B, 0x9C, 0x58, 0x74, 0x4C, 0xD6, 0x0F, 0x64, 0x4D, 0x7C, 0x3A, 0x74,
+0x4E, 0xB5, 0xF1, 0x64, 0x4F, 0x5C, 0x1C, 0x74, 0x50, 0x95, 0xD3, 0x64, 0x51, 0x3B, 0xFE, 0x74,
+0x52, 0x75, 0xB5, 0x64, 0x53, 0x1B, 0xE0, 0x74, 0x54, 0x55, 0x97, 0x64, 0x54, 0xFB, 0xC2, 0x74,
+0x56, 0x35, 0x79, 0x64, 0x56, 0xE4, 0xDE, 0xF4, 0x58, 0x1E, 0x95, 0xE4, 0x58, 0xC4, 0xC0, 0xF4,
+0x59, 0xFE, 0x77, 0xE4, 0x5A, 0xA4, 0xA2, 0xF4, 0x5B, 0xDE, 0x59, 0xE4, 0x5C, 0x84, 0x84, 0xF4,
+0x5D, 0xBE, 0x3B, 0xE4, 0x5E, 0x64, 0x66, 0xF4, 0x5F, 0x9E, 0x1D, 0xE4, 0x60, 0x4D, 0x83, 0x74,
+0x61, 0x87, 0x3A, 0x64, 0x62, 0x2D, 0x65, 0x74, 0x63, 0x67, 0x1C, 0x64, 0x64, 0x0D, 0x47, 0x74,
+0x65, 0x46, 0xFE, 0x64, 0x65, 0xED, 0x29, 0x74, 0x67, 0x26, 0xE0, 0x64, 0x67, 0xCD, 0x0B, 0x74,
+0x69, 0x06, 0xC2, 0x64, 0x69, 0xAC, 0xED, 0x74, 0x6A, 0xE6, 0xA4, 0x64, 0x6B, 0x96, 0x09, 0xF4,
+0x6C, 0xCF, 0xC0, 0xE4, 0x6D, 0x75, 0xEB, 0xF4, 0x6E, 0xAF, 0xA2, 0xE4, 0x6F, 0x55, 0xCD, 0xF4,
+0x70, 0x8F, 0x84, 0xE4, 0x71, 0x35, 0xAF, 0xF4, 0x72, 0x6F, 0x66, 0xE4, 0x73, 0x15, 0x91, 0xF4,
+0x74, 0x4F, 0x48, 0xE4, 0x74, 0xFE, 0xAE, 0x74, 0x76, 0x38, 0x65, 0x64, 0x76, 0xDE, 0x90, 0x74,
+0x78, 0x18, 0x47, 0x64, 0x78, 0xBE, 0x72, 0x74, 0x79, 0xF8, 0x29, 0x64, 0x7A, 0x9E, 0x54, 0x74,
+0x7B, 0xD8, 0x0B, 0x64, 0x7C, 0x7E, 0x36, 0x74, 0x7D, 0xB7, 0xED, 0x64, 0x7E, 0x5E, 0x18, 0x74,
+0x7F, 0x97, 0xCF, 0x64, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
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,
@@ -10191,22 +10315,22 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+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, 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,
@@ -10268,35 +10392,35 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+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, 0x04, 0x01, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05,
+0x06, 0x05, 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,
+0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x15, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 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, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
/* CET */
@@ -10409,8 +10533,8 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+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, 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,
@@ -10419,48 +10543,47 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+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, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 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, 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,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 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, 0xAB, 0xA0, 0x00, 0x0A, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x04,
+0x4D, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x53, 0x53, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01,
/* CST6CDT */
0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -10520,7 +10643,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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, 0x9B, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0C, 0xAC, 0x62, 0xC2, 0x80,
+0x00, 0x00, 0x00, 0x99, 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,
@@ -10543,36 +10666,35 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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, 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,
+0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 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, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01,
-0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04,
+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, 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,
+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,
@@ -10650,7 +10772,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x43, 0x3C, 0x55, 0xD0, 0x44, 0x51, 0x3E, 0xE0, 0x45, 0x12, 0xFD, 0x50, 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,
@@ -11881,6 +12003,91 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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/Guernsey */
+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/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,
@@ -11926,6 +12133,91 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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/Isle_of_Man */
+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/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,
@@ -11991,6 +12283,91 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x01,
+/* Europe/Jersey */
+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/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,
@@ -12891,6 +13268,52 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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/Podgorica */
+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/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,
@@ -13063,52 +13486,53 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1A, 0xA1, 0x00, 0x26, 0x9C,
+0xB5, 0xA4, 0x0B, 0x50, 0xBE, 0x4C, 0x26, 0xC0, 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, 0x02, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x05, 0x06,
+0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x09, 0x08, 0x02, 0x0B, 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, 0x00, 0x00, 0x2F, 0x04, 0x00, 0x00,
+0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50,
+0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0F, 0x00, 0x00,
+0x46, 0x50, 0x01, 0x09, 0x00, 0x00, 0x38, 0x40, 0x01, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0F,
+0x00, 0x00, 0x2A, 0x30, 0x01, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x0F, 0x00, 0x00, 0x46, 0x50,
+0x01, 0x14, 0x00, 0x00, 0x46, 0x50, 0x01, 0x14, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x4C, 0x4D,
+0x54, 0x00, 0x53, 0x41, 0x4D, 0x54, 0x00, 0x4B, 0x55, 0x59, 0x53, 0x54, 0x00, 0x4B, 0x55, 0x59,
+0x54, 0x00, 0x53, 0x41, 0x4D, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
+0x01, 0x01, 0x01, 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,
@@ -13835,69 +14259,118 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x01, 0x01, 0x01,
+/* Europe/Volgograd */
+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, 0x75, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x19, 0xA1, 0xF5, 0x46, 0xDC,
+0xAB, 0xD8, 0x86, 0x50, 0xB5, 0xA4, 0x0B, 0x50, 0xF0, 0xB0, 0x4C, 0x40, 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,
+0x29, 0xD4, 0xEC, 0x60, 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,
+0x01, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x06, 0x07, 0x06,
+0x07, 0x06, 0x07, 0x06, 0x08, 0x09, 0x08, 0x09, 0x06, 0x08, 0x0A, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08,
+0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 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, 0x29, 0xA4, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00,
+0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x09, 0x00, 0x00, 0x38, 0x40, 0x00, 0x09, 0x00, 0x00, 0x46,
+0x50, 0x01, 0x0E, 0x00, 0x00, 0x38, 0x40, 0x00, 0x14, 0x00, 0x00, 0x38, 0x40, 0x00, 0x14, 0x00,
+0x00, 0x46, 0x50, 0x01, 0x0E, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0E, 0x00, 0x00, 0x2A, 0x30, 0x00,
+0x14, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x54, 0x53, 0x41, 0x54, 0x00,
+0x53, 0x54, 0x41, 0x54, 0x00, 0x56, 0x4F, 0x4C, 0x53, 0x54, 0x00, 0x56, 0x4F, 0x4C, 0x54, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
/* 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,
+0x00, 0x00, 0x00, 0xA7, 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,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x80, 0xA9, 0x60, 0xD0, 0x84, 0xBA, 0x00,
+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, 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, 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,
-
+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,
@@ -14395,7 +14868,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x28, 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,
@@ -14405,29 +14878,9 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+0x41, 0x4F, 0x2F, 0xB8, 0x42, 0x3F, 0x2E, 0xC8, 0x43, 0x31, 0xB4, 0xB8, 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,
@@ -14588,58 +15041,59 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+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, 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,
+0xB8, 0x0A, 0xF2, 0xF0, 0xCB, 0xEA, 0x8D, 0x80, 0xD2, 0x23, 0xF4, 0x70, 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, 0x05, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03,
+0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 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, 0xFF, 0xFF, 0x9D, 0x90, 0x01, 0x14, 0x4C, 0x4D, 0x54, 0x00, 0x4D, 0x53, 0x54,
+0x00, 0x50, 0x53, 0x54, 0x00, 0x50, 0x44, 0x54, 0x00, 0x50, 0x57, 0x54, 0x00, 0x50, 0x50, 0x54,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
/* Mexico/BajaSur */
0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -15059,8 +15513,8 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+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, 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,
@@ -15069,48 +15523,47 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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,
+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, 0x06, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 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, 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,
+0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 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, 0xAB, 0xA0, 0x00, 0x0A, 0xFF, 0xFF, 0xB9, 0xB0, 0x01, 0x04,
+0x4D, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x53, 0x53, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01,
/* Pacific/Efate */
0x54, 0x5A, 0x69, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -15403,66 +15856,66 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0xA7, 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,
+0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x80, 0xA9, 0x60, 0xD0, 0x84, 0xBA, 0x00,
+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, 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, 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,
-
+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,
@@ -15738,7 +16191,7 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
/* 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,
+0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x26, 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,
@@ -15784,12 +16237,12 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 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,
+0x70, 0x01, 0x04, 0xFF, 0xFF, 0x81, 0x70, 0x01, 0x09, 0xFF, 0xFF, 0x73, 0x60, 0x00, 0x0E, 0xFF,
+0xFF, 0x81, 0x70, 0x01, 0x13, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x18, 0xFF, 0xFF, 0x8F, 0x80, 0x01,
+0x1C, 0xFF, 0xFF, 0x81, 0x70, 0x00, 0x21, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x57, 0x54, 0x00,
+0x43, 0x41, 0x50, 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,
@@ -16492,4 +16945,4 @@ unsigned char timelib_timezone_db_data_builtin[233606] = {
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 = { "2006.1", 538, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
+const timelib_tzdb timezonedb_builtin = { "2006.14", 546, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
diff --git a/ext/date/lib/timezonemap.h b/ext/date/lib/timezonemap.h
index 36b3a876e..ecfe4cac1 100644
--- a/ext/date/lib/timezonemap.h
+++ b/ext/date/lib/timezonemap.h
@@ -10,6 +10,7 @@
{ "addt", 1, -7200, "America/Pangnirtung" },
{ "adt", 1, -10800, "America/Halifax" },
{ "adt", 1, -10800, "America/Barbados" },
+ { "adt", 1, -10800, "America/Blanc-Sablon" },
{ "adt", 1, -10800, "America/Glace_Bay" },
{ "adt", 1, -10800, "America/Goose_Bay" },
{ "adt", 1, -10800, "America/Martinique" },
@@ -70,9 +71,11 @@
{ "ant", 0, -16200, "America/Curacao" },
{ "ant", 0, -16200, "America/Aruba" },
{ "apt", 1, -10800, "America/Halifax" },
+ { "apt", 1, -10800, "America/Blanc-Sablon" },
{ "apt", 1, -10800, "America/Glace_Bay" },
{ "apt", 1, -10800, "America/Moncton" },
{ "apt", 1, -10800, "America/Pangnirtung" },
+ { "apt", 1, -10800, "America/Puerto_Rico" },
{ "apt", 1, -10800, "Canada/Atlantic" },
{ "aqtst", 1, 18000, "Asia/Aqtau" },
{ "aqtst", 1, 21600, "Asia/Aqtau" },
@@ -165,6 +168,7 @@
{ "ast", 0, -14400, "America/Antigua" },
{ "ast", 0, -14400, "America/Aruba" },
{ "ast", 0, -14400, "America/Barbados" },
+ { "ast", 0, -14400, "America/Blanc-Sablon" },
{ "ast", 0, -14400, "America/Curacao" },
{ "ast", 0, -14400, "America/Dominica" },
{ "ast", 0, -14400, "America/Glace_Bay" },
@@ -195,6 +199,7 @@
{ "ast", 0, 10800, "Asia/Kuwait" },
{ "ast", 0, 10800, "Asia/Qatar" },
{ "awt", 1, -10800, "America/Halifax" },
+ { "awt", 1, -10800, "America/Blanc-Sablon" },
{ "awt", 1, -10800, "America/Glace_Bay" },
{ "awt", 1, -10800, "America/Moncton" },
{ "awt", 1, -10800, "America/Pangnirtung" },
@@ -216,6 +221,9 @@
{ "bdst", 1, 7200, "Europe/London" },
{ "bdst", 1, 7200, "Europe/Belfast" },
{ "bdst", 1, 7200, "Europe/Gibraltar" },
+ { "bdst", 1, 7200, "Europe/Guernsey" },
+ { "bdst", 1, 7200, "Europe/Isle_of_Man" },
+ { "bdst", 1, 7200, "Europe/Jersey" },
{ "bdst", 1, 7200, "GB" },
{ "bdst", 1, 7200, "GB-Eire" },
{ "bdt", 1, -36000, "America/Adak" },
@@ -268,12 +276,18 @@
{ "bst", 0, -39600, "US/Aleutian" },
{ "bst", 0, -39600, "US/Samoa" },
{ "bst", 0, 3600, "Europe/Belfast" },
+ { "bst", 0, 3600, "Europe/Guernsey" },
+ { "bst", 0, 3600, "Europe/Isle_of_Man" },
+ { "bst", 0, 3600, "Europe/Jersey" },
{ "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, "Europe/Guernsey" },
+ { "bst", 1, 3600, "Europe/Isle_of_Man" },
+ { "bst", 1, 3600, "Europe/Jersey" },
{ "bst", 1, 3600, "GB" },
{ "bst", 1, 3600, "GB-Eire" },
{ "btt", 0, 21600, "Asia/Thimbu" },
@@ -283,6 +297,8 @@
{ "burt", 0, 23400, "Asia/Dhaka" },
{ "burt", 0, 23400, "Asia/Rangoon" },
{ "cant", 0, -3600, "Atlantic/Canary" },
+ { "capt", 1, -32400, "America/Anchorage" },
+ { "capt", 1, -32400, "US/Alaska" },
{ "cast", 0, 34200, "Australia/Adelaide" },
{ "cast", 1, 10800, "Africa/Gaborone" },
{ "cast", 1, 10800, "Africa/Khartoum" },
@@ -302,10 +318,12 @@
{ "cdt", 1, -18000, "America/Chicago" },
{ "cdt", 1, -14400, "America/Havana" },
{ "cdt", 1, -14400, "Cuba" },
+ { "cdt", 1, -18000, "America/Atikokan" },
{ "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/Coral_Harbour" },
{ "cdt", 1, -18000, "America/Costa_Rica" },
{ "cdt", 1, -18000, "America/El_Salvador" },
{ "cdt", 1, -18000, "America/Fort_Wayne" },
@@ -328,6 +346,7 @@
{ "cdt", 1, -18000, "America/Mexico_City" },
{ "cdt", 1, -18000, "America/Monterrey" },
{ "cdt", 1, -18000, "America/North_Dakota/Center" },
+ { "cdt", 1, -18000, "America/North_Dakota/New_Salem" },
{ "cdt", 1, -18000, "America/Pangnirtung" },
{ "cdt", 1, -18000, "America/Rainy_River" },
{ "cdt", 1, -18000, "America/Rankin_Inlet" },
@@ -492,6 +511,8 @@
{ "cost", 1, -14400, "America/Bogota" },
{ "cot", 0, -18000, "America/Bogota" },
{ "cpt", 1, -18000, "America/Chicago" },
+ { "cpt", 1, -18000, "America/Atikokan" },
+ { "cpt", 1, -18000, "America/Coral_Harbour" },
{ "cpt", 1, -18000, "America/Fort_Wayne" },
{ "cpt", 1, -18000, "America/Indiana/Indianapolis" },
{ "cpt", 1, -18000, "America/Indiana/Knox" },
@@ -516,10 +537,12 @@
{ "cst", 0, -21600, "America/Chicago" },
{ "cst", 0, -18000, "America/Havana" },
{ "cst", 0, -18000, "Cuba" },
+ { "cst", 0, -21600, "America/Atikokan" },
{ "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/Coral_Harbour" },
{ "cst", 0, -21600, "America/Costa_Rica" },
{ "cst", 0, -21600, "America/Detroit" },
{ "cst", 0, -21600, "America/El_Salvador" },
@@ -545,6 +568,7 @@
{ "cst", 0, -21600, "America/Mexico_City" },
{ "cst", 0, -21600, "America/Monterrey" },
{ "cst", 0, -21600, "America/North_Dakota/Center" },
+ { "cst", 0, -21600, "America/North_Dakota/New_Salem" },
{ "cst", 0, -21600, "America/Pangnirtung" },
{ "cst", 0, -21600, "America/Rainy_River" },
{ "cst", 0, -21600, "America/Rankin_Inlet" },
@@ -590,6 +614,8 @@
{ "cvt", 0, -3600, "Atlantic/Cape_Verde" },
{ "cvt", 0, -7200, "Atlantic/Cape_Verde" },
{ "cwt", 1, -18000, "America/Chicago" },
+ { "cwt", 1, -18000, "America/Atikokan" },
+ { "cwt", 1, -18000, "America/Coral_Harbour" },
{ "cwt", 1, -18000, "America/Fort_Wayne" },
{ "cwt", 1, -18000, "America/Indiana/Indianapolis" },
{ "cwt", 1, -18000, "America/Indiana/Knox" },
@@ -648,7 +674,6 @@
{ "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" },
@@ -749,7 +774,6 @@
{ "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" },
@@ -763,6 +787,7 @@
{ "ept", 1, -14400, "US/Michigan" },
{ "est", 0, -18000, "America/New_York" },
{ "est", 0, -18000, "America/Antigua" },
+ { "est", 0, -18000, "America/Atikokan" },
{ "est", 0, -18000, "America/Cambridge_Bay" },
{ "est", 0, -18000, "America/Cancun" },
{ "est", 0, -18000, "America/Cayman" },
@@ -831,7 +856,6 @@
{ "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" },
@@ -892,6 +916,9 @@
{ "gmt", 0, 0, "Europe/Belfast" },
{ "gmt", 0, 0, "Europe/Dublin" },
{ "gmt", 0, 0, "Europe/Gibraltar" },
+ { "gmt", 0, 0, "Europe/Guernsey" },
+ { "gmt", 0, 0, "Europe/Isle_of_Man" },
+ { "gmt", 0, 0, "Europe/Jersey" },
{ "gmt", 0, 0, "Europe/London" },
{ "gmt", 0, 0, "GB" },
{ "gmt", 0, 0, "GB-Eire" },
@@ -1088,6 +1115,7 @@
{ "mdt", 1, -21600, "America/Inuvik" },
{ "mdt", 1, -21600, "America/Mazatlan" },
{ "mdt", 1, -21600, "America/North_Dakota/Center" },
+ { "mdt", 1, -21600, "America/North_Dakota/New_Salem" },
{ "mdt", 1, -21600, "America/Phoenix" },
{ "mdt", 1, -21600, "America/Regina" },
{ "mdt", 1, -21600, "America/Shiprock" },
@@ -1121,6 +1149,7 @@
{ "mpt", 1, -21600, "America/Cambridge_Bay" },
{ "mpt", 1, -21600, "America/Edmonton" },
{ "mpt", 1, -21600, "America/North_Dakota/Center" },
+ { "mpt", 1, -21600, "America/North_Dakota/New_Salem" },
{ "mpt", 1, -21600, "America/Regina" },
{ "mpt", 1, -21600, "America/Shiprock" },
{ "mpt", 1, -21600, "America/Swift_Current" },
@@ -1173,6 +1202,7 @@
{ "mst", 0, -25200, "America/Mazatlan" },
{ "mst", 0, -25200, "America/Mexico_City" },
{ "mst", 0, -25200, "America/North_Dakota/Center" },
+ { "mst", 0, -25200, "America/North_Dakota/New_Salem" },
{ "mst", 0, -25200, "America/Phoenix" },
{ "mst", 0, -25200, "America/Regina" },
{ "mst", 0, -25200, "America/Shiprock" },
@@ -1199,6 +1229,7 @@
{ "mwt", 1, -21600, "America/Cambridge_Bay" },
{ "mwt", 1, -21600, "America/Edmonton" },
{ "mwt", 1, -21600, "America/North_Dakota/Center" },
+ { "mwt", 1, -21600, "America/North_Dakota/New_Salem" },
{ "mwt", 1, -21600, "America/Phoenix" },
{ "mwt", 1, -21600, "America/Regina" },
{ "mwt", 1, -21600, "America/Shiprock" },
@@ -1325,10 +1356,13 @@
{ "pmt", 0, 36000, "Antarctica/DumontDUrville" },
{ "ppt", 1, -25200, "America/Los_Angeles" },
{ "ppt", 1, -25200, "America/Dawson_Creek" },
+ { "ppt", 1, -25200, "America/Ensenada" },
{ "ppt", 1, -25200, "America/Inuvik" },
{ "ppt", 1, -25200, "America/Juneau" },
+ { "ppt", 1, -25200, "America/Tijuana" },
{ "ppt", 1, -25200, "America/Vancouver" },
{ "ppt", 1, -25200, "Canada/Pacific" },
+ { "ppt", 1, -25200, "Mexico/BajaNorte" },
{ "ppt", 1, -25200, "PST8PDT" },
{ "ppt", 1, -25200, "US/Pacific" },
{ "ppt", 1, -25200, "US/Pacific-New" },
@@ -1385,6 +1419,7 @@
{ "samt", 0, -41400, "Pacific/Pago_Pago" },
{ "samt", 0, -41400, "Pacific/Samoa" },
{ "samt", 0, -41400, "US/Samoa" },
+ { "samt", 0, 10800, "Europe/Samara" },
{ "samt", 0, 14400, "Europe/Samara" },
{ "sast", 1, 10800, "Africa/Johannesburg" },
{ "sast", 0, 7200, "Africa/Johannesburg" },
@@ -1413,13 +1448,14 @@
{ "sst", 0, -39600, "Pacific/Midway" },
{ "sst", 0, -39600, "Pacific/Pago_Pago" },
{ "sst", 0, -39600, "US/Samoa" },
+ { "stat", 0, 10800, "Europe/Volgograd" },
+ { "stat", 0, 14400, "Europe/Volgograd" },
{ "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" },
@@ -1449,6 +1485,7 @@
{ "trt", 0, 10800, "Europe/Istanbul" },
{ "trt", 0, 10800, "Asia/Istanbul" },
{ "trt", 0, 10800, "Turkey" },
+ { "tsat", 0, 10800, "Europe/Volgograd" },
{ "ulast", 1, 32400, "Asia/Ulaanbaatar" },
{ "ulast", 1, 32400, "Asia/Ulan_Bator" },
{ "ulat", 0, 25200, "Asia/Ulaanbaatar" },
@@ -1479,6 +1516,10 @@
{ "vlast", 1, 39600, "Asia/Vladivostok" },
{ "vlat", 0, 32400, "Asia/Vladivostok" },
{ "vlat", 0, 36000, "Asia/Vladivostok" },
+ { "volst", 1, 14400, "Europe/Volgograd" },
+ { "volst", 1, 18000, "Europe/Volgograd" },
+ { "volt", 0, 10800, "Europe/Volgograd" },
+ { "volt", 0, 14400, "Europe/Volgograd" },
{ "vost", 0, 21600, "Antarctica/Vostok" },
{ "vust", 1, 43200, "Pacific/Efate" },
{ "vut", 0, 39600, "Pacific/Efate" },
diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c
index 522578077..1f8af0a2b 100644
--- a/ext/date/lib/tm2unixtime.c
+++ b/ext/date/lib/tm2unixtime.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tm2unixtime.c,v 1.13.2.3 2006/04/11 18:03:52 derick Exp $ */
+/* $Id: tm2unixtime.c,v 1.13.2.3.2.1 2006/05/14 17:36:05 derick Exp $ */
#include "timelib.h"
@@ -113,6 +113,11 @@ static void do_normalize(timelib_time* time)
static void do_adjust_relative(timelib_time* time)
{
+ if (time->have_weekday_relative) {
+ do_adjust_for_weekday(time);
+ }
+ do_normalize(time);
+
if (time->have_relative) {
time->s += time->relative.s;
time->i += time->relative.i;
@@ -124,11 +129,53 @@ static void do_adjust_relative(timelib_time* time)
}
do_normalize(time);
- if (time->have_weekday_relative) {
- do_adjust_for_weekday(time);
+ memset(&(time->relative), 0, sizeof(time->relative));
+}
+
+static void do_adjust_special_weekday(timelib_time* time)
+{
+ timelib_sll current_dow, this_weekday = 0, count;
+
+ current_dow = timelib_day_of_week(time->y, time->m, time->d);
+ count = time->special.amount;
+ if (count == 0) {
+ if (current_dow == 6) {
+ this_weekday = 2;
+ }
+ if (current_dow == 0) {
+ this_weekday = 1;
+ }
+ time->d += this_weekday;
+ return;
+ } else if (count > 0) {
+ if (current_dow == 5) {
+ this_weekday = 2;
+ }
+ if (current_dow == 6) {
+ this_weekday = 1;
+ }
+ } else if (count < 0) {
+ if (current_dow == 0) {
+ this_weekday = -1;
+ }
+ if (current_dow == 1) {
+ this_weekday = -2;
+ }
+ }
+ time->d += this_weekday + ((count / 5) * 7) + (count % 5);
+}
+
+static void do_adjust_special(timelib_time* time)
+{
+ if (time->have_special_relative) {
+ switch (time->special.type) {
+ case TIMELIB_SPECIAL_WEEKDAY:
+ do_adjust_special_weekday(time);
+ break;
+ }
}
do_normalize(time);
- memset(&(time->relative), 0, sizeof(time->relative));
+ memset(&(time->special), 0, sizeof(time->special));
}
static timelib_sll do_years(timelib_sll year)
@@ -247,6 +294,7 @@ void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi)
timelib_sll res = 0;
do_adjust_relative(time);
+ do_adjust_special(time);
res += do_years(time->y);
res += do_months(time->m, time->y);
res += do_days(time->d);
diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c
index 51048b646..0edde8f2c 100644
--- a/ext/date/lib/unixtime2tm.c
+++ b/ext/date/lib/unixtime2tm.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: unixtime2tm.c,v 1.12.2.4 2006/01/04 21:31:34 derick Exp $ */
+/* $Id: unixtime2tm.c,v 1.12.2.4.2.1 2006/05/15 08:54:16 derick Exp $ */
#include "timelib.h"
@@ -32,12 +32,6 @@
#include <strings.h>
#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 };
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 280fd27d7..ce64ff9e0 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_date.c,v 1.43.2.45 2006/04/11 18:03:46 derick Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.30 2006/09/10 17:01:51 bjori Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -29,26 +29,142 @@
#include "lib/timelib.h"
#include <time.h>
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, timestamp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmdate, 0, 0, 1)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, timestamp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_idate, 0, 0, 1)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, timestamp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_strtotime, 0, 0, 1)
+ ZEND_ARG_INFO(0, time)
+ ZEND_ARG_INFO(0, now)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mktime, 0, 0, 0)
+ ZEND_ARG_INFO(0, hour)
+ ZEND_ARG_INFO(0, min)
+ ZEND_ARG_INFO(0, sec)
+ ZEND_ARG_INFO(0, mon)
+ ZEND_ARG_INFO(0, day)
+ ZEND_ARG_INFO(0, year)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmmktime, 0, 0, 0)
+ ZEND_ARG_INFO(0, hour)
+ ZEND_ARG_INFO(0, min)
+ ZEND_ARG_INFO(0, sec)
+ ZEND_ARG_INFO(0, mon)
+ ZEND_ARG_INFO(0, day)
+ ZEND_ARG_INFO(0, year)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_checkdate, 0)
+ ZEND_ARG_INFO(0, month)
+ ZEND_ARG_INFO(0, day)
+ ZEND_ARG_INFO(0, year)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_strftime, 0, 0, 1)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, timestamp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmstrftime, 0, 0, 1)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, timestamp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_time, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_localtime, 0, 0, 0)
+ ZEND_ARG_INFO(0, timestamp)
+ ZEND_ARG_INFO(0, associative_array)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_getdate, 0, 0, 0)
+ ZEND_ARG_INFO(0, timestamp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_date_default_timezone_set, 0)
+ ZEND_ARG_INFO(0, timezone_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_date_default_timezone_get, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_date_sunrise, 0, 0, 1)
+ ZEND_ARG_INFO(0, time)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, latitude)
+ ZEND_ARG_INFO(0, longitude)
+ ZEND_ARG_INFO(0, zenith)
+ ZEND_ARG_INFO(0, gmt_offset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_date_sunset, 0, 0, 1)
+ ZEND_ARG_INFO(0, time)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, latitude)
+ ZEND_ARG_INFO(0, longitude)
+ ZEND_ARG_INFO(0, zenith)
+ ZEND_ARG_INFO(0, gmt_offset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_date_sun_info, 0)
+ ZEND_ARG_INFO(0, time)
+ ZEND_ARG_INFO(0, latitude)
+ ZEND_ARG_INFO(0, longitude)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
/* {{{ Function table */
zend_function_entry date_functions[] = {
- PHP_FE(strtotime, NULL)
- PHP_FE(date, NULL)
- PHP_FE(idate, NULL)
- PHP_FE(gmdate, NULL)
- PHP_FE(mktime, NULL)
- PHP_FE(gmmktime, NULL)
- PHP_FE(checkdate, NULL)
+ PHP_FE(strtotime, arginfo_strtotime)
+ PHP_FE(date, arginfo_date)
+ PHP_FE(idate, arginfo_idate)
+ PHP_FE(gmdate, arginfo_gmdate)
+ PHP_FE(mktime, arginfo_mktime)
+ PHP_FE(gmmktime, arginfo_gmmktime)
+ PHP_FE(checkdate, arginfo_checkdate)
#ifdef HAVE_STRFTIME
- PHP_FE(strftime, NULL)
- PHP_FE(gmstrftime, NULL)
+ PHP_FE(strftime, arginfo_strftime)
+ PHP_FE(gmstrftime, arginfo_gmstrftime)
#endif
- PHP_FE(time, NULL)
- PHP_FE(localtime, NULL)
- PHP_FE(getdate, NULL)
+ PHP_FE(time, arginfo_time)
+ PHP_FE(localtime, arginfo_localtime)
+ PHP_FE(getdate, arginfo_getdate)
-#ifdef EXPERIMENTAL_DATE_SUPPORT
/* Advanced Interface */
PHP_FE(date_create, NULL)
PHP_FE(date_parse, NULL)
@@ -66,24 +182,23 @@ zend_function_entry date_functions[] = {
PHP_FE(timezone_name_get, NULL)
PHP_FE(timezone_name_from_abbr, NULL)
PHP_FE(timezone_offset_get, NULL)
- PHP_FE(timezone_transistions_get, NULL)
+ PHP_FE(timezone_transitions_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)
+ PHP_FE(date_default_timezone_set, arginfo_date_default_timezone_set)
+ PHP_FE(date_default_timezone_get, arginfo_date_default_timezone_get)
/* Astronomical functions */
- PHP_FE(date_sunrise, NULL)
- PHP_FE(date_sunset, NULL)
- PHP_FE(date_sun_info, NULL)
+ PHP_FE(date_sunrise, arginfo_date_sunrise)
+ PHP_FE(date_sunset, arginfo_date_sunset)
+ PHP_FE(date_sun_info, arginfo_date_sun_info)
{NULL, NULL, NULL}
};
-#ifdef EXPERIMENTAL_DATE_SUPPORT
zend_function_entry date_funcs_date[] = {
+ PHP_ME(DateTime, __construct, NULL, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
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)
@@ -96,20 +211,21 @@ zend_function_entry date_funcs_date[] = {
};
zend_function_entry date_funcs_timezone[] = {
+ PHP_ME(DateTimeZone, __construct, NULL, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
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)
+ ZEND_NAMED_FE(getTransitions, ZEND_FN(timezone_transitions_get), NULL)
+ ZEND_ME_MAPPING(listAbbreviations, timezone_abbreviations_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ ZEND_ME_MAPPING(listIdentifiers, timezone_identifiers_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
{NULL, NULL, NULL}
};
static void date_register_classes(TSRMLS_D);
-#endif
-static char* guess_timezone(timelib_tzdb *tzdb TSRMLS_DC);
+static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC);
/* }}} */
ZEND_DECLARE_MODULE_GLOBALS(date)
+static PHP_GINIT_FUNCTION(date);
/* True global */
timelib_tzdb *php_date_global_timezone_db;
@@ -134,7 +250,6 @@ PHP_INI_BEGIN()
PHP_INI_END()
/* }}} */
-#ifdef EXPERIMENTAL_DATE_SUPPORT
zend_class_entry *date_ce_date, *date_ce_timezone;
static zend_object_handlers date_object_handlers_date;
@@ -171,15 +286,30 @@ struct _php_timezone_obj {
} \
obj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); \
+#define DATE_CHECK_INITIALIZED(member, class_name) \
+ if (!(member)) { \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The " #class_name " object has not been correctly initialized by its constructor"); \
+ RETURN_FALSE; \
+ }
+
static void date_object_free_storage_date(void *object TSRMLS_DC);
static void date_object_free_storage_timezone(void *object TSRMLS_DC);
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);
-#endif
+static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC);
+static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC);
+
+/* This is need to ensure that session extension request shutdown occurs 1st, because it uses the date extension */
+static zend_module_dep date_deps[] = {
+ ZEND_MOD_OPTIONAL("session")
+ {NULL, NULL, NULL}
+};
/* {{{ Module struct */
zend_module_entry date_module_entry = {
- STANDARD_MODULE_HEADER,
+ STANDARD_MODULE_HEADER_EX,
+ NULL,
+ date_deps,
"date", /* extension name */
date_functions, /* function list */
PHP_MINIT(date), /* process startup */
@@ -188,13 +318,17 @@ zend_module_entry date_module_entry = {
PHP_RSHUTDOWN(date), /* request shutdown */
PHP_MINFO(date), /* extension info */
PHP_VERSION, /* extension version */
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(date), /* globals descriptor */
+ PHP_GINIT(date), /* globals ctor */
+ NULL, /* globals dtor */
+ NULL, /* post deactivate */
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
-/* {{{ php_date_init_globals */
-static void php_date_init_globals(zend_date_globals *date_globals)
+/* {{{ PHP_GINIT_FUNCTION */
+static PHP_GINIT_FUNCTION(date)
{
date_globals->default_timezone = NULL;
date_globals->timezone = NULL;
@@ -237,11 +371,87 @@ PHP_RSHUTDOWN_FUNCTION(date)
#define DATE_TIMEZONEDB php_date_global_timezone_db ? php_date_global_timezone_db : timelib_builtin_db()
+/*
+ * RFC822, Section 5.1: http://www.ietf.org/rfc/rfc822.txt
+ * date-time = [ day "," ] date time ; dd mm yy hh:mm:ss zzz
+ * day = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"
+ * date = 1*2DIGIT month 2DIGIT ; day month year e.g. 20 Jun 82
+ * month = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"
+ * time = hour zone ; ANSI and Military
+ * hour = 2DIGIT ":" 2DIGIT [":" 2DIGIT] ; 00:00:00 - 23:59:59
+ * zone = "UT" / "GMT" / "EST" / "EDT" / "CST" / "CDT" / "MST" / "MDT" / "PST" / "PDT" / 1ALPHA / ( ("+" / "-") 4DIGIT )
+ */
+#define DATE_FORMAT_RFC822 "D, d M y H:i:s O"
+
+/*
+ * RFC850, Section 2.1.4: http://www.ietf.org/rfc/rfc850.txt
+ * Format must be acceptable both to the ARPANET and to the getdate routine.
+ * One format that is acceptable to both is Weekday, DD-Mon-YY HH:MM:SS TIMEZONE
+ * TIMEZONE can be any timezone name (3 or more letters)
+ */
+#define DATE_FORMAT_RFC850 "l, d-M-y H:i:s T"
+
+/*
+ * RFC1036, Section 2.1.2: http://www.ietf.org/rfc/rfc1036.txt
+ * Its format must be acceptable both in RFC-822 and to the getdate(3)
+ * Wdy, DD Mon YY HH:MM:SS TIMEZONE
+ * There is no hope of having a complete list of timezones. Universal
+ * Time (GMT), the North American timezones (PST, PDT, MST, MDT, CST,
+ * CDT, EST, EDT) and the +/-hhmm offset specifed in RFC-822 should be supported.
+ */
+#define DATE_FORMAT_RFC1036 "D, d M y H:i:s O"
+
+/*
+ * RFC1123, Section 5.2.14: http://www.ietf.org/rfc/rfc1123.txt
+ * RFC-822 Date and Time Specification: RFC-822 Section 5
+ * The syntax for the date is hereby changed to: date = 1*2DIGIT month 2*4DIGIT
+ */
+#define DATE_FORMAT_RFC1123 "D, d M Y H:i:s O"
+
+/*
+ * RFC2822, Section 3.3: http://www.ietf.org/rfc/rfc2822.txt
+ * FWS = ([*WSP CRLF] 1*WSP) / ; Folding white space
+ * CFWS = *([FWS] comment) (([FWS] comment) / FWS)
+ *
+ * date-time = [ day-of-week "," ] date FWS time [CFWS]
+ * day-of-week = ([FWS] day-name)
+ * day-name = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"
+ * date = day month year
+ * year = 4*DIGIT
+ * month = (FWS month-name FWS)
+ * month-name = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"
+ * day = ([FWS] 1*2DIGIT)
+ * time = time-of-day FWS zone
+ * time-of-day = hour ":" minute [ ":" second ]
+ * hour = 2DIGIT
+ * minute = 2DIGIT
+ * second = 2DIGIT
+ * zone = (( "+" / "-" ) 4DIGIT)
+ */
+#define DATE_FORMAT_RFC2822 "D, d M Y H:i:s O"
+/*
+ * RFC3339, Section 5.6: http://www.ietf.org/rfc/rfc3339.txt
+ * date-fullyear = 4DIGIT
+ * date-month = 2DIGIT ; 01-12
+ * date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on month/year
+ *
+ * time-hour = 2DIGIT ; 00-23
+ * time-minute = 2DIGIT ; 00-59
+ * time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second rules
+ *
+ * time-secfrac = "." 1*DIGIT
+ * time-numoffset = ("+" / "-") time-hour ":" time-minute
+ * time-offset = "Z" / time-numoffset
+ *
+ * partial-time = time-hour ":" time-minute ":" time-second [time-secfrac]
+ * full-date = date-fullyear "-" date-month "-" date-mday
+ * full-time = partial-time time-offset
+ *
+ * date-time = full-date "T" full-time
+ */
#define DATE_FORMAT_RFC3339 "Y-m-d\\TH:i:sP"
+
#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 " \
@@ -258,20 +468,35 @@ PHP_RSHUTDOWN_FUNCTION(date)
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(date)
{
- ZEND_INIT_MODULE_GLOBALS(date, php_date_init_globals, NULL);
REGISTER_INI_ENTRIES();
-#ifdef EXPERIMENTAL_DATE_SUPPORT
date_register_classes(TSRMLS_C);
-#endif
+/*
+ * RFC4287, Section 3.3: http://www.ietf.org/rfc/rfc4287.txt
+ * A Date construct is an element whose content MUST conform to the
+ * "date-time" production in [RFC3339]. In addition, an uppercase "T"
+ * character MUST be used to separate date and time, and an uppercase
+ * "Z" character MUST be present in the absence of a numeric time zone offset.
+ */
REGISTER_STRING_CONSTANT("DATE_ATOM", DATE_FORMAT_RFC3339, CONST_CS | CONST_PERSISTENT);
- REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
+/*
+ * Preliminary specification: http://wp.netscape.com/newsref/std/cookie_spec.html
+ * "This is based on RFC 822, RFC 850, RFC 1036, and RFC 1123,
+ * with the variations that the only legal time zone is GMT
+ * and the separators between the elements of the date must be dashes."
+ */
+ REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_RFC850, 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_RFC822", DATE_FORMAT_RFC822, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC850, 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_RFC3339", DATE_FORMAT_RFC3339, CONST_CS | CONST_PERSISTENT);
+/*
+ * RSS 2.0 Specification: http://blogs.law.harvard.edu/tech/rss
+ * "All date-times in RSS conform to the Date and Time Specification of RFC 822,
+ * with the exception that the year may be expressed with two characters or four characters (four preferred)"
+ */
REGISTER_STRING_CONSTANT("DATE_RSS", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_W3C", DATE_FORMAT_RFC3339, CONST_CS | CONST_PERSISTENT);
@@ -298,7 +523,7 @@ PHP_MSHUTDOWN_FUNCTION(date)
/* {{{ PHP_MINFO_FUNCTION */
PHP_MINFO_FUNCTION(date)
{
- timelib_tzdb *tzdb = DATE_TIMEZONEDB;
+ const timelib_tzdb *tzdb = DATE_TIMEZONEDB;
php_info_print_table_start();
php_info_print_table_row(2, "date/time support", "enabled");
@@ -312,7 +537,7 @@ PHP_MINFO_FUNCTION(date)
/* }}} */
/* {{{ Timezone Cache functions */
-static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, timelib_tzdb *tzdb TSRMLS_DC)
+static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_tzdb *tzdb TSRMLS_DC)
{
timelib_tzinfo *tzi, **ptzi;
@@ -329,7 +554,7 @@ static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, timelib_tzdb *
/* }}} */
/* {{{ Helper functions */
-static char* guess_timezone(timelib_tzdb *tzdb TSRMLS_DC)
+static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
{
char *env;
@@ -455,13 +680,33 @@ static char *english_suffix(timelib_sll number)
}
/* }}} */
+/* {{{ day of week helpers */
+char *php_date_full_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
+{
+ timelib_sll day_of_week = timelib_day_of_week(y, m, d);
+ if (day_of_week < 0) {
+ return "Unknown";
+ }
+ return day_full_names[day_of_week];
+}
+
+char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
+{
+ timelib_sll day_of_week = timelib_day_of_week(y, m, d);
+ if (day_of_week < 0) {
+ return "Unknown";
+ }
+ return day_short_names[day_of_week];
+}
+/* }}} */
+
/* {{{ date_format - (gm)date helper */
static char *date_format(char *format, int format_len, timelib_time *t, int localtime)
{
smart_str string = {0};
int i;
char buffer[33];
- timelib_time_offset *offset;
+ timelib_time_offset *offset = NULL;
timelib_sll isoweek, isoyear;
int rfc_colon = 0;
@@ -497,9 +742,9 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
switch (format[i]) {
/* day */
case 'd': snprintf(buffer, 32, "%02d", (int) t->d); break;
- case 'D': snprintf(buffer, 32, "%s", day_short_names[timelib_day_of_week(t->y, t->m, t->d)]); break;
+ case 'D': snprintf(buffer, 32, "%s", php_date_short_day_name(t->y, t->m, t->d)); break;
case 'j': snprintf(buffer, 32, "%d", (int) t->d); break;
- case 'l': snprintf(buffer, 32, "%s", day_full_names[timelib_day_of_week(t->y, t->m, t->d)]); break;
+ case 'l': snprintf(buffer, 32, "%s", php_date_full_day_name(t->y, t->m, t->d)); break;
case 'S': snprintf(buffer, 32, "%s", english_suffix(t->d)); break;
case 'w': snprintf(buffer, 32, "%d", (int) timelib_day_of_week(t->y, t->m, t->d)); break;
case 'N': snprintf(buffer, 32, "%d", (int) timelib_iso_day_of_week(t->y, t->m, t->d)); break;
@@ -530,7 +775,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
retval += 1000;
}
retval = retval % 1000;
- snprintf(buffer, 32, "%03d", retval); break;
+ snprintf(buffer, 32, "%03d", retval);
break;
}
case 'g': snprintf(buffer, 32, "%d", (t->h % 12) ? (int) t->h % 12 : 12); break;
@@ -564,7 +809,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
);
break;
case 'r': snprintf(buffer, 32, "%3s, %02d %3s %04d %02d:%02d:%02d %c%02d%02d",
- day_short_names[timelib_day_of_week(t->y, t->m, t->d)],
+ php_date_short_day_name(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) ? '-' : '+') : '+',
@@ -643,7 +888,7 @@ PHPAPI int php_idate(char format, time_t ts, int localtime)
timelib_time *t;
timelib_tzinfo *tzi;
int retval = -1;
- timelib_time_offset *offset;
+ timelib_time_offset *offset = NULL;
timelib_sll isoweek, isoyear;
t = timelib_time_ctor();
@@ -783,7 +1028,7 @@ PHP_FUNCTION(idate)
/* {{{ php_date_set_tzdb - NOT THREADSAFE */
PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb)
{
- timelib_tzdb *builtin = timelib_builtin_db();
+ const timelib_tzdb *builtin = timelib_builtin_db();
if (php_version_compare(tzdb->version, builtin->version) > 0) {
php_date_global_timezone_db = tzdb;
@@ -848,6 +1093,11 @@ PHP_FUNCTION(strtotime)
RETURN_FALSE;
}
+ if (!time_len) {
+ timelib_time_dtor(now);
+ RETURN_FALSE;
+ }
+
t = timelib_strtotime(times, time_len, &error, DATE_TIMEZONEDB);
error1 = error->error_count;
timelib_error_container_dtor(error);
@@ -863,7 +1113,7 @@ PHP_FUNCTION(strtotime)
timelib_tzinfo_dtor(t->tz_info);
}
- timelib_time_dtor(now);
+ timelib_time_dtor(now);
timelib_time_dtor(t);
if (error1 || error2) {
@@ -880,7 +1130,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
{
long hou, min, sec, mon, day, yea, dst = -1;
timelib_time *now;
- timelib_tzinfo *tzi;
+ timelib_tzinfo *tzi = NULL;
long ts, adjust_seconds = 0;
int error;
@@ -967,7 +1217,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
}
/* }}} */
-/* {{{ proto int mktime(int hour, int min, int sec, int mon, int day, int year)
+/* {{{ proto int mktime([int hour [, int min [, int sec [, int mon [, int day [, int year]]]]]])
Get UNIX timestamp for a date */
PHP_FUNCTION(mktime)
{
@@ -975,7 +1225,7 @@ PHP_FUNCTION(mktime)
}
/* }}} */
-/* {{{ proto int gmmktime(int hour, int min, int sec, int mon, int day, int year)
+/* {{{ 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)
{
@@ -1013,7 +1263,7 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
size_t buf_len = 64, real_len;
timelib_time *ts;
timelib_tzinfo *tzi;
- timelib_time_offset *offset;
+ timelib_time_offset *offset = NULL;
timestamp = (long) time(NULL);
@@ -1116,7 +1366,7 @@ PHP_FUNCTION(time)
PHP_FUNCTION(localtime)
{
long timestamp = (long)time(NULL);
- int associative = 0;
+ zend_bool associative = 0;
timelib_tzinfo *tzi;
timelib_time *ts;
@@ -1186,7 +1436,7 @@ PHP_FUNCTION(getdate)
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, "weekday", php_date_full_day_name(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);
@@ -1194,41 +1444,40 @@ PHP_FUNCTION(getdate)
}
/* }}} */
-#ifdef EXPERIMENTAL_DATE_SUPPORT
static void date_register_classes(TSRMLS_D)
{
zend_class_entry ce_date, ce_timezone;
- INIT_CLASS_ENTRY(ce_date, "date", date_funcs_date);
+ INIT_CLASS_ENTRY(ce_date, "DateTime", 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;
+ date_object_handlers_date.clone_obj = date_object_clone_date;
#define REGISTER_DATE_CLASS_CONST_STRING(const_name, value) \
zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
REGISTER_DATE_CLASS_CONST_STRING("ATOM", DATE_FORMAT_RFC3339);
- REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_RFC1123);
+ REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_RFC850);
REGISTER_DATE_CLASS_CONST_STRING("ISO8601", DATE_FORMAT_ISO8601);
- REGISTER_DATE_CLASS_CONST_STRING("RFC822", DATE_FORMAT_RFC1123);
- REGISTER_DATE_CLASS_CONST_STRING("RFC850", DATE_FORMAT_RFC1036);
+ REGISTER_DATE_CLASS_CONST_STRING("RFC822", DATE_FORMAT_RFC822);
+ REGISTER_DATE_CLASS_CONST_STRING("RFC850", DATE_FORMAT_RFC850);
REGISTER_DATE_CLASS_CONST_STRING("RFC1036", DATE_FORMAT_RFC1036);
REGISTER_DATE_CLASS_CONST_STRING("RFC1123", DATE_FORMAT_RFC1123);
REGISTER_DATE_CLASS_CONST_STRING("RFC2822", DATE_FORMAT_RFC2822);
REGISTER_DATE_CLASS_CONST_STRING("RFC3339", DATE_FORMAT_RFC3339);
REGISTER_DATE_CLASS_CONST_STRING("RSS", DATE_FORMAT_RFC1123);
- REGISTER_DATE_CLASS_CONST_STRING("W3C", DATE_FORMAT_ISO8601);
+ REGISTER_DATE_CLASS_CONST_STRING("W3C", DATE_FORMAT_RFC3339);
- INIT_CLASS_ENTRY(ce_timezone, "timezone", date_funcs_timezone);
+ INIT_CLASS_ENTRY(ce_timezone, "DateTimeZone", 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;
+ date_object_handlers_timezone.clone_obj = date_object_clone_timezone;
}
-static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC)
+static inline zend_object_value date_object_new_date_ex(zend_class_entry *class_type, php_date_obj **ptr TSRMLS_DC)
{
php_date_obj *intern;
zend_object_value retval;
@@ -1236,6 +1485,9 @@ static zend_object_value date_object_new_date(zend_class_entry *class_type TSRML
intern = emalloc(sizeof(php_date_obj));
memset(intern, 0, sizeof(php_date_obj));
+ if (ptr) {
+ *ptr = intern;
+ }
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
@@ -1246,7 +1498,33 @@ static zend_object_value date_object_new_date(zend_class_entry *class_type TSRML
return retval;
}
-static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC)
+static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC)
+{
+ return date_object_new_date_ex(class_type, NULL TSRMLS_CC);
+}
+
+static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC)
+{
+ php_date_obj *new_obj = NULL;
+ php_date_obj *old_obj = (php_date_obj *) zend_object_store_get_object(this_ptr TSRMLS_CC);
+ zend_object_value new_ov = date_object_new_date_ex(old_obj->std.ce, &new_obj TSRMLS_CC);
+
+ zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
+
+ /* this should probably moved to a new `timelib_time *timelime_time_clone(timelib_time *)` */
+ new_obj->time = timelib_time_ctor();
+ *new_obj->time = *old_obj->time;
+ if (old_obj->time->tz_abbr) {
+ new_obj->time->tz_abbr = strdup(old_obj->time->tz_abbr);
+ }
+ if (old_obj->time->tz_info) {
+ new_obj->time->tz_info = timelib_tzinfo_clone(old_obj->time->tz_info);
+ }
+
+ return new_ov;
+}
+
+static inline zend_object_value date_object_new_timezone_ex(zend_class_entry *class_type, php_timezone_obj **ptr TSRMLS_DC)
{
php_timezone_obj *intern;
zend_object_value retval;
@@ -1254,6 +1532,9 @@ static zend_object_value date_object_new_timezone(zend_class_entry *class_type T
intern = emalloc(sizeof(php_timezone_obj));
memset(intern, 0, sizeof(php_timezone_obj));
+ if (ptr) {
+ *ptr = intern;
+ }
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
@@ -1264,6 +1545,23 @@ static zend_object_value date_object_new_timezone(zend_class_entry *class_type T
return retval;
}
+static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC)
+{
+ return date_object_new_timezone_ex(class_type, NULL TSRMLS_CC);
+}
+
+static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC)
+{
+ php_timezone_obj *new_obj = NULL;
+ php_timezone_obj *old_obj = (php_timezone_obj *) zend_object_store_get_object(this_ptr TSRMLS_CC);
+ zend_object_value new_ov = date_object_new_timezone_ex(old_obj->std.ce, &new_obj TSRMLS_CC);
+
+ zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
+ new_obj->tz = old_obj->tz;
+
+ return new_ov;
+}
+
static void date_object_free_storage_date(void *object TSRMLS_DC)
{
php_date_obj *intern = (php_date_obj *)object;
@@ -1288,7 +1586,7 @@ static void date_object_free_storage_timezone(void *object TSRMLS_DC)
}
/* Advanced Interface */
-static zval * date_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC)
+static zval * date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
{
if (!object) {
ALLOC_ZVAL(object);
@@ -1297,27 +1595,33 @@ static zval * date_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC)
Z_TYPE_P(object) = IS_OBJECT;
object_init_ex(object, pce);
object->refcount = 1;
- object->is_ref = 1;
+ object->is_ref = 0;
return object;
}
-PHP_FUNCTION(date_create)
+static void date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int time_str_len, zval *timezone_object TSRMLS_DC)
{
- php_date_obj *dateobj;
- zval *timezone_object = NULL;
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;
+ timelib_error_container *err = NULL;
+ int free_tzi = 0;
+
+ if (dateobj->time) {
+ if (dateobj->time->tz_info) {
+ timelib_tzinfo_dtor(dateobj->time->tz_info);
+ }
+ timelib_time_dtor(dateobj->time);
+ }
+ dateobj->time = timelib_strtotime(time_str_len ? time_str : "now", time_str_len ? time_str_len : sizeof("now") -1, &err, DATE_TIMEZONEDB);
+ if (err) {
+ if (err->error_count) {
+ /* spit out the first library error message, at least */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", time_str,
+ err->error_messages[0].position, err->error_messages[0].character, err->error_messages[0].message);
+ }
+ timelib_error_container_dtor(err);
}
- 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", time_str_len ? time_str_len : sizeof("now") -1, NULL, DATE_TIMEZONEDB);
-
if (timezone_object) {
php_timezone_obj *tzobj;
@@ -1348,6 +1652,41 @@ PHP_FUNCTION(date_create)
timelib_time_dtor(now);
}
+/* {{{ proto DateTime date_create([string time[, DateTimeZone object]])
+*/
+PHP_FUNCTION(date_create)
+{
+ zval *timezone_object = NULL;
+ char *time_str = NULL;
+ int time_str_len = 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_instantiate(date_ce_date, return_value TSRMLS_CC);
+ date_initialize(zend_object_store_get_object(return_value TSRMLS_CC), time_str, time_str_len, timezone_object TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ proto DateTime::__construct([string time[, DateTimeZone object]])
+*/
+PHP_METHOD(DateTime, __construct)
+{
+ zval *timezone_object = NULL;
+ char *time_str = NULL;
+ int time_str_len = 0;
+
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
+ php_set_error_handling(EH_THROW, NULL TSRMLS_CC);
+ date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, timezone_object TSRMLS_CC);
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ }
+}
+/* }}} */
+
+/* {{{ proto array date_parse(string date)
+*/
PHP_FUNCTION(date_parse)
{
char *date;
@@ -1442,7 +1781,10 @@ PHP_FUNCTION(date_parse)
}
timelib_time_dtor(parsed_time);
}
+/* }}} */
+/* {{{ proto string date_format(DateTime object, string format)
+*/
PHP_FUNCTION(date_format)
{
zval *object;
@@ -1454,9 +1796,13 @@ PHP_FUNCTION(date_format)
RETURN_FALSE;
}
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
RETURN_STRING(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime), 0);
}
+/* }}} */
+/* {{{ proto void date_modify(DateTime object, string modify)
+*/
PHP_FUNCTION(date_modify)
{
zval *object;
@@ -1469,6 +1815,7 @@ PHP_FUNCTION(date_modify)
RETURN_FALSE;
}
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
tmp_time = timelib_strtotime(modify, modify_len, NULL, DATE_TIMEZONEDB);
dateobj->time->relative.y = tmp_time->relative.y;
@@ -1486,7 +1833,10 @@ PHP_FUNCTION(date_modify)
timelib_update_ts(dateobj->time, NULL);
timelib_update_from_sse(dateobj->time);
}
+/* }}} */
+/* {{{ proto DateTimeZone date_timezone_get(DateTime object)
+*/
PHP_FUNCTION(date_timezone_get)
{
zval *object;
@@ -1497,15 +1847,19 @@ PHP_FUNCTION(date_timezone_get)
RETURN_FALSE;
}
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
if (dateobj->time->is_localtime && dateobj->time->tz_info) {
- date_instanciate(date_ce_timezone, return_value TSRMLS_CC);
+ date_instantiate(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;
}
}
+/* }}} */
+/* {{{ proto void date_timezone_set(DateTime object, DateTimeZone object)
+*/
PHP_FUNCTION(date_timezone_set)
{
zval *object;
@@ -1513,10 +1867,11 @@ PHP_FUNCTION(date_timezone_set)
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) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
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);
@@ -1524,7 +1879,10 @@ PHP_FUNCTION(date_timezone_set)
timelib_set_timezone(dateobj->time, timelib_tzinfo_clone(tzobj->tz));
timelib_unixtime2local(dateobj->time, dateobj->time->sse);
}
+/* }}} */
+/* {{{ proto long date_offset_get(DateTime object)
+*/
PHP_FUNCTION(date_offset_get)
{
zval *object;
@@ -1535,6 +1893,7 @@ PHP_FUNCTION(date_offset_get)
RETURN_FALSE;
}
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
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);
@@ -1544,7 +1903,10 @@ PHP_FUNCTION(date_offset_get)
RETURN_LONG(0);
}
}
+/* }}} */
+/* {{{ proto void date_time_set(DateTime object, long hour, long minute[, long second])
+*/
PHP_FUNCTION(date_time_set)
{
zval *object;
@@ -1555,12 +1917,16 @@ PHP_FUNCTION(date_time_set)
RETURN_FALSE;
}
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
dateobj->time->h = h;
dateobj->time->i = i;
dateobj->time->s = s;
timelib_update_ts(dateobj->time, NULL);
}
+/* }}} */
+/* {{{ proto void date_date_set(DateTime object, long year, long month, long day)
+*/
PHP_FUNCTION(date_date_set)
{
zval *object;
@@ -1571,12 +1937,16 @@ PHP_FUNCTION(date_date_set)
RETURN_FALSE;
}
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
dateobj->time->y = y;
dateobj->time->m = m;
dateobj->time->d = d;
timelib_update_ts(dateobj->time, NULL);
}
+/* }}} */
+/* {{{ proto void date_isodate_set(DateTime object, long year, long week[, long day])
+*/
PHP_FUNCTION(date_isodate_set)
{
zval *object;
@@ -1587,6 +1957,7 @@ PHP_FUNCTION(date_isodate_set)
RETURN_FALSE;
}
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
dateobj->time->y = y;
dateobj->time->m = 1;
dateobj->time->d = 1;
@@ -1595,11 +1966,32 @@ PHP_FUNCTION(date_isodate_set)
timelib_update_ts(dateobj->time, NULL);
}
+/* }}} */
+static int timezone_initialize(timelib_tzinfo **tzi, /*const*/ char *tz TSRMLS_DC)
+{
+ char *tzid;
+
+ *tzi = NULL;
+
+ if ((tzid = timelib_timezone_id_from_abbr(tz, -1, 0))) {
+ *tzi = php_date_parse_tzfile(tzid, DATE_TIMEZONEDB TSRMLS_CC);
+ } else {
+ *tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC);
+ }
+
+ if (*tzi) {
+ return SUCCESS;
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad timezone (%s)", tz);
+ return FAILURE;
+ }
+}
+/* {{{ proto DateTimeZone timezone_open(string timezone)
+*/
PHP_FUNCTION(timezone_open)
{
- php_timezone_obj *tzobj;
char *tz;
int tz_len;
timelib_tzinfo *tzi = NULL;
@@ -1607,29 +1999,33 @@ PHP_FUNCTION(timezone_open)
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 {
+ if (SUCCESS != timezone_initialize(&tzi, tz TSRMLS_CC)) {
RETURN_FALSE;
}
+ ((php_timezone_obj *) zend_object_store_get_object(date_instantiate(date_ce_timezone, return_value TSRMLS_CC) TSRMLS_CC))->tz = tzi;
}
+/* }}} */
+
+/* {{{ proto DateTimeZone::__construct(string timezone)
+*/
+PHP_METHOD(DateTimeZone, __construct)
+{
+ char *tz;
+ int tz_len;
+ timelib_tzinfo *tzi = NULL;
+
+ php_set_error_handling(EH_THROW, NULL TSRMLS_CC);
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len)) {
+ if (SUCCESS == timezone_initialize(&tzi, tz TSRMLS_CC)) {
+ ((php_timezone_obj *) zend_object_store_get_object(getThis() TSRMLS_CC))->tz = tzi;
+ }
+ }
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+}
+/* }}} */
+/* {{{ proto string timezone_name_get(DateTimeZone object)
+*/
PHP_FUNCTION(timezone_name_get)
{
zval *object;
@@ -1639,10 +2035,14 @@ PHP_FUNCTION(timezone_name_get)
RETURN_FALSE;
}
tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(tzobj->tz, DateTimeZone);
RETURN_STRING(tzobj->tz->name, 1);
}
+/* }}} */
+/* {{{ proto string timezone_name_from_abbr(string abbr[, long gmtOffset[, long isdst]])
+*/
PHP_FUNCTION(timezone_name_from_abbr)
{
char *abbr;
@@ -1662,7 +2062,10 @@ PHP_FUNCTION(timezone_name_from_abbr)
RETURN_FALSE;
}
}
+/* }}} */
+/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTime object)
+*/
PHP_FUNCTION(timezone_offset_get)
{
zval *object, *dateobject;
@@ -1674,14 +2077,19 @@ PHP_FUNCTION(timezone_offset_get)
RETURN_FALSE;
}
tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(tzobj->tz, DateTimeZone);
dateobj = (php_date_obj *) zend_object_store_get_object(dateobject TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
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)
+/* {{{ proto array timezone_transitions_get(DateTimeZone object)
+*/
+PHP_FUNCTION(timezone_transitions_get)
{
zval *object, *element;
php_timezone_obj *tzobj;
@@ -1691,6 +2099,7 @@ PHP_FUNCTION(timezone_transistions_get)
RETURN_FALSE;
}
tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(tzobj->tz, DateTimeZone);
array_init(return_value);
for (i = 0; i < tzobj->tz->timecnt; ++i) {
@@ -1705,12 +2114,15 @@ PHP_FUNCTION(timezone_transistions_get)
add_next_index_zval(return_value, element);
}
}
+/* }}} */
+/* {{{ proto array timezone_identifiers_list()
+*/
PHP_FUNCTION(timezone_identifiers_list)
{
- timelib_tzdb *tzdb;
- timelib_tzdb_index_entry *table;
- int i, item_count;
+ const timelib_tzdb *tzdb;
+ const timelib_tzdb_index_entry *table;
+ int i, item_count;
tzdb = DATE_TIMEZONEDB;
item_count = tzdb->index_size;
@@ -1722,11 +2134,14 @@ PHP_FUNCTION(timezone_identifiers_list)
add_next_index_string(return_value, table[i].id, 1);
};
}
+/* }}} */
+/* proto {{{ array timezone_abbreviations_list()
+*/
PHP_FUNCTION(timezone_abbreviations_list)
{
- timelib_tz_lookup_table *table, *entry;
- zval *element, **abbr_array_pp, *abbr_array;
+ const timelib_tz_lookup_table *table, *entry;
+ zval *element, **abbr_array_pp, *abbr_array;
table = timelib_timezone_abbreviations_list();
array_init(return_value);
@@ -1754,8 +2169,7 @@ PHP_FUNCTION(timezone_abbreviations_list)
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 */
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index 57ac98211..27361515c 100644
--- a/ext/date/php_date.h
+++ b/ext/date/php_date.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_date.h,v 1.17.2.11 2006/04/11 18:03:46 derick Exp $ */
+/* $Id: php_date.h,v 1.17.2.11.2.2 2006/08/01 13:28:28 mike Exp $ */
#ifndef PHP_DATE_H
#define PHP_DATE_H
@@ -46,8 +46,8 @@ PHP_FUNCTION(time);
PHP_FUNCTION(localtime);
PHP_FUNCTION(getdate);
-#ifdef EXPERIMENTAL_DATE_SUPPORT
/* Advanced Interface */
+PHP_METHOD(DateTime, __construct);
PHP_FUNCTION(date_create);
PHP_FUNCTION(date_parse);
PHP_FUNCTION(date_format);
@@ -60,14 +60,14 @@ PHP_FUNCTION(date_time_set);
PHP_FUNCTION(date_date_set);
PHP_FUNCTION(date_isodate_set);
+PHP_METHOD(DateTimeZone, __construct);
PHP_FUNCTION(timezone_open);
PHP_FUNCTION(timezone_name_get);
PHP_FUNCTION(timezone_name_from_abbr);
PHP_FUNCTION(timezone_offset_get);
-PHP_FUNCTION(timezone_transistions_get);
+PHP_FUNCTION(timezone_transitions_get);
PHP_FUNCTION(timezone_identifiers_list);
PHP_FUNCTION(timezone_abbreviations_list);
-#endif
/* Options and Configuration */
PHP_FUNCTION(date_default_timezone_set);
diff --git a/ext/date/tests/003.phpt b/ext/date/tests/003.phpt
new file mode 100644
index 000000000..621a87b34
--- /dev/null
+++ b/ext/date/tests/003.phpt
@@ -0,0 +1,47 @@
+--TEST--
+date suffixes test
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+
+for ($i = 0; $i < 32; $i++) {
+ var_dump(date("jS", mktime(0,0,0, 1, $i, 2006)));
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(4) "31st"
+string(3) "1st"
+string(3) "2nd"
+string(3) "3rd"
+string(3) "4th"
+string(3) "5th"
+string(3) "6th"
+string(3) "7th"
+string(3) "8th"
+string(3) "9th"
+string(4) "10th"
+string(4) "11th"
+string(4) "12th"
+string(4) "13th"
+string(4) "14th"
+string(4) "15th"
+string(4) "16th"
+string(4) "17th"
+string(4) "18th"
+string(4) "19th"
+string(4) "20th"
+string(4) "21st"
+string(4) "22nd"
+string(4) "23rd"
+string(4) "24th"
+string(4) "25th"
+string(4) "26th"
+string(4) "27th"
+string(4) "28th"
+string(4) "29th"
+string(4) "30th"
+string(4) "31st"
+Done
diff --git a/ext/date/tests/004.phpt b/ext/date/tests/004.phpt
new file mode 100644
index 000000000..33e1fc791
--- /dev/null
+++ b/ext/date/tests/004.phpt
@@ -0,0 +1,73 @@
+--TEST--
+date() format params
+--FILE--
+<?php
+
+date_default_timezone_set("UTC");
+$tz = array("UTC", "Asia/Jerusalem", "America/Chicago", "Europe/London");
+$t = mktime(0, 0, 0, 6, 27, 2006);
+
+foreach ($tz as $zone) {
+ date_default_timezone_set($zone);
+
+ var_dump(date("w", $t));
+ var_dump(date("z", $t));
+ var_dump(date("n", $t));
+ var_dump(date("t", $t));
+ var_dump(date("L", $t));
+ var_dump(date("a", $t));
+ var_dump(date("B", $t));
+ var_dump(date("g", $t));
+ var_dump(date("G", $t));
+ var_dump(date("Z", $t));
+ var_dump(date("U", $t));
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(1) "2"
+string(3) "177"
+string(1) "6"
+string(2) "30"
+string(1) "0"
+string(2) "am"
+string(3) "041"
+string(2) "12"
+string(1) "0"
+string(1) "0"
+string(10) "1151366400"
+string(1) "2"
+string(3) "177"
+string(1) "6"
+string(2) "30"
+string(1) "0"
+string(2) "am"
+string(3) "041"
+string(1) "3"
+string(1) "3"
+string(5) "10800"
+string(10) "1151366400"
+string(1) "1"
+string(3) "176"
+string(1) "6"
+string(2) "30"
+string(1) "0"
+string(2) "pm"
+string(3) "041"
+string(1) "7"
+string(2) "19"
+string(6) "-18000"
+string(10) "1151366400"
+string(1) "2"
+string(3) "177"
+string(1) "6"
+string(2) "30"
+string(1) "0"
+string(2) "am"
+string(3) "041"
+string(1) "1"
+string(1) "1"
+string(4) "3600"
+string(10) "1151366400"
+Done
diff --git a/ext/date/tests/005.phpt b/ext/date/tests/005.phpt
new file mode 100644
index 000000000..c6551b76b
--- /dev/null
+++ b/ext/date/tests/005.phpt
@@ -0,0 +1,45 @@
+--TEST--
+idate() and invalid params
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+
+$t = mktime(0,0,0, 6, 27, 2006);
+
+var_dump(idate());
+var_dump(idate(1,1,1));
+
+var_dump(idate(1,1));
+var_dump(idate(""));
+var_dump(idate(0));
+
+var_dump(idate("B", $t));
+var_dump(idate("[", $t));
+var_dump(idate("'"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: idate() expects at least 1 parameter, 0 given in %s on line %d
+bool(false)
+
+Warning: idate() expects at most 2 parameters, 3 given in %s on line %d
+bool(false)
+
+Warning: idate(): Unrecognized date format token. in %s on line %d
+bool(false)
+
+Warning: idate(): idate format is one char in %s on line %d
+bool(false)
+
+Warning: idate(): Unrecognized date format token. in %s on line %d
+bool(false)
+int(41)
+
+Warning: idate(): Unrecognized date format token. in %s on line %d
+bool(false)
+
+Warning: idate(): Unrecognized date format token. in %s on line %d
+bool(false)
+Done
diff --git a/ext/date/tests/006.phpt b/ext/date/tests/006.phpt
new file mode 100644
index 000000000..407242b16
--- /dev/null
+++ b/ext/date/tests/006.phpt
@@ -0,0 +1,33 @@
+--TEST--
+checkdate() tests
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+
+var_dump(checkdate());
+var_dump(checkdate(1,1,1));
+
+var_dump(checkdate(2,29,2006));
+var_dump(checkdate(31,6,2006));
+var_dump(checkdate(1,1,32768));
+var_dump(checkdate(1,1,32767));
+
+var_dump(checkdate(-1,1,2006));
+var_dump(checkdate(1,-1,2006));
+var_dump(checkdate(1,1,-1));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: checkdate() expects exactly 3 parameters, 0 given in %s on line %d
+bool(false)
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+Done
diff --git a/ext/date/tests/007.phpt b/ext/date/tests/007.phpt
new file mode 100644
index 000000000..f0c878465
--- /dev/null
+++ b/ext/date/tests/007.phpt
@@ -0,0 +1,101 @@
+--TEST--
+localtime() tests
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+
+$t = mktime(0,0,0, 6, 27, 2006);
+var_dump(localtime(1,1,1));
+
+var_dump(localtime());
+var_dump(localtime($t));
+var_dump(localtime($t, true));
+var_dump(localtime($t, false));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: localtime() expects at most 2 parameters, 3 given in %s on line %d
+bool(false)
+array(9) {
+ [0]=>
+ int(%d)
+ [1]=>
+ int(%d)
+ [2]=>
+ int(%d)
+ [3]=>
+ int(%d)
+ [4]=>
+ int(%d)
+ [5]=>
+ int(%d)
+ [6]=>
+ int(%d)
+ [7]=>
+ int(%d)
+ [8]=>
+ int(%d)
+}
+array(9) {
+ [0]=>
+ int(0)
+ [1]=>
+ int(0)
+ [2]=>
+ int(0)
+ [3]=>
+ int(27)
+ [4]=>
+ int(5)
+ [5]=>
+ int(106)
+ [6]=>
+ int(2)
+ [7]=>
+ int(177)
+ [8]=>
+ int(0)
+}
+array(9) {
+ ["tm_sec"]=>
+ int(0)
+ ["tm_min"]=>
+ int(0)
+ ["tm_hour"]=>
+ int(0)
+ ["tm_mday"]=>
+ int(27)
+ ["tm_mon"]=>
+ int(5)
+ ["tm_year"]=>
+ int(106)
+ ["tm_wday"]=>
+ int(2)
+ ["tm_yday"]=>
+ int(177)
+ ["tm_isdst"]=>
+ int(0)
+}
+array(9) {
+ [0]=>
+ int(0)
+ [1]=>
+ int(0)
+ [2]=>
+ int(0)
+ [3]=>
+ int(27)
+ [4]=>
+ int(5)
+ [5]=>
+ int(106)
+ [6]=>
+ int(2)
+ [7]=>
+ int(177)
+ [8]=>
+ int(0)
+}
+Done
diff --git a/ext/date/tests/008.phpt b/ext/date/tests/008.phpt
new file mode 100644
index 000000000..424e15678
--- /dev/null
+++ b/ext/date/tests/008.phpt
@@ -0,0 +1,67 @@
+--TEST--
+getdate() tests
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+
+$t = mktime(0,0,0, 6, 27, 2006);
+var_dump(getdate(1,1));
+
+var_dump(getdate($t));
+var_dump(getdate());
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: getdate() expects at most 1 parameter, 2 given in %s on line %d
+bool(false)
+array(11) {
+ ["seconds"]=>
+ int(0)
+ ["minutes"]=>
+ int(0)
+ ["hours"]=>
+ int(0)
+ ["mday"]=>
+ int(27)
+ ["wday"]=>
+ int(2)
+ ["mon"]=>
+ int(6)
+ ["year"]=>
+ int(2006)
+ ["yday"]=>
+ int(177)
+ ["weekday"]=>
+ string(7) "Tuesday"
+ ["month"]=>
+ string(4) "June"
+ [0]=>
+ int(1151366400)
+}
+array(11) {
+ ["seconds"]=>
+ int(%d)
+ ["minutes"]=>
+ int(%d)
+ ["hours"]=>
+ int(%d)
+ ["mday"]=>
+ int(%d)
+ ["wday"]=>
+ int(%d)
+ ["mon"]=>
+ int(%d)
+ ["year"]=>
+ int(%d)
+ ["yday"]=>
+ int(%d)
+ ["weekday"]=>
+ string(%d) "%s"
+ ["month"]=>
+ string(%d) "%s"
+ [0]=>
+ int(%d)
+}
+Done
diff --git a/ext/date/tests/009.phpt b/ext/date/tests/009.phpt
new file mode 100644
index 000000000..0ce7b7e0b
--- /dev/null
+++ b/ext/date/tests/009.phpt
@@ -0,0 +1,46 @@
+--TEST--
+strftime() and gmstrftime() tests
+--INI--
+date.timezone=Asia/Jerusalem
+--FILE--
+<?php
+
+$t = mktime(0,0,0, 6, 27, 2006);
+
+var_dump(strftime());
+
+var_dump(strftime(""));
+var_dump(strftime("%a %A %b %B %c %C %d %D %e %g %G %h %H %I %j %m %M %n %p %r %R %S %t %T %u %U %V %W %w %x %X %y %Y %Z %z %%", $t));
+var_dump(strftime("%%q %%a", $t));
+var_dump(strftime("%q", $t));
+var_dump(strftime("blah", $t));
+
+var_dump(gmstrftime());
+
+var_dump(gmstrftime(""));
+var_dump(gmstrftime("%a %A %b %B %c %C %d %D %e %g %G %h %H %I %j %m %M %n %p %r %R %S %t %T %u %U %V %W %w %x %X %y %Y %Z %z %%", $t));
+var_dump(gmstrftime("%%q %%a", $t));
+var_dump(gmstrftime("%q", $t));
+var_dump(gmstrftime("blah", $t));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: strftime() expects at least 1 parameter, 0 given in %s on line %d
+bool(false)
+bool(false)
+string(%d) "Tue Tuesday Jun June Tue Jun 27 00:00:00 2006 %s
+%s %"
+string(5) "%q %a"
+string(%d) "%s"
+string(4) "blah"
+
+Warning: gmstrftime() expects at least 1 parameter, 0 given in %s on line %d
+bool(false)
+bool(false)
+string(%d) "Mon Monday Jun June Mon Jun 26 21:00:00 2006 %s
+%s %"
+string(5) "%q %a"
+string(%d) "%s"
+string(4) "blah"
+Done
diff --git a/ext/date/tests/bug20382-2.phpt b/ext/date/tests/bug20382-2.phpt
index 6e6a1ba6f..639f1b799 100644
--- a/ext/date/tests/bug20382-2.phpt
+++ b/ext/date/tests/bug20382-2.phpt
@@ -166,5 +166,5 @@ 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
+result = Monday 1996-01-01 00:00:00 AZT
wanted = Monday 00:00:00
diff --git a/ext/date/tests/bug37368.phpt b/ext/date/tests/bug37368.phpt
new file mode 100644
index 000000000..5be1c9679
--- /dev/null
+++ b/ext/date/tests/bug37368.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #37368 (Incorrect timestamp returned for strtotime()).
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+echo date("r", strtotime("Mon, 08 May 2006 13:06:44 -0400 +30 days"));
+?>
+--EXPECT--
+Wed, 07 Jun 2006 17:06:44 +0000
diff --git a/ext/date/tests/bug37514.phpt b/ext/date/tests/bug37514.phpt
new file mode 100644
index 000000000..31318b46a
--- /dev/null
+++ b/ext/date/tests/bug37514.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #37514 (strtotime doesn't assume year correctly).
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+echo date('r', strtotime('May 18th 5:05')), "\n";
+echo date('r', strtotime('May 18th 5:05pm')), "\n";
+echo date('r', strtotime('May 18th 5:05 pm')), "\n";
+echo date('r', strtotime('May 18th 5:05am')), "\n";
+echo date('r', strtotime('May 18th 5:05 am')), "\n";
+echo date('r', strtotime('May 18th 2006 5:05pm')), "\n";
+?>
+--EXPECT--
+Thu, 18 May 2006 05:05:00 +0000
+Thu, 18 May 2006 17:05:00 +0000
+Thu, 18 May 2006 17:05:00 +0000
+Thu, 18 May 2006 05:05:00 +0000
+Thu, 18 May 2006 05:05:00 +0000
+Thu, 18 May 2006 17:05:00 +0000
diff --git a/ext/date/tests/bug37616.phpt b/ext/date/tests/bug37616.phpt
new file mode 100644
index 000000000..765250176
--- /dev/null
+++ b/ext/date/tests/bug37616.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Bug #37616 (DATE_RFC822 does not product RFC 822 dates)
+--FILE--
+<?php
+ date_default_timezone_set("Europe/Oslo");
+ var_dump(date(DATE_RFC822, strtotime("1 Jul 06 14:27:30 +0200")));
+?>
+--EXPECT--
+string(29) "Sat, 01 Jul 06 14:27:30 +0200"
diff --git a/ext/date/tests/bug37747.phpt b/ext/date/tests/bug37747.phpt
new file mode 100644
index 000000000..465f791c4
--- /dev/null
+++ b/ext/date/tests/bug37747.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #37747 (strtotime segfaults when given "nextyear")
+--FILE--
+<?php
+ date_default_timezone_set("Europe/Oslo");
+ var_dump(strtotime("nextyear"));
+ echo "ALIVE\n";
+?>
+--EXPECT--
+bool(false)
+ALIVE
diff --git a/ext/date/tests/bug38229.phpt b/ext/date/tests/bug38229.phpt
new file mode 100644
index 000000000..472a05fae
--- /dev/null
+++ b/ext/date/tests/bug38229.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #38229 (strtotime() does not parse YYYY-MM)
+--FILE--
+<?php
+date_default_timezone_set("GMT");
+echo date("Y-m", strtotime('2006-1'))."\n";
+echo date("Y-m", strtotime('2006-03'))."\n";
+echo date("Y-m", strtotime('2006-12'))."\n";
+?>
+--EXPECT--
+2006-01
+2006-03
+2006-12
diff --git a/ext/date/tests/date_constants.phpt b/ext/date/tests/date_constants.phpt
new file mode 100644
index 000000000..132e24159
--- /dev/null
+++ b/ext/date/tests/date_constants.phpt
@@ -0,0 +1,75 @@
+--TEST--
+Date constants
+--FILE--
+<?php
+ date_default_timezone_set("Europe/Oslo");
+ $constants = array(
+ DATE_ATOM,
+ DATE_COOKIE,
+ DATE_ISO8601,
+ DATE_RFC822,
+ DATE_RFC850,
+ DATE_RFC1036,
+ DATE_RFC1123,
+ DATE_RFC2822,
+ DATE_RFC3339,
+ DATE_RSS,
+ DATE_W3C
+ );
+
+ foreach($constants as $const) {
+ var_dump(date($const, strtotime("1 Jul 06 14:27:30 +0200")));
+ var_dump(date($const, strtotime("2006-05-30T14:32:13+02:00")));
+ }
+
+ print "\n";
+
+ var_dump(
+ DATE_ATOM == DateTime::ATOM,
+ DATE_COOKIE == DateTime::COOKIE,
+ DATE_ISO8601 == DateTime::ISO8601,
+ DATE_RFC822 == DateTime::RFC822,
+ DATE_RFC850 == DateTime::RFC850,
+ DATE_RFC1036 == DateTime::RFC1036,
+ DATE_RFC1123 == DateTime::RFC1123,
+ DATE_RFC2822 == DateTime::RFC2822,
+ DATE_RFC3339 == DateTime::RFC3339,
+ DATE_RSS == DateTime::RSS,
+ DATE_W3C == DateTime::W3C
+ );
+?>
+--EXPECT--
+string(25) "2006-07-01T14:27:30+02:00"
+string(25) "2006-05-30T14:32:13+02:00"
+string(33) "Saturday, 01-Jul-06 14:27:30 CEST"
+string(32) "Tuesday, 30-May-06 14:32:13 CEST"
+string(24) "2006-07-01T14:27:30+0200"
+string(24) "2006-05-30T14:32:13+0200"
+string(29) "Sat, 01 Jul 06 14:27:30 +0200"
+string(29) "Tue, 30 May 06 14:32:13 +0200"
+string(33) "Saturday, 01-Jul-06 14:27:30 CEST"
+string(32) "Tuesday, 30-May-06 14:32:13 CEST"
+string(29) "Sat, 01 Jul 06 14:27:30 +0200"
+string(29) "Tue, 30 May 06 14:32:13 +0200"
+string(31) "Sat, 01 Jul 2006 14:27:30 +0200"
+string(31) "Tue, 30 May 2006 14:32:13 +0200"
+string(31) "Sat, 01 Jul 2006 14:27:30 +0200"
+string(31) "Tue, 30 May 2006 14:32:13 +0200"
+string(25) "2006-07-01T14:27:30+02:00"
+string(25) "2006-05-30T14:32:13+02:00"
+string(31) "Sat, 01 Jul 2006 14:27:30 +0200"
+string(31) "Tue, 30 May 2006 14:32:13 +0200"
+string(25) "2006-07-01T14:27:30+02:00"
+string(25) "2006-05-30T14:32:13+02:00"
+
+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/date/tests/date_create-1.phpt b/ext/date/tests/date_create-1.phpt
index c66bb6fd3..365d54dc9 100644
--- a/ext/date/tests/date_create-1.phpt
+++ b/ext/date/tests/date_create-1.phpt
@@ -28,7 +28,7 @@ $d[] = date_create("2005-07-14 22:30:41 Europe/Oslo", $tz1);
$d[] = date_create("2005-07-14 22:30:41 America/Los_Angeles", $tz2);
foreach($d as $date) {
- echo $date->format(date::ISO8601), "\n";
+ echo $date->format(DateTime::ISO8601), "\n";
}
?>
--EXPECT--
diff --git a/ext/date/tests/date_create-2.phpt b/ext/date/tests/date_create-2.phpt
index d7c785e22..4aa33595d 100644
--- a/ext/date/tests/date_create-2.phpt
+++ b/ext/date/tests/date_create-2.phpt
@@ -6,7 +6,7 @@ date_create() function [2]
<?php
date_default_timezone_set("GMT");
$d = date_create("2005-07-18 22:10:00 +0400");
-echo $d->format(date::RFC822), "\n";
+echo $d->format('D, d M Y H:i:s T'), "\n";
?>
--EXPECT--
Mon, 18 Jul 2005 22:10:00 GMT+0400
diff --git a/ext/date/tests/date_modify-1.phpt b/ext/date/tests/date_modify-1.phpt
index dc03f5ff9..7707b7fc2 100644
--- a/ext/date/tests/date_modify-1.phpt
+++ b/ext/date/tests/date_modify-1.phpt
@@ -6,20 +6,20 @@ date_modify() function [1]
<?php
date_default_timezone_set("Pacific/Kwajalein");
$ts = date_create("Thu Aug 19 1993 23:59:59");
-echo date_format($ts, date::RFC822), "\n";
+echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
$ts->modify("+1 second");
-echo date_format($ts, date::RFC822), "\n";
+echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
date_default_timezone_set("Europe/Amsterdam");
$ts = date_create("Sun Mar 27 01:59:59 2005");
-echo date_format($ts, date::RFC822), "\n";
+echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
$ts->modify("+1 second");
-echo date_format($ts, date::RFC822), "\n";
+echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
$ts = date_create("Sun Oct 30 01:59:59 2005");
-echo date_format($ts, date::RFC822), "\n";
+echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
$ts->modify("+ 1 hour 1 second");
-echo date_format($ts, date::RFC822), "\n";
+echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
?>
--EXPECT--
Thu, 19 Aug 1993 23:59:59 KWAT
diff --git a/ext/date/tests/date_modify-2.phpt b/ext/date/tests/date_modify-2.phpt
index 9bf7a5d2d..cc197fcdc 100644
--- a/ext/date/tests/date_modify-2.phpt
+++ b/ext/date/tests/date_modify-2.phpt
@@ -6,9 +6,9 @@ date_modify() function [2]
<?php
date_default_timezone_set("GMT");
$d = date_create("2005-07-18 22:10:00 +0400");
-echo date_format($d, date::RFC822), "\n";
+echo date_format($d, 'D, d M Y H:i:s T'), "\n";
date_modify($d, "+1 hour");
-echo date_format($d, date::RFC822), "\n";
+echo date_format($d, 'D, d M Y H:i:s T'), "\n";
?>
--EXPECT--
Mon, 18 Jul 2005 22:10:00 GMT+0400
diff --git a/ext/date/tests/oo_001.phpt b/ext/date/tests/oo_001.phpt
new file mode 100644
index 000000000..9b6142158
--- /dev/null
+++ b/ext/date/tests/oo_001.phpt
@@ -0,0 +1,53 @@
+--TEST--
+date OO interface
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+class _d extends DateTime {
+ function __construct() {
+ }
+}
+class _t extends DateTimeZone {
+ function __construct() {
+ }
+}
+
+$d = new DateTime;
+var_dump($d->format("Y-m-d H:i:s"));
+
+$d = new _d;
+var_dump($d->format("Y-m-d H:i:s"));
+
+try {
+ new DateTime("1am todax");
+} catch (Exception $e) {
+ echo $e->getMessage(),"\n";
+}
+
+$t = new DateTimeZone("UTC");
+var_dump($t->getName());
+
+$t = new _t;
+var_dump($t->getName());
+
+try {
+ new DateTimeZone("GottaFindThisOne");
+} catch (Exception $e) {
+ echo $e->getMessage(),"\n";
+}
+
+echo "DONE\n";
+?>
+--EXPECTF--
+string(19) "%d-%d-%d %d:%d:%d"
+
+Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %soo_001.php on line %d
+bool(false)
+DateTime::__construct(): Failed to parse time string (1am todax) at position 4 (t): The timezone could not be found in the database
+string(3) "UTC"
+
+Warning: DateTimeZone::getName(): The DateTimeZone object has not been correctly initialized by its constructor in %soo_001.php on line %d
+bool(false)
+DateTimeZone::__construct(): Unknown or bad timezone (GottaFindThisOne)
+DONE
diff --git a/ext/date/tests/oo_002.phpt b/ext/date/tests/oo_002.phpt
new file mode 100644
index 000000000..a83cb583b
--- /dev/null
+++ b/ext/date/tests/oo_002.phpt
@@ -0,0 +1,28 @@
+--TEST--
+date OO cloning
+--INI--
+date.timezone=Europe/Berlin
+--FILE--
+<?php
+class _d extends DateTime {}
+class _t extends DateTimeZone {}
+$d = new _d("1pm Aug 1 GMT");
+var_dump($d->format(DateTime::RFC822));
+$c = clone $d;
+var_dump($c->format(DateTime::RFC822));
+$d->modify("1 hour after");
+$c->modify("1 second ago");
+var_dump($d->format(DateTime::RFC822));
+var_dump($c->format(DateTime::RFC822));
+$t = new _t("Asia/Tokyo");
+var_dump($t->getName());
+$c = clone $t;
+var_dump($c->getName());
+?>
+--EXPECT--
+string(29) "Tue, 01 Aug 06 13:00:00 +0000"
+string(29) "Tue, 01 Aug 06 13:00:00 +0000"
+string(29) "Tue, 01 Aug 06 14:00:00 +0000"
+string(29) "Tue, 01 Aug 06 12:59:59 +0000"
+string(10) "Asia/Tokyo"
+string(10) "Asia/Tokyo"
diff --git a/ext/date/tests/strtotime-mysql.phpt b/ext/date/tests/strtotime-mysql.phpt
new file mode 100755
index 000000000..88a8f10fe
--- /dev/null
+++ b/ext/date/tests/strtotime-mysql.phpt
@@ -0,0 +1,25 @@
+--TEST--
+strtotime() and mysql timestamps
+--FILE--
+<?php
+date_default_timezone_set('UTC');
+
+/* Format: YYYYMMDDHHMMSS */
+$d[] = '19970523091528';
+$d[] = '20001231185859';
+$d[] = '20800410101010'; // overflow..
+
+foreach($d as $date) {
+ $time = strtotime($date);
+
+ if (is_integer($time)) {
+ var_dump(date('r', $time));
+ } else {
+ var_dump($time);
+ }
+}
+?>
+--EXPECT--
+string(31) "Fri, 23 May 1997 09:15:28 +0000"
+string(31) "Sun, 31 Dec 2000 18:58:59 +0000"
+bool(false)
diff --git a/ext/date/tests/strtotime2.phpt b/ext/date/tests/strtotime2.phpt
new file mode 100644
index 000000000..b8b605923
--- /dev/null
+++ b/ext/date/tests/strtotime2.phpt
@@ -0,0 +1,40 @@
+--TEST--
+strtotime() on date constants
+--FILE--
+<?php
+
+date_default_timezone_set("Europe/Oslo");
+$time = time();
+
+$constants = array(
+ 'DATE_ATOM',
+ 'DATE_COOKIE',
+ 'DATE_ISO8601',
+ 'DATE_RFC822',
+ 'DATE_RFC850',
+ 'DATE_RFC1036',
+ 'DATE_RFC1123',
+ 'DATE_RFC2822',
+ 'DATE_RFC3339',
+ 'DATE_RSS',
+ 'DATE_W3C'
+);
+
+
+foreach ($constants as $const) {
+ echo "$const:\t";
+ echo ((strtotime(date(constant($const), $time)) === $time) ? "OK" : "FAIL") . "\n";
+}
+?>
+--EXPECT--
+DATE_ATOM: OK
+DATE_COOKIE: OK
+DATE_ISO8601: OK
+DATE_RFC822: OK
+DATE_RFC850: OK
+DATE_RFC1036: OK
+DATE_RFC1123: OK
+DATE_RFC2822: OK
+DATE_RFC3339: OK
+DATE_RSS: OK
+DATE_W3C: OK
diff --git a/ext/date/tests/strtotime3.phpt b/ext/date/tests/strtotime3.phpt
new file mode 100644
index 000000000..c5d13d8a6
--- /dev/null
+++ b/ext/date/tests/strtotime3.phpt
@@ -0,0 +1,69 @@
+--TEST--
+strtotime() function
+--FILE--
+<?php
+date_default_timezone_set('Europe/Lisbon');
+$time = 1150494719; // 16/June/2006
+
+$strs = array(
+ '',
+ " \t\r\n000",
+ 'yesterday',
+ '22:49:12',
+ '22:49:12 bogusTZ',
+ '22.49.12.42GMT',
+ '22.49.12.42bogusTZ',
+ 't0222',
+ 't0222 t0222',
+ '022233',
+ '022233 bogusTZ',
+ '2-3-2004',
+ '2.3.2004',
+ '20060212T23:12:23UTC',
+ '20060212T23:12:23 bogusTZ',
+ '2006167', //pgydotd
+ 'Jan-15-2006', //pgtextshort
+ '2006-Jan-15', //pgtextreverse
+ '10/Oct/2000:13:55:36 +0100', //clf
+ '10/Oct/2000:13:55:36 +00100', //clf
+ '2006',
+ '1986', // year
+ 'JAN',
+ 'January',
+);
+
+foreach ($strs as $str) {
+ $t = strtotime($str, $time);
+ if (is_integer($t)) {
+ var_dump(date(DATE_RFC2822, $t));
+ } else {
+ var_dump($t);
+ }
+}
+
+?>
+--EXPECT--
+bool(false)
+bool(false)
+string(31) "Thu, 15 Jun 2006 00:00:00 +0100"
+string(31) "Fri, 16 Jun 2006 22:49:12 +0100"
+bool(false)
+string(31) "Fri, 16 Jun 2006 23:49:12 +0100"
+bool(false)
+string(31) "Fri, 16 Jun 2006 02:22:00 +0100"
+bool(false)
+string(31) "Fri, 16 Jun 2006 02:22:33 +0100"
+bool(false)
+string(31) "Tue, 02 Mar 2004 00:00:00 +0000"
+string(31) "Tue, 02 Mar 2004 00:00:00 +0000"
+string(31) "Sun, 12 Feb 2006 23:12:23 +0000"
+bool(false)
+string(31) "Fri, 16 Jun 2006 00:00:00 +0100"
+string(31) "Sun, 15 Jan 2006 00:00:00 +0000"
+string(31) "Sun, 15 Jan 2006 00:00:00 +0000"
+string(31) "Tue, 10 Oct 2000 13:55:36 +0100"
+bool(false)
+string(31) "Fri, 16 Jun 2006 20:06:00 +0100"
+string(31) "Mon, 16 Jun 1986 22:51:59 +0100"
+string(31) "Mon, 16 Jan 2006 00:00:00 +0000"
+string(31) "Mon, 16 Jan 2006 00:00:00 +0000"
diff --git a/ext/date/tests/timezones.phpt b/ext/date/tests/timezones.phpt
new file mode 100644
index 000000000..c7e470ab8
--- /dev/null
+++ b/ext/date/tests/timezones.phpt
@@ -0,0 +1,26 @@
+--TEST--
+setting bogus timezones
+--FILE--
+<?php
+
+//bogus
+var_dump(date_default_timezone_set('AAA'));
+var_dump(date_default_timezone_set('ZZZ'));
+
+
+//now the first and the last one
+var_dump(date_default_timezone_set("Africa/Abidjan"));
+var_dump(date_default_timezone_set("Zulu"));
+
+echo "done\n";
+
+?>
+--EXPECTF--
+Notice: date_default_timezone_set(): Timezone ID 'AAA' is invalid in %stimezones.php on line 4
+bool(false)
+
+Notice: date_default_timezone_set(): Timezone ID 'ZZZ' is invalid in %stimezones.php on line 5
+bool(false)
+bool(true)
+bool(true)
+done
diff --git a/ext/dba/config.m4 b/ext/dba/config.m4
index 377ee76e7..8099c783b 100644
--- a/ext/dba/config.m4
+++ b/ext/dba/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.70.2.2 2005/11/29 18:25:58 tony2001 Exp $
+dnl $Id: config.m4,v 1.70.2.2.2.1 2006/08/07 07:57:12 helly Exp $
dnl
dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -493,7 +493,7 @@ AC_ARG_WITH(cdb,
PHP_DBA_STD_ATTACH
fi
],[
- if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1"; then
+ if test "$PHP_DBA" != "no" && test "$HAVE_DBA" = "1"; then
PHP_DBA_BUILTIN_CDB
fi
])
@@ -511,7 +511,7 @@ AC_ARG_WITH(inifile,
PHP_DBA_BUILTIN_INI
fi
],[
- if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1"; then
+ if test "$PHP_DBA" != "no" && test "$HAVE_DBA" = "1"; then
PHP_DBA_BUILTIN_INI
fi
])
@@ -532,7 +532,7 @@ AC_ARG_WITH(flatfile,
PHP_DBA_BUILTIN_FLATFILE
fi
],[
- if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1"; then
+ if test "$PHP_DBA" != "no" && test "$HAVE_DBA" = "1"; then
PHP_DBA_BUILTIN_FLATFILE
fi
])
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index e0416e1ea..69634b10d 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba.c,v 1.111.2.4 2006/01/01 12:50:05 sniper Exp $ */
+/* $Id: dba.c,v 1.111.2.4.2.3 2006/07/06 23:13:18 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -51,24 +51,115 @@
#include "php_inifile.h"
#include "php_qdbm.h"
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_popen, 0, 0, 2)
+ ZEND_ARG_INFO(0, path)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, handlername)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_open, 0, 0, 2)
+ ZEND_ARG_INFO(0, path)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, handlername)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dba_close, 0)
+ ZEND_ARG_INFO(0, handle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dba_exists, 0)
+ ZEND_ARG_INFO(0, key)
+ ZEND_ARG_INFO(0, handle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_fetch, 0, 0, 2)
+ ZEND_ARG_INFO(0, key)
+ ZEND_ARG_INFO(0, skip)
+ ZEND_ARG_INFO(0, handle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dba_key_split, 0)
+ ZEND_ARG_INFO(0, key)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dba_firstkey, 0)
+ ZEND_ARG_INFO(0, handle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dba_nextkey, 0)
+ ZEND_ARG_INFO(0, handle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dba_delete, 0)
+ ZEND_ARG_INFO(0, key)
+ ZEND_ARG_INFO(0, handle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dba_insert, 0)
+ ZEND_ARG_INFO(0, key)
+ ZEND_ARG_INFO(0, value)
+ ZEND_ARG_INFO(0, handle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dba_replace, 0)
+ ZEND_ARG_INFO(0, key)
+ ZEND_ARG_INFO(0, value)
+ ZEND_ARG_INFO(0, handle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dba_optimize, 0)
+ ZEND_ARG_INFO(0, handle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dba_sync, 0)
+ ZEND_ARG_INFO(0, handle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_handlers, 0, 0, 0)
+ ZEND_ARG_INFO(0, full_info)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dba_list, 0)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
/* {{{ dba_functions[]
*/
zend_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)
+ PHP_FE(dba_open, arginfo_dba_open)
+ PHP_FE(dba_popen, arginfo_dba_popen)
+ PHP_FE(dba_close, arginfo_dba_close)
+ PHP_FE(dba_delete, arginfo_dba_delete)
+ PHP_FE(dba_exists, arginfo_dba_exists)
+ PHP_FE(dba_fetch, arginfo_dba_fetch)
+ PHP_FE(dba_insert, arginfo_dba_insert)
+ PHP_FE(dba_replace, arginfo_dba_replace)
+ PHP_FE(dba_firstkey, arginfo_dba_firstkey)
+ PHP_FE(dba_nextkey, arginfo_dba_nextkey)
+ PHP_FE(dba_optimize, arginfo_dba_optimize)
+ PHP_FE(dba_sync, arginfo_dba_sync)
+ PHP_FE(dba_handlers, arginfo_dba_handlers)
+ PHP_FE(dba_list, arginfo_dba_list)
+ PHP_FE(dba_key_split, arginfo_dba_key_split)
{NULL, NULL, NULL}
};
/* }}} */
@@ -77,6 +168,21 @@ PHP_MINIT_FUNCTION(dba);
PHP_MSHUTDOWN_FUNCTION(dba);
PHP_MINFO_FUNCTION(dba);
+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 PHP_GINIT_FUNCTION(dba);
+
zend_module_entry dba_module_entry = {
STANDARD_MODULE_HEADER,
"dba",
@@ -87,7 +193,11 @@ zend_module_entry dba_module_entry = {
NULL,
PHP_MINFO(dba),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(dba),
+ PHP_GINIT(dba),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
#ifdef COMPILE_DL_DBA
@@ -117,7 +227,7 @@ static size_t php_dba_make_key(zval **key, char **key_str, char **key_free TSRML
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)");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Key does not have exactly two elements: (key, name)");
return -1;
}
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(key), &pos);
@@ -287,21 +397,9 @@ static dba_handler handler[] = {
#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)
@@ -407,9 +505,9 @@ PHP_INI_BEGIN()
PHP_INI_END()
/* }}} */
-/* {{{ php_dba_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
-static void php_dba_init_globals(zend_dba_globals *dba_globals)
+static PHP_GINIT_FUNCTION(dba)
{
dba_globals->default_handler = "";
dba_globals->default_hptr = NULL;
@@ -420,7 +518,6 @@ static void php_dba_init_globals(zend_dba_globals *dba_globals)
*/
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);
diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c
index fb5f8878b..df82a5674 100644
--- a/ext/dba/libinifile/inifile.c
+++ b/ext/dba/libinifile/inifile.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: inifile.c,v 1.14.2.1 2006/01/01 12:50:05 sniper Exp $ */
+/* $Id: inifile.c,v 1.14.2.1.2.1 2006/07/06 23:13:18 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -43,7 +43,7 @@
/* {{{ inifile_version */
char *inifile_version()
{
- return "1.0, $Revision: 1.14.2.1 $";
+ return "1.0, $Revision: 1.14.2.1.2.1 $";
}
/* }}} */
@@ -538,7 +538,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated");
ret = FAILURE;
}
}
diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c
index f6c6f81c8..b905d89bd 100644
--- a/ext/dbase/dbase.c
+++ b/ext/dbase/dbase.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbase.c,v 1.74.2.2 2006/01/01 12:50:05 sniper Exp $ */
+/* $Id: dbase.c,v 1.74.2.2.2.5 2006/10/10 23:01:23 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -132,6 +132,9 @@ PHP_FUNCTION(dbase_open)
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;
+ } else if (Z_LVAL_PP(options) < 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid access mode %ld", Z_LVAL_PP(options));
+ RETURN_FALSE;
}
if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_PP(dbf_name), NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
@@ -503,6 +506,13 @@ static void php_dbase_get_record(INTERNAL_FUNCTION_PARAMETERS, int assoc)
}
}
break;
+ case 'F':
+ 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 */
@@ -690,6 +700,9 @@ PHP_FUNCTION(dbase_create)
case 'D':
cur_f->db_flen = 8;
break;
+ case 'F':
+ cur_f->db_flen = 20;
+ break;
case 'N':
case 'C':
/* field length */
@@ -713,6 +726,8 @@ PHP_FUNCTION(dbase_create)
break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unknown field type '%c'", cur_f->db_type);
+ free_dbf_head(dbh);
+ RETURN_FALSE;
}
cur_f->db_foffset = rlen;
rlen += cur_f->db_flen;
@@ -728,21 +743,92 @@ PHP_FUNCTION(dbase_create)
}
/* }}} */
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dbase_open, 0)
+ ZEND_ARG_INFO(0, name)
+ ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dbase_close, 0)
+ ZEND_ARG_INFO(0, identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dbase_numrecords, 0)
+ ZEND_ARG_INFO(0, identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dbase_numfields, 0)
+ ZEND_ARG_INFO(0, identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dbase_pack, 0)
+ ZEND_ARG_INFO(0, identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dbase_add_record, 0)
+ ZEND_ARG_INFO(0, identifier)
+ ZEND_ARG_INFO(0, data) /* ARRAY_INFO(0, data, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dbase_replace_record, 0)
+ ZEND_ARG_INFO(0, identifier)
+ ZEND_ARG_INFO(0, data) /* ARRAY_INFO(0, data, 0) */
+ ZEND_ARG_INFO(0, recnum)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dbase_delete_record, 0)
+ ZEND_ARG_INFO(0, identifier)
+ ZEND_ARG_INFO(0, record)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dbase_get_record, 0)
+ ZEND_ARG_INFO(0, identifier)
+ ZEND_ARG_INFO(0, record)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dbase_get_record_with_names, 0)
+ ZEND_ARG_INFO(0, identifier)
+ ZEND_ARG_INFO(0, record)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dbase_create, 0)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, fields) /* ARRAY_INFO(0, fields, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dbase_get_header_info, 0)
+ ZEND_ARG_INFO(0, database_handle)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
/* {{{ dbase_functions[]
*/
zend_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)
+ PHP_FE(dbase_open, arginfo_dbase_open)
+ PHP_FE(dbase_create, arginfo_dbase_create)
+ PHP_FE(dbase_close, arginfo_dbase_close)
+ PHP_FE(dbase_numrecords, arginfo_dbase_numrecords)
+ PHP_FE(dbase_numfields, arginfo_dbase_numfields)
+ PHP_FE(dbase_add_record, arginfo_dbase_add_record)
+ PHP_FE(dbase_replace_record, arginfo_dbase_replace_record)
+ PHP_FE(dbase_get_record, arginfo_dbase_get_record)
+ PHP_FE(dbase_get_record_with_names, arginfo_dbase_get_record_with_names)
+ PHP_FE(dbase_delete_record, arginfo_dbase_delete_record)
+ PHP_FE(dbase_pack, arginfo_dbase_pack)
+ PHP_FE(dbase_get_header_info, arginfo_dbase_get_header_info)
{NULL, NULL, NULL}
};
/* }}} */
@@ -789,6 +875,7 @@ PHP_FUNCTION(dbase_get_header_info)
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;
+ case 'F': add_assoc_string(row, "type", "float", 1); break;
default: add_assoc_string(row, "type", "unknown", 1); break;
}
diff --git a/ext/dbase/dbf_head.c b/ext/dbase/dbf_head.c
index f45a99cfd..42935c2ea 100644
--- a/ext/dbase/dbf_head.c
+++ b/ext/dbase/dbf_head.c
@@ -26,10 +26,14 @@ dbhead_t *get_dbf_head(int fd)
if ((dbh = (dbhead_t *)calloc(1, sizeof(dbhead_t))) == NULL)
return NULL;
- if (lseek(fd, 0, 0) < 0)
+ if (lseek(fd, 0, 0) < 0) {
+ free(dbh);
return NULL;
- if ((ret = read(fd, &dbhead, sizeof(dbhead))) < 0)
+ }
+ if ((ret = read(fd, &dbhead, sizeof(dbhead))) <= 0) {
+ free(dbh);
return NULL;
+ }
/* build in core info */
dbh->db_fd = fd;
@@ -54,6 +58,7 @@ dbhead_t *get_dbf_head(int fd)
if (gf_retval < 0) {
free_dbf_head(dbh);
+ free(tdbf);
return NULL;
}
if (gf_retval != 2 ) {
@@ -89,7 +94,7 @@ void free_dbf_head(dbhead_t *dbh)
free(cur_f->db_format);
}
}
-
+
free(dbf);
free(dbh);
}
@@ -119,7 +124,7 @@ int put_dbf_head(dbhead_t *dbh)
if (lseek(fd, 0, 0) < 0)
return -1;
- if ((ret = write(fd, &dbhead, sizeof(dbhead))) < 0)
+ if ((ret = write(fd, &dbhead, sizeof(dbhead))) <= 0)
return -1;
return ret;
}
@@ -132,7 +137,7 @@ 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) {
+ if ((ret = read(dbh->db_fd, &dbfield, sizeof(dbfield))) <= 0) {
return ret;
}
@@ -148,6 +153,7 @@ int get_dbf_field(dbhead_t *dbh, dbfield_t *dbf)
dbf->db_type = dbfield.dbf_type;
switch (dbf->db_type) {
case 'N':
+ case 'F':
dbf->db_flen = dbfield.dbf_flen[0];
dbf->db_fdc = dbfield.dbf_flen[1];
break;
@@ -191,7 +197,7 @@ int put_dbf_field(dbhead_t *dbh, dbfield_t *dbf)
}
/* now write it out to disk */
- if ((ret = write(dbh->db_fd, &dbfield, sizeof(dbfield))) < 0) {
+ if ((ret = write(dbh->db_fd, &dbfield, sizeof(dbfield))) <= 0) {
return ret;
}
return 1;
@@ -231,6 +237,7 @@ char *get_dbf_f_fmt(dbfield_t *dbf)
case 'N':
case 'L':
case 'D':
+ case 'F':
sprintf(format, "%%%ds", dbf->db_flen);
break;
case 'M':
@@ -250,22 +257,14 @@ dbhead_t *dbf_open(char *dp, int o_flags TSRMLS_DC)
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;
- }
+ return NULL;
}
if ((dbh = get_dbf_head(fd)) == NULL) {
- fprintf(stderr, "Unable to get header\n");
return NULL;
}
- dbh->db_name = cp;
+
dbh->db_cur_rec = 0;
-
return dbh;
}
diff --git a/ext/dbase/tests/001.phpt b/ext/dbase/tests/001.phpt
new file mode 100644
index 000000000..51a448870
--- /dev/null
+++ b/ext/dbase/tests/001.phpt
@@ -0,0 +1,61 @@
+--TEST--
+dbase_create() tests
+--SKIPIF--
+<?php if (!extension_loaded("dbase")) print "skip"; ?>
+--FILE--
+<?php
+
+$fields_arr = Array(
+ Array(
+ array('date','D'),
+ ),
+ Array(
+ array('error', 'E'),
+ ),
+ Array(
+ array('error', -1),
+ ),
+ Array(
+ array(-1, 'N', 3, 0),
+ ),
+ Array(
+ array(),
+ ),
+ Array(
+ ),
+);
+
+$file = dirname(__FILE__).'/001.dbf';
+
+foreach ($fields_arr as $fields) {
+ var_dump(dbase_create($file, $fields));
+ @unlink($file);
+}
+
+var_dump(dbase_create($file, -1));
+@unlink($file);
+
+var_dump(dbase_create("", ""));
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(%d)
+
+Warning: dbase_create(): unknown field type 'E' in %s on line %d
+bool(false)
+
+Warning: dbase_create(): unknown field type '-' in %s on line %d
+bool(false)
+int(%d)
+
+Warning: dbase_create(): expected field name as first element of list in field 0 in %s on line %d
+bool(false)
+int(%d)
+
+Warning: dbase_create(): Expected array as second parameter in %s on line %d
+bool(false)
+
+Warning: dbase_create(): Expected array as second parameter in %s on line %d
+bool(false)
+Done
diff --git a/ext/dbase/tests/002.phpt b/ext/dbase/tests/002.phpt
new file mode 100644
index 000000000..5c866443f
--- /dev/null
+++ b/ext/dbase/tests/002.phpt
@@ -0,0 +1,54 @@
+--TEST--
+dbase_open() tests
+--SKIPIF--
+<?php if (!extension_loaded("dbase")) print "skip"; ?>
+--FILE--
+<?php
+
+$file = dirname(__FILE__)."/002.dbf";
+@unlink($file);
+
+$fp = fopen($file, "w");
+fclose($fp);
+
+var_dump(dbase_open($file, -1));
+var_dump(dbase_open($file, 1000));
+var_dump(dbase_open($file, 0));
+var_dump(dbase_open($file."nonex", 0));
+var_dump(dbase_open("", 0));
+
+@unlink($file);
+
+$def = array(
+ array("date", "D"),
+ array("name", "C", 50),
+ array("age", "N", 3, 0),
+ array("email", "C", 128),
+ array("ismember", "L")
+);
+
+var_dump(dbase_create($file, $def));
+var_dump(dbase_open($file, 0));
+
+@unlink($file);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: dbase_open(): Invalid access mode -1 in %s on line %d
+bool(false)
+
+Warning: dbase_open(): unable to open database %s in %s on line %d
+bool(false)
+
+Warning: dbase_open(): unable to open database %s in %s on line %d
+bool(false)
+
+Warning: dbase_open(): unable to open database %s in %s on line %d
+bool(false)
+
+Warning: dbase_open(): unable to open database in %s on line %d
+bool(false)
+int(%d)
+int(%d)
+Done
diff --git a/ext/dom/attr.c b/ext/dom/attr.c
index 7d1642e62..5504fddf8 100644
--- a/ext/dom/attr.c
+++ b/ext/dom/attr.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: attr.c,v 1.18.2.2 2006/05/03 08:43:04 rrichards Exp $ */
+/* $Id: attr.c,v 1.18.2.2.2.1 2006/05/22 17:12:25 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -262,7 +262,6 @@ 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, dom_attr_class_entry) == FAILURE) {
return;
@@ -270,9 +269,7 @@ PHP_FUNCTION(dom_attr_is_id)
DOM_GET_OBJ(attrp, id, xmlAttrPtr, intern);
- nodep = attrp->parent;
-
- if (xmlIsID(attrp->doc, nodep, attrp)) {
+ if (attrp->atype == XML_ATTRIBUTE_ID) {
RETURN_TRUE;
} else {
RETURN_FALSE;
diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c
index 1fa1501e3..2a75bacdf 100644
--- a/ext/dom/characterdata.c
+++ b/ext/dom/characterdata.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: characterdata.c,v 1.15.2.1 2006/01/01 12:50:06 sniper Exp $ */
+/* $Id: characterdata.c,v 1.15.2.1.2.1 2006/09/16 13:54:52 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -207,9 +207,19 @@ PHP_FUNCTION(dom_characterdata_append_data)
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
-
+#if LIBXML_VERSION < 20627
+/* Implement logic from libxml xmlTextConcat to add suport for comments and PI */
+ if ((nodep->content == (xmlChar *) &(nodep->properties)) ||
+ ((nodep->doc != NULL) && (nodep->doc->dict != NULL) &&
+ xmlDictOwns(nodep->doc->dict, nodep->content))) {
+ nodep->content = xmlStrncatNew(nodep->content, arg, arg_len);
+ } else {
+ nodep->content = xmlStrncat(nodep->content, arg, arg_len);
+ }
+ nodep->properties = NULL;
+#else
xmlTextConcat(nodep, arg, arg_len);
-
+#endif
RETURN_TRUE;
}
/* }}} end dom_characterdata_append_data */
diff --git a/ext/dom/document.c b/ext/dom/document.c
index f8ec3a827..c117ea4fc 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: document.c,v 1.68.2.3 2006/01/01 12:50:06 sniper Exp $ */
+/* $Id: document.c,v 1.68.2.3.2.4 2006/10/07 19:40:58 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -85,6 +85,7 @@ zend_function_entry php_dom_document_class_functions[] = {
PHP_FALIAS(relaxNGValidate, dom_document_relaxNG_validate_file, NULL)
PHP_FALIAS(relaxNGValidateSource, dom_document_relaxNG_validate_xml, NULL)
#endif
+ PHP_ME(domdocument, registerNodeClass, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
@@ -384,7 +385,7 @@ Since: DOM Level 3
*/
int dom_document_strict_error_checking_read(dom_object *obj, zval **retval TSRMLS_DC)
{
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
ALLOC_ZVAL(*retval);
if (obj->document) {
@@ -399,7 +400,7 @@ int dom_document_strict_error_checking_read(dom_object *obj, zval **retval TSRML
int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRMLS_DC)
{
zval value_copy;
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
if(newval->refcount > 1) {
value_copy = *newval;
@@ -427,7 +428,7 @@ readonly=no
*/
int dom_document_format_output_read(dom_object *obj, zval **retval TSRMLS_DC)
{
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
ALLOC_ZVAL(*retval);
if (obj->document) {
@@ -442,7 +443,7 @@ 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)
{
zval value_copy;
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
if(newval->refcount > 1) {
value_copy = *newval;
@@ -469,7 +470,7 @@ readonly=no
*/
int dom_document_validate_on_parse_read(dom_object *obj, zval **retval TSRMLS_DC)
{
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
ALLOC_ZVAL(*retval);
if (obj->document) {
@@ -484,7 +485,7 @@ 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)
{
zval value_copy;
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
if(newval->refcount > 1) {
value_copy = *newval;
@@ -512,7 +513,7 @@ readonly=no
*/
int dom_document_resolve_externals_read(dom_object *obj, zval **retval TSRMLS_DC)
{
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
ALLOC_ZVAL(*retval);
if (obj->document) {
@@ -527,7 +528,7 @@ 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)
{
zval value_copy;
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
if(newval->refcount > 1) {
value_copy = *newval;
@@ -555,7 +556,7 @@ readonly=no
*/
int dom_document_preserve_whitespace_read(dom_object *obj, zval **retval TSRMLS_DC)
{
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
ALLOC_ZVAL(*retval);
if (obj->document) {
@@ -570,7 +571,7 @@ int dom_document_preserve_whitespace_read(dom_object *obj, zval **retval TSRMLS_
int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_DC)
{
zval value_copy;
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
if(newval->refcount > 1) {
value_copy = *newval;
@@ -597,7 +598,7 @@ readonly=no
*/
int dom_document_recover_read(dom_object *obj, zval **retval TSRMLS_DC)
{
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
ALLOC_ZVAL(*retval);
if (obj->document) {
@@ -612,7 +613,7 @@ int dom_document_recover_read(dom_object *obj, zval **retval TSRMLS_DC)
int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC)
{
zval value_copy;
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
if(newval->refcount > 1) {
value_copy = *newval;
@@ -640,7 +641,7 @@ readonly=no
*/
int dom_document_substitue_entities_read(dom_object *obj, zval **retval TSRMLS_DC)
{
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
ALLOC_ZVAL(*retval);
if (obj->document) {
@@ -655,7 +656,7 @@ int dom_document_substitue_entities_read(dom_object *obj, zval **retval TSRMLS_D
int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_DC)
{
zval value_copy;
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
if(newval->refcount > 1) {
value_copy = *newval;
@@ -1354,7 +1355,9 @@ PHP_METHOD(domdocument, __construct)
}
}
intern->document = NULL;
- php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC);
+ if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC) == -1) {
+ RETURN_FALSE;
+ }
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern TSRMLS_CC);
}
}
@@ -1394,8 +1397,9 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
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);
+ if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) {
+ xmlFreeURI(uri);
+ return NULL;
}
file_dest = resolved_path;
}
@@ -1410,12 +1414,12 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
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_doc_propsptr 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;
+ int old_error_reporting = 0;
char *directory=NULL, resolved_path[MAXPATHLEN];
if (id != NULL) {
@@ -1436,10 +1440,6 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int optio
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) {
@@ -1450,14 +1450,6 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int optio
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);
}
@@ -1490,7 +1482,6 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int optio
ctxt->sax->warning = php_libxml_ctx_warning;
}
-#if LIBXML_VERSION >= 20600
if (validate && ! (options & XML_PARSE_DTDVALID)) {
options |= XML_PARSE_DTDVALID;
}
@@ -1505,11 +1496,6 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int optio
}
xmlCtxtUseOptions(ctxt, options);
-#else
- ctxt->validate = validate;
- ctxt->loadsubset = (resolve_externals * XML_COMPLETE_ATTRS);
- ctxt->replaceEntities = substitute_ent;
-#endif
ctxt->recovery = recover;
if (recover) {
@@ -1544,7 +1530,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int optio
static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
zval *id, *rv = NULL;
xmlDoc *docp = NULL, *newdoc;
- dom_doc_props *doc_prop;
+ dom_doc_propsptr doc_prop;
dom_object *intern;
char *source;
int source_len, refcount, ret;
@@ -1584,7 +1570,9 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
}
}
intern->document = NULL;
- php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC);
+ if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC) == -1) {
+ RETURN_FALSE;
+ }
intern->document->doc_props = doc_prop;
}
@@ -1624,9 +1612,9 @@ PHP_FUNCTION(dom_document_save)
{
zval *id;
xmlDoc *docp;
- int file_len = 0, bytes, format, saveempty;
+ int file_len = 0, bytes, format, saveempty = 0;
dom_object *intern;
- dom_doc_props *doc_props;
+ dom_doc_propsptr doc_props;
char *file;
long options = 0;
@@ -1672,8 +1660,8 @@ PHP_FUNCTION(dom_document_savexml)
xmlBufferPtr buf;
xmlChar *mem;
dom_object *intern, *nodeobj;
- dom_doc_props *doc_props;
- int size, format, saveempty;
+ dom_doc_propsptr doc_props;
+ int size, format, saveempty = 0;
long options = 0;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O!l", &id, dom_document_class_entry, &nodep, dom_node_class_entry, &options) == FAILURE) {
@@ -1781,11 +1769,7 @@ PHP_FUNCTION(dom_document_xinclude)
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
@@ -2034,7 +2018,7 @@ 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;
+ dom_doc_propsptr doc_prop;
char *source;
int source_len, refcount, ret;
htmlParserCtxtPtr ctxt;
@@ -2089,7 +2073,9 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode)
}
}
intern->document = NULL;
- php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC);
+ if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC) == -1) {
+ RETURN_FALSE;
+ }
intern->document->doc_props = doc_prop;
}
@@ -2128,7 +2114,7 @@ PHP_FUNCTION(dom_document_save_html_file)
xmlDoc *docp;
int file_len, bytes, format;
dom_object *intern;
- dom_doc_props *doc_props;
+ dom_doc_propsptr doc_props;
char *file;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
@@ -2185,4 +2171,57 @@ PHP_FUNCTION(dom_document_save_html)
#endif /* defined(LIBXML_HTML_ENABLED) */
+/* {{{ proto boolean DOMDocument::registerNodeClass(string baseclass, string extendedclass);
+ Register extended class used to create base node type */
+PHP_METHOD(domdocument, registerNodeClass)
+{
+ zval *id;
+ xmlDoc *docp;
+ char *baseclass = NULL, *extendedclass = NULL;
+ int baseclass_len = 0, extendedclass_len = 0;
+ zend_class_entry *basece = NULL, *ce = NULL;
+ dom_object *intern;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss!", &id, dom_document_class_entry, &baseclass, &baseclass_len, &extendedclass, &extendedclass_len) == FAILURE) {
+ return;
+ }
+
+ if (baseclass_len) {
+ zend_class_entry **pce;
+ if (zend_lookup_class(baseclass, baseclass_len, &pce TSRMLS_CC) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s does not exist", baseclass);
+ return;
+ }
+ basece = *pce;
+ }
+
+ if (basece == NULL || ! instanceof_function(basece, dom_node_class_entry TSRMLS_CC)) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s is not derived from DOMNode.", baseclass);
+ return;
+ }
+
+ if (extendedclass_len) {
+ zend_class_entry **pce;
+ if (zend_lookup_class(extendedclass, extendedclass_len, &pce TSRMLS_CC) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s does not exist", extendedclass);
+ }
+ ce = *pce;
+ }
+
+ if (ce == NULL || instanceof_function(ce, basece TSRMLS_CC)) {
+
+ DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
+
+ if (dom_set_doc_classmap(intern->document, basece, ce TSRMLS_CC) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s could not be registered.", extendedclass);
+ }
+ RETURN_TRUE;
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s is not derived from %s.", extendedclass, baseclass);
+ }
+
+ RETURN_FALSE;
+}
+/* }}} */
+
#endif /* HAVE_LIBXML && HAVE_DOM */
diff --git a/ext/dom/dom_fe.h b/ext/dom/dom_fe.h
index 9182c8061..5cc0086b2 100644
--- a/ext/dom/dom_fe.h
+++ b/ext/dom/dom_fe.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dom_fe.h,v 1.14.2.1 2006/01/01 12:50:06 sniper Exp $ */
+/* $Id: dom_fe.h,v 1.14.2.1.2.3 2006/07/16 15:03:53 chregu Exp $ */
#ifndef DOM_FE_H
#define DOM_FE_H
@@ -130,6 +130,7 @@ PHP_METHOD(domdocument, loadXML);
PHP_FUNCTION(dom_document_savexml);
PHP_FUNCTION(dom_document_validate);
PHP_FUNCTION(dom_document_xinclude);
+PHP_METHOD(domdocument, registerNodeClass);
#if defined(LIBXML_HTML_ENABLED)
PHP_METHOD(domdocument, loadHTML);
@@ -164,6 +165,9 @@ 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);
+PHP_METHOD(domnode, C14N);
+PHP_METHOD(domnode, C14NFile);
+PHP_METHOD(domnode, getNodePath);
/* domnodelist methods */
PHP_FUNCTION(dom_nodelist_item);
diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c
index 862da4dc7..1ba5bdbb2 100644
--- a/ext/dom/dom_iterators.c
+++ b/ext/dom/dom_iterators.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dom_iterators.c,v 1.9.2.3 2006/03/03 20:15:10 rrichards Exp $ */
+/* $Id: dom_iterators.c,v 1.9.2.3.2.4 2006/10/07 19:59:19 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -162,7 +162,7 @@ static int php_dom_iterator_current_key(zend_object_iterator *iter, char **str_k
object = (zval *)iterator->intern.data;
if (instanceof_function(Z_OBJCE_P(object), dom_nodelist_class_entry TSRMLS_CC)) {
- *int_key = iter->index - 1;
+ *int_key = iter->index;
return HASH_KEY_IS_LONG;
} else {
curobj = iterator->curobj;
@@ -170,6 +170,8 @@ static int php_dom_iterator_current_key(zend_object_iterator *iter, char **str_k
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;
+ } else {
+ return HASH_KEY_NON_EXISTANT;
}
namelen = xmlStrlen(curnode->name);
@@ -187,7 +189,7 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
dom_object *intern;
dom_object *nnmap;
dom_nnodemap_object *objmap;
- int ret, previndex=1;
+ int ret, previndex=0;
HashTable *nodeht;
zval **entry;
@@ -220,21 +222,23 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
if (basenode && (basenode->type == XML_DOCUMENT_NODE ||
basenode->type == XML_HTML_DOCUMENT_NODE)) {
basenode = xmlDocGetRootElement((xmlDoc *) basenode);
- } else {
+ } else if (basenode) {
basenode = basenode->children;
+ } else {
+ goto err;
}
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 - 1);
+ curnode = php_dom_libxml_hash_iter(objmap->ht, iter->index);
} else {
- curnode = php_dom_libxml_notation_iter(objmap->ht, iter->index - 1);
+ curnode = php_dom_libxml_notation_iter(objmap->ht, iter->index);
}
}
}
-
+err:
zval_ptr_dtor((zval**)&curobj);
if (curnode) {
MAKE_STD_ZVAL(curattr);
@@ -253,7 +257,7 @@ zend_object_iterator_funcs php_dom_iterator_funcs = {
NULL
};
-zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC)
+zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
{
dom_object *intern;
dom_nnodemap_object *objmap;
@@ -262,8 +266,12 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object TS
int ret, curindex = 0;
HashTable *nodeht;
zval **entry;
+ php_dom_iterator *iterator;
- php_dom_iterator *iterator = emalloc(sizeof(php_dom_iterator));
+ if (by_ref) {
+ zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
+ }
+ iterator = emalloc(sizeof(php_dom_iterator));
object->refcount++;
iterator->intern.data = (void*)object;
@@ -283,6 +291,9 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object TS
}
} else {
nodep = (xmlNode *)dom_object_get_node(objmap->baseobj);
+ if (!nodep) {
+ goto err;
+ }
if (objmap->nodetype == XML_ATTRIBUTE_NODE || objmap->nodetype == XML_ELEMENT_NODE) {
if (objmap->nodetype == XML_ATTRIBUTE_NODE) {
curnode = (xmlNodePtr) nodep->properties;
@@ -306,7 +317,7 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object TS
}
}
}
-
+err:
if (curnode) {
MAKE_STD_ZVAL(curattr);
curattr = php_dom_create_object(curnode, &ret, NULL, curattr, objmap->baseobj TSRMLS_CC);
diff --git a/ext/dom/element.c b/ext/dom/element.c
index 2be0e8f31..1d5bbc120 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: element.c,v 1.36.2.4 2006/05/03 08:43:04 rrichards Exp $ */
+/* $Id: element.c,v 1.36.2.4.2.6 2006/09/28 10:11:36 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -88,7 +88,7 @@ PHP_METHOD(domelement, __construct)
if (uri_len > 0) {
errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len);
if (errorcode == 0) {
- nodep = xmlNewNode (NULL, localname);
+ nodep = xmlNewNode (NULL, (xmlChar *)localname);
if (nodep != NULL && uri != NULL) {
nsptr = dom_get_ns(nodep, uri, &errorcode, prefix);
xmlSetNs(nodep, nsptr);
@@ -100,14 +100,14 @@ PHP_METHOD(domelement, __construct)
}
if (errorcode != 0) {
if (nodep != NULL) {
- xmlFree(nodep);
+ xmlFreeNode(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);
+ localname = xmlSplitQName2((xmlChar *)name, (xmlChar **) &prefix);
if (prefix != NULL) {
xmlFree(localname);
xmlFree(prefix);
@@ -123,7 +123,7 @@ PHP_METHOD(domelement, __construct)
}
if (value_len > 0) {
- xmlNodeSetContentLen(nodep, value, value_len);
+ xmlNodeSetContentLen(nodep, (xmlChar *) value, value_len);
}
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
@@ -161,7 +161,7 @@ int dom_element_tag_name_read(dom_object *obj, zval **retval TSRMLS_DC)
qname = xmlStrdup(ns->prefix);
qname = xmlStrcat(qname, ":");
qname = xmlStrcat(qname, nodep->name);
- ZVAL_STRING(*retval, qname, 1);
+ ZVAL_STRING(*retval, (char *)qname, 1);
xmlFree(qname);
} else {
ZVAL_STRING(*retval, (char *) nodep->name, 1);
@@ -188,7 +188,46 @@ int dom_element_schema_type_info_read(dom_object *obj, zval **retval TSRMLS_DC)
/* }}} */
-
+static xmlNodePtr dom_get_dom1_attribute(xmlNodePtr elem, xmlChar *name) {
+ int len;
+ const xmlChar *nqname;
+
+ nqname = xmlSplitQName3(name, &len);
+ if (nqname != NULL) {
+ xmlNsPtr ns;
+ xmlChar *prefix = xmlStrndup(name, len);
+ if (prefix && xmlStrEqual(prefix, "xmlns")) {
+ ns = elem->nsDef;
+ while (ns) {
+ if (xmlStrEqual(ns->prefix, nqname)) {
+ break;
+ }
+ ns = ns->next;
+ }
+ xmlFree(prefix);
+ return (xmlNodePtr)ns;
+ }
+ ns = xmlSearchNs(elem->doc, elem, prefix);
+ if (prefix != NULL) {
+ xmlFree(prefix);
+ }
+ if (ns != NULL) {
+ return (xmlNodePtr)xmlHasNsProp(elem, nqname, ns->href);
+ }
+ } else {
+ if (xmlStrEqual(name, "xmlns")) {
+ xmlNsPtr nsPtr = elem->nsDef;
+ while (nsPtr) {
+ if (nsPtr->prefix == NULL) {
+ return (xmlNodePtr)nsPtr;
+ }
+ nsPtr = nsPtr->next;
+ }
+ return NULL;
+ }
+ }
+ return (xmlNodePtr)xmlHasNsProp(elem, name, NULL);
+}
/* {{{ 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
@@ -198,8 +237,9 @@ PHP_FUNCTION(dom_element_get_attribute)
{
zval *id;
xmlNode *nodep;
- char *name, *value;
+ char *name, *value = NULL;
dom_object *intern;
+ xmlNodePtr attr;
int name_len;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
@@ -208,7 +248,20 @@ PHP_FUNCTION(dom_element_get_attribute)
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
- value = xmlGetProp(nodep, name);
+ attr = dom_get_dom1_attribute(nodep, (xmlChar *)name);
+ if (attr) {
+ switch (attr->type) {
+ case XML_ATTRIBUTE_NODE:
+ value = xmlNodeListGetString(attr->doc, attr->children, 1);
+ break;
+ case XML_NAMESPACE_DECL:
+ value = xmlStrdup(((xmlNsPtr)attr)->href);
+ break;
+ default:
+ value = xmlStrdup(((xmlAttributePtr)attr)->defaultValue);
+ }
+ }
+
if (value == NULL) {
RETURN_EMPTY_STRING();
} else {
@@ -227,12 +280,11 @@ PHP_FUNCTION(dom_element_set_attribute)
{
zval *id, *rv = NULL;
xmlNode *nodep;
- xmlAttr *attr;
+ xmlNodePtr attr = NULL;
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, dom_element_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
@@ -249,17 +301,33 @@ PHP_FUNCTION(dom_element_set_attribute)
RETURN_FALSE;
}
- attr = xmlHasProp(nodep,name);
- if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) {
+ attr = dom_get_dom1_attribute(nodep, (xmlChar *)name);
+ if (attr != NULL) {
+ switch (attr->type) {
+ case XML_ATTRIBUTE_NODE:
node_list_unlink(attr->children TSRMLS_CC);
+ break;
+ case XML_NAMESPACE_DECL:
+ RETURN_FALSE;
+ default:
+ break;
+ }
+
+ }
+
+ if (xmlStrEqual((xmlChar *)name, "xmlns")) {
+ if (xmlNewNs(nodep, (xmlChar *)value, NULL)) {
+ RETURN_TRUE;
+ }
+ } else {
+ attr = (xmlNodePtr)xmlSetProp(nodep, (xmlChar *) name, value);
}
- 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);
+ DOM_RET_OBJ(rv, attr, &ret, intern);
}
/* }}} end dom_element_set_attribute */
@@ -272,8 +340,7 @@ Since:
PHP_FUNCTION(dom_element_remove_attribute)
{
zval *id;
- xmlNode *nodep;
- xmlAttr *attrp;
+ xmlNodePtr nodep, attrp;
dom_object *intern;
int name_len;
char *name;
@@ -289,19 +356,25 @@ PHP_FUNCTION(dom_element_remove_attribute)
RETURN_FALSE;
}
- attrp = xmlHasProp(nodep,name);
+ attrp = dom_get_dom1_attribute(nodep, (xmlChar *)name);
if (attrp == NULL) {
RETURN_FALSE;
}
- if (attrp->type != XML_ATTRIBUTE_DECL) {
- if (php_dom_object_get_data((xmlNodePtr) attrp) == NULL) {
+ switch (attrp->type) {
+ case XML_ATTRIBUTE_NODE:
+ if (php_dom_object_get_data(attrp) == NULL) {
node_list_unlink(attrp->children TSRMLS_CC);
- xmlUnlinkNode((xmlNodePtr) attrp);
- xmlFreeProp(attrp);
+ xmlUnlinkNode(attrp);
+ xmlFreeProp((xmlAttrPtr)attrp);
} else {
- xmlUnlinkNode((xmlNodePtr) attrp);
+ xmlUnlinkNode(attrp);
}
+ break;
+ case XML_NAMESPACE_DECL:
+ RETURN_FALSE;
+ default:
+ break;
}
RETURN_TRUE;
@@ -316,8 +389,7 @@ Since:
PHP_FUNCTION(dom_element_get_attribute_node)
{
zval *id, *rv = NULL;
- xmlNode *nodep;
- xmlAttr *attrp;
+ xmlNodePtr nodep, attrp;
int name_len, ret;
dom_object *intern;
char *name;
@@ -328,11 +400,30 @@ PHP_FUNCTION(dom_element_get_attribute_node)
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
- attrp = xmlHasProp(nodep,name);
+ attrp = dom_get_dom1_attribute(nodep, (xmlChar *)name);
if (attrp == NULL) {
RETURN_FALSE;
}
+ if (attrp->type == XML_NAMESPACE_DECL) {
+ xmlNsPtr curns;
+ xmlNodePtr nsparent;
+
+ nsparent = attrp->_private;
+ curns = xmlNewNs(NULL, attrp->name, NULL);
+ if (attrp->children) {
+ curns->prefix = xmlStrdup((xmlChar *) attrp->children);
+ }
+ if (attrp->children) {
+ attrp = xmlNewDocNode(nodep->doc, NULL, (xmlChar *) attrp->children, attrp->name);
+ } else {
+ attrp = xmlNewDocNode(nodep->doc, NULL, "xmlns", attrp->name);
+ }
+ attrp->type = XML_NAMESPACE_DECL;
+ attrp->parent = nsparent;
+ attrp->ns = curns;
+ }
+
DOM_RET_OBJ(rv, (xmlNodePtr) attrp, &ret, intern);
}
/* }}} end dom_element_get_attribute_node */
@@ -485,13 +576,13 @@ PHP_FUNCTION(dom_element_get_attribute_ns)
DOM_GET_OBJ(elemp, id, xmlNodePtr, intern);
- strattr = xmlGetNsProp(elemp, name, uri);
+ strattr = xmlGetNsProp(elemp, (xmlChar *) name, (xmlChar *) uri);
if (strattr != NULL) {
RETVAL_STRING(strattr, 1);
xmlFree(strattr);
} else {
- if (xmlStrEqual(uri, DOM_XMLNS_NAMESPACE)) {
+ if (xmlStrEqual((xmlChar *) uri, DOM_XMLNS_NAMESPACE)) {
nsptr = dom_get_nsdecl(elemp, name);
if (nsptr != NULL) {
RETVAL_STRING((char *) nsptr->href, 1);
@@ -581,12 +672,12 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
if (errorcode == 0) {
if (uri_len > 0) {
- nodep = (xmlNodePtr) xmlHasNsProp(elemp, localname, uri);
+ nodep = (xmlNodePtr) xmlHasNsProp(elemp, (xmlChar *) localname, (xmlChar *) 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)) {
+ if (xmlStrEqual((xmlChar *) prefix,"xmlns") && xmlStrEqual((xmlChar *) uri, DOM_XMLNS_NAMESPACE)) {
is_xmlns = 1;
nsptr = dom_get_nsdecl(elemp, localname);
} else {
@@ -679,11 +770,11 @@ PHP_FUNCTION(dom_element_remove_attribute_ns)
RETURN_NULL();
}
- attrp = xmlHasNsProp(nodep, name, uri);
+ attrp = xmlHasNsProp(nodep, (xmlChar *)name, (xmlChar *)uri);
- nsptr = dom_get_nsdecl(nodep, name);
+ nsptr = dom_get_nsdecl(nodep, (xmlChar *)name);
if (nsptr != NULL) {
- if (xmlStrEqual(uri, nsptr->href)) {
+ if (xmlStrEqual((xmlChar *)uri, nsptr->href)) {
if (nsptr->href != NULL) {
xmlFree((char *) nsptr->href);
nsptr->href = NULL;
@@ -852,8 +943,9 @@ PHP_FUNCTION(dom_element_has_attribute)
zval *id;
xmlNode *nodep;
dom_object *intern;
- char *name, *value;
+ char *name;
int name_len;
+ xmlNodePtr attr;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
return;
@@ -861,11 +953,10 @@ PHP_FUNCTION(dom_element_has_attribute)
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
- value = xmlGetProp(nodep, name);
- if (value == NULL) {
+ attr = dom_get_dom1_attribute(nodep, (xmlChar *)name);
+ if (attr == NULL) {
RETURN_FALSE;
} else {
- xmlFree(value);
RETURN_TRUE;
}
}
@@ -883,7 +974,8 @@ PHP_FUNCTION(dom_element_has_attribute_ns)
xmlNs *nsp;
dom_object *intern;
int uri_len, name_len;
- char *uri, *name, *value;
+ char *uri, *name;
+ xmlChar *value;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
@@ -891,7 +983,7 @@ PHP_FUNCTION(dom_element_has_attribute_ns)
DOM_GET_OBJ(elemp, id, xmlNodePtr, intern);
- value = xmlGetNsProp(elemp, name, uri);
+ value = xmlGetNsProp(elemp, (xmlChar *)name, (xmlChar *)uri);
if (value != NULL) {
xmlFree(value);
@@ -910,13 +1002,57 @@ PHP_FUNCTION(dom_element_has_attribute_ns)
/* }}} end dom_element_has_attribute_ns */
+static void php_set_attribute_id(xmlAttrPtr attrp, zend_bool is_id)
+{
+ if (is_id == 1 && attrp->atype != XML_ATTRIBUTE_ID) {
+ xmlChar *id_val;
+
+ id_val = xmlNodeListGetString(attrp->doc, attrp->children, 1);
+ if (id_val != NULL) {
+ xmlAddID(NULL, attrp->doc, id_val, attrp);
+ xmlFree(id_val);
+ }
+ } else {
+ if (attrp->atype == XML_ATTRIBUTE_ID) {
+ xmlRemoveID(attrp->doc, attrp);
+ attrp->atype = 0;
+ }
+ }
+}
+
/* {{{ 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();
+ zval *id;
+ xmlNode *nodep;
+ xmlAttrPtr attrp;
+ dom_object *intern;
+ char *name;
+ int name_len;
+ zend_bool is_id;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osb", &id, dom_element_class_entry, &name, &name_len, &is_id) == 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, NULL);
+ if (attrp == NULL || attrp->type == XML_ATTRIBUTE_DECL) {
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ } else {
+ php_set_attribute_id(attrp, is_id);
+ }
+
+ RETURN_NULL();
}
/* }}} end dom_element_set_id_attribute */
@@ -927,7 +1063,33 @@ Since: DOM Level 3
*/
PHP_FUNCTION(dom_element_set_id_attribute_ns)
{
- DOM_NOT_IMPLEMENTED();
+ zval *id;
+ xmlNodePtr elemp;
+ xmlAttrPtr attrp;
+ dom_object *intern;
+ int uri_len, name_len;
+ char *uri, *name;
+ zend_bool is_id;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ossb", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &is_id) == FAILURE) {
+ return;
+ }
+
+ DOM_GET_OBJ(elemp, id, xmlNodePtr, intern);
+
+ if (dom_node_is_read_only(elemp) == SUCCESS) {
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ RETURN_NULL();
+ }
+
+ attrp = xmlHasNsProp(elemp, (xmlChar *)name, (xmlChar *)uri);
+ if (attrp == NULL || attrp->type == XML_ATTRIBUTE_DECL) {
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ } else {
+ php_set_attribute_id(attrp, is_id);
+ }
+
+ RETURN_NULL();
}
/* }}} end dom_element_set_id_attribute_ns */
@@ -938,7 +1100,32 @@ Since: DOM Level 3
*/
PHP_FUNCTION(dom_element_set_id_attribute_node)
{
- DOM_NOT_IMPLEMENTED();
+ zval *id, *node;
+ xmlNode *nodep;
+ xmlAttrPtr attrp;
+ dom_object *intern, *attrobj;
+ zend_bool is_id;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OOb", &id, dom_element_class_entry, &node, dom_attr_class_entry, &is_id) == 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();
+ }
+
+ DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj);
+
+ if (attrp->parent != nodep) {
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ } else {
+ php_set_attribute_id(attrp, is_id);
+ }
+
+ RETURN_NULL();
}
/* }}} end dom_element_set_id_attribute_node */
diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c
index d0a84281c..ad135a666 100644
--- a/ext/dom/entityreference.c
+++ b/ext/dom/entityreference.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: entityreference.c,v 1.12.2.1 2006/01/01 12:50:06 sniper Exp $ */
+/* $Id: entityreference.c,v 1.12.2.1.2.1 2006/09/14 13:35:02 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -73,7 +73,7 @@ PHP_METHOD(domentityreference, __construct)
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
- oldnode = (xmlNodePtr)intern->ptr;
+ oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode TSRMLS_CC);
}
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 0f4401e8e..306680570 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: node.c,v 1.37.2.3 2006/01/25 17:34:05 rrichards Exp $ */
+/* $Id: node.c,v 1.37.2.3.2.5 2006/09/16 13:54:52 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -53,6 +53,9 @@ zend_function_entry php_dom_node_class_functions[] = {
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)
+ PHP_ME(domnode, getNodePath, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(domnode, C14N, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(domnode, C14NFile, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
@@ -1607,19 +1610,17 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri)
dom_object *intern;
xmlNsPtr nsptr;
int prefix_len = 0;
- char *prefix;
+ char *prefix=NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_node_class_entry, &prefix, &prefix_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!", &id, 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);
- }
+ nsptr = xmlSearchNs(nodep->doc, nodep, prefix);
+ if (nsptr && nsptr->href != NULL) {
+ RETURN_STRING((char *) nsptr->href, 1);
}
RETURN_NULL();
@@ -1669,4 +1670,215 @@ PHP_FUNCTION(dom_node_get_user_data)
DOM_NOT_IMPLEMENTED();
}
/* }}} end dom_node_get_user_data */
+
+
+static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode)
+{
+ zval *id;
+ zval *xpath_array=NULL, *ns_prefixes=NULL;
+ xmlNodePtr nodep;
+ xmlDocPtr docp;
+ xmlNodeSetPtr nodeset = NULL;
+ dom_object *intern;
+ zend_bool exclusive=0, with_comments=0;
+ xmlChar **inclusive_ns_prefixes = NULL;
+ char *file = NULL;
+ int ret = -1, file_len = 0;
+ xmlOutputBufferPtr buf;
+ xmlXPathContextPtr ctxp=NULL;
+ xmlXPathObjectPtr xpathobjp=NULL;
+
+ if (mode == 0) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ "O|bba!a!", &id, dom_node_class_entry, &exclusive, &with_comments,
+ &xpath_array, &ns_prefixes) == FAILURE) {
+ return;
+ }
+ } else {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ "Os|bba!a!", &id, dom_node_class_entry, &file, &file_len, &exclusive,
+ &with_comments, &xpath_array, &ns_prefixes) == FAILURE) {
+ return;
+ }
+ }
+
+ DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
+
+ docp = nodep->doc;
+
+ if (! docp) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node must be associated with a document");
+ RETURN_FALSE;
+ }
+
+ if (xpath_array == NULL) {
+ if (nodep->type != XML_DOCUMENT_NODE) {
+ ctxp = xmlXPathNewContext(docp);
+ ctxp->node = nodep;
+ xpathobjp = xmlXPathEvalExpression("(.//. | .//@* | .//namespace::*)", ctxp);
+ ctxp->node = NULL;
+ if (xpathobjp && xpathobjp->type == XPATH_NODESET) {
+ nodeset = xpathobjp->nodesetval;
+ } else {
+ if (xpathobjp) {
+ xmlXPathFreeObject(xpathobjp);
+ }
+ xmlXPathFreeContext(ctxp);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "XPath query did not return a nodeset.");
+ RETURN_FALSE;
+ }
+ }
+ } else {
+ /*xpath query from xpath_array */
+ HashTable *ht = Z_ARRVAL_P(xpath_array);
+ zval **tmp;
+ char *xquery;
+
+ if (zend_hash_find(ht, "query", sizeof("query"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING) {
+ xquery = Z_STRVAL_PP(tmp);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "'query' missing from xpath array or is not a string");
+ RETURN_FALSE;
+ }
+
+ ctxp = xmlXPathNewContext(docp);
+ ctxp->node = nodep;
+
+ if (zend_hash_find(ht, "namespaces", sizeof("namespaces"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_ARRAY) {
+ zval **tmpns;
+ while (zend_hash_get_current_data(Z_ARRVAL_PP(tmp), (void **)&tmpns) == SUCCESS) {
+ if (Z_TYPE_PP(tmpns) == IS_STRING) {
+ char *prefix;
+ ulong idx;
+ int prefix_key_len;
+
+ if (zend_hash_get_current_key_ex(Z_ARRVAL_PP(tmp),
+ &prefix, &prefix_key_len, &idx, 0, NULL) == HASH_KEY_IS_STRING) {
+ xmlXPathRegisterNs(ctxp, prefix, Z_STRVAL_PP(tmpns));
+ }
+ }
+ zend_hash_move_forward(Z_ARRVAL_PP(tmp));
+ }
+ }
+
+ xpathobjp = xmlXPathEvalExpression(xquery, ctxp);
+ ctxp->node = NULL;
+ if (xpathobjp && xpathobjp->type == XPATH_NODESET) {
+ nodeset = xpathobjp->nodesetval;
+ } else {
+ if (xpathobjp) {
+ xmlXPathFreeObject(xpathobjp);
+ }
+ xmlXPathFreeContext(ctxp);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "XPath query did not return a nodeset.");
+ RETURN_FALSE;
+ }
+ }
+
+ if (ns_prefixes != NULL) {
+ if (exclusive) {
+ zval **tmpns;
+ int nscount = 0;
+
+ inclusive_ns_prefixes = safe_emalloc(zend_hash_num_elements(Z_ARRVAL_P(ns_prefixes)) + 1,
+ sizeof(xmlChar *), 0);
+ while (zend_hash_get_current_data(Z_ARRVAL_P(ns_prefixes), (void **)&tmpns) == SUCCESS) {
+ if (Z_TYPE_PP(tmpns) == IS_STRING) {
+ inclusive_ns_prefixes[nscount++] = Z_STRVAL_PP(tmpns);
+ }
+ zend_hash_move_forward(Z_ARRVAL_P(ns_prefixes));
+ }
+ inclusive_ns_prefixes[nscount] = NULL;
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ "Inclusive namespace prefixes only allowed in exlcusive mode.");
+ }
+ }
+
+ if (mode == 1) {
+ buf = xmlOutputBufferCreateFilename(file, NULL, 0);
+ } else {
+ buf = xmlAllocOutputBuffer(NULL);
+ }
+
+ if (buf != NULL) {
+ ret = xmlC14NDocSaveTo(docp, nodeset, exclusive, inclusive_ns_prefixes,
+ with_comments, buf);
+ }
+
+ if (inclusive_ns_prefixes != NULL) {
+ efree(inclusive_ns_prefixes);
+ }
+ if (xpathobjp != NULL) {
+ xmlXPathFreeObject(xpathobjp);
+ }
+ if (ctxp != NULL) {
+ xmlXPathFreeContext(ctxp);
+ }
+
+ if (buf == NULL || ret < 0) {
+ RETVAL_FALSE;
+ } else {
+ if (mode == 0) {
+ ret = buf->buffer->use;
+ if (ret > 0) {
+ RETVAL_STRINGL((char *) buf->buffer->content, ret, 1);
+ } else {
+ RETVAL_EMPTY_STRING();
+ }
+ }
+ }
+
+ if (buf) {
+ int bytes;
+
+ bytes = xmlOutputBufferClose(buf);
+ if (mode == 1 && (ret >= 0)) {
+ RETURN_LONG(bytes);
+ }
+ }
+}
+
+/* {{{ proto string DOMNode::C14N([bool exclusive [, bool with_comments [, array xpath [, array ns_prefixes]]]])
+ Canonicalize nodes to a string */
+PHP_METHOD(domnode, C14N)
+{
+ dom_canonicalization(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+
+/* {{{ proto int DOMNode::C14NFile(string uri [, bool exclusive [, bool with_comments [, array xpath [, array ns_prefixes]]]])
+ Canonicalize nodes to a file */
+PHP_METHOD(domnode, C14NFile)
+{
+ dom_canonicalization(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+}
+
#endif
+
+/* {{{ proto int DOMNode::getNodePath()
+ Gets an xpath for a node */
+
+PHP_METHOD(domnode, getNodePath)
+{
+ zval *id;
+ xmlNode *nodep;
+ dom_object *intern;
+ char *value;
+
+
+
+ DOM_GET_THIS_OBJ(nodep, id, xmlNodePtr, intern);
+
+ value = xmlGetNodePath(nodep);
+ if (value == NULL) {
+ RETURN_NULL();
+ } else {
+ RETVAL_STRING(value, 1);
+ xmlFree(value);
+ }
+
+
+}
+
diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c
index c0b2afb23..1f326d2db 100644
--- a/ext/dom/nodelist.c
+++ b/ext/dom/nodelist.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: nodelist.c,v 1.17.2.2 2006/01/01 12:50:06 sniper Exp $ */
+/* $Id: nodelist.c,v 1.17.2.2.2.1 2006/08/13 15:02:41 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -134,7 +134,7 @@ PHP_FUNCTION(dom_nodelist_item)
zval_copy_ctor(return_value);
return;
}
- } else {
+ } else if (objmap->baseobj) {
nodep = dom_object_get_node(objmap->baseobj);
if (nodep) {
if (objmap->nodetype == XML_ATTRIBUTE_NODE || objmap->nodetype == XML_ELEMENT_NODE) {
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 1060018eb..332ce66b2 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_dom.c,v 1.73.2.12 2006/05/03 08:43:04 rrichards Exp $ */
+/* $Id: php_dom.c,v 1.73.2.12.2.8 2006/10/04 12:02:49 rrichards Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -149,12 +149,12 @@ int dom_node_children_valid(xmlNodePtr node) {
/* {{{ dom_get_doc_props() */
dom_doc_propsptr dom_get_doc_props(php_libxml_ref_obj *document)
{
- dom_doc_props *doc_props;
+ dom_doc_propsptr doc_props;
if (document && document->doc_props) {
return document->doc_props;
} else {
- doc_props = emalloc(sizeof(dom_doc_props));
+ doc_props = emalloc(sizeof(libxml_doc_props));
doc_props->formatoutput = 0;
doc_props->validateonparse = 0;
doc_props->resolveexternals = 0;
@@ -162,18 +162,58 @@ dom_doc_propsptr dom_get_doc_props(php_libxml_ref_obj *document)
doc_props->substituteentities = 0;
doc_props->stricterror = 1;
doc_props->recover = 0;
+ doc_props->classmap = NULL;
if (document) {
document->doc_props = doc_props;
}
return doc_props;
}
}
+
+int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce TSRMLS_DC)
+{
+ dom_doc_propsptr doc_props;
+
+ if (document) {
+ doc_props = dom_get_doc_props(document);
+ if (doc_props->classmap == NULL) {
+ if (ce == NULL) {
+ return SUCCESS;
+ }
+ ALLOC_HASHTABLE(doc_props->classmap);
+ zend_hash_init(doc_props->classmap, 0, NULL, NULL, 0);
+ }
+ if (ce) {
+ return zend_hash_add(doc_props->classmap, basece->name, basece->name_length + 1, &ce, sizeof(ce), NULL);
+ } else {
+ return zend_hash_del(doc_props->classmap, basece->name, basece->name_length + 1);
+ }
+ }
+ return SUCCESS;
+}
+
+zend_class_entry *dom_get_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece TSRMLS_DC)
+{
+ dom_doc_propsptr doc_props;
+ zend_class_entry **ce = NULL;
+
+ if (document) {
+ doc_props = dom_get_doc_props(document);
+ if (doc_props->classmap) {
+ if (zend_hash_find(doc_props->classmap, basece->name, basece->name_length + 1, (void**) &ce) == SUCCESS) {
+ return *ce;
+ }
+ }
+ }
+
+ return basece;
+}
/* }}} */
/* {{{ dom_get_strict_error() */
int dom_get_strict_error(php_libxml_ref_obj *document) {
int stricterror;
- dom_doc_props *doc_props;
+ dom_doc_propsptr doc_props;
doc_props = dom_get_doc_props(document);
stricterror = doc_props->stricterror;
@@ -188,7 +228,7 @@ int dom_get_strict_error(php_libxml_ref_obj *document) {
/* {{{ xmlNodePtr dom_object_get_node(dom_object *obj) */
PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj)
{
- if (obj->ptr != NULL) {
+ if (obj && obj->ptr != NULL) {
return ((php_libxml_node_ptr *)obj->ptr)->node;
} else {
return NULL;
@@ -199,7 +239,7 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj)
/* {{{ dom_object *php_dom_object_get_data(xmlNodePtr obj) */
PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj)
{
- if (obj->_private != NULL) {
+ if (obj && obj->_private != NULL) {
return (dom_object *) ((php_libxml_node_ptr *) obj->_private)->_private;
} else {
return NULL;
@@ -451,6 +491,7 @@ zend_object_value dom_objects_store_clone_obj(zval *zobject TSRMLS_DC)
return retval;
}
+
zend_object_value dom_objects_ze1_clone_obj(zval *zobject TSRMLS_DC)
{
php_error(E_ERROR, "Cannot clone object of class %s due to 'zend.ze1_compatibility_mode'", Z_OBJCE_P(zobject)->name);
@@ -510,14 +551,14 @@ PHP_MINIT_FUNCTION(dom)
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.get_property_ptr_ptr = dom_get_property_ptr_ptr;
dom_ze1_object_handlers.clone_obj = dom_objects_ze1_clone_obj;
dom_ze1_object_handlers.has_property = dom_property_exists;
zend_hash_init(&classes, 0, NULL, NULL, 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(), NULL TSRMLS_CC);
+ 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);
@@ -879,6 +920,8 @@ void node_list_unlink(xmlNodePtr node TSRMLS_DC)
if (wrapper != NULL ) {
xmlUnlinkNode(node);
} else {
+ if (node->type == XML_ENTITY_REF_NODE)
+ break;
node_list_unlink(node->children TSRMLS_CC);
switch (node->type) {
@@ -1229,6 +1272,9 @@ PHP_DOM_EXPORT zval *php_dom_create_object(xmlNodePtr obj, int *found, zval *wra
return wrapper;
}
+ if (domobj && domobj->document) {
+ ce = dom_get_doc_classmap(domobj->document, ce TSRMLS_CC);
+ }
object_init_ex(wrapper, ce);
intern = (dom_object *)zend_objects_get_address(wrapper TSRMLS_CC);
diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h
index 3af2ce834..97bd0d5bc 100644
--- a/ext/dom/php_dom.h
+++ b/ext/dom/php_dom.h
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_dom.h,v 1.28.2.1 2006/01/01 12:50:06 sniper Exp $ */
+/* $Id: php_dom.h,v 1.28.2.1.2.3 2006/06/20 18:04:25 bjori Exp $ */
#ifndef PHP_DOM_H
#define PHP_DOM_H
@@ -37,6 +37,7 @@ extern zend_module_entry dom_module_entry;
#include <libxml/xmlerror.h>
#include <libxml/xinclude.h>
#include <libxml/hash.h>
+#include <libxml/c14n.h>
#if defined(LIBXML_HTML_ENABLED)
#include <libxml/HTMLparser.h>
#include <libxml/HTMLtree.h>
@@ -109,7 +110,8 @@ void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xml
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);
+zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce TSRMLS_DC);
#define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \
INIT_CLASS_ENTRY(ce, name, funcs); \
diff --git a/ext/dom/tests/bug34276.phpt b/ext/dom/tests/bug34276.phpt
index e1083364a..4a63943f7 100644
--- a/ext/dom/tests/bug34276.phpt
+++ b/ext/dom/tests/bug34276.phpt
@@ -1,7 +1,7 @@
--TEST--
Bug # 34276: setAttributeNS and default namespace
--SKIPIF--
-<?php require_once('skipif.php'); ?>
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$xml = <<<HERE
diff --git a/ext/dom/tests/bug35342.phpt b/ext/dom/tests/bug35342.phpt
index 2aab3852b..c07fd340d 100644
--- a/ext/dom/tests/bug35342.phpt
+++ b/ext/dom/tests/bug35342.phpt
@@ -1,7 +1,7 @@
--TEST--
Bug # 35342: isset(DOMNodeList->length) returns false
--SKIPIF--
-<?php require_once('skipif.php'); ?>
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$dom = new DOMDocument();
diff --git a/ext/dom/tests/bug37456.phpt b/ext/dom/tests/bug37456.phpt
new file mode 100644
index 000000000..904712f4b
--- /dev/null
+++ b/ext/dom/tests/bug37456.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug # 37456 (DOMElement->setAttribute() loops forever)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+$doc = new DOMDocument();
+$doc->resolveExternals = true;
+$doc->load(dirname(__FILE__)."/dom.xml");
+
+$root = $doc->getElementsByTagName('foo')->item(0);
+$root->setAttribute('bar', '&gt;');
+$attr = $root->setAttribute('bar', 'newval');
+print $attr->nodeValue;
+
+
+?>
+--EXPECT--
+
+newval
+
diff --git a/ext/dom/tests/bug38438.phpt b/ext/dom/tests/bug38438.phpt
new file mode 100644
index 000000000..f51252832
--- /dev/null
+++ b/ext/dom/tests/bug38438.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #38438 (DOMNodeList->item(0) segfault on empty NodeList)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$list = new DOMNodeList();
+var_dump($list->item(0));
+echo "OK\n";
+?>
+--EXPECT--
+NULL
+OK
diff --git a/ext/dom/tests/bug38474.phpt b/ext/dom/tests/bug38474.phpt
new file mode 100644
index 000000000..7e7aa5c0c
--- /dev/null
+++ b/ext/dom/tests/bug38474.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Bug #38474 (getAttribute select attribute by order, even when prefixed)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$xml = '<node xmlns:pre="http://foo.com/tr/pre"
+ xmlns:post="http://foo.com/tr/post"
+ pre:type="bar" type="foo" ><sub /></node>';
+$dom = new DomDocument();
+$dom->loadXML($xml);
+echo $dom->firstChild->getAttribute('type')."\n";
+echo $dom->firstChild->getAttribute('pre:type')."\n";
+
+$dom->firstChild->setAttribute('pre:type', 'bar2');
+$dom->firstChild->setAttribute('type', 'foo2');
+$dom->firstChild->setAttribute('post:type', 'baz');
+$dom->firstChild->setAttribute('new:type', 'baz2');
+
+echo $dom->firstChild->getAttribute('type')."\n";
+echo $dom->firstChild->getAttribute('pre:type')."\n";
+echo $dom->firstChild->getAttribute('post:type')."\n";
+
+$dom->firstChild->removeAttribute('pre:type');
+$dom->firstChild->removeAttribute('type');
+
+echo $dom->firstChild->getAttribute('type')."\n";
+echo $dom->firstChild->getAttribute('pre:type')."\n";
+echo $dom->firstChild->getAttribute('post:type')."\n";
+echo $dom->firstChild->getAttribute('new:type');
+?>
+--EXPECT--
+foo
+bar
+foo2
+bar2
+baz
+
+
+baz
+baz2
diff --git a/ext/dom/tests/bug38850.phpt b/ext/dom/tests/bug38850.phpt
new file mode 100644
index 000000000..c8ca93928
--- /dev/null
+++ b/ext/dom/tests/bug38850.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug # 38850 (lookupNamespaceURI does not return default namespace)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$xml = <<<HERE
+<?xml version="1.0" ?>
+<foo xmlns="http://www.example.com/ns/foo" />
+HERE;
+
+$doc = new DOMDocument();
+$doc->loadXML($xml);
+
+$root = $doc->documentElement;
+
+print $root->lookupNamespaceURI(NULL);
+
+
+?>
+--EXPECT--
+http://www.example.com/ns/foo
diff --git a/ext/dom/tests/bug38949.phpt b/ext/dom/tests/bug38949.phpt
new file mode 100644
index 000000000..ba9c8dfe3
--- /dev/null
+++ b/ext/dom/tests/bug38949.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug # 38949: (Cannot get xmlns value attribute)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+$doc = new DOMDocument();
+$doc->load(dirname(__FILE__)."/nsdoc.xml");
+
+$root = $doc->documentElement;
+
+echo $root->getAttribute("xmlns")."\n";
+echo $root->getAttribute("xmlns:ns2")."\n";
+
+$child = $root->firstChild->nextSibling;
+echo $child->getAttribute("xmlns")."\n";
+echo $child->getAttribute("xmlns:ns2")."\n";
+
+echo "DONE\n";
+?>
+--EXPECT--
+http://ns
+http://ns2
+
+
+DONE
diff --git a/ext/dom/tests/canonicalization.phpt b/ext/dom/tests/canonicalization.phpt
new file mode 100644
index 000000000..cf1a81f24
--- /dev/null
+++ b/ext/dom/tests/canonicalization.phpt
@@ -0,0 +1,102 @@
+--TEST--
+Test: Canonicalization - C14N()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$xml = <<<EOXML
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<foo xmlns="http://www.example.com/ns/foo"
+ xmlns:fubar="http://www.example.com/ns/fubar" xmlns:test="urn::test"><contain>
+ <bar><test1 /></bar>
+ <bar><test2 /></bar>
+ <fubar:bar xmlns:fubar="http://www.example.com/ns/fubar"><test3 /></fubar:bar>
+ <fubar:bar><test4 /></fubar:bar>
+<!-- this is a comment -->
+</contain>
+</foo>
+EOXML;
+
+$dom = new DOMDocument();
+$dom->loadXML($xml);
+$doc = $dom->documentElement->firstChild;
+
+/* inclusive/without comments first child element of doc element is context. */
+echo $doc->C14N()."\n\n";
+
+/* exclusive/without comments first child element of doc element is context. */
+echo $doc->c14N(TRUE)."\n\n";
+
+/* inclusive/with comments first child element of doc element is context. */
+echo $doc->C14N(FALSE, TRUE)."\n\n";
+
+/* exclusive/with comments first child element of doc element is context. */
+echo $doc->C14N(TRUE, TRUE)."\n\n";
+
+/* exclusive/without comments using xpath query. */
+echo $doc->c14N(TRUE, FALSE, array('query'=>'(//. | //@* | //namespace::*)'))."\n\n";
+
+/* exclusive/without comments first child element of doc element is context.
+ using xpath query with registered namespace.
+ test namespace prefix is also included. */
+echo $doc->c14N(TRUE, FALSE,
+ array('query'=>'(//a:contain | //a:bar | .//namespace::*)',
+ 'namespaces'=>array('a'=>'http://www.example.com/ns/foo')),
+ array('test'))."\n\n";
+
+/* exclusive/without comments first child element of doc element is context.
+ test namespace prefix is also included */
+echo $doc->C14N(TRUE, FALSE, NULL, array('test'));
+?>
+--EXPECTF--
+
+<contain xmlns="http://www.example.com/ns/foo" xmlns:fubar="http://www.example.com/ns/fubar" xmlns:test="urn::test">
+ <bar><test1></test1></bar>
+ <bar><test2></test2></bar>
+ <fubar:bar><test3></test3></fubar:bar>
+ <fubar:bar><test4></test4></fubar:bar>
+
+</contain>
+
+<contain xmlns="http://www.example.com/ns/foo">
+ <bar><test1></test1></bar>
+ <bar><test2></test2></bar>
+ <fubar:bar xmlns:fubar="http://www.example.com/ns/fubar"><test3></test3></fubar:bar>
+ <fubar:bar xmlns:fubar="http://www.example.com/ns/fubar"><test4></test4></fubar:bar>
+
+</contain>
+
+<contain xmlns="http://www.example.com/ns/foo" xmlns:fubar="http://www.example.com/ns/fubar" xmlns:test="urn::test">
+ <bar><test1></test1></bar>
+ <bar><test2></test2></bar>
+ <fubar:bar><test3></test3></fubar:bar>
+ <fubar:bar><test4></test4></fubar:bar>
+<!-- this is a comment -->
+</contain>
+
+<contain xmlns="http://www.example.com/ns/foo">
+ <bar><test1></test1></bar>
+ <bar><test2></test2></bar>
+ <fubar:bar xmlns:fubar="http://www.example.com/ns/fubar"><test3></test3></fubar:bar>
+ <fubar:bar xmlns:fubar="http://www.example.com/ns/fubar"><test4></test4></fubar:bar>
+<!-- this is a comment -->
+</contain>
+
+<foo xmlns="http://www.example.com/ns/foo"><contain>
+ <bar><test1></test1></bar>
+ <bar><test2></test2></bar>
+ <fubar:bar xmlns:fubar="http://www.example.com/ns/fubar"><test3></test3></fubar:bar>
+ <fubar:bar xmlns:fubar="http://www.example.com/ns/fubar"><test4></test4></fubar:bar>
+
+</contain>
+</foo>
+
+<contain xmlns="http://www.example.com/ns/foo" xmlns:test="urn::test"><bar></bar><bar></bar></contain>
+
+<contain xmlns="http://www.example.com/ns/foo" xmlns:test="urn::test">
+ <bar><test1></test1></bar>
+ <bar><test2></test2></bar>
+ <fubar:bar xmlns:fubar="http://www.example.com/ns/fubar"><test3></test3></fubar:bar>
+ <fubar:bar xmlns:fubar="http://www.example.com/ns/fubar"><test4></test4></fubar:bar>
+
+</contain>
diff --git a/ext/dom/tests/dom.ent b/ext/dom/tests/dom.ent
new file mode 100644
index 000000000..987ff9dc0
--- /dev/null
+++ b/ext/dom/tests/dom.ent
@@ -0,0 +1,8 @@
+<!ENTITY amp "&#38;#38;">
+<!ENTITY gt "&#62;">
+<!ENTITY % coreattrs "title CDATA #IMPLIED">
+<!ENTITY % attrs "%coreattrs;">
+<!ATTLIST foo bar CDATA #IMPLIED>
+<!ELEMENT foo (#PCDATA)>
+<!ELEMENT root (foo)+>
+<!ATTLIST th %attrs; > \ No newline at end of file
diff --git a/ext/dom/tests/dom.xml b/ext/dom/tests/dom.xml
new file mode 100644
index 000000000..09ac674e5
--- /dev/null
+++ b/ext/dom/tests/dom.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE root [
+<!ENTITY % incent SYSTEM "dom.ent">
+%incent;
+]>
+<root>
+ <foo bar="" />
+</root> \ No newline at end of file
diff --git a/ext/dom/tests/dom002.phpt b/ext/dom/tests/dom002.phpt
index 2bc0717d6..3343a1774 100644
--- a/ext/dom/tests/dom002.phpt
+++ b/ext/dom/tests/dom002.phpt
@@ -1,7 +1,7 @@
--TEST--
Test 2: getElementsByTagName() / getElementsByTagNameNS()
--SKIPIF--
-<?php require_once('skipif.php'); ?>
+<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$xml = <<<HERE
diff --git a/ext/dom/tests/domattributes.phpt b/ext/dom/tests/domattributes.phpt
new file mode 100644
index 000000000..9097a887e
--- /dev/null
+++ b/ext/dom/tests/domattributes.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Attributes: DOMAttribute functionality
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+require_once("dom_test.inc");
+
+$dom = new DOMDocument;
+$dom->loadXML($xmlstr);
+if(!$dom) {
+ echo "Error while parsing the document\n";
+ exit;
+}
+
+$node = $dom->documentElement;
+
+$lang = $node->getAttributeNode('language');
+echo "Language: ".$lang->value."\n";
+
+$lang->value = 'en-US';
+echo "Language: ".$lang->value."\n";
+
+$parent = $lang->ownerElement;
+
+$chapter = new DOMAttr("num", "1");
+$parent->setAttributeNode($chapter);
+
+echo "Is ID?: ".($chapter->isId()?'YES':'NO')."\n";
+
+$top_element = $node->cloneNode();
+
+print $dom->saveXML($top_element);
+
+
+?>
+--EXPECT--
+
+Language: en
+Language: en-US
+Is ID?: NO
+<chapter language="en-US" num="1"/>
+
diff --git a/ext/dom/tests/domchardata.phpt b/ext/dom/tests/domchardata.phpt
new file mode 100644
index 000000000..6baff6d14
--- /dev/null
+++ b/ext/dom/tests/domchardata.phpt
@@ -0,0 +1,76 @@
+--TEST--
+CharData: DOMCharacterData and related functionality
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+require_once("dom_test.inc");
+
+$dom = new DOMDocument;
+$dom->loadXML($xmlstr);
+if(!$dom) {
+ echo "Error while parsing the document\n";
+ exit;
+}
+
+$node = $dom->documentElement;
+
+$charnode = $dom->createElement('charnode');
+$node->appendChild($charnode);
+
+/* DOMComment */
+$comment = new DOMComment('Testing character data and extending nodes');
+$charnode->appendChild($comment);
+
+echo "Comment Length: ".$comment->length."\n";
+
+$comment->data = 'Updated comment';
+echo "New Comment Length: ".$comment->length."\n";
+echo "New Comment Data: ".$comment->data."\n";
+
+/* DOMCDataSection */
+$cdata = new DOMCDataSection('Chars: <>&"');
+$charnode->appendChild($cdata);
+
+echo "Substring: ".$cdata->substringData(7, 4)."\n";
+$cdata->replaceData(10, 1, "'");
+echo "New Substring: ".$cdata->substringData(7, 4)."\n";
+
+/* DOMCharacterData using DOMComment */
+$comment = new DOMComment('instructions');
+echo "Comment Value: ".$comment->data."\n";
+$comment->data = 'some more instructions';
+echo "New Comment Value: ".$comment->data."\n";
+
+$comment->insertData(10, 'pi ');
+$comment->replaceData(18, 5, 'i');
+$comment->insertData(20, 'g');
+$comment->deleteData(13, 2);
+$comment->deleteData(10, 3);
+$comment->insertData(10, 'comment ');
+echo "Updated Comment Value: ".$comment->data."\n";
+
+/* DOMText */
+$text = new DOMText('some text characters');
+
+echo "Whole Text: ".$text->wholeText."\n";
+$text2 = $text->splitText(9);
+
+echo "Split text: ".$text2->wholeText."\n";
+$text3 = $text2->splitText(1);
+
+echo "Is Whitespace?: ".($text2->isElementContentWhitespace()?'YES':'NO');
+?>
+--EXPECT--
+
+Comment Length: 42
+New Comment Length: 15
+New Comment Data: Updated comment
+Substring: <>&"
+New Substring: <>&'
+Comment Value: instructions
+New Comment Value: some more instructions
+Updated Comment Value: some more comment strings
+Whole Text: some text characters
+Split text: characters
+Is Whitespace?: YES
diff --git a/ext/dom/tests/domelement.phpt b/ext/dom/tests/domelement.phpt
new file mode 100644
index 000000000..bc69af602
--- /dev/null
+++ b/ext/dom/tests/domelement.phpt
@@ -0,0 +1,114 @@
+--TEST--
+Elements: DOMElement functionality
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+require_once("dom_test.inc");
+
+$dom = new DOMDocument;
+$dom->loadXML($xmlstr);
+if(!$dom) {
+ echo "Error while parsing the document\n";
+ exit;
+}
+
+$node = $dom->documentElement;
+echo "Tag Name: ".$node->tagName."\n";
+
+
+$node->setAttribute('num', '1');
+echo "Chapter: ".$node->getAttribute('num')."\n";
+echo 'Attribute num exists?: '.($node->hasAttribute('num')?'Yes':'No')."\n";
+$node->removeAttribute('num');
+echo "Chapter: ".$node->getAttribute('num')."\n";
+echo 'Attribute num exists?: '.($node->hasAttribute('num')?'Yes':'No')."\n";
+
+echo "Language: ".$node->getAttribute('language')."\n";
+$lang = $node->getAttributeNode('language');
+$lang->nodeValue = 'en-US';
+$node->setAttributeNode($lang);
+echo "Language: ".$node->getAttribute('language')."\n";
+$node->removeAttributeNode($lang);
+echo "Language: ".$node->getAttribute('language')."\n";
+
+echo "\n-- xml:lang --\n";
+$node->setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:lang', 'en');
+echo "Language: ".$node->getAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang')."\n";
+echo 'Attribute xml:lang exists?: '.($node->hasAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang')?'Yes':'No')."\n";
+
+$node->removeAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang');
+echo "Language: ".$node->getAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang')."\n";
+echo 'Attribute xml:lang exists?: '.($node->hasAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang')?'Yes':'No')."\n";
+
+$lang = $dom->createAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:lang');
+$lang->nodeValue = 'en-GB';
+$node->setAttributeNodeNS($lang);
+unset($lang);
+echo "Language: ".$node->getAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang')."\n";
+$lang = $node->getAttributeNodeNS('http://www.w3.org/XML/1998/namespace', 'lang');
+echo "Language: ".$lang->value."\n";
+
+echo "\n-- Elements --\n";
+$rows = $node->getElementsByTagName('row');
+echo "Row Count: ".$rows->length."\n";
+
+$element_ns = new DOMElement('newns:myelement', 'default content', 'urn::dummyns');
+$node->appendChild($element_ns);
+$element_ns = new DOMElement('newns2:myelement', 'second default content', 'urn::dummyns');
+$node->appendChild($element_ns);
+
+$myelements = $node->getElementsByTagNameNS('urn::dummyns', 'myelement');
+$mylen = $myelements->length;
+echo "myelements Count: ".$mylen."\n";
+
+echo "\n-- IDs --\n";
+$node->setAttribute('idatt', 'n1');
+$node->setIdAttribute('idatt', TRUE);
+
+for ($x = 0; $x < $mylen; $x++) {
+ $current = $myelements->item($x);
+ $current->setAttributeNS('urn::dummyns', 'newns:idatt', 'n'.($x+2))."\n";
+ $current->setIdAttributeNS('urn::dummyns', 'idatt', TRUE);
+}
+
+echo 'Element Name: '.(($elem = $dom->getElementByID('n1'))?$elem->localName:'Not Found')."\n";
+$idatt = $node->getAttributeNode('idatt');
+$node->setIdAttributeNode($idatt, FALSE);
+echo 'Element Name: '.(($elem = $dom->getElementByID('n1'))?$elem->localName:'Not Found')."\n";
+
+echo 'Element Name: '.(($elem = $dom->getElementByID('n3'))?$elem->nodeName:'Not Found')."\n";
+for ($x = 0; $x < $mylen; $x++) {
+ $node = $myelements->item($x);
+ $node->setIdAttributeNS('urn::dummyns', 'idatt', FALSE);
+}
+echo 'Element Name: '.(($elem = $dom->getElementByID('n3'))?$elem->nodeName:'Not Found')."\n";
+?>
+--EXPECT--
+
+Tag Name: chapter
+Chapter: 1
+Attribute num exists?: Yes
+Chapter:
+Attribute num exists?: No
+Language: en
+Language: en-US
+Language:
+
+-- xml:lang --
+Language: en
+Attribute xml:lang exists?: Yes
+Language:
+Attribute xml:lang exists?: No
+Language: en-GB
+Language: en-GB
+
+-- Elements --
+Row Count: 3
+myelements Count: 2
+
+-- IDs --
+Element Name: chapter
+Element Name: Not Found
+Element Name: newns2:myelement
+Element Name: Not Found
diff --git a/ext/dom/tests/nsdoc.xml b/ext/dom/tests/nsdoc.xml
new file mode 100644
index 000000000..9503fd8c5
--- /dev/null
+++ b/ext/dom/tests/nsdoc.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<root xmlns="http://ns" xmlns:ns2="http://ns2">
+ <ns2:child />
+</root> \ No newline at end of file
diff --git a/ext/dom/tests/regsiter_node_class.phpt b/ext/dom/tests/regsiter_node_class.phpt
new file mode 100644
index 000000000..5444cc4b9
--- /dev/null
+++ b/ext/dom/tests/regsiter_node_class.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Test: registerNodeClass()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class myAttribute extends DOMAttr {
+ function testit() { return "HELLO Attribute"; }
+}
+
+class myElement extends DOMElement {
+ function testit() { return "HELLO Element"; }
+}
+
+$doc = new DOMDocument();
+$doc->registerNodeClass('DOMAttr', 'myAttribute');
+$doc->registerNodeClass('DOMElement', 'myElement');
+$doc->appendChild(new DOMElement('root'));
+$root = $doc->documentElement;
+$root->setAttribute('a', 'a1');
+var_dump($root);
+print $root->testit()."\n";
+$attr = $root->getAttributeNode('a');
+var_dump($attr);
+print $attr->testit()."\n";
+unset($attr);
+$doc->registerNodeClass('DOMAttr', NULL);
+$attr = $root->getAttributeNode('a');
+var_dump($attr);
+print $attr->testit()."\n";
+?>
+--EXPECTF--
+
+object(myElement)#%d (0) {
+}
+HELLO Element
+object(myAttribute)#%d (0) {
+}
+HELLO Attribute
+object(DOMAttr)#%d (0) {
+}
+
+Fatal error: Call to undefined method DOMAttr::testit() in %s on line 25
diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h
index 137ae6cd7..bdd0d26f0 100644
--- a/ext/dom/xml_common.h
+++ b/ext/dom/xml_common.h
@@ -17,24 +17,14 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xml_common.h,v 1.23.2.1 2006/01/01 12:50:06 sniper Exp $ */
+/* $Id: xml_common.h,v 1.23.2.1.2.1 2006/05/22 17:12:25 rrichards Exp $ */
#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 libxml_doc_props *dom_doc_propsptr;
typedef struct _dom_object {
zend_object std;
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 324195fa7..56bc3b9e0 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: exif.c,v 1.173.2.5 2006/04/10 18:23:24 helly Exp $ */
+/* $Id: exif.c,v 1.173.2.5.2.4 2006/10/10 22:22:43 tony2001 Exp $ */
/* ToDos
*
@@ -98,24 +98,48 @@ typedef unsigned char uchar;
#define MAX_IFD_NESTING_LEVEL 100
+/* {{{ arginfo */
static
-ZEND_BEGIN_ARG_INFO(exif_thumbnail_force_ref, 1)
- ZEND_ARG_PASS_INFO(0)
-ZEND_END_ARG_INFO();
+ZEND_BEGIN_ARG_INFO(arginfo_exif_tagname, 0)
+ ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_exif_read_data, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, sections_needed)
+ ZEND_ARG_INFO(0, sub_arrays)
+ ZEND_ARG_INFO(0, read_thumbnail)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_exif_thumbnail, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(1, width)
+ ZEND_ARG_INFO(1, height)
+ ZEND_ARG_INFO(1, imagetype)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_exif_imagetype, 0)
+ ZEND_ARG_INFO(0, imagefile)
+ZEND_END_ARG_INFO()
+
+/* }}} */
/* {{{ exif_functions[]
*/
zend_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)
+ PHP_FE(exif_read_data, arginfo_exif_read_data)
+ PHP_FALIAS(read_exif_data, exif_read_data, arginfo_exif_read_data)
+ PHP_FE(exif_tagname, arginfo_exif_tagname)
+ PHP_FE(exif_thumbnail, arginfo_exif_thumbnail)
+ PHP_FE(exif_imagetype, arginfo_exif_imagetype)
{NULL, NULL, NULL}
};
/* }}} */
-#define EXIF_VERSION "1.4 $Id: exif.c,v 1.173.2.5 2006/04/10 18:23:24 helly Exp $"
+#define EXIF_VERSION "1.4 $Id: exif.c,v 1.173.2.5.2.4 2006/10/10 22:22:43 tony2001 Exp $"
/* {{{ PHP_MINFO_FUNCTION
*/
@@ -182,9 +206,9 @@ PHP_INI_BEGIN()
PHP_INI_END()
/* }}} */
-/* {{{ php_extname_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
-static void php_exif_init_globals(zend_exif_globals *exif_globals)
+static PHP_GINIT_FUNCTION(exif)
{
exif_globals->encode_unicode = NULL;
exif_globals->decode_unicode_be = NULL;
@@ -199,7 +223,6 @@ static void php_exif_init_globals(zend_exif_globals *exif_globals)
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;
@@ -230,7 +253,15 @@ zend_module_entry exif_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
EXIF_VERSION,
#endif
+#if ZEND_MODULE_API_NO >= 20060613
+ PHP_MODULE_GLOBALS(exif),
+ PHP_GINIT(exif),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
+#else
STANDARD_MODULE_PROPERTIES
+#endif
};
/* }}} */
@@ -2151,7 +2182,7 @@ static void exif_process_CME (image_info_type *image_info, char *value, size_t l
}
} 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");
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "JPEG2000 comment section too small");
}
}
#endif
@@ -2775,6 +2806,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
// pointers read without the need to free them
// explicitley before returning.
*/
+ memset(&cbuf, 0, sizeof(cbuf));
value_ptr = cbuf;
}
@@ -3676,7 +3708,7 @@ static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
}
}
} else {
- exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "File to small (%d)", ImageInfo->FileSize);
+ exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "File too small (%d)", ImageInfo->FileSize);
}
return ret;
}
@@ -3990,6 +4022,7 @@ PHP_FUNCTION(exif_thumbnail)
ret = exif_read_file(&ImageInfo, p_name, 1, 0 TSRMLS_CC);
if (ret==FALSE) {
+ exif_discard_imageinfo(&ImageInfo);
RETURN_FALSE;
}
diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c
index 13fcc5277..06ac81376 100644
--- a/ext/fbsql/php_fbsql.c
+++ b/ext/fbsql/php_fbsql.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_fbsql.c,v 1.114.2.4 2006/08/14 18:40:20 fmk Exp $ */
+/* $Id: php_fbsql.c,v 1.114.2.3.2.3 2006/08/14 18:40:08 fmk Exp $ */
/* TODO:
*
@@ -169,6 +169,9 @@ struct PHPFBLink
#define DIGEST_BUFFER_SIZE 17 /* fbcDigestPassword() expects a preallocated buffer for 16 bytes plus termination */
+ZEND_DECLARE_MODULE_GLOBALS(fbsql)
+static PHP_GINIT_FUNCTION(fbsql);
+
int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql);
char *DigestPassword(char *user, char *password)
{
@@ -185,77 +188,430 @@ char *DigestPassword(char *user, char *password)
return digest;
}
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_connect, 0, 0, 0)
+ ZEND_ARG_INFO(0, hostname)
+ ZEND_ARG_INFO(0, username)
+ ZEND_ARG_INFO(0, password)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_pconnect, 0, 0, 0)
+ ZEND_ARG_INFO(0, username)
+ ZEND_ARG_INFO(0, hostname)
+ ZEND_ARG_INFO(0, password)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_close, 0, 0, 0)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_set_transaction, 0)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, locking)
+ ZEND_ARG_INFO(0, isolation)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_autocommit, 0, 0, 1)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, OnOff)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_commit, 0, 0, 0)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_rollback, 0, 0, 0)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_create_blob, 0, 0, 1)
+ ZEND_ARG_INFO(0, blob_data)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_create_clob, 0, 0, 1)
+ ZEND_ARG_INFO(0, clob_data)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_set_lob_mode, 0)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, lob_mode)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_read_blob, 0, 0, 1)
+ ZEND_ARG_INFO(0, blob_handle)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_read_clob, 0, 0, 1)
+ ZEND_ARG_INFO(0, clob_handle)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_blob_size, 0, 0, 1)
+ ZEND_ARG_INFO(0, blob_handle)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_clob_size, 0, 0, 1)
+ ZEND_ARG_INFO(0, clob_handle)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_hostname, 0, 0, 1)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, host_name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_database, 0, 0, 1)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, database)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_database_password, 0, 0, 1)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, database_password)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_username, 0, 0, 1)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, username)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_password, 0, 0, 1)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, password)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_set_password, 0)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, user)
+ ZEND_ARG_INFO(0, password)
+ ZEND_ARG_INFO(0, old_password)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_select_db, 0, 0, 0)
+ ZEND_ARG_INFO(0, database_name)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_set_characterset, 0, 0, 2)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, charcterset)
+ ZEND_ARG_INFO(0, in_out_both)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_change_user, 0, 0, 2)
+ ZEND_ARG_INFO(0, user)
+ ZEND_ARG_INFO(0, password)
+ ZEND_ARG_INFO(0, database)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_create_db, 0, 0, 1)
+ ZEND_ARG_INFO(0, database_name)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, database_options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_drop_db, 0, 0, 1)
+ ZEND_ARG_INFO(0, database_name)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_start_db, 0, 0, 1)
+ ZEND_ARG_INFO(0, database_name)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, database_options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_stop_db, 0, 0, 1)
+ ZEND_ARG_INFO(0, database_name)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_db_status, 0, 0, 1)
+ ZEND_ARG_INFO(0, database_name)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_query, 0, 0, 1)
+ ZEND_ARG_INFO(0, query)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, batch_size)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_db_query, 0, 0, 2)
+ ZEND_ARG_INFO(0, database_name)
+ ZEND_ARG_INFO(0, query)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_list_dbs, 0, 0, 0)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_list_tables, 0, 0, 1)
+ ZEND_ARG_INFO(0, database)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_list_fields, 0, 0, 2)
+ ZEND_ARG_INFO(0, database_name)
+ ZEND_ARG_INFO(0, table_name)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_error, 0, 0, 0)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_errno, 0, 0, 0)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_warnings, 0, 0, 0)
+ ZEND_ARG_INFO(0, flag)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_affected_rows, 0, 0, 0)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_rows_fetched, 0)
+ ZEND_ARG_INFO(0, result)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_insert_id, 0, 0, 0)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_result, 0, 0, 1)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, row)
+ ZEND_ARG_INFO(0, field)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_next_result, 0)
+ ZEND_ARG_INFO(0, result)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_num_rows, 0)
+ ZEND_ARG_INFO(0, result)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_num_fields, 0)
+ ZEND_ARG_INFO(0, result)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_fetch_row, 0)
+ ZEND_ARG_INFO(0, result)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_fetch_assoc, 0)
+ ZEND_ARG_INFO(0, result)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_fetch_object, 0, 0, 1)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, result_type)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_fetch_array, 0, 0, 1)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, result_type)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_data_seek, 0)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, row_number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_fetch_lengths, 0)
+ ZEND_ARG_INFO(0, result)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_fetch_field, 0, 0, 1)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, field_index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_field_seek, 0, 0, 1)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, field_index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_field_name, 0, 0, 1)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, field_index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_field_table, 0, 0, 1)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, field_index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_field_len, 0, 0, 1)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, field_index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_field_type, 0, 0, 1)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, field_index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_field_flags, 0, 0, 1)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, field_index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_table_name, 0)
+ ZEND_ARG_INFO(0, result)
+ ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fbsql_free_result, 0)
+ ZEND_ARG_INFO(0, result)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fbsql_get_autostart_info, 0, 0, 0)
+ ZEND_ARG_INFO(0, link_identifier)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
/* {{{ fbsql_functions[]
*/
zend_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)
+ PHP_FE(fbsql_connect, arginfo_fbsql_connect)
+ PHP_FE(fbsql_pconnect, arginfo_fbsql_pconnect)
+ PHP_FE(fbsql_close, arginfo_fbsql_close)
+ PHP_FE(fbsql_select_db, arginfo_fbsql_select_db)
+ PHP_FE(fbsql_set_characterset, arginfo_fbsql_set_characterset)
+ PHP_FE(fbsql_create_db, arginfo_fbsql_create_db)
+ PHP_FE(fbsql_drop_db, arginfo_fbsql_drop_db)
+ PHP_FE(fbsql_start_db, arginfo_fbsql_start_db)
+ PHP_FE(fbsql_stop_db, arginfo_fbsql_stop_db)
+ PHP_FE(fbsql_db_status, arginfo_fbsql_db_status)
+ PHP_FE(fbsql_query, arginfo_fbsql_query)
+ PHP_FE(fbsql_db_query, arginfo_fbsql_db_query)
+ PHP_FE(fbsql_list_dbs, arginfo_fbsql_list_dbs)
+ PHP_FE(fbsql_list_tables, arginfo_fbsql_list_tables)
+ PHP_FE(fbsql_list_fields, arginfo_fbsql_list_fields)
+ PHP_FE(fbsql_error, arginfo_fbsql_error)
+ PHP_FE(fbsql_errno, arginfo_fbsql_errno)
+ PHP_FE(fbsql_affected_rows, arginfo_fbsql_affected_rows)
+ PHP_FE(fbsql_rows_fetched, arginfo_fbsql_rows_fetched)
+ PHP_FE(fbsql_insert_id, arginfo_fbsql_insert_id)
+ PHP_FE(fbsql_result, arginfo_fbsql_result)
+ PHP_FE(fbsql_next_result, arginfo_fbsql_next_result)
+ PHP_FE(fbsql_num_rows, arginfo_fbsql_num_rows)
+ PHP_FE(fbsql_num_fields, arginfo_fbsql_num_fields)
+ PHP_FE(fbsql_fetch_row, arginfo_fbsql_fetch_row)
+ PHP_FE(fbsql_fetch_array, arginfo_fbsql_fetch_array)
+ PHP_FE(fbsql_fetch_assoc, arginfo_fbsql_fetch_assoc)
+ PHP_FE(fbsql_fetch_object, arginfo_fbsql_fetch_object)
+ PHP_FE(fbsql_data_seek, arginfo_fbsql_data_seek)
+ PHP_FE(fbsql_fetch_lengths, arginfo_fbsql_fetch_lengths)
+ PHP_FE(fbsql_fetch_field, arginfo_fbsql_fetch_field)
+ PHP_FE(fbsql_field_seek, arginfo_fbsql_field_seek)
+ PHP_FE(fbsql_free_result, arginfo_fbsql_free_result)
+ PHP_FE(fbsql_field_name, arginfo_fbsql_field_name)
+ PHP_FE(fbsql_field_table, arginfo_fbsql_field_table)
+ PHP_FE(fbsql_field_len, arginfo_fbsql_field_len)
+ PHP_FE(fbsql_field_type, arginfo_fbsql_field_type)
+ PHP_FE(fbsql_field_flags, arginfo_fbsql_field_flags)
+ PHP_FE(fbsql_table_name, arginfo_fbsql_table_name)
/* 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_transaction, arginfo_fbsql_set_transaction)
+ PHP_FE(fbsql_autocommit, arginfo_fbsql_autocommit)
+ PHP_FE(fbsql_commit, arginfo_fbsql_commit)
+ PHP_FE(fbsql_rollback, arginfo_fbsql_rollback)
+
+ PHP_FE(fbsql_create_blob, arginfo_fbsql_create_blob)
+ PHP_FE(fbsql_create_clob, arginfo_fbsql_create_clob)
+ PHP_FE(fbsql_set_lob_mode, arginfo_fbsql_set_lob_mode)
+ PHP_FE(fbsql_read_blob, arginfo_fbsql_read_blob)
+ PHP_FE(fbsql_read_clob, arginfo_fbsql_read_clob)
+ PHP_FE(fbsql_blob_size, arginfo_fbsql_blob_size)
+ PHP_FE(fbsql_clob_size, arginfo_fbsql_clob_size)
+
+ PHP_FE(fbsql_hostname, arginfo_fbsql_hostname)
+ PHP_FE(fbsql_database, arginfo_fbsql_database)
+ PHP_FE(fbsql_database_password, arginfo_fbsql_database_password)
+ PHP_FE(fbsql_username, arginfo_fbsql_username)
+ PHP_FE(fbsql_password, arginfo_fbsql_password)
+ PHP_FE(fbsql_warnings, arginfo_fbsql_warnings)
+ PHP_FE(fbsql_set_password, arginfo_fbsql_set_password)
+
+ PHP_FE(fbsql_get_autostart_info, arginfo_fbsql_get_autostart_info)
/* PHP_FE(fbsql_set_autostart_info, NULL) */
/* Aliases: */
- PHP_FALIAS(fbsql, fbsql_db_query, NULL)
- PHP_FALIAS(fbsql_tablename, fbsql_table_name, NULL)
+ PHP_FALIAS(fbsql, fbsql_db_query, arginfo_fbsql_db_query)
+ PHP_FALIAS(fbsql_tablename, fbsql_table_name, arginfo_fbsql_table_name)
{NULL, NULL, NULL}
};
@@ -271,11 +627,13 @@ zend_module_entry fbsql_module_entry = {
PHP_RSHUTDOWN(fbsql),
PHP_MINFO(fbsql),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(fbsql),
+ PHP_GINIT(fbsql),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
-ZEND_DECLARE_MODULE_GLOBALS(fbsql)
-
#ifdef COMPILE_DL_FBSQL
ZEND_GET_MODULE(fbsql)
#endif
@@ -397,7 +755,7 @@ PHP_INI_BEGIN()
PHP_INI_END()
/* }}} */
-static void php_fbsql_init_globals(zend_fbsql_globals *fbsql_globals)
+static PHP_GINIT_FUNCTION(fbsql)
{
fbsql_globals->persistentCount = 0;
@@ -415,8 +773,6 @@ static void php_fbsql_init_globals(zend_fbsql_globals *fbsql_globals)
PHP_MINIT_FUNCTION(fbsql)
{
- ZEND_INIT_MODULE_GLOBALS(fbsql, php_fbsql_init_globals, NULL);
-
REGISTER_INI_ENTRIES();
fbcInitialize();
@@ -1509,6 +1865,7 @@ PHP_FUNCTION(fbsql_set_characterset)
fbcdcSetOutputCharacterSet(phpLink->connection, charset);
}
}
+/* }}} */
/* {{{ proto int fbsql_change_user(string user, string password [, string database [, resource link_identifier]])
Change the user for a session */
@@ -1571,7 +1928,7 @@ PHP_FUNCTION(fbsql_change_user)
}
/* }}} */
-/* {{{ proto bool fbsql_create_db(string database_name [, resource link_identifier])
+/* {{{ proto bool fbsql_create_db(string database_name [, resource link_identifier [, string database_options]])
Create a new database on the server */
PHP_FUNCTION(fbsql_create_db)
{
@@ -2395,7 +2752,7 @@ PHP_FUNCTION(fbsql_affected_rows)
}
/* }}} */
-/* {{{ proto int fbsql_affected_rows([resource link_identifier])
+/* {{{ proto int fbsql_rows_fetched(resource result)
Get the number of rows affected by the last statement */
PHP_FUNCTION(fbsql_rows_fetched)
{
diff --git a/ext/fbsql/php_fbsql.h b/ext/fbsql/php_fbsql.h
index 7414647f2..0533b05d2 100644
--- a/ext/fbsql/php_fbsql.h
+++ b/ext/fbsql/php_fbsql.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_fbsql.h,v 1.31.2.2 2006/08/14 18:40:20 fmk Exp $ */
+/* $Id: php_fbsql.h,v 1.31.2.1.2.1 2006/08/14 18:40:08 fmk Exp $ */
#define HAVE_FBSQL 1
diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c
index 796aebbc8..fbd8420f9 100644
--- a/ext/fdf/fdf.c
+++ b/ext/fdf/fdf.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fdf.c,v 1.89.2.2 2006/01/01 12:50:06 sniper Exp $ */
+/* $Id: fdf.c,v 1.89.2.2.2.4 2006/07/23 23:55:46 sniper Exp $ */
/* FdfTk lib 2.0 is a Complete C/C++ FDF Toolkit available from
http://beta1.adobe.com/ada/acrosdk/forms.html. */
@@ -47,50 +47,280 @@ static int le_fdf;
SAPI_POST_HANDLER_FUNC(fdf_post_handler);
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_open, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_open_string, 0)
+ ZEND_ARG_INFO(0, fdf_data)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_create, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_close, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_get_value, 0, 0, 2)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, fieldname)
+ ZEND_ARG_INFO(0, which)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_set_value, 0, 0, 3)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, fieldname)
+ ZEND_ARG_INFO(0, value)
+ ZEND_ARG_INFO(0, isname)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_next_field_name, 0, 0, 1)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, fieldname)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_ap, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, fieldname)
+ ZEND_ARG_INFO(0, face)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, pagenr)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_get_ap, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, fieldname)
+ ZEND_ARG_INFO(0, face)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_get_encoding, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_status, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, status)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_get_status, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_set_file, 0, 0, 2)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, target_frame)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_get_file, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_save, 0, 0, 1)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_save_string, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_add_template, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, newpage)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, template)
+ ZEND_ARG_INFO(0, rename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_flags, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, fieldname)
+ ZEND_ARG_INFO(0, whichflags)
+ ZEND_ARG_INFO(0, newflags)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_get_flags, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, fieldname)
+ ZEND_ARG_INFO(0, whichflags)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_opt, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, fieldname)
+ ZEND_ARG_INFO(0, element)
+ ZEND_ARG_INFO(0, value)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_get_opt, 0, 0, 2)
+ ZEND_ARG_INFO(0, fdfdof)
+ ZEND_ARG_INFO(0, fieldname)
+ ZEND_ARG_INFO(0, element)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_submit_form_action, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, fieldname)
+ ZEND_ARG_INFO(0, whichtrigger)
+ ZEND_ARG_INFO(0, url)
+ ZEND_ARG_INFO(0, flags)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_javascript_action, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, fieldname)
+ ZEND_ARG_INFO(0, whichtrigger)
+ ZEND_ARG_INFO(0, script)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_encoding, 0)
+ ZEND_ARG_INFO(0, fdf_document)
+ ZEND_ARG_INFO(0, encoding)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_errno, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_error, 0)
+ ZEND_ARG_INFO(0, errno)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_get_version, 0, 0, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_version, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, version)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_add_doc_javascript, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, scriptname)
+ ZEND_ARG_INFO(0, script)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_on_import_javascript, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, script)
+ ZEND_ARG_INFO(0, before_data_import)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_set_target_frame, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, target)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_remove_item, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, fieldname)
+ ZEND_ARG_INFO(0, item)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_get_attachment, 0)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, fieldname)
+ ZEND_ARG_INFO(0, savepath)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fdf_enum_values, 0, 0, 2)
+ ZEND_ARG_INFO(0, fdfdoc)
+ ZEND_ARG_INFO(0, function)
+ ZEND_ARG_INFO(0, userdata)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fdf_header, 0)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
/* {{{ fdf_functions[]
*/
zend_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)
+ PHP_FE(fdf_add_template, arginfo_fdf_add_template)
+ PHP_FE(fdf_close, arginfo_fdf_close)
+ PHP_FE(fdf_create, arginfo_fdf_create)
+ PHP_FE(fdf_enum_values, arginfo_fdf_enum_values)
+ PHP_FE(fdf_errno, arginfo_fdf_errno)
+ PHP_FE(fdf_error, arginfo_fdf_error)
+ PHP_FE(fdf_get_ap, arginfo_fdf_get_ap)
+ PHP_FE(fdf_get_encoding, arginfo_fdf_get_encoding)
+ PHP_FE(fdf_get_file, arginfo_fdf_get_file)
+ PHP_FE(fdf_get_flags, arginfo_fdf_get_flags)
+ PHP_FE(fdf_get_opt, arginfo_fdf_get_opt)
+ PHP_FE(fdf_get_status, arginfo_fdf_get_status)
+ PHP_FE(fdf_get_value, arginfo_fdf_get_value)
+ PHP_FE(fdf_get_version, arginfo_fdf_get_version)
+ PHP_FE(fdf_next_field_name, arginfo_fdf_next_field_name)
+ PHP_FE(fdf_open, arginfo_fdf_open)
+ PHP_FE(fdf_open_string, arginfo_fdf_open_string)
+ PHP_FE(fdf_remove_item, arginfo_fdf_remove_item)
+ PHP_FE(fdf_save, arginfo_fdf_save)
+ PHP_FE(fdf_save_string, arginfo_fdf_save_string)
+ PHP_FE(fdf_set_ap, arginfo_fdf_set_ap)
+ PHP_FE(fdf_set_encoding, arginfo_fdf_set_encoding)
+ PHP_FE(fdf_set_file, arginfo_fdf_set_file)
+ PHP_FE(fdf_set_flags, arginfo_fdf_set_flags)
+ PHP_FE(fdf_set_javascript_action, arginfo_fdf_set_javascript_action)
+ PHP_FE(fdf_set_opt, arginfo_fdf_set_opt)
+ PHP_FE(fdf_set_status, arginfo_fdf_set_status)
+ PHP_FE(fdf_set_submit_form_action, arginfo_fdf_set_submit_form_action)
+ PHP_FE(fdf_set_value, arginfo_fdf_set_value)
+ PHP_FE(fdf_header, arginfo_fdf_header)
#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)
+ PHP_FE(fdf_add_doc_javascript, arginfo_fdf_add_doc_javascript)
+ PHP_FE(fdf_get_attachment, arginfo_fdf_get_attachment)
+ PHP_FE(fdf_set_on_import_javascript, arginfo_fdf_set_on_import_javascript)
+ PHP_FE(fdf_set_target_frame, arginfo_fdf_set_target_frame)
+ PHP_FE(fdf_set_version, arginfo_fdf_set_version)
#endif
{NULL, NULL, NULL}
};
/* }}} */
+ZEND_DECLARE_MODULE_GLOBALS(fdf)
+static PHP_GINIT_FUNCTION(fdf);
+
zend_module_entry fdf_module_entry = {
STANDARD_MODULE_HEADER,
"fdf",
@@ -101,15 +331,17 @@ zend_module_entry fdf_module_entry = {
NULL,
PHP_MINFO(fdf),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(fdf),
+ PHP_GINIT(fdf),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
#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)
@@ -129,7 +361,7 @@ static sapi_post_entry php_fdf_post_entry = {
fdf_post_handler
};
-static void php_fdf_init_globals(zend_fdf_globals *fdf_globals)
+static PHP_GINIT_FUNCTION(fdf)
{
memset(fdf_globals, 0, sizeof(*fdf_globals));
}
@@ -140,8 +372,6 @@ static void php_fdf_init_globals(zend_fdf_globals *fdf_globals)
*/
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 */
@@ -1384,7 +1614,7 @@ PHP_FUNCTION(fdf_add_doc_javascript) {
}
/* }}} */
-/* {{{ proto bool fdf_set_on_import_javascript(resource fdfdoc, string script [, bool before_data_import])
+/* {{{ 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;
diff --git a/ext/filepro/CREDITS b/ext/filepro/CREDITS
deleted file mode 100644
index c272432c0..000000000
--- 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 bad7cee1d..000000000
--- a/ext/filepro/config.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-dnl
-dnl $Id: config.m4,v 1.8 2005/05/29 23:16:40 sniper Exp $
-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 4ff97df47..000000000
--- a/ext/filepro/config.w32
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id: config.w32,v 1.1 2003/12/07 00:59:35 edink Exp $
-// 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 94e621430..000000000
--- a/ext/filepro/filepro.c
+++ /dev/null
@@ -1,614 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | 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 <chadr@brttech.com> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: filepro.c,v 1.57.2.2 2006/01/01 12:50:06 sniper Exp $ */
-
-/*
- 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 <string.h>
-#if HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#include <errno.h>
-#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;
-}
-/* }}} */
-
-zend_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. <sigh>
- *
- * 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 af9d7f2c1..000000000
--- 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 cb118b054..000000000
--- a/ext/filepro/package.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>filepro</name>
- <summary>filePro database access functions</summary>
- <maintainers>
- <maintainer>
- <user>???</user>
- <name> Chad Robinson</name>
- <email>chadr@brttech.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-These functions allow read-only access to data stored in filePro databases.
- </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="filepro.dsp"/>
- <file role="src" name="filepro.c"/>
- <file role="src" name="php_filepro.h"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/filepro/php_filepro.h b/ext/filepro/php_filepro.h
deleted file mode 100644
index a9a1b096f..000000000
--- a/ext/filepro/php_filepro.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | 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 <chadr@brttech.com> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: php_filepro.h,v 1.14.2.1 2006/01/01 12:50:06 sniper Exp $ */
-
-/*
- 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/filter/CREDITS b/ext/filter/CREDITS
new file mode 100644
index 000000000..8d75401f7
--- /dev/null
+++ b/ext/filter/CREDITS
@@ -0,0 +1,2 @@
+Input Filter
+Rasmus Lerdorf, Derick Rethans, Pierre-Alain Joye, Ilia Alshanetsky
diff --git a/ext/filter/callback_filter.c b/ext/filter/callback_filter.c
new file mode 100644
index 000000000..2c1bb9686
--- /dev/null
+++ b/ext/filter/callback_filter.c
@@ -0,0 +1,63 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2006 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable 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 <derick@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: callback_filter.c,v 1.9.2.1 2006/07/19 08:35:55 tony2001 Exp $ */
+
+#include "php_filter.h"
+
+void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
+{
+ zval *retval_ptr;
+ zval ***args;
+ int status;
+
+ if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument is expected to be a valid callback");
+ zval_dtor(value);
+ Z_TYPE_P(value) = IS_NULL;
+ return;
+ }
+
+ args = safe_emalloc(sizeof(zval **), 1, 0);
+ args[0] = &value;
+
+ status = call_user_function_ex(EG(function_table), NULL, option_array, &retval_ptr, 1, args, 0, NULL TSRMLS_CC);
+
+ if (status == SUCCESS && retval_ptr != NULL) {
+ zval_dtor(value);
+ *value = *retval_ptr;
+ zval_copy_ctor(value);
+ } else {
+ zval_dtor(value);
+ Z_TYPE_P(value) = IS_NULL;
+ }
+
+ if (retval_ptr) {
+ zval_ptr_dtor(&retval_ptr);
+ }
+ efree(args);
+}
+
+/*
+ * 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/filter/config.m4 b/ext/filter/config.m4
new file mode 100644
index 000000000..b7a42cf10
--- /dev/null
+++ b/ext/filter/config.m4
@@ -0,0 +1,95 @@
+dnl $Id: config.m4,v 1.6 2006/01/14 15:04:12 sniper Exp $
+dnl config.m4 for input filtering extension
+
+PHP_ARG_ENABLE(filter, whether to enable input filter support,
+[ --disable-filter Disable input filter support], yes)
+
+PHP_ARG_WITH(pcre-dir, pcre install prefix,
+[ --with-pcre-dir FILTER: pcre install prefix], no, no)
+
+if test "$PHP_FILTER" != "no"; then
+
+ dnl Check if configure is the PHP core configure
+ if test -n "$PHP_VERSION"; then
+ dnl This extension can not be build as shared when in PHP core
+ ext_shared=no
+ else
+ dnl This is PECL build, check if bundled PCRE library is used
+ old_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS=$INCLUDES
+ AC_EGREP_CPP(yes,[
+#include <main/php_config.h>
+#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
+yes
+#endif
+ ],[
+ PHP_PCRE_REGEX=yes
+ ],[
+ AC_EGREP_CPP(yes,[
+#include <main/php_config.h>
+#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE)
+yes
+#endif
+ ],[
+ PHP_PCRE_REGEX=pecl
+ ],[
+ PHP_PCRE_REGEX=no
+ ])
+ ])
+ CPPFLAGS=$old_CPPFLAGS
+ fi
+
+ if test "$PHP_PCRE_REGEX" != "yes"; then
+ dnl
+ dnl If PCRE extension is enabled we can use the already found paths,
+ dnl otherwise we have to detect them here:
+ dnl
+ if test "$PHP_PCRE_REGEX" = "no" || test "$PHP_PCRE_REGEX" = "pecl"; then
+ dnl Set the PCRE search dirs correctly
+ case "$PHP_PCRE_DIR" in
+ yes|no)
+ PCRE_SEARCH_DIR="/usr/local /usr"
+ ;;
+ *)
+ PCRE_SEARCH_DIR="$PHP_PCRE_DIR"
+ ;;
+ esac
+
+ for i in $PCRE_SEARCH_DIR; do
+ if test -f $i/include/pcre/pcre.h; then
+ PCRE_INCDIR=$i/include/pcre
+ break
+ elif test -f $i/include/pcre.h; then
+ PCRE_INCDIR=$i/include
+ break
+ elif test -f $i/pcre.h; then
+ PCRE_INCDIR=$i
+ break
+ fi
+ done
+
+ if test -z "$PCRE_INCDIR"; then
+ AC_MSG_ERROR([Could not find pcre.h anywhere under $PCRE_SEARCH_DIR])
+ fi
+
+ for j in $PCRE_SEARCH_DIR/$PHP_LIBDIR $PCRE_SEARCH_DIR; do
+ if test -f $j/libpcre.a || test -f $j/libpcre.$SHLIB_SUFFIX_NAME; then
+ PCRE_LIBDIR=$j
+ break
+ fi
+ done
+
+ if test -z "$PCRE_LIBDIR" ; then
+ AC_MSG_ERROR([Could not find libpcre.(a|$SHLIB_SUFFIX_NAME) anywhere under $PCRE_SEARCH_DIR])
+ fi
+ fi
+
+ PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, FILTER_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($PCRE_INCDIR)
+ fi
+
+ PHP_NEW_EXTENSION(filter, filter.c sanitizing_filters.c logical_filters.c callback_filter.c, $ext_shared)
+ PHP_SUBST(FILTER_SHARED_LIBADD)
+
+ PHP_INSTALL_HEADERS([$ext_srcdir/php_filter.h])
+fi
diff --git a/ext/filter/config.w32 b/ext/filter/config.w32
new file mode 100644
index 000000000..5b1046c9b
--- /dev/null
+++ b/ext/filter/config.w32
@@ -0,0 +1,8 @@
+// $Id: config.w32,v 1.1 2005/12/01 00:48:13 sniper Exp $
+// vim:ft=javascript
+
+ARG_ENABLE("filter", "Filter Support", "yes");
+
+if (PHP_FILTER == "yes") {
+ EXTENSION("filter", "filter.c sanitizing_filters.c logical_filters.c callback_filter.c");
+}
diff --git a/ext/filter/docs/filter.txt b/ext/filter/docs/filter.txt
new file mode 100644
index 000000000..111011689
--- /dev/null
+++ b/ext/filter/docs/filter.txt
@@ -0,0 +1,331 @@
+Input Filter Extension
+~~~~~~~~~~~~~~~~~~~~~~
+
+Introduction
+============
+We all know that you should always check input variables, but PHP does not
+offer really good functionality for doing this in a safe way. The Input Filter
+extension is meant to address this issue by implementing a set of filters and
+mechanisms that users can use to safely access their input data.
+
+
+Change Log
+==========
+2005-10-27
+ * Updated filter_data prototype
+ * Added filter constants
+ * Fixed minor problems
+ * Changes by David Tulloh
+
+2005-10-05
+ * Changed "input_filter.paranoid_admin_default_filter" to
+ "filter.default".
+ * Updated API prototypes to reflect implementation.
+ * Added 'on' and 'off' to the boolean filter.
+ * Removed min_range and max_range flags from the float filter.
+ * Added validate_url, validate_email and validate_ip filters.
+ * Updated allows flags for all filters.
+
+2005-08-15
+ * Unmade *source* a bitmask, it doesn't make sense to do.
+ * Changed return value of filters which got invalid data from 'false' to
+ 'null.
+ * Failed filters do not throw an E_NOTICE any longer.
+ * Added a magic_quotes sanitizing filter.
+
+
+General Considerations
+======================
+* If the filter's expected input data mask does not match the provided data
+ for logical filters the filter function returns "false". If the data was
+ not found, "null" is returned.
+* Character filters always return a string.
+* With the input filter extension enabled, and the
+ input_filter.paranoid_admin_default_filter is set to something != 'raw',
+ then all entries in the affected super globals will be passed through the
+ configured filter. The 'callback' filter can not be used here, as that
+ requieres a PHP script to be running already.
+* As the input filter acts on input data before the magic quotes function
+ mangles data, all access through the filter() function will not have any
+ quotes or slashes added - it will be the pure data as send by the browser.
+* All flags mentioned here should be prepended with `FILTER_FLAG_` when used
+ with PHP.
+
+
+API
+===
+mixed *input_get* (int *source*, string *name*, [, int *filter* [, mixed *filter_options*, [ string *characterset* ] ]);
+ Returns the filtered variable *$name* from source *$source*. It uses the
+ filter as specified in *$filter* with a constant, and additional options
+ to the filter through *$filter_options*.
+
+mixed *input_get_args* (array *definitions*, int *source*, [, array *data*]);
+ Returns an array with all filtered variables defined in 'definition'.
+ The keys are used as the name of the argument. The value can be either
+ an integer (flags) or an array of options. This array can contain
+ the 'filter' type, the 'flags', the 'otptions' or the 'charset'
+
+bool *input_has_variable (int *source*, string *name*);
+ Returns *true* if the variable with the name *name* exists in *source*, or
+ *false* otherwise.
+
+array *input_filters_list* ();
+ Returns a list with all supported filter names.
+
+mixed *filter_data* (mixed *variable*, int *filter* [, mixed *filter_options*, [ string *characterset* ] ]);
+ Filters the user supplied variable *$variable* in the same manner as
+ *input_get*.
+
+*$source*:
+
+* INPUT_POST 0
+* INPUT_GET 1
+* INPUT_COOKIE 2
+* INPUT_ENV 4
+* INPUT_SERVER 5 (not implemented yet)
+* INPUT_SESSION 6 (not implemented yet)
+
+
+General flags
+=============
+
+* FILTER_FLAG_SCALAR
+* FILTER_FLAG_ARRAY
+
+These two constants define whether to allow arrays in the source values. The
+default value is SCALAR for input_get_args and ARRAY for the other functions
+(< 0.9.5). These constants also insure that the function returns the correct
+type, if you ask for an array, you will get an array even if the source is
+only one value. However, if you ask for a scalar and the source is an array,
+the result will be FALSE (invalid).
+
+
+Logical Filters
+===============
+
+These filters check whether passed data was valid, and do never mangle input
+variables, but ofcourse they can deny the whole input variable getting to the
+application by returning false.
+
+The constants should be prepended by `FILTER_VALIDATE_` when used with php.
+
+================ ========== =========== ==================================================
+Name Constant Return Type Description
+================ ========== =========== ==================================================
+int INT integer Returns the input variable as an integer
+
+ $filter_options - an array with the optional
+ elements:
+
+ * min_range: Minimal number that is allowed
+ (inclusive)
+ * max_range: Maximum number that is allowed
+ (inclusive)
+ * flags: A bitmask supporting the following flags:
+
+ - ALLOW_OCTAL: allow octal numbers with the format
+ 0nn as input too.
+ - ALLOW_HEX: allow hexadecimal numbers with the
+ format 0xnn or 0Xnn too.
+
+boolean BOOLEAN boolean Returns *true* for '1', 'on' and 'true' and *false*
+ for '0', 'off' and 'false'
+
+float FLOAT float Returns the input variable as a floating point value
+
+validate_regexp REGEXP string Matches the input value as a string against the
+ regular expression. If there is a match then the
+ string is returned, otherwise the filter returns
+ *null*.
+ Remarks: Only available if pcre has been compiled
+ into PHP.
+
+validate_url URL string Validates an URL's format.
+
+ $filter_options - an bitmask that supports the
+ following flags:
+
+ * SCHEME_REQUIRED: The 'schema' part of the URL
+ needs to in the passed URL.
+ * HOST_REQUIRED: The 'host' part of the URL
+ needs to in the passed URL.
+ * PATH_REQUIRED: The 'path' part of the URL
+ needs to in the passed URL.
+ * QUERY_REQUIRED: The 'query' part of the URL
+ needs to in the passed URL.
+
+validate_email EMAIL string Validates the passed string against a reasonably
+ good regular expression for validating an email
+ address.
+
+validate_ip IP string Validates a string representing an IP address.
+
+ $filter_options - an bitmask that supports the
+ following flags:
+
+ * IPV4: Allows IPv4 addresses.
+ * IPV6: Allows IPv6 addresses.
+ * NO_RES_RANGE: Disallows addresses in reversed
+ ranges (IPv4 only)
+ * NO_PRIV_RANGE: Disallows addresses in private
+ ranges (IPv4 only)
+================ ========== =========== ==================================================
+
+
+Sanitizing Filters
+==================
+
+These filters remove data, or change data depending on the filter, and the
+set rules for this specific filter. Instead of taking an *options* array, they
+use this parameter for flags for the specific filter.
+
+The constants should be prepended by `FILTER_SANITIZE_` when used with php.
+
+============= ================ =========== =====================================================
+Name Constant Return Type Description
+============= ================ =========== =====================================================
+string STRING string Returns the input variable as a string after it has
+ been stripped of XML/HTML tags and other evil things
+ that can cause XSS problems.
+
+ $filter_options - an bitmask that supports the
+ following flags:
+
+ * NO_ENCODE_QUOTES: Prevents single and double
+ quotes from being encoded as numerical HTML
+ entities.
+ * STRIP_LOW: excludes all characters < 0x20 from the
+ allowed character list
+ * STRIP_HIGH: excludes all characters >= 0x80 from
+ the allowed character list
+ * ENCODE_LOW: allows characters < 0x20 but encodes
+ them as numerical HTML entities
+ * ENCODE_HIGH: allows characters >= 0x80 but encodes
+ them as numerical HTML entities
+ * ENCODE_AMP: encodes & as &amp;
+
+ The flags STRIP_LOW and ENCODE_LOW are mutual
+ exclusive, and so are STRIP_HIGH and ENCODE_HIGH. In
+ the case they clash, the characters will be
+ stripped.
+
+stripped STRIPPED string Alias for 'string'.
+
+encoded ENCODED string Encodes all characters outside the range
+ "a-zA-Z0-9-._" as URL encoded values.
+
+ $filter_options - an bitmask that supports the
+ following flags:
+
+ * STRIP_LOW: excludes all characters < 0x20 from the
+ allowed character list
+ * STRIP_HIGH: excludes all characters >= 0x80 from
+ the allowed character list
+ * ENCODE_LOW: allows characters < 0x20 but encodes
+ them as numerical HTML entities
+ * ENCODE_HIGH: allows characters >= 0x80 but encodes
+ them as numerical HTML entities
+
+special_chars SPECIAL_CHARS string Encodes the 'special' characters ' " < > &, \0 and
+ everything below 0x20 as numerical HTML entities.
+
+ $filter_options - an bitmask that supports the
+ following flags:
+
+ * STRIP_LOW: excludes all characters < 0x20 from the
+ allowed character list. If this is not set, then
+ those characters are encoded as numerical HTML
+ entities
+ * STRIP_HIGH: excludes all characters >= 0x80 from
+ the allowed character list
+ * ENCODE_HIGH: allows characters >= 0x80 but encodes
+ them as numerical HTML entities
+
+unsafe_raw UNSAFE_RAW string Returns the input variable as a string without
+ XML/HTML being stripped from the input value.
+
+ $filter_options - an bitmask that supports the
+ following flags:
+
+ * STRIP_LOW: excludes all characters < 0x20 from the
+ allowed character list
+ * STRIP_HIGH: excludes all characters >= 0x80 from
+ the allowed character list
+ * ENCODE_LOW: allows characters < 0x20 but encodes
+ them as numerical HTML entities
+ * ENCODE_HIGH: allows characters >= 0x80 but encodes
+ them as numerical HTML entities
+ * ENCODE_AMP: encodes & as &amp;
+
+ The flags STRIP_LOW and ENCODE_LOW are mutual
+ exclusive, and so are STRIP_HIGH and ENCODE_HIGH. In
+ the case they clash, the characters will be
+ stripped.
+
+email EMAIL string Removes all characters that can not be part of a
+ correctly formed e-mail address (exception are
+ comments in the email address) (a-z A-Z 0-9 " ! # $
+ % & ' * + - / = ? ^ _ ` { | } ~ @ . [ ]). This
+ filter does `not` validate if the e-mail address has
+ the correct format, use the validate_email filter
+ for that.
+
+url URL string Removes all characters that can not be part of a
+ correctly formed URI. (a-z A-Z 0-9 $ - _ . + ! * ' (
+ ) , { } | \ ^ ~ [ ] ` < > # % " ; / ? : @ & =) This
+ filter does `not` validate if a URI has the correct
+ format, use the validate_url filter for that.
+
+number_int NUMBER_INT int Removes all characters that are [^0-9+-].
+
+number_float NUMBER_FLOAT float Removes all characters that are [^0-9+-].
+
+ $filter_options - an bitmask that supports the
+ following flags:
+
+ * ALLOW_FRACTION: adds "." to the characters that
+ are not stripped.
+ * ALLOW_THOUSAND: adds "," to the characters that
+ are not stripped.
+ * ALLOW_SCIENTIFIC: adds "eE" to the characters that
+ are not stripped.
+
+magic_quotes MAGIC_QUOTES string BC filter for people who like magic quotes.
+============= ================ =========== =====================================================
+
+
+Callback Filter
+===============
+
+This filter will callback to the specified callback function as specified with
+the *filter_options* parameter. All variants of callback functions are
+supported:
+
+* function with *'functionname'*
+* static method with *array('classname', 'methodname')*
+* dynamic method with *array(&$this, 'methodname')*
+
+The constants should be prepended by `FILTER_` when used with php.
+
+============= =========== =========== =====================================================
+Name Constant Return Type Description
+============= =========== =========== =====================================================
+callback CALLBACK mixed Calls the callback function/method with the input
+ variable's value by reference which can do filtering
+ and modifying of the input value. If the callback
+ function returns "false" then the input value is
+ supposed to be incorrect and the returned value will
+ be 'false' (and an E_NOTICE will be raised).
+============= =========== =========== =====================================================
+
+The callback function's prototype is:
+
+boolean callback(&$value, $characterset);
+ With *$value* being a reference to the input variable and *$characterset*
+ containing the same value as this parameter's value in the call to
+ *input_get()* or *input_get_array()*. If the *$characterset* parameter was
+ not passed, it defaults to *'null'*.
+
+Version: $Id: filter.txt,v 1.5 2006/05/24 11:51:55 pajoye Exp $
+.. vim: et syn=rst tw=78
+
diff --git a/ext/filter/docs/input_get_args.php b/ext/filter/docs/input_get_args.php
new file mode 100644
index 000000000..b58052448
--- /dev/null
+++ b/ext/filter/docs/input_get_args.php
@@ -0,0 +1,41 @@
+<?php
+error_reporting(E_ALL|E_STRICT);
+$data = array(
+ 'product_id' => 'product id<script>',
+ 'component' => '10',
+ 'versions' => '1.2.33',
+ 'testscalar' => array('2','23','10','12'),
+ 'testarray' => '2',
+);
+
+$args = array(
+ 'product_id' => FILTER_SANITIZE_ENCODED,
+ 'component' => array('filter' => FILTER_VALIDATE_INT,
+ 'flags' => FILTER_FLAG_ARRAY,
+ 'options' => array("min_range"=>1, "max_range"=>10)
+ ),
+
+ /* equivalent of => FILTER_SANITIZE_ENCODED as SCALAR is
+ * the default mode
+ */
+ 'versions' => array(
+ 'filter' => FILTER_SANITIZE_ENCODED,
+ 'flags' => FILTER_FLAG_SCALAR,
+ ),
+ 'doesnotexist' => FILTER_VALIDATE_INT,
+ 'testscalar' => FILTER_VALIDATE_INT,
+ 'testarray' => array(
+ 'filter' => FILTER_VALIDATE_INT,
+ 'flags' => FILTER_FLAG_ARRAY,
+ )
+
+);
+
+/*
+The other INPUT_* can be used as well.
+$myinputs = input_get_args($args, INPUT_POST);
+*/
+$myinputs = input_get_args($args, INPUT_DATA, $data);
+
+var_dump($myinputs);
+
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
new file mode 100644
index 000000000..9ef94a2ac
--- /dev/null
+++ b/ext/filter/filter.c
@@ -0,0 +1,808 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2006 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable 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 <rasmus@php.net> |
+ | Derick Rethans <derick@php.net> |
+ | Pierre-A. Joye <pierre@php.net> |
+ | Ilia Alshanetsky <iliaa@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: filter.c,v 1.52.2.25 2006/10/17 15:26:14 iliaa Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php_filter.h"
+
+ZEND_DECLARE_MODULE_GLOBALS(filter)
+
+#include "filter_private.h"
+
+typedef struct filter_list_entry {
+ const char *name;
+ int id;
+ void (*function)(PHP_INPUT_FILTER_PARAM_DECL);
+} filter_list_entry;
+
+/* {{{ filter_list */
+filter_list_entry filter_list[] = {
+ { "int", FILTER_VALIDATE_INT, php_filter_int },
+ { "boolean", FILTER_VALIDATE_BOOLEAN, php_filter_boolean },
+ { "float", FILTER_VALIDATE_FLOAT, php_filter_float },
+
+ { "validate_regexp", FILTER_VALIDATE_REGEXP, php_filter_validate_regexp },
+ { "validate_url", FILTER_VALIDATE_URL, php_filter_validate_url },
+ { "validate_email", FILTER_VALIDATE_EMAIL, php_filter_validate_email },
+ { "validate_ip", FILTER_VALIDATE_IP, php_filter_validate_ip },
+
+ { "string", FILTER_SANITIZE_STRING, php_filter_string },
+ { "stripped", FILTER_SANITIZE_STRING, php_filter_string },
+ { "encoded", FILTER_SANITIZE_ENCODED, php_filter_encoded },
+ { "special_chars", FILTER_SANITIZE_SPECIAL_CHARS, php_filter_special_chars },
+ { "unsafe_raw", FILTER_UNSAFE_RAW, php_filter_unsafe_raw },
+ { "email", FILTER_SANITIZE_EMAIL, php_filter_email },
+ { "url", FILTER_SANITIZE_URL, php_filter_url },
+ { "number_int", FILTER_SANITIZE_NUMBER_INT, php_filter_number_int },
+ { "number_float", FILTER_SANITIZE_NUMBER_FLOAT, php_filter_number_float },
+ { "magic_quotes", FILTER_SANITIZE_MAGIC_QUOTES, php_filter_magic_quotes },
+
+ { "callback", FILTER_CALLBACK, php_filter_callback },
+};
+/* }}} */
+
+#ifndef PARSE_ENV
+#define PARSE_ENV 4
+#endif
+
+#ifndef PARSE_SERVER
+#define PARSE_SERVER 5
+#endif
+
+#ifndef PARSE_SESSION
+#define PARSE_SESSION 6
+#endif
+
+static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC);
+
+/* {{{ filter_functions[]
+ */
+zend_function_entry filter_functions[] = {
+ PHP_FE(filter_input, NULL)
+ PHP_FE(filter_var, NULL)
+ PHP_FE(filter_input_array, NULL)
+ PHP_FE(filter_var_array, NULL)
+ PHP_FE(filter_list, NULL)
+ PHP_FE(filter_has_var, NULL)
+ PHP_FE(filter_id, NULL)
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+/* {{{ filter_module_entry
+ */
+zend_module_entry filter_module_entry = {
+#if ZEND_MODULE_API_NO >= 20010901
+ STANDARD_MODULE_HEADER,
+#endif
+ "filter",
+ filter_functions,
+ PHP_MINIT(filter),
+ PHP_MSHUTDOWN(filter),
+ NULL,
+ PHP_RSHUTDOWN(filter),
+ PHP_MINFO(filter),
+ "0.9.5-dev",
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_FILTER
+ZEND_GET_MODULE(filter)
+#endif
+
+static PHP_INI_MH(UpdateDefaultFilter) /* {{{ */
+{
+ int i, size = sizeof(filter_list) / sizeof(filter_list_entry);
+
+ for (i = 0; i < size; ++i) {
+ if ((strcasecmp(new_value, filter_list[i].name) == 0)) {
+ IF_G(default_filter) = filter_list[i].id;
+ return SUCCESS;
+ }
+ }
+ /* Fallback to "string" filter */
+ IF_G(default_filter) = FILTER_DEFAULT;
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_INI
+ */
+static PHP_INI_MH(OnUpdateFlags)
+{
+ if (!new_value) {
+ IF_G(default_filter_flags) = FILTER_FLAG_NO_ENCODE_QUOTES;
+ } else {
+ IF_G(default_filter_flags) = atoi(new_value);
+ }
+ return SUCCESS;
+}
+
+PHP_INI_BEGIN()
+ STD_PHP_INI_ENTRY("filter.default", "unsafe_raw", PHP_INI_SYSTEM|PHP_INI_PERDIR, UpdateDefaultFilter, default_filter, zend_filter_globals, filter_globals)
+ PHP_INI_ENTRY("filter.default_flags", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateFlags)
+PHP_INI_END()
+/* }}} */
+
+static void php_filter_init_globals(zend_filter_globals *filter_globals) /* {{{ */
+{
+ filter_globals->post_array = NULL;
+ filter_globals->get_array = NULL;
+ filter_globals->cookie_array = NULL;
+ filter_globals->env_array = NULL;
+ filter_globals->server_array = NULL;
+ filter_globals->session_array = NULL;
+ filter_globals->default_filter = FILTER_DEFAULT;
+}
+/* }}} */
+
+#define PARSE_REQUEST 99
+
+/* {{{ PHP_MINIT_FUNCTION
+ */
+PHP_MINIT_FUNCTION(filter)
+{
+ ZEND_INIT_MODULE_GLOBALS(filter, php_filter_init_globals, NULL);
+
+ REGISTER_INI_ENTRIES();
+
+ REGISTER_LONG_CONSTANT("INPUT_POST", PARSE_POST, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("INPUT_GET", PARSE_GET, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("INPUT_COOKIE", PARSE_COOKIE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("INPUT_ENV", PARSE_ENV, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("INPUT_SERVER", PARSE_SERVER, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("INPUT_SESSION", PARSE_SESSION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("INPUT_REQUEST", PARSE_REQUEST, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_NONE", FILTER_FLAG_NONE, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("FILTER_REQUIRE_SCALAR", FILTER_REQUIRE_SCALAR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_REQUIRE_ARRAY", FILTER_REQUIRE_ARRAY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FORCE_ARRAY", FILTER_FORCE_ARRAY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_NULL_ON_FAILURE", FILTER_NULL_ON_FAILURE, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("FILTER_VALIDATE_INT", FILTER_VALIDATE_INT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_VALIDATE_BOOLEAN", FILTER_VALIDATE_BOOLEAN, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_VALIDATE_FLOAT", FILTER_VALIDATE_FLOAT, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("FILTER_VALIDATE_REGEXP", FILTER_VALIDATE_REGEXP, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_VALIDATE_URL", FILTER_VALIDATE_URL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_VALIDATE_EMAIL", FILTER_VALIDATE_EMAIL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_VALIDATE_IP", FILTER_VALIDATE_IP, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("FILTER_DEFAULT", FILTER_DEFAULT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_UNSAFE_RAW", FILTER_UNSAFE_RAW, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("FILTER_SANITIZE_STRING", FILTER_SANITIZE_STRING, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_SANITIZE_STRIPPED", FILTER_SANITIZE_STRING, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_SANITIZE_ENCODED", FILTER_SANITIZE_ENCODED, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_SANITIZE_SPECIAL_CHARS", FILTER_SANITIZE_SPECIAL_CHARS, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_SANITIZE_EMAIL", FILTER_SANITIZE_EMAIL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_SANITIZE_URL", FILTER_SANITIZE_URL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_SANITIZE_NUMBER_INT", FILTER_SANITIZE_NUMBER_INT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_SANITIZE_NUMBER_FLOAT", FILTER_SANITIZE_NUMBER_FLOAT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_SANITIZE_MAGIC_QUOTES", FILTER_SANITIZE_MAGIC_QUOTES, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("FILTER_CALLBACK", FILTER_CALLBACK, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_ALLOW_OCTAL", FILTER_FLAG_ALLOW_OCTAL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_ALLOW_HEX", FILTER_FLAG_ALLOW_HEX, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_STRIP_LOW", FILTER_FLAG_STRIP_LOW, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_STRIP_HIGH", FILTER_FLAG_STRIP_HIGH, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_ENCODE_LOW", FILTER_FLAG_ENCODE_LOW, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_ENCODE_HIGH", FILTER_FLAG_ENCODE_HIGH, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_ENCODE_AMP", FILTER_FLAG_ENCODE_AMP, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_NO_ENCODE_QUOTES", FILTER_FLAG_NO_ENCODE_QUOTES, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_EMPTY_STRING_NULL", FILTER_FLAG_EMPTY_STRING_NULL, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_ALLOW_FRACTION", FILTER_FLAG_ALLOW_FRACTION, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_ALLOW_THOUSAND", FILTER_FLAG_ALLOW_THOUSAND, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_ALLOW_SCIENTIFIC", FILTER_FLAG_ALLOW_SCIENTIFIC, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_SCHEME_REQUIRED", FILTER_FLAG_SCHEME_REQUIRED, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_HOST_REQUIRED", FILTER_FLAG_HOST_REQUIRED, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_PATH_REQUIRED", FILTER_FLAG_PATH_REQUIRED, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_QUERY_REQUIRED", FILTER_FLAG_QUERY_REQUIRED, CONST_CS | CONST_PERSISTENT);
+
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_IPV4", FILTER_FLAG_IPV4, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_IPV6", FILTER_FLAG_IPV6, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_NO_RES_RANGE", FILTER_FLAG_NO_RES_RANGE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FILTER_FLAG_NO_PRIV_RANGE", FILTER_FLAG_NO_PRIV_RANGE, CONST_CS | CONST_PERSISTENT);
+
+ sapi_register_input_filter(php_sapi_filter);
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
+PHP_MSHUTDOWN_FUNCTION(filter)
+{
+ UNREGISTER_INI_ENTRIES();
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_RSHUTDOWN_FUNCTION
+ */
+#define VAR_ARRAY_COPY_DTOR(a) \
+ if (IF_G(a)) { \
+ zval_ptr_dtor(&IF_G(a)); \
+ IF_G(a) = NULL; \
+ }
+
+PHP_RSHUTDOWN_FUNCTION(filter)
+{
+ VAR_ARRAY_COPY_DTOR(get_array)
+ VAR_ARRAY_COPY_DTOR(post_array)
+ VAR_ARRAY_COPY_DTOR(cookie_array)
+ VAR_ARRAY_COPY_DTOR(server_array)
+ VAR_ARRAY_COPY_DTOR(env_array)
+ VAR_ARRAY_COPY_DTOR(session_array)
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MINFO_FUNCTION
+ */
+PHP_MINFO_FUNCTION(filter)
+{
+ php_info_print_table_start();
+ php_info_print_table_header( 2, "Input Validation and Filtering", "enabled" );
+ php_info_print_table_row( 2, "Revision", "$Revision: 1.52.2.25 $");
+ php_info_print_table_end();
+
+ DISPLAY_INI_ENTRIES();
+}
+/* }}} */
+
+static filter_list_entry php_find_filter(long id) /* {{{ */
+{
+ int i, size = sizeof(filter_list) / sizeof(filter_list_entry);
+
+ for (i = 0; i < size; ++i) {
+ if (filter_list[i].id == id) {
+ return filter_list[i];
+ }
+ }
+ /* Fallback to "string" filter */
+ for (i = 0; i < size; ++i) {
+ if (filter_list[i].id == FILTER_DEFAULT) {
+ return filter_list[i];
+ }
+ }
+ /* To shut up GCC */
+ return filter_list[0];
+}
+/* }}} */
+
+static void php_zval_filter(zval **value, long filter, long flags, zval *options, char* charset, zend_bool copy TSRMLS_DC) /* {{{ */
+{
+ filter_list_entry filter_func;
+
+ filter_func = php_find_filter(filter);
+
+ if (!filter_func.id) {
+ /* Find default filter */
+ filter_func = php_find_filter(FILTER_DEFAULT);
+ }
+
+ if (copy) {
+ SEPARATE_ZVAL(value);
+ }
+ /* Here be strings */
+ convert_to_string(*value);
+
+ filter_func.function(*value, flags, options, charset TSRMLS_CC);
+}
+/* }}} */
+
+static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC) /* {{{ */
+{
+ zval new_var, raw_var;
+ zval *array_ptr = NULL, *orig_array_ptr = NULL;
+ char *orig_var = NULL;
+ int retval = 0;
+
+ assert(*val != NULL);
+
+#define PARSE_CASE(s,a,t) \
+ case s: \
+ if (!IF_G(a)) { \
+ ALLOC_ZVAL(array_ptr); \
+ array_init(array_ptr); \
+ INIT_PZVAL(array_ptr); \
+ IF_G(a) = array_ptr; \
+ } else { \
+ array_ptr = IF_G(a); \
+ } \
+ orig_array_ptr = PG(http_globals)[t]; \
+ break;
+
+ switch (arg) {
+ PARSE_CASE(PARSE_POST, post_array, TRACK_VARS_POST)
+ PARSE_CASE(PARSE_GET, get_array, TRACK_VARS_GET)
+ PARSE_CASE(PARSE_COOKIE, cookie_array, TRACK_VARS_COOKIE)
+ PARSE_CASE(PARSE_SERVER, server_array, TRACK_VARS_SERVER)
+ PARSE_CASE(PARSE_ENV, env_array, TRACK_VARS_ENV)
+
+ case PARSE_STRING: /* PARSE_STRING is used by parse_str() function */
+ retval = 1;
+ break;
+ }
+
+ if (array_ptr) {
+ /* Make a copy of the variable name, as php_register_variable_ex seems to
+ * modify it */
+ orig_var = estrdup(var);
+
+ /* Store the RAW variable internally */
+ /* FIXME: Should not use php_register_variable_ex as that also registers
+ * globals when register_globals is turned on */
+ Z_STRLEN(raw_var) = val_len;
+ Z_STRVAL(raw_var) = estrndup(*val, val_len);
+ Z_TYPE(raw_var) = IS_STRING;
+
+ php_register_variable_ex(var, &raw_var, array_ptr TSRMLS_CC);
+ }
+
+ if (val_len) {
+ /* Register mangled variable */
+ /* FIXME: Should not use php_register_variable_ex as that also registers
+ * globals when register_globals is turned on */
+ Z_STRLEN(new_var) = val_len;
+ Z_TYPE(new_var) = IS_STRING;
+
+ if (!(IF_G(default_filter) == FILTER_UNSAFE_RAW)) {
+ zval *tmp_new_var = &new_var;
+ Z_STRVAL(new_var) = estrndup(*val, val_len);
+ php_zval_filter(&tmp_new_var, IF_G(default_filter), IF_G(default_filter_flags), NULL, NULL/*charset*/, 0 TSRMLS_CC);
+ } else if (PG(magic_quotes_gpc)) {
+ Z_STRVAL(new_var) = php_addslashes(*val, Z_STRLEN(new_var), &Z_STRLEN(new_var), 0 TSRMLS_CC);
+ } else {
+ Z_STRVAL(new_var) = estrndup(*val, val_len);
+ }
+ } else { /* empty string */
+ ZVAL_EMPTY_STRING(&new_var);
+ }
+
+ if (orig_array_ptr) {
+ php_register_variable_ex(orig_var, &new_var, orig_array_ptr TSRMLS_CC);
+ }
+ if (array_ptr) {
+ efree(orig_var);
+ }
+
+ if (retval) {
+ if (new_val_len) {
+ *new_val_len = Z_STRLEN(new_var);
+ }
+ efree(*val);
+ if (Z_STRLEN(new_var)) {
+ *val = estrndup(Z_STRVAL(new_var), Z_STRLEN(new_var));
+ } else {
+ *val = estrdup("");
+ }
+ zval_dtor(&new_var);
+ }
+
+ return retval;
+}
+/* }}} */
+
+static void php_zval_filter_recursive(zval **value, long filter, long flags, zval *options, char *charset, zend_bool copy TSRMLS_DC) /* {{{ */
+{
+ if (Z_TYPE_PP(value) == IS_ARRAY) {
+ zval **element;
+ HashPosition pos;
+
+ if (Z_ARRVAL_PP(value)->nApplyCount > 1) {
+ return;
+ }
+
+ for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(value), &pos);
+ zend_hash_get_current_data_ex(Z_ARRVAL_PP(value), (void **) &element, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(Z_ARRVAL_PP(value), &pos)) {
+
+ if (Z_TYPE_PP(element) == IS_ARRAY) {
+ Z_ARRVAL_PP(element)->nApplyCount++;
+ php_zval_filter_recursive(element, filter, flags, options, charset, copy TSRMLS_CC);
+ Z_ARRVAL_PP(element)->nApplyCount--;
+ } else {
+ php_zval_filter(element, filter, flags, options, charset, copy TSRMLS_CC);
+ }
+ }
+ } else {
+ php_zval_filter(value, filter, flags, options, charset, copy TSRMLS_CC);
+ }
+}
+/* }}} */
+
+static zval *php_filter_get_storage(long arg TSRMLS_DC)/* {{{ */
+
+{
+ zval *array_ptr = NULL;
+ zend_bool jit_initialization = (PG(auto_globals_jit) && !PG(register_globals) && !PG(register_long_arrays));
+
+ 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(cookie_array);
+ break;
+ case PARSE_SERVER:
+ if (jit_initialization) {
+ zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC);
+ }
+ array_ptr = IF_G(server_array);
+ break;
+ case PARSE_ENV:
+ if (jit_initialization) {
+ zend_is_auto_global("_ENV", sizeof("_ENV")-1 TSRMLS_CC);
+ }
+ array_ptr = IF_G(env_array);
+ break;
+ case PARSE_SESSION:
+ /* FIXME: Implement session source */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "INPUT_SESSION is not yet implemented");
+ break;
+ case PARSE_REQUEST:
+ /* FIXME: Implement request source */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "INPUT_REQUEST is not yet implemented");
+ break;
+ }
+
+ return array_ptr;
+}
+/* }}} */
+
+/* {{{ proto mixed filter_has_var(constant type, string variable_name)
+ * Returns true if the variable with the name 'name' exists in source.
+ */
+PHP_FUNCTION(filter_has_var)
+{
+ long arg;
+ char *var;
+ int var_len;
+ zval **tmp;
+ zval *array_ptr = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &arg, &var, &var_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ array_ptr = php_filter_get_storage(arg TSRMLS_CC);
+
+ if (array_ptr && HASH_OF(array_ptr) && zend_hash_find(HASH_OF(array_ptr), var, var_len + 1, (void **)&tmp) == SUCCESS) {
+ RETURN_TRUE;
+ }
+
+ RETURN_FALSE;
+}
+/* }}} */
+
+static void php_filter_call(zval **filtered, long filter, zval **filter_args, const int copy, long filter_flags TSRMLS_DC) /* {{{ */
+{
+ zval *options = NULL;
+ zval **option;
+ char *charset = NULL;
+
+ if (filter_args && Z_TYPE_PP(filter_args) != IS_ARRAY) {
+ convert_to_long_ex(filter_args);
+ if (filter != -1) { /* handler for array apply */
+ /* filter_args is the filter_flags */
+ filter_flags = Z_LVAL_PP(filter_args);
+ } else {
+ filter = Z_LVAL_PP(filter_args);
+ }
+ } else if (filter_args) {
+ if (zend_hash_find(HASH_OF(*filter_args), "filter", sizeof("filter"), (void **)&option) == SUCCESS) {
+ convert_to_long(*option);
+ filter = Z_LVAL_PP(option);
+ }
+
+ if (zend_hash_find(HASH_OF(*filter_args), "flags", sizeof("flags"), (void **)&option) == SUCCESS) {
+ convert_to_long(*option);
+ filter_flags = Z_LVAL_PP(option);
+
+ if (!(filter_flags & FILTER_REQUIRE_ARRAY || filter_flags & FILTER_FORCE_ARRAY)) {
+ filter_flags |= FILTER_REQUIRE_SCALAR;
+ }
+ }
+
+ if (zend_hash_find(HASH_OF(*filter_args), "options", sizeof("options"), (void **)&option) == SUCCESS) {
+ if (filter != FILTER_CALLBACK) {
+ if (Z_TYPE_PP(option) == IS_ARRAY) {
+ options = *option;
+ }
+ } else {
+ options = *option;
+ filter_flags = 0;
+ }
+ }
+ }
+
+ if (Z_TYPE_PP(filtered) == IS_ARRAY) {
+ if (filter_flags & FILTER_REQUIRE_SCALAR) {
+ if (copy) {
+ SEPARATE_ZVAL(filtered);
+ }
+ zval_dtor(*filtered);
+ if (filter_flags & FILTER_NULL_ON_FAILURE) {
+ ZVAL_NULL(*filtered);
+ } else {
+ ZVAL_FALSE(*filtered);
+ }
+ return;
+ }
+ php_zval_filter_recursive(filtered, filter, filter_flags, options, charset, copy TSRMLS_CC);
+ return;
+ }
+ if (filter_flags & FILTER_REQUIRE_ARRAY) {
+ if (copy) {
+ SEPARATE_ZVAL(filtered);
+ }
+ zval_dtor(*filtered);
+ if (filter_flags & FILTER_NULL_ON_FAILURE) {
+ ZVAL_NULL(*filtered);
+ } else {
+ ZVAL_FALSE(*filtered);
+ }
+ return;
+ }
+
+ php_zval_filter(filtered, filter, filter_flags, options, charset, copy TSRMLS_CC);
+ if (filter_flags & FILTER_FORCE_ARRAY) {
+ zval *tmp;
+
+ ALLOC_ZVAL(tmp);
+ *tmp = **filtered;
+ zval_copy_ctor(tmp);
+ INIT_PZVAL(tmp);
+
+ zval_dtor(*filtered);
+
+ array_init(*filtered);
+ add_next_index_zval(*filtered, tmp);
+ }
+}
+/* }}} */
+
+static void php_filter_array_handler(zval *input, zval **op, zval *return_value TSRMLS_DC) /* {{{ */
+{
+ char *arg_key;
+ uint arg_key_len;
+ ulong index;
+ HashPosition pos;
+ zval **tmp, **arg_elm;
+
+ if (!op) {
+ SEPARATE_ZVAL(&input);
+ *return_value = *input;
+ php_filter_call(&return_value, FILTER_DEFAULT, NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC);
+ } else if (Z_TYPE_PP(op) == IS_LONG) {
+ SEPARATE_ZVAL(&input);
+ *return_value = *input;
+ php_filter_call(&return_value, Z_LVAL_PP(op), NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC);
+ } else if (Z_TYPE_PP(op) == IS_ARRAY) {
+ array_init(return_value);
+
+ zend_hash_internal_pointer_reset(Z_ARRVAL_PP(op));
+ for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(op), &pos);
+ zend_hash_get_current_data_ex(Z_ARRVAL_PP(op), (void **) &arg_elm, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(Z_ARRVAL_PP(op), &pos))
+ {
+ if (zend_hash_get_current_key_ex(Z_ARRVAL_PP(op), &arg_key, &arg_key_len, &index, 0, &pos) != HASH_KEY_IS_STRING) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Numeric keys are not allowed in the definition array.");
+ zval_dtor(return_value);
+ RETURN_FALSE;
+ }
+ if (zend_hash_find(Z_ARRVAL_P(input), arg_key, arg_key_len, (void **)&tmp) != SUCCESS) {
+ add_assoc_null_ex(return_value, arg_key, arg_key_len);
+ } else {
+ zval *nval;
+
+ ALLOC_ZVAL(nval);
+ *nval = **tmp;
+ zval_copy_ctor(nval);
+ INIT_PZVAL(nval);
+
+ php_filter_call(&nval, -1, arg_elm, 0, FILTER_REQUIRE_SCALAR TSRMLS_CC);
+ add_assoc_zval_ex(return_value, arg_key, arg_key_len, nval);
+ }
+ }
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto mixed filter_input(constant type, string variable_name [, long filter [, mixed options]])
+ * Returns the filtered variable 'name'* from source `type`.
+ */
+PHP_FUNCTION(filter_input)
+{
+ long fetch_from, filter = FILTER_DEFAULT;
+ zval **filter_args = NULL, **tmp;
+ zval *input = NULL;
+ char *var;
+ int var_len;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls|lZ", &fetch_from, &var, &var_len, &filter, &filter_args) == FAILURE) {
+ return;
+ }
+
+ input = php_filter_get_storage(fetch_from TSRMLS_CC);
+
+ if (!input || !HASH_OF(input) || zend_hash_find(HASH_OF(input), var, var_len + 1, (void **)&tmp) != SUCCESS) {
+ long filter_flags = 0;
+ zval **option;
+ if (filter_args) {
+ if (Z_TYPE_PP(filter_args) == IS_LONG) {
+ filter_flags = Z_LVAL_PP(filter_args);
+ } else if (Z_TYPE_PP(filter_args) == IS_ARRAY && zend_hash_find(HASH_OF(*filter_args), "flags", sizeof("flags"), (void **)&option) == SUCCESS) {
+ convert_to_long(*option);
+ filter_flags = Z_LVAL_PP(option);
+ }
+ }
+ if (filter_flags & FILTER_NULL_ON_FAILURE) {
+ RETURN_FALSE;
+ } else {
+ RETURN_NULL();
+ }
+ }
+
+ *return_value = **tmp;
+ zval_copy_ctor(return_value); /* Watch out for empty strings */
+
+ php_filter_call(&return_value, filter, filter_args, 1, FILTER_REQUIRE_SCALAR TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ proto mixed filter_var(mixed variable [, long filter [, mixed options]])
+ * Returns the filtered version of the vriable.
+ */
+PHP_FUNCTION(filter_var)
+{
+ long filter = FILTER_DEFAULT;
+ zval **filter_args = NULL, *data;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/|lZ", &data, &filter, &filter_args) == FAILURE) {
+ return;
+ }
+
+ *return_value = *data;
+ zval_copy_ctor(data);
+
+ php_filter_call(&return_value, filter, filter_args, 1, FILTER_REQUIRE_SCALAR TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ proto mixed filter_input_array(constant type, [, mixed options]])
+ * Returns an array with all arguments defined in 'definition'.
+ */
+PHP_FUNCTION(filter_input_array)
+{
+ long fetch_from;
+ zval *array_input = NULL, **op = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|Z", &fetch_from, &op) == FAILURE) {
+ return;
+ }
+
+ array_input = php_filter_get_storage(fetch_from TSRMLS_CC);
+
+ if (!array_input || !HASH_OF(array_input)) {
+ long filter_flags = 0;
+ zval **option;
+ if (op) {
+ if (Z_TYPE_PP(op) == IS_LONG) {
+ filter_flags = Z_LVAL_PP(op);
+ } else if (Z_TYPE_PP(op) == IS_ARRAY && zend_hash_find(HASH_OF(*op), "flags", sizeof("flags"), (void **)&option) == SUCCESS) {
+ convert_to_long(*option);
+ filter_flags = Z_LVAL_PP(option);
+ }
+ }
+ if (filter_flags & FILTER_NULL_ON_FAILURE) {
+ RETURN_FALSE;
+ } else {
+ RETURN_NULL();
+ }
+ }
+
+ php_filter_array_handler(array_input, op, return_value TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ proto mixed filter_var_array(array data, [, mixed options]])
+ * Returns an array with all arguments defined in 'definition'.
+ */
+PHP_FUNCTION(filter_var_array)
+{
+ zval *array_input = NULL, **op = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|Z", &array_input, &op) == FAILURE) {
+ return;
+ }
+
+ php_filter_array_handler(array_input, op, return_value TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ proto filter_list()
+ * Returns a list of all supported filters */
+PHP_FUNCTION(filter_list)
+{
+ int i, size = sizeof(filter_list) / sizeof(filter_list_entry);
+
+ if (ZEND_NUM_ARGS()) {
+ WRONG_PARAM_COUNT;
+ }
+
+ array_init(return_value);
+ for (i = 0; i < size; ++i) {
+ add_next_index_string(return_value, (char *)filter_list[i].name, 1);
+ }
+}
+/* }}} */
+
+/* {{{ proto filter_id(string filtername)
+ * Returns the filter ID belonging to a named filter */
+PHP_FUNCTION(filter_id)
+{
+ int i, filter_len;
+ int size = sizeof(filter_list) / sizeof(filter_list_entry);
+ char *filter;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filter, &filter_len) == FAILURE) {
+ return;
+ }
+
+ for (i = 0; i < size; ++i) {
+ if (strcmp(filter_list[i].name, filter) == 0) {
+ RETURN_LONG(filter_list[i].id);
+ }
+ }
+
+ RETURN_FALSE;
+}
+/* }}} */
+
+/*
+ * 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/filter/filter_private.h b/ext/filter/filter_private.h
new file mode 100644
index 000000000..92d0775ea
--- /dev/null
+++ b/ext/filter/filter_private.h
@@ -0,0 +1,115 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2006 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable 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 <derick@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: filter_private.h,v 1.12.2.5 2006/10/17 15:26:14 iliaa Exp $ */
+
+#ifndef FILTER_PRIVATE_H
+#define FILTER_PRIVATE_H
+
+#define FILTER_FLAG_NONE 0x0000
+
+#define FILTER_REQUIRE_ARRAY 0x1000000
+#define FILTER_REQUIRE_SCALAR 0x2000000
+
+#define FILTER_FORCE_ARRAY 0x4000000
+#define FILTER_NULL_ON_FAILURE 0x8000000
+
+#define FILTER_FLAG_ALLOW_OCTAL 0x0001
+#define FILTER_FLAG_ALLOW_HEX 0x0002
+
+#define FILTER_FLAG_STRIP_LOW 0x0004
+#define FILTER_FLAG_STRIP_HIGH 0x0008
+#define FILTER_FLAG_ENCODE_LOW 0x0010
+#define FILTER_FLAG_ENCODE_HIGH 0x0020
+#define FILTER_FLAG_ENCODE_AMP 0x0040
+#define FILTER_FLAG_NO_ENCODE_QUOTES 0x0080
+#define FILTER_FLAG_EMPTY_STRING_NULL 0x0100
+
+#define FILTER_FLAG_ALLOW_FRACTION 0x1000
+#define FILTER_FLAG_ALLOW_THOUSAND 0x2000
+#define FILTER_FLAG_ALLOW_SCIENTIFIC 0x4000
+
+#define FILTER_FLAG_SCHEME_REQUIRED 0x010000
+#define FILTER_FLAG_HOST_REQUIRED 0x020000
+#define FILTER_FLAG_PATH_REQUIRED 0x040000
+#define FILTER_FLAG_QUERY_REQUIRED 0x080000
+
+#define FILTER_FLAG_IPV4 0x100000
+#define FILTER_FLAG_IPV6 0x200000
+#define FILTER_FLAG_NO_RES_RANGE 0x400000
+#define FILTER_FLAG_NO_PRIV_RANGE 0x800000
+
+#define FILTER_VALIDATE_INT 0x0101
+#define FILTER_VALIDATE_BOOLEAN 0x0102
+#define FILTER_VALIDATE_FLOAT 0x0103
+
+#define FILTER_VALIDATE_REGEXP 0x0110
+#define FILTER_VALIDATE_URL 0x0111
+#define FILTER_VALIDATE_EMAIL 0x0112
+#define FILTER_VALIDATE_IP 0x0113
+
+#define FILTER_VALIDATE_ALL 0x0100
+
+#define FILTER_DEFAULT 0x0204
+#define FILTER_UNSAFE_RAW 0x0204
+
+#define FILTER_SANITIZE_STRING 0x0201
+#define FILTER_SANITIZE_ENCODED 0x0202
+#define FILTER_SANITIZE_SPECIAL_CHARS 0x0203
+#define FILTER_SANITIZE_EMAIL 0x0205
+#define FILTER_SANITIZE_URL 0x0206
+#define FILTER_SANITIZE_NUMBER_INT 0x0207
+#define FILTER_SANITIZE_NUMBER_FLOAT 0x0208
+#define FILTER_SANITIZE_MAGIC_QUOTES 0x0209
+
+#define FILTER_SANITIZE_ALL 0x0200
+
+#define FILTER_CALLBACK 0x0400
+
+#define PHP_FILTER_TRIM_DEFAULT(p, len, end) { \
+ while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\v') { \
+ p++; \
+ len--; \
+ } \
+ start = p; \
+ end = p + len - 1; \
+ if (*end == ' ' || *end == '\t' || *end == '\r' || *end == '\v') { \
+ unsigned int i; \
+ for (i = len - 1; i >= 0; i--) { \
+ if (!(p[i] == ' ' || p[i] == '\t' || p[i] == '\r' || p[i] == '\v')) { \
+ break; \
+ } \
+ } \
+ i++; \
+ p[i] = '\0'; \
+ end = p + i - 1; \
+ len = (int) (end - p) + 1; \
+ } \
+}
+
+
+#endif /* FILTER_PRIVATE_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/filter/logical_filters.c b/ext/filter/logical_filters.c
new file mode 100644
index 000000000..307b4ed20
--- /dev/null
+++ b/ext/filter/logical_filters.c
@@ -0,0 +1,821 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2006 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable 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 <derick@php.net> |
+ | Pierre-A. Joye <pierre@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: logical_filters.c,v 1.1.2.11 2006/10/17 15:26:14 iliaa Exp $ */
+
+#include "php_filter.h"
+#include "filter_private.h"
+#include "ext/standard/url.h"
+#include "ext/pcre/php_pcre.h"
+
+/* {{{ FETCH_LONG_OPTION(var_name, option_name) */
+#define FETCH_LONG_OPTION(var_name, option_name) \
+ var_name = 0; \
+ var_name##_set = 0; \
+ if (option_array) { \
+ if (zend_hash_find(HASH_OF(option_array), option_name, sizeof(option_name), (void **) &option_val) == SUCCESS) { \
+ convert_to_long(*option_val); \
+ var_name = Z_LVAL_PP(option_val); \
+ var_name##_set = 1; \
+ } \
+ }
+/* }}} */
+
+/* {{{ FETCH_STRING_OPTION(var_name, option_name) */
+#define FETCH_STRING_OPTION(var_name, option_name) \
+ var_name = NULL; \
+ var_name##_set = 0; \
+ var_name##_len = 0; \
+ if (option_array) { \
+ if (zend_hash_find(HASH_OF(option_array), option_name, sizeof(option_name), (void **) &option_val) == SUCCESS) { \
+ convert_to_string(*option_val); \
+ var_name = Z_STRVAL_PP(option_val); \
+ var_name##_set = 1; \
+ var_name##_len = Z_STRLEN_PP(option_val); \
+ } \
+ }
+/* }}} */
+
+#define FORMAT_IPV4 4
+#define FORMAT_IPV6 6
+
+#define RETURN_VALIDATION_FAILED \
+ zval_dtor(value); \
+ if (flags & FILTER_NULL_ON_FAILURE) { \
+ ZVAL_NULL(value); \
+ } else { \
+ ZVAL_FALSE(value); \
+ } \
+ return; \
+
+static int php_filter_parse_int(const char *str, unsigned int str_len, long *ret TSRMLS_DC) { /* {{{ */
+ long ctx_value = 0;
+ long sign = 1;
+ int error = 0;
+ const char *end;
+
+ end = str + str_len;
+
+ switch(*str) {
+ case '-':
+ sign = -1;
+ case '+':
+ str++;
+ default:
+ break;
+ }
+
+ /* must start with 1..9*/
+ if (*str >= '1' && *str <= '9') {
+ ctx_value += ((*str) - '0');
+ str++;
+ } else {
+ return -1;
+ }
+
+ if (str_len == 1 ) {
+ *ret = ctx_value;
+ return 1;
+ }
+
+ while (*str) {
+ if (*str >= '0' && *str <= '9') {
+ ctx_value *= 10;
+ ctx_value += ((*str) - '0');
+ str++;
+ } else {
+ error = 1;
+ break;
+ }
+ }
+
+ /* state "tail" */
+ if (!error && *str == '\0' && str == end) {
+ *ret = ctx_value * sign;
+ return 1;
+ } else {
+ return -1;
+ }
+}
+/* }}} */
+
+static int php_filter_parse_octal(const char *str, unsigned int str_len, long *ret TSRMLS_DC) { /* {{{ */
+ long ctx_value = 0;
+ int error = 0;
+
+ while (*str) {
+ if (*str >= '0' && *str <= '7') {
+ ctx_value *= 8;
+ ctx_value += ((*str) - '0');
+ str++;
+ } else {
+ error = 1;
+ break;
+ }
+ }
+ if (!error && *str == '\0') {
+ *ret = ctx_value;
+ return 1;
+ } else {
+ return -1;
+ }
+}
+/* }}} */
+
+static int php_filter_parse_hex(const char *str, unsigned int str_len, long *ret TSRMLS_DC) { /* {{{ */
+ long ctx_value = 0;
+ int error = 0;
+
+ while (*str) {
+ if ((*str >= '0' && *str <= '9') || (*str >= 'a' && *str <= 'f') || (*str >= 'A' && *str <= 'F')) {
+ ctx_value *= 16;
+ if (*str >= '0' && *str <= '9') {
+ ctx_value += ((*str) - '0');
+ } else if (*str >= 'a' && *str <= 'f') {
+ ctx_value += 10 + ((*str) - 'a');
+ } else if (*str >= 'A' && *str <= 'F') {
+ ctx_value += 10 + ((*str) - 'A');
+ }
+ str++;
+ } else {
+ error = 1;
+ break;
+ }
+ }
+ if (!error && *str == '\0') {
+ *ret = ctx_value;
+ return 1;
+ } else {
+ return -1;
+ }
+}
+/* }}} */
+
+void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
+{
+ zval **option_val;
+ long min_range, max_range, option_flags;
+ int min_range_set, max_range_set;
+ int allow_octal = 0, allow_hex = 0;
+ int len, error = 0;
+ long ctx_value;
+ char *p, *start, *end;
+
+ /* Parse options */
+ FETCH_LONG_OPTION(min_range, "min_range");
+ FETCH_LONG_OPTION(max_range, "max_range");
+ option_flags = flags;
+
+ len = Z_STRLEN_P(value);
+
+ if (len == 0) {
+ RETURN_VALIDATION_FAILED
+ }
+
+ if (option_flags & FILTER_FLAG_ALLOW_OCTAL) {
+ allow_octal = 1;
+ }
+
+ if (option_flags & FILTER_FLAG_ALLOW_HEX) {
+ allow_hex = 1;
+ }
+
+ /* Start the validating loop */
+ p = Z_STRVAL_P(value);
+ ctx_value = 0;
+
+ PHP_FILTER_TRIM_DEFAULT(p, len, end);
+
+ if (*p == '0') {
+ p++;
+ if (allow_hex && (*p == 'x' || *p == 'X')) {
+ p++;
+ if (php_filter_parse_hex(p, len, &ctx_value TSRMLS_CC) < 0) {
+ error = 1;
+ }
+ } else if (allow_octal) {
+ if (php_filter_parse_octal(p, len, &ctx_value TSRMLS_CC) < 0) {
+ error = 1;
+ }
+ } else if (len != 1) {
+ error = 1;
+ }
+ } else {
+ if (php_filter_parse_int(p, len, &ctx_value TSRMLS_CC) < 0) {
+ error = 1;
+ }
+ }
+
+ if (error > 0 || (min_range_set && (ctx_value < min_range)) || (max_range_set && (ctx_value > max_range))) {
+ RETURN_VALIDATION_FAILED
+ } else {
+ zval_dtor(value);
+ Z_TYPE_P(value) = IS_LONG;
+ Z_LVAL_P(value) = ctx_value;
+ return;
+ }
+}
+/* }}} */
+
+void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
+{
+ char *str = Z_STRVAL_P(value);
+ char *start, *end;
+ int len = Z_STRLEN_P(value);
+
+ if (len>0) {
+ PHP_FILTER_TRIM_DEFAULT(str, len, end);
+ } else {
+ RETURN_VALIDATION_FAILED
+ }
+
+ /* returns true for "1", "true", "on" and "yes"
+ * returns false for "0", "false", "off", "no", and ""
+ * null otherwise. */
+ if ((strncasecmp(str, "true", sizeof("true")) == 0) ||
+ (strncasecmp(str, "yes", sizeof("yes")) == 0) ||
+ (strncasecmp(str, "on", sizeof("on")) == 0) ||
+ (strncmp(str, "1", sizeof("1")) == 0))
+ {
+ zval_dtor(value);
+ ZVAL_BOOL(value, 1);
+ } else if ((strncasecmp(str, "false", sizeof("false")) == 0) ||
+ (strncasecmp(str, "no", sizeof("no")) == 0) ||
+ (strncasecmp(str, "off", sizeof("off")) == 0) ||
+ (strncmp(str, "0", sizeof("0")) == 0))
+ {
+ zval_dtor(value);
+ ZVAL_BOOL(value, 0);
+ } else {
+ RETURN_VALIDATION_FAILED
+ }
+}
+/* }}} */
+
+void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
+{
+ int len;
+ char *str, *start, *end;
+
+ zval **option_val;
+ char *decimal;
+ char dec_sep = '\0';
+
+ const char default_decimal[] = ".";
+ int decimal_set, decimal_len;
+
+ char tsd_sep[3] = "',.";
+
+ long options_flag;
+ int options_flag_set;
+
+ int sign = 1;
+
+ double ret_val = 0;
+ double factor;
+
+ int exp_value = 0, exp_multiply = 1;
+
+ len = Z_STRLEN_P(value);
+
+ if (len < 1) {
+ RETURN_VALIDATION_FAILED
+ }
+
+ str = Z_STRVAL_P(value);
+ start = str;
+
+ if (len == 1) {
+ if (*str >= '0' && *str <= '9') {
+ ret_val = (double)*str - '0';
+ } else if (*str == 'E' || *str == 'e') {
+ ret_val = 0;
+ }
+ zval_dtor(value);
+ Z_TYPE_P(value) = IS_DOUBLE;
+ Z_DVAL_P(value) = ret_val;
+ return;
+ }
+
+ FETCH_STRING_OPTION(decimal, "decimal");
+ FETCH_LONG_OPTION(options_flag, "flags");
+
+ if (decimal_set) {
+ if (decimal_len > 1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "decimal separator must be one char");
+ } else {
+ dec_sep = *decimal;
+ }
+ } else {
+ dec_sep = *default_decimal;
+ }
+
+ PHP_FILTER_TRIM_DEFAULT(str, len, end);
+
+ if (*str == '-') {
+ sign = -1;
+ str++;
+ start = str;
+ } else if (*str == '+') {
+ sign = 1;
+ str++;
+ start = str;
+ }
+
+ ret_val = 0.0;
+
+ while (*str == '0') {
+ str++;
+ }
+
+ if (*str == dec_sep) {
+ str++;
+ goto stateDot;
+ }
+
+ ret_val = 0;
+
+ if (str != start) {
+ str--;
+ }
+
+ while (*str && *str != dec_sep) {
+ if ((options_flag & FILTER_FLAG_ALLOW_THOUSAND) && (*str == tsd_sep[0] || *str == tsd_sep[1] || *str == tsd_sep[2])) {
+ str++;
+ continue;
+ }
+
+ if (*str == 'e' || *str == 'E') {
+ goto stateExp;
+ }
+
+ if (*str < '0' || *str > '9') {
+ goto stateError;
+ }
+
+ ret_val *=10; ret_val += (*str - '0');
+ str++;
+ }
+ if (!(*str)) {
+ goto stateT;
+ }
+ str++;
+
+stateDot:
+ factor = 0.1;
+ while (*str) {
+ if (*str == 'e' || *str == 'E') {
+ goto stateExp;
+ }
+
+ if (*str < '0' || *str > '9') {
+ goto stateError;
+ }
+
+ ret_val += factor * (*str - '0');
+ factor /= 10;
+ str++;
+ }
+ if (!(*str)) {
+ goto stateT;
+ }
+
+stateExp:
+ str++;
+ switch (*str) {
+ case '-':
+ exp_multiply = -1;
+ str++;
+ break;
+ case '+':
+ exp_multiply = 1;
+ str++;
+ }
+
+ while (*str) {
+ if (*str < '0' || *str > '9') {
+ goto stateError;
+ }
+ exp_value *= 10;
+ exp_value += ((*str) - '0');
+ str++;
+ }
+
+stateT:
+ if ((str -1) != end) {
+ goto stateError;
+ }
+ if (exp_value) {
+ exp_value *= exp_multiply;
+ ret_val *= pow(10, exp_value);
+ }
+
+ zval_dtor(value);
+ Z_TYPE_P(value) = IS_DOUBLE;
+ Z_DVAL_P(value) = sign * ret_val;
+ return;
+
+stateError:
+ RETURN_VALIDATION_FAILED
+}
+/* }}} */
+
+void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
+{
+ zval **option_val;
+ char *regexp;
+ int regexp_len;
+ long option_flags;
+ int regexp_set, option_flags_set;
+
+ pcre *re = NULL;
+ pcre_extra *pcre_extra = NULL;
+ int preg_options = 0;
+
+ int ovector[3];
+ int matches;
+
+ /* Parse options */
+ FETCH_STRING_OPTION(regexp, "regexp");
+ FETCH_LONG_OPTION(option_flags, "flags");
+
+ if (!regexp_set) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "'regexp' option missing");
+ RETURN_VALIDATION_FAILED
+ }
+
+ re = pcre_get_compiled_regex(regexp, &pcre_extra, &preg_options TSRMLS_CC);
+ if (!re) {
+ RETURN_VALIDATION_FAILED
+ }
+ matches = pcre_exec(re, NULL, Z_STRVAL_P(value), Z_STRLEN_P(value), 0, 0, ovector, 3);
+
+ /* 0 means that the vector is too small to hold all the captured substring offsets */
+ if (matches < 0) {
+ RETURN_VALIDATION_FAILED
+ }
+}
+/* }}} */
+
+void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
+{
+ php_url *url;
+
+ /* Use parse_url - if it returns false, we return NULL */
+ url = php_url_parse_ex(Z_STRVAL_P(value), Z_STRLEN_P(value));
+
+ if (url == NULL) {
+ RETURN_VALIDATION_FAILED
+ }
+
+ if (
+ ((flags & FILTER_FLAG_SCHEME_REQUIRED) && url->scheme == NULL) ||
+ ((flags & FILTER_FLAG_HOST_REQUIRED) && url->host == NULL) ||
+ ((flags & FILTER_FLAG_PATH_REQUIRED) && url->path == NULL) ||
+ ((flags & FILTER_FLAG_QUERY_REQUIRED) && url->query == NULL)
+ ) {
+ php_url_free(url);
+ RETURN_VALIDATION_FAILED
+ }
+ php_url_free(url);
+}
+/* }}} */
+
+void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
+{
+ /* From http://cvs.php.net/co.php/pear/HTML_QuickForm/QuickForm/Rule/Email.php?r=1.4 */
+ const char regexp[] = "/^((\\\"[^\\\"\\f\\n\\r\\t\\v\\b]+\\\")|([\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\\-])+\\.)+[A-Za-z\\-]+))$/";
+
+ pcre *re = NULL;
+ pcre_extra *pcre_extra = NULL;
+ int preg_options = 0;
+ int ovector[150]; /* Needs to be a multiple of 3 */
+ int matches;
+
+
+ re = pcre_get_compiled_regex((char *)regexp, &pcre_extra, &preg_options TSRMLS_CC);
+ if (!re) {
+ RETURN_VALIDATION_FAILED
+ }
+ matches = pcre_exec(re, NULL, Z_STRVAL_P(value), Z_STRLEN_P(value), 0, 0, ovector, 3);
+
+ /* 0 means that the vector is too small to hold all the captured substring offsets */
+ if (matches < 0) {
+ RETURN_VALIDATION_FAILED
+ }
+
+}
+/* }}} */
+
+static int _php_filter_validate_ipv4_count_dots(char *str) /* {{{ */
+{
+ char *s1, *s2, *s3, *s4;
+
+ s1 = strchr(str, '.');
+ if (!s1)
+ return 0;
+ s2 = strchr(s1 + 1, '.');
+ if (!s2)
+ return 1;
+ s3 = strchr(s2 + 1, '.');
+ if (!s3)
+ return 2;
+ s4 = strchr(s3 + 1, '.');
+ if (!s4)
+ return 3;
+ return 4; /* too many */
+}
+/* }}} */
+
+static int _php_filter_validate_ipv4_get_nr(char **str) /* {{{ */
+{
+ char *begin, *end, *ptr, *tmp_str;
+ int tmp_nr = -1;
+
+ begin = ptr = *str;
+ while ((*ptr >= '0') && (*ptr <= '9')) {
+ ++ptr;
+ }
+ end = ptr;
+ *str = end + 1;
+
+ if (end == begin) {
+ return -1;
+ }
+
+ tmp_str = calloc(1, end - begin + 1);
+ memcpy(tmp_str, begin, end - begin);
+ tmp_nr = strtol(tmp_str, NULL, 10);
+ free(tmp_str);
+
+ if (tmp_nr < 0 || tmp_nr > 255) {
+ tmp_nr = -1;
+ }
+ return tmp_nr;
+}
+/* }}} */
+
+static int _php_filter_validate_ipv4(char *str, int *ip TSRMLS_DC) /* {{{ */
+{
+ char *p;
+ int x;
+
+ if (_php_filter_validate_ipv4_count_dots(str) != 3) {
+ return 0;
+ }
+
+ p = str;
+ for (x = 0; x < 4; ++x) {
+ ip[x] = _php_filter_validate_ipv4_get_nr(&p);
+ if (ip[x] == -1) {
+ return 0;
+ }
+ }
+ return 1;
+}
+/* }}} */
+
+#define IS_HEX(s) if (!((s >= '0' && s <= '9') || (s >= 'a' && s <= 'f') ||(s >= 'A' && s <= 'F'))) { \
+ return 0; \
+}
+
+#define IPV6_LOOP_IN(str) \
+ if (*str == ':') { \
+ if (hexcode_found > 4) { \
+ return -134; \
+ } \
+ hexcode_found = 0; \
+ col_fnd++; \
+ } else { \
+ IS_HEX(*str); \
+ hexcode_found++; \
+ }
+
+static int _php_filter_validate_ipv6_(char *str TSRMLS_DC) /* {{{ */
+{
+ int hexcode_found = 0;
+ int compressed_2end = 0;
+ int col_fnd = 0;
+ char *start = str;
+ char *compressed = NULL, *t = str;
+ char *s2 = NULL, *ipv4=NULL;
+ int ip4elm[4];
+
+ if (!strchr(str, ':')) {
+ return 0;
+ }
+
+ /* Check for compressed expression. only one is allowed */
+ compressed = strstr(str, "::");
+ if (compressed) {
+ s2 = strstr(compressed+1, "::");
+ if (s2) {
+ return 0;
+ }
+ }
+
+ /* check for bundled IPv4 */
+ ipv4 = strchr(str, '.');
+
+ if (ipv4) {
+ while (*ipv4 != ':' && ipv4 >= start) {
+ ipv4--;
+ }
+
+ /* ::w.x.y.z */
+ if (compressed && ipv4 == (compressed + 1)) {
+ compressed_2end = 1;
+ }
+ ipv4++;
+
+ if (!_php_filter_validate_ipv4(ipv4, ip4elm TSRMLS_CC)) {
+ return 0;
+ }
+
+ if (compressed_2end) {
+ return 1;
+ }
+ }
+
+ if (!compressed) {
+ char *end;
+ if (ipv4) {
+ end = ipv4 - 1;
+ } else {
+ end = str + strlen(start);
+ }
+
+ while (*str && str <= end) {
+ IPV6_LOOP_IN(str);
+ str++;
+ }
+
+ if (!ipv4) {
+ if (col_fnd != 7) {
+ return 0;
+ } else {
+ return 1;
+ }
+ } else {
+ if (col_fnd != 6) {
+ return -1230;
+ } else {
+ return 1;
+ }
+ }
+ } else {
+ if (!ipv4) {
+ t = compressed - 1;
+ while (t >= start) {
+ IPV6_LOOP_IN(t);
+ t--;
+ }
+
+ if (hexcode_found > 4) {
+ return 0;
+ }
+
+ t = compressed + 2;
+ hexcode_found = 0;
+ while (*t) {
+ IPV6_LOOP_IN(t);
+ t++;
+ }
+
+ if (hexcode_found > 4) {
+ return 0;
+ }
+
+ if (col_fnd > 6) {
+ return 0;
+ } else {
+ return 1;
+ }
+ } else {
+ /* ipv4 part always at the end */
+ t = ipv4 - 1;
+ while (t >= (compressed + 2)) {
+ IPV6_LOOP_IN(t);
+ t--;
+ }
+
+ if (hexcode_found > 4) {
+ return 0;
+ }
+
+ hexcode_found = 0;
+ t = compressed - 1;
+ while (t >= start) {
+ IPV6_LOOP_IN(t);
+ t--;
+ }
+ if (hexcode_found > 4) {
+ return 0;
+ }
+
+ if (col_fnd > 6) {
+ return 0;
+ } else {
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+/* }}} */
+
+void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
+{
+ /* validates an ipv4 or ipv6 IP, based on the flag (4, 6, or both) add a
+ * flag to throw out reserved ranges; multicast ranges... etc. If both
+ * allow_ipv4 and allow_ipv6 flags flag are used, then the first dot or
+ * colon determine the format */
+
+ char *str = NULL;
+ int ip[4];
+ int mode;
+
+ str = Z_STRVAL_P(value);
+
+ if (strchr(str, ':')) {
+ mode = FORMAT_IPV6;
+ } else if (strchr(str, '.')) {
+ mode = FORMAT_IPV4;
+ } else {
+ RETURN_VALIDATION_FAILED
+ }
+
+ if (flags & (FILTER_FLAG_IPV4 || FILTER_FLAG_IPV6)) {
+ /* Both formats are cool */
+ } else if ((flags & FILTER_FLAG_IPV4) && mode == FORMAT_IPV6) {
+ RETURN_VALIDATION_FAILED
+ } else if ((flags & FILTER_FLAG_IPV6) && mode == FORMAT_IPV4) {
+ RETURN_VALIDATION_FAILED
+ }
+
+ switch (mode) {
+ case FORMAT_IPV4:
+ if (!_php_filter_validate_ipv4(str, ip TSRMLS_CC)) {
+ RETURN_VALIDATION_FAILED
+ }
+
+ /* Check flags */
+ if (flags & FILTER_FLAG_NO_PRIV_RANGE) {
+ if (
+ (ip[0] == 10) ||
+ (ip[0] == 172 && (ip[1] >= 16 && ip[1] <= 31)) ||
+ (ip[0] == 192 && ip[1] == 168)
+ ) {
+ RETURN_VALIDATION_FAILED
+ }
+ }
+
+ if (flags & FILTER_FLAG_NO_RES_RANGE) {
+ if (
+ (ip[0] == 0) ||
+ (ip[0] == 169 && ip[1] == 254) ||
+ (ip[0] == 192 && ip[1] == 0 && ip[2] == 2) ||
+ (ip[0] >= 224 && ip[0] <= 255)
+ ) {
+ RETURN_VALIDATION_FAILED
+ }
+ }
+ break;
+
+ case FORMAT_IPV6:
+ {
+ int res = 0;
+ res = _php_filter_validate_ipv6_(str TSRMLS_CC);
+ if (res < 1) {
+ RETURN_VALIDATION_FAILED
+ }
+ }
+ break;
+ }
+}
+/* }}} */
+
+/*
+ * 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/filter/php_filter.h b/ext/filter/php_filter.h
new file mode 100644
index 000000000..eb4eab17b
--- /dev/null
+++ b/ext/filter/php_filter.h
@@ -0,0 +1,107 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2006 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable 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 <rasmus@php.net> |
+ | Derick Rethans <derick@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_filter.h,v 1.10.2.1 2006/10/03 02:16:52 iliaa Exp $ */
+
+#ifndef PHP_FILTER_H
+#define PHP_FILTER_H
+
+#include "SAPI.h"
+#include "zend_API.h"
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "ext/standard/php_string.h"
+#include "php_variables.h"
+
+extern zend_module_entry filter_module_entry;
+#define phpext_filter_ptr &filter_module_entry
+
+#ifdef PHP_WIN32
+#define PHP_FILTER_API __declspec(dllexport)
+#else
+#define PHP_FILTER_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+PHP_MINIT_FUNCTION(filter);
+PHP_MSHUTDOWN_FUNCTION(filter);
+PHP_RINIT_FUNCTION(filter);
+PHP_RSHUTDOWN_FUNCTION(filter);
+PHP_MINFO_FUNCTION(filter);
+
+PHP_FUNCTION(filter_input);
+PHP_FUNCTION(filter_var);
+PHP_FUNCTION(filter_input_array);
+PHP_FUNCTION(filter_var_array);
+PHP_FUNCTION(filter_list);
+PHP_FUNCTION(filter_has_var);
+PHP_FUNCTION(filter_id);
+
+ZEND_BEGIN_MODULE_GLOBALS(filter)
+ zval *post_array;
+ zval *get_array;
+ zval *cookie_array;
+ zval *env_array;
+ zval *server_array;
+ zval *session_array;
+ long default_filter;
+ long default_filter_flags;
+ZEND_END_MODULE_GLOBALS(filter)
+
+#ifdef ZTS
+#define IF_G(v) TSRMG(filter_globals_id, zend_filter_globals *, v)
+#else
+#define IF_G(v) (filter_globals.v)
+#endif
+
+
+#define PHP_INPUT_FILTER_PARAM_DECL zval *value, long flags, zval *option_array, char *charset TSRMLS_DC
+void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL);
+
+void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_encoded(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_special_chars(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_email(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_url(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_number_int(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_number_float(PHP_INPUT_FILTER_PARAM_DECL);
+void php_filter_magic_quotes(PHP_INPUT_FILTER_PARAM_DECL);
+
+void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL);
+
+#endif /* FILTER_H */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ */
diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c
new file mode 100644
index 000000000..910c7d13c
--- /dev/null
+++ b/ext/filter/sanitizing_filters.c
@@ -0,0 +1,339 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2006 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable 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 <derick@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: sanitizing_filters.c,v 1.11.2.5 2006/10/03 11:42:23 pajoye Exp $ */
+
+#include "php_filter.h"
+#include "filter_private.h"
+#include "ext/standard/php_smart_str.h"
+
+/* {{{ STRUCTS */
+typedef unsigned long filter_map[256];
+/* }}} */
+
+/* {{{ HELPER FUNCTIONS */
+static void php_filter_encode_html(zval *value, const char* chars, int encode_nul)
+{
+ register int x, y;
+ smart_str str = {0};
+ int len = Z_STRLEN_P(value);
+ char *s = Z_STRVAL_P(value);
+
+ if (Z_STRLEN_P(value) == 0) {
+ return;
+ }
+
+ for (x = 0, y = 0; len--; x++, y++) {
+ if (strchr(chars, s[x]) || (encode_nul && s[x] == 0)) {
+ smart_str_appendl(&str, "&#", 2);
+ smart_str_append_long(&str, s[x]);
+ smart_str_appendc(&str, ';');
+ } else {
+ smart_str_appendc(&str, s[x]);
+ }
+ }
+ smart_str_0(&str);
+ efree(Z_STRVAL_P(value));
+ Z_STRVAL_P(value) = str.c;
+ Z_STRLEN_P(value) = str.len;
+}
+
+static void php_filter_encode_html_high_low(zval *value, long flags)
+{
+ register int x, y;
+ smart_str str = {0};
+ int len = Z_STRLEN_P(value);
+ unsigned char *s = (unsigned char *)Z_STRVAL_P(value);
+
+ if (Z_STRLEN_P(value) == 0) {
+ return;
+ }
+
+ for (x = 0, y = 0; len--; x++, y++) {
+ if (((flags & FILTER_FLAG_ENCODE_LOW) && (s[x] < 32)) || ((flags & FILTER_FLAG_ENCODE_HIGH) && (s[x] > 127))) {
+ smart_str_appendl(&str, "&#", 2);
+ smart_str_append_unsigned(&str, s[x]);
+ smart_str_appendc(&str, ';');
+ } else {
+ smart_str_appendc(&str, s[x]);
+ }
+ }
+ smart_str_0(&str);
+ efree(Z_STRVAL_P(value));
+ Z_STRVAL_P(value) = str.c;
+ Z_STRLEN_P(value) = str.len;
+}
+
+static const unsigned char hexchars[] = "0123456789ABCDEF";
+
+#define LOWALPHA "abcdefghijklmnopqrstuvwxyz"
+#define HIALPHA "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+#define DIGIT "0123456789"
+
+#define DEFAULT_URL_ENCODE LOWALPHA HIALPHA DIGIT "-._"
+
+static void php_filter_encode_url(zval *value, const char* chars, int high, int low, int encode_nul)
+{
+ register int x, y;
+ unsigned char *str;
+ int len = Z_STRLEN_P(value);
+ char *s = Z_STRVAL_P(value);
+
+ str = (unsigned char *) safe_emalloc(3, len, 1);
+ for (x = 0, y = 0; len--; x++, y++) {
+ str[y] = (unsigned char) s[x];
+
+ if ((strlen(chars) && !strchr(chars, str[y])) || (high && str[y] > 127) || (low && str[y] < 32) || (encode_nul && str[y] == 0)) {
+ str[y++] = '%';
+ str[y++] = hexchars[(unsigned char) s[x] >> 4];
+ str[y] = hexchars[(unsigned char) s[x] & 15];
+ }
+ }
+ str[y] = '\0';
+ efree(Z_STRVAL_P(value));
+ Z_STRVAL_P(value) = (char *)str;
+ Z_STRLEN_P(value) = y;
+}
+
+static void php_filter_strip(zval *value, long flags)
+{
+ unsigned char *buf, *str;
+ int i, c;
+
+ /* Optimization for if no strip flags are set */
+ if (! ((flags & FILTER_FLAG_STRIP_LOW) || (flags & FILTER_FLAG_STRIP_HIGH)) ) {
+ return;
+ }
+
+ str = (unsigned char *)Z_STRVAL_P(value);
+ buf = safe_emalloc(1, Z_STRLEN_P(value) + 1, 1);
+ c = 0;
+ for (i = 0; i < Z_STRLEN_P(value); i++) {
+ if ((str[i] > 127) && (flags & FILTER_FLAG_STRIP_HIGH)) {
+ } else if ((str[i] < 32) && (flags & FILTER_FLAG_STRIP_LOW)) {
+ } else {
+ buf[c] = str[i];
+ ++c;
+ }
+ }
+ /* update zval string data */
+ buf[c] = '\0';
+ efree(Z_STRVAL_P(value));
+ Z_STRVAL_P(value) = (char *)buf;
+ Z_STRLEN_P(value) = c;
+}
+/* }}} */
+
+/* {{{ FILTER MAP HELPERS */
+static void filter_map_init(filter_map *map)
+{
+ memset(map, 0, sizeof(filter_map));
+}
+
+static void filter_map_update(filter_map *map, int flag, const unsigned char *allowed_list)
+{
+ int l, i;
+
+ l = strlen((const char*)allowed_list);
+ for (i = 0; i < l; ++i) {
+ (*map)[allowed_list[i]] = flag;
+ }
+}
+
+static void filter_map_apply(zval *value, filter_map *map)
+{
+ unsigned char *buf, *str;
+ int i, c;
+
+ str = (unsigned char *)Z_STRVAL_P(value);
+ buf = safe_emalloc(1, Z_STRLEN_P(value) + 1, 1);
+ c = 0;
+ for (i = 0; i < Z_STRLEN_P(value); i++) {
+ if ((*map)[str[i]]) {
+ buf[c] = str[i];
+ ++c;
+ }
+ }
+ /* update zval string data */
+ buf[c] = '\0';
+ efree(Z_STRVAL_P(value));
+ Z_STRVAL_P(value) = (char *)buf;
+ Z_STRLEN_P(value) = c;
+}
+/* }}} */
+
+/* {{{ php_filter_string */
+void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL)
+{
+ size_t new_len;
+
+ /* strip tags, implicitly also removes \0 chars */
+ new_len = php_strip_tags(Z_STRVAL_P(value), Z_STRLEN_P(value), NULL, NULL, 0);
+ Z_STRLEN_P(value) = new_len;
+
+ if (new_len == 0) {
+ zval_dtor(value);
+ ZVAL_EMPTY_STRING(value);
+ return;
+ }
+
+ if (! (flags & FILTER_FLAG_NO_ENCODE_QUOTES)) {
+ /* encode ' and " to numerical entity */
+ php_filter_encode_html(value, "'\"", 0);
+ }
+ /* strip high/strip low ( see flags )*/
+ php_filter_strip(value, flags);
+
+ /* encode low/encode high flags */
+ php_filter_encode_html_high_low(value, flags);
+
+ /* also all the flags - & encode as %xx */
+ if (flags & FILTER_FLAG_ENCODE_AMP) {
+ php_filter_encode_html(value, "&", 0);
+ }
+}
+/* }}} */
+
+/* {{{ php_filter_encoded */
+void php_filter_encoded(PHP_INPUT_FILTER_PARAM_DECL)
+{
+ /* apply strip_high and strip_low filters */
+ php_filter_strip(value, flags);
+ /* urlencode */
+ php_filter_encode_url(value, DEFAULT_URL_ENCODE, flags & FILTER_FLAG_ENCODE_HIGH, flags & FILTER_FLAG_ENCODE_LOW, 1);
+}
+/* }}} */
+
+/* {{{ php_filter_special_chars */
+void php_filter_special_chars(PHP_INPUT_FILTER_PARAM_DECL)
+{
+ /* encodes ' " < > & \0 to numerical entities */
+ php_filter_encode_html(value, "'\"<>&", 1);
+ /* if strip low is not set, then we encode them as &#xx; */
+ php_filter_strip(value, flags);
+ php_filter_encode_html_high_low(value, FILTER_FLAG_ENCODE_LOW | flags);
+}
+/* }}} */
+
+/* {{{ php_filter_unsafe_raw */
+void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL)
+{
+ /* Only if no flags are set (optimization) */
+ if (flags != 0 && Z_STRLEN_P(value) > 0) {
+ php_filter_strip(value, flags);
+ if (flags & FILTER_FLAG_ENCODE_AMP) {
+ php_filter_encode_html(value, "&", 0);
+ }
+ php_filter_encode_html_high_low(value, flags);
+ }
+}
+/* }}} */
+
+/* {{{ php_filter_email */
+#define SAFE "$-_.+"
+#define EXTRA "!*'(),"
+#define NATIONAL "{}|\\^~[]`"
+#define PUNCTUATION "<>#%\""
+#define RESERVED ";/?:@&="
+
+void php_filter_email(PHP_INPUT_FILTER_PARAM_DECL)
+{
+ /* Check section 6 of rfc 822 http://www.faqs.org/rfcs/rfc822.html */
+ const unsigned char allowed_list[] = LOWALPHA HIALPHA DIGIT "!#$%&'*+-/=?^_`{|}~@.[]";
+ filter_map map;
+
+ filter_map_init(&map);
+ filter_map_update(&map, 1, allowed_list);
+ filter_map_apply(value, &map);
+}
+/* }}} */
+
+/* {{{ php_filter_url */
+void php_filter_url(PHP_INPUT_FILTER_PARAM_DECL)
+{
+ /* Strip all chars not part of section 5 of
+ * http://www.faqs.org/rfcs/rfc1738.html */
+ const unsigned char allowed_list[] = LOWALPHA HIALPHA DIGIT SAFE EXTRA NATIONAL PUNCTUATION RESERVED;
+ filter_map map;
+
+ filter_map_init(&map);
+ filter_map_update(&map, 1, allowed_list);
+ filter_map_apply(value, &map);
+}
+/* }}} */
+
+/* {{{ php_filter_number_int */
+void php_filter_number_int(PHP_INPUT_FILTER_PARAM_DECL)
+{
+ /* strip everything [^0-9+-] */
+ const unsigned char allowed_list[] = "+-" DIGIT;
+ filter_map map;
+
+ filter_map_init(&map);
+ filter_map_update(&map, 1, allowed_list);
+ filter_map_apply(value, &map);
+}
+/* }}} */
+
+/* {{{ php_filter_number_float */
+void php_filter_number_float(PHP_INPUT_FILTER_PARAM_DECL)
+{
+ /* strip everything [^0-9+-] */
+ const unsigned char allowed_list[] = "+-" DIGIT;
+ filter_map map;
+
+ filter_map_init(&map);
+ filter_map_update(&map, 1, allowed_list);
+
+ /* depending on flags, strip '.', 'e', ",", "'" */
+ if (flags & FILTER_FLAG_ALLOW_FRACTION) {
+ filter_map_update(&map, 2, (const unsigned char *) ".");
+ }
+ if (flags & FILTER_FLAG_ALLOW_THOUSAND) {
+ filter_map_update(&map, 3, (const unsigned char *) ",");
+ }
+ if (flags & FILTER_FLAG_ALLOW_SCIENTIFIC) {
+ filter_map_update(&map, 4, (const unsigned char *) "eE");
+ }
+ filter_map_apply(value, &map);
+}
+/* }}} */
+
+/* {{{ php_filter_magic_quotes */
+void php_filter_magic_quotes(PHP_INPUT_FILTER_PARAM_DECL)
+{
+ char *buf;
+ int len;
+
+ /* just call php_addslashes quotes */
+ buf = php_addslashes(Z_STRVAL_P(value), Z_STRLEN_P(value), &len, 0 TSRMLS_CC);
+
+ efree(Z_STRVAL_P(value));
+ Z_STRVAL_P(value) = buf;
+ Z_STRLEN_P(value) = 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/filter/tests/001.phpt b/ext/filter/tests/001.phpt
new file mode 100644
index 000000000..2755a5736
--- /dev/null
+++ b/ext/filter/tests/001.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Simple GET test
+--GET--
+a=1
+--FILE--
+<?php echo $_GET['a']; ?>
+--EXPECT--
+1
diff --git a/ext/filter/tests/002.phpt b/ext/filter/tests/002.phpt
new file mode 100644
index 000000000..7136b251a
--- /dev/null
+++ b/ext/filter/tests/002.phpt
@@ -0,0 +1,11 @@
+--TEST--
+GET test with 2 values and an empty one
+--GET--
+a=1&b=&c=3
+--FILE--
+<?php echo $_GET['a'];
+echo $_GET['b'];
+echo $_GET['c'];
+?>
+--EXPECT--
+13
diff --git a/ext/filter/tests/003.phpt b/ext/filter/tests/003.phpt
new file mode 100644
index 000000000..43e6cd9b0
--- /dev/null
+++ b/ext/filter/tests/003.phpt
@@ -0,0 +1,22 @@
+--TEST--
+GET/POST/REQUEST Test
+--POST--
+d=4&e=5
+--GET--
+a=1&b=&c=3
+--FILE--
+<?php echo $_GET['a'];
+echo $_GET['b'];
+echo $_GET['c'];
+echo $_POST['d'];
+echo $_POST['e'];
+echo "\n";
+echo $_REQUEST['a'];
+echo $_REQUEST['b'];
+echo $_REQUEST['c'];
+echo $_REQUEST['d'];
+echo $_REQUEST['e'];
+?>
+--EXPECT--
+1345
+1345
diff --git a/ext/filter/tests/004.phpt b/ext/filter/tests/004.phpt
new file mode 100644
index 000000000..a0d1b5f2a
--- /dev/null
+++ b/ext/filter/tests/004.phpt
@@ -0,0 +1,30 @@
+--TEST--
+GET/POST/REQUEST Test with filtered data
+--SKIPIF--
+<?php
+/* CGI doesn't read commandline options when it sees REQUES_METHOD */
+die("skip");
+die("not possible to set ini setting using -d and CGI");
+?>
+--INI--
+filter.default=special_chars
+--POST--
+d="quotes"&e=\slash
+--GET--
+a=O'Henry&b=&c=<b>Bold</b>
+--FILE--
+<?php echo $_GET['a'];
+echo $_GET['b'];
+echo $_GET['c'];
+echo $_POST['d'];
+echo $_POST['e'];
+echo "\n";
+echo $_REQUEST['a'];
+echo $_REQUEST['b'];
+echo $_REQUEST['c'];
+echo $_REQUEST['d'];
+echo $_REQUEST['e'];
+?>
+--EXPECT--
+O&#39;HenryBold&quot;quotes&quot;\slash
+O&#39;HenryBold&quot;quotes&quot;\slash
diff --git a/ext/filter/tests/005.phpt b/ext/filter/tests/005.phpt
new file mode 100644
index 000000000..f44379153
--- /dev/null
+++ b/ext/filter/tests/005.phpt
@@ -0,0 +1,21 @@
+--TEST--
+GET/REQUEST Test with fifa example data
+--INI--
+filter.default=stripped
+--GET--
+id=f03_photos&pgurl=http%3A//fifaworldcup.yahoo.com/03/en/photozone/index.html
+--FILE--
+<?php
+echo $_GET['id'];
+echo "\n";
+echo $_GET['pgurl'];
+echo "\n";
+echo $_REQUEST['id'];
+echo "\n";
+echo $_REQUEST['pgurl'];
+?>
+--EXPECT--
+f03_photos
+http://fifaworldcup.yahoo.com/03/en/photozone/index.html
+f03_photos
+http://fifaworldcup.yahoo.com/03/en/photozone/index.html
diff --git a/ext/filter/tests/006.phpt b/ext/filter/tests/006.phpt
new file mode 100644
index 000000000..aa612d73d
--- /dev/null
+++ b/ext/filter/tests/006.phpt
@@ -0,0 +1,10 @@
+--TEST--
+filter() test
+--POST--
+foo=<b>abc</b>
+--FILE--
+<?php
+echo filter_input(INPUT_POST, 'foo', FILTER_SANITIZE_STRIPPED);
+?>
+--EXPECT--
+abc
diff --git a/ext/filter/tests/007.phpt b/ext/filter/tests/007.phpt
new file mode 100644
index 000000000..72670dc79
--- /dev/null
+++ b/ext/filter/tests/007.phpt
@@ -0,0 +1,68 @@
+--TEST--
+input_has_variable()
+--SKIPIF--
+<?php
+/* TODO: Check why we get warnings 2x */
+die("skip");
+die("error mode cannot be changed via -d");
+?>
+--GET--
+a=qwe&abc=<a>href</a>
+--POST--
+b=qwe&bbc=<a>href</a>
+--FILE--
+<?php
+
+var_dump(input_has_variable(INPUT_GET, "a"));
+var_dump(input_has_variable(INPUT_GET, "abc"));
+var_dump(input_has_variable(INPUT_GET, "nonex"));
+var_dump(input_has_variable(INPUT_GET, " "));
+var_dump(input_has_variable(INPUT_GET, ""));
+var_dump(input_has_variable(INPUT_GET, array()));
+
+var_dump(input_has_variable(INPUT_POST, "b"));
+var_dump(input_has_variable(INPUT_POST, "bbc"));
+var_dump(input_has_variable(INPUT_POST, "nonex"));
+var_dump(input_has_variable(INPUT_POST, " "));
+var_dump(input_has_variable(INPUT_POST, ""));
+var_dump(input_has_variable(INPUT_POST, array()));
+
+var_dump(input_has_variable(-1, ""));
+var_dump(input_has_variable("", ""));
+var_dump(input_has_variable(array(), array()));
+var_dump(input_has_variable(array(), ""));
+var_dump(input_has_variable("", array()));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+
+Warning: input_has_variable() expects parameter 2 to be string, array given in %s on line %d
+NULL
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+
+Warning: input_has_variable() expects parameter 2 to be string, array given in %s on line %d
+NULL
+bool(false)
+
+Warning: input_has_variable() expects parameter 1 to be long, string given in %s on line %d
+NULL
+
+Warning: input_has_variable() expects parameter 1 to be long, array given in %s on line %d
+NULL
+
+Warning: input_has_variable() expects parameter 1 to be long, array given in %s on line %d
+NULL
+
+Warning: input_has_variable() expects parameter 1 to be long, string given in %s on line %d
+NULL
+Done
diff --git a/ext/filter/tests/008.phpt b/ext/filter/tests/008.phpt
new file mode 100644
index 000000000..5f89910d7
--- /dev/null
+++ b/ext/filter/tests/008.phpt
@@ -0,0 +1,53 @@
+--TEST--
+filter_list()
+--FILE--
+<?php
+
+var_dump(filter_list());
+var_dump(filter_list(array()));
+
+echo "Done\n";
+?>
+--EXPECTF--
+array(18) {
+ [0]=>
+ string(3) "int"
+ [1]=>
+ string(7) "boolean"
+ [2]=>
+ string(5) "float"
+ [3]=>
+ string(15) "validate_regexp"
+ [4]=>
+ string(12) "validate_url"
+ [5]=>
+ string(14) "validate_email"
+ [6]=>
+ string(11) "validate_ip"
+ [7]=>
+ string(6) "string"
+ [8]=>
+ string(8) "stripped"
+ [9]=>
+ string(7) "encoded"
+ [10]=>
+ string(13) "special_chars"
+ [11]=>
+ string(10) "unsafe_raw"
+ [12]=>
+ string(5) "email"
+ [13]=>
+ string(3) "url"
+ [14]=>
+ string(10) "number_int"
+ [15]=>
+ string(12) "number_float"
+ [16]=>
+ string(12) "magic_quotes"
+ [17]=>
+ string(8) "callback"
+}
+
+Warning: Wrong parameter count for filter_list() in %s on line %d
+NULL
+Done
diff --git a/ext/filter/tests/009.phpt b/ext/filter/tests/009.phpt
new file mode 100644
index 000000000..d9d66be07
--- /dev/null
+++ b/ext/filter/tests/009.phpt
@@ -0,0 +1,30 @@
+--TEST--
+filter_id()
+--FILE--
+<?php
+
+var_dump(filter_id("stripped"));
+var_dump(filter_id("string"));
+var_dump(filter_id("url"));
+var_dump(filter_id("int"));
+var_dump(filter_id("none"));
+var_dump(filter_id(array()));
+var_dump(filter_id(-1));
+var_dump(filter_id(0,0,0));
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(513)
+int(513)
+int(518)
+int(257)
+bool(false)
+
+Warning: filter_id() expects parameter 1 to be string, array given in %s on line %d
+NULL
+bool(false)
+
+Warning: filter_id() expects exactly 1 parameter, 3 given in %s on line %d
+NULL
+Done
diff --git a/ext/filter/tests/010.phpt b/ext/filter/tests/010.phpt
new file mode 100644
index 000000000..b1cf124f2
--- /dev/null
+++ b/ext/filter/tests/010.phpt
@@ -0,0 +1,60 @@
+--TEST--
+filter_var()
+--FILE--
+<?php
+
+var_dump(filter_var(array(1,"1","", "-23234", "text", "asdf234asdfgs", array()), FILTER_VALIDATE_INT, FILTER_REQUIRE_ARRAY));
+var_dump(filter_var(array(1.2,"1.7","", "-23234.123", "text", "asdf234.2asdfgs", array()), FILTER_VALIDATE_FLOAT, FILTER_REQUIRE_ARRAY));
+var_dump(filter_var(1, array()));
+var_dump(filter_var(1, FILTER_SANITIZE_STRING, 1));
+var_dump(filter_var(1, FILTER_SANITIZE_STRING, 0));
+var_dump(filter_var(1, FILTER_SANITIZE_STRING, array()));
+var_dump(filter_var(1, -1, array(123)));
+var_dump(filter_var(1, 0, array()));
+
+echo "Done\n";
+?>
+--EXPECTF--
+array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(1)
+ [2]=>
+ bool(false)
+ [3]=>
+ int(-23234)
+ [4]=>
+ bool(false)
+ [5]=>
+ bool(false)
+ [6]=>
+ array(0) {
+ }
+}
+array(7) {
+ [0]=>
+ float(1.2)
+ [1]=>
+ float(1.7)
+ [2]=>
+ bool(false)
+ [3]=>
+ float(-23234.123)
+ [4]=>
+ bool(false)
+ [5]=>
+ bool(false)
+ [6]=>
+ array(0) {
+ }
+}
+
+Warning: filter_var() expects parameter 2 to be long, array given in %s on line %d
+NULL
+string(1) "1"
+string(1) "1"
+string(1) "1"
+string(1) "1"
+string(1) "1"
+Done
diff --git a/ext/filter/tests/011.phpt b/ext/filter/tests/011.phpt
new file mode 100644
index 000000000..1e5d0182c
--- /dev/null
+++ b/ext/filter/tests/011.phpt
@@ -0,0 +1,52 @@
+--TEST--
+input_get()
+--SKIPIF--
+<?php
+/* TODO: Check why we get warnings 2x */
+die("skip");
+die("error mode cannot be changed via -d");
+?>
+--GET--
+a=<b>test</b>&b=http://example.com
+--POST--
+c=<p>string</p>&d=12345.7
+--FILE--
+<?php
+ini_set('html_errors', false);
+var_dump(input_get(INPUT_GET, "a", FILTER_SANITIZE_STRIPPED));
+var_dump(input_get(INPUT_GET, "b", FILTER_SANITIZE_URL));
+var_dump(input_get(INPUT_GET, "a", FILTER_SANITIZE_SPECIAL_CHARS, array(1,2,3,4,5)));
+var_dump(input_get(INPUT_GET, "b", FILTER_VALIDATE_FLOAT, new stdClass));
+var_dump(input_get(INPUT_POST, "c", FILTER_SANITIZE_STRIPPED, array(5,6,7,8)));
+var_dump(input_get(INPUT_POST, "d", FILTER_VALIDATE_FLOAT));
+var_dump(input_get(INPUT_POST, "c", FILTER_SANITIZE_SPECIAL_CHARS));
+var_dump(input_get(INPUT_POST, "d", FILTER_VALIDATE_INT));
+
+var_dump(input_get(new stdClass, "d"));
+
+var_dump(input_get(INPUT_POST, "c", "", ""));
+var_dump(input_get("", "", "", "", ""));
+var_dump(input_get(0, 0, 0, 0, 0));
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(4) "test"
+string(18) "http://example.com"
+string(27) "&#60;b&#62;test&#60;/b&#62;"
+bool(false)
+string(6) "string"
+float(12345.7)
+string(29) "&#60;p&#62;string&#60;/p&#62;"
+bool(false)
+
+Warning: input_get() expects parameter 1 to be long, object given in %s on line %d
+NULL
+
+Warning: input_get() expects parameter 3 to be long, string given in %s on line %d
+NULL
+
+Warning: input_get() expects parameter 1 to be long, string given in %s on line %d
+NULL
+NULL
+Done
diff --git a/ext/filter/tests/012.phpt b/ext/filter/tests/012.phpt
new file mode 100644
index 000000000..ef0525489
--- /dev/null
+++ b/ext/filter/tests/012.phpt
@@ -0,0 +1,16 @@
+--TEST--
+filter_input()
+--FILE--
+<?php
+
+var_dump(filter_input(INPUT_GET, "test"));
+var_dump(filter_input(INPUT_POST, "test"));
+var_dump(filter_input(INPUT_COOKIE, ""));
+
+echo "Done\n";
+?>
+--EXPECT--
+NULL
+NULL
+NULL
+Done
diff --git a/ext/filter/tests/013.phpt b/ext/filter/tests/013.phpt
new file mode 100644
index 000000000..55c71e353
--- /dev/null
+++ b/ext/filter/tests/013.phpt
@@ -0,0 +1,72 @@
+--TEST--
+filter_var() and flags
+--FILE--
+<?php
+var_dump(filter_var(" 234", FILTER_VALIDATE_INT));
+var_dump(filter_var("234 ", FILTER_VALIDATE_INT));
+var_dump(filter_var(" 234 ", FILTER_VALIDATE_INT));
+var_dump(filter_var("0xff", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
+var_dump(filter_var("0Xff", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
+var_dump(filter_var("0xFF", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
+var_dump(filter_var("0XFF", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
+var_dump(filter_var("07", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL)));
+var_dump(filter_var("0xff0000", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
+var_dump(filter_var("0666", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL)));
+var_dump(filter_var("08", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL)));
+var_dump(filter_var("00", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL)));
+var_dump(filter_var("000", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL)));
+
+var_dump(filter_var("-0xff", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
+var_dump(filter_var("-0Xff", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
+var_dump(filter_var("-0xFF", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
+var_dump(filter_var("-0XFF", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
+var_dump(filter_var("-07", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL)));
+var_dump(filter_var("-0xff0000", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_HEX)));
+var_dump(filter_var("-0666", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL)));
+
+var_dump(filter_var("6", FILTER_VALIDATE_INT, array("options" => array("min_range"=>1, "max_range"=>7))));
+var_dump(filter_var("6", FILTER_VALIDATE_INT, array("options" => array("min_range"=>0, "max_range"=>5))));
+var_dump(filter_var(-1, FILTER_VALIDATE_INT, array("options" => array("min_range"=>1, "max_range"=>7))));
+var_dump(filter_var(-1, FILTER_VALIDATE_INT, array("options" => array("min_range"=>-4, "max_range"=>7))));
+
+var_dump(filter_var("", FILTER_VALIDATE_INT, array("options" => array("min_range"=>-4, "max_range"=>7))));
+var_dump(filter_var("", FILTER_VALIDATE_INT, array("options" => array("min_range"=>2, "max_range"=>7))));
+var_dump(filter_var("", FILTER_VALIDATE_INT, array("options" => array("min_range"=>-5, "max_range"=>-3))));
+var_dump(filter_var(345, FILTER_VALIDATE_INT, array("options" => array("min_range"=>500, "max_range"=>100))));
+var_dump(filter_var("0ff", FILTER_VALIDATE_INT));
+var_dump(filter_var("010", FILTER_VALIDATE_INT));
+
+echo "Done\n";
+?>
+--EXPECT--
+int(234)
+int(234)
+int(234)
+int(255)
+int(255)
+int(255)
+int(255)
+int(7)
+int(16711680)
+int(438)
+bool(false)
+int(0)
+int(0)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+int(6)
+bool(false)
+bool(false)
+int(-1)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+Done
diff --git a/ext/filter/tests/014.phpt b/ext/filter/tests/014.phpt
new file mode 100644
index 000000000..77e4d2557
--- /dev/null
+++ b/ext/filter/tests/014.phpt
@@ -0,0 +1,68 @@
+--TEST--
+filter_var() and FILTER_VALIDATE_BOOLEAN
+--FILE--
+<?php
+
+class test {
+
+ function __toString() {
+ return "blah";
+ }
+}
+
+$t = new test;
+
+var_dump(filter_var("no", FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var(NULL, FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var($t, FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var(array(1,2,3,0,array("", "123")), FILTER_VALIDATE_BOOLEAN, FILTER_REQUIRE_ARRAY));
+var_dump(filter_var("yes", FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var("true", FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var("false", FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var("off", FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var("on", FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var("0", FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var("1", FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var("NONE", FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var("", FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var(-1, FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var("000000", FILTER_VALIDATE_BOOLEAN));
+var_dump(filter_var("111111", FILTER_VALIDATE_BOOLEAN));
+
+
+echo "Done\n";
+?>
+--EXPECT--
+bool(false)
+bool(false)
+bool(false)
+array(5) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(false)
+ [2]=>
+ bool(false)
+ [3]=>
+ bool(false)
+ [4]=>
+ array(2) {
+ [0]=>
+ bool(false)
+ [1]=>
+ bool(false)
+ }
+}
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+Done
diff --git a/ext/filter/tests/015.phpt b/ext/filter/tests/015.phpt
new file mode 100644
index 000000000..edde095e7
--- /dev/null
+++ b/ext/filter/tests/015.phpt
@@ -0,0 +1,71 @@
+--TEST--
+filter_var() and FILTER_VALIDATE_URL
+--FILE--
+<?php
+
+$values = Array(
+'http://example.com/index.html',
+'http://www.example.com/index.php',
+'http://www.example/img/test.png',
+'http://www.example/img/dir/',
+'http://www.example/img/dir',
+'http//www.example/wrong/url/',
+'http:/www.example',
+'file:///tmp/test.c',
+'ftp://ftp.example.com/tmp/',
+'/tmp/test.c',
+'/',
+'http://',
+'http:/',
+'http:',
+'http',
+'',
+-1,
+array(),
+);
+foreach ($values as $value) {
+ var_dump(filter_var($value, FILTER_VALIDATE_URL));
+}
+
+
+var_dump(filter_var("qwe", FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED));
+var_dump(filter_var("http://qwe", FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED));
+var_dump(filter_var("http://", FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED));
+var_dump(filter_var("/tmp/test", FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED));
+var_dump(filter_var("http://www.example.com", FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED));
+var_dump(filter_var("http://www.example.com", FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED));
+var_dump(filter_var("http://www.example.com/path/at/the/server/", FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED));
+var_dump(filter_var("http://www.example.com/index.html", FILTER_VALIDATE_URL, FILTER_FLAG_QUERY_REQUIRED));
+var_dump(filter_var("http://www.example.com/index.php?a=b&c=d", FILTER_VALIDATE_URL, FILTER_FLAG_QUERY_REQUIRED));
+
+echo "Done\n";
+?>
+--EXPECT--
+string(29) "http://example.com/index.html"
+string(32) "http://www.example.com/index.php"
+string(31) "http://www.example/img/test.png"
+string(27) "http://www.example/img/dir/"
+string(26) "http://www.example/img/dir"
+string(28) "http//www.example/wrong/url/"
+string(17) "http:/www.example"
+string(18) "file:///tmp/test.c"
+string(26) "ftp://ftp.example.com/tmp/"
+string(11) "/tmp/test.c"
+string(1) "/"
+bool(false)
+string(6) "http:/"
+string(5) "http:"
+string(4) "http"
+string(0) ""
+string(2) "-1"
+bool(false)
+bool(false)
+string(10) "http://qwe"
+bool(false)
+bool(false)
+string(22) "http://www.example.com"
+bool(false)
+string(42) "http://www.example.com/path/at/the/server/"
+bool(false)
+string(40) "http://www.example.com/index.php?a=b&c=d"
+Done
diff --git a/ext/filter/tests/016.phpt b/ext/filter/tests/016.phpt
new file mode 100644
index 000000000..67921f018
--- /dev/null
+++ b/ext/filter/tests/016.phpt
@@ -0,0 +1,32 @@
+--TEST--
+filter_var() and FILTER_VALIDATE_EMAIL
+--FILE--
+<?php
+$values = Array(
+'a@b.c',
+'abuse@example.com',
+'test!.!@#$%^&*@example.com',
+'test@@#$%^&*())).com',
+'test@.com',
+'test@com',
+'@',
+'[]()/@example.com',
+'QWERTYUIOPASDFGHJKLZXCVBNM@QWERTYUIOPASDFGHJKLZXCVBNM.NET',
+);
+foreach ($values as $value) {
+ var_dump(filter_var($value, FILTER_VALIDATE_EMAIL));
+}
+
+echo "Done\n";
+?>
+--EXPECT--
+string(5) "a@b.c"
+string(17) "abuse@example.com"
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+string(57) "QWERTYUIOPASDFGHJKLZXCVBNM@QWERTYUIOPASDFGHJKLZXCVBNM.NET"
+Done
diff --git a/ext/filter/tests/017.phpt b/ext/filter/tests/017.phpt
new file mode 100644
index 000000000..661dfe40f
--- /dev/null
+++ b/ext/filter/tests/017.phpt
@@ -0,0 +1,24 @@
+--TEST--
+filter_var() and FILTER_VALIDATE_REGEXP
+--FILE--
+<?php
+
+var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/.*/'))));
+var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/^b(.*)/'))));
+var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/^d(.*)/'))));
+var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/blah/'))));
+var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>'/\[/'))));
+var_dump(filter_var("data", FILTER_VALIDATE_REGEXP));
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(4) "data"
+bool(false)
+string(4) "data"
+bool(false)
+bool(false)
+
+Warning: filter_var(): 'regexp' option missing in %s on line %d
+bool(false)
+Done
diff --git a/ext/filter/tests/018.phpt b/ext/filter/tests/018.phpt
new file mode 100644
index 000000000..7ea17b329
--- /dev/null
+++ b/ext/filter/tests/018.phpt
@@ -0,0 +1,50 @@
+--TEST--
+filter_var() and FILTER_VALIDATE_IP
+--FILE--
+<?php
+var_dump(filter_var("192.168.0.1", FILTER_VALIDATE_IP));
+var_dump(filter_var("192.168.0.1.1", FILTER_VALIDATE_IP));
+var_dump(filter_var("::1", FILTER_VALIDATE_IP));
+var_dump(filter_var("fe00::0", FILTER_VALIDATE_IP));
+var_dump(filter_var("::123456", FILTER_VALIDATE_IP));
+var_dump(filter_var("::1::b", FILTER_VALIDATE_IP));
+var_dump(filter_var("127.0.0.1", FILTER_VALIDATE_IP));
+var_dump(filter_var("192.168.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE));
+var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE));
+var_dump(filter_var("127.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
+var_dump(filter_var("192.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
+var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP));
+var_dump(filter_var("256.1237.123.1", FILTER_VALIDATE_IP));
+var_dump(filter_var("255.255.255.255", FILTER_VALIDATE_IP));
+var_dump(filter_var("255.255.255.255", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
+var_dump(filter_var("", FILTER_VALIDATE_IP));
+var_dump(filter_var(-1, FILTER_VALIDATE_IP));
+var_dump(filter_var("::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV4));
+var_dump(filter_var("127.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
+var_dump(filter_var("::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
+var_dump(filter_var("127.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV4));
+echo "Done\n";
+?>
+--EXPECT--
+string(11) "192.168.0.1"
+bool(false)
+string(3) "::1"
+string(7) "fe00::0"
+bool(false)
+bool(false)
+string(9) "127.0.0.1"
+bool(false)
+string(12) "192.0.34.166"
+string(9) "127.0.0.1"
+string(9) "192.0.0.1"
+string(12) "192.0.34.166"
+bool(false)
+string(15) "255.255.255.255"
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+string(3) "::1"
+string(9) "127.0.0.1"
+Done
diff --git a/ext/filter/tests/019.phpt b/ext/filter/tests/019.phpt
new file mode 100644
index 000000000..5a20ff821
--- /dev/null
+++ b/ext/filter/tests/019.phpt
@@ -0,0 +1,20 @@
+--TEST--
+filter_var() & FILTER_VALIDATE_IP and weird data
+--FILE--
+<?php
+
+var_dump(filter_var("....", FILTER_VALIDATE_IP));
+var_dump(filter_var("...", FILTER_VALIDATE_IP));
+var_dump(filter_var("..", FILTER_VALIDATE_IP));
+var_dump(filter_var(".", FILTER_VALIDATE_IP));
+var_dump(filter_var("1.1.1.1", FILTER_VALIDATE_IP));
+
+echo "Done\n";
+?>
+--EXPECT--
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+string(7) "1.1.1.1"
+Done
diff --git a/ext/filter/tests/020.phpt b/ext/filter/tests/020.phpt
new file mode 100644
index 000000000..d39ee55e9
--- /dev/null
+++ b/ext/filter/tests/020.phpt
@@ -0,0 +1,18 @@
+--TEST--
+filter_var() and FILTER_SANITIZE_MAGIC_QUOTES
+--FILE--
+<?php
+
+var_dump(filter_var("test'asd'asd'' asd\'\"asdfasdf", FILTER_SANITIZE_MAGIC_QUOTES));
+var_dump(filter_var("'", FILTER_SANITIZE_MAGIC_QUOTES));
+var_dump(filter_var("", FILTER_SANITIZE_MAGIC_QUOTES));
+var_dump(filter_var(-1, FILTER_SANITIZE_MAGIC_QUOTES));
+
+echo "Done\n";
+?>
+--EXPECT--
+string(36) "test\'asd\'asd\'\' asd\\\'\"asdfasdf"
+string(2) "\'"
+string(0) ""
+string(2) "-1"
+Done
diff --git a/ext/filter/tests/021.phpt b/ext/filter/tests/021.phpt
new file mode 100644
index 000000000..1dffc9f7a
--- /dev/null
+++ b/ext/filter/tests/021.phpt
@@ -0,0 +1,44 @@
+--TEST--
+filter_var() and FILTER_SANITIZE_NUMBER_*
+--FILE--
+<?php
+
+var_dump(filter_var("qwertyu123456dfghj", FILTER_SANITIZE_NUMBER_INT));
+var_dump(filter_var("asd123123.asd123.23", FILTER_SANITIZE_NUMBER_INT));
+var_dump(filter_var("123,23", FILTER_SANITIZE_NUMBER_INT));
+var_dump(filter_var("", FILTER_SANITIZE_NUMBER_INT));
+var_dump(filter_var("0", FILTER_SANITIZE_NUMBER_INT));
+var_dump(filter_var("asd123.2asd", FILTER_SANITIZE_NUMBER_INT));
+var_dump(filter_var("qwertyuiop", FILTER_SANITIZE_NUMBER_INT));
+var_dump(filter_var("123.4", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION));
+var_dump(filter_var("123,4", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION));
+var_dump(filter_var("123.4", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_THOUSAND));
+var_dump(filter_var("123,4", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_THOUSAND));
+var_dump(filter_var("123.4e", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_SCIENTIFIC));
+var_dump(filter_var("123,4E", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_SCIENTIFIC));
+var_dump(filter_var("qwe123,4qwe", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION));
+var_dump(filter_var("werty65456.34", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION));
+var_dump(filter_var("234.56fsfd", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION));
+var_dump(filter_var("", FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION));
+
+echo "Done\n";
+?>
+--EXPECT--
+string(6) "123456"
+string(11) "12312312323"
+string(5) "12323"
+string(0) ""
+string(1) "0"
+string(4) "1232"
+string(0) ""
+string(5) "123.4"
+string(4) "1234"
+string(4) "1234"
+string(5) "123,4"
+string(5) "1234e"
+string(5) "1234E"
+string(4) "1234"
+string(8) "65456.34"
+string(6) "234.56"
+string(0) ""
+Done
diff --git a/ext/filter/tests/022.phpt b/ext/filter/tests/022.phpt
new file mode 100644
index 000000000..a2ad5a4c3
--- /dev/null
+++ b/ext/filter/tests/022.phpt
@@ -0,0 +1,20 @@
+--TEST--
+filter_var() and FILTER_SANITIZE_EMAIL
+--FILE--
+<?php
+
+var_dump(filter_var("a@b.c", FILTER_SANITIZE_EMAIL));
+var_dump(filter_var("a[!@#$%^&*()@a@#$%^&*(.com@#$%^&*(", FILTER_SANITIZE_EMAIL));
+var_dump(filter_var("white space here \ \ \" som more", FILTER_SANITIZE_EMAIL));
+var_dump(filter_var("", FILTER_SANITIZE_EMAIL));
+var_dump(filter_var("123456789000000", FILTER_SANITIZE_EMAIL));
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(5) "a@b.c"
+string(30) "a[!@#$%^&*@a@#$%^&*.com@#$%^&*"
+string(21) "whitespaceheresommore"
+string(0) ""
+string(15) "123456789000000"
+Done
diff --git a/ext/filter/tests/023.phpt b/ext/filter/tests/023.phpt
new file mode 100644
index 000000000..b9761a5b7
--- /dev/null
+++ b/ext/filter/tests/023.phpt
@@ -0,0 +1,20 @@
+--TEST--
+filter_var() and FILTER_UNSAFE_RAW
+--FILE--
+<?php
+
+var_dump(filter_var("}\"<p>test para</p>", FILTER_UNSAFE_RAW, FILTER_FLAG_ENCODE_AMP));
+var_dump(filter_var("a[!@#<b>$%^&*()@a@#$%^&*(.<br>com@#$%^&*(", FILTER_UNSAFE_RAW, FILTER_FLAG_ENCODE_AMP));
+var_dump(filter_var("white space here \ \ \" some more", FILTER_UNSAFE_RAW, FILTER_FLAG_ENCODE_AMP));
+var_dump(filter_var("", FILTER_UNSAFE_RAW, FILTER_FLAG_ENCODE_AMP));
+var_dump(filter_var(" 123456789000000 <qwertyuiop> ", FILTER_UNSAFE_RAW, FILTER_FLAG_ENCODE_AMP));
+
+echo "Done\n";
+?>
+--EXPECT--
+string(18) "}"<p>test para</p>"
+string(53) "a[!@#<b>$%^&#38;*()@a@#$%^&#38;*(.<br>com@#$%^&#38;*("
+string(32) "white space here \ \ " some more"
+string(0) ""
+string(48) " 123456789000000 <qwertyuiop> "
+Done
diff --git a/ext/filter/tests/024.phpt b/ext/filter/tests/024.phpt
new file mode 100644
index 000000000..bc2cdb400
--- /dev/null
+++ b/ext/filter/tests/024.phpt
@@ -0,0 +1,18 @@
+--TEST--
+filter_var() and FILTER_SANITIZE_ENCODED
+--FILE--
+<?php
+
+var_dump(filter_var("\"<br>blah</ph>", FILTER_SANITIZE_ENCODED));
+var_dump(filter_var("", FILTER_SANITIZE_ENCODED));
+var_dump(filter_var(" text here ", FILTER_SANITIZE_ENCODED));
+var_dump(filter_var("!@#$%^&*()QWERTYUIOP{ASDFGHJKL:\"ZXCVBNM<>?", FILTER_SANITIZE_ENCODED));
+
+echo "Done\n";
+?>
+--EXPECT--
+string(26) "%22%3Cbr%3Eblah%3C%2Fph%3E"
+string(0) ""
+string(23) "%20%20text%20here%20%20"
+string(74) "%21%40%23%24%25%5E%26%2A%28%29QWERTYUIOP%7BASDFGHJKL%3A%22ZXCVBNM%3C%3E%3F"
+Done
diff --git a/ext/filter/tests/025.phpt b/ext/filter/tests/025.phpt
new file mode 100644
index 000000000..d1e94abf0
--- /dev/null
+++ b/ext/filter/tests/025.phpt
@@ -0,0 +1,24 @@
+--TEST--
+filter_var() and FILTER_SANITIZE_STRING
+--FILE--
+<?php
+
+var_dump(filter_var("", FILTER_SANITIZE_STRING));
+var_dump(filter_var("<>", FILTER_SANITIZE_STRING));
+var_dump(filter_var("<>!@#$%^&*()'\"", FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
+var_dump(filter_var("<>!@#$%^&*()'\"", FILTER_SANITIZE_STRING, FILTER_FLAG_ENCODE_AMP));
+var_dump(filter_var("<>`1234567890", FILTER_SANITIZE_STRING));
+var_dump(filter_var("`123`", FILTER_SANITIZE_STRING));
+var_dump(filter_var(".", FILTER_SANITIZE_STRING));
+
+echo "Done\n";
+?>
+--EXPECT--
+string(0) ""
+string(0) ""
+string(12) "!@#$%^&*()'""
+string(32) "!@#$%^&#38;*()&#38;#39;&#38;#34;"
+string(11) "`1234567890"
+string(5) "`123`"
+string(1) "."
+Done
diff --git a/ext/filter/tests/026.phpt b/ext/filter/tests/026.phpt
new file mode 100644
index 000000000..9d66f1144
--- /dev/null
+++ b/ext/filter/tests/026.phpt
@@ -0,0 +1,30 @@
+--TEST--
+filter_var() and FILTER_SANITIZE_STRIPPED
+--FILE--
+<?php
+
+var_dump(filter_var("<p>Let me <font color=\"#000000\">see</font> you <br /><b>Stripped</b> down to the bone</p>", FILTER_SANITIZE_STRIPPED));
+var_dump(filter_var("!@#$%^&*()><<>+_\"'<br><p /><li />", FILTER_SANITIZE_STRIPPED));
+var_dump(filter_var("", FILTER_SANITIZE_STRIPPED));
+
+var_dump(filter_var("<p>Let me <font color=\"#000000\">see</font> you <br /><b>Stripped</b> down to the bone</p>", FILTER_SANITIZE_STRIPPED, FILTER_FLAG_STRIP_LOW));
+var_dump(filter_var("!@#$%^&*()><<>+_\"'<br><p /><li />", FILTER_SANITIZE_STRIPPED, FILTER_FLAG_STRIP_LOW));
+var_dump(filter_var("", FILTER_SANITIZE_STRIPPED, FILTER_FLAG_STRIP_LOW));
+
+var_dump(filter_var("<p>Let me <font color=\"#000000\">see</font> you <br /><b>Stripped</b> down to the bone</p>", FILTER_SANITIZE_STRIPPED, FILTER_FLAG_STRIP_HIGH));
+var_dump(filter_var("!@#$%^&*()><<>+_\"'<br><p /><li />", FILTER_SANITIZE_STRIPPED, FILTER_FLAG_STRIP_HIGH));
+var_dump(filter_var("", FILTER_SANITIZE_STRIPPED, FILTER_FLAG_STRIP_HIGH));
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(40) "Let me see you Stripped down to the bone"
+string(11) "!@#$%^&*()>"
+string(0) ""
+string(40) "Let me see you Stripped down to the bone"
+string(11) "!@#$%^&*()>"
+string(0) ""
+string(40) "Let me see you Stripped down to the bone"
+string(11) "!@#$%^&*()>"
+string(0) ""
+Done
diff --git a/ext/filter/tests/027.phpt b/ext/filter/tests/027.phpt
new file mode 100644
index 000000000..c187960a0
--- /dev/null
+++ b/ext/filter/tests/027.phpt
@@ -0,0 +1,30 @@
+--TEST--
+filter_var() and FILTER_SANITIZE_ENCODED
+--FILE--
+<?php
+
+var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_ENCODED));
+var_dump(filter_var("<data&sons>", FILTER_SANITIZE_ENCODED));
+var_dump(filter_var("", FILTER_SANITIZE_ENCODED));
+
+var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_LOW));
+var_dump(filter_var("<data&sons>", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_LOW));
+var_dump(filter_var("", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_LOW));
+
+var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_HIGH));
+var_dump(filter_var("<data&sons>", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_HIGH));
+var_dump(filter_var("", FILTER_SANITIZE_ENCODED, FILTER_FLAG_ENCODE_HIGH));
+
+echo "Done\n";
+?>
+--EXPECT--
+string(75) "%3F%3E%3C%21%40%23%24%25%5E%26%2A%28%29%7D%7B%7EQwertyuilfdsasdfgmnbvcxcvbn"
+string(17) "%3Cdata%26sons%3E"
+string(0) ""
+string(75) "%3F%3E%3C%21%40%23%24%25%5E%26%2A%28%29%7D%7B%7EQwertyuilfdsasdfgmnbvcxcvbn"
+string(17) "%3Cdata%26sons%3E"
+string(0) ""
+string(75) "%3F%3E%3C%21%40%23%24%25%5E%26%2A%28%29%7D%7B%7EQwertyuilfdsasdfgmnbvcxcvbn"
+string(17) "%3Cdata%26sons%3E"
+string(0) ""
+Done
diff --git a/ext/filter/tests/028.phpt b/ext/filter/tests/028.phpt
new file mode 100644
index 000000000..4ffb0fd1f
--- /dev/null
+++ b/ext/filter/tests/028.phpt
@@ -0,0 +1,35 @@
+--TEST--
+filter_var() and FILTER_SANITIZE_SPECIAL_CHARS
+--FILE--
+<?php
+
+var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_SPECIAL_CHARS));
+var_dump(filter_var("<data&sons>", FILTER_SANITIZE_SPECIAL_CHARS));
+var_dump(filter_var("", FILTER_SANITIZE_SPECIAL_CHARS));
+
+var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_LOW));
+var_dump(filter_var("<data&sons>", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_LOW));
+var_dump(filter_var("", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_LOW));
+
+var_dump(filter_var("?><!@#$%^&*()}{~Qwertyuilfdsasdfgmnbvcxcvbn", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_HIGH));
+var_dump(filter_var("<data&sons>", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_HIGH));
+var_dump(filter_var("", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_HIGH));
+
+var_dump(filter_var("кириллица", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_HIGH));
+var_dump(filter_var("кириллица", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_LOW));
+
+echo "Done\n";
+?>
+--EXPECT--
+string(55) "?&#62;&#60;!@#$%^&#38;*()}{~Qwertyuilfdsasdfgmnbvcxcvbn"
+string(23) "&#60;data&#38;sons&#62;"
+string(0) ""
+string(55) "?&#62;&#60;!@#$%^&#38;*()}{~Qwertyuilfdsasdfgmnbvcxcvbn"
+string(23) "&#60;data&#38;sons&#62;"
+string(0) ""
+string(55) "?&#62;&#60;!@#$%^&#38;*()}{~Qwertyuilfdsasdfgmnbvcxcvbn"
+string(23) "&#60;data&#38;sons&#62;"
+string(0) ""
+string(108) "&#208;&#186;&#208;&#184;&#209;&#128;&#208;&#184;&#208;&#187;&#208;&#187;&#208;&#184;&#209;&#134;&#208;&#176;"
+string(18) "кириллица"
+Done
diff --git a/ext/filter/tests/029.phpt b/ext/filter/tests/029.phpt
new file mode 100644
index 000000000..d0979f1e3
--- /dev/null
+++ b/ext/filter/tests/029.phpt
@@ -0,0 +1,103 @@
+--TEST--
+filter_var() and FILTER_CALLBACK
+--FILE--
+<?php
+
+/* Simple callback function */
+function test($var) {
+ return strtoupper($var);
+}
+
+var_dump(filter_var("data", FILTER_CALLBACK, array("options"=>"test")));
+var_dump(filter_var("~!@#$%^&*()_QWERTYUIOPASDFGHJKLZXCVBNM<>>?\"}{:", FILTER_CALLBACK, array("options"=>"test")));
+var_dump(filter_var("", FILTER_CALLBACK, array("options"=>"test")));
+var_dump(filter_var("qwe", FILTER_CALLBACK, array("options"=>"no such func")));
+var_dump(filter_var("qwe", FILTER_CALLBACK, array("options"=>"")));
+var_dump(filter_var("qwe", FILTER_CALLBACK));
+
+/* Simple class method callback */
+class test_class {
+ static function test ($var) {
+ return strtolower($var);
+ }
+}
+
+var_dump(filter_var("dAtA", FILTER_CALLBACK, array("options"=>array("test_class", "test"))));
+var_dump(filter_var("~!@#$%^&*()_QWERTYUIOPASDFGHJKLZXCVBNM<>>?\"}{:", FILTER_CALLBACK, array("options"=>array("test_class","test"))));
+var_dump(filter_var("", FILTER_CALLBACK, array("options"=>array("test_class","test"))));
+
+/* empty function without return value */
+function test1($var) {
+}
+
+var_dump(filter_var("data", FILTER_CALLBACK, array("options"=>"test1")));
+var_dump(filter_var("~!@#$%^&*()_QWERTYUIOPASDFGHJKLZXCVBNM<>>?\"}{:", FILTER_CALLBACK, array("options"=>"test1")));
+var_dump(filter_var("", FILTER_CALLBACK, array("options"=>"test1")));
+
+/* attempting to change data by reference */
+function test2(&$var) {
+ $var = 1;
+}
+
+var_dump(filter_var("data", FILTER_CALLBACK, array("options"=>"test2")));
+var_dump(filter_var("~!@#$%^&*()_QWERTYUIOPASDFGHJKLZXCVBNM<>>?\"}{:", FILTER_CALLBACK, array("options"=>"test2")));
+var_dump(filter_var("", FILTER_CALLBACK, array("options"=>"test2")));
+
+/* unsetting data */
+function test3(&$var) {
+ unset($var);
+}
+
+var_dump(filter_var("data", FILTER_CALLBACK, array("options"=>"test3")));
+var_dump(filter_var("~!@#$%^&*()_QWERTYUIOPASDFGHJKLZXCVBNM<>>?\"}{:", FILTER_CALLBACK, array("options"=>"test3")));
+var_dump(filter_var("", FILTER_CALLBACK, array("options"=>"test3")));
+
+/* unset data and return value */
+function test4(&$var) {
+ unset($var);
+ return 1;
+}
+
+var_dump(filter_var("data", FILTER_CALLBACK, array("options"=>"test4")));
+
+/* thrown exception in the callback */
+function test5(&$var) {
+ throw new Exception("test");
+}
+
+try {
+ var_dump(filter_var("data", FILTER_CALLBACK, array("options"=>"test5")));
+} catch (Exception $e) {
+ var_dump($e->getMessage());
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(4) "DATA"
+string(46) "~!@#$%^&*()_QWERTYUIOPASDFGHJKLZXCVBNM<>>?"}{:"
+string(0) ""
+
+Warning: filter_var(): First argument is expected to be a valid callback in %s on line %d
+NULL
+
+Warning: filter_var(): First argument is expected to be a valid callback in %s on line %d
+NULL
+
+Warning: filter_var(): First argument is expected to be a valid callback in %s on line %d
+NULL
+string(4) "data"
+string(46) "~!@#$%^&*()_qwertyuiopasdfghjklzxcvbnm<>>?"}{:"
+string(0) ""
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+int(1)
+string(4) "test"
+Done
diff --git a/ext/filter/tests/030.phpt b/ext/filter/tests/030.phpt
new file mode 100644
index 000000000..97b62b9e2
--- /dev/null
+++ b/ext/filter/tests/030.phpt
@@ -0,0 +1,35 @@
+--TEST--
+filter_var() and IPv6
+--FILE--
+<?php
+$ipv6_test = array(
+ "::127.0.0.1" => true,
+ "FF01::101:127.0.1" => false,
+ "FF01:0:0:0:101:127.0.1.1" => false,
+ "FF01:0:0:0:237:101:127.0.1.1" => true,
+ "FF01::101" => true,
+ "A1080::8:800:200C:417A" => false,
+ "1080::8:Z00:200C:417A" => false,
+ "FF01::101::1" => false,
+ "1080::8:800:200C:417A" => true,
+ "1080:0:0:0:8:800:200C:417A" => true,
+ "2001:ec8:1:1:1:1:1:1" => true,
+ "ffff::FFFF:129.144.52.38" => true,
+ "::ffff:1.2.3.4" => true,
+ "0:0:0:0:0:FFFF:129.144.52.38" => true,
+ "0:0:0:0:0:0:13.1.68.3" => true,
+ "::13.1.68.3" => true,
+ "::FFFF:129.144.52.38" => true
+);
+foreach ($ipv6_test as $ip => $exp) {
+ $out = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
+ $out = (int) ($out === false ? 0 : 1);
+ if ($exp != $out) {
+ echo "$ip failed\n";
+ }
+}
+
+echo "Ok\n";
+?>
+--EXPECT--
+Ok
diff --git a/ext/filter/tests/031.phpt b/ext/filter/tests/031.phpt
new file mode 100644
index 000000000..74883b8b2
--- /dev/null
+++ b/ext/filter/tests/031.phpt
@@ -0,0 +1,54 @@
+--TEST--
+filter_var() and FLOAT
+--FILE--
+<?php
+
+$floats = array(
+'1.234 ',
+' 1.234',
+'1.234' ,
+'1.2e3',
+'7E3',
+'7E3 ',
+' 7E3 ',
+' 7E-3 '
+);
+
+foreach ($floats as $float) {
+ $out = filter_var($float, FILTER_VALIDATE_FLOAT);
+ var_dump($out);
+}
+
+$floats = array(
+'1.234 ' => ',',
+'1,234' => ',',
+' 1.234' => '.',
+'1.234' => '..',
+'1.2e3' => ','
+);
+
+echo "\ncustom decimal:\n";
+foreach ($floats as $float => $dec) {
+ $out = filter_var($float, FILTER_VALIDATE_FLOAT, array("options"=>array('decimal' => $dec)));
+ var_dump($out);
+}
+
+?>
+--EXPECTF--
+float(1.234)
+float(1.234)
+float(1.234)
+float(1200)
+float(7000)
+float(7000)
+float(7000)
+float(0.007)
+
+custom decimal:
+bool(false)
+float(1.234)
+float(1.234)
+
+Warning: filter_var(): decimal separator must be one char in %s on line %d
+bool(false)
+bool(false)
diff --git a/ext/filter/tests/032.phpt b/ext/filter/tests/032.phpt
new file mode 100644
index 000000000..cc6abd4f0
--- /dev/null
+++ b/ext/filter/tests/032.phpt
@@ -0,0 +1,55 @@
+--TEST--
+input_get_args()
+--FILE--
+<?php
+$data = array(
+ 'product_id' => 'libgd<script>',
+ 'component' => '10dhsajkkdhk <do>',
+ 'versions' => '2.0.33',
+ 'testscalar' => array('2','23','10','12'),
+ 'testarray' => '2',
+);
+
+$args = array(
+ 'product_id' => FILTER_SANITIZE_ENCODED,
+ 'component' => array(//'filter' => FILTER_VALIDATE_INT,
+ 'flags' => FILTER_FORCE_ARRAY,
+ 'options' => array("min_range"=>1, "max_range"=>10)
+ ),
+ 'versions' => array(
+ 'filter' => FILTER_SANITIZE_ENCODED,
+ 'flags' => FILTER_REQUIRE_SCALAR,
+ ),
+ 'doesnotexist' => FILTER_VALIDATE_INT,
+ 'testscalar' => FILTER_VALIDATE_INT,
+ 'testarray' => array(
+ 'filter' => FILTER_VALIDATE_INT,
+ 'flags' => FILTER_FORCE_ARRAY,
+ )
+
+);
+
+$myinputs = filter_var_array($data, $args);
+var_dump($myinputs);
+?>
+--EXPECT--
+array(6) {
+ ["product_id"]=>
+ string(17) "libgd%3Cscript%3E"
+ ["component"]=>
+ array(1) {
+ [0]=>
+ string(17) "10dhsajkkdhk <do>"
+ }
+ ["versions"]=>
+ string(6) "2.0.33"
+ ["doesnotexist"]=>
+ NULL
+ ["testscalar"]=>
+ bool(false)
+ ["testarray"]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+}
diff --git a/ext/filter/tests/033.phpt b/ext/filter/tests/033.phpt
new file mode 100644
index 000000000..2a679d50c
--- /dev/null
+++ b/ext/filter/tests/033.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Test all filters returned by filter_list()
+--FILE--
+<?php
+include dirname(__FILE__) . '/033_run.inc';
+?>
+--EXPECT--
+int 1 123
+boolean 1
+float 1 123
+validate_regexp O'Henry
+validate_url PHP 1 foo@bar.com http://a.b.c 1.2.3.4 123 123abc<>() O'Henry 하í¼
+validate_email foo@bar.com
+validate_ip 1.2.3.4
+string PHP 1 foo@bar.com http://a.b.c 1.2.3.4 123 123abc() O&#39;Henry 하í¼
+stripped PHP 1 foo@bar.com http://a.b.c 1.2.3.4 123 123abc() O&#39;Henry 하í¼
+encoded PHP 1 foo%40bar.com http%3A%2F%2Fa.b.c 1.2.3.4 123 123abc%3C%3E%28%29 O%27Henry %ED%95%98%ED%8D%BC
+special_chars PHP 1 foo@bar.com http://a.b.c 1.2.3.4 123 123abc&#60;&#62;() O&#39;Henry 하í¼
+unsafe_raw PHP 1 foo@bar.com http://a.b.c 1.2.3.4 123 123abc<>() O'Henry 하í¼
+email PHP 1 foo@bar.com http//a.b.c 1.2.3.4 123 123abc O'Henry
+url PHP 1 foo@bar.com http://a.b.c 1.2.3.4 123 123abc<>() O'Henry
+number_int 1 1234 123 123
+number_float 1 1234 123 123
+magic_quotes PHP 1 foo@bar.com http://a.b.c 1.2.3.4 123 123abc<>() O\'Henry 하í¼
+callback PHP 1 FOO@BAR.COM HTTP://A.B.C 1.2.3.4 123 123ABC<>() O'HENRY 하í¼
diff --git a/ext/filter/tests/033_run.inc b/ext/filter/tests/033_run.inc
new file mode 100644
index 000000000..c77d888ac
--- /dev/null
+++ b/ext/filter/tests/033_run.inc
@@ -0,0 +1,35 @@
+<?php
+function test($data) {
+ return strtoupper($data);
+}
+$data = array(
+ "PHP",
+ "1",
+ "foo@bar.com",
+ "http://a.b.c",
+ "1.2.3.4",
+ "123",
+ "123abc<>()",
+ "O'Henry",
+ "하í¼"
+);
+
+
+foreach(filter_list() as $filter) {
+ if($filter=="validate_regexp") {
+ foreach($data as $k=>$d) $result[$k] = filter_var($d,filter_id($filter),array("options"=>array("regexp"=>'/^O.*/')));
+ } else {
+ foreach($data as $k=>$d) $result[$k] = filter_var($d,filter_id($filter),array("options"=>"test"));
+ }
+ printf("%-20s",$filter);
+ printf("%-5s",$result[0]);
+ printf("%-3s",$result[1]);
+ printf("%-15s",$result[2]);
+ printf("%-20s",$result[3]);
+ printf("%-10s",$result[4]);
+ printf("%-5s",$result[5]);
+ printf("%-20s",$result[6]);
+ printf("%-15s",$result[7]);
+ printf("%-10s\n",$result[8]);
+}
+?>
diff --git a/ext/filter/tests/034.phpt b/ext/filter/tests/034.phpt
new file mode 100644
index 000000000..f96596d7c
--- /dev/null
+++ b/ext/filter/tests/034.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Logical filter: boolean
+--FILE--
+<?php
+$booleans = array(
+'1' => true,
+'On' => true,
+'Off' => true,
+'True' => true,
+'TrUe' => true,
+'oN' => true,
+
+'0' => false,
+'Off' => false,
+'False' => false,
+'faLsE' => false,
+'oFf' => false,
+
+'' => false
+);
+
+foreach($booleans as $val=>$exp) {
+ $res =filter_var($val, FILTER_VALIDATE_BOOLEAN);
+ if ($res !== $exp) {
+ echo "$val failed,'$exp' expect, '$res' received.\n";
+ }
+}
+echo "Ok.";
+?>
+--EXPECTF--
+Ok.
diff --git a/ext/filter/tests/035.phpt b/ext/filter/tests/035.phpt
new file mode 100644
index 000000000..e85444322
--- /dev/null
+++ b/ext/filter/tests/035.phpt
@@ -0,0 +1,36 @@
+--TEST--
+GET/POST/REQUEST Test with input_filter
+--POST--
+d=379
+--GET--
+ar[elm1]=1234&ar[elm2]=0660&a=0234
+--FILE--
+<?php
+$ret = filter_input(INPUT_GET, 'a', FILTER_VALIDATE_INT);
+var_dump($ret);
+
+$ret = filter_input(INPUT_GET, 'a', FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL));
+var_dump($ret);
+
+$ret = filter_input(INPUT_GET, 'ar', FILTER_VALIDATE_INT, array('flags'=>FILTER_REQUIRE_ARRAY));
+var_dump($ret);
+
+$ret = filter_input(INPUT_GET, 'ar', FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_REQUIRE_ARRAY));
+var_dump($ret);
+
+?>
+--EXPECT--
+bool(false)
+int(156)
+array(2) {
+ ["elm1"]=>
+ int(1234)
+ ["elm2"]=>
+ bool(false)
+}
+array(2) {
+ ["elm1"]=>
+ int(1234)
+ ["elm2"]=>
+ int(432)
+}
diff --git a/ext/filter/tests/036.phpt b/ext/filter/tests/036.phpt
new file mode 100644
index 000000000..954326661
--- /dev/null
+++ b/ext/filter/tests/036.phpt
@@ -0,0 +1,39 @@
+--TEST--
+input_get_args() and references
+--SKIPIF--
+<?php if (!extension_loaded("filter")) print "skip"; ?>
+--FILE--
+<?php
+
+$var = "1";
+
+$data = array();
+$data["test1"] = 1;
+$data["test2"] = &$var;
+
+$args = array();
+$args["test1"] = FILTER_VALIDATE_INT;
+$args["test2"] = FILTER_VALIDATE_INT;
+
+$ret = filter_var_array($data, $args);
+var_dump($ret);
+var_dump($data); //should be separated, i.e. not reference anymore. looks like we can't change this, or it'd change the original zval instead..
+var_dump($var); //should be still string(1) "1"
+
+echo "Done\n";
+?>
+--EXPECTF--
+array(2) {
+ ["test1"]=>
+ int(1)
+ ["test2"]=>
+ int(1)
+}
+array(2) {
+ ["test1"]=>
+ int(1)
+ ["test2"]=>
+ &string(1) "1"
+}
+string(1) "1"
+Done
diff --git a/ext/filter/tests/037.phpt b/ext/filter/tests/037.phpt
new file mode 100644
index 000000000..9e91288cb
--- /dev/null
+++ b/ext/filter/tests/037.phpt
@@ -0,0 +1,39 @@
+--TEST--
+GET and data callback tests
+--GET--
+a=1&b=2
+--FILE--
+<?php
+function myfunc($val) {
+ return $val . '_callback';
+}
+echo filter_input(INPUT_GET, 'a', FILTER_CALLBACK, array("options"=>'myfunc'));
+echo "\n";
+echo filter_input(INPUT_GET, 'b', FILTER_VALIDATE_INT);
+echo "\n";
+$data = "data";
+
+echo filter_var($data, FILTER_CALLBACK, array("options"=>'myfunc'));
+echo "\n";
+
+$res = filter_input_array(INPUT_GET, array(
+ 'a' => array(
+ 'filter' => FILTER_CALLBACK,
+ 'options' => 'myfunc'
+ ),
+ 'b' => FILTER_VALIDATE_INT
+ )
+ );
+
+var_dump($res);
+?>
+--EXPECT--
+1_callback
+2
+data_callback
+array(2) {
+ ["a"]=>
+ string(10) "1_callback"
+ ["b"]=>
+ int(2)
+}
diff --git a/ext/filter/tests/038.phpt b/ext/filter/tests/038.phpt
new file mode 100644
index 000000000..d74e5f27e
--- /dev/null
+++ b/ext/filter/tests/038.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Test scalar, array
+--FILE--
+<?php
+
+$var = 12;
+$res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL));
+var_dump($res);
+
+$var = array(12);
+$res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL));
+var_dump($res);
+
+$var = 12;
+$res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_FORCE_ARRAY));
+var_dump($res);
+
+
+
+$var = 12;
+$res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_REQUIRE_ARRAY));
+var_dump($res);
+
+$var = array(12);
+$res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_REQUIRE_ARRAY));
+var_dump($res);
+
+$var = array(12);
+$res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_FORCE_ARRAY|FILTER_REQUIRE_ARRAY));
+var_dump($res);
+
+$var = array(12);
+$res = filter_var($var, FILTER_VALIDATE_INT, array('flags'=>FILTER_FLAG_ALLOW_OCTAL|FILTER_FORCE_ARRAY));
+var_dump($res);
+
+?>
+--EXPECT--
+int(12)
+bool(false)
+array(1) {
+ [0]=>
+ int(12)
+}
+bool(false)
+array(1) {
+ [0]=>
+ int(12)
+}
+array(1) {
+ [0]=>
+ int(12)
+}
+array(1) {
+ [0]=>
+ int(12)
+}
diff --git a/ext/filter/tests/bug7586.phpt b/ext/filter/tests/bug7586.phpt
new file mode 100644
index 000000000..d9ea723f4
--- /dev/null
+++ b/ext/filter/tests/bug7586.phpt
@@ -0,0 +1,53 @@
+--TEST--
+input_get_args() filter not reseted between elements
+--FILE--
+<?php
+$data = array(
+ 'product_id' => 'libgd<script>',
+ 'component' => '10dhsajkkdhk <do>',
+ 'versions' => '2.0.33',
+ 'testscalar' => array('2','23','10','12'),
+ 'testarray' => '2',
+);
+
+$args = array(
+ 'product_id' => FILTER_SANITIZE_ENCODED,
+ 'component' => array('flags' => FILTER_FORCE_ARRAY,
+ 'options' => array("min_range"=>1, "max_range"=>10)
+ ),
+ 'versions' => array(
+ 'filter' => FILTER_SANITIZE_ENCODED,
+ 'flags' => FILTER_REQUIRE_SCALAR,
+ ),
+ 'doesnotexist' => FILTER_VALIDATE_INT,
+ 'testscalar' => FILTER_VALIDATE_INT,
+ 'testarray' => array(
+ 'filter' => FILTER_VALIDATE_INT,
+ 'flags' => FILTER_FORCE_ARRAY,
+ )
+
+);
+$out = filter_var_array($data, $args);
+var_dump($out);
+?>
+--EXPECTF--
+array(6) {
+ ["product_id"]=>
+ string(17) "libgd%3Cscript%3E"
+ ["component"]=>
+ array(1) {
+ [0]=>
+ string(17) "%s"
+ }
+ ["versions"]=>
+ string(6) "2.0.33"
+ ["doesnotexist"]=>
+ NULL
+ ["testscalar"]=>
+ bool(false)
+ ["testarray"]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+}
diff --git a/ext/filter/tests/bug7715.phpt b/ext/filter/tests/bug7715.phpt
new file mode 100644
index 000000000..3372f756d
--- /dev/null
+++ b/ext/filter/tests/bug7715.phpt
@@ -0,0 +1,29 @@
+--TEST--
+bug 7715, floats value with integer or incomplete input
+--FILE--
+<?php
+$data = array(
+ '.23',
+ '-42',
+ '+42',
+ '.4',
+ '-.4',
+ '1000000000000',
+ '-1000000000000',
+ '02.324'
+);
+foreach ($data as $val) {
+ $res = filter_var($val, FILTER_VALIDATE_FLOAT);
+ var_dump($res);
+}
+echo "\n";
+?>
+--EXPECTF--
+float(0.23)
+float(-42)
+float(42)
+float(0.4)
+float(-0.4)
+float(1.0E+12)
+float(-1.0E+12)
+float(2.324)
diff --git a/ext/filter/tests/bug7733.phpt b/ext/filter/tests/bug7733.phpt
new file mode 100644
index 000000000..07b4b0c72
--- /dev/null
+++ b/ext/filter/tests/bug7733.phpt
@@ -0,0 +1,27 @@
+--TEST--
+filter_data() Float exponential weird result
+--FILE--
+<?php
+$data = array(
+ 'E2',
+ '10E',
+ '2E-',
+ 'E-2',
+ '+E2'
+ );
+$out = filter_var($data, FILTER_VALIDATE_FLOAT, FILTER_REQUIRE_ARRAY);
+var_dump($out);
+?>
+--EXPECTF--
+array(5) {
+ [0]=>
+ float(0)
+ [1]=>
+ float(10)
+ [2]=>
+ float(2)
+ [3]=>
+ float(0)
+ [4]=>
+ float(0)
+}
diff --git a/ext/filter/tests/bug8315.phpt b/ext/filter/tests/bug8315.phpt
new file mode 100644
index 000000000..ab1a0937e
--- /dev/null
+++ b/ext/filter/tests/bug8315.phpt
@@ -0,0 +1,13 @@
+--TEST--
+bug 8315, NULL values halt the validation
+--FILE--
+<?php
+
+$var="3".chr(0)."foo";
+var_dump(filter_var($var, FILTER_VALIDATE_INT));
+$var="3".chr(0)."foo";
+var_dump(filter_var($var, FILTER_VALIDATE_FLOAT));
+?>
+--EXPECT--
+bool(false)
+bool(false)
diff --git a/ext/filter/tests/filter_data.phpt b/ext/filter/tests/filter_data.phpt
new file mode 100644
index 000000000..14e8545c9
--- /dev/null
+++ b/ext/filter/tests/filter_data.phpt
@@ -0,0 +1,71 @@
+--TEST--
+Simple filter_var() tests
+--FILE--
+<?php
+
+/* Integer */
+$data = "-123"; var_dump(filter_var($data, FILTER_VALIDATE_INT));
+$data = "0"; var_dump(filter_var($data, FILTER_VALIDATE_INT));
+$data = "123"; var_dump(filter_var($data, FILTER_VALIDATE_INT));
+$data = -123; var_dump(filter_var($data, FILTER_VALIDATE_INT));
+$data = 0; var_dump(filter_var($data, FILTER_VALIDATE_INT));
+$data = 123; var_dump(filter_var($data, FILTER_VALIDATE_INT));
+$data = ""; var_dump(filter_var($data, FILTER_VALIDATE_INT));
+echo "\n";
+
+/* Float */
+$data = "-0.123"; var_dump(filter_var($data, FILTER_VALIDATE_FLOAT));
+$data = "0.00"; var_dump(filter_var($data, FILTER_VALIDATE_FLOAT));
+$data = "1.23"; var_dump(filter_var($data, FILTER_VALIDATE_FLOAT));
+$data = -1.23; var_dump(filter_var($data, FILTER_VALIDATE_FLOAT));
+$data = 0.0; var_dump(filter_var($data, FILTER_VALIDATE_FLOAT));
+$data = 1.23; var_dump(filter_var($data, FILTER_VALIDATE_FLOAT));
+$data = ""; var_dump(filter_var($data, FILTER_VALIDATE_FLOAT));
+echo "\n";
+
+/* Boolean */
+$data = "on"; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+$data = "off"; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+$data = "yes"; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+$data = "no"; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+$data = "true"; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+$data = "false"; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+$data = "1"; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+$data = "0"; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+$data = 1; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+$data = 0; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+$data = true; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+$data = false; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+$data = ""; var_dump(filter_var($data, FILTER_VALIDATE_BOOLEAN));
+
+?>
+--EXPECT--
+int(-123)
+int(0)
+int(123)
+int(-123)
+int(0)
+int(123)
+bool(false)
+
+float(-0.123)
+float(0)
+float(1.23)
+float(-1.23)
+float(0)
+float(1.23)
+bool(false)
+
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(false)
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index 2bedefc8c..9274abe88 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ftp.c,v 1.103.2.2 2006/01/01 12:50:06 sniper Exp $ */
+/* $Id: php_ftp.c,v 1.103.2.2.2.1 2006/06/11 20:03:05 bjori Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -44,50 +44,273 @@
static int le_ftpbuf;
#define le_ftpbuf_name "FTP Buffer"
+/* {{{ arginfo */
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()
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_connect, 0, 0, 1)
+ ZEND_ARG_INFO(0, host)
+ ZEND_ARG_INFO(0, port)
+ ZEND_ARG_INFO(0, timeout)
+ZEND_END_ARG_INFO()
+
+#if HAVE_OPENSSL_EXT
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_ssl_connect, 0, 0, 1)
+ ZEND_ARG_INFO(0, host)
+ ZEND_ARG_INFO(0, port)
+ ZEND_ARG_INFO(0, timeout)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_login, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, username)
+ ZEND_ARG_INFO(0, password)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_pwd, 0)
+ ZEND_ARG_INFO(0, ftp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_cdup, 0)
+ ZEND_ARG_INFO(0, ftp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_chdir, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, directory)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_exec, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, command)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_raw, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, command)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_mkdir, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, directory)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_rmdir, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, directory)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_chmod, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_alloc, 0, 0, 2)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, size)
+ ZEND_ARG_INFO(1, response)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_nlist, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, directory)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_rawlist, 0, 0, 2)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, directory)
+ ZEND_ARG_INFO(0, recursive)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_systype, 0)
+ ZEND_ARG_INFO(0, ftp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_fget, 0, 0, 4)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, remote_file)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, resumepos)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_fget, 0, 0, 4)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, remote_file)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, resumepos)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_pasv, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, pasv)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_get, 0, 0, 4)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, local_file)
+ ZEND_ARG_INFO(0, remote_file)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, resume_pos)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_get, 0, 0, 4)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, local_file)
+ ZEND_ARG_INFO(0, remote_file)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, resume_pos)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_nb_continue, 0)
+ ZEND_ARG_INFO(0, ftp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_fput, 0, 0, 4)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, remote_file)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, startpos)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_fput, 0, 0, 4)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, remote_file)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, startpos)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_put, 0, 0, 4)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, remote_file)
+ ZEND_ARG_INFO(0, local_file)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, startpos)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_put, 0, 0, 4)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, remote_file)
+ ZEND_ARG_INFO(0, local_file)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, startpos)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_size, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_mdtm, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_rename, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, src)
+ ZEND_ARG_INFO(0, dest)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_delete, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, file)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_site, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, cmd)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_close, 0)
+ ZEND_ARG_INFO(0, ftp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_set_option, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, option)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftp_get_option, 0)
+ ZEND_ARG_INFO(0, ftp)
+ ZEND_ARG_INFO(0, option)
+ZEND_END_ARG_INFO()
+
+/* }}} */
zend_function_entry php_ftp_functions[] = {
- PHP_FE(ftp_connect, NULL)
+ PHP_FE(ftp_connect, arginfo_ftp_connect)
#if HAVE_OPENSSL_EXT
- PHP_FE(ftp_ssl_connect, NULL)
+ PHP_FE(ftp_ssl_connect, arginfo_ftp_ssl_connect)
#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)
+ PHP_FE(ftp_login, arginfo_ftp_login)
+ PHP_FE(ftp_pwd, arginfo_ftp_pwd)
+ PHP_FE(ftp_cdup, arginfo_ftp_cdup)
+ PHP_FE(ftp_chdir, arginfo_ftp_chdir)
+ PHP_FE(ftp_exec, arginfo_ftp_exec)
+ PHP_FE(ftp_raw, arginfo_ftp_raw)
+ PHP_FE(ftp_mkdir, arginfo_ftp_mkdir)
+ PHP_FE(ftp_rmdir, arginfo_ftp_rmdir)
+ PHP_FE(ftp_chmod, arginfo_ftp_chmod)
+ PHP_FE(ftp_alloc, arginfo_ftp_alloc)
+ PHP_FE(ftp_nlist, arginfo_ftp_nlist)
+ PHP_FE(ftp_rawlist, arginfo_ftp_rawlist)
+ PHP_FE(ftp_systype, arginfo_ftp_systype)
+ PHP_FE(ftp_pasv, arginfo_ftp_pasv)
+ PHP_FE(ftp_get, arginfo_ftp_get)
+ PHP_FE(ftp_fget, arginfo_ftp_fget)
+ PHP_FE(ftp_put, arginfo_ftp_put)
+ PHP_FE(ftp_fput, arginfo_ftp_fput)
+ PHP_FE(ftp_size, arginfo_ftp_size)
+ PHP_FE(ftp_mdtm, arginfo_ftp_mdtm)
+ PHP_FE(ftp_rename, arginfo_ftp_rename)
+ PHP_FE(ftp_delete, arginfo_ftp_delete)
+ PHP_FE(ftp_site, arginfo_ftp_site)
+ PHP_FE(ftp_close, arginfo_ftp_close)
+ PHP_FE(ftp_set_option, arginfo_ftp_set_option)
+ PHP_FE(ftp_get_option, arginfo_ftp_get_option)
+ PHP_FE(ftp_nb_fget, arginfo_ftp_nb_fget)
+ PHP_FE(ftp_nb_get, arginfo_ftp_nb_get)
+ PHP_FE(ftp_nb_continue, arginfo_ftp_nb_continue)
+ PHP_FE(ftp_nb_put, arginfo_ftp_nb_put)
+ PHP_FE(ftp_nb_fput, arginfo_ftp_nb_fput)
+ PHP_FALIAS(ftp_quit, ftp_close, arginfo_ftp_close)
{NULL, NULL, NULL}
};
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 398832392..7fa66d014 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.312.2.20 2006/03/10 18:07:27 pajoye Exp $ */
+/* $Id: gd.c,v 1.312.2.20.2.8 2006/10/18 16:04:37 bjori Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -167,170 +167,975 @@ 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);
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gd_info, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imageloadfont, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagesetstyle, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, styles) /* ARRAY_INFO(0, styles, 0) */
+ZEND_END_ARG_INFO()
+
+#if HAVE_LIBGD20
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecreatetruecolor, 0)
+ ZEND_ARG_INFO(0, x_size)
+ ZEND_ARG_INFO(0, y_size)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imageistruecolor, 0)
+ ZEND_ARG_INFO(0, im)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagetruecolortopalette, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, ditherFlag)
+ ZEND_ARG_INFO(0, colorsWanted)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_GD_BUNDLED
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolormatch, 0)
+ ZEND_ARG_INFO(0, im1)
+ ZEND_ARG_INFO(0, im2)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_LIBGD20
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagesetthickness, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, thickness)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagefilledellipse, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, cx)
+ ZEND_ARG_INFO(0, cy)
+ ZEND_ARG_INFO(0, w)
+ ZEND_ARG_INFO(0, h)
+ ZEND_ARG_INFO(0, color)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagefilledarc, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, cx)
+ ZEND_ARG_INFO(0, cy)
+ ZEND_ARG_INFO(0, w)
+ ZEND_ARG_INFO(0, h)
+ ZEND_ARG_INFO(0, s)
+ ZEND_ARG_INFO(0, e)
+ ZEND_ARG_INFO(0, col)
+ ZEND_ARG_INFO(0, style)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagealphablending, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, blend)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagesavealpha, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, save)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_GD_BUNDLED
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagelayereffect, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, effect)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_LIBGD20
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorallocatealpha, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, red)
+ ZEND_ARG_INFO(0, green)
+ ZEND_ARG_INFO(0, blue)
+ ZEND_ARG_INFO(0, alpha)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorresolvealpha, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, red)
+ ZEND_ARG_INFO(0, green)
+ ZEND_ARG_INFO(0, blue)
+ ZEND_ARG_INFO(0, alpha)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorclosestalpha, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, red)
+ ZEND_ARG_INFO(0, green)
+ ZEND_ARG_INFO(0, blue)
+ ZEND_ARG_INFO(0, alpha)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorexactalpha, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, red)
+ ZEND_ARG_INFO(0, green)
+ ZEND_ARG_INFO(0, blue)
+ ZEND_ARG_INFO(0, alpha)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecopyresampled, 0)
+ ZEND_ARG_INFO(0, dst_im)
+ ZEND_ARG_INFO(0, src_im)
+ ZEND_ARG_INFO(0, dst_x)
+ ZEND_ARG_INFO(0, dst_y)
+ ZEND_ARG_INFO(0, src_x)
+ ZEND_ARG_INFO(0, src_y)
+ ZEND_ARG_INFO(0, dst_w)
+ ZEND_ARG_INFO(0, dst_h)
+ ZEND_ARG_INFO(0, src_w)
+ ZEND_ARG_INFO(0, src_h)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_BUNDLED
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagerotate, 0, 0, 3)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, angle)
+ ZEND_ARG_INFO(0, bgdcolor)
+ ZEND_ARG_INFO(0, ignoretransparent)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_GD_IMAGESETTILE
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagesettile, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, tile)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_GD_IMAGESETBRUSH
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagesetbrush, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, brush)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecreate, 0)
+ ZEND_ARG_INFO(0, x_size)
+ ZEND_ARG_INFO(0, y_size)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagetypes, 0)
+ZEND_END_ARG_INFO()
+
+#if HAVE_LIBGD15
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecreatefromstring, 0)
+ ZEND_ARG_INFO(0, image)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_GIF_READ
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecreatefromgif, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_JPG
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecreatefromjpeg, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_PNG
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecreatefrompng, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_XBM
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecreatefromxbm, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+#endif
+
+#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecreatefromxpm, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_WBMP
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecreatefromwbmp, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecreatefromgd, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+#ifdef HAVE_GD_GD2
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecreatefromgd2, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecreatefromgd2part, 0)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, srcX)
+ ZEND_ARG_INFO(0, srcY)
+ ZEND_ARG_INFO(0, width)
+ ZEND_ARG_INFO(0, height)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_GD_BUNDLED
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagexbm, 0, 0, 2)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, foreground)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_GIF_CREATE
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagegif, 0, 0, 1)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_PNG
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagepng, 0, 0, 1)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_JPG
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagejpeg, 0, 0, 1)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, quality)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_WBMP
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagewbmp, 0, 0, 1)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, foreground)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagegd, 0, 0, 1)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+#ifdef HAVE_GD_GD2
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagegd2, 0, 0, 1)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, chunk_size)
+ ZEND_ARG_INFO(0, type)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagedestroy, 0)
+ ZEND_ARG_INFO(0, im)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorallocate, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, red)
+ ZEND_ARG_INFO(0, green)
+ ZEND_ARG_INFO(0, blue)
+ZEND_END_ARG_INFO()
+
+#if HAVE_LIBGD15
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagepalettecopy, 0)
+ ZEND_ARG_INFO(0, dst)
+ ZEND_ARG_INFO(0, src)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorat, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorclosest, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, red)
+ ZEND_ARG_INFO(0, green)
+ ZEND_ARG_INFO(0, blue)
+ZEND_END_ARG_INFO()
+
+#if HAVE_COLORCLOSESTHWB
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorclosesthwb, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, red)
+ ZEND_ARG_INFO(0, green)
+ ZEND_ARG_INFO(0, blue)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolordeallocate, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorresolve, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, red)
+ ZEND_ARG_INFO(0, green)
+ ZEND_ARG_INFO(0, blue)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorexact, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, red)
+ ZEND_ARG_INFO(0, green)
+ ZEND_ARG_INFO(0, blue)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorset, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, color)
+ ZEND_ARG_INFO(0, red)
+ ZEND_ARG_INFO(0, green)
+ ZEND_ARG_INFO(0, blue)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorsforindex, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagegammacorrect, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, inputgamma)
+ ZEND_ARG_INFO(0, outputgamma)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagesetpixel, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imageline, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, x1)
+ ZEND_ARG_INFO(0, y1)
+ ZEND_ARG_INFO(0, x2)
+ ZEND_ARG_INFO(0, y2)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagedashedline, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, x1)
+ ZEND_ARG_INFO(0, y1)
+ ZEND_ARG_INFO(0, x2)
+ ZEND_ARG_INFO(0, y2)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagerectangle, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, x1)
+ ZEND_ARG_INFO(0, y1)
+ ZEND_ARG_INFO(0, x2)
+ ZEND_ARG_INFO(0, y2)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagefilledrectangle, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, x1)
+ ZEND_ARG_INFO(0, y1)
+ ZEND_ARG_INFO(0, x2)
+ ZEND_ARG_INFO(0, y2)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagearc, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, cx)
+ ZEND_ARG_INFO(0, cy)
+ ZEND_ARG_INFO(0, w)
+ ZEND_ARG_INFO(0, h)
+ ZEND_ARG_INFO(0, s)
+ ZEND_ARG_INFO(0, e)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imageellipse, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, cx)
+ ZEND_ARG_INFO(0, cy)
+ ZEND_ARG_INFO(0, w)
+ ZEND_ARG_INFO(0, h)
+ ZEND_ARG_INFO(0, color)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagefilltoborder, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ ZEND_ARG_INFO(0, border)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagefill, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecolorstotal, 0)
+ ZEND_ARG_INFO(0, im)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagecolortransparent, 0, 0, 1)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imageinterlace, 0, 0, 1)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, interlace)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagepolygon, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, points) /* ARRAY_INFO(0, points, 0) */
+ ZEND_ARG_INFO(0, num_pos)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagefilledpolygon, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, points) /* ARRAY_INFO(0, points, 0) */
+ ZEND_ARG_INFO(0, num_pos)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagefontwidth, 0)
+ ZEND_ARG_INFO(0, font)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagefontheight, 0)
+ ZEND_ARG_INFO(0, font)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagechar, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, font)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ ZEND_ARG_INFO(0, c)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecharup, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, font)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ ZEND_ARG_INFO(0, c)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagestring, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, font)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagestringup, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, font)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, col)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecopy, 0)
+ ZEND_ARG_INFO(0, dst_im)
+ ZEND_ARG_INFO(0, src_im)
+ ZEND_ARG_INFO(0, dst_x)
+ ZEND_ARG_INFO(0, dst_y)
+ ZEND_ARG_INFO(0, src_x)
+ ZEND_ARG_INFO(0, src_y)
+ ZEND_ARG_INFO(0, src_w)
+ ZEND_ARG_INFO(0, src_h)
+ZEND_END_ARG_INFO()
+
+#if HAVE_LIBGD15
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecopymerge, 0)
+ ZEND_ARG_INFO(0, src_im)
+ ZEND_ARG_INFO(0, dst_im)
+ ZEND_ARG_INFO(0, dst_x)
+ ZEND_ARG_INFO(0, dst_y)
+ ZEND_ARG_INFO(0, src_x)
+ ZEND_ARG_INFO(0, src_y)
+ ZEND_ARG_INFO(0, src_w)
+ ZEND_ARG_INFO(0, src_h)
+ ZEND_ARG_INFO(0, pct)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecopymergegray, 0)
+ ZEND_ARG_INFO(0, src_im)
+ ZEND_ARG_INFO(0, dst_im)
+ ZEND_ARG_INFO(0, dst_x)
+ ZEND_ARG_INFO(0, dst_y)
+ ZEND_ARG_INFO(0, src_x)
+ ZEND_ARG_INFO(0, src_y)
+ ZEND_ARG_INFO(0, src_w)
+ ZEND_ARG_INFO(0, src_h)
+ ZEND_ARG_INFO(0, pct)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagecopyresized, 0)
+ ZEND_ARG_INFO(0, dst_im)
+ ZEND_ARG_INFO(0, src_im)
+ ZEND_ARG_INFO(0, dst_x)
+ ZEND_ARG_INFO(0, dst_y)
+ ZEND_ARG_INFO(0, src_x)
+ ZEND_ARG_INFO(0, src_y)
+ ZEND_ARG_INFO(0, dst_w)
+ ZEND_ARG_INFO(0, dst_h)
+ ZEND_ARG_INFO(0, src_w)
+ ZEND_ARG_INFO(0, src_h)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagesx, 0)
+ ZEND_ARG_INFO(0, im)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagesy, 0)
+ ZEND_ARG_INFO(0, im)
+ZEND_END_ARG_INFO()
+
+#ifdef ENABLE_GD_TTF
+#if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imageftbbox, 0, 0, 4)
+ ZEND_ARG_INFO(0, size)
+ ZEND_ARG_INFO(0, angle)
+ ZEND_ARG_INFO(0, font_file)
+ ZEND_ARG_INFO(0, text)
+ ZEND_ARG_INFO(0, extrainfo) /* ARRAY_INFO(0, extrainfo, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagefttext, 0, 0, 8)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, size)
+ ZEND_ARG_INFO(0, angle)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ ZEND_ARG_INFO(0, col)
+ ZEND_ARG_INFO(0, font_file)
+ ZEND_ARG_INFO(0, text)
+ ZEND_ARG_INFO(0, extrainfo) /* ARRAY_INFO(0, extrainfo, 0) */
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagettfbbox, 0)
+ ZEND_ARG_INFO(0, size)
+ ZEND_ARG_INFO(0, angle)
+ ZEND_ARG_INFO(0, font_file)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagettftext, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, size)
+ ZEND_ARG_INFO(0, angle)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ ZEND_ARG_INFO(0, col)
+ ZEND_ARG_INFO(0, font_file)
+ ZEND_ARG_INFO(0, text)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_LIBT1
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagepsloadfont, 0)
+ ZEND_ARG_INFO(0, pathname)
+ZEND_END_ARG_INFO()
+
+/*
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagepscopyfont, 0)
+ ZEND_ARG_INFO(0, font_index)
+ZEND_END_ARG_INFO()
+*/
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagepsfreefont, 0)
+ ZEND_ARG_INFO(0, font_index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagepsencodefont, 0)
+ ZEND_ARG_INFO(0, font_index)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagepsextendfont, 0)
+ ZEND_ARG_INFO(0, font_index)
+ ZEND_ARG_INFO(0, extend)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imagepsslantfont, 0)
+ ZEND_ARG_INFO(0, font_index)
+ ZEND_ARG_INFO(0, slant)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagepstext, 0, 0, 8)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, text)
+ ZEND_ARG_INFO(0, font)
+ ZEND_ARG_INFO(0, size)
+ ZEND_ARG_INFO(0, foreground)
+ ZEND_ARG_INFO(0, background)
+ ZEND_ARG_INFO(0, xcoord)
+ ZEND_ARG_INFO(0, ycoord)
+ ZEND_ARG_INFO(0, space)
+ ZEND_ARG_INFO(0, tightness)
+ ZEND_ARG_INFO(0, angle)
+ ZEND_ARG_INFO(0, antialias)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagepsbbox, 0, 0, 3)
+ ZEND_ARG_INFO(0, text)
+ ZEND_ARG_INFO(0, font)
+ ZEND_ARG_INFO(0, size)
+ ZEND_ARG_INFO(0, space)
+ ZEND_ARG_INFO(0, tightness)
+ ZEND_ARG_INFO(0, angle)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_WBMP
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_image2wbmp, 0, 0, 1)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, threshold)
+ZEND_END_ARG_INFO()
+#endif
+
+#if defined(HAVE_GD_JPG) && defined(HAVE_GD_WBMP)
+static
+ZEND_BEGIN_ARG_INFO(arginfo_jpeg2wbmp, 0)
+ ZEND_ARG_INFO(0, f_org)
+ ZEND_ARG_INFO(0, f_dest)
+ ZEND_ARG_INFO(0, d_height)
+ ZEND_ARG_INFO(0, d_width)
+ ZEND_ARG_INFO(0, d_threshold)
+ZEND_END_ARG_INFO()
+#endif
+
+#if defined(HAVE_GD_PNG) && defined(HAVE_GD_WBMP)
+static
+ZEND_BEGIN_ARG_INFO(arginfo_png2wbmp, 0)
+ ZEND_ARG_INFO(0, f_org)
+ ZEND_ARG_INFO(0, f_dest)
+ ZEND_ARG_INFO(0, d_height)
+ ZEND_ARG_INFO(0, d_width)
+ ZEND_ARG_INFO(0, d_threshold)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_BUNDLED
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imagefilter, 0, 0, 2)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, filtertype)
+ ZEND_ARG_INFO(0, arg1)
+ ZEND_ARG_INFO(0, arg2)
+ ZEND_ARG_INFO(0, arg3)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imageconvolution, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, matrix3x3) /* ARRAY_INFO(0, matrix3x3, 0) */
+ ZEND_ARG_INFO(0, div)
+ ZEND_ARG_INFO(0, offset)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GD_BUNDLED
+static
+ZEND_BEGIN_ARG_INFO(arginfo_imageantialias, 0)
+ ZEND_ARG_INFO(0, im)
+ ZEND_ARG_INFO(0, on)
+ZEND_END_ARG_INFO()
+#endif
+
+/* }}} */
+
/* {{{ gd_functions[]
*/
zend_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)
+ PHP_FE(gd_info, arginfo_gd_info)
+ PHP_FE(imagearc, arginfo_imagearc)
+ PHP_FE(imageellipse, arginfo_imageellipse)
+ PHP_FE(imagechar, arginfo_imagechar)
+ PHP_FE(imagecharup, arginfo_imagecharup)
+ PHP_FE(imagecolorat, arginfo_imagecolorat)
+ PHP_FE(imagecolorallocate, arginfo_imagecolorallocate)
#if HAVE_LIBGD15
- PHP_FE(imagepalettecopy, NULL)
- PHP_FE(imagecreatefromstring, NULL)
+ PHP_FE(imagepalettecopy, arginfo_imagepalettecopy)
+ PHP_FE(imagecreatefromstring, arginfo_imagecreatefromstring)
#endif
- PHP_FE(imagecolorclosest, NULL)
+ PHP_FE(imagecolorclosest, arginfo_imagecolorclosest)
#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)
+ PHP_FE(imagecolorclosesthwb, arginfo_imagecolorclosesthwb)
+#endif
+ PHP_FE(imagecolordeallocate, arginfo_imagecolordeallocate)
+ PHP_FE(imagecolorresolve, arginfo_imagecolorresolve)
+ PHP_FE(imagecolorexact, arginfo_imagecolorexact)
+ PHP_FE(imagecolorset, arginfo_imagecolorset)
+ PHP_FE(imagecolortransparent, arginfo_imagecolortransparent)
+ PHP_FE(imagecolorstotal, arginfo_imagecolorstotal)
+ PHP_FE(imagecolorsforindex, arginfo_imagecolorsforindex)
+ PHP_FE(imagecopy, arginfo_imagecopy)
#if HAVE_LIBGD15
- PHP_FE(imagecopymerge, NULL)
- PHP_FE(imagecopymergegray, NULL)
+ PHP_FE(imagecopymerge, arginfo_imagecopymerge)
+ PHP_FE(imagecopymergegray, arginfo_imagecopymergegray)
#endif
- PHP_FE(imagecopyresized, NULL)
- PHP_FE(imagecreate, NULL)
+ PHP_FE(imagecopyresized, arginfo_imagecopyresized)
+ PHP_FE(imagecreate, arginfo_imagecreate)
#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)
+ PHP_FE(imagecreatetruecolor, arginfo_imagecreatetruecolor)
+ PHP_FE(imageistruecolor, arginfo_imageistruecolor)
+ PHP_FE(imagetruecolortopalette, arginfo_imagetruecolortopalette)
+ PHP_FE(imagesetthickness, arginfo_imagesetthickness)
+ PHP_FE(imagefilledarc, arginfo_imagefilledarc)
+ PHP_FE(imagefilledellipse, arginfo_imagefilledellipse)
+ PHP_FE(imagealphablending, arginfo_imagealphablending)
+ PHP_FE(imagesavealpha, arginfo_imagesavealpha)
+ PHP_FE(imagecolorallocatealpha, arginfo_imagecolorallocatealpha)
+ PHP_FE(imagecolorresolvealpha, arginfo_imagecolorresolvealpha)
+ PHP_FE(imagecolorclosestalpha, arginfo_imagecolorclosestalpha)
+ PHP_FE(imagecolorexactalpha, arginfo_imagecolorexactalpha)
+ PHP_FE(imagecopyresampled, arginfo_imagecopyresampled)
#endif
#ifdef HAVE_GD_BUNDLED
- PHP_FE(imagerotate, NULL)
- PHP_FE(imageantialias, NULL)
+ PHP_FE(imagerotate, arginfo_imagerotate)
+ PHP_FE(imageantialias, arginfo_imageantialias)
#endif
#if HAVE_GD_IMAGESETTILE
- PHP_FE(imagesettile, NULL)
+ PHP_FE(imagesettile, arginfo_imagesettile)
#endif
#if HAVE_GD_IMAGESETBRUSH
- PHP_FE(imagesetbrush, NULL)
+ PHP_FE(imagesetbrush, arginfo_imagesetbrush)
#endif
- PHP_FE(imagesetstyle, NULL)
+ PHP_FE(imagesetstyle, arginfo_imagesetstyle)
#ifdef HAVE_GD_PNG
- PHP_FE(imagecreatefrompng, NULL)
+ PHP_FE(imagecreatefrompng, arginfo_imagecreatefrompng)
#endif
#ifdef HAVE_GD_GIF_READ
- PHP_FE(imagecreatefromgif, NULL)
+ PHP_FE(imagecreatefromgif, arginfo_imagecreatefromgif)
#endif
#ifdef HAVE_GD_JPG
- PHP_FE(imagecreatefromjpeg, NULL)
+ PHP_FE(imagecreatefromjpeg, arginfo_imagecreatefromjpeg)
#endif
#ifdef HAVE_GD_WBMP
- PHP_FE(imagecreatefromwbmp, NULL)
+ PHP_FE(imagecreatefromwbmp, arginfo_imagecreatefromwbmp)
#endif
#ifdef HAVE_GD_XBM
- PHP_FE(imagecreatefromxbm, NULL)
+ PHP_FE(imagecreatefromxbm, arginfo_imagecreatefromxbm)
#endif
#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
- PHP_FE(imagecreatefromxpm, NULL)
+ PHP_FE(imagecreatefromxpm, arginfo_imagecreatefromxpm)
#endif
- PHP_FE(imagecreatefromgd, NULL)
+ PHP_FE(imagecreatefromgd, arginfo_imagecreatefromgd)
#ifdef HAVE_GD_GD2
- PHP_FE(imagecreatefromgd2, NULL)
- PHP_FE(imagecreatefromgd2part, NULL)
+ PHP_FE(imagecreatefromgd2, arginfo_imagecreatefromgd2)
+ PHP_FE(imagecreatefromgd2part, arginfo_imagecreatefromgd2part)
#endif
#ifdef HAVE_GD_PNG
- PHP_FE(imagepng, NULL)
+ PHP_FE(imagepng, arginfo_imagepng)
#endif
#ifdef HAVE_GD_GIF_CREATE
- PHP_FE(imagegif, NULL)
+ PHP_FE(imagegif, arginfo_imagegif)
#endif
#ifdef HAVE_GD_JPG
- PHP_FE(imagejpeg, NULL)
+ PHP_FE(imagejpeg, arginfo_imagejpeg)
#endif
#ifdef HAVE_GD_WBMP
- PHP_FE(imagewbmp, NULL)
+ PHP_FE(imagewbmp, arginfo_imagewbmp)
#endif
- PHP_FE(imagegd, NULL)
+ PHP_FE(imagegd, arginfo_imagegd)
#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)
+ PHP_FE(imagegd2, arginfo_imagegd2)
+#endif
+
+ PHP_FE(imagedestroy, arginfo_imagedestroy)
+ PHP_FE(imagegammacorrect, arginfo_imagegammacorrect)
+ PHP_FE(imagefill, arginfo_imagefill)
+ PHP_FE(imagefilledpolygon, arginfo_imagefilledpolygon)
+ PHP_FE(imagefilledrectangle, arginfo_imagefilledrectangle)
+ PHP_FE(imagefilltoborder, arginfo_imagefilltoborder)
+ PHP_FE(imagefontwidth, arginfo_imagefontwidth)
+ PHP_FE(imagefontheight, arginfo_imagefontheight)
+ PHP_FE(imageinterlace, arginfo_imageinterlace)
+ PHP_FE(imageline, arginfo_imageline)
+ PHP_FE(imageloadfont, arginfo_imageloadfont)
+ PHP_FE(imagepolygon, arginfo_imagepolygon)
+ PHP_FE(imagerectangle, arginfo_imagerectangle)
+ PHP_FE(imagesetpixel, arginfo_imagesetpixel)
+ PHP_FE(imagestring, arginfo_imagestring)
+ PHP_FE(imagestringup, arginfo_imagestringup)
+ PHP_FE(imagesx, arginfo_imagesx)
+ PHP_FE(imagesy, arginfo_imagesy)
+ PHP_FE(imagedashedline, arginfo_imagedashedline)
#ifdef ENABLE_GD_TTF
- PHP_FE(imagettfbbox, NULL)
- PHP_FE(imagettftext, NULL)
+ PHP_FE(imagettfbbox, arginfo_imagettfbbox)
+ PHP_FE(imagettftext, arginfo_imagettftext)
#if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX
- PHP_FE(imageftbbox, NULL)
- PHP_FE(imagefttext, NULL)
+ PHP_FE(imageftbbox, arginfo_imageftbbox)
+ PHP_FE(imagefttext, arginfo_imagefttext)
#endif
#endif
#ifdef HAVE_LIBT1
- PHP_FE(imagepsloadfont, NULL)
+ PHP_FE(imagepsloadfont, arginfo_imagepsloadfont)
/*
- PHP_FE(imagepscopyfont, NULL)
+ PHP_FE(imagepscopyfont, arginfo_imagepscopyfont)
*/
- PHP_FE(imagepsfreefont, NULL)
- PHP_FE(imagepsencodefont, NULL)
- PHP_FE(imagepsextendfont, NULL)
- PHP_FE(imagepsslantfont, NULL)
- PHP_FE(imagepstext, NULL)
- PHP_FE(imagepsbbox, NULL)
+ PHP_FE(imagepsfreefont, arginfo_imagepsfreefont)
+ PHP_FE(imagepsencodefont, arginfo_imagepsencodefont)
+ PHP_FE(imagepsextendfont, arginfo_imagepsextendfont)
+ PHP_FE(imagepsslantfont, arginfo_imagepsslantfont)
+ PHP_FE(imagepstext, arginfo_imagepstext)
+ PHP_FE(imagepsbbox, arginfo_imagepsbbox)
#endif
- PHP_FE(imagetypes, NULL)
+ PHP_FE(imagetypes, arginfo_imagetypes)
#if defined(HAVE_GD_JPG) && defined(HAVE_GD_WBMP)
- PHP_FE(jpeg2wbmp, NULL)
+ PHP_FE(jpeg2wbmp, arginfo_jpeg2wbmp)
#endif
#if defined(HAVE_GD_PNG) && defined(HAVE_GD_WBMP)
- PHP_FE(png2wbmp, NULL)
+ PHP_FE(png2wbmp, arginfo_png2wbmp)
#endif
#ifdef HAVE_GD_WBMP
- PHP_FE(image2wbmp, NULL)
+ PHP_FE(image2wbmp, arginfo_image2wbmp)
#endif
#if HAVE_GD_BUNDLED
- PHP_FE(imagelayereffect, NULL)
- PHP_FE(imagecolormatch, NULL)
- PHP_FE(imagexbm, NULL)
+ PHP_FE(imagelayereffect, arginfo_imagelayereffect)
+ PHP_FE(imagecolormatch, arginfo_imagecolormatch)
+ PHP_FE(imagexbm, arginfo_imagexbm)
#endif
/* gd filters */
#ifdef HAVE_GD_BUNDLED
- PHP_FE(imagefilter, NULL)
- PHP_FE(imageconvolution, NULL)
+ PHP_FE(imagefilter, arginfo_imagefilter)
+ PHP_FE(imageconvolution, arginfo_imageconvolution)
#endif
{NULL, NULL, NULL}
@@ -661,6 +1466,7 @@ PHP_GD_API int phpi_get_le_gd(void)
{
return le_gd;
}
+/* }}} */
#ifndef HAVE_GDIMAGECOLORRESOLVE
@@ -1250,7 +2056,7 @@ PHP_FUNCTION(imagecopyresampled)
#endif
#ifdef HAVE_GD_BUNDLED
-/* {{{ proto resource imagerotate(resource src_im, float angle, int bgdcolor)
+/* {{{ proto resource imagerotate(resource src_im, float angle, int bgdcolor [, int ignoretransparent])
Rotate an image using a custom angle */
PHP_FUNCTION(imagerotate)
{
@@ -1550,8 +2356,9 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
php_stream *stream;
FILE * fp = NULL;
int argc=ZEND_NUM_ARGS();
+#ifdef HAVE_GD_JPG
long ignore_warning;
-
+#endif
if ((image_type == PHP_GDIMG_TYPE_GD2PART && argc != 5) ||
(image_type != PHP_GDIMG_TYPE_GD2PART && argc != 1) ||
@@ -1598,6 +2405,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
io_ctx = gdNewDynamicCtxEx(buff_size, buff, 0);
if (!io_ctx) {
+ pefree(buff, 1);
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot allocate GD IO context");
goto out_err;
}
@@ -1612,7 +2420,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
#else
io_ctx->free(io_ctx);
#endif
-
+ pefree(buff, 1);
#endif
}
else {
@@ -2869,7 +3677,7 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode)
ch = (int)((unsigned char)*(Z_STRVAL_PP(C)));
} else {
str = (unsigned char *) estrndup(Z_STRVAL_PP(C), Z_STRLEN_PP(C));
- l = strlen(str);
+ l = strlen((char *)str);
}
y = Z_LVAL_PP(Y);
@@ -3236,7 +4044,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
{
char tmp_font_path[MAXPATHLEN];
- if (VCWD_REALPATH(fontname, tmp_font_path)) {
+ if (VCWD_REALPATH((char *)fontname, tmp_font_path)) {
fontname = (unsigned char *) fontname;
} else {
fontname = NULL;
@@ -3246,18 +4054,18 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
fontname = (unsigned char *) fontname;
#endif
- PHP_GD_CHECK_OPEN_BASEDIR(fontname, "Invalid font filename");
+ PHP_GD_CHECK_OPEN_BASEDIR((char *)fontname, "Invalid font filename");
#ifdef USE_GD_IMGSTRTTF
# if HAVE_GD_STRINGFTEX
if (extended) {
- error = gdImageStringFTEx(im, brect, col, fontname, ptsize, angle, x, y, str, &strex);
+ error = gdImageStringFTEx(im, brect, col, (char *)fontname, ptsize, angle, x, y, (char *)str, &strex);
}
else
# endif
# if HAVE_GD_STRINGFT
- error = gdImageStringFT(im, brect, col, fontname, ptsize, angle, x, y, str);
+ error = gdImageStringFT(im, brect, col, (char *)fontname, ptsize, angle, x, y, (char *)str);
# elif HAVE_GD_STRINGTTF
error = gdImageStringTTF(im, brect, col, fontname, ptsize, angle, x, y, str);
# endif
@@ -3494,7 +4302,7 @@ PHP_FUNCTION(imagepsslantfont)
}
/* }}} */
-/* {{{ proto array imagepstext(resource image, string text, resource font, int size, int xcoord, int ycoord [, int space, int tightness, float angle, int antialias])
+/* {{{ proto array imagepstext(resource image, string text, resource font, int size, int foreground, int background, int xcoord, int ycoord [, int space, int tightness, float angle, int antialias])
Rasterize a string over an image */
PHP_FUNCTION(imagepstext)
{
@@ -3865,7 +4673,9 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
int int_threshold;
int x, y;
float x_ratio, y_ratio;
+#ifdef HAVE_GD_JPG
long ignore_warning;
+#endif
if (argc != 5 || zend_get_parameters_ex(argc, &f_org, &f_dest, &height, &width, &threshold) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
@@ -4281,7 +5091,7 @@ PHP_FUNCTION(imageconvolution)
}
for (i=0; i<3; i++) {
- if (zend_hash_index_find(Z_ARRVAL_P(hash_matrix), (i), (void **) &var) == SUCCESS) {
+ if (zend_hash_index_find(Z_ARRVAL_P(hash_matrix), (i), (void **) &var) == SUCCESS && Z_TYPE_PP(var) == IS_ARRAY) {
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;
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 8b7434282..2ccfa3d01 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd_ctx.c,v 1.22.2.5 2006/01/27 13:36:29 pajoye Exp $ */
+/* $Id: gd_ctx.c,v 1.22.2.5.2.2 2006/10/08 17:36:10 pajoye Exp $ */
#include "php_gd.h"
@@ -75,7 +75,9 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
ZEND_FETCH_RESOURCE(im, gdImagePtr, imgind, -1, "Image", phpi_get_le_gd());
if (argc > 1) {
- convert_to_string_ex(file);
+ if (argc >= 2 && Z_TYPE_PP(file) != IS_NULL) {
+ convert_to_string_ex(file);
+ }
fn = Z_STRVAL_PP(file);
if (argc >= 3) {
convert_to_long_ex(quality);
@@ -87,13 +89,13 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
}
}
- if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) {
+ if (argc > 1 && (Z_TYPE_PP(file) != IS_NULL && ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))))) {
PHP_GD_CHECK_OPEN_BASEDIR(fn, "Invalid filename");
fp = VCWD_FOPEN(fn, "wb");
if (!fp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing: %s", fn, strerror(errno));
RETURN_FALSE;
}
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index bb12cefc0..3edec2edf 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -1885,6 +1885,10 @@ void gdImageFill(gdImagePtr im, int x, int y, int nc)
struct seg *stack;
struct seg *sp;
+ if (!im->trueColor && nc > (im->colorsTotal -1)) {
+ return;
+ }
+
alphablending_bak = im->alphaBlendingFlag;
im->alphaBlendingFlag = 0;
diff --git a/ext/gd/libgd/gd_gd2.c b/ext/gd/libgd/gd_gd2.c
index 3f24e4a47..efc6ef47a 100644
--- a/ext/gd/libgd/gd_gd2.c
+++ b/ext/gd/libgd/gd_gd2.c
@@ -544,7 +544,7 @@ gdImagePtr gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w,
chunkNum = cx + cy * ncx;
chunkLen = chunkMax;
- if (!_gd2ReadChunk (chunkIdx[chunkNum].offset, compBuf, chunkIdx[chunkNum].size, chunkBuf, &chunkLen, in)) {
+ if (!_gd2ReadChunk (chunkIdx[chunkNum].offset, compBuf, chunkIdx[chunkNum].size, (char *)chunkBuf, &chunkLen, in)) {
php_gd_error("Error reading comproessed chunk");
goto fail2;
}
@@ -558,7 +558,7 @@ gdImagePtr gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w,
for (x = xlo; x < xhi; x++) {
if (!gd2_compressed(fmt)) {
if (im->trueColor) {
- if (!gdGetInt(&ch, in)) {
+ if (!gdGetInt((int *)&ch, in)) {
ch = 0;
}
} else {
diff --git a/ext/gd/libgd/gd_gif_in.c b/ext/gd/libgd/gd_gif_in.c
index ffe4168c8..e3d635b31 100644
--- a/ext/gd/libgd/gd_gif_in.c
+++ b/ext/gd/libgd/gd_gif_in.c
@@ -17,9 +17,9 @@ static int verbose;
static int set_verbose(void)
{
- verbose = !!getenv("GIF_VERBOSE");
- verbose_set = 1;
- return(verbose);
+ verbose = !!getenv("GIF_VERBOSE");
+ verbose_set = 1;
+ return(verbose);
}
#else
@@ -51,21 +51,21 @@ static int set_verbose(void)
/* 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;
+ 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;
+ int transparent;
+ int delayTime;
+ int inputFlag;
+ int disposal;
} Gif89 = { -1, -1, -1, 0 };
static int ReadColorMap (gdIOCtx *fd, int number, unsigned char (*buffer)[256]);
@@ -78,225 +78,231 @@ static void ReadImage (gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned
int ZeroDataBlock;
-gdImagePtr gdImageCreateFromGifSource(gdSourcePtr inSource)
+gdImagePtr gdImageCreateFromGifSource(gdSourcePtr inSource) /* {{{ */
{
- gdIOCtx *in = gdNewSSCtx(inSource, NULL);
- gdImagePtr im;
+ gdIOCtx *in = gdNewSSCtx(inSource, NULL);
+ gdImagePtr im;
- im = gdImageCreateFromGifCtx(in);
+ im = gdImageCreateFromGifCtx(in);
- in->gd_free(in);
+ in->gd_free(in);
- return im;
+ return im;
}
+/* }}} */
-gdImagePtr
-gdImageCreateFromGif(FILE *fdFile)
+gdImagePtr gdImageCreateFromGif(FILE *fdFile) /* {{{ */
{
- gdIOCtx *fd = gdNewFileCtx(fdFile);
- gdImagePtr im = 0;
+ gdIOCtx *fd = gdNewFileCtx(fdFile);
+ gdImagePtr im = 0;
- im = gdImageCreateFromGifCtx(fd);
+ im = gdImageCreateFromGifCtx(fd);
- fd->gd_free(fd);
+ fd->gd_free(fd);
- return im;
+ return im;
}
+/* }}} */
-gdImagePtr
-gdImageCreateFromGifCtx(gdIOCtxPtr fd)
+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)) {
+ /* 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) {
+ if (strncmp((char *)buf,"GIF",3) != 0) {
return 0;
}
- strncpy(version, (char *)buf + 3, 3);
- version[3] = '\0';
+ strncpy(version, (char *)buf + 3, 3);
+ version[3] = '\0';
- if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) {
+ if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) {
return 0;
}
- if (! ReadOK(fd,buf,7)) {
+ 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];
+ BitPixel = 2<<(buf[4]&0x07);
+ ColorResolution = (int) (((buf[4]&0x70)>>3)+1);
+ Background = buf[5];
+ AspectRatio = buf[6];
- imw = LM_to_uint(buf[0],buf[1]);
- imh = LM_to_uint(buf[2],buf[3]);
+ imw = LM_to_uint(buf[0],buf[1]);
+ imh = LM_to_uint(buf[2],buf[3]);
- if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */
- if (ReadColorMap(fd, BitPixel, ColorMap)) {
+ 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 */
+ }
+ 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 == '!') { /* Extension */
+ if (! ReadOK(fd,&c,1)) {
+ return 0;
+ }
+ DoExtension(fd, c, &Transparent);
+ continue;
+ }
- if (c != ',') { /* Not a valid start character */
- continue;
- }
+ if (c != ',') { /* Not a valid start character */
+ continue;
+ }
- /*1.4//++imageCount; */
+ /*1.4//++imageCount; */
- if (! ReadOK(fd,buf,9)) {
- return 0;
- }
+ if (! ReadOK(fd,buf,9)) {
+ return 0;
+ }
- useGlobalColormap = ! BitSet(buf[8], LOCALCOLORMAP);
+ useGlobalColormap = ! BitSet(buf[8], LOCALCOLORMAP);
- bitPixel = 1<<((buf[8]&0x07)+1);
+ bitPixel = 1<<((buf[8]&0x07)+1);
+
+ if (!useGlobalColormap) {
+ if (ReadColorMap(fd, bitPixel, localColorMap)) {
+ return 0;
+ }
+ }
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;
- }
+ im->interlace = BitSet(buf[8], INTERLACE);
+ if (! useGlobalColormap) {
+ 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) {
+ /* Terminator before any image was declared! */
+ if (!im) {
return 0;
- }
+ }
+
if (!im->colorsTotal) {
gdImageDestroy(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--) {
+
+ /* 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;
+ im->colorsTotal--;
+ } else {
+ break;
+ }
+ }
+ return im;
}
+/* }}} */
-static int
-ReadColorMap(gdIOCtx *fd, int number, unsigned char (*buffer)[256])
+static int ReadColorMap(gdIOCtx *fd, int number, unsigned char (*buffer)[256]) /* {{{ */
{
- int i;
- unsigned char rgb[3];
+ 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] ;
- }
+ 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;
+ return FALSE;
}
+/* }}} */
-static int
-DoExtension(gdIOCtx *fd, int label, int *Transparent)
+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 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)
+static int GetDataBlock_(gdIOCtx *fd, unsigned char *buf) /* {{{ */
{
- unsigned char count;
+ unsigned char count;
- if (! ReadOK(fd,&count,1)) {
- return -1;
- }
+ if (! ReadOK(fd,&count,1)) {
+ return -1;
+ }
- ZeroDataBlock = count == 0;
+ ZeroDataBlock = count == 0;
- if ((count != 0) && (! ReadOK(fd, buf, count))) {
- return -1;
- }
+ if ((count != 0) && (! ReadOK(fd, buf, count))) {
+ return -1;
+ }
- return count;
+ return count;
}
+/* }}} */
-static int
-GetDataBlock(gdIOCtx *fd, unsigned char *buf)
+static int GetDataBlock(gdIOCtx *fd, unsigned char *buf) /* {{{ */
{
int rv;
int i;
@@ -317,277 +323,276 @@ GetDataBlock(gdIOCtx *fd, unsigned char *buf)
}
return(rv);
}
+/* }}} */
-static int
-GetCode_(gdIOCtx *fd, int code_size, int flag)
+static int GetCode_(gdIOCtx *fd, int code_size, int flag) /* {{{ */
{
- static unsigned char buf[280];
- static int curbit, lastbit, done, last_byte;
- int i, j, ret;
- unsigned char count;
-
- if (flag) {
- curbit = 0;
- lastbit = 0;
- done = FALSE;
- return 0;
- }
-
- if ( (curbit+code_size) >= 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 unsigned char buf[280];
+ static int curbit, lastbit, done, last_byte;
+ int i, j, ret;
+ unsigned char count;
+
+ if (flag) {
+ curbit = 0;
+ lastbit = 0;
+ done = FALSE;
+ return 0;
+ }
+
+ if ( (curbit+code_size) >= 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)
+static int GetCode(gdIOCtx *fd, int code_size, int flag) /* {{{ */
{
- int rv;
+ 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);
+ 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 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<<MAX_LWZ_BITS); ++i)
- table[0][i] = table[1][0] = 0;
-
- sp = stack;
-
- return 0;
- } else if (fresh) {
- fresh = FALSE;
- do {
- firstcode = oldcode =
- GetCode(fd, code_size, FALSE);
- } while (firstcode == clear_code);
- return firstcode;
- }
-
- if (sp > 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<<MAX_LWZ_BITS); ++i)
- table[0][i] = table[1][i] = 0;
- code_size = set_code_size+1;
- max_code_size = 2*clear_code;
- max_code = clear_code+2;
- sp = stack;
- firstcode = oldcode =
- GetCode(fd, code_size, FALSE);
- return firstcode;
- } else if (code == end_code) {
- int count;
- unsigned char buf[260];
-
- if (ZeroDataBlock)
- return -2;
-
- while ((count = GetDataBlock(fd, buf)) > 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_LWZ_BITS)) {
- table[0][code] = oldcode;
- table[1][code] = firstcode;
- ++max_code;
- if ((max_code >= max_code_size) &&
- (max_code_size < (1<<MAX_LWZ_BITS))) {
- max_code_size *= 2;
- ++code_size;
- }
- }
-
- oldcode = incode;
-
- if (sp > stack)
- return *--sp;
- }
- return code;
+ 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<<MAX_LWZ_BITS); ++i)
+ table[0][i] = table[1][0] = 0;
+
+ sp = stack;
+
+ return 0;
+ } else if (fresh) {
+ fresh = FALSE;
+ do {
+ firstcode = oldcode =
+ GetCode(fd, code_size, FALSE);
+ } while (firstcode == clear_code);
+ return firstcode;
+ }
+
+ if (sp > 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<<MAX_LWZ_BITS); ++i)
+ table[0][i] = table[1][i] = 0;
+ code_size = set_code_size+1;
+ max_code_size = 2*clear_code;
+ max_code = clear_code+2;
+ sp = stack;
+ firstcode = oldcode =
+ GetCode(fd, code_size, FALSE);
+ return firstcode;
+ } else if (code == end_code) {
+ int count;
+ unsigned char buf[260];
+
+ if (ZeroDataBlock)
+ return -2;
+
+ while ((count = GetDataBlock(fd, buf)) > 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_LWZ_BITS)) {
+ table[0][code] = oldcode;
+ table[1][code] = firstcode;
+ ++max_code;
+ if ((max_code >= max_code_size) &&
+ (max_code_size < (1<<MAX_LWZ_BITS))) {
+ max_code_size *= 2;
+ ++code_size;
+ }
+ }
+
+ oldcode = incode;
+
+ if (sp > stack)
+ return *--sp;
+ }
+ return code;
}
+/* }}} */
-static int
-LWZReadByte(gdIOCtx *fd, int flag, int input_code_size)
+static int LWZReadByte(gdIOCtx *fd, int flag, int input_code_size) /* {{{ */
{
- int rv;
+ 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);
+ 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) */
+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;
-
- /*
- ** Initialize the Compression routines
- */
- if (! ReadOK(fd,&c,1)) {
- return;
- }
+ unsigned char c;
+ int v;
+ int xpos = 0, ypos = 0, pass = 0;
+ int i;
+
+
+ /*
+ ** Initialize the Compression routines
+ */
+ if (! ReadOK(fd,&c,1)) {
+ return;
+ }
if (c > MAX_LWZ_BITS) {
+ return;
+ }
+
+ /* Stash the color map into the image */
+ for (i=0; (i<gdMaxColors); i++) {
+ im->red[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;
+ if (LWZReadByte(fd, TRUE, c) < 0) {
return;
}
- /* Stash the color map into the image */
- for (i=0; (i<gdMaxColors); i++) {
- im->red[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;
-
- 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;
- }
+ /*
+ ** 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 */
- }
+ 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
index f6b4ff7e6..1fe36880a 100644
--- a/ext/gd/libgd/gd_gif_out.c
+++ b/ext/gd/libgd/gd_gif_out.c
@@ -264,11 +264,11 @@ GIFEncode(gdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace, int Background
int ColorMapSize;
int InitCodeSize;
int i;
- GifCtx ctx;
-
- memset(&ctx, 0, sizeof(ctx));
+ GifCtx ctx;
+
+ memset(&ctx, 0, sizeof(ctx));
ctx.Interlace = GInterlace;
- ctx.in_count = 1;
+ ctx.in_count = 1;
ColorMapSize = 1 << BitsPerPixel;
diff --git a/ext/gd/libgd/gd_png.c b/ext/gd/libgd/gd_png.c
index fcc9a008a..b99c33c8c 100644
--- a/ext/gd/libgd/gd_png.c
+++ b/ext/gd/libgd/gd_png.c
@@ -131,7 +131,10 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * 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 (gdGetBuf(sig, 8, infile) < 8) {
+ return NULL;
+ }
+
if (!png_check_sig (sig, 8)) { /* bad signature */
return NULL;
}
diff --git a/ext/gd/libgd/gdfontg.c b/ext/gd/libgd/gdfontg.c
index 61c8c2710..edddd0990 100644
--- a/ext/gd/libgd/gdfontg.c
+++ b/ext/gd/libgd/gdfontg.c
@@ -13,7 +13,7 @@
#include "gdfontg.h"
-char gdFontGiantData[] =
+static const char gdFontGiantData[] =
{
/* Char 0 */
0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -4376,7 +4376,7 @@ gdFont gdFontGiantRep =
0,
9,
15,
- gdFontGiantData
+ (char*)gdFontGiantData
};
gdFontPtr gdFontGiant = &gdFontGiantRep;
diff --git a/ext/gd/libgd/gdfontl.c b/ext/gd/libgd/gdfontl.c
index 6da54e1a1..093954ba3 100644
--- a/ext/gd/libgd/gdfontl.c
+++ b/ext/gd/libgd/gdfontl.c
@@ -14,7 +14,7 @@
#include "gdfontl.h"
-char gdFontLargeData[] =
+static const char gdFontLargeData[] =
{
/* Char 0 */
0, 0, 0, 0, 0, 0, 0, 0,
@@ -4633,7 +4633,7 @@ gdFont gdFontLargeRep =
0,
8,
16,
- gdFontLargeData
+ (char*)gdFontLargeData
};
gdFontPtr gdFontLarge = &gdFontLargeRep;
diff --git a/ext/gd/libgd/gdfontmb.c b/ext/gd/libgd/gdfontmb.c
index dab7c0589..b60110507 100644
--- a/ext/gd/libgd/gdfontmb.c
+++ b/ext/gd/libgd/gdfontmb.c
@@ -12,7 +12,7 @@
#include "gdfontmb.h"
-char gdFontMediumBoldData[] =
+static const char gdFontMediumBoldData[] =
{
/* Char 0 */
0, 0, 0, 0, 0, 0, 0,
@@ -3863,7 +3863,7 @@ gdFont gdFontMediumBoldRep =
0,
7,
13,
- gdFontMediumBoldData
+ (char*)gdFontMediumBoldData
};
gdFontPtr gdFontMediumBold = &gdFontMediumBoldRep;
diff --git a/ext/gd/libgd/gdfonts.c b/ext/gd/libgd/gdfonts.c
index 165cf70c5..bcc0717ca 100644
--- a/ext/gd/libgd/gdfonts.c
+++ b/ext/gd/libgd/gdfonts.c
@@ -12,7 +12,7 @@
#include "gdfonts.h"
-char gdFontSmallData[] =
+static const char gdFontSmallData[] =
{
/* Char 0 */
0, 0, 0, 0, 0, 0,
@@ -3863,7 +3863,7 @@ gdFont gdFontSmallRep =
0,
6,
13,
- gdFontSmallData
+ (char*)gdFontSmallData
};
gdFontPtr gdFontSmall = &gdFontSmallRep;
diff --git a/ext/gd/libgd/gdfontt.c b/ext/gd/libgd/gdfontt.c
index 2e6d24150..d4e0cf957 100644
--- a/ext/gd/libgd/gdfontt.c
+++ b/ext/gd/libgd/gdfontt.c
@@ -13,7 +13,7 @@
#include "gdfontt.h"
-char gdFontTinyData[] =
+static const char gdFontTinyData[] =
{
/* Char 0 */
0, 0, 0, 0, 0,
@@ -2584,7 +2584,7 @@ gdFont gdFontTinyRep =
0,
5,
8,
- gdFontTinyData
+ (char*)gdFontTinyData
};
gdFontPtr gdFontTiny = &gdFontTinyRep;
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index a09bdcba6..30ac2768c 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -207,12 +207,28 @@ static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr)
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;
+ byte = *((unsigned char *) (str + 2));
+ if (byte == 'x' || byte == 'X') {
+ for (i = 3; i < 8; i++) {
+ byte = *((unsigned char *) (str + i));
+ if (byte >= 'A' && byte <= 'F')
+ byte = byte - 'A' + 10;
+ else if (byte >= 'a' && byte <= 'f')
+ byte = byte - 'a' + 10;
+ else if (byte >= '0' && byte <= '9')
+ byte = byte - '0';
+ else
+ break;
+ n = (n * 16) + byte;
+ }
+ } else {
+ 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 == ';') {
@@ -518,7 +534,7 @@ static void * tweenColorFetch (char **error, void *key)
pixel = a->pixel = b->pixel;
bg = a->bgcolor = b->bgcolor;
fg = a->fgcolor = b->fgcolor;
- im = b->im;
+ im = a->im = b->im;
/* if fg is specified by a negative color idx, then don't antialias */
if (fg < 0) {
diff --git a/ext/gd/libgd/gdtables.c b/ext/gd/libgd/gdtables.c
index 1e81f3e9e..e34d8fc7c 100644
--- a/ext/gd/libgd/gdtables.c
+++ b/ext/gd/libgd/gdtables.c
@@ -5,7 +5,7 @@
#include "php_compat.h"
-int gdCosT[] =
+const int gdCosT[] =
{
1024,
1023,
@@ -369,7 +369,7 @@ int gdCosT[] =
1023
};
-int gdSinT[] =
+const int gdSinT[] =
{
0,
17,
diff --git a/ext/gd/tests/001.phpt b/ext/gd/tests/001.phpt
new file mode 100644
index 000000000..b0ac2a398
--- /dev/null
+++ b/ext/gd/tests/001.phpt
@@ -0,0 +1,25 @@
+--TEST--
+imagecreatefrompng() and empty/missing file
+--SKIPIF--
+<?php if (!function_exists("imagecreatefrompng")) print "skip"; ?>
+--FILE--
+<?php
+
+$file = dirname(__FILE__)."/001.test";
+@unlink($file);
+
+var_dump(imagecreatefrompng($file));
+touch($file);
+var_dump(imagecreatefrompng($file));
+
+@unlink($file);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: imagecreatefrompng(%s001.test): failed to open stream: No such file or directory in %s on line %d
+bool(false)
+
+Warning: imagecreatefrompng(): '%s001.test' is not a valid PNG file in %s on line %d
+bool(false)
+Done
diff --git a/ext/gd/tests/bug38112.gif b/ext/gd/tests/bug38112.gif
new file mode 100644
index 000000000..178d27e35
--- /dev/null
+++ b/ext/gd/tests/bug38112.gif
Binary files differ
diff --git a/ext/gd/tests/bug38112.phpt b/ext/gd/tests/bug38112.phpt
new file mode 100644
index 000000000..6c5227124
--- /dev/null
+++ b/ext/gd/tests/bug38112.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #38112 (GIF Invalid Code size ).
+--SKIPIF--
+<?php
+ if (!extension_loaded('gd')) {
+ die("skip gd extension not available\n");
+ }
+ if (!GD_BUNDLED) {
+ die('skip external GD libraries may fail');
+ }
+?>
+--FILE--
+<?php
+$im = imagecreatefromgif(dirname(__FILE__) . '/bug38112.gif');
+?>
+--EXPECTF--
+Warning: imagecreatefromgif(): '%sbug38112.gif' is not a valid GIF file in %sbug38112.php on line %d
diff --git a/ext/gd/tests/bug38179.phpt b/ext/gd/tests/bug38179.phpt
new file mode 100644
index 000000000..01adaa32c
--- /dev/null
+++ b/ext/gd/tests/bug38179.phpt
@@ -0,0 +1,28 @@
+--TEST--
+imagecopy doen't copy alpha, palette to truecolor
+--SKIPIF--
+<?php
+ if (!function_exists('imagecopy')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+$src = imagecreate(5,5);
+$c0 = imagecolorallocate($src, 255,255,255);
+$c1 = imagecolorallocatealpha($src, 255,0,0,70);
+
+imagealphablending($src, 0);
+imagefill($src, 0,0, $c1);
+
+$dst_tc = imagecreatetruecolor(5,5);
+imagealphablending($dst_tc, 0);
+
+imagecopy($dst_tc, $src, 0,0, 0,0, imagesx($src), imagesy($src));
+
+$p1 = imagecolorat($dst_tc, 3,3);
+printf("%X\n", $p1);
+
+imagedestroy($src); imagedestroy($dst_tc);
+?>
+--EXPECTF--
+46FF0000
+
diff --git a/ext/gd/tests/bug38212.phpt b/ext/gd/tests/bug38212.phpt
new file mode 100644
index 000000000..0094712a5
--- /dev/null
+++ b/ext/gd/tests/bug38212.phpt
@@ -0,0 +1,17 @@
+--TEST--
+imagecopy doen't copy alpha, palette to truecolor
+--SKIPIF--
+<?php
+ if (!function_exists('imagecopy')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+$file = dirname(__FILE__) . '/bug38212.gd2';
+$im1 = imagecreatetruecolor(10,100);
+imagefill($im1, 0,0, 0xffffff);
+imagegd2($im1, $file);
+$im = imagecreatefromgd2part($file, 0,0, -25,10);
+unlink($file);
+?>
+--EXPECTF--
+Warning: imagecreatefromgd2part(): '%sbug38212.gd2' is not a valid GD2 file in %sbug38212.php on line %d
diff --git a/ext/gd/tests/bug39082.phpt b/ext/gd/tests/bug39082.phpt
new file mode 100644
index 000000000..9bbfdb2e3
--- /dev/null
+++ b/ext/gd/tests/bug39082.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #39082 (Output image to stdout segfaults).
+--SKIPIF--
+<?php
+ if (!extension_loaded('gd')) {
+ die("skip gd extension not available\n");
+ }
+ if (!GD_BUNDLED) {
+ die('skip external GD libraries may fail');
+ }
+?>
+--FILE--
+<?php
+$im = imagecreatetruecolor(1,1);
+imagegif($im);
+?>
+--EXPECTF--
+GIF87a%s
diff --git a/ext/gd/tests/colorat.phpt b/ext/gd/tests/colorat.phpt
new file mode 100644
index 000000000..be1487388
--- /dev/null
+++ b/ext/gd/tests/colorat.phpt
@@ -0,0 +1,42 @@
+--TEST--
+imagecolorat
+--SKIPIF--
+<?php
+ if (!function_exists('imagecolorat')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+$file = dirname(__FILE__) . '/im.wbmp';
+
+$im = imagecreatetruecolor(6,6);
+imagefill($im, 0,0, 0xffffff);
+imagesetpixel($im, 3,3, 0x0);
+
+
+echo 'test colorat truecolor: ';
+$c = imagecolorat($im, 3,3);
+echo $c == 0x0 ? 'ok' : 'failed';
+echo "\n";
+imagedestroy($im);
+
+$im = imagecreate(6,6);
+$c1 = imagecolorallocate($im, 255,255,255);
+$c2 = imagecolorallocate($im, 0,0,0);
+
+imagefill($im, 0,0, $c1);
+imagesetpixel($im, 3,3, $c2);
+echo 'test colorat palette: ';
+
+$c = imagecolorsforindex($im, imagecolorat($im, 3,3));
+$failed = false;
+foreach ($c as $v) {
+ if ($v != 0) {
+ $failed = true;
+ }
+}
+echo !$failed ? 'ok' : 'failed';
+echo "\n";
+?>
+--EXPECT--
+test colorat truecolor: ok
+test colorat palette: ok
diff --git a/ext/gd/tests/colorclosest.phpt b/ext/gd/tests/colorclosest.phpt
new file mode 100644
index 000000000..7ade09478
--- /dev/null
+++ b/ext/gd/tests/colorclosest.phpt
@@ -0,0 +1,127 @@
+--TEST--
+imageclosest
+--SKIPIF--
+<?php
+ if (!function_exists('imagecolorclosest')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+
+$im = imagecreatetruecolor(5,5);
+$c = imagecolorclosest($im, 255,0,255);
+printf("%X\n", $c);
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+$c = imagecolorclosest($im, 255,0,255);
+print_r(imagecolorsforindex($im, $c));
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+imagecolorallocate($im, 255, 0, 255);
+$c = imagecolorclosest($im, 255,0,255);
+print_r(imagecolorsforindex($im, $c));
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+for ($i=0; $i<255; $i++) imagecolorresolve($im, $i,0,0);
+$c = imagecolorclosest($im, 255,0,0);
+print_r(imagecolorsforindex($im, $c));
+
+
+$im = imagecreate(5,5);
+for ($i=0; $i<256; $i++) {
+ if ($i == 246) {
+ imagecolorallocate($im, $i,10,10);
+ } else {
+ imagecolorallocate($im, $i,0,0);
+ }
+}
+$c = imagecolorclosest($im, 255,10,10);
+print_r(imagecolorsforindex($im, $c));
+
+// with alpha
+$im = imagecreatetruecolor(5,5);
+$c = imagecolorclosestalpha($im, 255,0,255,100);
+printf("%X\n", $c);
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+$c = imagecolorclosestalpha($im, 255,0,255,100);
+print_r(imagecolorsforindex($im, $c));
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+imagecolorallocatealpha($im, 255, 0, 255, 1);
+$c = imagecolorclosestalpha($im, 255,0,255,1);
+print_r(imagecolorsforindex($im, $c));
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+for ($i=0; $i<255; $i++) imagecolorresolvealpha($im, $i,0,0,1);
+$c = imagecolorclosestalpha($im, 255,0,0,1);
+print_r(imagecolorsforindex($im, $c));
+
+
+$im = imagecreate(5,5);
+for ($i=0; $i<256; $i++) {
+ if ($i == 246) {
+ imagecolorallocatealpha($im, $i,10,10,1);
+ } else {
+ imagecolorallocatealpha($im, $i,0,0,100);
+ }
+}
+$c = imagecolorclosestalpha($im, 255,10,10,1);
+print_r(imagecolorsforindex($im, $c));
+
+
+?>
+--EXPECTF--
+FF00FF
+
+Warning: imagecolorsforindex(): Color index -1 out of range in %s on line %d
+Array
+(
+ [red] => 255
+ [green] => 0
+ [blue] => 255
+ [alpha] => 0
+)
+Array
+(
+ [red] => 254
+ [green] => 0
+ [blue] => 0
+ [alpha] => 0
+)
+Array
+(
+ [red] => 246
+ [green] => 10
+ [blue] => 10
+ [alpha] => 0
+)
+64FF00FF
+
+Warning: imagecolorsforindex(): Color index -1 out of range in %s on line %d
+Array
+(
+ [red] => 255
+ [green] => 0
+ [blue] => 255
+ [alpha] => 1
+)
+Array
+(
+ [red] => 254
+ [green] => 0
+ [blue] => 0
+ [alpha] => 1
+)
+Array
+(
+ [red] => 246
+ [green] => 10
+ [blue] => 10
+ [alpha] => 1
+)
diff --git a/ext/gd/tests/colorexact.phpt b/ext/gd/tests/colorexact.phpt
new file mode 100644
index 000000000..e6983b751
--- /dev/null
+++ b/ext/gd/tests/colorexact.phpt
@@ -0,0 +1,40 @@
+--TEST--
+imagecolorexact
+--SKIPIF--
+<?php
+ if (!function_exists('imagecolorexact')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+
+$im = imagecreatetruecolor(5,5);
+$c = imagecolorexact($im, 255,0,255);
+$c2 = imagecolorexactalpha($im, 255,0,255, 100);
+
+printf("%X\n", $c);
+printf("%X\n", $c2);
+
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+$c = imagecolorallocate($im, 255,0,255);
+$c2 = imagecolorallocate($im, 255,200,0);
+$c3 = imagecolorallocatealpha($im, 255,200,0,100);
+
+echo imagecolorexact($im, 255,0,255) . "\n";
+echo imagecolorexact($im, 255,200,0) . "\n";
+echo imagecolorexactalpha($im, 255,200,0,100) . "\n";
+
+
+// unallocated index
+echo imagecolorexact($im, 12,12,12) . "\n";
+
+imagedestroy($im);
+?>
+--EXPECTF--
+FF00FF
+64FF00FF
+0
+1
+2
+-1
diff --git a/ext/gd/tests/colorresolve.phpt b/ext/gd/tests/colorresolve.phpt
new file mode 100644
index 000000000..9af0f1860
--- /dev/null
+++ b/ext/gd/tests/colorresolve.phpt
@@ -0,0 +1,113 @@
+--TEST--
+imagecolorresolve
+--SKIPIF--
+<?php
+ if (!function_exists('imagecolorresolve')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+
+$im = imagecreatetruecolor(5,5);
+$c = imagecolorresolve($im, 255,0,255);
+printf("%X\n", $c);
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+$c = imagecolorresolve($im, 255,0,255);
+print_r(imagecolorsforindex($im, $c));
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+for ($i=0; $i<255; $i++) imagecolorresolve($im, $i,0,0);
+$c = imagecolorresolve($im, 255,0,0);
+print_r(imagecolorsforindex($im, $c));
+
+
+$im = imagecreate(5,5);
+for ($i=0; $i<256; $i++) {
+ if ($i == 246) {
+ imagecolorresolve($im, $i,10,10);
+ } else {
+ imagecolorresolve($im, $i,0,0);
+ }
+}
+$c = imagecolorresolve($im, 255,10,10);
+print_r(imagecolorsforindex($im, $c));
+
+
+
+// with alpha
+$im = imagecreatetruecolor(5,5);
+$c = imagecolorresolvealpha($im, 255,0,255, 100);
+printf("%X\n", $c);
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+$c = imagecolorresolvealpha($im, 255,0,255,100);
+print_r(imagecolorsforindex($im, $c));
+imagedestroy($im);
+
+$im = imagecreate(5,5);
+for ($i=0; $i<255; $i++) imagecolorresolvealpha($im, $i,0,0,1);
+$c = imagecolorresolvealpha($im, 255,0,0,1);
+print_r(imagecolorsforindex($im, $c));
+
+
+$im = imagecreate(5,5);
+for ($i=0; $i<256; $i++) {
+ if ($i == 246) {
+ imagecolorresolvealpha($im, $i,10,10,1);
+ } else {
+ imagecolorresolvealpha($im, $i,0,0,100);
+ }
+}
+$c = imagecolorresolvealpha($im, 255,10,10,0);
+print_r(imagecolorsforindex($im, $c));
+
+
+?>
+--EXPECTF--
+FF00FF
+Array
+(
+ [red] => 255
+ [green] => 0
+ [blue] => 255
+ [alpha] => 0
+)
+Array
+(
+ [red] => 255
+ [green] => 0
+ [blue] => 0
+ [alpha] => 0
+)
+Array
+(
+ [red] => 246
+ [green] => 10
+ [blue] => 10
+ [alpha] => 0
+)
+64FF00FF
+Array
+(
+ [red] => 255
+ [green] => 0
+ [blue] => 255
+ [alpha] => 100
+)
+Array
+(
+ [red] => 255
+ [green] => 0
+ [blue] => 0
+ [alpha] => 1
+)
+Array
+(
+ [red] => 246
+ [green] => 10
+ [blue] => 10
+ [alpha] => 1
+)
diff --git a/ext/gd/tests/copy.phpt b/ext/gd/tests/copy.phpt
new file mode 100644
index 000000000..5aafc31e7
--- /dev/null
+++ b/ext/gd/tests/copy.phpt
@@ -0,0 +1,109 @@
+--TEST--
+imagecopy
+--SKIPIF--
+<?php
+ if (!function_exists('imagecopy')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+
+$src_tc = imagecreatetruecolor(5,5);
+imagefill($src_tc, 0,0, 0xffffff);
+imagesetpixel($src_tc, 3,3, 0xff0000);
+imagesetpixel($src_tc, 0,0, 0x0000ff);
+imagesetpixel($src_tc, 4,4, 0x00ff00);
+
+
+$dst_tc = imagecreatetruecolor(5,5);
+imagecopy($dst_tc, $src_tc, 0,0, 0,0, imagesx($src_tc), imagesy($src_tc));
+$p1 = imagecolorat($dst_tc, 3,3) == 0xff0000;
+$p2 = imagecolorat($dst_tc, 0,0) == 0x0000ff;
+$p3 = imagecolorat($dst_tc, 4,4) == 0x00ff00;
+
+if ($p1 && $p2 && $p3) {
+ echo "TC/TC: ok\n";
+}
+
+imagedestroy($src_tc); imagedestroy($dst_tc);
+
+
+$src_tc = imagecreatetruecolor(5,5);
+imagefill($src_tc, 0,0, 0xffffff);
+imagesetpixel($src_tc, 3,3, 0xff0000);
+imagesetpixel($src_tc, 0,0, 0x0000ff);
+imagesetpixel($src_tc, 4,4, 0x00ff00);
+
+
+$dst_tc = imagecreate(5,5);
+imagecopy($dst_tc, $src_tc, 0,0, 0,0, imagesx($src_tc), imagesy($src_tc));
+
+$c1 = imagecolorsforindex($dst_tc, imagecolorat($dst_tc, 3,3));
+$c2 = imagecolorsforindex($dst_tc, imagecolorat($dst_tc, 0,0));
+$c3 = imagecolorsforindex($dst_tc, imagecolorat($dst_tc, 4,4));
+
+$p1 = $c1['red'] == 0xff && $c1['blue']==0x00 && $c1['green']==0x00;
+$p2 = $c2['red'] == 0x00 && $c2['blue']==0xff && $c2['green']==0x00;
+$p3 = $c3['red'] == 0x00 && $c3['blue']==0x00 && $c3['green']==0xff;
+
+if ($p1 && $p2 && $p3) {
+ echo "TC/P: ok\n";
+}
+imagedestroy($src_tc); imagedestroy($dst_tc);
+
+
+
+$src_tc = imagecreate(5,5);
+$c0 = imagecolorallocate($src_tc, 0xff, 0xff, 0xff);
+$c1 = imagecolorallocate($src_tc, 0xff, 0x00, 0x00);
+$c2 = imagecolorallocate($src_tc, 0x00, 0x00, 0xff);
+$c3 = imagecolorallocate($src_tc, 0x00, 0xff, 0x00);
+
+imagesetpixel($src_tc, 3,3, $c1);
+imagesetpixel($src_tc, 0,0, $c2);
+imagesetpixel($src_tc, 4,4, $c3);
+
+
+$dst_tc = imagecreate(5,5);
+imagecopy($dst_tc, $src_tc, 0,0, 0,0, imagesx($src_tc), imagesy($src_tc));
+
+$c1 = imagecolorsforindex($dst_tc, imagecolorat($dst_tc, 3,3));
+$c2 = imagecolorsforindex($dst_tc, imagecolorat($dst_tc, 0,0));
+$c3 = imagecolorsforindex($dst_tc, imagecolorat($dst_tc, 4,4));
+
+$p1 = $c1['red'] == 0xff && $c1['blue']==0x00 && $c1['green']==0x00;
+$p2 = $c2['red'] == 0x00 && $c2['blue']==0xff && $c2['green']==0x00;
+$p3 = $c3['red'] == 0x00 && $c3['blue']==0x00 && $c3['green']==0xff;
+
+
+if ($p1 && $p2 && $p3) {
+ echo "P/P: ok\n";
+}
+
+
+
+$src_tc = imagecreate(5,5);
+$c0 = imagecolorallocate($src_tc, 0xff, 0xff, 0xff);
+$c1 = imagecolorallocate($src_tc, 0xff, 0x00, 0x00);
+$c2 = imagecolorallocate($src_tc, 0x00, 0x00, 0xff);
+$c3 = imagecolorallocate($src_tc, 0x00, 0xff, 0x00);
+
+imagesetpixel($src_tc, 3,3, $c1);
+imagesetpixel($src_tc, 0,0, $c2);
+imagesetpixel($src_tc, 4,4, $c3);
+
+
+$dst_tc = imagecreatetruecolor(5,5);
+imagecopy($dst_tc, $src_tc, 0,0, 0,0, imagesx($src_tc), imagesy($src_tc));
+$p1 = imagecolorat($dst_tc, 3,3) == 0xff0000;
+$p2 = imagecolorat($dst_tc, 0,0) == 0x0000ff;
+$p3 = imagecolorat($dst_tc, 4,4) == 0x00ff00;
+
+if ($p1 && $p2 && $p3) {
+ echo "P/TC: ok\n";
+}
+?>
+--EXPECTF--
+TC/TC: ok
+TC/P: ok
+P/P: ok
+P/TC: ok
diff --git a/ext/gd/tests/copyresized.phpt b/ext/gd/tests/copyresized.phpt
new file mode 100644
index 000000000..fe98642db
--- /dev/null
+++ b/ext/gd/tests/copyresized.phpt
@@ -0,0 +1,91 @@
+--TEST--
+imagecopyresized
+--SKIPIF--
+<?php
+ if (!function_exists('imagecopyresized')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+
+function get_hexcolor($im, $c) {
+ if (imageistruecolor($im)) {
+ return $c;
+ }
+ $colors = imagecolorsforindex($im, $c);
+ return ($colors['red'] << 16) + ($colors['green'] << 8) + ($colors['blue']);
+}
+
+function check_doublesize($dst) {
+ $im = imagecreatetruecolor(38,38);
+ imagefill($im,0,0, 0xffffff);
+ imagefilledrectangle($im, 0,0,9,9, 0xff0000);
+ imagefilledrectangle($im, 0,28,9,37, 0xff0000);
+ imagefilledrectangle($im, 28,0,37,9, 0xff0000);
+ imagefilledrectangle($im, 28,28,37,37, 0xff0000);
+ imagefilledrectangle($im, 14,14,23,23, 0xff0000);
+
+ for ($x = 0; $x < 38; $x++) {
+ for ($y = 0; $y < 38; $y++) {
+ $p1 = imagecolorat($im, $x, $y);
+ $p2 = imagecolorat($dst, $x, $y);
+ if (get_hexcolor($im, $p1) != get_hexcolor($dst, $p2)) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+$src_tc = imagecreatetruecolor(19,19);
+imagefill($src_tc, 0,0, 0xffffff);
+imagefilledrectangle($src_tc, 0,0,4,4, 0xff0000);
+imagefilledrectangle($src_tc, 14,0,18,4, 0xff0000);
+imagefilledrectangle($src_tc, 0,14,4,18, 0xff0000);
+imagefilledrectangle($src_tc, 14,14,18,18, 0xff0000);
+imagefilledrectangle($src_tc, 7,7,11,11, 0xff0000);
+
+$dst_tc = imagecreatetruecolor(38,38);
+imagecopyresized($dst_tc, $src_tc, 0,0, 0,0, imagesx($dst_tc), imagesy($dst_tc), 19,19);
+
+if (!check_doublesize($dst_tc)) exit("1 failed\n");
+echo "TC->TC: ok\n";
+
+$src_tc = imagecreate(19,19);
+$white = imagecolorallocate($src_tc, 255,255,255);
+$red = imagecolorallocate($src_tc, 255,0,0);
+
+imagefilledrectangle($src_tc, 0,0,4,4, $red);
+imagefilledrectangle($src_tc, 14,0,18,4, $red);
+imagefilledrectangle($src_tc, 0,14,4,18, $red);
+imagefilledrectangle($src_tc, 14,14,18,18, $red);
+imagefilledrectangle($src_tc, 7,7,11,11, $red);
+
+$dst_tc = imagecreatetruecolor(38,38);
+imagecopyresized($dst_tc, $src_tc, 0,0, 0,0, imagesx($dst_tc), imagesy($dst_tc), 19,19);
+
+if (!check_doublesize($dst_tc)) exit("2 failed\n");
+echo "P->TC: ok\n";
+
+$src_tc = imagecreate(19,19);
+$white = imagecolorallocate($src_tc, 255,255,255);
+$red = imagecolorallocate($src_tc, 255,0,0);
+
+imagefilledrectangle($src_tc, 0,0,4,4, $red);
+imagefilledrectangle($src_tc, 14,0,18,4, $red);
+imagefilledrectangle($src_tc, 0,14,4,18, $red);
+imagefilledrectangle($src_tc, 14,14,18,18, $red);
+imagefilledrectangle($src_tc, 7,7,11,11, $red);
+
+$dst_tc = imagecreate(38,38);
+$white = imagecolorallocate($src_tc, 255,255,255);
+$red = imagecolorallocate($src_tc, 255,0,0);
+
+imagecopyresized($dst_tc, $src_tc, 0,0, 0,0, imagesx($dst_tc), imagesy($dst_tc), 19,19);
+
+if (!check_doublesize($dst_tc)) exit("3 failed\n");
+echo "P->P: ok\n";
+?>
+--EXPECTF--
+TC->TC: ok
+P->TC: ok
+P->P: ok
diff --git a/ext/gd/tests/createfromgd2.phpt b/ext/gd/tests/createfromgd2.phpt
new file mode 100644
index 000000000..98b078ea5
--- /dev/null
+++ b/ext/gd/tests/createfromgd2.phpt
@@ -0,0 +1,24 @@
+--TEST--
+imagecreatefromgd2
+--SKIPIF--
+<?php
+ if (!function_exists('imagecreatefromgd2')) die("skip gd extension not available\n");
+ if (!GD_BUNDLED) die('skip external GD libraries always fail');
+?>
+--FILE--
+<?php
+$file = dirname(__FILE__) . '/src.gd2';
+
+$im2 = imagecreatefromgd2($file);
+echo 'test create from gd2: ';
+echo imagecolorat($im2, 4,4) == 0xffffff ? 'ok' : 'failed';
+echo "\n";
+
+$im3 = imagecreatefromgd2part($file, 4,4, 2,2);
+echo 'test create from gd2 part: ';
+echo imagecolorat($im2, 4,4) == 0xffffff ? 'ok' : 'failed';
+echo "\n";
+?>
+--EXPECT--
+test create from gd2: ok
+test create from gd2 part: ok
diff --git a/ext/gd/tests/createfromwbmp.phpt b/ext/gd/tests/createfromwbmp.phpt
new file mode 100644
index 000000000..5e48f235e
--- /dev/null
+++ b/ext/gd/tests/createfromwbmp.phpt
@@ -0,0 +1,18 @@
+--TEST--
+imagecreatefromwbmp
+--SKIPIF--
+<?php
+ if (!function_exists('imagecreatefromwbmp')) die("skip gd extension not available\n");
+ if (!GD_BUNDLED) die('skip external GD libraries always fail');
+?>
+--FILE--
+<?php
+$file = dirname(__FILE__) . '/src.wbmp';
+
+$im2 = imagecreatefromwbmp($file);
+echo 'test create from wbmp: ';
+echo imagecolorat($im2, 3,3) == 0x0 ? 'ok' : 'failed';
+echo "\n";
+?>
+--EXPECT--
+test create from wbmp: ok
diff --git a/ext/gd/tests/dashedlines.phpt b/ext/gd/tests/dashedlines.phpt
new file mode 100644
index 000000000..7c1308415
--- /dev/null
+++ b/ext/gd/tests/dashedlines.phpt
@@ -0,0 +1,78 @@
+--TEST--
+imageline, dashed
+--SKIPIF--
+<?php
+ if (!function_exists('imagecreatefromstring')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+$im = imagecreatetruecolor(6,6);
+imagefill($im, 0,0, 0xffffff);
+
+$r = 0xff0000;
+$b = 0x0000ff;
+
+$style = array($r, $b);
+imagesetstyle($im, $style);
+
+// Horizontal line
+imageline($im, 0,5, 5,5, IMG_COLOR_STYLED);
+$p1 = imagecolorat($im, 0,5) == $r;
+$p2 = imagecolorat($im, 1,5) == $b;
+$p3 = imagecolorat($im, 2,5) == $r;
+$p4 = imagecolorat($im, 3,5) == $b;
+$p5 = imagecolorat($im, 4,5) == $r;
+$p5 = imagecolorat($im, 5,5) == $b;
+
+
+if ($p1 && $p2 && $p3 && $p4 && $p5) {
+ echo "Horizontal: ok\n";
+}
+imagedestroy($im);
+
+$im = imagecreatetruecolor(6,6);
+imagefill($im, 0,0, 0xffffff);
+
+$style = array($r, $b);
+imagesetstyle($im, $style);
+
+
+imageline($im, 2,0, 2,5, IMG_COLOR_STYLED);
+$p1 = imagecolorat($im, 2,0) == $r;
+$p2 = imagecolorat($im, 2,1) == $b;
+$p3 = imagecolorat($im, 2,2) == $r;
+$p4 = imagecolorat($im, 2,3) == $b;
+$p5 = imagecolorat($im, 2,4) == $r;
+$p6 = imagecolorat($im, 2,5) == $b;
+
+if ($p1 && $p2 && $p3 && $p4 && $p5 && $p6) {
+ echo "Vertical: ok\n";
+}
+imagedestroy($im);
+
+
+$im = imagecreatetruecolor(6,6);
+imagefill($im, 0,0, 0xffffff);
+
+$style = array($r, $b);
+imagesetstyle($im, $style);
+
+imageline($im, 0,0, 5,5, IMG_COLOR_STYLED);
+$p1 = imagecolorat($im, 0,0) == $r;
+$p2 = imagecolorat($im, 1,1) == $b;
+$p3 = imagecolorat($im, 2,2) == $r;
+$p4 = imagecolorat($im, 3,3) == $b;
+$p5 = imagecolorat($im, 4,4) == $r;
+$p6 = imagecolorat($im, 5,5) == $b;
+
+if ($p1 && $p2 && $p3 && $p4 && $p5 && $p6) {
+ echo "Diagonal: ok\n";
+}
+imagedestroy($im);
+
+
+?>
+--EXPECTF--
+Horizontal: ok
+Vertical: ok
+Diagonal: ok
diff --git a/ext/gd/tests/gif.phpt b/ext/gd/tests/gif.phpt
new file mode 100644
index 000000000..f4ed578c4
--- /dev/null
+++ b/ext/gd/tests/gif.phpt
@@ -0,0 +1,145 @@
+--TEST--
+gif in/out
+--SKIPIF--
+<?php
+// $Id: gif.phpt,v 1.2.2.2 2006/07/17 12:54:09 pajoye Exp $
+ if (!extension_loaded('gd')) {
+ die("skip gd extension not available.");
+ }
+ if (!function_exists("imagegif") || !function_exists("imagecreatefromgif") || !function_exists('imagecreatefromjpeg')) {
+ die("skip gif support unavailable");
+ }
+?>
+--FILE--
+<?php
+
+function check_box($r,$g,$b, $error=0) {
+ $cwd = dirname(__FILE__);
+ $im2 = imagecreatefromgif($cwd . '/test_gif.gif');
+
+ $c = imagecolorsforindex($im2, imagecolorat($im2, 8,8));
+
+ if ($error>0) {
+ $r_min = $r - $error; $r_max = $r + $error;
+ $g_min = $g - $error; $g_max = $g + $error;
+ $b_min = $b - $error; $b_max = $b + $error;
+
+ if (
+ ($c['red'] >= $r_min || $c['red'] <= $r_max)
+ &&
+ ($c['green'] >= $g_min || $c['green'] <= $g_max)
+ &&
+ ($c['blue'] >= $b_min || $c['blue'] <= $b_max)
+ ) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ if ($c['red']==$r && $c['green']==$g && $c['blue']==$b) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
+$cwd = dirname(__FILE__);
+
+$im = imagecreate(10,10);
+$c = imagecolorallocate($im, 255,255,255);
+imagefilledrectangle($im, 5,5, 10,10, $c);
+imagegif($im, $cwd . '/test_gif.gif');
+if (check_box(255,255,255)) {
+ echo "<4 cols: ok\n";
+}
+
+$im = imagecreate(10,10);
+for ($i=0; $i<7; $i++) {
+ $c = imagecolorallocate($im, $i,$i,$i);
+}
+imagefilledrectangle($im, 5,5, 10,10, $c);
+imagegif($im, $cwd . '/test_gif.gif');
+$i--;
+if (check_box($i,$i,$i)) {
+ echo "<8 cols: ok\n";
+}
+
+
+$im = imagecreate(10,10);
+for ($i=0; $i<15; $i++) {
+ $c = imagecolorallocate($im, $i,$i,$i);
+}
+imagefilledrectangle($im, 5,5, 10,10, $c);
+imagegif($im, $cwd . '/test_gif.gif');
+$i--;
+if (check_box($i,$i,$i)) {
+ echo "<16 cols: ok\n";
+}
+
+
+$im = imagecreate(10,10);
+for ($i=0; $i<31; $i++) {
+ $c = imagecolorallocate($im, $i,$i,$i);
+}
+imagefilledrectangle($im, 5,5, 10,10, $c);
+imagegif($im, $cwd . '/test_gif.gif');
+$i--;
+if (check_box($i,$i,$i)) {
+ echo "<32 cols: ok\n";
+}
+
+
+$im = imagecreate(10,10);
+for ($i=0; $i<63; $i++) {
+ $c = imagecolorallocate($im, $i,$i,$i);
+}
+imagefilledrectangle($im, 5,5, 10,10, $c);
+imagegif($im, $cwd . '/test_gif.gif');
+$i--;
+if (check_box($i,$i,$i)) {
+ echo "<64 cols: ok\n";
+}
+
+$im = imagecreate(10,10);
+for ($i=0; $i<127; $i++) {
+ $c = imagecolorallocate($im, $i,$i,$i);
+}
+imagefilledrectangle($im, 5,5, 10,10, $c);
+imagegif($im, $cwd . '/test_gif.gif');
+$i--;
+if (check_box($i,$i,$i)) {
+ echo "<128 cols: ok\n";
+}
+
+$im = imagecreate(10,10);
+for ($i=0; $i<255; $i++) {
+ $c = imagecolorallocate($im, $i,$i,$i);
+}
+imagefilledrectangle($im, 5,5, 10,10, $c);
+imagegif($im, $cwd . '/test_gif.gif');
+$i--;
+if (check_box($i,$i,$i)) {
+ echo "<256 cols: ok\n";
+}
+
+
+$im = imagecreatefromjpeg($cwd . '/conv_test.jpeg');
+imagefilledrectangle($im, 5,5, 10,10, 0xffffff);
+imagegif($im, $cwd . '/test_gif.gif');
+imagegif($im, $cwd . '/test_gif_2.gif');
+
+if (check_box(255,255,255, 10)) {
+ echo ">256 cols: ok\n";
+}
+
+@unlink($cwd . "/test_gif.gif");
+?>
+--EXPECT--
+<4 cols: ok
+<8 cols: ok
+<16 cols: ok
+<32 cols: ok
+<64 cols: ok
+<128 cols: ok
+<256 cols: ok
+>256 cols: ok
diff --git a/ext/gd/tests/imagefill_1.phpt b/ext/gd/tests/imagefill_1.phpt
new file mode 100644
index 000000000..04e1cab55
--- /dev/null
+++ b/ext/gd/tests/imagefill_1.phpt
@@ -0,0 +1,25 @@
+--TEST--
+imagefill() infinite loop with wrong color index
+--SKIPIF--
+<?php
+ if (!extension_loaded('gd')) {
+ die("skip gd extension not available.");
+ }
+ if (!function_exists("imagefttext")) {
+ die("skip imagefttext() not available.");
+ }
+?>
+--FILE--
+<?php
+$im = imagecreate(100,100);
+$white = imagecolorallocate($im, 255,255,255);
+$blue = imagecolorallocate($im, 0,0,255);
+$green = imagecolorallocate($im, 0,255,0);
+
+print_r(imagecolorat($im, 0,0));
+imagefill($im, 0,0,$white + 3);
+print_r(imagecolorat($im, 0,0));
+imagedestroy($im);
+?>
+--EXPECT--
+00
diff --git a/ext/gd/tests/imagewbmp.phpt b/ext/gd/tests/imagewbmp.phpt
new file mode 100644
index 000000000..cea464e75
--- /dev/null
+++ b/ext/gd/tests/imagewbmp.phpt
@@ -0,0 +1,31 @@
+--TEST--
+imagewbmp
+--SKIPIF--
+<?php
+ if (!function_exists('imagecreatefromwbmp')) die("skip gd extension not available\n");
+ if (!GD_BUNDLED) die('skip external GD libraries always fail');
+?>
+--FILE--
+<?php
+$file = dirname(__FILE__) . '/im.wbmp';
+
+$im = imagecreatetruecolor(6,6);
+imagefill($im, 0,0, 0xffffff);
+imagesetpixel($im, 3,3, 0x0);
+imagewbmp($im, $file);
+
+$im2 = imagecreatefromwbmp($file);
+echo 'test create wbmp: ';
+$c = imagecolorsforindex($im2, imagecolorat($im2, 3,3));
+$failed = false;
+foreach ($c as $v) {
+ if ($v != 0) {
+ $failed = true;
+ }
+}
+echo !$failed ? 'ok' : 'failed';
+echo "\n";
+unlink($file);
+?>
+--EXPECT--
+test create wbmp: ok
diff --git a/ext/gd/tests/lines.phpt b/ext/gd/tests/lines.phpt
new file mode 100644
index 000000000..e8c663bca
--- /dev/null
+++ b/ext/gd/tests/lines.phpt
@@ -0,0 +1,114 @@
+--TEST--
+imageline no AA
+--SKIPIF--
+<?php
+ if (!function_exists('imageline')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+$im = imagecreatetruecolor(6,6);
+imagefill($im, 0,0, 0xffffff);
+
+// Wrong argument count
+imageline($im, 0,0, 5,5);
+
+
+// Horizontal line
+imageline($im, 0,5, 5,5, 0x00ff00);
+
+$p1 = imagecolorat($im, 0,5)==0x00ff00;
+$p2 = imagecolorat($im, 5,5)==0x00ff00;
+$p3 = true;
+for ($x=1; $x<5; $x++) {
+ $p3 = $p3 && (imagecolorat($im, $x,5)==0x00ff00);
+}
+if ($p1 && $p2 && $p3) {
+ echo "Horizontal: ok\n";
+}
+
+$im = imagecreatetruecolor(6,6);
+imagefill($im, 0,0, 0xffffff);
+
+imageline($im, 0,0, 0,5, 0x00ff00);
+$p1 = imagecolorat($im, 0,0)==0x00ff00;
+$p2 = imagecolorat($im, 0,5)==0x00ff00;
+$p3 = true;
+for ($y=1; $y<5; $y++) {
+ $p3 = $p3 && (imagecolorat($im, 0,$y)==0x00ff00);
+}
+
+if ($p1 && $p2 && $p3) {
+ echo "Vertical: ok\n";
+}
+
+
+$im = imagecreatetruecolor(6,6);
+imagefill($im, 0,0, 0xffffff);
+imageline($im, 0,0, 5,5, 0x00ff00);
+
+
+// Diagonal
+$p1 = imagecolorat($im, 0,0)==0x00ff00;
+$p2 = imagecolorat($im, 5,5)==0x00ff00;
+$x=1;
+$p3 = true;
+
+for ($y=1; $y<5; $y++) {
+ $p3 = $p3 && (imagecolorat($im, $x,$y)==0x00ff00);
+ $x++;
+}
+
+if ($p1 && $p2 && $p3) {
+ echo "Diagonal: ok\n";
+}
+
+// Outside
+$im = imagecreatetruecolor(6,6);
+imagefill($im, 0,0, 0xffffff);
+imageline($im, 12, 12, 23,23, 0x00ff00);
+$p3 = true;
+for ($x=0; $x<6; $x++) {
+ for ($y=0; $y<6; $y++) {
+ $p3 = $p3 && (imagecolorat($im, $x,$y)!=0x00ff00);
+ }
+}
+if ($p3) {
+ echo "Outside 1: ok\n";
+}
+
+$im = imagecreatetruecolor(6,6);
+imagefill($im, 0,0, 0xffffff);
+imageline($im, -12, -12, -23,-23, 0x00ff00);
+$p3 = true;
+for ($x=0; $x<6; $x++) {
+ for ($y=0; $y<6; $y++) {
+ $p3 = $p3 && (imagecolorat($im, $x,$y)!=0x00ff00);
+ }
+}
+if ($p3) {
+ echo "Outside 2: ok\n";
+}
+
+$im = imagecreatetruecolor(6,6);
+imagefill($im, 0,0, 0xffffff);
+imageline($im, -1, -1, 4,4, 0x00ff00);
+$p3 = true;
+for ($x=0; $x<5; $x++) {
+ for ($y=0; $y<5; $y++) {
+ $p3 = $p3 && (imagecolorat($im, $x,$y)==0x00ff00);
+ }
+}
+if ($p3) {
+ echo "Outside 2: ok\n";
+}
+
+
+?>
+--EXPECTF--
+
+Warning: Wrong parameter count for imageline() in %s on line %d
+Horizontal: ok
+Vertical: ok
+Diagonal: ok
+Outside 1: ok
+Outside 2: ok
diff --git a/ext/gd/tests/src.gd2 b/ext/gd/tests/src.gd2
new file mode 100644
index 000000000..1c64b46d9
--- /dev/null
+++ b/ext/gd/tests/src.gd2
Binary files differ
diff --git a/ext/gd/tests/src.wbmp b/ext/gd/tests/src.wbmp
new file mode 100644
index 000000000..d38c74268
--- /dev/null
+++ b/ext/gd/tests/src.wbmp
Binary files differ
diff --git a/ext/gd/tests/test_gif_2.gif b/ext/gd/tests/test_gif_2.gif
new file mode 100644
index 000000000..332ec8b41
--- /dev/null
+++ b/ext/gd/tests/test_gif_2.gif
Binary files differ
diff --git a/ext/gd/tests/truecolor.phpt b/ext/gd/tests/truecolor.phpt
new file mode 100644
index 000000000..9e30cbe29
--- /dev/null
+++ b/ext/gd/tests/truecolor.phpt
@@ -0,0 +1,19 @@
+--TEST--
+imageistruecolor, truecolortopalette
+--SKIPIF--
+<?php
+ if (!function_exists('imagetruecolortopalette')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+$im = imagecreatetruecolor(1,1);
+if (imageistruecolor($im)) echo "ok\n";
+
+if (imagetruecolortopalette($im, 1,2)) echo "ok\n";
+if (!imageistruecolor($im)) echo "ok\n";
+
+?>
+--EXPECTF--
+ok
+ok
+ok
diff --git a/ext/gd/tests/types.phpt b/ext/gd/tests/types.phpt
new file mode 100644
index 000000000..0b79e78d1
--- /dev/null
+++ b/ext/gd/tests/types.phpt
@@ -0,0 +1,33 @@
+--TEST--
+imagetypes
+--SKIPIF--
+<?php
+ if (!function_exists('imagetypes')) die("skip gd extension not available\n");
+?>
+--FILE--
+<?php
+$flags = imagetypes();
+
+if ($flags&0x1 && !function_exists("imagegif")) {
+ echo "gif failed\n";
+}
+
+if ($flags&0x2 && !function_exists("imagejpeg")) {
+ echo "jpeg failed\n";
+}
+
+if ($flags&0x4 && !function_exists("imagepng")) {
+ echo "png failed\n";
+}
+
+if ($flags&0x8 && !function_exists("imagewbmp")) {
+ echo "wbmp failed\n";
+}
+
+if ($flags&16 && !function_exists("imagecreatefromxpm")) {
+ echo "xom failed\n";
+}
+echo "ok\n";
+?>
+--EXPECTF--
+ok
diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c
index 613b6c58b..60c6cb3b8 100644
--- a/ext/gettext/gettext.c
+++ b/ext/gettext/gettext.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gettext.c,v 1.46.2.2 2006/01/01 12:50:07 sniper Exp $ */
+/* $Id: gettext.c,v 1.46.2.2.2.2 2006/09/05 10:36:24 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -30,27 +30,96 @@
#include "ext/standard/info.h"
#include "php_gettext.h"
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_textdomain, 0)
+ ZEND_ARG_INFO(0, domain)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gettext, 0)
+ ZEND_ARG_INFO(0, msgid)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dgettext, 0)
+ ZEND_ARG_INFO(0, domain_name)
+ ZEND_ARG_INFO(0, msgid)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dcgettext, 0)
+ ZEND_ARG_INFO(0, domain_name)
+ ZEND_ARG_INFO(0, msgid)
+ ZEND_ARG_INFO(0, category)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_bindtextdomain, 0)
+ ZEND_ARG_INFO(0, domain_name)
+ ZEND_ARG_INFO(0, dir)
+ZEND_END_ARG_INFO()
+
+#if HAVE_NGETTEXT
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ngettext, 0)
+ ZEND_ARG_INFO(0, msgid1)
+ ZEND_ARG_INFO(0, msgid2)
+ ZEND_ARG_INFO(0, count)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_DNGETTEXT
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dngettext, 0)
+ ZEND_ARG_INFO(0, domain)
+ ZEND_ARG_INFO(0, msgid1)
+ ZEND_ARG_INFO(0, msgid2)
+ ZEND_ARG_INFO(0, count)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_DCNGETTEXT
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dcngettext, 0)
+ ZEND_ARG_INFO(0, domain)
+ ZEND_ARG_INFO(0, msgid1)
+ ZEND_ARG_INFO(0, msgid2)
+ ZEND_ARG_INFO(0, count)
+ ZEND_ARG_INFO(0, category)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_BIND_TEXTDOMAIN_CODESET
+static
+ZEND_BEGIN_ARG_INFO(arginfo_bind_textdomain_codeset, 0)
+ ZEND_ARG_INFO(0, domain)
+ ZEND_ARG_INFO(0, codeset)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+
/* {{{ php_gettext_functions[]
*/
zend_function_entry php_gettext_functions[] = {
- PHP_NAMED_FE(textdomain, zif_textdomain, NULL)
- PHP_NAMED_FE(gettext, zif_gettext, NULL)
+ PHP_NAMED_FE(textdomain, zif_textdomain, arginfo_textdomain)
+ PHP_NAMED_FE(gettext, zif_gettext, arginfo_gettext)
/* 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)
+ PHP_NAMED_FE(_, zif_gettext, arginfo_gettext)
+ PHP_NAMED_FE(dgettext, zif_dgettext, arginfo_dgettext)
+ PHP_NAMED_FE(dcgettext, zif_dcgettext, arginfo_dcgettext)
+ PHP_NAMED_FE(bindtextdomain, zif_bindtextdomain, arginfo_bindtextdomain)
#if HAVE_NGETTEXT
- PHP_NAMED_FE(ngettext, zif_ngettext, NULL)
+ PHP_NAMED_FE(ngettext, zif_ngettext, arginfo_ngettext)
#endif
#if HAVE_DNGETTEXT
- PHP_NAMED_FE(dngettext, zif_dngettext, NULL)
+ PHP_NAMED_FE(dngettext, zif_dngettext, arginfo_dngettext)
#endif
#if HAVE_DCNGETTEXT
- PHP_NAMED_FE(dcngettext, zif_dcngettext, NULL)
+ PHP_NAMED_FE(dcngettext, zif_dcngettext, arginfo_dcngettext)
#endif
#if HAVE_BIND_TEXTDOMAIN_CODESET
- PHP_NAMED_FE(bind_textdomain_codeset, zif_bind_textdomain_codeset, NULL)
+ PHP_NAMED_FE(bind_textdomain_codeset, zif_bind_textdomain_codeset, arginfo_bind_textdomain_codeset)
#endif
{NULL, NULL, NULL}
};
@@ -258,7 +327,7 @@ PHP_NAMED_FUNCTION(zif_dcngettext)
RETVAL_FALSE;
- if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(4, &domain, &msgid1, &msgid2, &count, &category) == FAILURE) {
+ if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &domain, &msgid1, &msgid2, &count, &category) == FAILURE) {
WRONG_PARAM_COUNT;
} else {
char* msgstr = NULL;
diff --git a/ext/gettext/tests/dcngettext.phpt b/ext/gettext/tests/dcngettext.phpt
new file mode 100644
index 000000000..e5961eb1e
--- /dev/null
+++ b/ext/gettext/tests/dcngettext.phpt
@@ -0,0 +1,30 @@
+--TEST--
+dcngettext() tests
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) die("skip");
+if (!function_exists("dcngettext")) die("skip dcngettext() doesn't exist");
+?>
+--FILE--
+<?php
+
+var_dump(dcngettext(1,1,1,1));
+var_dump(dcngettext(1,1,1,1,1));
+var_dump(dcngettext("test","test","test",1,1));
+var_dump(dcngettext("test","test","test",0,0));
+var_dump(dcngettext("test","test","test",-1,-1));
+var_dump(dcngettext("","","",1,1));
+var_dump(dcngettext("","","",0,0));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for dcngettext() in %s on line %d
+bool(false)
+string(1) "1"
+string(4) "test"
+string(4) "test"
+string(4) "test"
+string(0) ""
+string(0) ""
+Done
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index c946b8ff9..e97977a77 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -37,48 +37,282 @@
/* True global resources - no need for thread safety here */
static int le_gmp;
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_init, 0, 0, 1)
+ ZEND_ARG_INFO(0, number)
+ ZEND_ARG_INFO(0, base)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_intval, 0)
+ ZEND_ARG_INFO(0, gmpnumber)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_strval, 0, 0, 1)
+ ZEND_ARG_INFO(0, gmpnumber)
+ ZEND_ARG_INFO(0, base)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_add, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_sub, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_mul, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_div_qr, 0, 0, 2)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ ZEND_ARG_INFO(0, round)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_div_r, 0, 0, 2)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ ZEND_ARG_INFO(0, round)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_div_q, 0, 0, 2)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ ZEND_ARG_INFO(0, round)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_mod, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_divexact, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_neg, 0)
+ ZEND_ARG_INFO(0, a)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_abs, 0)
+ ZEND_ARG_INFO(0, a)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_fact, 0)
+ ZEND_ARG_INFO(0, a)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_pow, 0)
+ ZEND_ARG_INFO(0, base)
+ ZEND_ARG_INFO(0, exp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_powm, 0)
+ ZEND_ARG_INFO(0, base)
+ ZEND_ARG_INFO(0, exp)
+ ZEND_ARG_INFO(0, mod)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_sqrt, 0)
+ ZEND_ARG_INFO(0, a)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_sqrtrem, 0)
+ ZEND_ARG_INFO(0, a)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_perfect_square, 0)
+ ZEND_ARG_INFO(0, a)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_prob_prime, 0, 0, 1)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, reps)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_gcd, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_gcdext, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_invert, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_jacobi, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_legendre, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_cmp, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_sign, 0)
+ ZEND_ARG_INFO(0, a)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_random, 0, 0, 0)
+ ZEND_ARG_INFO(0, limiter)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_and, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_or, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_com, 0)
+ ZEND_ARG_INFO(0, a)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_xor, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_setbit, 0, 0, 2)
+ ZEND_ARG_INFO(1, a)
+ ZEND_ARG_INFO(0, index)
+ ZEND_ARG_INFO(0, set_clear)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_clrbit, 0)
+ ZEND_ARG_INFO(1, a)
+ ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_popcount, 0)
+ ZEND_ARG_INFO(0, a)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_hamdist, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, b)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_scan0, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, start)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_scan1, 0)
+ ZEND_ARG_INFO(0, a)
+ ZEND_ARG_INFO(0, start)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gmp_nextprime, 0)
+ ZEND_ARG_INFO(0, a)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
+ZEND_DECLARE_MODULE_GLOBALS(gmp)
+static ZEND_GINIT_FUNCTION(gmp);
+
/* {{{ gmp_functions[]
*/
zend_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)
+ ZEND_FE(gmp_init, arginfo_gmp_init)
+ ZEND_FE(gmp_intval, arginfo_gmp_intval)
+ ZEND_FE(gmp_strval, arginfo_gmp_strval)
+ ZEND_FE(gmp_add, arginfo_gmp_add)
+ ZEND_FE(gmp_sub, arginfo_gmp_sub)
+ ZEND_FE(gmp_mul, arginfo_gmp_mul)
+ ZEND_FE(gmp_div_qr, arginfo_gmp_div_qr)
+ ZEND_FE(gmp_div_q, arginfo_gmp_div_q)
+ ZEND_FE(gmp_div_r, arginfo_gmp_div_r)
+ ZEND_FALIAS(gmp_div, gmp_div_q, arginfo_gmp_div_q)
+ ZEND_FE(gmp_mod, arginfo_gmp_mod)
+ ZEND_FE(gmp_divexact, arginfo_gmp_divexact)
+ ZEND_FE(gmp_neg, arginfo_gmp_neg)
+ ZEND_FE(gmp_abs, arginfo_gmp_abs)
+ ZEND_FE(gmp_fact, arginfo_gmp_fact)
+ ZEND_FE(gmp_sqrt, arginfo_gmp_sqrt)
+ ZEND_FE(gmp_sqrtrem, arginfo_gmp_sqrtrem)
+ ZEND_FE(gmp_pow, arginfo_gmp_pow)
+ ZEND_FE(gmp_powm, arginfo_gmp_powm)
+ ZEND_FE(gmp_perfect_square, arginfo_gmp_perfect_square)
+ ZEND_FE(gmp_prob_prime, arginfo_gmp_prob_prime)
+ ZEND_FE(gmp_gcd, arginfo_gmp_gcd)
+ ZEND_FE(gmp_gcdext, arginfo_gmp_gcdext)
+ ZEND_FE(gmp_invert, arginfo_gmp_invert)
+ ZEND_FE(gmp_jacobi, arginfo_gmp_jacobi)
+ ZEND_FE(gmp_legendre, arginfo_gmp_legendre)
+ ZEND_FE(gmp_cmp, arginfo_gmp_cmp)
+ ZEND_FE(gmp_sign, arginfo_gmp_sign)
+ ZEND_FE(gmp_random, arginfo_gmp_random)
+ ZEND_FE(gmp_and, arginfo_gmp_and)
+ ZEND_FE(gmp_or, arginfo_gmp_or)
+ ZEND_FE(gmp_com, arginfo_gmp_com)
+ ZEND_FE(gmp_xor, arginfo_gmp_xor)
+ ZEND_FE(gmp_setbit, arginfo_gmp_setbit)
+ ZEND_FE(gmp_clrbit, arginfo_gmp_clrbit)
+ ZEND_FE(gmp_scan0, arginfo_gmp_scan0)
+ ZEND_FE(gmp_scan1, arginfo_gmp_scan1)
+ ZEND_FE(gmp_popcount, arginfo_gmp_popcount)
+ ZEND_FE(gmp_hamdist, arginfo_gmp_hamdist)
+ ZEND_FE(gmp_nextprime, arginfo_gmp_nextprime)
{NULL, NULL, NULL} /* Must be the last line in gmp_functions[] */
};
/* }}} */
@@ -95,17 +329,16 @@ zend_module_entry gmp_module_entry = {
ZEND_MODULE_DEACTIVATE_N(gmp),
ZEND_MODULE_INFO_N(gmp),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ ZEND_MODULE_GLOBALS(gmp),
+ ZEND_GINIT(gmp),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
-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);
@@ -140,9 +373,9 @@ static void gmp_efree(void *ptr, size_t size)
}
/* }}} */
-/* {{{ php_gmp_init_globals
+/* {{{ ZEND_GINIT_FUNCTION
*/
-static void php_gmp_init_globals(zend_gmp_globals *gmp_globals)
+static ZEND_GINIT_FUNCTION(gmp)
{
gmp_globals->rand_initialized = 0;
}
@@ -152,8 +385,6 @@ static void php_gmp_init_globals(zend_gmp_globals *gmp_globals)
*/
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);
@@ -1199,6 +1430,14 @@ ZEND_FUNCTION(gmp_com)
}
/* }}} */
+/* {{{ proto resource gmp_nextprime(resource a)
+ Finds next prime of a */
+ZEND_FUNCTION(gmp_nextprime)
+{
+ gmp_unary_op(mpz_nextprime);
+}
+/* }}} */
+
/* {{{ proto resource gmp_xor(resource a, resource b)
Calculates logical exclusive OR of a and b */
ZEND_FUNCTION(gmp_xor)
@@ -1374,6 +1613,6 @@ static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
* tab-width: 4
* c-basic-offset: 4
* End:
- * vim600: sw=4 ts=4 fdm=marker
- * vim<600: sw=4 ts=4
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
*/
diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h
index 7ad54723f..5af361597 100644
--- a/ext/gmp/php_gmp.h
+++ b/ext/gmp/php_gmp.h
@@ -75,6 +75,7 @@ ZEND_FUNCTION(gmp_scan0);
ZEND_FUNCTION(gmp_scan1);
ZEND_FUNCTION(gmp_popcount);
ZEND_FUNCTION(gmp_hamdist);
+ZEND_FUNCTION(gmp_nextprime);
ZEND_BEGIN_MODULE_GLOBALS(gmp)
zend_bool rand_initialized;
diff --git a/ext/gmp/tests/004.phpt b/ext/gmp/tests/004.phpt
new file mode 100644
index 000000000..d093c04d5
--- /dev/null
+++ b/ext/gmp/tests/004.phpt
@@ -0,0 +1,45 @@
+--TEST--
+gmp_intval() tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gmp_intval(1,1));
+var_dump(gmp_intval(""));
+var_dump(gmp_intval(1.0001));
+var_dump(gmp_intval("1.0001"));
+var_dump(gmp_intval("-1"));
+var_dump(gmp_intval(-1));
+var_dump(gmp_intval(-2349828));
+var_dump(gmp_intval(2342344));
+var_dump(gmp_intval(new stdclass));
+var_dump(gmp_intval(array()));
+
+$fp = fopen(__FILE__, 'r');
+var_dump(gmp_intval($fp));
+
+$g = gmp_init("12345678");
+var_dump(gmp_intval($g));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for gmp_intval() in %s on line %d
+NULL
+int(0)
+int(1)
+int(1)
+int(-1)
+int(-1)
+int(-2349828)
+int(2342344)
+
+Notice: Object of class stdClass could not be converted to int in %s on line %d
+int(1)
+int(0)
+
+Warning: gmp_intval(): supplied resource is not a valid GMP integer resource in %s on line %d
+bool(false)
+int(12345678)
+Done
diff --git a/ext/gmp/tests/005.phpt b/ext/gmp/tests/005.phpt
new file mode 100644
index 000000000..482e7217a
--- /dev/null
+++ b/ext/gmp/tests/005.phpt
@@ -0,0 +1,68 @@
+--TEST--
+gmp_strval() tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gmp_strval());
+var_dump(gmp_strval(""));
+var_dump(gmp_strval("", ""));
+var_dump(gmp_strval("", -1));
+var_dump(gmp_strval(-1, ""));
+
+$fp = fopen(__FILE__, "r");
+var_dump(gmp_strval($fp));
+
+$g = gmp_init("9765456");
+var_dump(gmp_strval($g));
+var_dump(gmp_strval($g, -1));
+var_dump(gmp_strval($g, 100000));
+var_dump(gmp_strval($g, 10));
+
+$g = gmp_init("-3373333");
+var_dump(gmp_strval($g));
+var_dump(gmp_strval($g, -1));
+var_dump(gmp_strval($g, 100000));
+var_dump(gmp_strval($g, 10));
+
+var_dump(gmp_strval(array(1,2), array(1,2)));
+var_dump(gmp_strval(new stdclass, new stdclass));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for gmp_strval() in %s on line %d
+NULL
+bool(false)
+bool(false)
+bool(false)
+
+Warning: gmp_strval(): Bad base for conversion: 0 in %s on line %d
+bool(false)
+
+Warning: gmp_strval(): supplied resource is not a valid GMP integer resource in %s on line %d
+bool(false)
+string(7) "9765456"
+
+Warning: gmp_strval(): Bad base for conversion: -1 in %s on line %d
+bool(false)
+
+Warning: gmp_strval(): Bad base for conversion: 100000 in %s on line %d
+bool(false)
+string(7) "9765456"
+string(8) "-3373333"
+
+Warning: gmp_strval(): Bad base for conversion: -1 in %s on line %d
+bool(false)
+
+Warning: gmp_strval(): Bad base for conversion: 100000 in %s on line %d
+bool(false)
+string(8) "-3373333"
+
+Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+
+Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+Done
diff --git a/ext/gmp/tests/006.phpt b/ext/gmp/tests/006.phpt
new file mode 100644
index 000000000..2e207c197
--- /dev/null
+++ b/ext/gmp/tests/006.phpt
@@ -0,0 +1,50 @@
+--TEST--
+gmp_sub() tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gmp_sub());
+var_dump(gmp_sub(""));
+var_dump(gmp_sub("", ""));
+var_dump(gmp_sub("", "", ""));
+var_dump(gmp_sub(array(), array()));
+
+var_dump($g = gmp_sub(10000, 10001));
+var_dump(gmp_strval($g));
+var_dump($g = gmp_sub(10000, -1));
+var_dump(gmp_strval($g));
+var_dump($g = gmp_sub(10000, new stdclass));
+var_dump(gmp_strval($g));
+var_dump($g = gmp_sub(new stdclass, 100));
+var_dump(gmp_strval($g));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for gmp_sub() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for gmp_sub() in %s on line %d
+NULL
+bool(false)
+
+Warning: Wrong parameter count for gmp_sub() in %s on line %d
+NULL
+
+Warning: gmp_sub(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+resource(%d) of type (GMP integer)
+string(2) "-1"
+resource(%d) of type (GMP integer)
+string(5) "10001"
+
+Warning: gmp_sub(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+string(1) "0"
+
+Warning: gmp_sub(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+string(1) "0"
+Done
diff --git a/ext/gmp/tests/007.phpt b/ext/gmp/tests/007.phpt
new file mode 100644
index 000000000..d69981610
--- /dev/null
+++ b/ext/gmp/tests/007.phpt
@@ -0,0 +1,133 @@
+--TEST--
+gmp_div_qr() tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gmp_div_qr());
+var_dump(gmp_div_qr(""));
+
+var_dump($r = gmp_div_qr(0,1));
+var_dump(gmp_strval($r[0]));
+var_dump(gmp_strval($r[1]));
+var_dump($r = gmp_div_qr(1,0));
+var_dump($r = gmp_div_qr(12653,23482734));
+var_dump(gmp_strval($r[0]));
+var_dump(gmp_strval($r[1]));
+var_dump($r = gmp_div_qr(12653,23482734, 10));
+var_dump(gmp_strval($r[0]));
+var_dump(gmp_strval($r[1]));
+var_dump($r = gmp_div_qr(1123123,123));
+var_dump(gmp_strval($r[0]));
+var_dump(gmp_strval($r[1]));
+var_dump($r = gmp_div_qr(1123123,123, 1));
+var_dump(gmp_strval($r[0]));
+var_dump(gmp_strval($r[1]));
+var_dump($r = gmp_div_qr(1123123,123, 2));
+var_dump(gmp_strval($r[0]));
+var_dump(gmp_strval($r[1]));
+var_dump($r = gmp_div_qr(1123123,123, GMP_ROUND_ZERO));
+var_dump(gmp_strval($r[0]));
+var_dump(gmp_strval($r[1]));
+var_dump($r = gmp_div_qr(1123123,123, GMP_ROUND_PLUSINF));
+var_dump(gmp_strval($r[0]));
+var_dump(gmp_strval($r[1]));
+var_dump($r = gmp_div_qr(1123123,123, GMP_ROUND_MINUSINF));
+var_dump(gmp_strval($r[0]));
+var_dump(gmp_strval($r[1]));
+
+$fp = fopen(__FILE__, 'r');
+
+var_dump(gmp_div_qr($fp, $fp));
+var_dump(gmp_div_qr(array(), array()));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for gmp_div_qr() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for gmp_div_qr() in %s on line %d
+NULL
+array(2) {
+ [0]=>
+ resource(%d) of type (GMP integer)
+ [1]=>
+ resource(%d) of type (GMP integer)
+}
+string(1) "0"
+string(1) "0"
+
+Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d
+bool(false)
+array(2) {
+ [0]=>
+ resource(%d) of type (GMP integer)
+ [1]=>
+ resource(%d) of type (GMP integer)
+}
+string(1) "0"
+string(5) "12653"
+NULL
+
+Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+
+Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+array(2) {
+ [0]=>
+ resource(%d) of type (GMP integer)
+ [1]=>
+ resource(%d) of type (GMP integer)
+}
+string(4) "9131"
+string(2) "10"
+array(2) {
+ [0]=>
+ resource(%d) of type (GMP integer)
+ [1]=>
+ resource(%d) of type (GMP integer)
+}
+string(4) "9132"
+string(4) "-113"
+array(2) {
+ [0]=>
+ resource(%d) of type (GMP integer)
+ [1]=>
+ resource(%d) of type (GMP integer)
+}
+string(4) "9131"
+string(2) "10"
+array(2) {
+ [0]=>
+ resource(%d) of type (GMP integer)
+ [1]=>
+ resource(%d) of type (GMP integer)
+}
+string(4) "9131"
+string(2) "10"
+array(2) {
+ [0]=>
+ resource(%d) of type (GMP integer)
+ [1]=>
+ resource(%d) of type (GMP integer)
+}
+string(4) "9132"
+string(4) "-113"
+array(2) {
+ [0]=>
+ resource(%d) of type (GMP integer)
+ [1]=>
+ resource(%d) of type (GMP integer)
+}
+string(4) "9131"
+string(2) "10"
+
+Warning: gmp_div_qr(): supplied resource is not a valid GMP integer resource in %s on line %d
+bool(false)
+
+Warning: gmp_div_qr(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+Done
diff --git a/ext/gmp/tests/008.phpt b/ext/gmp/tests/008.phpt
new file mode 100644
index 000000000..773719ec4
--- /dev/null
+++ b/ext/gmp/tests/008.phpt
@@ -0,0 +1,73 @@
+--TEST--
+gmp_div_r() tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gmp_div_r());
+var_dump(gmp_div_r(""));
+
+var_dump($r = gmp_div_r(0,1));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_r(1,0));
+var_dump($r = gmp_div_r(12653,23482734));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_r(12653,23482734, 10));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_r(1123123,123));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_r(1123123,123, 1));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_r(1123123,123, 2));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_r(1123123,123, GMP_ROUND_ZERO));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_r(1123123,123, GMP_ROUND_PLUSINF));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_r(1123123,123, GMP_ROUND_MINUSINF));
+var_dump(gmp_strval($r));
+
+$fp = fopen(__FILE__, 'r');
+
+var_dump(gmp_div_r($fp, $fp));
+var_dump(gmp_div_r(array(), array()));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for gmp_div_r() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for gmp_div_r() in %s on line %d
+NULL
+int(0)
+string(1) "0"
+
+Warning: gmp_div_r(): Zero operand not allowed in %s on line %d
+bool(false)
+int(12653)
+string(5) "12653"
+NULL
+
+Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+int(10)
+string(2) "10"
+int(113)
+string(3) "113"
+int(10)
+string(2) "10"
+int(10)
+string(2) "10"
+int(113)
+string(3) "113"
+int(10)
+string(2) "10"
+
+Warning: gmp_div_r(): supplied resource is not a valid GMP integer resource in %s on line %d
+bool(false)
+
+Warning: gmp_div_r(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+Done
diff --git a/ext/gmp/tests/009.phpt b/ext/gmp/tests/009.phpt
new file mode 100644
index 000000000..559cc17f2
--- /dev/null
+++ b/ext/gmp/tests/009.phpt
@@ -0,0 +1,73 @@
+--TEST--
+gmp_div_q() tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gmp_div_q());
+var_dump(gmp_div_q(""));
+
+var_dump($r = gmp_div_q(0,1));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_q(1,0));
+var_dump($r = gmp_div_q(12653,23482734));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_q(12653,23482734, 10));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_q(1123123,123));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_q(1123123,123, 1));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_q(1123123,123, 2));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_q(1123123,123, GMP_ROUND_ZERO));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_q(1123123,123, GMP_ROUND_PLUSINF));
+var_dump(gmp_strval($r));
+var_dump($r = gmp_div_q(1123123,123, GMP_ROUND_MINUSINF));
+var_dump(gmp_strval($r));
+
+$fp = fopen(__FILE__, 'r');
+
+var_dump(gmp_div_q($fp, $fp));
+var_dump(gmp_div_q(array(), array()));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for gmp_div_q() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for gmp_div_q() in %s on line %d
+NULL
+resource(%d) of type (GMP integer)
+string(1) "0"
+
+Warning: gmp_div_q(): Zero operand not allowed in %s on line %d
+bool(false)
+resource(%d) of type (GMP integer)
+string(1) "0"
+NULL
+
+Warning: gmp_strval(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+resource(%d) of type (GMP integer)
+string(4) "9131"
+resource(%d) of type (GMP integer)
+string(4) "9132"
+resource(%d) of type (GMP integer)
+string(4) "9131"
+resource(%d) of type (GMP integer)
+string(4) "9131"
+resource(%d) of type (GMP integer)
+string(4) "9132"
+resource(%d) of type (GMP integer)
+string(4) "9131"
+
+Warning: gmp_div_q(): supplied resource is not a valid GMP integer resource in %s on line %d
+bool(false)
+
+Warning: gmp_div_q(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+Done
diff --git a/ext/gmp/tests/010.phpt b/ext/gmp/tests/010.phpt
new file mode 100644
index 000000000..5ddc2c53c
--- /dev/null
+++ b/ext/gmp/tests/010.phpt
@@ -0,0 +1,40 @@
+--TEST--
+gmp_mod tests()
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gmp_mod());
+var_dump(gmp_mod(""));
+var_dump(gmp_mod("",""));
+var_dump(gmp_mod(0,1));
+var_dump(gmp_mod(0,-1));
+var_dump(gmp_mod(-1,0));
+
+var_dump(gmp_mod(array(), array()));
+
+$a = gmp_init("-100000000");
+$b = gmp_init("353467");
+
+var_dump(gmp_mod($a, $b));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for gmp_mod() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for gmp_mod() in %s on line %d
+NULL
+bool(false)
+int(0)
+resource(%d) of type (GMP integer)
+
+Warning: gmp_mod(): Zero operand not allowed in %s on line %d
+bool(false)
+
+Warning: gmp_mod(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+resource(%d) of type (GMP integer)
+Done
diff --git a/ext/gmp/tests/gmp_nextprime.phpt b/ext/gmp/tests/gmp_nextprime.phpt
new file mode 100644
index 000000000..84d945b3f
--- /dev/null
+++ b/ext/gmp/tests/gmp_nextprime.phpt
@@ -0,0 +1,40 @@
+--TEST--
+gmp_nextprime()
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+$n = gmp_nextprime(-1);
+var_dump(gmp_strval($n));
+$n = gmp_nextprime(0);
+var_dump(gmp_strval($n));
+$n = gmp_nextprime(-1000);
+var_dump(gmp_strval($n));
+$n = gmp_nextprime(1000);
+var_dump(gmp_strval($n));
+$n = gmp_nextprime(100000);
+var_dump(gmp_strval($n));
+$n = gmp_nextprime(array());
+var_dump(gmp_strval($n));
+$n = gmp_nextprime("");
+var_dump(gmp_strval($n));
+$n = gmp_nextprime(new stdclass());
+var_dump(gmp_strval($n));
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(1) "2"
+string(1) "2"
+string(4) "-997"
+string(4) "1009"
+string(6) "100003"
+
+Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
+string(1) "0"
+string(1) "0"
+
+Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
+string(1) "0"
+Done
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index acb6c625a..15aaa1bb7 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hash.c,v 1.18.2.5 2006/01/01 12:50:07 sniper Exp $ */
+/* $Id: hash.c,v 1.18.2.5.2.3 2006/07/28 14:27:03 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -43,7 +43,7 @@ PHP_HASH_API php_hash_ops *php_hash_fetch_ops(const char *algo, int algo_len)
char *lower = estrndup(algo, algo_len);
zend_str_tolower(lower, algo_len);
- if (SUCCESS != zend_hash_find(&php_hash_hashtable, lower, algo_len + 1, (void**)&ops)) {
+ if (SUCCESS != zend_hash_find(&php_hash_hashtable, lower, algo_len + 1, (void*)&ops)) {
ops = NULL;
}
efree(lower);
@@ -97,15 +97,15 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename)
int n;
while ((n = php_stream_read(stream, buf, sizeof(buf))) > 0) {
- ops->hash_update(context, buf, n);
+ ops->hash_update(context, (unsigned char *) buf, n);
}
php_stream_close(stream);
} else {
- ops->hash_update(context, data, data_len);
+ ops->hash_update(context, (unsigned char *) data, data_len);
}
digest = emalloc(ops->digest_size + 1);
- ops->hash_final(digest, context);
+ ops->hash_final((unsigned char *) digest, context);
efree(context);
if (raw_output) {
@@ -114,7 +114,7 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename)
} else {
char *hex_digest = safe_emalloc(ops->digest_size, 2, 1);
- php_hash_bin2hex(hex_digest, digest, ops->digest_size);
+ php_hash_bin2hex(hex_digest, (unsigned char *) digest, ops->digest_size);
hex_digest[2 * ops->digest_size] = 0;
efree(digest);
RETURN_STRINGL(hex_digest, 2 * ops->digest_size, 0);
@@ -172,8 +172,8 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename)
if (key_len > ops->block_size) {
/* Reduce the key first */
- ops->hash_update(context, key, key_len);
- ops->hash_final(K, context);
+ ops->hash_update(context, (unsigned char *) key, key_len);
+ ops->hash_final((unsigned char *) K, context);
/* Make the context ready to start over */
ops->hash_init(context);
} else {
@@ -184,22 +184,22 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename)
for(i=0; i < ops->block_size; i++) {
K[i] ^= 0x36;
}
- ops->hash_update(context, K, ops->block_size);
+ ops->hash_update(context, (unsigned char *) K, ops->block_size);
if (isfilename) {
char buf[1024];
int n;
while ((n = php_stream_read(stream, buf, sizeof(buf))) > 0) {
- ops->hash_update(context, buf, n);
+ ops->hash_update(context, (unsigned char *) buf, n);
}
php_stream_close(stream);
} else {
- ops->hash_update(context, data, data_len);
+ ops->hash_update(context, (unsigned char *) data, data_len);
}
digest = emalloc(ops->digest_size + 1);
- ops->hash_final(digest, context);
+ ops->hash_final((unsigned char *) digest, context);
/* Convert K to opad -- 0x6A = 0x36 ^ 0x5C */
for(i=0; i < ops->block_size; i++) {
@@ -208,9 +208,9 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename)
/* Feed this result into the outter hash */
ops->hash_init(context);
- ops->hash_update(context, K, ops->block_size);
- ops->hash_update(context, digest, ops->digest_size);
- ops->hash_final(digest, context);
+ ops->hash_update(context, (unsigned char *) K, ops->block_size);
+ ops->hash_update(context, (unsigned char *) digest, ops->digest_size);
+ ops->hash_final((unsigned char *) digest, context);
/* Zero the key */
memset(K, 0, ops->block_size);
@@ -223,7 +223,7 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename)
} else {
char *hex_digest = safe_emalloc(ops->digest_size, 2, 1);
- php_hash_bin2hex(hex_digest, digest, ops->digest_size);
+ php_hash_bin2hex(hex_digest, (unsigned char *) digest, ops->digest_size);
hex_digest[2 * ops->digest_size] = 0;
efree(digest);
RETURN_STRINGL(hex_digest, 2 * ops->digest_size, 0);
@@ -292,8 +292,8 @@ PHP_FUNCTION(hash_init)
if (key_len > ops->block_size) {
/* Reduce the key first */
- ops->hash_update(context, key, key_len);
- ops->hash_final(K, context);
+ ops->hash_update(context, (unsigned char *) key, key_len);
+ ops->hash_final((unsigned char *) K, context);
/* Make the context ready to start over */
ops->hash_init(context);
} else {
@@ -304,8 +304,8 @@ PHP_FUNCTION(hash_init)
for(i=0; i < ops->block_size; i++) {
K[i] ^= 0x36;
}
- ops->hash_update(context, K, ops->block_size);
- hash->key = K;
+ ops->hash_update(context, (unsigned char *) K, ops->block_size);
+ hash->key = (unsigned char *) K;
}
ZEND_REGISTER_RESOURCE(return_value, hash, php_hash_le_hash);
@@ -327,7 +327,7 @@ PHP_FUNCTION(hash_update)
ZEND_FETCH_RESOURCE(hash, php_hash_data*, &zhash, -1, PHP_HASH_RESNAME, php_hash_le_hash);
- hash->ops->hash_update(hash->context, data, data_len);
+ hash->ops->hash_update(hash->context, (unsigned char *) data, data_len);
RETURN_TRUE;
}
@@ -361,7 +361,7 @@ PHP_FUNCTION(hash_update_stream)
/* Nada mas */
RETURN_LONG(didread);
}
- hash->ops->hash_update(hash->context, buf, n);
+ hash->ops->hash_update(hash->context, (unsigned char *) buf, n);
length -= n;
didread += n;
}
@@ -395,7 +395,7 @@ PHP_FUNCTION(hash_update_file)
}
while ((n = php_stream_read(stream, buf, sizeof(buf))) > 0) {
- hash->ops->hash_update(hash->context, buf, n);
+ hash->ops->hash_update(hash->context, (unsigned char *) buf, n);
}
php_stream_close(stream);
@@ -422,7 +422,7 @@ PHP_FUNCTION(hash_final)
digest_len = hash->ops->digest_size;
digest = emalloc(digest_len + 1);
- hash->ops->hash_final(digest, hash->context);
+ hash->ops->hash_final((unsigned char *) digest, hash->context);
if (hash->options & PHP_HASH_HMAC) {
int i;
@@ -433,9 +433,9 @@ PHP_FUNCTION(hash_final)
/* Feed this result into the outter hash */
hash->ops->hash_init(hash->context);
- hash->ops->hash_update(hash->context, hash->key, hash->ops->block_size);
- hash->ops->hash_update(hash->context, digest, hash->ops->digest_size);
- hash->ops->hash_final(digest, hash->context);
+ hash->ops->hash_update(hash->context, (unsigned char *) hash->key, hash->ops->block_size);
+ hash->ops->hash_update(hash->context, (unsigned char *) digest, hash->ops->digest_size);
+ hash->ops->hash_final((unsigned char *) digest, hash->context);
/* Zero the key */
memset(hash->key, 0, hash->ops->block_size);
@@ -447,7 +447,7 @@ PHP_FUNCTION(hash_final)
hash->context = NULL;
/* zend_list_REAL_delete() */
- if (zend_hash_index_find(&EG(regular_list), Z_RESVAL_P(zhash), (void **) &le)==SUCCESS) {
+ if (zend_hash_index_find(&EG(regular_list), Z_RESVAL_P(zhash), (void *) &le)==SUCCESS) {
/* This is a hack to avoid letting the resource hide elsewhere (like in separated vars)
FETCH_RESOURCE is intelligent enough to handle dealing with any issues this causes */
le->refcount = 1;
@@ -459,7 +459,7 @@ PHP_FUNCTION(hash_final)
} else {
char *hex_digest = safe_emalloc(digest_len,2,1);
- php_hash_bin2hex(hex_digest, digest, digest_len);
+ php_hash_bin2hex(hex_digest, (unsigned char *) digest, digest_len);
hex_digest[2 * digest_len] = 0;
efree(digest);
RETURN_STRINGL(hex_digest, 2 * digest_len, 0);
@@ -473,8 +473,9 @@ PHP_FUNCTION(hash_algos)
{
HashPosition pos;
char *str;
- int str_len;
- long idx, type;
+ uint str_len;
+ long type;
+ ulong idx;
array_init(return_value);
for(zend_hash_internal_pointer_reset_ex(&php_hash_hashtable, &pos);
@@ -493,7 +494,7 @@ static void php_hash_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
/* Just in case the algo has internally allocated resources */
if (hash->context) {
- char *dummy = emalloc(hash->ops->digest_size);
+ unsigned char *dummy = emalloc(hash->ops->digest_size);
hash->ops->hash_final(dummy, hash->context);
efree(dummy);
efree(hash->context);
@@ -578,7 +579,8 @@ PHP_MINFO_FUNCTION(hash)
HashPosition pos;
char buffer[2048];
char *s = buffer, *e = s + sizeof(buffer), *str;
- long idx, type;
+ ulong idx;
+ long type;
for(zend_hash_internal_pointer_reset_ex(&php_hash_hashtable, &pos);
(type = zend_hash_get_current_key_ex(&php_hash_hashtable, &str, NULL, &idx, 0, &pos)) != HASH_KEY_NON_EXISTANT;
@@ -588,38 +590,136 @@ PHP_MINFO_FUNCTION(hash)
*s = 0;
php_info_print_table_start();
- php_info_print_table_header(2, "hash support", "enabled");
- php_info_print_table_header(2, "Hashing Engines", buffer);
+ php_info_print_table_row(2, "hash support", "enabled");
+ php_info_print_table_row(2, "Hashing Engines", buffer);
php_info_print_table_end();
}
/* }}} */
+/* {{{ arginfo */
+#ifdef PHP_HASH_MD5_NOT_IN_CORE
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_md5, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_md5_file, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef PHP_HASH_SHA1_NOT_IN_CORE
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_sha1, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_sha1_file, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hash, 0, 0, 2)
+ ZEND_ARG_INFO(0, algo)
+ ZEND_ARG_INFO(0, data)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_file, 0, 0, 2)
+ ZEND_ARG_INFO(0, algo)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_hmac, 0, 0, 3)
+ ZEND_ARG_INFO(0, algo)
+ ZEND_ARG_INFO(0, data)
+ ZEND_ARG_INFO(0, key)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_hmac_file, 0, 0, 3)
+ ZEND_ARG_INFO(0, algo)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, key)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_init, 0, 0, 1)
+ ZEND_ARG_INFO(0, algo)
+ ZEND_ARG_INFO(0, options)
+ ZEND_ARG_INFO(0, key)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_hash_update, 0)
+ ZEND_ARG_INFO(0, context)
+ ZEND_ARG_INFO(0, data)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_update_stream, 0, 0, 2)
+ ZEND_ARG_INFO(0, context)
+ ZEND_ARG_INFO(0, handle)
+ ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_update_file, 0, 0, 2)
+ ZEND_ARG_INFO(0, context)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_final, 0, 0, 1)
+ ZEND_ARG_INFO(0, context)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_hash_algos, 0)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
/* {{{ hash_functions[]
*/
zend_function_entry hash_functions[] = {
- PHP_FE(hash, NULL)
- PHP_FE(hash_file, NULL)
+ PHP_FE(hash, arginfo_hash)
+ PHP_FE(hash_file, arginfo_hash_file)
- PHP_FE(hash_hmac, NULL)
- PHP_FE(hash_hmac_file, NULL)
+ PHP_FE(hash_hmac, arginfo_hash_hmac)
+ PHP_FE(hash_hmac_file, arginfo_hash_hmac_file)
- PHP_FE(hash_init, NULL)
- PHP_FE(hash_update, NULL)
- PHP_FE(hash_update_stream, NULL)
- PHP_FE(hash_update_file, NULL)
- PHP_FE(hash_final, NULL)
+ PHP_FE(hash_init, arginfo_hash_init)
+ PHP_FE(hash_update, arginfo_hash_update)
+ PHP_FE(hash_update_stream, arginfo_hash_update_stream)
+ PHP_FE(hash_update_file, arginfo_hash_update_file)
+ PHP_FE(hash_final, arginfo_hash_final)
- PHP_FE(hash_algos, NULL)
+ PHP_FE(hash_algos, arginfo_hash_algos)
/* BC Land */
#ifdef PHP_HASH_MD5_NOT_IN_CORE
- PHP_NAMED_FE(md5, php_if_md5, NULL)
- PHP_NAMED_FE(md5_file, php_if_md5_file, NULL)
+ PHP_NAMED_FE(md5, php_if_md5, arginfo_hash_md5)
+ PHP_NAMED_FE(md5_file, php_if_md5_file, arginfo_hash_md5_file)
#endif /* PHP_HASH_MD5_NOT_IN_CORE */
#ifdef PHP_HASH_SHA1_NOT_IN_CORE
- PHP_NAMED_FE(sha1, php_if_sha1, NULL)
- PHP_NAMED_FE(sha1_file, php_if_sha1_file, NULL)
+ PHP_NAMED_FE(sha1, php_if_sha1, arginfo_hash_sha1)
+ PHP_NAMED_FE(sha1_file, php_if_sha1_file, arginfo_hash_sha1_file)
#endif /* PHP_HASH_SHA1_NOT_IN_CORE */
{NULL, NULL, NULL}
diff --git a/ext/hwapi/CREDITS b/ext/hwapi/CREDITS
deleted file mode 100644
index 8416199c5..000000000
--- 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 194b47be0..000000000
--- a/ext/hwapi/config.m4
+++ /dev/null
@@ -1,35 +0,0 @@
-dnl $Id: config.m4,v 1.3 2002/09/19 20:14:33 derick Exp $
-
-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 7058057ba..000000000
--- a/ext/hwapi/hwapi.cpp
+++ /dev/null
@@ -1,5023 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable 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: hwapi.cpp,v 1.12.2.3 2006/01/01 12:50:07 sniper Exp $ */
-
-#include <stdlib.h>
-#include <errno.h>
-
-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 <winsock.h>
-#endif
-#ifdef HAVE_MMAP
-#include <sys/mman.h>
-#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 <sdk/api/api.h>
-#include <sdk/hgcsp/apihgcsp.h>
-//}
-//#endif
-
-zend_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 zend_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 zend_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 zend_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 zend_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 zend_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 zend_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; i<strings.count(); i++) {
- HW_API_String str;
- strings.string(i, str);
- fprintf(stderr, "%s\n", str.string());
- }
-}
-
-static int stringArray2indexArray(zval **return_value, HW_API_StringArray *values) {
- array_init(*return_value);
- for (int i=0; i<values->count(); 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(zval **return_value, HW_API_ObjectArray *objarr) {
- array_init(*return_value);
-
- for(int i=0; i<objarr->count(); 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; j<count; j++) {
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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; i<count; i++) {
- ulong ind;
- char *key;
- zval **keydata;
- zend_hash_get_current_data(lht, (void **) &keydata);
- zend_hash_get_current_key(lht, &key, &ind, 0);
- switch((*keydata)->type) {
- 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) {
- zval **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) {
- zval **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; i<objarr.count(); 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;
- for(i=0; i<objarr.count(); i++) {
- HW_API_Object obj;
- HW_API_Attribute attr;
- objarr.object(i, obj);
- obj.attribute("GOid", attr);
- add_next_index_string(return_value, (char *) attr.value().string(), 1);
- }
-}
-/* }}} */
-
-/* {{{ proto object hwapi_children(array parameters)
- */
-PHP_FUNCTION(hwapi_children) {
- 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_array_ex(arg1);
-
- id = getThis();
- db = (HW_API_HGCSP *) php_hwapi_get_object(id, le_hwapip);
-
- if(!db) {
- RETURN_FALSE;
- }
-
- in = make_HW_API_children_In(*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();
- }
-
- 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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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) {
- zval **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_zval_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; i<count; i++) {
- zval *keydata, **keydataptr;
- zend_hash_get_current_data(lht, (void **) &keydataptr);
- /* FIXME: just hope this doesn't do any harm. Maybe convert_to_string
- * changes the type of the array element */
- convert_to_string_ex(keydataptr);
- keydata = *keydataptr;
- values.insert(keydata->value.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) {{{
- *
- */
-zval hw_api_class_get_property(zend_property_reference *property_reference) {
- zval 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;
- }
- zval_dtor(&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, zval *value) {{{
- */
-int hw_api_class_set_property(zend_property_reference *property_reference, zval *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;
- }
- zval_dtor(&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) {{{
- */
-zval hw_api_object_class_get_property(zend_property_reference *property_reference) {
- zval 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;
- }
- zval_dtor(&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, zval *value) {{{
- */
-int hw_api_object_class_set_property(zend_property_reference *property_reference, zval *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;
- }
- zval_dtor(&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) {{{
- */
-zval hw_api_attribute_class_get_property(zend_property_reference *property_reference) {
- zval 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;
- }
- zval_dtor(&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, zval *value) {{{
- */
-int hw_api_attribute_class_set_property(zend_property_reference *property_reference, zval *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;
- }
- zval_dtor(&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 6c698c6dd..000000000
--- a/ext/hwapi/php_hwapi.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable 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 <rasmus@lerdorf.on.ca> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id: php_hwapi.h,v 1.4.2.1 2006/01/01 12:50:07 sniper Exp $ */
-
-#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/iconv.c b/ext/iconv/iconv.c
index b646399a2..b945ed30e 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: iconv.c,v 1.124.2.8 2006/04/27 00:50:54 moriyoshi Exp $ */
+/* $Id: iconv.c,v 1.124.2.8.2.7 2006/09/12 17:26:34 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -62,24 +62,104 @@
#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))
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_strlen, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_substr, 0, 0, 2)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, offset)
+ ZEND_ARG_INFO(0, length)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_strpos, 0, 0, 2)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ ZEND_ARG_INFO(0, offset)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_strrpos, 0, 0, 2)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_mime_encode, 0, 0, 2)
+ ZEND_ARG_INFO(0, field_name)
+ ZEND_ARG_INFO(0, field_value)
+ ZEND_ARG_INFO(0, preference) /* ZEND_ARG_ARRAY_INFO(0, preference, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_mime_decode, 0, 0, 1)
+ ZEND_ARG_INFO(0, encoded_string)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_mime_decode_headers, 0, 0, 1)
+ ZEND_ARG_INFO(0, headers)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_iconv, 0)
+ ZEND_ARG_INFO(0, in_charset)
+ ZEND_ARG_INFO(0, out_charset)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ob_iconv_handler, 0)
+ ZEND_ARG_INFO(0, contents)
+ ZEND_ARG_INFO(0, status)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_iconv_set_encoding, 0)
+ ZEND_ARG_INFO(0, type)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_get_encoding, 0, 0, 0)
+ ZEND_ARG_INFO(0, type)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
/* {{{ iconv_functions[]
*/
zend_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)
+ PHP_NAMED_FE(iconv,php_if_iconv, arginfo_iconv)
+ PHP_FE(ob_iconv_handler, arginfo_ob_iconv_handler)
+ PHP_FE(iconv_get_encoding, arginfo_iconv_get_encoding)
+ PHP_FE(iconv_set_encoding, arginfo_iconv_set_encoding)
+ PHP_FE(iconv_strlen, arginfo_iconv_strlen)
+ PHP_FE(iconv_substr, arginfo_iconv_substr)
+ PHP_FE(iconv_strpos, arginfo_iconv_strpos)
+ PHP_FE(iconv_strrpos, arginfo_iconv_strrpos)
+ PHP_FE(iconv_mime_encode, arginfo_iconv_mime_encode)
+ PHP_FE(iconv_mime_decode, arginfo_iconv_mime_decode)
+ PHP_FE(iconv_mime_decode_headers, arginfo_iconv_mime_decode_headers)
{NULL, NULL, NULL}
};
/* }}} */
+ZEND_DECLARE_MODULE_GLOBALS(iconv)
+static PHP_GINIT_FUNCTION(iconv);
+
/* {{{ iconv_module_entry
*/
zend_module_entry iconv_module_entry = {
@@ -92,16 +172,27 @@ zend_module_entry iconv_module_entry = {
NULL,
PHP_MINFO(miconv),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(iconv),
+ PHP_GINIT(iconv),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
-ZEND_DECLARE_MODULE_GLOBALS(iconv)
-
#ifdef COMPILE_DL_ICONV
ZEND_GET_MODULE(iconv)
#endif
+/* {{{ PHP_GINIT_FUNCTION */
+static PHP_GINIT_FUNCTION(iconv)
+{
+ iconv_globals->input_encoding = NULL;
+ iconv_globals->output_encoding = NULL;
+ iconv_globals->internal_encoding = NULL;
+}
+/* }}} */
+
#ifdef HAVE_LIBICONV
#define iconv libiconv
#endif
@@ -151,21 +242,11 @@ PHP_INI_BEGIN()
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
@@ -1078,7 +1159,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
prev_in_left = in_left;
- encoded = php_base64_encode(buf, (int)(out_size - out_left), &dummy);
+ encoded = (char *) php_base64_encode((unsigned char *) buf, (int)(out_size - out_left), &dummy);
encoded_len = (size_t)dummy;
if (char_cnt < encoded_len) {
@@ -1748,7 +1829,7 @@ static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset,
case PHP_ICONV_ERR_TOO_BIG:
/* should not happen */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Run out of buffer");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Buffer length exceeded");
break;
case PHP_ICONV_ERR_MALFORMED:
@@ -1802,7 +1883,6 @@ PHP_FUNCTION(iconv_substr)
char *str;
int str_len;
long offset, length;
- zval *len_z = NULL;
php_iconv_err_t err;
@@ -1810,17 +1890,14 @@ PHP_FUNCTION(iconv_substr)
charset = ICONVG(internal_encoding);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|zs",
- &str, &str_len, &offset, &len_z,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ls",
+ &str, &str_len, &offset, &length,
&charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
- if (len_z == NULL) {
+ if (ZEND_NUM_ARGS() < 3) {
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);
@@ -1839,7 +1916,7 @@ PHP_FUNCTION(iconv_substr)
}
/* }}} */
-/* {{{ proto int iconv_strpos(string haystack, string needle, int offset [, string charset])
+/* {{{ 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)
{
@@ -1869,6 +1946,10 @@ PHP_FUNCTION(iconv_strpos)
RETURN_FALSE;
}
+ if (ndl_len < 1) {
+ 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);
@@ -1904,6 +1985,10 @@ PHP_FUNCTION(iconv_strrpos)
RETURN_FALSE;
}
+ if (ndl_len < 1) {
+ 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);
@@ -1916,7 +2001,7 @@ PHP_FUNCTION(iconv_strrpos)
}
/* }}} */
-/* {{{ proto string iconv_mime_encode(string field_name, string field_value, [, array preference])
+/* {{{ 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)
{
@@ -2197,7 +2282,7 @@ PHP_FUNCTION(ob_iconv_handler)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &zv_string, &status) == FAILURE)
return;
- convert_to_string_ex(&zv_string);
+ convert_to_string(zv_string);
if (SG(sapi_headers).mimetype &&
strncasecmp(SG(sapi_headers).mimetype, "text/", 5) == 0) {
@@ -2300,6 +2385,7 @@ typedef struct _php_iconv_stream_filter {
char stub[128];
size_t stub_len;
} php_iconv_stream_filter;
+/* }}} iconv stream filter */
/* {{{ php_iconv_stream_filter_dtor */
static void php_iconv_stream_filter_dtor(php_iconv_stream_filter *self)
@@ -2547,6 +2633,7 @@ out_failure:
pefree(out_buf, persistent);
return FAILURE;
}
+/* }}} php_iconv_stream_filter_append_bucket */
/* {{{ php_iconv_stream_filter_do_filter */
static php_stream_filter_status_t php_iconv_stream_filter_do_filter(
diff --git a/ext/iconv/tests/bug37176.phpt b/ext/iconv/tests/bug37176.phpt
index 3923dbd49..2bcc57c69 100644
--- a/ext/iconv/tests/bug37176.phpt
+++ b/ext/iconv/tests/bug37176.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #37176 (iconv_strpos() fails to find a string)
+--SKIPIF--
+<?php include('skipif.inc'); ?>
--FILE--
<?php
var_dump(iconv_strpos('11--','1-',0,'UTF-8'));
diff --git a/ext/iconv/tests/iconv_strpos.phpt b/ext/iconv/tests/iconv_strpos.phpt
index ccf4ea74a..6965f6fae 100644
--- a/ext/iconv/tests/iconv_strpos.phpt
+++ b/ext/iconv/tests/iconv_strpos.phpt
@@ -31,6 +31,10 @@ foo(str_repeat("abcab", 60)."abcdb".str_repeat("adabc", 60), "abcd", 0);
foo(str_repeat("¤¢¤¤¤¦¤¨¤ª", 30)."¤¤¤¦¤ª¤¨¤¢".str_repeat("¤¢¤¤¤¨¤ª¤¦", 30), "¤¦¤ª", 0, "EUC-JP");
$str = str_repeat("¤¢¤¤¤¦¤¨¤ª", 60).'$'.str_repeat("¤¢¤¤¤¨¤ª¤¦", 60);
foo($str, '$', 0, "ISO-2022-JP", "EUC-JP");
+
+var_dump(iconv_strpos("string", ""));
+var_dump(iconv_strpos("", "string"));
+
?>
--EXPECTF--
2: %s
@@ -50,3 +54,5 @@ int(302)
int(151)
int(1)
int(300)
+bool(false)
+bool(false)
diff --git a/ext/iconv/tests/iconv_strrpos.phpt b/ext/iconv/tests/iconv_strrpos.phpt
index f150f8842..ee977f2c3 100644
--- a/ext/iconv/tests/iconv_strrpos.phpt
+++ b/ext/iconv/tests/iconv_strrpos.phpt
@@ -32,6 +32,10 @@ for ($i = 0; $i <=6; ++$i) {
$str = str_repeat("¤¢¤¤¤¦¤¨¤ª", 60).str_repeat('$', $i).str_repeat("¤¢¤¤¤¨¤ª¤¦", 60);
foo($str, '$', "ISO-2022-JP", "EUC-JP");
}
+
+var_dump(iconv_strrpos("string", ""));
+var_dump(iconv_strrpos("", "string"));
+
?>
--EXPECT--
int(14)
@@ -54,3 +58,5 @@ int(605)
int(304)
int(606)
int(305)
+bool(false)
+bool(false)
diff --git a/ext/imap/config.m4 b/ext/imap/config.m4
index 3fb2ba70b..e9f82669f 100644
--- a/ext/imap/config.m4
+++ b/ext/imap/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.69 2005/05/29 23:16:41 sniper Exp $
+dnl $Id: config.m4,v 1.69.4.1 2006/09/24 18:06:37 iliaa Exp $
dnl
AC_DEFUN([IMAP_INC_CHK],[if test -r "$i$1/c-client.h"; then
@@ -114,6 +114,11 @@ if test "$PHP_IMAP" != "no"; then
AC_EGREP_HEADER(mail_fetch_overview_sequence, $IMAP_INC_DIR/mail.h, [
AC_DEFINE(HAVE_IMAP2004,1,[ ])
])
+
+ dnl Check for new version of the utf8_mime2text() function
+ AC_EGREP_HEADER(mail_append_set, $IMAP_INC_DIR/mail.h, [
+ AC_DEFINE(HAVE_NEW_MIME2TEXT,1,[ ])
+ ])
dnl Check for c-client version 2001
old_CPPFLAGS=$CPPFLAGS
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 9b07924f6..1d394c4ac 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -26,7 +26,7 @@
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_imap.c,v 1.208.2.9 2006/08/11 15:07:13 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.7 2006/10/05 14:25:41 tony2001 Exp $ */
#define IMAP41
@@ -75,11 +75,17 @@ static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DA
void rfc822_date(char *date);
char *cpystr(const char *str);
char *cpytxt(SIZEDTEXT *dst, char *text, unsigned long size);
+#ifndef HAVE_NEW_MIME2TEXT
long utf8_mime2text(SIZEDTEXT *src, SIZEDTEXT *dst);
+#else
+long utf8_mime2text (SIZEDTEXT *src, SIZEDTEXT *dst, long flags);
+#endif
unsigned long find_rightmost_bit(unsigned long *valptr);
void fs_give(void **block);
void *fs_get(size_t size);
+ZEND_DECLARE_MODULE_GLOBALS(imap)
+static PHP_GINIT_FUNCTION(imap);
/* {{{ imap_functions[]
*/
@@ -175,12 +181,14 @@ zend_module_entry imap_module_entry = {
PHP_RSHUTDOWN(imap),
PHP_MINFO(imap),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(imap),
+ PHP_GINIT(imap),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
-ZEND_DECLARE_MODULE_GLOBALS(imap)
-
#ifdef COMPILE_DL_IMAP
ZEND_GET_MODULE(imap)
#endif
@@ -397,9 +405,9 @@ void mail_getacl(MAILSTREAM *stream, char *mailbox, ACLLIST *alist)
#endif
-/* {{{ php_imap_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
-static void php_imap_init_globals(zend_imap_globals *imap_globals)
+static PHP_GINIT_FUNCTION(imap)
{
imap_globals->imap_user = NIL;
imap_globals->imap_password = NIL;
@@ -433,8 +441,6 @@ 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 */
@@ -1874,14 +1880,14 @@ PHP_FUNCTION(imap_fetchbody)
Save a specific body section to a file */
PHP_FUNCTION(imap_savebody)
{
- zval *stream, *out;
+ zval *stream, **out;
pils *imap_ptr = NULL;
php_stream *writer = NULL;
char *section = "";
int section_len = 0, close_stream = 1;
long msgno, flags = 0;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzl|sl", &stream, &out, &msgno, &section, &section_len, &flags)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZl|sl", &stream, &out, &msgno, &section, &section_len, &flags)) {
RETURN_FALSE;
}
@@ -1891,17 +1897,17 @@ PHP_FUNCTION(imap_savebody)
RETURN_FALSE;
}
- switch (Z_TYPE_P(out))
+ switch (Z_TYPE_PP(out))
{
case IS_LONG:
case IS_RESOURCE:
close_stream = 0;
- php_stream_from_zval(writer, &out);
+ php_stream_from_zval(writer, out);
break;
default:
- convert_to_string_ex(&out);
- writer = php_stream_open_wrapper(Z_STRVAL_P(out), "wb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
+ convert_to_string_ex(out);
+ writer = php_stream_open_wrapper(Z_STRVAL_PP(out), "wb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
break;
}
@@ -2175,8 +2181,16 @@ PHP_FUNCTION(imap_utf8)
dest.size = 0;
cpytxt(&src, Z_STRVAL_PP(str), Z_STRLEN_PP(str));
+
+#ifndef HAVE_NEW_MIME2TEXT
utf8_mime2text(&src, &dest);
- RETURN_STRINGL(dest.data, strlen(dest.data), 1);
+#else
+ utf8_mime2text(&src, &dest, U8T_CANONICAL);
+#endif
+ RETVAL_STRINGL(dest.data, dest.size, 1);
+ if (dest.data) {
+ free(dest.data);
+ }
}
/* }}} */
diff --git a/ext/imap/tests/imap_utf8.phpt b/ext/imap/tests/imap_utf8.phpt
new file mode 100644
index 000000000..dd432862f
--- /dev/null
+++ b/ext/imap/tests/imap_utf8.phpt
@@ -0,0 +1,22 @@
+--TEST--
+imap_utf8() tests
+--SKIPIF--
+<?php if (!extension_loaded("imap")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(imap_utf8(""));
+var_dump(imap_utf8(1));
+var_dump(imap_utf8(array(1,2)));
+var_dump(imap_utf8("test"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(0) ""
+string(1) "1"
+
+Notice: Array to string conversion in %s on line %d
+string(5) "Array"
+string(4) "test"
+Done
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index 8bf92a6a0..41abb23ff 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: interbase.c,v 1.225.2.4 2006/01/01 12:50:08 sniper Exp $ */
+/* $Id: interbase.c,v 1.225.2.4.2.1 2006/06/15 18:33:07 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -43,6 +43,9 @@
#define COMMIT 1
#define RETAIN 2
+ZEND_DECLARE_MODULE_GLOBALS(ibase)
+static PHP_GINIT_FUNCTION(ibase);
+
/* {{{ extension definition structures */
zend_function_entry ibase_functions[] = {
PHP_FE(ibase_connect, NULL)
@@ -178,7 +181,11 @@ zend_module_entry ibase_module_entry = {
PHP_RSHUTDOWN(ibase),
PHP_MINFO(ibase),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(ibase),
+ PHP_GINIT(ibase),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
#ifdef COMPILE_DL_INTERBASE
@@ -188,8 +195,6 @@ ZEND_GET_MODULE(ibase)
/* True globals, no need for thread safety */
int le_link, le_plink, le_trans;
-ZEND_DECLARE_MODULE_GLOBALS(ibase)
-
/* }}} */
/* error handling ---------------------------- */
@@ -448,7 +453,7 @@ PHP_INI_BEGIN()
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)
+static PHP_GINIT_FUNCTION(ibase)
{
ibase_globals->num_persistent = ibase_globals->num_links = 0;
ibase_globals->sql_code = *ibase_globals->errmsg = 0;
@@ -457,8 +462,6 @@ static void php_ibase_init_globals(zend_ibase_globals *ibase_globals)
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);
diff --git a/ext/json/CREDITS b/ext/json/CREDITS
new file mode 100644
index 000000000..dba45eb56
--- /dev/null
+++ b/ext/json/CREDITS
@@ -0,0 +1,2 @@
+JSON
+Omar Kilani
diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c
new file mode 100644
index 000000000..dce42d37e
--- /dev/null
+++ b/ext/json/JSON_parser.c
@@ -0,0 +1,757 @@
+/* JSON_parser.c */
+
+/* 2005-12-30 */
+
+/*
+Copyright (c) 2005 JSON.org
+
+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.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+
+#include "JSON_parser.h"
+#include <stdio.h>
+
+#define true 1
+#define false 0
+
+/*
+ Characters are mapped into these 32 symbol classes. This allows for
+ significant reductions in the size of the state transition table.
+*/
+
+/* error */
+#define S_ERR -1
+
+/* space */
+#define S_SPA 0
+
+/* other whitespace */
+#define S_WSP 1
+
+/* { */
+#define S_LBE 2
+
+/* } */
+#define S_RBE 3
+
+/* [ */
+#define S_LBT 4
+
+/* ] */
+#define S_RBT 5
+
+/* : */
+#define S_COL 6
+
+/* , */
+#define S_COM 7
+
+/* " */
+#define S_QUO 8
+
+/* \ */
+#define S_BAC 9
+
+/* / */
+#define S_SLA 10
+
+/* + */
+#define S_PLU 11
+
+/* - */
+#define S_MIN 12
+
+/* . */
+#define S_DOT 13
+
+/* 0 */
+#define S_ZER 14
+
+/* 123456789 */
+#define S_DIG 15
+
+/* a */
+#define S__A_ 16
+
+/* b */
+#define S__B_ 17
+
+/* c */
+#define S__C_ 18
+
+/* d */
+#define S__D_ 19
+
+/* e */
+#define S__E_ 20
+
+/* f */
+#define S__F_ 21
+
+/* l */
+#define S__L_ 22
+
+/* n */
+#define S__N_ 23
+
+/* r */
+#define S__R_ 24
+
+/* s */
+#define S__S_ 25
+
+/* t */
+#define S__T_ 26
+
+/* u */
+#define S__U_ 27
+
+/* ABCDF */
+#define S_A_F 28
+
+/* E */
+#define S_E 29
+
+/* everything else */
+#define S_ETC 30
+
+
+/*
+ This table maps the 128 ASCII characters into the 32 character classes.
+ The remaining Unicode characters should be mapped to S_ETC.
+*/
+static const int ascii_class[128] = {
+ S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR,
+ S_ERR, S_WSP, S_WSP, S_ERR, S_ERR, S_WSP, S_ERR, S_ERR,
+ S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR,
+ S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR, S_ERR,
+
+ S_SPA, S_ETC, S_QUO, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC,
+ S_ETC, S_ETC, S_ETC, S_PLU, S_COM, S_MIN, S_DOT, S_SLA,
+ S_ZER, S_DIG, S_DIG, S_DIG, S_DIG, S_DIG, S_DIG, S_DIG,
+ S_DIG, S_DIG, S_COL, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC,
+
+ S_ETC, S_A_F, S_A_F, S_A_F, S_A_F, S_E , S_A_F, S_ETC,
+ S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC,
+ S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC, S_ETC,
+ S_ETC, S_ETC, S_ETC, S_LBT, S_BAC, S_RBT, S_ETC, S_ETC,
+
+ S_ETC, S__A_, S__B_, S__C_, S__D_, S__E_, S__F_, S_ETC,
+ S_ETC, S_ETC, S_ETC, S_ETC, S__L_, S_ETC, S__N_, S_ETC,
+ S_ETC, S_ETC, S__R_, S__S_, S__T_, S__U_, S_ETC, S_ETC,
+ S_ETC, S_ETC, S_ETC, S_LBE, S_ETC, S_RBE, S_ETC, S_ETC
+};
+
+
+/*
+ The state transition table takes the current state and the current symbol,
+ and returns either a new state or an action. A new state is a number between
+ 0 and 29. An action is a negative number between -1 and -9. A JSON text is
+ accepted if the end of the text is in state 9 and mode is MODE_DONE.
+*/
+static const int state_transition_table[30][31] = {
+/* 0*/ { 0, 0,-8,-1,-6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
+/* 1*/ { 1, 1,-1,-9,-1,-1,-1,-1, 3,-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,-8,-1,-6,-5,-1,-1, 3,-1,-1,-1,20,-1,21,22,-1,-1,-1,-1,-1,13,-1,17,-1,-1,10,-1,-1,-1,-1},
+/* 3*/ { 3,-1, 3, 3, 3, 3, 3, 3,-4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
+/* 4*/ {-1,-1,-1,-1,-1,-1,-1,-1, 3, 3, 3,-1,-1,-1,-1,-1,-1, 3,-1,-1,-1, 3,-1, 3, 3,-1, 3, 5,-1,-1,-1},
+/* 5*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 6, 6, 6, 6, 6, 6, 6, 6,-1,-1,-1,-1,-1,-1, 6, 6,-1},
+/* 6*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 7, 7, 7, 7, 7, 7, 7, 7,-1,-1,-1,-1,-1,-1, 7, 7,-1},
+/* 7*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 8, 8, 8, 8, 8, 8, 8, 8,-1,-1,-1,-1,-1,-1, 8, 8,-1},
+/* 8*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 3, 3, 3, 3, 3, 3, 3, 3,-1,-1,-1,-1,-1,-1, 3, 3,-1},
+/* 9*/ { 9, 9,-1,-7,-1,-5,-1,-3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
+/*10*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,-1,-1,-1,-1,-1,-1},
+/*11*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,12,-1,-1,-1},
+/*12*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
+/*13*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,14,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
+/*14*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,15,-1,-1,-1,-1,-1,-1,-1,-1},
+/*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,16,-1,-1,-1,-1,-1},
+/*16*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
+/*17*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,18,-1,-1,-1},
+/*18*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19,-1,-1,-1,-1,-1,-1,-1,-1},
+/*19*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 9,-1,-1,-1,-1,-1,-1,-1,-1},
+/*20*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,21,22,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
+/*21*/ { 9, 9,-1,-7,-1,-5,-1,-3,-1,-1,-1,-1,-1,23,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
+/*22*/ { 9, 9,-1,-7,-1,-5,-1,-3,-1,-1,-1,-1,-1,23,22,22,-1,-1,-1,-1,24,-1,-1,-1,-1,-1,-1,-1,-1,24,-1},
+/*23*/ { 9, 9,-1,-7,-1,-5,-1,-3,-1,-1,-1,-1,-1,-1,23,23,-1,-1,-1,-1,24,-1,-1,-1,-1,-1,-1,-1,-1,24,-1},
+/*24*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,25,25,-1,26,26,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
+/*25*/ {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,26,26,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
+/*26*/ { 9, 9,-1,-7,-1,-5,-1,-3,-1,-1,-1,-1,-1,-1,26,26,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
+/*27*/ {27,27,-1,-1,-1,-1,-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},
+/*28*/ {28,28,-8,-1,-6,-1,-1,-1, 3,-1,-1,-1,20,-1,21,22,-1,-1,-1,-1,-1,13,-1,17,-1,-1,10,-1,-1,-1,-1},
+/*29*/ {29,29,-1,-1,-1,-1,-1,-1, 3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
+};
+
+#define JSON_PARSER_MAX_DEPTH 20
+
+
+/*
+ A stack maintains the states of nested structures.
+*/
+
+typedef struct json_parser
+{
+ int the_stack[JSON_PARSER_MAX_DEPTH];
+ zval *the_zstack[JSON_PARSER_MAX_DEPTH];
+ int the_top;
+} json_parser;
+
+
+/*
+ These modes can be pushed on the PDA stack.
+*/
+#define MODE_DONE 1
+#define MODE_KEY 2
+#define MODE_OBJECT 3
+#define MODE_ARRAY 4
+
+/*
+ Push a mode onto the stack. Return false if there is overflow.
+*/
+static int
+push(json_parser *json, zval *z, int mode)
+{
+ json->the_top += 1;
+ if (json->the_top >= JSON_PARSER_MAX_DEPTH) {
+ return false;
+ }
+
+ json->the_stack[json->the_top] = mode;
+ return true;
+}
+
+
+/*
+ Pop the stack, assuring that the current mode matches the expectation.
+ Return false if there is underflow or if the modes mismatch.
+*/
+static int
+pop(json_parser *json, zval *z, int mode)
+{
+ if (json->the_top < 0 || json->the_stack[json->the_top] != mode) {
+ return false;
+ }
+ json->the_stack[json->the_top] = 0;
+ json->the_top -= 1;
+
+ return true;
+}
+
+
+static int dehexchar(char c)
+{
+ if (c >= '0' && c <= '9')
+ {
+ 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;
+ }
+}
+
+
+static void json_create_zval(zval **z, smart_str *buf, int type)
+{
+ ALLOC_INIT_ZVAL(*z);
+
+ if (type == IS_LONG)
+ {
+ ZVAL_LONG(*z, atol(buf->c));
+ }
+ else if (type == IS_DOUBLE)
+ {
+ ZVAL_DOUBLE(*z, atof(buf->c));
+ }
+ else if (type == IS_STRING)
+ {
+ ZVAL_STRINGL(*z, buf->c, buf->len, 1);
+ }
+ else if (type == IS_BOOL)
+ {
+ ZVAL_BOOL(*z, (*(buf->c) == 't'));
+ }
+ else /* type == IS_NULL) || type unknown */
+ {
+ ZVAL_NULL(*z);
+ }
+}
+
+
+static void utf16_to_utf8(smart_str *buf, unsigned short utf16)
+{
+ if (utf16 < 0x80)
+ {
+ smart_str_appendc(buf, (unsigned char) utf16);
+ }
+ else if (utf16 < 0x800)
+ {
+ smart_str_appendc(buf, 0xc0 | (utf16 >> 6));
+ smart_str_appendc(buf, 0x80 | (utf16 & 0x3f));
+ }
+ else
+ {
+ smart_str_appendc(buf, 0xe0 | (utf16 >> 12));
+ smart_str_appendc(buf, 0x80 | ((utf16 >> 6) & 0x3f));
+ smart_str_appendc(buf, 0x80 | (utf16 & 0x3f));
+ }
+}
+
+static void attach_zval(json_parser *json, int up, int cur, smart_str *key, int assoc TSRMLS_DC)
+{
+ zval *root = json->the_zstack[up];
+ zval *child = json->the_zstack[cur];
+ int up_mode = json->the_stack[up];
+
+ if (up_mode == MODE_ARRAY)
+ {
+ add_next_index_zval(root, child);
+ }
+ else if (up_mode == MODE_OBJECT)
+ {
+ if (!assoc)
+ {
+ add_property_zval_ex(root, (key->len ? key->c : "_empty_"), (key->len ? (key->len + 1) : sizeof("_empty_")), child TSRMLS_CC);
+#if PHP_MAJOR_VERSION >= 5
+ ZVAL_DELREF(child);
+#endif
+ }
+ else
+ {
+ add_assoc_zval_ex(root, (key->len ? key->c : "_empty_"), (key->len ? (key->len + 1) : sizeof("_empty_")), child);
+ }
+ key->len = 0;
+ }
+}
+
+
+#define FREE_BUFFERS() do { smart_str_free(&buf); smart_str_free(&key); } while (0);
+#define SWAP_BUFFERS(from, to) do { \
+ char *t1 = from.c; \
+ int t2 = from.a; \
+ from.c = to.c; \
+ from.a = to.a; \
+ to.c = t1; \
+ to.a = t2; \
+ to.len = from.len; \
+ from.len = 0; \
+ } while(0);
+#define JSON_RESET_TYPE() do { type = -1; } while(0);
+#define JSON(x) the_json.x
+
+
+/*
+ The JSON_parser takes a UTF-16 encoded string and determines if it is a
+ syntactically correct JSON text. Along the way, it creates a PHP variable.
+
+ It is implemented as a Pushdown Automaton; that means it is a finite state
+ machine with a stack.
+*/
+int
+JSON_parser(zval *z, unsigned short p[], int length, int assoc TSRMLS_DC)
+{
+ int b; /* the next character */
+ int c; /* the next character class */
+ int s; /* the next state */
+ json_parser the_json; /* the parser state */
+ int the_state = 0;
+ int the_index;
+
+ smart_str buf = {0};
+ smart_str key = {0};
+
+ int type = -1;
+ unsigned short utf16 = 0;
+
+ JSON(the_top) = -1;
+ push(&the_json, z, MODE_DONE);
+
+ for (the_index = 0; the_index < length; the_index += 1) {
+ b = p[the_index];
+ if ((b & 127) == b) {
+ c = ascii_class[b];
+ if (c <= S_ERR) {
+ FREE_BUFFERS();
+ return false;
+ }
+ } else {
+ c = S_ETC;
+ }
+/*
+ Get the next state from the transition table.
+*/
+ s = state_transition_table[the_state][c];
+ if (s < 0) {
+/*
+ Perform one of the predefined actions.
+*/
+ switch (s) {
+/*
+ empty }
+*/
+ case -9:
+ if (!pop(&the_json, z, MODE_KEY)) {
+ FREE_BUFFERS();
+ return false;
+ }
+ the_state = 9;
+ break;
+/*
+ {
+*/
+ case -8:
+ if (!push(&the_json, z, MODE_KEY)) {
+ FREE_BUFFERS();
+ return false;
+ }
+
+ the_state = 1;
+ if (JSON(the_top) > 0)
+ {
+ zval *obj;
+
+ if (JSON(the_top) == 1)
+ {
+ obj = z;
+ }
+ else
+ {
+ ALLOC_INIT_ZVAL(obj);
+ }
+
+ if (!assoc)
+ {
+ object_init(obj);
+ }
+ else
+ {
+ array_init(obj);
+ }
+
+ JSON(the_zstack)[JSON(the_top)] = obj;
+
+ if (JSON(the_top) > 1)
+ {
+ attach_zval(&the_json, JSON(the_top-1), JSON(the_top), &key, assoc TSRMLS_CC);
+ }
+
+ JSON_RESET_TYPE();
+ }
+
+ break;
+/*
+ }
+*/
+ case -7:
+ if (type != -1 &&
+ (JSON(the_stack)[JSON(the_top)] == MODE_OBJECT ||
+ JSON(the_stack)[JSON(the_top)] == MODE_ARRAY))
+ {
+ zval *mval;
+ smart_str_0(&buf);
+
+ json_create_zval(&mval, &buf, type);
+
+ if (!assoc)
+ {
+ add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : "_empty_"), (key.len ? (key.len + 1) : sizeof("_empty_")), mval TSRMLS_CC);
+#if PHP_MAJOR_VERSION >= 5
+ ZVAL_DELREF(mval);
+#endif
+ }
+ else
+ {
+ add_assoc_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : "_empty_"), (key.len ? (key.len + 1) : sizeof("_empty_")), mval);
+ }
+ key.len = 0;
+ buf.len = 0;
+ JSON_RESET_TYPE();
+ }
+
+
+ if (!pop(&the_json, z, MODE_OBJECT)) {
+ FREE_BUFFERS();
+ return false;
+ }
+ the_state = 9;
+ break;
+/*
+ [
+*/
+ case -6:
+ if (!push(&the_json, z, MODE_ARRAY)) {
+ FREE_BUFFERS();
+ return false;
+ }
+ the_state = 2;
+
+ if (JSON(the_top) > 0)
+ {
+ zval *arr;
+
+ if (JSON(the_top) == 1)
+ {
+ arr = z;
+ }
+ else
+ {
+ ALLOC_INIT_ZVAL(arr);
+ }
+
+ array_init(arr);
+ JSON(the_zstack)[JSON(the_top)] = arr;
+
+ if (JSON(the_top) > 1)
+ {
+ attach_zval(&the_json, JSON(the_top-1), JSON(the_top), &key, assoc TSRMLS_CC);
+ }
+
+ JSON_RESET_TYPE();
+ }
+
+ break;
+/*
+ ]
+*/
+ case -5:
+ {
+ if (type != -1 &&
+ (JSON(the_stack)[JSON(the_top)] == MODE_OBJECT ||
+ JSON(the_stack)[JSON(the_top)] == MODE_ARRAY))
+ {
+ zval *mval;
+ smart_str_0(&buf);
+
+ json_create_zval(&mval, &buf, type);
+ add_next_index_zval(JSON(the_zstack)[JSON(the_top)], mval);
+ buf.len = 0;
+ JSON_RESET_TYPE();
+ }
+
+ if (!pop(&the_json, z, MODE_ARRAY)) {
+ FREE_BUFFERS();
+ return false;
+ }
+ the_state = 9;
+ }
+ break;
+/*
+ "
+*/
+ case -4:
+ switch (JSON(the_stack)[JSON(the_top)]) {
+ case MODE_KEY:
+ the_state = 27;
+ smart_str_0(&buf);
+ SWAP_BUFFERS(buf, key);
+ JSON_RESET_TYPE();
+ break;
+ case MODE_ARRAY:
+ case MODE_OBJECT:
+ the_state = 9;
+ break;
+ default:
+ FREE_BUFFERS();
+ return false;
+ }
+ break;
+/*
+ ,
+*/
+ case -3:
+ {
+ zval *mval;
+
+ if (type != -1 &&
+ (JSON(the_stack)[JSON(the_top)] == MODE_OBJECT ||
+ JSON(the_stack[JSON(the_top)]) == MODE_ARRAY))
+ {
+ smart_str_0(&buf);
+ json_create_zval(&mval, &buf, type);
+ }
+
+ switch (JSON(the_stack)[JSON(the_top)]) {
+ case MODE_OBJECT:
+ if (pop(&the_json, z, MODE_OBJECT) && push(&the_json, z, MODE_KEY)) {
+ if (type != -1)
+ {
+ if (!assoc)
+ {
+ add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : "_empty_"), (key.len ? (key.len + 1) : sizeof("_empty_")), mval TSRMLS_CC);
+#if PHP_MAJOR_VERSION >= 5
+ ZVAL_DELREF(mval);
+#endif
+ }
+ else
+ {
+ add_assoc_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : "_empty_"), (key.len ? (key.len + 1) : sizeof("_empty_")), mval);
+ }
+ key.len = 0;
+ }
+ the_state = 29;
+ }
+ break;
+ case MODE_ARRAY:
+ if (type != -1)
+ {
+ add_next_index_zval(JSON(the_zstack)[JSON(the_top)], mval);
+ }
+ the_state = 28;
+ break;
+ default:
+ FREE_BUFFERS();
+ return false;
+ }
+ buf.len = 0;
+ JSON_RESET_TYPE();
+ }
+ break;
+/*
+ :
+*/
+ case -2:
+ if (pop(&the_json, z, MODE_KEY) && push(&the_json, z, MODE_OBJECT)) {
+ the_state = 28;
+ break;
+ }
+/*
+ syntax error
+*/
+ case -1:
+ {
+ FREE_BUFFERS();
+ return false;
+ }
+ }
+ } else {
+/*
+ Change the state and iterate.
+*/
+ if (type == IS_STRING)
+ {
+ if (s == 3 && the_state != 8)
+ {
+ if (the_state != 4)
+ {
+ utf16_to_utf8(&buf, b);
+ }
+ else
+ {
+ switch (b)
+ {
+ case 'b':
+ smart_str_appendc(&buf, '\b');
+ break;
+ case 't':
+ smart_str_appendc(&buf, '\t');
+ break;
+ case 'n':
+ smart_str_appendc(&buf, '\n');
+ break;
+ case 'f':
+ smart_str_appendc(&buf, '\f');
+ break;
+ case 'r':
+ smart_str_appendc(&buf, '\r');
+ break;
+ default:
+ utf16_to_utf8(&buf, b);
+ break;
+ }
+ }
+ }
+ else if (s == 6)
+ {
+ utf16 = dehexchar(b) << 12;
+ }
+ else if (s == 7)
+ {
+ utf16 += dehexchar(b) << 8;
+ }
+ else if (s == 8)
+ {
+ utf16 += dehexchar(b) << 4;
+ }
+ else if (s == 3 && the_state == 8)
+ {
+ utf16 += dehexchar(b);
+ utf16_to_utf8(&buf, utf16);
+ }
+ }
+ else if (type < IS_LONG && (c == S_DIG || c == S_ZER))
+ {
+ type = IS_LONG;
+ smart_str_appendc(&buf, b);
+ }
+ else if (type == IS_LONG && s == 24)
+ {
+ type = IS_DOUBLE;
+ smart_str_appendc(&buf, b);
+ }
+ else if (type < IS_DOUBLE && c == S_DOT)
+ {
+ type = IS_DOUBLE;
+ smart_str_appendc(&buf, b);
+ }
+ else if (type < IS_STRING && c == S_QUO)
+ {
+ type = IS_STRING;
+ }
+ else if (type < IS_BOOL && ((the_state == 12 && s == 9) || (the_state == 16 && s == 9)))
+ {
+ type = IS_BOOL;
+ }
+ else if (type < IS_NULL && the_state == 19 && s == 9)
+ {
+ type = IS_NULL;
+ }
+ else if (type != IS_STRING && c > S_WSP)
+ {
+ utf16_to_utf8(&buf, b);
+ }
+
+ the_state = s;
+ }
+ }
+
+ FREE_BUFFERS();
+
+ return the_state == 9 && pop(&the_json, z, MODE_DONE);
+}
+
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/json/JSON_parser.h b/ext/json/JSON_parser.h
new file mode 100644
index 000000000..4790f728e
--- /dev/null
+++ b/ext/json/JSON_parser.h
@@ -0,0 +1,6 @@
+/* JSON_checker.h */
+
+#include "php.h"
+#include "ext/standard/php_smart_str.h"
+
+extern int JSON_parser(zval *z, unsigned short p[], int length, int assoc TSRMLS_DC);
diff --git a/ext/json/README b/ext/json/README
new file mode 100644
index 000000000..d680b0c59
--- /dev/null
+++ b/ext/json/README
@@ -0,0 +1,76 @@
+json 1.2.0
+==========
+
+This extension implements the JavaScript Object Notation (JSON)
+data-interchange format as specified in [0].
+
+Two functions are implemented: encoding and decoding. The decoding
+is handled by a parser based on JSON_checker[1] by Douglas Crockford.
+
+
+Function overview
+-----------------
+
+ string json_encode ( mixed value )
+
+json_encode returns a string containing the JSON representation of value.
+value can be any type except a resource.
+
+ mixed json_decode ( string json, [bool assoc] )
+
+json_decode takes a JSON string and converts it into a PHP variable.
+When assoc is given, and evaluates to TRUE, json_decode() will return
+any objects as associative arrays.
+
+
+Example usage
+-------------
+
+$arr = array("a"=>1,"b"=>2,"c"=>3,"d"=>4,"e"=>5);
+echo json_encode($arr);
+
+---> {"a":1,"b":2,"c":3,"d":4,"e":5}
+
+$json = '{"a":1,"b":2,"c":3,"d":4,"e":5}';
+var_dump(json_decode($json));
+
+---> object(stdClass)#1 (5) {
+ ["a"]=>
+ int(1)
+ ["b"]=>
+ int(2)
+ ["c"]=>
+ int(3)
+ ["d"]=>
+ int(4)
+ ["e"]=>
+ int(5)
+ }
+
+$json = '{"a":1,"b":2,"c":3,"d":4,"e":5}';
+var_dump(json_decode($json, true));
+
+---> array(5) {
+ ["a"]=>
+ int(1)
+ ["b"]=>
+ int(2)
+ ["c"]=>
+ int(3)
+ ["d"]=>
+ int(4)
+ ["e"]=>
+ int(5)
+ }
+
+
+Authors
+-------
+
+Omar Kilani <omar@php.net>
+
+
+---
+
+[0] http://www.crockford.com/JSON/draft-jsonorg-json-00.txt
+[1] http://www.crockford.com/JSON/JSON_checker/
diff --git a/ext/json/config.m4 b/ext/json/config.m4
new file mode 100644
index 000000000..3e3a6ab32
--- /dev/null
+++ b/ext/json/config.m4
@@ -0,0 +1,16 @@
+dnl
+dnl $Id: config.m4,v 1.3.2.3 2006/07/20 10:47:37 tony2001 Exp $
+dnl
+
+PHP_ARG_ENABLE(json, whether to enable JavaScript Object Serialization support,
+[ --disable-json Disable JavaScript Object Serialization support], yes)
+
+if test "$PHP_JSON" != "no"; then
+ AC_DEFINE([HAVE_JSON],1 ,[whether to enable JavaScript Object Serialization support])
+ AC_HEADER_STDC
+
+ PHP_NEW_EXTENSION(json, json.c utf8_to_utf16.c utf8_decode.c JSON_parser.c, $ext_shared)
+ PHP_SUBST(JSON_SHARED_LIBADD)
+fi
+
+# vim600: sts=2 sw=2 et
diff --git a/ext/json/config.w32 b/ext/json/config.w32
new file mode 100644
index 000000000..0cc79dc00
--- /dev/null
+++ b/ext/json/config.w32
@@ -0,0 +1,10 @@
+// $Id: config.w32,v 1.2.2.1 2006/07/22 15:33:02 rrichards Exp $
+// vim:ft=javascript
+
+ARG_ENABLE("json", "JavaScript Object Serialization support", "yes");
+
+if (PHP_JSON != "no") {
+ EXTENSION('json', 'json.c', PHP_JSON_SHARED, "");
+ ADD_SOURCES(configure_module_dirname, "JSON_parser.c utf8_decode.c utf8_to_utf16.c", "json");
+}
+
diff --git a/ext/json/json.c b/ext/json/json.c
new file mode 100644
index 000000000..097c0ad7d
--- /dev/null
+++ b/ext/json/json.c
@@ -0,0 +1,468 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2006 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Omar Kilani <omar@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: json.c,v 1.9.2.6 2006/08/14 20:08:17 nlopess Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "ext/standard/php_smart_str.h"
+#include "utf8_to_utf16.h"
+#include "JSON_parser.h"
+#include "php_json.h"
+
+static PHP_MINFO_FUNCTION(json);
+
+static PHP_FUNCTION(json_encode);
+static PHP_FUNCTION(json_decode);
+
+/* If you declare any globals in php_json.h uncomment this:
+ZEND_DECLARE_MODULE_GLOBALS(json)
+*/
+static const char digits[] = "0123456789abcdef";
+
+/* {{{ json_functions[]
+ *
+ * Every user visible function must have an entry in json_functions[].
+ */
+static function_entry json_functions[] = {
+ PHP_FE(json_encode, NULL)
+ PHP_FE(json_decode, NULL)
+ {NULL, NULL, NULL} /* Must be the last line in json_functions[] */
+};
+/* }}} */
+
+/* {{{ json_module_entry
+ */
+zend_module_entry json_module_entry = {
+#if ZEND_MODULE_API_NO >= 20010901
+ STANDARD_MODULE_HEADER,
+#endif
+ "json",
+ json_functions,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ PHP_MINFO(json),
+#if ZEND_MODULE_API_NO >= 20010901
+ PHP_JSON_VERSION,
+#endif
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_JSON
+ZEND_GET_MODULE(json)
+#endif
+
+/* {{{ PHP_MINFO_FUNCTION
+ */
+static PHP_MINFO_FUNCTION(json)
+{
+ php_info_print_table_start();
+ php_info_print_table_row(2, "json support", "enabled");
+ php_info_print_table_row(2, "json version", PHP_JSON_VERSION);
+ php_info_print_table_end();
+}
+/* }}} */
+
+static void json_encode_r(smart_str *buf, zval *val TSRMLS_DC);
+static void json_escape_string(smart_str *buf, char *s, int len);
+
+static int json_determine_array_type(zval **val TSRMLS_DC) {
+ int i;
+ HashTable *myht;
+
+ if (Z_TYPE_PP(val) == IS_ARRAY) {
+ myht = HASH_OF(*val);
+ } else {
+ myht = Z_OBJPROP_PP(val);
+ return 1;
+ }
+
+ i = myht ? zend_hash_num_elements(myht) : 0;
+ if (i > 0) {
+ char *key;
+ ulong index, idx;
+ uint key_len;
+ HashPosition pos;
+
+ zend_hash_internal_pointer_reset_ex(myht, &pos);
+ idx = 0;
+ 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 (i == HASH_KEY_IS_STRING) {
+ return 1;
+ } else {
+ if (index != idx) {
+ return 1;
+ }
+ }
+ idx++;
+ }
+ }
+
+ return 0;
+}
+
+static void json_encode_array(smart_str *buf, zval **val TSRMLS_DC) {
+ int i, r;
+ HashTable *myht;
+
+ if (Z_TYPE_PP(val) == IS_ARRAY) {
+ myht = HASH_OF(*val);
+ r = json_determine_array_type(val TSRMLS_CC);
+ } else {
+ myht = Z_OBJPROP_PP(val);
+ r = 1;
+ }
+
+ if (myht && myht->nApplyCount > 1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ smart_str_appendl(buf, "null", 4);
+ return;
+ }
+
+ if (r == 0)
+ {
+ smart_str_appendc(buf, '[');
+ }
+ else
+ {
+ smart_str_appendc(buf, '{');
+ }
+
+ i = myht ? zend_hash_num_elements(myht) : 0;
+ if (i > 0) {
+ char *key;
+ zval **data;
+ ulong index;
+ uint key_len;
+ HashPosition pos;
+ HashTable *tmp_ht;
+ int need_comma = 0;
+
+ 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 (zend_hash_get_current_data_ex(myht, (void **) &data, &pos) == SUCCESS) {
+ tmp_ht = HASH_OF(*data);
+ if (tmp_ht) {
+ tmp_ht->nApplyCount++;
+ }
+
+ if (r == 0) {
+ if (need_comma) {
+ smart_str_appendc(buf, ',');
+ } else {
+ need_comma = 1;
+ }
+
+ json_encode_r(buf, *data TSRMLS_CC);
+ } else if (r == 1) {
+ if (i == HASH_KEY_IS_STRING) {
+ if (key[0] == '\0') {
+ /* Skip protected and private members. */
+ continue;
+ }
+
+ if (need_comma) {
+ smart_str_appendc(buf, ',');
+ } else {
+ need_comma = 1;
+ }
+
+ json_escape_string(buf, key, key_len - 1);
+ smart_str_appendc(buf, ':');
+
+ json_encode_r(buf, *data TSRMLS_CC);
+ } else {
+ if (need_comma) {
+ smart_str_appendc(buf, ',');
+ } else {
+ need_comma = 1;
+ }
+
+ smart_str_appendc(buf, '"');
+ smart_str_append_long(buf, (long) index);
+ smart_str_appendc(buf, '"');
+ smart_str_appendc(buf, ':');
+
+ json_encode_r(buf, *data TSRMLS_CC);
+ }
+ }
+
+ if (tmp_ht) {
+ tmp_ht->nApplyCount--;
+ }
+ }
+ }
+ }
+
+ if (r == 0)
+ {
+ smart_str_appendc(buf, ']');
+ }
+ else
+ {
+ smart_str_appendc(buf, '}');
+ }
+}
+
+#define REVERSE16(us) (((us & 0xf) << 12) | (((us >> 4) & 0xf) << 8) | (((us >> 8) & 0xf) << 4) | ((us >> 12) & 0xf))
+
+static void json_escape_string(smart_str *buf, char *s, int len)
+{
+ int pos = 0;
+ unsigned short us;
+ unsigned short *utf16;
+
+ if (len == 0)
+ {
+ smart_str_appendl(buf, "\"\"", 2);
+ return;
+ }
+
+ utf16 = (unsigned short *) emalloc(len * sizeof(unsigned short));
+
+ len = utf8_to_utf16(utf16, s, len);
+ if (len <= 0)
+ {
+ if (utf16)
+ {
+ efree(utf16);
+ }
+
+ smart_str_appendl(buf, "\"\"", 2);
+ return;
+ }
+
+ smart_str_appendc(buf, '"');
+
+ while(pos < len)
+ {
+ us = utf16[pos++];
+
+ switch (us)
+ {
+ case '"':
+ {
+ smart_str_appendl(buf, "\\\"", 2);
+ }
+ break;
+ case '\\':
+ {
+ smart_str_appendl(buf, "\\\\", 2);
+ }
+ break;
+ case '/':
+ {
+ smart_str_appendl(buf, "\\/", 2);
+ }
+ break;
+ case '\b':
+ {
+ smart_str_appendl(buf, "\\b", 2);
+ }
+ break;
+ case '\f':
+ {
+ smart_str_appendl(buf, "\\f", 2);
+ }
+ break;
+ case '\n':
+ {
+ smart_str_appendl(buf, "\\n", 2);
+ }
+ break;
+ case '\r':
+ {
+ smart_str_appendl(buf, "\\r", 2);
+ }
+ break;
+ case '\t':
+ {
+ smart_str_appendl(buf, "\\t", 2);
+ }
+ break;
+ default:
+ {
+ if (us < ' ' || (us & 127) == us)
+ {
+ smart_str_appendc(buf, (unsigned char) us);
+ }
+ else
+ {
+ smart_str_appendl(buf, "\\u", 2);
+ us = REVERSE16(us);
+
+ smart_str_appendc(buf, digits[us & ((1 << 4) - 1)]);
+ us >>= 4;
+ smart_str_appendc(buf, digits[us & ((1 << 4) - 1)]);
+ us >>= 4;
+ smart_str_appendc(buf, digits[us & ((1 << 4) - 1)]);
+ us >>= 4;
+ smart_str_appendc(buf, digits[us & ((1 << 4) - 1)]);
+ }
+ }
+ break;
+ }
+ }
+
+ smart_str_appendc(buf, '"');
+ efree(utf16);
+}
+
+static void json_encode_r(smart_str *buf, zval *val TSRMLS_DC) {
+ switch (Z_TYPE_P(val)) {
+ case IS_NULL:
+ smart_str_appendl(buf, "null", 4);
+ break;
+ case IS_BOOL:
+ if (Z_BVAL_P(val))
+ {
+ smart_str_appendl(buf, "true", 4);
+ }
+ else
+ {
+ smart_str_appendl(buf, "false", 5);
+ }
+ break;
+ case IS_LONG:
+ smart_str_append_long(buf, Z_LVAL_P(val));
+ break;
+ case IS_DOUBLE:
+ {
+ char *d = NULL;
+ int len;
+ double dbl = Z_DVAL_P(val);
+
+ if (!zend_isinf(dbl) && !zend_isnan(dbl))
+ {
+ len = spprintf(&d, 0, "%.9g", dbl);
+ if (d)
+ {
+ smart_str_appendl(buf, d, len);
+ efree(d);
+ }
+ }
+ else
+ {
+ zend_error(E_WARNING, "[json] (json_encode_r) double %.9g does not conform to the JSON spec, encoded as 0.", dbl);
+ smart_str_appendc(buf, '0');
+ }
+ }
+ break;
+ case IS_STRING:
+ json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val));
+ break;
+ case IS_ARRAY:
+ case IS_OBJECT:
+ json_encode_array(buf, &val TSRMLS_CC);
+ break;
+ default:
+ zend_error(E_WARNING, "[json] (json_encode_r) type is unsupported, encoded as null.");
+ smart_str_appendl(buf, "null", 4);
+ break;
+ }
+
+ return;
+}
+
+static PHP_FUNCTION(json_encode)
+{
+ zval *parameter;
+ smart_str buf = {0};
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &parameter) == FAILURE) {
+ return;
+ }
+
+ json_encode_r(&buf, parameter TSRMLS_CC);
+
+ ZVAL_STRINGL(return_value, buf.c, buf.len, 1);
+
+ smart_str_free(&buf);
+}
+
+static PHP_FUNCTION(json_decode)
+{
+ char *parameter;
+ int parameter_len, utf16_len;
+ zend_bool assoc = 0; /* return JS objects as PHP objects by default */
+ zval *z;
+ unsigned short *utf16;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &parameter, &parameter_len, &assoc) == FAILURE) {
+ return;
+ }
+
+ if (!parameter_len)
+ {
+ RETURN_NULL();
+ }
+
+ utf16 = (unsigned short *) emalloc((parameter_len+1) * sizeof(unsigned short));
+
+ utf16_len = utf8_to_utf16(utf16, parameter, parameter_len);
+ if (utf16_len <= 0)
+ {
+ if (utf16)
+ {
+ efree(utf16);
+ }
+
+ RETURN_NULL();
+ }
+
+ ALLOC_INIT_ZVAL(z);
+ if (JSON_parser(z, utf16, utf16_len, assoc TSRMLS_CC))
+ {
+ *return_value = *z;
+
+ FREE_ZVAL(z);
+ efree(utf16);
+ }
+ else
+ {
+ zval_dtor(z);
+ FREE_ZVAL(z);
+ efree(utf16);
+ RETURN_NULL();
+ }
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/ext/json/json.dsp b/ext/json/json.dsp
new file mode 100644
index 000000000..e5bb3767b
--- /dev/null
+++ b/ext/json/json.dsp
@@ -0,0 +1,135 @@
+# Microsoft Developer Studio Project File - Name="json" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=json - 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 "json.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 "json.mak" CFG="json - Win32 Debug_TS"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "json - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "json - 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)" == "json - 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 "JSON_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "json_c" /D HAVE_JSON=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D ZTS=1 /D COMPILE_DL_JSON=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JSON_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 iconv.lib 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_json.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
+
+!ELSEIF "$(CFG)" == "json - 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 "JSON_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "json_c" /D HAVE_JSON=1 /D "ZEND_WIN32" /D ZEND_DEBUG=0 /D "PHP_WIN32" /D ZTS=1 /D COMPILE_DL_JSON=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JSON_EXPORTS" /D "HAVE_FCNTL_H" /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 iconv.lib 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_json.dll" /libpath:"..\..\Release_TS"
+
+!ENDIF
+
+# Begin Target
+
+# Name "json - Win32 Debug_TS"
+# Name "json - Win32 Release_TS"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=".\json.c"
+# End Source File
+# Begin Source File
+
+SOURCE=.\JSON_parser.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\JSON_parser.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\utf8_decode.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\utf8_decode.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\utf8_to_utf16.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\utf8_to_utf16.h
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\php_json.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/json/package.xml b/ext/json/package.xml
new file mode 100644
index 000000000..0651de736
--- /dev/null
+++ b/ext/json/package.xml
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE package SYSTEM "../pear/package.dtd">
+<package>
+ <dep type="php" rel="ge" version="4.3.0" optional="no"/>
+ <name>json</name>
+ <summary>JavaScript Object Notation</summary>
+ <maintainers>
+ <maintainer>
+ <user>omar</user>
+ <name>Omar Kilani</name>
+ <email>omar@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ </maintainers>
+ <description>
+ Support for JSON (JavaScript Object Notation) serialization.
+ </description>
+ <license>PHP 3.01</license>
+ <release>
+ <state>stable</state>
+ <version>1.2.1</version>
+ <date>2006-03-18</date>
+ <notes>
+ Fix PECL bug #7147 - rework handling of comma insertion while encoding.
+ Add tests to package.xml
+ </notes>
+ </release>
+ <configureoptions>
+ </configureoptions>
+ <filelist>
+ <file role="doc" name="README" />
+ <file role="src" name="config.m4" />
+ <file role="src" name="config.w32" />
+ <file role="src" name="json.dsp" />
+ <file role="src" name="json.c" />
+ <file role="src" name="JSON_parser.c" />
+ <file role="src" name="JSON_parser.h" />
+ <file role="src" name="php_json.h" />
+ <file role="src" name="utf8_decode.c" />
+ <file role="src" name="utf8_decode.h" />
+ <file role="src" name="utf8_to_utf16.c" />
+ <file role="src" name="utf8_to_utf16.h" />
+ <dir role="test" name="tests">
+ <file role="test" name="fail001.phpt" />
+ <file role="test" name="pass001.phpt" />
+ <file role="test" name="pass001.1.phpt" />
+ <file role="test" name="pass002.phpt" />
+ <file role="test" name="pass003.phpt" />
+ </dir>
+ </filelist>
+ <changelog>
+ <release>
+ <state>stable</state>
+ <version>1.0.0</version>
+ <date>2005-04-01</date>
+ <notes>
+ Initial release.
+ </notes>
+ </release>
+ <release>
+ <state>stable</state>
+ <version>1.0.1</version>
+ <date>2005-06-10</date>
+ <notes>
+ Fixed non-linear and mixed type array index issues, fixed issues with escaping \\, forked json-c and added Unicode support.
+ </notes>
+ </release>
+ <release>
+ <state>stable</state>
+ <version>1.0.2</version>
+ <date>2005-06-11</date>
+ <notes>
+ Fixed issues with object reference counts under PHP4.
+ </notes>
+ </release>
+ <release>
+ <state>stable</state>
+ <version>1.0.3</version>
+ <date>2005-06-15</date>
+ <notes>
+ Fixed json-c string corruption issues under Mac OS X and FreeBSD.
+ </notes>
+ </release>
+ <release>
+ <state>stable</state>
+ <version>1.0.4</version>
+ <date>2005-06-15</date>
+ <notes>
+ Changes in 1.0.4 released with 1.0.5.
+ </notes>
+ </release>
+ <release>
+ <state>stable</state>
+ <version>1.0.5</version>
+ <date>2005-06-16</date>
+ <notes>
+ Changed spacing in json-c encoding, added optional assoc (boolean) parameter to json_decode to decode as associative array instead of object, fixed issues with escaping /.
+ </notes>
+ </release>
+ <release>
+ <state>stable</state>
+ <version>1.0.6</version>
+ <date>2005-08-05</date>
+ <notes>
+ Fixed issues with exporting private and protected class members.
+ </notes>
+ </release>
+ <release>
+ <state>stable</state>
+ <version>1.0.7</version>
+ <date>2005-09-07</date>
+ <notes>
+ Fixed issues with negative array keys, modified json-c to return an error on unquoted object key names instead of going into an infinite loop.
+ </notes>
+ </release>
+ <release>
+ <state>stable</state>
+ <version>1.0.8</version>
+ <date>2005-12-01</date>
+ <notes>
+ Changed license to LGPL, modified build system to allow static compilation into PHP, added strndup check for json-c.
+ </notes>
+ </release>
+ <release>
+ <state>stable</state>
+ <version>1.1.0</version>
+ <date>2005-12-04</date>
+ <notes>
+ Port to Win32.
+ </notes>
+ </release>
+ <release>
+ <state>stable</state>
+ <version>1.1.1</version>
+ <date>2006-01-12</date>
+ <notes>
+ Cleanup and TSRM performance fixes by rasmus.
+ </notes>
+ </release>
+ <release>
+ <state>stable</state>
+ <version>1.2.0</version>
+ <date>2006-03-15</date>
+ <notes>
+ Complete rewrite using JSON_checker as the base for the parser. Implements the JSON specification. 3-8x faster on encodes and 1.2x-4x faster on decodes.
+ </notes>
+ </release>
+ </changelog>
+</package>
+<!--
+vim:et:ts=1:sw=1
+-->
diff --git a/ext/json/php_json.h b/ext/json/php_json.h
new file mode 100644
index 000000000..64e4d5edc
--- /dev/null
+++ b/ext/json/php_json.h
@@ -0,0 +1,55 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2006 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Omar Kilani <omar@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_json.h,v 1.8.2.1 2006/08/14 20:08:17 nlopess Exp $ */
+
+#ifndef PHP_JSON_H
+#define PHP_JSON_H
+
+#define PHP_JSON_VERSION "1.2.1"
+
+extern zend_module_entry json_module_entry;
+#define phpext_json_ptr &json_module_entry
+
+#ifdef PHP_WIN32
+#define PHP_JSON_API __declspec(dllexport)
+#else
+#define PHP_JSON_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+#ifdef ZTS
+#define JSON_G(v) TSRMG(json_globals_id, zend_json_globals *, v)
+#else
+#define JSON_G(v) (json_globals.v)
+#endif
+
+#endif /* PHP_JSON_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/json/tests/001.phpt b/ext/json/tests/001.phpt
new file mode 100644
index 000000000..095aedf63
--- /dev/null
+++ b/ext/json/tests/001.phpt
@@ -0,0 +1,71 @@
+--TEST--
+json_decode() tests
+--SKIPIF--
+<?php if (!extension_loaded("json")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(json_decode());
+var_dump(json_decode(""));
+var_dump(json_decode("", 1));
+var_dump(json_decode("", 0));
+var_dump(json_decode(".", 1));
+var_dump(json_decode(".", 0));
+var_dump(json_decode("<?>"));
+var_dump(json_decode(";"));
+var_dump(json_decode("руÑÑиш"));
+var_dump(json_decode("blah"));
+var_dump(json_decode(NULL));
+var_dump(json_decode('{ "test": { "foo": "bar" } }'));
+var_dump(json_decode('{ "test": { "foo": "" } }'));
+var_dump(json_decode('{ "": { "foo": "" } }'));
+var_dump(json_decode('{ "": { "": "" } }'));
+var_dump(json_decode('{ "": { "": "" }'));
+var_dump(json_decode('{ "": "": "" } }'));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: json_decode() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+object(stdClass)#1 (1) {
+ ["test"]=>
+ object(stdClass)#2 (1) {
+ ["foo"]=>
+ string(3) "bar"
+ }
+}
+object(stdClass)#1 (1) {
+ ["test"]=>
+ object(stdClass)#2 (1) {
+ ["foo"]=>
+ string(0) ""
+ }
+}
+object(stdClass)#1 (1) {
+ ["_empty_"]=>
+ object(stdClass)#2 (1) {
+ ["foo"]=>
+ string(0) ""
+ }
+}
+object(stdClass)#1 (1) {
+ ["_empty_"]=>
+ object(stdClass)#2 (1) {
+ ["_empty_"]=>
+ string(0) ""
+ }
+}
+NULL
+NULL
+Done
diff --git a/ext/json/tests/002.phpt b/ext/json/tests/002.phpt
new file mode 100644
index 000000000..5bc29bc5b
--- /dev/null
+++ b/ext/json/tests/002.phpt
@@ -0,0 +1,28 @@
+--TEST--
+json_encode() tests
+--SKIPIF--
+<?php if (!extension_loaded("json")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(json_encode(""));
+var_dump(json_encode(NULL));
+var_dump(json_encode(TRUE));
+var_dump(json_encode(array(""=>"")));
+var_dump(json_encode(array(array(1))));
+
+var_dump(json_encode(1));
+var_dump(json_encode("руÑÑиш"));
+
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(2) """"
+string(4) "null"
+string(4) "true"
+string(2) "{}"
+string(5) "[[1]]"
+string(1) "1"
+string(38) ""\u0440\u0443\u0441\u0441\u0438\u0448""
+Done
diff --git a/ext/json/tests/003.phpt b/ext/json/tests/003.phpt
new file mode 100644
index 000000000..f10baa9d1
--- /dev/null
+++ b/ext/json/tests/003.phpt
@@ -0,0 +1,33 @@
+--TEST--
+json_encode() & endless loop - 1
+--SKIPIF--
+<?php if (!extension_loaded("json")) print "skip"; ?>
+--FILE--
+<?php
+
+$a = array();
+$a[] = &$a;
+
+var_dump($a);
+var_dump(json_encode($a));
+
+/* Break circular data structure to prevent memory leaks */
+unset($a[0]);
+
+echo "Done\n";
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ &array(1) {
+ [0]=>
+ &array(1) {
+ [0]=>
+ *RECURSION*
+ }
+ }
+}
+
+Warning: json_encode(): recursion detected in %s on line %d
+string(8) "[[null]]"
+Done
diff --git a/ext/json/tests/004.phpt b/ext/json/tests/004.phpt
new file mode 100644
index 000000000..884d87420
--- /dev/null
+++ b/ext/json/tests/004.phpt
@@ -0,0 +1,27 @@
+--TEST--
+json_encode() & endless loop - 2
+--SKIPIF--
+<?php if (!extension_loaded("json")) print "skip"; ?>
+--FILE--
+<?php
+
+$a = new stdclass;
+$a->prop = $a;
+
+var_dump($a);
+var_dump(json_encode($a));
+
+echo "Done\n";
+?>
+--EXPECTF--
+object(stdClass)#%d (1) {
+ ["prop"]=>
+ object(stdClass)#%d (1) {
+ ["prop"]=>
+ *RECURSION*
+ }
+}
+
+Warning: json_encode(): recursion detected in %s on line %d
+string(22) "{"prop":{"prop":null}}"
+Done
diff --git a/ext/json/tests/005.phpt b/ext/json/tests/005.phpt
new file mode 100644
index 000000000..f6a8977d1
--- /dev/null
+++ b/ext/json/tests/005.phpt
@@ -0,0 +1,27 @@
+--TEST--
+json_encode() & endless loop - 3
+--SKIPIF--
+<?php if (!extension_loaded("json")) print "skip"; ?>
+--FILE--
+<?php
+
+$a = array();
+$a[] = $a;
+
+var_dump($a);
+var_dump(json_encode($a));
+
+echo "Done\n";
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ *RECURSION*
+ }
+}
+
+Warning: json_encode(): recursion detected in %s on line %d
+string(8) "[[null]]"
+Done
diff --git a/ext/json/tests/fail001.phpt b/ext/json/tests/fail001.phpt
new file mode 100644
index 000000000..f0e0afa38
--- /dev/null
+++ b/ext/json/tests/fail001.phpt
@@ -0,0 +1,165 @@
+--TEST--
+JSON (http://www.crockford.com/JSON/JSON_checker/test/fail*.json)
+--SKIPIF--
+<?php
+ if (!extension_loaded('json')) die('skip: json extension not available');
+?>
+--FILE--
+<?php
+
+$tests = array('"A JSON payload should be an object or array, not a string."',
+ '["Unclosed array"',
+ '{unquoted_key: "keys must be quoted}',
+ '["extra comma",]',
+ '["double extra comma",,]',
+ '[ , "<-- missing value"]',
+ '["Comma after the close"],',
+ '["Extra close"]]',
+ '{"Extra comma": true,}',
+ '{"Extra value after close": true} "misplaced quoted value"',
+ '{"Illegal expression": 1 + 2}',
+ '{"Illegal invocation": alert()}',
+ '{"Numbers cannot have leading zeroes": 013}',
+ '{"Numbers cannot be hex": 0x14}',
+ '["Illegal backslash escape: \\x15"]',
+ '["Illegal backslash escape: \\\'"]',
+ '["Illegal backslash escape: \\017"]',
+ '[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]',
+ '{"Missing colon" null}',
+ '{"Double colon":: null}',
+ '{"Comma instead of colon", null}',
+ '["Colon instead of comma": false]',
+ '["Bad value", truth]',
+ "['single quote']");
+
+foreach ($tests as $test)
+{
+ echo 'Testing: ' . $test . "\n";
+ echo "AS OBJECT\n";
+ var_dump(json_decode($test));
+ echo "AS ARRAY\n";
+ var_dump(json_decode($test, true));
+}
+
+?>
+--EXPECT--
+Testing: "A JSON payload should be an object or array, not a string."
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: ["Unclosed array"
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: {unquoted_key: "keys must be quoted}
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: ["extra comma",]
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: ["double extra comma",,]
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: [ , "<-- missing value"]
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: ["Comma after the close"],
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: ["Extra close"]]
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: {"Extra comma": true,}
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: {"Extra value after close": true} "misplaced quoted value"
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: {"Illegal expression": 1 + 2}
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: {"Illegal invocation": alert()}
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: {"Numbers cannot have leading zeroes": 013}
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: {"Numbers cannot be hex": 0x14}
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: ["Illegal backslash escape: \x15"]
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: ["Illegal backslash escape: \'"]
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: ["Illegal backslash escape: \017"]
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: [[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: {"Missing colon" null}
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: {"Double colon":: null}
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: {"Comma instead of colon", null}
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: ["Colon instead of comma": false]
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: ["Bad value", truth]
+AS OBJECT
+NULL
+AS ARRAY
+NULL
+Testing: ['single quote']
+AS OBJECT
+NULL
+AS ARRAY
+NULL
diff --git a/ext/json/tests/pass001.1.phpt b/ext/json/tests/pass001.1.phpt
new file mode 100644
index 000000000..cdc68ab96
--- /dev/null
+++ b/ext/json/tests/pass001.1.phpt
@@ -0,0 +1,887 @@
+--TEST--
+JSON (http://www.crockford.com/JSON/JSON_checker/test/pass1.json)
+--SKIPIF--
+<?php
+ if (!extension_loaded('json')) die('skip: json extension not available');
+?>
+--FILE--
+<?php
+/* Modified to test unescaped UNICODE as keys and values.
+ * Modified to test numbers with exponents without a decimal point.
+ * Modified to test empty string values.
+ * Modified to test a mix of integers and strings as keys.
+ */
+// Expect warnings about INF.
+ini_set("error_reporting", E_ALL & ~E_WARNING);
+
+$test = "
+[
+ \"JSON Test Pattern pass1\",
+ {\"object with 1 member\":[\"array with 1 element\"]},
+ {},
+ [],
+ -42,
+ true,
+ false,
+ null,
+ {
+ \"integer\": 1234567890,
+ \"real\": -9876.543210,
+ \"e\": 0.123456789e-12,
+ \"E\": 1.234567890E+34,
+ \"\": 23456789012E666,
+ \"E no .\": 4E12,
+ \"zero\": 0,
+ \"one\": 1,
+ \"space\": \" \",
+ \"quote\": \"\\\"\",
+ \"backslash\": \"\\\\\",
+ \"controls\": \"\\b\\f\\n\\r\\t\",
+ \"slash\": \"/ & \\/\",
+ \"alpha\": \"abcdefghijklmnopqrstuvwyz\",
+ \"ALPHA\": \"ABCDEFGHIJKLMNOPQRSTUVWYZ\",
+ \"digit\": \"0123456789\",
+ \"special\": \"`1~!@#$%^&*()_+-={':[,]}|;.</>?\",
+ \"hex\": \"\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A\",
+ \"unicode\": \"\\u30d7\\u30ec\\u30b9\\u30ad\\u30c3\\u30c8\",
+ \"プレスキット\": \"プレスキット\",
+ \"empty_string\": \"\",
+ \"true\": true,
+ \"false\": false,
+ \"null\": null,
+ \"array\":[ ],
+ \"object\":{ },
+ \"123\":{\"456\":{\"abc\":{\"789\":\"def\",\"012\":[1,2,\"5\",500],\"ghi\":[1,2,\"five\",50,\"sixty\"]}}},
+ \"address\": \"50 St. James Street\",
+ \"url\": \"http://www.JSON.org/\",
+ \"comment\": \"// /* <!-- --\",
+ \"# -- --> */\": \" \",
+ \" s p a c e d \" :[1,2 , 3
+
+,
+
+4 , 5 , 6 ,7 ],
+ \"compact\": [1,2,3,4,5,6,7],
+ \"jsontext\": \"{\\\"object with 1 member\\\":[\\\"array with 1 element\\\"]}\",
+ \"quotes\": \"&#34; \\u0022 %22 0x22 034 &#x22;\",
+ \"\\/\\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?\"
+: \"A key can be any string\"
+ },
+ 0.5 ,98.6
+,
+99.44
+,
+
+1066
+
+
+,\"rosebud\"]
+";
+
+echo 'Testing: ' . $test . "\n";
+echo "DECODE: AS OBJECT\n";
+$obj = json_decode($test);
+var_dump($obj);
+echo "DECODE: AS ARRAY\n";
+$arr = json_decode($test, true);
+var_dump($arr);
+
+echo "ENCODE: FROM OBJECT\n";
+$obj_enc = json_encode($obj);
+echo $obj_enc . "\n";
+echo "ENCODE: FROM ARRAY\n";
+$arr_enc = json_encode($arr);
+echo $arr_enc . "\n";
+
+echo "DECODE AGAIN: AS OBJECT\n";
+$obj = json_decode($obj_enc);
+var_dump($obj);
+echo "DECODE AGAIN: AS ARRAY\n";
+$arr = json_decode($arr_enc, true);
+var_dump($arr);
+
+?>
+--EXPECT--
+Testing:
+[
+ "JSON Test Pattern pass1",
+ {"object with 1 member":["array with 1 element"]},
+ {},
+ [],
+ -42,
+ true,
+ false,
+ null,
+ {
+ "integer": 1234567890,
+ "real": -9876.543210,
+ "e": 0.123456789e-12,
+ "E": 1.234567890E+34,
+ "": 23456789012E666,
+ "E no .": 4E12,
+ "zero": 0,
+ "one": 1,
+ "space": " ",
+ "quote": "\"",
+ "backslash": "\\",
+ "controls": "\b\f\n\r\t",
+ "slash": "/ & \/",
+ "alpha": "abcdefghijklmnopqrstuvwyz",
+ "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
+ "digit": "0123456789",
+ "special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
+ "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
+ "unicode": "\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8",
+ "プレスキット": "プレスキット",
+ "empty_string": "",
+ "true": true,
+ "false": false,
+ "null": null,
+ "array":[ ],
+ "object":{ },
+ "123":{"456":{"abc":{"789":"def","012":[1,2,"5",500],"ghi":[1,2,"five",50,"sixty"]}}},
+ "address": "50 St. James Street",
+ "url": "http://www.JSON.org/",
+ "comment": "// /* <!-- --",
+ "# -- --> */": " ",
+ " s p a c e d " :[1,2 , 3
+
+,
+
+4 , 5 , 6 ,7 ],
+ "compact": [1,2,3,4,5,6,7],
+ "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
+ "quotes": "&#34; \u0022 %22 0x22 034 &#x22;",
+ "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
+: "A key can be any string"
+ },
+ 0.5 ,98.6
+,
+99.44
+,
+
+1066
+
+
+,"rosebud"]
+
+DECODE: AS OBJECT
+array(14) {
+ [0]=>
+ string(23) "JSON Test Pattern pass1"
+ [1]=>
+ object(stdClass)#1 (1) {
+ ["object with 1 member"]=>
+ array(1) {
+ [0]=>
+ string(20) "array with 1 element"
+ }
+ }
+ [2]=>
+ object(stdClass)#2 (0) {
+ }
+ [3]=>
+ array(0) {
+ }
+ [4]=>
+ int(-42)
+ [5]=>
+ bool(true)
+ [6]=>
+ bool(false)
+ [7]=>
+ NULL
+ [8]=>
+ object(stdClass)#3 (36) {
+ ["integer"]=>
+ int(1234567890)
+ ["real"]=>
+ float(-9876.54321)
+ ["e"]=>
+ float(1.23456789E-13)
+ ["E"]=>
+ float(1.23456789E+34)
+ ["_empty_"]=>
+ float(INF)
+ ["E no ."]=>
+ float(4.0E+12)
+ ["zero"]=>
+ int(0)
+ ["one"]=>
+ int(1)
+ ["space"]=>
+ string(1) " "
+ ["quote"]=>
+ string(1) """
+ ["backslash"]=>
+ string(1) "\"
+ ["controls"]=>
+ string(5) "
+ "
+ ["slash"]=>
+ string(5) "/ & /"
+ ["alpha"]=>
+ string(25) "abcdefghijklmnopqrstuvwyz"
+ ["ALPHA"]=>
+ string(25) "ABCDEFGHIJKLMNOPQRSTUVWYZ"
+ ["digit"]=>
+ string(10) "0123456789"
+ ["special"]=>
+ string(31) "`1~!@#$%^&*()_+-={':[,]}|;.</>?"
+ ["hex"]=>
+ string(17) "ģ䕧覫췯ê¯î½Š"
+ ["unicode"]=>
+ string(18) "プレスキット"
+ ["プレスキット"]=>
+ string(18) "プレスキット"
+ ["empty_string"]=>
+ string(0) ""
+ ["true"]=>
+ bool(true)
+ ["false"]=>
+ bool(false)
+ ["null"]=>
+ NULL
+ ["array"]=>
+ array(0) {
+ }
+ ["object"]=>
+ object(stdClass)#4 (0) {
+ }
+ ["123"]=>
+ object(stdClass)#5 (1) {
+ ["456"]=>
+ object(stdClass)#6 (1) {
+ ["abc"]=>
+ object(stdClass)#7 (3) {
+ ["789"]=>
+ string(3) "def"
+ ["012"]=>
+ array(4) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "5"
+ [3]=>
+ int(500)
+ }
+ ["ghi"]=>
+ array(5) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ string(4) "five"
+ [3]=>
+ int(50)
+ [4]=>
+ string(5) "sixty"
+ }
+ }
+ }
+ }
+ ["address"]=>
+ string(19) "50 St. James Street"
+ ["url"]=>
+ string(20) "http://www.JSON.org/"
+ ["comment"]=>
+ string(13) "// /* <!-- --"
+ ["# -- --> */"]=>
+ string(1) " "
+ [" s p a c e d "]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["compact"]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["jsontext"]=>
+ string(49) "{"object with 1 member":["array with 1 element"]}"
+ ["quotes"]=>
+ string(27) "&#34; " %22 0x22 034 &#x22;"
+ ["/\"쫾몾ꮘﳞ볚
+ `1~!@#$%^&*()_+-=[]{}|;:',./<>?"]=>
+ string(23) "A key can be any string"
+ }
+ [9]=>
+ float(0.5)
+ [10]=>
+ float(98.6)
+ [11]=>
+ float(99.44)
+ [12]=>
+ int(1066)
+ [13]=>
+ string(7) "rosebud"
+}
+DECODE: AS ARRAY
+array(14) {
+ [0]=>
+ string(23) "JSON Test Pattern pass1"
+ [1]=>
+ array(1) {
+ ["object with 1 member"]=>
+ array(1) {
+ [0]=>
+ string(20) "array with 1 element"
+ }
+ }
+ [2]=>
+ array(0) {
+ }
+ [3]=>
+ array(0) {
+ }
+ [4]=>
+ int(-42)
+ [5]=>
+ bool(true)
+ [6]=>
+ bool(false)
+ [7]=>
+ NULL
+ [8]=>
+ array(36) {
+ ["integer"]=>
+ int(1234567890)
+ ["real"]=>
+ float(-9876.54321)
+ ["e"]=>
+ float(1.23456789E-13)
+ ["E"]=>
+ float(1.23456789E+34)
+ ["_empty_"]=>
+ float(INF)
+ ["E no ."]=>
+ float(4.0E+12)
+ ["zero"]=>
+ int(0)
+ ["one"]=>
+ int(1)
+ ["space"]=>
+ string(1) " "
+ ["quote"]=>
+ string(1) """
+ ["backslash"]=>
+ string(1) "\"
+ ["controls"]=>
+ string(5) "
+ "
+ ["slash"]=>
+ string(5) "/ & /"
+ ["alpha"]=>
+ string(25) "abcdefghijklmnopqrstuvwyz"
+ ["ALPHA"]=>
+ string(25) "ABCDEFGHIJKLMNOPQRSTUVWYZ"
+ ["digit"]=>
+ string(10) "0123456789"
+ ["special"]=>
+ string(31) "`1~!@#$%^&*()_+-={':[,]}|;.</>?"
+ ["hex"]=>
+ string(17) "ģ䕧覫췯ê¯î½Š"
+ ["unicode"]=>
+ string(18) "プレスキット"
+ ["プレスキット"]=>
+ string(18) "プレスキット"
+ ["empty_string"]=>
+ string(0) ""
+ ["true"]=>
+ bool(true)
+ ["false"]=>
+ bool(false)
+ ["null"]=>
+ NULL
+ ["array"]=>
+ array(0) {
+ }
+ ["object"]=>
+ array(0) {
+ }
+ [123]=>
+ array(1) {
+ [456]=>
+ array(1) {
+ ["abc"]=>
+ array(3) {
+ [789]=>
+ string(3) "def"
+ ["012"]=>
+ array(4) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "5"
+ [3]=>
+ int(500)
+ }
+ ["ghi"]=>
+ array(5) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ string(4) "five"
+ [3]=>
+ int(50)
+ [4]=>
+ string(5) "sixty"
+ }
+ }
+ }
+ }
+ ["address"]=>
+ string(19) "50 St. James Street"
+ ["url"]=>
+ string(20) "http://www.JSON.org/"
+ ["comment"]=>
+ string(13) "// /* <!-- --"
+ ["# -- --> */"]=>
+ string(1) " "
+ [" s p a c e d "]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["compact"]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["jsontext"]=>
+ string(49) "{"object with 1 member":["array with 1 element"]}"
+ ["quotes"]=>
+ string(27) "&#34; " %22 0x22 034 &#x22;"
+ ["/\"쫾몾ꮘﳞ볚
+ `1~!@#$%^&*()_+-=[]{}|;:',./<>?"]=>
+ string(23) "A key can be any string"
+ }
+ [9]=>
+ float(0.5)
+ [10]=>
+ float(98.6)
+ [11]=>
+ float(99.44)
+ [12]=>
+ int(1066)
+ [13]=>
+ string(7) "rosebud"
+}
+ENCODE: FROM OBJECT
+["JSON Test Pattern pass1",{"object with 1 member":["array with 1 element"]},{},[],-42,true,false,null,{"integer":1234567890,"real":-9876.54321,"e":1.23456789e-13,"E":1.23456789e+34,"_empty_":0,"E no .":4.0e+12,"zero":0,"one":1,"space":" ","quote":"\"","backslash":"\\","controls":"\b\f\n\r\t","slash":"\/ & \/","alpha":"abcdefghijklmnopqrstuvwyz","ALPHA":"ABCDEFGHIJKLMNOPQRSTUVWYZ","digit":"0123456789","special":"`1~!@#$%^&*()_+-={':[,]}|;.<\/>?","hex":"\u0123\u4567\u89ab\ucdef\uabcd\uef4a","unicode":"\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8","\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8":"\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8","empty_string":"","true":true,"false":false,"null":null,"array":[],"object":{},"123":{"456":{"abc":{"789":"def","012":[1,2,"5",500],"ghi":[1,2,"five",50,"sixty"]}}},"address":"50 St. James Street","url":"http:\/\/www.JSON.org\/","comment":"\/\/ \/* <!-- --","# -- --> *\/":" "," s p a c e d ":[1,2,3,4,5,6,7],"compact":[1,2,3,4,5,6,7],"jsontext":"{\"object with 1 member\":[\"array with 1 element\"]}","quotes":"&#34; \" %22 0x22 034 &#x22;","\/\\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',.\/<>?":"A key can be any string"},0.5,98.6,99.44,1066,"rosebud"]
+ENCODE: FROM ARRAY
+["JSON Test Pattern pass1",{"object with 1 member":["array with 1 element"]},[],[],-42,true,false,null,{"integer":1234567890,"real":-9876.54321,"e":1.23456789e-13,"E":1.23456789e+34,"_empty_":0,"E no .":4.0e+12,"zero":0,"one":1,"space":" ","quote":"\"","backslash":"\\","controls":"\b\f\n\r\t","slash":"\/ & \/","alpha":"abcdefghijklmnopqrstuvwyz","ALPHA":"ABCDEFGHIJKLMNOPQRSTUVWYZ","digit":"0123456789","special":"`1~!@#$%^&*()_+-={':[,]}|;.<\/>?","hex":"\u0123\u4567\u89ab\ucdef\uabcd\uef4a","unicode":"\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8","\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8":"\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8","empty_string":"","true":true,"false":false,"null":null,"array":[],"object":[],"123":{"456":{"abc":{"789":"def","012":[1,2,"5",500],"ghi":[1,2,"five",50,"sixty"]}}},"address":"50 St. James Street","url":"http:\/\/www.JSON.org\/","comment":"\/\/ \/* <!-- --","# -- --> *\/":" "," s p a c e d ":[1,2,3,4,5,6,7],"compact":[1,2,3,4,5,6,7],"jsontext":"{\"object with 1 member\":[\"array with 1 element\"]}","quotes":"&#34; \" %22 0x22 034 &#x22;","\/\\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',.\/<>?":"A key can be any string"},0.5,98.6,99.44,1066,"rosebud"]
+DECODE AGAIN: AS OBJECT
+array(14) {
+ [0]=>
+ string(23) "JSON Test Pattern pass1"
+ [1]=>
+ object(stdClass)#8 (1) {
+ ["object with 1 member"]=>
+ array(1) {
+ [0]=>
+ string(20) "array with 1 element"
+ }
+ }
+ [2]=>
+ object(stdClass)#9 (0) {
+ }
+ [3]=>
+ array(0) {
+ }
+ [4]=>
+ int(-42)
+ [5]=>
+ bool(true)
+ [6]=>
+ bool(false)
+ [7]=>
+ NULL
+ [8]=>
+ object(stdClass)#10 (36) {
+ ["integer"]=>
+ int(1234567890)
+ ["real"]=>
+ float(-9876.54321)
+ ["e"]=>
+ float(1.23456789E-13)
+ ["E"]=>
+ float(1.23456789E+34)
+ ["_empty_"]=>
+ int(0)
+ ["E no ."]=>
+ float(4.0E+12)
+ ["zero"]=>
+ int(0)
+ ["one"]=>
+ int(1)
+ ["space"]=>
+ string(1) " "
+ ["quote"]=>
+ string(1) """
+ ["backslash"]=>
+ string(1) "\"
+ ["controls"]=>
+ string(5) "
+ "
+ ["slash"]=>
+ string(5) "/ & /"
+ ["alpha"]=>
+ string(25) "abcdefghijklmnopqrstuvwyz"
+ ["ALPHA"]=>
+ string(25) "ABCDEFGHIJKLMNOPQRSTUVWYZ"
+ ["digit"]=>
+ string(10) "0123456789"
+ ["special"]=>
+ string(31) "`1~!@#$%^&*()_+-={':[,]}|;.</>?"
+ ["hex"]=>
+ string(17) "ģ䕧覫췯ê¯î½Š"
+ ["unicode"]=>
+ string(18) "プレスキット"
+ ["プレスキット"]=>
+ string(18) "プレスキット"
+ ["empty_string"]=>
+ string(0) ""
+ ["true"]=>
+ bool(true)
+ ["false"]=>
+ bool(false)
+ ["null"]=>
+ NULL
+ ["array"]=>
+ array(0) {
+ }
+ ["object"]=>
+ object(stdClass)#11 (0) {
+ }
+ ["123"]=>
+ object(stdClass)#12 (1) {
+ ["456"]=>
+ object(stdClass)#13 (1) {
+ ["abc"]=>
+ object(stdClass)#14 (3) {
+ ["789"]=>
+ string(3) "def"
+ ["012"]=>
+ array(4) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "5"
+ [3]=>
+ int(500)
+ }
+ ["ghi"]=>
+ array(5) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ string(4) "five"
+ [3]=>
+ int(50)
+ [4]=>
+ string(5) "sixty"
+ }
+ }
+ }
+ }
+ ["address"]=>
+ string(19) "50 St. James Street"
+ ["url"]=>
+ string(20) "http://www.JSON.org/"
+ ["comment"]=>
+ string(13) "// /* <!-- --"
+ ["# -- --> */"]=>
+ string(1) " "
+ [" s p a c e d "]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["compact"]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["jsontext"]=>
+ string(49) "{"object with 1 member":["array with 1 element"]}"
+ ["quotes"]=>
+ string(27) "&#34; " %22 0x22 034 &#x22;"
+ ["/\"쫾몾ꮘﳞ볚
+ `1~!@#$%^&*()_+-=[]{}|;:',./<>?"]=>
+ string(23) "A key can be any string"
+ }
+ [9]=>
+ float(0.5)
+ [10]=>
+ float(98.6)
+ [11]=>
+ float(99.44)
+ [12]=>
+ int(1066)
+ [13]=>
+ string(7) "rosebud"
+}
+DECODE AGAIN: AS ARRAY
+array(14) {
+ [0]=>
+ string(23) "JSON Test Pattern pass1"
+ [1]=>
+ array(1) {
+ ["object with 1 member"]=>
+ array(1) {
+ [0]=>
+ string(20) "array with 1 element"
+ }
+ }
+ [2]=>
+ array(0) {
+ }
+ [3]=>
+ array(0) {
+ }
+ [4]=>
+ int(-42)
+ [5]=>
+ bool(true)
+ [6]=>
+ bool(false)
+ [7]=>
+ NULL
+ [8]=>
+ array(36) {
+ ["integer"]=>
+ int(1234567890)
+ ["real"]=>
+ float(-9876.54321)
+ ["e"]=>
+ float(1.23456789E-13)
+ ["E"]=>
+ float(1.23456789E+34)
+ ["_empty_"]=>
+ int(0)
+ ["E no ."]=>
+ float(4.0E+12)
+ ["zero"]=>
+ int(0)
+ ["one"]=>
+ int(1)
+ ["space"]=>
+ string(1) " "
+ ["quote"]=>
+ string(1) """
+ ["backslash"]=>
+ string(1) "\"
+ ["controls"]=>
+ string(5) "
+ "
+ ["slash"]=>
+ string(5) "/ & /"
+ ["alpha"]=>
+ string(25) "abcdefghijklmnopqrstuvwyz"
+ ["ALPHA"]=>
+ string(25) "ABCDEFGHIJKLMNOPQRSTUVWYZ"
+ ["digit"]=>
+ string(10) "0123456789"
+ ["special"]=>
+ string(31) "`1~!@#$%^&*()_+-={':[,]}|;.</>?"
+ ["hex"]=>
+ string(17) "ģ䕧覫췯ê¯î½Š"
+ ["unicode"]=>
+ string(18) "プレスキット"
+ ["プレスキット"]=>
+ string(18) "プレスキット"
+ ["empty_string"]=>
+ string(0) ""
+ ["true"]=>
+ bool(true)
+ ["false"]=>
+ bool(false)
+ ["null"]=>
+ NULL
+ ["array"]=>
+ array(0) {
+ }
+ ["object"]=>
+ array(0) {
+ }
+ [123]=>
+ array(1) {
+ [456]=>
+ array(1) {
+ ["abc"]=>
+ array(3) {
+ [789]=>
+ string(3) "def"
+ ["012"]=>
+ array(4) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ string(1) "5"
+ [3]=>
+ int(500)
+ }
+ ["ghi"]=>
+ array(5) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ string(4) "five"
+ [3]=>
+ int(50)
+ [4]=>
+ string(5) "sixty"
+ }
+ }
+ }
+ }
+ ["address"]=>
+ string(19) "50 St. James Street"
+ ["url"]=>
+ string(20) "http://www.JSON.org/"
+ ["comment"]=>
+ string(13) "// /* <!-- --"
+ ["# -- --> */"]=>
+ string(1) " "
+ [" s p a c e d "]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["compact"]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["jsontext"]=>
+ string(49) "{"object with 1 member":["array with 1 element"]}"
+ ["quotes"]=>
+ string(27) "&#34; " %22 0x22 034 &#x22;"
+ ["/\"쫾몾ꮘﳞ볚
+ `1~!@#$%^&*()_+-=[]{}|;:',./<>?"]=>
+ string(23) "A key can be any string"
+ }
+ [9]=>
+ float(0.5)
+ [10]=>
+ float(98.6)
+ [11]=>
+ float(99.44)
+ [12]=>
+ int(1066)
+ [13]=>
+ string(7) "rosebud"
+}
diff --git a/ext/json/tests/pass001.phpt b/ext/json/tests/pass001.phpt
new file mode 100644
index 000000000..029e2f9ff
--- /dev/null
+++ b/ext/json/tests/pass001.phpt
@@ -0,0 +1,700 @@
+--TEST--
+JSON (http://www.crockford.com/JSON/JSON_checker/test/pass1.json)
+--SKIPIF--
+<?php
+ if (!extension_loaded('json')) die('skip: json extension not available');
+?>
+--FILE--
+<?php
+// Expect warnings about INF.
+ini_set("error_reporting", E_ALL & ~E_WARNING);
+
+$test = "
+[
+ \"JSON Test Pattern pass1\",
+ {\"object with 1 member\":[\"array with 1 element\"]},
+ {},
+ [],
+ -42,
+ true,
+ false,
+ null,
+ {
+ \"integer\": 1234567890,
+ \"real\": -9876.543210,
+ \"e\": 0.123456789e-12,
+ \"E\": 1.234567890E+34,
+ \"\": 23456789012E666,
+ \"zero\": 0,
+ \"one\": 1,
+ \"space\": \" \",
+ \"quote\": \"\\\"\",
+ \"backslash\": \"\\\\\",
+ \"controls\": \"\\b\\f\\n\\r\\t\",
+ \"slash\": \"/ & \\/\",
+ \"alpha\": \"abcdefghijklmnopqrstuvwyz\",
+ \"ALPHA\": \"ABCDEFGHIJKLMNOPQRSTUVWYZ\",
+ \"digit\": \"0123456789\",
+ \"special\": \"`1~!@#$%^&*()_+-={':[,]}|;.</>?\",
+ \"hex\": \"\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A\",
+ \"true\": true,
+ \"false\": false,
+ \"null\": null,
+ \"array\":[ ],
+ \"object\":{ },
+ \"address\": \"50 St. James Street\",
+ \"url\": \"http://www.JSON.org/\",
+ \"comment\": \"// /* <!-- --\",
+ \"# -- --> */\": \" \",
+ \" s p a c e d \" :[1,2 , 3
+
+,
+
+4 , 5 , 6 ,7 ],
+ \"compact\": [1,2,3,4,5,6,7],
+ \"jsontext\": \"{\\\"object with 1 member\\\":[\\\"array with 1 element\\\"]}\",
+ \"quotes\": \"&#34; \\u0022 %22 0x22 034 &#x22;\",
+ \"\\/\\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?\"
+: \"A key can be any string\"
+ },
+ 0.5 ,98.6
+,
+99.44
+,
+
+1066
+
+
+,\"rosebud\"]
+";
+
+echo 'Testing: ' . $test . "\n";
+echo "DECODE: AS OBJECT\n";
+$obj = json_decode($test);
+var_dump($obj);
+echo "DECODE: AS ARRAY\n";
+$arr = json_decode($test, true);
+var_dump($arr);
+
+echo "ENCODE: FROM OBJECT\n";
+$obj_enc = json_encode($obj);
+echo $obj_enc . "\n";
+echo "ENCODE: FROM ARRAY\n";
+$arr_enc = json_encode($arr);
+echo $arr_enc . "\n";
+
+echo "DECODE AGAIN: AS OBJECT\n";
+$obj = json_decode($obj_enc);
+var_dump($obj);
+echo "DECODE AGAIN: AS ARRAY\n";
+$arr = json_decode($arr_enc, true);
+var_dump($arr);
+
+?>
+--EXPECT--
+Testing:
+[
+ "JSON Test Pattern pass1",
+ {"object with 1 member":["array with 1 element"]},
+ {},
+ [],
+ -42,
+ true,
+ false,
+ null,
+ {
+ "integer": 1234567890,
+ "real": -9876.543210,
+ "e": 0.123456789e-12,
+ "E": 1.234567890E+34,
+ "": 23456789012E666,
+ "zero": 0,
+ "one": 1,
+ "space": " ",
+ "quote": "\"",
+ "backslash": "\\",
+ "controls": "\b\f\n\r\t",
+ "slash": "/ & \/",
+ "alpha": "abcdefghijklmnopqrstuvwyz",
+ "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
+ "digit": "0123456789",
+ "special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
+ "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
+ "true": true,
+ "false": false,
+ "null": null,
+ "array":[ ],
+ "object":{ },
+ "address": "50 St. James Street",
+ "url": "http://www.JSON.org/",
+ "comment": "// /* <!-- --",
+ "# -- --> */": " ",
+ " s p a c e d " :[1,2 , 3
+
+,
+
+4 , 5 , 6 ,7 ],
+ "compact": [1,2,3,4,5,6,7],
+ "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
+ "quotes": "&#34; \u0022 %22 0x22 034 &#x22;",
+ "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
+: "A key can be any string"
+ },
+ 0.5 ,98.6
+,
+99.44
+,
+
+1066
+
+
+,"rosebud"]
+
+DECODE: AS OBJECT
+array(14) {
+ [0]=>
+ string(23) "JSON Test Pattern pass1"
+ [1]=>
+ object(stdClass)#1 (1) {
+ ["object with 1 member"]=>
+ array(1) {
+ [0]=>
+ string(20) "array with 1 element"
+ }
+ }
+ [2]=>
+ object(stdClass)#2 (0) {
+ }
+ [3]=>
+ array(0) {
+ }
+ [4]=>
+ int(-42)
+ [5]=>
+ bool(true)
+ [6]=>
+ bool(false)
+ [7]=>
+ NULL
+ [8]=>
+ object(stdClass)#3 (31) {
+ ["integer"]=>
+ int(1234567890)
+ ["real"]=>
+ float(-9876.54321)
+ ["e"]=>
+ float(1.23456789E-13)
+ ["E"]=>
+ float(1.23456789E+34)
+ ["_empty_"]=>
+ float(INF)
+ ["zero"]=>
+ int(0)
+ ["one"]=>
+ int(1)
+ ["space"]=>
+ string(1) " "
+ ["quote"]=>
+ string(1) """
+ ["backslash"]=>
+ string(1) "\"
+ ["controls"]=>
+ string(5) "
+ "
+ ["slash"]=>
+ string(5) "/ & /"
+ ["alpha"]=>
+ string(25) "abcdefghijklmnopqrstuvwyz"
+ ["ALPHA"]=>
+ string(25) "ABCDEFGHIJKLMNOPQRSTUVWYZ"
+ ["digit"]=>
+ string(10) "0123456789"
+ ["special"]=>
+ string(31) "`1~!@#$%^&*()_+-={':[,]}|;.</>?"
+ ["hex"]=>
+ string(17) "ģ䕧覫췯ê¯î½Š"
+ ["true"]=>
+ bool(true)
+ ["false"]=>
+ bool(false)
+ ["null"]=>
+ NULL
+ ["array"]=>
+ array(0) {
+ }
+ ["object"]=>
+ object(stdClass)#4 (0) {
+ }
+ ["address"]=>
+ string(19) "50 St. James Street"
+ ["url"]=>
+ string(20) "http://www.JSON.org/"
+ ["comment"]=>
+ string(13) "// /* <!-- --"
+ ["# -- --> */"]=>
+ string(1) " "
+ [" s p a c e d "]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["compact"]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["jsontext"]=>
+ string(49) "{"object with 1 member":["array with 1 element"]}"
+ ["quotes"]=>
+ string(27) "&#34; " %22 0x22 034 &#x22;"
+ ["/\"쫾몾ꮘﳞ볚
+ `1~!@#$%^&*()_+-=[]{}|;:',./<>?"]=>
+ string(23) "A key can be any string"
+ }
+ [9]=>
+ float(0.5)
+ [10]=>
+ float(98.6)
+ [11]=>
+ float(99.44)
+ [12]=>
+ int(1066)
+ [13]=>
+ string(7) "rosebud"
+}
+DECODE: AS ARRAY
+array(14) {
+ [0]=>
+ string(23) "JSON Test Pattern pass1"
+ [1]=>
+ array(1) {
+ ["object with 1 member"]=>
+ array(1) {
+ [0]=>
+ string(20) "array with 1 element"
+ }
+ }
+ [2]=>
+ array(0) {
+ }
+ [3]=>
+ array(0) {
+ }
+ [4]=>
+ int(-42)
+ [5]=>
+ bool(true)
+ [6]=>
+ bool(false)
+ [7]=>
+ NULL
+ [8]=>
+ array(31) {
+ ["integer"]=>
+ int(1234567890)
+ ["real"]=>
+ float(-9876.54321)
+ ["e"]=>
+ float(1.23456789E-13)
+ ["E"]=>
+ float(1.23456789E+34)
+ ["_empty_"]=>
+ float(INF)
+ ["zero"]=>
+ int(0)
+ ["one"]=>
+ int(1)
+ ["space"]=>
+ string(1) " "
+ ["quote"]=>
+ string(1) """
+ ["backslash"]=>
+ string(1) "\"
+ ["controls"]=>
+ string(5) "
+ "
+ ["slash"]=>
+ string(5) "/ & /"
+ ["alpha"]=>
+ string(25) "abcdefghijklmnopqrstuvwyz"
+ ["ALPHA"]=>
+ string(25) "ABCDEFGHIJKLMNOPQRSTUVWYZ"
+ ["digit"]=>
+ string(10) "0123456789"
+ ["special"]=>
+ string(31) "`1~!@#$%^&*()_+-={':[,]}|;.</>?"
+ ["hex"]=>
+ string(17) "ģ䕧覫췯ê¯î½Š"
+ ["true"]=>
+ bool(true)
+ ["false"]=>
+ bool(false)
+ ["null"]=>
+ NULL
+ ["array"]=>
+ array(0) {
+ }
+ ["object"]=>
+ array(0) {
+ }
+ ["address"]=>
+ string(19) "50 St. James Street"
+ ["url"]=>
+ string(20) "http://www.JSON.org/"
+ ["comment"]=>
+ string(13) "// /* <!-- --"
+ ["# -- --> */"]=>
+ string(1) " "
+ [" s p a c e d "]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["compact"]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["jsontext"]=>
+ string(49) "{"object with 1 member":["array with 1 element"]}"
+ ["quotes"]=>
+ string(27) "&#34; " %22 0x22 034 &#x22;"
+ ["/\"쫾몾ꮘﳞ볚
+ `1~!@#$%^&*()_+-=[]{}|;:',./<>?"]=>
+ string(23) "A key can be any string"
+ }
+ [9]=>
+ float(0.5)
+ [10]=>
+ float(98.6)
+ [11]=>
+ float(99.44)
+ [12]=>
+ int(1066)
+ [13]=>
+ string(7) "rosebud"
+}
+ENCODE: FROM OBJECT
+["JSON Test Pattern pass1",{"object with 1 member":["array with 1 element"]},{},[],-42,true,false,null,{"integer":1234567890,"real":-9876.54321,"e":1.23456789e-13,"E":1.23456789e+34,"_empty_":0,"zero":0,"one":1,"space":" ","quote":"\"","backslash":"\\","controls":"\b\f\n\r\t","slash":"\/ & \/","alpha":"abcdefghijklmnopqrstuvwyz","ALPHA":"ABCDEFGHIJKLMNOPQRSTUVWYZ","digit":"0123456789","special":"`1~!@#$%^&*()_+-={':[,]}|;.<\/>?","hex":"\u0123\u4567\u89ab\ucdef\uabcd\uef4a","true":true,"false":false,"null":null,"array":[],"object":{},"address":"50 St. James Street","url":"http:\/\/www.JSON.org\/","comment":"\/\/ \/* <!-- --","# -- --> *\/":" "," s p a c e d ":[1,2,3,4,5,6,7],"compact":[1,2,3,4,5,6,7],"jsontext":"{\"object with 1 member\":[\"array with 1 element\"]}","quotes":"&#34; \" %22 0x22 034 &#x22;","\/\\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',.\/<>?":"A key can be any string"},0.5,98.6,99.44,1066,"rosebud"]
+ENCODE: FROM ARRAY
+["JSON Test Pattern pass1",{"object with 1 member":["array with 1 element"]},[],[],-42,true,false,null,{"integer":1234567890,"real":-9876.54321,"e":1.23456789e-13,"E":1.23456789e+34,"_empty_":0,"zero":0,"one":1,"space":" ","quote":"\"","backslash":"\\","controls":"\b\f\n\r\t","slash":"\/ & \/","alpha":"abcdefghijklmnopqrstuvwyz","ALPHA":"ABCDEFGHIJKLMNOPQRSTUVWYZ","digit":"0123456789","special":"`1~!@#$%^&*()_+-={':[,]}|;.<\/>?","hex":"\u0123\u4567\u89ab\ucdef\uabcd\uef4a","true":true,"false":false,"null":null,"array":[],"object":[],"address":"50 St. James Street","url":"http:\/\/www.JSON.org\/","comment":"\/\/ \/* <!-- --","# -- --> *\/":" "," s p a c e d ":[1,2,3,4,5,6,7],"compact":[1,2,3,4,5,6,7],"jsontext":"{\"object with 1 member\":[\"array with 1 element\"]}","quotes":"&#34; \" %22 0x22 034 &#x22;","\/\\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',.\/<>?":"A key can be any string"},0.5,98.6,99.44,1066,"rosebud"]
+DECODE AGAIN: AS OBJECT
+array(14) {
+ [0]=>
+ string(23) "JSON Test Pattern pass1"
+ [1]=>
+ object(stdClass)#5 (1) {
+ ["object with 1 member"]=>
+ array(1) {
+ [0]=>
+ string(20) "array with 1 element"
+ }
+ }
+ [2]=>
+ object(stdClass)#6 (0) {
+ }
+ [3]=>
+ array(0) {
+ }
+ [4]=>
+ int(-42)
+ [5]=>
+ bool(true)
+ [6]=>
+ bool(false)
+ [7]=>
+ NULL
+ [8]=>
+ object(stdClass)#7 (31) {
+ ["integer"]=>
+ int(1234567890)
+ ["real"]=>
+ float(-9876.54321)
+ ["e"]=>
+ float(1.23456789E-13)
+ ["E"]=>
+ float(1.23456789E+34)
+ ["_empty_"]=>
+ int(0)
+ ["zero"]=>
+ int(0)
+ ["one"]=>
+ int(1)
+ ["space"]=>
+ string(1) " "
+ ["quote"]=>
+ string(1) """
+ ["backslash"]=>
+ string(1) "\"
+ ["controls"]=>
+ string(5) "
+ "
+ ["slash"]=>
+ string(5) "/ & /"
+ ["alpha"]=>
+ string(25) "abcdefghijklmnopqrstuvwyz"
+ ["ALPHA"]=>
+ string(25) "ABCDEFGHIJKLMNOPQRSTUVWYZ"
+ ["digit"]=>
+ string(10) "0123456789"
+ ["special"]=>
+ string(31) "`1~!@#$%^&*()_+-={':[,]}|;.</>?"
+ ["hex"]=>
+ string(17) "ģ䕧覫췯ê¯î½Š"
+ ["true"]=>
+ bool(true)
+ ["false"]=>
+ bool(false)
+ ["null"]=>
+ NULL
+ ["array"]=>
+ array(0) {
+ }
+ ["object"]=>
+ object(stdClass)#8 (0) {
+ }
+ ["address"]=>
+ string(19) "50 St. James Street"
+ ["url"]=>
+ string(20) "http://www.JSON.org/"
+ ["comment"]=>
+ string(13) "// /* <!-- --"
+ ["# -- --> */"]=>
+ string(1) " "
+ [" s p a c e d "]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["compact"]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["jsontext"]=>
+ string(49) "{"object with 1 member":["array with 1 element"]}"
+ ["quotes"]=>
+ string(27) "&#34; " %22 0x22 034 &#x22;"
+ ["/\"쫾몾ꮘﳞ볚
+ `1~!@#$%^&*()_+-=[]{}|;:',./<>?"]=>
+ string(23) "A key can be any string"
+ }
+ [9]=>
+ float(0.5)
+ [10]=>
+ float(98.6)
+ [11]=>
+ float(99.44)
+ [12]=>
+ int(1066)
+ [13]=>
+ string(7) "rosebud"
+}
+DECODE AGAIN: AS ARRAY
+array(14) {
+ [0]=>
+ string(23) "JSON Test Pattern pass1"
+ [1]=>
+ array(1) {
+ ["object with 1 member"]=>
+ array(1) {
+ [0]=>
+ string(20) "array with 1 element"
+ }
+ }
+ [2]=>
+ array(0) {
+ }
+ [3]=>
+ array(0) {
+ }
+ [4]=>
+ int(-42)
+ [5]=>
+ bool(true)
+ [6]=>
+ bool(false)
+ [7]=>
+ NULL
+ [8]=>
+ array(31) {
+ ["integer"]=>
+ int(1234567890)
+ ["real"]=>
+ float(-9876.54321)
+ ["e"]=>
+ float(1.23456789E-13)
+ ["E"]=>
+ float(1.23456789E+34)
+ ["_empty_"]=>
+ int(0)
+ ["zero"]=>
+ int(0)
+ ["one"]=>
+ int(1)
+ ["space"]=>
+ string(1) " "
+ ["quote"]=>
+ string(1) """
+ ["backslash"]=>
+ string(1) "\"
+ ["controls"]=>
+ string(5) "
+ "
+ ["slash"]=>
+ string(5) "/ & /"
+ ["alpha"]=>
+ string(25) "abcdefghijklmnopqrstuvwyz"
+ ["ALPHA"]=>
+ string(25) "ABCDEFGHIJKLMNOPQRSTUVWYZ"
+ ["digit"]=>
+ string(10) "0123456789"
+ ["special"]=>
+ string(31) "`1~!@#$%^&*()_+-={':[,]}|;.</>?"
+ ["hex"]=>
+ string(17) "ģ䕧覫췯ê¯î½Š"
+ ["true"]=>
+ bool(true)
+ ["false"]=>
+ bool(false)
+ ["null"]=>
+ NULL
+ ["array"]=>
+ array(0) {
+ }
+ ["object"]=>
+ array(0) {
+ }
+ ["address"]=>
+ string(19) "50 St. James Street"
+ ["url"]=>
+ string(20) "http://www.JSON.org/"
+ ["comment"]=>
+ string(13) "// /* <!-- --"
+ ["# -- --> */"]=>
+ string(1) " "
+ [" s p a c e d "]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["compact"]=>
+ array(7) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ }
+ ["jsontext"]=>
+ string(49) "{"object with 1 member":["array with 1 element"]}"
+ ["quotes"]=>
+ string(27) "&#34; " %22 0x22 034 &#x22;"
+ ["/\"쫾몾ꮘﳞ볚
+ `1~!@#$%^&*()_+-=[]{}|;:',./<>?"]=>
+ string(23) "A key can be any string"
+ }
+ [9]=>
+ float(0.5)
+ [10]=>
+ float(98.6)
+ [11]=>
+ float(99.44)
+ [12]=>
+ int(1066)
+ [13]=>
+ string(7) "rosebud"
+}
diff --git a/ext/json/tests/pass002.phpt b/ext/json/tests/pass002.phpt
new file mode 100644
index 000000000..24c7e3358
--- /dev/null
+++ b/ext/json/tests/pass002.phpt
@@ -0,0 +1,275 @@
+--TEST--
+JSON (http://www.crockford.com/JSON/JSON_checker/test/pass2.json)
+--SKIPIF--
+<?php
+ if (!extension_loaded('json')) die('skip: json extension not available');
+?>
+--FILE--
+<?php
+
+$test = '[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]';
+echo 'Testing: ' . $test . "\n";
+echo "DECODE: AS OBJECT\n";
+$obj = json_decode($test);
+var_dump($obj);
+echo "DECODE: AS ARRAY\n";
+$arr = json_decode($test, true);
+var_dump($arr);
+
+echo "ENCODE: FROM OBJECT\n";
+$obj_enc = json_encode($obj);
+echo $obj_enc . "\n";
+echo "ENCODE: FROM ARRAY\n";
+$arr_enc = json_encode($arr);
+echo $arr_enc . "\n";
+
+echo "DECODE AGAIN: AS OBJECT\n";
+$obj = json_decode($obj_enc);
+var_dump($obj);
+echo "DECODE AGAIN: AS ARRAY\n";
+$arr = json_decode($arr_enc, true);
+var_dump($arr);
+
+?>
+--EXPECT--
+Testing: [[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]
+DECODE: AS OBJECT
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(12) "Not too deep"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+DECODE: AS ARRAY
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(12) "Not too deep"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+ENCODE: FROM OBJECT
+[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]
+ENCODE: FROM ARRAY
+[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]
+DECODE AGAIN: AS OBJECT
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(12) "Not too deep"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+DECODE AGAIN: AS ARRAY
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(12) "Not too deep"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/ext/json/tests/pass003.phpt b/ext/json/tests/pass003.phpt
new file mode 100644
index 000000000..36da4a1de
--- /dev/null
+++ b/ext/json/tests/pass003.phpt
@@ -0,0 +1,94 @@
+--TEST--
+JSON (http://www.crockford.com/JSON/JSON_checker/test/pass3.json)
+--SKIPIF--
+<?php
+ if (!extension_loaded('json')) die('skip: json extension not available');
+?>
+--FILE--
+<?php
+
+$test = '
+{
+ "JSON Test Pattern pass3": {
+ "The outermost value": "must be an object or array.",
+ "In this test": "It is an object."
+ }
+}
+';
+
+echo 'Testing: ' . $test . "\n";
+echo "DECODE: AS OBJECT\n";
+$obj = json_decode($test);
+var_dump($obj);
+echo "DECODE: AS ARRAY\n";
+$arr = json_decode($test, true);
+var_dump($arr);
+
+echo "ENCODE: FROM OBJECT\n";
+$obj_enc = json_encode($obj);
+echo $obj_enc . "\n";
+echo "ENCODE: FROM ARRAY\n";
+$arr_enc = json_encode($arr);
+echo $arr_enc . "\n";
+
+echo "DECODE AGAIN: AS OBJECT\n";
+$obj = json_decode($obj_enc);
+var_dump($obj);
+echo "DECODE AGAIN: AS ARRAY\n";
+$arr = json_decode($arr_enc, true);
+var_dump($arr);
+
+?>
+--EXPECT--
+Testing:
+{
+ "JSON Test Pattern pass3": {
+ "The outermost value": "must be an object or array.",
+ "In this test": "It is an object."
+ }
+}
+
+DECODE: AS OBJECT
+object(stdClass)#1 (1) {
+ ["JSON Test Pattern pass3"]=>
+ object(stdClass)#2 (2) {
+ ["The outermost value"]=>
+ string(27) "must be an object or array."
+ ["In this test"]=>
+ string(16) "It is an object."
+ }
+}
+DECODE: AS ARRAY
+array(1) {
+ ["JSON Test Pattern pass3"]=>
+ array(2) {
+ ["The outermost value"]=>
+ string(27) "must be an object or array."
+ ["In this test"]=>
+ string(16) "It is an object."
+ }
+}
+ENCODE: FROM OBJECT
+{"JSON Test Pattern pass3":{"The outermost value":"must be an object or array.","In this test":"It is an object."}}
+ENCODE: FROM ARRAY
+{"JSON Test Pattern pass3":{"The outermost value":"must be an object or array.","In this test":"It is an object."}}
+DECODE AGAIN: AS OBJECT
+object(stdClass)#3 (1) {
+ ["JSON Test Pattern pass3"]=>
+ object(stdClass)#4 (2) {
+ ["The outermost value"]=>
+ string(27) "must be an object or array."
+ ["In this test"]=>
+ string(16) "It is an object."
+ }
+}
+DECODE AGAIN: AS ARRAY
+array(1) {
+ ["JSON Test Pattern pass3"]=>
+ array(2) {
+ ["The outermost value"]=>
+ string(27) "must be an object or array."
+ ["In this test"]=>
+ string(16) "It is an object."
+ }
+}
diff --git a/ext/json/utf8_decode.c b/ext/json/utf8_decode.c
new file mode 100644
index 000000000..cea1f8cec
--- /dev/null
+++ b/ext/json/utf8_decode.c
@@ -0,0 +1,179 @@
+/* utf8_decode.c */
+
+/* 2005-12-25 */
+
+/*
+Copyright (c) 2005 JSON.org
+
+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.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "utf8_decode.h"
+
+/*
+ Very Strict UTF-8 Decoder
+
+ UTF-8 is a multibyte character encoding of Unicode. A character can be
+ represented by 1-4 bytes. The bit pattern of the first byte indicates the
+ number of continuation bytes.
+
+ Most UTF-8 decoders tend to be lenient, attempting to recover as much
+ information as possible, even from badly encoded input. This UTF-8
+ decoder is not lenient. It will reject input which does not include
+ proper continuation bytes. It will reject aliases (or suboptimal
+ codings). It will reject surrogates. (Surrogate encoding should only be
+ used with UTF-16.)
+
+ Code Contination Minimum Maximum
+ 0xxxxxxx 0 0 127
+ 10xxxxxx error
+ 110xxxxx 1 128 2047
+ 1110xxxx 2 2048 65535 excluding 55296 - 57343
+ 11110xxx 3 65536 1114111
+ 11111xxx error
+*/
+
+
+/*
+ Get the next byte. It returns UTF8_END if there are no more bytes.
+*/
+static int
+get(json_utf8_decode *utf8)
+{
+ int c;
+ if (utf8->the_index >= utf8->the_length) {
+ return UTF8_END;
+ }
+ c = utf8->the_input[utf8->the_index] & 0xFF;
+ utf8->the_index += 1;
+ return c;
+}
+
+
+/*
+ Get the 6-bit payload of the next continuation byte.
+ Return UTF8_ERROR if it is not a contination byte.
+*/
+static int
+cont(json_utf8_decode *utf8)
+{
+ int c = get(utf8);
+ return ((c & 0xC0) == 0x80) ? (c & 0x3F) : UTF8_ERROR;
+}
+
+
+/*
+ Initialize the UTF-8 decoder. The decoder is not reentrant,
+*/
+void
+utf8_decode_init(json_utf8_decode *utf8, char p[], int length)
+{
+ utf8->the_index = 0;
+ utf8->the_input = p;
+ utf8->the_length = length;
+ utf8->the_char = 0;
+ utf8->the_byte = 0;
+}
+
+
+/*
+ Get the current byte offset. This is generally used in error reporting.
+*/
+int
+utf8_decode_at_byte(json_utf8_decode *utf8)
+{
+ return utf8->the_byte;
+}
+
+
+/*
+ Get the current character offset. This is generally used in error reporting.
+ The character offset matches the byte offset if the text is strictly ASCII.
+*/
+int
+utf8_decode_at_character(json_utf8_decode *utf8)
+{
+ return utf8->the_char > 0 ? utf8->the_char - 1 : 0;
+}
+
+
+/*
+ Extract the next character.
+ Returns: the character (between 0 and 1114111)
+ or UTF8_END (the end)
+ or UTF8_ERROR (error)
+*/
+int
+utf8_decode_next(json_utf8_decode *utf8)
+{
+ int c; /* the first byte of the character */
+ int r; /* the result */
+
+ if (utf8->the_index >= utf8->the_length) {
+ return utf8->the_index == utf8->the_length ? UTF8_END : UTF8_ERROR;
+ }
+ utf8->the_byte = utf8->the_index;
+ utf8->the_char += 1;
+ c = get(utf8);
+/*
+ Zero continuation (0 to 127)
+*/
+ if ((c & 0x80) == 0) {
+ return c;
+ }
+/*
+ One contination (128 to 2047)
+*/
+ if ((c & 0xE0) == 0xC0) {
+ int c1 = cont(utf8);
+ if (c1 < 0) {
+ return UTF8_ERROR;
+ }
+ r = ((c & 0x1F) << 6) | c1;
+ return r >= 128 ? r : UTF8_ERROR;
+ }
+/*
+ Two continuation (2048 to 55295 and 57344 to 65535)
+*/
+ if ((c & 0xF0) == 0xE0) {
+ int c1 = cont(utf8);
+ int c2 = cont(utf8);
+ if (c1 < 0 || c2 < 0) {
+ return UTF8_ERROR;
+ }
+ r = ((c & 0x0F) << 12) | (c1 << 6) | c2;
+ return r >= 2048 && (r < 55296 || r > 57343) ? r : UTF8_ERROR;
+ }
+/*
+ Three continuation (65536 to 1114111)
+*/
+ if ((c & 0xF1) == 0xF0) {
+ int c1 = cont(utf8);
+ int c2 = cont(utf8);
+ int c3 = cont(utf8);
+ if (c1 < 0 || c2 < 0 || c3 < 0) {
+ return UTF8_ERROR;
+ }
+ r = ((c & 0x0F) << 18) | (c1 << 12) | (c2 << 6) | c3;
+ return r >= 65536 && r <= 1114111 ? r : UTF8_ERROR;
+ }
+ return UTF8_ERROR;
+}
diff --git a/ext/json/utf8_decode.h b/ext/json/utf8_decode.h
new file mode 100644
index 000000000..cc0fc79f6
--- /dev/null
+++ b/ext/json/utf8_decode.h
@@ -0,0 +1,18 @@
+/* utf8_decode.h */
+
+#define UTF8_END -1
+#define UTF8_ERROR -2
+
+typedef struct json_utf8_decode
+{
+ int the_index;
+ char *the_input;
+ int the_length;
+ int the_char;
+ int the_byte;
+} json_utf8_decode;
+
+extern int utf8_decode_at_byte(json_utf8_decode *utf8);
+extern int utf8_decode_at_character(json_utf8_decode *utf8);
+extern void utf8_decode_init(json_utf8_decode *utf8, char p[], int length);
+extern int utf8_decode_next(json_utf8_decode *utf8);
diff --git a/ext/json/utf8_to_utf16.c b/ext/json/utf8_to_utf16.c
new file mode 100644
index 000000000..bc2d6f36d
--- /dev/null
+++ b/ext/json/utf8_to_utf16.c
@@ -0,0 +1,56 @@
+/* utf8_to_utf16.c */
+
+/* 2005-12-25 */
+
+/*
+Copyright (c) 2005 JSON.org
+
+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.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "utf8_to_utf16.h"
+#include "utf8_decode.h"
+
+int
+utf8_to_utf16(unsigned short w[], char p[], int length)
+{
+ int c;
+ int the_index = 0;
+ json_utf8_decode utf8;
+
+ utf8_decode_init(&utf8, p, length);
+ for (;;) {
+ c = utf8_decode_next(&utf8);
+ if (c < 0) {
+ return UTF8_END ? the_index : UTF8_ERROR;
+ }
+ if (c < 0x10000) {
+ w[the_index] = (unsigned short)c;
+ the_index += 1;
+ } else {
+ c &= 0xFFFF;
+ w[the_index] = (unsigned short)(0xD800 | (c >> 10));
+ the_index += 1;
+ w[the_index] = (unsigned short)(0xDC00 | (c & 0x3FF));
+ the_index += 1;
+ }
+ }
+}
diff --git a/ext/json/utf8_to_utf16.h b/ext/json/utf8_to_utf16.h
new file mode 100644
index 000000000..5aff0268b
--- /dev/null
+++ b/ext/json/utf8_to_utf16.h
@@ -0,0 +1,3 @@
+/* utf8_to_utf16.h */
+
+extern int utf8_to_utf16(unsigned short w[], char p[], int length);
diff --git a/ext/ldap/config.m4 b/ext/ldap/config.m4
index 61d04f4da..cd6c755a9 100644
--- a/ext/ldap/config.m4
+++ b/ext/ldap/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.39.2.6 2005/11/21 19:06:04 sniper Exp $
+dnl $Id: config.m4,v 1.39.2.6.2.1 2006/10/18 20:58:23 tony2001 Exp $
dnl
AC_DEFUN([PHP_LDAP_CHECKS], [
@@ -70,7 +70,7 @@ PHP_ARG_WITH(ldap-sasl,for LDAP Cyrus SASL support,
if test "$PHP_LDAP" != "no"; then
- PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared)
+ PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared,,-DLDAP_DEPRECATED=1)
if test "$PHP_LDAP" = "yes"; then
for i in /usr/local /usr; do
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 9a39f65aa..b8726c1ae 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -22,7 +22,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ldap.c,v 1.161.2.3 2006/01/01 12:50:08 sniper Exp $ */
+/* $Id: ldap.c,v 1.161.2.3.2.1 2006/06/15 18:33:07 dmitry Exp $ */
#define IS_EXT_MODULE
#ifdef HAVE_CONFIG_H
@@ -78,6 +78,7 @@ typedef struct {
} ldap_resultentry;
ZEND_DECLARE_MODULE_GLOBALS(ldap)
+static PHP_GINIT_FUNCTION(ldap);
static
ZEND_BEGIN_ARG_INFO(arg3to6of6_force_ref, 0)
@@ -177,7 +178,11 @@ zend_module_entry ldap_module_entry = {
NULL,
PHP_MINFO(ldap),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(ldap),
+ PHP_GINIT(ldap),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
#ifdef COMPILE_DL_LDAP
@@ -222,9 +227,9 @@ PHP_INI_BEGIN()
PHP_INI_END()
/* }}} */
-/* {{{ php_ldap_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
-static void php_ldap_init_globals(zend_ldap_globals *ldap_globals)
+static PHP_GINIT_FUNCTION(ldap)
{
ldap_globals->num_links = 0;
}
@@ -234,8 +239,6 @@ static void php_ldap_init_globals(zend_ldap_globals *ldap_globals)
*/
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() */
@@ -314,7 +317,7 @@ PHP_MINFO_FUNCTION(ldap)
php_info_print_table_start();
php_info_print_table_row(2, "LDAP Support", "enabled");
- php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.161.2.3 2006/01/01 12:50:08 sniper Exp $");
+ php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.161.2.3.2.1 2006/06/15 18:33:07 dmitry Exp $");
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index d974f1272..2ad1896b7 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: libxml.c,v 1.32.2.7 2006/01/01 12:50:08 sniper Exp $ */
+/* $Id: libxml.c,v 1.32.2.7.2.8 2006/09/06 21:44:45 edink Exp $ */
#define IS_EXT_MODULE
@@ -60,20 +60,14 @@ typedef struct _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_DECLARE_MODULE_GLOBALS(libxml)
+static PHP_GINIT_FUNCTION(libxml);
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 */
/* }}} */
@@ -86,13 +80,38 @@ PHP_MINFO_FUNCTION(libxml);
/* }}} */
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_libxml_set_streams_context, 0)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_libxml_use_internal_errors, 0)
+ ZEND_ARG_INFO(0, use_errors)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_libxml_get_last_error, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_libxml_get_errors, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_libxml_clear_errors, 0)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
/* {{{ extension definition structures */
zend_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)
+ PHP_FE(libxml_set_streams_context, arginfo_libxml_set_streams_context)
+ PHP_FE(libxml_use_internal_errors, arginfo_libxml_use_internal_errors)
+ PHP_FE(libxml_get_last_error, arginfo_libxml_get_last_error)
+ PHP_FE(libxml_clear_errors, arginfo_libxml_clear_errors)
+ PHP_FE(libxml_get_errors, arginfo_libxml_get_errors)
{NULL, NULL, NULL}
};
@@ -106,7 +125,11 @@ zend_module_entry libxml_module_entry = {
PHP_RSHUTDOWN(libxml), /* per-request shutdown function */
PHP_MINFO(libxml), /* information function */
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(libxml), /* globals descriptor */
+ PHP_GINIT(libxml), /* globals ctor */
+ NULL, /* globals dtor */
+ NULL, /* post deactivate */
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
@@ -237,14 +260,12 @@ static void php_libxml_node_free_list(xmlNodePtr node TSRMLS_DC)
/* }}} */
/* {{{ startup, shutdown and info functions */
-#ifdef ZTS
-static void php_libxml_init_globals(php_libxml_globals *libxml_globals_p TSRMLS_DC)
+static PHP_GINIT_FUNCTION(libxml)
{
- LIBXML(stream_context) = NULL;
- LIBXML(error_buffer).c = NULL;
- LIBXML(error_list) = NULL;
+ libxml_globals->stream_context = NULL;
+ libxml_globals->error_buffer.c = NULL;
+ libxml_globals->error_list = NULL;
}
-#endif
/* Channel libxml file io layer through the PHP streams subsystem.
* This allows use of ftps:// and https:// urls */
@@ -575,14 +596,6 @@ PHP_MINIT_FUNCTION(libxml)
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);
@@ -644,6 +657,10 @@ PHP_RSHUTDOWN_FUNCTION(libxml)
xmlParserInputBufferCreateFilenameDefault(NULL);
xmlOutputBufferCreateFilenameDefault(NULL);
+ if (LIBXML(stream_context)) {
+ zval_ptr_dtor(&LIBXML(stream_context));
+ LIBXML(stream_context) = NULL;
+ }
smart_str_free(&LIBXML(error_buffer));
if (LIBXML(error_list)) {
zend_llist_destroy(LIBXML(error_list));
@@ -683,12 +700,12 @@ PHP_FUNCTION(libxml_set_streams_context)
}
/* }}} */
-/* {{{ proto void libxml_use_internal_errors(boolean use_errors)
+/* {{{ 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;
+ zend_bool use_errors=0, retval;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &use_errors) == FAILURE) {
return;
@@ -942,11 +959,15 @@ int php_libxml_decrement_doc_ref(php_libxml_node_object *object TSRMLS_DC) {
xmlFreeDoc((xmlDoc *) object->document->ptr);
}
if (object->document->doc_props != NULL) {
+ if (object->document->doc_props->classmap) {
+ zend_hash_destroy(object->document->doc_props->classmap);
+ FREE_HASHTABLE(object->document->doc_props->classmap);
+ }
efree(object->document->doc_props);
}
efree(object->document);
+ object->document = NULL;
}
- object->document = NULL;
}
return ret_refcount;
@@ -1004,12 +1025,21 @@ void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC
obj_node->_private = NULL;
}
}
+ }
+ if (object != NULL && object->document != NULL) {
/* Safe to call as if the resource were freed then doc pointer is NULL */
php_libxml_decrement_doc_ref(object TSRMLS_CC);
}
}
/* }}} */
+#ifdef PHP_WIN32
+PHP_LIBXML_API BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ return xmlDllMain(hinstDLL, fdwReason, lpvReserved);
+}
+#endif
+
#endif
/*
diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h
index 65a7ef186..2a1e54bb8 100644
--- a/ext/libxml/php_libxml.h
+++ b/ext/libxml/php_libxml.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_libxml.h,v 1.15.2.2 2006/01/01 12:50:08 sniper Exp $ */
+/* $Id: php_libxml.h,v 1.15.2.2.2.2 2006/06/15 18:33:07 dmitry Exp $ */
#ifndef PHP_LIBXML_H
#define PHP_LIBXML_H
@@ -37,16 +37,27 @@ extern zend_module_entry libxml_module_entry;
#define LIBXML_SAVE_NOEMPTYTAG 1<<2
-typedef struct {
+ZEND_BEGIN_MODULE_GLOBALS(libxml)
zval *stream_context;
smart_str error_buffer;
zend_llist *error_list;
-} php_libxml_globals;
+ZEND_END_MODULE_GLOBALS(libxml)
+
+typedef struct _libxml_doc_props {
+ int formatoutput;
+ int validateonparse;
+ int resolveexternals;
+ int preservewhitespace;
+ int substituteentities;
+ int stricterror;
+ int recover;
+ HashTable *classmap;
+} libxml_doc_props;
typedef struct _php_libxml_ref_obj {
void *ptr;
int refcount;
- void *doc_props;
+ libxml_doc_props *doc_props;
} php_libxml_ref_obj;
typedef struct _php_libxml_node_ptr {
@@ -92,7 +103,7 @@ 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)
+#define LIBXML(v) TSRMG(libxml_globals_id, zend_libxml_globals *, v)
#else
#define LIBXML(v) (libxml_globals.v)
#endif
diff --git a/ext/libxml/php_libxml2.def b/ext/libxml/php_libxml2.def
index f1998c320..ef21f5e64 100644
--- a/ext/libxml/php_libxml2.def
+++ b/ext/libxml/php_libxml2.def
@@ -1391,6 +1391,7 @@ xmlXPathCompile
xmlXPathCompiledEval
xmlXPathConcatFunction
xmlXPathContainsFunction
+xmlXPathContextSetCache
xmlXPathConvertBoolean
xmlXPathConvertNumber
xmlXPathConvertString
diff --git a/ext/libxml/tests/001.phpt b/ext/libxml/tests/001.phpt
new file mode 100644
index 000000000..6f68cb4a8
--- /dev/null
+++ b/ext/libxml/tests/001.phpt
@@ -0,0 +1,31 @@
+--TEST--
+libxml_use_internal_errors()
+--SKIPIF--
+<?php if (!extension_loaded('libxml')) die('skip'); ?>
+--FILE--
+<?php
+
+var_dump(libxml_use_internal_errors(false));
+var_dump(libxml_use_internal_errors(true));
+var_dump(libxml_use_internal_errors());
+var_dump(libxml_use_internal_errors(new stdclass));
+
+var_dump(libxml_get_errors());
+var_dump(libxml_get_last_error());
+
+var_dump(libxml_clear_errors());
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(false)
+bool(false)
+bool(true)
+
+Warning: libxml_use_internal_errors() expects parameter 1 to be boolean, object given in %s001.php on line 6
+NULL
+array(0) {
+}
+bool(false)
+NULL
+Done
diff --git a/ext/libxml/tests/002.phpt b/ext/libxml/tests/002.phpt
new file mode 100644
index 000000000..f803d7ab1
--- /dev/null
+++ b/ext/libxml/tests/002.phpt
@@ -0,0 +1,87 @@
+--TEST--
+libxml_get_errors()
+--SKIPIF--
+<?php if (!extension_loaded('simplexml')) die('skip'); ?>
+--FILE--
+<?php
+
+var_dump(libxml_use_internal_errors(true));
+
+$xmlstr = <<< XML
+<?xml version='1.0' standalone='yes'?>
+ <movies>
+ <movie>
+ <titles>PHP: Behind the Parser</title>
+ </movie>
+ </movies>
+XML;
+
+$doc = simplexml_load_string($xmlstr);
+$xml = explode("\n", $xmlstr);
+
+if (!$doc) {
+ $errors = libxml_get_errors();
+
+ foreach ($errors as $error) {
+ echo display_xml_error($error, $xml);
+ }
+
+ var_dump(libxml_get_last_error());
+}
+
+
+function display_xml_error($error, $xml)
+{
+ $return = $xml[$error->line - 1] . "\n";
+ $return .= str_repeat('-', $error->column) . "^\n";
+
+ switch ($error->level) {
+ case LIBXML_ERR_WARNING:
+ $return .= "Warning $error->code: ";
+ break;
+ case LIBXML_ERR_ERROR:
+ $return .= "Error $error->code: ";
+ break;
+ case LIBXML_ERR_FATAL:
+ $return .= "Fatal Error $error->code: ";
+ break;
+ }
+
+ $return .= trim($error->message) . "\n Line: $error->line" . "\n Column: $error->column";
+
+ if ($error->file) {
+ $return .= "\n File: $error->file";
+ }
+
+ return "$return\n\n--------------------------------------------\n\n";
+}
+
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(false)
+ <titles>PHP: Behind the Parser</title>
+%s
+Fatal Error 76: Opening and ending tag mismatch: titles line 4 and title
+ Line: 4
+ Column: %d
+
+--------------------------------------------
+
+object(LibXMLError)#%d (6) {
+ ["level"]=>
+ int(3)
+ ["code"]=>
+ int(76)
+ ["column"]=>
+ int(%d)
+ ["message"]=>
+ string(57) "Opening and ending tag mismatch: titles line 4 and title
+"
+ ["file"]=>
+ string(0) ""
+ ["line"]=>
+ int(4)
+}
+Done
diff --git a/ext/libxml/tests/003.phpt b/ext/libxml/tests/003.phpt
new file mode 100644
index 000000000..dcf6c0bb6
--- /dev/null
+++ b/ext/libxml/tests/003.phpt
@@ -0,0 +1,28 @@
+--TEST--
+libxml_use_internal_errors() memory leaks
+--SKIPIF--
+<?php if (!extension_loaded('simplexml')) die('skip'); ?>
+--FILE--
+<?php
+var_dump(libxml_use_internal_errors(true));
+
+$xmlstr = <<< XML
+<?xml version='1.0' standalone='yes'?>
+ <movies>
+ <movie>
+ <titles>PHP: Behind the Parser</title>
+ </movie>
+ </movies>
+XML;
+
+simplexml_load_string($xmlstr);
+
+// test memleaks here
+var_dump(libxml_use_internal_errors(false));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(false)
+bool(true)
+Done
diff --git a/ext/libxml/tests/004.phpt b/ext/libxml/tests/004.phpt
new file mode 100644
index 000000000..f347aed61
--- /dev/null
+++ b/ext/libxml/tests/004.phpt
@@ -0,0 +1,57 @@
+--TEST--
+libxml_set_streams_context()
+--SKIPIF--
+<?php if (!extension_loaded('dom')) die('skip'); ?>
+--FILE--
+<?php
+
+$ctxs = array(
+ NULL,
+ 'bogus',
+ 123,
+ new stdclass,
+ array('a'),
+ stream_context_create(),
+ stream_context_create(array('file')),
+ stream_context_create(array('file' => array('some_opt' => 'aaa')))
+);
+
+
+foreach ($ctxs as $ctx) {
+ var_dump(libxml_set_streams_context($ctx));
+ $dom = new DOMDocument();
+ var_dump($dom->load(dirname(__FILE__).'/test.xml'));
+}
+
+echo "Done\n";
+
+?>
+--EXPECTF--
+Warning: options should have the form ["wrappername"]["optionname"] = $value in %s004.php on line 10
+NULL
+
+Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18
+bool(true)
+NULL
+
+Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18
+bool(true)
+NULL
+
+Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18
+bool(true)
+NULL
+
+Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18
+bool(true)
+NULL
+
+Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18
+bool(true)
+NULL
+bool(true)
+NULL
+bool(true)
+NULL
+bool(true)
+Done
diff --git a/ext/libxml/tests/test.xml b/ext/libxml/tests/test.xml
new file mode 100644
index 000000000..fc1d32890
--- /dev/null
+++ b/ext/libxml/tests/test.xml
@@ -0,0 +1,8 @@
+<library>
+ <book>
+ <title>PHP made simple</title>
+ </book>
+ <book>
+ <title>learn PHP easily</title>
+ </book>
+</library>
diff --git a/ext/mbstring/config.m4 b/ext/mbstring/config.m4
index b62d8710c..aa55d0b04 100644
--- a/ext/mbstring/config.m4
+++ b/ext/mbstring/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.58.2.4 2006/04/17 22:13:56 sniper Exp $
+dnl $Id: config.m4,v 1.58.2.4.2.6 2006/10/01 08:34:39 hirokawa Exp $
dnl
AC_DEFUN([PHP_MBSTRING_ADD_SOURCES], [
@@ -101,6 +101,11 @@ esac
fi
AC_DEFINE([HAVE_MBREGEX], 1, [whether to have multibyte regex support])
+
+ if test "$PHP_MBREGEX_BACKTRACK" != "no"; then
+ AC_DEFINE([USE_COMBINATION_EXPLOSION_CHECK],1,[whether to check multibyte regex backtrack])
+ fi
+
PHP_MBSTRING_ADD_CFLAG([-DNOT_RUBY])
PHP_MBSTRING_ADD_BUILD_DIR([oniguruma])
PHP_MBSTRING_ADD_BUILD_DIR([oniguruma/enc])
@@ -149,6 +154,7 @@ esac
oniguruma/enc/utf16_le.c
oniguruma/enc/utf32_be.c
oniguruma/enc/utf32_le.c
+ oniguruma/enc/gb18030.c
])
fi
])
@@ -277,6 +283,9 @@ PHP_ARG_ENABLE(mbstring, whether to 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_ENABLE([mbregex_backtrack], [whether to check multibyte regex backtrack],
+[ --disable-mbregex-backtrack MBSTRING: Disable multibyte regex backtrack check], 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)
@@ -293,7 +302,7 @@ if test "$PHP_MBSTRING" != "no"; then
dnl libmbfl is required
PHP_MBSTRING_SETUP_LIBMBFL
PHP_MBSTRING_EXTENSION
- PHP_INSTALL_HEADERS([ext/mbstring], [libmbfl/ libmbfl/mbfl])
+ PHP_INSTALL_HEADERS([ext/mbstring], [mbstring.h php_mbregex.h libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h oniguruma/oniguruma.h oniguruma/php_onig_compat.h])
fi
# vim600: sts=2 sw=2 et
diff --git a/ext/mbstring/config.w32 b/ext/mbstring/config.w32
index c4976a9c9..32e6aca5e 100644
--- a/ext/mbstring/config.w32
+++ b/ext/mbstring/config.w32
@@ -1,8 +1,9 @@
-// $Id: config.w32,v 1.10.2.1 2005/12/23 15:18:52 hirokawa Exp $
+// $Id: config.w32,v 1.10.2.1.2.2 2006/09/21 16:37:20 masugata Exp $
// vim:ft=javascript
ARG_ENABLE("mbstring", "multibyte string functions", "no");
ARG_ENABLE("mbregex", "multibyte regex support", "no");
+ARG_ENABLE("mbregex-backtrack", "check multibyte regex backtrack", "yes");
if (PHP_MBSTRING == "yes") {
@@ -52,6 +53,9 @@ if (PHP_MBSTRING == "yes") {
if (PHP_MBREGEX != "no") {
AC_DEFINE('HAVE_STDARG_PROTOTYPES', 1, 'have stdarg.h');
AC_DEFINE('HAVE_MBREGEX', 1);
+ if (PHP_MBREGEX_BACKTRACK != "no") {
+ AC_DEFINE('USE_COMBINATION_EXPLOSION_CHECK', 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");
@@ -61,7 +65,7 @@ if (PHP_MBSTRING == "yes") {
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");
+ utf32_be.c utf32_le.c gb18030.c", "mbstring");
ADD_SOURCES("ext/mbstring", "php_mbregex.c", "mbstring");
}
}
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index dbf2bf413..84cd7ca54 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.224.2.23 2006/05/11 14:47:34 masugata Exp $ */
+/* $Id: mbstring.c,v 1.224.2.22.2.15 2006/09/24 07:10:54 hirokawa Exp $ */
/*
* PHP 4 Multibyte String module "mbstring"
@@ -81,8 +81,9 @@
/* }}} */
/* {{{ 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);
+ZEND_DECLARE_MODULE_GLOBALS(mbstring)
+static PHP_GINIT_FUNCTION(mbstring);
+static PHP_GSHUTDOWN_FUNCTION(mbstring);
/* }}} */
/* {{{ php_mb_default_identify_list */
@@ -172,6 +173,11 @@ static const struct mb_overload_def mb_ovld[] = {
{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, "stripos", "mb_stripos", "mb_orig_stripos"},
+ {MB_OVERLOAD_STRING, "strripos", "mb_strripos", "mb_orig_stripos"},
+ {MB_OVERLOAD_STRING, "strstr", "mb_strstr", "mb_orig_strstr"},
+ {MB_OVERLOAD_STRING, "strrchr", "mb_strrchr", "mb_orig_strrchr"},
+ {MB_OVERLOAD_STRING, "stristr", "mb_stristr", "mb_orig_stristr"},
{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"},
@@ -204,6 +210,12 @@ zend_function_entry mbstring_functions[] = {
PHP_FE(mb_strlen, NULL)
PHP_FE(mb_strpos, NULL)
PHP_FE(mb_strrpos, NULL)
+ PHP_FE(mb_stripos, NULL)
+ PHP_FE(mb_strripos, NULL)
+ PHP_FE(mb_strstr, NULL)
+ PHP_FE(mb_strrchr, NULL)
+ PHP_FE(mb_stristr, NULL)
+ PHP_FE(mb_strrichr, NULL)
PHP_FE(mb_substr_count, NULL)
PHP_FE(mb_substr, NULL)
PHP_FE(mb_strcut, NULL)
@@ -239,7 +251,11 @@ zend_module_entry mbstring_module_entry = {
PHP_RSHUTDOWN(mbstring),
PHP_MINFO(mbstring),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(mbstring),
+ PHP_GINIT(mbstring),
+ PHP_GSHUTDOWN(mbstring),
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
@@ -251,8 +267,6 @@ static sapi_post_entry php_post_entries[] = {
};
/* }}} */
-ZEND_DECLARE_MODULE_GLOBALS(mbstring)
-
#ifdef COMPILE_DL_MBSTRING
ZEND_GET_MODULE(mbstring)
# ifdef PHP_WIN32
@@ -761,51 +775,51 @@ PHP_INI_END()
/* }}} */
/* {{{ module global initialize handler */
-static void _php_mb_globals_ctor(zend_mbstring_globals *pglobals TSRMLS_DC)
+static PHP_GINIT_FUNCTION(mbstring)
{
- 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);
+ mbstring_globals->language = mbfl_no_language_uni;
+ mbstring_globals->current_language = mbstring_globals->language;
+ mbstring_globals->internal_encoding = mbfl_no_encoding_invalid;
+ mbstring_globals->current_internal_encoding = mbstring_globals->internal_encoding;
#ifdef ZEND_MULTIBYTE
- MBSTRG(script_encoding_list) = NULL;
- MBSTRG(script_encoding_list_size) = 0;
+ mbstring_globals->script_encoding_list = NULL;
+ mbstring_globals->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(illegalchars) = 0;
- MBSTRG(func_overload) = 0;
- MBSTRG(encoding_translation) = 0;
- MBSTRG(strict_detection) = 0;
- pglobals->outconv = NULL;
+ mbstring_globals->http_output_encoding = mbfl_no_encoding_pass;
+ mbstring_globals->current_http_output_encoding = mbfl_no_encoding_pass;
+ mbstring_globals->http_input_identify = mbfl_no_encoding_invalid;
+ mbstring_globals->http_input_identify_get = mbfl_no_encoding_invalid;
+ mbstring_globals->http_input_identify_post = mbfl_no_encoding_invalid;
+ mbstring_globals->http_input_identify_cookie = mbfl_no_encoding_invalid;
+ mbstring_globals->http_input_identify_string = mbfl_no_encoding_invalid;
+ mbstring_globals->http_input_list = NULL;
+ mbstring_globals->http_input_list_size = 0;
+ mbstring_globals->detect_order_list = NULL;
+ mbstring_globals->detect_order_list_size = 0;
+ mbstring_globals->current_detect_order_list = NULL;
+ mbstring_globals->current_detect_order_list_size = 0;
+ mbstring_globals->default_detect_order_list = (enum mbfl_no_encoding *) php_mb_default_identify_list_neut;
+ mbstring_globals->default_detect_order_list_size = sizeof(php_mb_default_identify_list_neut) / sizeof(php_mb_default_identify_list_neut[0]);
+ mbstring_globals->filter_illegal_mode = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
+ mbstring_globals->filter_illegal_substchar = 0x3f; /* '?' */
+ mbstring_globals->current_filter_illegal_mode = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
+ mbstring_globals->current_filter_illegal_substchar = 0x3f; /* '?' */
+ mbstring_globals->illegalchars = 0;
+ mbstring_globals->func_overload = 0;
+ mbstring_globals->encoding_translation = 0;
+ mbstring_globals->strict_detection = 0;
+ mbstring_globals->outconv = NULL;
#if HAVE_MBREGEX
- _php_mb_regex_globals_ctor(pglobals TSRMLS_CC);
+ _php_mb_regex_globals_ctor(mbstring_globals TSRMLS_CC);
#endif
}
/* }}} */
-/* {{{ static void _php_mb_globals_dtor() */
-static void _php_mb_globals_dtor(zend_mbstring_globals *pglobals TSRMLS_DC)
+/* {{{ PHP_GSHUTDOWN_FUNCTION */
+static PHP_GSHUTDOWN_FUNCTION(mbstring)
{
#if HAVE_MBREGEX
- _php_mb_regex_globals_dtor(pglobals TSRMLS_CC);
+ _php_mb_regex_globals_dtor(mbstring_globals TSRMLS_CC);
#endif
}
/* }}} */
@@ -815,14 +829,6 @@ 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)) {
@@ -866,12 +872,6 @@ PHP_MSHUTDOWN_FUNCTION(mbstring)
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;
}
/* }}} */
@@ -1048,6 +1048,11 @@ PHP_MINFO_FUNCTION(mbstring)
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);
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ php_info_print_table_row(2, "Multibyte regex (oniguruma) backtrack check", "On");
+#else /* USE_COMBINATION_EXPLOSION_CHECK */
+ php_info_print_table_row(2, "Multibyte regex (oniguruma) backtrack check", "Off");
+#endif /* USE_COMBINATION_EXPLOSION_CHECK */
}
#endif
php_info_print_table_end();
@@ -1630,7 +1635,7 @@ PHP_FUNCTION(mb_strpos)
}
/* }}} */
-/* {{{ proto int mb_strrpos(string haystack, string needle [, string encoding])
+/* {{{ proto int mb_strrpos(string haystack, string needle [, int offset [, string encoding]])
Find the last occurrence of a character in a string within another */
PHP_FUNCTION(mb_strrpos)
{
@@ -1638,6 +1643,10 @@ PHP_FUNCTION(mb_strrpos)
mbfl_string haystack, needle;
char *enc_name = NULL;
int enc_name_len;
+ zval **zoffset;
+ long offset = 0, str_flg;
+ char *enc_name2 = NULL;
+ int enc_name_len2;
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
@@ -1646,10 +1655,51 @@ PHP_FUNCTION(mb_strrpos)
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) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|Zs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &zoffset, &enc_name, &enc_name_len) == FAILURE) {
RETURN_FALSE;
}
+ if(ZEND_NUM_ARGS() >= 3) {
+ if (Z_TYPE_PP(zoffset) == IS_STRING) {
+ enc_name2 = Z_STRVAL_PP(zoffset);
+ enc_name_len2 = Z_STRLEN_PP(zoffset);
+ str_flg = 1;
+
+ if (enc_name2 != NULL) {
+ switch (*enc_name2) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case ' ':
+ case '-':
+ case '.':
+ break;
+ default :
+ str_flg = 0;
+ break;
+ }
+ }
+
+ if(str_flg) {
+ convert_to_long_ex(zoffset);
+ offset = Z_LVAL_PP(zoffset);
+ } else {
+ enc_name = enc_name2;
+ enc_name_len = enc_name_len2;
+ }
+ } else {
+ convert_to_long_ex(zoffset);
+ offset = Z_LVAL_PP(zoffset);
+ }
+ }
+
if (enc_name != NULL) {
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
@@ -1666,7 +1716,33 @@ PHP_FUNCTION(mb_strrpos)
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Empty needle");
RETURN_FALSE;
}
- n = mbfl_strpos(&haystack, &needle, 0, 1);
+ n = mbfl_strpos(&haystack, &needle, offset, 1);
+ if (n >= 0) {
+ RETVAL_LONG(n);
+ } else {
+ RETVAL_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto int mb_stripos(string haystack, string needle [, int offset [, string encoding]])
+ Finds position of first occurrence of a string within another, case insensitive */
+PHP_FUNCTION(mb_stripos)
+{
+ int n;
+ long offset;
+ char *old_haystack, *old_needle;
+ char *from_encoding = (char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding));
+ int old_haystack_len, old_needle_len, from_encoding_len;
+ n = -1;
+ offset = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", &old_haystack, &old_haystack_len, &old_needle, &old_needle_len, &offset, &from_encoding, &from_encoding_len ) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ n = php_mb_stripos(0, old_haystack, old_haystack_len, old_needle, old_needle_len, offset, from_encoding TSRMLS_CC);
+
if (n >= 0) {
RETVAL_LONG(n);
} else {
@@ -1675,6 +1751,260 @@ PHP_FUNCTION(mb_strrpos)
}
/* }}} */
+/* {{{ proto int mb_strripos(string haystack, string needle [, int offset [, string encoding]])
+ Finds position of last occurrence of a string within another, case insensitive */
+PHP_FUNCTION(mb_strripos)
+{
+ int n;
+ long offset;
+ char *old_haystack, *old_needle;
+ char *from_encoding = (char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding));
+ int old_haystack_len, old_needle_len, from_encoding_len;
+ n = -1;
+ offset = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", &old_haystack, &old_haystack_len, &old_needle, &old_needle_len, &offset, &from_encoding, &from_encoding_len ) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ n = php_mb_stripos(1, old_haystack, old_haystack_len, old_needle, old_needle_len, offset, from_encoding TSRMLS_CC);
+
+ if (n >= 0) {
+ RETVAL_LONG(n);
+ } else {
+ RETVAL_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto string mb_strstr(string haystack, string needle[, bool part[, string encoding]])
+ Finds first occurrence of a string within another */
+PHP_FUNCTION(mb_strstr)
+{
+ int n, len, mblen;
+ mbfl_string haystack, needle, result, *ret = NULL;
+ char *enc_name = NULL;
+ int enc_name_len;
+ zend_bool part = 0;
+
+ 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|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &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, 0);
+ if (n >= 0) {
+ mblen = mbfl_strlen(&haystack);
+ if (part) {
+ ret = mbfl_substr(&haystack, &result, 0, n);
+ if (ret != NULL) {
+ RETVAL_STRINGL((char *)ret->val, ret->len, 0);
+ } else {
+ RETVAL_FALSE;
+ }
+ } else {
+ len = (mblen - n);
+ ret = mbfl_substr(&haystack, &result, n, len);
+ if (ret != NULL) {
+ RETVAL_STRINGL((char *)ret->val, ret->len, 0);
+ } else {
+ RETVAL_FALSE;
+ }
+ }
+ } else {
+ RETVAL_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto string mb_strrchr(string haystack, string needle[, bool part[, string encoding]])
+ Finds the last occurrence of a character in a string within another */
+PHP_FUNCTION(mb_strrchr)
+{
+ int n, len, mblen;
+ mbfl_string haystack, needle, result, *ret = NULL;
+ char *enc_name = NULL;
+ int enc_name_len;
+ zend_bool part = 0;
+
+ 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|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &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) {
+ mblen = mbfl_strlen(&haystack);
+ if (part) {
+ ret = mbfl_substr(&haystack, &result, 0, n);
+ if (ret != NULL) {
+ RETVAL_STRINGL((char *)ret->val, ret->len, 0);
+ } else {
+ RETVAL_FALSE;
+ }
+ } else {
+ len = (mblen - n);
+ ret = mbfl_substr(&haystack, &result, n, len);
+ if (ret != NULL) {
+ RETVAL_STRINGL((char *)ret->val, ret->len, 0);
+ } else {
+ RETVAL_FALSE;
+ }
+ }
+ } else {
+ RETVAL_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto string mb_stristr(string haystack, string needle[, bool part[, string encoding]])
+ Finds first occurrence of a string within another, case insensitive */
+PHP_FUNCTION(mb_stristr)
+{
+ zend_bool part = 0;
+ int n, from_encoding_len, len, mblen;
+ mbfl_string haystack, needle, result, *ret = NULL;
+ char *from_encoding = (char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding));
+ 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|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(from_encoding);
+ if (haystack.no_encoding == mbfl_no_encoding_invalid) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
+ RETURN_FALSE;
+ }
+
+ n = php_mb_stripos(0, haystack.val, haystack.len, needle.val, needle.len, 0, from_encoding TSRMLS_CC);
+
+ if (n <0) {
+ RETURN_FALSE;
+ }
+
+ mblen = mbfl_strlen(&haystack);
+
+ if (part) {
+ ret = mbfl_substr(&haystack, &result, 0, n);
+ if (ret != NULL) {
+ RETVAL_STRINGL((char *)ret->val, ret->len, 0);
+ } else {
+ RETVAL_FALSE;
+ }
+ } else {
+ len = (mblen - n);
+ ret = mbfl_substr(&haystack, &result, n, len);
+ if (ret != NULL) {
+ RETVAL_STRINGL((char *)ret->val, ret->len, 0);
+ } else {
+ RETVAL_FALSE;
+ }
+ }
+}
+
+/* {{{ proto string mb_strrichr(string haystack, string needle[, bool part[, string encoding]])
+ Finds the last occurrence of a character in a string within another, case insensitive */
+PHP_FUNCTION(mb_strrichr)
+{
+ zend_bool part = 0;
+ int n, from_encoding_len, len, mblen;
+ mbfl_string haystack, needle, result, *ret = NULL;
+ char *from_encoding = (char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding));
+ 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|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(from_encoding);
+ if (haystack.no_encoding == mbfl_no_encoding_invalid) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
+ RETURN_FALSE;
+ }
+
+ n = php_mb_stripos(1, haystack.val, haystack.len, needle.val, needle.len, 0, from_encoding TSRMLS_CC);
+
+ if (n <0) {
+ RETURN_FALSE;
+ }
+
+ mblen = mbfl_strlen(&haystack);
+
+ if (part) {
+ ret = mbfl_substr(&haystack, &result, 0, n);
+ if (ret != NULL) {
+ RETVAL_STRINGL((char *)ret->val, ret->len, 0);
+ } else {
+ RETVAL_FALSE;
+ }
+ } else {
+ len = (mblen - n);
+ ret = mbfl_substr(&haystack, &result, n, len);
+ if (ret != NULL) {
+ RETVAL_STRINGL((char *)ret->val, ret->len, 0);
+ } 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)
@@ -2325,8 +2655,8 @@ PHP_FUNCTION(mb_detect_encoding)
}
/* }}} */
-/* {{{ proto array mb_list_encodings()
- Returns an array of all supported encodings */
+/* {{{ proto mixed mb_list_encodings()
+ Returns an array of all supported entity encodings */
PHP_FUNCTION(mb_list_encodings)
{
const mbfl_encoding **encodings;
@@ -2342,6 +2672,122 @@ PHP_FUNCTION(mb_list_encodings)
}
/* }}} */
+/* {{{ proto array mb_list_encodings_alias_names([string encoding])
+ Returns an array of all supported alias encodings */
+PHP_FUNCTION(mb_list_encodings_alias_names)
+{
+ const mbfl_encoding **encodings;
+ const mbfl_encoding *encoding;
+ enum mbfl_no_encoding no_encoding;
+ int i, j;
+ zval *row;
+ char *name = NULL;
+ int name_len;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ if (name == NULL) {
+ array_init(return_value);
+ i = 0;
+ encodings = mbfl_get_supported_encodings();
+ while ((encoding = encodings[i++]) != NULL) {
+ MAKE_STD_ZVAL(row);
+ array_init(row);
+ if (encoding->aliases != NULL) {
+ j = 0;
+ while ((*encoding->aliases)[j] != NULL) {
+ add_next_index_string(row, (char *)(*encoding->aliases)[j], 1);
+ j++;
+ }
+ }
+ add_assoc_zval(return_value, (char *) encoding->name, row);
+ }
+ } 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;
+ }
+
+ name = (char *)mbfl_no_encoding2name(no_encoding);
+ if (name != NULL) {
+ i = 0;
+ encodings = mbfl_get_supported_encodings();
+ while ((encoding = encodings[i++]) != NULL) {
+ if (strcmp(encoding->name, name) != 0){ continue; }
+
+ array_init(return_value);
+ if (encoding->aliases != NULL) {
+ j = 0;
+ while ((*encoding->aliases)[j] != NULL) {
+ add_next_index_string(return_value, (char *)(*encoding->aliases)[j], 1);
+ j++;
+ }
+ }
+
+ break;
+ }
+ } else {
+ RETURN_FALSE;
+ }
+ }
+}
+/* }}} */
+
+/* {{{ proto mixed mb_list_mime_names([string encoding])
+ Returns an array or string of all supported mime names */
+PHP_FUNCTION(mb_list_mime_names)
+{
+ const mbfl_encoding **encodings;
+ const mbfl_encoding *encoding;
+ enum mbfl_no_encoding no_encoding;
+ int i;
+ char *name = NULL;
+ int name_len;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ if (name == NULL) {
+ array_init(return_value);
+ i = 0;
+ encodings = mbfl_get_supported_encodings();
+ while ((encoding = encodings[i++]) != NULL) {
+ if(encoding->mime_name != NULL) {
+ add_assoc_string(return_value, (char *) encoding->name, (char *) encoding->mime_name, 1);
+ } else{
+ add_assoc_string(return_value, (char *) encoding->name, "", 1);
+ }
+ }
+ } 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;
+ }
+
+ name = (char *)mbfl_no_encoding2name(no_encoding);
+ if (name != NULL) {
+ i = 0;
+ encodings = mbfl_get_supported_encodings();
+ while ((encoding = encodings[i++]) != NULL) {
+ if (strcmp(encoding->name, name) != 0){ continue; }
+ if(encoding->mime_name != NULL) {
+ RETURN_STRING((char *) encoding->mime_name, 1);
+ }
+ break;
+ }
+ RETURN_STRING("", 1);
+ } else {
+ RETURN_FALSE;
+ }
+ }
+}
+/* }}} */
+
/* {{{ proto string mb_encode_mimeheader(string str [, string charset [, string transfer-encoding [, string linefeed [, int indent]]]])
Converts the string to MIME "encoded-word" in the format of =?charset?(B|Q)?encoded_string?= */
PHP_FUNCTION(mb_encode_mimeheader)
@@ -2354,7 +2800,7 @@ PHP_FUNCTION(mb_encode_mimeheader)
int trans_enc_name_len;
char *linefeed = "\r\n";
int linefeed_len;
- int indent = 0;
+ long indent = 0;
mbfl_string_init(&string);
string.no_language = MBSTRG(current_language);
@@ -3376,6 +3822,7 @@ PHP_FUNCTION(mb_get_info)
if ((name = (char *)mbfl_no_encoding2name(MBSTRG(current_http_output_encoding))) != NULL) {
add_assoc_string(return_value, "http_output", name, 1);
}
+ add_assoc_long(return_value, "func_overload", MBSTRG(func_overload));
if (MBSTRG(func_overload)){
over_func = &(mb_ovld[0]);
MAKE_STD_ZVAL(row1);
@@ -3386,9 +3833,9 @@ PHP_FUNCTION(mb_get_info)
}
over_func++;
}
- add_assoc_zval(return_value, "func_overload", row1);
+ add_assoc_zval(return_value, "func_overload_list", row1);
} else {
- add_assoc_string(return_value, "func_overload", "no overload", 1);
+ add_assoc_string(return_value, "func_overload_list", "no overload", 1);
}
if (lang != NULL) {
if ((name = (char *)mbfl_no_encoding2name(lang->mail_charset)) != NULL) {
@@ -3465,6 +3912,8 @@ PHP_FUNCTION(mb_get_info)
RETVAL_STRING(name, 1);
}
} else if (!strcasecmp("func_overload", typ)) {
+ RETVAL_LONG(MBSTRG(func_overload));
+ } else if (!strcasecmp("func_overload_list", typ)) {
if (MBSTRG(func_overload)){
over_func = &(mb_ovld[0]);
array_init(return_value);
@@ -3857,6 +4306,71 @@ MBSTRING_API int php_mb_gpc_encoding_detector(char **arg_string, int *arg_length
}
/* }}} */
+/* {{{ MBSTRING_API int php_mb_stripos()
+ */
+
+MBSTRING_API int php_mb_stripos(int mode, char *old_haystack, int old_haystack_len, char *old_needle, int old_needle_len, long offset, char *from_encoding TSRMLS_DC)
+{
+ int n;
+ mbfl_string haystack, needle;
+ n = -1;
+
+ 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);
+
+ do {
+ haystack.val = php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, old_haystack, (size_t) old_haystack_len, &haystack.len, from_encoding TSRMLS_CC);
+
+ if (!haystack.val) {
+ break;
+ }
+
+ if (haystack.len <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty haystack");
+ break;
+ }
+
+ needle.val = php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, old_needle, (size_t) old_needle_len, &needle.len, from_encoding TSRMLS_CC);
+
+ if (!needle.val) {
+ break;
+ }
+
+ if (needle.len <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle");
+ break;
+ }
+
+ haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(from_encoding);
+ if (haystack.no_encoding == mbfl_no_encoding_invalid) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
+ break;
+ }
+
+ if (offset < 0 || (unsigned long)offset > haystack.len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is out of range");
+ break;
+ }
+
+ n = mbfl_strpos(&haystack, &needle, offset, mode);
+ } while(0);
+
+ if(haystack.val){
+ efree(haystack.val);
+ }
+
+ if(needle.val){
+ efree(needle.val);
+ }
+
+ return n;
+}
+/* }}} */
+
#ifdef ZEND_MULTIBYTE
/* {{{ MBSTRING_API int php_mb_set_zend_encoding() */
MBSTRING_API int php_mb_set_zend_encoding(TSRMLS_D)
diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h
index 131f4105c..e68086905 100644
--- a/ext/mbstring/mbstring.h
+++ b/ext/mbstring/mbstring.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.h,v 1.66.2.4 2006/03/21 07:56:28 hirokawa Exp $ */
+/* $Id: mbstring.h,v 1.66.2.4.2.4 2006/05/30 15:47:53 masugata Exp $ */
/*
* PHP 4 Multibyte String module "mbstring" (currently only for Japanese)
@@ -104,6 +104,12 @@ PHP_FUNCTION(mb_output_handler);
PHP_FUNCTION(mb_strlen);
PHP_FUNCTION(mb_strpos);
PHP_FUNCTION(mb_strrpos);
+PHP_FUNCTION(mb_stripos);
+PHP_FUNCTION(mb_strripos);
+PHP_FUNCTION(mb_strstr);
+PHP_FUNCTION(mb_strrchr);
+PHP_FUNCTION(mb_stristr);
+PHP_FUNCTION(mb_strrichr);
PHP_FUNCTION(mb_substr_count);
PHP_FUNCTION(mb_substr);
PHP_FUNCTION(mb_strcut);
@@ -112,6 +118,8 @@ PHP_FUNCTION(mb_strimwidth);
PHP_FUNCTION(mb_convert_encoding);
PHP_FUNCTION(mb_detect_encoding);
PHP_FUNCTION(mb_list_encodings);
+PHP_FUNCTION(mb_list_encodings_alias_names);
+PHP_FUNCTION(mb_list_mime_names);
PHP_FUNCTION(mb_convert_kana);
PHP_FUNCTION(mb_encode_mimeheader);
PHP_FUNCTION(mb_decode_mimeheader);
@@ -151,6 +159,8 @@ MBSTRING_API int php_mb_gpc_encoding_converter(char **str, int *len, int num, co
MBSTRING_API int php_mb_gpc_encoding_detector(char **arg_string, int *arg_length, int num, char *arg_list TSRMLS_DC);
+MBSTRING_API int php_mb_stripos(int mode, char *old_haystack, int old_haystack_len, char *old_needle, int old_needle_len, long offset, char *from_encoding TSRMLS_DC);
+
ZEND_BEGIN_MODULE_GLOBALS(mbstring)
enum mbfl_no_language language;
enum mbfl_no_language current_language;
diff --git a/ext/mbstring/oniguruma/AUTHORS b/ext/mbstring/oniguruma/AUTHORS
new file mode 100644
index 000000000..93167bd43
--- /dev/null
+++ b/ext/mbstring/oniguruma/AUTHORS
@@ -0,0 +1 @@
+sndgk393 AT ybb DOT ne DOT jp (K.Kosako)
diff --git a/ext/mbstring/oniguruma/COPYING b/ext/mbstring/oniguruma/COPYING
index ed3fa53b2..4d321bb93 100644
--- a/ext/mbstring/oniguruma/COPYING
+++ b/ext/mbstring/oniguruma/COPYING
@@ -1,4 +1,4 @@
-OniGuruma LICENSE
+Oniguruma LICENSE
-----------------
When this software is partly used or it is distributed with Ruby,
@@ -6,7 +6,7 @@ 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 <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/ext/mbstring/oniguruma/HISTORY b/ext/mbstring/oniguruma/HISTORY
index c648c5455..6c824a697 100644
--- a/ext/mbstring/oniguruma/HISTORY
+++ b/ext/mbstring/oniguruma/HISTORY
@@ -1,5 +1,364 @@
History
+2006/09/19: Version 4.4.4
+
+2006/09/19: [test] success in ruby 1.9.0 (2006-08-22) [i686-linux].
+2006/09/19: [impl] (thanks KOYAMA Tetsuji)
+ HAVE_STDARG_PROTOTYPES was not defined in Mac OS X
+ by Xcode 2.4(gcc 4.0.1) problem. [php-dev 1312] etc...
+
+2006/09/15: Version 4.4.3
+
+2006/09/15: [test] success in ruby 1.9.0 (2006-08-22) [i686-linux].
+2006/09/15: [bug] (thanks Allan Odgaard)
+ out of range access in bm_search_notrev().
+ (p < s)
+
+2006/09/08: Version 4.4.2
+
+2006/09/08: [test] success in ruby 1.9.0 (2006-08-22) [i686-linux].
+2006/09/08: [bug] (thanks K.Takata)
+ out of range access in bm_search_notrev().
+2006/09/04: [spec] (thanks K.Takata)
+ allow look-behind in negative look-behind.
+ ex. /(?<!(?<=a)b|c)d/
+
+2006/08/29: Version 4.4.1
+
+2006/08/29: [test] success in ruby 1.9.0 (2006-08-22) [i686-linux].
+2006/08/29: [dist] (thanks Seiji Masugata)
+ add configure option --enable-combination-explosion-check
+
+2006/08/25: Version 4.4.0
+
+2006/08/25: [test] success in ruby 1.9.0 (2006-08-22) [i686-linux].
+2006/08/25: [impl] add_state_check_num() should be enclosed in
+ ifdef USE_COMBINATION_EXPLOSION_CHECK.
+2006/08/23: [spec] config USE_COMBINATION_EXPLOSION_CHECK is enabled
+ in Ruby mode only.
+2006/08/22: [impl] remove last line comma in enum OpCode.
+2006/08/22: [impl] remove OP_STATE_CHECK_ANYCHAR_STAR_PEEK_NEXT and
+ OP_STATE_CHECK_ANYCHAR_ML_STAR_PEEK_NEXT.
+2006/08/22: [impl] remove OP_BACKREF3.
+
+2006/08/21: Version 4.3.1
+
+2006/08/21: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux].
+2006/08/21: [impl] change stack type values
+ and re-define STK_MASK_TO_VOID_TARGET etc...
+2006/08/21: [impl] set repeat_range[].upper to 0x7fffffff as infinite.
+2006/08/21: [impl] add STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE.
+2006/08/21: [impl] reduce (?:a*){n,m}, (?:a+){n,m} => (?:a*){n,n}, (?:a+){n,n}
+2006/09/21: [impl] reduce (a*){n,m}, (a+){n,m} => (a*){n,n}, (a+){n,n}
+ if backreference is not used.
+2006/08/17: [bug] should check scan_env.num_call > 0 for backrefed pattern
+ in combination explosion check.
+
+2006/08/17: Version 4.3.0
+
+2006/08/17: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux].
+2006/08/17: [new] add config USE_COMBINATION_EXPLOSION_CHECK.
+ check /(.+)*/, /(\s*foo\s*)*/ etc...
+ [API] add num_comb_exp_check member in regex_t.
+ [dist] change LTVERSION value to "1:0:0" in configure.in.
+2006/08/15: [bug] OP_REPEAT_INC process in match_at().
+ should check repeat-count >= range-upper and
+ range-upper may be infinite.
+
+2006/08/11: Version 4.2.3
+
+2006/08/11: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux].
+2006/08/10: [impl] remove double call in set_qualifier().
+2006/08/10: [impl] remove by_number member in QualifierNode.
+2006/08/09: [impl] remove a comma at the end of enum ReduceType
+ for escape warning on Mac OS X.
+2006/08/07: [impl] remove warning in regcomp.c.
+2006/08/07: [spec] move definition of USE_BACKREF_AT_LEVEL into NOT_RUBY.
+
+2006/08/03: Version 4.2.2
+
+2006/08/03: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux].
+2006/08/03: [bug] (thanks Hiroyuki Yamamoto)
+ segmentation fault in regexec(). (POSIX API)
+2006/08/02: [bug] combination of \G in look-ahead/look-behind and other
+ anchors(\A, \z, \Z) cause invalid result.
+ ex. /(?!\G)a\z/.match("ba")
+ start arg. of MATCH_ARG_INIT() should be original
+ arg. of onig_search().
+
+2006/07/31: Version 4.2.1
+
+2006/07/31: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux].
+2006/07/31: [bug] (thanks Kimura Minoru)
+ re-implement bm_search_notrev().
+2006/07/31: [impl] bm_search_notrev() refactoring.
+2006/07/31: [bug] (thanks Kimura Minoru)
+ fix incomplete multibyte string in exact info.
+2006/07/31: [impl] (thanks Seiji Masugata)
+ remove cast in va_init_list() for Intel C Compiler.
+
+2006/07/18: Version 4.2.0
+
+2006/07/18: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].
+2006/07/18: [new] (thanks Wolfgang Nadasi-Donner)
+ add back reference with nest level.
+ \k<name+n>, \k<name-n>
+2006/07/11: [impl] change long to unsigned long for ONIG_OPTION_XXX
+ and ONIG_SYN_XXX number literals.
+
+2006/07/03: Version 4.1.2
+
+2006/07/03: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].
+2006/07/03: [spec] (thanks Wolfgang Nadasi-Donner)
+ allow \G in look-behind.
+ add ANCHOR_BEGIN_POSITION flag in setup_tree().
+2006/06/12: [impl] (thanks matz)
+ fix cast from char* to const char*
+ in onig_snprintf_with_pattern().
+ fix cast from char* to const char*
+ for PopularQStr[] and ReduceQStr[].
+
+2006/05/22: Version 4.1.1
+
+2006/05/22: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].
+2006/05/22: [impl] add position string argument to STACK_BASE_CHECK().
+2006/05/22: [bug] (thanks NARUSE, Yui)
+ add STK_NULL_CHECK_END to IS_TO_VOID_TARGET().
+ ex. core dump in
+ /(?<pare>\(([^\(\)]++|\g<pare>)*+\))/.match('((a))')
+
+2006/05/15: Version 4.1.0
+
+2006/05/15: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].
+2006/05/15: [impl] thread atomic changes for onig_end() and
+ onig_free_node_list().
+2006/05/15: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].
+2005/05/15: [dist] update API, API.ja, FAQ, FAQ.ja.
+2006/05/15: [spec] remove onig_recompile(), onig_recompile_deluxe()
+ and re_recompile_pattern().
+ add config USE_RECOMPILE_API.
+2006/05/15: [impl] improved thread safe implementation of onig_search()
+ and onig_match().
+
+2006/05/11: Version 4.0.4
+
+2006/05/11: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].
+2006/05/11: [bug] (thanks Yuji Kaneda)
+ dead-lock in onig_end().
+2006/05/11: [dist] update index.html.
+
+2006/05/08: Version 4.0.3
+
+2006/05/08: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].
+2006/05/08: [bug] (thanks Allan Odgaard)
+ Segmentation fault in backward search.
+ ex. /^\t.*$/
+2006/04/18: [dist] update index.html.
+2006/04/05: [dist] update index.html.
+2006/03/24: [dist] update doc/RE, doc/RE.ja.
+
+2006/03/23: Version 4.0.2
+
+2006/03/22: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].
+2006/03/22: [impl] add both of ONIG_OPTION_DONT_CAPTURE_GROUP
+ and ONIG_OPTION_CAPTURE_GROUP check.
+2006/03/22: [spec] add error code ONIGERR_INVALID_COMBINATION_OF_OPTIONS.
+2006/03/22: [impl] remove USE_NAMED_GROUP condition from
+ ONIG_OPTION_DONT_CAPTURE_GROUP check in parse_effect().
+2006/03/22: [new] add API onig_noname_group_capture_is_active().
+2006/03/01: [spec] rename regex object type from regex_t to OnigRegexType.
+ add typedef OnigRegexType regex_t
+ unless ONIG_ESCAPE_REGEX_T_COLLISION is defined.
+2006/02/27: [spec] change ONIG_MAX_MULTI_BYTE_RANGES_NUM from 1000
+ to 10000. (for docdiff program)
+2006/02/17: [dist] change COPYING year 2005 -> 2006.
+
+2006/02/07: Version 4.0.1
+
+2006/02/07: [test] success in ruby 1.9.0 (2005-11-28) [i686-linux].
+2006/02/07: [bug] memory leaks in onig_free_shared_cclass_table().
+2006/02/03: [ruby] add -m 0644 option to install command in "make 19".
+2006/02/03: [impl] rename ANCHOR_ANYCHAR_STAR_PL to ANCHOR_ANYCHAR_STAR_ML.
+ change from IS_POSIXLINE() to IS_MULTILINE()
+ for ANCHOR_ANYCHAR_START/_ML decision
+ in optimize_node_left().
+2006/01/26: [dist] update index.html for Oniguruma 2.5.3.
+2006/01/25: [dist] update URL in index.html.
+
+2006/01/24: Version 4.0.0
+
+2006/01/24: [test] success in ruby 1.9.0 (2005-11-28) [i386-cygwin].
+2006/01/24: [test] success in ruby 1.9.0 (2005-11-28) [i686-linux].
+2006/01/24: [dist] remove warnings from sample/encode.c.
+2006/01/24: [dist] change install description in README(.ja).
+2006/01/24: [dist] remove re.c.XXX.patch from distribution and CVS.
+2006/01/24: [dist] --- support shared library ---
+ use GNU libtool/automake.
+ change configure.in and add Makefile.am, sample/Makefile.am.
+ add AUTHORS file.
+2006/01/24: [dist] test programs return exit code -1 when test fails.
+2006/01/24: [bug] (thanks KIMURA Koichi)
+ invalid syntax definition in ONIG_SYNTAX_GREP.
+ ONIG_SYN_OP_BRACE_INTERVAL
+ -> ONIG_SYN_OP_ESC_BRACE_INTERVAL
+2006/01/23: [dist] fix configure.in for onig-config.
+2006/01/19: [new] add new config USE_UNICODE_ALL_LINE_TERMINATORS.
+ (U+000d, U+0085, U+2028, U+2029)
+2005/12/29: [dist] change pmatch array size to 25 in testconv.rb.
+2005/12/26: [dist] fix name in test.rb.
+2005/12/26: [dist] update index.html for 2.5.1.
+
+2005/11/29: Version 3.9.1
+
+2005/11/29: [test] success in ruby 1.9.0 (2005-11-28) [i686-linux].
+2005/11/24: [test] success in ruby 1.9.0 (2005-08-09) [i686-linux].
+2005/11/21: [test] success in ruby 1.9.0 (2005-11-20) [i386-cygwin].
+2005/11/21: [bug] (thanks Allan Odgaard)
+ utf-8 character comments in extended mode leads
+ invalid result.
+ ex. /(?x)(?<= # <any-utf-8 multibyte char>o\n~) /
+ fix onigenc_unicode_is_code_ctype() and
+ utf8_is_code_ctype().
+2005/11/20: [bug] (thanks MATSUMOTO Satoshi) (thanks Isao Sonobe)
+ begin-line anchor and BM search optimization leads
+ invalid result in UTF-16/32.
+ fix in set_optimize_exact_info().
+
+2005/11/20: Version 3.9.0
+
+2005/11/20: [test] success in ruby 1.9.0 (2005-11-20) [i386-cygwin].
+2005/11/20: [test] success in ruby 1.9.0 (2005-10-18) [i386-cygwin].
+2005/11/20: [new] add new config USE_CRNL_AS_LINE_TERMINATOR.
+ (!!! NO SUPPORT experimental option !!!)
+2005/11/15: [bug] (thanks Allan Odgaard)
+ tok->escape was not cleared in fetch_token_in_cc().
+ ex. [\s&&[^\n]] makes wrong result.
+2005/10/18: [impl] (thanks nobu)
+ change sjis_mbc_enc_len()
+ and node_new_cclass_by_codepoint_range() scope to static.
+2005/09/05: [dist] remove link to MultiFind.
+2005/09/01: [dist] add link to yagrep.
+
+2005/08/23: Version 3.8.9
+
+2005/08/23: [test] success in ruby 1.9.0 (2005-08-09) [i686-linux].
+2005/08/23: [inst] fix Makefile.in for make ctest/ptest.
+
+2005/08/23: Version 3.8.8
+
+2005/08/23: [test] success in ruby 1.9.0 (2005-08-09) [i686-linux].
+2005/08/23: [impl] split is_code_in_cc() from onig_is_code_in_cc().
+2005/08/23: [impl] should check DATA_ENSURE() at OP_CCLASS_NODE in match_at().
+2005/08/23: [impl] (thanks akr)
+ add ONIG_OPTION_MAXBIT for escape conflict with
+ Ruby's option.
+2005/08/22: [impl] escape GCC 4.0 warnings for testc.c.
+2005/08/22: [bug] (thanks nobu, matz) [ruby-dev:26840]
+ UTF-8 0xFE, 0xFF handling bug in code_is_in_cclass_node().
+ abort on /\S*/ =~ "\xfe"
+2005/08/22: [impl] escape GCC 4.0 warnings for sample/*.c.
+2005/08/22: [impl] fix testconvu.rb.
+2005/08/22: [impl] escape GCC 4.0 warnings.
+
+2005/08/09: Version 3.8.7
+
+2005/08/09: [test] success in ruby 1.9.0 (2005-08-09) [i686-linux].
+2005/08/09: [bug] (thanks Allan Odgaard)
+ should not call enc_len() for s == range
+ in onig_search().
+2005/08/01: [dist] add mkdir $prefix, mkdir $exec_prefix to make install.
+
+2005/07/27: Version 3.8.6
+
+2005/07/27: [test] success in ruby 1.9.0 (2005-07-26) [i686-linux].
+2005/07/27: [impl] update onig-config.in.
+2005/07/26: [new] (thanks Yen-Ju Chen)
+ add Oniguruma configuration check program.
+ (onig-config.in)
+
+2005/07/14: Version 3.8.5
+
+2005/07/14: [test] success in ruby 1.9.0 (2005-07-14) [i686-linux].
+2005/07/11: [test] success in ruby 1.9.0 (2005-07-04) [i686-linux].
+2005/07/11: [bug] (thanks nobu) [ruby-dev:26505]
+ invalid handling for /\c\x/ and /\C-\x/.
+ fix fetch_escaped_value().
+2005/07/05: [impl] (thanks Alexey Zakhlestine)
+ escape GCC 4.0 warnings.
+
+2005/07/01: Version 3.8.4
+
+2005/07/01: [test] success in ruby 1.9.0 (2005-07-01) [i686-linux].
+2005/06/30: [test] success in ruby 1.9.0 (2005-06-28) [i686-linux].
+2005/06/30: [dist] add GB 18030 test to sample/encode.c.
+2005/06/30: [impl] escape warning of gb18030_left_adjust_char_head().
+2005/06/30: [new] (contributed by KUBO Takehiro)
+ add new character encoding ONIG_ENCODING_GB18030.
+2005/06/30: [bug] invalid ctype check for multibyte encodings.
+ ("graph", "print")
+ fix onigenc_mb2/4_is_code_ctype(),
+ eucjp_is_code_ctype() and sjis_is_code_ctype().
+2005/06/30: [bug] invalid conversion from code point to mbc in
+ onigenc_mb4_code_to_mbc().
+
+2005/06/28: Version 3.8.3
+
+2005/06/28: [test] success in ruby 1.9.0 (2005-06-28) [i686-linux].
+2005/06/27: [test] success in ruby 1.9.0 (2005-05-31) [i686-linux].
+2005/06/27: [bug] (thanks Wolfgang Nadasi-Donner)
+ invalid check for never ending recursion.
+ lower zero quantifier should be treated as
+ a non-recursive call alternative.
+ ex. /(?<bal>[^()]*(\(\g<bal>\)[^()]*)*)/
+2005/06/15: [impl] add divide_ambig_string_node_sub().
+2005/06/15: [dist] add a test to sample/encode.c.
+2005/06/10: [new] add ONIG_SYNTAX_PERL_NG. (Perl + named group)
+
+2005/06/01: Version 3.8.2
+
+2005/06/01: [test] success in ruby 1.9.0 (2005-05-31) [i686-linux].
+2005/05/31: [dist] add doc/FAQ and doc/FAQ.ja.
+2005/05/31: [impl] minor change in node_new().
+2005/05/30: [test] success in ruby 1.9.0 (2005-05-11) [i686-linux].
+2005/05/30: [bug] (thanks Allan Odgaard)
+ FreeNodeList null check should be on thread-atomic
+ in node_new().
+
+2005/05/11: Version 3.8.1
+
+2005/05/11: [test] success in ruby 1.9.0 (2005-05-11) [i386-mswin32].
+2005/05/11: [dist] update win32/Makefile (make 19).
+2005/05/11: [test] success in ruby 1.9.0 (2005-05-11) [i686-linux].
+2005/05/06: [test] success in ruby 1.9.0 (2005-05-06) [i686-linux].
+2005/05/06: [impl] (thanks nobu) [ruby-core:4815]
+ add #ifdef USE_VARIABLE_META_CHARS to goto label.
+2005/04/25: [test] success in ruby 1.9.0 (2005-04-25) [i686-linux].
+2005/04/25: [impl] change DEFAULT_WARN_FUNCTION and DEFAULT_VERB_WARN_FUNCTION
+ to onig_rb_warn() and onig_rb_warning().
+
+2005/04/15: Version 3.8.0
+
+2005/04/15: [test] success in ruby 1.9.0 (2005-04-14) [i686-linux].
+2005/04/01: [test] success in ruby 1.9.0 (2005-03-24) [i686-linux].
+2005/04/01: [impl] (thanks Joe Orton)
+ (thanks Moriyoshi Koizumi)
+ many const-ification to many *.[ch] files.
+
+2005/03/25: Version 3.7.2
+
+2005/03/25: [test] success in ruby 1.9.0 (2005-03-24) [i686-linux].
+2005/03/23: [test] success in ruby 1.9.0 (2005-03-20) [i686-linux].
+2005/03/23: [test] success in ruby 1.9.0 (2005-03-08) [i686-linux].
+2005/03/23: [new] add ONIG_SYNTAX_ASIS.
+2005/03/23: [new] add ONIG_SYN_OP2_INEFFECTIVE_ESCAPE.
+2005/03/09: [spec] rename MBCTYPE_XXX to RE_MBCTYPE_XXX. (GNU API)
+2005/03/08: [test] success in ruby 1.9.0 (2005-03-08) [i686-linux].
+2005/03/08: [impl] (thanks matz) [ruby-dev:25783]
+ should not allocate memory for key data in st.c.
+ move st_*_strend() functions from st.c. fixed some
+ potential memory leaks.
+ (imported from Ruby 1.9 2005-03-08)
+
2005/03/07: Version 3.7.1
2005/03/07: [test] success in ruby 1.9.0 (2005-03-07) [i686-linux].
@@ -24,7 +383,7 @@ History
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)
+2005/02/19: [impl] (thanks Alexey Zakhlestine)
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
@@ -1366,8 +1725,30 @@ svn copy http://localhost/repos/trunk/oniguruma http://localhost/repos/branches/
<create tag>
svn copy http://localhost/repos/trunk/oniguruma http://localhost/repos/tags/oniguruma/X.X.X -m "onigdXXXXXXXX"
-<show all tags>
+
+<CVS: show all tags>
cvs history -T
-<add tag>
+<CVS: add tag>
cvs rtag "VERSION_X_X_X" oniguruma
+
+
+<GNU Autotools: bootstrap>
+* write Makefile.am and configure.in.
+> aclocal
+> libtoolize
+> automake --foreign --add-missing
+> autoconf
+> configure --with-rubydir=... CFLAGS="-O2 -Wall"
+
+
+<GNU libtool: version management>
+
+ VERSION = current:revision:age
+
+ current: interface number (from 0)
+ revision: implementation number of same interface (from 0)
+ age: number of supported previous interfaces
+ (if current only supported then age == 0)
+
+//END
diff --git a/ext/mbstring/oniguruma/README b/ext/mbstring/oniguruma/README
index dc4fb3b64..f2cc7c981 100644
--- a/ext/mbstring/oniguruma/README
+++ b/ext/mbstring/oniguruma/README
@@ -1,4 +1,4 @@
-README 2005/02/04
+README 2006/05/15
Oniguruma ---- (C) K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
@@ -14,11 +14,12 @@ 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 (*),
+ Shift_JIS, Big5, GB 18030, 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
+* GB 18030: contributed by KUBO Takehiro
* KOI8 is not included in library archive by default setup.
(need to edit Makefile if you want to use it.)
------------------------------------------------------------
@@ -31,15 +32,20 @@ Install
2. make
3. make install
- library file: libonig.a
+ * uninstall
- test (ASCII/EUC-JP)
+ make uninstall
- make ctest
+ * test (ASCII/EUC-JP)
- uninstall
+ make atest
- make uninstall
+ * configuration check
+
+ onig-config --cflags
+ onig-config --libs
+ onig-config --prefix
+ onig-config --exec-prefix
@@ -73,8 +79,21 @@ Regular Expressions
Usage
- Include oniguruma.h in your program. (native API)
- See doc/API for native API.
+ Include oniguruma.h in your program. (Oniguruma API)
+ See doc/API for Oniguruma API.
+
+ If you want to disable UChar type (== unsigned char) definition
+ in oniguruma.h, define ONIG_ESCAPE_UCHAR_COLLISION and then
+ include oniguruma.h.
+
+ If you want to disable regex_t type definition in oniguruma.h,
+ define ONIG_ESCAPE_REGEX_T_COLLISION and then include oniguruma.h.
+
+ Example of the compiling/linking command line in Unix or Cygwin,
+ (prefix == /usr/local case)
+
+ cc sample.c -L/usr/local/lib -lonig
+
If you want to use static link library(onig_s.lib) in Win32,
add option -DONIG_EXTERN=extern to C compiler.
@@ -83,19 +102,20 @@ Usage
Sample Programs
- sample/simple.c example of the minimum (native API)
+ sample/simple.c example of the minimum (Oniguruma 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.
+ sample/syntax.c Perl, Java and ASIS syntax test.
Source Files
oniguruma.h Oniguruma API header file. (public)
+ onig-config.in configuration check program template.
regenc.h character encodings framework header file.
regint.h internal definitions
@@ -125,9 +145,10 @@ Source Files
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/big5.c Big5 encoding.
+ enc/gb18030.c GB 18030 encoding (contributed by KUBO Takehiro)
+ 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)
@@ -159,7 +180,6 @@ Source Files
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.
@@ -169,7 +189,6 @@ ToDo
? 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.
diff --git a/ext/mbstring/oniguruma/README.ja b/ext/mbstring/oniguruma/README.ja
index 44553abfe..2394e958f 100644
--- a/ext/mbstring/oniguruma/README.ja
+++ b/ext/mbstring/oniguruma/README.ja
@@ -1,4 +1,4 @@
-README.ja 2005/02/04
+README.ja 2006/05/15
µ´¼Ö ---- (C) K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
@@ -14,11 +14,12 @@ 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 (*),
+ Shift_JIS, Big5, GB 18030, 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
+* GB 18030: µ×ÊÝ·òÍλáÄó¶¡
* KOI8¤Ï¥Ç¥Õ¥©¥ë¥È¤Î¥»¥Ã¥È¥¢¥Ã¥×¤Ç¤Ï¥é¥¤¥Ö¥é¥ê¤ÎÃæ¤Ë´Þ¤Þ¤ì¤Ê¤¤¡£
(ɬÍפǤ¢¤ì¤ÐMakefile¤òÊÔ½¸¤¹¤ë¤³¤È)
------------------------------------------------------------
@@ -31,15 +32,21 @@ http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/
2. make
3. make install
- ¥é¥¤¥Ö¥é¥ê¥Õ¥¡¥¤¥ë: libonig.a
+ ¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë
+
+ make uninstall
Æ°ºî¥Æ¥¹¥È (ASCII/EUC-JP)
- make ctest
+ make atest
- ¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë
- make uninstall
+ ¹½À®³Îǧ
+
+ onig-config --cflags
+ onig-config --libs
+ onig-config --prefix
+ onig-config --exec-prefix
@@ -71,8 +78,28 @@ http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/
»ÈÍÑÊýË¡
- »ÈÍѤ¹¤ë¥×¥í¥°¥é¥à¤Ç¡¢oniguruma.h¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë(Native API¤Î¾ì¹ç)¡£
- Native API¤Ë¤Ä¤¤¤Æ¤Ï¡¢doc/API.ja¤ò»²¾È¡£
+ »ÈÍѤ¹¤ë¥×¥í¥°¥é¥à¤Ç¡¢oniguruma.h¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë(Oniguruma API¤Î¾ì¹ç)¡£
+ Oniguruma API¤Ë¤Ä¤¤¤Æ¤Ï¡¢doc/API.ja¤ò»²¾È¡£
+
+ oniguruma.h¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë·¿Ì¾UChar(== unsigned char)¤ò̵¸ú¤Ë¤·¤¿¤¤¾ì¹ç
+ ¤Ë¤Ï¡¢ONIG_ESCAPE_UCHAR_COLLISION¤òdefine¤·¤Æ¤«¤éoniguruma.h¤ò¥¤¥ó¥¯¥ë¡¼¥É
+ ¤¹¤ë¤³¤È¡£¤³¤Î¤È¤­¤Ë¤ÏUChar¤ÏÄêµÁ¤µ¤ì¤º¡¢OnigUChar¤È¤¤¤¦Ì¾Á°¤ÎÄêµÁ¤Î¤ß¤¬
+ Í­¸ú¤Ë¤Ê¤ë¡£
+
+ oniguruma.h¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë·¿Ì¾regex_t¤ò̵¸ú¤Ë¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢
+ ONIG_ESCAPE_REGEX_T_COLLISION¤òdefine¤·¤Æ¤«¤éoniguruma.h¤ò¥¤¥ó¥¯¥ë¡¼¥É
+ ¤¹¤ë¤³¤È¡£¤³¤Î¤È¤­¤Ë¤Ïregex_t¤ÏÄêµÁ¤µ¤ì¤º¡¢OnigRegexType, OnigRegex¤È¤¤¤¦
+ ̾Á°¤ÎÄêµÁ¤Î¤ß¤¬Í­¸ú¤Ë¤Ê¤ë¡£
+
+ Unix/Cygwin¾å¤Ç¥³¥ó¥Ñ¥¤¥ë¡¢¥ê¥ó¥¯¤¹¤ë¾ì¹ç¤ÎÎ㡧
+ (prefix¤¬/usr/local¤Î¤È¤­)
+ cc sample.c -L/usr/local/lib -lonig
+
+ GNU libtool¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Î¤Ç¡¢¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤¬¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò¥µ¥Ý¡¼¥È¤·¤Æ
+ ¤¤¤ì¤Ð¡¢»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
+ ÀÅŪ¥é¥¤¥Ö¥é¥ê¤È¶¦Í­¥é¥¤¥Ö¥é¥ê¤Î¤É¤Á¤é¤ò»ÈÍѤ¹¤ë¤«¤ò»ØÄꤹ¤ëÊýË¡¡¢¼Â¹Ô»þÅÀ¤Ç¤Î
+ ´Ä¶­ÀßÄêÊýË¡¤Ë¤Ä¤Æ¤Ï¡¢¼«Ê¬¤ÇÄ´¤Ù¤Æ²¼¤µ¤¤¡£
+
Win32¤Ç¥¹¥¿¥Æ¥£¥Ã¥¯¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê(onig_s.lib)¤ò¥ê¥ó¥¯¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢
¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È¤­¤Ë -DONIG_EXTERN=extern ¤ò¥³¥ó¥Ñ¥¤¥ë°ú¿ô¤ËÄɲ乤뤳¤È¡£
@@ -80,18 +107,19 @@ http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/
»ÈÍÑÎã¥×¥í¥°¥é¥à
- sample/simple.c ºÇ¾®Îã (native API)
+ sample/simple.c ºÇ¾®Îã (Oniguruma 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ʸˡ¤Î¥Æ¥¹¥È
+ sample/syntax.c Perl¡¢Java¡¢ASISʸˡ¤Î¥Æ¥¹¥È
¥½¡¼¥¹¥Õ¥¡¥¤¥ë
oniguruma.h µ´¼ÖAPI¥Ø¥Ã¥À (¸ø³«)
+ onig-config.in onig-config¥×¥í¥°¥é¥à ¥Æ¥ó¥×¥ì¡¼¥È
regenc.h ʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°ÏÈÁȤߥإåÀ
regint.h ÆâÉôÀë¸À
@@ -122,6 +150,7 @@ http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/
enc/euc_kr.c EUC-KR, EUC-CN ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
enc/sjis.c Shift_JIS ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
enc/big5.c Big5 ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
+ enc/gb18030.c GB 18030 ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° (µ×ÊÝ·òÍλá Äó¶¡)
enc/koi8.c KOI8 ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
enc/koi8_r.c KOI8-R ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
enc/iso8859_1.c ISO-8859-1 (Latin-1)
@@ -155,7 +184,6 @@ http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/
Ruby 1.8/1.6¤ÎÆüËܸ첽GNU regex¤È¤ÎAPI¤Î°ã¤¤
+ re_compile_fastmap() ¤Ïºï½ü¤µ¤ì¤¿¡£
- + re_recompile_pattern() ¤¬Äɲ䵤줿¡£
+ re_alloc_pattern() ¤¬Äɲ䵤줿¡£
@@ -165,7 +193,6 @@ Ruby 1.8/1.6¤ÎÆüËܸ첽GNU regex¤È¤ÎAPI¤Î°ã¤¤
? Unicode¥×¥í¥Ñ¥Æ¥£
? ambig-flag Katakana <-> Hiragana
? ONIG_OPTION_NOTBOS/NOTEOSÄɲà (\A, \z, \Z)
- ? ONIG_SYNTAX_ASISÄɲÃ
?? \X (== \PM\pM*)
?? ʸˡÍ×ÁÇ ONIG_SYN_CONTEXT_INDEP_ANCHORS¤Î¼ÂÁõ
?? ²þ¹Ôʸ»ú(ʸ»úÎó)¤òÊѹ¹¤Ç¤­¤ë
@@ -174,4 +201,4 @@ Ruby 1.8/1.6¤ÎÆüËܸ첽GNU regex¤È¤ÎAPI¤Î°ã¤¤
and I'm thankful to Akinori MUSHA.
-Mail Address: K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+¥¢¥É¥ì¥¹: K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
diff --git a/ext/mbstring/oniguruma/config.h.in b/ext/mbstring/oniguruma/config.h.in
index 5ca2056fb..4a2fc28d8 100644
--- a/ext/mbstring/oniguruma/config.h.in
+++ b/ext/mbstring/oniguruma/config.h.in
@@ -1,69 +1,108 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
+/* config.h.in. Generated 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. */
+/* 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. */
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+/* Define to 1 if you have <alloca.h> 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 to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
-/* The number of bytes in a int. */
-#undef SIZEOF_INT
+/* Define if compilerr supports prototypes */
+#undef HAVE_PROTOTYPES
-/* The number of bytes in a long. */
-#undef SIZEOF_LONG
+/* Define if compiler supports stdarg prototypes */
+#undef HAVE_STDARG_PROTOTYPES
-/* The number of bytes in a short. */
-#undef SIZEOF_SHORT
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
-/* Define if you have the <stdlib.h> header file. */
+/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
-/* Define if you have the <string.h> header file. */
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
-/* Define if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
-/* Define if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
+/* Define to 1 if you have the <sys/times.h> header file. */
+#undef HAVE_SYS_TIMES_H
-/* Define if you have the <sys/time.h> header file. */
+/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
-/* Define if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
-/* Define if you have the <unistd.h> header file. */
+/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define if you have the function argument prototype */
-#undef HAVE_PROTOTYPES
+/* Name of package */
+#undef PACKAGE
-/* Define if you have the variable length prototypes and stdarg.h */
-#undef HAVE_STDARG_PROTOTYPES
+/* 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
+
+/* The size of a `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of a `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of a `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+/* 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 to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if combination explosion check */
+#undef USE_COMBINATION_EXPLOSION_CHECK
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
diff --git a/ext/mbstring/oniguruma/doc/API b/ext/mbstring/oniguruma/doc/API
new file mode 100644
index 000000000..7374f65bd
--- /dev/null
+++ b/ext/mbstring/oniguruma/doc/API
@@ -0,0 +1,586 @@
+Oniguruma API Version 4.1.0 2006/05/15
+
+#include <oniguruma.h>
+
+
+# int onig_init(void)
+
+ Initialize library.
+
+ You don't have to call it explicitly, because it is called in onig_new().
+
+
+# int onig_error_code_to_str(UChar* err_buf, int err_code, ...)
+
+ Get error message string.
+ If this function is used for onig_new(),
+ don't call this after the pattern argument of onig_new() is freed.
+
+ normal return: error message string length
+
+ arguments
+ 1 err_buf: error message string buffer.
+ (required size: ONIG_MAX_ERROR_MESSAGE_LEN)
+ 2 err_code: error code returned by other API functions.
+ 3 err_info (optional): error info returned by onig_new().
+
+
+# void onig_set_warn_func(OnigWarnFunc func)
+
+ Set warning function.
+
+ WARNING:
+ '[', '-', ']' in character class without escape.
+ ']' in pattern without escape.
+
+ arguments
+ 1 func: function pointer. void (*func)(char* warning_message)
+
+
+# void onig_set_verb_warn_func(OnigWarnFunc func)
+
+ Set verbose warning function.
+
+ WARNING:
+ redundant nested repeat operator.
+
+ arguments
+ 1 func: function pointer. void (*func)(char* warning_message)
+
+
+# int onig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
+ OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax,
+ OnigErrorInfo* err_info)
+
+ Create a regex object.
+
+ normal return: ONIG_NORMAL
+
+ arguments
+ 1 reg: return regex object's address.
+ 2 pattern: regex pattern string.
+ 3 pattern_end: terminate address of pattern. (pattern + pattern length)
+ 4 option: compile time options.
+
+ ONIG_OPTION_NONE no option
+ ONIG_OPTION_SINGLELINE '^' -> '\A', '$' -> '\z', '\Z' -> '\z'
+ ONIG_OPTION_MULTILINE '.' match with newline
+ ONIG_OPTION_IGNORECASE ambiguity match on
+ ONIG_OPTION_EXTEND extended pattern form
+ ONIG_OPTION_FIND_LONGEST find longest match
+ ONIG_OPTION_FIND_NOT_EMPTY ignore empty match
+ ONIG_OPTION_NEGATE_SINGLELINE
+ clear ONIG_OPTION_SINGLELINE which is enabled on
+ ONIG_SYNTAX_POSIX_BASIC, ONIG_SYNTAX_POSIX_EXTENDED,
+ ONIG_SYNTAX_PERL, ONIG_SYNTAX_PERL_NG, ONIG_SYNTAX_JAVA
+
+ ONIG_OPTION_DONT_CAPTURE_GROUP only named group captured.
+ ONIG_OPTION_CAPTURE_GROUP named and no-named group captured.
+
+ 5 enc: character encoding.
+
+ ONIG_ENCODING_ASCII ASCII
+ ONIG_ENCODING_ISO_8859_1 ISO 8859-1
+ ONIG_ENCODING_ISO_8859_2 ISO 8859-2
+ ONIG_ENCODING_ISO_8859_3 ISO 8859-3
+ ONIG_ENCODING_ISO_8859_4 ISO 8859-4
+ ONIG_ENCODING_ISO_8859_5 ISO 8859-5
+ ONIG_ENCODING_ISO_8859_6 ISO 8859-6
+ ONIG_ENCODING_ISO_8859_7 ISO 8859-7
+ ONIG_ENCODING_ISO_8859_8 ISO 8859-8
+ ONIG_ENCODING_ISO_8859_9 ISO 8859-9
+ ONIG_ENCODING_ISO_8859_10 ISO 8859-10
+ ONIG_ENCODING_ISO_8859_11 ISO 8859-11
+ ONIG_ENCODING_ISO_8859_13 ISO 8859-13
+ ONIG_ENCODING_ISO_8859_14 ISO 8859-14
+ ONIG_ENCODING_ISO_8859_15 ISO 8859-15
+ ONIG_ENCODING_ISO_8859_16 ISO 8859-16
+ ONIG_ENCODING_UTF8 UTF-8
+ ONIG_ENCODING_UTF16_BE UTF-16BE
+ ONIG_ENCODING_UTF16_LE UTF-16LE
+ ONIG_ENCODING_UTF32_BE UTF-32BE
+ ONIG_ENCODING_UTF32_LE UTF-32LE
+ ONIG_ENCODING_EUC_JP EUC-JP
+ ONIG_ENCODING_EUC_TW EUC-TW
+ ONIG_ENCODING_EUC_KR EUC-KR
+ ONIG_ENCODING_EUC_CN EUC-CN
+ ONIG_ENCODING_SJIS Shift_JIS
+ ONIG_ENCODING_KOI8 KOI8
+ ONIG_ENCODING_KOI8_R KOI8-R
+ ONIG_ENCODING_BIG5 Big5
+ ONIG_ENCODING_GB18030 GB 18030
+
+ or any OnigEncodingType data address defined by user.
+
+ 6 syntax: address of pattern syntax definition.
+
+ ONIG_SYNTAX_ASIS plain text
+ ONIG_SYNTAX_POSIX_BASIC POSIX Basic RE
+ ONIG_SYNTAX_POSIX_EXTENDED POSIX Extended RE
+ ONIG_SYNTAX_EMACS Emacs
+ ONIG_SYNTAX_GREP grep
+ ONIG_SYNTAX_GNU_REGEX GNU regex
+ ONIG_SYNTAX_JAVA Java (Sun java.util.regex)
+ ONIG_SYNTAX_PERL Perl
+ ONIG_SYNTAX_PERL_NG Perl + named group
+ ONIG_SYNTAX_RUBY Ruby
+ ONIG_SYNTAX_DEFAULT default (== Ruby)
+ onig_set_default_syntax()
+
+ or any OnigSyntaxType data address defined by user.
+
+ 7 err_info: address for return optional error info.
+ Use this value as 3rd argument of onig_error_code_to_str().
+
+
+
+# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
+ OnigCompileInfo* ci, OnigErrorInfo* einfo)
+
+ Create a regex object.
+ This function is deluxe version of onig_new().
+
+ normal return: ONIG_NORMAL
+
+ arguments
+ 1 reg: return address of regex object.
+ 2 pattern: regex pattern string.
+ 3 pattern_end: terminate address of pattern. (pattern + pattern length)
+ 4 ci: compile time info.
+
+ ci->num_of_elements: number of elements in ci. (current version: 5)
+ ci->pattern_enc: pattern string character encoding.
+ ci->target_enc: target string character encoding.
+ ci->syntax: address of pattern syntax definition.
+ ci->option: compile time option.
+ ci->ambig_flag: character matching ambiguity bit flag for
+ ONIG_OPTION_IGNORECASE mode.
+
+ ONIGENC_AMBIGUOUS_MATCH_NONE: exact
+ ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE: ignore case for ASCII
+ ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE: ignore case for non-ASCII
+ ONIGENC_AMBIGUOUS_MATCH_COMPOUND: grapheme cluster as a char
+ ONIGENC_AMBIGUOUS_MATCH_FULL: all ambiguity on
+ ONIGENC_AMBIGUOUS_MATCH_DEFAULT: (ASCII | NONASCII)
+ onig_set_default_ambig_flag()
+
+ 5 err_info: address for return optional error info.
+ Use this value as 3rd argument of onig_error_code_to_str().
+
+
+ Different character encoding combination is allowed for
+ the following cases only.
+
+ pattern_enc: ASCII, ISO_8859_1
+ target_enc: UTF16_BE, UTF16_LE, UTF32_BE, UTF32_LE
+
+ pattern_enc: UTF16_BE/LE
+ target_enc: UTF16_LE/BE
+
+ pattern_enc: UTF32_BE/LE
+ target_enc: UTF32_LE/BE
+
+
+# void onig_free(regex_t* reg)
+
+ Free memory used by regex object.
+
+ arguments
+ 1 reg: regex object.
+
+
+# int onig_search(regex_t* reg, const UChar* str, const UChar* end, const UChar* start,
+ const UChar* range, OnigRegion* region, OnigOptionType option)
+
+ Search string and return search result and matching region.
+
+ normal return: match position offset (i.e. p - str >= 0)
+ not found: ONIG_MISMATCH (< 0)
+
+ arguments
+ 1 reg: regex object
+ 2 str: target string
+ 3 end: terminate address of target string
+ 4 start: search start address of target string
+ 5 range: search terminate address of target string
+ in forward search (start <= searched string head < range)
+ in backward search (range <= searched string head <= start)
+ 6 region: address for return group match range info (NULL is allowed)
+ 7 option: search time option
+
+ ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line
+ ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line
+ ONIG_OPTION_POSIX_REGION region argument is regmatch_t[] of POSIX API.
+
+
+# int onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at,
+ OnigRegion* region, OnigOptionType option)
+
+ Match string and return result and matching region.
+
+ normal return: match length (>= 0)
+ not match: ONIG_MISMATCH ( < 0)
+
+ arguments
+ 1 reg: regex object
+ 2 str: target string
+ 3 end: terminate address of target string
+ 4 at: match address of target string
+ 5 region: address for return group match range info (NULL is allowed)
+ 6 option: search time option
+
+ ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line
+ ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line
+ ONIG_OPTION_POSIX_REGION region argument is regmatch_t[] type of POSIX API.
+
+
+# OnigRegion* onig_region_new(void)
+
+ Create a region.
+
+
+# void onig_region_free(OnigRegion* region, int free_self)
+
+ Free memory used by region.
+
+ arguments
+ 1 region: target region
+ 2 free_self: [1: free all, 0: free memory used in region but not self]
+
+
+# void onig_region_copy(OnigRegion* to, OnigRegion* from)
+
+ Copy contents of region.
+
+ arguments
+ 1 to: target region
+ 2 from: source region
+
+
+# void onig_region_clear(OnigRegion* region)
+
+ Clear contents of region.
+
+ arguments
+ 1 region: target region
+
+
+# int onig_region_resize(OnigRegion* region, int n)
+
+ Resize group range area of region.
+
+ normal return: ONIG_NORMAL
+
+ arguments
+ 1 region: target region
+ 2 n: new size
+
+
+# int onig_name_to_group_numbers(regex_t* reg, const UChar* name, const UChar* name_end,
+ int** num_list)
+
+ Return the group number list of the name.
+ Named subexp is defined by (?<name>....).
+
+ normal return: number of groups for the name.
+ (ex. /(?<x>..)(?<x>..)/ ==> 2)
+ name not found: -1
+
+ arguments
+ 1 reg: regex object.
+ 2 name: group name.
+ 3 name_end: terminate address of group name.
+ 4 num_list: return list of group number.
+
+
+# int onig_name_to_backref_number(regex_t* reg, const UChar* name, const UChar* name_end,
+ OnigRegion *region)
+
+ Return the group number corresponding to the named backref (\k<name>).
+ If two or more regions for the groups of the name are effective,
+ the greatest number in it is obtained.
+
+ normal return: group number.
+
+ arguments
+ 1 reg: regex object.
+ 2 name: group name.
+ 3 name_end: terminate address of group name.
+ 4 region: search/match result region.
+
+
+# int onig_foreach_name(regex_t* reg,
+ int (*func)(const UChar*, const UChar*, int,int*,regex_t*,void*),
+ void* arg)
+
+ Iterate function call for all names.
+
+ normal return: 0
+ error: func's return value.
+
+ arguments
+ 1 reg: regex object.
+ 2 func: callback function.
+ func(name, name_end, <number of groups>, <group number's list>,
+ reg, arg);
+ if func does not return 0, then iteration is stopped.
+ 3 arg: argument for func.
+
+
+# int onig_number_of_names(regex_t* reg)
+
+ Return the number of names defined in the pattern.
+ Multiple definitions of one name is counted as one.
+
+ arguments
+ 1 reg: regex object.
+
+
+# OnigEncoding onig_get_encoding(regex_t* reg)
+# OnigOptionType onig_get_options(regex_t* reg)
+# OnigAmbigType onig_get_ambig_flag(regex_t* reg)
+# OnigSyntaxType* onig_get_syntax(regex_t* reg)
+
+ Return a value of the regex object.
+
+ arguments
+ 1 reg: regex object.
+
+
+# int onig_number_of_captures(regex_t* reg)
+
+ Return the number of capture group in the pattern.
+
+ arguments
+ 1 reg: regex object.
+
+
+# int onig_number_of_capture_histories(regex_t* reg)
+
+ Return the number of capture history defined in the pattern.
+
+ You can't use capture history if ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY
+ is disabled in the pattern syntax.(disabled in the default syntax)
+
+ arguments
+ 1 reg: regex object.
+
+
+
+# OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region)
+
+ Return the root node of capture history data tree.
+
+ This value is undefined if matching has faild.
+
+ arguments
+ 1 region: matching result.
+
+
+# int onig_capture_tree_traverse(OnigRegion* region, int at,
+ int(*func)(int,int,int,int,int,void*), void* arg)
+
+ Traverse and callback in capture history data tree.
+
+ normal return: 0
+ error: callback func's return value.
+
+ arguments
+ 1 region: match region data.
+ 2 at: callback position.
+
+ ONIG_TRAVERSE_CALLBACK_AT_FIRST: callback first, then traverse childs.
+ ONIG_TRAVERSE_CALLBACK_AT_LAST: traverse childs first, then callback.
+ ONIG_TRAVERSE_CALLBACK_AT_BOTH: callback first, then traverse childs,
+ and at last callback again.
+
+ 3 func: callback function.
+ if func does not return 0, then traverse is stopped.
+
+ int func(int group, int beg, int end, int level, int at,
+ void* arg)
+
+ group: group number
+ beg: capture start position
+ end: capture end position
+ level: nest level (from 0)
+ at: callback position
+ ONIG_TRAVERSE_CALLBACK_AT_FIRST
+ ONIG_TRAVERSE_CALLBACK_AT_LAST
+ arg: optional callback argument
+
+ 4 arg; optional callback argument.
+
+
+# int onig_noname_group_capture_is_active(regex_t* reg)
+
+ Return noname group capture activity.
+
+ active: 1
+ inactive: 0
+
+ arguments
+ 1 reg: regex object.
+
+ if option ONIG_OPTION_DONT_CAPTURE_GROUP == ON
+ --> inactive
+
+ if the regex pattern have named group
+ and syntax ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP == ON
+ and option ONIG_OPTION_CAPTURE_GROUP == OFF
+ --> inactive
+
+ else --> active
+
+
+# UChar* onigenc_get_prev_char_head(OnigEncoding enc, const UChar* start, const UChar* s)
+
+ Return previous character head address.
+
+ arguments
+ 1 enc: character encoding
+ 2 start: string address
+ 3 s: target address of string
+
+
+# UChar* onigenc_get_left_adjust_char_head(OnigEncoding enc,
+ const UChar* start, const UChar* s)
+
+ Return left-adjusted head address of a character.
+
+ arguments
+ 1 enc: character encoding
+ 2 start: string address
+ 3 s: target address of string
+
+
+# UChar* onigenc_get_right_adjust_char_head(OnigEncoding enc,
+ const UChar* start, const UChar* s)
+
+ Return right-adjusted head address of a character.
+
+ arguments
+ 1 enc: character encoding
+ 2 start: string address
+ 3 s: target address of string
+
+
+# int onigenc_strlen(OnigEncoding enc, const UChar* s, const UChar* end)
+# int onigenc_strlen_null(OnigEncoding enc, const UChar* s)
+
+ Return number of characters in the string.
+
+
+# int onigenc_str_bytelen_null(OnigEncoding enc, const UChar* s)
+
+ Return number of bytes in the string.
+
+
+# int onig_set_default_syntax(OnigSyntaxType* syntax)
+
+ Set default syntax.
+
+ arguments
+ 1 syntax: address of pattern syntax definition.
+
+
+# void onig_copy_syntax(OnigSyntaxType* to, OnigSyntaxType* from)
+
+ Copy syntax.
+
+ arguments
+ 1 to: destination address.
+ 2 from: source address.
+
+
+# unsigned int onig_get_syntax_op(OnigSyntaxType* syntax)
+# unsigned int onig_get_syntax_op2(OnigSyntaxType* syntax)
+# unsigned int onig_get_syntax_behavior(OnigSyntaxType* syntax)
+# OnigOptionType onig_get_syntax_options(OnigSyntaxType* syntax)
+
+# void onig_set_syntax_op(OnigSyntaxType* syntax, unsigned int op)
+# void onig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2)
+# void onig_set_syntax_behavior(OnigSyntaxType* syntax, unsigned int behavior)
+# void onig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options)
+
+ Get/Set elements of the syntax.
+
+ arguments
+ 1 syntax: syntax
+ 2 op, op2, behavior, options: value of element.
+
+
+# void onig_copy_encoding(OnigEncoding to, OnigOnigEncoding from)
+
+ Copy encoding.
+
+ arguments
+ 1 to: destination address.
+ 2 from: source address.
+
+
+# int onig_set_meta_char(OnigEncoding enc, unsigned int what,
+ OnigCodePoint code)
+
+ Set a variable meta character to the code point value.
+ Except for an escape character, this meta characters specification
+ is not work, if ONIG_SYN_OP_VARIABLE_META_CHARACTERS is not effective
+ by the syntax. (Build-in syntaxes are not effective.)
+
+ normal return: ONIG_NORMAL
+
+ arguments
+ 1 enc: target encoding
+ 2 what: specifies which meta character it is.
+
+ ONIG_META_CHAR_ESCAPE
+ ONIG_META_CHAR_ANYCHAR
+ ONIG_META_CHAR_ANYTIME
+ ONIG_META_CHAR_ZERO_OR_ONE_TIME
+ ONIG_META_CHAR_ONE_OR_MORE_TIME
+ ONIG_META_CHAR_ANYCHAR_ANYTIME
+
+ 3 code: meta character or ONIG_INEFFECTIVE_META_CHAR.
+
+
+# OnigAmbigType onig_get_default_ambig_flag()
+
+ Get default ambig flag.
+
+
+# int onig_set_default_ambig_flag(OnigAmbigType ambig_flag)
+
+ Set default ambig flag.
+
+ 1 ambig_flag: ambiguity flag
+
+
+# unsigned int onig_get_match_stack_limit_size(void)
+
+ Return the maximum number of stack size.
+ (default: 0 == unlimited)
+
+
+# int onig_set_match_stack_limit_size(unsigned int size)
+
+ Set the maximum number of stack size.
+ (size = 0: unlimited)
+
+ normal return: ONIG_NORMAL
+
+
+# int onig_end(void)
+
+ The use of this library is finished.
+
+ normal return: ONIG_NORMAL
+
+ It is not allowed to use regex objects which created
+ before onig_end() call.
+
+
+# const char* onig_version(void)
+
+ Return version string. (ex. "2.2.8")
+
+// END
diff --git a/ext/mbstring/oniguruma/doc/API.ja b/ext/mbstring/oniguruma/doc/API.ja
new file mode 100644
index 000000000..2682da480
--- /dev/null
+++ b/ext/mbstring/oniguruma/doc/API.ja
@@ -0,0 +1,593 @@
+µ´¼Ö¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ Version 4.1.0 2006/05/15
+
+#include <oniguruma.h>
+
+
+# int onig_init(void)
+
+ ¥é¥¤¥Ö¥é¥ê¤Î½é´ü²½
+
+ onig_new()¤ÎÃæ¤Ç¸Æ¤Ó½Ð¤µ¤ì¤ë¤Î¤Ç¡¢¤³¤Î´Ø¿ô¤òÌÀ¼¨Åª¤Ë¸Æ¤Ó½Ð¤µ¤Ê¤¯¤Æ¤â¤è¤¤¡£
+
+
+# int onig_error_code_to_str(UChar* err_buf, int err_code, ...)
+
+ ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò¼èÆÀ¤¹¤ë¡£
+
+ ¤³¤Î´Ø¿ô¤ò¡¢onig_new()¤Î·ë²Ì¤ËÂФ·¤Æ¸Æ¤Ó½Ð¤¹¾ì¹ç¤Ë¤Ï¡¢onig_new()¤Îpattern°ú¿ô¤ò
+ ¥á¥â¥ê²òÊü¤¹¤ë¤è¤ê¤âÁ°¤Ë¸Æ¤Ó½Ð¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Ê¸»úÎó¤Î¥Ð¥¤¥ÈĹ
+
+ °ú¿ô
+ 1 err_buf: ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò³ÊǼ¤¹¤ëÎΰè
+ (ɬÍפʥµ¥¤¥º: ONIG_MAX_ERROR_MESSAGE_LEN)
+ 2 err_code: ¥¨¥é¡¼¥³¡¼¥É
+ 3 err_info (optional): onig_new()¤Îerr_info
+
+
+# void onig_set_warn_func(OnigWarnFunc func)
+
+ ·Ù¹ðÄÌÃδؿô¤ò¥»¥Ã¥È¤¹¤ë¡£
+
+ ·Ù¹ð:
+ '[', '-', ']' in character class without escape.
+ ']' in pattern without escape.
+
+ °ú¿ô
+ 1 func: ·Ù¹ð´Ø¿ô void (*func)(char* warning_message)
+
+
+# void onig_set_verb_warn_func(OnigWarnFunc func)
+
+ ¾ÜºÙ·Ù¹ðÄÌÃδؿô¤ò¥»¥Ã¥È¤¹¤ë¡£
+
+ ¾ÜºÙ·Ù¹ð:
+ redundant nested repeat operator.
+
+ °ú¿ô
+ 1 func: ¾ÜºÙ·Ù¹ð´Ø¿ô void (*func)(char* warning_message)
+
+
+# int onig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
+ OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax,
+ OnigErrorInfo* err_info)
+
+ Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È(regex)¤òºîÀ®¤¹¤ë¡£
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: ONIG_NORMAL
+
+ °ú¿ô
+ 1 reg: ºîÀ®¤µ¤ì¤¿Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¥¢¥É¥ì¥¹
+ 2 pattern: Àµµ¬É½¸½¥Ñ¥¿¡¼¥óʸ»úÎó
+ 3 pattern_end: Àµµ¬É½¸½¥Ñ¥¿¡¼¥óʸ»úÎó¤Î½ªÃ¼¥¢¥É¥ì¥¹(pattern + pattern length)
+ 4 option: Àµµ¬É½¸½¥³¥ó¥Ñ¥¤¥ë»þ¥ª¥×¥·¥ç¥ó
+
+ ONIG_OPTION_NONE ¥ª¥×¥·¥ç¥ó¤Ê¤·
+ ONIG_OPTION_SINGLELINE '^' -> '\A', '$' -> '\z', '\Z' -> '\z'
+ ONIG_OPTION_MULTILINE '.'¤¬²þ¹Ô¤Ë¥Þ¥Ã¥Á¤¹¤ë
+ ONIG_OPTION_IGNORECASE Û£Ëæ¥Þ¥Ã¥Á ¥ª¥ó
+ ONIG_OPTION_EXTEND ¥Ñ¥¿¡¼¥ó³ÈÄ¥·Á¼°
+ ONIG_OPTION_FIND_LONGEST ºÇĹ¥Þ¥Ã¥Á
+ ONIG_OPTION_FIND_NOT_EMPTY ¶õ¥Þ¥Ã¥Á¤ò̵»ë
+ ONIG_OPTION_NEGATE_SINGLELINE
+ ONIG_SYNTAX_POSIX_BASIC, ONIG_SYNTAX_POSIX_EXTENDED,
+ ONIG_SYNTAX_PERL, ONIG_SYNTAX_PERL_NG, ONIG_SYNTAX_JAVA¤Ç
+ ¥Ç¥Õ¥©¥ë¥È¤ÇÍ­¸ú¤ÊONIG_OPTION_SINGLELINE¤ò¥¯¥ê¥¢¤¹¤ë¡£
+
+ ONIG_OPTION_DONT_CAPTURE_GROUP ̾Á°ÉÕ¤­Êá³Í¼°½¸¹ç¤Î¤ßÊá³Í
+ ONIG_OPTION_CAPTURE_GROUP ̾Á°Ìµ¤·Êá³Í¼°½¸¹ç¤âÊá³Í
+
+ 5 enc: ʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
+
+ ONIG_ENCODING_ASCII ASCII
+ ONIG_ENCODING_ISO_8859_1 ISO 8859-1
+ ONIG_ENCODING_ISO_8859_2 ISO 8859-2
+ ONIG_ENCODING_ISO_8859_3 ISO 8859-3
+ ONIG_ENCODING_ISO_8859_4 ISO 8859-4
+ ONIG_ENCODING_ISO_8859_5 ISO 8859-5
+ ONIG_ENCODING_ISO_8859_6 ISO 8859-6
+ ONIG_ENCODING_ISO_8859_7 ISO 8859-7
+ ONIG_ENCODING_ISO_8859_8 ISO 8859-8
+ ONIG_ENCODING_ISO_8859_9 ISO 8859-9
+ ONIG_ENCODING_ISO_8859_10 ISO 8859-10
+ ONIG_ENCODING_ISO_8859_11 ISO 8859-11
+ ONIG_ENCODING_ISO_8859_13 ISO 8859-13
+ ONIG_ENCODING_ISO_8859_14 ISO 8859-14
+ ONIG_ENCODING_ISO_8859_15 ISO 8859-15
+ ONIG_ENCODING_ISO_8859_16 ISO 8859-16
+ ONIG_ENCODING_UTF8 UTF-8
+ ONIG_ENCODING_UTF16_BE UTF-16BE
+ ONIG_ENCODING_UTF16_LE UTF-16LE
+ ONIG_ENCODING_UTF32_BE UTF-32BE
+ ONIG_ENCODING_UTF32_LE UTF-32LE
+ ONIG_ENCODING_EUC_JP EUC-JP
+ ONIG_ENCODING_EUC_TW EUC-TW
+ ONIG_ENCODING_EUC_KR EUC-KR
+ ONIG_ENCODING_EUC_CN EUC-CN
+ ONIG_ENCODING_SJIS Shift_JIS
+ ONIG_ENCODING_KOI8 KOI8
+ ONIG_ENCODING_KOI8_R KOI8-R
+ ONIG_ENCODING_BIG5 Big5
+ ONIG_ENCODING_GB18030 GB 18030
+
+ ¤Þ¤¿¤Ï¡¢¥æ¡¼¥¶¤¬ÄêµÁ¤·¤¿OnigEncodingType¥Ç¡¼¥¿¤Î¥¢¥É¥ì¥¹
+
+ 6 syntax: Àµµ¬É½¸½¥Ñ¥¿¡¼¥óʸˡÄêµÁ
+
+ ONIG_SYNTAX_ASIS plain text
+ ONIG_SYNTAX_POSIX_BASIC POSIX Basic RE
+ ONIG_SYNTAX_POSIX_EXTENDED POSIX Extended RE
+ ONIG_SYNTAX_EMACS Emacs
+ ONIG_SYNTAX_GREP grep
+ ONIG_SYNTAX_GNU_REGEX GNU regex
+ ONIG_SYNTAX_JAVA Java (Sun java.util.regex)
+ ONIG_SYNTAX_PERL Perl
+ ONIG_SYNTAX_PERL_NG Perl + ̾Á°ÉÕ¤­Êá³Í¼°½¸¹ç
+ ONIG_SYNTAX_RUBY Ruby
+ ONIG_SYNTAX_DEFAULT default (== Ruby)
+ onig_set_default_syntax()
+
+ ¤Þ¤¿¤Ï¡¢¥æ¡¼¥¶¤¬ÄêµÁ¤·¤¿OnigSyntaxType¥Ç¡¼¥¿¤Î¥¢¥É¥ì¥¹
+
+ 7 err_info: ¥¨¥é¡¼¾ðÊó¤òÊÖ¤¹¤¿¤á¤Î¥¢¥É¥ì¥¹
+ onig_error_code_to_str()¤Î»°ÈÖÌܤΰú¿ô¤È¤·¤Æ»ÈÍѤ¹¤ë
+
+
+# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
+ OnigCompileInfo* ci, OnigErrorInfo* einfo)
+
+ Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È(regex)¤òºîÀ®¤¹¤ë¡£
+ ¤³¤Î´Ø¿ô¤Ï¡¢onig_new()¤Î¥Ç¥é¥Ã¥¯¥¹ÈÇ¡£
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: ONIG_NORMAL
+
+ °ú¿ô
+ 1 reg: ºîÀ®¤µ¤ì¤¿Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¥¢¥É¥ì¥¹
+ 2 pattern: Àµµ¬É½¸½¥Ñ¥¿¡¼¥óʸ»úÎó
+ 3 pattern_end: Àµµ¬É½¸½¥Ñ¥¿¡¼¥óʸ»úÎó¤Î½ªÃ¼¥¢¥É¥ì¥¹(pattern + pattern length)
+ 4 ci: ¥³¥ó¥Ñ¥¤¥ë¾ðÊó
+
+ ci->num_of_elements: ci¤ÎÍ×ÁÇ¿ô (¸½ºß¤ÎÈǤǤÏ: 5)
+ ci->pattern_enc: ¥Ñ¥¿¡¼¥óʸ»úÎó¤Îʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
+ ci->target_enc: ÂоÝʸ»úÎó¤Îʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
+ ci->syntax: Àµµ¬É½¸½¥Ñ¥¿¡¼¥óʸˡÄêµÁ
+ ci->option: Àµµ¬É½¸½¥³¥ó¥Ñ¥¤¥ë»þ¥ª¥×¥·¥ç¥ó
+ ci->ambig_flag: ONIG_OPTION_IGNORECASE¥â¡¼¥É¤Ç¤Î
+ ʸ»úÛ£Ëæ¥Þ¥Ã¥Á»ØÄê¥Ó¥Ã¥È¥Õ¥é¥°
+
+ ONIGENC_AMBIGUOUS_MATCH_NONE: Û£Ëæ̵¤·
+ ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE: ASCII¤ÎÂçʸ»ú¾®Ê¸»ú
+ ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE: ASCII°Ê³°¤ÎÂçʸ»ú¾®Ê¸»ú
+ ONIGENC_AMBIGUOUS_MATCH_COMPOUND: ¹çÀ®Ê¸»ú
+ ONIGENC_AMBIGUOUS_MATCH_FULL: Á´¤Æ¤ÎÛ£Ëæ¥Õ¥é¥°Í­¸ú
+ ONIGENC_AMBIGUOUS_MATCH_DEFAULT: (ASCII | NONASCII)
+ onig_set_default_ambig_flag()
+
+ 5 err_info: ¥¨¥é¡¼¾ðÊó¤òÊÖ¤¹¤¿¤á¤Î¥¢¥É¥ì¥¹
+ onig_error_code_to_str()¤Î»°ÈÖÌܤΰú¿ô¤È¤·¤Æ»ÈÍѤ¹¤ë
+
+
+ °Û¤Ê¤ëʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ÎÁȤ߹ç¤ï¤»¤Ï¡¢°Ê²¼¤Î¾ì¹ç¤Ë¤Î¤ßµö¤µ¤ì¤ë¡£
+
+ pattern_enc: ASCII, ISO_8859_1
+ target_enc: UTF16_BE, UTF16_LE, UTF32_BE, UTF32_LE
+
+ pattern_enc: UTF16_BE/LE
+ target_enc: UTF16_LE/BE
+
+ pattern_enc: UTF32_BE/LE
+ target_enc: UTF32_LE/BE
+
+
+# void onig_free(regex_t* reg)
+
+ Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È¤Î¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£
+
+ °ú¿ô
+ 1 reg: Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È
+
+
+
+# int onig_search(regex_t* reg, const UChar* str, const UChar* end, const UChar* start,
+ const UChar* range, OnigRegion* region, OnigOptionType option)
+
+ Àµµ¬É½¸½¤Çʸ»úÎó¤ò¸¡º÷¤·¡¢¸¡º÷·ë²Ì¤È¥Þ¥Ã¥ÁÎΰè¤òÊÖ¤¹¡£
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: ¥Þ¥Ã¥Á°ÌÃÖ (p - str >= 0)
+ ¸¡º÷¼ºÇÔ: ONIG_MISMATCH (< 0)
+
+ °ú¿ô
+ 1 reg: Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È
+ 2 str: ¸¡º÷ÂоÝʸ»úÎó
+ 3 end: ¸¡º÷ÂоÝʸ»úÎó¤Î½ªÃ¼¥¢¥É¥ì¥¹
+ 4 start: ¸¡º÷ÂоÝʸ»úÎó¤Î¸¡º÷ÀèƬ°ÌÃÖ³«»Ï¥¢¥É¥ì¥¹
+ 5 range: ¸¡º÷ÂоÝʸ»úÎó¤Î¸¡º÷ÀèƬ°ÌÃÖ½ªÃ¼¥¢¥É¥ì¥¹
+ Á°Êýõº÷ (start <= õº÷¤µ¤ì¤ëʸ»úÎó¤ÎÀèƬ < range)
+ ¸åÊýõº÷ (range <= õº÷¤µ¤ì¤ëʸ»úÎó¤ÎÀèƬ <= start)
+ 6 region: ¥Þ¥Ã¥ÁÎΰè¾ðÊó(region) (NULL¤âµö¤µ¤ì¤ë)
+ 7 option: ¸¡º÷»þ¥ª¥×¥·¥ç¥ó
+
+ ONIG_OPTION_NOTBOL ʸ»úÎó¤ÎÀèƬ(str)¤ò¹ÔƬ¤È´ÇÐö¤µ¤Ê¤¤
+ ONIG_OPTION_NOTEOL ʸ»úÎó¤Î½ªÃ¼(end)¤ò¹ÔËö¤È´ÇÐö¤µ¤Ê¤¤
+ ONIG_OPTION_POSIX_REGION region°ú¿ô¤òPOSIX API¤Îregmatch_t[]¤Ë¤¹¤ë
+
+
+# int onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at,
+ OnigRegion* region, OnigOptionType option)
+
+ ʸ»úÎó¤Î»ØÄê°ÌÃ֤ǥޥåÁ¥ó¥°¤ò¹Ô¤¤¡¢·ë²Ì¤È¥Þ¥Ã¥ÁÎΰè¤òÊÖ¤¹¡£
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: ¥Þ¥Ã¥Á¤·¤¿¥Ð¥¤¥ÈĹ (>= 0)
+ not match: ONIG_MISMATCH ( < 0)
+
+ °ú¿ô
+ 1 reg: Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È
+ 2 str: ¸¡º÷ÂоÝʸ»úÎó
+ 3 end: ¸¡º÷ÂоÝʸ»úÎó¤Î½ªÃ¼¥¢¥É¥ì¥¹
+ 4 at: ¸¡º÷ÂоÝʸ»úÎó¤Î¸¡º÷¥¢¥É¥ì¥¹
+ 5 region: ¥Þ¥Ã¥ÁÎΰè¾ðÊó(region) (NULL¤âµö¤µ¤ì¤ë)
+ 6 option: ¸¡º÷»þ¥ª¥×¥·¥ç¥ó
+
+ ONIG_OPTION_NOTBOL ʸ»úÎó¤ÎÀèƬ(str)¤ò¹ÔƬ¤È´ÇÐö¤µ¤Ê¤¤
+ ONIG_OPTION_NOTEOL ʸ»úÎó¤Î½ªÃ¼(end)¤ò¹ÔËö¤È´ÇÐö¤µ¤Ê¤¤
+ ONIG_OPTION_POSIX_REGION region°ú¿ô¤òPOSIX API¤Îregmatch_t[]¤Ë¤¹¤ë
+
+
+# OnigRegion* onig_region_new(void)
+
+ ¥Þ¥Ã¥ÁÎΰè¾ðÊó(region)¤òºîÀ®¤¹¤ë¡£
+
+
+# void onig_region_free(OnigRegion* region, int free_self)
+
+ ¥Þ¥Ã¥ÁÎΰè¾ðÊó(region)¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¥á¥â¥ê¤ò²òÊü¤¹¤ë¡£
+
+ °ú¿ô
+ 1 region: ¥Þ¥Ã¥ÁÎΰè¾ðÊ󥪥֥¸¥§¥¯¥È
+ 2 free_self: [1: region¼«¿È¤ò´Þ¤á¤ÆÁ´¤Æ²òÊü, 0: region¼«¿È¤Ï²òÊü¤·¤Ê¤¤]
+
+
+# void onig_region_copy(OnigRegion* to, OnigRegion* from)
+
+ ¥Þ¥Ã¥ÁÎΰè¾ðÊó(region)¤òÊ£À½¤¹¤ë¡£
+
+ °ú¿ô
+ 1 to: ÂоÝÎΰè
+ 2 from: ¸µÎΰè
+
+
+# void onig_region_clear(OnigRegion* region)
+
+ ¥Þ¥Ã¥ÁÎΰè¾ðÊó(region)¤ÎÃæÌ£¤ò¥¯¥ê¥¢¤¹¤ë¡£
+
+ °ú¿ô
+ 1 region: ÂоÝÎΰè
+
+
+# int onig_region_resize(OnigRegion* region, int n)
+
+ ¥Þ¥Ã¥ÁÎΰè¾ðÊó(region)¤ÎÊá³Í¼°½¸¹ç(¥°¥ë¡¼¥×)¿ô¤òÊѹ¹¤¹¤ë¡£
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: ONIG_NORMAL
+
+ °ú¿ô
+ 1 region: ÂоÝÎΰè
+ 2 n: ¿·¤·¤¤¥µ¥¤¥º
+
+
+# int onig_name_to_group_numbers(regex_t* reg, const UChar* name, const UChar* name_end,
+ int** num_list)
+
+ »ØÄꤷ¤¿Ì¾Á°¤ËÂФ¹¤ë̾Á°ÉÕ¤­Êá³Í¼°½¸¹ç(¥°¥ë¡¼¥×)¤Î
+ ¥°¥ë¡¼¥×ÈÖ¹æ¥ê¥¹¥È¤òÊÖ¤¹¡£
+ ̾Á°ÉÕ¤­Êá³Í¼°½¸¹ç¤Ï¡¢(?<name>....)¤Ë¤è¤Ã¤ÆÄêµÁ¤Ç¤­¤ë¡£
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: »ØÄꤵ¤ì¤¿Ì¾Á°¤ËÂФ¹¤ë¥°¥ë¡¼¥×¿ô
+ (Îã /(?<x>..)(?<x>..)/ ==> 2)
+ ̾Á°¤ËÂФ¹¤ë¥°¥ë¡¼¥×¤¬Â¸ºß¤·¤Ê¤¤: -1
+
+ °ú¿ô
+ 1 reg: Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È
+ 2 name: Êá³Í¼°½¸¹ç(¥°¥ë¡¼¥×)̾
+ 3 name_end: Êá³Í¼°½¸¹ç(¥°¥ë¡¼¥×)̾¤Î½ªÃ¼¥¢¥É¥ì¥¹
+ 4 num_list: ÈÖ¹æ¥ê¥¹¥È¤òÊÖ¤¹¥¢¥É¥ì¥¹
+
+
+# int onig_name_to_backref_number(regex_t* reg, const UChar* name, const UChar* name_end,
+ OnigRegion *region)
+
+ »ØÄꤵ¤ì¤¿Ì¾Á°¤Î¸åÊý»²¾È(\k<name>)¤ËÂФ¹¤ëÊá³Í¼°½¸¹ç(¥°¥ë¡¼¥×)¤ÎÈÖ¹æ¤òÊÖ¤¹¡£
+ ̾Á°¤ËÂФ·¤Æ¡¢Ê£¿ô¤Î¥Þ¥Ã¥ÁÎΰ褬ͭ¸ú¤Ç¤¢¤ì¤Ð¡¢¤½¤ÎÃæ¤ÎºÇÂç¤ÎÈÖ¹æ¤òÊÖ¤¹¡£
+ ̾Á°¤ËÂФ¹¤ëÊá³Í¼°½¸¹ç¤¬°ì¸Ä¤·¤«¤Ê¤¤¤È¤­¤Ë¤Ï¡¢Âбþ¤¹¤ë¥Þ¥Ã¥ÁÎΰ褬ͭ¸ú¤«
+ ¤É¤¦¤«¤Ë´Ø·¸¤Ê¤¯¡¢¤½¤ÎÈÖ¹æ¤òÊÖ¤¹¡£(½¾¤Ã¤Æ¡¢region¤Ë¤ÏNULL¤òÅϤ·¤Æ¤â¤è¤¤¡£)
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: ÈÖ¹æ
+
+ °ú¿ô
+ 1 reg: Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È
+ 2 name: Êá³Í¼°½¸¹ç(¥°¥ë¡¼¥×)̾
+ 3 name_end: Êá³Í¼°½¸¹ç(¥°¥ë¡¼¥×)̾¤Î½ªÃ¼¥¢¥É¥ì¥¹
+ 4 region: search/match·ë²Ì¤Î¥Þ¥Ã¥ÁÎΰè
+
+
+# int onig_foreach_name(regex_t* reg,
+ int (*func)(const UChar*, const UChar*, int,int*,regex_t*,void*),
+ void* arg)
+
+ Á´¤Æ¤Î̾Á°¤ËÂФ·¤Æ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¸Æ¤Ó½Ð¤·¤ò¼Â¹Ô¤¹¤ë¡£
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: 0
+ ¥¨¥é¡¼: ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤ÎÌá¤êÃÍ
+
+ °ú¿ô
+ 1 reg: Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È
+ 2 func: ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô
+ func(name, name_end, <number of groups>, <group number's list>,
+ reg, arg);
+
+ func¤¬0°Ê³°¤ÎÃͤòÊÖ¤¹¤È¡¢¤½¤ì°Ê¹ß¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¤Ï¹Ô¤Ê¤ï¤º¤Ë
+ ½ªÎ»¤¹¤ë¡£
+
+ 3 arg: func¤ËÂФ¹¤ëÄɲðú¿ô
+
+
+# int onig_number_of_names(regex_t* reg)
+
+ ¥Ñ¥¿¡¼¥óÃæ¤ÇÄêµÁ¤µ¤ì¤¿Ì¾Á°¤Î¿ô¤òÊÖ¤¹¡£
+ °ì¸Ä¤Î̾Á°¤Î¿½ÅÄêµÁ¤Ï°ì¸Ä¤È´ÇÐö¤¹¡£
+
+ °ú¿ô
+ 1 reg: Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È
+
+
+# OnigEncoding onig_get_encoding(regex_t* reg)
+# OnigOptionType onig_get_options(regex_t* reg)
+# OnigAmbigType onig_get_ambig_flag(regex_t* reg)
+# OnigSyntaxType* onig_get_syntax(regex_t* reg)
+
+ Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ·¤Æ¡¢Âбþ¤¹¤ëÃͤòÊÖ¤¹¡£
+
+ °ú¿ô
+ 1 reg: Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È
+
+
+# int onig_number_of_captures(regex_t* reg)
+
+ ¥Ñ¥¿¡¼¥óÃæ¤ÇÄêµÁ¤µ¤ì¤¿Êá³Í¥°¥ë¡¼¥×¤Î¿ô¤òÊÖ¤¹¡£
+
+ °ú¿ô
+ 1 reg: Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È
+
+
+# int onig_number_of_capture_histories(regex_t* reg)
+
+ ¥Ñ¥¿¡¼¥óÃæ¤ÇÄêµÁ¤µ¤ì¤¿Êá³ÍÍúÎò(?@...)¤Î¿ô¤òÊÖ¤¹¡£
+
+ »ÈÍѤ¹¤ëʸˡ¤ÇÊá³ÍÍúÎòµ¡Ç½¤¬Í­¸ú(ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY)
+ ¤Ç¤Ê¤±¤ì¤Ð¡¢Êá³ÍÍúÎòµ¡Ç½¤Ï»ÈÍѤǤ­¤Ê¤¤¡£
+
+ °ú¿ô
+ 1 reg: Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È
+
+
+# OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region)
+
+ Êá³ÍÍúÎò¥Ç¡¼¥¿¤Î¥ë¡¼¥È¥Î¡¼¥É¤òÊÖ¤¹¡£
+
+ ¥Þ¥Ã¥Á¤¬¼ºÇÔ¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤³¤ÎÃͤÏÉÔÄê¤Ç¤¢¤ë¡£
+
+ °ú¿ô
+ 1 region: ¥Þ¥Ã¥ÁÎΰè
+
+
+# int onig_capture_tree_traverse(OnigRegion* region, int at,
+ int(*func)(int,int,int,int,int,void*), void* arg)
+
+ Êá³ÍÍúÎò¥Ç¡¼¥¿ÌÚ¤ò½ä²ó¤·¤Æ¥³¡¼¥ë¥Ð¥Ã¥¯¤¹¤ë¡£
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: 0
+ ¥¨¥é¡¼: ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤ÎÌá¤êÃÍ
+
+ °ú¿ô
+ 1 region: ¥Þ¥Ã¥ÁÎΰè
+ 2 at: ¥³¡¼¥ë¥Ð¥Ã¥¯¤ò¹Ô¤Ê¤¦¥¿¥¤¥ß¥ó¥°
+
+ ONIG_TRAVERSE_CALLBACK_AT_FIRST:
+ ºÇ½é¤Ë¥³¡¼¥ë¥Ð¥Ã¥¯¤·¤Æ¡¢»Ò¥Î¡¼¥É¤ò½ä²ó
+ ONIG_TRAVERSE_CALLBACK_AT_LAST:
+ »Ò¥Î¡¼¥É¤ò½ä²ó¤·¤Æ¡¢¥³¡¼¥ë¥Ð¥Ã¥¯
+ ONIG_TRAVERSE_CALLBACK_AT_BOTH:
+ ºÇ½é¤Ë¥³¡¼¥ë¥Ð¥Ã¥¯¤·¤Æ¡¢»Ò¥Î¡¼¥É¤ò½ä²ó¡¢ºÇ¸å¤Ë¤â¤¦°ìÅÙ¥³¡¼¥ë¥Ð¥Ã¥¯
+
+ 3 func: ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô
+ func¤¬0°Ê³°¤ÎÃͤòÊÖ¤¹¤È¡¢¤½¤ì°Ê¹ß¤Î½ä²ó¤Ï¹Ô¤Ê¤ï¤º¤Ë
+ ½ªÎ»¤¹¤ë¡£
+
+ int func(int group, int beg, int end, int level, int at,
+ void* arg)
+ group: ¥°¥ë¡¼¥×ÈÖ¹æ
+ beg: ¥Þ¥Ã¥Á³«»Ï°ÌÃÖ
+ end ¥Þ¥Ã¥Á½ªÎ»°ÌÃÖ
+ level: ¥Í¥¹¥È¥ì¥Ù¥ë (0¤«¤é)
+ at: ¥³¡¼¥ë¥Ð¥Ã¥¯¤¬¸Æ¤Ó½Ð¤µ¤ì¤¿¥¿¥¤¥ß¥ó¥°
+ ONIG_TRAVERSE_CALLBACK_AT_FIRST
+ ONIG_TRAVERSE_CALLBACK_AT_LAST
+ arg: Äɲðú¿ô
+
+ 4 arg; func¤ËÂФ¹¤ëÄɲðú¿ô
+
+
+# int onig_noname_group_capture_is_active(regex_t* reg)
+
+ ̾Á°¤Ê¤·¼°½¸¹ç¤ÎÊá³Íµ¡Ç½¤¬Í­¸ú¤«¤É¤¦¤«¤òÊÖ¤¹¡£
+
+ Í­¸ú: 1
+ ̵¸ú: 0
+
+ °ú¿ô
+ 1 reg: Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È
+
+
+ ¥ª¥×¥·¥ç¥ó¤ÎONIG_OPTION_DONT_CAPTURE_GROUP¤¬ON --> ̵¸ú
+
+ ¥Ñ¥¿¡¼¥ó¤¬Ì¾Á°¤Ä¤­¼°½¸¹ç¤ò»ÈÍѤ·¤Æ¤¤¤ë
+ AND »ÈÍÑʸˡ¤Ç¡¢ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP¤¬ON
+ AND ¥ª¥×¥·¥ç¥ó¤ÎONIG_OPTION_CAPTURE_GROUP¤¬OFF
+ --> ̵¸ú
+
+ ¾åµ­°Ê³°¤Î¾ì¹ç --> Í­¸ú
+
+
+# UChar* onigenc_get_prev_char_head(OnigEncoding enc, const UChar* start, const UChar* s)
+
+ ʸ»ú°ì¸ÄʬÁ°¤Îʸ»úÎó°ÌÃÖ¤òÊÖ¤¹¡£
+
+ °ú¿ô
+ 1 enc: ʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
+ 2 start: ʸ»úÎó¤ÎÀèƬ¥¢¥É¥ì¥¹
+ 3 s: ʸ»úÎóÃæ¤Î°ÌÃÖ
+
+
+# UChar* onigenc_get_left_adjust_char_head(OnigEncoding enc,
+ const UChar* start, const UChar* s)
+
+ ʸ»ú¤ÎÀèƬ¥Ð¥¤¥È°ÌÃ֤ˤʤë¤è¤¦¤Ëº¸Â¦¤ËÄ´À°¤·¤¿¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£
+
+ °ú¿ô
+ 1 enc: ʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
+ 2 start: ʸ»úÎó¤ÎÀèƬ¥¢¥É¥ì¥¹
+ 3 s: ʸ»úÎóÃæ¤Î°ÌÃÖ
+
+
+# UChar* onigenc_get_right_adjust_char_head(OnigEncoding enc,
+ const UChar* start, const UChar* s)
+
+ ʸ»ú¤ÎÀèƬ¥Ð¥¤¥È°ÌÃ֤ˤʤë¤è¤¦¤Ë±¦Â¦¤ËÄ´À°¤·¤¿¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£
+
+ °ú¿ô
+ 1 enc: ʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
+ 2 start: ʸ»úÎó¤ÎÀèƬ¥¢¥É¥ì¥¹
+ 3 s: ʸ»úÎóÃæ¤Î°ÌÃÖ
+
+
+# int onigenc_strlen(OnigEncoding enc, const UChar* s, const UChar* end)
+# int onigenc_strlen_null(OnigEncoding enc, const UChar* s)
+
+ ʸ»úÎó¤Îʸ»ú¿ô¤òÊÖ¤¹¡£
+
+
+# int onigenc_str_bytelen_null(OnigEncoding enc, const UChar* s)
+
+ ʸ»úÎó¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
+
+
+# int onig_set_default_syntax(OnigSyntaxType* syntax)
+
+ ¥Ç¥Õ¥©¥ë¥È¤ÎÀµµ¬É½¸½¥Ñ¥¿¡¼¥óʸˡ¤ò¥»¥Ã¥È¤¹¤ë¡£
+
+ °ú¿ô
+ 1 syntax: Àµµ¬É½¸½¥Ñ¥¿¡¼¥óʸˡ
+
+
+# void onig_copy_syntax(OnigSyntaxType* to, OnigSyntaxType* from)
+
+ Àµµ¬É½¸½¥Ñ¥¿¡¼¥óʸˡ¤ò¥³¥Ô¡¼¤¹¤ë¡£
+
+ °ú¿ô
+ 1 to: ÂоÝ
+ 2 from: ¸µ
+
+
+# unsigned int onig_get_syntax_op(OnigSyntaxType* syntax)
+# unsigned int onig_get_syntax_op2(OnigSyntaxType* syntax)
+# unsigned int onig_get_syntax_behavior(OnigSyntaxType* syntax)
+# OnigOptionType onig_get_syntax_options(OnigSyntaxType* syntax)
+
+# void onig_set_syntax_op(OnigSyntaxType* syntax, unsigned int op)
+# void onig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2)
+# void onig_set_syntax_behavior(OnigSyntaxType* syntax, unsigned int behavior)
+# void onig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options)
+
+ Àµµ¬É½¸½¥Ñ¥¿¡¼¥óʸˡ¤ÎÍ×ÁǤò»²¾È/¼èÆÀ¤¹¤ë¡£
+
+ °ú¿ô
+ 1 syntax: Àµµ¬É½¸½¥Ñ¥¿¡¼¥óʸˡ
+ 2 op, op2, behavior, options: Í×ÁǤÎÃÍ
+
+
+# void onig_copy_encoding(OnigEncoding to, OnigOnigEncoding from)
+
+ ʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ò¥³¥Ô¡¼¤¹¤ë¡£
+
+ °ú¿ô
+ 1 to: ÂоÝ
+ 2 from: ¸µ
+
+
+# int onig_set_meta_char(OnigEncoding enc, unsigned int what,
+ OnigCodePoint code)
+
+ ¥á¥¿Ê¸»ú¤ò»ØÄꤷ¤¿¥³¡¼¥É¥Ý¥¤¥ó¥ÈÃͤ˥»¥Ã¥È¤¹¤ë¡£
+ ONIG_SYN_OP_VARIABLE_META_CHARACTERS¤¬Àµµ¬É½¸½¥Ñ¥¿¡¼¥óʸˡ¤ÇÍ­¸ú¤Ë
+ ¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥¨¥¹¥±¡¼¥×ʸ»ú¤ò½ü¤¤¤Æ¡¢¤³¤³¤Ç»ØÄꤷ¤¿¥á¥¿Ê¸»ú¤Ï
+ µ¡Ç½¤·¤Ê¤¤¡£(Áȹþ¤ß¤Îʸˡ¤Ç¤ÏÍ­¸ú¤Ë¤·¤Æ¤¤¤Ê¤¤¡£)
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: ONIG_NORMAL
+
+ °ú¿ô
+ 1 enc: ÂоÝʸ»ú¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
+ 2 what: ¥á¥¿Ê¸»úµ¡Ç½¤Î»ØÄê
+
+ ONIG_META_CHAR_ESCAPE
+ ONIG_META_CHAR_ANYCHAR
+ ONIG_META_CHAR_ANYTIME
+ ONIG_META_CHAR_ZERO_OR_ONE_TIME
+ ONIG_META_CHAR_ONE_OR_MORE_TIME
+ ONIG_META_CHAR_ANYCHAR_ANYTIME
+
+ 3 code: ¥á¥¿Ê¸»ú¤Î¥³¡¼¥É¥Ý¥¤¥ó¥È ¤Þ¤¿¤Ï ONIG_INEFFECTIVE_META_CHAR.
+
+
+# OnigAmbigType onig_get_default_ambig_flag()
+
+ ¥Ç¥Õ¥©¥ë¥È¤ÎÛ£Ëæ¥Þ¥Ã¥Á¥Õ¥é¥°¤ò¼èÆÀ¤¹¤ë¡£
+
+
+# int onig_set_default_ambig_flag(OnigAmbigType ambig_flag)
+
+ ¥Ç¥Õ¥©¥ë¥È¤ÎÛ£Ëæ¥Þ¥Ã¥Á¥Õ¥é¥°¤ò¥»¥Ã¥È¤¹¤ë¡£
+
+ °ú¿ô
+ 1 ambig_flag: Û£Ëæ¥Þ¥Ã¥Á¥Õ¥é¥°
+
+
+# unsigned int onig_get_match_stack_limit_size(void)
+
+ ¥Þ¥Ã¥Á¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤ÎºÇÂçÃͤòÊÖ¤¹¡£
+ (¥Ç¥Õ¥©¥ë¥È: 0 == ̵À©¸Â)
+
+
+# int onig_set_match_stack_limit_size(unsigned int size)
+
+ ¥Þ¥Ã¥Á¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤ÎºÇÂçÃͤò»ØÄꤹ¤ë¡£
+ (size = 0: ̵À©¸Â)
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: ONIG_NORMAL
+
+
+# int onig_end(void)
+
+ ¥é¥¤¥Ö¥é¥ê¤Î»ÈÍѤò½ªÎ»¤¹¤ë¡£
+
+ Àµ¾ï½ªÎ»Ìá¤êÃÍ: ONIG_NORMAL
+
+ onig_init()¤òºÆÅٸƤӽФ·¤Æ¤â¡¢°ÊÁ°¤ËºîÀ®¤·¤¿Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È
+ ¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£
+
+
+# const char* onig_version(void)
+
+ ¥Ð¡¼¥¸¥ç¥óʸ»úÎó¤òÊÖ¤¹¡£(Îã "2.2.8")
+
+// END
diff --git a/ext/mbstring/oniguruma/doc/FAQ b/ext/mbstring/oniguruma/doc/FAQ
new file mode 100644
index 000000000..1621a359e
--- /dev/null
+++ b/ext/mbstring/oniguruma/doc/FAQ
@@ -0,0 +1,33 @@
+FAQ 2006/05/15
+
+1. Lognest match
+
+ You can execute longest match by using ONIG_OPTION_FIND_LONGEST option
+ in onig_new().
+
+
+2. Thread safe
+
+ In order to make thread safe, which of (A) or (B) must be done.
+
+ (A) Oniguruma Layer
+
+ Define the macro below at NOT_RUBY case in oniguruma/regint.h.
+
+ USE_MULTI_THREAD_SYSTEM
+ THREAD_ATOMIC_START
+ THREAD_ATOMIC_END
+ THREAD_PASS
+
+ (B) Application Layer
+
+ The plural threads should not do simultaneously that making
+ new regexp objects or re-compiling objects or freeing objects,
+ even if these objects are differ.
+
+
+3. Mailing list
+
+ There is no mailing list about Oniguruma.
+
+// END
diff --git a/ext/mbstring/oniguruma/doc/FAQ.ja b/ext/mbstring/oniguruma/doc/FAQ.ja
new file mode 100644
index 000000000..5f61b0955
--- /dev/null
+++ b/ext/mbstring/oniguruma/doc/FAQ.ja
@@ -0,0 +1,115 @@
+FAQ 2006/05/15
+
+1. ºÇĹ¥Þ¥Ã¥Á
+
+ onig_new()¤ÎÃæ¤Ç¡¢ONIG_OPTION_FIND_LONGEST¥ª¥×¥·¥ç¥ó
+ ¤ò»ÈÍѤ¹¤ì¤ÐºÇĹ¥Þ¥Ã¥Á¤Ë¤Ê¤ë¡£
+
+
+2. ¥¹¥ì¥Ã¥É¥»¡¼¥Õ
+
+ ¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ë¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤Î(A)¤È(B)¤Î¤É¤Á¤é¤«¤ò¹Ô¤Ê¤¨¤Ð
+ ¤è¤¤¡£
+
+ (A) Oniguruma Layer
+
+ oniguruma/regint.h¤ÎÃæ¤ÎNOT_RUBY¤ÎÉôʬ¤Î°Ê²¼¤Î¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë¡£
+
+ USE_MULTI_THREAD_SYSTEM
+ THREAD_ATOMIC_START
+ THREAD_ATOMIC_END
+ THREAD_PASS
+
+ (B) Application Layer
+
+ Ʊ»þ¤ËÊ£¿ô¤Î¥¹¥ì¥Ã¥É¤¬¡¢Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤¹¤ë¡¢
+ ¤Þ¤¿¤Ï²òÊü¤¹¤ë¡¢¤³¤È¤ò¹Ô¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
+ ¤½¤ì¤é¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬Á´¤¯Ê̤Τâ¤Î¤Ç¤¢¤Ã¤Æ¤â¡£
+
+ ¤â¤¦¾¯¤·¾Ü¤·¤¤ÀâÌÀ¤Ï¡¢¤³¤Î¥É¥­¥å¥á¥ó¥È¤ÎÃæ¤Î
+ "¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ë´Ø¤¹¤ëÊä­"¤Ë½ñ¤¤¤Æ¤ª¤¤¤¿¡£
+
+
+3. ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È
+
+ µ´¼Ö¤Ë´Ø¤¹¤ë¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Ï¸ºß¤·¤Ê¤¤¡£
+
+//END
+
+
+
+¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ë´Ø¤¹¤ëÊä­
+
+¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ë¤¹¤ë¤Ë¤Ï¡¢¸ÄÊ̤Υ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÃæ¤Ç¹Ô¤¦¤«¡¢
+Oniguruma¥é¥¤¥Ö¥é¥ê¤ÎÃæ¤Ç¹Ô¤¦¤«¡¢¤É¤Á¤é¤«¤òÁª¤Ö¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+(Oniguruma¤ò»ÈÍѤ¹¤ë¦¤ÇÂн褹¤ë¤«¡¢Oniguruma¤ËÂн褵¤»¤ë¤«
+¤É¤Á¤é¤«ÊÒÊý¤Ç¹Ô¤¦É¬Íפ¬¤¢¤ë¤È¤¤¤¦¤³¤È¤Ç¤¹¡£)
+
+¤³¤ì¤é¤ÎÊýË¡¤Ë¤Ä¤¤¤Æ¡¢°Ê²¼(A)¤È(B)¤ÇÀâÌÀ¤·¤Þ¤¹¡£
+
+¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉAPI¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ë¤è¤Ã¤Æ¤â
+°Û¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢°Ê²¼¤ÎÀâÌÀ¤ÎÃæ¤Ç¶ñÂÎŪ¤Ë²¿¤ò¸Æ¤Ö¤Î¤«¤ò
+½ñ¤¯¤³¤È¤Ï̵Íý¤Ç¤¹¡£¼ÂºÝ¤Ë»ÈÍѤµ¤ì¤ë¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉAPI¤Ç¡¢
+Âбþ¤¹¤ëµ¡Ç½¤Î¤â¤Î¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
+
+(A) Oniguruma¤ÎÃæ¤ÇÂбþ¤¹¤ë¾ì¹ç
+
+oniguruma/regint.h¤ÎÃæ¤ÎNOT_RUBY¤Ç°Ï¤Þ¤ì¤Æ¤¤¤ëÉôʬ¤ÎÃæ¤Ç
+°Ê²¼¤Î¥Þ¥¯¥í¤òÄêµÁ¤·¤ÆºÆ¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+USE_MULTI_THREAD_SYSTEM
+
+ ñ¤ËÍ­¸ú¤Ë¤¹¤ì¤Ð¤è¤¤¤Ç¤¹¡£
+
+THREAD_ATOMIC_START
+THREAD_ATOMIC_END
+
+ THREAD_ATOMIC_START¤«¤éTHREAD_ATOMIC_END¤Ç°Ï¤Þ¤ì¤¿
+ ¥×¥í¥°¥é¥à¤Î¥³¡¼¥ÉÉôʬ¤ò¤¢¤ë¥¹¥ì¥Ã¥É¤¬¼Â¹ÔÃæ¤Ë¡¢Â¾¤Î
+ ¥¹¥ì¥Ã¥É¤Ë¼Â¹Ô¸¢¤¬°ÜÆ°¤·¤Ê¤¤¤³¤È¤òÊݾ㤹¤ë¤â¤Î¤ËÄêµÁ
+ ¤·¤Æ¤¯¤À¤µ¤¤¡£
+ (̾Á°¤ÎÄ̤ꡢ°Ï¤Þ¤ì¤¿¥³¡¼¥ÉÉôʬ¤ò¥¹¥ì¥Ã¥É¥¢¥È¥ß¥Ã¥¯¤Ë
+ ¤¹¤ë¤È¤¤¤¦°ÕÌ£)
+
+THREAD_PASS
+
+ ¤³¤ì¤ò¼Â¹Ô¤·¤¿¥¹¥ì¥Ã¥É¤«¤é¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤Ë¼Â¹Ô¸¢¤ò°Ñ¾ù
+ ¤¹¤ë¤â¤Î¤ËÄêµÁ¤ò¤·¤Æ¤¯¤À¤µ¤¤¡£(ºÆ¥¹¥±¥¸¥å¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹
+ ¤È¤¤¤¦°ÕÌ£)
+ Âбþ¤¹¤ëµ¡Ç½¤¬Á´¤¯¤Ê¤±¤ì¤Ð¡¢¶õÄêµÁ¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+(»²¹ÍÎã)
+Ruby¤Î¾ì¹ç¤òÎã¤Ë¤¹¤ë¤È¡¢
+Ruby¤Ï¼«Ê¬¼«¿È¤ÇÆȼ«¤Î¥¹¥ì¥Ã¥Éµ¡Ç½¤ò¼ÂÁõ¤·¤Æ¤¤¤Þ¤¹¡£
+¤½¤Îµ¡Ç½¤ò»ÈÍѤ¹¤ë¤È¡¢°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤¹¤ì¤Ð¤è¤¤¤³¤È¤Ë
+¤Ê¤ê¤Þ¤¹¡£
+
+#define USE_MULTI_THREAD_SYSTEM
+#define THREAD_ATOMIC_START DEFER_INTS
+#define THREAD_ATOMIC_END ENABLE_INTS
+#define THREAD_PASS rb_thread_schedule()
+
+Ruby¤Î¾ì¹ç¡¢¥¿¥¤¥Þ³ä¤ê¹þ¤ß¤ò»ÈÍѤ·¤Æ¡¢¥¹¥ì¥Ã¥É¤ÎÀÚ¤êÂؤ¨¤ò
+¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£DEFER_INTS¤Ï³ä¤ê¹þ¤ß¥Ï¥ó¥É¥é¤Î¼Â¹Ô¤ò°ì»þŪ¤Ë
+»ß¤á¤ë¤¿¤á¤Î¥Þ¥¯¥í¤Ç¤¹¡£ENABLE_INTS¥Þ¥¯¥í¤Ç³ä¤ê¹þ¤ß¥Ï¥ó¥É¥é
+¤Î¼Â¹Ô¤òµö²Ä¤·¤Þ¤¹¡£
+¤³¤ì¤Ë¤è¤Ã¤Æ¡¢THREAD_ATOMIC_START¤«¤éTHREAD_ATOMIC_END
+¤Ç°Ï¤Þ¤ì¤¿Éôʬ¤Î¼Â¹ÔÃæ¤Ë¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤Ë¼Â¹Ô¸¢¤¬°ÜÆ°¤·¤Þ¤»¤ó¡£
+
+
+(B) ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÃæ¤ÇÂбþ¤¹¤ë¾ì¹ç
+
+°Ê²¼¤òÊݾ㤹¤ë¤è¤¦¤Ë¡¢¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤òÀ©¸æ¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+Ʊ»þ¤ËÊ£¿ô¤Î¥¹¥ì¥Ã¥É¤¬¡¢Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤¹¤ë¡¢¤Þ¤¿¤Ï²òÊü¤¹¤ë¡¢¤³¤È¤ò
+¹Ô¤Ê¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¤½¤ì¤é¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬Á´¤¯Ê̤Τâ¤Î¤Ç¤¢¤Ã¤Æ¤â¡£
+
+onig_new(), onig_new_deluxe(), onig_free()¤Î¤É¤ì¤«¤Î¸Æ¤Ó½Ð¤·¤ò¡¢
+Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤¬Æ±»þ¤Ë¼Â¹Ô¤¹¤ë¤³¤È¤òÈò¤±¤Æ¤¯¤À¤µ¤¤¡£Æ±»þ¤Ç¤Ê¤±¤ì¤ÐÊ̤ˤ«¤Þ¤¤¤Þ¤»¤ó¡£
+
+¤³¤ì¤Ï²¿¸ÎɬÍפʤΤ«¤È¤¤¤¦¤È¡¢Àµµ¬É½¸½¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤¹¤ë
+²áÄø¤Ç¡¢ÆâÉô¤Ç¶¦Ä̤˻²¾È¤¹¤ë¥Æ¡¼¥Ö¥ë¤¬¤¢¤ê¤Þ¤¹¡£
+¤³¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¤Î¥Ç¡¼¥¿ÅÐÏ¿½èÍý¤¬Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤Ç¾×Æͤ·¤Æ
+°Û¾ï¤Ê¾õÂ֤ˤʤé¤Ê¤¤¤¿¤á¤ËɬÍפǤ¹¡£
+
+// END
diff --git a/ext/mbstring/oniguruma/doc/RE b/ext/mbstring/oniguruma/doc/RE
new file mode 100644
index 000000000..5a2783d16
--- /dev/null
+++ b/ext/mbstring/oniguruma/doc/RE
@@ -0,0 +1,412 @@
+Oniguruma Regular Expressions Version 4.3.0 2006/08/17
+
+syntax: ONIG_SYNTAX_RUBY (default)
+
+
+1. Syntax elements
+
+ \ escape (enable or disable meta character meaning)
+ | alternation
+ (...) group
+ [...] character class
+
+
+2. Characters
+
+ \t horizontal tab (0x09)
+ \v vertical tab (0x0B)
+ \n newline (0x0A)
+ \r return (0x0D)
+ \b back space (0x08)
+ \f form feed (0x0C)
+ \a bell (0x07)
+ \e escape (0x1B)
+ \nnn octal char (encoded byte value)
+ \xHH hexadecimal char (encoded byte value)
+ \x{7HHHHHHH} wide hexadecimal char (character code point value)
+ \cx control char (character code point value)
+ \C-x control char (character code point value)
+ \M-x meta (x|0x80) (character code point value)
+ \M-\C-x meta control char (character code point value)
+
+ (* \b is effective in character class [...] only)
+
+
+3. Character types
+
+ . any character (except newline)
+
+ \w word character
+
+ Not Unicode:
+ alphanumeric, "_" and multibyte char.
+
+ Unicode:
+ General_Category -- (Letter|Mark|Number|Connector_Punctuation)
+
+ \W non word char
+
+ \s whitespace char
+
+ Not Unicode:
+ \t, \n, \v, \f, \r, \x20
+
+ Unicode:
+ 0009, 000A, 000B, 000C, 000D, 0085(NEL),
+ General_Category -- Line_Separator
+ -- Paragraph_Separator
+ -- Space_Separator
+
+ \S non whitespace char
+
+ \d decimal digit char
+
+ Unicode: General_Category -- Decimal_Number
+
+ \D non decimal digit char
+
+ \h hexadecimal digit char [0-9a-fA-F]
+
+ \H non hexadecimal digit char
+
+
+4. Quantifier
+
+ greedy
+
+ ? 1 or 0 times
+ * 0 or more times
+ + 1 or more times
+ {n,m} at least n but not more than m times
+ {n,} at least n times
+ {,n} at least 0 but not more than n times ({0,n})
+ {n} n times
+
+ reluctant
+
+ ?? 1 or 0 times
+ *? 0 or more times
+ +? 1 or more times
+ {n,m}? at least n but not more than m times
+ {n,}? at least n times
+ {,n}? at least 0 but not more than n times (== {0,n}?)
+
+ possessive (greedy and does not backtrack after repeated)
+
+ ?+ 1 or 0 times
+ *+ 0 or more times
+ ++ 1 or more times
+
+ ({n,m}+, {n,}+, {n}+ are possessive op. in ONIG_SYNTAX_JAVA only)
+
+ ex. /a*+/ === /(?>a*)/
+
+
+5. Anchors
+
+ ^ beginning of the line
+ $ end of the line
+ \b word boundary
+ \B not word boundary
+ \A beginning of string
+ \Z end of string, or before newline at the end
+ \z end of string
+ \G matching start position (*)
+
+ * Ruby Regexp:
+ previous end-of-match position
+ (This specification is not related to this library.)
+
+
+6. Character class
+
+ ^... negative class (lowest precedence operator)
+ x-y range from x to y
+ [...] set (character class in character class)
+ ..&&.. intersection (low precedence at the next of ^)
+
+ ex. [a-w&&[^c-g]z] ==> ([a-w] AND ([^c-g] OR z)) ==> [abh-w]
+
+ * If you want to use '[', '-', ']' as a normal character
+ in a character class, you should escape these characters by '\'.
+
+
+ POSIX bracket ([:xxxxx:], negate [:^xxxxx:])
+
+ Not Unicode Case:
+
+ alnum alphabet or digit char
+ alpha alphabet
+ ascii code value: [0 - 127]
+ blank \t, \x20
+ cntrl
+ digit 0-9
+ graph include all of multibyte encoded characters
+ lower
+ print include all of multibyte encoded characters
+ punct
+ space \t, \n, \v, \f, \r, \x20
+ upper
+ xdigit 0-9, a-f, A-F
+
+
+ Unicode Case:
+
+ alnum Letter | Mark | Decimal_Number
+ alpha Letter | Mark
+ ascii 0000 - 007F
+ blank Space_Separator | 0009
+ cntrl Control | Format | Unassigned | Private_Use | Surrogate
+ digit Decimal_Number
+ graph [[:^space:]] && ^Control && ^Unassigned && ^Surrogate
+ lower Lowercase_Letter
+ print [[:graph:]] | [[:space:]]
+ punct Connector_Punctuation | Dash_Punctuation | Close_Punctuation |
+ Final_Punctuation | Initial_Punctuation | Other_Punctuation |
+ Open_Punctuation
+ space Space_Separator | Line_Separator | Paragraph_Separator |
+ 0009 | 000A | 000B | 000C | 000D | 0085
+ upper Uppercase_Letter
+ xdigit 0030 - 0039 | 0041 - 0046 | 0061 - 0066
+ (0-9, a-f, A-F)
+
+
+7. Extended groups
+
+ (?#...) comment
+
+ (?imx-imx) option on/off
+ i: ignore case
+ m: multi-line (dot(.) match newline)
+ x: extended form
+ (?imx-imx:subexp) option on/off for subexp
+
+ (?:subexp) not captured group
+ (subexp) captured group
+
+ (?=subexp) look-ahead
+ (?!subexp) negative look-ahead
+ (?<=subexp) look-behind
+ (?<!subexp) negative look-behind
+
+ Subexp of look-behind must be fixed character length.
+ But different character length is allowed in top level
+ alternatives only.
+ ex. (?<=a|bc) is OK. (?<=aaa(?:b|cd)) is not allowed.
+
+ In negative-look-behind, captured group isn't allowed,
+ but shy group(?:) is allowed.
+
+ (?>subexp) atomic group
+ don't backtrack in subexp.
+
+ (?<name>subexp) define named group
+ (All characters of the name must be a word character.
+ And first character must not be a digit or uppper case)
+
+ Not only a name but a number is assigned like a captured
+ group.
+
+ Assigning the same name as two or more subexps is allowed.
+ In this case, a subexp call can not be performed although
+ the back reference is possible.
+
+
+8. Back reference
+
+ \n back reference by group number (n >= 1)
+ \k<name> back reference by group name
+
+ In the back reference by the multiplex definition name,
+ a subexp with a large number is referred to preferentially.
+ (When not matched, a group of the small number is referred to.)
+
+ * Back reference by group number is forbidden if named group is defined
+ in the pattern and ONIG_OPTION_CAPTURE_GROUP is not setted.
+
+
+ back reference with nest level
+
+ (This function is disabled in Ruby 1.9.)
+
+ \k<name+n> n: 0, 1, 2, ...
+ \k<name-n> n: 0, 1, 2, ...
+
+ Destinate relative nest level from back reference position.
+
+ ex 1.
+
+ /\A(?<a>|.|(?:(?<b>.)\g<a>\k<b+0>))\z/.match("reer")
+
+ ex 2.
+
+ r = Regexp.compile(<<'__REGEXP__'.strip, Regexp::EXTENDED)
+ (?<element> \g<stag> \g<content>* \g<etag> ){0}
+ (?<stag> < \g<name> \s* > ){0}
+ (?<name> [a-zA-Z_:]+ ){0}
+ (?<content> [^<&]+ (\g<element> | [^<&]+)* ){0}
+ (?<etag> </ \k<name+1> >){0}
+ \g<element>
+ __REGEXP__
+
+ p r.match('<foo>f<bar>bbb</bar>f</foo>').captures
+
+
+
+9. Subexp call ("Tanaka Akira special")
+
+ \g<name> call by group name
+ \g<n> call by group number (n >= 1)
+
+ * left-most recursive call is not allowed.
+ ex. (?<name>a|\g<name>b) => error
+ (?<name>a|b\g<name>c) => OK
+
+ * Call by group number is forbidden if named group is defined in the pattern
+ and ONIG_OPTION_CAPTURE_GROUP is not setted.
+
+ * If the option status of called group is different from calling position
+ then the group's option is effective.
+
+ ex. (?-i:\g<name>)(?i:(?<name>a)){0} match to "A"
+
+
+10. Captured group
+
+ Behavior of the no-named group (...) changes with the following conditions.
+ (But named group is not changed.)
+
+ case 1. /.../ (named group is not used, no option)
+
+ (...) is treated as a captured group.
+
+ case 2. /.../g (named group is not used, 'g' option)
+
+ (...) is treated as a no-captured group (?:...).
+
+ case 3. /..(?<name>..)../ (named group is used, no option)
+
+ (...) is treated as a no-captured group (?:...).
+ numbered-backref/call is not allowed.
+
+ case 4. /..(?<name>..)../G (named group is used, 'G' option)
+
+ (...) is treated as a captured group.
+ numbered-backref/call is allowed.
+
+ where
+ g: ONIG_OPTION_DONT_CAPTURE_GROUP
+ G: ONIG_OPTION_CAPTURE_GROUP
+
+ ('g' and 'G' options are argued in ruby-dev ML)
+
+ These options are not implemented in Ruby level.
+
+
+-----------------------------
+A-1. Syntax depend options
+
+ + ONIG_SYNTAX_RUBY
+ (?m): dot(.) match newline
+
+ + ONIG_SYNTAX_PERL and ONIG_SYNTAX_JAVA
+ (?s): dot(.) match newline
+ (?m): ^ match after newline, $ match before newline
+
+
+A-2. Original extensions
+
+ + hexadecimal digit char type \h, \H
+ + named group (?<name>...)
+ + named backref \k<name>
+ + subexp call \g<name>, \g<group-num>
+
+
+A-3. Lacked features compare with perl 5.8.0
+
+ + [:word:]
+ + \N{name}
+ + \l,\u,\L,\U, \X, \C
+ + (?{code})
+ + (??{code})
+ + (?(condition)yes-pat|no-pat)
+
+ * \Q...\E
+ This is effective on ONIG_SYNTAX_PERL and ONIG_SYNTAX_JAVA.
+
+ * \p{property}, \P{property}
+ This is effective on ONIG_SYNTAX_PERL and ONIG_SYNTAX_JAVA.
+ Alnum, Alpha, Blank, Cntrl, Digit, Graph, Lower,
+ Print, Punct, Space, Upper, XDigit, ASCII are supported.
+
+ Prefix 'Is' of property name is allowed in ONIG_SYNTAX_PERL only.
+ ex. \p{IsXDigit}.
+
+ Negation operator of property is supported in ONIG_SYNTAX_PERL only.
+ \p{^...}, \P{^...}
+
+
+A-4. Differences with Japanized GNU regex(version 0.12) of Ruby
+
+ + add hexadecimal digit char type (\h, \H)
+ + add look-behind
+ (?<=fixed-char-length-pattern), (?<!fixed-char-length-pattern)
+ + add possessive quantifier. ?+, *+, ++
+ + add operations in character class. [], &&
+ ('[' must be escaped as an usual char in character class.)
+ + add named group and subexp call.
+ + octal or hexadecimal number sequence can be treated as
+ a multibyte code char in character class if multibyte encoding
+ is specified.
+ (ex. [\xa1\xa2], [\xa1\xa7-\xa4\xa1])
+ + allow the range of single byte char and multibyte char in character
+ class.
+ ex. /[a-<<any EUC-JP character>>]/ in EUC-JP encoding.
+ + effect range of isolated option is to next ')'.
+ ex. (?:(?i)a|b) is interpreted as (?:(?i:a|b)), not (?:(?i:a)|b).
+ + isolated option is not transparent to previous pattern.
+ ex. a(?i)* is a syntax error pattern.
+ + allowed incompleted left brace as an usual string.
+ ex. /{/, /({)/, /a{2,3/ etc...
+ + negative POSIX bracket [:^xxxx:] is supported.
+ + POSIX bracket [:ascii:] is added.
+ + repeat of look-ahead is not allowed.
+ ex. /(?=a)*/, /(?!b){5}/
+ + Ignore case option is effective to numbered character.
+ ex. /\x61/i =~ "A"
+ + In the range quantifier, the number of the minimum is omissible.
+ /a{,n}/ == /a{0,n}/
+ The simultanious abbreviation of the number of times of the minimum
+ and the maximum is not allowed. (/a{,}/)
+ + /a{n}?/ is not a non-greedy operator.
+ /a{n}?/ == /(?:a{n})?/
+ + invalid back reference is checked and cause error.
+ /\1/, /(a)\2/
+ + Zero-length match in infinite repeat stops the repeat,
+ then changes of the capture group status are checked as stop condition.
+ /(?:()|())*\1\2/ =~ ""
+ /(?:\1a|())*/ =~ "a"
+
+
+A-5. Disabled functions by default syntax
+
+ + capture history
+
+ (?@...) and (?@<name>...)
+
+ ex. /(?@a)*/.match("aaa") ==> [<0-1>, <1-2>, <2-3>]
+
+ see sample/listcap.c file.
+
+
+A-6. Problems
+
+ + Invalid encoding byte sequence is not checked in UTF-8.
+
+ * Invalid first byte is treated as a character.
+ /./u =~ "\xa3"
+
+ * Incomplete byte sequence is not checked.
+ /\w+/ =~ "a\xf3\x8ec"
+
+// END
diff --git a/ext/mbstring/oniguruma/doc/RE.ja b/ext/mbstring/oniguruma/doc/RE.ja
new file mode 100644
index 000000000..51681715c
--- /dev/null
+++ b/ext/mbstring/oniguruma/doc/RE.ja
@@ -0,0 +1,424 @@
+µ´¼Ö Àµµ¬É½¸½ Version 4.3.0 2006/08/17
+
+»ÈÍÑʸˡ: ONIG_SYNTAX_RUBY (´ûÄêÃÍ)
+
+
+1. ´ðËÜÍ×ÁÇ
+
+ \ ÂàÈò½¤¾þ (¥¨¥¹¥±¡¼¥×) Àµµ¬É½¸½µ­¹æ¤ÎÍ­¸ú/̵¸ú¤ÎÀ©¸æ
+ | ÁªÂò»Ò
+ (...) ¼°½¸¹ç (¥°¥ë¡¼¥×)
+ [...] ʸ»ú½¸¹ç (ʸ»ú¥¯¥é¥¹)
+
+
+2. ʸ»ú
+
+ \t ¿åÊ¿¥¿¥Ö (0x09)
+ \v ¿âľ¥¿¥Ö (0x0B)
+ \n ²þ¹Ô (0x0A)
+ \r Éüµ¢ (0x0D)
+ \b ¸åÂà¶õÇò (0x08)
+ \f ²þÊÇ (0x0C)
+ \a ¾â (0x07)
+ \e ÂàÈò½¤¾þ (0x1B)
+ \nnn Ȭ¿Ê¿ôɽ¸½ Éä¹æ²½¥Ð¥¤¥ÈÃÍ(¤Î°ìÉô)
+ \xHH ½½Ï»¿Ê¿ôɽ¸½ Éä¹æ²½¥Ð¥¤¥ÈÃÍ(¤Î°ìÉô)
+ \x{7HHHHHHH} ³ÈÄ¥½½Ï»¿Ê¿ôɽ¸½ ¥³¡¼¥É¥Ý¥¤¥ó¥ÈÃÍ
+ \cx À©¸æʸ»úɽ¸½ ¥³¡¼¥É¥Ý¥¤¥ó¥ÈÃÍ
+ \C-x À©¸æʸ»úɽ¸½ ¥³¡¼¥É¥Ý¥¤¥ó¥ÈÃÍ
+ \M-x Ķ (x|0x80) ¥³¡¼¥É¥Ý¥¤¥ó¥ÈÃÍ
+ \M-\C-x Ķ + À©¸æʸ»úɽ¸½ ¥³¡¼¥É¥Ý¥¤¥ó¥ÈÃÍ
+
+ ¢¨ \b¤Ï¡¢Ê¸»ú½¸¹çÆâ¤Ç¤Î¤ßÍ­¸ú
+
+
+3. ʸ»ú¼ï
+
+ . Ǥ°Õʸ»ú (²þ¹Ô¤ò½ü¤¯)
+
+ \w ñ¸ì¹½À®Ê¸»ú
+
+ Unicode°Ê³°¤Î¾ì¹ç:
+ ±Ñ¿ô»ú, "_" ¤ª¤è¤Ó ¿¥Ð¥¤¥Èʸ»ú¡£
+
+ Unicode¤Î¾ì¹ç:
+ General_Category -- (Letter|Mark|Number|Connector_Punctuation)
+
+ \W Èóñ¸ì¹½À®Ê¸»ú
+
+ \s ¶õÇòʸ»ú
+
+ Unicode°Ê³°¤Î¾ì¹ç:
+ \t, \n, \v, \f, \r, \x20
+
+ Unicode¤Î¾ì¹ç:
+ 0009, 000A, 000B, 000C, 000D, 0085(NEL),
+ General_Category -- Line_Separator
+ -- Paragraph_Separator
+ -- Space_Separator
+
+ \S Èó¶õÇòʸ»ú
+
+ \d 10¿Ê¿ô»ú
+
+ Unicode¤Î¾ì¹ç: General_Category -- Decimal_Number
+
+ \D Èó10¿Ê¿ô»ú
+
+ \h 16¿Ê¿ô»ú [0-9a-fA-F]
+
+ \H Èó16¿Ê¿ô»ú
+
+
+
+4. ÎÌ»ØÄê»Ò
+
+ ÍßÄ¥¤ê
+
+ ? °ì²ó¤Þ¤¿¤ÏÎí²ó
+ * Îí²ó°Ê¾å
+ + °ì²ó°Ê¾å
+ {n,m} n²ó°Ê¾åm²ó°Ê²¼
+ {n,} n²ó°Ê¾å
+ {,n} Îí²ó°Ê¾ån²ó°Ê²¼ ({0,n})
+ {n} n²ó
+
+ ̵Íß
+
+ ?? °ì²ó¤Þ¤¿¤ÏÎí²ó
+ *? Îí²ó°Ê¾å
+ +? °ì²ó°Ê¾å
+ {n,m}? n²ó°Ê¾åm²ó°Ê²¼
+ {n,}? n²ó°Ê¾å
+ {,n}? Îí²ó°Ê¾ån²ó°Ê²¼ (== {0,n}?)
+
+ ¶¯Íß (ÍßÄ¥¤ê¤Ç¡¢·«¤êÊÖ¤·¤ËÀ®¸ù¤·¤¿¸å¤Ï²ó¿ô¤ò¸º¤é¤¹¤è¤¦¤Ê¸åÂàºÆ»î¹Ô¤ò¤·¤Ê¤¤)
+
+ ?+ °ì²ó¤Þ¤¿¤ÏÎí²ó
+ *+ Îí²ó°Ê¾å
+ ++ °ì²ó°Ê¾å
+
+ ({n,m}+, {n,}+, {n}+ ¤Ï¡¢ONIG_SYNTAX_JAVA¤Ç¤Î¤ß¶¯ÍߤʻØÄê»Ò)
+
+ Îã. /a*+/ === /(?>a*)/
+
+
+5. ÉÅ
+
+ ^ ¹ÔƬ
+ $ ¹ÔËö
+ \b ñ¸ì¶­³¦
+ \B Èóñ¸ì¶­³¦
+ \A ʸ»úÎóÀèƬ
+ \Z ʸ»úÎóËöÈø¡¢¤Þ¤¿¤Ïʸ»úÎóËöÈø¤Î²þ¹Ô¤ÎľÁ°
+ \z ʸ»úÎóËöÈø
+ \G ¾È¹ç³«»Ï°ÌÃÖ(*)
+
+ * Ruby Regexp:
+ Á°²ó¾È¹çÀ®¸ùËöÈø°ÌÃÖ
+ (¤³¤Î»ÅÍͤÏRuby¤Î¼ÂÁõ¤Ë´Ø¤¹¤ë¤â¤Î¤Ç¤¢¤ê¡¢
+ Àµµ¬É½¸½¥é¥¤¥Ö¥é¥ê¤È¤Ï̵´Ø·¸)
+
+
+6. ʸ»ú½¸¹ç
+
+ ^... ÈÝÄê (ºÇÄãÍ¥ÀèÅٱ黻»Ò)
+ x-y ÈÏ°Ï (x¤«¤éy¤Þ¤Ç)
+ [...] ½¸¹ç (ʸ»ú½¸¹çÆâʸ»ú½¸¹ç)
+ ..&&.. Àѱ黻 (^¤Î¼¡¤ËÍ¥ÀèÅÙ¤¬Ä㤤±é»»»Ò)
+
+ Îã. [a-w&&[^c-g]z] ==> ([a-w] and ([^c-g] or z)) ==> [abh-w]
+
+ ¢¨ '[', '-', ']'¤ò¡¢Ê¸»ú½¸¹çÆâ¤ÇÄ̾ïʸ»ú¤Î°ÕÌ£¤Ç»ÈÍѤ·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢
+ ¤³¤ì¤é¤Îʸ»ú¤ò'\'¤ÇÂàÈò½¤¾þ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
+
+
+ POSIX¥Ö¥é¥±¥Ã¥È ([:xxxxx:], ÈÝÄê [:^xxxxx:])
+
+ Unicode°Ê³°¤Î¾ì¹ç:
+
+ alnum ±Ñ¿ô»ú
+ alpha 񥯣
+ ascii 0 - 127
+ blank \t, \x20
+ cntrl
+ digit 0-9
+ graph ¿¥Ð¥¤¥Èʸ»úÁ´Éô¤ò´Þ¤à
+ lower
+ print ¿¥Ð¥¤¥Èʸ»úÁ´Éô¤ò´Þ¤à
+ punct
+ space \t, \n, \v, \f, \r, \x20
+ upper
+ xdigit 0-9, a-f, A-F
+
+ Unicode¤Î¾ì¹ç:
+
+ alnum Letter | Mark | Decimal_Number
+ alpha Letter | Mark
+ ascii 0000 - 007F
+ blank Space_Separator | 0009
+ cntrl Control | Format | Unassigned | Private_Use | Surrogate
+ digit Decimal_Number
+ graph [[:^space:]] && ^Control && ^Unassigned && ^Surrogate
+ lower Lowercase_Letter
+ print [[:graph:]] | [[:space:]]
+ punct Connector_Punctuation | Dash_Punctuation | Close_Punctuation |
+ Final_Punctuation | Initial_Punctuation | Other_Punctuation |
+ Open_Punctuation
+ space Space_Separator | Line_Separator | Paragraph_Separator |
+ 0009 | 000A | 000B | 000C | 000D | 0085
+ upper Uppercase_Letter
+ xdigit 0030 - 0039 | 0041 - 0046 | 0061 - 0066
+ (0-9, a-f, A-F)
+
+
+7. ³ÈÄ¥¼°½¸¹ç
+
+ (?#...) Ãí¼á
+ (?imx-imx) ¸ÉΩ¥ª¥×¥·¥ç¥ó
+ i: Âçʸ»ú¾®Ê¸»ú¾È¹ç
+ m: Ê£¿ô¹Ô
+ x: ³ÈÄ¥·Á¼°
+ (?imx-imx:¼°) ¼°¥ª¥×¥·¥ç¥ó
+
+ (¼°) Êá³Í¼°½¸¹ç
+ (?:¼°) ÈóÊá³Í¼°½¸¹ç
+
+ (?=¼°) ÀèÆɤß
+ (?!¼°) ÈÝÄêÀèÆɤß
+ (?<=¼°) Ìá¤êÆɤß
+ (?<!¼°) ÈÝÄêÌá¤êÆɤß
+
+ Ìá¤êÆɤߤμ°¤Ï¸ÇÄêʸ»úĹ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
+ ¤·¤«¤·¡¢ºÇ¾å°Ì¤ÎÁªÂò»Ò¤À¤±¤Ï°Û¤Ê¤Ã¤¿Ê¸»úŤ¬µö¤µ¤ì¤ë¡£
+ Îã. (?<=a|bc) ¤Ïµö²Ä. (?<=aaa(?:b|cd)) ¤ÏÉÔµö²Ä
+
+ ÈÝÄêÌá¤êÆɤߤǤϡ¢Êá³Í¼°½¸¹ç¤Ïµö¤µ¤ì¤Ê¤¤¤¬¡¢
+ ÈóÊá³Í¼°½¸¹ç¤Ïµö¤µ¤ì¤ë¡£
+
+ (?>¼°) ¸¶»ÒŪ¼°½¸¹ç
+ ¼°Á´ÂΤòÄ̲ᤷ¤¿¤È¤­¡¢¼°¤ÎÃæ¤Ç¤Î¸åÂàºÆ»î¹Ô¤ò¹Ô¤Ê¤ï¤Ê¤¤
+
+ (?<name>¼°) ̾Á°ÉÕ¤­Êá³Í¼°½¸¹ç
+ ¼°½¸¹ç¤Ë̾Á°¤ò³ä¤êÅö¤Æ¤ë(ÄêµÁ¤¹¤ë)¡£
+ (̾Á°¤Ïñ¸ì¹½À®Ê¸»ú¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ºÇ½é¤Îʸ»ú¤Ï
+ ±ÑÂçʸ»ú¤Ç¤¢¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£)
+
+ ̾Á°¤À¤±¤Ç¤Ê¤¯¡¢Êá³Í¼°½¸¹ç¤ÈƱÍͤËÈÖ¹æ¤â³ä¤êÅö¤Æ¤é¤ì¤ë¡£
+ ÈÖ¹æ»ØÄ꤬¶Ø»ß¤µ¤ì¤Æ¤¤¤Ê¤¤¾õÂÖ (10. Êá³Í¼°½¸¹ç ¤ò»²¾È)
+ ¤Î¤È¤­¤Ï¡¢Ì¾Á°¤ò»È¤ï¤Ê¤¤¤ÇÈÖ¹æ¤Ç¤â»²¾È¤Ç¤­¤ë¡£
+
+ Ê£¿ô¤Î¼°½¸¹ç¤ËƱ¤¸Ì¾Á°¤òÍ¿¤¨¤ë¤³¤È¤Ïµö¤µ¤ì¤Æ¤¤¤ë¡£
+ ¤³¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤Î̾Á°¤ò»ÈÍѤ·¤¿¸åÊý»²¾È¤Ï²Äǽ¤Ç¤¢¤ë¤¬¡¢
+ Éôʬ¼°¸Æ½Ð¤·¤Ï¤Ç¤­¤Ê¤¤¡£
+
+
+8. ¸åÊý»²¾È
+
+ \n ÈÖ¹æ»ØÄ껲¾È (n >= 1)
+ \k<name> ̾Á°»ØÄ껲¾È
+
+ ̾Á°»ØÄ껲¾È¤Ç¡¢¤½¤Î̾Á°¤¬Ê£¿ô¤Î¼°½¸¹ç¤Ç¿½ÅÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢
+ ÈÖ¹æ¤ÎÂ礭¤¤¼°½¸¹ç¤«¤éÍ¥ÀèŪ¤Ë»²¾È¤µ¤ì¤ë¡£
+ (¥Þ¥Ã¥Á¤·¤Ê¤¤¤È¤­¤Ë¤ÏÈÖ¹æ¤Î¾®¤µ¤¤¼°½¸¹ç¤¬»²¾È¤µ¤ì¤ë)
+
+ ¢¨ ÈÖ¹æ»ØÄ껲¾È¤Ï¡¢Ì¾Á°ÉÕ¤­Êá³Í¼°½¸¹ç¤¬ÄêµÁ¤µ¤ì¡¢
+ ¤«¤Ä ONIG_OPTION_CAPTURE_GROUP¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢
+ ¶Ø»ß¤µ¤ì¤ë¡£(10. Êá³Í¼°½¸¹ç ¤ò»²¾È)
+
+
+ ¥Í¥¹¥È¥ì¥Ù¥ëÉÕ¤­¸åÊý»²¾È
+
+ ¤³¤Îµ¡Ç½¤Ï¸½ºß¡¢Ruby 1.9¤Ç¤Ï̵¸ú¤Ë¤·¤Æ¤¤¤ë¡£
+
+ \k<name+n> n: 0, 1, 2, ...
+ \k<name-n> n: 0, 1, 2, ...
+
+ ¸åÊý»²¾È¤Î°ÌÃÖ¤«¤éÁêÂÐŪ¤ÊÉôʬ¼°¸Æ½Ð¤·¥Í¥¹¥È¥ì¥Ù¥ë¤ò»ØÄꤷ¤Æ¡¢¤½¤Î¥ì¥Ù¥ë¤Ç¤Î
+ Êá³ÍÃͤò»²¾È¤¹¤ë¡£
+
+ Îã-1.
+
+ /\A(?<a>|.|(?:(?<b>.)\g<a>\k<b+0>))\z/.match("reer")
+
+ Îã-2.
+
+ r = Regexp.compile(<<'__REGEXP__'.strip, Regexp::EXTENDED)
+ (?<element> \g<stag> \g<content>* \g<etag> ){0}
+ (?<stag> < \g<name> \s* > ){0}
+ (?<name> [a-zA-Z_:]+ ){0}
+ (?<content> [^<&]+ (\g<element> | [^<&]+)* ){0}
+ (?<etag> </ \k<name+1> >){0}
+ \g<element>
+ __REGEXP__
+
+ p r.match('<foo>f<bar>bbb</bar>f</foo>').captures
+
+
+
+9. Éôʬ¼°¸Æ½Ð¤· ("ÅÄÃæů¥¹¥Ú¥·¥ã¥ë")
+
+ \g<name> ̾Á°»ØÄê¸Æ½Ð¤·
+ \g<n> ÈÖ¹æ»ØÄê¸Æ½Ð¤· (n >= 1)
+
+ ¢¨ ºÇº¸°ÌÃ֤ǤκƵ¢¸Æ½Ð¤·¤Ï¶Ø»ß¤µ¤ì¤ë¡£
+ Îã. (?<name>a|\g<name>b) => error
+ (?<name>a|b\g<name>c) => OK
+
+ ¢¨ ÈÖ¹æ»ØÄê¸Æ½Ð¤·¤Ï¡¢Ì¾Á°ÉÕ¤­Êá³Í¼°½¸¹ç¤¬ÄêµÁ¤µ¤ì¡¢
+ ¤«¤Ä ONIG_OPTION_CAPTURE_GROUP¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢
+ ¶Ø»ß¤µ¤ì¤ë¡£ (10. Êá³Í¼°½¸¹ç ¤ò»²¾È)
+
+ ¢¨ ¸Æ¤Ó½Ð¤µ¤ì¤¿¼°½¸¹ç¤Î¥ª¥×¥·¥ç¥ó¾õÂÖ¤¬¸Æ½Ð¤·Â¦¤Î¥ª¥×¥·¥ç¥ó¾õÂ֤ȰۤʤäƤ¤¤ë
+ ¤È¤­¡¢¸Æ¤Ó½Ð¤µ¤ì¤¿Â¦¤Î¥ª¥×¥·¥ç¥ó¾õÂÖ¤¬Í­¸ú¤Ç¤¢¤ë¡£
+
+ Îã. (?-i:\g<name>)(?i:(?<name>a)){0} ¤Ï "A" ¤Ë¾È¹çÀ®¸ù¤¹¤ë¡£
+
+
+10. Êá³Í¼°½¸¹ç
+
+ Êá³Í¼°½¸¹ç(...)¤Ï¡¢°Ê²¼¤Î¾ò·ï¤Ë±þ¤¸¤Æ¿¶Éñ¤¬ÊѲ½¤¹¤ë¡£
+ (̾Á°ÉÕ¤­Êá³Í¼°½¸¹ç¤ÏÊѲ½¤·¤Ê¤¤)
+
+ case 1. /.../ (̾Á°ÉÕ¤­Êá³Í¼°½¸¹ç¤ÏÉÔ»ÈÍÑ¡¢¥ª¥×¥·¥ç¥ó¤Ê¤·)
+
+ (...) ¤Ï¡¢Êá³Í¼°½¸¹ç¤È¤·¤Æ°·¤ï¤ì¤ë¡£
+
+ case 2. /.../g (̾Á°ÉÕ¤­Êá³Í¼°½¸¹ç¤ÏÉÔ»ÈÍÑ¡¢¥ª¥×¥·¥ç¥ó 'g'¤ò»ØÄê)
+
+ (...) ¤Ï¡¢ÈóÊá³Í¼°½¸¹ç¤È¤·¤Æ°·¤ï¤ì¤ë¡£
+
+ case 3. /..(?<name>..)../ (̾Á°ÉÕ¤­Êá³Í¼°½¸¹ç¤Ï»ÈÍÑ¡¢¥ª¥×¥·¥ç¥ó¤Ê¤·)
+
+ (...) ¤Ï¡¢ÈóÊá³Í¼°½¸¹ç¤È¤·¤Æ°·¤ï¤ì¤ë¡£
+ ÈÖ¹æ»ØÄ껲¾È/¸Æ¤Ó½Ð¤·¤ÏÉÔµö²Ä¡£
+
+ case 4. /..(?<name>..)../G (̾Á°ÉÕ¤­Êá³Í¼°½¸¹ç¤Ï»ÈÍÑ¡¢¥ª¥×¥·¥ç¥ó 'G'¤ò»ØÄê)
+
+ (...) ¤Ï¡¢Êá³Í¼°½¸¹ç¤È¤·¤Æ°·¤ï¤ì¤ë¡£
+ ÈÖ¹æ»ØÄ껲¾È/¸Æ¤Ó½Ð¤·¤Ïµö²Ä¡£
+
+ ⤷
+ g: ONIG_OPTION_DONT_CAPTURE_GROUP
+ G: ONIG_OPTION_CAPTURE_GROUP
+ ('g'¤È'G'¥ª¥×¥·¥ç¥ó¤Ï¡¢ruby-dev ML¤ÇµÄÏÀ¤µ¤ì¤¿¡£)
+
+ ¤³¤ì¤é¤Î¿¶Éñ¤Î°ÕÌ£¤Ï¡¢
+ ̾Á°ÉÕ¤­Êá³Í¤È̾Á°Ìµ¤·Êá³Í¤òƱ»þ¤Ë»ÈÍѤ¹¤ëɬÁ³À­¤Î¤¢¤ë¾ìÌ̤Ͼ¯¤Ê¤¤¤Ç¤¢¤í¤¦
+ ¤È¤¤¤¦Íýͳ¤«¤é¹Í¤¨¤é¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£
+ ¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï¡¢Ruby¤Ç¤Ï¸½ºß¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
+
+
+-----------------------------
+Êäµ­ 1. ʸˡ°Í¸¥ª¥×¥·¥ç¥ó
+
+ + ONIG_SYNTAX_RUBY
+ (?m): ½ª»ßÉäµ­¹æ(.)¤Ï²þ¹Ô¤È¾È¹çÀ®¸ù
+
+ + ONIG_SYNTAX_PERL ¤È ONIG_SYNTAX_JAVA
+ (?s): ½ª»ßÉäµ­¹æ(.)¤Ï²þ¹Ô¤È¾È¹çÀ®¸ù
+ (?m): ^ ¤Ï²þ¹Ô¤Îľ¸å¤Ë¾È¹ç¤¹¤ë¡¢$ ¤Ï²þ¹Ô¤ÎľÁ°¤Ë¾È¹ç¤¹¤ë
+
+
+Êäµ­ 2. Æȼ«³ÈÄ¥µ¡Ç½
+
+ + 16¿Ê¿ô¿ô»ú¡¢Èó16¿Ê¿ô»ú \h, \H
+ + ̾Á°ÉÕ¤­Êá³Í¼°½¸¹ç (?<name>...)
+ + ̾Á°»ØÄê¸åÊý»²¾È \k<name>
+ + Éôʬ¼°¸Æ½Ð¤· \g<name>, \g<group-num>
+
+
+Êäµ­ 3. Perl 5.8.0¤ÈÈæ³Ó¤·¤Æ¸ºß¤·¤Ê¤¤µ¡Ç½
+
+ + [:word:]
+ + \N{name}
+ + \l,\u,\L,\U, \X, \C
+ + (?{code})
+ + (??{code})
+ + (?(condition)yes-pat|no-pat)
+
+ * \Q...\E
+ ⤷ONIG_SYNTAX_PERL¤ÈONIG_SYNTAX_JAVA¤Ç¤ÏÍ­¸ú
+
+ * \p{property}, \P{property}
+ ⤷ONIG_SYNTAX_PERL¤ÈONIG_SYNTAX_JAVA¤Ç¤ÏÍ­¸ú
+ Alnum, Alpha, Blank, Cntrl, Digit, Graph, Lower,
+ Print, Punct, Space, Upper, XDigit, ASCII¤¬»ØÄê¤Ç¤­¤ë¡£
+
+ ÆÃÀ­Ì¾¤ÎÁ°¤Ë 'Is'Á°ÃÖ»ì¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¡¢ONIG_SYNTAX_PERL¤Ç¤Î¤ß
+ µö¤µ¤ì¤Æ¤¤¤ë¡£
+ ex. \p{IsXDigit}.
+
+ ÆÃÀ­¤ÎÈÝÄê±é»»»Ò¤Ï¡¢ONIG_SYNTAX_PERL¤Ç¤Î¤ßµö¤µ¤ì¤Æ¤¤¤ë¡£
+ \p{^...}, \P{^...}
+
+
+Êäµ­ 4. Ruby¤ÎÆüËܸ첽 GNU regex(version 0.12)¤È¤Î°ã¤¤
+
+ + 16¿Ê¿ô»ú¥¿¥¤¥×Äɲà (\h, \H)
+ + Ìá¤êÆɤߵ¡Ç½¤òÄɲÃ
+ + ¶¯Íߤʷ«¤êÊÖ¤·»ØÄê»Ò¤òÄɲà (?+, *+, ++)
+ + ʸ»ú½¸¹ç¤ÎÃæ¤Î±é»»»Ò¤òÄɲà ([...], &&)
+ ('[' ¤Ï¡¢Ê¸»ú½¸¹ç¤ÎÃæ¤ÇÄ̾ï¤Îʸ»ú¤È¤·¤Æ»ÈÍѤ¹¤ë¤È¤­¤Ë¤Ï
+ ÂàÈò½¤¾þ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)
+ + ̾Á°ÉÕ¤­Êá³Í¼°½¸¹ç¤È¡¢Éôʬ¼°¸Æ½Ð¤·µ¡Ç½ÄɲÃ
+ + ¿¥Ð¥¤¥Èʸ»ú¥³¡¼¥É¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¤­¡¢
+ ʸ»ú½¸¹ç¤ÎÃæ¤ÇȬ¿Ê¿ô¤Þ¤¿¤Ï½½Ï»¿Ê¿ôɽ¸½¤ÎϢ³¤Ï¡¢Â¿¥Ð¥¤¥ÈÉä¹ç¤Çɽ¸½¤µ¤ì¤¿
+ °ì¸Ä¤Îʸ»ú¤È²ò¼á¤µ¤ì¤ë
+ (Îã. [\xa1\xa2], [\xa1\xa7-\xa4\xa1])
+ + ʸ»ú½¸¹ç¤ÎÃæ¤Ç¡¢°ì¥Ð¥¤¥Èʸ»ú¤È¿¥Ð¥¤¥Èʸ»ú¤ÎÈÏ°Ï»ØÄê¤Ïµö¤µ¤ì¤ë¡£
+ ex. /[a-¤¢]/
+ + ¸ÉΩ¥ª¥×¥·¥ç¥ó¤ÎÍ­¸úÈϰϤϡ¢¤½¤Î¸ÉΩ¥ª¥×¥·¥ç¥ó¤ò´Þ¤ó¤Ç¤¤¤ë¼°½¸¹ç¤Î
+ ½ª¤ï¤ê¤Þ¤Ç¤Ç¤¢¤ë
+ Îã. (?:(?i)a|b) ¤Ï (?:(?i:a|b)) ¤È²ò¼á¤µ¤ì¤ë¡¢(?:(?i:a)|b)¤Ç¤Ï¤Ê¤¤
+ + ¸ÉΩ¥ª¥×¥·¥ç¥ó¤Ï¤½¤ÎÁ°¤Î¼°¤ËÂФ·¤ÆÆ©²áŪ¤Ç¤Ï¤Ê¤¤
+ Îã. /a(?i)*/ ¤Ïʸˡ¥¨¥é¡¼¤È¤Ê¤ë
+ + ÉÔ´°Á´¤Ê·«¤êÊÖ¤·ÈÏ°Ï»ØÄê»Ò¤ÏÄ̾ï¤Îʸ»úÎó¤È¤·¤Æµö²Ä¤µ¤ì¤ë
+ Îã. /{/, /({)/, /a{2,3/
+ + ÈÝÄêŪPOSIX¥Ö¥é¥±¥Ã¥È [:^xxxx:] ¤òÄɲÃ
+ + POSIX¥Ö¥é¥±¥Ã¥È [:ascii:] ¤òÄɲÃ
+ + ÀèÆɤߤ竤êÊÖ¤·¤ÏÉÔµö²Ä
+ Îã. /(?=a)*/, /(?!b){5}/
+ + ¿ôÃͤǻØÄꤵ¤ì¤¿Ê¸»ú¤ËÂФ·¤Æ¤â¡¢Âçʸ»ú¾®Ê¸»ú¾È¹ç¥ª¥×¥·¥ç¥ó¤ÏÍ­¸ú
+ Îã. /\x61/i =~ "A"
+ + ·«¤êÊÖ¤·²ó¿ô»ØÄê¤Ç¡¢ºÇÄã²ó¿ô¤Î¾Êά(0²ó)¤¬¤Ç¤­¤ë
+ /a{,n}/ == /a{0,n}/
+ ºÇÄã²ó¿ô¤ÈºÇÂç²ó¿ô¤ÎƱ»þ¾Êά¤Ïµö¤µ¤ì¤Ê¤¤¡£(/a{,}/)
+ + /a{n}?/¤Ï̵Íߤʱ黻»Ò¤Ç¤Ï¤Ê¤¤¡£
+ /a{n}?/ == /(?:a{n})?/
+ + ̵¸ú¤Ê¸åÊý»²¾È¤ò¥Á¥§¥Ã¥¯¤·¤Æ¥¨¥é¡¼¤Ë¤¹¤ë¡£
+ /\1/, /(a)\2/
+ + ̵¸Â·«¤êÊÖ¤·¤ÎÃæ¤Ç¡¢Ä¹¤µÎí¤Ç¤Î¾È¹çÀ®¸ù¤Ï·«¤êÊÖ¤·¤òÃæÃǤµ¤»¤ë¤¬¡¢
+ ¤³¤Î¤È¤­¡¢ÃæÃǤ¹¤Ù¤­¤«¤É¤¦¤«¤ÎȽÄê¤È¤·¤Æ¡¢Êá³Í¼°½¸¹ç¤ÎÊá³Í¾õÂÖ¤Î
+ ÊѲ½¤Þ¤Ç¹Íθ¤·¤Æ¤¤¤ë
+ /(?:()|())*\1\2/ =~ ""
+ /(?:\1a|())*/ =~ "a"
+
+
+
+Êäµ­ 5. ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢´ûÄêÃͤǤÏÍ­¸ú¤Ë¤·¤Æ¤¤¤Ê¤¤µ¡Ç½
+
+ + Êá³ÍÍúÎò»²¾È
+
+ (?@...) ¤È (?@<name>...)
+
+ Îã. /(?@a)*/.match("aaa") ==> [<0-1>, <1-2>, <2-3>]
+
+ »ÈÍÑÊýË¡¤Ï¡¢sample/listcap.c¤ò»²¾È
+
+ Í­¸ú¤Ë¤·¤Æ¤¤¤Ê¤¤Íýͳ¤Ï¡¢¤É¤ÎÄøÅÙÌò¤ËΩ¤Ä¤«¤Ï¤Ã¤­¤ê¤·¤Ê¤¤¤¿¤á¡£
+
+
+Êäµ­ 6. ÌäÂêÅÀ
+
+ + UTF-8¤Ç¡¢¥Ð¥¤¥ÈÃͤ¬Å¬Àµ¤Ê²Á¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¤Ï¹Ô¤Ê¤Ã¤Æ¤¤¤Ê¤¤¡£
+
+ * ÀèƬ¥Ð¥¤¥È¤È¤·¤ÆÉÔÀµ¤Ê¥Ð¥¤¥È¤ò°ìʸ»ú¤È¤ß¤Ê¤¹
+ /./u =~ "\xa3"
+
+ * ÉÔ´°Á´¤Ê¥Ð¥¤¥È¥·¡¼¥±¥ó¥¹¤Î¥Á¥§¥Ã¥¯¤ò¤·¤Ê¤¤
+ /\w+/ =~ "a\xf3\x8ec"
+
+ ¤³¤ì¤òÄ´¤Ù¤ë¤³¤È¤Ï²Äǽ¤Ç¤Ï¤¢¤ë¤¬¡¢ÃÙ¤¯¤Ê¤ë¤Î¤Ç¹Ô¤Ê¤ï¤Ê¤¤¡£
+
+½ª¤ê
diff --git a/ext/mbstring/oniguruma/enc/big5.c b/ext/mbstring/oniguruma/enc/big5.c
index 763872e96..86792666a 100644
--- a/ext/mbstring/oniguruma/enc/big5.c
+++ b/ext/mbstring/oniguruma/enc/big5.c
@@ -29,7 +29,7 @@
#include "regenc.h"
-static int EncLen_BIG5[] = {
+static const 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,
diff --git a/ext/mbstring/oniguruma/enc/euc_jp.c b/ext/mbstring/oniguruma/enc/euc_jp.c
index 5f13e33eb..71c81ee9f 100644
--- a/ext/mbstring/oniguruma/enc/euc_jp.c
+++ b/ext/mbstring/oniguruma/enc/euc_jp.c
@@ -31,7 +31,7 @@
#define eucjp_islead(c) ((UChar )((c) - 0xa1) > 0xfe - 0xa1)
-static int EncLen_EUCJP[] = {
+static const 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,
@@ -158,20 +158,16 @@ eucjp_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* 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
+ if (code < 128)
+ return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
+ else {
+ if ((ctype & (ONIGENC_CTYPE_WORD |
+ ONIGENC_CTYPE_GRAPH | ONIGENC_CTYPE_PRINT)) != 0) {
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;
+ return FALSE;
}
static UChar*
diff --git a/ext/mbstring/oniguruma/enc/euc_kr.c b/ext/mbstring/oniguruma/enc/euc_kr.c
index c1e83b7e6..57bf80153 100644
--- a/ext/mbstring/oniguruma/enc/euc_kr.c
+++ b/ext/mbstring/oniguruma/enc/euc_kr.c
@@ -29,7 +29,7 @@
#include "regenc.h"
-static int EncLen_EUCKR[] = {
+static const 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,
diff --git a/ext/mbstring/oniguruma/enc/euc_tw.c b/ext/mbstring/oniguruma/enc/euc_tw.c
index 4e5851a45..6f396e75e 100644
--- a/ext/mbstring/oniguruma/enc/euc_tw.c
+++ b/ext/mbstring/oniguruma/enc/euc_tw.c
@@ -29,7 +29,7 @@
#include "regenc.h"
-static int EncLen_EUCTW[] = {
+static const 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,
diff --git a/ext/mbstring/oniguruma/enc/gb18030.c b/ext/mbstring/oniguruma/enc/gb18030.c
new file mode 100644
index 000000000..01995ea09
--- /dev/null
+++ b/ext/mbstring/oniguruma/enc/gb18030.c
@@ -0,0 +1,501 @@
+/**********************************************************************
+ gb18030.c - Oniguruma (regular expression library)
+**********************************************************************/
+/*-
+ * Copyright (c) 2005 KUBO Takehiro <kubo AT jiubao DOT org>
+ * K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * 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"
+
+#if 1
+#define DEBUG_GB18030(arg)
+#else
+#define DEBUG_GB18030(arg) printf arg
+#endif
+
+enum {
+ C1, /* one-byte char */
+ C2, /* one-byte or second of two-byte char */
+ C4, /* one-byte or second or fourth of four-byte char */
+ CM /* first of two- or four-byte char or second of two-byte char */
+};
+
+static const char GB18030_MAP[] = {
+ C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1,
+ C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1,
+ C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1,
+ C4, C4, C4, C4, C4, C4, C4, C4, C4, C4, C1, C1, C1, C1, C1, C1,
+ C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2,
+ C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2,
+ C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2,
+ C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C1,
+ C2, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
+ CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
+ CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
+ CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
+ CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
+ CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
+ CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,
+ CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, C1
+};
+
+static int
+gb18030_mbc_enc_len(const UChar* p)
+{
+ if (GB18030_MAP[*p] != CM)
+ return 1;
+ p++;
+ if (GB18030_MAP[*p] == C4)
+ return 4;
+ if (GB18030_MAP[*p] == C1)
+ return 1; /* illegal sequence */
+ return 2;
+}
+
+static OnigCodePoint
+gb18030_mbc_to_code(const UChar* p, const UChar* end)
+{
+ return onigenc_mbn_mbc_to_code(ONIG_ENCODING_GB18030, p, end);
+}
+
+static int
+gb18030_code_to_mbc(OnigCodePoint code, UChar *buf)
+{
+ return onigenc_mb4_code_to_mbc(ONIG_ENCODING_GB18030, code, buf);
+}
+
+static int
+gb18030_mbc_to_normalize(OnigAmbigType flag, const UChar** pp, const UChar* end,
+ UChar* lower)
+{
+ return onigenc_mbn_mbc_to_normalize(ONIG_ENCODING_GB18030, flag,
+ pp, end, lower);
+}
+
+static int
+gb18030_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end)
+{
+ return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_GB18030, flag, pp, end);
+}
+
+static int
+gb18030_is_code_ctype(OnigCodePoint code, unsigned int ctype)
+{
+ return onigenc_mb4_is_code_ctype(ONIG_ENCODING_GB18030, code, ctype);
+}
+
+enum state {
+ S_START,
+ S_one_C2,
+ S_one_C4,
+ S_one_CM,
+
+ S_odd_CM_one_CX,
+ S_even_CM_one_CX,
+
+ /* CMC4 : pair of "CM C4" */
+ S_one_CMC4,
+ S_odd_CMC4,
+ S_one_C4_odd_CMC4,
+ S_even_CMC4,
+ S_one_C4_even_CMC4,
+
+ S_odd_CM_odd_CMC4,
+ S_even_CM_odd_CMC4,
+
+ S_odd_CM_even_CMC4,
+ S_even_CM_even_CMC4,
+
+ /* C4CM : pair of "C4 CM" */
+ S_odd_C4CM,
+ S_one_CM_odd_C4CM,
+ S_even_C4CM,
+ S_one_CM_even_C4CM,
+
+ S_even_CM_odd_C4CM,
+ S_odd_CM_odd_C4CM,
+ S_even_CM_even_C4CM,
+ S_odd_CM_even_C4CM,
+};
+
+static UChar*
+gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
+{
+ const UChar *p;
+ enum state state = S_START;
+
+ DEBUG_GB18030(("----------------\n"));
+ for (p = s; p >= start; p--) {
+ DEBUG_GB18030(("state %d --(%02x)-->\n", state, *p));
+ switch (state) {
+ case S_START:
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ return (UChar *)s;
+ case C2:
+ state = S_one_C2; /* C2 */
+ break;
+ case C4:
+ state = S_one_C4; /* C4 */
+ break;
+ case CM:
+ state = S_one_CM; /* CM */
+ break;
+ }
+ break;
+ case S_one_C2: /* C2 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)s;
+ case CM:
+ state = S_odd_CM_one_CX; /* CM C2 */
+ break;
+ }
+ break;
+ case S_one_C4: /* C4 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)s;
+ case CM:
+ state = S_one_CMC4;
+ break;
+ }
+ break;
+ case S_one_CM: /* CM */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ return (UChar *)s;
+ case C4:
+ state = S_odd_C4CM;
+ break;
+ case CM:
+ state = S_odd_CM_one_CX; /* CM CM */
+ break;
+ }
+ break;
+
+ case S_odd_CM_one_CX: /* CM C2 */ /* CM CM */ /* CM CM CM C4 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)(s - 1);
+ case CM:
+ state = S_even_CM_one_CX;
+ break;
+ }
+ break;
+ case S_even_CM_one_CX: /* CM CM C2 */ /* CM CM CM */ /* CM CM C4 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)s;
+ case CM:
+ state = S_odd_CM_one_CX;
+ break;
+ }
+ break;
+
+ case S_one_CMC4: /* CM C4 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ return (UChar *)(s - 1);
+ case C4:
+ state = S_one_C4_odd_CMC4; /* C4 CM C4 */
+ break;
+ case CM:
+ state = S_even_CM_one_CX; /* CM CM C4 */
+ break;
+ }
+ break;
+ case S_odd_CMC4: /* CM C4 CM C4 CM C4 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ return (UChar *)(s - 1);
+ case C4:
+ state = S_one_C4_odd_CMC4;
+ break;
+ case CM:
+ state = S_odd_CM_odd_CMC4;
+ break;
+ }
+ break;
+ case S_one_C4_odd_CMC4: /* C4 CM C4 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)(s - 1);
+ case CM:
+ state = S_even_CMC4; /* CM C4 CM C4 */
+ break;
+ }
+ break;
+ case S_even_CMC4: /* CM C4 CM C4 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ return (UChar *)(s - 3);
+ case C4:
+ state = S_one_C4_even_CMC4;
+ break;
+ case CM:
+ state = S_odd_CM_even_CMC4;
+ break;
+ }
+ break;
+ case S_one_C4_even_CMC4: /* C4 CM C4 CM C4 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)(s - 3);
+ case CM:
+ state = S_odd_CMC4;
+ break;
+ }
+ break;
+
+ case S_odd_CM_odd_CMC4: /* CM CM C4 CM C4 CM C4 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)(s - 3);
+ case CM:
+ state = S_even_CM_odd_CMC4;
+ break;
+ }
+ break;
+ case S_even_CM_odd_CMC4: /* CM CM CM C4 CM C4 CM C4 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)(s - 1);
+ case CM:
+ state = S_odd_CM_odd_CMC4;
+ break;
+ }
+ break;
+
+ case S_odd_CM_even_CMC4: /* CM CM C4 CM C4 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)(s - 1);
+ case CM:
+ state = S_even_CM_even_CMC4;
+ break;
+ }
+ break;
+ case S_even_CM_even_CMC4: /* CM CM CM C4 CM C4 */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)(s - 3);
+ case CM:
+ state = S_odd_CM_even_CMC4;
+ break;
+ }
+ break;
+
+ case S_odd_C4CM: /* C4 CM */ /* C4 CM C4 CM C4 CM*/
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)s;
+ case CM:
+ state = S_one_CM_odd_C4CM; /* CM C4 CM */
+ break;
+ }
+ break;
+ case S_one_CM_odd_C4CM: /* CM C4 CM */ /* CM C4 CM C4 CM C4 CM */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ return (UChar *)(s - 2); /* |CM C4 CM */
+ case C4:
+ state = S_even_C4CM;
+ break;
+ case CM:
+ state = S_even_CM_odd_C4CM;
+ break;
+ }
+ break;
+ case S_even_C4CM: /* C4 CM C4 CM */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)(s - 2); /* C4|CM C4 CM */
+ case CM:
+ state = S_one_CM_even_C4CM;
+ break;
+ }
+ break;
+ case S_one_CM_even_C4CM: /* CM C4 CM C4 CM */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ return (UChar *)(s - 0); /*|CM C4 CM C4|CM */
+ case C4:
+ state = S_odd_C4CM;
+ break;
+ case CM:
+ state = S_even_CM_even_C4CM;
+ break;
+ }
+ break;
+
+ case S_even_CM_odd_C4CM: /* CM CM C4 CM */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)(s - 0); /* |CM CM|C4|CM */
+ case CM:
+ state = S_odd_CM_odd_C4CM;
+ break;
+ }
+ break;
+ case S_odd_CM_odd_C4CM: /* CM CM CM C4 CM */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)(s - 2); /* |CM CM|CM C4 CM */
+ case CM:
+ state = S_even_CM_odd_C4CM;
+ break;
+ }
+ break;
+
+ case S_even_CM_even_C4CM: /* CM CM C4 CM C4 CM */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)(s - 2); /* |CM CM|C4|CM C4 CM */
+ case CM:
+ state = S_odd_CM_even_C4CM;
+ break;
+ }
+ break;
+ case S_odd_CM_even_C4CM: /* CM CM CM C4 CM C4 CM */
+ switch (GB18030_MAP[*p]) {
+ case C1:
+ case C2:
+ case C4:
+ return (UChar *)(s - 0); /* |CM CM|CM C4 CM C4|CM */
+ case CM:
+ state = S_even_CM_even_C4CM;
+ break;
+ }
+ break;
+ }
+ }
+
+ DEBUG_GB18030(("state %d\n", state));
+ switch (state) {
+ case S_START: return (UChar *)(s - 0);
+ case S_one_C2: return (UChar *)(s - 0);
+ case S_one_C4: return (UChar *)(s - 0);
+ case S_one_CM: return (UChar *)(s - 0);
+
+ case S_odd_CM_one_CX: return (UChar *)(s - 1);
+ case S_even_CM_one_CX: return (UChar *)(s - 0);
+
+ case S_one_CMC4: return (UChar *)(s - 1);
+ case S_odd_CMC4: return (UChar *)(s - 1);
+ case S_one_C4_odd_CMC4: return (UChar *)(s - 1);
+ case S_even_CMC4: return (UChar *)(s - 3);
+ case S_one_C4_even_CMC4: return (UChar *)(s - 3);
+
+ case S_odd_CM_odd_CMC4: return (UChar *)(s - 3);
+ case S_even_CM_odd_CMC4: return (UChar *)(s - 1);
+
+ case S_odd_CM_even_CMC4: return (UChar *)(s - 1);
+ case S_even_CM_even_CMC4: return (UChar *)(s - 3);
+
+ case S_odd_C4CM: return (UChar *)(s - 0);
+ case S_one_CM_odd_C4CM: return (UChar *)(s - 2);
+ case S_even_C4CM: return (UChar *)(s - 2);
+ case S_one_CM_even_C4CM: return (UChar *)(s - 0);
+
+ case S_even_CM_odd_C4CM: return (UChar *)(s - 0);
+ case S_odd_CM_odd_C4CM: return (UChar *)(s - 2);
+ case S_even_CM_even_C4CM: return (UChar *)(s - 2);
+ case S_odd_CM_even_C4CM: return (UChar *)(s - 0);
+ }
+
+ return (UChar* )s; /* never come here. (escape warning) */
+}
+
+static int
+gb18030_is_allowed_reverse_match(const UChar* s, const UChar* end)
+{
+ return GB18030_MAP[*s] == C1 ? TRUE : FALSE;
+}
+
+OnigEncodingType OnigEncodingGB18030 = {
+ gb18030_mbc_enc_len,
+ "GB18030", /* 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,
+ gb18030_mbc_to_code,
+ onigenc_mb4_code_to_mbclen,
+ gb18030_code_to_mbc,
+ gb18030_mbc_to_normalize,
+ gb18030_is_mbc_ambiguous,
+ onigenc_ascii_get_all_pair_ambig_codes,
+ onigenc_nothing_get_all_comp_ambig_codes,
+ gb18030_is_code_ctype,
+ onigenc_not_support_get_ctype_code_range,
+ gb18030_left_adjust_char_head,
+ gb18030_is_allowed_reverse_match
+};
diff --git a/ext/mbstring/oniguruma/enc/iso8859_1.c b/ext/mbstring/oniguruma/enc/iso8859_1.c
index 53ad52ee1..4dd708d84 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_1.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_1.c
@@ -32,7 +32,7 @@
#define ENC_IS_ISO_8859_1_CTYPE(code,ctype) \
((EncISO_8859_1_CtypeTable[code] & ctype) != 0)
-static unsigned short EncISO_8859_1_CtypeTable[256] = {
+static const 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,
diff --git a/ext/mbstring/oniguruma/enc/iso8859_10.c b/ext/mbstring/oniguruma/enc/iso8859_10.c
index a9331cebf..e317f4975 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_10.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_10.c
@@ -33,7 +33,7 @@
#define ENC_IS_ISO_8859_10_CTYPE(code,ctype) \
((EncISO_8859_10_CtypeTable[code] & ctype) != 0)
-static UChar EncISO_8859_10_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncISO_8859_10_ToLowerCaseTable[256] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
};
-static unsigned short EncISO_8859_10_CtypeTable[256] = {
+static const 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,
@@ -186,9 +186,9 @@ iso_8859_10_is_code_ctype(OnigCodePoint code, unsigned int ctype)
static int
iso_8859_10_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xa1, 0xb1 },
{ 0xa2, 0xb2 },
{ 0xa3, 0xb3 },
diff --git a/ext/mbstring/oniguruma/enc/iso8859_11.c b/ext/mbstring/oniguruma/enc/iso8859_11.c
index bb1098807..6afaa27f4 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_11.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_11.c
@@ -32,7 +32,7 @@
#define ENC_IS_ISO_8859_11_CTYPE(code,ctype) \
((EncISO_8859_11_CtypeTable[code] & ctype) != 0)
-static unsigned short EncISO_8859_11_CtypeTable[256] = {
+static const 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,
diff --git a/ext/mbstring/oniguruma/enc/iso8859_13.c b/ext/mbstring/oniguruma/enc/iso8859_13.c
index 827ca508e..abd764452 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_13.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_13.c
@@ -33,7 +33,7 @@
#define ENC_IS_ISO_8859_13_CTYPE(code,ctype) \
((EncISO_8859_13_CtypeTable[code] & ctype) != 0)
-static UChar EncISO_8859_13_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncISO_8859_13_ToLowerCaseTable[256] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
};
-static unsigned short EncISO_8859_13_CtypeTable[256] = {
+static const 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,
@@ -186,9 +186,9 @@ iso_8859_13_is_code_ctype(OnigCodePoint code, unsigned int ctype)
static int
iso_8859_13_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xc0, 0xe0 },
{ 0xc1, 0xe1 },
{ 0xc2, 0xe2 },
diff --git a/ext/mbstring/oniguruma/enc/iso8859_14.c b/ext/mbstring/oniguruma/enc/iso8859_14.c
index 4fe5ab29d..d76771a1c 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_14.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_14.c
@@ -33,7 +33,7 @@
#define ENC_IS_ISO_8859_14_CTYPE(code,ctype) \
((EncISO_8859_14_CtypeTable[code] & ctype) != 0)
-static UChar EncISO_8859_14_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncISO_8859_14_ToLowerCaseTable[256] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
};
-static unsigned short EncISO_8859_14_CtypeTable[256] = {
+static const 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,
@@ -186,9 +186,9 @@ iso_8859_14_is_code_ctype(OnigCodePoint code, unsigned int ctype)
static int
iso_8859_14_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xa1, 0xa2 },
{ 0xa2, 0xa1 },
{ 0xa4, 0xa5 },
diff --git a/ext/mbstring/oniguruma/enc/iso8859_15.c b/ext/mbstring/oniguruma/enc/iso8859_15.c
index 1a8bd7b4c..d6611ed29 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_15.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_15.c
@@ -33,7 +33,7 @@
#define ENC_IS_ISO_8859_15_CTYPE(code,ctype) \
((EncISO_8859_15_CtypeTable[code] & ctype) != 0)
-static UChar EncISO_8859_15_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncISO_8859_15_ToLowerCaseTable[256] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
};
-static unsigned short EncISO_8859_15_CtypeTable[256] = {
+static const 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,
@@ -186,9 +186,9 @@ iso_8859_15_is_code_ctype(OnigCodePoint code, unsigned int ctype)
static int
iso_8859_15_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xa6, 0xa8 },
{ 0xa8, 0xa6 },
diff --git a/ext/mbstring/oniguruma/enc/iso8859_16.c b/ext/mbstring/oniguruma/enc/iso8859_16.c
index e283db17c..23b868065 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_16.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_16.c
@@ -33,7 +33,7 @@
#define ENC_IS_ISO_8859_16_CTYPE(code,ctype) \
((EncISO_8859_16_CtypeTable[code] & ctype) != 0)
-static UChar EncISO_8859_16_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncISO_8859_16_ToLowerCaseTable[256] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
};
-static unsigned short EncISO_8859_16_CtypeTable[256] = {
+static const 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,
@@ -186,9 +186,9 @@ iso_8859_16_is_code_ctype(OnigCodePoint code, unsigned int ctype)
static int
iso_8859_16_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xa1, 0xa2 },
{ 0xa2, 0xa1 },
{ 0xa3, 0xb3 },
diff --git a/ext/mbstring/oniguruma/enc/iso8859_2.c b/ext/mbstring/oniguruma/enc/iso8859_2.c
index e86415b9c..5f21ff78a 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_2.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_2.c
@@ -33,7 +33,7 @@
#define ENC_IS_ISO_8859_2_CTYPE(code,ctype) \
((EncISO_8859_2_CtypeTable[code] & ctype) != 0)
-static UChar EncISO_8859_2_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncISO_8859_2_ToLowerCaseTable[256] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
};
-static unsigned short EncISO_8859_2_CtypeTable[256] = {
+static const 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,
@@ -177,9 +177,9 @@ iso_8859_2_is_mbc_ambiguous(OnigAmbigType flag,
static int
iso_8859_2_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xa1, 0xb1 },
{ 0xa3, 0xb3 },
{ 0xa5, 0xb5 },
diff --git a/ext/mbstring/oniguruma/enc/iso8859_3.c b/ext/mbstring/oniguruma/enc/iso8859_3.c
index 76d2bec8a..9ac3dab17 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_3.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_3.c
@@ -33,7 +33,7 @@
#define ENC_IS_ISO_8859_3_CTYPE(code,ctype) \
((EncISO_8859_3_CtypeTable[code] & ctype) != 0)
-static UChar EncISO_8859_3_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncISO_8859_3_ToLowerCaseTable[256] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
};
-static unsigned short EncISO_8859_3_CtypeTable[256] = {
+static const 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,
@@ -186,9 +186,9 @@ iso_8859_3_is_code_ctype(OnigCodePoint code, unsigned int ctype)
static int
iso_8859_3_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xa1, 0xb1 },
{ 0xa6, 0xb6 },
{ 0xa9, 0xb9 },
diff --git a/ext/mbstring/oniguruma/enc/iso8859_4.c b/ext/mbstring/oniguruma/enc/iso8859_4.c
index 756900672..c54a2fa14 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_4.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_4.c
@@ -33,7 +33,7 @@
#define ENC_IS_ISO_8859_4_CTYPE(code,ctype) \
((EncISO_8859_4_CtypeTable[code] & ctype) != 0)
-static UChar EncISO_8859_4_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncISO_8859_4_ToLowerCaseTable[256] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
};
-static unsigned short EncISO_8859_4_CtypeTable[256] = {
+static const 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,
@@ -186,9 +186,9 @@ iso_8859_4_is_code_ctype(OnigCodePoint code, unsigned int ctype)
static int
iso_8859_4_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xa1, 0xb1 },
{ 0xa3, 0xb3 },
{ 0xa5, 0xb5 },
diff --git a/ext/mbstring/oniguruma/enc/iso8859_5.c b/ext/mbstring/oniguruma/enc/iso8859_5.c
index 2f7677b3e..5b941e2eb 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_5.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_5.c
@@ -33,7 +33,7 @@
#define ENC_IS_ISO_8859_5_CTYPE(code,ctype) \
((EncISO_8859_5_CtypeTable[code] & ctype) != 0)
-static UChar EncISO_8859_5_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncISO_8859_5_ToLowerCaseTable[256] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
};
-static unsigned short EncISO_8859_5_CtypeTable[256] = {
+static const 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,
@@ -152,9 +152,9 @@ iso_8859_5_is_code_ctype(OnigCodePoint code, unsigned int ctype)
static int
iso_8859_5_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xa1, 0xf1 },
{ 0xa2, 0xf2 },
{ 0xa3, 0xf3 },
diff --git a/ext/mbstring/oniguruma/enc/iso8859_6.c b/ext/mbstring/oniguruma/enc/iso8859_6.c
index 0fcb9e8b8..bb5515d30 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_6.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_6.c
@@ -32,7 +32,7 @@
#define ENC_IS_ISO_8859_6_CTYPE(code,ctype) \
((EncISO_8859_6_CtypeTable[code] & ctype) != 0)
-static unsigned short EncISO_8859_6_CtypeTable[256] = {
+static const 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,
diff --git a/ext/mbstring/oniguruma/enc/iso8859_7.c b/ext/mbstring/oniguruma/enc/iso8859_7.c
index 8b2cb9ec5..2529dae66 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_7.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_7.c
@@ -33,7 +33,7 @@
#define ENC_IS_ISO_8859_7_CTYPE(code,ctype) \
((EncISO_8859_7_CtypeTable[code] & ctype) != 0)
-static UChar EncISO_8859_7_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncISO_8859_7_ToLowerCaseTable[256] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
};
-static unsigned short EncISO_8859_7_CtypeTable[256] = {
+static const 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,
@@ -159,9 +159,9 @@ iso_8859_7_is_code_ctype(OnigCodePoint code, unsigned int ctype)
static int
iso_8859_7_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xb6, 0xdc },
{ 0xb8, 0xdd },
{ 0xb9, 0xde },
diff --git a/ext/mbstring/oniguruma/enc/iso8859_8.c b/ext/mbstring/oniguruma/enc/iso8859_8.c
index 3c95b9b13..d7f0fc594 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_8.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_8.c
@@ -32,7 +32,7 @@
#define ENC_IS_ISO_8859_8_CTYPE(code,ctype) \
((EncISO_8859_8_CtypeTable[code] & ctype) != 0)
-static unsigned short EncISO_8859_8_CtypeTable[256] = {
+static const 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,
diff --git a/ext/mbstring/oniguruma/enc/iso8859_9.c b/ext/mbstring/oniguruma/enc/iso8859_9.c
index 1b061ff6e..f4bcac1ae 100644
--- a/ext/mbstring/oniguruma/enc/iso8859_9.c
+++ b/ext/mbstring/oniguruma/enc/iso8859_9.c
@@ -33,7 +33,7 @@
#define ENC_IS_ISO_8859_9_CTYPE(code,ctype) \
((EncISO_8859_9_CtypeTable[code] & ctype) != 0)
-static UChar EncISO_8859_9_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncISO_8859_9_ToLowerCaseTable[256] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
};
-static unsigned short EncISO_8859_9_CtypeTable[256] = {
+static const 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,
@@ -186,9 +186,9 @@ iso_8859_9_is_code_ctype(OnigCodePoint code, unsigned int ctype)
static int
iso_8859_9_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xc0, 0xe0 },
{ 0xc1, 0xe1 },
{ 0xc2, 0xe2 },
diff --git a/ext/mbstring/oniguruma/enc/koi8.c b/ext/mbstring/oniguruma/enc/koi8.c
index f8a5a1da6..27f97f307 100644
--- a/ext/mbstring/oniguruma/enc/koi8.c
+++ b/ext/mbstring/oniguruma/enc/koi8.c
@@ -33,7 +33,7 @@
#define ENC_IS_KOI8_CTYPE(code,ctype) \
((EncKOI8_CtypeTable[code] & ctype) != 0)
-static UChar EncKOI8_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncKOI8_ToLowerCaseTable[256] = {
'\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337'
};
-static unsigned short EncKOI8_CtypeTable[256] = {
+static const 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,
@@ -105,9 +105,9 @@ static unsigned short EncKOI8_CtypeTable[256] = {
static int
koi8_mbc_to_normalize(OnigAmbigType flag,
- const UChar** pp, const UChar* end, UChar* lower)
+ const OnigUChar** pp, const OnigUChar* end, OnigUChar* lower)
{
- UChar* p = (UChar *)*pp;
+ const OnigUChar* p = *pp;
if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 &&
ONIGENC_IS_MBC_ASCII(p)) ||
@@ -123,9 +123,9 @@ koi8_mbc_to_normalize(OnigAmbigType flag,
}
static int
-koi8_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end)
+koi8_is_mbc_ambiguous(OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end)
{
- UChar* p = (UChar *)*pp;
+ const OnigUChar* p = *pp;
(*pp)++;
if (((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0 &&
@@ -151,9 +151,9 @@ koi8_is_code_ctype(OnigCodePoint code, unsigned int ctype)
static int
koi8_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xc0, 0xe0 },
{ 0xc1, 0xe1 },
{ 0xc2, 0xe2 },
diff --git a/ext/mbstring/oniguruma/enc/koi8_r.c b/ext/mbstring/oniguruma/enc/koi8_r.c
index 7c626df61..d2a4440f2 100644
--- a/ext/mbstring/oniguruma/enc/koi8_r.c
+++ b/ext/mbstring/oniguruma/enc/koi8_r.c
@@ -33,7 +33,7 @@
#define ENC_IS_KOI8_R_CTYPE(code,ctype) \
((EncKOI8_R_CtypeTable[code] & ctype) != 0)
-static UChar EncKOI8_R_ToLowerCaseTable[256] = {
+static const 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',
@@ -68,7 +68,7 @@ static UChar EncKOI8_R_ToLowerCaseTable[256] = {
'\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337'
};
-static unsigned short EncKOI8_R_CtypeTable[256] = {
+static const 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,
@@ -150,9 +150,9 @@ koi8_r_is_code_ctype(OnigCodePoint code, unsigned int ctype)
static int
koi8_r_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xc0, 0xe0 },
{ 0xc1, 0xe1 },
{ 0xc2, 0xe2 },
diff --git a/ext/mbstring/oniguruma/enc/sjis.c b/ext/mbstring/oniguruma/enc/sjis.c
index e13407bcc..f7d7d5226 100644
--- a/ext/mbstring/oniguruma/enc/sjis.c
+++ b/ext/mbstring/oniguruma/enc/sjis.c
@@ -29,7 +29,7 @@
#include "regenc.h"
-static int EncLen_SJIS[] = {
+static const 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,
@@ -76,7 +76,7 @@ sjis_mbc_enc_len(const UChar* p)
return EncLen_SJIS[*p];
}
-extern int
+static int
sjis_code_to_mbclen(OnigCodePoint code)
{
if (code < 256) {
@@ -167,21 +167,16 @@ sjis_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* 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 {
+ if (code < 128)
+ return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
+ else {
+ if ((ctype & (ONIGENC_CTYPE_WORD |
+ ONIGENC_CTYPE_GRAPH | ONIGENC_CTYPE_PRINT)) != 0) {
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;
+ return FALSE;
}
static UChar*
diff --git a/ext/mbstring/oniguruma/enc/unicode.c b/ext/mbstring/oniguruma/enc/unicode.c
index e3be9450a..a8cf53901 100644
--- a/ext/mbstring/oniguruma/enc/unicode.c
+++ b/ext/mbstring/oniguruma/enc/unicode.c
@@ -30,7 +30,7 @@
#include "regenc.h"
-unsigned short OnigEnc_Unicode_ISO_8859_1_CtypeTable[256] = {
+const 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,
@@ -65,7 +65,7 @@ unsigned short OnigEnc_Unicode_ISO_8859_1_CtypeTable[256] = {
0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2, 0x10e2
};
-static OnigCodePoint CRAlnum[] = {
+static const OnigCodePoint CRAlnum[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
414,
#else
@@ -490,7 +490,7 @@ static OnigCodePoint CRAlnum[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of CRAlnum */
-static OnigCodePoint CRAlpha[] = {
+static const OnigCodePoint CRAlpha[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
396,
#else
@@ -897,7 +897,7 @@ static OnigCodePoint CRAlpha[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of CRAlpha */
-static OnigCodePoint CRBlank[] = {
+static const OnigCodePoint CRBlank[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
9,
#else
@@ -917,7 +917,7 @@ static OnigCodePoint CRBlank[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of CRBlank */
-static OnigCodePoint CRCntrl[] = {
+static const OnigCodePoint CRCntrl[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
19,
#else
@@ -947,7 +947,7 @@ static OnigCodePoint CRCntrl[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of CRCntrl */
-static OnigCodePoint CRDigit[] = {
+static const OnigCodePoint CRDigit[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
23,
#else
@@ -981,7 +981,7 @@ static OnigCodePoint CRDigit[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of CRDigit */
-static OnigCodePoint CRGraph[] = {
+static const OnigCodePoint CRGraph[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
405,
#else
@@ -1397,7 +1397,7 @@ static OnigCodePoint CRGraph[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of CRGraph */
-static OnigCodePoint CRLower[] = {
+static const OnigCodePoint CRLower[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
424,
#else
@@ -1832,7 +1832,7 @@ static OnigCodePoint CRLower[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of CRLower */
-static OnigCodePoint CRPrint[] = {
+static const OnigCodePoint CRPrint[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
405,
#else
@@ -2248,7 +2248,7 @@ static OnigCodePoint CRPrint[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of CRPrint */
-static OnigCodePoint CRPunct[] = {
+static const OnigCodePoint CRPunct[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
86,
#else
@@ -2345,7 +2345,7 @@ static OnigCodePoint CRPunct[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of CRPunct */
-static OnigCodePoint CRSpace[] = {
+static const OnigCodePoint CRSpace[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
11,
#else
@@ -2367,7 +2367,7 @@ static OnigCodePoint CRSpace[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of CRSpace */
-static OnigCodePoint CRUpper[] = {
+static const OnigCodePoint CRUpper[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
421,
#else
@@ -2799,7 +2799,7 @@ static OnigCodePoint CRUpper[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of CRUpper */
-static OnigCodePoint CRXDigit[] = {
+static const OnigCodePoint CRXDigit[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
3,
#else
@@ -2810,7 +2810,7 @@ static OnigCodePoint CRXDigit[] = {
0x0061, 0x0066
};
-static OnigCodePoint CRASCII[] = {
+static const OnigCodePoint CRASCII[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
1,
#else
@@ -2819,7 +2819,7 @@ static OnigCodePoint CRASCII[] = {
0x0000, 0x007f
};
-static OnigCodePoint CRWord[] = {
+static const OnigCodePoint CRWord[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
436,
#else
@@ -3320,6 +3320,9 @@ onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype)
case ONIGENC_CTYPE_ALNUM:
return onig_is_in_code_range((UChar* )CRAlnum, code);
break;
+ case ONIGENC_CTYPE_NEWLINE:
+ return FALSE;
+ break;
default:
return ONIGENCERR_TYPE_BUG;
@@ -3337,9 +3340,9 @@ onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype)
extern int
onigenc_unicode_get_ctype_code_range(int ctype,
- OnigCodePoint* sbr[], OnigCodePoint* mbr[])
+ const OnigCodePoint* sbr[], const OnigCodePoint* mbr[])
{
- static OnigCodePoint EmptyRange[] = { 0 };
+ static const OnigCodePoint EmptyRange[] = { 0 };
#define CR_SET(list) do { \
*mbr = list; \
diff --git a/ext/mbstring/oniguruma/enc/utf16_be.c b/ext/mbstring/oniguruma/enc/utf16_be.c
index ad33ddbee..0dd2832f7 100755
--- a/ext/mbstring/oniguruma/enc/utf16_be.c
+++ b/ext/mbstring/oniguruma/enc/utf16_be.c
@@ -2,7 +2,7 @@
utf16_be.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
#define UTF16_IS_SURROGATE_FIRST(c) (c >= 0xd8 && c <= 0xdb)
#define UTF16_IS_SURROGATE_SECOND(c) (c >= 0xdc && c <= 0xdf)
-static int EncLen_UTF16[] = {
+static const 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,
@@ -63,6 +63,12 @@ utf16be_is_mbc_newline(const UChar* p, const UChar* end)
if (p + 1 < end) {
if (*(p+1) == 0x0a && *p == 0x00)
return 1;
+#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
+ if ((*(p+1) == 0x0d || *(p+1) == 0x85) && *p == 0x00)
+ return 1;
+ if (*p == 0x20 && (*(p+1) == 0x29 || *(p+1) == 0x28))
+ return 1;
+#endif
}
return 0;
}
diff --git a/ext/mbstring/oniguruma/enc/utf16_le.c b/ext/mbstring/oniguruma/enc/utf16_le.c
index db892dcd1..93cc6138a 100755
--- a/ext/mbstring/oniguruma/enc/utf16_le.c
+++ b/ext/mbstring/oniguruma/enc/utf16_le.c
@@ -2,7 +2,7 @@
utf16_le.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
#define UTF16_IS_SURROGATE_FIRST(c) (c >= 0xd8 && c <= 0xdb)
#define UTF16_IS_SURROGATE_SECOND(c) (c >= 0xdc && c <= 0xdf)
-static int EncLen_UTF16[] = {
+static const 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,
@@ -69,6 +69,12 @@ utf16le_is_mbc_newline(const UChar* p, const UChar* end)
if (p + 1 < end) {
if (*p == 0x0a && *(p+1) == 0x00)
return 1;
+#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
+ if ((*p == 0x0d || *p == 0x85) && *(p+1) == 0x00)
+ return 1;
+ if (*(p+1) == 0x20 && (*p == 0x29 || *p == 0x28))
+ return 1;
+#endif
}
return 0;
}
diff --git a/ext/mbstring/oniguruma/enc/utf32_be.c b/ext/mbstring/oniguruma/enc/utf32_be.c
index 60feb040b..36b477286 100755
--- a/ext/mbstring/oniguruma/enc/utf32_be.c
+++ b/ext/mbstring/oniguruma/enc/utf32_be.c
@@ -2,7 +2,7 @@
utf32_be.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,14 @@ 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;
+#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
+ if ((*(p+3) == 0x0d || *(p+3) == 0x85)
+ && *(p+2) == 0 && *(p+1) == 0 && *p == 0x00)
+ return 1;
+ if (*(p+2) == 0x20 && (*(p+3) == 0x29 || *(p+3) == 0x28)
+ && *(p+1) == 0 && *p == 0)
+ return 1;
+#endif
}
return 0;
}
diff --git a/ext/mbstring/oniguruma/enc/utf32_le.c b/ext/mbstring/oniguruma/enc/utf32_le.c
index bba9689f7..1e9487d1d 100755
--- a/ext/mbstring/oniguruma/enc/utf32_le.c
+++ b/ext/mbstring/oniguruma/enc/utf32_le.c
@@ -2,7 +2,7 @@
utf32_le.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,14 @@ 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;
+#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
+ if ((*p == 0x0d || *p == 0x85) && *(p+1) == 0x00
+ && (p+2) == 0x00 && *(p+3) == 0x00)
+ return 1;
+ if (*(p+1) == 0x20 && (*p == 0x29 || *p == 0x28)
+ && *(p+2) == 0x00 && *(p+3) == 0x00)
+ return 1;
+#endif
}
return 0;
}
diff --git a/ext/mbstring/oniguruma/enc/utf8.c b/ext/mbstring/oniguruma/enc/utf8.c
index 592bebfe8..0e816176b 100644
--- a/ext/mbstring/oniguruma/enc/utf8.c
+++ b/ext/mbstring/oniguruma/enc/utf8.c
@@ -2,7 +2,7 @@
utf8.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,7 @@
#define utf8_islead(c) ((UChar )((c) & 0xc0) != 0x80)
-static int EncLen_UTF8[] = {
+static const 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,
@@ -65,6 +65,29 @@ utf8_mbc_enc_len(const UChar* p)
return EncLen_UTF8[*p];
}
+static int
+utf8_is_mbc_newline(const UChar* p, const UChar* end)
+{
+ if (p < end) {
+ if (*p == 0x0a) return 1;
+
+#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
+ if (*p == 0x0d) return 1;
+ if (p + 1 < end) {
+ if (*(p+1) == 0x85 && *p == 0xc2) /* U+0085 */
+ return 1;
+ if (p + 2 < end) {
+ if ((*(p+2) == 0xa8 || *(p+2) == 0xa9)
+ && *(p+1) == 0x80 && *p == 0xe2) /* U+2028, U+2029 */
+ return 1;
+ }
+ }
+#endif
+ }
+
+ return 0;
+}
+
static OnigCodePoint
utf8_mbc_to_code(const UChar* p, const UChar* end)
{
@@ -307,16 +330,16 @@ utf8_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end)
}
-static OnigCodePoint EmptyRange[] = { 0 };
+static const OnigCodePoint EmptyRange[] = { 0 };
-static OnigCodePoint SBAlnum[] = {
+static const OnigCodePoint SBAlnum[] = {
3,
0x0030, 0x0039,
0x0041, 0x005a,
0x0061, 0x007a
};
-static OnigCodePoint MBAlnum[] = {
+static const OnigCodePoint MBAlnum[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
411,
#else
@@ -738,13 +761,13 @@ static OnigCodePoint MBAlnum[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of MBAlnum */
-static OnigCodePoint SBAlpha[] = {
+static const OnigCodePoint SBAlpha[] = {
2,
0x0041, 0x005a,
0x0061, 0x007a
};
-static OnigCodePoint MBAlpha[] = {
+static const OnigCodePoint MBAlpha[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
394,
#else
@@ -1149,13 +1172,13 @@ static OnigCodePoint MBAlpha[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of MBAlpha */
-static OnigCodePoint SBBlank[] = {
+static const OnigCodePoint SBBlank[] = {
2,
0x0009, 0x0009,
0x0020, 0x0020
};
-static OnigCodePoint MBBlank[] = {
+static const OnigCodePoint MBBlank[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
7,
#else
@@ -1173,13 +1196,13 @@ static OnigCodePoint MBBlank[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of MBBlank */
-static OnigCodePoint SBCntrl[] = {
+static const OnigCodePoint SBCntrl[] = {
2,
0x0000, 0x001f,
0x007f, 0x007f
};
-static OnigCodePoint MBCntrl[] = {
+static const OnigCodePoint MBCntrl[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
18,
#else
@@ -1208,12 +1231,12 @@ static OnigCodePoint MBCntrl[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of MBCntrl */
-static OnigCodePoint SBDigit[] = {
+static const OnigCodePoint SBDigit[] = {
1,
0x0030, 0x0039
};
-static OnigCodePoint MBDigit[] = {
+static const OnigCodePoint MBDigit[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
22,
#else
@@ -1245,12 +1268,12 @@ static OnigCodePoint MBDigit[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of MBDigit */
-static OnigCodePoint SBGraph[] = {
+static const OnigCodePoint SBGraph[] = {
1,
0x0021, 0x007e
};
-static OnigCodePoint MBGraph[] = {
+static const OnigCodePoint MBGraph[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
404,
#else
@@ -1665,12 +1688,12 @@ static OnigCodePoint MBGraph[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of MBGraph */
-static OnigCodePoint SBLower[] = {
+static const OnigCodePoint SBLower[] = {
1,
0x0061, 0x007a
};
-static OnigCodePoint MBLower[] = {
+static const OnigCodePoint MBLower[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
423,
#else
@@ -2104,13 +2127,13 @@ static OnigCodePoint MBLower[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of MBLower */
-static OnigCodePoint SBPrint[] = {
+static const OnigCodePoint SBPrint[] = {
2,
0x0009, 0x000d,
0x0020, 0x007e
};
-static OnigCodePoint MBPrint[] = {
+static const OnigCodePoint MBPrint[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
403,
#else
@@ -2524,7 +2547,7 @@ static OnigCodePoint MBPrint[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of MBPrint */
-static OnigCodePoint SBPunct[] = {
+static const OnigCodePoint SBPunct[] = {
9,
0x0021, 0x0023,
0x0025, 0x002a,
@@ -2537,7 +2560,7 @@ static OnigCodePoint SBPunct[] = {
0x007d, 0x007d
}; /* end of SBPunct */
-static OnigCodePoint MBPunct[] = {
+static const OnigCodePoint MBPunct[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
77,
#else
@@ -2625,13 +2648,13 @@ static OnigCodePoint MBPunct[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of MBPunct */
-static OnigCodePoint SBSpace[] = {
+static const OnigCodePoint SBSpace[] = {
2,
0x0009, 0x000d,
0x0020, 0x0020
};
-static OnigCodePoint MBSpace[] = {
+static const OnigCodePoint MBSpace[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
9,
#else
@@ -2651,12 +2674,12 @@ static OnigCodePoint MBSpace[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of MBSpace */
-static OnigCodePoint SBUpper[] = {
+static const OnigCodePoint SBUpper[] = {
1,
0x0041, 0x005a
};
-static OnigCodePoint MBUpper[] = {
+static const OnigCodePoint MBUpper[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
420,
#else
@@ -3087,19 +3110,19 @@ static OnigCodePoint MBUpper[] = {
#endif /* USE_UNICODE_FULL_RANGE_CTYPE */
}; /* end of MBUpper */
-static OnigCodePoint SBXDigit[] = {
+static const OnigCodePoint SBXDigit[] = {
3,
0x0030, 0x0039,
0x0041, 0x0046,
0x0061, 0x0066
};
-static OnigCodePoint SBASCII[] = {
+static const OnigCodePoint SBASCII[] = {
1,
0x0000, 0x007f
};
-static OnigCodePoint SBWord[] = {
+static const OnigCodePoint SBWord[] = {
4,
0x0030, 0x0039,
0x0041, 0x005a,
@@ -3107,7 +3130,7 @@ static OnigCodePoint SBWord[] = {
0x0061, 0x007a
};
-static OnigCodePoint MBWord[] = {
+static const OnigCodePoint MBWord[] = {
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
432,
#else
@@ -3554,7 +3577,7 @@ static OnigCodePoint MBWord[] = {
static int
utf8_get_ctype_code_range(int ctype,
- OnigCodePoint* sbr[], OnigCodePoint* mbr[])
+ const OnigCodePoint* sbr[], const OnigCodePoint* mbr[])
{
#define CR_SET(sbl,mbl) do { \
*sbr = sbl; \
@@ -3622,7 +3645,7 @@ static int
utf8_is_code_ctype(OnigCodePoint code, unsigned int ctype)
{
#ifdef USE_UNICODE_FULL_RANGE_CTYPE
- OnigCodePoint *range;
+ const OnigCodePoint *range;
#endif
if (code < 256) {
@@ -3674,6 +3697,9 @@ utf8_is_code_ctype(OnigCodePoint code, unsigned int ctype)
case ONIGENC_CTYPE_ALNUM:
range = MBAlnum;
break;
+ case ONIGENC_CTYPE_NEWLINE:
+ return FALSE;
+ break;
default:
return ONIGENCERR_TYPE_BUG;
@@ -3723,7 +3749,7 @@ OnigEncodingType OnigEncodingUTF8 = {
, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
},
- onigenc_is_mbc_newline_0x0a,
+ utf8_is_mbc_newline,
utf8_mbc_to_code,
utf8_code_to_mbclen,
utf8_code_to_mbc,
diff --git a/ext/mbstring/oniguruma/index.html b/ext/mbstring/oniguruma/index.html
index 02e844c36..fbf4fc095 100755
--- a/ext/mbstring/oniguruma/index.html
+++ b/ext/mbstring/oniguruma/index.html
@@ -5,18 +5,10 @@
</head>
<body BGCOLOR="#ffffff" VLINK="#808040" TEXT="#696969">
-<!--
-<a href="http://miuras.net/matsushita.html">
-<img src="anti_matsushita.PNG" height="46" width="266">
-</a>
--->
-<a href="http://miuras.net/matsushita.html">M</a>
-<a href="http://www.micropac.co.jp/nec/">N</a>
-
<h1>Oniguruma</h1>
<p>
-2005/03/07 (C) K.Kosako
+2006/09/19 (C) K.Kosako
</p>
<p>
@@ -29,10 +21,13 @@ The characteristics of this library is that different character encoding
<dt><b>Supported character encodings:</b><br>
ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE,<br>
EUC-JP, EUC-TW, EUC-KR, EUC-CN,<br>
-Shift_JIS, Big5, KOI8-R, KOI8,<br>
+Shift_JIS, Big5, GB 18030, KOI8-R, KOI8,<br>
ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5,<br>
ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10,<br>
-ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16
+ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16<br>
+<font color="red">
+(GB 18030 encoding was contributed by KUBO Takehiro)
+</font>
</p>
</dl>
<p>
@@ -42,8 +37,8 @@ ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16
<dt><b>What's new</b>
</font>
<ul>
-<li>released Version 3.7.1 (2005/03/07)
-<li>released Version 2.4.2 (2005/03/05)
+<li>Version 4.4.4 released. (2006/09/19)
+<li>Version 2.5.7 released. (2006/07/28)
</ul>
</dl>
@@ -75,23 +70,24 @@ It follows the BSD license in the case of the one except for it.
<dt><b>Download:</b>
<ul>
-<li> <a href="archive/onigd20050307.tar.gz">Latest release version 3.7.1</a> (2005/03/07) <a href="HISTORY_3X.txt">Change Log</a>
-<li> <a href="archive/onigd20050219.tar.gz">3.7.0</a> (2005/02/19)
-<li> <a href="archive/onigd20050204.tar.gz">3.6.0</a> (2005/02/04)
-<li> <a href="archive/onigd2_4_2.tar.gz">Latest release version 2.4.2</a> (2005/03/05) <a href="HISTORY_2X.txt">Change Log</a>
-<li> <a href="archive/onigd2_4_1.tar.gz">2.4.1</a> (2005/01/05)
-<li> <a href="archive/onigd2_4_0.tar.gz">2.4.0</a> (2004/12/01)
+<li> <a href="archive/onig-4.4.4.tar.gz">Latest release version 4.4.4</a> (2006/09/19) <a href="HISTORY_4X.txt">Change Log</a>
+<li> <a href="archive/onig-4.4.3.tar.gz">4.4.3</a> (2006/09/15)
+<li> <a href="archive/onig-4.4.2.tar.gz">4.4.2</a> (2006/09/08)
+<li> <a href="archive/onig-4.4.1.tar.gz">4.4.1</a> (2006/08/29)
+<li> <a href="archive/onigd2_5_7.tar.gz">Latest release version 2.5.7</a> (2006/07/28) <a href="HISTORY_2X.txt">Change Log</a>
+<li> <a href="archive/onigd2_5_6.tar.gz">2.5.6</a> (2006/05/29)
+<li> <a href="archive/onigd2_5_5.tar.gz">2.5.5</a> (2006/05/08)
</ul>
<br>
<font color="red">
-* 3.X.X supports UTF-16/UTF-32, Ruby 1.9.X.<br>
-* 2.X.X does not support UTF-16/UTF-32, supports Ruby 1.6/1.8.
+* 4.X.X supports UTF-16/UTF-32, Ruby 1.9.X.<br>
+* 2.X.X does not support UTF-16/UTF-32, supports Ruby 1.6/1.8.[2-4]
</font>
<br>
<br>
-<dt><b>Documents:</b> (version 3.7.1)
+<dt><b>Documents:</b> (version 4.4.4)
<ul>
<li> <a href="doc/RE.txt">Regular Expressions</a>
<a href="doc/RE.ja.txt">(Japanese: EUC-JP)</a>
@@ -112,23 +108,39 @@ It follows the BSD license in the case of the one except for it.
<li> <a href="http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/oniguruma/">Oniguruma in Ruby CVS</a> (old version)
<li> <a href="http://raa.ruby-lang.org/project/oniguruma/">Oniguruma in RAA</a> (Ruby Application Archive)
<li> <a href="http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/">FreeBSD ports</a>
-<li> <a href="http://www.halbiz.com/osaru/cnregex.html">cnRegex 4D Plugin</a> (Japanese page)
+<li> <a href="http://www.softantenna.com/lib/1953/index.html">SoftAntenna &gt; Lib &gt; Oniguruma</a> (Japanese page)
+<li> <a href="http://homepage3.nifty.com/k-takata/mysoft/bregonig.html">bregonig.dll</a> (Japanese page)
+<li> <a href="http://www.halbiz.com/osaru/cnregex.html">cnRegex 4D Plugin (Mac OS X)</a> (Japanese page)
+<li> <a href="http://kmaebashi.com/">new script language crowbar</a> (Japanese page)
+<li> <a href="http://homepage2.nifty.com/Km/onig.htm">Delphi interface (Win32)</a> (Japanese page)
+<li> <a href="http://pyxis-project.net/ensemble/">Ensemble (Mac OS X)</a> (Japanese page)
<li> <a href="http://www.tom.sfc.keio.ac.jp/~sakai/d/?date=20050209">GHC patch</a> Masahiro Sakai (Japanese Blog)
-<li> <a href="http://www.gyazsquare.com/gyazmail/index.php">GyazMail</a>
-<li> <a href="http://www.artman21.net/">Jedit X</a>
+<li> <a href="http://www.gyazsquare.com/gyazmail/index.php">GyazMail (Mac OS X)</a>
+<li> <a href="http://www.artman21.net/">Jedit X (Mac OS X)</a>
<li> <a href="http://www.chitora.jp/lhaz.html">Lhaz</a> (Japanese page)
+<li> <a href="http://limechat.net/">LimeChat</a> (Japanese page)
<li> <a href="http://www.irori.org/tool/mregexp.html">mregexp</a> (Japanese page)
-<li> <a href="http://www.trinity-site.net/wiki/index.php?MultiFind">MultiFind</a> (Japanese page)
<li> <a href="http://ochusha.sourceforge.jp/">Ochusha</a> (Japanese page)
-<li> <a href="http://www-gauge.scphys.kyoto-u.ac.jp/~sonobe/OgreKit/index.html">OgreKit</a> Regular Expression Framework for Cocoa (Japanese page)
-<li> <a href ="http://www.kanetaka.net/4dapi/wiki4d.dll/4dcgi/wiki.cgi?plugins-oniguruma">OnigRegexp</a> (Japanese page)
-<li> <a href ="http://www.moriq.com/onig/">Oniguruma / FireBird (Win32)</a>
-<li> <a href ="http://openspace.timedia.co.jp/~yasuyuki/wiliki/wiliki.cgi?Oniguruma-mysqld&l=jp">Oniguruma-mysqld</a>
-<li> <a href ="http://www.kt.rim.or.jp/~kbk/sed/index.html">Onigsed (Win32)</a> (Japanese page)
+<li> <a href="http://www8.ocn.ne.jp/%7esonoisa/OgreKit/index.html">OgreKit (Mac OS X)</a> Regular Expression Framework for Cocoa (Japanese page)
+<li> <a href="http://www.kanetaka.net/4dapi/wiki4d.dll/4dcgi/wiki.cgi?plugins-oniguruma">OnigRegexp</a> (Japanese page)
+<li> <a href="http://www.moriq.com/onig/">Oniguruma / FireBird (Win32)</a>
+<li> <a href="http://openspace.timedia.co.jp/~yasuyuki/wiliki/wiliki.cgi?Oniguruma-mysqld&l=jp">Oniguruma-mysqld</a>
+<li> <a href="http://www.void.in/wiki/OnigPP">OnigPP</a> (Japanese page)
+<li> <a href="http://www.kt.rim.or.jp/~kbk/sed/index.html">Onigsed (Win32)</a> (Japanese page)
+<li> <a href="http://www.kt.rim.or.jp/~kbk/yagrep/index.html">yagrep (Win32)</a> (Japanese page)
<li> <a href="http://www.php.gr.jp/">Japan PHP User Group</a> PHP 5.0 mb_ereg (Japanese page)
+<li> <a href="http://yatsu.info/wiki/Pufui/">Pufui (Mac OS X)</a> (Japanese page)
+<li> <a href="http://harumune.s56.xrea.com/assari/index.php?RSSTyping">RSSTyping</a> (Japanese page)
<li> <a href="http://www.ruby-lang.org/">Ruby</a>
-<li> <a href="http://quux.s74.xrea.com/">SevenFour</a> (Japanese page)
-<li> <a href="http://www8.ocn.ne.jp/~sonoisa/TiddlyWikiPod/">TiddlyWikiPod</a>
+<li> <a href="http://tobysoft.net/wiki/index.php?Ruby%2Fruby-win32-oniguruma">ruby-win32-oniguruma</a> (Japanese page)
+<li> <a href="http://quux.s74.xrea.com/">SevenFour (Mac OS X)</a> (Japanese page)
+<li> <a href="http://storklab.cyber-ninja.jp/">Stork Lab. Products (Mac OS X)</a> (Japanese page)
+<li> <a href="http://sourceforge.jp/projects/ttssh2/">TeraTerm</a>
+<li> <a href="http://macromates.com/">TextMate (Mac OS X)</a>
+<li> <a href="http://www8.ocn.ne.jp/~sonoisa/TiddlyWikiPod/">TiddlyWikiPod (Mac OS X)</a>
+<li> <a href="http://www.cyanworks.net/mac.html">TunesTEXT (Mac OS X)</a>
+<li> <a href="http://sourceforge.jp/projects/frogger/">XML parser</a>
+<li> <a href="http://www.yokkasoft.net/">YokkaSoft</a>
</ul>
<br>
@@ -138,41 +150,41 @@ It follows the BSD license in the case of the one except for it.
<li> <a href="http://www.perldoc.com/perl5.8.0/pod/perlre.html">Perl regular expressions</a>
<li> <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html">java.util.regex.Pattern (J2SE 1.4.2)</a>
<li> <a href="http://www.opengroup.org/onlinepubs/007908799/xbd/re.html">The Open Group</a>
-<li> <a href="http://www.pcre.org/">PCRE</a>
-<!--
-<li> <a href="http://www.jajakarta.org/regexp/">Jakarta Project Regexp</a> (Japanese page)
-<li> <a href="http://www.jajakarta.org/oro/">Jakarta Project ORO</a> (Japanese page)
--->
-<li> <a href="http://www.kt.rim.or.jp/~kbk/regex/regex.html">Regular expressions memo</a> (Japanese page)
-<li> <a href="http://www.din.or.jp/~ohzaki/regex.htm">Regular expressions technique</a> (Japanese page)
<li> <a href="http://regex.info/">Mastering Regular Expressions</a>
+<li> <a href="http://www.unicode.org/">Unicode Home Page</a>
</ul>
<br>
-<!--
-<dt><b>ToDo:</b>
+<dt><b>Resources:</b>
<ul>
-<li> support character types for all code point range.
+<li> <a href="http://www.kt.rim.or.jp/~kbk/regex/regex.html">Regular expressions memo</a> (Japanese page)
+<li> <a href="http://www.din.or.jp/~ohzaki/regex.htm">Regular expressions technique</a> (Japanese page)
+<li> <a href="http://staff.aist.go.jp/tanaka-akira/textprocess/">"Text Processing" Lecture documents (Tanaka Akira)</a> (Japanese page)
</ul>
--->
+
+<br>
</dl>
<p>
and I'm thankful to Akinori MUSHA.
</p>
-<!--
<hr>
-<font color="red">
-2004-06-14<br>
-To: "Greg A. Woods"<br>
-I can't send mail to you. (rejected)<br>
-Please set the nmatch argument of regexec() to 1,
-and use Oniguruma 3.7.1 or 2.4.2.<br>
-The nmatch argument should be array size of a pmatch.<br>
-But I don't know whether this problem is related to the crash
-that you reported.
-</font>
--->
+<dl>
+<dt><b>Other Libraries:</b>
+<ul>
+<li> <a href="http://www.boost.org/libs/regex/doc/">Boost.Regex</a>
+<li> <a href="http://www.pcre.org/">PCRE</a>
+<li> <a href="http://arglist.com/regex/">A copy of Henry Spencer's</a>
+<li> <a href="http://re2c.org/">re2c</a>
+<li> <a href="http://tiny-rex.sourceforge.net/">T-Rex</a>
+<li> <a href="http://laurikari.net/tre/">TRE</a>
+<li> <a href="http://www.cacas.org/java/gnu/regexp/">gnu.regexp for Java</a>
+<li> <a href="http://jakarta.apache.org/regexp/index.html">Jakarta Project Regexp</a>
+<li> <a href="http://jakarta.apache.org/oro/">Jakarta Project ORO</a>
+</ul>
+</dl>
+
<hr>
+<a href="../">Back to Home</a>
</body>
</html>
diff --git a/ext/mbstring/oniguruma/onigcmpt200.h b/ext/mbstring/oniguruma/onigcmpt200.h
index 4c029304b..d9b141914 100644
--- a/ext/mbstring/oniguruma/onigcmpt200.h
+++ b/ext/mbstring/oniguruma/onigcmpt200.h
@@ -29,6 +29,12 @@
#define REGCODE_EUCJP REG_ENCODING_EUC_JP
#define REGCODE_SJIS REG_ENCODING_SJIS
+/* Don't use REGCODE_XXXX. (obsoleted) */
+#define MBCTYPE_ASCII RE_MBCTYPE_ASCII
+#define MBCTYPE_EUC RE_MBCTYPE_EUC
+#define MBCTYPE_SJIS RE_MBCTYPE_SJIS
+#define MBCTYPE_UTF8 RE_MBCTYPE_UTF8
+
typedef unsigned char* RegTransTableType;
#define RegOptionType OnigOptionType
#define RegDistance OnigDistance
diff --git a/ext/mbstring/oniguruma/oniggnu.h b/ext/mbstring/oniguruma/oniggnu.h
index b203f6c8a..3da9f235c 100644
--- a/ext/mbstring/oniguruma/oniggnu.h
+++ b/ext/mbstring/oniguruma/oniggnu.h
@@ -35,10 +35,10 @@
extern "C" {
#endif
-#define MBCTYPE_ASCII 0
-#define MBCTYPE_EUC 1
-#define MBCTYPE_SJIS 2
-#define MBCTYPE_UTF8 3
+#define RE_MBCTYPE_ASCII 0
+#define RE_MBCTYPE_EUC 1
+#define RE_MBCTYPE_SJIS 2
+#define RE_MBCTYPE_UTF8 3
/* GNU regex options */
#ifndef RE_NREGS
diff --git a/ext/mbstring/oniguruma/oniguruma.h b/ext/mbstring/oniguruma/oniguruma.h
index 279035610..a0107cbe3 100644
--- a/ext/mbstring/oniguruma/oniguruma.h
+++ b/ext/mbstring/oniguruma/oniguruma.h
@@ -4,7 +4,7 @@
oniguruma.h - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,9 +36,9 @@ extern "C" {
#endif
#define ONIGURUMA
-#define ONIGURUMA_VERSION_MAJOR 3
-#define ONIGURUMA_VERSION_MINOR 7
-#define ONIGURUMA_VERSION_TEENY 1
+#define ONIGURUMA_VERSION_MAJOR 4
+#define ONIGURUMA_VERSION_MINOR 4
+#define ONIGURUMA_VERSION_TEENY 4
#ifdef __cplusplus
# ifndef HAVE_PROTOTYPES
@@ -49,6 +49,13 @@ extern "C" {
# endif
#endif
+/* escape Mac OS X/Xcode 2.4/gcc 4.0.1 problem */
+#if defined(__APPLE__) && defined(__GNUC__) && __GNUC__ >= 4
+# ifndef HAVE_STDARG_PROTOTYPES
+# define HAVE_STDARG_PROTOTYPES 1
+# endif
+#endif
+
#ifndef P_
#if defined(__STDC__) || defined(_WIN32)
# define P_(args) args
@@ -167,10 +174,10 @@ typedef struct {
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 (*get_all_pair_ambig_codes)(OnigAmbigType flag, const OnigPairAmbigCodes** acs);
+ int (*get_all_comp_ambig_codes)(OnigAmbigType flag, const OnigCompAmbigCodes** acs);
int (*is_code_ctype)(OnigCodePoint code, unsigned int ctype);
- int (*get_ctype_code_range)(int ctype, OnigCodePoint* sb_range[], OnigCodePoint* mb_range[]);
+ int (*get_ctype_code_range)(int ctype, const OnigCodePoint* sb_range[], const 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;
@@ -206,6 +213,7 @@ ONIG_EXTERN OnigEncodingType OnigEncodingSJIS;
ONIG_EXTERN OnigEncodingType OnigEncodingKOI8;
ONIG_EXTERN OnigEncodingType OnigEncodingKOI8_R;
ONIG_EXTERN OnigEncodingType OnigEncodingBIG5;
+ONIG_EXTERN OnigEncodingType OnigEncodingGB18030;
#define ONIG_ENCODING_ASCII (&OnigEncodingASCII)
#define ONIG_ENCODING_ISO_8859_1 (&OnigEncodingISO_8859_1)
@@ -236,6 +244,7 @@ ONIG_EXTERN OnigEncodingType OnigEncodingBIG5;
#define ONIG_ENCODING_KOI8 (&OnigEncodingKOI8)
#define ONIG_ENCODING_KOI8_R (&OnigEncodingKOI8_R)
#define ONIG_ENCODING_BIG5 (&OnigEncodingBIG5)
+#define ONIG_ENCODING_GB18030 (&OnigEncodingGB18030)
#endif /* else RUBY && M17N */
@@ -448,7 +457,7 @@ int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
#define ONIG_NREGION 10
#define ONIG_MAX_BACKREF_NUM 1000
#define ONIG_MAX_REPEAT_NUM 100000
-#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 1000
+#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000
/* constants */
#define ONIG_MAX_ERROR_MESSAGE_LEN 90
@@ -457,8 +466,8 @@ 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_NONE 0U
+#define ONIG_OPTION_IGNORECASE 1U
#define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1)
#define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1)
#define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1)
@@ -471,6 +480,7 @@ typedef unsigned int OnigOptionType;
#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_MAXBIT ONIG_OPTION_POSIX_REGION /* limit */
#define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))
#define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))
@@ -484,6 +494,7 @@ typedef struct {
OnigOptionType options; /* default option */
} OnigSyntaxType;
+ONIG_EXTERN OnigSyntaxType OnigSyntaxASIS;
ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixBasic;
ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixExtended;
ONIG_EXTERN OnigSyntaxType OnigSyntaxEmacs;
@@ -491,9 +502,11 @@ ONIG_EXTERN OnigSyntaxType OnigSyntaxGrep;
ONIG_EXTERN OnigSyntaxType OnigSyntaxGnuRegex;
ONIG_EXTERN OnigSyntaxType OnigSyntaxJava;
ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl;
+ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl_NG;
ONIG_EXTERN OnigSyntaxType OnigSyntaxRuby;
/* predefined syntaxes (see regsyntax.c) */
+#define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)
#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)
#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)
#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)
@@ -501,6 +514,7 @@ ONIG_EXTERN OnigSyntaxType OnigSyntaxRuby;
#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)
#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)
#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)
+#define ONIG_SYNTAX_PERL_NG (&OnigSyntaxPerl_NG)
#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)
/* default syntax */
@@ -508,80 +522,81 @@ 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) /* (?<name>...) */
-#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1<<8) /* \k<name> */
-#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1<<9) /* \g<name>, \g<n> */
-#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1<<10) /* (?@..),(?@<x>..) */
-#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 */
+#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS (1U<<0)
+#define ONIG_SYN_OP_DOT_ANYCHAR (1U<<1) /* . */
+#define ONIG_SYN_OP_ASTERISK_ZERO_INF (1U<<2) /* * */
+#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (1U<<3)
+#define ONIG_SYN_OP_PLUS_ONE_INF (1U<<4) /* + */
+#define ONIG_SYN_OP_ESC_PLUS_ONE_INF (1U<<5)
+#define ONIG_SYN_OP_QMARK_ZERO_ONE (1U<<6) /* ? */
+#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (1U<<7)
+#define ONIG_SYN_OP_BRACE_INTERVAL (1U<<8) /* {lower,upper} */
+#define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1U<<9) /* \{lower,upper\} */
+#define ONIG_SYN_OP_VBAR_ALT (1U<<10) /* | */
+#define ONIG_SYN_OP_ESC_VBAR_ALT (1U<<11) /* \| */
+#define ONIG_SYN_OP_LPAREN_SUBEXP (1U<<12) /* (...) */
+#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP (1U<<13) /* \(...\) */
+#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (1U<<14) /* \A, \Z, \z */
+#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (1U<<15) /* \G */
+#define ONIG_SYN_OP_DECIMAL_BACKREF (1U<<16) /* \num */
+#define ONIG_SYN_OP_BRACKET_CC (1U<<17) /* [...] */
+#define ONIG_SYN_OP_ESC_W_WORD (1U<<18) /* \w, \W */
+#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (1U<<19) /* \<. \> */
+#define ONIG_SYN_OP_ESC_B_WORD_BOUND (1U<<20) /* \b, \B */
+#define ONIG_SYN_OP_ESC_S_WHITE_SPACE (1U<<21) /* \s, \S */
+#define ONIG_SYN_OP_ESC_D_DIGIT (1U<<22) /* \d, \D */
+#define ONIG_SYN_OP_LINE_ANCHOR (1U<<23) /* ^, $ */
+#define ONIG_SYN_OP_POSIX_BRACKET (1U<<24) /* [:xxxx:] */
+#define ONIG_SYN_OP_QMARK_NON_GREEDY (1U<<25) /* ??,*?,+?,{n,m}? */
+#define ONIG_SYN_OP_ESC_CONTROL_CHARS (1U<<26) /* \n,\r,\t,\a ... */
+#define ONIG_SYN_OP_ESC_C_CONTROL (1U<<27) /* \cx */
+#define ONIG_SYN_OP_ESC_OCTAL3 (1U<<28) /* \OOO */
+#define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */
+#define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */
+
+#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */
+#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */
+#define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsx),(?-imsx) */
+#define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imx), (?-imx) */
+#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1U<<4) /* ?+,*+,++ */
+#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1U<<5) /* {n,m}+ */
+#define ONIG_SYN_OP2_CCLASS_SET_OP (1U<<6) /* [...&&..[..]..] */
+#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (1U<<7) /* (?<name>...) */
+#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1U<<8) /* \k<name> */
+#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1U<<9) /* \g<name>, \g<n> */
+#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1U<<10) /* (?@..),(?@<x>..) */
+#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (1U<<11) /* \C-x */
+#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (1U<<12) /* \M-x */
+#define ONIG_SYN_OP2_ESC_V_VTAB (1U<<13) /* \v as VTAB */
+#define ONIG_SYN_OP2_ESC_U_HEX4 (1U<<14) /* \uHHHH */
+#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (1U<<15) /* \`, \' */
+#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (1U<<16) /* \p{...}, \P{...} */
+#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1U<<17) /* \p{^..}, \P{^..} */
+#define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1U<<18) /* \p{IsXDigit} */
+#define ONIG_SYN_OP2_ESC_H_XDIGIT (1U<<19) /* \h, \H */
+#define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U<<20) /* \ */
/* 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) /* (?<x>)(?<x>) */
-#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1<<9) /* a{n}?=(?:a{n})? */
+#define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1U<<31) /* not implemented */
+#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (1U<<0) /* ?, *, +, {n,m} */
+#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (1U<<1) /* error or ignore */
+#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (1U<<2) /* ...)... */
+#define ONIG_SYN_ALLOW_INVALID_INTERVAL (1U<<3) /* {??? */
+#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (1U<<4) /* {,n} => {0,n} */
+#define ONIG_SYN_STRICT_CHECK_BACKREF (1U<<5) /* /(\1)/,/\1()/ ..*/
+#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (1U<<6) /* (?<=a|bc) */
+#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1U<<7) /* see doc/RE */
+#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U<<8) /* (?<x>)(?<x>) */
+#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U<<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] */
+#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1U<<20) /* [^...] */
+#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (1U<<21) /* [..\w..] etc.. */
+#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (1U<<22)
+#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (1U<<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*)+ */
+#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1U<<24) /* [,-,] */
+#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1U<<25) /* (?:a*)+ */
/* meta character specifiers (onig_set_meta_char()) */
#define ONIG_META_CHAR_ESCAPE 0
@@ -660,6 +675,7 @@ ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;
#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401
#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402
+#define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403
/* errors related to thread */
#define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001
@@ -735,6 +751,7 @@ typedef struct re_pattern_buffer {
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_comb_exp_check; /* combination explosion check */
int num_call; /* number of subexp call */
unsigned int capture_history; /* (?@...) flag (1-31) */
unsigned int bt_mem_start; /* need backtrack flag */
@@ -766,7 +783,13 @@ typedef struct re_pattern_buffer {
/* regex_t link chain */
struct re_pattern_buffer* chain; /* escape compile-conflict */
-} regex_t;
+} OnigRegexType;
+
+typedef OnigRegexType* OnigRegex;
+
+#ifndef ONIG_ESCAPE_REGEX_T_COLLISION
+ typedef OnigRegexType regex_t;
+#endif
typedef struct {
@@ -788,19 +811,19 @@ 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));
+int onig_new P_((OnigRegex*, 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));
+int onig_new_deluxe P_((OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));
ONIG_EXTERN
-void onig_free P_((regex_t*));
+void onig_free P_((OnigRegex));
ONIG_EXTERN
-int onig_recompile P_((regex_t*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));
+int onig_recompile P_((OnigRegex, 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));
+int onig_recompile_deluxe P_((OnigRegex 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));
+int onig_search P_((OnigRegex, 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));
+int onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));
ONIG_EXTERN
OnigRegion* onig_region_new P_((void));
ONIG_EXTERN
@@ -816,29 +839,31 @@ 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));
+int onig_name_to_group_numbers P_((OnigRegex 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));
+int onig_name_to_backref_number P_((OnigRegex 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));
+int onig_foreach_name P_((OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg));
ONIG_EXTERN
-int onig_number_of_names P_((regex_t* reg));
+int onig_number_of_names P_((OnigRegex reg));
ONIG_EXTERN
-int onig_number_of_captures P_((regex_t* reg));
+int onig_number_of_captures P_((OnigRegex reg));
ONIG_EXTERN
-int onig_number_of_capture_histories P_((regex_t* reg));
+int onig_number_of_capture_histories P_((OnigRegex 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));
+int onig_noname_group_capture_is_active P_((OnigRegex reg));
+ONIG_EXTERN
+OnigEncoding onig_get_encoding P_((OnigRegex reg));
ONIG_EXTERN
-OnigOptionType onig_get_options P_((regex_t* reg));
+OnigOptionType onig_get_options P_((OnigRegex reg));
ONIG_EXTERN
-OnigAmbigType onig_get_ambig_flag P_((regex_t* reg));
+OnigAmbigType onig_get_ambig_flag P_((OnigRegex reg));
ONIG_EXTERN
-OnigSyntaxType* onig_get_syntax P_((regex_t* reg));
+OnigSyntaxType* onig_get_syntax P_((OnigRegex reg));
ONIG_EXTERN
int onig_set_default_syntax P_((OnigSyntaxType* syntax));
ONIG_EXTERN
diff --git a/ext/mbstring/oniguruma/regcomp.c b/ext/mbstring/oniguruma/regcomp.c
index a2315fcec..9b862657d 100644
--- a/ext/mbstring/oniguruma/regcomp.c
+++ b/ext/mbstring/oniguruma/regcomp.c
@@ -2,7 +2,7 @@
regcomp.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -186,6 +186,17 @@ add_opcode(regex_t* reg, int opcode)
return 0;
}
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+static int
+add_state_check_num(regex_t* reg, int num)
+{
+ StateCheckNumType n = (StateCheckNumType )num;
+
+ BBUF_ADD(reg, &n, SIZE_STATE_CHECK_NUM);
+ return 0;
+}
+#endif
+
static int
add_rel_addr(regex_t* reg, int addr)
{
@@ -644,7 +655,7 @@ entry_repeat_range(regex_t* reg, int id, int lower, int upper)
}
p[id].lower = lower;
- p[id].upper = upper;
+ p[id].upper = (IS_REPEAT_INFINITE(upper) ? 0x7fffffff : upper);
return 0;
}
@@ -684,7 +695,254 @@ compile_range_repeat_node(QualifierNode* qn, int target_len, int empty_info,
return r;
}
+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;
+}
+
#define QUALIFIER_EXPAND_LIMIT_SIZE 50
+#define CKN_ON (ckn > 0)
+
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+
+static int
+compile_length_qualifier_node(QualifierNode* qn, regex_t* reg)
+{
+ int len, mod_tlen, cklen;
+ int ckn;
+ 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;
+
+ ckn = ((reg->num_comb_exp_check > 0) ? qn->comb_exp_check_num : 0);
+
+ cklen = (CKN_ON ? SIZE_STATE_CHECK_NUM: 0);
+
+ /* anychar repeat */
+ if (NTYPE(qn->target) == N_ANYCHAR) {
+ if (qn->greedy && infinite) {
+ if (IS_NOT_NULL(qn->next_head_exact) && !CKN_ON)
+ return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower + cklen;
+ else
+ return SIZE_OP_ANYCHAR_STAR + tlen * qn->lower + cklen;
+ }
+ }
+
+ 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) {
+ if (qn->greedy) {
+ if (qn->lower == 1)
+ len = SIZE_OP_JUMP;
+ else
+ len = 0;
+
+ len += SIZE_OP_PUSH + cklen + mod_tlen + SIZE_OP_JUMP;
+ }
+ else {
+ if (qn->lower == 0)
+ len = SIZE_OP_JUMP;
+ else
+ len = 0;
+
+ len += mod_tlen + SIZE_OP_PUSH + cklen;
+ }
+ }
+ else if (qn->upper == 0) {
+ if (qn->is_refered != 0) /* /(?<n>..){0}/ */
+ len = SIZE_OP_JUMP + tlen;
+ else
+ len = 0;
+ }
+ else if (qn->upper == 1 && qn->greedy) {
+ if (qn->lower == 0) {
+ if (CKN_ON) {
+ len = SIZE_OP_STATE_CHECK_PUSH + tlen;
+ }
+ else {
+ len = SIZE_OP_PUSH + tlen;
+ }
+ }
+ else {
+ len = tlen;
+ }
+ }
+ else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) { /* '??' */
+ len = SIZE_OP_PUSH + cklen + SIZE_OP_JUMP + tlen;
+ }
+ else {
+ len = SIZE_OP_REPEAT_INC
+ + mod_tlen + SIZE_OPCODE + SIZE_RELADDR + SIZE_MEMNUM;
+ if (CKN_ON)
+ len += SIZE_OP_STATE_CHECK;
+ }
+
+ return len;
+}
+
+static int
+compile_qualifier_node(QualifierNode* qn, regex_t* reg)
+{
+ int r, mod_tlen;
+ int ckn;
+ 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;
+
+ ckn = ((reg->num_comb_exp_check > 0) ? qn->comb_exp_check_num : 0);
+
+ 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) && !CKN_ON) {
+ 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;
+ if (CKN_ON) {
+ r = add_state_check_num(reg, ckn);
+ if (r) return r;
+ }
+
+ return add_bytes(reg, NSTRING(qn->next_head_exact).s, 1);
+ }
+ else {
+ if (IS_MULTILINE(reg->options)) {
+ r = add_opcode(reg, (CKN_ON ?
+ OP_STATE_CHECK_ANYCHAR_ML_STAR
+ : OP_ANYCHAR_ML_STAR));
+ }
+ else {
+ r = add_opcode(reg, (CKN_ON ?
+ OP_STATE_CHECK_ANYCHAR_STAR
+ : OP_ANYCHAR_STAR));
+ }
+ if (r) return r;
+ if (CKN_ON)
+ r = add_state_check_num(reg, ckn);
+
+ return r;
+ }
+ }
+
+ 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) {
+ if (qn->greedy) {
+ if (qn->lower == 1) {
+ r = add_opcode_rel_addr(reg, OP_JUMP,
+ (CKN_ON ? SIZE_OP_STATE_CHECK_PUSH : SIZE_OP_PUSH));
+ if (r) return r;
+ }
+
+ if (CKN_ON) {
+ r = add_opcode(reg, OP_STATE_CHECK_PUSH);
+ if (r) return r;
+ r = add_state_check_num(reg, ckn);
+ if (r) return r;
+ r = add_rel_addr(reg, mod_tlen + SIZE_OP_JUMP);
+ }
+ 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 )(CKN_ON ? SIZE_OP_STATE_CHECK_PUSH : SIZE_OP_PUSH)));
+ }
+ else {
+ if (qn->lower == 0) {
+ 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;
+ if (CKN_ON) {
+ r = add_opcode(reg, OP_STATE_CHECK_PUSH_OR_JUMP);
+ if (r) return r;
+ r = add_state_check_num(reg, ckn);
+ if (r) return r;
+ r = add_rel_addr(reg,
+ -(mod_tlen + (int )SIZE_OP_STATE_CHECK_PUSH_OR_JUMP));
+ }
+ else
+ r = add_opcode_rel_addr(reg, OP_PUSH, -(mod_tlen + (int )SIZE_OP_PUSH));
+ }
+ }
+ else if (qn->upper == 0) {
+ if (qn->is_refered != 0) { /* /(?<n>..){0}/ */
+ r = add_opcode_rel_addr(reg, OP_JUMP, tlen);
+ if (r) return r;
+ r = compile_tree(qn->target, reg);
+ }
+ else
+ r = 0;
+ }
+ else if (qn->upper == 1 && qn->greedy) {
+ if (qn->lower == 0) {
+ if (CKN_ON) {
+ r = add_opcode(reg, OP_STATE_CHECK_PUSH);
+ if (r) return r;
+ r = add_state_check_num(reg, ckn);
+ if (r) return r;
+ r = add_rel_addr(reg, tlen);
+ }
+ else {
+ r = add_opcode_rel_addr(reg, OP_PUSH, tlen);
+ }
+ if (r) return r;
+ }
+
+ r = compile_tree(qn->target, reg);
+ }
+ else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) { /* '??' */
+ if (CKN_ON) {
+ r = add_opcode(reg, OP_STATE_CHECK_PUSH);
+ if (r) return r;
+ r = add_state_check_num(reg, ckn);
+ if (r) return r;
+ r = add_rel_addr(reg, SIZE_OP_JUMP);
+ }
+ else {
+ 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);
+ if (CKN_ON) {
+ if (r) return r;
+ r = add_opcode(reg, OP_STATE_CHECK);
+ if (r) return r;
+ r = add_state_check_num(reg, ckn);
+ }
+ }
+ return r;
+}
+
+#else /* USE_COMBINATION_EXPLOSION_CHECK */
static int
compile_length_qualifier_node(QualifierNode* qn, regex_t* reg)
@@ -752,16 +1010,6 @@ compile_length_qualifier_node(QualifierNode* qn, regex_t* reg)
}
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;
@@ -887,6 +1135,7 @@ compile_qualifier_node(QualifierNode* qn, regex_t* reg)
}
return r;
}
+#endif /* USE_COMBINATION_EXPLOSION_CHECK */
static int
compile_length_option_node(EffectNode* node, regex_t* reg)
@@ -1268,8 +1517,15 @@ compile_length_tree(Node* node, regex_t* reg)
{
BackrefNode* br = &(NBACKREF(node));
+#ifdef USE_BACKREF_AT_LEVEL
+ if (IS_BACKREF_NEST_LEVEL(br)) {
+ r = SIZE_OPCODE + SIZE_OPTION + SIZE_LENGTH +
+ SIZE_LENGTH + (SIZE_MEMNUM * br->back_num);
+ }
+ else
+#endif
if (br->back_num == 1) {
- r = ((!IS_IGNORECASE(reg->options) && br->back_static[0] <= 3)
+ r = ((!IS_IGNORECASE(reg->options) && br->back_static[0] <= 2)
? SIZE_OPCODE : (SIZE_OPCODE + SIZE_MEMNUM));
}
else {
@@ -1381,9 +1637,21 @@ compile_tree(Node* node, regex_t* reg)
case N_BACKREF:
{
- int i;
BackrefNode* br = &(NBACKREF(node));
+#ifdef USE_BACKREF_AT_LEVEL
+ if (IS_BACKREF_NEST_LEVEL(br)) {
+ r = add_opcode(reg, OP_BACKREF_AT_LEVEL);
+ if (r) return r;
+ r = add_option(reg, (reg->options & ONIG_OPTION_IGNORECASE));
+ if (r) return r;
+ r = add_length(reg, br->nest_level);
+ if (r) return r;
+
+ goto add_bacref_mems;
+ }
+ else
+#endif
if (br->back_num == 1) {
n = br->back_static[0];
if (IS_IGNORECASE(reg->options)) {
@@ -1395,7 +1663,6 @@ compile_tree(Node* node, regex_t* reg)
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;
@@ -1405,17 +1672,21 @@ compile_tree(Node* node, regex_t* reg)
}
}
else {
+ int i;
int* p;
if (IS_IGNORECASE(reg->options)) {
- add_opcode(reg, OP_BACKREF_MULTI_IC);
+ r = add_opcode(reg, OP_BACKREF_MULTI_IC);
}
else {
- add_opcode(reg, OP_BACKREF_MULTI);
+ r = add_opcode(reg, OP_BACKREF_MULTI);
}
-
if (r) return r;
- add_length(reg, br->back_num);
+
+#ifdef USE_BACKREF_AT_LEVEL
+ add_bacref_mems:
+#endif
+ r = add_length(reg, br->back_num);
if (r) return r;
p = BACKREFS_P(br);
for (i = br->back_num - 1; i >= 0; i--) {
@@ -2120,29 +2391,6 @@ 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)
@@ -2516,6 +2764,9 @@ subexp_inf_recursive_check(Node* node, ScanEnv* env, int head)
case N_QUALIFIER:
r = subexp_inf_recursive_check(NQUALIFIER(node).target, env, head);
+ if (r == RECURSION_EXIST) {
+ if (NQUALIFIER(node).lower == 0) r = 0;
+ }
break;
case N_ANCHOR:
@@ -2943,15 +3194,55 @@ next_setup(Node* node, Node* next_node, regex_t* reg)
return 0;
}
+
+static int
+divide_ambig_string_node_sub(regex_t* reg, int prev_ambig,
+ UChar* prev_start, UChar* prev,
+ UChar* end, Node*** tailp, Node** root)
+{
+ UChar *tmp, *wp;
+ Node* snode;
+
+ 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);
+ }
+
+ 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;
+ int r;
start = prev_start = p = sn->s;
end = sn->end;
@@ -2964,33 +3255,9 @@ divide_ambig_string_node(Node* node, regex_t* reg)
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);
- }
+ r = divide_ambig_string_node_sub(reg, prev_ambig, prev_start, prev,
+ end, &tailp, &root);
+ if (r != 0) return r;
prev_ambig = ambig;
prev_start = prev;
@@ -3011,41 +3278,157 @@ divide_ambig_string_node(Node* node, regex_t* reg)
}
}
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);
+ r = divide_ambig_string_node_sub(reg, prev_ambig, prev_start, end,
+ end, &tailp, &root);
+ if (r != 0) return r;
+
+ swap_node(node, root);
+ onig_node_str_clear(root); /* should be after swap! */
+ onig_node_free(root); /* free original string node */
+ }
+
+ return 0;
+}
+
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+
+#define CEC_THRES_NUM_BIG_REPEAT 512
+#define CEC_INFINITE_NUM 0x7fffffff
+
+#define CEC_IN_INFINITE_REPEAT (1<<0)
+#define CEC_IN_FINITE_REPEAT (1<<1)
+#define CEC_CONT_BIG_REPEAT (1<<2)
+
+static int
+setup_comb_exp_check(Node* node, int state, ScanEnv* env)
+{
+ int type;
+ int r = state;
+
+ type = NTYPE(node);
+ switch (type) {
+ case N_LIST:
+ {
+ Node* prev = NULL_NODE;
+ do {
+ r = setup_comb_exp_check(NCONS(node).left, r, env);
+ prev = NCONS(node).left;
+ } while (r >= 0 && IS_NOT_NULL(node = NCONS(node).right));
}
- else {
- snode = onig_node_new_str(prev_start, end);
- CHECK_NULL_RETURN_VAL(snode, ONIGERR_MEMORY);
+ break;
+
+ case N_ALT:
+ {
+ int ret;
+ do {
+ ret = setup_comb_exp_check(NCONS(node).left, state, env);
+ r |= ret;
+ } while (ret >= 0 && IS_NOT_NULL(node = NCONS(node).right));
}
+ break;
+
+ case N_QUALIFIER:
+ {
+ int child_state = state;
+ int add_state = 0;
+ QualifierNode* qn = &(NQUALIFIER(node));
+ Node* target = qn->target;
+ int var_num;
+
+ if (! IS_REPEAT_INFINITE(qn->upper)) {
+ if (qn->upper > 1) {
+ /* {0,1}, {1,1} are allowed */
+ child_state |= CEC_IN_FINITE_REPEAT;
+
+ /* check (a*){n,m}, (a+){n,m} => (a*){n,n}, (a+){n,n} */
+ if (env->backrefed_mem == 0) {
+ if (NTYPE(qn->target) == N_EFFECT) {
+ EffectNode* en = &(NEFFECT(qn->target));
+ if (en->type == EFFECT_MEMORY) {
+ if (NTYPE(en->target) == N_QUALIFIER) {
+ QualifierNode* q = &(NQUALIFIER(en->target));
+ if (IS_REPEAT_INFINITE(q->upper)
+ && q->greedy == qn->greedy) {
+ qn->upper = (qn->lower == 0 ? 1 : qn->lower);
+ if (qn->upper == 1)
+ child_state = state;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (state & CEC_IN_FINITE_REPEAT) {
+ qn->comb_exp_check_num = -1;
+ }
+ else {
+ if (IS_REPEAT_INFINITE(qn->upper)) {
+ var_num = CEC_INFINITE_NUM;
+ child_state |= CEC_IN_INFINITE_REPEAT;
+ }
+ else {
+ var_num = qn->upper - qn->lower;
+ }
- if (tailp == (Node** )0) {
- root = onig_node_new_list(snode, NULL);
- CHECK_NULL_RETURN_VAL(root, ONIGERR_MEMORY);
- tailp = &(NCONS(node).right);
+ if (var_num >= CEC_THRES_NUM_BIG_REPEAT)
+ add_state |= CEC_CONT_BIG_REPEAT;
+
+ if (((state & CEC_IN_INFINITE_REPEAT) != 0 && var_num != 0) ||
+ ((state & CEC_CONT_BIG_REPEAT) != 0 &&
+ var_num >= CEC_THRES_NUM_BIG_REPEAT)) {
+ if (qn->comb_exp_check_num == 0) {
+ env->num_comb_exp_check++;
+ qn->comb_exp_check_num = env->num_comb_exp_check;
+ if (env->curr_max_regnum > env->comb_exp_max_regnum)
+ env->comb_exp_max_regnum = env->curr_max_regnum;
+ }
+ }
+ }
+
+ r = setup_comb_exp_check(target, child_state, env);
+ r |= add_state;
}
- else {
- *tailp = onig_node_new_list(snode, NULL);
- CHECK_NULL_RETURN_VAL(*tailp, ONIGERR_MEMORY);
- tailp = &(NCONS(*tailp).right);
+ break;
+
+ case N_EFFECT:
+ {
+ EffectNode* en = &(NEFFECT(node));
+
+ switch (en->type) {
+ case EFFECT_MEMORY:
+ {
+ if (env->curr_max_regnum < en->regnum)
+ env->curr_max_regnum = en->regnum;
+
+ r = setup_comb_exp_check(en->target, state, env);
+ }
+ break;
+
+ default:
+ r = setup_comb_exp_check(en->target, state, env);
+ break;
+ }
}
+ break;
- swap_node(node, root);
- onig_node_str_clear(root); /* should be after swap! */
- onig_node_free(root); /* free original string node */
+#ifdef USE_SUBEXP_CALL
+ case N_CALL:
+ if (IS_CALL_RECURSION(&(NCALL(node))))
+ env->has_recursion = 1;
+ else
+ r = setup_comb_exp_check(NCALL(node).target, state, env);
+ break;
+#endif
+
+ default:
+ break;
}
- return 0;
+ return r;
}
+#endif
#define IN_ALT (1<<0)
#define IN_NOT (1<<1)
@@ -3116,6 +3499,11 @@ setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env)
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]);
+#ifdef USE_BACKREF_AT_LEVEL
+ if (IS_BACKREF_NEST_LEVEL(br)) {
+ BIT_STATUS_ON_AT(env->bt_mem_end, p[i]);
+ }
+#endif
SET_EFFECT_STATUS(nodes[p[i]], NST_MEM_BACKREFED);
}
}
@@ -3263,11 +3651,9 @@ setup_tree(Node* node, regex_t* reg, int state, ScanEnv* env)
#define ALLOWED_EFFECT_IN_LB_NOT 0
#define ALLOWED_ANCHOR_IN_LB \
-( ANCHOR_LOOK_BEHIND | ANCHOR_BEGIN_LINE | ANCHOR_END_LINE | ANCHOR_BEGIN_BUF )
+( ANCHOR_LOOK_BEHIND | ANCHOR_BEGIN_LINE | ANCHOR_END_LINE | ANCHOR_BEGIN_BUF | ANCHOR_BEGIN_POSITION )
#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. */
+( ANCHOR_LOOK_BEHIND | ANCHOR_LOOK_BEHIND_NOT | ANCHOR_BEGIN_LINE | ANCHOR_END_LINE | ANCHOR_BEGIN_BUF | ANCHOR_BEGIN_POSITION )
case ANCHOR_LOOK_BEHIND:
{
@@ -3383,7 +3769,7 @@ typedef struct {
static int
map_position_value(OnigEncoding enc, int i)
{
- static short int ByteValTable[] = {
+ static const 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,
@@ -3408,7 +3794,7 @@ static int
distance_value(MinMaxLen* mm)
{
/* 1000 / (min-max-dist + 1) */
- static short int dist_vals[] = {
+ static const 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,
@@ -3604,9 +3990,10 @@ copy_opt_exact_info(OptExactInfo* to, OptExactInfo* from)
}
static void
-concat_opt_exact_info(OptExactInfo* to, OptExactInfo* add)
+concat_opt_exact_info(OptExactInfo* to, OptExactInfo* add, OnigEncoding enc)
{
- int i, n;
+ int i, j, len;
+ UChar *p, *end;
OptAncInfo tanc;
if (! to->ignore_case && add->ignore_case) {
@@ -3615,11 +4002,17 @@ concat_opt_exact_info(OptExactInfo* to, OptExactInfo* add)
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];
+ p = add->s;
+ end = p + add->len;
+ for (i = to->len; p < end; ) {
+ len = enc_len(enc, p);
+ if (i + len > OPT_EXACT_MAXLEN) break;
+ for (j = 0; j < len && p < end; j++)
+ to->s[i++] = *p++;
+ }
to->len = i;
- to->reach_end = (n == add->len ? add->reach_end : 0);
+ to->reach_end = (p == end ? add->reach_end : 0);
concat_opt_anc_info(&tanc, &to->anc, &add->anc, 1, 1);
if (! to->reach_end) tanc.right_anchor = 0;
@@ -3634,15 +4027,10 @@ concat_opt_exact_info_str(OptExactInfo* to,
UChar *p;
for (i = to->len, p = s; p < end && i < OPT_EXACT_MAXLEN; ) {
- if (raw) {
+ len = enc_len(enc, p);
+ if (i + len > OPT_EXACT_MAXLEN) break;
+ for (j = 0; j < len && p < end; j++)
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;
@@ -3711,7 +4099,7 @@ select_opt_exact_info(OnigEncoding enc, OptExactInfo* now, OptExactInfo* alt)
static void
clear_opt_map_info(OptMapInfo* map)
{
- static OptMapInfo clean_info = {
+ static const OptMapInfo clean_info = {
{0, 0}, {0, 0}, 0,
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -3758,8 +4146,8 @@ add_char_amb_opt_map_info(OptMapInfo* map, UChar* p, UChar* end,
int i, j, n, len;
UChar buf[ONIGENC_MBC_NORMALIZE_MAXLEN];
OnigCodePoint code, ccode;
- OnigCompAmbigCodes* ccs;
- OnigPairAmbigCodes* pccs;
+ const OnigCompAmbigCodes* ccs;
+ const OnigPairAmbigCodes* pccs;
OnigAmbigType amb;
add_char_opt_map_info(map, p[0], enc);
@@ -3907,11 +4295,11 @@ concat_left_node_opt_info(OnigEncoding enc, NodeOptInfo* to, NodeOptInfo* add)
if (add->exb.len > 0) {
if (exb_reach) {
- concat_opt_exact_info(&to->exb, &add->exb);
+ concat_opt_exact_info(&to->exb, &add->exb, enc);
clear_opt_exact_info(&add->exb);
}
else if (exm_reach) {
- concat_opt_exact_info(&to->exm, &add->exb);
+ concat_opt_exact_info(&to->exm, &add->exb, enc);
clear_opt_exact_info(&add->exb);
}
}
@@ -4197,8 +4585,8 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
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);
+ if (IS_MULTILINE(env->options))
+ add_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_ML);
else
add_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR);
}
@@ -4210,7 +4598,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
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);
+ concat_opt_exact_info(&opt->exb, &nopt.exb, env->enc);
}
if (i < qn->lower) {
opt->exb.reach_end = 0;
@@ -4316,10 +4704,7 @@ set_optimize_exact_info(regex_t* reg, OptExactInfo* e)
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 =
+ allow_reverse =
ONIGENC_IS_ALLOWED_REVERSE_MATCH(reg->enc, reg->exact, reg->exact_end);
if (e->len >= 3 || (e->len >= 2 && allow_reverse)) {
@@ -4391,7 +4776,7 @@ set_optimize_info_from_tree(Node* node, regex_t* reg, ScanEnv* scan_env)
if (r) return r;
reg->anchor = opt.anc.left_anchor & (ANCHOR_BEGIN_BUF |
- ANCHOR_BEGIN_POSITION | ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_PL);
+ ANCHOR_BEGIN_POSITION | ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML);
reg->anchor |= opt.anc.right_anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF);
@@ -4503,7 +4888,7 @@ print_anchor(FILE* f, int anchor)
q = 1;
fprintf(f, "anychar-star");
}
- if (anchor & ANCHOR_ANYCHAR_STAR_PL) {
+ if (anchor & ANCHOR_ANYCHAR_STAR_ML) {
if (q) fprintf(f, ", ");
fprintf(f, "anychar-star-pl");
}
@@ -4514,8 +4899,8 @@ print_anchor(FILE* f, int anchor)
static void
print_optimize_info(FILE* f, regex_t* reg)
{
- static char* on[] = { "NONE", "EXACT", "EXACT_BM", "EXACT_BM_NOT_REV",
- "EXACT_IC", "MAP" };
+ static const 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);
@@ -4624,7 +5009,6 @@ onig_chain_reduce(regex_t* reg)
{
regex_t *head, *prev;
- THREAD_ATOMIC_START;
prev = reg;
head = prev->chain;
if (IS_NOT_NULL(head)) {
@@ -4636,7 +5020,6 @@ onig_chain_reduce(regex_t* reg)
prev->chain = (regex_t* )NULL;
REGEX_TRANSFER(reg, head);
}
- THREAD_ATOMIC_END;
}
#if 0
@@ -4753,6 +5136,9 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
reg->num_null_check = 0;
reg->repeat_range_alloc = 0;
reg->repeat_range = (OnigRepeatRange* )NULL;
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ reg->num_comb_exp_check = 0;
+#endif
r = onig_parse_make_tree(&root, pattern, pattern_end, reg, &scan_env);
if (r != 0) goto err;
@@ -4806,6 +5192,33 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
reg->bt_mem_end |= reg->capture_history;
}
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ if (scan_env.backrefed_mem == 0
+#ifdef USE_SUBEXP_CALL
+ || scan_env.num_call == 0
+#endif
+ ) {
+ setup_comb_exp_check(root, 0, &scan_env);
+#ifdef USE_SUBEXP_CALL
+ if (scan_env.has_recursion != 0) {
+ scan_env.num_comb_exp_check = 0;
+ }
+ else
+#endif
+ if (scan_env.comb_exp_max_regnum > 0) {
+ int i;
+ for (i = 1; i <= scan_env.comb_exp_max_regnum; i++) {
+ if (BIT_STATUS_AT(scan_env.backrefed_mem, i) != 0) {
+ scan_env.num_comb_exp_check = 0;
+ break;
+ }
+ }
+ }
+ }
+
+ reg->num_comb_exp_check = scan_env.num_comb_exp_check;
+#endif
+
clear_optimize_info(reg);
#ifndef ONIG_DONT_OPTIMIZE
r = set_optimize_info_from_tree(root, reg, &scan_env);
@@ -4875,6 +5288,7 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
return r;
}
+#ifdef USE_RECOMPILE_API
extern int
onig_recompile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax,
@@ -4893,6 +5307,7 @@ onig_recompile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
}
return 0;
}
+#endif
static int onig_inited = 0;
@@ -4906,6 +5321,11 @@ onig_alloc_init(regex_t** reg, OnigOptionType option, OnigAmbigType ambig_flag,
if (ONIGENC_IS_UNDEF(enc))
return ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED;
+ if ((option & (ONIG_OPTION_DONT_CAPTURE_GROUP|ONIG_OPTION_CAPTURE_GROUP))
+ == (ONIG_OPTION_DONT_CAPTURE_GROUP|ONIG_OPTION_CAPTURE_GROUP)) {
+ return ONIGERR_INVALID_COMBINATION_OF_OPTIONS;
+ }
+
*reg = (regex_t* )xmalloc(sizeof(regex_t));
if (IS_NULL(*reg)) return ONIGERR_MEMORY;
(*reg)->state = ONIG_STATE_MODIFY;
@@ -4991,14 +5411,14 @@ onig_end()
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
+#ifdef USE_RECYCLE_NODE
+ onig_free_node_list();
+#endif
+
onig_inited = 0;
THREAD_ATOMIC_END;
@@ -5008,6 +5428,16 @@ onig_end()
#ifdef ONIG_DEBUG
+/* 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
+#define ARG_STATE_CHECK 6
+
OnigOpInfoType OnigOpInfo[] = {
{ OP_FINISH, "finish", ARG_NON },
{ OP_END, "end", ARG_NON },
@@ -5038,62 +5468,68 @@ OnigOpInfoType OnigOpInfo[] = {
{ 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_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_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_BACKREF_AT_LEVEL, "backref_at_level", 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 },
+ { OP_CALL, "call", ARG_ABSADDR },
+ { OP_RETURN, "return", ARG_NON },
+ { OP_STATE_CHECK_PUSH, "state-check-push", ARG_SPECIAL },
+ { OP_STATE_CHECK_PUSH_OR_JUMP, "state-check-push-or-jump", ARG_SPECIAL },
+ { OP_STATE_CHECK, "state-check", ARG_STATE_CHECK },
+ { OP_STATE_CHECK_ANYCHAR_STAR, "state-check-anychar*", ARG_STATE_CHECK },
+ { OP_STATE_CHECK_ANYCHAR_ML_STAR,
+ "state-check-anychar-ml*", ARG_STATE_CHECK },
{ -1, "", ARG_NON }
};
@@ -5152,6 +5588,7 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar** nextp,
RelAddrType addr;
LengthType len;
MemNumType mem;
+ StateCheckNumType scn;
OnigCodePoint code;
UChar *q;
@@ -5186,6 +5623,12 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar** nextp,
fprintf(f, ":%d", option);
}
break;
+
+ case ARG_STATE_CHECK:
+ scn = *((StateCheckNumType* )bp);
+ bp += SIZE_STATE_CHECK_NUM;
+ fprintf(f, ":%d", scn);
+ break;
}
}
else {
@@ -5312,6 +5755,26 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar** nextp,
}
break;
+ case OP_BACKREF_AT_LEVEL:
+ {
+ OnigOptionType option;
+ LengthType level;
+
+ GET_OPTION_INC(option, bp);
+ fprintf(f, ":%d", option);
+ GET_LENGTH_INC(level, bp);
+ fprintf(f, ":%d", level);
+
+ 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:
{
@@ -5343,6 +5806,15 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar** nextp,
fprintf(f, ":%d:(%d)", len, addr);
break;
+ case OP_STATE_CHECK_PUSH:
+ case OP_STATE_CHECK_PUSH_OR_JUMP:
+ scn = *((StateCheckNumType* )bp);
+ bp += SIZE_STATE_CHECK_NUM;
+ addr = *((RelAddrType* )bp);
+ bp += SIZE_RELADDR;
+ fprintf(f, ":%d:(%d)", scn, addr);
+ break;
+
default:
fprintf(stderr, "onig_print_compiled_byte_code: undefined code %d\n",
*--bp);
diff --git a/ext/mbstring/oniguruma/regenc.c b/ext/mbstring/oniguruma/regenc.c
index a767ca60b..bbbf1a2f9 100644
--- a/ext/mbstring/oniguruma/regenc.c
+++ b/ext/mbstring/oniguruma/regenc.c
@@ -175,7 +175,7 @@ onigenc_str_bytelen_null(OnigEncoding enc, const UChar* s)
#define USE_APPLICATION_TO_LOWER_CASE_TABLE
-unsigned short OnigEnc_Unicode_ISO_8859_1_CtypeTable[256] = {
+const 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,
@@ -251,7 +251,7 @@ static const UChar BuiltInAsciiToLowerCaseTable[] = {
#endif /* not USE_APPLICATION_TO_LOWER_CASE_TABLE */
#ifdef USE_UPPER_CASE_TABLE
-UChar OnigEncAsciiToUpperCaseTable[256] = {
+const 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',
@@ -287,7 +287,7 @@ UChar OnigEncAsciiToUpperCaseTable[256] = {
};
#endif
-unsigned short OnigEncAsciiCtypeTable[256] = {
+const 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,
@@ -323,7 +323,7 @@ unsigned short OnigEncAsciiCtypeTable[256] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
-UChar OnigEncISO_8859_1_ToLowerCaseTable[256] = {
+const 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',
@@ -359,7 +359,7 @@ UChar OnigEncISO_8859_1_ToLowerCaseTable[256] = {
};
#ifdef USE_UPPER_CASE_TABLE
-UChar OnigEncISO_8859_1_ToUpperCaseTable[256] = {
+const 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',
@@ -417,7 +417,7 @@ onigenc_get_left_adjust_char_head(OnigEncoding enc, const UChar* start, const UC
return ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s);
}
-OnigPairAmbigCodes OnigAsciiPairAmbigCodes[] = {
+const OnigPairAmbigCodes OnigAsciiPairAmbigCodes[] = {
{ 0x41, 0x61 },
{ 0x42, 0x62 },
{ 0x43, 0x63 },
@@ -475,7 +475,7 @@ OnigPairAmbigCodes OnigAsciiPairAmbigCodes[] = {
extern int
onigenc_ascii_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
if (flag == ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) {
*ccs = OnigAsciiPairAmbigCodes;
@@ -488,16 +488,16 @@ onigenc_ascii_get_all_pair_ambig_codes(OnigAmbigType flag,
extern int
onigenc_nothing_get_all_comp_ambig_codes(OnigAmbigType flag,
- OnigCompAmbigCodes** ccs)
+ const OnigCompAmbigCodes** ccs)
{
return 0;
}
extern int
onigenc_iso_8859_1_get_all_pair_ambig_codes(OnigAmbigType flag,
- OnigPairAmbigCodes** ccs)
+ const OnigPairAmbigCodes** ccs)
{
- static OnigPairAmbigCodes cc[] = {
+ static const OnigPairAmbigCodes cc[] = {
{ 0xc0, 0xe0 },
{ 0xc1, 0xe1 },
{ 0xc2, 0xe2 },
@@ -577,9 +577,9 @@ onigenc_iso_8859_1_get_all_pair_ambig_codes(OnigAmbigType flag,
extern int
onigenc_ess_tsett_get_all_comp_ambig_codes(OnigAmbigType flag,
- OnigCompAmbigCodes** ccs)
+ const OnigCompAmbigCodes** ccs)
{
- static OnigCompAmbigCodes folds[] = {
+ static const OnigCompAmbigCodes folds[] = {
{ 2, 0xdf, {{ 2, { 0x53, 0x53 } }, { 2, { 0x73, 0x73} } } }
};
@@ -593,7 +593,7 @@ onigenc_ess_tsett_get_all_comp_ambig_codes(OnigAmbigType flag,
extern int
onigenc_not_support_get_ctype_code_range(int ctype,
- OnigCodePoint* sbr[], OnigCodePoint* mbr[])
+ const OnigCodePoint* sbr[], const OnigCodePoint* mbr[])
{
return ONIG_NO_SUPPORT_CONFIG;
}
@@ -830,10 +830,10 @@ onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf)
if ((code & 0xff000000) != 0) {
*p++ = (UChar )((code >> 24) & 0xff);
}
- if ((code & 0xff0000) != 0) {
+ if ((code & 0xff0000) != 0 || p != buf) {
*p++ = (UChar )((code >> 16) & 0xff);
}
- if ((code & 0xff00) != 0) {
+ if ((code & 0xff00) != 0 || p != buf) {
*p++ = (UChar )((code >> 8) & 0xff);
}
*p++ = (UChar )(code & 0xff);
@@ -849,40 +849,32 @@ 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
+ if (code < 128)
+ return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
+ else {
+ if ((ctype & (ONIGENC_CTYPE_WORD |
+ ONIGENC_CTYPE_GRAPH | ONIGENC_CTYPE_PRINT)) != 0) {
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;
+ 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
+ if (code < 128)
+ return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
+ else {
+ if ((ctype & (ONIGENC_CTYPE_WORD |
+ ONIGENC_CTYPE_GRAPH | ONIGENC_CTYPE_PRINT)) != 0) {
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;
+ return FALSE;
}
extern int
diff --git a/ext/mbstring/oniguruma/regenc.h b/ext/mbstring/oniguruma/regenc.h
index 510455146..58ee3e7f2 100644
--- a/ext/mbstring/oniguruma/regenc.h
+++ b/ext/mbstring/oniguruma/regenc.h
@@ -4,7 +4,7 @@
regenc.h - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -65,15 +65,17 @@
#else /* ONIG_RUBY_M17N */
#define USE_UNICODE_FULL_RANGE_CTYPE
+/* following must not use with USE_CRNL_AS_LINE_TERMINATOR */
+/* #define USE_UNICODE_ALL_LINE_TERMINATORS */ /* see Unicode.org UTF#18 */
#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_ascii_get_all_pair_ambig_codes P_((OnigAmbigType flag, const OnigPairAmbigCodes** acs));
+ONIG_EXTERN int onigenc_nothing_get_all_comp_ambig_codes P_((OnigAmbigType flag, const OnigCompAmbigCodes** acs));
+ONIG_EXTERN int onigenc_iso_8859_1_get_all_pair_ambig_codes P_((OnigAmbigType flag, const OnigPairAmbigCodes** acs));
+ONIG_EXTERN int onigenc_ess_tsett_get_all_comp_ambig_codes P_((OnigAmbigType flag, const OnigCompAmbigCodes** acs));
+ONIG_EXTERN int onigenc_not_support_get_ctype_code_range P_((int ctype, const OnigCodePoint* sbr[], const OnigCodePoint* mbr[]));
ONIG_EXTERN int onigenc_is_mbc_newline_0x0a P_((const UChar* p, const UChar* end));
/* methods for single byte encoding */
@@ -105,7 +107,7 @@ ONIG_EXTERN int onigenc_get_all_fold_match_code_ss_0xdf P_((OnigCodePoint** code
/* 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[]));
+ONIG_EXTERN int onigenc_unicode_get_ctype_code_range P_((int ctype, const OnigCodePoint* sbr[], const OnigCodePoint* mbr[]));
#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \
@@ -115,10 +117,10 @@ ONIG_EXTERN int onigenc_unicode_get_ctype_code_range P_((int ctype, OnigCodePoin
#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[];
+ONIG_EXTERN const UChar OnigEncISO_8859_1_ToLowerCaseTable[];
+ONIG_EXTERN const UChar OnigEncISO_8859_1_ToUpperCaseTable[];
+ONIG_EXTERN const unsigned short OnigEnc_Unicode_ISO_8859_1_CtypeTable[];
+ONIG_EXTERN const OnigPairAmbigCodes OnigAsciiPairAmbigCodes[];
#endif /* is not ONIG_RUBY_M17N */
@@ -133,7 +135,7 @@ 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[];
+ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[];
#define ONIGENC_ASCII_CODE_TO_LOWER_CASE(c) OnigEncAsciiToLowerCaseTable[c]
#define ONIGENC_ASCII_CODE_TO_UPPER_CASE(c) OnigEncAsciiToUpperCaseTable[c]
diff --git a/ext/mbstring/oniguruma/regerror.c b/ext/mbstring/oniguruma/regerror.c
index 560b5e12c..ad73b76c3 100644
--- a/ext/mbstring/oniguruma/regerror.c
+++ b/ext/mbstring/oniguruma/regerror.c
@@ -2,7 +2,7 @@
regerror.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,12 +38,12 @@
#define va_init_list(a,b) va_start(a)
#endif
-extern char*
+extern UChar*
onig_error_code_to_format(int code)
{
char *p;
- if (code >= 0) return (char* )0;
+ if (code >= 0) return (UChar* )0;
switch (code) {
case ONIG_MISMATCH:
@@ -170,6 +170,8 @@ onig_error_code_to_format(int code)
p = "invalid character property name {%n}"; break;
case ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION:
p = "not supported encoding combination"; break;
+ case ONIGERR_INVALID_COMBINATION_OF_OPTIONS:
+ p = "invalid combination of options"; break;
case ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT:
p = "over thread pass limit count"; break;
@@ -177,7 +179,7 @@ onig_error_code_to_format(int code)
p = "undefined error code"; break;
}
- return p;
+ return (UChar* )p;
}
@@ -256,36 +258,36 @@ onig_error_code_to_str(s, code, va_alist)
void
#ifdef HAVE_STDARG_PROTOTYPES
-onig_snprintf_with_pattern(char buf[], int bufsize, OnigEncoding enc,
- char* pat, char* pat_end, char *fmt, ...)
+onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
+ UChar* pat, UChar* pat_end, const UChar *fmt, ...)
#else
onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
- char buf[];
+ UChar buf[];
int bufsize;
OnigEncoding enc;
- char* pat;
- char* pat_end;
- const char *fmt;
+ UChar* pat;
+ UChar* pat_end;
+ const UChar *fmt;
va_dcl
#endif
{
int n, need, len;
UChar *p, *s, *bp;
- char bs[6];
+ UChar bs[6];
va_list args;
va_init_list(args, fmt);
- n = vsnprintf(buf, bufsize, fmt, args);
+ n = vsnprintf((char* )buf, bufsize, (const char* )fmt, args);
va_end(args);
need = (pat_end - pat) * 4 + 4;
if (n + need < bufsize) {
- strcat(buf, ": /");
+ strcat((char* )buf, ": /");
s = buf + onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, buf);
p = pat;
- while (p < (UChar* )pat_end) {
+ while (p < pat_end) {
if (*p == MC_ESC(enc)) {
*s++ = *p++;
len = enc_len(enc, p);
@@ -304,7 +306,7 @@ onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
int blen;
while (len-- > 0) {
- sprintf(bs, "\\%03o", *p++ & 0377);
+ sprintf((char* )bs, "\\%03o", *p++ & 0377);
blen = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs);
bp = bs;
while (blen-- > 0) *s++ = *bp++;
@@ -313,7 +315,7 @@ onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
}
else if (!ONIGENC_IS_CODE_PRINT(enc, *p) &&
!ONIGENC_IS_CODE_SPACE(enc, *p)) {
- sprintf(bs, "\\%03o", *p++ & 0377);
+ sprintf((char* )bs, "\\%03o", *p++ & 0377);
len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs);
bp = bs;
while (len-- > 0) *s++ = *bp++;
diff --git a/ext/mbstring/oniguruma/regexec.c b/ext/mbstring/oniguruma/regexec.c
index 25d97773f..769ed30c9 100644
--- a/ext/mbstring/oniguruma/regexec.c
+++ b/ext/mbstring/oniguruma/regexec.c
@@ -2,7 +2,7 @@
regexec.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,6 +29,12 @@
#include "regint.h"
+#ifdef USE_CRNL_AS_LINE_TERMINATOR
+#define ONIGENC_IS_MBC_CRNL(enc,p,end) \
+ (ONIGENC_MBC_TO_CODE(enc,p,end) == 13 && \
+ ONIGENC_IS_MBC_NEWLINE(enc,(p+enc_len(enc,p)),end))
+#endif
+
#ifdef USE_CAPTURE_HISTORY
static void history_tree_free(OnigCaptureTreeNode* node);
@@ -300,6 +306,9 @@ typedef struct _StackType {
UChar *pcode; /* byte code position */
UChar *pstr; /* string position */
UChar *pstr_prev; /* previous char position of pstr */
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ unsigned int state_check;
+#endif
} state;
struct {
int count; /* for OP_REPEAT_INC, OP_REPEAT_INC_NG */
@@ -333,28 +342,28 @@ typedef struct _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
+#define STK_LOOK_BEHIND_NOT 0x0002
+#define STK_POS_NOT 0x0003
/* handled by normal-POP */
-#define STK_MEM_START 0x0200
-#define STK_MEM_END 0x0300
-#define STK_REPEAT_INC 0x0400
+#define STK_MEM_START 0x0100
+#define STK_MEM_END 0x8200
+#define STK_REPEAT_INC 0x0300
+#define STK_STATE_CHECK_MARK 0x1000
/* avoided by normal-POP */
+#define STK_NULL_CHECK_START 0x3000
+#define STK_NULL_CHECK_END 0x5000 /* for recursive call */
+#define STK_MEM_END_MARK 0x8400
#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 */
+#define STK_VOID 0x0a00 /* for fill a blank */
/* 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)
+#define STK_MASK_POP_USED 0x00ff
+#define STK_MASK_TO_VOID_TARGET 0x10ff
+#define STK_MASK_MEM_END_OR_MARK 0x8000 /* MEM_END or MEM_END_MARK */
typedef struct {
void* stack_p;
@@ -362,6 +371,10 @@ typedef struct {
OnigOptionType options;
OnigRegion* region;
const UChar* start; /* search start position (for \G: BEGIN_POSITION) */
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ void* state_check_buff;
+ int state_check_buff_size;
+#endif
} MatchArg;
#define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start) do {\
@@ -371,7 +384,37 @@ typedef struct {
(msa).start = (arg_start);\
} while (0)
-#define MATCH_ARG_FREE(msa) if ((msa).stack_p) xfree((msa).stack_p)
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+
+#define STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE 16
+
+#define STATE_CHECK_BUFF_INIT(msa, str_len, state_num) do { \
+ (msa).state_check_buff = (void* )0;\
+ (msa).state_check_buff_size = 0;\
+ if ((state_num) > 0 && str_len >= STATE_CHECK_STRING_THRESHOLD_LEN) {\
+ int size = ((int )((str_len) + 1) * (state_num) + 7) / 8;\
+ (msa).state_check_buff_size = size; \
+ if (size > 0 && size < STATE_CHECK_BUFF_MAX_SIZE) {\
+ if (size >= STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE) \
+ (msa).state_check_buff = (void* )xmalloc(size);\
+ else \
+ (msa).state_check_buff = (void* )xalloca(size);\
+ xmemset((msa).state_check_buff, 0, (size_t )size);\
+ }\
+ }\
+} while (0)
+
+#define MATCH_ARG_FREE(msa) do {\
+ if ((msa).stack_p) xfree((msa).stack_p);\
+ if ((msa).state_check_buff_size >= STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE) { \
+ if ((msa).state_check_buff) xfree((msa).state_check_buff);\
+ }\
+} while (0);
+#else
+#define STATE_CHECK_BUFF_INIT(msa, str_len, state_num)
+#define MATCH_ARG_FREE(msa) if ((msa).stack_p) xfree((msa).stack_p)
+#endif
+
#define STACK_INIT(alloc_addr, ptr_num, stack_num) do {\
@@ -465,26 +508,88 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
#define STACK_AT(index) (stk_base + (index))
#define GET_STACK_INDEX(stk) ((stk) - stk_base)
+#define STACK_PUSH_TYPE(stack_type) do {\
+ STACK_ENSURE(1);\
+ stk->type = (stack_type);\
+ STACK_INC;\
+} while(0)
+
+#define IS_TO_VOID_TARGET(stk) (((stk)->type & STK_MASK_TO_VOID_TARGET) != 0)
+
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+#define STATE_CHECK_POS(s,snum) \
+ (((s) - str) * num_comb_exp_check + ((snum) - 1))
+#define STATE_CHECK_VAL(v,snum) do {\
+ if (state_check_buff != NULL) {\
+ int x = STATE_CHECK_POS(s,snum);\
+ (v) = state_check_buff[x/8] & (1<<(x%8));\
+ }\
+ else (v) = 0;\
+} while(0)
+
+
+#define ELSE_IF_STATE_CHECK_MARK(stk) \
+ else if ((stk)->type == STK_STATE_CHECK_MARK) { \
+ int x = STATE_CHECK_POS(stk->u.state.pstr, stk->u.state.state_check);\
+ state_check_buff[x/8] |= (1<<(x%8)); \
+ }
+
#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);\
+ stk->u.state.state_check = 0;\
STACK_INC;\
} while(0)
#define STACK_PUSH_ENSURED(stack_type,pat) do {\
stk->type = (stack_type);\
stk->u.state.pcode = (pat);\
+ stk->u.state.state_check = 0;\
STACK_INC;\
} while(0)
-#define STACK_PUSH_TYPE(stack_type) do {\
+#define STACK_PUSH_ALT_WITH_STATE_CHECK(pat,s,sprev,snum) do {\
STACK_ENSURE(1);\
+ stk->type = STK_ALT;\
+ stk->u.state.pcode = (pat);\
+ stk->u.state.pstr = (s);\
+ stk->u.state.pstr_prev = (sprev);\
+ stk->u.state.state_check = ((state_check_buff != NULL) ? (snum) : 0);\
+ STACK_INC;\
+} while(0)
+
+#define STACK_PUSH_STATE_CHECK(s,snum) do {\
+ if (state_check_buff != NULL) {\
+ STACK_ENSURE(1);\
+ stk->type = STK_STATE_CHECK_MARK;\
+ stk->u.state.pstr = (s);\
+ stk->u.state.state_check = (snum);\
+ STACK_INC;\
+ }\
+} while(0)
+
+#else /* USE_COMBINATION_EXPLOSION_CHECK */
+
+#define ELSE_IF_STATE_CHECK_MARK(stk)
+
+#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)
+#endif /* USE_COMBINATION_EXPLOSION_CHECK */
#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)
@@ -544,7 +649,7 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
k = stk;\
while (k > stk_base) {\
k--;\
- if ((k->type == STK_MEM_END_MARK || k->type == STK_MEM_END) \
+ if ((k->type & STK_MASK_MEM_END_OR_MARK) != 0 \
&& k->u.mem.num == (mnum)) {\
level++;\
}\
@@ -603,15 +708,18 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
#ifdef ONIG_DEBUG
-#define STACK_BASE_CHECK(p) \
- if ((p) < stk_base) goto stack_error;
+#define STACK_BASE_CHECK(p, at) \
+ if ((p) < stk_base) {\
+ fprintf(stderr, "at %s\n", at);\
+ goto stack_error;\
+ }
#else
-#define STACK_BASE_CHECK(p)
+#define STACK_BASE_CHECK(p, at)
#endif
#define STACK_POP_ONE do {\
stk--;\
- STACK_BASE_CHECK(stk); \
+ STACK_BASE_CHECK(stk, "STACK_POP_ONE"); \
} while(0)
#define STACK_POP do {\
@@ -619,25 +727,27 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
case STACK_POP_LEVEL_FREE:\
while (1) {\
stk--;\
- STACK_BASE_CHECK(stk); \
+ STACK_BASE_CHECK(stk, "STACK_POP"); \
if ((stk->type & STK_MASK_POP_USED) != 0) break;\
+ ELSE_IF_STATE_CHECK_MARK(stk);\
}\
break;\
case STACK_POP_LEVEL_MEM_START:\
while (1) {\
stk--;\
- STACK_BASE_CHECK(stk); \
+ STACK_BASE_CHECK(stk, "STACK_POP 2"); \
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_STATE_CHECK_MARK(stk);\
}\
break;\
default:\
while (1) {\
stk--;\
- STACK_BASE_CHECK(stk); \
+ STACK_BASE_CHECK(stk, "STACK_POP 3"); \
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;\
@@ -650,6 +760,7 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
}\
+ ELSE_IF_STATE_CHECK_MARK(stk);\
}\
break;\
}\
@@ -658,7 +769,7 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
#define STACK_POP_TIL_POS_NOT do {\
while (1) {\
stk--;\
- STACK_BASE_CHECK(stk); \
+ STACK_BASE_CHECK(stk, "STACK_POP_TIL_POS_NOT"); \
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;\
@@ -671,13 +782,14 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
}\
+ ELSE_IF_STATE_CHECK_MARK(stk);\
}\
} while(0)
#define STACK_POP_TIL_LOOK_BEHIND_NOT do {\
while (1) {\
stk--;\
- STACK_BASE_CHECK(stk); \
+ STACK_BASE_CHECK(stk, "STACK_POP_TIL_LOOK_BEHIND_NOT"); \
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;\
@@ -690,6 +802,7 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
}\
+ ELSE_IF_STATE_CHECK_MARK(stk);\
}\
} while(0)
@@ -697,7 +810,7 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
k = stk;\
while (1) {\
k--;\
- STACK_BASE_CHECK(k); \
+ STACK_BASE_CHECK(k, "STACK_POS_END"); \
if (IS_TO_VOID_TARGET(k)) {\
k->type = STK_VOID;\
}\
@@ -712,7 +825,7 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
StackType *k = stk;\
while (1) {\
k--;\
- STACK_BASE_CHECK(k); \
+ STACK_BASE_CHECK(k, "STACK_STOP_BT_END"); \
if (IS_TO_VOID_TARGET(k)) {\
k->type = STK_VOID;\
}\
@@ -727,7 +840,7 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
StackType* k = stk;\
while (1) {\
k--;\
- STACK_BASE_CHECK(k); \
+ STACK_BASE_CHECK(k, "STACK_NULL_CHECK"); \
if (k->type == STK_NULL_CHECK_START) {\
if (k->u.null_check.num == (id)) {\
(isnull) = (k->u.null_check.pstr == (s));\
@@ -742,7 +855,7 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
StackType* k = stk;\
while (1) {\
k--;\
- STACK_BASE_CHECK(k); \
+ STACK_BASE_CHECK(k, "STACK_NULL_CHECK_REC"); \
if (k->type == STK_NULL_CHECK_START) {\
if (k->u.null_check.num == (id)) {\
if (level == 0) {\
@@ -762,7 +875,7 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
StackType* k = stk;\
while (1) {\
k--;\
- STACK_BASE_CHECK(k); \
+ STACK_BASE_CHECK(k, "STACK_NULL_CHECK_MEMST"); \
if (k->type == STK_NULL_CHECK_START) {\
if (k->u.null_check.num == (id)) {\
if (k->u.null_check.pstr != (s)) {\
@@ -802,7 +915,7 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
StackType* k = stk;\
while (1) {\
k--;\
- STACK_BASE_CHECK(k); \
+ STACK_BASE_CHECK(k, "STACK_NULL_CHECK_MEMST_REC"); \
if (k->type == STK_NULL_CHECK_START) {\
if (k->u.null_check.num == (id)) {\
if (level == 0) {\
@@ -850,7 +963,7 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
k = stk;\
while (1) {\
k--;\
- STACK_BASE_CHECK(k); \
+ STACK_BASE_CHECK(k, "STACK_GET_REPEAT"); \
if (k->type == STK_REPEAT) {\
if (level == 0) {\
if (k->u.repeat.num == (id)) {\
@@ -868,7 +981,7 @@ stack_double(StackType** arg_stk_base, StackType** arg_stk_end,
StackType* k = stk;\
while (1) {\
k--;\
- STACK_BASE_CHECK(k); \
+ STACK_BASE_CHECK(k, "STACK_RETURN"); \
if (k->type == STK_CALL_FRAME) {\
if (level == 0) {\
(addr) = k->u.call_frame.ret_addr;\
@@ -937,6 +1050,7 @@ static int string_cmp_ic(OnigEncoding enc, int ambig_flag,
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)
@@ -988,6 +1102,77 @@ make_capture_history_tree(OnigCaptureTreeNode* node, StackType** kp,
}
#endif
+#ifdef USE_BACKREF_AT_LEVEL
+static int mem_is_in_memp(int mem, int num, UChar* memp)
+{
+ int i;
+ MemNumType m;
+
+ for (i = 0; i < num; i++) {
+ GET_MEMNUM_INC(m, memp);
+ if (mem == (int )m) return 1;
+ }
+ return 0;
+}
+
+static int backref_match_at_nested_level(regex_t* reg
+ , StackType* top, StackType* stk_base
+ , int ignore_case, int ambig_flag
+ , int nest, int mem_num, UChar* memp, UChar** s, const UChar* send)
+{
+ UChar *ss, *p, *pstart, *pend = NULL_UCHARP;
+ int level;
+ StackType* k;
+
+ level = 0;
+ k = top;
+ k--;
+ while (k >= stk_base) {
+ if (k->type == STK_CALL_FRAME) {
+ level--;
+ }
+ else if (k->type == STK_RETURN) {
+ level++;
+ }
+ else if (level == nest) {
+ if (k->type == STK_MEM_START) {
+ if (mem_is_in_memp(k->u.mem.num, mem_num, memp)) {
+ pstart = k->u.mem.pstr;
+ if (pend != NULL_UCHARP) {
+ if (pend - pstart > send - *s) return 0; /* or goto next_mem; */
+ p = pstart;
+ ss = *s;
+
+ if (ignore_case != 0) {
+ if (string_cmp_ic(reg->enc, ambig_flag,
+ pstart, &ss, (int )(pend - pstart)) == 0)
+ return 0; /* or goto next_mem; */
+ }
+ else {
+ while (p < pend) {
+ if (*p++ != *ss++) return 0; /* or goto next_mem; */
+ }
+ }
+
+ *s = ss;
+ return 1;
+ }
+ }
+ }
+ else if (k->type == STK_MEM_END) {
+ if (mem_is_in_memp(k->u.mem.num, mem_num, memp)) {
+ pend = k->u.mem.pstr;
+ }
+ }
+ }
+ k--;
+ }
+
+ return 0;
+}
+#endif /* USE_BACKREF_AT_LEVEL */
+
+
#ifdef RUBY_PLATFORM
typedef struct {
@@ -1003,7 +1188,7 @@ trap_ensure(VALUE arg)
TrapEnsureArg* ta = (TrapEnsureArg* )arg;
if (ta->state == 0) { /* trap_exec() is not normal return */
- ONIG_STATE_DEC(ta->reg);
+ ONIG_STATE_DEC_THREAD(ta->reg);
if (! IS_NULL(ta->msa->stack_p) && ta->stk_base != ta->msa->stack_p)
xfree(ta->stk_base);
@@ -1165,27 +1350,43 @@ onig_is_in_code_range(const UChar* p, OnigCodePoint code)
}
static int
-code_is_in_cclass_node(void* node, OnigCodePoint code, int enclen)
+is_code_in_cc(int enclen, OnigCodePoint code, CClassNode* cc)
{
- unsigned int in_cc;
- CClassNode* cc = (CClassNode* )node;
+ int found;
- if (enclen == 1) {
- in_cc = BITSET_AT(cc->bs, code);
+ if (enclen > 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 {
- UChar* p = ((BBuf* )(cc->mbuf))->p;
- in_cc = onig_is_in_code_range(p, code);
+ found = (BITSET_AT(cc->bs, code) == 0 ? 0 : 1);
}
- if (IS_CCLASS_NOT(cc)) {
- return (in_cc ? 0 : 1);
+ if (IS_CCLASS_NOT(cc))
+ return !found;
+ else
+ return found;
+}
+
+extern int
+onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode* cc)
+{
+ int len;
+
+ if (ONIGENC_MBC_MINLEN(enc) > 1) {
+ len = 2;
}
else {
- return (in_cc ? 1 : 0);
+ len = ONIGENC_CODE_TO_MBCLEN(enc, code);
}
+ return is_code_in_cc(len, code, cc);
}
+
/* matching region of POSIX API */
typedef int regoff_t;
@@ -1217,6 +1418,11 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, const UChar* sstart,
StackIndex si;
StackIndex *repeat_stk;
StackIndex *mem_start_stk, *mem_end_stk;
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ int scv;
+ unsigned char* state_check_buff = msa->state_check_buff;
+ int num_comb_exp_check = reg->num_comb_exp_check;
+#endif
n = reg->num_repeat + reg->num_mem * 2;
STACK_INIT(alloca_base, n, INIT_MATCH_STACK_SIZE);
@@ -1739,8 +1945,9 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, const UChar* sstart,
mb_len = enc_len(encode, s);
ss = s;
s += mb_len;
+ DATA_ENSURE(0);
code = ONIGENC_MBC_TO_CODE(encode, ss, s);
- if (code_is_in_cclass_node(node, code, mb_len) == 0) goto fail;
+ if (is_code_in_cc(mb_len, code, node) == 0) goto fail;
}
STAT_OP_OUT;
break;
@@ -1826,6 +2033,47 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, const UChar* sstart,
STAT_OP_OUT;
break;
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ case OP_STATE_CHECK_ANYCHAR_STAR: STAT_OP_IN(OP_STATE_CHECK_ANYCHAR_STAR);
+ GET_STATE_CHECK_NUM_INC(mem, p);
+ while (s < end) {
+ STATE_CHECK_VAL(scv, mem);
+ if (scv) goto fail;
+
+ STACK_PUSH_ALT_WITH_STATE_CHECK(p, s, sprev, mem);
+ 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_STATE_CHECK_ANYCHAR_ML_STAR:
+ STAT_OP_IN(OP_STATE_CHECK_ANYCHAR_ML_STAR);
+
+ GET_STATE_CHECK_NUM_INC(mem, p);
+ while (s < end) {
+ STATE_CHECK_VAL(scv, mem);
+ if (scv) goto fail;
+
+ STACK_PUSH_ALT_WITH_STATE_CHECK(p, s, sprev, mem);
+ n = enc_len(encode, s);
+ if (n > 1) {
+ DATA_ENSURE(n);
+ sprev = s;
+ s += n;
+ }
+ else {
+ sprev = s;
+ s++;
+ }
+ }
+ STAT_OP_OUT;
+ break;
+#endif /* USE_COMBINATION_EXPLOSION_CHECK */
+
case OP_WORD: STAT_OP_IN(OP_WORD);
DATA_ENSURE(1);
if (! ONIGENC_IS_MBC_WORD(encode, s, end))
@@ -1946,6 +2194,12 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, const UChar* sstart,
STAT_OP_OUT;
continue;
}
+#ifdef USE_CRNL_AS_LINE_TERMINATOR
+ else if (ONIGENC_IS_MBC_CRNL(encode, s, end)) {
+ STAT_OP_OUT;
+ continue;
+ }
+#endif
goto fail;
break;
@@ -1966,6 +2220,15 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, const UChar* sstart,
STAT_OP_OUT;
continue;
}
+#ifdef USE_CRNL_AS_LINE_TERMINATOR
+ else if (ONIGENC_IS_MBC_CRNL(encode, s, end)) {
+ UChar* ss = s + enc_len(encode, s);
+ if (ON_STR_END(ss + enc_len(encode, ss))) {
+ STAT_OP_OUT;
+ continue;
+ }
+ }
+#endif
goto fail;
break;
@@ -2041,11 +2304,6 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, const UChar* sstart,
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:
@@ -2188,6 +2446,35 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, const UChar* sstart,
continue;
}
break;
+
+#ifdef USE_BACKREF_AT_LEVEL
+ case OP_BACKREF_AT_LEVEL:
+ {
+ int len;
+ OnigOptionType ic;
+ LengthType level;
+
+ GET_OPTION_INC(ic, p);
+ GET_LENGTH_INC(level, p);
+ GET_LENGTH_INC(tlen, p);
+
+ sprev = s;
+ if (backref_match_at_nested_level(reg, stk, stk_base, ic, ambig_flag
+ , (int )level, (int )tlen, p, &s, end)) {
+ while (sprev + (len = enc_len(encode, sprev)) < s)
+ sprev += len;
+
+ p += (SIZE_MEMNUM * tlen);
+ }
+ else
+ goto fail;
+
+ STAT_OP_OUT;
+ continue;
+ }
+
+ break;
+#endif
case OP_SET_OPTION_PUSH: STAT_OP_IN(OP_SET_OPTION_PUSH);
GET_OPTION_INC(option, p);
@@ -2309,6 +2596,43 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, const UChar* sstart,
continue;
break;
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ case OP_STATE_CHECK_PUSH: STAT_OP_IN(OP_STATE_CHECK_PUSH);
+ GET_STATE_CHECK_NUM_INC(mem, p);
+ STATE_CHECK_VAL(scv, mem);
+ if (scv) goto fail;
+
+ GET_RELADDR_INC(addr, p);
+ STACK_PUSH_ALT_WITH_STATE_CHECK(p + addr, s, sprev, mem);
+ STAT_OP_OUT;
+ continue;
+ break;
+
+ case OP_STATE_CHECK_PUSH_OR_JUMP: STAT_OP_IN(OP_STATE_CHECK_PUSH_OR_JUMP);
+ GET_STATE_CHECK_NUM_INC(mem, p);
+ GET_RELADDR_INC(addr, p);
+ STATE_CHECK_VAL(scv, mem);
+ if (scv) {
+ p += addr;
+ }
+ else {
+ STACK_PUSH_ALT_WITH_STATE_CHECK(p + addr, s, sprev, mem);
+ }
+ STAT_OP_OUT;
+ continue;
+ break;
+
+ case OP_STATE_CHECK: STAT_OP_IN(OP_STATE_CHECK);
+ GET_STATE_CHECK_NUM_INC(mem, p);
+ STATE_CHECK_VAL(scv, mem);
+ if (scv) goto fail;
+
+ STACK_PUSH_STATE_CHECK(s, mem);
+ STAT_OP_OUT;
+ continue;
+ break;
+#endif /* USE_COMBINATION_EXPLOSION_CHECK */
+
case OP_POP: STAT_OP_IN(OP_POP);
STACK_POP_ONE;
STAT_OP_OUT;
@@ -2383,7 +2707,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, const UChar* sstart,
repeat_inc:
stkp->u.repeat.count++;
- if (stkp->u.repeat.count == reg->repeat_range[mem].upper) {
+ 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) {
@@ -2413,8 +2737,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, const UChar* sstart,
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].upper) {
if (stkp->u.repeat.count >= reg->repeat_range[mem].lower) {
UChar* pcode = stkp->u.repeat.pcode;
@@ -2543,6 +2866,14 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, const UChar* sstart,
p = stk->u.state.pcode;
s = stk->u.state.pstr;
sprev = stk->u.state.pstr_prev;
+
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ if (stk->u.state.state_check != 0) {
+ stk->type = STK_STATE_CHECK_MARK;
+ stk++;
+ }
+#endif
+
STAT_OP_OUT;
continue;
break;
@@ -2727,66 +3058,56 @@ 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 *s, *se, *t, *p, *end;
const UChar *tail;
- int skip;
+ int skip, tlen1;
#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;
+ tlen1 = tail - target;
+ end = text_range;
+ if (end + tlen1 > text_end)
+ end = text_end - tlen1;
+
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;
+ p = se = s + tlen1;
t = tail;
while (t >= target && *p == *t) {
- p--; t--;
+ p--; t--;
}
- if (t < target) return (UChar* )(p + 1);
+ if (t < target) return (UChar* )s;
- skip = reg->map[*s];
- p = s + 1;
- if (p >= text_end) return (UChar* )NULL;
- t = p;
+ skip = reg->map[*se];
+ t = s;
do {
- p += enc_len(reg->enc, p);
- } while ((p - t) < skip && p < text_end);
-
- s += (p - t);
+ s += enc_len(reg->enc, s);
+ } while ((s - t) < skip && s < end);
}
}
else {
while (s < end) {
- p = s;
+ p = se = s + tlen1;
t = tail;
while (t >= target && *p == *t) {
- p--; t--;
+ p--; t--;
}
- if (t < target) return (UChar* )(p + 1);
+ if (t < target) return (UChar* )s;
- skip = reg->int_map[*s];
- p = s + 1;
- if (p >= text_end) return (UChar* )NULL;
- t = p;
+ skip = reg->int_map[*se];
+ t = s;
do {
- p += enc_len(reg->enc, p);
- } while ((p - t) < skip && p < text_end);
-
- s += (p - t);
+ s += enc_len(reg->enc, s);
+ } while ((s - t) < skip && s < end);
}
}
+
return (UChar* )NULL;
}
@@ -2915,7 +3236,9 @@ onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at, On
UChar *prev;
MatchArg msa;
-#ifdef USE_MULTI_THREAD_SYSTEM
+#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)
+ start:
+ THREAD_ATOMIC_START;
if (ONIG_STATE(reg) >= ONIG_STATE_NORMAL) {
ONIG_STATE_INC(reg);
if (IS_NOT_NULL(reg->chain) && ONIG_STATE(reg) == ONIG_STATE_NORMAL) {
@@ -2924,17 +3247,22 @@ onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at, On
}
}
else {
- int n = 0;
+ int n;
+
+ THREAD_ATOMIC_END;
+ 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);
+ goto start;
}
-#endif /* USE_MULTI_THREAD_SYSTEM */
+ THREAD_ATOMIC_END;
+#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */
MATCH_ARG_INIT(msa, option, region, at);
+ STATE_CHECK_BUFF_INIT(msa, end - str, reg->num_comb_exp_check);
if (region
#ifdef USE_POSIX_REGION_OPTION
@@ -2952,7 +3280,7 @@ onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at, On
}
MATCH_ARG_FREE(msa);
- ONIG_STATE_DEC(reg);
+ ONIG_STATE_DEC_THREAD(reg);
return r;
}
@@ -3029,7 +3357,11 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
if (prev && ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end))
goto retry_gate;
}
- else if (!ONIGENC_IS_MBC_NEWLINE(reg->enc, p, end))
+ else if (! ONIGENC_IS_MBC_NEWLINE(reg->enc, p, end)
+#ifdef USE_CRNL_AS_LINE_TERMINATOR
+ && ! ONIGENC_IS_MBC_CRNL(reg->enc, p, end)
+#endif
+ )
goto retry_gate;
break;
}
@@ -3132,7 +3464,7 @@ backward_search_range(regex_t* reg, const UChar* str, const UChar* end,
switch (reg->sub_anchor) {
case ANCHOR_BEGIN_LINE:
if (!ON_STR_BEGIN(p)) {
- prev = onigenc_get_prev_char_head(reg->enc, adjrange, p);
+ prev = onigenc_get_prev_char_head(reg->enc, str, p);
if (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end)) {
p = prev;
goto retry;
@@ -3149,7 +3481,11 @@ backward_search_range(regex_t* reg, const UChar* str, const UChar* end,
goto retry;
}
}
- else if (!ONIGENC_IS_MBC_NEWLINE(reg->enc, p, end)) {
+ else if (! ONIGENC_IS_MBC_NEWLINE(reg->enc, p, end)
+#ifdef USE_CRNL_AS_LINE_TERMINATOR
+ && ! ONIGENC_IS_MBC_CRNL(reg->enc, p, end)
+#endif
+ ) {
p = onigenc_get_prev_char_head(reg->enc, adjrange, p);
if (IS_NULL(p)) goto fail;
goto retry;
@@ -3187,8 +3523,11 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
int r;
UChar *s, *prev;
MatchArg msa;
+ const UChar *orig_start = start;
-#ifdef USE_MULTI_THREAD_SYSTEM
+#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)
+ start:
+ THREAD_ATOMIC_START;
if (ONIG_STATE(reg) >= ONIG_STATE_NORMAL) {
ONIG_STATE_INC(reg);
if (IS_NOT_NULL(reg->chain) && ONIG_STATE(reg) == ONIG_STATE_NORMAL) {
@@ -3197,15 +3536,19 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
}
}
else {
- int n = 0;
+ int n;
+
+ THREAD_ATOMIC_END;
+ 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);
+ goto start;
}
-#endif /* USE_MULTI_THREAD_SYSTEM */
+ THREAD_ATOMIC_END;
+#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */
#ifdef ONIG_DEBUG_SEARCH
fprintf(stderr,
@@ -3305,12 +3648,12 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
goto end_buf;
}
}
- else if ((reg->anchor & ANCHOR_ANYCHAR_STAR_PL)) {
+ else if ((reg->anchor & ANCHOR_ANYCHAR_STAR_ML)) {
goto begin_position;
}
}
else if (str == end) { /* empty string */
- static const UChar* address_for_empty_string = "";
+ static const UChar* address_for_empty_string = (UChar* )"";
#ifdef ONIG_DEBUG_SEARCH
fprintf(stderr, "onig_search: empty string.\n");
@@ -3322,6 +3665,10 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
prev = (UChar* )NULL;
MATCH_ARG_INIT(msa, option, region, start);
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ msa.state_check_buff = (void* )0;
+ msa.state_check_buff_size = 0;
+#endif
MATCH_AND_RETURN_CHECK;
goto mismatch;
}
@@ -3333,7 +3680,8 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
(int )(end - str), (int )(start - str), (int )(range - str));
#endif
- MATCH_ARG_INIT(msa, option, region, start);
+ MATCH_ARG_INIT(msa, option, region, orig_start);
+ STATE_CHECK_BUFF_INIT(msa, end - str, reg->num_comb_exp_check);
s = (UChar* )start;
if (range > start) { /* forward search */
@@ -3398,7 +3746,11 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
MATCH_AND_RETURN_CHECK;
prev = s;
s += enc_len(reg->enc, s);
- } while (s <= range); /* exec s == range, because empty match with /$/. */
+ } while (s < range);
+
+ if (s == range) { /* because empty match with /$/. */
+ MATCH_AND_RETURN_CHECK;
+ }
}
else { /* backward search */
if (reg->optimize != ONIG_OPTIMIZE_NONE) {
@@ -3461,7 +3813,7 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
finish:
MATCH_ARG_FREE(msa);
- ONIG_STATE_DEC(reg);
+ ONIG_STATE_DEC_THREAD(reg);
/* If result is mismatch and no FIND_NOT_EMPTY option,
then the region is not setted in match_at(). */
@@ -3482,7 +3834,7 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
mismatch_no_msa:
r = ONIG_MISMATCH;
finish_no_msa:
- ONIG_STATE_DEC(reg);
+ ONIG_STATE_DEC_THREAD(reg);
#ifdef ONIG_DEBUG
if (r != ONIG_MISMATCH)
fprintf(stderr, "onig_search: error %d\n", r);
@@ -3490,7 +3842,7 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
return r;
match:
- ONIG_STATE_DEC(reg);
+ ONIG_STATE_DEC_THREAD(reg);
MATCH_ARG_FREE(msa);
return s - str;
}
diff --git a/ext/mbstring/oniguruma/regext.c b/ext/mbstring/oniguruma/regext.c
index 6839708be..f5ad1f35a 100755
--- a/ext/mbstring/oniguruma/regext.c
+++ b/ext/mbstring/oniguruma/regext.c
@@ -2,7 +2,7 @@
regext.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -194,6 +194,7 @@ onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
return r;
}
+#ifdef USE_RECOMPILE_API
extern int
onig_recompile_deluxe(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
OnigCompileInfo* ci, OnigErrorInfo* einfo)
@@ -211,3 +212,4 @@ onig_recompile_deluxe(regex_t* reg, const UChar* pattern, const UChar* pattern_e
}
return 0;
}
+#endif
diff --git a/ext/mbstring/oniguruma/reggnu.c b/ext/mbstring/oniguruma/reggnu.c
index 70e8582ff..248957c9d 100644
--- a/ext/mbstring/oniguruma/reggnu.c
+++ b/ext/mbstring/oniguruma/reggnu.c
@@ -2,7 +2,7 @@
reggnu.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -93,6 +93,7 @@ re_compile_pattern(const char* pattern, int size, regex_t* reg, char* ebuf)
return r;
}
+#ifdef USE_RECOMPILE_API
extern int
re_recompile_pattern(const char* pattern, int size, regex_t* reg, char* ebuf)
{
@@ -113,6 +114,7 @@ re_recompile_pattern(const char* pattern, int size, regex_t* reg, char* ebuf)
}
return r;
}
+#endif
extern void
re_free_pattern(regex_t* reg)
@@ -151,16 +153,16 @@ re_mbcinit(int mb_code)
OnigEncoding enc;
switch (mb_code) {
- case MBCTYPE_ASCII:
+ case RE_MBCTYPE_ASCII:
enc = ONIG_ENCODING_ASCII;
break;
- case MBCTYPE_EUC:
+ case RE_MBCTYPE_EUC:
enc = ONIG_ENCODING_EUC_JP;
break;
- case MBCTYPE_SJIS:
+ case RE_MBCTYPE_SJIS:
enc = ONIG_ENCODING_SJIS;
break;
- case MBCTYPE_UTF8:
+ case RE_MBCTYPE_UTF8:
enc = ONIG_ENCODING_UTF8;
break;
default:
diff --git a/ext/mbstring/oniguruma/regint.h b/ext/mbstring/oniguruma/regint.h
index 2bd514b7c..c06bf5763 100644
--- a/ext/mbstring/oniguruma/regint.h
+++ b/ext/mbstring/oniguruma/regint.h
@@ -4,7 +4,7 @@
regint.h - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -62,6 +62,12 @@
#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
+/* #define USE_RECOMPILE_API */
+/* treat \r\n as line terminator.
+ !!! NO SUPPORT !!!
+ use this configuration on your own responsibility */
+/* #define USE_CRNL_AS_LINE_TERMINATOR */
+
/* internal config */
#define USE_RECYCLE_NODE
#define USE_OP_PUSH_OR_JUMP_EXACT
@@ -75,10 +81,12 @@
/* interface to external system */
#ifdef NOT_RUBY /* given from Makefile */
#include "config.h"
+#define USE_BACKREF_AT_LEVEL
#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_COMBINATION_EXPLOSION_CHECK */ /* (X*)* */
/* #define USE_MULTI_THREAD_SYSTEM */
#define THREAD_ATOMIC_START /* depend on thread system */
#define THREAD_ATOMIC_END /* depend on thread system */
@@ -93,7 +101,9 @@
#include "version.h"
#include "rubysig.h" /* for DEFER_INTS, ENABLE_INTS */
+#define USE_COMBINATION_EXPLOSION_CHECK /* (X*)* */
#define USE_MULTI_THREAD_SYSTEM
+
#define THREAD_ATOMIC_START DEFER_INTS
#define THREAD_ATOMIC_END ENABLE_INTS
#define THREAD_PASS rb_thread_schedule()
@@ -105,11 +115,14 @@
}\
} while (0)
-#define DEFAULT_WARN_FUNCTION rb_warn
-#define DEFAULT_VERB_WARN_FUNCTION rb_warning
+#define DEFAULT_WARN_FUNCTION onig_rb_warn
+#define DEFAULT_VERB_WARN_FUNCTION onig_rb_warning
#endif /* else NOT_RUBY */
+#define STATE_CHECK_STRING_THRESHOLD_LEN 7
+#define STATE_CHECK_BUFF_MAX_SIZE 0x08000000
+
#define THREAD_PASS_LIMIT_COUNT 8
#define xmemset memset
#define xmemcpy memcpy
@@ -124,13 +137,26 @@
#endif
-#ifdef USE_MULTI_THREAD_SYSTEM
-#define ONIG_STATE_INC(reg) (reg)->state++
-#define ONIG_STATE_DEC(reg) (reg)->state--
+#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)
+#define ONIG_STATE_INC(reg) (reg)->state++
+#define ONIG_STATE_DEC(reg) (reg)->state--
+
+#define ONIG_STATE_INC_THREAD(reg) do {\
+ THREAD_ATOMIC_START;\
+ (reg)->state++;\
+ THREAD_ATOMIC_END;\
+} while(0)
+#define ONIG_STATE_DEC_THREAD(reg) do {\
+ THREAD_ATOMIC_START;\
+ (reg)->state--;\
+ THREAD_ATOMIC_END;\
+} while(0)
#else
-#define ONIG_STATE_INC(reg) /* Nothing */
-#define ONIG_STATE_DEC(reg) /* Nothing */
-#endif /* USE_MULTI_THREAD_SYSTEM */
+#define ONIG_STATE_INC(reg) /* Nothing */
+#define ONIG_STATE_DEC(reg) /* Nothing */
+#define ONIG_STATE_INC_THREAD(reg) /* Nothing */
+#define ONIG_STATE_DEC_THREAD(reg) /* Nothing */
+#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */
#define onig_st_is_member st_is_member
@@ -518,7 +544,7 @@ typedef struct _BBuf {
#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) */
+#define ANCHOR_ANYCHAR_STAR_ML (1<<15) /* ".*" optimize info (multi-line) */
/* operation code */
enum OpCode {
@@ -574,11 +600,11 @@ enum OpCode {
OP_BACKREF1,
OP_BACKREF2,
- OP_BACKREF3,
OP_BACKREFN,
OP_BACKREFN_IC,
OP_BACKREF_MULTI,
OP_BACKREF_MULTI_IC,
+ OP_BACKREF_AT_LEVEL, /* \k<xxx+n>, \k<xxx-n> */
OP_MEMORY_START,
OP_MEMORY_START_PUSH, /* push back-tracker to stack */
@@ -618,34 +644,33 @@ enum OpCode {
OP_FAIL_LOOK_BEHIND_NOT, /* (?<!...) end */
OP_CALL, /* \g<name> */
- OP_RETURN
-};
+ 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
+ OP_STATE_CHECK_PUSH, /* combination explosion check and push */
+ OP_STATE_CHECK_PUSH_OR_JUMP, /* check ok -> push, else jump */
+ OP_STATE_CHECK, /* check only */
+ OP_STATE_CHECK_ANYCHAR_STAR,
+ OP_STATE_CHECK_ANYCHAR_ML_STAR
+};
typedef int RelAddrType;
typedef int AbsAddrType;
typedef int LengthType;
typedef int RepeatNumType;
typedef short int MemNumType;
+typedef short int StateCheckNumType;
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)
+#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_STATE_CHECK_NUM sizeof(StateCheckNumType)
+#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
@@ -671,6 +696,7 @@ typedef void* PointerType;
#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)
+#define GET_STATE_CHECK_NUM_INC(num,p) PLATFORM_GET_INC(num, p, StateCheckNumType)
/* code point's address must be aligned address. */
#define GET_CODE_POINT(code,p) code = *((OnigCodePoint* )(p))
@@ -713,6 +739,12 @@ typedef void* PointerType;
#define SIZE_OP_CALL (SIZE_OPCODE + SIZE_ABSADDR)
#define SIZE_OP_RETURN SIZE_OPCODE
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+#define SIZE_OP_STATE_CHECK (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
+#define SIZE_OP_STATE_CHECK_PUSH (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
+#define SIZE_OP_STATE_CHECK_PUSH_OR_JUMP (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)
+#define SIZE_OP_STATE_CHECK_ANYCHAR_STAR (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)
+#endif
#define MC_ESC(enc) (enc)->meta_char_table.esc
#define MC_ANYCHAR(enc) (enc)->meta_char_table.anychar
@@ -721,6 +753,11 @@ typedef void* PointerType;
#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 IS_MC_ESC_CODE(code, enc, syn) \
+ ((code) == MC_ESC(enc) && \
+ !IS_SYNTAX_OP2((syn), ONIG_SYN_OP2_INEFFECTIVE_ESCAPE))
+
+
#define SYN_POSIX_COMMON_OP \
( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_POSIX_BRACKET | \
ONIG_SYN_OP_DECIMAL_BACKREF | \
@@ -781,13 +818,14 @@ 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 UChar* onig_error_code_to_format P_((int code));
+extern void onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *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));
+extern int onig_is_code_in_cc P_((OnigEncoding enc, OnigCodePoint code, CClassNode* cc));
#endif /* REGINT_H */
diff --git a/ext/mbstring/oniguruma/regparse.c b/ext/mbstring/oniguruma/regparse.c
index 58e122f48..407b73fc4 100644
--- a/ext/mbstring/oniguruma/regparse.c
+++ b/ext/mbstring/oniguruma/regparse.c
@@ -2,7 +2,7 @@
regparse.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -60,6 +60,20 @@ OnigSyntaxType* OnigDefaultSyntax = ONIG_SYNTAX_RUBY;
extern void onig_null_warn(const char* s) { }
+#ifdef RUBY_PLATFORM
+extern void
+onig_rb_warn(const char* s)
+{
+ rb_warn(s);
+}
+
+extern void
+onig_rb_warning(const char* s)
+{
+ rb_warning(s);
+}
+#endif
+
#ifdef DEFAULT_WARN_FUNCTION
static OnigWarnFunc onig_warn = (OnigWarnFunc )DEFAULT_WARN_FUNCTION;
#else
@@ -305,6 +319,88 @@ typedef struct {
#include "st.h"
+typedef struct {
+ unsigned char* s;
+ unsigned char* end;
+} st_strend_key;
+
+static int strend_cmp(st_strend_key*, st_strend_key*);
+static int strend_hash(st_strend_key*);
+
+static struct st_hash_type type_strend_hash = {
+ strend_cmp,
+ strend_hash,
+};
+
+static st_table*
+onig_st_init_strend_table_with_size(int size)
+{
+ return onig_st_init_table_with_size(&type_strend_hash, size);
+}
+
+static int
+onig_st_lookup_strend(st_table *table, const UChar* str_key, const UChar* end_key, st_data_t *value)
+{
+ st_strend_key key;
+
+ key.s = (unsigned char* )str_key;
+ key.end = (unsigned char* )end_key;
+
+ return onig_st_lookup(table, (st_data_t )(&key), value);
+}
+
+static int
+onig_st_insert_strend(st_table *table, const UChar* str_key, const UChar* end_key, st_data_t value)
+{
+ st_strend_key* key;
+ int result;
+
+ key = (st_strend_key* )xmalloc(sizeof(st_strend_key));
+ key->s = (unsigned char* )str_key;
+ key->end = (unsigned char* )end_key;
+ result = onig_st_insert(table, (st_data_t )key, value);
+ if (result) {
+ xfree(key);
+ }
+ return result;
+}
+
+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);
+}
+
typedef st_table NameTable;
typedef st_data_t HashDataType; /* 1.6 st.h doesn't define st_data_t type */
@@ -350,8 +446,10 @@ onig_print_names(FILE* fp, regex_t* reg)
static int
i_free_name_entry(UChar* key, NameEntry* e, void* arg)
{
- xfree(e->name); /* == key */
+ xfree(e->name);
if (IS_NOT_NULL(e->back_refs)) xfree(e->back_refs);
+ xfree(key);
+ xfree(e);
return ST_DELETE;
}
@@ -801,6 +899,23 @@ onig_number_of_names(regex_t* reg)
}
#endif /* else USE_NAMED_GROUP */
+extern int
+onig_noname_group_capture_is_active(regex_t* reg)
+{
+ if (ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_DONT_CAPTURE_GROUP))
+ return 0;
+
+#ifdef USE_NAMED_GROUP
+ if (onig_number_of_names(reg) > 0 &&
+ IS_SYNTAX_BV(reg->syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) &&
+ !ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_CAPTURE_GROUP)) {
+ return 0;
+ }
+#endif
+
+ return 1;
+}
+
#define INIT_SCANENV_MEMNODES_ALLOC_SIZE 16
@@ -825,6 +940,13 @@ scan_env_clear(ScanEnv* env)
for (i = 0; i < SCANENV_MEMNODES_SIZE; i++)
env->mem_nodes_static[i] = NULL_NODE;
+
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ env->num_comb_exp_check = 0;
+ env->comb_exp_max_regnum = 0;
+ env->curr_max_regnum = 0;
+ env->has_recursion = 0;
+#endif
}
static int
@@ -970,13 +1092,13 @@ onig_free_node_list()
{
FreeNode* n;
- THREAD_ATOMIC_START;
- while (FreeNodeList) {
+ /* THREAD_ATOMIC_START; */
+ while (IS_NOT_NULL(FreeNodeList)) {
n = FreeNodeList;
FreeNodeList = FreeNodeList->next;
xfree(n);
}
- THREAD_ATOMIC_END;
+ /* THREAD_ATOMIC_END; */
return 0;
}
#endif
@@ -987,13 +1109,14 @@ node_new()
Node* node;
#ifdef USE_RECYCLE_NODE
+ THREAD_ATOMIC_START;
if (IS_NOT_NULL(FreeNodeList)) {
- THREAD_ATOMIC_START;
node = (Node* )FreeNodeList;
FreeNodeList = FreeNodeList->next;
THREAD_ATOMIC_END;
return node;
}
+ THREAD_ATOMIC_END;
#endif
node = (Node* )xmalloc(sizeof(Node));
@@ -1020,9 +1143,9 @@ node_new_cclass()
return node;
}
-extern Node*
+static Node*
node_new_cclass_by_codepoint_range(int not,
- OnigCodePoint sbr[], OnigCodePoint mbr[])
+ const OnigCodePoint sbr[], const OnigCodePoint mbr[])
{
CClassNode* cc;
int n, i, j;
@@ -1128,7 +1251,11 @@ onig_node_new_anchor(int type)
}
static Node*
-node_new_backref(int back_num, int* backrefs, int by_name, ScanEnv* env)
+node_new_backref(int back_num, int* backrefs, int by_name,
+#ifdef USE_BACKREF_AT_LEVEL
+ int exist_level, int nest_level,
+#endif
+ ScanEnv* env)
{
int i;
Node* node = node_new();
@@ -1141,6 +1268,13 @@ node_new_backref(int back_num, int* backrefs, int by_name, ScanEnv* env)
if (by_name != 0)
NBACKREF(node).state |= NST_NAME_REF;
+#ifdef USE_BACKREF_AT_LEVEL
+ if (exist_level != 0) {
+ NBACKREF(node).state |= NST_NEST_LEVEL;
+ NBACKREF(node).nest_level = nest_level;
+ }
+#endif
+
for (i = 0; i < back_num; i++) {
if (backrefs[i] <= env->num_mem &&
IS_NULL(SCANENV_MEM_NODES(env)[backrefs[i]])) {
@@ -1194,11 +1328,17 @@ node_new_qualifier(int lower, int upper, int by_number)
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;
+ if (by_number != 0)
+ NQUALIFIER(node).state |= NST_BY_NUMBER;
+
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ NQUALIFIER(node).comb_exp_check_num = 0;
+#endif
+
return node;
}
@@ -2013,7 +2153,7 @@ enum ReduceType {
RQ_AQ, /* to '*?' */
RQ_QQ, /* to '??' */
RQ_P_QQ, /* to '+)??' */
- RQ_PQ_Q, /* to '+?)?' */
+ RQ_PQ_Q /* to '+?)?' */
};
static enum ReduceType ReduceTypeTable[6][6] = {
@@ -2125,6 +2265,10 @@ typedef struct {
int ref1;
int* refs;
int by_name;
+#ifdef USE_BACKREF_AT_LEVEL
+ int exist_level;
+ int level; /* \k<name+n> */
+#endif
} backref;
struct {
UChar* name;
@@ -2274,15 +2418,17 @@ fetch_escaped_value(UChar** src, UChar* end, ScanEnv* env)
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 == '?')
+ if (c == '?') {
c = 0177;
- else
+ }
+ else {
+ if (c == MC_ESC(enc)) {
+ v = fetch_escaped_value(&p, end, env);
+ if (v < 0) return v;
+ c = (OnigCodePoint )v;
+ }
c &= 0x9f;
+ }
break;
}
/* fall through */
@@ -2302,6 +2448,89 @@ fetch_escaped_value(UChar** src, UChar* end, ScanEnv* env)
static int fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env);
#ifdef USE_NAMED_GROUP
+#ifdef USE_BACKREF_AT_LEVEL
+/*
+ \k<name+n>, \k<name-n>
+*/
+static int
+fetch_name_with_level(UChar** src, UChar* end, UChar** rname_end
+ , ScanEnv* env, int* level)
+{
+ int r, exist_level = 0;
+ OnigCodePoint c = 0;
+ OnigCodePoint first_code;
+ OnigEncoding enc = env->enc;
+ UChar *name_end;
+ UChar *p = *src;
+ PFETCH_READY;
+
+ name_end = end;
+ r = 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_WORD(enc, c)) {
+ r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
+ }
+ }
+
+ while (!PEND) {
+ name_end = p;
+ PFETCH(c);
+ if (c == '>' || c == ')' || c == '+' || c == '-') break;
+
+ if (!ONIGENC_IS_CODE_WORD(enc, c)) {
+ r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;
+ }
+ }
+
+ if (c != '>') {
+ if (c == '+' || c == '-') {
+ int num;
+ int flag = (c == '-' ? -1 : 1);
+
+ PFETCH(c);
+ if (! ONIGENC_IS_CODE_DIGIT(enc, c)) goto err;
+ PUNFETCH;
+ num = onig_scan_unsigned_number(&p, end, enc);
+ if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
+ *level = (num * flag);
+ exist_level = 1;
+
+ PFETCH(c);
+ if (c == '>')
+ goto first_check;
+ }
+
+ err:
+ r = ONIGERR_INVALID_GROUP_NAME;
+ name_end = end;
+ }
+ else {
+ first_check:
+ 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 (exist_level ? 1 : 0);
+ }
+ else {
+ onig_scan_env_set_error_string(env, r, *src, name_end);
+ return r;
+ }
+}
+#endif /* USE_BACKREF_AT_LEVEL */
+
/*
def: 0 -> define name (don't allow number name)
1 -> reference name (allow number name)
@@ -2428,11 +2657,11 @@ CC_ESC_WARN(ScanEnv* env, UChar *c)
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];
+ UChar 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);
+ (UChar* )"character class has '%s' without escape", c);
+ (*onig_warn)((char* )buf);
}
}
@@ -2442,11 +2671,11 @@ 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];
+ UChar 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);
+ (UChar* )"regular expression has '%s' without escape", c);
+ (*onig_warn)((char* )buf);
}
}
@@ -2537,6 +2766,8 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
tok->type = TK_CHAR;
tok->base = 0;
tok->u.c = c;
+ tok->escaped = 0;
+
if (c == ']') {
tok->type = TK_CC_CLOSE;
}
@@ -2708,7 +2939,7 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
tok->type = TK_CC_CC_OPEN;
}
else {
- CC_ESC_WARN(env, "[");
+ CC_ESC_WARN(env, (UChar* )"[");
}
}
}
@@ -2747,7 +2978,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
tok->backp = p;
PFETCH(c);
- if (c == MC_ESC(enc)) {
+ if (IS_MC_ESC_CODE(c, enc, syn)) {
if (PEND) return ONIGERR_END_PATTERN_AT_ESCAPE;
tok->backp = p;
@@ -3012,6 +3243,9 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
tok->u.backref.num = 1;
tok->u.backref.ref1 = num;
tok->u.backref.by_name = 0;
+#ifdef USE_BACKREF_AT_LEVEL
+ tok->u.backref.exist_level = 0;
+#endif
break;
}
@@ -3050,8 +3284,17 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
int* backs;
prev = p;
+
+#ifdef USE_BACKREF_AT_LEVEL
+ name_end = NULL_UCHARP; /* no need. escape gcc warning. */
+ r = fetch_name_with_level(&p, end, &name_end, env, &tok->u.backref.level);
+ if (r == 1) tok->u.backref.exist_level = 1;
+ else tok->u.backref.exist_level = 0;
+#else
r = fetch_name(&p, end, &name_end, env, 1);
+#endif
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,
@@ -3170,13 +3413,17 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
switch (c) {
case '.':
if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_DOT_ANYCHAR)) break;
+#ifdef USE_VARIABLE_META_CHARS
any_char:
+#endif
tok->type = TK_ANYCHAR;
break;
case '*':
if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ASTERISK_ZERO_INF)) break;
+#ifdef USE_VARIABLE_META_CHARS
anytime:
+#endif
tok->type = TK_OP_REPEAT;
tok->u.repeat.lower = 0;
tok->u.repeat.upper = REPEAT_INFINITE;
@@ -3185,7 +3432,9 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
case '+':
if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_PLUS_ONE_INF)) break;
+#ifdef USE_VARIABLE_META_CHARS
one_or_more_time:
+#endif
tok->type = TK_OP_REPEAT;
tok->u.repeat.lower = 1;
tok->u.repeat.upper = REPEAT_INFINITE;
@@ -3194,7 +3443,9 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
case '?':
if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_QMARK_ZERO_ONE)) break;
+#ifdef USE_VARIABLE_META_CHARS
zero_or_one_time:
+#endif
tok->type = TK_OP_REPEAT;
tok->u.repeat.lower = 0;
tok->u.repeat.upper = 1;
@@ -3271,7 +3522,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
case ']':
if (*src > env->pattern) /* /].../ is allowed. */
- CCEND_ESC_WARN(env, "]");
+ CCEND_ESC_WARN(env, (UChar* )"]");
break;
case '#':
@@ -3297,14 +3548,16 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
}
}
+#ifdef USE_VARIABLE_META_CHARS
out:
+#endif
*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[])
+ const OnigCodePoint sbr[], const OnigCodePoint mbr[])
{
int i, r;
OnigCodePoint j;
@@ -3368,7 +3621,7 @@ static int
add_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env)
{
int c, r;
- OnigCodePoint *sbr, *mbr;
+ const OnigCodePoint *sbr, *mbr;
OnigEncoding enc = env->enc;
r = ONIGENC_GET_CTYPE_CODE_RANGE(enc, ctype, &sbr, &mbr);
@@ -3506,19 +3759,19 @@ parse_posix_bracket(CClassNode* cc, UChar** src, UChar* end, ScanEnv* env)
#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* )"alnum", ONIGENC_CTYPE_ALNUM, 5 },
+ { (UChar* )"alpha", ONIGENC_CTYPE_ALPHA, 5 },
+ { (UChar* )"blank", ONIGENC_CTYPE_BLANK, 5 },
+ { (UChar* )"cntrl", ONIGENC_CTYPE_CNTRL, 5 },
+ { (UChar* )"digit", ONIGENC_CTYPE_DIGIT, 5 },
+ { (UChar* )"graph", ONIGENC_CTYPE_GRAPH, 5 },
+ { (UChar* )"lower", ONIGENC_CTYPE_LOWER, 5 },
+ { (UChar* )"print", ONIGENC_CTYPE_PRINT, 5 },
+ { (UChar* )"punct", ONIGENC_CTYPE_PUNCT, 5 },
+ { (UChar* )"space", ONIGENC_CTYPE_SPACE, 5 },
+ { (UChar* )"upper", ONIGENC_CTYPE_UPPER, 5 },
+ { (UChar* )"xdigit", ONIGENC_CTYPE_XDIGIT, 6 },
+ { (UChar* )"ascii", ONIGENC_CTYPE_ASCII, 5 },
{ (UChar* )NULL, -1, 0 }
};
@@ -3542,7 +3795,7 @@ parse_posix_bracket(CClassNode* cc, UChar** src, UChar* end, ScanEnv* env)
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)
+ if (onigenc_with_ascii_strncmp(enc, p, end, (UChar* )":]", 2) != 0)
return ONIGERR_INVALID_POSIX_BRACKET_TYPE;
r = add_ctype_to_cc(cc, pb->ctype, not, env);
@@ -3577,19 +3830,19 @@ 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* )"Alnum", ONIGENC_CTYPE_ALNUM, 5 },
+ { (UChar* )"Alpha", ONIGENC_CTYPE_ALPHA, 5 },
+ { (UChar* )"Blank", ONIGENC_CTYPE_BLANK, 5 },
+ { (UChar* )"Cntrl", ONIGENC_CTYPE_CNTRL, 5 },
+ { (UChar* )"Digit", ONIGENC_CTYPE_DIGIT, 5 },
+ { (UChar* )"Graph", ONIGENC_CTYPE_GRAPH, 5 },
+ { (UChar* )"Lower", ONIGENC_CTYPE_LOWER, 5 },
+ { (UChar* )"Print", ONIGENC_CTYPE_PRINT, 5 },
+ { (UChar* )"Punct", ONIGENC_CTYPE_PUNCT, 5 },
+ { (UChar* )"Space", ONIGENC_CTYPE_SPACE, 5 },
+ { (UChar* )"Upper", ONIGENC_CTYPE_UPPER, 5 },
+ { (UChar* )"XDigit", ONIGENC_CTYPE_XDIGIT, 6 },
+ { (UChar* )"ASCII", ONIGENC_CTYPE_ASCII, 5 },
{ (UChar* )NULL, -1, 0 }
};
@@ -3839,7 +4092,7 @@ parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end,
*src, env->pattern_end, 1, env->enc))
return ONIGERR_EMPTY_CHAR_CLASS;
- CC_ESC_WARN(env, "]");
+ CC_ESC_WARN(env, (UChar* )"]");
r = tok->type = TK_CHAR; /* allow []...] */
}
@@ -3942,7 +4195,7 @@ parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end,
r = parse_posix_bracket(cc, &p, end, env);
if (r < 0) goto err;
if (r == 1) { /* is not POSIX bracket */
- CC_ESC_WARN(env, "[");
+ CC_ESC_WARN(env, (UChar* )"[");
p = tok->backp;
v = (OnigCodePoint )tok->u.c;
in_israw = 0;
@@ -3988,7 +4241,7 @@ parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end,
goto val_entry;
}
else if (r == TK_CC_AND) {
- CC_ESC_WARN(env, "-");
+ CC_ESC_WARN(env, (UChar* )"-");
goto range_end_val;
}
state = CCS_RANGE;
@@ -4003,12 +4256,12 @@ parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end,
fetched = 1;
/* [--x] or [a&&-x] is warned. */
if (r == TK_CC_RANGE || and_start != 0)
- CC_ESC_WARN(env, "-");
+ CC_ESC_WARN(env, (UChar* )"-");
goto val_entry;
}
else if (state == CCS_RANGE) {
- CC_ESC_WARN(env, "-");
+ CC_ESC_WARN(env, (UChar* )"-");
goto sb_char; /* [!--x] is allowed */
}
else { /* CCS_COMPLETE */
@@ -4017,12 +4270,12 @@ parse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end,
fetched = 1;
if (r == TK_CC_CLOSE) goto range_end_val; /* allow [a-b-] */
else if (r == TK_CC_AND) {
- CC_ESC_WARN(env, "-");
+ CC_ESC_WARN(env, (UChar* )"-");
goto range_end_val;
}
if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC)) {
- CC_ESC_WARN(env, "-");
+ CC_ESC_WARN(env, (UChar* )"-");
goto sb_char; /* [0-9-a] is allowed as [0-9\-a] */
}
r = ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS;
@@ -4326,10 +4579,9 @@ parse_effect(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
}
}
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);
@@ -4358,11 +4610,11 @@ parse_effect(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
return 0;
}
-static char* PopularQStr[] = {
+static const char* PopularQStr[] = {
"?", "*", "+", "??", "*?", "+?"
};
-static char* ReduceQStr[] = {
+static const char* ReduceQStr[] = {
"", "", "*", "*?", "??", "+ and ??", "+? and ?"
};
@@ -4394,15 +4646,13 @@ set_qualifier(Node* qnode, Node* target, int group, ScanEnv* env)
{ /* check redundant double repeat. */
/* verbose warn (?:.?)? etc... but not warn (.?)? etc... */
QualifierNode* qnt = &(NQUALIFIER(target));
+ int nestq_num = popular_qualifier_num(qn);
+ int targetq_num = popular_qualifier_num(qnt);
#ifdef USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR
- if (qn->by_number == 0 && qnt->by_number == 0 &&
+ if (!IS_QUALIFIER_BY_NUMBER(qn) && !IS_QUALIFIER_BY_NUMBER(qnt) &&
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);
+ UChar buf[WARN_BUFSIZE];
switch(ReduceTypeTable[targetq_num][nestq_num]) {
case RQ_ASIS:
@@ -4411,9 +4661,9 @@ set_qualifier(Node* qnode, Node* target, int group, ScanEnv* env)
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);
+ env->pattern, env->pattern_end,
+ (UChar* )"redundant nested repeat operator");
+ (*onig_verb_warn)((char* )buf);
}
goto warn_exit;
break;
@@ -4422,10 +4672,10 @@ set_qualifier(Node* qnode, Node* target, int group, ScanEnv* env)
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'",
+ (UChar* )"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);
+ (*onig_verb_warn)((char* )buf);
}
goto warn_exit;
break;
@@ -4434,9 +4684,17 @@ set_qualifier(Node* qnode, Node* target, int group, ScanEnv* env)
warn_exit:
#endif
- if (popular_qualifier_num(qnt) >= 0 && popular_qualifier_num(qn) >= 0) {
- onig_reduce_nested_qualifier(qnode, target);
- goto q_exit;
+ if (targetq_num >= 0) {
+ if (nestq_num >= 0) {
+ onig_reduce_nested_qualifier(qnode, target);
+ goto q_exit;
+ }
+ else if (targetq_num == 1 || targetq_num == 2) { /* * or + */
+ /* (?:a*){n,m}, (?:a+){n,m} => (?:a*){n,n}, (?:a+){n,n} */
+ if (! IS_REPEAT_INFINITE(qn->upper) && qn->upper > 1 && qn->greedy) {
+ qn->upper = (qn->lower == 0 ? 1 : qn->lower);
+ }
+ }
}
}
break;
@@ -4457,8 +4715,8 @@ make_compound_alt_node_from_cc(OnigAmbigType ambig_flag, OnigEncoding enc,
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;
+ const OnigCompAmbigCodes* ccs;
+ const OnigCompAmbigCodeItem* ci;
OnigAmbigType amb;
n = 0;
@@ -4546,27 +4804,9 @@ static int type_cclass_hash(type_cclass_key* key)
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;
@@ -4580,6 +4820,8 @@ i_free_shared_class(type_cclass_key* key, Node* node, void* arg)
if (IS_NOT_NULL(cc->mbuf)) xfree(cc->mbuf);
xfree(node);
}
+
+ if (IS_NOT_NULL(key)) xfree(key);
return ST_DELETE;
}
@@ -4588,6 +4830,8 @@ onig_free_shared_cclass_table()
{
if (IS_NOT_NULL(OnigTypeCClassTable)) {
onig_st_foreach(OnigTypeCClassTable, i_free_shared_class, 0);
+ xfree(OnigTypeCClassTable);
+ OnigTypeCClassTable = NULL;
}
return 0;
@@ -4741,7 +4985,7 @@ parse_exp(Node** np, OnigToken* tok, int term,
int ctype, not;
#ifdef USE_SHARED_CCLASS_TABLE
- OnigCodePoint *sbr, *mbr;
+ const OnigCodePoint *sbr, *mbr;
ctype = parse_ctype_to_enc_ctype(tok->u.subtype, &not);
r = ONIGENC_GET_CTYPE_CODE_RANGE(env->enc, ctype, &sbr, &mbr);
@@ -4823,7 +5067,7 @@ parse_exp(Node** np, OnigToken* tok, int term,
if (IS_IGNORECASE(env->option)) {
int i, n, in_cc;
- OnigPairAmbigCodes* ccs;
+ const OnigPairAmbigCodes* ccs;
BitSetRef bs = cc->bs;
OnigAmbigType amb;
@@ -4892,8 +5136,13 @@ parse_exp(Node** np, OnigToken* tok, int term,
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);
+ (len > 1 ? tok->u.backref.refs : &(tok->u.backref.ref1)),
+ tok->u.backref.by_name,
+#ifdef USE_BACKREF_AT_LEVEL
+ tok->u.backref.exist_level,
+ tok->u.backref.level,
+#endif
+ env);
CHECK_NULL_RETURN_VAL(*np, ONIGERR_MEMORY);
break;
diff --git a/ext/mbstring/oniguruma/regparse.h b/ext/mbstring/oniguruma/regparse.h
index 1a4ac7dea..ca62dddf7 100644
--- a/ext/mbstring/oniguruma/regparse.h
+++ b/ext/mbstring/oniguruma/regparse.h
@@ -4,7 +4,7 @@
regparse.h - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -67,7 +67,7 @@
#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_ANYCHAR_STAR_MASK (ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML)
#define ANCHOR_END_BUF_MASK (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF)
#define EFFECT_MEMORY (1<<0)
@@ -76,7 +76,7 @@
#define NODE_STR_MARGIN 16
#define NODE_STR_BUF_SIZE 24 /* sizeof(CClassNode) - sizeof(int)*4 */
-#define NODE_BACKREFS_SIZE 7
+#define NODE_BACKREFS_SIZE 6
#define NSTR_RAW (1<<0) /* by backslashed number */
#define NSTR_AMBIG (1<<1)
@@ -124,11 +124,13 @@ typedef struct {
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} */
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ int comb_exp_check_num; /* 1,2,3...: check, 0: no check */
+#endif
} QualifierNode;
/* status bits */
@@ -145,6 +147,8 @@ typedef struct {
#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 NST_NEST_LEVEL (1<<13)
+#define NST_BY_NUMBER (1<<14) /* {n,m} */
#define SET_EFFECT_STATUS(node,f) (node)->u.effect.state |= (f)
#define CLEAR_EFFECT_STATUS(node,f) (node)->u.effect.state &= ~(f)
@@ -165,7 +169,9 @@ typedef struct {
#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_BACKREF_NEST_LEVEL(bn) (((bn)->state & NST_NEST_LEVEL) != 0)
#define IS_QUALIFIER_IN_REPEAT(qn) (((qn)->state & NST_IN_REPEAT) != 0)
+#define IS_QUALIFIER_BY_NUMBER(qn) (((qn)->state & NST_BY_NUMBER) != 0)
typedef struct {
int state;
@@ -212,6 +218,7 @@ typedef struct {
int back_num;
int back_static[NODE_BACKREFS_SIZE];
int* back_dynamic;
+ int nest_level;
} BackrefNode;
typedef struct {
@@ -274,6 +281,12 @@ typedef struct {
int mem_alloc;
Node* mem_nodes_static[SCANENV_MEMNODES_SIZE];
Node** mem_nodes_dynamic;
+#ifdef USE_COMBINATION_EXPLOSION_CHECK
+ int num_comb_exp_check;
+ int comb_exp_max_regnum;
+ int curr_max_regnum;
+ int has_recursion;
+#endif
} ScanEnv;
@@ -290,7 +303,6 @@ typedef struct {
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));
diff --git a/ext/mbstring/oniguruma/regposix.c b/ext/mbstring/oniguruma/regposix.c
index 34cbeb9a4..a3bacf722 100644
--- a/ext/mbstring/oniguruma/regposix.c
+++ b/ext/mbstring/oniguruma/regposix.c
@@ -2,7 +2,7 @@
regposix.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -55,7 +55,7 @@ typedef struct {
static int
onig2posix_error_code(int code)
{
- static O2PERR o2p[] = {
+ static const O2PERR o2p[] = {
{ ONIG_MISMATCH, REG_NOMATCH },
{ ONIG_NO_SUPPORT_CONFIG, REG_EONIG_INTERNAL },
{ ONIGERR_MEMORY, REG_ESPACE },
@@ -192,7 +192,7 @@ regexec(regex_t* reg, const char* str, size_t nmatch,
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);
+ (OnigRegion* )pm, options);
if (r >= 0) {
r = 0; /* Match */
@@ -212,6 +212,11 @@ regexec(regex_t* reg, const char* str, size_t nmatch,
if (pm != pmatch && pm != NULL)
xfree(pm);
+#if 0
+ if (reg->re_nsub > nmatch - 1)
+ reg->re_nsub = (nmatch <= 1 ? 0 : nmatch - 1);
+#endif
+
return r;
}
diff --git a/ext/mbstring/oniguruma/regsyntax.c b/ext/mbstring/oniguruma/regsyntax.c
index a0f36b8c3..9114e39e6 100644
--- a/ext/mbstring/oniguruma/regsyntax.c
+++ b/ext/mbstring/oniguruma/regsyntax.c
@@ -2,7 +2,7 @@
regsyntax.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2004 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,6 +29,13 @@
#include "regint.h"
+OnigSyntaxType OnigSyntaxASIS = {
+ 0
+ , ONIG_SYN_OP2_INEFFECTIVE_ESCAPE
+ , 0
+ , ONIG_OPTION_NONE
+};
+
OnigSyntaxType OnigSyntaxPosixBasic = {
( SYN_POSIX_COMMON_OP | ONIG_SYN_OP_ESC_LPAREN_SUBEXP |
ONIG_SYN_OP_ESC_BRACE_INTERVAL )
@@ -63,7 +70,7 @@ OnigSyntaxType OnigSyntaxEmacs = {
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_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 |
@@ -110,6 +117,28 @@ OnigSyntaxType OnigSyntaxPerl = {
, ONIG_OPTION_SINGLELINE
};
+/* Perl + named group */
+OnigSyntaxType OnigSyntaxPerl_NG = {
+ (( 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 |
+ ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP |
+ ONIG_SYN_OP2_ESC_K_NAMED_BACKREF |
+ ONIG_SYN_OP2_ESC_G_SUBEXP_CALL )
+ , ( SYN_GNU_REGEX_BV |
+ ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP |
+ ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME )
+ , ONIG_OPTION_SINGLELINE
+};
+
+
extern int
onig_set_default_syntax(OnigSyntaxType* syntax)
diff --git a/ext/mbstring/oniguruma/regversion.c b/ext/mbstring/oniguruma/regversion.c
index 5f15c10e6..5fad0cc18 100644
--- a/ext/mbstring/oniguruma/regversion.c
+++ b/ext/mbstring/oniguruma/regversion.c
@@ -2,7 +2,7 @@
regversion.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,7 @@ onig_copyright(void)
{
static char s[58];
- sprintf(s, "Oniguruma %d.%d.%d : Copyright (C) 2002-2005 K.Kosako",
+ sprintf(s, "Oniguruma %d.%d.%d : Copyright (C) 2002-2006 K.Kosako",
ONIGURUMA_VERSION_MAJOR,
ONIGURUMA_VERSION_MINOR,
ONIGURUMA_VERSION_TEENY);
diff --git a/ext/mbstring/oniguruma/st.c b/ext/mbstring/oniguruma/st.c
index 65c2cc58b..2324da263 100644
--- a/ext/mbstring/oniguruma/st.c
+++ b/ext/mbstring/oniguruma/st.c
@@ -56,8 +56,6 @@ 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 *); */
@@ -65,20 +63,6 @@ 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 *);
@@ -100,7 +84,7 @@ static void rehash(st_table *);
/*
Table of prime numbers 2^n+a, 2<=n<=30.
*/
-static long primes[] = {
+static const long primes[] = {
8 + 3,
16 + 3,
32 + 5,
@@ -228,13 +212,6 @@ st_init_strtable_with_size(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;
@@ -246,7 +223,6 @@ st_free_table(table)
ptr = table->bins[i];
while (ptr != 0) {
next = ptr->next;
- table->type->key_free(ptr->key);
free(ptr);
ptr = next;
}
@@ -297,21 +273,6 @@ st_lookup(table, key, value)
}
}
-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;\
@@ -352,22 +313,6 @@ st_insert(table, key, value)
}
}
-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;
@@ -381,21 +326,6 @@ st_add_direct(table, key, value)
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;
@@ -455,7 +385,6 @@ st_copy(old_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;
@@ -556,7 +485,7 @@ st_cleanup_safe(table, never)
table->num_entries = num_entries;
}
-void
+int
st_foreach(table, func, arg)
st_table *table;
int (*func)();
@@ -569,7 +498,7 @@ st_foreach(table, func, arg)
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);
+ retval = (*func)(ptr->key, ptr->record, arg);
switch (retval) {
case ST_CHECK: /* check if hash is modified during iteration */
tmp = 0;
@@ -580,8 +509,7 @@ st_foreach(table, func, arg)
}
if (!tmp) {
/* call func with error notice */
- retval = (*func)(0, 0, arg, 1);
- return;
+ return 1;
}
/* fall through */
case ST_CONTINUE:
@@ -589,7 +517,7 @@ st_foreach(table, func, arg)
ptr = ptr->next;
break;
case ST_STOP:
- return;
+ return 0;
case ST_DELETE:
tmp = ptr;
if (last == 0) {
@@ -599,12 +527,12 @@ st_foreach(table, func, arg)
last->next = ptr->next;
}
ptr = ptr->next;
- table->type->key_free(tmp->key);
free(tmp);
table->num_entries--;
}
}
}
+ return 0;
}
static int
@@ -659,59 +587,3 @@ numhash(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
index c5cc4e625..da65e7fef 100644
--- a/ext/mbstring/oniguruma/st.h
+++ b/ext/mbstring/oniguruma/st.h
@@ -14,8 +14,6 @@ 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 {
@@ -25,11 +23,6 @@ struct st_table {
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};
@@ -51,23 +44,16 @@ 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));
+int 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)
diff --git a/ext/mbstring/oniguruma/win32/config.h b/ext/mbstring/oniguruma/win32/config.h
index 7ee9e2506..bdbdaf25c 100644
--- a/ext/mbstring/oniguruma/win32/config.h
+++ b/ext/mbstring/oniguruma/win32/config.h
@@ -1,84 +1,84 @@
-#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"
+#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
index 4a27aef48..e4b23af97 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mbregex.c,v 1.53.2.1 2006/01/01 12:50:08 sniper Exp $ */
+/* $Id: php_mbregex.c,v 1.53.2.1.2.2 2006/10/11 11:53:02 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
@@ -517,8 +517,7 @@ PHP_FUNCTION(mb_regex_encoding)
/* {{{ _php_mb_regex_ereg_exec */
static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
{
- zval tmp;
- zval *arg_pattern, *array;
+ zval **arg_pattern, *array;
char *string;
int string_len;
php_mb_regex_t *re;
@@ -529,7 +528,7 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
array = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|z", &arg_pattern, &string, &string_len, &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs|z", &arg_pattern, &string, &string_len, &array) == FAILURE) {
RETURN_FALSE;
}
@@ -539,18 +538,15 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
}
/* compile the regular expression from the supplied regex */
- if (Z_TYPE_P(arg_pattern) != IS_STRING) {
+ if (Z_TYPE_PP(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 */
+ if (Z_TYPE_PP(arg_pattern) == IS_DOUBLE) {
+ convert_to_long_ex(arg_pattern); /* get rid of decimal places */
}
- convert_to_string(&tmp);
- arg_pattern = &tmp;
+ convert_to_string_ex(arg_pattern);
/* 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);
+ re = php_mbregex_compile_pattern(Z_STRVAL_PP(arg_pattern), Z_STRLEN_PP(arg_pattern), options, MBSTRG(current_mbctype), MBSTRG(regex_default_syntax) TSRMLS_CC);
if (re == NULL) {
RETVAL_FALSE;
goto out;
@@ -567,19 +563,18 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
match_len = 1;
str = string;
if (array != NULL) {
- zval ret_array;
match_len = regs->end[0] - regs->beg[0];
- array_init(&ret_array);
+ zval_dtor(array);
+ array_init(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);
+ add_index_stringl(array, i, (char *)&str[beg], end - beg, 1);
} else {
- add_index_bool(&ret_array, i, 0);
+ add_index_bool(array, i, 0);
}
}
- REPLACE_ZVAL_VALUE(&array, &ret_array, 0);
}
if (match_len == 0) {
@@ -590,9 +585,6 @@ out:
if (regs != NULL) {
onig_region_free(regs, 1);
}
- if (arg_pattern == &tmp) {
- zval_dtor(&tmp);
- }
}
/* }}} */
@@ -1104,6 +1096,7 @@ PHP_FUNCTION(mb_ereg_search_init)
WRONG_PARAM_COUNT;
break;
}
+ convert_to_string_ex(arg_str);
if (ZEND_NUM_ARGS() > 1) {
/* create regex pattern buffer */
convert_to_string_ex(arg_pattern);
diff --git a/ext/mbstring/tests/common.inc b/ext/mbstring/tests/common.inc
index e8fb411b0..1df634107 100644
--- a/ext/mbstring/tests/common.inc
+++ b/ext/mbstring/tests/common.inc
@@ -18,7 +18,9 @@ function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
128 => "Compile Warning", // E_COMPILE_WARNING
256 => "User Error", // E_USER_ERROR
512 => "User Warning", // E_USER_WARMING
- 1024=> "User Notice" // E_USER_NOTICE
+ 1024=> "User Notice", // E_USER_NOTICE
+ 2048=> "Strict Notice", // E_STRICT
+ 4096=> "Catchable fatal error", // E_RECOVERABLE_ERROR
);
if (!empty($debug)) {
@@ -50,4 +52,4 @@ class tc
$t_obj = new tc;
-?> \ No newline at end of file
+?>
diff --git a/ext/mbstring/tests/mb_ereg1.phpt b/ext/mbstring/tests/mb_ereg1.phpt
new file mode 100644
index 000000000..e420312da
--- /dev/null
+++ b/ext/mbstring/tests/mb_ereg1.phpt
@@ -0,0 +1,79 @@
+--TEST--
+mb_ereg() and invalid arguments
+--SKIPIF--
+<?php if (!function_exists("mb_ereg")) print "skip"; ?>
+--FILE--
+<?php
+
+$a = array(
+ array(1,2,3),
+ array("", "", ""),
+ array(array(), 1, ""),
+ array(1, array(), ""),
+ array(1, "", array()),
+ );
+
+foreach ($a as $args) {
+ var_dump(mb_ereg($args[0], $args[1], $args[2]));
+ var_dump($args);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(false)
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+int(1)
+array(3) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(0) ""
+ [2]=>
+ array(1) {
+ [0]=>
+ bool(false)
+ }
+}
+
+Notice: Array to string conversion in %s on line %d
+bool(false)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ int(1)
+ [2]=>
+ string(0) ""
+}
+
+Warning: mb_ereg() expects parameter 2 to be string, array given in %s on line %d
+bool(false)
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ string(0) ""
+}
+bool(false)
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ string(0) ""
+ [2]=>
+ array(0) {
+ }
+}
+Done
diff --git a/ext/mbstring/tests/mb_ereg2.phpt b/ext/mbstring/tests/mb_ereg2.phpt
new file mode 100644
index 000000000..922a8e78d
--- /dev/null
+++ b/ext/mbstring/tests/mb_ereg2.phpt
@@ -0,0 +1,41 @@
+--TEST--
+mb_ereg() returning matches
+--SKIPIF--
+<?php if (!function_exists("mb_ereg")) print "skip"; ?>
+--FILE--
+<?php
+
+$a = -1; $b = -1; $c = -1;
+mbereg($a, $b, $c);
+var_dump($a, $b, $c);
+
+mberegi($a, $b, $c);
+var_dump($a, $b, $c);
+
+mbereg_search_init($a, $b, $c);
+var_dump($a, $b, $c);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(-1)
+int(-1)
+array(1) {
+ [0]=>
+ string(2) "-1"
+}
+int(-1)
+int(-1)
+array(1) {
+ [0]=>
+ string(2) "-1"
+}
+
+Notice: Array to string conversion in %s on line %d
+int(-1)
+int(-1)
+array(1) {
+ [0]=>
+ string(2) "-1"
+}
+Done
diff --git a/ext/mbstring/tests/mb_send_mail01.phpt b/ext/mbstring/tests/mb_send_mail01.phpt
index bc481fbba..26d2ed2ec 100644
--- a/ext/mbstring/tests/mb_send_mail01.phpt
+++ b/ext/mbstring/tests/mb_send_mail01.phpt
@@ -2,7 +2,7 @@
mb_send_mail() test 1 (lang=neutral)
--SKIPIF--
<?php
-if (@mb_send_mail() === false || !mb_language("neutral")) {
+if (!function_exists("mb_send_mail") || !mb_language("neutral")) {
die("skip mb_send_mail() not available");
}
?>
diff --git a/ext/mbstring/tests/mb_send_mail02.phpt b/ext/mbstring/tests/mb_send_mail02.phpt
index 34dee474b..6a2dbcfeb 100644
--- a/ext/mbstring/tests/mb_send_mail02.phpt
+++ b/ext/mbstring/tests/mb_send_mail02.phpt
@@ -2,7 +2,7 @@
mb_send_mail() test 2 (lang=Japanese)
--SKIPIF--
<?php
-if (@mb_send_mail() === false || !mb_language("japanese")) {
+if (!function_exists("mb_send_mail") || !mb_language("japanese")) {
die("skip mb_send_mail() not available");
}
?>
diff --git a/ext/mbstring/tests/mb_send_mail03.phpt b/ext/mbstring/tests/mb_send_mail03.phpt
index 3113d8e2b..4be1f8346 100644
--- a/ext/mbstring/tests/mb_send_mail03.phpt
+++ b/ext/mbstring/tests/mb_send_mail03.phpt
@@ -2,7 +2,7 @@
mb_send_mail() test 3 (lang=English)
--SKIPIF--
<?php
-if (@mb_send_mail() === false || !mb_language("english")) {
+if (!function_exists("mb_send_mail") || !mb_language("english")) {
die("skip mb_send_mail() not available");
}
?>
diff --git a/ext/mbstring/tests/mb_send_mail04.phpt b/ext/mbstring/tests/mb_send_mail04.phpt
index 468a1e367..06aa3a415 100644
--- a/ext/mbstring/tests/mb_send_mail04.phpt
+++ b/ext/mbstring/tests/mb_send_mail04.phpt
@@ -2,7 +2,7 @@
mb_send_mail() test 4 (lang=German)
--SKIPIF--
<?php
-if (@mb_send_mail() === false || !mb_language("german")) {
+if (!function_exists("mb_send_mail") || !mb_language("german")) {
die("skip mb_send_mail() not available");
}
?>
diff --git a/ext/mbstring/tests/mb_send_mail05.phpt b/ext/mbstring/tests/mb_send_mail05.phpt
index 7033424b8..cd3eaf4ed 100644
--- a/ext/mbstring/tests/mb_send_mail05.phpt
+++ b/ext/mbstring/tests/mb_send_mail05.phpt
@@ -2,7 +2,7 @@
mb_send_mail() test 5 (lang=Simplified Chinese)
--SKIPIF--
<?php
-if (@mb_send_mail() === false || !mb_language("Simplified Chinese")) {
+if (!function_exists("mb_send_mail") || !mb_language("Simplified Chinese")) {
die("skip mb_send_mail() not available");
}
if (!@mb_internal_encoding('GB2312')) {
diff --git a/ext/mbstring/tests/mb_send_mail06.phpt b/ext/mbstring/tests/mb_send_mail06.phpt
index 2e8c15128..08cf24013 100644
--- a/ext/mbstring/tests/mb_send_mail06.phpt
+++ b/ext/mbstring/tests/mb_send_mail06.phpt
@@ -2,7 +2,7 @@
mb_send_mail() test 6 (lang=Traditional Chinese)
--SKIPIF--
<?php
-if (@mb_send_mail() === false || !mb_language("Traditional Chinese")) {
+if (!function_exists("mb_send_mail") || !mb_language("Traditional Chinese")) {
die("skip mb_send_mail() not available");
}
if (!@mb_internal_encoding('BIG5')) {
diff --git a/ext/mbstring/tests/mb_send_mail07.phpt b/ext/mbstring/tests/mb_send_mail07.phpt
index 21fdaa597..ef2965265 100644
--- a/ext/mbstring/tests/mb_send_mail07.phpt
+++ b/ext/mbstring/tests/mb_send_mail07.phpt
@@ -2,7 +2,7 @@
mb_send_mail() test 7 (lang=Korean)
--SKIPIF--
<?php
-if (@mb_send_mail() === false || !mb_language("Korean")) {
+if (!function_exists("mb_send_mail") || !mb_language("Korean")) {
die("skip mb_send_mail() not available");
}
if (!@mb_internal_encoding('ISO-2022-KR')) {
diff --git a/ext/mbstring/tests/mb_strlen.phpt b/ext/mbstring/tests/mb_strlen.phpt
index 6a71b4158..5fc19f454 100644
--- a/ext/mbstring/tests/mb_strlen.phpt
+++ b/ext/mbstring/tests/mb_strlen.phpt
@@ -21,35 +21,35 @@ $ascii = 'abcdefghijklmnopqrstuvwxyz;]=#0123456789';
// ASCII
echo "== ASCII ==\n";
-print strlen($ascii,'ASCII') . "\n";
+print mb_strlen($ascii,'ASCII') . "\n";
print strlen($ascii) . "\n";
// EUC-JP
echo "== EUC-JP ==\n";
-print strlen($euc_jp,'EUC-JP') . "\n";
+print mb_strlen($euc_jp,'EUC-JP') . "\n";
mb_internal_encoding('EUC-JP') or print("mb_internal_encoding() failed\n");
print strlen($euc_jp) . "\n";
// SJIS
echo "== SJIS ==\n";
-$sjis = mb_convert_encoding($euc_jp, 'SJIS');
-print strlen($sjis,'SJIS') . "\n";
+$sjis = mb_convert_encoding($euc_jp, 'SJIS','EUC-JP');
+print mb_strlen($sjis,'SJIS') . "\n";
mb_internal_encoding('SJIS') or print("mb_internal_encoding() failed\n");
print strlen($sjis) . "\n";
// JIS
// Note: either convert_encoding or strlen has problem
echo "== JIS ==\n";
-$jis = mb_convert_encoding($euc_jp, 'JIS');
-print strlen($jis,'JIS') . "\n";
+$jis = mb_convert_encoding($euc_jp, 'JIS','EUC-JP');
+print mb_strlen($jis,'JIS') . "\n";
mb_internal_encoding('JIS') or print("mb_internal_encoding() failed\n");
print strlen($jis) . "\n";
// UTF-8
// Note: either convert_encoding or strlen has problem
echo "== UTF-8 ==\n";
-$utf8 = mb_convert_encoding($euc_jp, 'UTF-8');
-print strlen($utf8,'UTF-8') . "\n";
+$utf8 = mb_convert_encoding($euc_jp, 'UTF-8','EUC-JP');
+print mb_strlen($utf8,'UTF-8') . "\n";
mb_internal_encoding('UTF-8') or print("mb_internal_encoding() failed\n");
print strlen($utf8) . "\n";
@@ -66,7 +66,7 @@ $r = strlen($t_obj);
echo $r."\n";
// Wrong encoding
mb_internal_encoding('EUC-JP');
-$r = strlen($euc_jp, 'BAD_NAME');
+$r = mb_strlen($euc_jp, 'BAD_NAME');
echo $r."\n";
@@ -76,28 +76,24 @@ echo $r."\n";
--EXPECT--
== ASCII ==
-ERR: Warning
-
+40
40
== EUC-JP ==
-ERR: Warning
-
+43
72
== SJIS ==
-ERR: Warning
-
+43
72
== JIS ==
-ERR: Warning
-
-121
+43
+90
== UTF-8 ==
-ERR: Warning
-
-174
+43
+101
== WRONG PARAMETERS ==
ERR: Notice
5
+ERR: Catchable fatal error
ERR: Notice
6
ERR: Warning
diff --git a/ext/mbstring/tests/mb_substr.phpt b/ext/mbstring/tests/mb_substr.phpt
index 893cb6481..579e7ffb5 100644
--- a/ext/mbstring/tests/mb_substr.phpt
+++ b/ext/mbstring/tests/mb_substr.phpt
@@ -4,6 +4,7 @@ mb_substr()
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--INI--
output_handler=
+mbstring.func_overload=0
--FILE--
<?php
// TODO: Add more encodings
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index 983e85264..40b64324a 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -16,7 +16,7 @@
| Derick Rethans <derick@derickrethans.nl> |
+----------------------------------------------------------------------+
*/
-/* $Id: mcrypt.c,v 1.91.2.3 2006/01/01 12:50:08 sniper Exp $ */
+/* $Id: mcrypt.c,v 1.91.2.3.2.5 2006/06/26 16:33:38 bjori Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -63,7 +63,7 @@ zend_function_entry mcrypt_functions[] = {
PHP_FE(mcrypt_generic_init, NULL)
PHP_FE(mcrypt_generic, NULL)
PHP_FE(mdecrypt_generic, NULL)
- PHP_FE(mcrypt_generic_end, NULL)
+ PHP_DEP_FALIAS(mcrypt_generic_end, mcrypt_generic_deinit, NULL)
PHP_FE(mcrypt_generic_deinit, NULL)
PHP_FE(mcrypt_enc_self_test, NULL)
@@ -93,6 +93,8 @@ static PHP_MINFO_FUNCTION(mcrypt);
static PHP_MINIT_FUNCTION(mcrypt);
static PHP_MSHUTDOWN_FUNCTION(mcrypt);
+ZEND_DECLARE_MODULE_GLOBALS(mcrypt)
+
zend_module_entry mcrypt_module_entry = {
STANDARD_MODULE_HEADER,
"mcrypt",
@@ -101,11 +103,13 @@ zend_module_entry mcrypt_module_entry = {
NULL, NULL,
PHP_MINFO(mcrypt),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES,
+ PHP_MODULE_GLOBALS(mcrypt),
+ NULL,
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
-ZEND_DECLARE_MODULE_GLOBALS(mcrypt)
-
#ifdef COMPILE_DL_MCRYPT
ZEND_GET_MODULE(mcrypt)
#endif
@@ -245,11 +249,6 @@ static void php_mcrypt_module_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
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 */
@@ -492,6 +491,10 @@ PHP_FUNCTION(mcrypt_generic)
ZEND_FETCH_RESOURCE(pm, php_mcrypt *, mcryptind, -1, "MCrypt", le_mcrypt);
PHP_MCRYPT_INIT_CHECK
convert_to_string_ex(data);
+ if (Z_STRLEN_PP(data) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "An empty string was passed");
+ RETURN_FALSE
+ }
/* Check blocksize */
if (mcrypt_enc_is_block_mode(pm->td) == 1) { /* It's a block algorithm */
@@ -533,6 +536,10 @@ PHP_FUNCTION(mdecrypt_generic)
ZEND_FETCH_RESOURCE(pm, php_mcrypt * , mcryptind, -1, "MCrypt", le_mcrypt);
PHP_MCRYPT_INIT_CHECK
convert_to_string_ex(data);
+ if (Z_STRLEN_PP(data) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "An empty string was passed");
+ RETURN_FALSE
+ }
/* Check blocksize */
if (mcrypt_enc_is_block_mode(pm->td) == 1) { /* It's a block algorithm */
@@ -597,16 +604,6 @@ PHP_FUNCTION(mcrypt_module_close)
/* }}} */
-/* {{{ 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)
@@ -1097,7 +1094,8 @@ static void php_mcrypt_do_crypt (char* cipher, zval **key, zval **data, char *mo
}
if (mcrypt_generic_init(td, key_s, use_key_length, iv_s) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Mcrypt initialisation failed");
+ 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);
diff --git a/ext/mcrypt/php_mcrypt.h b/ext/mcrypt/php_mcrypt.h
index bce9880f9..32119e7a2 100644
--- a/ext/mcrypt/php_mcrypt.h
+++ b/ext/mcrypt/php_mcrypt.h
@@ -16,7 +16,7 @@
| Derick Rethans <derick@derickrethans.nl> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_mcrypt.h,v 1.26.2.1 2006/01/01 12:50:08 sniper Exp $ */
+/* $Id: php_mcrypt.h,v 1.26.2.1.2.1 2006/06/26 16:33:38 bjori Exp $ */
#ifndef PHP_MCRYPT_H
#define PHP_MCRYPT_H
@@ -52,7 +52,6 @@ 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);
diff --git a/ext/mcrypt/tests/blowfish.phpt b/ext/mcrypt/tests/blowfish.phpt
index dc51da65b..ce258d3e1 100644
--- a/ext/mcrypt/tests/blowfish.phpt
+++ b/ext/mcrypt/tests/blowfish.phpt
@@ -36,7 +36,19 @@ foreach($vectors as $data) {
($crypt==$guess ? "OK" : "BAD")
);
}
-}
+}
+
+// Longer test case from http://www.schneier.com/code/vectors.txt
+$td = mcrypt_module_open ("blowfish", "", MCRYPT_MODE_CBC, "");
+
+$key = hex2bin( "0123456789ABCDEFF0E1D2C3B4A59687" );
+$iv = hex2bin( "FEDCBA9876543210" );
+$plain = hex2bin( "37363534333231204E6F77206973207468652074696D6520666F722000" );
+
+mcrypt_generic_init( $td, $key, $iv );
+$guess = bin2hex( mcrypt_generic( $td, $plain ) );
+
+echo "\n", $guess, "\n";
?>
--EXPECT--
key plain crypt guess stat
@@ -73,3 +85,5 @@ E0FEE0FEF1FEF1FE 0123456789ABCDEF c39e072d9fac631d c39e072d9fac631d OK
FFFFFFFFFFFFFFFF 0000000000000000 f21e9a77b71c49bc f21e9a77b71c49bc OK
0123456789ABCDEF 0000000000000000 245946885754369a 245946885754369a OK
FEDCBA9876543210 FFFFFFFFFFFFFFFF 6b5c5a9c5d9e0a5a 6b5c5a9c5d9e0a5a OK
+
+6b77b4d63006dee605b156e27403979358deb9e7154616d959f1652bd5ff92cc
diff --git a/ext/mcrypt/tests/bug37595.phpt b/ext/mcrypt/tests/bug37595.phpt
new file mode 100644
index 000000000..3c682129f
--- /dev/null
+++ b/ext/mcrypt/tests/bug37595.phpt
Binary files differ
diff --git a/ext/mime_magic/mime_magic.c b/ext/mime_magic/mime_magic.c
index 49a6a65e3..2fa492773 100644
--- a/ext/mime_magic/mime_magic.c
+++ b/ext/mime_magic/mime_magic.c
@@ -15,7 +15,7 @@
| Author: Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
- $Id: mime_magic.c,v 1.42.2.5 2006/01/01 12:50:09 sniper Exp $
+ $Id: mime_magic.c,v 1.42.2.5.2.1 2006/06/15 18:33:07 dmitry Exp $
This module contains a lot of stuff taken from Apache mod_mime_magic,
so the license section is a little bit longer than usual:
@@ -212,7 +212,7 @@ static magic_req_rec *magic_set_config(void);
static void magic_free_config(magic_req_rec *);
ZEND_DECLARE_MODULE_GLOBALS(mime_magic)
-
+static PHP_GINIT_FUNCTION(mime_magic);
/* True global resources - no need for thread safety here */
static magic_server_config_rec mime_global;
@@ -240,7 +240,15 @@ zend_module_entry mime_magic_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
"0.1",
#endif
+#if ZEND_MODULE_API_NO >= 20060613
+ PHP_MODULE_GLOBALS(mime_magic),
+ PHP_GINIT(mime_magic),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
+#else
STANDARD_MODULE_PROPERTIES
+#endif
};
/* }}} */
@@ -256,9 +264,9 @@ STD_PHP_INI_BOOLEAN("mime_magic.debug", "0", PHP_INI_SYSTEM, OnUpdateBool, debug
PHP_INI_END()
/* }}} */
-/* {{{ php_mime_magic_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
-static void php_mime_magic_init_globals(zend_mime_magic_globals *mime_magic_globals)
+static PHP_GINIT_FUNCTION(mime_magic)
{
memset(mime_magic_globals, 0, sizeof(zend_mime_magic_globals));
mime_global.magic = NULL;
@@ -270,7 +278,6 @@ static void php_mime_magic_init_globals(zend_mime_magic_globals *mime_magic_glob
*/
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)) {
diff --git a/ext/ming/ming.c b/ext/ming/ming.c
index 12ef5d066..13e906c48 100644
--- a/ext/ming/ming.c
+++ b/ext/ming/ming.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ming.c,v 1.79.2.4 2006/03/06 10:06:15 helly Exp $ */
+/* $Id: ming.c,v 1.79.2.4.2.1 2006/05/22 14:22:18 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -259,7 +259,7 @@ static SWFCharacter getCharacter(zval *id TSRMLS_DC)
return (SWFCharacter)getPrebuiltClip(id TSRMLS_CC);
#endif
else
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Called object is not an SWFCharacter");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFCharacter");
return NULL;
}
/* }}} */
@@ -312,7 +312,7 @@ PHP_METHOD(swfaction, __construct)
action = compileSWFActionCode(Z_STRVAL_PP(script));
if (!action) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Couldn't compile actionscript");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Couldn't compile actionscript");
}
ret = zend_list_insert(action, le_swfactionp);
@@ -331,7 +331,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFAction");
}
return (SWFAction)action;
}
@@ -407,7 +407,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFBitmap");
}
return (SWFBitmap)bitmap;
}
@@ -465,7 +465,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFButton");
}
return (SWFButton)button;
}
@@ -664,7 +664,7 @@ PHP_FUNCTION(ming_keypress)
convert_to_string_ex(key);
if (Z_STRLEN_PP(key) > 1) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Only one character expected");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Only one character expected");
}
c = Z_STRVAL_PP(key)[0];
@@ -701,7 +701,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFDisplayItem");
}
return (SWFDisplayItem)item;
@@ -1208,7 +1208,7 @@ static zend_function_entry swfdisplayitem_functions[] = {
Creates 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Instantiating SWFFill won't do any good- use SWFShape::addFill() instead");
}
static void destroy_SWFFill_resource(zend_rsrc_list_entry *resource TSRMLS_DC)
@@ -1227,7 +1227,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFFill");
}
return (SWFFill)fill;
}
@@ -1338,7 +1338,7 @@ 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!");
+ php_error(E_RECOVERABLE_ERROR, "called object is not an SWFFontCharacter!");
return (SWFFontCharacter)font;
}
@@ -1398,7 +1398,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFFont");
}
return (SWFFont)font;
}
@@ -1619,7 +1619,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFGradient");
}
return (SWFGradient)gradient;
}
@@ -1694,7 +1694,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFMorph");
}
return (SWFMorph)morph;
}
@@ -1746,7 +1746,7 @@ 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!");
+ php_error(E_RECOVERABLE_ERROR, "called object is not an SWFSound!");
return (SWFSound)sound;
}
@@ -1826,7 +1826,7 @@ 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!");
+ php_error(E_RECOVERABLE_ERROR, "called object is not an SWFSoundInstance!");
return (SWFSoundInstance)inst;
}
@@ -1960,7 +1960,7 @@ 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!");
+ php_error(E_RECOVERABLE_ERROR, "called object is not an SWFVideoStream!");
return (SWFVideoStream)stream;
}
@@ -1974,7 +1974,7 @@ PHP_METHOD(swfvideostream, setdimension)
zval **x, **y;
SWFVideoStream stream = getVideoStream(getThis() TSRMLS_CC);
if(!stream)
- php_error(E_ERROR, "getVideoSTream returned NULL");
+ php_error(E_RECOVERABLE_ERROR, "getVideoSTream returned NULL");
if( ZEND_NUM_ARGS() != 2
|| zend_get_parameters_ex(2, &x, &y) == FAILURE )
@@ -2070,7 +2070,7 @@ 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!");
+ php_error(E_RECOVERABLE_ERROR, "called object is not an SWFPrebuiltClip!");
return (SWFPrebuiltClip)clip;
}
@@ -2126,7 +2126,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFMovie");
}
return (SWFMovie)movie;
}
@@ -2720,7 +2720,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFShape");
}
return (SWFShape)shape;
@@ -2804,7 +2804,7 @@ PHP_METHOD(swfshape, addFill)
}
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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Argument is not a bitmap nor a gradient");
}
} else if (ZEND_NUM_ARGS() == 3 || ZEND_NUM_ARGS() == 4) {
@@ -2837,7 +2837,7 @@ PHP_METHOD(swfshape, addFill)
}
if (!fill) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error adding fill to shape");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Error adding fill to shape");
}
/* return an SWFFill object */
@@ -3241,7 +3241,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFSprite");
}
return (SWFMovieClip)sprite;
}
@@ -3426,7 +3426,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFText");
}
return (SWFText)text;
}
@@ -3721,7 +3721,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Called object is not an SWFTextField");
}
return (SWFTextField)field;
}
@@ -4024,7 +4024,7 @@ static void php_ming_error(const char *msg, ...)
vspprintf(&buffer, 0, msg, args);
va_end(args);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "%s", buffer);
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "%s", buffer);
efree(buffer);
}
@@ -4033,7 +4033,7 @@ 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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Error initializing Ming module");
return FAILURE;
}
return SUCCESS;
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c
index f900b5f81..a709f5c47 100644
--- a/ext/mssql/php_mssql.c
+++ b/ext/mssql/php_mssql.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mssql.c,v 1.152.2.13 2006/04/04 18:49:12 fmk Exp $ */
+/* $Id: php_mssql.c,v 1.152.2.13.2.1 2006/06/15 18:33:07 dmitry Exp $ */
#ifdef COMPILE_DL_MSSQL
#define HAVE_MSSQL 1
@@ -81,6 +81,9 @@ zend_function_entry mssql_functions[] = {
{NULL, NULL, NULL}
};
+ZEND_DECLARE_MODULE_GLOBALS(mssql)
+static PHP_GINIT_FUNCTION(mssql);
+
zend_module_entry mssql_module_entry =
{
STANDARD_MODULE_HEADER,
@@ -91,12 +94,14 @@ zend_module_entry mssql_module_entry =
PHP_RINIT(mssql),
PHP_RSHUTDOWN(mssql),
PHP_MINFO(mssql),
- NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ NO_VERSION_YET,
+ PHP_MODULE_GLOBALS(mssql),
+ PHP_GINIT(mssql),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
-ZEND_DECLARE_MODULE_GLOBALS(mssql)
-
#ifdef COMPILE_DL_MSSQL
ZEND_GET_MODULE(mssql)
# ifdef PHP_WIN32
@@ -273,7 +278,7 @@ static void _mssql_bind_hash_dtor(void *data)
zval_ptr_dtor(&(bind->zval));
}
-static void php_mssql_init_globals(zend_mssql_globals *mssql_globals)
+static PHP_GINIT_FUNCTION(mssql)
{
long compatability_mode;
@@ -288,8 +293,6 @@ static void php_mssql_init_globals(zend_mssql_globals *mssql_globals)
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);
diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4
index 4eed751d9..5593ed5f8 100644
--- a/ext/mysql/config.m4
+++ b/ext/mysql/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.67.2.1 2005/09/04 04:51:23 wez Exp $
+dnl $Id: config.m4,v 1.67.2.1.2.1 2006/06/01 19:14:48 mike Exp $
dnl
AC_DEFUN([MYSQL_LIB_CHK], [
@@ -86,7 +86,11 @@ if test "$PHP_MYSQL" != "no"; then
Note that the MySQL client library is not bundled anymore!])
fi
- MYSQL_LIBNAME=mysqlclient
+ if test "$enable_maintainer_zts" = "yes"; then
+ MYSQL_LIBNAME=mysqlclient_r
+ else
+ MYSQL_LIBNAME=mysqlclient
+ fi
case $host_alias in
*netware*[)]
MYSQL_LIBNAME=mysql
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 106f45871..0d5584301 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mysql.c,v 1.213.2.6 2006/01/01 12:50:09 sniper Exp $ */
+/* $Id: php_mysql.c,v 1.213.2.6.2.5 2006/08/02 10:04:11 tony2001 Exp $ */
/* TODO:
*
@@ -116,6 +116,9 @@ static int le_result, le_link, le_plink;
(mysql_field_count(mysql)>0)
#endif
+ZEND_DECLARE_MODULE_GLOBALS(mysql)
+static PHP_GINIT_FUNCTION(mysql);
+
typedef struct _php_mysql_conn {
MYSQL conn;
int active_result_id;
@@ -130,15 +133,15 @@ zend_function_entry mysql_functions[] = {
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)
+ PHP_DEP_FE(mysql_create_db, NULL)
+ PHP_DEP_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_DEP_FE(mysql_list_tables, NULL)
PHP_FE(mysql_list_fields, NULL)
PHP_FE(mysql_list_processes, NULL)
PHP_FE(mysql_error, NULL)
@@ -189,15 +192,15 @@ zend_function_entry mysql_functions[] = {
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)
+ PHP_DEP_FALIAS(mysql_createdb, mysql_create_db, NULL)
+ PHP_DEP_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_DEP_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)
@@ -219,12 +222,14 @@ zend_module_entry mysql_module_entry = {
PHP_RSHUTDOWN(mysql),
PHP_MINFO(mysql),
"1.0",
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(mysql),
+ PHP_GINIT(mysql),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
-ZEND_DECLARE_MODULE_GLOBALS(mysql)
-
#ifdef COMPILE_DL_MYSQL
ZEND_GET_MODULE(mysql)
#endif
@@ -353,9 +358,9 @@ PHP_INI_BEGIN()
PHP_INI_END()
/* }}} */
-/* {{{ php_mysql_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
-static void php_mysql_init_globals(zend_mysql_globals *mysql_globals)
+static PHP_GINIT_FUNCTION(mysql)
{
mysql_globals->num_persistent = 0;
mysql_globals->default_socket = NULL;
@@ -374,8 +379,6 @@ static void php_mysql_init_globals(zend_mysql_globals *mysql_globals)
*/
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);
@@ -392,13 +395,6 @@ ZEND_MODULE_STARTUP_D(mysql)
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;
}
/* }}} */
@@ -407,12 +403,6 @@ ZEND_MODULE_STARTUP_D(mysql)
*/
PHP_MSHUTDOWN_FUNCTION(mysql)
{
-#ifdef ZTS
-# if MYSQL_VERSION_ID >= 40000
- mysql_thread_end();
-# endif
-#endif
-
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
@@ -1165,8 +1155,6 @@ PHP_FUNCTION(mysql_create_db)
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();
@@ -1208,9 +1196,6 @@ PHP_FUNCTION(mysql_drop_db)
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);
@@ -1462,7 +1447,6 @@ PHP_FUNCTION(mysql_list_tables)
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);
@@ -1909,7 +1893,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
mysql_row_length_type *mysql_row_lengths;
int i;
zval *res, *ctor_params = NULL;
- zend_class_entry *ce;
+ zend_class_entry *ce = NULL;
#ifdef ZEND_ENGINE_2
if (into_object) {
@@ -2043,7 +2027,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
* single value is an array. Also we'd have to make that one
* argument passed by reference.
*/
- zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
return;
}
} else {
@@ -2058,7 +2042,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
fcc.object_pp = &return_value;
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
- zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
+ 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);
@@ -2068,7 +2052,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
efree(fci.params);
}
} else if (ctor_params) {
- zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
+ 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);
}
}
#endif
diff --git a/ext/mysql/tests/skipif.inc b/ext/mysql/tests/skipif.inc
index 934420b09..735be482c 100755
--- a/ext/mysql/tests/skipif.inc
+++ b/ext/mysql/tests/skipif.inc
@@ -1,8 +1,11 @@
<?php
include 'connect.inc';
+if (!extension_loaded("mysql")) {
+ die('skip mysql extension not available');
+}
$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/config.m4 b/ext/mysqli/config.m4
index a249bb82b..6ddb5d7ec 100644
--- a/ext/mysqli/config.m4
+++ b/ext/mysqli/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.22.2.1 2005/11/29 17:32:40 sniper Exp $
+dnl $Id: config.m4,v 1.22.2.1.2.1 2006/06/01 19:14:48 mike Exp $
dnl config.m4 for extension mysqli
PHP_ARG_WITH(mysqli, for MySQLi support,
@@ -22,9 +22,13 @@ dnl fi
MYSQL_CONFIG=$PHP_MYSQLI
fi
+ MYSQL_LIB_NAME='mysqlclient'
if test "$PHP_EMBEDDED_MYSQLI" = "yes"; then
AC_DEFINE(HAVE_EMBEDDED_MYSQLI, 1, [embedded MySQL support enabled])
MYSQL_LIB_CFG='--libmysqld-libs'
+ elif test "$enable_maintainer_zts" = "yes"; then
+ MYSQL_LIB_CFG='--libs_r'
+ MYSQL_LIB_NAME='mysqlclient_r'
else
MYSQL_LIB_CFG='--libs'
fi
@@ -40,12 +44,12 @@ dnl fi
dnl
dnl Check the library
dnl
- PHP_CHECK_LIBRARY(mysqlclient, mysql_set_server_option,
+ PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, 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,
+ PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, 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])
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 562b0d61e..99926f680 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli.c,v 1.72.2.16 2006/04/02 09:40:19 georg Exp $
+ $Id: mysqli.c,v 1.72.2.16.2.11 2006/07/27 10:53:15 tony2001 Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -35,6 +35,8 @@
#define MYSQLI_USE_RESULT 1
ZEND_DECLARE_MODULE_GLOBALS(mysqli)
+static PHP_GINIT_FUNCTION(mysqli);
+
static zend_object_handlers mysqli_object_handlers;
static HashTable classes;
static HashTable mysqli_driver_properties;
@@ -43,6 +45,13 @@ static HashTable mysqli_result_properties;
static HashTable mysqli_stmt_properties;
static HashTable mysqli_warning_properties;
+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;
+
extern void php_mysqli_connect(INTERNAL_FUNCTION_PARAMETERS);
typedef int (*mysqli_read_t)(mysqli_object *obj, zval **retval TSRMLS_DC);
@@ -62,10 +71,6 @@ void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type)
return;
}
- if (bbuf.is_null) {
- efree(bbuf.is_null);
- }
-
for (i=0; i < bbuf.var_cnt; i++) {
/* free temporary bind buffer */
@@ -82,9 +87,18 @@ void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type)
efree(bbuf.vars);
}
+ /*
+ Don't free bbuf.is_null for FETCH_RESULT since we have allocated
+ is_null and buf in one block so we free only buf, which is the beginning
+ of the block. When FETCH_SIMPLE then buf wasn't allocated together with
+ buf and we have to free it.
+ */
if (type == FETCH_RESULT) {
efree(bbuf.buf);
+ } else if (type == FETCH_SIMPLE){
+ efree(bbuf.is_null);
}
+
bbuf.var_cnt = 0;
return;
}
@@ -120,53 +134,82 @@ void php_clear_mysql(MY_MYSQL *mysql) {
/* {{{ mysqli_objects_free_storage
*/
-static void mysqli_objects_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_objects_free_storage(void *object TSRMLS_DC)
{
- mysqli_object *intern = (mysqli_object *)object;
+ zend_object *zo = (zend_object *)object;
+ mysqli_object *intern = (mysqli_object *)zo;
+ MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
+ my_efree(my_res);
zend_object_std_dtor(&intern->zo TSRMLS_CC);
efree(intern);
}
/* }}} */
-/* {{{ mysqli_objects_destroy_object
+/* {{{ mysqli_link_free_storage
*/
-static void mysqli_objects_destroy_object(void *object, zend_object_handle handle TSRMLS_DC)
+static void mysqli_link_free_storage(void *object TSRMLS_DC)
{
- mysqli_object *intern = (mysqli_object *)object;
- MYSQLI_RESOURCE *my_res;
+ zend_object *zo = (zend_object *)object;
+ mysqli_object *intern = (mysqli_object *)zo;
+ MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
+
+ 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);
+ }
+ mysqli_objects_free_storage(object TSRMLS_CC);
+}
+/* }}} */
- zend_objects_destroy_object(object, handle TSRMLS_CC);
-
- my_res = (MYSQLI_RESOURCE *)intern->ptr;
+/* {{{ mysqli_stmt_free_storage
+ */
+static void mysqli_stmt_free_storage(void *object TSRMLS_DC)
+{
+ zend_object *zo = (zend_object *)object;
+ mysqli_object *intern = (mysqli_object *)zo;
+ MYSQLI_RESOURCE *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 (instanceof_function(intern->zo.ce, mysqli_stmt_class_entry TSRMLS_CC)) { /* stmt object */
- if (my_res && my_res->ptr) {
- MY_STMT *stmt = (MY_STMT *)my_res->ptr;
- php_clear_stmt_bind(stmt);
- }
- } else if (instanceof_function(intern->zo.ce, mysqli_result_class_entry TSRMLS_CC)) { /* result object */
- if (my_res && my_res->ptr) {
- mysql_free_result(my_res->ptr);
- }
- } else if (instanceof_function(intern->zo.ce, mysqli_warning_class_entry TSRMLS_CC)) { /* warning object */
- if (my_res && my_res->ptr) {
- php_clear_warnings((MYSQLI_WARNING *)my_res->info);
- }
+ if (my_res && my_res->ptr) {
+ MY_STMT *stmt = (MY_STMT *)my_res->ptr;
+ php_clear_stmt_bind(stmt);
}
- intern->ptr = NULL;
- my_efree(my_res);
+ mysqli_objects_free_storage(object TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ mysqli_result_free_storage
+ */
+static void mysqli_result_free_storage(void *object TSRMLS_DC)
+{
+ zend_object *zo = (zend_object *)object;
+ mysqli_object *intern = (mysqli_object *)zo;
+ MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
+
+ if (my_res && my_res->ptr) {
+ mysql_free_result(my_res->ptr);
+ }
+ mysqli_objects_free_storage(object TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ mysqli_warning_free_storage
+ */
+static void mysqli_warning_free_storage(void *object TSRMLS_DC)
+{
+ zend_object *zo = (zend_object *)object;
+ mysqli_object *intern = (mysqli_object *)zo;
+ MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
+
+ if (my_res && my_res->ptr) {
+ php_clear_warnings((MYSQLI_WARNING *)my_res->info);
+ my_res->ptr = NULL;
+ }
+ mysqli_objects_free_storage(object TSRMLS_CC);
}
/* }}} */
@@ -291,11 +334,12 @@ void mysqli_add_property(HashTable *h, char *pname, mysqli_read_t r_func, mysqli
static union _zend_function *php_mysqli_constructor_get(zval *object TSRMLS_DC)
{
mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC);
+ zend_class_entry * ce = Z_OBJCE_P(object);
- 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;
+ if (ce != mysqli_link_class_entry && ce != mysqli_stmt_class_entry &&
+ ce != mysqli_result_class_entry && ce != mysqli_driver_class_entry &&
+ ce != mysqli_warning_class_entry) {
+ return zend_std_get_constructor(object TSRMLS_CC);
} else {
static zend_internal_function f;
@@ -315,7 +359,7 @@ static union _zend_function *php_mysqli_constructor_get(zval *object TSRMLS_DC)
} 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);
+ f.handler = ZEND_MN(mysqli_warning___construct);
}
return (union _zend_function*)&f;
@@ -330,6 +374,7 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry *class_
mysqli_object *intern;
zval *tmp;
zend_class_entry *mysqli_base_class;
+ zend_objects_free_object_storage_t free_storage;
intern = emalloc(sizeof(mysqli_object));
memset(intern, 0, sizeof(mysqli_object));
@@ -348,7 +393,20 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry *class_
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);
+ /* link object */
+ if (instanceof_function(class_type, mysqli_link_class_entry TSRMLS_CC)) {
+ free_storage = mysqli_link_free_storage;
+ } else if (instanceof_function(class_type, mysqli_stmt_class_entry TSRMLS_CC)) { /* stmt object */
+ free_storage = mysqli_stmt_free_storage;
+ } else if (instanceof_function(class_type, mysqli_result_class_entry TSRMLS_CC)) { /* result object */
+ free_storage = mysqli_result_free_storage;
+ } else if (instanceof_function(class_type, mysqli_warning_class_entry TSRMLS_CC)) { /* warning object */
+ free_storage = mysqli_warning_free_storage;
+ } else {
+ free_storage = mysqli_objects_free_storage;
+ }
+
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, free_storage, NULL TSRMLS_CC);
retval.handlers = &mysqli_object_handlers;
return retval;
@@ -367,7 +425,11 @@ zend_module_entry mysqli_module_entry = {
PHP_RSHUTDOWN(mysqli),
PHP_MINFO(mysqli),
"0.1", /* Replace with version number for your extension */
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(mysqli),
+ PHP_GINIT(mysqli),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
@@ -389,9 +451,9 @@ PHP_INI_END()
/* }}} */
-/* {{{ php_mysqli_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
-static void php_mysqli_init_globals(zend_mysqli_globals *mysqli_globals)
+static PHP_GINIT_FUNCTION(mysqli)
{
mysqli_globals->num_links = 0;
mysqli_globals->max_links = 0;
@@ -418,7 +480,6 @@ 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));
@@ -434,7 +495,7 @@ PHP_MINIT_FUNCTION(mysqli)
#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(), NULL TSRMLS_CC);
+ 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);
@@ -870,7 +931,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
* single value is an array. Also we'd have to make that one
* argument passed by reference.
*/
- zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
return;
}
} else {
@@ -885,7 +946,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
fcc.object_pp = &return_value;
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
- zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
+ 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);
@@ -895,7 +956,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
efree(fci.params);
}
} else if (ctor_params) {
- zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
+ 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);
}
}
}
@@ -1088,11 +1149,15 @@ void php_local_infile_end(void *ptr)
data= (mysqli_local_infile *)ptr;
- if (!(mysql = data->userdata)) {
+ if (!data || !(mysql = data->userdata)) {
+ if (data) {
+ free(data);
+ }
return;
}
php_stream_close(mysql->li_stream);
+ free(data);
return;
}
/* }}} */
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 4886b3f78..9bda36d78 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_api.c,v 1.118.2.22 2006/04/05 12:17:08 georg Exp $
+ $Id: mysqli_api.c,v 1.118.2.22.2.8 2006/10/02 07:44:34 bjori Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -57,14 +57,14 @@ PHP_FUNCTION(mysqli_autocommit)
{
MY_MYSQL *mysql;
zval *mysql_link;
- unsigned long automode;
+ zend_bool 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", MYSQLI_STATUS_VALID);
- if (mysql_autocommit(mysql->mysql, automode)) {
+ if (mysql_autocommit(mysql->mysql, (my_bool)automode)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -89,11 +89,6 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
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;
@@ -105,8 +100,12 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt", MYSQLI_STATUS_VALID);
+ num_vars = argc - 1;
if (getThis()) {
start = 1;
+ } else {
+ /* ignore handle parameter in procedural interface*/
+ --num_vars;
}
if (typelen != argc - start) {
@@ -154,23 +153,19 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
case 'b': /* Blob (send data) */
bind[ofs].buffer_type = MYSQL_TYPE_LONG_BLOB;
- bind[ofs].is_null = 0;
- bind[ofs].length = 0;
+ /* don't initialize is_null and length to 0 because we use ecalloc */
break;
case 's': /* string */
bind[ofs].buffer_type = MYSQL_TYPE_VAR_STRING;
- bind[ofs].buffer = NULL;
- bind[ofs].buffer_length = 0;
+ /* don't initialize buffer and buffer_length because we use ecalloc */
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;
+ RETVAL_FALSE;
+ goto end;
}
ofs++;
}
@@ -178,9 +173,8 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
if (rc) {
- efree(args);
- efree(bind);
- RETURN_FALSE;
+ RETVAL_FALSE;
+ goto end;
}
stmt->param.var_cnt = num_vars;
@@ -193,10 +187,10 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
stmt->param.vars[i] = NULL;
}
}
+ RETVAL_TRUE;
+end:
efree(args);
efree(bind);
-
- RETURN_TRUE;
}
/* }}} */
@@ -256,12 +250,16 @@ PHP_FUNCTION(mysqli_stmt_bind_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));
+ {
+ int size;
+ char *p= emalloc(size= var_cnt * (sizeof(char) + sizeof(VAR_BUFFER)));
+ stmt->result.buf = (VAR_BUFFER *) p;
+ stmt->result.is_null = p + var_cnt * sizeof(VAR_BUFFER);
+ memset(p, 0, size);
+ }
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) {
@@ -279,12 +277,16 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
break;
case MYSQL_TYPE_NULL:
- stmt->result.buf[ofs].type = IS_NULL;
- stmt->result.buf[ofs].buflen = 0;
+ stmt->result.buf[ofs].type = IS_NULL;
+ /*
+ don't initialize to 0 :
+ 1. stmt->result.buf[ofs].buflen
+ 2. bind[ofs].buffer
+ 3. bind[ofs].buffer_length
+ because memory was allocated with ecalloc
+ */
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:
@@ -294,7 +296,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
case MYSQL_TYPE_YEAR:
convert_to_long_ex(args[i]);
stmt->result.buf[ofs].type = IS_LONG;
- stmt->result.buf[ofs].buflen = 0;
+ /* don't set stmt->result.buf[ofs].buflen to 0, we used ecalloc */
stmt->result.buf[ofs].val = (char *)emalloc(sizeof(int));
bind[ofs].buffer_type = MYSQL_TYPE_LONG;
bind[ofs].buffer = stmt->result.buf[ofs].val;
@@ -303,10 +305,13 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
break;
case MYSQL_TYPE_LONGLONG:
+#if MYSQL_VERSION_ID > 50002
+ case MYSQL_TYPE_BIT:
+#endif
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_type = col_type;
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;
@@ -369,30 +374,27 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
if (rc) {
- efree(bind);
- efree(args);
/* dont close the statement or subsequent usage (for example ->execute()) will lead to crash */
for (i=0; i < var_cnt ; i++) {
- if (stmt->result.buf[i].val)
+ if (stmt->result.buf[i].val) {
efree(stmt->result.buf[i].val);
+ }
}
+ /* Don't free stmt->result.is_null because is_null & buf are one block of memory */
efree(stmt->result.buf);
- efree(stmt->result.is_null);
- 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];
+ RETVAL_FALSE;
+ } else {
+ 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];
+ }
+ RETVAL_TRUE;
}
-
efree(args);
efree(bind);
-
- RETURN_TRUE;
}
/* }}} */
@@ -687,7 +689,7 @@ PHP_FUNCTION(mysqli_stmt_fetch)
ZVAL_LONG(stmt->result.vars[i], *(unsigned int *)stmt->result.buf[i].val);
} else {
ZVAL_LONG(stmt->result.vars[i], *(int *)stmt->result.buf[i].val);
- };
+ }
break;
case IS_DOUBLE:
ZVAL_DOUBLE(stmt->result.vars[i], *(double *)stmt->result.buf[i].val);
@@ -713,7 +715,14 @@ PHP_FUNCTION(mysqli_stmt_fetch)
} else {
ZVAL_LONG(stmt->result.vars[i], llval);
}
- } else {
+ }
+#if MYSQL_VERSION_ID > 50002
+ else if (stmt->stmt->bind[i].buffer_type == MYSQL_TYPE_BIT) {
+ llval = *(my_ulonglong *)stmt->result.buf[i].val;
+ ZVAL_LONG(stmt->result.vars[i], llval);
+ }
+#endif
+ else {
ZVAL_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val, stmt->result.buf[i].buflen, 1);
}
break;
@@ -933,7 +942,7 @@ PHP_FUNCTION(mysqli_field_seek)
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (fieldnr < 0 || fieldnr >= mysql_num_fields(result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid field offset");
RETURN_FALSE;
}
@@ -972,8 +981,6 @@ PHP_FUNCTION(mysqli_free_result)
mysql_free_result(result);
MYSQLI_CLEAR_RESOURCE(&mysql_result);
-
- return;
}
/* }}} */
@@ -1136,7 +1143,7 @@ PHP_FUNCTION(mysqli_kill)
}
/* }}} */
-/* {{{ proto mysqli_set_local_infile_default(object link)
+/* {{{ proto void mysqli_set_local_infile_default(object link)
unsets user defined handler for load local infile command */
PHP_FUNCTION(mysqli_set_local_infile_default)
{
@@ -1184,6 +1191,8 @@ PHP_FUNCTION(mysqli_set_local_infile_handler)
/* save callback function */
ALLOC_ZVAL(mysql->li_read);
ZVAL_STRING(mysql->li_read, callback_func->value.str.val, 1);
+
+ RETURN_TRUE;
}
/* }}} */
@@ -1199,10 +1208,7 @@ PHP_FUNCTION(mysqli_more_results)
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link", MYSQLI_STATUS_VALID);
- if (!mysql_more_results(mysql->mysql)) {
- RETURN_FALSE;
- }
- RETURN_TRUE;
+ RETURN_BOOL(mysql_more_results(mysql->mysql));
}
/* }}} */
@@ -1217,10 +1223,7 @@ PHP_FUNCTION(mysqli_next_result) {
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link", MYSQLI_STATUS_VALID);
- if (mysql_next_result(mysql->mysql)) {
- RETURN_FALSE;
- }
- RETURN_TRUE;
+ RETURN_BOOL(!mysql_next_result(mysql->mysql));
}
/* }}} */
@@ -1288,11 +1291,7 @@ PHP_FUNCTION(mysqli_options)
break;
}
- if (ret != 0) {
- RETURN_FALSE;
- } else {
- RETURN_TRUE;
- }
+ RETURN_BOOL(!ret);
}
/* }}} */
@@ -1311,10 +1310,8 @@ PHP_FUNCTION(mysqli_ping)
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link", MYSQLI_STATUS_VALID);
rc = mysql_ping(mysql->mysql);
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
- if (rc) {
- RETURN_FALSE;
- }
- RETURN_TRUE;
+
+ RETURN_BOOL(!rc);
}
/* }}} */
@@ -1359,8 +1356,8 @@ PHP_FUNCTION(mysqli_prepare)
memcpy(mysql->mysql->net.last_error, last_error, MYSQL_ERRMSG_SIZE);
memcpy(mysql->mysql->net.sqlstate, sqlstate, SQLSTATE_LENGTH+1);
}
- }
-
+ }
+ /* don't joing to the previous if because it won't work if mysql_stmt_prepare_fails */
if (!stmt->stmt) {
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
efree(stmt);
@@ -1370,8 +1367,13 @@ PHP_FUNCTION(mysqli_prepare)
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);
+ /* don't initialize stmt->query with NULL, we ecalloc()-ed the memory */
+ /* Get performance boost if reporting is switched off */
+ if (query_len && (MyG(report_mode) & MYSQLI_REPORT_INDEX)) {
+ stmt->query = (char *)emalloc(query_len + 1);
+ memcpy(stmt->query, query, query_len);
+ stmt->query[query_len] = '\0';
+ }
/* change status */
mysqli_resource->status = MYSQLI_STATUS_VALID;
@@ -1497,7 +1499,7 @@ PHP_FUNCTION(mysqli_real_escape_string) {
newstr_len = mysql_real_escape_string(mysql->mysql, newstr, escapestr, escapestr_len);
newstr = erealloc(newstr, newstr_len + 1);
- RETURN_STRING(newstr, 0);
+ RETURN_STRINGL(newstr, newstr_len, 0);
}
/* }}} */
@@ -1520,7 +1522,7 @@ PHP_FUNCTION(mysqli_rollback)
}
/* }}} */
-/* {{{ proto bool mysqli_send_long_data(object stmt, int param_nr, string data)
+/* {{{ proto bool mysqli_stmt_send_long_data(object stmt, int param_nr, string data)
*/
PHP_FUNCTION(mysqli_stmt_send_long_data)
{
@@ -1608,7 +1610,6 @@ PHP_FUNCTION(mysqli_stmt_data_seek)
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt", MYSQLI_STATUS_VALID);
mysql_stmt_data_seek(stmt->stmt, offset);
- return;
}
/* }}} */
@@ -1642,8 +1643,6 @@ PHP_FUNCTION(mysqli_stmt_free_result)
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt", MYSQLI_STATUS_VALID);
mysql_stmt_free_result(stmt->stmt);
-
- return;
}
/* }}} */
@@ -1770,7 +1769,7 @@ PHP_FUNCTION(mysqli_ssl_set)
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", MYSQLI_STATUS_VALID);
+ MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link", MYSQLI_STATUS_INITIALIZED);
for (i=0; i < 5; i++) {
if (!ssl_parm_len[i]) {
@@ -1805,7 +1804,7 @@ PHP_FUNCTION(mysqli_stat)
/* }}} */
-/* {{{ proto int mysqli_stmt_attr_set(object stmt, long attr, bool mode)
+/* {{{ proto int mysqli_stmt_attr_set(object stmt, long attr, long mode)
*/
PHP_FUNCTION(mysqli_stmt_attr_set)
{
@@ -1833,7 +1832,11 @@ PHP_FUNCTION(mysqli_stmt_attr_get)
{
MY_STMT *stmt;
zval *mysql_stmt;
+#if MYSQL_VERSION_ID > 50099
+ my_bool value;
+#else
ulong value = 0;
+#endif
ulong attr;
int rc;
@@ -1845,7 +1848,7 @@ PHP_FUNCTION(mysqli_stmt_attr_get)
if ((rc = mysql_stmt_attr_get(stmt->stmt, attr, &value))) {
RETURN_FALSE;
}
- RETURN_LONG(value);
+ RETURN_LONG((long)value);
}
/* }}} */
diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c
index d1c776ad1..7a16e6284 100644
--- a/ext/mysqli/mysqli_driver.c
+++ b/ext/mysqli/mysqli_driver.c
@@ -79,7 +79,7 @@ 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_CC);
+ zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
return SUCCESS;
}
/* }}} */
diff --git a/ext/mysqli/mysqli_embedded.c b/ext/mysqli/mysqli_embedded.c
index 38d4b46c1..71f55d676 100644
--- a/ext/mysqli/mysqli_embedded.c
+++ b/ext/mysqli/mysqli_embedded.c
@@ -75,14 +75,14 @@ PHP_FUNCTION(mysqli_embedded_server_start)
/* 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;
+ groups[0] = NULL;
- zend_hash_internal_pointer_reset_ex(HASH_OF(*args), &pos);
+ zend_hash_internal_pointer_reset_ex(HASH_OF(*grps), &pos);
- for (index = 0;; zend_hash_move_forward_ex(HASH_OF(*args), &pos)) {
+ for (index = 0;; zend_hash_move_forward_ex(HASH_OF(*grps), &pos)) {
zval ** item;
- if (zend_hash_get_current_data_ex(HASH_OF(*args), (void **) &item, &pos) == FAILURE) {
+ if (zend_hash_get_current_data_ex(HASH_OF(*grps), (void **) &item, &pos) == FAILURE) {
break;
}
@@ -96,7 +96,7 @@ PHP_FUNCTION(mysqli_embedded_server_start)
groups[0] = NULL;
}
- rc = mysql_server_init(argc, arguments, NULL);
+ rc = mysql_server_init(argc, arguments, groups);
if (argc) {
efree(arguments);
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 1866beb49..332d839e8 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_nonapi.c,v 1.54.2.7 2006/03/24 09:32:24 georg Exp $
+ $Id: mysqli_nonapi.c,v 1.54.2.7.2.1 2006/10/02 07:44:34 bjori Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -289,7 +289,7 @@ PHP_FUNCTION(mysqli_get_warnings)
}
/* }}} */
-/* {{{ proto object mysqli_get_warnings(object link) */
+/* {{{ proto object mysqli_stmt_get_warnings(object link) */
PHP_FUNCTION(mysqli_stmt_get_warnings)
{
MY_STMT *stmt;
diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c
index 083c7c2d7..8b8e1e0cf 100644
--- a/ext/mysqli/mysqli_report.c
+++ b/ext/mysqli/mysqli_report.c
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: mysqli_report.c,v 1.11.2.2 2006/01/01 12:50:09 sniper Exp $
+ $Id: mysqli_report.c,v 1.11.2.2.2.1 2006/10/02 07:36:18 bjori Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -27,7 +27,7 @@
#include "ext/standard/info.h"
#include "php_mysqli.h"
-/* {{{ bool mysqli_report(int flags)
+/* {{{ proto bool mysqli_report(int flags)
sets report level */
PHP_FUNCTION(mysqli_report)
{
diff --git a/ext/mysqli/php_mysqli.h b/ext/mysqli/php_mysqli.h
index 78cbddcc5..241b7577f 100644
--- a/ext/mysqli/php_mysqli.h
+++ b/ext/mysqli/php_mysqli.h
@@ -15,7 +15,7 @@
| Author: Georg Richter <georg@php.net> |
+----------------------------------------------------------------------+
- $Id: php_mysqli.h,v 1.54.2.7 2006/04/05 12:17:08 georg Exp $
+ $Id: php_mysqli.h,v 1.54.2.7.2.2 2006/05/09 11:26:09 georg Exp $
*/
/* A little hack to prevent build break, when mysql is used together with
@@ -161,12 +161,12 @@ 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;
+extern zend_class_entry *mysqli_link_class_entry;
+extern zend_class_entry *mysqli_stmt_class_entry;
+extern zend_class_entry *mysqli_result_class_entry;
+extern zend_class_entry *mysqli_driver_class_entry;
+extern zend_class_entry *mysqli_warning_class_entry;
+extern zend_class_entry *mysqli_exception_class_entry;
#ifdef HAVE_SPL
extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
@@ -191,13 +191,13 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRML
mysqli_entry = zend_register_internal_class(&ce TSRMLS_CC); \
} \
-#define MYSQLI_REGISTER_RESOURCE_EX(__ptr, __zval, __ce) \
+#define MYSQLI_REGISTER_RESOURCE_EX(__ptr, __zval) \
((mysqli_object *) zend_object_store_get_object(__zval TSRMLS_CC))->ptr = __ptr; \
#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)
+ MYSQLI_REGISTER_RESOURCE_EX(__ptr, return_value)
#define MYSQLI_REGISTER_RESOURCE(__ptr, __ce) \
{\
@@ -207,7 +207,7 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRML
Z_TYPE_P(object) = IS_OBJECT;\
(object)->value.obj = mysqli_objects_new(__ce TSRMLS_CC);\
}\
- MYSQLI_REGISTER_RESOURCE_EX(__ptr, object, __ce)\
+ MYSQLI_REGISTER_RESOURCE_EX(__ptr, object)\
}
#define MYSQLI_FETCH_RESOURCE(__ptr, __type, __id, __name, __check) \
diff --git a/ext/mysqli/tests/013.phpt b/ext/mysqli/tests/013.phpt
index 983ceba14..60caff5b8 100644
--- a/ext/mysqli/tests/013.phpt
+++ b/ext/mysqli/tests/013.phpt
@@ -1,5 +1,5 @@
--TEST--
-mysqli fetch mixed / mysql_query
+mysqli fetch mixed / mysql_query (may fail when using 4.1 library with 5.x server)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
diff --git a/ext/mysqli/tests/019.phpt b/ext/mysqli/tests/019.phpt
index 41b1ba2cf..173c40490 100644
--- a/ext/mysqli/tests/019.phpt
+++ b/ext/mysqli/tests/019.phpt
@@ -20,12 +20,13 @@ mysqli fetch (bind_param + bind_result)
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);
+ $stmt= mysqli_prepare($link,"INSERT INTO insert_read(col1,col10, col11, col6) VALUES(?,?,?,?)");
+ mysqli_bind_param($stmt, "issd", $c1, $c2, $c3, $c4);
$c1 = 1;
$c2 = "foo";
$c3 = "foobar";
+ $c4 = 3.14;
mysqli_execute($stmt);
mysqli_stmt_close($stmt);
@@ -56,7 +57,7 @@ array(11) {
[4]=>
NULL
[5]=>
- NULL
+ float(3.14)
[6]=>
NULL
[7]=>
diff --git a/ext/mysqli/tests/028.phpt b/ext/mysqli/tests/028.phpt
index 021804540..0e897d86f 100644
--- a/ext/mysqli/tests/028.phpt
+++ b/ext/mysqli/tests/028.phpt
@@ -15,5 +15,5 @@ function test: mysqli_character_set_name
mysqli_close($link);
?>
---EXPECT--
-string(6) "latin1"
+--EXPECTF--
+string(%d) "%s"
diff --git a/ext/mysqli/tests/047.phpt b/ext/mysqli/tests/047.phpt
index 8663e8a64..4b5df9867 100644
--- a/ext/mysqli/tests/047.phpt
+++ b/ext/mysqli/tests/047.phpt
@@ -20,15 +20,28 @@ mysqli_get_metadata
mysqli_execute($stmt);
$result = mysqli_get_metadata($stmt);
- $fields = mysqli_fetch_fields($result);
+ echo "\n=== fetch_fields ===\n";
+ var_dump(mysqli_fetch_fields($result));
+
+ echo "\n=== fetch_field_direct ===\n";
+ var_dump(mysqli_fetch_field_direct($result, 0));
+ var_dump(mysqli_fetch_field_direct($result, 1));
+
+ echo "\n=== fetch_field ===\n";
+ while ($field = mysqli_fetch_field($result)) {
+ var_dump($field);
+ }
+
+ print_r(mysqli_fetch_lengths($result));
+
mysqli_free_result($result);
- var_dump($fields);
mysqli_stmt_close($stmt);
mysqli_close($link);
?>
--EXPECTF--
+=== fetch_fields ===
array(2) {
[0]=>
object(stdClass)#5 (11) {
@@ -81,3 +94,103 @@ array(2) {
int(0)
}
}
+
+=== fetch_field_direct ===
+object(stdClass)#6 (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)
+}
+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)
+}
+
+=== fetch_field ===
+object(stdClass)#6 (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)
+}
+object(stdClass)#5 (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)
+} \ No newline at end of file
diff --git a/ext/mysqli/tests/068.phpt b/ext/mysqli/tests/068.phpt
new file mode 100644
index 000000000..ab407c1ad
--- /dev/null
+++ b/ext/mysqli/tests/068.phpt
@@ -0,0 +1,33 @@
+--TEST--
+mysqli_autocommit() tests
+--SKIPIF--
+<?php
+ require_once('skipif.inc');
+?>
+--FILE--
+<?php
+
+include "connect.inc";
+
+$mysqli = new mysqli($host, $user, $passwd, "test");
+
+var_dump($mysqli->autocommit(false));
+$result = $mysqli->query("SELECT @@autocommit");
+var_dump($result->fetch_row());
+
+var_dump($mysqli->autocommit(true));
+$result = $mysqli->query("SELECT @@autocommit");
+var_dump($result->fetch_row());
+
+?>
+--EXPECT--
+bool(true)
+array(1) {
+ [0]=>
+ string(1) "0"
+}
+bool(true)
+array(1) {
+ [0]=>
+ string(1) "1"
+}
diff --git a/ext/mysqli/tests/071.phpt b/ext/mysqli/tests/071.phpt
new file mode 100644
index 000000000..75ff3e850
--- /dev/null
+++ b/ext/mysqli/tests/071.phpt
@@ -0,0 +1,36 @@
+--TEST--
+mysqli thread_id & kill
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
+--FILE--
+<?php
+ include "connect.inc";
+
+ $mysql = new mysqli($host, $user, $passwd, "test");
+
+ var_dump($mysql->ping());
+
+ var_dump($mysql->kill($mysql->thread_id));
+
+ var_dump($mysql->ping());
+
+ $mysql->close();
+
+ $mysql = new mysqli($host, $user, $passwd, "test");
+
+ var_dump(mysqli_ping($mysql));
+
+ var_dump(mysqli_kill($mysql, mysqli_thread_id($mysql)));
+
+ var_dump(mysqli_ping($mysql));
+
+ $mysql->close();
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(false)
+bool(true)
+bool(true)
+bool(false)
diff --git a/ext/mysqli/tests/072.phpt b/ext/mysqli/tests/072.phpt
new file mode 100644
index 000000000..8c85175ea
--- /dev/null
+++ b/ext/mysqli/tests/072.phpt
@@ -0,0 +1,27 @@
+--TEST--
+mysqli warning_count, get_warnings
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php die('skip mysqli_warning class not functional yet?'); ?>
+--FILE--
+<?php
+ include "connect.inc";
+
+ $mysql = new mysqli($host, $user, $passwd, "test");
+
+ $mysql->query("DROP TABLE IF EXISTS not_exists");
+
+ var_dump($mysql->warning_count);
+
+ $w = $mysql->get_warnings();
+
+ var_dump($w->errno);
+ var_dump($w->message);
+# var_dump($w->sqlstate);
+
+ $mysql->close();
+?>
+--EXPECT--
+1
+1051
+Unknown table 'not_exists' \ No newline at end of file
diff --git a/ext/mysqli/tests/073.phpt b/ext/mysqli/tests/073.phpt
new file mode 100644
index 000000000..5a017a2cb
--- /dev/null
+++ b/ext/mysqli/tests/073.phpt
@@ -0,0 +1,23 @@
+--TEST--
+mysqli_driver properties
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ include "connect.inc";
+
+ var_dump( $driver->embedded);
+ var_dump( $driver->client_version);
+ var_dump( $driver->client_info);
+ var_dump( $driver->driver_version);
+ var_dump( $driver->reconnect);
+ var_dump( $driver->report_mode);
+
+?>
+--EXPECTF--
+bool(%s)
+int(%d)
+string(%d) "%s"
+int(%d)
+bool(%s)
+int(%d)
diff --git a/ext/mysqli/tests/bug33263.phpt b/ext/mysqli/tests/bug33263.phpt
index 44f9167c9..8ccb1e7e5 100644
--- a/ext/mysqli/tests/bug33263.phpt
+++ b/ext/mysqli/tests/bug33263.phpt
@@ -2,6 +2,7 @@
bug #33263 (mysqli_real_connect in __construct)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
diff --git a/ext/mysqli/tests/bug36745.phpt b/ext/mysqli/tests/bug36745.phpt
index 7bbfe8180..868015c45 100644
--- a/ext/mysqli/tests/bug36745.phpt
+++ b/ext/mysqli/tests/bug36745.phpt
@@ -18,6 +18,6 @@ bug #36745 : LOAD DATA LOCAL INFILE doesn't return correct error message
$mysql->close();
printf("Done");
?>
---EXPECT--
-string(31) "Can't find file 'filenotfound'."
+--EXPECTF--
+string(%d) "%s"
Done
diff --git a/ext/mysqli/tests/bug36802.phpt b/ext/mysqli/tests/bug36802.phpt
index 69ef56bba..99f863330 100644
--- a/ext/mysqli/tests/bug36802.phpt
+++ b/ext/mysqli/tests/bug36802.phpt
@@ -17,7 +17,11 @@ bug #36802 : crashes with mysql_init
$mysql = mysqli_init();
/* following operations should not work */
- $x[0] = @$mysql->set_charset('utf8');
+ if (method_exists($mysql, 'set_charset')) {
+ $x[0] = @$mysql->set_charset('utf8');
+ } else {
+ $x[0] = NULL;
+ }
$x[1] = @$mysql->query("SELECT 'foo' FROM DUAL");
/* following operations should work */
diff --git a/ext/mysqli/tests/bug36949.phpt b/ext/mysqli/tests/bug36949.phpt
new file mode 100644
index 000000000..fb57df486
--- /dev/null
+++ b/ext/mysqli/tests/bug36949.phpt
@@ -0,0 +1,50 @@
+--TEST--
+bug #36949
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+include "connect.inc";
+
+class A {
+
+ private $mysqli;
+
+ public function __construct() {
+ global $user, $host, $passwd;
+ $this->mysqli = new mysqli($host, $user, $passwd);
+ $result = $this->mysqli->query("SELECT NOW() AS my_time FROM DUAL");
+ $row = $result->fetch_object();
+ echo $row->my_time."<br>\n";
+ $result->close();
+ }
+
+ public function __destruct() {
+ $this->mysqli->close();
+ }
+}
+
+class B {
+
+ private $mysqli;
+
+ public function __construct() {
+ global $user, $host, $passwd;
+ $this->mysqli = new mysqli($host, $user, $passwd);
+ $result = $this->mysqli->query("SELECT NOW() AS my_time FROM DUAL");
+ $row = $result->fetch_object();
+ echo $row->my_time."<br>\n";
+ $result->close();
+ }
+
+ public function __destruct() {
+ $this->mysqli->close();
+ }
+}
+
+$A = new A();
+$B = new B();
+?>
+--EXPECTF--
+%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d<br>
+%d%d%d%d-%d%d-%d%d %d%d:%d%d:%d%d<br>
diff --git a/ext/mysqli/tests/bug37090.phpt b/ext/mysqli/tests/bug37090.phpt
new file mode 100644
index 000000000..de6043d38
--- /dev/null
+++ b/ext/mysqli/tests/bug37090.phpt
@@ -0,0 +1,37 @@
+--TEST--
+bug #37090: mysqli_set_charset return code
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+ include "connect.inc";
+
+ $mysql = new mysqli($host, $user, $passwd);
+
+ $cs = array();
+ $cs[] = $mysql->set_charset("latin5");
+ $cs[] = $mysql->character_set_name();
+
+ $cs[] = $mysql->set_charset("utf8");
+ $cs[] = $mysql->character_set_name();
+
+ $cs[] = $mysql->set_charset("notdefined");
+ $cs[] = $mysql->character_set_name();
+
+ var_dump($cs);
+?>
+--EXPECT--
+array(6) {
+ [0]=>
+ bool(true)
+ [1]=>
+ string(6) "latin5"
+ [2]=>
+ bool(true)
+ [3]=>
+ string(4) "utf8"
+ [4]=>
+ bool(false)
+ [5]=>
+ string(4) "utf8"
+}
diff --git a/ext/mysqli/tests/bug38003.phpt b/ext/mysqli/tests/bug38003.phpt
new file mode 100644
index 000000000..af71f85f2
--- /dev/null
+++ b/ext/mysqli/tests/bug38003.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #38003 (in classes inherited from MySQLi it's possible to call private constructors from invalid context)
+--SKIPIF--
+<?php if (!extension_loaded("mysqli")) print "skip"; ?>
+--FILE--
+<?php
+
+class DB extends mysqli {
+
+ private function __construct($hostname, $username, $password, $database) {
+ var_dump("DB::__construct() called");
+ }
+}
+
+$DB = new DB();
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Call to private DB::__construct() from invalid context in %s on line %d
diff --git a/ext/mysqli/tests/connect.inc b/ext/mysqli/tests/connect.inc
index 2b4a67be2..ea24ff89a 100644
--- a/ext/mysqli/tests/connect.inc
+++ b/ext/mysqli/tests/connect.inc
@@ -16,10 +16,10 @@
"--datadir=$path",
"--innodb_data_home_dir=$path",
"--innodb_data_file_path=ibdata1:10M:autoextend",
- "--log-error=$path/testrun.log"
+ "--log-error=$path/testrun.log",
+ "--init-connect='CREATE DATABASE IF NOT EXISTS test;'"
);
- $x = $driver->embedded_server_start(TRUE, $args, NULL);
- var_dump($x);
+ $driver->embedded_server_start(TRUE, $args, NULL);
}
?>
diff --git a/ext/mysqli/tests/skipifnotemb.inc b/ext/mysqli/tests/skipifnotemb.inc
new file mode 100644
index 000000000..8639130cb
--- /dev/null
+++ b/ext/mysqli/tests/skipifnotemb.inc
@@ -0,0 +1,5 @@
+<?php
+ $driver = new mysqli_driver();
+ if (!$driver->embedded)
+ die("skip test for with embedded server only");
+?>
diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4
index 3d084d7d3..ca334de82 100644
--- a/ext/oci8/config.m4
+++ b/ext/oci8/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.55.2.3 2006/04/05 14:06:00 tony2001 Exp $
+dnl $Id: config.m4,v 1.55.2.3.2.3 2006/09/18 21:23:42 tony2001 Exp $
dnl
if test -z "$SED"; then
@@ -50,7 +50,7 @@ AC_DEFUN([AC_OCI8_CHECK_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/libnnz10.$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])
@@ -101,6 +101,35 @@ PHP_ARG_WITH(oci8, for Oracle (OCI8) support,
Use --with-oci8=instantclient,/path/to/oic/lib
to use Oracle Instant Client installation])
+ AC_MSG_CHECKING([checking PHP version])
+
+ tmp_version=$PHP_VERSION
+ if test -z "$tmp_version"; then
+ if test -z "$PHP_CONFIG"; then
+ AC_MSG_ERROR([php-config not found])
+ fi
+ php_version=`$PHP_CONFIG --version 2>/dev/null|head -n 1|sed -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'`
+ else
+ php_version=`echo "$tmp_version"|sed -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'`
+ fi
+
+ if test -z "$php_version"; then
+ AC_MSG_ERROR([failed to detect PHP version, please report])
+ fi
+
+ ac_IFS=$IFS
+ IFS="."
+ set $php_version
+ IFS=$ac_IFS
+ oci8_php_version=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
+
+ if test "$oci8_php_version" -le "4003010"; then
+ AC_MSG_ERROR([You need at least PHP 4.3.10 to be able to use this version of OCI8. PHP $php_version found])
+ else
+ AC_MSG_RESULT([$php_version, ok])
+ fi
+
+
PHP_OCI8_INSTANT_CLIENT="no"
if test "`echo $PHP_OCI8 | cut -d, -f2`" = "instantclient"; then
@@ -316,13 +345,13 @@ dnl version in /usr/lib
AC_MSG_CHECKING([Oracle Instant Client SDK header directory])
dnl Header directory for Instant Client SDK RPM install
- OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!^/usr/lib/oracle/\(.*\)/client/lib[[/]]*$!/usr/include/oracle/\1/client!'`
+ OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_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" | $PHP_OCI8_SED -e 's!\(.*\)/lib[[/]]*$!\1/include!'`
+ OCISDKMANINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!\(.*\)/lib[/]*$!\1/include!'`
if test -f "$OCISDKRPMINC/oci.h"; then
AC_MSG_RESULT($OCISDKRPMINC)
diff --git a/ext/oci8/config.w32 b/ext/oci8/config.w32
index a8a1a3da8..cce2dc0ec 100644
--- a/ext/oci8/config.w32
+++ b/ext/oci8/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.3.4.4 2006/05/22 04:18:05 tony2001 Exp $
+// $Id: config.w32,v 1.3.4.2.2.2 2006/05/22 04:17:42 tony2001 Exp $
// vim:ft=javascript
ARG_WITH("oci8", "OCI8 support", "no");
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 78e26cb97..450b9753d 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -26,7 +26,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8.c,v 1.269.2.18 2006/05/18 13:21:45 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.269.2.16.2.25 2006/10/18 14:23:23 tony2001 Exp $ */
/* TODO
*
* file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() with OCI_ATTR_LOBEMPTY
@@ -48,8 +48,12 @@
#include "php_oci8.h"
#include "php_oci8_int.h"
+#include "zend_hash.h"
ZEND_DECLARE_MODULE_GLOBALS(oci)
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
+static PHP_GINIT_FUNCTION(oci);
+#endif
/* True globals, no need for thread safety */
int le_connection;
@@ -250,6 +254,7 @@ static zend_function_entry php_oci_functions[] = {
PHP_FE(oci_lob_append, NULL)
PHP_FE(oci_lob_copy, NULL)
PHP_FE(oci_lob_export, NULL)
+ PHP_FE(oci_lob_seek, NULL)
PHP_FE(oci_commit, NULL)
PHP_FE(oci_rollback, NULL)
PHP_FE(oci_new_descriptor, NULL)
@@ -370,8 +375,16 @@ zend_module_entry oci8_module_entry = {
PHP_RINIT(oci), /* per-request startup function */
PHP_RSHUTDOWN(oci), /* per-request shutdown function */
PHP_MINFO(oci), /* information function */
- "1.1",
+ "1.2.2",
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
+ PHP_MODULE_GLOBALS(oci), /* globals descriptor */
+ PHP_GINIT(oci), /* globals ctor */
+ NULL, /* globals dtor */
+ NULL, /* post deactivate */
+ STANDARD_MODULE_PROPERTIES_EX
+#else
STANDARD_MODULE_PROPERTIES
+#endif
};
/* }}} */
@@ -420,7 +433,7 @@ oci_error:
if (error_code) {
int tmp_buf_len = strlen(tmp_buf);
- if (tmp_buf[tmp_buf_len - 1] == '\n') {
+ if (tmp_buf_len > 0 && tmp_buf[tmp_buf_len - 1] == '\n') {
tmp_buf[tmp_buf_len - 1] = '\0';
}
@@ -431,8 +444,7 @@ oci_error:
OCI_G(env) = NULL;
OCI_G(err) = NULL;
- }
- else {
+ } else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: %s", tmp_buf);
}
}
@@ -454,10 +466,14 @@ static void php_oci_cleanup_global_handles(TSRMLS_D)
}
} /* }}} */
-/* {{{ php_oci_init_globals()
+/* {{{ PHP_GINIT_FUNCTION
Zerofill globals during module init
*/
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
+static PHP_GINIT_FUNCTION(oci)
+#else
static void php_oci_init_globals(zend_oci_globals *oci_globals TSRMLS_DC)
+#endif
{
memset(oci_globals, 0, sizeof(zend_oci_globals));
}
@@ -486,7 +502,11 @@ PHP_MINIT_FUNCTION(oci)
OCIInitialize(PHP_OCI_INIT_MODE, NULL, NULL, NULL, NULL);
#endif
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
+ /* this is handled by new globals management code */
+#else
ZEND_INIT_MODULE_GLOBALS(oci, php_oci_init_globals, NULL);
+#endif
REGISTER_INI_ENTRIES();
le_statement = zend_register_list_destructors_ex(php_oci_statement_list_dtor, NULL, "oci8 statement", module_number);
@@ -647,7 +667,8 @@ PHP_MINFO_FUNCTION(oci)
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.18 $");
+ php_info_print_table_row(2, "Version", "1.2.2");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.16.2.25 $");
sprintf(buf, "%ld", OCI_G(num_persistent));
php_info_print_table_row(2, "Active Persistent Connections", buf);
@@ -755,9 +776,10 @@ void php_oci_bind_hash_dtor(void *data)
if (bind->array.elements) {
efree(bind->array.elements);
}
-/* if (bind->array.element_lengths) {
+ if (bind->array.element_lengths) {
efree(bind->array.element_lengths);
}
+/*
if (bind->array.indicators) {
efree(bind->array.indicators);
}
@@ -838,8 +860,12 @@ sb4 php_oci_error(OCIError *err_p, sword status TSRMLS_DC)
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);
+ if (errbuf) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: %s", errbuf);
+ efree(errbuf);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: failed to fetch error message");
+ }
break;
case OCI_NEED_DATA:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_NEED_DATA");
@@ -849,8 +875,12 @@ sb4 php_oci_error(OCIError *err_p, sword status TSRMLS_DC)
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);
+ if (errbuf) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf);
+ efree(errbuf);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to fetch error message");
+ }
break;
case OCI_INVALID_HANDLE:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_INVALID_HANDLE");
@@ -883,12 +913,12 @@ sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC)
if (error_code) {
int tmp_buf_len = strlen(tmp_buf);
- if (tmp_buf[tmp_buf_len - 1] == '\n') {
+ if (tmp_buf_len && tmp_buf[tmp_buf_len - 1] == '\n') {
tmp_buf[tmp_buf_len - 1] = '\0';
}
- if (error_buf) {
+ if (tmp_buf_len && error_buf) {
*error_buf = NULL;
- *error_buf = estrndup(tmp_buf, tmp_buf_len + 1);
+ *error_buf = estrndup(tmp_buf, tmp_buf_len);
}
}
return error_code;
@@ -902,14 +932,14 @@ int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, u
*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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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);
@@ -959,6 +989,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
time_t timestamp;
#if HAVE_OCI_ENV_NLS_CREATE
ub2 charsetid = 0;
+ ub2 charsetid_nls_lang = 0;
#endif
switch (session_mode) {
@@ -980,20 +1011,43 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
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 (password_len) {
+ ulong password_hash;
+ password_hash = zend_inline_hash_func(password, password_len);
+ smart_str_append_unsigned_ex(&hashed_details, password_hash, 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);
+ /* Initialize global handles if the weren't initialized before */
+ if (OCI_G(env) == NULL) {
+ php_oci_init_global_handles(TSRMLS_C);
+ }
+
#if HAVE_OCI_ENV_NLS_CREATE
if (charset && *charset) {
- smart_str_appends_ex(&hashed_details, charset, 1);
+ PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, (OCI_G(env), charset));
+ if (!charsetid) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid character set name: %s", charset);
+ } else {
+ smart_str_append_unsigned_ex(&hashed_details, charsetid, 0);
+ }
}
- else {
+
+ /* use NLS_LANG if no or invalid charset specified */
+ if (!charsetid) {
size_t rsize = 0;
+ sword result;
- PHP_OCI_CALL(OCINlsEnvironmentVariableGet, (&charsetid, 2, OCI_NLS_CHARSET_ID, 0, &rsize));
- smart_str_append_unsigned_ex(&hashed_details, charsetid, 0);
+ PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize))
+ if (result != OCI_SUCCESS) {
+ charsetid_nls_lang = 0;
+ }
+ smart_str_append_unsigned_ex(&hashed_details, charsetid_nls_lang, 0);
}
#else
if (charset && *charset) {
@@ -1009,27 +1063,22 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
/* make it lowercase */
php_strtolower(hashed_details.c, hashed_details.len);
- /* 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) {
-
+ zend_bool found = 0;
+
if (persistent && zend_hash_find(&EG(persistent_list), hashed_details.c, hashed_details.len+1, (void **) &le) == SUCCESS) {
+ found = 1;
/* 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) {
+ } else if (!persistent && zend_hash_find(&EG(regular_list), hashed_details.c, hashed_details.len+1, (void **) &le) == SUCCESS) {
+ found = 1;
if (le->type == le_index_ptr) {
- int type;
- long link;
+ int type, link;
void *ptr;
- link = (long) le->ptr;
+ link = (int) le->ptr;
ptr = zend_list_find(link,&type);
if (ptr && (type == le_connection)) {
connection = (php_oci_connection *)ptr;
@@ -1051,26 +1100,32 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* 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)) {
+ if ( (connection->next_ping > 0) && (timestamp >= connection->next_ping) && !php_oci_connection_ping(connection TSRMLS_CC)) {
/* server died */
- }
- else {
+ } else {
+ int rsrc_type;
+ php_oci_connection *tmp;
+
/* okay, the connection is open and the server is still alive */
connection->used_this_request = 1;
- smart_str_free_ex(&hashed_details, 0);
- if (zend_list_addref(connection->rsrc_id) == FAILURE) {
+ tmp = (php_oci_connection *)zend_list_find(connection->rsrc_id, &rsrc_type);
+
+ if (tmp != NULL && rsrc_type == le_pconnection && strlen(tmp->hash_key) == hashed_details.len &&
+ memcmp(tmp->hash_key, hashed_details.c, hashed_details.len) == 0 && zend_list_addref(connection->rsrc_id) == SUCCESS) {
+ /* do nothing */
+ } else {
connection->rsrc_id = zend_list_insert(connection, le_pconnection);
}
+ smart_str_free_ex(&hashed_details, 0);
return connection;
}
}
/* server died */
+ connection->is_open = 0;
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 {
+ } else {
/* we do not ping non-persistent connections */
smart_str_free_ex(&hashed_details, 0);
zend_list_addref(connection->rsrc_id);
@@ -1081,13 +1136,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
connection = NULL;
goto open;
}
- }
- else {
+ } else if (found) {
/* 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 {
+ } else {
zend_hash_del(&EG(regular_list), hashed_details.c, hashed_details.len+1);
}
}
@@ -1109,26 +1162,23 @@ open:
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->hash_key = estrndup(hashed_details.c, hashed_details.len);
connection->is_persistent = 0;
- }
- else {
+ } 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 {
+ } else {
connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection));
- connection->hash_key = estrndup(hashed_details.c, hashed_details.len+1);
+ connection->hash_key = estrndup(hashed_details.c, hashed_details.len);
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 {
+ } else {
/* -1 means "Off" */
connection->next_ping = 0;
}
@@ -1139,32 +1189,34 @@ open:
#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) {
+ if (charsetid) {
connection->charset = charsetid;
+ } else {
+ connection->charset = charsetid_nls_lang;
}
/* 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));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIEnvNlsCreate, (&(connection->env), PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL, connection->charset, connection->charset));
#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));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIEnvInit, (&(connection->env), OCI_DEFAULT, 0, NULL));
#endif
if (OCI_G(errcode) != OCI_SUCCESS) {
#ifdef HAVE_OCI_INSTANT_CLIENT
+# ifdef PHP_WIN32
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, PHP_OCI_INIT_FUNC_NAME "() failed. There is something wrong with your system - please check that 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 LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries");
+# endif
#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
@@ -1173,7 +1225,7 @@ open:
}
/* allocate our server handle {{{ */
- OCI_G(errcode) = PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(connection->server), OCI_HTYPE_SERVER, 0, NULL));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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);
@@ -1182,7 +1234,7 @@ open:
} /* }}} */
/* attach to the server {{{ */
- OCI_G(errcode) = PHP_OCI_CALL(OCIServerAttach, (connection->server, OCI_G(err), (text*)dbname, dbname_len, (ub4) OCI_DEFAULT));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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);
@@ -1192,7 +1244,7 @@ open:
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));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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);
@@ -1201,7 +1253,7 @@ open:
} /* }}} */
/* allocate our private error-handle {{{ */
- OCI_G(errcode) = PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(connection->err), OCI_HTYPE_ERROR, 0, NULL));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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);
@@ -1210,7 +1262,7 @@ open:
} /* }}} */
/* allocate our service-context {{{ */
- OCI_G(errcode) = PHP_OCI_CALL(OCIHandleAlloc, (connection->env, (dvoid **)&(connection->svc), OCI_HTYPE_SVCCTX, 0, NULL));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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);
@@ -1220,7 +1272,7 @@ open:
/* 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)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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);
@@ -1231,7 +1283,7 @@ open:
/* 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)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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);
@@ -1241,7 +1293,7 @@ open:
}/* }}} */
/* 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)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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);
@@ -1250,7 +1302,7 @@ open:
} /* }}} */
/* 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)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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);
@@ -1260,7 +1312,7 @@ open:
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));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPasswordChange, (connection->svc, OCI_G(err), (text *)username, username_len, (text *)password, password_len, (text *)new_password, new_password_len, OCI_AUTH));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
@@ -1268,7 +1320,7 @@ open:
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)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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);
@@ -1281,19 +1333,19 @@ open:
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));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_RDBMS, (ub4) OCI_DEFAULT));
#endif
break;
case OCI_SYSDBA:
case OCI_SYSOPER:
default:
if (username_len == 1 && username[0] == '/' && password_len == 0) {
- OCI_G(errcode) = PHP_OCI_CALL(OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_EXT, (ub4) session_mode));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_EXT, (ub4) session_mode));
} else {
- OCI_G(errcode) = PHP_OCI_CALL(OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_RDBMS, (ub4) session_mode));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) OCI_CRED_RDBMS, (ub4) session_mode));
}
break;
}
@@ -1314,7 +1366,7 @@ open:
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)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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);
@@ -1335,15 +1387,13 @@ open:
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(zend_rsrc_list_entry), NULL);
OCI_G(num_persistent)++;
- }
- else if (!exclusive) {
+ } else if (!exclusive) {
connection->rsrc_id = zend_list_insert(connection, le_connection);
new_le.ptr = (void *)connection->rsrc_id;
new_le.type = le_index_ptr;
zend_hash_update(&EG(regular_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), NULL);
OCI_G(num_links)++;
- }
- else {
+ } else {
connection->rsrc_id = zend_list_insert(connection, le_connection);
OCI_G(num_links)++;
}
@@ -1357,11 +1407,11 @@ static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC)
{
/* OCIPing() crashes Oracle servers older than 10.2 */
#if 0
- OCI_G(errcode) = PHP_OCI_CALL(OCIPing, (connection->svc, OCI_G(err), OCI_DEFAULT));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerVersion, (connection->server, OCI_G(err), (text*)version, sizeof(version), OCI_HTYPE_SERVER));
#endif
if (OCI_G(errcode) == OCI_SUCCESS) {
@@ -1381,7 +1431,7 @@ 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)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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;
@@ -1397,7 +1447,7 @@ static int php_oci_connection_status(php_oci_connection *connection TSRMLS_DC)
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCITransRollback, (connection->svc, connection->err, (ub4) 0));
connection->needs_commit = 0;
if (connection->errcode != OCI_SUCCESS) {
@@ -1412,7 +1462,7 @@ int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC)
Commit connection */
int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC)
{
- connection->errcode = PHP_OCI_CALL(OCITransCommit, (connection->svc, connection->err, (ub4) 0));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCITransCommit, (connection->svc, connection->err, (ub4) 0));
connection->needs_commit = 0;
if (connection->errcode != OCI_SUCCESS) {
@@ -1428,6 +1478,7 @@ int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC)
static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC)
{
int result = 0;
+ zend_bool in_call_save = OCI_G(in_call);
if (connection->descriptors) {
zend_hash_destroy(connection->descriptors);
@@ -1477,14 +1528,14 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC)
free(connection->hash_key);
}
free(connection);
- }
- else {
+ } else {
if (connection->hash_key) {
efree(connection->hash_key);
}
efree(connection);
}
connection = NULL;
+ OCI_G(in_call) = in_call_save;
return result;
} /* }}} */
@@ -1492,7 +1543,7 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC)
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIPasswordChange, (connection->svc, connection->err, (text *)user, user_len, (text *)pass_old, pass_old_len, (text *)pass_new, pass_new_len, OCI_DEFAULT));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -1508,7 +1559,7 @@ int php_oci_server_get_version(php_oci_connection *connection, char **version TS
{
char version_buff[256];
- connection->errcode = PHP_OCI_CALL(OCIServerVersion, (connection->svc, connection->err, (text*)version_buff, sizeof(version_buff), OCI_HTYPE_SVCCTX));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -1537,8 +1588,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR
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) {
+ } else if (column->is_descr) {
if (column->data_type != SQLT_RDD) {
int rsrc_type;
@@ -1565,8 +1615,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR
} else {
if (lob_length > 0) {
ZVAL_STRINGL(value, lob_buffer, lob_length, 0);
- }
- else {
+ } else {
ZVAL_EMPTY_STRING(value);
}
return 0;
@@ -1577,8 +1626,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR
add_property_resource(value, "descriptor", column->descid);
zend_list_addref(column->descid);
}
- }
- else {
+ } else {
switch (column->retcode) {
case 0:
/* intact value */
@@ -1621,8 +1669,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
if (ZEND_NUM_ARGS() == 2) {
fetch_mode = mode;
}
- }
- else if (expected_args == 2) {
+ } 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) {
@@ -1632,8 +1679,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
if (ZEND_NUM_ARGS() == 1) {
fetch_mode = mode;
}
- }
- else {
+ } else {
/* for all oci_fetch_*() */
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
@@ -1722,6 +1768,10 @@ static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC)
connection = (php_oci_connection *)le->ptr;
if (connection->used_this_request) {
+ if ((PG(connection_status) & PHP_CONNECTION_TIMEOUT) || OCI_G(in_call)) {
+ return 1;
+ }
+
if (connection->descriptors) {
zend_hash_destroy(connection->descriptors);
efree(connection->descriptors);
@@ -1738,15 +1788,13 @@ static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC)
if (OCI_G(ping_interval) >= 0) {
connection->next_ping = timestamp + OCI_G(ping_interval);
- }
- else {
+ } else {
/* ping_interval is -1 */
connection->next_ping = 0;
}
connection->used_this_request = 0;
- }
- else if (OCI_G(persistent_timeout) != -1) {
+ } else if (OCI_G(persistent_timeout) != -1) {
if (connection->idle_expiry < timestamp) {
/* connection has timed out */
return 1;
diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c
index 74d4b82aa..127504524 100644
--- a/ext/oci8/oci8_collection.c
+++ b/ext/oci8/oci8_collection.c
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_collection.c,v 1.5.2.3 2006/01/01 12:50:10 sniper Exp $ */
+/* $Id: oci8_collection.c,v 1.5.2.3.2.3 2006/08/21 16:41:13 tony2001 Exp $ */
@@ -37,7 +37,7 @@
#include "ext/standard/info.h"
#include "php_ini.h"
-#if HAVE_OCI8
+#if HAVE_OCI8 && PHP_OCI8_HAVE_COLLECTIONS
#include "php_oci8.h"
#include "php_oci8_int.h"
@@ -57,35 +57,70 @@ php_oci_collection * php_oci_collection_create(php_oci_connection* connection, c
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)));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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;
@@ -95,28 +130,64 @@ php_oci_collection * php_oci_collection_create(php_oci_connection* connection, c
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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)));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIAttrGet,
+ (
+ (dvoid*) parmp2,
+ (ub4) OCI_DTYPE_PARAM,
+ (dvoid*) &(collection->element_typecode),
+ (ub4 *) 0,
+ (ub4) OCI_ATTR_TYPECODE,
+ connection->err
+ )
+ );
if (connection->errcode) {
goto CLEANUP;
@@ -129,7 +200,7 @@ php_oci_collection * php_oci_collection_create(php_oci_connection* connection, c
}
/* Create object to hold return table */
- connection->errcode = PHP_OCI_CALL(OCIObjectNew,
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIObjectNew,
(
connection->env,
connection->err,
@@ -163,7 +234,7 @@ 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollSize, (connection->env, connection->err, collection->collection, (sb4 *)size));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -178,7 +249,7 @@ 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));
+ PHP_OCI_CALL_RETURN(*max, OCICollMax, (connection->env, collection->collection));
/* error handling is not necessary here? */
return 0;
@@ -190,7 +261,7 @@ int php_oci_collection_trim(php_oci_collection *collection, long trim_size TSRML
{
php_oci_connection *connection = collection->connection;
- connection->errcode = PHP_OCI_CALL(OCICollTrim, (connection->env, connection->err, trim_size, collection->collection));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCICollTrim, (connection->env, connection->err, trim_size, collection->collection));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -207,7 +278,7 @@ int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC)
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -225,7 +296,7 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, date, date_len, NULL, 0, NULL, 0, &oci_date));
if (connection->errcode != OCI_SUCCESS) {
/* failed to convert string to date */
@@ -233,7 +304,15 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCICollAppend, (connection->env, connection->err, (dvoid *) &oci_date, (dvoid *) &new_index, (OCIColl *) collection->collection));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -254,14 +333,22 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe
element_double = zend_strtod(number, NULL);
- connection->errcode = PHP_OCI_CALL(OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -279,14 +366,22 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme
OCIString *ocistr = (OCIString *)0;
php_oci_connection *connection = collection->connection;
- connection->errcode = PHP_OCI_CALL(OCIStringAssignText, (connection->env, connection->err, element, element_len, &ocistr));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -350,7 +445,17 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -371,7 +476,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z
switch (collection->element_typecode) {
case OCI_TYPECODE_DATE:
- connection->errcode = PHP_OCI_CALL(OCIDateToText, (connection->err, element, 0, 0, 0, 0, &buff_len, buff));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -390,7 +495,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z
OCIString *oci_string = *(OCIString **)element;
text *str;
- str = (text *)PHP_OCI_CALL(OCIStringPtr, (connection->env, oci_string));
+ PHP_OCI_CALL_RETURN(str, OCIStringPtr, (connection->env, oci_string));
if (str) {
ZVAL_STRING(*result_element, str, 1);
@@ -413,7 +518,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, long index, z
{
double double_number;
- connection->errcode = PHP_OCI_CALL(OCINumberToReal, (connection->err, (CONST OCINumber *) element, (uword) sizeof(double), (dvoid *) &double_number));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -444,7 +549,7 @@ int php_oci_collection_element_set_null(php_oci_collection *collection, long ind
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -462,7 +567,7 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, long ind
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, date, date_len, NULL, 0, NULL, 0, &oci_date));
if (connection->errcode != OCI_SUCCESS) {
/* failed to convert string to date */
@@ -470,7 +575,16 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, long ind
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCICollAssignElem, (connection->env, connection->err, (ub4)index, (dvoid *) &oci_date, (dvoid *) &new_index, (OCIColl *) collection->collection));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -491,14 +605,23 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, long i
element_double = zend_strtod(number, NULL);
- connection->errcode = PHP_OCI_CALL(OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -516,14 +639,23 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, long i
OCIString *ocistr = (OCIString *)0;
php_oci_connection *connection = collection->connection;
- connection->errcode = PHP_OCI_CALL(OCIStringAssignText, (connection->env, connection->err, element, element_len, &ocistr));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -579,7 +711,7 @@ int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_colle
{
php_oci_connection *connection = collection_dest->connection;
- connection->errcode = PHP_OCI_CALL(OCICollAssign, (connection->env, connection->err, collection_from->collection, collection_dest->collection));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -595,7 +727,7 @@ 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c
index a5f7d00f9..dbbce2290 100644
--- a/ext/oci8/oci8_interface.c
+++ b/ext/oci8/oci8_interface.c
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_interface.c,v 1.8.2.7 2006/03/28 09:12:18 tony2001 Exp $ */
+/* $Id: oci8_interface.c,v 1.8.2.7.2.3 2006/08/22 11:09:12 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1483,7 +1483,10 @@ PHP_FUNCTION(oci_free_statement)
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- zend_list_delete(statement->id);
+ if (!statement->nested) {
+ /* nested cursors cannot be freed, they are allocated once and used during the fetch */
+ zend_list_delete(statement->id);
+ }
RETURN_TRUE;
}
@@ -1633,15 +1636,14 @@ PHP_FUNCTION(oci_parse)
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) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &query, &query_len) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
- statement = php_oci_statement_create(connection, query, query_len, cached TSRMLS_CC);
+ statement = php_oci_statement_create(connection, query, query_len TSRMLS_CC);
if (statement) {
RETURN_RESOURCE(statement->id);
@@ -1689,12 +1691,38 @@ PHP_FUNCTION(oci_password_change)
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 (!user_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "username cannot be empty");
+ RETURN_FALSE;
+ }
+ if (!pass_old_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "old password cannot be empty");
+ RETURN_FALSE;
+ }
+ if (!pass_new_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "new password cannot be empty");
+ RETURN_FALSE;
+ }
+
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) {
+ if (!user_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "username cannot be empty");
+ RETURN_FALSE;
+ }
+ if (!pass_old_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "old password cannot be empty");
+ RETURN_FALSE;
+ }
+ if (!pass_new_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "new password cannot be empty");
+ RETURN_FALSE;
+ }
+
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;
@@ -1719,7 +1747,7 @@ PHP_FUNCTION(oci_new_cursor)
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
- statement = php_oci_statement_create(connection, NULL, 0, 0 TSRMLS_CC);
+ statement = php_oci_statement_create(connection, NULL, 0 TSRMLS_CC);
if (statement) {
RETURN_RESOURCE(statement->id);
diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c
index 023fbfaaf..39c61d87d 100644
--- a/ext/oci8/oci8_lob.c
+++ b/ext/oci8/oci8_lob.c
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_lob.c,v 1.7.2.6 2006/04/05 14:06:00 tony2001 Exp $ */
+/* $Id: oci8_lob.c,v 1.7.2.6.2.6 2006/08/22 11:09:12 tony2001 Exp $ */
@@ -70,7 +70,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ
descriptor = ecalloc(1, 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));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode), 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);
@@ -86,6 +86,8 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, long typ
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 */
+ descriptor->charset_form = SQLCS_IMPLICIT; /* default value */
+ descriptor->charset_id = connection->charset;
if (descriptor->type == OCI_DTYPE_LOB || descriptor->type == OCI_DTYPE_FILE) {
/* add Lobs & Files to hash. we'll flush them at the end */
@@ -113,7 +115,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D
return 0;
} else {
if (descriptor->type == OCI_DTYPE_FILE) {
- connection->errcode = PHP_OCI_CALL(OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -121,7 +123,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D
}
}
- connection->errcode = PHP_OCI_CALL(OCILobGetLength, (connection->svc, connection->err, descriptor->descriptor, (ub4 *)length));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobGetLength, (connection->svc, connection->err, descriptor->descriptor, (ub4 *)length));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -132,7 +134,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D
descriptor->lob_size = *length;
if (descriptor->type == OCI_DTYPE_FILE) {
- connection->errcode = PHP_OCI_CALL(OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -144,20 +146,92 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D
return 0;
} /* }}} */
+/* {{{ php_oci_lob_callback()
+ Append LOB portion to a memory buffer */
+#if defined(HAVE_OCI_LOB_READ2)
+sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp)
+#else
+sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, ub4 len, ub1 piece)
+#endif
+{
+ ub4 lenp = (ub4) len;
+ php_oci_lob_ctx *ctx = (php_oci_lob_ctx *)ctxp;
+
+ switch (piece)
+ {
+ case OCI_LAST_PIECE:
+ *(ctx->lob_data) = erealloc(*(ctx->lob_data), (size_t) (*(ctx->lob_len) + lenp + 1));
+ memcpy(*(ctx->lob_data) + *(ctx->lob_len), bufxp, (size_t) lenp);
+ *(ctx->lob_len) += lenp;
+ *(*(ctx->lob_data) + *(ctx->lob_len)) = 0x00;
+ return OCI_CONTINUE;
+
+ case OCI_FIRST_PIECE:
+ case OCI_NEXT_PIECE:
+ *(ctx->lob_data) = erealloc(*(ctx->lob_data), (size_t) (*(ctx->lob_len) + lenp));
+ memcpy(*(ctx->lob_data) + *(ctx->lob_len), bufxp, (size_t) lenp);
+ *(ctx->lob_len) += lenp;
+ return OCI_CONTINUE;
+
+ default: {
+ TSRMLS_FETCH();
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected LOB piece id received (value:%d)", piece);
+ efree(*(ctx->lob_data));
+ *(ctx->lob_data) = NULL;
+ *(ctx->lob_len) = 0;
+ return OCI_ERROR;
+ }
+ }
+}
+/* }}} */
+
+/* {{{ php_oci_lob_calculate_buffer() */
+static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, long read_length TSRMLS_DC)
+{
+ php_oci_connection *connection = descriptor->connection;
+ ub4 chunk_size;
+
+ if (!descriptor->chunk_size) {
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobGetChunkSize, (connection->svc, connection->err, descriptor->descriptor, &chunk_size));
+
+ if (connection->errcode != OCI_SUCCESS) {
+ php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
+ return read_length; /* we have to return original length here */
+ }
+ descriptor->chunk_size = chunk_size;
+ }
+
+ if ((read_length % descriptor->chunk_size) != 0) {
+ return descriptor->chunk_size * ((read_length / descriptor->chunk_size) + 1);
+ }
+ return read_length;
+}
+/* }}} */
+
/* {{{ 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 initial_offset, char **data, ub4 *data_len TSRMLS_DC)
{
php_oci_connection *connection = descriptor->connection;
ub4 length = 0;
- int bytes_read, bytes_total = 0, offset = 0;
- int requested_len = read_length; /* this is by default */
+ int buffer_size = PHP_OCI_LOB_BUFFER_SIZE;
+ php_oci_lob_ctx ctx;
+ ub1 *bufp;
#if defined(HAVE_OCI_LOB_READ2)
- int chars_read = 0, is_clob = 0;
+ oraub8 bytes_read, offset = 0;
+ oraub8 requested_len = read_length; /* this is by default */
+ oraub8 chars_read = 0;
+ int is_clob = 0;
+#else
+ int bytes_read, offset = 0;
+ int requested_len = read_length; /* this is by default */
#endif
*data_len = 0;
*data = NULL;
+ ctx.lob_len = data_len;
+ ctx.lob_data = data;
if (php_oci_lob_get_length(descriptor, &length TSRMLS_CC)) {
return 1;
@@ -183,9 +257,11 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini
if (requested_len <= 0) {
return 0;
}
+
+ offset = initial_offset;
if (descriptor->type == OCI_DTYPE_FILE) {
- connection->errcode = PHP_OCI_CALL(OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -197,7 +273,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini
else {
ub2 charset_id = 0;
- connection->errcode = PHP_OCI_CALL(OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -209,110 +285,101 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, long read_length, long ini
is_clob = 1;
}
}
-#endif
-
- *data = (char *)emalloc(requested_len + 1);
- bytes_read = requested_len;
- offset = initial_offset;
-
- /* TODO
- * We need to make sure this function works with Unicode LOBs
- * */
-
-#if defined(HAVE_OCI_LOB_READ2)
- do {
+ if (is_clob) {
+ chars_read = requested_len;
+ bytes_read = 0;
+ } else {
chars_read = 0;
- connection->errcode = PHP_OCI_CALL(OCILobRead2,
- (
- connection->svc,
- connection->err,
- descriptor->descriptor,
- (oraub8 *)&bytes_read, /* IN/OUT bytes toread/read */
- (oraub8 *)&chars_read,
- (oraub8) offset + 1, /* offset (starts with 1) */
- (dvoid *) ((char *) *data + *data_len),
- (oraub8) requested_len, /* size of buffer */
- 0,
- NULL,
- (OCICallbackLobRead2) 0, /* callback... */
- (ub2) connection->charset, /* The character set ID of the buffer data. */
- (ub1) SQLCS_IMPLICIT /* The character set form of the buffer data. */
- )
- );
-
- bytes_total += bytes_read;
- if (is_clob) {
- offset += chars_read;
- } else {
- offset += bytes_read;
- }
-
- *data_len += bytes_read;
-
- if (connection->errcode != OCI_NEED_DATA) {
- break;
- }
- *data = erealloc(*data, *data_len + PHP_OCI_LOB_BUFFER_SIZE + 1);
- } while (connection->errcode == OCI_NEED_DATA);
+ bytes_read = requested_len;
+ }
+
+ buffer_size = (requested_len < buffer_size ) ? requested_len : buffer_size; /* optimize buffer size */
+ buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size TSRMLS_CC); /* use chunk size */
+
+ bufp = (ub1 *) ecalloc(1, buffer_size);
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobRead2,
+ (
+ connection->svc,
+ connection->err,
+ descriptor->descriptor,
+ (oraub8 *)&bytes_read, /* IN/OUT bytes toread/read */
+ (oraub8 *)&chars_read, /* IN/OUT chars toread/read */
+ (oraub8) offset + 1, /* offset (starts with 1) */
+ (dvoid *) bufp,
+ (oraub8) buffer_size, /* size of buffer */
+ OCI_FIRST_PIECE,
+ (dvoid *)&ctx,
+ (OCICallbackLobRead2) php_oci_lob_callback, /* callback... */
+ (ub2) descriptor->charset_id, /* The character set ID of the buffer data. */
+ (ub1) descriptor->charset_form /* The character set form of the buffer data. */
+ )
+ );
+
+ efree(bufp);
+
+ if (is_clob) {
+ offset = descriptor->lob_current_position + chars_read;
+ } else {
+ offset = descriptor->lob_current_position + bytes_read;
+ }
#else
- do {
- 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),
- requested_len, /* 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. */
- )
- );
-
- bytes_total += bytes_read;
- offset += bytes_read;
-
- *data_len += bytes_read;
-
- if (connection->errcode != OCI_NEED_DATA) {
- break;
- }
- *data = erealloc(*data, *data_len + PHP_OCI_LOB_BUFFER_SIZE + 1);
- } while (connection->errcode == OCI_NEED_DATA);
+ bytes_read = requested_len;
+ buffer_size = (requested_len < buffer_size ) ? requested_len : buffer_size; /* optimize buffer size */
+ buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size TSRMLS_CC); /* use chunk size */
+
+ bufp = (ub1 *) ecalloc(1, buffer_size);
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobRead,
+ (
+ connection->svc,
+ connection->err,
+ descriptor->descriptor,
+ &bytes_read, /* IN/OUT bytes toread/read */
+ offset + 1, /* offset (starts with 1) */
+ (dvoid *) bufp,
+ (ub4) buffer_size, /* size of buffer */
+ (dvoid *)&ctx,
+ (OCICallbackLobRead) php_oci_lob_callback, /* callback... */
+ (ub2) descriptor->charset_id, /* The character set ID of the buffer data. */
+ (ub1) descriptor->charset_form /* The character set form of the buffer data. */
+ )
+ );
+
+ efree(bufp);
+ offset = descriptor->lob_current_position + bytes_read;
#endif
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;
+ if (*data) {
+ efree(*data);
+ *data = NULL;
+ }
+ *data_len = 0;
return 1;
}
- descriptor->lob_current_position = offset;
+ descriptor->lob_current_position = (int)offset;
if (descriptor->type == OCI_DTYPE_FILE) {
- connection->errcode = PHP_OCI_CALL(OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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;
+ if (*data) {
+ efree(*data);
+ *data = NULL;
+ }
+ *data_len = 0;
return 1;
}
}
- *data = erealloc(*data, *data_len + 1);
- (*data)[ *data_len ] = 0;
-
return 0;
} /* }}} */
@@ -341,7 +408,22 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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) descriptor->charset_id,
+ (ub1) descriptor->charset_form
+ )
+ );
if (connection->errcode) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -381,10 +463,9 @@ int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off TSRMLS
}
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobEnableBuffering, (connection->svc, connection->err, descriptor->descriptor));
+ } else {
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobDisableBuffering, (connection->svc, connection->err, descriptor->descriptor));
}
if (connection->errcode != OCI_SUCCESS) {
@@ -398,12 +479,11 @@ int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off TSRMLS
/* {{{ php_oci_lob_get_buffering()
Return current buffering state for the LOB */
-int php_oci_lob_get_buffering (php_oci_descriptor *descriptor TSRMLS_DC)
+int php_oci_lob_get_buffering (php_oci_descriptor *descriptor)
{
if (descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) {
return 1;
- }
- else {
+ } else {
return 0;
}
} /* }}} */
@@ -425,8 +505,7 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d
if (length == -1) {
copy_len = length_from - descriptor_from->lob_current_position;
- }
- else {
+ } else {
copy_len = length;
}
@@ -435,7 +514,17 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -453,7 +542,7 @@ 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobClose, (connection->svc, connection->err, descriptor->descriptor));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -461,7 +550,7 @@ int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCILobIsTemporary, (connection->env,connection->err, descriptor->descriptor, &is_temporary));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobIsTemporary, (connection->env,connection->err, descriptor->descriptor, &is_temporary));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -471,7 +560,7 @@ int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
if (is_temporary) {
- connection->errcode = PHP_OCI_CALL(OCILobFreeTemporary, (connection->svc, connection->err, descriptor->descriptor));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobFreeTemporary, (connection->svc, connection->err, descriptor->descriptor));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -511,7 +600,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, int flush_flag TSRMLS_DC)
return 0;
}
- connection->errcode = PHP_OCI_CALL(OCILobFlushBuffer, (connection->svc, connection->err, lob, flush_flag));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobFlushBuffer, (connection->svc, connection->err, lob, flush_flag));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -569,7 +658,7 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC
}
while ((loblen = read(fp, &buf, sizeof(buf))) > 0) {
- connection->errcode = PHP_OCI_CALL(
+ PHP_OCI_CALL_RETURN(connection->errcode,
OCILobWrite,
(
connection->svc,
@@ -582,8 +671,8 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC
OCI_ONE_PIECE,
(dvoid *)0,
(OCICallbackLobWrite) 0,
- (ub2) 0,
- (ub1) SQLCS_IMPLICIT
+ (ub2) descriptor->charset_id,
+ (ub1) descriptor->charset_form
)
);
@@ -621,7 +710,7 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor
return 0;
}
- connection->errcode = PHP_OCI_CALL(OCILobAppend, (connection->svc, connection->err, lob_dest, lob_from));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobAppend, (connection->svc, connection->err, lob_dest, lob_from));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -657,7 +746,7 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, long new_lob_length TS
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCILobTrim, (connection->svc, connection->err, lob, new_lob_length));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobTrim, (connection->svc, connection->err, lob, new_lob_length));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -691,7 +780,7 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, long offset, long length,
length = lob_length;
}
- connection->errcode = PHP_OCI_CALL(OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, offset+1));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, offset+1));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -711,7 +800,7 @@ int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descript
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobIsEqual, (connection->env, first_lob, second_lob, result));
if (connection->errcode) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -745,7 +834,18 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, ub1 type, char *data,
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCILobCreateTemporary, (connection->svc, connection->err, lob, OCI_DEFAULT, OCI_DEFAULT, type, OCI_ATTR_NOCACHE, OCI_DURATION_SESSION));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -753,7 +853,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, ub1 type, char *data,
return 1;
}
- connection->errcode = PHP_OCI_CALL(OCILobOpen, (connection->svc, connection->err, lob, OCI_LOB_READWRITE));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCILobOpen, (connection->svc, connection->err, lob, OCI_LOB_READWRITE));
if (connection->errcode) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c
index dcc33bd4e..1d1e2df15 100644
--- a/ext/oci8/oci8_statement.c
+++ b/ext/oci8/oci8_statement.c
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8_statement.c,v 1.7.2.14 2006/04/12 19:21:35 tony2001 Exp $ */
+/* $Id: oci8_statement.c,v 1.7.2.14.2.13 2006/10/13 14:26:34 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
@@ -43,7 +43,7 @@
/* {{{ 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 *php_oci_statement_create (php_oci_connection *connection, char *query, int query_len TSRMLS_DC)
{
php_oci_statement *statement;
@@ -62,9 +62,21 @@ php_oci_statement *php_oci_statement_create (php_oci_connection *connection, cha
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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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));
+ PHP_OCI_CALL_RETURN(connection->errcode, 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);
@@ -94,6 +106,7 @@ php_oci_statement *php_oci_statement_create (php_oci_connection *connection, cha
statement->connection = connection;
statement->has_data = 0;
+ statement->nested = 0;
if (OCI_G(default_prefetch) > 0) {
php_oci_statement_set_prefetch(statement, OCI_G(default_prefetch) TSRMLS_CC);
@@ -116,7 +129,7 @@ int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 size TSRMLS
return 1;
}
- statement->errcode = PHP_OCI_CALL (OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_MEMORY, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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);
@@ -125,7 +138,7 @@ int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 size TSRMLS
}
prefetch = size;
- statement->errcode = PHP_OCI_CALL (OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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);
@@ -142,9 +155,14 @@ int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 size TSRMLS
int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
{
int i;
+ void *handlepp;
+ ub4 typep, iterp, idxp;
+ ub1 in_outp, piecep;
+ zend_bool piecewisecols = 0;
+
php_oci_out_column *column;
- statement->errcode = PHP_OCI_CALL(OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT));
if ( statement->errcode == OCI_NO_DATA || nrows == 0 ) {
if (statement->last_query == NULL) {
@@ -173,31 +191,62 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
if (column->piecewise) {
column->retlen4 = 0;
+ piecewisecols = 1;
}
}
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);
+ if (piecewisecols) {
+ PHP_OCI_CALL_RETURN(statement->errcode,
+ OCIStmtGetPieceInfo,
+ (
+ statement->stmt,
+ statement->err,
+ &handlepp,
+ &typep,
+ &in_outp,
+ &iterp,
+ &idxp,
+ &piecep
+ )
+ );
+
+ /* scan through our columns for a piecewise column with a matching handle */
+ for (i = 0; i < statement->ncolumns; i++) {
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ if (column->piecewise && handlepp == column->oci_define) {
+ if (!column->data) {
+ column->data = (text *) ecalloc(1, PHP_OCI_PIECE_SIZE + 1);
+ } else {
+ column->data = erealloc(column->data, column->retlen4 + PHP_OCI_PIECE_SIZE + 1);
+ }
+ column->cb_retlen = PHP_OCI_PIECE_SIZE;
+
+ /* and instruct fetch to fetch waiting piece into our buffer */
+ PHP_OCI_CALL(OCIStmtSetPieceInfo,
+ (
+ (void *) column->oci_define,
+ OCI_HTYPE_DEFINE,
+ statement->err,
+ ((char*)column->data) + column->retlen4,
+ &(column->cb_retlen),
+ piecep,
+ &column->indicator,
+ &column->retcode
+ )
+ );
}
-
- 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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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 (piecewisecols) {
+ for (i = 0; i < statement->ncolumns; i++) {
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ if (column && column->piecewise && handlepp == column->oci_define) {
+ column->retlen4 += column->cb_retlen;
+ }
}
}
}
@@ -234,7 +283,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
/* {{{ 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 *php_oci_statement_get_column(php_oci_statement *statement, long column_index, char *column_name, int column_name_len TSRMLS_DC)
{
php_oci_out_column *column = NULL;
int i;
@@ -294,7 +343,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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);
@@ -318,7 +367,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
}
/* execute statement */
- statement->errcode = PHP_OCI_CALL(OCIStmtExecute, (statement->connection->svc, statement->stmt, statement->err, iters, 0, NULL, NULL, mode));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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);
@@ -347,7 +396,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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);
@@ -369,7 +418,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
outcol->statement = statement;
/* get column */
- statement->errcode = PHP_OCI_CALL(OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)&param, counter));
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)&param, counter));
if (statement->errcode != OCI_SUCCESS) {
php_oci_error(statement->err, statement->errcode TSRMLS_CC);
@@ -378,7 +427,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
}
/* 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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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));
@@ -387,8 +436,28 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
return 1;
}
+ /* get character set form */
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_form, (ub4 *)0, OCI_ATTR_CHARSET_FORM, 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 character set id */
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)param, OCI_DTYPE_PARAM, (dvoid *)&outcol->charset_id, (ub4 *)0, OCI_ATTR_CHARSET_ID, 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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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));
@@ -401,7 +470,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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));
@@ -411,7 +480,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
}
/* 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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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));
@@ -421,7 +490,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
}
/* 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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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));
@@ -441,8 +510,9 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
buf = 0;
switch (outcol->data_type) {
case SQLT_RSET:
- outcol->statement = php_oci_statement_create(statement->connection, NULL, 0, 0 TSRMLS_CC);
+ outcol->statement = php_oci_statement_create(statement->connection, NULL, 0 TSRMLS_CC);
outcol->stmtid = outcol->statement->id;
+ outcol->statement->nested = 1;
define_type = SQLT_RSET;
outcol->is_cursor = 1;
@@ -476,6 +546,8 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
}
outcol->descid = descr->id;
buf = &(descr->descriptor);
+ descr->charset_form = outcol->charset_form;
+ /* descr->charset_id = outcol->charset_id; */
break;
case SQLT_LNG:
@@ -521,7 +593,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
}
if (dynamic == OCI_DYNAMIC_FETCH) {
- statement->errcode = PHP_OCI_CALL(
+ PHP_OCI_CALL_RETURN(statement->errcode,
OCIDefineByPos,
(
statement->stmt, /* IN/OUT handle to the requested SQL query */
@@ -539,7 +611,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
);
} else {
- statement->errcode = PHP_OCI_CALL(
+ PHP_OCI_CALL_RETURN(statement->errcode,
OCIDefineByPos,
(
statement->stmt, /* IN/OUT handle to the requested SQL query */
@@ -587,8 +659,7 @@ void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC)
#if HAVE_OCI_STMT_PREPARE2
if (statement->last_query_len) { /* FIXME: magical */
PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, OCI_STRLS_CACHE_DELETE));
- }
- else {
+ } else {
PHP_OCI_CALL(OCIHandleFree, (statement->stmt, OCI_HTYPE_STMT));
}
#else
@@ -656,12 +727,13 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
} 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';
- }
- else if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
+ } else if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
int i;
zval **entry;
HashTable *hash = HASH_OF(bind->zval);
+ zend_hash_internal_pointer_reset(hash);
+
switch (bind->array.type) {
case SQLT_NUM:
case SQLT_INT:
@@ -671,8 +743,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
zval_dtor(*entry);
ZVAL_LONG(*entry, ((ub4 *)(bind->array.elements))[i]);
zend_hash_move_forward(hash);
- }
- else {
+ } else {
add_next_index_long(bind->zval, ((ub4 *)(bind->array.elements))[i]);
}
}
@@ -683,8 +754,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
zval_dtor(*entry);
ZVAL_DOUBLE(*entry, ((double *)(bind->array.elements))[i]);
zend_hash_move_forward(hash);
- }
- else {
+ } else {
add_next_index_double(bind->zval, ((double *)(bind->array.elements))[i]);
}
}
@@ -697,25 +767,22 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
memset((void*)buff,0,sizeof(buff));
if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
- connection->errcode = PHP_OCI_CALL(OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
zval_dtor(*entry);
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
ZVAL_NULL(*entry);
- }
- else {
+ } else {
ZVAL_STRINGL(*entry, buff, buff_len, 1);
}
zend_hash_move_forward(hash);
- }
- else {
- connection->errcode = PHP_OCI_CALL(OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
+ } else {
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
if (connection->errcode != OCI_SUCCESS) {
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
add_next_index_null(bind->zval);
- }
- else {
+ } else {
add_next_index_stringl(bind->zval, buff, buff_len, 1);
}
}
@@ -729,13 +796,13 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
case SQLT_STR:
case SQLT_LVC:
for (i = 0; i < bind->array.current_length; i++) {
- int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length);
+ /* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */
+ int curr_element_length = bind->array.element_lengths[i];
if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
zval_dtor(*entry);
ZVAL_STRINGL(*entry, ((text *)bind->array.elements)+i*bind->array.max_length, curr_element_length, 1);
zend_hash_move_forward(hash);
- }
- else {
+ } else {
add_next_index_stringl(bind->zval, ((text *)bind->array.elements)+i*bind->array.max_length, curr_element_length, 1);
}
}
@@ -758,7 +825,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
/* dvoid *php_oci_collection = NULL; */
OCIStmt *oci_stmt = NULL;
dvoid *bind_data = NULL;
- php_oci_bind bind, *bindp;
+ php_oci_bind bind, *old_bind, *bindp;
int mode = OCI_DATA_AT_EXEC;
sb4 value_sz = -1;
@@ -821,11 +888,12 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
case SQLT_LNG:
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);
+ if (Z_TYPE_P(var) != IS_NULL) {
+ convert_to_string(var);
}
- else {
+ if (maxlength == -1) {
+ value_sz = (Z_TYPE_P(var) == IS_STRING) ? Z_STRLEN_P(var) : 0;
+ } else {
value_sz = maxlength;
}
break;
@@ -857,7 +925,14 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
}
memset((void*)&bind,0,sizeof(php_oci_bind));
- zend_hash_update(statement->binds, name, name_len + 1, &bind, sizeof(php_oci_bind), (void **)&bindp);
+ if (zend_hash_find(statement->binds, name, name_len + 1, (void **)&old_bind) == SUCCESS) {
+ bindp = old_bind;
+ if (bindp->zval) {
+ zval_ptr_dtor(&bindp->zval);
+ }
+ } else {
+ zend_hash_update(statement->binds, name, name_len + 1, &bind, sizeof(php_oci_bind), (void **)&bindp);
+ }
bindp->descriptor = oci_desc;
bindp->statement = oci_stmt;
@@ -865,7 +940,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
bindp->zval = var;
zval_add_ref(&var);
- statement->errcode = PHP_OCI_CALL(
+ PHP_OCI_CALL_RETURN(statement->errcode,
OCIBindByName,
(
statement->stmt, /* statement handle */
@@ -892,7 +967,16 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
}
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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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);
@@ -904,7 +988,17 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
#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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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);
@@ -998,7 +1092,7 @@ sb4 php_oci_bind_out_callback(
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));
+ Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(phpbind->zval) + 1);
/* XXX we assume that zend-zval len has 4 bytes */
*alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval);
@@ -1017,11 +1111,11 @@ sb4 php_oci_bind_out_callback(
Helper function to get column by name and index */
php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data)
{
- zval *z_statement, *column_index;
+ 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) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &z_statement, &column_index) == FAILURE) {
return NULL;
}
@@ -1035,18 +1129,17 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
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 (Z_TYPE_PP(column_index) == IS_STRING) {
+ column = php_oci_statement_get_column(statement, -1, Z_STRVAL_PP(column_index), Z_STRLEN_PP(column_index) TSRMLS_CC);
if (!column) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_P(column_index));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_PP(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);
+ } else {
+ convert_to_long_ex(column_index);
+ column = php_oci_statement_get_column(statement, Z_LVAL_PP(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));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%ld\"", Z_LVAL_PP(column_index));
return NULL;
}
}
@@ -1061,7 +1154,7 @@ int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC
*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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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);
@@ -1082,7 +1175,7 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSR
*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));
+ PHP_OCI_CALL_RETURN(statement->errcode, 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);
@@ -1160,7 +1253,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
bindp->array.type = type;
zval_add_ref(&var);
- statement->errcode = PHP_OCI_CALL(
+ PHP_OCI_CALL_RETURN(statement->errcode,
OCIBindByName,
(
statement->stmt,
@@ -1172,7 +1265,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
(sb4) bind->array.max_length,
type,
(dvoid *)0, /* bindp->array.indicators, */
- (ub2 *)0, /* bindp->array.element_lengths, */
+ (ub2 *)bind->array.element_lengths,
(ub2 *)0, /* bindp->array.retcodes, */
(ub4) max_table_length,
(ub4 *) &(bindp->array.current_length),
@@ -1218,6 +1311,19 @@ php_oci_bind *php_oci_bind_array_helper_string(zval* var, long max_table_length,
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
bind->array.max_length = maxlength;
+ bind->array.element_lengths = ecalloc(1, max_table_length * sizeof(ub2));
+
+ zend_hash_internal_pointer_reset(hash);
+
+ for (i = 0; i < bind->array.current_length; i++) {
+ if (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) {
+ convert_to_string_ex(entry);
+ bind->array.element_lengths[i] = Z_STRLEN_PP(entry);
+ zend_hash_move_forward(hash);
+ } else {
+ break;
+ }
+ }
zend_hash_internal_pointer_reset(hash);
for (i = 0; i < max_table_length; i++) {
@@ -1231,8 +1337,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval* var, long max_table_length,
((text *)bind->array.elements)[i*maxlength + element_length] = '\0';
zend_hash_move_forward(hash);
- }
- else {
+ } else {
((text *)bind->array.elements)[i*maxlength] = '\0';
}
}
@@ -1257,15 +1362,18 @@ php_oci_bind *php_oci_bind_array_helper_number(zval* var, long max_table_length
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
bind->array.max_length = sizeof(ub4);
+ bind->array.element_lengths = ecalloc(1, max_table_length * sizeof(ub2));
zend_hash_internal_pointer_reset(hash);
for (i = 0; i < max_table_length; i++) {
+ if (i < bind->array.current_length) {
+ bind->array.element_lengths[i] = sizeof(ub4);
+ }
if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
convert_to_long_ex(entry);
((ub4 *)bind->array.elements)[i] = (ub4) Z_LVAL_PP(entry);
zend_hash_move_forward(hash);
- }
- else {
+ } else {
((ub4 *)bind->array.elements)[i] = 0;
}
}
@@ -1290,15 +1398,18 @@ php_oci_bind *php_oci_bind_array_helper_double(zval* var, long max_table_length
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
bind->array.max_length = sizeof(double);
+ bind->array.element_lengths = ecalloc(1, max_table_length * sizeof(ub2));
zend_hash_internal_pointer_reset(hash);
for (i = 0; i < max_table_length; i++) {
+ if (i < bind->array.current_length) {
+ bind->array.element_lengths[i] = sizeof(double);
+ }
if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
convert_to_double_ex(entry);
((double *)bind->array.elements)[i] = (double) Z_DVAL_PP(entry);
zend_hash_move_forward(hash);
- }
- else {
+ } else {
((double *)bind->array.elements)[i] = 0;
}
}
@@ -1323,17 +1434,22 @@ php_oci_bind *php_oci_bind_array_helper_date(zval* var, long max_table_length, p
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
bind->array.max_length = sizeof(OCIDate);
+ bind->array.element_lengths = ecalloc(1, max_table_length * sizeof(ub2));
zend_hash_internal_pointer_reset(hash);
for (i = 0; i < max_table_length; i++) {
OCIDate oci_date;
+ if (i < bind->array.current_length) {
+ bind->array.element_lengths[i] = sizeof(OCIDate);
+ }
if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
convert_to_string_ex(entry);
- connection->errcode = PHP_OCI_CALL(OCIDateFromText, (connection->err, Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, 0, NULL, 0, &oci_date));
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, 0, NULL, 0, &oci_date));
if (connection->errcode != OCI_SUCCESS) {
/* failed to convert string to date */
+ efree(bind->array.element_lengths);
efree(bind->array.elements);
efree(bind);
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
@@ -1342,12 +1458,12 @@ php_oci_bind *php_oci_bind_array_helper_date(zval* var, long max_table_length, p
((OCIDate *)bind->array.elements)[i] = oci_date;
zend_hash_move_forward(hash);
- }
- else {
- connection->errcode = PHP_OCI_CALL(OCIDateFromText, (connection->err, "01-JAN-00", sizeof("01-JAN-00")-1, NULL, 0, NULL, 0, &oci_date));
+ } else {
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, "01-JAN-00", sizeof("01-JAN-00")-1, NULL, 0, NULL, 0, &oci_date));
if (connection->errcode != OCI_SUCCESS) {
/* failed to convert string to date */
+ efree(bind->array.element_lengths);
efree(bind->array.elements);
efree(bind);
php_oci_error(connection->err, connection->errcode TSRMLS_CC);
diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml
index ce9ff36ff..992b6774a 100644
--- a/ext/oci8/package.xml
+++ b/ext/oci8/package.xml
@@ -29,13 +29,25 @@
</description>
<license>PHP</license>
<release>
- <state>beta</state>
- <version>1.2</version>
- <date>2005-??-??</date>
+ <state>stable</state>
+ <version>1.2.2</version>
+ <date>2006-08-24</date>
<notes>
- Fixed PECL bug #5571 (oci_new_connect() not closed by oci_close())
- Fixed bug #33383 (crash when retrieving empty BLOBs)
+ Reimplemented oci_lob_read() utilities using patch from Massimo Squillace (msquillace at sogei dot it), which should fix Unicode LOB problems.
+ Fixed bug #38161 (oci_bind_by_name() returns garbage when Oracle didn't set the variable)
+ Fixed bug #38173 (Freeing nested cursors causes OCI8 to segfault)
+ Fixed bug #37886 (oci_connect may crash when charset parameter is given)
+ Fixed bug #37931 (possible crash after database restart when using persistent connections)
+ Fixed bug #37531 (oci8 persistent connection corruption)
+ Fixed bug #37487 (oci_fetch_array() array-type should always default to OCI_BOTH)
+ Fixed bug #37392 (Unnecessary call to OCITransRollback() at the end of request)
+ Fixed bug #35973 (Error ORA-24806 occurs when trying to fetch a NCLOB field)
+ Fixed bug #34005 (oci_password_change() fails). Patch by pholdaway at technocom-wireless dot com.
+ Fixed PECL bug #8112 (Persistent connections misbehave when Apache process times out)
</notes>
+ <deps>
+ <dep type="php" rel="ge" version="4.3.10"/>
+ </deps>
</release>
<filelist>
<file role="doc" name="CREDITS"/>
@@ -50,12 +62,21 @@
<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/bind_empty.phpt"/>
+ <file role="test" name="tests/bind_long.phpt"/>
+ <file role="test" name="tests/bind_raw.phpt"/>
+ <file role="test" name="tests/bind_long_raw.phpt"/>
<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/bug35973.phpt"/>
+ <file role="test" name="tests/bug36096.phpt"/>
+ <file role="test" name="tests/bug37581.phpt"/>
+ <file role="test" name="tests/bug38161.phpt"/>
+ <file role="test" name="tests/bug38173.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"/>
@@ -94,6 +115,7 @@
<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_with_charset_001.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"/>
@@ -142,6 +164,9 @@
<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_019.phpt"/>
+ <file role="test" name="tests/lob_020.phpt"/>
+ <file role="test" name="tests/test.gif"/>
<file role="test" name="tests/lob_temp1.phpt"/>
<file role="test" name="tests/lob_temp.phpt"/>
<file role="test" name="tests/num.phpt"/>
@@ -168,6 +193,34 @@
</configureoptions>
<changelog>
<release>
+ <state>stable</state>
+ <version>1.2.1</version>
+ <date>2006-05-02</date>
+ <notes>
+ Added support for BINARY_DOUBLE and BINARY_FLOAT (see #36764)
+ Changed oci_field_type() to return VARCHAR2 instead of VARCHAR (according to feature request #36800)
+ Fixed bug #37059 (oci_bind_by_name() doesn't support RAW and LONG RAW fields)
+ Fixed bug #37055 (incorrect reference counting for persistent OCI8 connections)
+ Fixed bug #36934 (OCILob->read() doesn't move internal pointer when reading 0's)
+ Fixed bug #36851 (Documentation and code discrepancies for NULL data)
+ Fixed bug #36820 (Privileged connection with an Oracle password file fails)
+ </notes>
+ </release>
+ <release>
+ <state>stable</state>
+ <version>1.2.0</version>
+ <date>2006-03-16</date>
+ <notes>
+ Changed OCI8 code to use OCIServerVersion() instead of OCIPing(), which may crash Oracle server of version &lt; 10.2
+ Fixed bug #36235 (ocicolumnname returns false before a succesfull fetch)
+ Fixed bug #36096 (oci_result() returns garbage after oci_fetch() failed)
+ Fixed bug #36055 (possible OCI8 crash in multithreaded environment)
+ Fixed bug #36010 (Segfault when re-creating and re-executing statements with bound parameters)
+ Fixed PECL bug #5571 (oci_new_connect() not closed by oci_close())
+ Fixed bug #33383 (crash when retrieving empty BLOBs)
+ </notes>
+ </release>
+ <release>
<state>beta</state>
<version>1.1.1</version>
<date>2005-09-22</date>
diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h
index 0e872a335..d4ab23443 100644
--- a/ext/oci8/php_oci8_int.h
+++ b/ext/oci8/php_oci8_int.h
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_oci8_int.h,v 1.11.2.6 2006/04/05 14:06:00 tony2001 Exp $ */
+/* $Id: php_oci8_int.h,v 1.11.2.6.2.7 2006/08/22 11:09:12 tony2001 Exp $ */
#if HAVE_OCI8
# ifndef PHP_OCI8_INT_H
@@ -78,7 +78,7 @@ extern zend_class_entry *oci_coll_class_entry_ptr;
#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 32768
+#define PHP_OCI_LOB_BUFFER_SIZE 1048576l /* 1Mb seems to be the most reasonable buffer size for LOB reading */
#define PHP_OCI_ASSOC 1<<0
#define PHP_OCI_NUM 1<<1
@@ -126,8 +126,16 @@ typedef struct { /* php_oci_descriptor {{{ */
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 */
+ ub4 chunk_size; /* chunk size of the LOB. 0 - unknown */
+ ub1 charset_form; /* charset form, required for NCLOBs */
+ ub2 charset_id; /* charset ID */
} php_oci_descriptor; /* }}} */
+typedef struct { /* php_oci_lob_ctx {{{ */
+ char **lob_data; /* address of pointer to LOB data */
+ ub4 *lob_len; /* address of LOB length variable (bytes) */
+} php_oci_lob_ctx; /* }}} */
+
typedef struct { /* php_oci_collection {{{ */
int id;
php_oci_connection *connection; /* parent connection handle */
@@ -160,6 +168,7 @@ typedef struct { /* php_oci_statement {{{ */
int ncolumns; /* number of columns in the result */
unsigned executed:1; /* statement executed flag */
unsigned has_data:1; /* statement has more data flag */
+ unsigned nested:1; /* statement handle is valid */
ub2 stmttype; /* statement type */
} php_oci_statement; /* }}} */
@@ -171,15 +180,15 @@ typedef struct { /* php_oci_bind {{{ */
php_oci_statement *parent_statement; /* pointer to the parent statement */
struct {
void *elements;
-/* ub2 *indicators;
+/* ub2 *indicators; */
ub2 *element_lengths;
- ub2 *retcodes; */
+/* ub2 *retcodes; */
long current_length;
long old_length;
long max_length;
long type;
} array;
- sb2 indicator; /* */
+ sb2 indicator; /* -1 means NULL */
ub2 retcode; /* */
} php_oci_bind; /* }}} */
@@ -205,12 +214,24 @@ typedef struct { /* php_oci_out_column {{{ */
ub4 cb_retlen; /* */
ub2 scale; /* column scale */
ub2 precision; /* column precision */
+ ub1 charset_form; /* charset form, required for NCLOBs */
+ ub2 charset_id; /* charset ID */
} php_oci_out_column; /* }}} */
/* {{{ macros */
#define PHP_OCI_CALL(func, params) \
+ OCI_G(in_call) = 1; \
func params; \
+ OCI_G(in_call) = 0; \
+ if (OCI_G(debug_mode)) { \
+ php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__, __LINE__); \
+ }
+
+#define PHP_OCI_CALL_RETURN(__retval, func, params) \
+ OCI_G(in_call) = 1; \
+ __retval = func params; \
+ OCI_G(in_call) = 0; \
if (OCI_G(debug_mode)) { \
php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__, __LINE__); \
}
@@ -306,7 +327,7 @@ 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_get_buffering (php_oci_descriptor *);
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);
@@ -318,6 +339,11 @@ 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);
+#if defined(HAVE_OCI_LOB_READ2)
+sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp);
+#else
+sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, ub4 len, ub1 piece);
+#endif
/* }}} */
@@ -346,10 +372,10 @@ 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);
+php_oci_statement * php_oci_statement_create (php_oci_connection *, char *, int 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);
+php_oci_out_column * php_oci_statement_get_column (php_oci_statement *, long, char*, int 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);
@@ -396,6 +422,8 @@ ZEND_BEGIN_MODULE_GLOBALS(oci) /* {{{ */
OCIEnv *env; /* global environment handle */
+ zend_bool in_call;
+
ZEND_END_MODULE_GLOBALS(oci) /* }}} */
#ifdef ZTS
diff --git a/ext/oci8/tests/array_bind_005.phpt b/ext/oci8/tests/array_bind_005.phpt
index 192d15563..15278532e 100644
--- a/ext/oci8/tests/array_bind_005.phpt
+++ b/ext/oci8/tests/array_bind_005.phpt
@@ -58,7 +58,8 @@ var_dump($array);
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
+Warning: oci_execute(): ORA-01405: fetched column value is NULL in %s on line %d
array(5) {
[0]=>
string(0) ""
diff --git a/ext/oci8/tests/array_bind_013.phpt b/ext/oci8/tests/array_bind_013.phpt
new file mode 100644
index 000000000..da8f6fdd1
--- /dev/null
+++ b/ext/oci8/tests/array_bind_013.phpt
@@ -0,0 +1,39 @@
+--TEST--
+oci_bind_array_by_name(), SQLT_CHR, default max_length and empty array
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--FILE--
+<?php
+
+require dirname(__FILE__).'/connect.inc';
+
+$statement = oci_parse($c, 'SELECT user FROM v$session');
+
+$array = array();
+
+var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, -10, SQLT_CHR, -10));
+var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, -10));
+var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, -1));
+var_dump(oci_bind_array_by_name($statement, ":c1", $array, 5, 0));
+
+oci_execute($statement);
+
+var_dump($array);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: oci_bind_array_by_name() expects at most 6 parameters, 7 given in %s on line %d
+NULL
+
+Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d
+bool(false)
+
+Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d
+bool(false)
+
+Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d
+bool(false)
+array(0) {
+}
+Done
diff --git a/ext/oci8/tests/bind_long.phpt b/ext/oci8/tests/bind_long.phpt
index 58590f145..ddbc11eb6 100644
--- a/ext/oci8/tests/bind_long.phpt
+++ b/ext/oci8/tests/bind_long.phpt
@@ -7,19 +7,19 @@ bind LONG field
require dirname(__FILE__)."/connect.inc";
-$stmt = oci_parse($c, "create table phptestlng( id number(10), fileimage long)");
+$stmt = oci_parse($c, "create table phptestlng( id number(10), filetxt long)");
oci_execute($stmt);
-$stmt = oci_parse ($c, "insert into phptestlng (id, fileimage) values (:id, :fileimage)");
+$stmt = oci_parse ($c, "insert into phptestlng (id, filetxt) values (:id, :filetxt)");
$i=1;
-$fileimage = file_get_contents( dirname(__FILE__)."/test.gif");
+$filetxt = file_get_contents( dirname(__FILE__)."/test.txt");
oci_bind_by_name( $stmt, ":id", $i, -1);
-oci_bind_by_name( $stmt, ":fileimage", $fileimage, -1, SQLT_LNG);
+oci_bind_by_name( $stmt, ":filetxt", $filetxt, -1, SQLT_LNG);
oci_execute($stmt, OCI_DEFAULT);
oci_commit($c);
-$stmt = oci_parse($c, "SELECT fileimage FROM phptestlng");
+$stmt = oci_parse($c, "SELECT filetxt FROM phptestlng");
oci_execute($stmt);
$row = oci_fetch_row($stmt);
@@ -33,6 +33,6 @@ echo "Done\n";
?>
--EXPECT--
-string(32) "d04e7036e2f4221abc88fd14e960a45b"
-int(2523)
+string(32) "da852396d08c9ef9fbdf914db1d6d5bb"
+int(276)
Done
diff --git a/ext/oci8/tests/bug35973.phpt b/ext/oci8/tests/bug35973.phpt
new file mode 100644
index 000000000..b62f5cfd0
--- /dev/null
+++ b/ext/oci8/tests/bug35973.phpt
@@ -0,0 +1,43 @@
+--TEST--
+bug #35973 (Error ORA-24806 occurs when trying to fetch a NCLOB field)
+--SKIPIF--
+<?php if (!extension_loaded("oci8")) print "skip"; ?>
+--FILE--
+<?php
+
+require dirname(__FILE__).'/connect.inc';
+
+$s1 = oci_parse($c, "drop table test_nclob");
+@oci_execute($s1);
+
+$s2 = oci_parse($c, "create table test_nclob (nc NCLOB)");
+oci_execute($s2);
+
+$s3 = oci_parse($c, "insert into test_nclob (nc) values ('12345data')");
+oci_execute($s3);
+
+$s3 = oci_parse($c, "select * from test_nclob");
+oci_execute($s3);
+
+var_dump($data = oci_fetch_assoc($s3));
+$d = $data['NC'];
+
+var_dump($d->read(5));
+var_dump($d->read(4));
+
+$s1 = oci_parse($c, "drop table test_nclob");
+@oci_execute($s1);
+
+echo "Done\n";
+?>
+--EXPECTF--
+array(1) {
+ ["NC"]=>
+ object(OCI-Lob)#%d (1) {
+ ["descriptor"]=>
+ resource(%d) of type (oci8 descriptor)
+ }
+}
+string(%d) "%s5"
+string(%d) "%sa"
+Done
diff --git a/ext/oci8/tests/bug37581.phpt b/ext/oci8/tests/bug37581.phpt
new file mode 100644
index 000000000..ec86c5195
--- /dev/null
+++ b/ext/oci8/tests/bug37581.phpt
@@ -0,0 +1,69 @@
+--TEST--
+Bug #37581 (oci_bind_array_by_name clobbers input array when using SQLT_AFC, AVC)
+--SKIPIF--
+<?php if (!extension_loaded("oci8")) print "skip"; ?>
+--FILE--
+<?php
+
+require dirname(__FILE__)."/connect.inc";
+
+$p1 = "create or replace package ARRAYBINDPKG1 as
+type str_array is table of char(2) index by binary_integer;
+procedure array_bind(in_str in str_array, out_str out string);
+end ARRAYBINDPKG1;";
+
+$p2 = "create or replace package body ARRAYBINDPKG1 as
+ procedure array_bind(in_str in str_array, out_str out string) is
+ begin
+ for i in 1 .. in_str.count loop
+ out_str := in_str(i);
+ end loop;
+ end array_bind;
+end ARRAYBINDPKG1;";
+
+$s1 = oci_parse($c, $p1);
+$s2 = oci_parse($c, $p2);
+oci_execute($s1);
+oci_execute($s2);
+
+
+$stmt = oci_parse($c,'begin ARRAYBINDPKG1.array_bind(:in_arr, :out_str); end;');
+$strings = array('A','B','C','D','E');
+
+oci_bind_array_by_name($stmt,':in_arr',$strings,5,1,SQLT_AFC);
+oci_bind_by_name($stmt,':out_str',$result,10);
+
+oci_execute($stmt);
+var_dump($strings);
+
+oci_execute($stmt);
+var_dump($strings);
+
+echo "Done\n";
+?>
+--EXPECTF--
+array(5) {
+ [0]=>
+ string(1) "A"
+ [1]=>
+ string(1) "B"
+ [2]=>
+ string(1) "C"
+ [3]=>
+ string(1) "D"
+ [4]=>
+ string(1) "E"
+}
+array(5) {
+ [0]=>
+ string(1) "A"
+ [1]=>
+ string(1) "B"
+ [2]=>
+ string(1) "C"
+ [3]=>
+ string(1) "D"
+ [4]=>
+ string(1) "E"
+}
+Done
diff --git a/ext/oci8/tests/bug38161.phpt b/ext/oci8/tests/bug38161.phpt
new file mode 100644
index 000000000..27cfafdc8
--- /dev/null
+++ b/ext/oci8/tests/bug38161.phpt
@@ -0,0 +1,30 @@
+--TEST--
+bug #38161 (oci_bind_by_name() returns garbage when Oracle didn't set the variable)
+--SKIPIF--
+<?php if (!extension_loaded("oci8")) print "skip"; ?>
+--FILE--
+<?php
+
+require dirname(__FILE__).'/connect.inc';
+
+$query = "begin if false then :bv := 1; end if; end;";
+$stid = oci_parse($c, $query);
+oci_bind_by_name($stid, ":bv", $bv, 22);
+oci_execute($stid, OCI_DEFAULT);
+
+var_dump($bv);
+unset($bv);
+
+$query = "begin if false then :bv := 1; end if; end;";
+$stid = oci_parse($c, $query);
+oci_bind_by_name($stid, ":bv", $bv, 22, SQLT_INT);
+oci_execute($stid, OCI_DEFAULT);
+
+var_dump($bv);
+
+echo "Done\n";
+?>
+--EXPECTF--
+NULL
+int(0)
+Done
diff --git a/ext/oci8/tests/bug38173.phpt b/ext/oci8/tests/bug38173.phpt
new file mode 100644
index 000000000..b92df9e39
--- /dev/null
+++ b/ext/oci8/tests/bug38173.phpt
@@ -0,0 +1,79 @@
+--TEST--
+Bug #38173 (Freeing nested cursors causes OCI8 to segfault)
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--FILE--
+<?php
+
+require dirname(__FILE__)."/connect.inc";
+
+$create_1 = "CREATE TABLE t1 (id INTEGER)";
+$create_2 = "CREATE TABLE t2 (id INTEGER)";
+$drop_1 = "DROP TABLE t1";
+$drop_2 = "DROP TABLE t2";
+
+$s1 = oci_parse($c, $drop_1);
+$s2 = oci_parse($c, $drop_2);
+@oci_execute($s1);
+@oci_execute($s2);
+
+$s1 = oci_parse($c, $create_1);
+$s2 = oci_parse($c, $create_2);
+oci_execute($s1);
+oci_execute($s2);
+
+for($i=0; $i < 5; $i++) {
+ $insert = "INSERT INTO t1 VALUES(".$i.")";
+ $s = oci_parse($c, $insert);
+ oci_execute($s);
+}
+
+for($i=0; $i < 5; $i++) {
+ $insert = "INSERT INTO t2 VALUES(".$i.")";
+ $s = oci_parse($c, $insert);
+ oci_execute($s);
+}
+
+$query ="
+SELECT
+ t1.*,
+ CURSOR( SELECT * FROM t2 ) as cursor
+FROM
+ t1
+";
+
+$sth = oci_parse($c, $query);
+oci_execute($sth);
+
+// dies on oci_free_statement on 2nd pass through loop
+while ( $row = oci_fetch_assoc($sth) ) {
+ print "Got row!\n";
+ var_dump(oci_execute($row['CURSOR']));
+ var_dump(oci_free_statement($row['CURSOR']));
+}
+
+$s1 = oci_parse($c, $drop_1);
+$s2 = oci_parse($c, $drop_2);
+@oci_execute($s1);
+@oci_execute($s2);
+
+echo "Done\n";
+
+?>
+--EXPECT--
+Got row!
+bool(true)
+bool(true)
+Got row!
+bool(true)
+bool(true)
+Got row!
+bool(true)
+bool(true)
+Got row!
+bool(true)
+bool(true)
+Got row!
+bool(true)
+bool(true)
+Done
diff --git a/ext/oci8/tests/coll_016.phpt b/ext/oci8/tests/coll_016.phpt
index 1a57a104e..c2af9cc22 100644
--- a/ext/oci8/tests/coll_016.phpt
+++ b/ext/oci8/tests/coll_016.phpt
@@ -37,10 +37,10 @@ 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
+Warning: OCI-Collection::assignelem(): OCI-22165: given index [%d] must be in the range of %s 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
+Warning: OCI-Collection::assignelem(): OCI-22165: given index [5000] must be in the range of %s to [0] in %s on line %d
bool(false)
bool(false)
bool(false)
diff --git a/ext/oci8/tests/coll_016_func.phpt b/ext/oci8/tests/coll_016_func.phpt
index e090ca19e..cde26f22f 100644
--- a/ext/oci8/tests/coll_016_func.phpt
+++ b/ext/oci8/tests/coll_016_func.phpt
@@ -37,10 +37,10 @@ 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
+Warning: oci_collection_element_assign(): OCI-22165: given index [%d] must be in the range of%s0%sto [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
+Warning: oci_collection_element_assign(): OCI-22165: given index [5000] must be in the range of%s0%sto [0] in %s on line %d
bool(false)
bool(false)
bool(false)
diff --git a/ext/oci8/tests/connect_with_charset_001.phpt b/ext/oci8/tests/connect_with_charset_001.phpt
new file mode 100644
index 000000000..9149747cd
--- /dev/null
+++ b/ext/oci8/tests/connect_with_charset_001.phpt
@@ -0,0 +1,37 @@
+--TEST--
+oci_connect() with invalid character set
+--SKIPIF--
+<?php if (!extension_loaded("oci8")) print "skip"; ?>
+--FILE--
+<?php
+
+require dirname(__FILE__)."/connect.inc";
+
+var_dump($c1 = oci_connect($user, $password, $dbase));
+var_dump($c2 = oci_connect($user, $password, $dbase, ""));
+var_dump($c3 = oci_connect($user, $password, $dbase, "blah"));
+var_dump($c4 = oci_connect($user, $password, $dbase, "obviously wrong"));
+
+var_dump($c3 == $c4);
+
+var_dump($c5 = oci_connect($user, $password, $dbase, "US7ASCII"));
+var_dump($c6 = oci_connect($user, $password, $dbase, "UTF8"));
+
+var_dump($c5 == $c6);
+
+echo "Done\n";
+?>
+--EXPECTF--
+resource(%d) of type (oci8 connection)
+resource(%d) of type (oci8 connection)
+
+Warning: oci_connect(): Invalid character set name: blah in %s on line %d
+resource(%d) of type (oci8 connection)
+
+Warning: oci_connect(): Invalid character set name: obviously wrong in %s on line %d
+resource(%d) of type (oci8 connection)
+bool(true)
+resource(%d) of type (oci8 connection)
+resource(%d) of type (oci8 connection)
+bool(false)
+Done
diff --git a/ext/oci8/tests/define1.phpt b/ext/oci8/tests/define1.phpt
new file mode 100644
index 000000000..f6e04cc18
--- /dev/null
+++ b/ext/oci8/tests/define1.phpt
@@ -0,0 +1,52 @@
+--TEST--
+oci_define_by_name()
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--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 = '';
+var_dump(oci_define_by_name($stmt, "STRING", $string, 20));
+var_dump(oci_define_by_name($stmt, "STRING", $string, 20));
+var_dump(oci_define_by_name($stmt, "", $string, 20));
+var_dump(oci_define_by_name($stmt, ""));
+
+oci_execute($stmt);
+
+while (oci_fetch($stmt)) {
+ var_dump($string);
+}
+
+require dirname(__FILE__)."/drop_table.inc";
+
+echo "Done\n";
+
+?>
+--EXPECTF--
+bool(true)
+bool(false)
+
+Warning: oci_define_by_name(): Column name cannot be empty in %s on line %d
+bool(false)
+
+Warning: oci_define_by_name() expects at least 3 parameters, 2 given in %s on line %d
+NULL
+string(4) "some"
+Done
diff --git a/ext/oci8/tests/error1.phpt b/ext/oci8/tests/error1.phpt
index 8b358b612..25a3f09e9 100644
--- a/ext/oci8/tests/error1.phpt
+++ b/ext/oci8/tests/error1.phpt
@@ -12,13 +12,13 @@ echo "Done\n";
?>
--EXPECTF--
-Warning: oci_connect(): ORA-12154: TNS:could not resolve service name in %s on line %d
+Warning: oci_connect(): ORA-12154: TNS:could not resolve %s in %s on line %d
bool(false)
array(4) {
["code"]=>
int(12154)
["message"]=>
- string(45) "ORA-12154: TNS:could not resolve service name"
+ string(%d) "ORA-12154: TNS:could not resolve %s"
["offset"]=>
int(0)
["sqltext"]=>
diff --git a/ext/oci8/tests/field_funcs.phpt b/ext/oci8/tests/field_funcs.phpt
index 988e5f7a1..102f2fdc0 100644
--- a/ext/oci8/tests/field_funcs.phpt
+++ b/ext/oci8/tests/field_funcs.phpt
@@ -54,7 +54,7 @@ require dirname(__FILE__).'/drop_table.inc';
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
array(5) {
[0]=>
string(1) "1"
@@ -71,14 +71,14 @@ bool(false)
string(2) "ID"
string(6) "NUMBER"
int(2)
-int(0)
+int(%d)
int(0)
int(22)
bool(false)
string(5) "VALUE"
string(6) "NUMBER"
int(2)
-int(0)
+int(%d)
int(0)
int(22)
bool(true)
diff --git a/ext/oci8/tests/field_funcs_old.phpt b/ext/oci8/tests/field_funcs_old.phpt
index 34af09429..e6f21d613 100644
--- a/ext/oci8/tests/field_funcs_old.phpt
+++ b/ext/oci8/tests/field_funcs_old.phpt
@@ -54,7 +54,7 @@ require dirname(__FILE__).'/drop_table.inc';
echo "Done\n";
?>
---EXPECT--
+--EXPECTF--
array(5) {
[0]=>
string(1) "1"
@@ -71,14 +71,14 @@ bool(false)
string(2) "ID"
string(6) "NUMBER"
int(2)
-int(0)
+int(%d)
int(0)
int(22)
bool(false)
string(5) "VALUE"
string(6) "NUMBER"
int(2)
-int(0)
+int(%d)
int(0)
int(22)
bool(true)
diff --git a/ext/oci8/tests/lob_015.phpt b/ext/oci8/tests/lob_015.phpt
index d2b7f0ad4..297d5b497 100644
--- a/ext/oci8/tests/lob_015.phpt
+++ b/ext/oci8/tests/lob_015.phpt
@@ -18,10 +18,11 @@ $ora_sql = "INSERT INTO
$statement = oci_parse($c,$ora_sql);
$blob = oci_new_descriptor($c,OCI_D_LOB,1,2,3);
$blob = oci_new_descriptor($c);
+$int = 1;
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", $int,-1);
+oci_bind_by_name($statement,":v_blob", $int);
oci_bind_by_name($statement,":v_blob");
oci_bind_by_name($statement);
oci_execute($statement, OCI_DEFAULT);
@@ -34,18 +35,19 @@ echo "Done\n";
?>
--EXPECTF--
-Warning: oci_new_descriptor() expects at most 2 parameters, 5 given in %slob_015.php on line %d
+Warning: oci_new_descriptor() expects at most 2 parameters, 5 given in %s 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, 6 given in %s on line %d
-Warning: oci_bind_by_name() expects at most 5 parameters, 7 given in %slob_015.php on line %d
+Warning: oci_bind_by_name() expects at most 5 parameters, 7 given in %s 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 %s 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 %s 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"
+Warning: oci_execute(): ORA-00932: inconsistent datatypes: expected NUMBER got BLOB in %s on line %d
+object(OCI-Lob)#%d (1) {
+ ["descriptor"]=>
+ resource(%d) of type (oci8 descriptor)
+}
Done
diff --git a/ext/oci8/tests/lob_021.phpt b/ext/oci8/tests/lob_021.phpt
new file mode 100644
index 000000000..32ef6f9fe
--- /dev/null
+++ b/ext/oci8/tests/lob_021.phpt
@@ -0,0 +1,74 @@
+--TEST--
+oci_lob_free()/close()
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--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(oci_free_descriptor($blob));
+var_dump($blob->write("test"));
+
+var_dump(oci_free_descriptor($blob));
+var_dump(oci_free_descriptor(new stdclass));
+
+$blob = oci_new_descriptor($c,OCI_D_LOB);
+unset($blob->descriptor);
+var_dump(oci_free_descriptor($blob));
+
+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 %s on line %d
+bool(false)
+int(4)
+bool(true)
+
+Warning: OCI-Lob::write(): %d is not a valid oci8 descriptor resource in %s on line %d
+bool(false)
+
+Warning: oci_free_descriptor(): %d is not a valid oci8 descriptor resource in %s on line %d
+bool(false)
+
+Warning: oci_free_descriptor() expects parameter 1 to be OCI-Lob, object given in %s on line %d
+NULL
+
+Warning: oci_free_descriptor(): Unable to find descriptor property in %s on line %d
+bool(false)
+array(1) {
+ [0]=>
+ string(8) "testtest"
+}
+Done
diff --git a/ext/oci8/tests/lob_022.phpt b/ext/oci8/tests/lob_022.phpt
new file mode 100644
index 000000000..5fb9dfab0
--- /dev/null
+++ b/ext/oci8/tests/lob_022.phpt
@@ -0,0 +1,80 @@
+--TEST--
+fetching the same lob several times
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--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();
+oci_lob_save();
+oci_lob_save($clob, "data");
+unset($clob->descriptor);
+oci_lob_save($clob, "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");
+$clob->save("long data", -1);
+$clob->save("long data", 0);
+
+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--
+Warning: OCI-Lob::save() expects at least 1 parameter, 0 given in %s on line %d
+
+Warning: oci_lob_save() expects at least 2 parameters, 0 given in %s on line %d
+
+Warning: oci_lob_save(): Unable to find descriptor property in %s on line %d
+
+Warning: OCI-Lob::save(): Offset parameter must be greater than or equal to 0 in %s on line %d
+string(4) "data"
+string(9) "long data"
+string(9) "long data"
+string(4) "data"
+Done
diff --git a/ext/oci8/tests/lob_023.phpt b/ext/oci8/tests/lob_023.phpt
new file mode 100644
index 000000000..0c352956d
--- /dev/null
+++ b/ext/oci8/tests/lob_023.phpt
@@ -0,0 +1,84 @@
+--TEST--
+oci_lob_import()/read()
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--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"));
+var_dump($blob->import());
+var_dump(oci_lob_import($blob));
+var_dump(oci_lob_import($blob, dirname(__FILE__)."/lob_009.txt"));
+unset($blob->descriptor);
+var_dump(oci_lob_import($blob, 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)
+
+Warning: OCI-Lob::import() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: oci_lob_import() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+bool(true)
+
+Warning: oci_lob_import(): Unable to find descriptor property in %s on line %d
+bool(false)
+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_024.phpt b/ext/oci8/tests/lob_024.phpt
new file mode 100644
index 000000000..9a7f53240
--- /dev/null
+++ b/ext/oci8/tests/lob_024.phpt
@@ -0,0 +1,75 @@
+--TEST--
+oci_lob_load()
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--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(strlen($row[0]->load()));
+var_dump(strlen(oci_lob_load($row[0])));
+var_dump(oci_lob_load());
+unset($row[0]->descriptor);
+var_dump(oci_lob_load($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)
+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)
+
+Warning: oci_lob_load() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: oci_lob_load(): Unable to find descriptor property in %s on line %d
+bool(false)
+Done
diff --git a/ext/oci8/tests/lob_025.phpt b/ext/oci8/tests/lob_025.phpt
new file mode 100644
index 000000000..5b5e845a7
--- /dev/null
+++ b/ext/oci8/tests/lob_025.phpt
@@ -0,0 +1,82 @@
+--TEST--
+oci_lob_read() tests
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--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->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(oci_lob_read($row[0], 2));
+var_dump(oci_lob_read($row[0]));
+var_dump(oci_lob_read());
+var_dump(oci_lob_eof($row[0]));
+var_dump(oci_lob_eof());
+
+unset($row[0]->descriptor);
+var_dump(oci_lob_read($row[0],1));
+var_dump(oci_lob_eof($row[0]));
+
+require dirname(__FILE__).'/drop_table.inc';
+
+echo "Done\n";
+
+?>
+--EXPECTF--
+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)
+ }
+}
+string(2) "st"
+
+Warning: oci_lob_read() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: oci_lob_read() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+bool(false)
+
+Warning: oci_lob_eof() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: oci_lob_read(): Unable to find descriptor property in %s on line %d
+bool(false)
+
+Warning: oci_lob_eof(): Unable to find descriptor property in %s on line %d
+bool(false)
+Done
diff --git a/ext/oci8/tests/lob_026.phpt b/ext/oci8/tests/lob_026.phpt
new file mode 100644
index 000000000..157d78a2b
--- /dev/null
+++ b/ext/oci8/tests/lob_026.phpt
@@ -0,0 +1,100 @@
+--TEST--
+oci_lob_seek()/rewind()/append()
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--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(oci_lob_write($blob, "test"));
+var_dump(oci_lob_rewind());
+var_dump(oci_lob_rewind($blob));
+var_dump(oci_lob_write($blob, "str"));
+var_dump(oci_lob_seek(10, OCI_SEEK_SET));
+var_dump(oci_lob_seek($blob, 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(oci_lob_append());
+var_dump(oci_lob_append($blob));
+var_dump(oci_lob_append($row[0], $blob));
+var_dump(oci_lob_read(10000));
+var_dump(oci_lob_read($row[0], 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(oci_lob_read($row[0], 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)
+
+Warning: oci_lob_rewind() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+bool(true)
+int(3)
+
+Warning: oci_lob_seek() expects parameter 1 to be OCI-Lob, integer given in %s on line %d
+NULL
+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)
+ }
+}
+
+Warning: oci_lob_append() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+
+Warning: oci_lob_append() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+bool(true)
+
+Warning: oci_lob_read() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+string(4) "strt"
+string(8) "strtstrt"
+Done
diff --git a/ext/oci8/tests/pecl_bug8816.phpt b/ext/oci8/tests/pecl_bug8816.phpt
new file mode 100644
index 000000000..c369711fc
--- /dev/null
+++ b/ext/oci8/tests/pecl_bug8816.phpt
@@ -0,0 +1,98 @@
+--TEST--
+PECL Bug #8816 (issue in php_oci_statement_fetch with more than one piecewise column)
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
+--FILE--
+<?php
+
+require dirname(__FILE__)."/connect.inc";
+
+$create_1 = "CREATE TABLE t1 (id INTEGER, l1 LONG)";
+$create_2 = "CREATE TABLE t2 (id INTEGER, l2 LONG)";
+$drop_1 = "DROP TABLE t1";
+$drop_2 = "DROP TABLE t2";
+
+$s1 = oci_parse($c, $drop_1);
+$s2 = oci_parse($c, $drop_2);
+@oci_execute($s1);
+@oci_execute($s2);
+
+$s1 = oci_parse($c, $create_1);
+$s2 = oci_parse($c, $create_2);
+oci_execute($s1);
+oci_execute($s2);
+
+$values = array("1234567890111111111", "122222222222222", "985456745674567654567654567654", "123456789", "987654321");
+
+$i = 0;
+foreach ($values as $val) {
+ $i++;
+ $insert = "INSERT INTO t1 VALUES($i, ".$val.")";
+ $s = oci_parse($c, $insert);
+ oci_execute($s);
+}
+
+foreach ($values as $val) {
+ $insert = "INSERT INTO t2 VALUES($i, ".$val.")";
+ $s = oci_parse($c, $insert);
+ oci_execute($s);
+ $i--;
+}
+
+$query ="
+SELECT
+ t1.l1, t2.l2
+FROM
+t1, t2
+WHERE
+t1.id = t2.id
+ORDER BY t1.id ASC
+";
+
+$sth = oci_parse($c, $query);
+oci_execute($sth);
+
+while ( $row = oci_fetch_assoc($sth) ) {
+ var_dump($row);
+}
+
+$s1 = oci_parse($c, $drop_1);
+$s2 = oci_parse($c, $drop_2);
+@oci_execute($s1);
+@oci_execute($s2);
+
+echo "Done\n";
+
+?>
+--EXPECT--
+array(2) {
+ ["L1"]=>
+ string(19) "1234567890111111111"
+ ["L2"]=>
+ string(9) "987654321"
+}
+array(2) {
+ ["L1"]=>
+ string(15) "122222222222222"
+ ["L2"]=>
+ string(9) "123456789"
+}
+array(2) {
+ ["L1"]=>
+ string(30) "985456745674567654567654567654"
+ ["L2"]=>
+ string(30) "985456745674567654567654567654"
+}
+array(2) {
+ ["L1"]=>
+ string(9) "123456789"
+ ["L2"]=>
+ string(15) "122222222222222"
+}
+array(2) {
+ ["L1"]=>
+ string(9) "987654321"
+ ["L2"]=>
+ string(19) "1234567890111111111"
+}
+Done
diff --git a/ext/oci8/tests/statement_cache.phpt b/ext/oci8/tests/statement_cache.phpt
index e7c8911e8..19e69d4c2 100644
--- a/ext/oci8/tests/statement_cache.phpt
+++ b/ext/oci8/tests/statement_cache.phpt
@@ -9,11 +9,11 @@ require dirname(__FILE__)."/connect.inc";
$pc = oci_pconnect($user, $password, $dbase);
-$stmt = oci_parse($pc, "select 1+3 from dual", true);
+$stmt = oci_parse($pc, "select 1+3 from dual");
oci_execute($stmt);
var_dump(oci_fetch_array($stmt));
-$stmt = oci_parse($pc, "select 1+3 from dual", true);
+$stmt = oci_parse($pc, "select 1+3 from dual");
oci_execute($stmt);
var_dump(oci_fetch_array($stmt));
diff --git a/ext/oci8/tests/test.txt b/ext/oci8/tests/test.txt
new file mode 100644
index 000000000..fa9e8d2c2
--- /dev/null
+++ b/ext/oci8/tests/test.txt
@@ -0,0 +1,9 @@
+Feel so good, I feel so fine
+Love that little lady always on my mind
+She gives me loving every night and day
+Never gonna leave her, never going away
+
+Someone to love me
+You know she makes me feel all right, yeah (all right)
+Someone to need me
+Love me every single night, yeah
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 83f18c839..b843b3da0 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_odbc.c,v 1.189.2.4 2006/01/01 12:50:10 sniper Exp $ */
+/* $Id: php_odbc.c,v 1.189.2.4.2.1 2006/06/15 18:33:08 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -130,6 +130,9 @@ zend_function_entry odbc_functions[] = {
};
/* }}} */
+ZEND_DECLARE_MODULE_GLOBALS(odbc);
+static PHP_GINIT_FUNCTION(odbc);
+
/* {{{ odbc_module_entry
*/
zend_module_entry odbc_module_entry = {
@@ -142,16 +145,14 @@ zend_module_entry odbc_module_entry = {
PHP_RSHUTDOWN(odbc),
PHP_MINFO(odbc),
"1.0",
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(odbc),
+ PHP_GINIT(odbc),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
-#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
@@ -383,32 +384,30 @@ static PHP_INI_DISP(display_lrl)
*/
PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("odbc.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateLong,
- allow_persistent, php_odbc_globals, odbc_globals)
+ allow_persistent, zend_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)
+ max_persistent, zend_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)
+ max_links, zend_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)
+ defDB, zend_odbc_globals, odbc_globals)
STD_PHP_INI_ENTRY("odbc.default_user", NULL, PHP_INI_ALL, OnUpdateString,
- defUser, php_odbc_globals, odbc_globals)
+ defUser, zend_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)
+ defPW, zend_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)
+ defaultlrl, zend_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)
+ defaultbinmode, zend_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)
+ check_persistent, zend_odbc_globals, odbc_globals)
PHP_INI_END()
/* }}} */
-#ifdef ZTS
-static void php_odbc_init_globals(php_odbc_globals *odbc_globals_p TSRMLS_DC)
+static PHP_GINIT_FUNCTION(odbc)
{
- ODBCG(num_persistent) = 0;
+ odbc_globals->num_persistent = 0;
}
-#endif
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(odbc)
@@ -418,12 +417,6 @@ PHP_MINIT_FUNCTION(odbc)
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);
diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h
index 2bec71a2e..f35a1c417 100644
--- a/ext/odbc/php_odbc_includes.h
+++ b/ext/odbc/php_odbc_includes.h
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_odbc_includes.h,v 1.12.2.1 2006/01/01 12:50:10 sniper Exp $ */
+/* $Id: php_odbc_includes.h,v 1.12.2.1.2.2 2006/06/19 16:13:15 tony2001 Exp $ */
#ifndef PHP_ODBC_INCLUDES_H
#define PHP_ODBC_INCLUDES_H
@@ -249,7 +249,7 @@ typedef struct odbc_result {
odbc_connection *conn_ptr;
} odbc_result;
-typedef struct {
+ZEND_BEGIN_MODULE_GLOBALS(odbc)
char *defDB;
char *defUser;
char *defPW;
@@ -266,7 +266,7 @@ typedef struct {
char lasterrormsg[SQL_MAX_MESSAGE_LENGTH];
HashTable *resource_list;
HashTable *resource_plist;
-} php_odbc_globals;
+ZEND_END_MODULE_GLOBALS(odbc)
int odbc_add_result(HashTable *list, odbc_result *result);
odbc_result *odbc_get_result(HashTable *list, int count);
@@ -284,10 +284,10 @@ void odbc_sql_error(ODBC_SQL_ERROR_PARAMS);
#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)
+# define ODBCG(v) TSRMG(odbc_globals_id, zend_odbc_globals *, v)
#else
# define ODBCG(v) (odbc_globals.v)
-extern ZEND_API php_odbc_globals odbc_globals;
+extern ZEND_API zend_odbc_globals odbc_globals;
#endif
#endif /* HAVE_UODBC */
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 2a1ebd538..115a286f0 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: openssl.c,v 1.98.2.5 2006/04/30 23:43:40 wez Exp $ */
+/* $Id: openssl.c,v 1.98.2.5.2.23 2006/10/15 21:09:24 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -60,11 +60,19 @@ static
ZEND_ARG_PASS_INFO(1)
ZEND_END_ARG_INFO();
+/* FIXME: Use the openssl constants instead of
+ * enum. It is now impossible to match real values
+ * against php constants. Also sorry to break the
+ * enum principles here, BC...
+ */
enum php_openssl_key_type {
OPENSSL_KEYTYPE_RSA,
OPENSSL_KEYTYPE_DSA,
OPENSSL_KEYTYPE_DH,
- OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA
+ OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA,
+#ifdef EVP_PKEY_EC
+ OPENSSL_KEYTYPE_EC = OPENSSL_KEYTYPE_DH +1
+#endif
};
enum php_openssl_cipher_type {
@@ -87,6 +95,7 @@ zend_function_entry openssl_functions[] = {
PHP_FE(openssl_pkey_export_to_file, NULL)
PHP_FE(openssl_pkey_get_private, NULL)
PHP_FE(openssl_pkey_get_public, NULL)
+ PHP_FE(openssl_pkey_get_details, NULL)
PHP_FALIAS(openssl_free_key, openssl_pkey_free, NULL)
PHP_FALIAS(openssl_get_privatekey, openssl_pkey_get_private, NULL)
@@ -106,6 +115,8 @@ zend_function_entry openssl_functions[] = {
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_csr_get_subject, NULL)
+ PHP_FE(openssl_csr_get_public_key, NULL)
PHP_FE(openssl_sign, second_arg_force_ref)
PHP_FE(openssl_verify, NULL)
@@ -156,10 +167,11 @@ static int le_x509;
static int le_csr;
static int ssl_stream_data_index;
-int php_openssl_get_x509_list_id(void)
+int php_openssl_get_x509_list_id(void) /* {{{ */
{
return le_x509;
}
+/* }}} */
/* {{{ resource destructors */
static void php_pkey_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
@@ -202,7 +214,7 @@ inline static int php_openssl_safe_mode_chk(char *filename TSRMLS_DC)
/* true global; readonly after module startup */
static char default_ssl_conf_filename[MAXPATHLEN];
-struct php_x509_request {
+struct php_x509_request { /* {{{ */
LHASH * global_config; /* Global SSL config */
LHASH * req_config; /* SSL config for this request */
const EVP_MD * md_alg;
@@ -219,7 +231,7 @@ struct php_x509_request {
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);
@@ -230,19 +242,23 @@ static X509_REQ * php_openssl_csr_from_zval(zval ** val, int makeresource, long
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)
+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_STRING * str = NULL;
ASN1_OBJECT * obj;
- MAKE_STD_ZVAL(subitem);
- array_init(subitem);
-
+ if (key != NULL) {
+ MAKE_STD_ZVAL(subitem);
+ array_init(subitem);
+ } else {
+ subitem = val;
+ }
+
for (i = 0; i < X509_NAME_entry_count(name); i++) {
ne = X509_NAME_get_entry(name, i);
obj = X509_NAME_ENTRY_get_object(ne);
@@ -267,7 +283,7 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
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);
+ add_next_index_stringl(subentries, (char *)str->data, str->length, 1);
}
last = j;
}
@@ -278,20 +294,24 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
} else {
zval_dtor(subentries);
FREE_ZVAL(subentries);
- if (obj_cnt) {
- add_assoc_stringl(subitem, sname, str->data, str->length, 1);
+ if (obj_cnt && str) {
+ add_assoc_stringl(subitem, sname, (char *)str->data, str->length, 1);
}
}
}
- zend_hash_update(HASH_OF(val), key, strlen(key) + 1, (void *)&subitem, sizeof(subitem), NULL);
+ if (key != NULL) {
+ 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)
+static void add_assoc_asn1_string(zval * val, char * key, ASN1_STRING * str) /* {{{ */
{
- add_assoc_stringl(val, key, str->data, str->length, 1);
+ add_assoc_stringl(val, key, (char *)str->data, str->length, 1);
}
+/* }}} */
-static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC)
+static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
{
/*
This is how the time string is formatted:
@@ -311,7 +331,7 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC)
return (time_t)-1;
}
- strbuf = estrdup(timestr->data);
+ strbuf = estrdup((char *)timestr->data);
memset(&thetime, 0, sizeof(thetime));
@@ -359,12 +379,14 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC)
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)
+ LHASH * config TSRMLS_DC
+ ) /* {{{ */
{
X509V3_CTX ctx;
@@ -379,8 +401,9 @@ static inline int php_openssl_config_check_syntax(
}
return SUCCESS;
}
+/* }}} */
-static int add_oid_section(struct php_x509_request * req TSRMLS_DC)
+static int add_oid_section(struct php_x509_request * req TSRMLS_DC) /* {{{ */
{
char * str;
STACK_OF(CONF_VALUE) * sktmp;
@@ -405,6 +428,7 @@ static int add_oid_section(struct php_x509_request * req TSRMLS_DC)
}
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)
@@ -431,7 +455,7 @@ static int php_openssl_parse_config(
struct php_x509_request * req,
zval * optional_args
TSRMLS_DC
- )
+ ) /* {{{ */
{
char * str;
zval ** item;
@@ -461,8 +485,8 @@ static int php_openssl_parse_config(
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_STRING_ARG("req_extensions", req->request_extensions_section,
+ CONF_get_string(req->req_config, req->section_name, "req_extensions"));
SET_OPTIONAL_LONG_ARG("private_key_bits", req->priv_key_bits,
CONF_get_number(req->req_config, req->section_name, "default_bits"));
@@ -502,15 +526,13 @@ static int php_openssl_parse_config(
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)
+static void php_openssl_dispose_config(struct php_x509_request * req TSRMLS_DC) /* {{{ */
{
if (req->priv_key) {
EVP_PKEY_free(req->priv_key);
@@ -525,8 +547,9 @@ static void php_openssl_dispose_config(struct php_x509_request * req TSRMLS_DC)
req->req_config = NULL;
}
}
+/* }}} */
-static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded)
+static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded) /* {{{ */
{
char buffer[MAXPATHLEN];
@@ -556,8 +579,9 @@ static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *se
*seeded = 1;
return SUCCESS;
}
+/* }}} */
-static int php_openssl_write_rand_file(const char * file, int egdsocket, int seeded)
+static int php_openssl_write_rand_file(const char * file, int egdsocket, int seeded) /* {{{ */
{
char buffer[MAXPATHLEN];
@@ -579,6 +603,31 @@ static int php_openssl_write_rand_file(const char * file, int egdsocket, int see
}
/* }}} */
+static EVP_MD * php_openssl_get_evp_md_from_algo(long algo) { /* {{{ */
+ EVP_MD *mdtype;
+
+ switch (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:
+ return NULL;
+ break;
+ }
+ return mdtype;
+}
+/* }}} */
+/* }}} */
+
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(openssl)
@@ -602,6 +651,9 @@ PHP_MINIT_FUNCTION(openssl)
* openSSL callbacks */
ssl_stream_data_index = SSL_get_ex_new_index(0, "PHP stream index", NULL, NULL, NULL);
+ REGISTER_STRING_CONSTANT("OPENSSL_VERSION_TEXT", OPENSSL_VERSION_TEXT, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("OPENSSL_VERSION_NUMBER", OPENSSL_VERSION_NUMBER, CONST_CS|CONST_PERSISTENT);
+
/* 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);
@@ -648,6 +700,9 @@ PHP_MINIT_FUNCTION(openssl)
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);
+#ifdef EVP_PKEY_EC
+ REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_EC", OPENSSL_KEYTYPE_EC, CONST_CS|CONST_PERSISTENT);
+#endif
/* Determine default SSL configuration file */
config_filename = getenv("OPENSSL_CONF");
@@ -749,6 +804,11 @@ static X509 * php_openssl_x509_from_zval(zval ** val, int makeresource, long * r
return NULL;
}
+
+ if (!(Z_TYPE_PP(val) == IS_STRING || Z_TYPE_PP(val) == IS_OBJECT)) {
+ return NULL;
+ }
+
/* force it to be a string and check if it refers to a file */
convert_to_string_ex(val);
@@ -790,19 +850,19 @@ static X509 * php_openssl_x509_from_zval(zval ** val, int makeresource, long * r
PHP_FUNCTION(openssl_x509_export_to_file)
{
X509 * cert;
- zval * zcert = NULL;
+ zval ** zcert;
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, &notext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs|b", &zcert, &filename, &filename_len, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
- cert = php_openssl_x509_from_zval(&zcert, 0, &certresource TSRMLS_CC);
+ 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;
@@ -835,19 +895,17 @@ PHP_FUNCTION(openssl_x509_export_to_file)
PHP_FUNCTION(openssl_x509_export)
{
X509 * cert;
- zval * zcert = NULL, *zout=NULL;
+ zval ** zcert, *zout;
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, &notext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zz|b", &zcert, &zout, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
- cert = php_openssl_x509_from_zval(&zcert, 0, &certresource TSRMLS_CC);
+ 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;
@@ -857,12 +915,15 @@ PHP_FUNCTION(openssl_x509_export)
if (!notext) {
X509_print(bio_out, cert);
}
- PEM_write_bio_X509(bio_out, cert);
+ if (PEM_write_bio_X509(bio_out, cert)) {
+ BUF_MEM *bio_buf;
- bio_mem_len = BIO_get_mem_data(bio_out, &bio_mem_ptr);
- ZVAL_STRINGL(zout, bio_mem_ptr, bio_mem_len, 1);
+ zval_dtor(zout);
+ BIO_get_mem_ptr(bio_out, &bio_buf);
+ ZVAL_STRINGL(zout, bio_buf->data, bio_buf->length, 1);
- RETVAL_TRUE;
+ RETVAL_TRUE;
+ }
if (certresource == -1 && cert) {
X509_free(cert);
@@ -875,21 +936,21 @@ PHP_FUNCTION(openssl_x509_export)
Checks if a private key corresponds to a CERT */
PHP_FUNCTION(openssl_x509_check_private_key)
{
- zval * zcert, *zkey;
+ 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) {
+ 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);
+ 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);
+ key = php_openssl_evp_from_zval(zkey, 0, "", 1, &keyresource TSRMLS_CC);
if (key) {
RETVAL_BOOL(X509_check_private_key(cert, key));
}
@@ -907,18 +968,21 @@ PHP_FUNCTION(openssl_x509_check_private_key)
Returns an array of the fields/values of the CERT */
PHP_FUNCTION(openssl_x509_parse)
{
- zval * zcert;
+ zval ** zcert;
X509 * cert = NULL;
long certresource = -1;
int i;
zend_bool useshortnames = 1;
char * tmpstr;
zval * subitem;
+ X509_EXTENSION *extension;
+ ASN1_OCTET_STRING *extdata;
+ char *extname;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &zcert, &useshortnames) == FAILURE) {
+ 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);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
if (cert == NULL) {
RETURN_FALSE;
}
@@ -947,7 +1011,7 @@ PHP_FUNCTION(openssl_x509_parse)
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);
+ tmpstr = (char *)X509_alias_get0(cert, NULL);
if (tmpstr) {
add_assoc_string(return_value, "alias", tmpstr, 1);
}
@@ -988,6 +1052,18 @@ PHP_FUNCTION(openssl_x509_parse)
}
add_assoc_zval(return_value, "purposes", subitem);
+ MAKE_STD_ZVAL(subitem);
+ array_init(subitem);
+
+
+ for (i = 0; i < X509_get_ext_count(cert); i++) {
+ extension = X509_get_ext(cert, i);
+ extdata = X509_EXTENSION_get_data(extension);
+ extname = (char *)OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(extension)));
+ add_assoc_asn1_string(subitem, extname, extdata);
+ }
+ add_assoc_zval(return_value, "extensions", subitem);
+
if (certresource == -1 && cert) {
X509_free(cert);
}
@@ -1074,7 +1150,7 @@ static int check_cert(X509_STORE *ctx, X509 *x, STACK_OF(X509) *untrustedchain,
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;
+ zval ** zcert, * zcainfo = NULL;
X509_STORE * cainfo = NULL;
X509 * cert = NULL;
long certresource = -1;
@@ -1083,7 +1159,7 @@ PHP_FUNCTION(openssl_x509_checkpurpose)
char * untrusted = NULL;
int untrusted_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl|a!s", &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len)
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zl|a!s", &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len)
== FAILURE) {
return;
}
@@ -1101,7 +1177,7 @@ PHP_FUNCTION(openssl_x509_checkpurpose)
if (cainfo == NULL) {
goto clean_exit;
}
- cert = php_openssl_x509_from_zval(&zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
if (cert == NULL) {
goto clean_exit;
}
@@ -1192,14 +1268,14 @@ static X509_STORE * setup_verify(zval * calist TSRMLS_DC)
Reads X.509 certificates */
PHP_FUNCTION(openssl_x509_read)
{
- zval *cert;
+ zval **cert;
X509 *x509;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &cert) == FAILURE) {
+ 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);
+ 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!");
@@ -1263,8 +1339,9 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
/* 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;
+ char * strindex = NULL;
+ uint strindexlen = 0;
+ ulong intindex;
zend_hash_get_current_key_ex(HASH_OF(dn), &strindex, &strindexlen, &intindex, 0, &hpos);
@@ -1337,8 +1414,8 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
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;
+ char * strindex; uint strindexlen;
+ ulong intindex;
zend_hash_get_current_key_ex(HASH_OF(attribs), &strindex, &strindexlen, &intindex, 0, &hpos);
convert_to_string_ex(item);
@@ -1466,8 +1543,6 @@ PHP_FUNCTION(openssl_csr_export_to_file)
}
/* }}} */
-
-
/* {{{ 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)
@@ -1476,9 +1551,8 @@ PHP_FUNCTION(openssl_csr_export)
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, &notext) == FAILURE) {
return;
@@ -1497,12 +1571,16 @@ PHP_FUNCTION(openssl_csr_export)
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);
+ if (PEM_write_bio_X509_REQ(bio_out, csr)) {
+ BUF_MEM *bio_buf;
- RETVAL_TRUE;
+ BIO_get_mem_ptr(bio_out, &bio_buf);
+ zval_dtor(zout);
+ ZVAL_STRINGL(zout, bio_buf->data, bio_buf->length, 1);
+
+ RETVAL_TRUE;
+ }
if (csr_resource == -1 && csr) {
X509_REQ_free(csr);
@@ -1515,7 +1593,7 @@ PHP_FUNCTION(openssl_csr_export)
Signs a cert with another CERT */
PHP_FUNCTION(openssl_csr_sign)
{
- zval * zcert = NULL, *zcsr, *zpkey, *args = NULL;
+ zval ** zcert = NULL, **zcsr, **zpkey, *args = NULL;
long num_days;
long serial = 0L;
X509 * cert = NULL, *new_cert = NULL;
@@ -1525,25 +1603,25 @@ PHP_FUNCTION(openssl_csr_sign)
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)
+ 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);
+ 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);
+ 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);
+ 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;
@@ -1600,12 +1678,12 @@ PHP_FUNCTION(openssl_csr_sign)
if (!i) {
goto cleanup;
}
- if (req.request_extensions_section) {
+ if (req.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)) {
+ if (!X509V3_EXT_add_conf(req.req_config, &ctx, req.extensions_section, new_cert)) {
goto cleanup;
}
}
@@ -1702,6 +1780,7 @@ PHP_FUNCTION(openssl_csr_new)
if (we_made_the_key) {
/* and a resource for the private key */
+ zval_dtor(out_pkey);
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) {
@@ -1725,6 +1804,61 @@ PHP_FUNCTION(openssl_csr_new)
}
/* }}} */
+/* {{{ proto mixed openssl_csr_get_subject(mixed csr)
+ Returns the subject of a CERT or FALSE on error */
+PHP_FUNCTION(openssl_csr_get_subject)
+{
+ zval ** zcsr;
+ zend_bool use_shortnames = 1;
+ long csr_resource;
+ X509_NAME * subject;
+ X509_REQ * csr;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|b", &zcsr, &use_shortnames) == FAILURE) {
+ return;
+ }
+
+ csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource TSRMLS_CC);
+
+ if (csr == NULL) {
+ RETURN_FALSE;
+ }
+
+ subject = X509_REQ_get_subject_name(csr);
+
+ array_init(return_value);
+ add_assoc_name_entry(return_value, NULL, subject, use_shortnames TSRMLS_CC);
+ return;
+}
+/* }}} */
+
+/* {{{ proto mixed openssl_csr_get_public_key(mixed csr)
+ Returns the subject of a CERT or FALSE on error */
+PHP_FUNCTION(openssl_csr_get_public_key)
+{
+ zval ** zcsr;
+ zend_bool use_shortnames = 1;
+ long csr_resource;
+
+ X509_REQ * csr;
+ EVP_PKEY *tpubkey;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|b", &zcsr, &use_shortnames) == FAILURE) {
+ return;
+ }
+
+ csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource TSRMLS_CC);
+
+ if (csr == NULL) {
+ RETURN_FALSE;
+ }
+
+ tpubkey=X509_REQ_get_pubkey(csr);
+ RETVAL_RESOURCE(zend_list_insert(tpubkey, le_key));
+ return;
+}
+/* }}} */
+
/* }}} */
/* {{{ EVP Public/Private key functions */
@@ -1749,7 +1883,16 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char *
int free_cert = 0;
long cert_res = -1;
char * filename = NULL;
-
+ zval tmp;
+
+ Z_TYPE(tmp) = IS_NULL;
+
+#define TMP_CLEAN \
+ if (Z_TYPE(tmp) == IS_STRING) {\
+ zval_dtor(&tmp); \
+ } \
+ return NULL;
+
if (resourceval) {
*resourceval = -1;
}
@@ -1762,13 +1905,19 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char *
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);
+
+ if (Z_TYPE_PP(zphrase) == IS_STRING) {
+ passphrase = Z_STRVAL_PP(zphrase);
+ } else {
+ tmp = **zphrase;
+ zval_copy_ctor(&tmp);
+ passphrase = Z_STRVAL(tmp);
+ }
/* 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;
+ TMP_CLEAN;
}
}
@@ -1778,7 +1927,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char *
what = zend_fetch_resource(val TSRMLS_CC, -1, "OpenSSL X.509/key", &type, 2, le_x509, le_key);
if (!what) {
- return NULL;
+ TMP_CLEAN;
}
if (resourceval) {
*resourceval = Z_LVAL_PP(val);
@@ -1795,23 +1944,31 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char *
/* 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;
+ TMP_CLEAN;
}
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;
+ TMP_CLEAN;
} else {
+ if (Z_TYPE(tmp) == IS_STRING) {
+ zval_dtor(&tmp);
+ }
/* 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;
+ TMP_CLEAN;
} else {
/* force it to be a string and check if it refers to a file */
+ /* passing non string values leaks, object uses toString, it returns NULL
+ * See bug38255.phpt
+ */
+ if (!(Z_TYPE_PP(val) == IS_STRING || Z_TYPE_PP(val) == IS_OBJECT)) {
+ TMP_CLEAN;
+ }
convert_to_string_ex(val);
if (Z_STRLEN_PP(val) > 7 && memcmp(Z_STRVAL_PP(val), "file://", sizeof("file://") - 1) == 0) {
@@ -1831,7 +1988,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char *
in = BIO_new_mem_buf(Z_STRVAL_PP(val), Z_STRLEN_PP(val));
}
if (in == NULL) {
- return NULL;
+ TMP_CLEAN;
}
key = PEM_read_bio_PUBKEY(in, NULL,NULL, NULL);
BIO_free(in);
@@ -1842,7 +1999,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char *
if (filename) {
if (php_openssl_safe_mode_chk(filename TSRMLS_CC)) {
- return NULL;
+ TMP_CLEAN;
}
in = BIO_new_file(filename, "r");
} else {
@@ -1850,7 +2007,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char *
}
if (in == NULL) {
- return NULL;
+ TMP_CLEAN;
}
key = PEM_read_bio_PrivateKey(in, NULL,NULL, passphrase);
BIO_free(in);
@@ -1868,6 +2025,9 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char *
if (key && makeresource && resourceval) {
*resourceval = ZEND_REGISTER_RESOURCE(NULL, key, le_key);
}
+ if (Z_TYPE(tmp) == IS_STRING) {
+ zval_dtor(&tmp);
+ }
return key;
}
/* }}} */
@@ -1891,9 +2051,27 @@ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req
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)))
+ if (EVP_PKEY_assign_RSA(req->priv_key, RSA_generate_key(req->priv_key_bits, 0x10001, NULL, NULL))) {
return_val = req->priv_key;
+ }
break;
+#ifndef NO_DSA
+ case OPENSSL_KEYTYPE_DSA:
+ {
+ DSA *dsapar = DSA_generate_parameters(req->priv_key_bits, NULL, 0, NULL, NULL, NULL, NULL);
+ if (dsapar) {
+ DSA_set_method(dsapar, DSA_get_default_method());
+ if (DSA_generate_key(dsapar)) {
+ if (EVP_PKEY_assign_DSA(req->priv_key, dsapar)) {
+ return_val = req->priv_key;
+ }
+ } else {
+ DSA_free(dsapar);
+ }
+ }
+ }
+ break;
+#endif
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported private key type");
}
@@ -1990,7 +2168,7 @@ PHP_FUNCTION(openssl_pkey_new)
PHP_FUNCTION(openssl_pkey_export_to_file)
{
struct php_x509_request req;
- zval * zpkey, * args = NULL;
+ zval ** zpkey, * args = NULL;
char * passphrase = NULL; int passphrase_len = 0;
char * filename = NULL; int filename_len = 0;
long key_resource = -1;
@@ -1998,12 +2176,12 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
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) {
+ 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);
+ 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");
@@ -2024,7 +2202,7 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
} else {
cipher = NULL;
}
- if (PEM_write_bio_PrivateKey(bio_out, key, cipher, passphrase, passphrase_len, NULL, NULL)) {
+ if (PEM_write_bio_PrivateKey(bio_out, key, cipher, (unsigned char *)passphrase, passphrase_len, NULL, NULL)) {
/* Success!
* If returning the output as a string, do so now */
RETVAL_TRUE;
@@ -2046,19 +2224,19 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
PHP_FUNCTION(openssl_pkey_export)
{
struct php_x509_request req;
- zval * zpkey, * args = NULL, *out;
+ 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) {
+ 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);
+ 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");
@@ -2075,7 +2253,7 @@ PHP_FUNCTION(openssl_pkey_export)
} else {
cipher = NULL;
}
- if (PEM_write_bio_PrivateKey(bio_out, key, cipher, passphrase, passphrase_len, NULL, NULL)) {
+ if (PEM_write_bio_PrivateKey(bio_out, key, cipher, (unsigned char *)passphrase, passphrase_len, NULL, NULL)) {
/* Success!
* If returning the output as a string, do so now */
@@ -2102,14 +2280,14 @@ PHP_FUNCTION(openssl_pkey_export)
Gets public key from X.509 certificate */
PHP_FUNCTION(openssl_pkey_get_public)
{
- zval *cert;
+ zval **cert;
EVP_PKEY *pkey;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &cert) == FAILURE) {
+ 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);
+ pkey = php_openssl_evp_from_zval(cert, 1, NULL, 1, &Z_LVAL_P(return_value) TSRMLS_CC);
if (pkey == NULL) {
RETURN_FALSE;
@@ -2136,16 +2314,16 @@ PHP_FUNCTION(openssl_pkey_free)
Gets private keys */
PHP_FUNCTION(openssl_pkey_get_private)
{
- zval *cert;
+ 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) {
+ 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);
+ pkey = php_openssl_evp_from_zval(cert, 0, passphrase, 1, &Z_LVAL_P(return_value) TSRMLS_CC);
if (pkey == NULL) {
RETURN_FALSE;
@@ -2154,6 +2332,63 @@ PHP_FUNCTION(openssl_pkey_get_private)
/* }}} */
+/* {{{ proto resource openssl_pkey_get_details(resource key)
+ returns an array with the key details (bits, pkey, type)*/
+PHP_FUNCTION(openssl_pkey_get_details)
+{
+ zval *key;
+ EVP_PKEY *pkey;
+ BIO *out;
+ unsigned int pbio_len;
+ char *pbio;
+ long ktype;
+
+ 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);
+ if (!pkey) {
+ RETURN_FALSE;
+ }
+ out = BIO_new(BIO_s_mem());
+ PEM_write_bio_PUBKEY(out, pkey);
+ pbio_len = BIO_get_mem_data(out, &pbio);
+
+ array_init(return_value);
+ add_assoc_long(return_value, "bits", EVP_PKEY_bits(pkey));
+ add_assoc_stringl(return_value, "key", pbio, pbio_len, 1);
+ /*TODO: Use the real values once the openssl constants are used
+ * See the enum at the top of this file
+ */
+ switch (EVP_PKEY_type(pkey->type)) {
+ case EVP_PKEY_RSA:
+ case EVP_PKEY_RSA2:
+ ktype = OPENSSL_KEYTYPE_RSA;
+ break;
+ case EVP_PKEY_DSA:
+ case EVP_PKEY_DSA2:
+ case EVP_PKEY_DSA3:
+ case EVP_PKEY_DSA4:
+ ktype = OPENSSL_KEYTYPE_DSA;
+ break;
+ case EVP_PKEY_DH:
+ ktype = OPENSSL_KEYTYPE_DH;
+ break;
+#ifdef EVP_PKEY_EC
+ case EVP_PKEY_EC:
+ ktype = OPENSSL_KEYTYPE_EC;
+ break;
+#endif
+ default:
+ ktype = -1;
+ break;
+ }
+ add_assoc_long(return_value, "type", ktype);
+
+ BIO_free(out);
+}
+/* }}} */
+
/* }}} */
/* {{{ PKCS7 S/MIME functions */
@@ -2271,7 +2506,7 @@ clean_exit:
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;
+ zval ** zrecipcerts, * zheaders = NULL;
STACK_OF(X509) * recipcerts = NULL;
BIO * infile = NULL, * outfile = NULL;
long flags = 0;
@@ -2289,7 +2524,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssza!|ll", &infilename, &infilename_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssZa!|ll", &infilename, &infilename_len,
&outfilename, &outfilename_len, &zrecipcerts, &zheaders, &flags, &cipherid) == FAILURE)
return;
@@ -2311,9 +2546,9 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
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) {
+ if (Z_TYPE_PP(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);
@@ -2331,13 +2566,13 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
}
sk_X509_push(recipcerts, cert);
- zend_hash_move_forward_ex(HASH_OF(zrecipcerts), &hpos);
+ 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);
+ cert = php_openssl_x509_from_zval(zrecipcerts, 0, &certresource TSRMLS_CC);
if (cert == NULL) {
goto clean_exit;
}
@@ -2426,7 +2661,7 @@ clean_exit:
PHP_FUNCTION(openssl_pkcs7_sign)
{
- zval * zcert, * zprivkey, * zheaders;
+ zval ** zcert, ** zprivkey, * zheaders;
zval ** hval;
X509 * cert = NULL;
EVP_PKEY * privkey = NULL;
@@ -2443,7 +2678,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
char * outfilename; int outfilename_len;
char * extracertsfilename = NULL; int extracertsfilename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sszza!|ls",
+ 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) {
@@ -2459,13 +2694,13 @@ PHP_FUNCTION(openssl_pkcs7_sign)
}
}
- privkey = php_openssl_evp_from_zval(&zprivkey, 0, "", 0, &keyresource TSRMLS_CC);
+ 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);
+ 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;
@@ -2537,7 +2772,7 @@ clean_exit:
PHP_FUNCTION(openssl_pkcs7_decrypt)
{
- zval * recipcert, * recipkey = NULL;
+ zval ** recipcert, ** recipkey = NULL;
X509 * cert = NULL;
EVP_PKEY * key = NULL;
long certresval, keyresval;
@@ -2546,20 +2781,20 @@ PHP_FUNCTION(openssl_pkcs7_decrypt)
char * infilename; int infilename_len;
char * outfilename; int outfilename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssz|z", &infilename, &infilename_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);
+ 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);
+ 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;
@@ -2606,7 +2841,7 @@ clean_exit:
Encrypts data with private key */
PHP_FUNCTION(openssl_private_encrypt)
{
- zval *key, *crypted;
+ zval **key, *crypted;
EVP_PKEY *pkey;
int cryptedlen;
unsigned char *cryptedbuf = NULL;
@@ -2616,12 +2851,12 @@ PHP_FUNCTION(openssl_private_encrypt)
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) {
+ 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);
+ 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");
@@ -2635,7 +2870,7 @@ PHP_FUNCTION(openssl_private_encrypt)
case EVP_PKEY_RSA:
case EVP_PKEY_RSA2:
successful = (RSA_private_encrypt(data_len,
- data,
+ (unsigned char *)data,
cryptedbuf,
pkey->pkey.rsa,
padding) == cryptedlen);
@@ -2647,7 +2882,7 @@ PHP_FUNCTION(openssl_private_encrypt)
if (successful) {
zval_dtor(crypted);
cryptedbuf[cryptedlen] = '\0';
- ZVAL_STRINGL(crypted, cryptedbuf, cryptedlen, 0);
+ ZVAL_STRINGL(crypted, (char *)cryptedbuf, cryptedlen, 0);
cryptedbuf = NULL;
RETVAL_TRUE;
}
@@ -2664,7 +2899,7 @@ PHP_FUNCTION(openssl_private_encrypt)
Decrypts data with private key */
PHP_FUNCTION(openssl_private_decrypt)
{
- zval *key, *crypted;
+ zval **key, *crypted;
EVP_PKEY *pkey;
int cryptedlen;
unsigned char *cryptedbuf = NULL;
@@ -2675,12 +2910,12 @@ PHP_FUNCTION(openssl_private_decrypt)
char * data;
int data_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
+ 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);
+ 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;
@@ -2693,7 +2928,7 @@ PHP_FUNCTION(openssl_private_decrypt)
case EVP_PKEY_RSA:
case EVP_PKEY_RSA2:
cryptedlen = RSA_private_decrypt(data_len,
- data,
+ (unsigned char *)data,
crypttemp,
pkey->pkey.rsa,
padding);
@@ -2712,7 +2947,7 @@ PHP_FUNCTION(openssl_private_decrypt)
if (successful) {
zval_dtor(crypted);
cryptedbuf[cryptedlen] = '\0';
- ZVAL_STRINGL(crypted, cryptedbuf, cryptedlen, 0);
+ ZVAL_STRINGL(crypted, (char *)cryptedbuf, cryptedlen, 0);
cryptedbuf = NULL;
RETVAL_TRUE;
}
@@ -2730,7 +2965,7 @@ PHP_FUNCTION(openssl_private_decrypt)
Encrypts data with public key */
PHP_FUNCTION(openssl_public_encrypt)
{
- zval *key, *crypted;
+ zval **key, *crypted;
EVP_PKEY *pkey;
int cryptedlen;
unsigned char *cryptedbuf;
@@ -2740,12 +2975,12 @@ PHP_FUNCTION(openssl_public_encrypt)
char * data;
int data_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE)
+ 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);
+ 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;
@@ -2758,7 +2993,7 @@ PHP_FUNCTION(openssl_public_encrypt)
case EVP_PKEY_RSA:
case EVP_PKEY_RSA2:
successful = (RSA_public_encrypt(data_len,
- data,
+ (unsigned char *)data,
cryptedbuf,
pkey->pkey.rsa,
padding) == cryptedlen);
@@ -2771,7 +3006,7 @@ PHP_FUNCTION(openssl_public_encrypt)
if (successful) {
zval_dtor(crypted);
cryptedbuf[cryptedlen] = '\0';
- ZVAL_STRINGL(crypted, cryptedbuf, cryptedlen, 0);
+ ZVAL_STRINGL(crypted, (char *)cryptedbuf, cryptedlen, 0);
cryptedbuf = NULL;
RETVAL_TRUE;
}
@@ -2788,7 +3023,7 @@ PHP_FUNCTION(openssl_public_encrypt)
Decrypts data with public key */
PHP_FUNCTION(openssl_public_decrypt)
{
- zval *key, *crypted;
+ zval **key, *crypted;
EVP_PKEY *pkey;
int cryptedlen;
unsigned char *cryptedbuf = NULL;
@@ -2799,12 +3034,12 @@ PHP_FUNCTION(openssl_public_decrypt)
char * data;
int data_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
+ 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);
+ 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;
@@ -2817,7 +3052,7 @@ PHP_FUNCTION(openssl_public_decrypt)
case EVP_PKEY_RSA:
case EVP_PKEY_RSA2:
cryptedlen = RSA_public_decrypt(data_len,
- data,
+ (unsigned char *)data,
crypttemp,
pkey->pkey.rsa,
padding);
@@ -2838,7 +3073,7 @@ PHP_FUNCTION(openssl_public_decrypt)
if (successful) {
zval_dtor(crypted);
cryptedbuf[cryptedlen] = '\0';
- ZVAL_STRINGL(crypted, cryptedbuf, cryptedlen, 0);
+ ZVAL_STRINGL(crypted, (char *)cryptedbuf, cryptedlen, 0);
cryptedbuf = NULL;
RETVAL_TRUE;
}
@@ -2872,11 +3107,11 @@ PHP_FUNCTION(openssl_error_string)
}
/* }}} */
-/* {{{ proto bool openssl_sign(string data, &string signature, mixed key)
+/* {{{ proto bool openssl_sign(string data, &string signature, mixed key[, int signature_alg])
Signs data */
PHP_FUNCTION(openssl_sign)
{
- zval *key, *signature;
+ zval **key, *signature;
EVP_PKEY *pkey;
int siglen;
unsigned char *sigbuf;
@@ -2887,32 +3122,19 @@ PHP_FUNCTION(openssl_sign)
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) {
+ 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);
+ 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;
+ mdtype = php_openssl_get_evp_md_from_algo(signature_algo);
+ if (!mdtype) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ RETURN_FALSE;
}
siglen = EVP_PKEY_size(pkey);
@@ -2920,10 +3142,10 @@ PHP_FUNCTION(openssl_sign)
EVP_SignInit(&md_ctx, mdtype);
EVP_SignUpdate(&md_ctx, data, data_len);
- if (EVP_SignFinal (&md_ctx, sigbuf, &siglen, pkey)) {
+ if (EVP_SignFinal (&md_ctx, sigbuf,(unsigned int *)&siglen, pkey)) {
zval_dtor(signature);
sigbuf[siglen] = '\0';
- ZVAL_STRINGL(signature, sigbuf, siglen, 0);
+ ZVAL_STRINGL(signature, (char *)sigbuf, siglen, 0);
RETVAL_TRUE;
} else {
efree(sigbuf);
@@ -2939,27 +3161,35 @@ PHP_FUNCTION(openssl_sign)
Verifys data */
PHP_FUNCTION(openssl_verify)
{
- zval *key;
+ zval **key;
EVP_PKEY *pkey;
int err;
EVP_MD_CTX md_ctx;
+ EVP_MD *mdtype;
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) {
+ long signature_algo = OPENSSL_ALGO_SHA1;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssZ|l", &data, &data_len, &signature, &signature_len, &key, &signature_algo) == FAILURE) {
return;
}
-
- pkey = php_openssl_evp_from_zval(&key, 1, NULL, 0, &keyresource TSRMLS_CC);
+
+ mdtype = php_openssl_get_evp_md_from_algo(signature_algo);
+ if (!mdtype) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ RETURN_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, "supplied key param cannot be coerced into a public key");
RETURN_FALSE;
}
- EVP_VerifyInit (&md_ctx, EVP_sha1());
+ EVP_VerifyInit (&md_ctx, mdtype);
EVP_VerifyUpdate (&md_ctx, data, data_len);
- err = EVP_VerifyFinal (&md_ctx, signature, signature_len, pkey);
+ err = EVP_VerifyFinal (&md_ctx, (unsigned char *)signature, signature_len, pkey);
if (keyresource == -1) {
EVP_PKEY_free(pkey);
@@ -2996,7 +3226,9 @@ PHP_FUNCTION(openssl_seal)
pkeys = safe_emalloc(nkeys, sizeof(*pkeys), 0);
eksl = safe_emalloc(nkeys, sizeof(*eksl), 0);
eks = safe_emalloc(nkeys, sizeof(*eks), 0);
+ memset(eks, 0, sizeof(*eks) * nkeys);
key_resources = safe_emalloc(nkeys, sizeof(long), 0);
+ memset(key_resources, 0, sizeof(*key_resources) * nkeys);
/* get the public keys we are using to seal this data */
zend_hash_internal_pointer_reset_ex(pubkeysht, &pos);
@@ -3027,7 +3259,7 @@ PHP_FUNCTION(openssl_seal)
/* 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)) {
+ if (!EVP_SealInit(&ctx, EVP_rc4(), eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
RETVAL_FALSE;
efree(buf);
goto clean_exit;
@@ -3039,7 +3271,7 @@ PHP_FUNCTION(openssl_seal)
zval_dtor(sealdata);
buf[len1 + len2] = '\0';
buf = erealloc(buf, len1 + len2 + 1);
- ZVAL_STRINGL(sealdata, buf, len1 + len2, 0);
+ ZVAL_STRINGL(sealdata, (char *)buf, len1 + len2, 0);
zval_dtor(ekeys);
array_init(ekeys);
@@ -3083,7 +3315,7 @@ clean_exit:
Opens data */
PHP_FUNCTION(openssl_open)
{
- zval *privkey, *opendata;
+ zval **privkey, *opendata;
EVP_PKEY *pkey;
int len1, len2;
unsigned char *buf;
@@ -3092,18 +3324,18 @@ PHP_FUNCTION(openssl_open)
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) {
+ 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);
+ 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_OpenInit(&ctx, EVP_rc4(), (unsigned char *)ekey, ekey_len, NULL, pkey) && EVP_OpenUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) {
if (!EVP_OpenFinal(&ctx, buf + len1, &len2) || (len1 + len2 == 0)) {
efree(buf);
if (keyresource == -1) {
@@ -3133,7 +3365,7 @@ PHP_FUNCTION(openssl_open)
#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)
+static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
{
php_stream *stream;
SSL *ssl;
@@ -3170,8 +3402,9 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
return ret;
}
+/* }}} */
-int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stream TSRMLS_DC)
+int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stream TSRMLS_DC) /* {{{ */
{
zval **val = NULL;
char *cnmatch = NULL;
@@ -3239,8 +3472,9 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
return SUCCESS;
}
+/* }}} */
-static int passwd_callback(char *buf, int num, int verify, void *data)
+static int passwd_callback(char *buf, int num, int verify, void *data) /* {{{ */
{
php_stream *stream = (php_stream *)data;
zval **val = NULL;
@@ -3257,8 +3491,9 @@ static int passwd_callback(char *buf, int num, int verify, void *data)
}
return 0;
}
+/* }}} */
-SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
+SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
{
zval **val = NULL;
char *cafile = NULL;
@@ -3348,7 +3583,7 @@ SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
return NULL;
}
-
+/* }}} */
/*
* Local variables:
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index 1204f3fc8..a56ef8a1a 100644
--- a/ext/openssl/php_openssl.h
+++ b/ext/openssl/php_openssl.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_openssl.h,v 1.16.2.1 2006/01/01 12:50:10 sniper Exp $ */
+/* $Id: php_openssl.h,v 1.16.2.1.2.2 2006/08/15 20:27:20 pajoye Exp $ */
#ifndef PHP_OPENSSL_H
#define PHP_OPENSSL_H
@@ -38,6 +38,7 @@ 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_pkey_get_details);
PHP_FUNCTION(openssl_sign);
PHP_FUNCTION(openssl_verify);
@@ -66,7 +67,8 @@ PHP_FUNCTION(openssl_csr_new);
PHP_FUNCTION(openssl_csr_export);
PHP_FUNCTION(openssl_csr_export_to_file);
PHP_FUNCTION(openssl_csr_sign);
-
+PHP_FUNCTION(openssl_csr_get_subject);
+PHP_FUNCTION(openssl_csr_get_public_key);
#else
#define phpext_openssl_ptr NULL
diff --git a/ext/openssl/tests/002.phpt b/ext/openssl/tests/002.phpt
new file mode 100644
index 000000000..d1b393ec0
--- /dev/null
+++ b/ext/openssl/tests/002.phpt
@@ -0,0 +1,32 @@
+--TEST--
+openssl_seal() tests
+--SKIPIF--
+<?php if (!extension_loaded("openssl")) print "skip"; ?>
+--FILE--
+<?php
+
+$a = 1;
+$b = array(1);
+$c = array(1);
+$d = array(1);
+
+var_dump(openssl_seal($a, $b, $c, $d));
+var_dump(openssl_seal($a, $a, $a, array()));
+var_dump(openssl_seal($c, $c, $c, 1));
+var_dump(openssl_seal($b, $b, $b, ""));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: openssl_seal(): not a public key (0th member of pubkeys) in %s on line %d
+bool(false)
+
+Warning: openssl_seal(): Fourth argument to openssl_seal() must be a non-empty array in %s on line %d
+bool(false)
+
+Warning: openssl_seal() expects parameter 1 to be string, array given in %s on line %d
+NULL
+
+Warning: openssl_seal() expects parameter 1 to be string, array given in %s on line %d
+NULL
+Done
diff --git a/ext/openssl/tests/003.phpt b/ext/openssl/tests/003.phpt
new file mode 100644
index 000000000..92c8c85b1
--- /dev/null
+++ b/ext/openssl/tests/003.phpt
@@ -0,0 +1,43 @@
+--TEST--
+openssl_pkcs7_decrypt() and invalid parameters
+--SKIPIF--
+<?php if (!extension_loaded("openssl")) print "skip"; ?>
+--FILE--
+<?php
+
+function myErrorHandler($errno, $errstr, $errfile, $errline) {
+var_dump($errstr);
+}
+set_error_handler("myErrorHandler");
+
+$a = 1;
+$b = 1;
+$c = new stdclass;
+$d = new stdclass;
+
+var_dump(openssl_pkcs7_decrypt($a, $b, $c, $d));
+var_dump($c);
+
+var_dump(openssl_pkcs7_decrypt($b, $b, $b, $b));
+var_dump(openssl_pkcs7_decrypt($a, $b, "", ""));
+var_dump(openssl_pkcs7_decrypt($a, $b, true, false));
+var_dump(openssl_pkcs7_decrypt($a, $b, 0, 0));
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(57) "Object of class stdClass could not be converted to string"
+string(45) "Object of class stdClass to string conversion"
+string(66) "openssl_pkcs7_decrypt(): unable to coerce parameter 3 to x509 cert"
+bool(false)
+object(stdClass)#1 (0) {
+}
+string(66) "openssl_pkcs7_decrypt(): unable to coerce parameter 3 to x509 cert"
+bool(false)
+string(66) "openssl_pkcs7_decrypt(): unable to coerce parameter 3 to x509 cert"
+bool(false)
+string(66) "openssl_pkcs7_decrypt(): unable to coerce parameter 3 to x509 cert"
+bool(false)
+string(66) "openssl_pkcs7_decrypt(): unable to coerce parameter 3 to x509 cert"
+bool(false)
+Done
diff --git a/ext/openssl/tests/004.phpt b/ext/openssl/tests/004.phpt
new file mode 100644
index 000000000..b9c41590c
--- /dev/null
+++ b/ext/openssl/tests/004.phpt
@@ -0,0 +1,34 @@
+--TEST--
+openssl_csr_new() tests
+--SKIPIF--
+<?php if (!extension_loaded("openssl")) print "skip"; ?>
+--FILE--
+<?php
+
+$a = 1;
+var_dump(openssl_csr_new(1,$a));
+var_dump(openssl_csr_new(1,$a,1,1));
+$a = array();
+var_dump(openssl_csr_new(array(), $a, array(), array()));
+
+//this leaks
+$a = array(1,2);
+$b = array(1,2);
+var_dump(openssl_csr_new($a, $b));
+
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: openssl_csr_new() expects parameter 1 to be array, integer given in %s on line %d
+NULL
+
+Warning: openssl_csr_new() expects parameter 1 to be array, integer given in %s on line %d
+NULL
+
+Warning: openssl_csr_new(): key array must be of the form array(0 => key, 1 => phrase) in %s on line %d
+
+Warning: openssl_csr_new(): add1_attr_by_txt challengePassword_min -> 4 (failed) in %s on line %d
+bool(false)
+resource(%d) of type (OpenSSL X.509 CSR)
+Done
diff --git a/ext/openssl/tests/bug28382.phpt b/ext/openssl/tests/bug28382.phpt
new file mode 100644
index 000000000..7302f59fa
--- /dev/null
+++ b/ext/openssl/tests/bug28382.phpt
@@ -0,0 +1,38 @@
+--TEST--
+#28382, openssl_x509_parse extensions support
+--SKIPIF--
+<?php
+if (!extension_loaded("openssl")) die("skip");
+if (OPENSSL_VERSION_NUMBER<0x009070af) die("skip");
+?>
+--FILE--
+<?php
+$cert = file_get_contents(dirname(__FILE__) . "/bug28382cert.txt");
+$ext = openssl_x509_parse($cert);
+var_dump($ext['extensions']);
+?>
+--EXPECTF--
+array(11) {
+ ["basicConstraints"]=>
+ string(2) "%s"
+ ["nsComment"]=>
+ string(40) "%s"
+ ["nsCertType"]=>
+ string(4) "%s"
+ ["crlDistributionPoints"]=>
+ string(56) "%s"
+ ["nsCaPolicyUrl"]=>
+ string(40) "%s"
+ ["subjectAltName"]=>
+ string(26) "%s"
+ ["subjectKeyIdentifier"]=>
+ string(22) "%s"
+ ["authorityKeyIdentifier"]=>
+ string(159) "%s"
+ ["keyUsage"]=>
+ string(4) "%s"
+ ["nsBaseUrl"]=>
+ string(22) "%s"
+ ["UNDEF"]=>
+ string(4) "%s"
+}
diff --git a/ext/openssl/tests/bug28382cert.txt b/ext/openssl/tests/bug28382cert.txt
new file mode 100644
index 000000000..cce8d4224
--- /dev/null
+++ b/ext/openssl/tests/bug28382cert.txt
@@ -0,0 +1,27 @@
+-----BEGIN CERTIFICATE-----
+MIIEoDCCBAmgAwIBAgIBJzANBgkqhkiG9w0BAQQFADCBkDELMAkGA1UEBhMCUk8x
+EDAOBgNVBAgTB1JvbWFuaWExEDAOBgNVBAcTB0NyYWlvdmExDzANBgNVBAoTBlNl
+cmdpdTETMBEGA1UECxMKU2VyZ2l1IFNSTDESMBAGA1UEAxMJU2VyZ2l1IENBMSMw
+IQYJKoZIhvcNAQkBFhRuX3NlcmdpdUBob3RtYWlsLmNvbTAeFw0wNDA1MTQxMzM0
+NTZaFw0wNTA1MTQxMzM0NTZaMIGaMQswCQYDVQQGEwJSTzEQMA4GA1UECBMHUm9t
+YW5pYTEQMA4GA1UEBxMHQ3JhaW92YTETMBEGA1UEChMKU2VyZ2l1IFNSTDETMBEG
+A1UECxMKU2VyZ2l1IFNSTDEYMBYGA1UEAxMPU2VyZ2l1IHBlcnNvbmFsMSMwIQYJ
+KoZIhvcNAQkBFhRuX3NlcmdpdUBob3RtYWlsLmNvbTCBnzANBgkqhkiG9w0BAQEF
+AAOBjQAwgYkCgYEApNj7XXz8T8FcLIWpBniPYom3QcT6T7u0xRPHqtqzj5oboBYp
+DJe5d354/y0gJTpiLt8+fTrPgWXnbHm3pOHgXzTcX6Arani0GDU0/xDi4VkCRGcS
+YqX2sJpcDzAbmK9UDMt3xf/O1B8AJan3RfO0Bm3ozTEPziLMkmsiYr5b/L8CAwEA
+AaOCAfwwggH4MAkGA1UdEwQCMAAwNQYJYIZIAYb4QgENBCgWJkZvciBHcmlkIHVz
+ZSBvbmx5OyByZXF1ZXN0IHRhZyB1c2VyVGFnMBEGCWCGSAGG+EIBAQQEAwIF4DA/
+BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vbW9iaWxlLmJsdWUtc29mdHdhcmUucm86
+OTAvY2EvY3JsLnNodG1sMDUGCWCGSAGG+EIBCAQoFiZodHRwOi8vbW9iaWxlLmJs
+dWUtc29mdHdhcmUucm86OTAvcHViLzAhBgNVHREEGjAYgRZzZXJnaXVAYmx1ZXNv
+ZnR3YXJlLnJvMB0GA1UdDgQWBBSwp//5QRXeIzm93TEPl6CyonTg/DCBpwYDVR0j
+BIGfMIGcoYGWpIGTMIGQMQswCQYDVQQGEwJSTzEQMA4GA1UECBMHUm9tYW5pYTEQ
+MA4GA1UEBxMHQ3JhaW92YTEPMA0GA1UEChMGU2VyZ2l1MRMwEQYDVQQLEwpTZXJn
+aXUgU1JMMRIwEAYDVQQDEwlTZXJnaXUgQ0ExIzAhBgkqhkiG9w0BCQEWFG5fc2Vy
+Z2l1QGhvdG1haWwuY29tggEAMAsGA1UdDwQEAwIE8DAjBglghkgBhvhCAQIEFhYU
+aHR0cDovLzYyLjIzMS45OC41Mi8wCwYDKgMEBAQ+52I0MA0GCSqGSIb3DQEBBAUA
+A4GBAIBIOJ+iiLyQfNJEY+IMefayQea0nmuXYY+F+L1DFjSC7xChytgYoPNnKkhh
+3dWPtxbswiqKYUnGi6y3Hi4UhDsOaDW29t2S305hSc2qgjOiNtRYQIVYQ8EHG1k7
+Fl63S7uCOhnVJt+4MnUK1N6/pwgsp+Z2GvEsDG1qCKnvNpf6
+-----END CERTIFICATE-----
diff --git a/ext/openssl/tests/bug36732.phpt b/ext/openssl/tests/bug36732.phpt
new file mode 100644
index 000000000..9878f4028
--- /dev/null
+++ b/ext/openssl/tests/bug36732.phpt
@@ -0,0 +1,40 @@
+--TEST--
+#36732, add support for req_extensions in openss_csr_new and sign
+--SKIPIF--
+<?php
+if (!extension_loaded("openssl")) die("skip");
+if (OPENSSL_VERSION_NUMBER < 0x009070af) die("skip");
+?>
+--FILE--
+<?php
+$configargs = array(
+ "req_extensions" => "v3_req",
+ "x509_extensions" => "usr_cert"
+);
+
+$dn = array(
+ "countryName" => "GB",
+ "stateOrProvinceName" => "Berkshire",
+ "localityName" => "Newbury",
+ "organizationName" => "My Company Ltd",
+ "commonName" => "Demo Cert"
+);
+
+$key = openssl_pkey_new();
+$csr = openssl_csr_new($dn, $key, $configargs);
+$crt = openssl_csr_sign($csr, NULL, $key, 365, $configargs);
+
+$str = '';
+openssl_csr_export($csr, $str, false);
+
+if (strpos($str, 'Requested Extensions:')) {
+ echo "Ok\n";
+}
+openssl_x509_export($crt, $str, false);
+if (strpos($str, 'X509v3 extensions:')) {
+ echo "Ok\n";
+}
+?>
+--EXPECTF--
+Ok
+Ok
diff --git a/ext/openssl/tests/bug37820.phpt b/ext/openssl/tests/bug37820.phpt
new file mode 100644
index 000000000..485114e20
--- /dev/null
+++ b/ext/openssl/tests/bug37820.phpt
@@ -0,0 +1,35 @@
+--TEST--
+openssl_sign/verify: accept different algos
+--SKIPIF--
+<?php
+if (!extension_loaded("openssl")) die("skip");
+?>
+--FILE--
+<?php
+$dir = dirname(__FILE__);
+$file_pub = $dir . '/bug37820cert.pem';
+$file_key = $dir . '/bug37820key.pem';
+
+$priv_key = file_get_contents($file_key);
+$priv_key_id = openssl_get_privatekey($priv_key);
+
+
+
+$pub_key = file_get_contents($file_pub);
+$pub_key_id = openssl_get_publickey($pub_key);
+$data = "some custom data";
+if (!openssl_sign($data, $signature, $priv_key_id, OPENSSL_ALGO_MD5)) {
+ echo "openssl_sign failed.";
+}
+
+$ok = openssl_verify($data, $signature, $pub_key_id, OPENSSL_ALGO_MD5);
+if ($ok == 1) {
+ echo "Ok";
+} elseif ($ok == 0) {
+ echo "openssl_verify failed.";
+}
+
+
+?>
+--EXPECTF--
+Ok
diff --git a/ext/openssl/tests/bug37820cert.pem b/ext/openssl/tests/bug37820cert.pem
new file mode 100644
index 000000000..9d7ac238d
--- /dev/null
+++ b/ext/openssl/tests/bug37820cert.pem
@@ -0,0 +1,14 @@
+-----BEGIN CERTIFICATE-----
+MIICLDCCAdYCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlBUMRMwEQYD
+VQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5ldXJv
+bmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMTEmJy
+dXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZpMB4X
+DTk2MDkwNTAzNDI0M1oXDTk2MTAwNTAzNDI0M1owgaAxCzAJBgNVBAYTAlBUMRMw
+EQYDVQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5l
+dXJvbmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMT
+EmJydXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZp
+MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL7+aty3S1iBA/+yxjxv4q1MUTd1kjNw
+L4lYKbpzzlmC5beaQXeQ2RmGMTXU+mDvuqItjVHOK3DvPK7lTcSGftUCAwEAATAN
+BgkqhkiG9w0BAQQFAANBAFqPEKFjk6T6CKTHvaQeEAsX0/8YHPHqH/9AnhSjrwuX
+9EBc0n6bVGhN7XaXd6sJ7dym9sbsWxb+pJdurnkxjx4=
+-----END CERTIFICATE-----
diff --git a/ext/openssl/tests/bug37820key.pem b/ext/openssl/tests/bug37820key.pem
new file mode 100644
index 000000000..239ad66f9
--- /dev/null
+++ b/ext/openssl/tests/bug37820key.pem
@@ -0,0 +1,9 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIBPAIBAAJBAL7+aty3S1iBA/+yxjxv4q1MUTd1kjNwL4lYKbpzzlmC5beaQXeQ
+2RmGMTXU+mDvuqItjVHOK3DvPK7lTcSGftUCAwEAAQJBALjkK+jc2+iihI98riEF
+oudmkNziSRTYjnwjx8mCoAjPWviB3c742eO3FG4/soi1jD9A5alihEOXfUzloenr
+8IECIQD3B5+0l+68BA/6d76iUNqAAV8djGTzvxnCxycnxPQydQIhAMXt4trUI3nc
+a+U8YL2HPFA3gmhBsSICbq2OptOCnM7hAiEA6Xi3JIQECob8YwkRj29DU3/4WYD7
+WLPgsQpwo1GuSpECICGsnWH5oaeD9t9jbFoSfhJvv0IZmxdcLpRcpslpeWBBAiEA
+6/5B8J0GHdJq89FHwEG/H2eVVUYu5y/aD6sgcm+0Avg=
+-----END RSA PRIVATE KEY-----
diff --git a/ext/openssl/tests/bug38255.phpt b/ext/openssl/tests/bug38255.phpt
new file mode 100644
index 000000000..487260553
--- /dev/null
+++ b/ext/openssl/tests/bug38255.phpt
@@ -0,0 +1,55 @@
+--TEST--
+openssl key from zval leaks
+--SKIPIF--
+<?php
+if (!extension_loaded("openssl")) die("skip");
+?>
+--FILE--
+<?php
+$pub_key_id = false;
+$signature = '';
+$ok = openssl_verify("foo", $signature, $pub_key_id, OPENSSL_ALGO_MD5);
+
+class test {
+ function __toString() {
+ return "test object";
+ }
+}
+$t = new test;
+
+
+var_dump(openssl_verify("foo", $signature, $pub_key_id, OPENSSL_ALGO_MD5));
+var_dump(openssl_verify("foo", $t, $pub_key_id, OPENSSL_ALGO_MD5));
+var_dump(openssl_verify("foo", new stdClass, $pub_key_id, OPENSSL_ALGO_MD5));
+var_dump(openssl_verify("foo", new stdClass, array(), OPENSSL_ALGO_MD5));
+var_dump(openssl_verify("foo", array(), array(), OPENSSL_ALGO_MD5));
+var_dump(openssl_verify());
+var_dump(openssl_verify(new stdClass, new stdClass, array(), 10000));
+
+echo "Done\n";
+
+?>
+--EXPECTF--
+Warning: openssl_verify(): supplied key param cannot be coerced into a public key in %s on line %d
+
+Warning: openssl_verify(): supplied key param cannot be coerced into a public key in %s on line %d
+bool(false)
+
+Warning: openssl_verify(): supplied key param cannot be coerced into a public key in %s on line %d
+bool(false)
+
+Warning: openssl_verify() expects parameter 2 to be string, object given in %s on line %d
+NULL
+
+Warning: openssl_verify() expects parameter 2 to be string, object given in %s on line %d
+NULL
+
+Warning: openssl_verify() expects parameter 2 to be string, array given in %s on line %d
+NULL
+
+Warning: openssl_verify() expects at least 3 parameters, 0 given in %s on line %d
+NULL
+
+Warning: openssl_verify() expects parameter 1 to be string, object given in %s on line %d
+NULL
+Done
diff --git a/ext/openssl/tests/bug38261.phpt b/ext/openssl/tests/bug38261.phpt
new file mode 100644
index 000000000..e7d806083
--- /dev/null
+++ b/ext/openssl/tests/bug38261.phpt
@@ -0,0 +1,34 @@
+--TEST--
+openssl key from zval leaks
+--SKIPIF--
+<?php
+if (!extension_loaded("openssl")) die("skip");
+?>
+--FILE--
+<?php
+$cert = false;
+class test {
+ function __toString() {
+ return "test object";
+ }
+}
+$t = new test;
+
+var_dump(openssl_x509_parse("foo"));
+var_dump(openssl_x509_parse($t));
+var_dump(openssl_x509_parse(array()));
+var_dump(openssl_x509_parse());
+var_dump(openssl_x509_parse($cert));
+var_dump(openssl_x509_parse(new stdClass));
+
+?>
+--EXPECTF--
+bool(false)
+bool(false)
+bool(false)
+
+Warning: openssl_x509_parse() expects at least 1 parameter, 0 given in %s/bug38261.php on line %d
+NULL
+bool(false)
+
+Catchable fatal error: Object of class stdClass could not be converted to string in %s/bug38261.php on line %d
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index 4b965fa9d..c6594c64d 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xp_ssl.c,v 1.22.2.3 2006/04/30 23:43:40 wez Exp $ */
+/* $Id: xp_ssl.c,v 1.22.2.3.2.2 2006/10/05 00:38:00 iliaa Exp $ */
#include "php.h"
#include "ext/standard/file.h"
@@ -57,17 +57,20 @@ php_stream_ops php_openssl_socket_ops;
* 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) {
+ if (stream->wrapperdata && stream->wrapper && strcasecmp(stream->wrapper->wops->label, "HTTP") == 0) {
/* the wrapperdata is an array zval containing the headers */
zval **tmp;
#define SERVER_MICROSOFT_IIS "Server: Microsoft-IIS"
+#define SERVER_GOOGLE "Server: GFE/"
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;
+ } else if (strncasecmp(Z_STRVAL_PP(tmp), SERVER_GOOGLE, sizeof(SERVER_GOOGLE)-1) == 0) {
+ return 1;
}
zend_hash_move_forward(Z_ARRVAL_P(stream->wrapperdata));
@@ -432,6 +435,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
"ssl", "peer_certificate",
zcert);
peer_cert = NULL;
+ efree(zcert);
}
if (SUCCESS == php_stream_context_get_option(
@@ -445,7 +449,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
chain = SSL_get_peer_cert_chain(
sslsock->ssl_handle);
- if (chain) {
+ if (chain && sk_X509_num(chain) > 0) {
int i;
array_init(arr);
@@ -458,6 +462,8 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
php_openssl_get_x509_list_id()));
add_next_index_zval(arr, zcert);
}
+ efree(zcert);
+
} else {
ZVAL_NULL(arr);
}
@@ -465,6 +471,8 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
php_stream_context_set_option(stream->context,
"ssl", "peer_certificate_chain",
arr);
+ zval_dtor(arr);
+ efree(arr);
}
}
}
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index bb3d55667..9aabf40fd 100755
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pcntl.c,v 1.48.2.2 2006/01/01 12:50:10 sniper Exp $ */
+/* $Id: pcntl.c,v 1.48.2.2.2.3 2006/08/31 15:42:18 tony2001 Exp $ */
#define PCNTL_DEBUG 0
@@ -42,6 +42,7 @@
#endif
ZEND_DECLARE_MODULE_GLOBALS(pcntl)
+static PHP_GINIT_FUNCTION(pcntl);
zend_function_entry pcntl_functions[] = {
PHP_FE(pcntl_fork, NULL)
@@ -75,7 +76,11 @@ zend_module_entry pcntl_module_entry = {
PHP_RSHUTDOWN(pcntl),
PHP_MINFO(pcntl),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(pcntl),
+ PHP_GINIT(pcntl),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
#ifdef COMPILE_DL_PCNTL
@@ -160,7 +165,7 @@ void php_register_signal_constants(INIT_FUNC_ARGS)
#endif
}
-static void php_pcntl_init_globals(zend_pcntl_globals *pcntl_globals)
+static PHP_GINIT_FUNCTION(pcntl)
{
memset(pcntl_globals, 0, sizeof(*pcntl_globals));
}
@@ -175,7 +180,6 @@ PHP_RINIT_FUNCTION(pcntl)
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;
@@ -545,7 +549,7 @@ PHP_FUNCTION(pcntl_signal)
/* 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");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for handle argument specified");
}
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");
@@ -693,16 +697,19 @@ void pcntl_tick_handler()
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) {
+ MAKE_STD_ZVAL(retval);
+ MAKE_STD_ZVAL(param);
+ ZVAL_NULL(retval);
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, &param TSRMLS_CC);
+ zval_ptr_dtor(&param);
+ zval_ptr_dtor(&retval);
}
next = queue->next;
@@ -713,10 +720,6 @@ void pcntl_tick_handler()
/* Re-enable queue */
PCNTL_G(processing_signal_queue) = 0;
-
- /* Clean up */
- efree(param);
- efree(retval);
}
diff --git a/ext/pcre/config.w32 b/ext/pcre/config.w32
index 9d31eded1..1905d1107 100644
--- a/ext/pcre/config.w32
+++ b/ext/pcre/config.w32
@@ -1,12 +1,12 @@
-// $Id: config.w32,v 1.4.2.5 2006/03/06 22:49:16 sebastian Exp $
+// $Id: config.w32,v 1.4.2.5.2.3 2006/08/30 20:00:21 iliaa Exp $
// 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 -DMATCH_LIMIT_RECURSION=10000000 -Iext/pcre/pcrelib");
- ADD_SOURCES("ext/pcre/pcrelib", "pcre_chartables.c pcre_ucp_searchfuncs.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_refcount.c pcre_study.c pcre_tables.c pcre_try_flipped.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c", "pcre");
+ "-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=10000000 -DMATCH_LIMIT_RECURSION=10000000 -DMAX_NAME_SIZE=32 -DMAX_NAME_COUNT=10000 -DMAX_DUPLENGTH=30000 -DNO_RECURSE -Iext/pcre/pcrelib");
+ ADD_SOURCES("ext/pcre/pcrelib", "pcre_chartables.c pcre_ucp_searchfuncs.c pcre_compile.c pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_globals.c pcre_info.c pcre_maketables.c pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_try_flipped.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c", "pcre");
ADD_DEF_FILE("ext\\pcre\\php_pcre.def");
AC_DEFINE('HAVE_BUNDLED_PCRE', 1, 'Using bundled PCRE library');
diff --git a/ext/pcre/config0.m4 b/ext/pcre/config0.m4
index 7fb8a079e..2f073eff9 100644
--- a/ext/pcre/config0.m4
+++ b/ext/pcre/config0.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config0.m4,v 1.38.2.3 2006/03/06 21:45:57 andrei Exp $
+dnl $Id: config0.m4,v 1.38.2.3.2.3 2006/08/30 20:00:21 iliaa Exp $
dnl
dnl By default we'll compile and link against the bundled PCRE library
@@ -13,7 +13,7 @@ PHP_ARG_WITH(pcre-regex,for PCRE support,
if test "$PHP_PCRE_REGEX" != "no"; then
if test "$PHP_PCRE_REGEX" = "yes"; then
- PHP_NEW_EXTENSION(pcre, pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.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_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.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 -DMATCH_LIMIT_RECURSION=10000000 -I@ext_srcdir@/pcrelib)
+ PHP_NEW_EXTENSION(pcre, pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.c pcrelib/pcre_compile.c pcrelib/pcre_config.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_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.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 -DMATCH_LIMIT_RECURSION=10000000 -DMAX_NAME_SIZE=32 -DMAX_NAME_COUNT=10000 -DMAX_DUPLENGTH=30000 -I@ext_srcdir@/pcrelib)
PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
@@ -43,15 +43,15 @@ if test "$PHP_PCRE_REGEX" != "no"; 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])
+ if test "$pcre_version" -lt 660; then
+ AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 6.6])
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 -DMATCH_LIMIT_RECURSION=10000000)
+ 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 -DMATCH_LIMIT_RECURSION=10000000 -DMAX_NAME_SIZE=32 -DMAX_NAME_COUNT=10000 -DMAX_DUPLENGTH=30000)
fi
PHP_SUBST(PCRE_SHARED_LIBADD)
fi
diff --git a/ext/pcre/pcrelib/AUTHORS b/ext/pcre/pcrelib/AUTHORS
index 33df90f8d..adb4fc401 100644
--- a/ext/pcre/pcrelib/AUTHORS
+++ b/ext/pcre/pcrelib/AUTHORS
@@ -8,7 +8,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England. Phone: +44 1223 334714.
-Copyright (c) 1997-2005 University of Cambridge
+Copyright (c) 1997-2006 University of Cambridge
All rights reserved
@@ -17,7 +17,7 @@ THE C++ WRAPPER LIBRARY
Written by: Google Inc.
-Copyright (c) 2005 Google Inc
+Copyright (c) 2006 Google Inc
All rights reserved
####
diff --git a/ext/pcre/pcrelib/COPYING b/ext/pcre/pcrelib/COPYING
index e8eb0d937..daea2e48a 100644
--- a/ext/pcre/pcrelib/COPYING
+++ b/ext/pcre/pcrelib/COPYING
@@ -22,7 +22,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England. Phone: +44 1223 334714.
-Copyright (c) 1997-2005 University of Cambridge
+Copyright (c) 1997-2006 University of Cambridge
All rights reserved.
@@ -31,7 +31,7 @@ THE C++ WRAPPER FUNCTIONS
Contributed by: Google Inc.
-Copyright (c) 2005, Google Inc.
+Copyright (c) 2006, Google Inc.
All rights reserved.
diff --git a/ext/pcre/pcrelib/ChangeLog b/ext/pcre/pcrelib/ChangeLog
index ce2b35853..2a1413484 100644
--- a/ext/pcre/pcrelib/ChangeLog
+++ b/ext/pcre/pcrelib/ChangeLog
@@ -1,6 +1,175 @@
ChangeLog for PCRE
------------------
+Version 6.7 04-Jul-06
+---------------------
+
+ 1. In order to handle tests when input lines are enormously long, pcretest has
+ been re-factored so that it automatically extends its buffers when
+ necessary. The code is crude, but this _is_ just a test program. The
+ default size has been increased from 32K to 50K.
+
+ 2. The code in pcre_study() was using the value of the re argument before
+ testing it for NULL. (Of course, in any sensible call of the function, it
+ won't be NULL.)
+
+ 3. The memmove() emulation function in pcre_internal.h, which is used on
+ systems that lack both memmove() and bcopy() - that is, hardly ever -
+ was missing a "static" storage class specifier.
+
+ 4. When UTF-8 mode was not set, PCRE looped when compiling certain patterns
+ containing an extended class (one that cannot be represented by a bitmap
+ because it contains high-valued characters or Unicode property items, e.g.
+ [\pZ]). Almost always one would set UTF-8 mode when processing such a
+ pattern, but PCRE should not loop if you do not (it no longer does).
+ [Detail: two cases were found: (a) a repeated subpattern containing an
+ extended class; (b) a recursive reference to a subpattern that followed a
+ previous extended class. It wasn't skipping over the extended class
+ correctly when UTF-8 mode was not set.]
+
+ 5. A negated single-character class was not being recognized as fixed-length
+ in lookbehind assertions such as (?<=[^f]), leading to an incorrect
+ compile error "lookbehind assertion is not fixed length".
+
+ 6. The RunPerlTest auxiliary script was showing an unexpected difference
+ between PCRE and Perl for UTF-8 tests. It turns out that it is hard to
+ write a Perl script that can interpret lines of an input file either as
+ byte characters or as UTF-8, which is what "perltest" was being required to
+ do for the non-UTF-8 and UTF-8 tests, respectively. Essentially what you
+ can't do is switch easily at run time between having the "use utf8;" pragma
+ or not. In the end, I fudged it by using the RunPerlTest script to insert
+ "use utf8;" explicitly for the UTF-8 tests.
+
+ 7. In multiline (/m) mode, PCRE was matching ^ after a terminating newline at
+ the end of the subject string, contrary to the documentation and to what
+ Perl does. This was true of both matching functions. Now it matches only at
+ the start of the subject and immediately after *internal* newlines.
+
+ 8. A call of pcre_fullinfo() from pcretest to get the option bits was passing
+ a pointer to an int instead of a pointer to an unsigned long int. This
+ caused problems on 64-bit systems.
+
+ 9. Applied a patch from the folks at Google to pcrecpp.cc, to fix "another
+ instance of the 'standard' template library not being so standard".
+
+10. There was no check on the number of named subpatterns nor the maximum
+ length of a subpattern name. The product of these values is used to compute
+ the size of the memory block for a compiled pattern. By supplying a very
+ long subpattern name and a large number of named subpatterns, the size
+ computation could be caused to overflow. This is now prevented by limiting
+ the length of names to 32 characters, and the number of named subpatterns
+ to 10,000.
+
+11. Subpatterns that are repeated with specific counts have to be replicated in
+ the compiled pattern. The size of memory for this was computed from the
+ length of the subpattern and the repeat count. The latter is limited to
+ 65535, but there was no limit on the former, meaning that integer overflow
+ could in principle occur. The compiled length of a repeated subpattern is
+ now limited to 30,000 bytes in order to prevent this.
+
+12. Added the optional facility to have named substrings with the same name.
+
+13. Added the ability to use a named substring as a condition, using the
+ Python syntax: (?(name)yes|no). This overloads (?(R)... and names that
+ are numbers (not recommended). Forward references are permitted.
+
+14. Added forward references in named backreferences (if you see what I mean).
+
+15. In UTF-8 mode, with the PCRE_DOTALL option set, a quantified dot in the
+ pattern could run off the end of the subject. For example, the pattern
+ "(?s)(.{1,5})"8 did this with the subject "ab".
+
+16. If PCRE_DOTALL or PCRE_MULTILINE were set, pcre_dfa_exec() behaved as if
+ PCRE_CASELESS was set when matching characters that were quantified with ?
+ or *.
+
+17. A character class other than a single negated character that had a minimum
+ but no maximum quantifier - for example [ab]{6,} - was not handled
+ correctly by pce_dfa_exec(). It would match only one character.
+
+18. A valid (though odd) pattern that looked like a POSIX character
+ class but used an invalid character after [ (for example [[,abc,]]) caused
+ pcre_compile() to give the error "Failed: internal error: code overflow" or
+ in some cases to crash with a glibc free() error. This could even happen if
+ the pattern terminated after [[ but there just happened to be a sequence of
+ letters, a binary zero, and a closing ] in the memory that followed.
+
+19. Perl's treatment of octal escapes in the range \400 to \777 has changed
+ over the years. Originally (before any Unicode support), just the bottom 8
+ bits were taken. Thus, for example, \500 really meant \100. Nowadays the
+ output from "man perlunicode" includes this:
+
+ The regular expression compiler produces polymorphic opcodes. That
+ is, the pattern adapts to the data and automatically switches to
+ the Unicode character scheme when presented with Unicode data--or
+ instead uses a traditional byte scheme when presented with byte
+ data.
+
+ Sadly, a wide octal escape does not cause a switch, and in a string with
+ no other multibyte characters, these octal escapes are treated as before.
+ Thus, in Perl, the pattern /\500/ actually matches \100 but the pattern
+ /\500|\x{1ff}/ matches \500 or \777 because the whole thing is treated as a
+ Unicode string.
+
+ I have not perpetrated such confusion in PCRE. Up till now, it took just
+ the bottom 8 bits, as in old Perl. I have now made octal escapes with
+ values greater than \377 illegal in non-UTF-8 mode. In UTF-8 mode they
+ translate to the appropriate multibyte character.
+
+29. Applied some refactoring to reduce the number of warnings from Microsoft
+ and Borland compilers. This has included removing the fudge introduced
+ seven years ago for the OS/2 compiler (see 2.02/2 below) because it caused
+ a warning about an unused variable.
+
+21. PCRE has not included VT (character 0x0b) in the set of whitespace
+ characters since release 4.0, because Perl (from release 5.004) does not.
+ [Or at least, is documented not to: some releases seem to be in conflict
+ with the documentation.] However, when a pattern was studied with
+ pcre_study() and all its branches started with \s, PCRE still included VT
+ as a possible starting character. Of course, this did no harm; it just
+ caused an unnecessary match attempt.
+
+22. Removed a now-redundant internal flag bit that recorded the fact that case
+ dependency changed within the pattern. This was once needed for "required
+ byte" processing, but is no longer used. This recovers a now-scarce options
+ bit. Also moved the least significant internal flag bit to the most-
+ significant bit of the word, which was not previously used (hangover from
+ the days when it was an int rather than a uint) to free up another bit for
+ the future.
+
+23. Added support for CRLF line endings as well as CR and LF. As well as the
+ default being selectable at build time, it can now be changed at runtime
+ via the PCRE_NEWLINE_xxx flags. There are now options for pcregrep to
+ specify that it is scanning data with non-default line endings.
+
+24. Changed the definition of CXXLINK to make it agree with the definition of
+ LINK in the Makefile, by replacing LDFLAGS to CXXFLAGS.
+
+25. Applied Ian Taylor's patches to avoid using another stack frame for tail
+ recursions. This makes a big different to stack usage for some patterns.
+
+26. If a subpattern containing a named recursion or subroutine reference such
+ as (?P>B) was quantified, for example (xxx(?P>B)){3}, the calculation of
+ the space required for the compiled pattern went wrong and gave too small a
+ value. Depending on the environment, this could lead to "Failed: internal
+ error: code overflow at offset 49" or "glibc detected double free or
+ corruption" errors.
+
+27. Applied patches from Google (a) to support the new newline modes and (b) to
+ advance over multibyte UTF-8 characters in GlobalReplace.
+
+28. Change free() to pcre_free() in pcredemo.c. Apparently this makes a
+ difference for some implementation of PCRE in some Windows version.
+
+29. Added some extra testing facilities to pcretest:
+
+ \q<number> in a data line sets the "match limit" value
+ \Q<number> in a data line sets the "match recursion limt" value
+ -S <number> sets the stack size, where <number> is in megabytes
+
+ The -S option isn't available for Windows.
+
+
Version 6.6 06-Feb-06
---------------------
diff --git a/ext/pcre/pcrelib/LICENCE b/ext/pcre/pcrelib/LICENCE
index 2a3d00e0b..daea2e48a 100644
--- a/ext/pcre/pcrelib/LICENCE
+++ b/ext/pcre/pcrelib/LICENCE
@@ -31,7 +31,7 @@ THE C++ WRAPPER FUNCTIONS
Contributed by: Google Inc.
-Copyright (c) 2005, Google Inc.
+Copyright (c) 2006, Google Inc.
All rights reserved.
diff --git a/ext/pcre/pcrelib/NEWS b/ext/pcre/pcrelib/NEWS
index a8b3a7a04..4f17b198a 100644
--- a/ext/pcre/pcrelib/NEWS
+++ b/ext/pcre/pcrelib/NEWS
@@ -1,6 +1,17 @@
News about PCRE releases
------------------------
+Release 6.7 04-Jul-06
+---------------------
+
+The main additions to this release are the ability to use the same name for
+multiple sets of parentheses, and support for CRLF line endings in both the
+library and pcregrep (and in pcretest for testing).
+
+Thanks to Ian Taylor, the stack usage for many kinds of pattern has been
+significantly reduced for certain subject strings.
+
+
Release 6.5 01-Feb-06
---------------------
diff --git a/ext/pcre/pcrelib/README b/ext/pcre/pcrelib/README
index ab9ee516f..24d0b9749 100644
--- a/ext/pcre/pcrelib/README
+++ b/ext/pcre/pcrelib/README
@@ -34,7 +34,7 @@ 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"
+man pages whose names all start with "pcre". The one that is just 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.
@@ -114,15 +114,17 @@ library. You can read more about them in the pcrebuild man page.
. 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
+ command. This adds about 30K 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 recognize either CR or LF as the newline character,
- instead of whatever your compiler uses for "\n", by adding --newline-is-cr or
- --newline-is-lf 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 LF.
+. You can build PCRE to recognize either CR or LF or the sequence CRLF as
+ indicating the end of a line. Whatever you specify at build time is the
+ default; the caller of PCRE can change the selection at run time. The default
+ newline indicator is a single LF character (the Unix standard). You can
+ specify the default newline indicator by adding --newline-is-cr or
+ --newline-is-lf or --newline-is-crlf to the "configure" command,
+ respectively.
. When called via the POSIX interface, PCRE uses malloc() to get additional
storage for processing capturing parentheses if there are more than 10 of
@@ -142,6 +144,16 @@ library. You can read more about them in the pcrebuild man page.
pcre_exec() can supply their own value. There is discussion on the pcreapi
man page.
+. There is a separate counter that limits the depth of recursive function calls
+ during a matching process. This also has a default of ten million, which is
+ essentially "unlimited". You can change the default by setting, for example,
+
+ --with-match-limit-recursion=500000
+
+ Recursive function calls use up the runtime stack; running out of stack can
+ cause programs to crash in strange ways. There is a discussion about stack
+ sizes in the pcrestack 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
@@ -165,7 +177,6 @@ library. You can read more about them in the pcrebuild man page.
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
@@ -432,25 +443,24 @@ The distribution should contain the following files:
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_ucp_searchfuncs.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"
+ pcre_printint.src ) debugging function that is #included in pcretest, and
+ ) can also be #included in pcre_compile()
+
+ pcre.h the public PCRE header file
pcreposix.h header for the external POSIX wrapper API
pcre_internal.h header for internal use
+ ucp.h ) headers concerned with
+ ucpinternal.h ) Unicode property handling
config.in template for config.h, which is built by configure
pcrecpp.h the header file for the C++ wrapper
@@ -477,8 +487,9 @@ The distribution should contain the following files:
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
+ config.h.in "source" for the config.h header file
configure a configuring shell script (built by autoconf)
- configure.in the autoconf input used to build configure
+ configure.ac 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
@@ -506,7 +517,6 @@ The distribution should contain the following files:
libpcre.def
libpcreposix.def
- pcre.def
(D) Auxiliary file for VPASCAL
@@ -515,4 +525,4 @@ The distribution should contain the following files:
Philip Hazel
Email local part: ph10
Email domain: cam.ac.uk
-January 2006
+June 2006
diff --git a/ext/pcre/pcrelib/doc/Tech.Notes b/ext/pcre/pcrelib/doc/Tech.Notes
index aa5398d0f..21dbe1f9b 100644
--- a/ext/pcre/pcrelib/doc/Tech.Notes
+++ b/ext/pcre/pcrelib/doc/Tech.Notes
@@ -1,6 +1,9 @@
Technical Notes about PCRE
--------------------------
+These are very rough technical notes that record potentially useful information
+about PCRE internals.
+
Historical note 1
-----------------
@@ -21,13 +24,14 @@ 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.
+By contrast, the code originally written by Henry Spencer (which was
+subsequently heavily modified for Perl) 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 Perl version probably doesn't do this any more; I'm talking about
+the original library.) 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
-------------------------
@@ -43,7 +47,7 @@ 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
+compiling functions bigger, of course, but they have become quite big anyway to
handle all the Perl stuff.
Traditional matching function
@@ -63,7 +67,7 @@ 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
+facilities are available, and those that are do not always work in quite the
same way. See the user documentation for details.
Format of compiled patterns
@@ -157,10 +161,12 @@ 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.
+Each is followed by two bytes that encode the desired property as a type and a
+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.
+Repeats of these items use the OP_TYPESTAR etc. set of opcodes, followed by
+three bytes: OP_PROP or OP_NOTPROP and then the desired property type and
+value.
Matching literal characters
@@ -339,4 +345,4 @@ at compile time, and so does not cause anything to be put into the compiled
data.
Philip Hazel
-January 2006
+June 2006
diff --git a/ext/pcre/pcrelib/doc/pcre.txt b/ext/pcre/pcrelib/doc/pcre.txt
index fe57de473..d6c204b57 100644
--- a/ext/pcre/pcrelib/doc/pcre.txt
+++ b/ext/pcre/pcrelib/doc/pcre.txt
@@ -81,6 +81,7 @@ USER DOCUMENTATION
pcreposix the POSIX-compatible C API
pcreprecompile details of saving and re-using precompiled patterns
pcresample discussion of the sample program
+ pcrestack discussion of stack usage
pcretest description of the pcretest testing command
In addition, in the "man" and HTML formats, there is a short page for
@@ -100,19 +101,24 @@ LIMITATIONS
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.
+ All values in repeating quantifiers must be less than 65536. The maxi-
+ mum compiled length of subpattern with an explicit repeat count is
+ 30000 bytes. The maximum 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,
+ 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 name for a named subpattern is 32, and the maxi-
+ mum number of named subpatterns is 10000.
+
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.
+ For a discussion of stack issues, see the pcrestack documentation.
UTF-8 AND UNICODE PROPERTY SUPPORT
@@ -162,37 +168,40 @@ UTF-8 AND UNICODE PROPERTY SUPPORT
2. An unbraced hexadecimal escape sequence (such as \xb3) matches a
two-byte UTF-8 character if the value is greater than 127.
- 3. Repeat quantifiers apply to complete UTF-8 characters, not to indi-
+ 3. Octal numbers up to \777 are recognized, and match two-byte UTF-8
+ characters for values greater than \177.
+
+ 4. Repeat quantifiers apply to complete UTF-8 characters, not to indi-
vidual bytes, for example: \x{100}{3}.
- 4. The dot metacharacter matches one UTF-8 character instead of a sin-
+ 5. The dot metacharacter matches one UTF-8 character instead of a sin-
gle byte.
- 5. 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
+ 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().
- 6. 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
+ 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
+ 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}.
- 7. Similarly, characters that match the POSIX named character classes
+ 8. Similarly, characters that match the POSIX named character classes
are all low-valued characters.
- 8. 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
+ 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. Even when Unicode property
support is available, PCRE supports case-insensitive matching only when
- there is a one-to-one mapping between a letter's cases. There are a
- small number of many-to-one mappings in Unicode; these are not sup-
+ there is a one-to-one mapping between a letter's cases. There are a
+ small number of many-to-one mappings in Unicode; these are not sup-
ported by PCRE.
@@ -202,11 +211,11 @@ AUTHOR
University Computing Service,
Cambridge CB2 3QG, England.
- Putting an actual email address here seems to have been a spam magnet,
+ 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: 24 January 2006
+Last updated: 05 June 2006
Copyright (c) 1997-2006 University of Cambridge.
------------------------------------------------------------------------------
@@ -281,15 +290,25 @@ UNICODE CHARACTER PROPERTY SUPPORT
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
+ By default, PCRE interprets character 10 (linefeed, LF) as indicating
+ the end of a line. This is the normal newline character on Unix-like
+ systems. You can compile PCRE to use character 13 (carriage return, CR)
+ 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.
+ to the configure command. There is also a --enable-newline-is-lf
+ option, which explicitly specifies linefeed as the newline character.
+
+ Alternatively, you can specify that line endings are to be indicated by
+ the two character sequence CRLF. If you want this, add
+
+ --enable-newline-is-crlf
+
+ to the configure command. Whatever line ending convention is selected
+ when PCRE is built can be overridden when the library functions are
+ called. At build time it is conventional to use the standard for your
+ operating system.
BUILDING SHARED AND STATIC LIBRARIES
@@ -320,23 +339,6 @@ POSIX MALLOC USAGE
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
@@ -366,10 +368,12 @@ AVOIDING EXCESSIVE STACK USAGE
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
+ suffer from this problem, but it may sometimes be necessary to increase
+ the maximum stack size. There is a discussion in the pcrestack docu-
+ mentation.) An alternative approach to recursion that uses memory from
+ the heap to remember data, instead of using recursive function calls,
+ has been implemented to work round the problem of limited stack size.
+ If you want to build a version of PCRE that works this way, add
--disable-stack-for-recursion
@@ -384,19 +388,49 @@ AVOIDING EXCESSIVE STACK USAGE
function; it is not relevant for the the pcre_dfa_exec() function.
+LIMITING PCRE RESOURCE USAGE
+
+ Internally, PCRE has a function called match(), which it calls repeat-
+ edly (sometimes 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.
+
+ In some environments it is desirable to limit the depth of recursive
+ calls of match() more strictly than the total number of calls, in order
+ to restrict the maximum amount of stack (or heap, if --disable-stack-
+ for-recursion is specified) that is used. A second limit controls this;
+ it defaults to the value that is set for --with-match-limit, which
+ imposes no additional constraints. However, you can set a lower limit
+ by adding, for example,
+
+ --with-match-limit-recursion=10000
+
+ to the configure command. This value can also be overridden at run
+ time.
+
+
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
+ 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: 15 August 2005
-Copyright (c) 1997-2005 University of Cambridge.
+Last updated: 06 June 2006
+Copyright (c) 1997-2006 University of Cambridge.
------------------------------------------------------------------------------
@@ -441,9 +475,9 @@ REGULAR EXPRESSIONS AS TREES
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.
+ thought of as a search of the tree. There are two 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
@@ -563,8 +597,8 @@ DISADVANTAGES OF THE DFA ALGORITHM
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.
+Last updated: 06 June 2006
+Copyright (c) 1997-2006 University of Cambridge.
------------------------------------------------------------------------------
@@ -617,6 +651,9 @@ PCRE NATIVE API
int pcre_get_stringnumber(const pcre *code,
const char *name);
+ int pcre_get_stringtable_entries(const pcre *code,
+ const char *name, char **first, char **last);
+
int pcre_get_substring(const char *subject, int *ovector,
int stringcount, int stringnumber,
const char **stringptr);
@@ -677,11 +714,11 @@ PCRE API OVERVIEW
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.
+ ing. The alternative algorithm finds all possible matches (at a given
+ point in the subject). 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 documenta-
+ tion.
In addition to the main compiling and matching functions, there are
convenience functions for extracting captured substrings from a subject
@@ -693,6 +730,7 @@ PCRE API OVERVIEW
pcre_get_named_substring()
pcre_get_substring_list()
pcre_get_stringnumber()
+ pcre_get_stringtable_entries()
pcre_free_substring() and pcre_free_substring_list() are also provided,
to free the memory used for extracted strings.
@@ -724,12 +762,15 @@ PCRE API OVERVIEW
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.
+ function. See the pcrebuild documentation for details of how to do
+ this. It is a non-standard way of building PCRE, for use in environ-
+ ments 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.
+ There is a discussion about PCRE's stack usage in the pcrestack docu-
+ mentation.
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
@@ -737,14 +778,27 @@ PCRE API OVERVIEW
pcrecallout documentation.
+NEWLINES
+ PCRE supports three different conventions for indicating line breaks in
+ strings: a single CR character, a single LF character, or the two-char-
+ acter sequence CRLF. All three are used as "standard" by different
+ operating systems. When PCRE is built, a default can be specified. The
+ default default is LF, which is the Unix standard. When PCRE is run,
+ the default can be overridden, either when a pattern is compiled, or
+ when it is matched.
+
+ In the PCRE documentation the word "newline" is used to mean "the char-
+ acter or pair of characters that indicate a line break".
+
+
MULTITHREADING
- The PCRE functions can be used in multi-threading applications, with
+ 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-
+ 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.
@@ -752,8 +806,8 @@ MULTITHREADING
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
+ 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.
@@ -761,68 +815,68 @@ CHECKING BUILD-TIME OPTIONS
int pcre_config(int what, void *where);
- The function pcre_config() makes it possible for a PCRE client to dis-
+ 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-
+ The pcrebuild documentation has more details about these optional fea-
tures.
- The first argument for pcre_config() is an integer, specifying which
+ 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
+ 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-
+ 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
+ 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.
+ The output is an integer whose value specifies the default character
+ sequence that is recognized as meaning "newline". The three values that
+ are supported are: 10 for LF, 13 for CR, and 3338 for CRLF. The default
+ should normally be the standard sequence for your operating system.
PCRE_CONFIG_LINK_SIZE
- The output is an integer that contains the number of bytes used for
+ 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
+ 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
+ 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
+ internal matching function calls in a pcre_exec() execution. Further
details are given with pcre_exec() below.
PCRE_CONFIG_MATCH_LIMIT_RECURSION
- The output is an integer that gives the default limit for the depth of
- recursion when calling the internal matching function in a pcre_exec()
+ The output is an integer that gives the default limit for the depth of
+ recursion when calling the internal matching function 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
+ 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
+ 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
+ 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.
@@ -839,55 +893,55 @@ COMPILING A PATTERN
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,
+ 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
+ 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.
+ It is up to the caller to free the memory (via pcre_free) when it is no
+ longer required.
- Although the compiled code of a PCRE regex is relocatable, that is, it
+ 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-
+ 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.
+ 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 and PCRE_NEWLINE_xxx options 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
+ 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. This is a static string that is part of the library. You must not
try to free it. The offset from the start of the pattern to the charac-
ter 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
+ 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
+ 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
+ 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-
+ This code fragment shows a typical straightforward call to pcre_com-
pile():
pcre *re;
@@ -900,86 +954,95 @@ COMPILING A PATTERN
&erroffset, /* for error offset */
NULL); /* use default character tables */
- The following names for option bits are defined in the pcre.h header
+ 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
+ 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
+ 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
+ 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.
+ 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 a newline at the end of the string (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.
+ acters, including those that indicate newline. Without it, a dot does
+ not match when the current position is at a newline. 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
+ newlines, independent of the setting of this option.
+
+ PCRE_DUPNAMES
+
+ If this bit is set, names used to identify capturing subpatterns need
+ not be unique. This can be helpful for certain types of pattern when it
+ is known that only one instance of the named subpattern can ever be
+ matched. There are more details of named subpatterns below; see also
+ the pcrepattern documentation.
PCRE_EXTENDED
- If this bit is set, whitespace data characters in the pattern are
+ 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
+ line, inclusive, are also ignored. This is equivalent to Perl's /x
+ option, and it can be changed within a pattern by a (?x) option set-
+ ting.
+
+ 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.
+ 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. (Perl can, however, be persuaded to give a warning for this.)
+ 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.
+ before or at the first newline in the subject string, though the
+ matched text may continue over the newline.
PCRE_MULTILINE
@@ -991,54 +1054,71 @@ COMPILING A PATTERN
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,
+ constructs match immediately following or immediately before internal
+ newlines 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 new-
+ lines in a subject string, or no occurrences of ^ or $ in a pattern,
setting PCRE_MULTILINE has no effect.
+ PCRE_NEWLINE_CR
+ PCRE_NEWLINE_LF
+ PCRE_NEWLINE_CRLF
+
+ These options override the default newline definition that was chosen
+ when PCRE was built. Setting the first or the second specifies that a
+ newline is indicated by a single character (CR or LF, respectively).
+ Setting both of them specifies that a newline is indicated by the two-
+ character CRLF sequence. For convenience, PCRE_NEWLINE_CRLF is defined
+ to contain both bits. The only time that a line break is relevant when
+ compiling a pattern is if PCRE_EXTENDED is set, and an unescaped # out-
+ side a character class is encountered. This indicates a comment that
+ lasts until after the next newline.
+
+ The newline option set at compile time becomes the default that is used
+ for pcre_exec() and pcre_dfa_exec(), but it can be overridden.
+
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).
+ 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
+ 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
+ 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
+ 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-
+ 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
+ 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
@@ -1067,7 +1147,7 @@ COMPILATION ERROR CODES
23 internal error: code overflow
24 unrecognized character after (?<
25 lookbehind assertion is not fixed length
- 26 malformed number after (?(
+ 26 malformed number or name after (?(
27 conditional group contains more than two branches
28 assertion expected after (?(
29 (?R or (?digits must be followed by )
@@ -1084,11 +1164,15 @@ COMPILATION ERROR CODES
40 recursive call could loop indefinitely
41 unrecognized character after (?P
42 syntax error after (?P
- 43 two named groups have the same name
+ 43 two named subpatterns 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
+ 48 subpattern name is too long (maximum 32 characters)
+ 49 too many named subpatterns (maximum 10,000)
+ 50 repeated subpattern is too long
+ 51 octal value is greater than \377 (not in UTF-8 mode)
STUDYING A PATTERN
@@ -1096,32 +1180,32 @@ 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
+ 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-
+ 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
+ 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
+ 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
+ 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
+ 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,
+ 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 is set to point to a textual
+ 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 is set to point to a textual
error message. This is a static string that is part of the library. You
- must not try to free it. You should test the error pointer for NULL
+ must not try to free it. You should test the error pointer for NULL
after calling pcre_study(), to be sure that it has run successfully.
This is a typical call to pcre_study():
@@ -1133,52 +1217,52 @@ STUDYING A PATTERN
&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-
+ 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. The use of locales with Uni-
+ 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. The use of locales with Uni-
code is discouraged.
- 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
+ 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
+ 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
+ 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()
+ 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
+ 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.
@@ -1188,15 +1272,15 @@ 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-
+ 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
+ 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
@@ -1204,51 +1288,50 @@ INFORMATION ABOUT A PATTERN
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
+ 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;
+ size_t 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
+ 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
+ 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
+ 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
+ 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
+ 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.)
+ Return information about the first byte of any matched string, for a
+ non-anchored pattern. The fourth argument should point to an int vari-
+ able. (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
+ If there is a fixed first byte, for example, from a pattern such as
+ (cat|cow|coyote). Otherwise, if either
(a) the pattern was compiled with the PCRE_MULTILINE option, and every
branch starts with "^", or
@@ -1284,13 +1367,13 @@ INFORMATION ABOUT A PATTERN
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.
+ ses, which still acquire numbers. Several convenience functions such as
+ pcre_get_named_substring() are provided for extracting captured sub-
+ strings 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
@@ -1300,8 +1383,10 @@ INFORMATION ABOUT A PATTERN
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):
+ When PCRE_DUPNAMES is set, duplicate names are in order of their paren-
+ theses numbers. 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) )
@@ -1317,8 +1402,8 @@ INFORMATION ABOUT A PATTERN
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.
+ name-to-number map, remember that the length of the entries is likely
+ to be different for each compiled pattern.
PCRE_INFO_OPTIONS
@@ -1517,16 +1602,26 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
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.
+ The only bits that may be set are PCRE_ANCHORED, PCRE_NEWLINE_xxx,
+ 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
+ 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_NEWLINE_CR
+ PCRE_NEWLINE_LF
+ PCRE_NEWLINE_CRLF
+
+ These options override the newline definition that was chosen or
+ defaulted when the pattern was compiled. For details, see the descrip-
+ tion pcre_compile() above. During matching, the newline choice affects
+ the behaviour of the dot, circumflex, and dollar metacharacters.
+
PCRE_NOTBOL
This option specifies that first character of the subject string is not
@@ -1662,41 +1757,50 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
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.
+ tern, and so on. The value returned by pcre_exec() is one more than the
+ highest numbered pair that has been set. For example, if two substrings
+ have been captured, the returned value is 3. 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.
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,
+ 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-
+ 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.
+ 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.
+ The pcre_info() function can be used to find out how many capturing
+ subpatterns 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.
+
+ It is possible for 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) the
+ return from the function is 4, and subpatterns 1 and 3 are matched, but
+ 2 is not. When this happens, both values in the offset pairs corre-
+ sponding to unused subpatterns are set to -1.
+
+ Offset values that correspond to unused subpatterns at the end of the
+ expression are also set to -1. For example, if the string "abc" is
+ matched against the pattern (abc)(x(yz)?)? subpatterns 2 and 3 are not
+ matched. The return from the function is 2, because the highest used
+ capturing subpattern number is 1. However, you can refer to the offsets
+ for the second and third capturing subpatterns if you wish (assuming
+ the vector is large enough, of course).
- Return values from pcre_exec()
+ Some convenience functions are provided for extracting the captured
+ substrings as separate strings. These are described below.
- If pcre_exec() fails, it returns a negative number. The following are
+ Error 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)
@@ -1705,7 +1809,7 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
PCRE_ERROR_NULL (-2)
- Either code or subject was passed as NULL, or ovector was NULL and
+ Either code or subject was passed as NULL, or ovector was NULL and
ovecsize was not zero.
PCRE_ERROR_BADOPTION (-3)
@@ -1714,80 +1818,80 @@ MATCHING A PATTERN: THE TRADITIONAL FUNCTION
PCRE_ERROR_BADMAGIC (-4)
- PCRE stores a 4-byte "magic number" at the start of the compiled code,
+ 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
+ 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
+ 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
+ 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
+ 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(),
+ 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 backtracking limit, as specified by the match_limit field in a
- pcre_extra structure (or defaulted) was reached. See the description
+ The backtracking limit, as specified by the match_limit field in a
+ pcre_extra structure (or defaulted) was reached. See the description
above.
PCRE_ERROR_RECURSIONLIMIT (-21)
The internal recursion limit, as specified by the match_limit_recursion
- field in a pcre_extra structure (or defaulted) was reached. See the
+ 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.
+ 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
+ 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-
+ 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
+ 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
+ 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
+ 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.
+ This error is given if the value of the ovecsize argument is negative.
EXTRACTING CAPTURED SUBSTRINGS BY NUMBER
@@ -1803,71 +1907,77 @@ EXTRACTING CAPTURED SUBSTRINGS BY NUMBER
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
+ 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
+ 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. However, you can process such a string by referring to the
+ length that is returned by pcre_copy_substring() and pcre_get_sub-
+ string(). Unfortunately, the interface to pcre_get_substring_list() is
+ not adequate for handling strings containing binary zeros, because the
+ end of the final string is not independently indicated.
+
+ 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
+ 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
+ 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 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
+ 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
+ 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
+ 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
+ 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-
+ 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
+ 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-
+ 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 that cannot use
+ pcre_free directly; it is for these cases that the functions are pro-
vided.
@@ -1886,16 +1996,17 @@ EXTRACTING CAPTURED SUBSTRINGS BY NAME
int stringcount, const char *stringname,
const char **stringptr);
- To extract a substring by name, you first have to find associated num-
+ 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.
+ the number of the subpattern called "xxx" is 2. If the name is known to
+ be unique (PCRE_DUPNAMES was not set), you can find the number from the
+ name by calling pcre_get_stringnumber(). The first argument is the com-
+ piled 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
@@ -1917,21 +2028,50 @@ EXTRACTING CAPTURED SUBSTRINGS BY NAME
ate.
+DUPLICATE SUBPATTERN NAMES
+
+ int pcre_get_stringtable_entries(const pcre *code,
+ const char *name, char **first, char **last);
+
+ When a pattern is compiled with the PCRE_DUPNAMES option, names for
+ subpatterns are not required to be unique. Normally, patterns with
+ duplicate names are such that in any one match, only one of the named
+ subpatterns participates. An example is shown in the pcrepattern docu-
+ mentation. When duplicates are present, pcre_copy_named_substring() and
+ pcre_get_named_substring() return the first substring corresponding to
+ the given name that is set. If none are set, an empty string is
+ returned. The pcre_get_stringnumber() function returns one of the num-
+ bers that are associated with the name, but it is not defined which it
+ is.
+
+ If you want to get full details of all captured substrings for a given
+ name, you must use the pcre_get_stringtable_entries() function. The
+ first argument is the compiled pattern, and the second is the name. The
+ third and fourth are pointers to variables which are updated by the
+ function. After it has run, they point to the first and last entries in
+ the name-to-number table for the given name. The function itself
+ returns the length of each entry, or PCRE_ERROR_NOSUBSTRING if there
+ are none. The format of the table is described above in the section
+ entitled Information about a pattern. Given all the relevant entries
+ for the name, you can extract each of their numbers, and hence the cap-
+ tured data, if any.
+
+
FINDING ALL POSSIBLE MATCHES
- The traditional matching function uses a similar algorithm to Perl,
+ 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
+ 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
+ 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.
@@ -1942,25 +2082,25 @@ MATCHING A PATTERN: THE ALTERNATIVE FUNCTION
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-
+ 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
+ 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
+ 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
+ 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
+ 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.
+ workspace will be needed for patterns and subjects where there are a
+ lot of potential matches.
Here is an example of a simple call to pcre_dfa_exec():
@@ -1981,47 +2121,47 @@ MATCHING A PATTERN: THE ALTERNATIVE FUNCTION
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.
+ 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_NEW-
+ LINE_xxx, 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
+ 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
+ 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
+ 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
+ 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-
+ 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,
+ 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
<.*>
@@ -2036,58 +2176,58 @@ MATCHING A PATTERN: THE ALTERNATIVE FUNCTION
<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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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
+ 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: 18 January 2006
+Last updated: 08 June 2006
Copyright (c) 1997-2006 University of Cambridge.
------------------------------------------------------------------------------
@@ -2334,25 +2474,26 @@ DIFFERENCES BETWEEN PCRE AND PERL
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.
+ cial meaning is faulted. Otherwise, like Perl, the backslash is
+ ignored. (Perl can be made to issue a warning.)
- (d) If PCRE_UNGREEDY is set, the greediness of the repetition quanti-
+ (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-
+ (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,
+ (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.
+ (h) PCRE supports named capturing substrings, using the Python syntax.
- (i) PCRE supports the possessive quantifier "++" syntax, taken from
+ (i) PCRE supports the possessive quantifier "++" syntax, taken from
Sun's Java package.
(j) The (R) condition, for testing recursion, is a PCRE extension.
@@ -2364,10 +2505,10 @@ DIFFERENCES BETWEEN PCRE AND PERL
(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
+ (n) The alternative matching function (pcre_dfa_exec()) matches in a
different way and is not Perl-compatible.
-Last updated: 24 January 2006
+Last updated: 06 June 2006
Copyright (c) 1997-2006 University of Cambridge.
------------------------------------------------------------------------------
@@ -2476,9 +2617,9 @@ BACKSLASH
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.
+ # outside a character class and the next newline are ignored. An escap-
+ ing backslash can be used to include a whitespace or # character 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-
@@ -2535,26 +2676,27 @@ BACKSLASH
two syntaxes for \x. There is no difference in the way they are han-
dled. 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.
+ After \0 up to two further octal digits are read. 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
+ 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
+ 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:
+ 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, ane uses them to gen-
+ erate a data character. Any subsequent digits stand for themselves. In
+ non-UTF-8 mode, the value of a character specified in octal must be
+ less than \400. In UTF-8 mode, values up to \777 are permitted. For
+ example:
\040 is another way of writing a space
\40 is the same, provided there are fewer than 40
@@ -2571,15 +2713,14 @@ BACKSLASH
\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
+ 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).
+ All the sequences that define a single character value 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
@@ -2604,7 +2745,9 @@ BACKSLASH
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).
+ characters are HT (9), LF (10), FF (12), CR (13), and space (32). (If
+ "use locale;" is included in a Perl script, \s may match the VT charac-
+ ter. In PCRE, it never does.)
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-
@@ -2719,7 +2862,7 @@ BACKSLASH
classified as a modifier or "other".
The long synonyms for these properties that Perl supports (such as
- \p{Letter}) are not supported by PCRE. Nor is is permitted to prefix
+ \p{Letter}) are not supported by PCRE, nor is it permitted to prefix
any of these properties with "Is".
No character that is in the Unicode table has the Cn (unassigned) prop-
@@ -2777,24 +2920,23 @@ BACKSLASH
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-
+ that \Z matches before a newline at the end of the string as well as at
+ the very end, 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
+ 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
+ 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
+ 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.
@@ -2802,68 +2944,81 @@ BACKSLASH
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
+ 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
+ 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.
+ 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 at the end of 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.
+ PCRE_MULTILINE option is set. When this is the case, a circumflex
+ matches immediately after internal newlines as well as at the start of
+ the subject string. It does not match after a newline that ends the
+ string. A dollar matches before any newlines in the string, as well as
+ at the very end, when PCRE_MULTILINE is set. When newline is specified
+ as the two-character sequence CRLF, isolated CR and LF characters do
+ not indicate newlines.
+
+ For example, the pattern /^abc$/ matches the subject string "def\nabc"
+ (where \n represents a newline) in multiline 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_DOLLAR_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 or not PCRE_MULTILINE is
+ set.
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.
+ ter in the subject string except (by default) a character that signi-
+ fies the end of a line. In UTF-8 mode, the matched character may be
+ more than one byte long. When a line ending is defined as a single
+ character (CR or LF), dot never matches that character; when the two-
+ character sequence CRLF is used, dot does not match CR if it is immedi-
+ ately followed by LF, but otherwise it matches all characters (includ-
+ ing isolated CRs and LFs).
+
+ The behaviour of dot with regard to newlines can be changed. If the
+ PCRE_DOTALL option is set, a dot matches any one character, without
+ exception. If newline is defined as the two-character sequence CRLF, it
+ takes two dots to match it.
+
+ The handling of dot is entirely independent of the handling of circum-
+ flex and dollar, the only relationship being that they both involve
+ newlines. 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
+ both in and out of UTF-8 mode. Unlike a dot, it always matches CR and
+ LF. 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.
@@ -2912,9 +3067,11 @@ SQUARE BRACKETS AND CHARACTER CLASSES
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.
+ Characters that might indicate line breaks (CR and LF) are never
+ treated in any special way when matching character classes, whatever
+ line-ending sequence is in use, and whatever setting of the PCRE_DOTALL
+ and PCRE_MULTILINE options is used. A class such as [^a] always matches
+ one of these characters.
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
@@ -3015,11 +3172,10 @@ VERTICAL BAR
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.
+ string). The matching process tries each alternative in turn, from left
+ to right, and the first one that succeeds is used. If the alternatives
+ are within a subpattern (defined below), "succeeds" means matching the
+ rest of the main pattern as well as the alternative in the subpattern.
INTERNAL OPTION SETTING
@@ -3065,12 +3221,9 @@ INTERNAL OPTION SETTING
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.
+ The PCRE-specific options PCRE_DUPNAMES, PCRE_UNGREEDY, and PCRE_EXTRA
+ can be changed in the same way as the Perl-compatible options by using
+ the characters J, U and X respectively.
SUBPATTERNS
@@ -3082,18 +3235,18 @@ SUBPATTERNS
cat(aract|erpillar|)
- matches one of the words "cat", "cataract", or "caterpillar". Without
- the parentheses, it would match "cataract", "erpillar" or the empty
+ 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
+ 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
+ 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-
+ For example, if the string "the red king" is matched against the pat-
tern
the ((red|white) (king|queen))
@@ -3101,50 +3254,75 @@ SUBPATTERNS
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
+ 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-
+ 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
+ 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
+ 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
+ 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. References to capturing parentheses from other
+ parts of the pattern, such as backreferences, recursion, and condi-
+ tions, can be made by name as well as by number.
+
+ Names consist of up to 32 alphanumeric characters and underscores.
+ 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.
+ number translation table from a compiled pattern. There is also a con-
+ venience function for extracting a captured substring by name.
+
+ By default, a name must be unique within a pattern, but it is possible
+ to relax this constraint by setting the PCRE_DUPNAMES option at compile
+ time. This can be useful for patterns where only one instance of the
+ named parentheses can match. Suppose you want to match the name of a
+ weekday, either as a 3-letter abbreviation or as the full name, and in
+ both cases you want to extract the abbreviation. This pattern (ignoring
+ the line breaks) does the job:
+
+ (?P<DN>Mon|Fri|Sun)(?:day)?|
+ (?P<DN>Tue)(?:sday)?|
+ (?P<DN>Wed)(?:nesday)?|
+ (?P<DN>Thu)(?:rsday)?|
+ (?P<DN>Sat)(?:urday)?
+
+ There are five capturing substrings, but only one is ever set after a
+ match. The convenience function for extracting the data by name
+ returns the substring for the first, and in this example, the only,
+ subpattern of that name that matched. This saves searching to find
+ which numbered subpattern it was. If you make a reference to a non-
+ unique named subpattern from elsewhere in the pattern, the one that
+ corresponds to the lowest number is used. For further details of the
+ interfaces for handling named subpatterns, see the pcreapi documenta-
+ tion.
REPETITION
@@ -3353,8 +3531,10 @@ ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS
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.
+ The possessive quantifier syntax is an extension to the Perl syntax.
+ Jeffrey Friedl originated the idea (and the name) in the first edition
+ of his book. Mike McCloskey liked it, so implemented it when he built
+ Sun's Java package, and PCRE copied it from there.
When a pattern contains an unlimited repeat inside a subpattern that
can itself be repeated an unlimited number of times, the use of an
@@ -3395,31 +3575,41 @@ BACK REFERENCES
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.
+ to the left of the reference for numbers less than 10. A "forward back
+ reference" of this type can make sense when a repetition is involved
+ and the subpattern to the right has participated in an earlier itera-
+ tion.
+
+ It is not possible to have a numerical "forward back reference" to sub-
+ pattern whose number is 10 or more. However, a back reference to any
+ subpattern is possible using named parentheses (see below). See also
+ the subsection 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
+ 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-
+ 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
+ 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).
+ 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)
+ (?P<p1>(?i)rah)\s+(?P=p1)
+
+ A subpattern that is referenced by name may appear in the pattern
+ before or after the reference.
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
@@ -3508,8 +3698,8 @@ ASSERTIONS
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
+ eral top-level alternatives, they do not all have to have the same
+ fixed length. Thus
(?<=bullock|donkey)
@@ -3622,12 +3812,18 @@ CONDITIONAL SUBPATTERNS
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:
+ consists of a sequence of digits, or a sequence of alphanumeric charac-
+ ters and underscores, the condition is satisfied if the capturing sub-
+ pattern of that number or name has previously matched. There is a pos-
+ sible ambiguity here, because subpattern names may consist entirely of
+ digits. PCRE looks first for a named subpattern; if it cannot find one
+ and the text consists entirely of digits, it looks for a subpattern of
+ that number, which must be greater than zero. Using subpattern names
+ that consist entirely of digits is not recommended.
+
+ Consider the following pattern, which contains 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) \) )
@@ -3640,12 +3836,16 @@ CONDITIONAL SUBPATTERNS
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.
+ optionally enclosed in parentheses. Rewriting it to use a named subpat-
+ tern gives this:
- 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.
+ (?P<OPEN> \( )? [^()]+ (?(OPEN) \) )
+
+ If the condition is the string (R), and there is no subpattern with the
+ name R, the condition is satisfied if a recursive call to the pattern
+ or subpattern has been made. At "top level", the condition 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
@@ -3672,8 +3872,8 @@ COMMENTS
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.
+ character class introduces a comment that continues to immediately
+ after the next newline in the pattern.
RECURSIVE PATTERNS
@@ -3796,50 +3996,51 @@ SUBPATTERNS AS SUBROUTINES
(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.
+ two strings. Such references, if given numerically, must follow the
+ subpattern to which they refer. However, named references can refer to
+ later subpatterns.
Like recursive subpatterns, a "subroutine" call is always treated as an
- atomic group. That is, once it has matched some of the subject string,
- it is never re-entered, even if it contains untried alternatives and
+ atomic group. That is, once it has matched some of the subject string,
+ it is never re-entered, even if it contains untried alternatives and
there is a subsequent matching failure.
CALLOUTS
Perl has a feature whereby using the sequence (?{...}) causes arbitrary
- Perl code to be obeyed in the middle of matching a regular expression.
+ 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
+ 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
+ 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
+ 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-
+ 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: 24 January 2006
+Last updated: 06 June 2006
Copyright (c) 1997-2006 University of Cambridge.
------------------------------------------------------------------------------
@@ -4847,3 +5048,106 @@ PCRE SAMPLE PROGRAM
Last updated: 09 September 2004
Copyright (c) 1997-2004 University of Cambridge.
------------------------------------------------------------------------------
+PCRESTACK(3) PCRESTACK(3)
+
+
+NAME
+ PCRE - Perl-compatible regular expressions
+
+
+PCRE DISCUSSION OF STACK USAGE
+
+ When you call pcre_exec(), it makes use of an internal function called
+ match(). This calls itself recursively at branch points in the pattern,
+ in order to remember the state of the match so that it can back up and
+ try a different alternative if the first one fails. As matching pro-
+ ceeds deeper and deeper into the tree of possibilities, the recursion
+ depth increases.
+
+ Not all calls of match() increase the recursion depth; for an item such
+ as a* it may be called several times at the same level, after matching
+ different numbers of a's. Furthermore, in a number of cases where the
+ result of the recursive call would immediately be passed back as the
+ result of the current call (a "tail recursion"), the function is just
+ restarted instead.
+
+ The pcre_dfa_exec() function operates in an entirely different way, and
+ hardly uses recursion at all. The limit on its complexity is the amount
+ of workspace it is given. The comments that follow do NOT apply to
+ pcre_dfa_exec(); they are relevant only for pcre_exec().
+
+ You can set limits on the number of times that match() is called, both
+ in total and recursively. If the limit is exceeded, an error occurs.
+ For details, see the section on extra data for pcre_exec() in the
+ pcreapi documentation.
+
+ Each time that match() is actually called recursively, it uses memory
+ from the process stack. For certain kinds of pattern and data, very
+ large amounts of stack may be needed, despite the recognition of "tail
+ recursion". You can often reduce the amount of recursion, and there-
+ fore the amount of stack used, by modifying the pattern that is being
+ matched. Consider, for example, this pattern:
+
+ ([^<]|<(?!inet))+
+
+ It matches from wherever it starts until it encounters "<inet" or the
+ end of the data, and is the kind of pattern that might be used when
+ processing an XML file. Each iteration of the outer parentheses matches
+ either one character that is not "<" or a "<" that is not followed by
+ "inet". However, each time a parenthesis is processed, a recursion
+ occurs, so this formulation uses a stack frame for each matched charac-
+ ter. For a long string, a lot of stack is required. Consider now this
+ rewritten pattern, which matches exactly the same strings:
+
+ ([^<]++|<(?!inet))
+
+ This uses very much less stack, because runs of characters that do not
+ contain "<" are "swallowed" in one item inside the parentheses. Recur-
+ sion happens only when a "<" character that is not followed by "inet"
+ is encountered (and we assume this is relatively rare). A possessive
+ quantifier is used to stop any backtracking into the runs of non-"<"
+ characters, but that is not related to stack usage.
+
+ In environments where stack memory is constrained, you might want to
+ compile PCRE to use heap memory instead of stack for remembering back-
+ up points. This makes it run a lot more slowly, however. Details of how
+ to do this are given in the pcrebuild documentation.
+
+ In Unix-like environments, there is not often a problem with the stack,
+ though the default limit on stack size varies from system to system.
+ Values from 8Mb to 64Mb are common. You can find your default limit by
+ running the command:
+
+ ulimit -s
+
+ The effect of running out of stack is often SIGSEGV, though sometimes
+ an error message is given. You can normally increase the limit on stack
+ size by code such as this:
+
+ struct rlimit rlim;
+ getrlimit(RLIMIT_STACK, &rlim);
+ rlim.rlim_cur = 100*1024*1024;
+ setrlimit(RLIMIT_STACK, &rlim);
+
+ This reads the current limits (soft and hard) using getrlimit(), then
+ attempts to increase the soft limit to 100Mb using setrlimit(). You
+ must do this before calling pcre_exec().
+
+ PCRE has an internal counter that can be used to limit the depth of
+ recursion, and thus cause pcre_exec() to give an error code before it
+ runs out of stack. By default, the limit is very large, and unlikely
+ ever to operate. It can be changed when PCRE is built, and it can also
+ be set when pcre_exec() is called. For details of these interfaces, see
+ the pcrebuild and pcreapi documentation.
+
+ As a very rough rule of thumb, you should reckon on about 500 bytes per
+ recursion. Thus, if you want to limit your stack usage to 8Mb, you
+ should set the limit at 16000 recursions. A 64Mb stack, on the other
+ hand, can support around 128000 recursions. The pcretest test program
+ has a command line option (-S) that can be used to increase its stack.
+
+Last updated: 29 June 2006
+Copyright (c) 1997-2006 University of Cambridge.
+------------------------------------------------------------------------------
+
+
diff --git a/ext/pcre/pcrelib/pcre.h b/ext/pcre/pcrelib/pcre.h
index e16cc7096..b4a19d2fa 100644
--- a/ext/pcre/pcrelib/pcre.h
+++ b/ext/pcre/pcrelib/pcre.h
@@ -55,9 +55,9 @@ cannot run ./configure. As it now stands, this file need not be edited in that
circumstance. */
#define PCRE_MAJOR 6
-#define PCRE_MINOR 6
+#define PCRE_MINOR 7
#define PCRE_PRERELEASE
-#define PCRE_DATE 06-Feb-2006
+#define PCRE_DATE 04-Jul-2006
/* Win32 uses DLL by default; it needs special stuff for exported functions
when building PCRE. */
@@ -116,6 +116,10 @@ extern "C" {
#define PCRE_DFA_SHORTEST 0x00010000
#define PCRE_DFA_RESTART 0x00020000
#define PCRE_FIRSTLINE 0x00040000
+#define PCRE_DUPNAMES 0x00080000
+#define PCRE_NEWLINE_CR 0x00100000
+#define PCRE_NEWLINE_LF 0x00200000
+#define PCRE_NEWLINE_CRLF 0x00300000
/* Exec-time and get/set-time error codes */
@@ -269,6 +273,8 @@ PCRE_DATA_SCOPE int pcre_fullinfo(const pcre *, const pcre_extra *, int,
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_stringtable_entries(const pcre *, const char *,
+ char **, 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,
diff --git a/ext/pcre/pcrelib/pcre_compile.c b/ext/pcre/pcrelib/pcre_compile.c
index 0bbc7f5ba..4ea73d9d3 100644
--- a/ext/pcre/pcrelib/pcre_compile.c
+++ b/ext/pcre/pcrelib/pcre_compile.c
@@ -42,6 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
supporting internal functions that are not used by other modules. */
+#define NLBLOCK cd /* The block containing newline information */
#include "pcre_internal.h"
@@ -190,7 +191,7 @@ static const char *error_texts[] = {
"unrecognized character after (?<",
/* 25 */
"lookbehind assertion is not fixed length",
- "malformed number after (?(",
+ "malformed number or name after (?(",
"conditional group contains more than two branches",
"assertion expected after (?(",
"(?R or (?digits must be followed by )",
@@ -210,12 +211,17 @@ static const char *error_texts[] = {
"recursive call could loop indefinitely",
"unrecognized character after (?P",
"syntax error after (?P",
- "two named groups have the same name",
+ "two named subpatterns 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"
+ "unknown property name after \\P or \\p",
+ "subpattern name is too long (maximum 32 characters)",
+ "too many named subpatterns (maximum 10,000)",
+ /* 50 */
+ "repeated subpattern is too long",
+ "octal value is greater than \\377 (not in UTF-8 mode)"
};
@@ -460,13 +466,16 @@ else
}
/* \0 always starts an octal number, but we may drop through to here with a
- larger first octal digit. */
+ larger first octal digit. The original code used just to take the least
+ significant 8 bits of octal numbers (I think this is what early Perls used
+ to do). Nowadays we allow for larger numbers in UTF-8 mode, but no more
+ than 3 octal digits. */
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 */
+ if (!utf8 && c > 255) *errorcodeptr = ERR51;
break;
/* \x is complicated. \x{ddd} is a character number which can be greater
@@ -763,6 +772,48 @@ return p;
/*************************************************
+* Find forward referenced named subpattern *
+*************************************************/
+
+/* This function scans along a pattern looking for capturing subpatterns, and
+counting them. If it finds a named pattern that matches the name it is given,
+it returns its number. This is used for forward references to named
+subpatterns. We know that if (?P< is encountered, the name will be terminated
+by '>' because that is checked in the first pass.
+
+Arguments:
+ pointer current position in the pattern
+ count current count of capturing parens
+ name name to seek
+ namelen name length
+
+Returns: the number of the named subpattern, or -1 if not found
+*/
+
+static int
+find_named_parens(const uschar *ptr, int count, const uschar *name, int namelen)
+{
+const uschar *thisname;
+for (; *ptr != 0; ptr++)
+ {
+ if (*ptr == '\\' && ptr[1] != 0) { ptr++; continue; }
+ if (*ptr != '(') continue;
+ if (ptr[1] != '?') { count++; continue; }
+ if (ptr[2] == '(') { ptr += 2; continue; }
+ if (ptr[2] != 'P' || ptr[3] != '<') continue;
+ count++;
+ ptr += 4;
+ thisname = ptr;
+ while (*ptr != '>') ptr++;
+ if (namelen == ptr - thisname && strncmp(name, thisname, namelen) == 0)
+ return count;
+ }
+return -1;
+}
+
+
+
+/*************************************************
* Find first significant op code *
*************************************************/
@@ -917,6 +968,7 @@ for (;;)
case OP_CHAR:
case OP_CHARNC:
+ case OP_NOT:
branchlength++;
cc += 2;
#ifdef SUPPORT_UTF8
@@ -1031,14 +1083,19 @@ 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;
+
+ /* 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. */
+
+ if (c == OP_XCLASS) code += GET(code, 1);
+
+ /* Handle bracketed group */
+
else if (c > OP_BRA)
{
int n = c - OP_BRA;
@@ -1046,17 +1103,16 @@ for (;;)
if (n == number) return (uschar *)code;
code += _pcre_OP_lengths[OP_BRA];
}
+
+ /* Otherwise, we get the item's length from the table. 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. */
+
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:
@@ -1072,16 +1128,7 @@ for (;;)
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
}
}
}
@@ -1105,30 +1152,34 @@ 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;
+ if (c == OP_RECURSE) return code;
+
+ /* 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. */
+
+ if (c == OP_XCLASS) code += GET(code, 1);
+
+ /* All bracketed groups have the same length. */
+
else if (c > OP_BRA)
{
code += _pcre_OP_lengths[OP_BRA];
}
+
+ /* Otherwise, we get the item's length from the table. 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. */
+
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:
@@ -1144,16 +1195,7 @@ for (;;)
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
}
}
}
@@ -1569,7 +1611,6 @@ 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;
@@ -1683,10 +1724,14 @@ for (;; ptr++)
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 */
+ while (*(++ptr) != 0) if (IS_NEWLINE(ptr)) break;
+ if (*ptr != 0)
+ {
+ ptr += cd->nllen - 1;
+ continue;
+ }
+ /* Else fall through to handle end of string */
+ c = 0;
}
}
@@ -2851,37 +2896,91 @@ for (;; ptr++)
case '(':
bravalue = OP_COND; /* Conditional group */
- /* Condition to test for recursion */
-
- if (ptr[1] == 'R')
+ /* A condition can be a number, referring to a numbered group, a name,
+ referring to a named group, 'R', referring to recursion, or an
+ assertion. There are two unfortunate ambiguities, caused by history.
+ (a) 'R' can be the recursive thing or the name 'R', and (b) a number
+ could be a name that consists of digits. In both cases, we look for a
+ name first; if not found, we try the other cases. If the first
+ character after (?( is a word character, we know the rest up to ) will
+ also be word characters because the syntax was checked in the first
+ pass. */
+
+ if ((cd->ctypes[ptr[1]] & ctype_word) != 0)
{
- code[1+LINK_SIZE] = OP_CREF;
- PUT2(code, 2+LINK_SIZE, CREF_RECURSE);
+ int i, namelen;
+ int condref = 0;
+ const uschar *name;
+ uschar *slot = cd->name_table;
+
+ /* This is needed for all successful cases. */
+
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. */
+ /* Read the name, but also get it as a number if it's all digits */
- 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)
+ name = ++ptr;
+ while (*ptr != ')')
{
- *errorcodeptr = ERR35;
- goto FAILED;
+ if (condref >= 0)
+ condref = ((digitab[*ptr] & ctype_digit) != 0)?
+ condref * 10 + *ptr - '0' : -1;
+ ptr++;
}
+ namelen = ptr - name;
ptr++;
- code[1+LINK_SIZE] = OP_CREF;
- PUT2(code, 2+LINK_SIZE, condref);
- skipbytes = 3;
+
+ for (i = 0; i < cd->names_found; i++)
+ {
+ if (strncmp((char *)name, (char *)slot+2, namelen) == 0) break;
+ slot += cd->name_entry_size;
+ }
+
+ /* Found a previous named subpattern */
+
+ if (i < cd->names_found)
+ {
+ condref = GET2(slot, 0);
+ code[1+LINK_SIZE] = OP_CREF;
+ PUT2(code, 2+LINK_SIZE, condref);
+ }
+
+ /* Search the pattern for a forward reference */
+
+ else if ((i = find_named_parens(ptr, *brackets, name, namelen)) > 0)
+ {
+ code[1+LINK_SIZE] = OP_CREF;
+ PUT2(code, 2+LINK_SIZE, i);
+ }
+
+ /* Check for 'R' for recursion */
+
+ else if (namelen == 1 && *name == 'R')
+ {
+ code[1+LINK_SIZE] = OP_CREF;
+ PUT2(code, 2+LINK_SIZE, CREF_RECURSE);
+ }
+
+ /* Check for a subpattern number */
+
+ else if (condref > 0)
+ {
+ code[1+LINK_SIZE] = OP_CREF;
+ PUT2(code, 2+LINK_SIZE, condref);
+ }
+
+ /* Either an unidentified subpattern, or a reference to (?(0) */
+
+ else
+ {
+ *errorcodeptr = (condref == 0)? ERR35: ERR15;
+ goto FAILED;
+ }
}
+
/* For conditions that are assertions, we just fall through, having
set bravalue above. */
+
break;
case '=': /* Positive lookahead */
@@ -2953,10 +3052,13 @@ for (;; ptr++)
{
if (slot[2+namelen] == 0)
{
- *errorcodeptr = ERR43;
- goto FAILED;
+ if ((options & PCRE_DUPNAMES) == 0)
+ {
+ *errorcodeptr = ERR43;
+ goto FAILED;
+ }
}
- crc = -1; /* Current name is substring */
+ else crc = -1; /* Current name is substring */
}
if (crc < 0)
{
@@ -2989,14 +3091,18 @@ for (;; ptr++)
if (strncmp((char *)name, (char *)slot+2, namelen) == 0) break;
slot += cd->name_entry_size;
}
- if (i >= cd->names_found)
+
+ if (i < cd->names_found) /* Back reference */
+ {
+ recno = GET2(slot, 0);
+ }
+ else if ((recno = /* Forward back reference */
+ find_named_parens(ptr, *brackets, name, namelen)) <= 0)
{
*errorcodeptr = ERR15;
goto FAILED;
}
- recno = GET2(slot, 0);
-
if (type == '>') goto HANDLE_RECURSION; /* A few lines below */
/* Back reference */
@@ -3036,9 +3142,8 @@ for (;; ptr++)
regex in case it doesn't exist. */
*code = OP_END;
- called = (recno == 0)?
- cd->start_code : find_bracket(cd->start_code, utf8, recno);
-
+ called = (recno == 0)? cd->start_code :
+ find_bracket(cd->start_code, utf8, recno);
if (called == NULL)
{
*errorcodeptr = ERR15;
@@ -3085,6 +3190,7 @@ for (;; ptr++)
case '-': optset = &unset; break;
case 'i': *optset |= PCRE_CASELESS; break;
+ case 'J': *optset |= PCRE_DUPNAMES; break;
case 'm': *optset |= PCRE_MULTILINE; break;
case 's': *optset |= PCRE_DOTALL; break;
case 'x': *optset |= PCRE_EXTENDED; break;
@@ -3201,7 +3307,7 @@ for (;; ptr++)
else if (bravalue == OP_COND)
{
uschar *tc = code;
- condcount = 0;
+ int condcount = 0;
do {
condcount++;
@@ -3906,13 +4012,14 @@ return pcre_compile2(pattern, options, NULL, errorptr, erroroffset, tables);
}
+
PCRE_DATA_SCOPE 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 c, firstbyte, reqbyte, newline;
int bracount = 0;
int branch_extra = 0;
int branch_newextra;
@@ -3933,6 +4040,7 @@ uschar *code;
const uschar *codestart;
const uschar *ptr;
compile_data compile_block;
+compile_data *cd = &compile_block;
int brastack[BRASTACK_SIZE];
uschar bralenstack[BRASTACK_SIZE];
@@ -3986,18 +4094,42 @@ if ((options & ~PUBLIC_OPTIONS) != 0)
/* 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;
+cd->lcc = tables + lcc_offset;
+cd->fcc = tables + fcc_offset;
+cd->cbits = tables + cbits_offset;
+cd->ctypes = tables + ctypes_offset;
+
+/* Handle different types of newline. The two bits give four cases. The current
+code allows for one- or two-byte sequences. */
+
+switch (options & PCRE_NEWLINE_CRLF)
+ {
+ default: newline = NEWLINE; break; /* Compile-time default */
+ case PCRE_NEWLINE_CR: newline = '\r'; break;
+ case PCRE_NEWLINE_LF: newline = '\n'; break;
+ case PCRE_NEWLINE_CR+
+ PCRE_NEWLINE_LF: newline = ('\r' << 8) | '\n'; break;
+ }
+
+if (newline > 255)
+ {
+ cd->nllen = 2;
+ cd->nl[0] = (newline >> 8) & 255;
+ cd->nl[1] = newline & 255;
+ }
+else
+ {
+ cd->nllen = 1;
+ cd->nl[0] = newline;
+ }
/* 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;
+cd->top_backref = 0;
+cd->backref_map = 0;
/* Reflect pattern for debugging output */
@@ -4031,14 +4163,16 @@ while ((c = *(++ptr)) != 0)
if ((options & PCRE_EXTENDED) != 0)
{
- if ((compile_block.ctypes[c] & ctype_space) != 0) continue;
+ 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) break;
- continue;
+ while (*(++ptr) != 0) if (IS_NEWLINE(ptr)) break;
+ if (*ptr != 0)
+ {
+ ptr += cd->nllen - 1;
+ continue;
+ }
+ break; /* End loop at end of pattern */
}
}
@@ -4128,9 +4262,9 @@ while ((c = *(++ptr)) != 0)
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;
+ cd->backref_map |= (refnum < 32)? (1 << refnum) : 1;
+ if (refnum > cd->top_backref)
+ cd->top_backref = refnum;
length += 2; /* For single back reference */
if (ptr[1] == '{' && is_counted_repeat(ptr+2))
{
@@ -4284,7 +4418,9 @@ while ((c = *(++ptr)) != 0)
/* 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))
+ else if (*ptr == '[' &&
+ (ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') &&
+ check_posix_syntax(ptr, &ptr, cd))
{
ptr++;
class_optcount = 10; /* Make sure > 1 */
@@ -4517,6 +4653,61 @@ while ((c = *(++ptr)) != 0)
ptr += 2;
break;
+ /* 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 ((cd->ctypes[*ptr] & ctype_word) != 0) ptr++;
+ if (*ptr != '>')
+ {
+ errorcode = ERR42;
+ goto PCRE_ERROR_RETURN;
+ }
+ name_count++;
+ if (name_count > MAX_NAME_COUNT)
+ {
+ errorcode = ERR49;
+ goto PCRE_ERROR_RETURN;
+ }
+ if (ptr - p > max_name_size)
+ {
+ max_name_size = (ptr - p);
+ if (max_name_size > MAX_NAME_SIZE)
+ {
+ errorcode = ERR48;
+ goto PCRE_ERROR_RETURN;
+ }
+ }
+ capturing = TRUE; /* Named parentheses are always capturing */
+ break; /* Go handle capturing parentheses */
+ }
+
+ /* Handle back references and recursive calls to named subpatterns */
+
+ if (*ptr == '=' || *ptr == '>')
+ {
+ length += 3 + 3*LINK_SIZE; /* Allow for the automatic "once" */
+ while ((cd->ctypes[*(++ptr)] & ctype_word) != 0);
+ if (*ptr != ')')
+ {
+ errorcode = ERR42;
+ goto PCRE_ERROR_RETURN;
+ }
+ goto RECURSE_CHECK_QUANTIFIED;
+ }
+
+ /* Unknown character after (?P */
+
+ errorcode = ERR41;
+ goto PCRE_ERROR_RETURN;
+
/* (?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}).
@@ -4542,8 +4733,10 @@ while ((c = *(++ptr)) != 0)
/* 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. */
+ code that handles this for real brackets. Come here from code for
+ named recursions/subroutines. */
+ RECURSE_CHECK_QUANTIFIED:
if (ptr[1] == '+' || ptr[1] == '*' || ptr[1] == '?' || ptr[1] == '{')
{
length += 2 + 2 * LINK_SIZE; /* to make bracketed */
@@ -4567,48 +4760,6 @@ while ((c = *(++ptr)) != 0)
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 == '>')
- {
- length += 2 + 2*LINK_SIZE; /* Allow for the automatic "once" */
- 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 '<':
@@ -4624,19 +4775,17 @@ while ((c = *(++ptr)) != 0)
/* 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. */
+ group. PCRE extends this by allowing a name to reference a named group;
+ unfortunately, previously 'R' was implemented for a recursion test.
+ When this is compiled, we look for the named group 'R' first. At this
+ point we just do a basic syntax check. */
case '(':
- if (ptr[3] == 'R' && ptr[4] == ')')
- {
- ptr += 4;
- length += 3;
- }
- else if ((digitab[ptr[3]] & ctype_digit) != 0)
+ if ((cd->ctypes[ptr[3]] & ctype_word) != 0)
{
ptr += 4;
length += 3;
- while ((digitab[*ptr] & ctype_digit) != 0) ptr++;
+ while ((cd->ctypes[*ptr] & ctype_word) != 0) ptr++;
if (*ptr != ')')
{
errorcode = ERR26;
@@ -4675,6 +4824,11 @@ while ((c = *(++ptr)) != 0)
*optset |= PCRE_CASELESS;
continue;
+ case 'J':
+ *optset |= PCRE_DUPNAMES;
+ options |= PCRE_JCHANGED; /* Record that it changed */
+ continue;
+
case 'm':
*optset |= PCRE_MULTILINE;
continue;
@@ -4740,16 +4894,13 @@ while ((c = *(++ptr)) != 0)
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. */
+ branch_newextra to 2. */
case ':':
if (((set|unset) & PCRE_IMS) != 0)
{
length += 4;
branch_newextra = 2;
- if (((set|unset) & PCRE_CASELESS) != 0) options |= PCRE_ICHANGED;
}
goto END_OPTIONS;
@@ -4829,6 +4980,12 @@ while ((c = *(++ptr)) != 0)
{
duplength = length - brastack[--brastackptr];
branch_extra = bralenstack[brastackptr];
+ /* This is a paranoid check to stop integer overflow later on */
+ if (duplength > MAX_DUPLENGTH)
+ {
+ errorcode = ERR50;
+ goto PCRE_ERROR_RETURN;
+ }
}
else duplength = 0;
@@ -4933,7 +5090,8 @@ if (length > MAX_PATTERN_SIZE)
}
/* Compute the size of data block needed and get it, either from malloc or
-externally provided function. */
+externally provided function. Integer overflow should no longer be possible
+because nowadays we limit the maximum value of name_count and max_name size. */
size = length + sizeof(real_pcre) + name_count * (max_name_size + 3);
re = (real_pcre *)(pcre_malloc)(size);
@@ -4963,14 +5121,14 @@ 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;
+cd->names_found = 0;
+cd->name_entry_size = max_name_size + 3;
+cd->name_table = (uschar *)re + re->name_table_offset;
+codestart = cd->name_table + re->name_entry_size * re->name_count;
+cd->start_code = codestart;
+cd->start_pattern = (const uschar *)pattern;
+cd->req_varyopt = 0;
+cd->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
@@ -4981,11 +5139,11 @@ 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);
+ &errorcode, FALSE, 0, &firstbyte, &reqbyte, NULL, cd);
re->top_bracket = bracount;
-re->top_backref = compile_block.top_backref;
+re->top_backref = cd->top_backref;
-if (compile_block.nopartial) re->options |= PCRE_NOPARTIAL;
+if (cd->nopartial) re->options |= PCRE_NOPARTIAL;
/* If not reached end of pattern on success, there's an excess bracket. */
@@ -5031,7 +5189,7 @@ 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))
+ if (is_anchored(codestart, &temp_options, 0, cd->backref_map))
re->options |= PCRE_ANCHORED;
else
{
@@ -5041,10 +5199,10 @@ if ((options & PCRE_ANCHORED) == 0)
{
int ch = firstbyte & 255;
re->first_byte = ((firstbyte & REQ_CASELESS) != 0 &&
- compile_block.fcc[ch] == ch)? ch : firstbyte;
+ cd->fcc[ch] == ch)? ch : firstbyte;
re->options |= PCRE_FIRSTSET;
}
- else if (is_startline(codestart, 0, compile_block.backref_map))
+ else if (is_startline(codestart, 0, cd->backref_map))
re->options |= PCRE_STARTLINE;
}
}
@@ -5058,7 +5216,7 @@ if (reqbyte >= 0 &&
{
int ch = reqbyte & 255;
re->req_byte = ((reqbyte & REQ_CASELESS) != 0 &&
- compile_block.fcc[ch] == ch)? (reqbyte & ~REQ_CASELESS) : reqbyte;
+ cd->fcc[ch] == ch)? (reqbyte & ~REQ_CASELESS) : reqbyte;
re->options |= PCRE_REQCHSET;
}
@@ -5072,11 +5230,10 @@ printf("Length = %d top_bracket = %d top_backref = %d\n",
if (re->options != 0)
{
- printf("%s%s%s%s%s%s%s%s%s%s\n",
+ printf("%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 " : "",
diff --git a/ext/pcre/pcrelib/pcre_dfa_exec.c b/ext/pcre/pcrelib/pcre_dfa_exec.c
deleted file mode 100644
index b5e01dac3..000000000
--- a/ext/pcre/pcrelib/pcre_dfa_exec.c
+++ /dev/null
@@ -1,2027 +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-2006 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;
-
-#ifdef SUPPORT_UTF8
-BOOL utf8 = (md->poptions & PCRE_UTF8) != 0;
-#endif
-
-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, script;
-
-#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)
- {
- BOOL OK;
- int category = _pcre_ucp_findprop(c, &chartype, &script);
- switch(code[1])
- {
- case PT_ANY:
- OK = TRUE;
- break;
-
- case PT_LAMP:
- OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt;
- break;
-
- case PT_GC:
- OK = category == code[2];
- break;
-
- case PT_PC:
- OK = chartype == code[2];
- break;
-
- case PT_SC:
- OK = script == code[2];
- break;
-
- /* Should never occur, but keep compilers from grumbling. */
-
- default:
- OK = codevalue != OP_PROP;
- break;
- }
-
- if (OK == (codevalue == OP_PROP)) { ADD_NEW(state_offset + 3, 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 + 4, 0); }
- if (clen > 0)
- {
- BOOL OK;
- int category = _pcre_ucp_findprop(c, &chartype, &script);
- switch(code[2])
- {
- case PT_ANY:
- OK = TRUE;
- break;
-
- case PT_LAMP:
- OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt;
- break;
-
- case PT_GC:
- OK = category == code[3];
- break;
-
- case PT_PC:
- OK = chartype == code[3];
- break;
-
- case PT_SC:
- OK = script == code[3];
- break;
-
- /* Should never occur, but keep compilers from grumbling. */
-
- default:
- OK = codevalue != OP_PROP;
- break;
- }
-
- if (OK == (d == OP_PROP)) { 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 && _pcre_ucp_findprop(c, &chartype, &script) != ucp_M)
- {
- const uschar *nptr = ptr + clen;
- int ncount = 0;
- while (nptr < end_subject)
- {
- int nd;
- int ndlen = 1;
- GETCHARLEN(nd, nptr, ndlen);
- if (_pcre_ucp_findprop(nd, &chartype, &script) != 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 = 4;
- goto QS1;
-
- case OP_PROP_EXTRA + OP_TYPESTAR:
- case OP_PROP_EXTRA + OP_TYPEMINSTAR:
- count = 0;
-
- QS1:
-
- ADD_ACTIVE(state_offset + 4, 0);
- if (clen > 0)
- {
- BOOL OK;
- int category = _pcre_ucp_findprop(c, &chartype, &script);
- switch(code[2])
- {
- case PT_ANY:
- OK = TRUE;
- break;
-
- case PT_LAMP:
- OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt;
- break;
-
- case PT_GC:
- OK = category == code[3];
- break;
-
- case PT_PC:
- OK = chartype == code[3];
- break;
-
- case PT_SC:
- OK = script == code[3];
- break;
-
- /* Should never occur, but keep compilers from grumbling. */
-
- default:
- OK = codevalue != OP_PROP;
- break;
- }
-
- if (OK == (d == OP_PROP)) { 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 && _pcre_ucp_findprop(c, &chartype, &script) != ucp_M)
- {
- const uschar *nptr = ptr + clen;
- int ncount = 0;
- while (nptr < end_subject)
- {
- int nd;
- int ndlen = 1;
- GETCHARLEN(nd, nptr, ndlen);
- if (_pcre_ucp_findprop(nd, &chartype, &script) != 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 + 6, 0); }
- count = current_state->count; /* Number already matched */
- if (clen > 0)
- {
- BOOL OK;
- int category = _pcre_ucp_findprop(c, &chartype, &script);
- switch(code[4])
- {
- case PT_ANY:
- OK = TRUE;
- break;
-
- case PT_LAMP:
- OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt;
- break;
-
- case PT_GC:
- OK = category == code[5];
- break;
-
- case PT_PC:
- OK = chartype == code[5];
- break;
-
- case PT_SC:
- OK = script == code[5];
- break;
-
- /* Should never occur, but keep compilers from grumbling. */
-
- default:
- OK = codevalue != OP_PROP;
- break;
- }
-
- if (OK == (d == OP_PROP))
- {
- if (++count >= GET2(code, 1))
- { ADD_NEW(state_offset + 6, 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 && _pcre_ucp_findprop(c, &chartype, &script) != ucp_M)
- {
- const uschar *nptr = ptr + clen;
- int ncount = 0;
- while (nptr < end_subject)
- {
- int nd;
- int ndlen = 1;
- GETCHARLEN(nd, nptr, ndlen);
- if (_pcre_ucp_findprop(nd, &chartype, &script) != 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
- {
- int othercase;
- 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. */
-
-#ifdef SUPPORT_UCP
- othercase = _pcre_ucp_othercase(c);
-#else
- othercase = -1;
-#endif
-
- 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 && _pcre_ucp_findprop(c, &chartype, &script) != ucp_M)
- {
- const uschar *nptr = ptr + clen;
- int ncount = 0;
- while (nptr < end_subject)
- {
- int nclen = 1;
- GETCHARLEN(c, nptr, nclen);
- if (_pcre_ucp_findprop(c, &chartype, &script) != 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 && d >= 128)
- {
-#ifdef SUPPORT_UCP
- otherd = _pcre_ucp_othercase(d);
-#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 && d >= 128)
- {
-#ifdef SUPPORT_UCP
- otherd = _pcre_ucp_othercase(d);
-#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 && d >= 128)
- {
-#ifdef SUPPORT_UCP
- otherd = _pcre_ucp_othercase(d);
-#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 && d >= 128)
- {
-#ifdef SUPPORT_UCP
- otherd = _pcre_ucp_othercase(d);
-#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 = (PCRE_SPTR)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
-*/
-
-PCRE_DATA_SCOPE 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_MATCH_LIMIT_RECURSION) != 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|PCRE_DFA_RESTART)) != 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
index ecb32977d..882a1d1c0 100644
--- a/ext/pcre/pcrelib/pcre_exec.c
+++ b/ext/pcre/pcrelib/pcre_exec.c
@@ -42,7 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
pattern matching using an NFA algorithm, trying to mimic Perl as closely as
possible. There are also some static supporting functions. */
-
+#define NLBLOCK md /* The block containing newline information */
#include "pcre_internal.h"
@@ -275,7 +275,7 @@ typedef struct heapframe {
long int Xims;
eptrblock *Xeptrb;
int Xflags;
- int Xrdepth;
+ unsigned int Xrdepth;
/* Function local variables */
@@ -374,16 +374,16 @@ Returns: MATCH_MATCH if matched ) these values are >= 0
static int
match(REGISTER USPTR eptr, REGISTER const uschar *ecode,
int offset_top, match_data *md, unsigned long int ims, eptrblock *eptrb,
- int flags, int rdepth)
+ int flags, unsigned int rdepth)
{
/* 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 */
+register int rrc; /* Returns from recursive calls */
+register int i; /* Used for loops not involving calls to RMATCH() */
+register unsigned 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
@@ -527,6 +527,13 @@ prop_fail_result = 0;
prop_test_variable = NULL;
#endif
+/* This label is used for tail recursion, which is used in a few cases even
+when NO_RECURSE is not defined, in order to reduce the amount of stack that is
+used. Thanks to Ian Taylor for noticing this possibility and sending the
+original patch. */
+
+TAIL_RECURSE:
+
/* OK, now we can get on with the real code of the function. Recursive calls
are specified by the macro RMATCH and RRETURN is used to return. When
NO_RECURSE is *not* defined, these just turn into a recursive call to match()
@@ -542,7 +549,12 @@ if (md->match_call_count++ >= md->match_limit) RRETURN(PCRE_ERROR_MATCHLIMIT);
if (rdepth >= md->match_limit_recursion) RRETURN(PCRE_ERROR_RECURSIONLIMIT);
original_ims = ims; /* Save for resetting on ')' */
+
+#ifdef SUPPORT_UTF8
utf8 = md->utf8; /* Local copy of the flag */
+#else
+utf8 = FALSE;
+#endif
/* 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
@@ -642,21 +654,38 @@ for (;;)
{
case OP_BRA: /* Non-capturing bracket: optimized */
DPRINTF(("start bracket 0\n"));
- do
+
+ /* Loop for all the alternatives */
+
+ for (;;)
{
+ /* When we get to the final alternative within the brackets, we would
+ return the result of a recursive call to match() whatever happened. We
+ can reduce stack usage by turning this into a tail recursion. */
+
+ if (ecode[GET(ecode, 1)] != OP_ALT)
+ {
+ ecode += 1 + LINK_SIZE;
+ flags = match_isgroup;
+ DPRINTF(("bracket 0 tail recursion\n"));
+ goto TAIL_RECURSE;
+ }
+
+ /* For non-final alternatives, continue the loop for a NOMATCH result;
+ otherwise return. */
+
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);
+ /* Control never reaches here. */
/* 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. */
+ exactly what going to the ket would do. As there is only one branch to be
+ obeyed, we can use tail recursion to avoid using another stack frame. */
case OP_COND:
if (ecode[LINK_SIZE+1] == OP_CREF) /* Condition extract or recurse test */
@@ -665,10 +694,9 @@ for (;;)
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);
+ ecode += condition? (LINK_SIZE + 4) : (LINK_SIZE + 1 + GET(ecode, 1));
+ flags = match_isgroup;
+ goto TAIL_RECURSE;
}
/* The condition is an assertion. Call match() to evaluate it - setting
@@ -688,9 +716,13 @@ for (;;)
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);
+
+ /* We are now at the branch that is to be obeyed. As there is only one,
+ we can use tail recursion to avoid using another stack frame. */
+
+ ecode += 1 + LINK_SIZE;
+ flags = match_isgroup;
+ goto TAIL_RECURSE;
}
/* Control never reaches here */
@@ -945,71 +977,72 @@ for (;;)
the end of a normal bracket, leaving the subject pointer. */
case OP_ONCE:
- {
- prev = ecode;
- saved_eptr = eptr;
+ 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);
+ 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 hit the end of the group (which could be repeated), fail */
- if (*ecode != OP_ONCE && *ecode != OP_ALT) RRETURN(MATCH_NOMATCH);
+ 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. */
+ /* 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);
+ do ecode += GET(ecode,1); while (*ecode == OP_ALT);
- offset_top = md->end_offset_top;
- eptr = md->end_match_ptr;
+ 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. */
+ /* 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;
- }
+ 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. */
+ /* The repeating kets try the rest of the pattern or restart from the
+ preceding bracket, in the appropriate order. The second "call" of match()
+ uses tail recursion, to avoid using another stack frame. 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[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);
- }
+ if (*ecode == OP_KETRMIN)
+ {
+ RMATCH(rrc, eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ ecode = prev;
+ flags = match_isgroup;
+ goto TAIL_RECURSE;
+ }
+ else /* OP_KETRMAX */
+ {
+ RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ ecode += 1 + LINK_SIZE;
+ flags = 0;
+ goto TAIL_RECURSE;
}
- RRETURN(MATCH_NOMATCH);
+ /* Control never gets here */
/* An alternation is the end of a branch; scan along to find the end of the
bracketed group and go to there. */
@@ -1053,114 +1086,114 @@ for (;;)
case OP_KET:
case OP_KETRMIN:
case OP_KETRMAX:
- {
- prev = ecode - GET(ecode, 1);
- saved_eptr = eptrb->epb_saved_eptr;
+ prev = ecode - GET(ecode, 1);
+ saved_eptr = eptrb->epb_saved_eptr;
- /* Back up the stack of bracket start pointers. */
+ /* Back up the stack of bracket start pointers. */
- eptrb = eptrb->epb_prev;
+ 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);
- }
+ 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. */
+ /* 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;
+ 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. */
+ /* 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;
+ if (number > EXTRACT_BASIC_MAX) number = GET2(prev, 2+LINK_SIZE);
+ offset = number << 1;
#ifdef DEBUG
- printf("end bracket %d", number);
- printf("\n");
+ 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. */
+ /* 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)
+ if (number > 0)
+ {
+ md->capture_last = number;
+ if (offset >= md->offset_max) md->offset_overflow = TRUE; else
{
- 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;
- }
+ 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. */
+ /* 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;
- }
+ 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. */
+ /* 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));
+ 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. */
+ /* 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;
- }
+ 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. */
+ /* The repeating kets try the rest of the pattern or restart from the
+ preceding bracket, in the appropriate order. In the second case, we can use
+ tail recursion to avoid using another stack frame. */
- 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);
- }
+ if (*ecode == OP_KETRMIN)
+ {
+ RMATCH(rrc, eptr, ecode + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ ecode = prev;
+ flags = match_isgroup;
+ goto TAIL_RECURSE;
}
-
- RRETURN(MATCH_NOMATCH);
+ else /* OP_KETRMAX */
+ {
+ RMATCH(rrc, eptr, prev, offset_top, md, ims, eptrb, match_isgroup);
+ if (rrc != MATCH_NOMATCH) RRETURN(rrc);
+ ecode += 1 + LINK_SIZE;
+ flags = 0;
+ goto TAIL_RECURSE;
+ }
+ /* Control never gets here */
/* Start of subject unless notbol, or after internal newline if multiline */
@@ -1168,7 +1201,10 @@ for (;;)
if (md->notbol && eptr == md->start_subject) RRETURN(MATCH_NOMATCH);
if ((ims & PCRE_MULTILINE) != 0)
{
- if (eptr != md->start_subject && eptr[-1] != NEWLINE)
+ if (eptr != md->start_subject &&
+ (eptr == md->end_subject ||
+ eptr < md->start_subject + md->nllen ||
+ !IS_NEWLINE(eptr - md->nllen)))
RRETURN(MATCH_NOMATCH);
ecode++;
break;
@@ -1196,7 +1232,7 @@ for (;;)
if ((ims & PCRE_MULTILINE) != 0)
{
if (eptr < md->end_subject)
- { if (*eptr != NEWLINE) RRETURN(MATCH_NOMATCH); }
+ { if (!IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); }
else
{ if (md->noteol) RRETURN(MATCH_NOMATCH); }
ecode++;
@@ -1207,14 +1243,14 @@ for (;;)
if (md->noteol) RRETURN(MATCH_NOMATCH);
if (!md->endonly)
{
- if (eptr < md->end_subject - 1 ||
- (eptr == md->end_subject - 1 && *eptr != NEWLINE))
+ if (eptr != md->end_subject &&
+ (eptr != md->end_subject - md->nllen || !IS_NEWLINE(eptr)))
RRETURN(MATCH_NOMATCH);
ecode++;
break;
}
}
- /* ... else fall through */
+ /* ... else fall through for endonly */
/* End of subject assertion (\z) */
@@ -1226,8 +1262,9 @@ for (;;)
/* 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);
+ if (eptr != md->end_subject &&
+ (eptr != md->end_subject - md->nllen || !IS_NEWLINE(eptr)))
+ RRETURN(MATCH_NOMATCH);
ecode++;
break;
@@ -1280,13 +1317,14 @@ for (;;)
/* 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 ((ims & PCRE_DOTALL) == 0)
+ {
+ if (eptr <= md->end_subject - md->nllen && IS_NEWLINE(eptr))
+ 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;
@@ -2573,8 +2611,11 @@ for (;;)
for (i = 1; i <= min; i++)
{
if (eptr >= md->end_subject ||
- (*eptr++ == NEWLINE && (ims & PCRE_DOTALL) == 0))
+ ((ims & PCRE_DOTALL) == 0 &&
+ eptr <= md->end_subject - md->nllen &&
+ IS_NEWLINE(eptr)))
RRETURN(MATCH_NOMATCH);
+ eptr++;
while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;
}
break;
@@ -2659,7 +2700,11 @@ for (;;)
if ((ims & PCRE_DOTALL) == 0)
{
for (i = 1; i <= min; i++)
- if (*eptr++ == NEWLINE) RRETURN(MATCH_NOMATCH);
+ {
+ if (eptr <= md->end_subject - md->nllen && IS_NEWLINE(eptr))
+ RRETURN(MATCH_NOMATCH);
+ eptr++;
+ }
}
else eptr += min;
break;
@@ -2829,13 +2874,15 @@ for (;;)
{
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 (fi >= max || eptr >= md->end_subject ||
+ (ctype == OP_ANY && (ims & PCRE_DOTALL) == 0 &&
+ eptr <= md->end_subject - md->nllen && IS_NEWLINE(eptr)))
+ RRETURN(MATCH_NOMATCH);
GETCHARINC(c, eptr);
switch(ctype)
{
- case OP_ANY:
- if ((ims & PCRE_DOTALL) == 0 && c == NEWLINE) RRETURN(MATCH_NOMATCH);
+ case OP_ANY: /* This is the DOTALL case */
break;
case OP_ANYBYTE:
@@ -2884,12 +2931,15 @@ for (;;)
{
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 (fi >= max || eptr >= md->end_subject ||
+ ((ims & PCRE_DOTALL) == 0 &&
+ eptr <= md->end_subject - md->nllen && IS_NEWLINE(eptr)))
+ RRETURN(MATCH_NOMATCH);
+
c = *eptr++;
switch(ctype)
{
- case OP_ANY:
- if ((ims & PCRE_DOTALL) == 0 && c == NEWLINE) RRETURN(MATCH_NOMATCH);
+ case OP_ANY: /* This is the DOTALL case */
break;
case OP_ANYBYTE:
@@ -3075,9 +3125,9 @@ for (;;)
{
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. */
+ /* 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)
{
@@ -3085,7 +3135,9 @@ for (;;)
{
for (i = min; i < max; i++)
{
- if (eptr >= md->end_subject || *eptr == NEWLINE) break;
+ if (eptr >= md->end_subject ||
+ (eptr <= md->end_subject - md->nllen && IS_NEWLINE(eptr)))
+ break;
eptr++;
while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;
}
@@ -3094,6 +3146,7 @@ for (;;)
{
for (i = min; i < max; i++)
{
+ if (eptr >= md->end_subject) break;
eptr++;
while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++;
}
@@ -3108,7 +3161,9 @@ for (;;)
{
for (i = min; i < max; i++)
{
- if (eptr >= md->end_subject || *eptr == NEWLINE) break;
+ if (eptr >= md->end_subject ||
+ (eptr <= md->end_subject - md->nllen && IS_NEWLINE(eptr)))
+ break;
eptr++;
}
break;
@@ -3222,7 +3277,9 @@ for (;;)
{
for (i = min; i < max; i++)
{
- if (eptr >= md->end_subject || *eptr == NEWLINE) break;
+ if (eptr >= md->end_subject ||
+ (eptr <= md->end_subject - md->nllen && IS_NEWLINE(eptr)))
+ break;
eptr++;
}
break;
@@ -3419,7 +3476,8 @@ int rc, resetcount, ocount;
int first_byte = -1;
int req_byte = -1;
int req_byte2 = -1;
-unsigned long int ims = 0;
+int newline;
+unsigned long int ims;
BOOL using_temporary_offsets = FALSE;
BOOL anchored;
BOOL startline;
@@ -3427,6 +3485,7 @@ BOOL firstline;
BOOL first_byte_caseless = FALSE;
BOOL req_byte_caseless = FALSE;
match_data match_block;
+match_data *md = &match_block;
const uschar *tables;
const uschar *start_bits = NULL;
USPTR start_match = (USPTR)subject + start_offset;
@@ -3451,9 +3510,9 @@ if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;
the default values. */
study = NULL;
-match_block.match_limit = MATCH_LIMIT;
-match_block.match_limit_recursion = MATCH_LIMIT_RECURSION;
-match_block.callout_data = NULL;
+md->match_limit = MATCH_LIMIT;
+md->match_limit_recursion = MATCH_LIMIT_RECURSION;
+md->callout_data = NULL;
/* The table pointer is always in native byte order. */
@@ -3465,11 +3524,11 @@ if (extra_data != NULL)
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;
+ md->match_limit = extra_data->match_limit;
if ((flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION) != 0)
- match_block.match_limit_recursion = extra_data->match_limit_recursion;
+ md->match_limit_recursion = extra_data->match_limit_recursion;
if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0)
- match_block.callout_data = extra_data->callout_data;
+ md->callout_data = extra_data->callout_data;
if ((flags & PCRE_EXTRA_TABLES) != 0) tables = extra_data->tables;
}
@@ -3499,39 +3558,64 @@ 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 +
+md->start_code = (const uschar *)external_re + re->name_table_offset +
re->name_count * re->name_entry_size;
-match_block.start_subject = (USPTR)subject;
-match_block.start_offset = start_offset;
-match_block.end_subject = match_block.start_subject + length;
-end_subject = match_block.end_subject;
+md->start_subject = (USPTR)subject;
+md->start_offset = start_offset;
+md->end_subject = md->start_subject + length;
+end_subject = md->end_subject;
+
+md->endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0;
+md->utf8 = (re->options & PCRE_UTF8) != 0;
+
+md->notbol = (options & PCRE_NOTBOL) != 0;
+md->noteol = (options & PCRE_NOTEOL) != 0;
+md->notempty = (options & PCRE_NOTEMPTY) != 0;
+md->partial = (options & PCRE_PARTIAL) != 0;
+md->hitend = FALSE;
+
+md->recursive = NULL; /* No recursion at top level */
-match_block.endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0;
-match_block.utf8 = (re->options & PCRE_UTF8) != 0;
+md->lcc = tables + lcc_offset;
+md->ctypes = tables + ctypes_offset;
-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;
+/* Handle different types of newline. The two bits give four cases. If nothing
+is set at run time, whatever was used at compile time applies. */
-match_block.recursive = NULL; /* No recursion at top level */
+switch ((((options & PCRE_NEWLINE_CRLF) == 0)? re->options : options) &
+ PCRE_NEWLINE_CRLF)
+ {
+ default: newline = NEWLINE; break; /* Compile-time default */
+ case PCRE_NEWLINE_CR: newline = '\r'; break;
+ case PCRE_NEWLINE_LF: newline = '\n'; break;
+ case PCRE_NEWLINE_CR+
+ PCRE_NEWLINE_LF: newline = ('\r' << 8) | '\n'; break;
+ }
-match_block.lcc = tables + lcc_offset;
-match_block.ctypes = tables + ctypes_offset;
+if (newline > 255)
+ {
+ md->nllen = 2;
+ md->nl[0] = (newline >> 8) & 255;
+ md->nl[1] = newline & 255;
+ }
+else
+ {
+ md->nllen = 1;
+ md->nl[0] = newline;
+ }
/* Partial matching is supported only for a restricted set of regexes at the
moment. */
-if (match_block.partial && (re->options & PCRE_NOPARTIAL) != 0)
+if (md->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 (md->utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)
{
if (_pcre_valid_utf8((uschar *)subject, length) >= 0)
return PCRE_ERROR_BADUTF8;
@@ -3563,17 +3647,17 @@ 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;
+ md->offset_vector = (int *)(pcre_malloc)(ocount * sizeof(int));
+ if (md->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;
+else md->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;
+md->offset_end = ocount;
+md->offset_max = (2*ocount)/3;
+md->offset_overflow = FALSE;
+md->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
@@ -3586,9 +3670,9 @@ if (resetcount > offsetcount) resetcount = ocount;
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)
+if (md->offset_vector != NULL)
{
- register int *iptr = match_block.offset_vector + ocount;
+ register int *iptr = md->offset_vector + ocount;
register int *iend = iptr - resetcount/2 + 1;
while (--iptr >= iend) *iptr = -1;
}
@@ -3605,7 +3689,7 @@ if (!anchored)
{
first_byte = re->first_byte & 255;
if ((first_byte_caseless = ((re->first_byte & REQ_CASELESS) != 0)) == TRUE)
- first_byte = match_block.lcc[first_byte];
+ first_byte = md->lcc[first_byte];
}
else
if (!startline && study != NULL &&
@@ -3632,9 +3716,9 @@ do
/* Reset the maximum number of extractions we might see. */
- if (match_block.offset_vector != NULL)
+ if (md->offset_vector != NULL)
{
- register int *iptr = match_block.offset_vector;
+ register int *iptr = md->offset_vector;
register int *iend = iptr + resetcount;
while (iptr < iend) *iptr++ = -1;
}
@@ -3648,7 +3732,7 @@ do
if (firstline)
{
USPTR t = start_match;
- while (t < save_end_subject && *t != '\n') t++;
+ while (t <= save_end_subject - md->nllen && !IS_NEWLINE(t)) t++;
end_subject = t;
}
@@ -3658,20 +3742,22 @@ do
{
if (first_byte_caseless)
while (start_match < end_subject &&
- match_block.lcc[*start_match] != first_byte)
+ md->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 */
+ /* Or to just after a linebreak for a multiline match if possible */
else if (startline)
{
- if (start_match > match_block.start_subject + start_offset)
+ if (start_match >= md->start_subject + md->nllen +
+ start_offset)
{
- while (start_match < end_subject && start_match[-1] != NEWLINE)
+ while (start_match <= end_subject &&
+ !IS_NEWLINE(start_match - md->nllen))
start_match++;
}
}
@@ -3693,7 +3779,7 @@ do
#ifdef DEBUG /* Sigh. Some compilers never learn. */
printf(">>>> Match against: ");
- pchars(start_match, end_subject - start_match, TRUE, &match_block);
+ pchars(start_match, end_subject - start_match, TRUE, md);
printf("\n");
#endif
@@ -3715,7 +3801,7 @@ do
if (req_byte >= 0 &&
end_subject - start_match < REQ_BYTE_MAX &&
- !match_block.partial)
+ !md->partial)
{
register USPTR p = start_match + ((first_byte >= 0)? 1 : 0);
@@ -3759,11 +3845,10 @@ do
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;
+ md->start_match = start_match;
+ md->match_call_count = 0;
- rc = match(start_match, match_block.start_code, 2, &match_block, ims, NULL,
- match_isgroup, 0);
+ rc = match(start_match, md->start_code, 2, md, ims, NULL, match_isgroup, 0);
/* 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
@@ -3774,10 +3859,13 @@ do
if (rc == MATCH_NOMATCH)
{
- if (firstline && *start_match == NEWLINE) break;
+ if (firstline &&
+ start_match <= md->end_subject - md->nllen &&
+ IS_NEWLINE(start_match))
+ break;
start_match++;
#ifdef SUPPORT_UTF8
- if (match_block.utf8)
+ if (md->utf8)
while(start_match < end_subject && (*start_match & 0xc0) == 0x80)
start_match++;
#endif
@@ -3797,23 +3885,23 @@ do
{
if (offsetcount >= 4)
{
- memcpy(offsets + 2, match_block.offset_vector + 2,
+ memcpy(offsets + 2, md->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;
+ if (md->end_offset_top > offsetcount)
+ md->offset_overflow = TRUE;
DPRINTF(("Freeing temporary memory\n"));
- (pcre_free)(match_block.offset_vector);
+ (pcre_free)(md->offset_vector);
}
- rc = match_block.offset_overflow? 0 : match_block.end_offset_top/2;
+ rc = md->offset_overflow? 0 : md->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;
+ offsets[0] = start_match - md->start_subject;
+ offsets[1] = md->end_match_ptr - md->start_subject;
}
DPRINTF((">>>> returning %d\n", rc));
@@ -3827,10 +3915,10 @@ while (!anchored && start_match <= end_subject);
if (using_temporary_offsets)
{
DPRINTF(("Freeing temporary memory\n"));
- (pcre_free)(match_block.offset_vector);
+ (pcre_free)(md->offset_vector);
}
-if (match_block.partial && match_block.hitend)
+if (md->partial && md->hitend)
{
DPRINTF((">>>> returning PCRE_ERROR_PARTIAL\n"));
return PCRE_ERROR_PARTIAL;
diff --git a/ext/pcre/pcrelib/pcre_get.c b/ext/pcre/pcrelib/pcre_get.c
index 674625a0e..0588c61a7 100644
--- a/ext/pcre/pcrelib/pcre_get.c
+++ b/ext/pcre/pcrelib/pcre_get.c
@@ -50,8 +50,8 @@ for these functions came from Scott Wimer. */
* Find number for named string *
*************************************************/
-/* This function is used by the two extraction functions below, as well
-as being generally available.
+/* This function is used by the get_first_set() function below, as well
+as being generally available. It assumes that names are unique.
Arguments:
code the compiled regex
@@ -94,6 +94,113 @@ return PCRE_ERROR_NOSUBSTRING;
/*************************************************
+* Find (multiple) entries for named string *
+*************************************************/
+
+/* This is used by the get_first_set() function below, as well as being
+generally available. It is used when duplicated names are permitted.
+
+Arguments:
+ code the compiled regex
+ stringname the name whose entries required
+ firstptr where to put the pointer to the first entry
+ lastptr where to put the pointer to the last entry
+
+Returns: the length of each entry, or a negative number
+ (PCRE_ERROR_NOSUBSTRING) if not found
+*/
+
+int
+pcre_get_stringtable_entries(const pcre *code, const char *stringname,
+ char **firstptr, char **lastptr)
+{
+int rc;
+int entrysize;
+int top, bot;
+uschar *nametable, *lastentry;
+
+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;
+
+lastentry = nametable + entrysize * (top - 1);
+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)
+ {
+ uschar *first = entry;
+ uschar *last = entry;
+ while (first > nametable)
+ {
+ if (strcmp(stringname, (char *)(first - entrysize + 2)) != 0) break;
+ first -= entrysize;
+ }
+ while (last < lastentry)
+ {
+ if (strcmp(stringname, (char *)(last + entrysize + 2)) != 0) break;
+ last += entrysize;
+ }
+ *firstptr = (char *)first;
+ *lastptr = (char *)last;
+ return entrysize;
+ }
+ if (c > 0) bot = mid + 1; else top = mid;
+ }
+
+return PCRE_ERROR_NOSUBSTRING;
+}
+
+
+
+/*************************************************
+* Find first set of multiple named strings *
+*************************************************/
+
+/* This function allows for duplicate names in the table of named substrings.
+It returns the number of the first one that was set in a pattern match.
+
+Arguments:
+ code the compiled regex
+ stringname the name of the capturing substring
+ ovector the vector of matched substrings
+
+Returns: the number of the first that is set,
+ or the number of the last one if none are set,
+ or a negative number on error
+*/
+
+static int
+get_first_set(const pcre *code, const char *stringname, int *ovector)
+{
+const real_pcre *re = (const real_pcre *)code;
+int entrysize;
+char *first, *last;
+uschar *entry;
+if ((re->options & (PCRE_DUPNAMES | PCRE_JCHANGED)) == 0)
+ return pcre_get_stringnumber(code, stringname);
+entrysize = pcre_get_stringtable_entries(code, stringname, &first, &last);
+if (entrysize <= 0) return entrysize;
+for (entry = (uschar *)first; entry <= (uschar *)last; entry += entrysize)
+ {
+ int n = (entry[0] << 8) + entry[1];
+ if (ovector[n*2] >= 0) return n;
+ }
+return (first[0] << 8) + first[1];
+}
+
+
+
+
+/*************************************************
* Copy captured string to given buffer *
*************************************************/
@@ -142,7 +249,8 @@ return yield;
*************************************************/
/* This function copies a single captured substring into a given buffer,
-identifying it by name.
+identifying it by name. If the regex permits duplicate names, the first
+substring that is set is chosen.
Arguments:
code the compiled regex
@@ -168,7 +276,7 @@ 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);
+int n = get_first_set(code, stringname, ovector);
if (n <= 0) return n;
return pcre_copy_substring(subject, ovector, stringcount, n, buffer, size);
}
@@ -299,7 +407,8 @@ return yield;
*************************************************/
/* This function copies a single captured substring, identified by name, into
-new store.
+new store. If the regex permits duplicate names, the first substring that is
+set is chosen.
Arguments:
code the compiled regex
@@ -324,9 +433,10 @@ 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);
+int n = get_first_set(code, stringname, ovector);
if (n <= 0) return n;
return pcre_get_substring(subject, ovector, stringcount, n, stringptr);
+
}
diff --git a/ext/pcre/pcrelib/pcre_internal.h b/ext/pcre/pcrelib/pcre_internal.h
index 386ed3ddf..6f91020f9 100644
--- a/ext/pcre/pcrelib/pcre_internal.h
+++ b/ext/pcre/pcrelib/pcre_internal.h
@@ -118,6 +118,14 @@ Unix, where it is defined in sys/types, so use "uschar" instead. */
typedef unsigned char uschar;
+/* PCRE is able to support 3 different kinds of newline (CR, LF, CRLF). The
+following macro is used to package up testing for newlines. NLBLOCK is defined
+in the various modules to indicate in which datablock the parameters exist. */
+
+#define IS_NEWLINE(p) \
+ ((p)[0] == NLBLOCK->nl[0] && \
+ (NLBLOCK->nllen == 1 || (p)[1] == NLBLOCK->nl[1]))
+
/* When PCRE is compiled as a C++ library, the subject pointer can be replaced
with a custom type. This makes it possible, for example, to allow pcre_exec()
to process subject strings that are discontinuous by using a smart pointer
@@ -164,7 +172,7 @@ case in PCRE. */
#if HAVE_BCOPY
#define memmove(a, b, c) bcopy(b, a, c)
#else /* HAVE_BCOPY */
-void *
+static void *
pcre_memmove(unsigned char *dest, const unsigned char *src, size_t n)
{
size_t i;
@@ -377,16 +385,17 @@ Standard C system should have one. */
#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! */
+/* Private options flags start at the most significant end of the four bytes.
+The public options defined in pcre.h start at the least significant end. Make
+sure they don't overlap! The bits are getting a bit scarce now -- when we run
+out, there is a dummy word in the structure that could be used for the private
+bits. */
+#define PCRE_NOPARTIAL 0x80000000 /* can't use partial with this regex */
#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 */
+#define PCRE_JCHANGED 0x08000000 /* j option changes within regex */
/* Options for the "extra" block produced by pcre_study(). */
@@ -398,15 +407,17 @@ 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)
+ PCRE_NO_AUTO_CAPTURE|PCRE_NO_UTF8_CHECK|PCRE_AUTO_CALLOUT|PCRE_FIRSTLINE| \
+ PCRE_DUPNAMES|PCRE_NEWLINE_CR|PCRE_NEWLINE_LF)
#define PUBLIC_EXEC_OPTIONS \
(PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NO_UTF8_CHECK| \
- PCRE_PARTIAL)
+ PCRE_PARTIAL|PCRE_NEWLINE_CR|PCRE_NEWLINE_LF)
#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)
+ PCRE_PARTIAL|PCRE_DFA_SHORTEST|PCRE_DFA_RESTART|PCRE_NEWLINE_CR| \
+ PCRE_NEWLINE_LF)
#define PUBLIC_STUDY_OPTIONS 0 /* None defined */
@@ -534,7 +545,7 @@ enum {
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_NOT, /* 23 Match one character, not the following one */
OP_STAR, /* 24 The maximizing and minimizing versions of */
OP_MINSTAR, /* 25 all these opcodes must come in pairs, with */
@@ -714,7 +725,8 @@ 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 };
+ ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,
+ ERR50, ERR51 };
/* 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
@@ -778,6 +790,8 @@ typedef struct compile_data {
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 */
+ int nllen; /* 1 or 2 for newline string length */
+ uschar nl[4]; /* Newline string */
} compile_data;
/* Structure for maintaining a chain of pointers to the currently incomplete
@@ -802,11 +816,11 @@ typedef struct 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. */
+pcre_exec.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;
@@ -820,6 +834,8 @@ typedef struct match_data {
int *offset_vector; /* Offset vector */
int offset_end; /* One past the end */
int offset_max; /* The maximum usable for return data */
+ int nllen; /* 1 or 2 for newline string length */
+ uschar nl[4]; /* Newline string */
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 */
@@ -853,6 +869,8 @@ typedef struct dfa_match_data {
const uschar *tables; /* Character tables */
int moptions; /* Match options */
int poptions; /* Pattern options */
+ int nllen; /* 1 or 2 for newline string length */
+ uschar nl[4]; /* Newline string */
void *callout_data; /* To pass back to callouts */
} dfa_match_data;
@@ -926,7 +944,7 @@ sense, but are not part of the PCRE public API. */
extern int _pcre_ord2utf8(int, uschar *);
extern real_pcre * _pcre_try_flipped(const real_pcre *, real_pcre *,
const pcre_study_data *, pcre_study_data *);
-extern int _pcre_ucp_findprop(const int, int *, int *);
+extern int _pcre_ucp_findprop(const unsigned int, int *, int *);
extern int _pcre_ucp_othercase(const int);
extern int _pcre_valid_utf8(const uschar *, int);
extern BOOL _pcre_xclass(int, const uschar *);
diff --git a/ext/pcre/pcrelib/pcre_maketables.c b/ext/pcre/pcrelib/pcre_maketables.c
index abc272f49..afe63d1b1 100644
--- a/ext/pcre/pcrelib/pcre_maketables.c
+++ b/ext/pcre/pcrelib/pcre_maketables.c
@@ -130,7 +130,9 @@ for (i = 0; i < 256; i++)
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; }
+ if (strchr("*+?{^.$|()[", i) != 0) x += ctype_meta;
+ *p++ = x;
+ }
return yield;
}
diff --git a/ext/pcre/pcrelib/pcre_printint.src b/ext/pcre/pcrelib/pcre_printint.src
index 34f52d114..e4de825a9 100644
--- a/ext/pcre/pcrelib/pcre_printint.src
+++ b/ext/pcre/pcrelib/pcre_printint.src
@@ -111,9 +111,9 @@ for (i = _pcre_utt_size; i >= 0; i--)
}
return (i >= 0)? _pcre_utt[i].name : "??";
#else
-ptype = ptype; /* Avoid compiler warning */
-pvalue = pvalue;
-return "??";
+/* It gets harder and harder to shut off unwanted compiler warnings. */
+ptype = ptype * pvalue;
+return (ptype == pvalue)? "??" : "??";
#endif
}
@@ -182,32 +182,26 @@ for(;;)
break;
case OP_CHAR:
+ fprintf(f, " ");
+ do
{
- fprintf(f, " ");
- do
- {
- code++;
- code += 1 + print_char(f, code, utf8);
- }
- while (*code == OP_CHAR);
- fprintf(f, "\n");
- continue;
+ code++;
+ code += 1 + print_char(f, code, utf8);
}
- break;
+ while (*code == OP_CHAR);
+ fprintf(f, "\n");
+ continue;
case OP_CHARNC:
+ fprintf(f, " NC ");
+ do
{
- fprintf(f, " NC ");
- do
- {
- code++;
- code += 1 + print_char(f, code, utf8);
- }
- while (*code == OP_CHARNC);
- fprintf(f, "\n");
- continue;
+ code++;
+ code += 1 + print_char(f, code, utf8);
}
- break;
+ while (*code == OP_CHARNC);
+ fprintf(f, "\n");
+ continue;
case OP_KETRMAX:
case OP_KETRMIN:
diff --git a/ext/pcre/pcrelib/pcre_study.c b/ext/pcre/pcrelib/pcre_study.c
index d3ea04ff7..5091324ae 100644
--- a/ext/pcre/pcrelib/pcre_study.c
+++ b/ext/pcre/pcrelib/pcre_study.c
@@ -95,6 +95,13 @@ set_start_bits(const uschar *code, uschar *start_bits, BOOL caseless,
{
register int c;
+#if 0
+/* ========================================================================= */
+/* The following comment and code was inserted in January 1999. In May 2006,
+when it was observed to cause compiler warnings about unused values, I took it
+out again. If anybody is still using OS/2, they will have to put it back
+manually. */
+
/* 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
@@ -102,6 +109,8 @@ 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;
+/* ========================================================================= */
+#endif
do
{
@@ -159,7 +168,11 @@ do
case OP_BRAMINZERO:
if (!set_start_bits(++tcode, start_bits, caseless, utf8, cd))
return FALSE;
+/* =========================================================================
+ See the comment at the head of this function concerning the next line,
+ which was an old fudge for the benefit of OS/2.
dummy = 1;
+ ========================================================================= */
do tcode += GET(tcode,1); while (*tcode == OP_ALT);
tcode += 1+LINK_SIZE;
break;
@@ -215,15 +228,29 @@ do
try_next = FALSE;
break;
+ /* The cbit_space table has vertical tab as whitespace; we have to
+ discard it. */
+
case OP_NOT_WHITESPACE:
for (c = 0; c < 32; c++)
- start_bits[c] |= ~cd->cbits[c+cbit_space];
+ {
+ int d = cd->cbits[c+cbit_space];
+ if (c == 1) d &= ~0x08;
+ start_bits[c] |= ~d;
+ }
try_next = FALSE;
break;
+ /* The cbit_space table has vertical tab as whitespace; we have to
+ discard it. */
+
case OP_WHITESPACE:
for (c = 0; c < 32; c++)
- start_bits[c] |= cd->cbits[c+cbit_space];
+ {
+ int d = cd->cbits[c+cbit_space];
+ if (c == 1) d &= ~0x08;
+ start_bits[c] |= d;
+ }
try_next = FALSE;
break;
@@ -277,14 +304,28 @@ do
start_bits[c] |= cd->cbits[c+cbit_digit];
break;
+ /* The cbit_space table has vertical tab as whitespace; we have to
+ discard it. */
+
case OP_NOT_WHITESPACE:
for (c = 0; c < 32; c++)
- start_bits[c] |= ~cd->cbits[c+cbit_space];
+ {
+ int d = cd->cbits[c+cbit_space];
+ if (c == 1) d &= ~0x08;
+ start_bits[c] |= ~d;
+ }
break;
+ /* The cbit_space table has vertical tab as whitespace; we have to
+ discard it. */
+
case OP_WHITESPACE:
for (c = 0; c < 32; c++)
- start_bits[c] |= cd->cbits[c+cbit_space];
+ {
+ int d = cd->cbits[c+cbit_space];
+ if (c == 1) d &= ~0x08;
+ start_bits[c] |= d;
+ }
break;
case OP_NOT_WORDCHAR:
@@ -408,10 +449,9 @@ 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);
+uschar *code;
compile_data compile_block;
+const real_pcre *re = (const real_pcre *)external_re;
*errorptr = NULL;
@@ -427,6 +467,9 @@ if ((options & ~PUBLIC_STUDY_OPTIONS) != 0)
return NULL;
}
+code = (uschar *)re + re->name_table_offset +
+ (re->name_count * re->name_entry_size);
+
/* 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. */
diff --git a/ext/pcre/pcrelib/pcre_try_flipped.c b/ext/pcre/pcrelib/pcre_try_flipped.c
index 7174cb6e1..00c94fccf 100644
--- a/ext/pcre/pcrelib/pcre_try_flipped.c
+++ b/ext/pcre/pcrelib/pcre_try_flipped.c
@@ -62,8 +62,8 @@ Arguments:
Returns: the flipped value
*/
-static long int
-byteflip(long int value, int n)
+static unsigned long int
+byteflip(unsigned long int value, int n)
{
if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8);
return ((value & 0x000000ff) << 24) |
diff --git a/ext/pcre/pcrelib/pcre_ucp_searchfuncs.c b/ext/pcre/pcrelib/pcre_ucp_searchfuncs.c
index ac964ca90..7a4be9486 100644
--- a/ext/pcre/pcrelib/pcre_ucp_searchfuncs.c
+++ b/ext/pcre/pcrelib/pcre_ucp_searchfuncs.c
@@ -79,7 +79,7 @@ Returns: the character type category
*/
int
-_pcre_ucp_findprop(const int c, int *type_ptr, int *script_ptr)
+_pcre_ucp_findprop(const unsigned int c, int *type_ptr, int *script_ptr)
{
int bot = 0;
int top = sizeof(ucp_table)/sizeof(cnode);
diff --git a/ext/pcre/pcrelib/pcrecpp.cc b/ext/pcre/pcrelib/pcrecpp.cc
index 70d59a272..f828de732 100644
--- a/ext/pcre/pcrelib/pcrecpp.cc
+++ b/ext/pcre/pcrelib/pcrecpp.cc
@@ -332,6 +332,30 @@ bool RE::Replace(const StringPiece& rewrite,
return true;
}
+// Returns PCRE_NEWLINE_CRLF, PCRE_NEWLINE_CR, or PCRE_NEWLINE_LF.
+// Note that PCRE_NEWLINE_CRLF is defined to be P_N_CR | P_N_LF.
+static int NewlineMode(int pcre_options) {
+ // TODO: if we can make it threadsafe, cache this var
+ int newline_mode = 0;
+ /* if (newline_mode) return newline_mode; */ // do this once it's cached
+ if (pcre_options & (PCRE_NEWLINE_CRLF|PCRE_NEWLINE_CR|PCRE_NEWLINE_LF)) {
+ newline_mode = (pcre_options &
+ (PCRE_NEWLINE_CRLF|PCRE_NEWLINE_CR|PCRE_NEWLINE_LF));
+ } else {
+ int newline;
+ pcre_config(PCRE_CONFIG_NEWLINE, &newline);
+ if (newline == 10)
+ newline_mode = PCRE_NEWLINE_LF;
+ else if (newline == 13)
+ newline_mode = PCRE_NEWLINE_CR;
+ else if (newline == 3338)
+ newline_mode = PCRE_NEWLINE_CRLF;
+ else
+ assert("" == "Unexpected return value from pcre_config(NEWLINE)");
+ }
+ return newline_mode;
+}
+
int RE::GlobalReplace(const StringPiece& rewrite,
string *str) const {
int count = 0;
@@ -350,9 +374,27 @@ int RE::GlobalReplace(const StringPiece& rewrite,
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++;
+ matchend = start + 1;
+ // If the current char is CR and we're in CRLF mode, skip LF too.
+ // Note it's better to call pcre_fullinfo() than to examine
+ // all_options(), since options_ could have changed bewteen
+ // compile-time and now, but this is simpler and safe enough.
+ if (start+1 < static_cast<int>(str->length()) &&
+ (*str)[start] == '\r' && (*str)[start+1] == '\n' &&
+ NewlineMode(options_.all_options()) == PCRE_NEWLINE_CRLF) {
+ matchend++;
+ }
+ // We also need to advance more than one char if we're in utf8 mode.
+#ifdef SUPPORT_UTF8
+ if (options_.utf8()) {
+ while (matchend < static_cast<int>(str->length()) &&
+ ((*str)[matchend] & 0xc0) == 0x80)
+ matchend++;
+ }
+#endif
+ if (matchend <= static_cast<int>(str->length()))
+ out.append(*str, start, matchend - start);
+ start = matchend;
} else {
out.append(*str, start, matchstart - start);
Rewrite(&out, rewrite, *str, vec, matches);
diff --git a/ext/pcre/pcrelib/pcrecpp_unittest.cc b/ext/pcre/pcrelib/pcrecpp_unittest.cc
index ba808bc4f..ccd876d08 100644
--- a/ext/pcre/pcrelib/pcrecpp_unittest.cc
+++ b/ext/pcre/pcrelib/pcrecpp_unittest.cc
@@ -32,6 +32,7 @@
// TODO: Test extractions for PartialMatch/Consume
#include <stdio.h>
+#include <cassert>
#include <vector>
#include "config.h"
#include "pcrecpp.h"
@@ -259,17 +260,71 @@ static void TestReplace() {
"aaaaa",
"bbaaaaa",
"bbabbabbabbabbabb" },
+ { "b*",
+ "bb",
+ "aa\naa\n",
+ "bbaa\naa\n",
+ "bbabbabb\nbbabbabb\nbb" },
+ { "b*",
+ "bb",
+ "aa\raa\r",
+ "bbaa\raa\r",
+ "bbabbabb\rbbabbabb\rbb" },
+ { "b*",
+ "bb",
+ "aa\r\naa\r\n",
+ "bbaa\r\naa\r\n",
+ "bbabbabb\r\nbbabbabb\r\nbb" },
+#ifdef SUPPORT_UTF8
+ { "b*",
+ "bb",
+ "\xE3\x83\x9B\xE3\x83\xBC\xE3\x83\xA0\xE3\x81\xB8", // utf8
+ "bb\xE3\x83\x9B\xE3\x83\xBC\xE3\x83\xA0\xE3\x81\xB8",
+ "bb\xE3\x83\x9B""bb""\xE3\x83\xBC""bb""\xE3\x83\xA0""bb""\xE3\x81\xB8""bb" },
+ { "b*",
+ "bb",
+ "\xE3\x83\x9B\r\n\xE3\x83\xBC\r\xE3\x83\xA0\n\xE3\x81\xB8\r\n", // utf8
+ "bb\xE3\x83\x9B\r\n\xE3\x83\xBC\r\xE3\x83\xA0\n\xE3\x81\xB8\r\n",
+ ("bb\xE3\x83\x9B""bb\r\nbb""\xE3\x83\xBC""bb\rbb""\xE3\x83\xA0"
+ "bb\nbb""\xE3\x81\xB8""bb\r\nbb") },
+#endif
{ "", NULL, NULL, NULL, NULL }
};
+#ifdef SUPPORT_UTF8
+ const bool support_utf8 = true;
+#else
+ const bool support_utf8 = false;
+#endif
+
for (const ReplaceTest *t = tests; t->original != NULL; ++t) {
+ RE re(t->regexp, RE_Options(PCRE_NEWLINE_CRLF).set_utf8(support_utf8));
+ assert(re.error().empty());
string one(t->original);
- CHECK(RE(t->regexp).Replace(t->rewrite, &one));
+ CHECK(re.Replace(t->rewrite, &one));
CHECK_EQ(one, t->single);
string all(t->original);
- CHECK(RE(t->regexp).GlobalReplace(t->rewrite, &all) > 0);
+ CHECK(re.GlobalReplace(t->rewrite, &all) > 0);
CHECK_EQ(all, t->global);
}
+
+ // One final test: test \r\n replacement when we're not in CRLF mode
+ {
+ RE re("b*", RE_Options(PCRE_NEWLINE_CR).set_utf8(support_utf8));
+ assert(re.error().empty());
+ string all("aa\r\naa\r\n");
+ CHECK(re.GlobalReplace("bb", &all) > 0);
+ CHECK_EQ(all, string("bbabbabb\rbb\nbbabbabb\rbb\nbb"));
+ }
+ {
+ RE re("b*", RE_Options(PCRE_NEWLINE_LF).set_utf8(support_utf8));
+ assert(re.error().empty());
+ string all("aa\r\naa\r\n");
+ CHECK(re.GlobalReplace("bb", &all) > 0);
+ CHECK_EQ(all, string("bbabbabb\rbb\nbbabbabb\rbb\nbb"));
+ }
+ // TODO: test what happens when no PCRE_NEWLINE_* flag is set.
+ // Alas, the answer depends on how pcre was compiled.
}
static void TestExtract() {
diff --git a/ext/pcre/pcrelib/pcredemo.c b/ext/pcre/pcrelib/pcredemo.c
index 3817203b5..8b06a9ce6 100644
--- a/ext/pcre/pcrelib/pcredemo.c
+++ b/ext/pcre/pcrelib/pcredemo.c
@@ -117,7 +117,7 @@ if (rc < 0)
*/
default: printf("Matching error %d\n", rc); break;
}
- free(re); /* Release memory used for the compiled pattern */
+ pcre_free(re); /* Release memory used for the compiled pattern */
return 1;
}
@@ -223,8 +223,8 @@ if (namecount <= 0) printf("No named substrings\n"); else
if (!find_all)
{
- free(re); /* Release the memory used for the compiled pattern */
- return 0; /* Finish unless -g was given */
+ pcre_free(re); /* Release the memory used for the compiled pattern */
+ return 0; /* Finish unless -g was given */
}
/* Loop for second and subsequent matches */
@@ -276,7 +276,7 @@ for (;;)
if (rc < 0)
{
printf("Matching error %d\n", rc);
- free(re); /* Release memory used for the compiled pattern */
+ pcre_free(re); /* Release memory used for the compiled pattern */
return 1;
}
@@ -317,7 +317,7 @@ for (;;)
} /* End of loop to find second and subsequent matches */
printf("\n");
-free(re); /* Release memory used for the compiled pattern */
+pcre_free(re); /* Release memory used for the compiled pattern */
return 0;
}
diff --git a/ext/pcre/pcrelib/pcregrep.c b/ext/pcre/pcrelib/pcregrep.c
index 1533c8366..001588be2 100644
--- a/ext/pcre/pcrelib/pcregrep.c
+++ b/ext/pcre/pcrelib/pcregrep.c
@@ -56,7 +56,7 @@ POSSIBILITY OF SUCH DAMAGE.
typedef int BOOL;
-#define VERSION "4.2 09-Jan-2006"
+#define VERSION "4.3 01-Jun-2006"
#define MAX_PATTERN_COUNT 100
#if BUFSIZ > 8192
@@ -100,10 +100,14 @@ static const char *jfriedl_prefix = "";
static const char *jfriedl_postfix = "";
#endif
+static int endlinebyte = '\n'; /* Last byte of endline sequence */
+static int endlineextra = 0; /* Extra bytes for endline sequence */
+
static char *colour_string = (char *)"1;31";
static char *colour_option = NULL;
static char *dee_option = NULL;
static char *DEE_option = NULL;
+static char *newline = NULL;
static char *pattern_filename = NULL;
static char *stdin_name = (char *)"(standard input)";
static char *locale = NULL;
@@ -185,6 +189,7 @@ static option_item optionlist[] = {
{ OP_STRING, N_LABEL, &stdin_name, "label=name", "set name for standard input" },
{ OP_STRING, N_LOCALE, &locale, "locale=locale", "use the named locale" },
{ OP_NODATA, 'M', NULL, "multiline", "run in multiline mode" },
+ { OP_STRING, 'N', &newline, "newline=type", "specify newline type (CR, LR, CRLF)" },
{ OP_NODATA, 'n', NULL, "line-number", "print line number with output lines" },
{ OP_NODATA, 'o', NULL, "only-matching", "show only the part of the line that matched" },
{ OP_NODATA, 'q', NULL, "quiet", "suppress output, just set return code" },
@@ -493,8 +498,9 @@ if (after_context > 0 && lastmatchnumber > 0)
char *pp = lastmatchrestart;
if (printname != NULL) fprintf(stdout, "%s-", printname);
if (number) fprintf(stdout, "%d-", lastmatchnumber++);
- while (*pp != '\n') pp++;
- fwrite(lastmatchrestart, 1, pp - lastmatchrestart + 1, stdout);
+ while (*pp != endlinebyte) pp++;
+ fwrite(lastmatchrestart, 1, pp - lastmatchrestart + (1 + endlineextra),
+ stdout);
lastmatchrestart = pp + 1;
}
hyphenpending = TRUE;
@@ -566,7 +572,7 @@ while (ptr < endptr)
that any match is constrained to be in the first line. */
linelength = 0;
- while (t < endptr && *t++ != '\n') linelength++;
+ while (t < endptr && *t++ != endlinebyte) linelength++;
length = multiline? endptr - ptr : linelength;
@@ -705,7 +711,7 @@ while (ptr < endptr)
while (p < ptr && linecount < after_context)
{
- while (*p != '\n') p++;
+ while (*p != endlinebyte) p++;
p++;
linecount++;
}
@@ -719,8 +725,9 @@ while (ptr < endptr)
char *pp = lastmatchrestart;
if (printname != NULL) fprintf(stdout, "%s-", printname);
if (number) fprintf(stdout, "%d-", lastmatchnumber++);
- while (*pp != '\n') pp++;
- fwrite(lastmatchrestart, 1, pp - lastmatchrestart + 1, stdout);
+ while (*pp != endlinebyte) pp++;
+ fwrite(lastmatchrestart, 1, pp - lastmatchrestart +
+ (1 + endlineextra), stdout);
lastmatchrestart = pp + 1;
}
if (lastmatchrestart != ptr) hyphenpending = TRUE;
@@ -748,7 +755,7 @@ while (ptr < endptr)
{
linecount++;
p--;
- while (p > buffer && p[-1] != '\n') p--;
+ while (p > buffer && p[-1] != endlinebyte) p--;
}
if (lastmatchnumber > 0 && p > lastmatchrestart && !hyphenprinted)
@@ -759,8 +766,8 @@ while (ptr < endptr)
char *pp = p;
if (printname != NULL) fprintf(stdout, "%s-", printname);
if (number) fprintf(stdout, "%d-", linenumber - linecount--);
- while (*pp != '\n') pp++;
- fwrite(p, 1, pp - p + 1, stdout); /* In case binary zero */
+ while (*pp != endlinebyte) pp++;
+ fwrite(p, 1, pp - p + (1 + endlineextra), stdout);
p = pp + 1;
}
}
@@ -777,14 +784,14 @@ while (ptr < endptr)
/* 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. */
+ start of the match will always be before the first newline sequence. */
if (multiline)
{
char *endmatch = ptr + offsets[1];
t = ptr;
- while (t < endmatch) { if (*t++ == '\n') linenumber++; }
- while (endmatch < endptr && *endmatch != '\n') endmatch++;
+ while (t < endmatch) { if (*t++ == endlinebyte) linenumber++; }
+ while (endmatch < endptr && *endmatch != endlinebyte) endmatch++;
linelength = endmatch - ptr;
}
@@ -1206,7 +1213,7 @@ return FALSE;
*************************************************/
/* When the -F option has been used, each string may be a list of strings,
-separated by newlines. They will be matched literally.
+separated by line breaks. They will be matched literally.
Arguments:
pattern the pattern string
@@ -1227,10 +1234,10 @@ if ((process_options & PO_FIXED_STRINGS) != 0)
char buffer[MBUFTHIRD];
for(;;)
{
- char *p = strchr(pattern, '\n');
+ char *p = strchr(pattern, endlinebyte);
if (p == NULL)
return compile_single_pattern(pattern, options, filename, count);
- sprintf(buffer, "%.*s", p - pattern, pattern);
+ sprintf(buffer, "%.*s", p - pattern - endlineextra, pattern);
pattern = p + 1;
if (!compile_single_pattern(buffer, options, filename, count))
return FALSE;
@@ -1260,6 +1267,16 @@ char *patterns[MAX_PATTERN_COUNT];
const char *locale_from = "--locale";
const char *error;
+/* Set the default line ending value from the default in the PCRE library. */
+
+(void)pcre_config(PCRE_CONFIG_NEWLINE, &i);
+switch(i)
+ {
+ default: newline = (char *)"lf"; break;
+ case '\r': newline = (char *)"cr"; break;
+ case ('\r' << 8) | '\n': newline = (char *)"crlf"; break;
+ }
+
/* Process the options */
for (i = 1; i < argc; i++)
@@ -1543,6 +1560,28 @@ if (colour_option != NULL && strcmp(colour_option, "never") != 0)
}
}
+/* Interpret the newline type; the default settings are Unix-like. */
+
+if (strcmp(newline, "cr") == 0 || strcmp(newline, "CR") == 0)
+ {
+ pcre_options |= PCRE_NEWLINE_CR;
+ endlinebyte = '\r';
+ }
+else if (strcmp(newline, "lf") == 0 || strcmp(newline, "LF") == 0)
+ {
+ pcre_options |= PCRE_NEWLINE_LF;
+ }
+else if (strcmp(newline, "crlf") == 0 || strcmp(newline, "CRLF") == 0)
+ {
+ pcre_options |= PCRE_NEWLINE_CRLF;
+ endlineextra = 1;
+ }
+else
+ {
+ fprintf(stderr, "pcregrep: Invalid newline specifier \"%s\"\n", newline);
+ return 2;
+ }
+
/* Interpret the text values for -d and -D */
if (dee_option != NULL)
diff --git a/ext/pcre/pcrelib/pcreposix.c b/ext/pcre/pcrelib/pcreposix.c
index cbb1ff800..b3472361c 100644
--- a/ext/pcre/pcrelib/pcreposix.c
+++ b/ext/pcre/pcrelib/pcreposix.c
@@ -77,7 +77,7 @@ static const int eint[] = {
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, /* malformed number or name after (?( */
REG_BADPAT, /* conditional group containe more than two branches */
REG_BADPAT, /* assertion expected after (?( */
REG_BADPAT, /* (?R or (?digits must be followed by ) */
@@ -94,11 +94,15 @@ static const int eint[] = {
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, /* two named subpatterns 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 */
+ REG_BADPAT, /* unknown property name after \P or \p */
+ REG_BADPAT, /* subpattern name is too long (maximum 32 characters) */
+ REG_BADPAT, /* too many named subpatterns (maximum 10,000) */
+ REG_BADPAT, /* repeated subpattern is too long */
+ REG_BADPAT /* octal value is greater than \377 (not in UTF-8 mode) */
};
/* Table of texts corresponding to POSIX error codes */
diff --git a/ext/pcre/pcrelib/pcretest.c b/ext/pcre/pcrelib/pcretest.c
index f5c6cdd2e..431378c6d 100644
--- a/ext/pcre/pcrelib/pcretest.c
+++ b/ext/pcre/pcrelib/pcretest.c
@@ -44,6 +44,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include <locale.h>
#include <errno.h>
+#ifndef _WIN32
+#include <sys/resource.h>
+#endif
+
#define PCRE_SPY /* For Win32 build, import data, not export */
/* We include pcre_internal.h because we need the internal info for displaying
@@ -101,11 +105,6 @@ function (define NOINFOCHECK). */
#define LOOPREPEAT 500000
-#define BUFFER_SIZE 30000
-#define PBUFFER_SIZE BUFFER_SIZE
-#define DBUFFER_SIZE BUFFER_SIZE
-
-
/* Static variables */
static FILE *outfile;
@@ -119,11 +118,96 @@ static int show_malloc;
static int use_utf8;
static size_t gotten_store;
+/* The buffers grow automatically if very long input lines are encountered. */
+
+static int buffer_size = 50000;
+static uschar *buffer = NULL;
+static uschar *dbuffer = NULL;
static uschar *pbuffer = NULL;
/*************************************************
+* Read or extend an input line *
+*************************************************/
+
+/* Input lines are read into buffer, but both patterns and data lines can be
+continued over multiple input lines. In addition, if the buffer fills up, we
+want to automatically expand it so as to be able to handle extremely large
+lines that are needed for certain stress tests. When the input buffer is
+expanded, the other two buffers must also be expanded likewise, and the
+contents of pbuffer, which are a copy of the input for callouts, must be
+preserved (for when expansion happens for a data line). This is not the most
+optimal way of handling this, but hey, this is just a test program!
+
+Arguments:
+ f the file to read
+ start where in buffer to start (this *must* be within buffer)
+
+Returns: pointer to the start of new data
+ could be a copy of start, or could be moved
+ NULL if no data read and EOF reached
+*/
+
+static uschar *
+extend_inputline(FILE *f, uschar *start)
+{
+uschar *here = start;
+
+for (;;)
+ {
+ int rlen = buffer_size - (here - buffer);
+ if (rlen > 1000)
+ {
+ int dlen;
+ if (fgets((char *)here, rlen, f) == NULL)
+ return (here == start)? NULL : start;
+ dlen = (int)strlen((char *)here);
+ if (dlen > 0 && here[dlen - 1] == '\n') return start;
+ here += dlen;
+ }
+
+ else
+ {
+ int new_buffer_size = 2*buffer_size;
+ uschar *new_buffer = (unsigned char *)malloc(new_buffer_size);
+ uschar *new_dbuffer = (unsigned char *)malloc(new_buffer_size);
+ uschar *new_pbuffer = (unsigned char *)malloc(new_buffer_size);
+
+ if (new_buffer == NULL || new_dbuffer == NULL || new_pbuffer == NULL)
+ {
+ fprintf(stderr, "pcretest: malloc(%d) failed\n", new_buffer_size);
+ exit(1);
+ }
+
+ memcpy(new_buffer, buffer, buffer_size);
+ memcpy(new_pbuffer, pbuffer, buffer_size);
+
+ buffer_size = new_buffer_size;
+
+ start = new_buffer + (start - buffer);
+ here = new_buffer + (here - buffer);
+
+ free(buffer);
+ free(dbuffer);
+ free(pbuffer);
+
+ buffer = new_buffer;
+ dbuffer = new_dbuffer;
+ pbuffer = new_pbuffer;
+ }
+ }
+
+return NULL; /* Control never gets here */
+}
+
+
+
+
+
+
+
+/*************************************************
* Read number from string *
*************************************************/
@@ -159,19 +243,19 @@ return(result);
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
+ utf8bytes 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)
+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)
+utf82ord(unsigned char *utf8bytes, int *vptr)
{
-int c = *buffer++;
+int c = *utf8bytes++;
int d = c;
int i, j, s;
@@ -191,7 +275,7 @@ d = (c & utf8_table3[i]) << s;
for (j = 0; j < i; j++)
{
- c = *buffer++;
+ c = *utf8bytes++;
if ((c & 0xc0) != 0x80) return -(j+1);
s -= 6;
d |= (c & 0x3f) << s;
@@ -222,24 +306,24 @@ 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
+ utf8bytes pointer to buffer for result - at least 6 bytes long
Returns: number of characters placed in the buffer
*/
static int
-ord2utf8(int cvalue, uschar *buffer)
+ord2utf8(int cvalue, uschar *utf8bytes)
{
register int i, j;
for (i = 0; i < utf8_table1_size; i++)
if (cvalue <= utf8_table1[i]) break;
-buffer += i;
+utf8bytes += i;
for (j = i; j > 0; j--)
{
- *buffer-- = 0x80 | (cvalue & 0x3f);
+ *utf8bytes-- = 0x80 | (cvalue & 0x3f);
cvalue >>= 6;
}
-*buffer = utf8_table2[i] | cvalue;
+*utf8bytes = utf8_table2[i] | cvalue;
return i + 1;
}
@@ -461,8 +545,8 @@ if ((rc = pcre_fullinfo(re, study, option, ptr)) < 0)
* Byte flipping function *
*************************************************/
-static long int
-byteflip(long int value, int n)
+static unsigned long int
+byteflip(unsigned long int value, int n)
{
if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8);
return ((value & 0x000000ff) << 24) |
@@ -526,6 +610,32 @@ return count;
/*************************************************
+* Check newline indicator *
+*************************************************/
+
+/* This is used both at compile and run-time to check for <xxx> escapes, where
+xxx is LF, CR, or CRLF. Print a message and return 0 if there is no match.
+
+Arguments:
+ p points after the leading '<'
+ f file for error message
+
+Returns: appropriate PCRE_NEWLINE_xxx flags, or 0
+*/
+
+static int
+check_newline(uschar *p, FILE *f)
+{
+if (strncmp((char *)p, "cr>", 3) == 0) return PCRE_NEWLINE_CR;
+if (strncmp((char *)p, "lf>", 3) == 0) return PCRE_NEWLINE_LF;
+if (strncmp((char *)p, "crlf>", 5) == 0) return PCRE_NEWLINE_CRLF;
+fprintf(f, "Unknown newline type at: <%s\n", p);
+return 0;
+}
+
+
+
+/*************************************************
* Main Program *
*************************************************/
@@ -553,16 +663,23 @@ int debug = 0;
int done = 0;
int all_use_dfa = 0;
int yield = 0;
+int stack_size;
-unsigned char *buffer;
-unsigned char *dbuffer;
+/* These vectors store, end-to-end, a list of captured substring names. Assume
+that 1024 is plenty long enough for the few names we'll be testing. */
+
+uschar copynames[1024];
+uschar getnames[1024];
+
+uschar *copynamesptr;
+uschar *getnamesptr;
/* Get buffers from malloc() so that Electric Fence will check their misuse
-when I am debugging. */
+when I am debugging. They grow automatically when very long lines are read. */
-buffer = (unsigned char *)malloc(BUFFER_SIZE);
-dbuffer = (unsigned char *)malloc(DBUFFER_SIZE);
-pbuffer = (unsigned char *)malloc(PBUFFER_SIZE);
+buffer = (unsigned char *)malloc(buffer_size);
+dbuffer = (unsigned char *)malloc(buffer_size);
+pbuffer = (unsigned char *)malloc(buffer_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
@@ -596,6 +713,28 @@ while (argc > 1 && argv[op][0] == '-')
op++;
argc--;
}
+ else if (strcmp(argv[op], "-S") == 0 && argc > 2 &&
+ ((stack_size = get_value((unsigned char *)argv[op+1], &endptr)),
+ *endptr == 0))
+ {
+#ifdef _WIN32
+ printf("PCRE: -S not supported on this OS\n");
+ exit(1);
+#else
+ int rc;
+ struct rlimit rlim;
+ getrlimit(RLIMIT_STACK, &rlim);
+ rlim.rlim_cur = stack_size * 1024 * 1024;
+ rc = setrlimit(RLIMIT_STACK, &rlim);
+ if (rc != 0)
+ {
+ printf("PCRE: setrlimit() failed with error %d\n", rc);
+ exit(1);
+ }
+ op++;
+ argc--;
+#endif
+ }
#if !defined NOPOSIX
else if (strcmp(argv[op], "-p") == 0) posix = 1;
#endif
@@ -609,7 +748,8 @@ while (argc > 1 && argv[op][0] == '-')
(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");
+ printf(" Newline sequence is %s\n", (rc == '\r')? "CR" :
+ (rc == '\n')? "LF" : "CRLF");
(void)pcre_config(PCRE_CONFIG_LINK_SIZE, &rc);
printf(" Internal link size = %d\n", rc);
(void)pcre_config(PCRE_CONFIG_POSIX_MALLOC_THRESHOLD, &rc);
@@ -625,7 +765,7 @@ while (argc > 1 && argv[op][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("Usage: pcretest [options] [<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
@@ -637,6 +777,7 @@ while (argc > 1 && argv[op][0] == '-')
#if !defined NOPOSIX
printf(" -p use POSIX interface\n");
#endif
+ printf(" -S <n> set stack size to <n> megabytes\n");
printf(" -s output store (memory) used information\n"
" -t time compilation and execution\n");
yield = 1;
@@ -723,7 +864,7 @@ while (!done)
use_utf8 = 0;
if (infile == stdin) printf(" re> ");
- if (fgets((char *)buffer, BUFFER_SIZE, infile) == NULL) break;
+ if (extend_inputline(infile, buffer) == NULL) break;
if (infile != stdin) fprintf(outfile, "%s", (char *)buffer);
fflush(outfile);
@@ -735,7 +876,7 @@ while (!done)
if (*p == '<' && strchr((char *)(p+1), '<') == NULL)
{
- unsigned long int magic;
+ unsigned long int magic, get_options;
uschar sbuf[8];
FILE *f;
@@ -783,8 +924,8 @@ while (!done)
/* Need to know if UTF-8 for printing data strings */
- new_info(re, NULL, PCRE_INFO_OPTIONS, &options);
- use_utf8 = (options & PCRE_UTF8) != 0;
+ new_info(re, NULL, PCRE_INFO_OPTIONS, &get_options);
+ use_utf8 = (get_options & PCRE_UTF8) != 0;
/* Now see if there is any following study data */
@@ -838,16 +979,8 @@ while (!done)
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)
+ if ((pp = extend_inputline(infile, pp)) == NULL)
{
fprintf(outfile, "** Unexpected EOF\n");
done = 1;
@@ -893,6 +1026,7 @@ while (!done)
case 'F': do_flip = 1; break;
case 'G': do_G = 1; break;
case 'I': do_showinfo = 1; break;
+ case 'J': options |= PCRE_DUPNAMES; break;
case 'M': log_store = 1; break;
case 'N': options |= PCRE_NO_AUTO_CAPTURE; break;
@@ -927,6 +1061,15 @@ while (!done)
*pp = 0;
break;
+ case '<':
+ {
+ int x = check_newline(pp, outfile);
+ if (x == 0) goto SKIP_DATA;
+ options |= x;
+ while (*pp++ != '>');
+ }
+ break;
+
case '\r': /* So that it works in Windows */
case '\n':
case ' ':
@@ -961,7 +1104,7 @@ while (!done)
if (rc != 0)
{
- (void)regerror(rc, &preg, (char *)buffer, BUFFER_SIZE);
+ (void)regerror(rc, &preg, (char *)buffer, buffer_size);
fprintf(outfile, "Failed: POSIX code %d: %s\n", rc, buffer);
goto SKIP_DATA;
}
@@ -1002,7 +1145,7 @@ while (!done)
{
for (;;)
{
- if (fgets((char *)buffer, BUFFER_SIZE, infile) == NULL)
+ if (extend_inputline(infile, buffer) == NULL)
{
done = 1;
goto CONTINUE;
@@ -1163,13 +1306,13 @@ while (!done)
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%s\n",
+ else fprintf(outfile, "Options:%s%s%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" : "",
@@ -1181,14 +1324,30 @@ while (!done)
((get_options & PCRE_UNGREEDY) != 0)? " ungreedy" : "",
((get_options & PCRE_NO_AUTO_CAPTURE) != 0)? " no_auto_capture" : "",
((get_options & PCRE_UTF8) != 0)? " utf8" : "",
- ((get_options & PCRE_NO_UTF8_CHECK) != 0)? " no_utf8_check" : "");
+ ((get_options & PCRE_NO_UTF8_CHECK) != 0)? " no_utf8_check" : "",
+ ((get_options & PCRE_DUPNAMES) != 0)? " dupnames" : "");
+
+ switch (get_options & PCRE_NEWLINE_CRLF)
+ {
+ case PCRE_NEWLINE_CR:
+ fprintf(outfile, "Forced newline sequence: CR\n");
+ break;
+
+ case PCRE_NEWLINE_LF:
+ fprintf(outfile, "Forced newline sequence: LF\n");
+ break;
- if (((((real_pcre *)re)->options) & PCRE_ICHANGED) != 0)
- fprintf(outfile, "Case state changes\n");
+ case PCRE_NEWLINE_CRLF:
+ fprintf(outfile, "Forced newline sequence: CRLF\n");
+ break;
+
+ default:
+ break;
+ }
if (first_char == -1)
{
- fprintf(outfile, "First char at start or follows \\n\n");
+ fprintf(outfile, "First char at start or follows newline\n");
}
else if (first_char < 0)
{
@@ -1343,6 +1502,12 @@ while (!done)
options = 0;
+ *copynames = 0;
+ *getnames = 0;
+
+ copynamesptr = copynames;
+ getnamesptr = getnames;
+
pcre_callout = callout;
first_callout = 1;
callout_extra = 0;
@@ -1351,15 +1516,24 @@ while (!done)
callout_fail_id = -1;
show_malloc = 0;
- if (infile == stdin) printf("data> ");
- if (fgets((char *)buffer, BUFFER_SIZE, infile) == NULL)
+ if (extra != NULL) extra->flags &=
+ ~(PCRE_EXTRA_MATCH_LIMIT|PCRE_EXTRA_MATCH_LIMIT_RECURSION);
+
+ len = 0;
+ for (;;)
{
- done = 1;
- goto CONTINUE;
+ if (infile == stdin) printf("data> ");
+ if (extend_inputline(infile, buffer + len) == NULL)
+ {
+ if (len > 0) break;
+ done = 1;
+ goto CONTINUE;
+ }
+ if (infile != stdin) fprintf(outfile, "%s", (char *)buffer);
+ len = (int)strlen((char *)buffer);
+ if (buffer[len-1] == '\n') break;
}
- 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;
@@ -1389,6 +1563,17 @@ while (!done)
c -= '0';
while (i++ < 2 && isdigit(*p) && *p != '8' && *p != '9')
c = c * 8 + *p++ - '0';
+
+#if !defined NOUTF8
+ if (use_utf8 && c > 255)
+ {
+ unsigned char buff8[8];
+ int ii, utn;
+ utn = ord2utf8(c, buff8);
+ for (ii = 0; ii < utn - 1; ii++) *q++ = buff8[ii];
+ c = buff8[ii]; /* Last byte */
+ }
+#endif
break;
case 'x':
@@ -1450,14 +1635,14 @@ while (!done)
}
else if (isalnum(*p))
{
- uschar name[256];
- uschar *npp = name;
+ uschar *npp = copynamesptr;
while (isalnum(*p)) *npp++ = *p++;
+ *npp++ = 0;
*npp = 0;
- n = pcre_get_stringnumber(re, (char *)name);
+ n = pcre_get_stringnumber(re, (char *)copynamesptr);
if (n < 0)
- fprintf(outfile, "no parentheses with name \"%s\"\n", name);
- else copystrings |= 1 << n;
+ fprintf(outfile, "no parentheses with name \"%s\"\n", copynamesptr);
+ copynamesptr = npp;
}
else if (*p == '+')
{
@@ -1518,14 +1703,14 @@ while (!done)
}
else if (isalnum(*p))
{
- uschar name[256];
- uschar *npp = name;
+ uschar *npp = getnamesptr;
while (isalnum(*p)) *npp++ = *p++;
+ *npp++ = 0;
*npp = 0;
- n = pcre_get_stringnumber(re, (char *)name);
+ n = pcre_get_stringnumber(re, (char *)getnamesptr);
if (n < 0)
- fprintf(outfile, "no parentheses with name \"%s\"\n", name);
- else getstrings |= 1 << n;
+ fprintf(outfile, "no parentheses with name \"%s\"\n", getnamesptr);
+ getnamesptr = npp;
}
continue;
@@ -1564,6 +1749,28 @@ while (!done)
options |= PCRE_PARTIAL;
continue;
+ case 'Q':
+ while(isdigit(*p)) n = n * 10 + *p++ - '0';
+ if (extra == NULL)
+ {
+ extra = (pcre_extra *)malloc(sizeof(pcre_extra));
+ extra->flags = 0;
+ }
+ extra->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
+ extra->match_limit_recursion = n;
+ continue;
+
+ case 'q':
+ while(isdigit(*p)) n = n * 10 + *p++ - '0';
+ if (extra == NULL)
+ {
+ extra = (pcre_extra *)malloc(sizeof(pcre_extra));
+ extra->flags = 0;
+ }
+ extra->flags |= PCRE_EXTRA_MATCH_LIMIT;
+ extra->match_limit = n;
+ continue;
+
#if !defined NODFA
case 'R':
options |= PCRE_DFA_RESTART;
@@ -1581,6 +1788,15 @@ while (!done)
case '?':
options |= PCRE_NO_UTF8_CHECK;
continue;
+
+ case '<':
+ {
+ int x = check_newline(p, outfile);
+ if (x == 0) goto NEXT_DATA;
+ options |= x;
+ while (*p++ != '>');
+ }
+ continue;
}
*q++ = c;
}
@@ -1611,7 +1827,7 @@ while (!done)
if (rc != 0)
{
- (void)regerror(rc, &preg, (char *)buffer, BUFFER_SIZE);
+ (void)regerror(rc, &preg, (char *)buffer, buffer_size);
fprintf(outfile, "No match: POSIX code %d: %s\n", rc, buffer);
}
else if ((((const pcre *)preg.re_pcre)->options & PCRE_NO_AUTO_CAPTURE)
@@ -1690,7 +1906,7 @@ while (!done)
extra->flags = 0;
}
- count = check_match_limit(re, extra, bptr, len, start_offset,
+ (void)check_match_limit(re, extra, bptr, len, start_offset,
options|g_notempty, use_offsets, use_size_offsets,
PCRE_EXTRA_MATCH_LIMIT, &(extra->match_limit),
PCRE_ERROR_MATCHLIMIT, "match()");
@@ -1778,7 +1994,7 @@ while (!done)
{
if ((copystrings & (1 << i)) != 0)
{
- char copybuffer[16];
+ char copybuffer[256];
int rc = pcre_copy_substring((char *)bptr, use_offsets, count,
i, copybuffer, sizeof(copybuffer));
if (rc < 0)
@@ -1788,6 +2004,19 @@ while (!done)
}
}
+ for (copynamesptr = copynames;
+ *copynamesptr != 0;
+ copynamesptr += (int)strlen((char*)copynamesptr) + 1)
+ {
+ char copybuffer[256];
+ int rc = pcre_copy_named_substring(re, (char *)bptr, use_offsets,
+ count, (char *)copynamesptr, copybuffer, sizeof(copybuffer));
+ if (rc < 0)
+ fprintf(outfile, "copy substring %s failed %d\n", copynamesptr, rc);
+ else
+ fprintf(outfile, " C %s (%d) %s\n", copybuffer, rc, copynamesptr);
+ }
+
for (i = 0; i < 32; i++)
{
if ((getstrings & (1 << i)) != 0)
@@ -1800,12 +2029,27 @@ while (!done)
else
{
fprintf(outfile, "%2dG %s (%d)\n", i, substring, rc);
- /* free((void *)substring); */
pcre_free_substring(substring);
}
}
}
+ for (getnamesptr = getnames;
+ *getnamesptr != 0;
+ getnamesptr += (int)strlen((char*)getnamesptr) + 1)
+ {
+ const char *substring;
+ int rc = pcre_get_named_substring(re, (char *)bptr, use_offsets,
+ count, (char *)getnamesptr, &substring);
+ if (rc < 0)
+ fprintf(outfile, "copy substring %s failed %d\n", getnamesptr, rc);
+ else
+ {
+ fprintf(outfile, " G %s (%d) %s\n", substring, rc, getnamesptr);
+ pcre_free_substring(substring);
+ }
+ }
+
if (getlist)
{
const char **stringlist;
@@ -1905,6 +2149,8 @@ while (!done)
len -= use_offsets[1];
}
} /* End of loop for /g and /G */
+
+ NEXT_DATA: continue;
} /* End of loop for data lines */
CONTINUE:
diff --git a/ext/pcre/pcrelib/testdata/grepinputx b/ext/pcre/pcrelib/testdata/grepinputx
index aebba0277..296ed4cef 100644
--- a/ext/pcre/pcrelib/testdata/grepinputx
+++ b/ext/pcre/pcrelib/testdata/grepinputx
@@ -39,4 +39,10 @@ eighteen
nineteen
twenty
+Here follows some CR/LF/CRLF test data.
+
+abc def
+ghi
+jkl
+
This is the last line of this file.
diff --git a/ext/pcre/pcrelib/testdata/testinput1 b/ext/pcre/pcrelib/testdata/testinput1
index c1a05eb01..042db24e6 100644
--- a/ext/pcre/pcrelib/testdata/testinput1
+++ b/ext/pcre/pcrelib/testdata/testinput1
@@ -1473,11 +1473,11 @@
/(abc)\323/
abc\xd3
-/(abc)\500/
+/(abc)\100/
abc\x40
abc\100
-/(abc)\5000/
+/(abc)\1000/
abc\x400
abc\x40\x30
abc\1000
@@ -3846,4 +3846,41 @@
** Failers
abcddefg
+/(?<![^f]oo)(bar)/
+ foobarX
+ ** Failers
+ boobarX
+
+/(?<![^f])X/
+ offX
+ ** Failers
+ onyX
+
+/(?<=[^f])X/
+ onyX
+ ** Failers
+ offX
+
+/^/mg
+ a\nb\nc\n
+ \
+
+/(?<=C\n)^/mg
+ A\nC\nC\n
+
+/(?:(?(1)a|b)(X))+/
+ bXaX
+
+/(?:(?(1)\1a|b)(X|Y))+/
+ bXXaYYaY
+ bXYaXXaX
+
+/()()()()()()()()()(?:(?(10)\10a|b)(X|Y))+/
+ bXXaYYaY
+
+/[[,abc,]+]/
+ abc]
+ a,b]
+ [a,b,c]
+
/ End of testinput1 /
diff --git a/ext/pcre/pcrelib/testdata/testinput2 b/ext/pcre/pcrelib/testdata/testinput2
index 60d2db00f..0a87466ae 100644
--- a/ext/pcre/pcrelib/testdata/testinput2
+++ b/ext/pcre/pcrelib/testdata/testinput2
@@ -733,7 +733,7 @@
Ab
AB
-/[\200-\410]/
+/[\200-\110]/
/^(?(0)f|b)oo/
@@ -1490,4 +1490,157 @@
/\x{0000ff}/
+/^((?P<A>a1)|(?P<A>a2)b)/
+
+/^((?P<A>a1)|(?P<A>a2)b)/J
+ a1b\CA
+ a2b\CA
+ ** Failers
+ a1b\CZ\CA
+
+/^(?P<A>a)(?P<A>b)/J
+ ab\CA
+
+/^(?P<A>a)(?P<A>b)|cd/J
+ ab\CA
+ cd\CA
+
+/^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/J
+ cdefgh\CA
+
+/^((?P<A>a1)|(?P<A>a2)b)/J
+ a1b\GA
+ a2b\GA
+ ** Failers
+ a1b\GZ\GA
+
+/^(?P<A>a)(?P<A>b)/J
+ ab\GA
+
+/^(?P<A>a)(?P<A>b)|cd/J
+ ab\GA
+ cd\GA
+
+/^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/J
+ cdefgh\GA
+
+/(?J)^((?P<A>a1)|(?P<A>a2)b)/
+ a1b\CA
+ a2b\CA
+
+/^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/
+
+/ In this next test, J is not set at the outer level; consequently it isn't
+set in the pattern's options; consequently pcre_get_named_substring() produces
+a random value. /x
+
+/^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/
+ a bc d\CA\CB\CC
+
+/^(?P<A>a)?(?(A)a|b)/
+ aabc
+ bc
+ ** Failers
+ abc
+
+/(?:(?(ZZ)a|b)(?P<ZZ>X))+/
+ bXaX
+
+/(?:(?(2y)a|b)(X))+/
+
+/(?:(?(ZA)a|b)(?P<ZZ>X))+/
+
+/(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/
+ bbXaaX
+
+/(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/
+ (b)\\Xa\\X
+
+/(?P<ABC/
+
+/(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/
+ bXXaYYaY
+ bXYaXXaX
+
+/()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/
+ bXXaYYaY
+
+/\777/
+
+/\s*,\s*/S
+ \x0b,\x0b
+ \x0c,\x0d
+
+/^abc/m
+ xyz\nabc
+ xyz\nabc\<lf>
+ xyz\r\nabc\<lf>
+ xyz\rabc\<cr>
+ xyz\r\nabc\<crlf>
+ ** Failers
+ xyz\nabc\<cr>
+ xyz\r\nabc\<cr>
+ xyz\nabc\<crlf>
+ xyz\rabc\<crlf>
+ xyz\rabc\<lf>
+
+/abc$/m
+ xyzabc
+ xyzabc\n
+ xyzabc\npqr
+ xyzabc\r\<cr>
+ xyzabc\rpqr\<cr>
+ xyzabc\r\n\<crlf>
+ xyzabc\r\npqr\<crlf>
+ ** Failers
+ xyzabc\r
+ xyzabc\rpqr
+ xyzabc\r\n
+ xyzabc\r\npqr
+
+/^abc/m<cr>
+ xyz\rabcdef
+ xyz\nabcdef\<lf>
+ ** Failers
+ xyz\nabcdef
+
+/^abc/m<lf>
+ xyz\nabcdef
+ xyz\rabcdef\<cr>
+ ** Failers
+ xyz\rabcdef
+
+/^abc/m<crlf>
+ xyz\r\nabcdef
+ xyz\rabcdef\<cr>
+ ** Failers
+ xyz\rabcdef
+
+/^abc/m<bad>
+
+/abc/
+ xyz\rabc\<bad>
+ abc
+
+/.*/
+ abc\ndef
+ abc\rdef
+ abc\r\ndef
+ \<cr>abc\ndef
+ \<cr>abc\rdef
+ \<cr>abc\r\ndef
+ \<crlf>abc\ndef
+ \<crlf>abc\rdef
+ \<crlf>abc\r\ndef
+
+/\w+(.)(.)?def/s
+ abc\ndef
+ abc\rdef
+ abc\r\ndef
+
++((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)+
+ /* this is a C style comment */\M
+
+/(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/
+
/ End of testinput2 /
diff --git a/ext/pcre/pcrelib/testdata/testinput4 b/ext/pcre/pcrelib/testdata/testinput4
index 6e0099c64..9ff0fc7a6 100644
--- a/ext/pcre/pcrelib/testdata/testinput4
+++ b/ext/pcre/pcrelib/testdata/testinput4
@@ -510,7 +510,14 @@
/^\x{85}$/8i
\x{85}
+/^ሴ/8
+ ሴ
+
/^\ሴ/8
ሴ
+"(?s)(.{1,5})"8
+ abcdefg
+ ab
+
/ End of testinput4 /
diff --git a/ext/pcre/pcrelib/testdata/testinput5 b/ext/pcre/pcrelib/testdata/testinput5
index dc45445f6..54643f651 100644
--- a/ext/pcre/pcrelib/testdata/testinput5
+++ b/ext/pcre/pcrelib/testdata/testinput5
@@ -265,4 +265,10 @@
/^\ሴ/8D
+/\777/I
+
+/\777/8I
+ \x{1ff}
+ \777
+
/ End of testinput5 /
diff --git a/ext/pcre/pcrelib/testdata/testinput6 b/ext/pcre/pcrelib/testdata/testinput6
index a45920a17..da5b9ca23 100644
--- a/ext/pcre/pcrelib/testdata/testinput6
+++ b/ext/pcre/pcrelib/testdata/testinput6
@@ -738,4 +738,13 @@
\x{1c5}XY
AXY
+/^(\p{Z}[^\p{C}\p{Z}]+)*$/
+ \xa0!
+
+/^[\pL](abc)(?1)/
+ AabcabcYZ
+
+/([\pL]=(abc))*X/
+ L=abcX
+
/ End of testinput6 /
diff --git a/ext/pcre/pcrelib/testdata/testinput7 b/ext/pcre/pcrelib/testdata/testinput7
index 0c7418ed3..6c8e86474 100644
--- a/ext/pcre/pcrelib/testdata/testinput7
+++ b/ext/pcre/pcrelib/testdata/testinput7
@@ -1908,11 +1908,11 @@
/(abc)\323/
abc\xd3
-/(abc)\500/
+/(abc)\100/
abc\x40
abc\100
-/(abc)\5000/
+/(abc)\1000/
abc\x400
abc\x40\x30
abc\1000
@@ -4018,4 +4018,100 @@
123\P
4\P\R
+/^/mg
+ a\nb\nc\n
+ \
+
+/(?<=C\n)^/mg
+ A\nC\nC\n
+
+/(?s)A?B/
+ AB
+ aB
+
+/(?s)A*B/
+ AB
+ aB
+
+/(?m)A?B/
+ AB
+ aB
+
+/(?m)A*B/
+ AB
+ aB
+
+/Content-Type\x3A[^\r\n]{6,}/
+ Content-Type:xxxxxyyy
+
+/Content-Type\x3A[^\r\n]{6,}z/
+ Content-Type:xxxxxyyyz
+
+/Content-Type\x3A[^a]{6,}/
+ Content-Type:xxxyyy
+
+/Content-Type\x3A[^a]{6,}z/
+ Content-Type:xxxyyyz
+
+/^abc/m
+ xyz\nabc
+ xyz\nabc\<lf>
+ xyz\r\nabc\<lf>
+ xyz\rabc\<cr>
+ xyz\r\nabc\<crlf>
+ ** Failers
+ xyz\nabc\<cr>
+ xyz\r\nabc\<cr>
+ xyz\nabc\<crlf>
+ xyz\rabc\<crlf>
+ xyz\rabc\<lf>
+
+/abc$/m
+ xyzabc
+ xyzabc\n
+ xyzabc\npqr
+ xyzabc\r\<cr>
+ xyzabc\rpqr\<cr>
+ xyzabc\r\n\<crlf>
+ xyzabc\r\npqr\<crlf>
+ ** Failers
+ xyzabc\r
+ xyzabc\rpqr
+ xyzabc\r\n
+ xyzabc\r\npqr
+
+/^abc/m<cr>
+ xyz\rabcdef
+ xyz\nabcdef\<lf>
+ ** Failers
+ xyz\nabcdef
+
+/^abc/m<lf>
+ xyz\nabcdef
+ xyz\rabcdef\<cr>
+ ** Failers
+ xyz\rabcdef
+
+/^abc/m<crlf>
+ xyz\r\nabcdef
+ xyz\rabcdef\<cr>
+ ** Failers
+ xyz\rabcdef
+
+/.*/
+ abc\ndef
+ abc\rdef
+ abc\r\ndef
+ \<cr>abc\ndef
+ \<cr>abc\rdef
+ \<cr>abc\r\ndef
+ \<crlf>abc\ndef
+ \<crlf>abc\rdef
+ \<crlf>abc\r\ndef
+
+/\w+(.)(.)?def/s
+ abc\ndef
+ abc\rdef
+ abc\r\ndef
+
/ End of testinput7 /
diff --git a/ext/pcre/pcrelib/testdata/testoutput1 b/ext/pcre/pcrelib/testdata/testoutput1
index 3fdde0aab..a71f41a38 100644
--- a/ext/pcre/pcrelib/testdata/testoutput1
+++ b/ext/pcre/pcrelib/testdata/testoutput1
@@ -2126,7 +2126,7 @@ No match
0: abc\xd3
1: abc
-/(abc)\500/
+/(abc)\100/
abc\x40
0: abc@
1: abc
@@ -2134,7 +2134,7 @@ No match
0: abc@
1: abc
-/(abc)\5000/
+/(abc)\1000/
abc\x400
0: abc@0
1: abc
@@ -6281,4 +6281,76 @@ No match
abcddefg
No match
+/(?<![^f]oo)(bar)/
+ foobarX
+ 0: bar
+ 1: bar
+ ** Failers
+No match
+ boobarX
+No match
+
+/(?<![^f])X/
+ offX
+ 0: X
+ ** Failers
+No match
+ onyX
+No match
+
+/(?<=[^f])X/
+ onyX
+ 0: X
+ ** Failers
+No match
+ offX
+No match
+
+/^/mg
+ a\nb\nc\n
+ 0:
+ 0:
+ 0:
+ \
+ 0:
+
+/(?<=C\n)^/mg
+ A\nC\nC\n
+ 0:
+
+/(?:(?(1)a|b)(X))+/
+ bXaX
+ 0: bXaX
+ 1: X
+
+/(?:(?(1)\1a|b)(X|Y))+/
+ bXXaYYaY
+ 0: bXXaYYaY
+ 1: Y
+ bXYaXXaX
+ 0: bX
+ 1: X
+
+/()()()()()()()()()(?:(?(10)\10a|b)(X|Y))+/
+ bXXaYYaY
+ 0: bX
+ 1:
+ 2:
+ 3:
+ 4:
+ 5:
+ 6:
+ 7:
+ 8:
+ 9:
+10: X
+
+/[[,abc,]+]/
+ abc]
+ 0: abc]
+ a,b]
+ 0: a,b]
+ [a,b,c]
+ 0: [a,b,c]
+
/ End of testinput1 /
diff --git a/ext/pcre/pcrelib/testdata/testoutput2 b/ext/pcre/pcrelib/testdata/testoutput2
index 55adba0b9..bcde70856 100644
--- a/ext/pcre/pcrelib/testdata/testoutput2
+++ b/ext/pcre/pcrelib/testdata/testoutput2
@@ -115,14 +115,14 @@ Failed: unrecognized character after (? at offset 2
Capturing subpattern count = 0
Partial matching not supported
No options
-First char at start or follows \n
+First char at start or follows newline
Need char = 'b'
/.*?b/
Capturing subpattern count = 0
Partial matching not supported
No options
-First char at start or follows \n
+First char at start or follows newline
Need char = 'b'
/cat|dog|elephant/
@@ -326,7 +326,7 @@ No need char
Capturing subpattern count = 3
Partial matching not supported
No options
-First char at start or follows \n
+First char at start or follows newline
No need char
defabc
0: defabc
@@ -517,7 +517,6 @@ No need char
/(^b|(?i)^d)/
Capturing subpattern count = 1
Options: anchored
-Case state changes
No first char
No need char
@@ -552,13 +551,13 @@ Starting byte set: b c x y
/(^a|^b)/m
Capturing subpattern count = 1
Options: multiline
-First char at start or follows \n
+First char at start or follows newline
No need char
/(?i)(^a|^b)/m
Capturing subpattern count = 1
Options: caseless multiline
-First char at start or follows \n
+First char at start or follows newline
No need char
/(a)(?(1)a|b|c)/
@@ -568,13 +567,13 @@ Failed: conditional group contains more than two branches at offset 13
Failed: conditional group contains more than two branches at offset 12
/(?(1a)/
-Failed: malformed number after (?( at offset 4
+Failed: reference to non-existent subpattern at offset 6
/(?(?i))/
Failed: assertion expected after (?( at offset 3
/(?(abc))/
-Failed: assertion expected after (?( at offset 3
+Failed: reference to non-existent subpattern at offset 7
/(?(?<ab))/
Failed: unrecognized character after (?< at offset 5
@@ -592,7 +591,6 @@ 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)
@@ -609,7 +607,6 @@ Need char = 'h' (caseless)
------------------------------------------------------------------
Capturing subpattern count = 1
No options
-Case state changes
First char = 'b' (caseless)
No need char
Study returned NULL
@@ -618,7 +615,6 @@ Study returned NULL
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
@@ -664,7 +660,7 @@ No need char
/^abc/m
Capturing subpattern count = 0
Options: multiline
-First char at start or follows \n
+First char at start or follows newline
Need char = 'c'
/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
@@ -721,7 +717,7 @@ No match
/^(?<=foo\n)bar/m
Capturing subpattern count = 0
Options: multiline
-First char at start or follows \n
+First char at start or follows newline
Need char = 'r'
foo\nbarbar
0: bar
@@ -737,7 +733,7 @@ No match
/(?>^abc)/m
Capturing subpattern count = 0
Options: multiline
-First char at start or follows \n
+First char at start or follows newline
Need char = 'c'
abc
0: abc
@@ -782,7 +778,6 @@ No match
/(?<=ab(?i)x|y|z)/
Capturing subpattern count = 0
No options
-Case state changes
No first char
No need char
@@ -790,7 +785,7 @@ No need char
Capturing subpattern count = 2
Partial matching not supported
No options
-First char at start or follows \n
+First char at start or follows newline
No need char
alphabetabcd
0: alphabetabcd
@@ -803,7 +798,6 @@ No need char
/(?<=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
@@ -966,7 +960,7 @@ Failed: unrecognized character after (? at offset 3
Failed: unrecognized character after (? at offset 3
/(?(1?)a|b)/
-Failed: malformed number after (?( at offset 4
+Failed: malformed number or name after (?( at offset 4
/(?(1)a|b|c)/
Failed: conditional group contains more than two branches at offset 10
@@ -1021,7 +1015,7 @@ No need char
abcdefghijklmnopqrstuvwxyz\C1
0: abcdefghijklmnopqrst
1: abcdefghijklmnopqrst
-copy substring 1 failed -6
+ 1C abcdefghijklmnopqrst (20)
abcdefghijklmnopqrstuvwxyz\G1
0: abcdefghijklmnopqrst
1: abcdefghijklmnopqrst
@@ -1054,7 +1048,7 @@ No need char
abcdefghijklmnopqrstuvwxyz\C1\G1\L
0: abcdefghijklmnop
1: abcdefghijklmnop
-copy substring 1 failed -6
+ 1C abcdefghijklmnop (16)
1G abcdefghijklmnop (16)
0L abcdefghijklmnop
1L abcdefghijklmnop
@@ -1128,7 +1122,7 @@ Need char = 'd'
Capturing subpattern count = 0
Partial matching not supported
No options
-First char at start or follows \n
+First char at start or follows newline
Need char = 'X'
/.*X/Ds
@@ -1161,7 +1155,7 @@ Need char = 'X'
Capturing subpattern count = 1
Partial matching not supported
No options
-First char at start or follows \n
+First char at start or follows newline
No need char
/(.*X|^B)/Ds
@@ -1221,7 +1215,7 @@ No need char
Capturing subpattern count = 0
Partial matching not supported
No options
-First char at start or follows \n
+First char at start or follows newline
No need char
/\Biss\B/+
@@ -1306,7 +1300,7 @@ No need char
Capturing subpattern count = 0
Partial matching not supported
No options
-First char at start or follows \n
+First char at start or follows newline
Need char = 's'
abciss\nxyzisspqr
0: abciss
@@ -1365,7 +1359,7 @@ No need char
/^ab\n/mg+
Capturing subpattern count = 0
Options: multiline
-First char at start or follows \n
+First char at start or follows newline
Need char = 10
ab\nab\ncd
0: ab\x0a
@@ -2223,7 +2217,6 @@ No need char
/((?-i)[[:lower:]])[[:lower:]]/i
Capturing subpattern count = 1
Options: caseless
-Case state changes
No first char
No need char
ab
@@ -2240,11 +2233,11 @@ No match
AB
No match
-/[\200-\410]/
+/[\200-\110]/
Failed: range out of order in character class at offset 9
/^(?(0)f|b)oo/
-Failed: invalid condition (?(0) at offset 5
+Failed: invalid condition (?(0) at offset 6
/This one's here because of the large output vector needed/
Capturing subpattern count = 0
@@ -2761,7 +2754,6 @@ No need char
------------------------------------------------------------------
Capturing subpattern count = 0
No options
-Case state changes
First char = 'a'
Need char = 'b' (caseless)
ab
@@ -2787,7 +2779,6 @@ No match
------------------------------------------------------------------
Capturing subpattern count = 1
No options
-Case state changes
First char = 'a'
Need char = 'b' (caseless)
ab
@@ -3370,7 +3361,7 @@ No need char
Capturing subpattern count = 1
Partial matching not supported
No options
-First char at start or follows \n
+First char at start or follows newline
No need char
/(.*)\d+\1/Is
@@ -3393,7 +3384,7 @@ Capturing subpattern count = 2
Max back reference = 2
Partial matching not supported
No options
-First char at start or follows \n
+First char at start or follows newline
Need char = 'z'
/((.*))\d+\1/I
@@ -3430,7 +3421,6 @@ Need char = 'z' (caseless)
/(?=abc)(?i).xyz/I
Capturing subpattern count = 0
No options
-Case state changes
First char = 'a'
Need char = 'z' (caseless)
@@ -3553,7 +3543,7 @@ Need char = 'b'
/^a/mI
Capturing subpattern count = 0
Options: multiline
-First char at start or follows \n
+First char at start or follows newline
Need char = 'a'
abcde
0: a
@@ -3580,7 +3570,6 @@ 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
@@ -4503,12 +4492,12 @@ No first char
Need char = 'z'
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M
Minimum match() limit = 8
-Minimum match() recursion limit = 7
+Minimum match() recursion limit = 6
0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz
1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaz\M
Minimum match() limit = 32768
-Minimum match() recursion limit = 43
+Minimum match() recursion limit = 42
No match
/(aaa(?C1)bbb|ab)/
@@ -4555,18 +4544,19 @@ Need char = 'h'
1: cd
2: gh
1C cd (2)
- 2G gh (2)
+ G gh (2) two
abcdefgh\Cone\Ctwo
0: abcdefgh
1: cd
2: gh
- 1C cd (2)
- 2C gh (2)
+ C cd (2) one
+ C gh (2) two
abcdefgh\Cthree
no parentheses with name "three"
0: abcdefgh
1: cd
2: gh
+copy substring three failed -7
/(?P<Tes>)(?P<Test>)/D
------------------------------------------------------------------
@@ -4616,18 +4606,18 @@ Need char = 'a'
0: zzaa
1: zz
2: aa
- 1C zz (2)
+ C zz (2) Z
zzaa\CA
0: zzaa
1: zz
2: aa
- 2C aa (2)
+ C aa (2) A
/(?P<x>eks)(?P<x>eccs)/
-Failed: two named groups have the same name at offset 16
+Failed: two named subpatterns 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
+Failed: two named subpatterns have the same name at offset 31
"\[((?P<elem>\d+)(,(?P>elem))*)\]"
Capturing subpattern count = 3
@@ -5769,7 +5759,6 @@ Failed: number too big in {} quantifier at offset 15
Capturing subpattern count = 1
Max back reference = 1
No options
-Case state changes
First char = 'a' (caseless)
Need char = 'B'
abcdefghijklAkB
@@ -6059,6 +6048,505 @@ No options
First char = 255
No need char
+/^((?P<A>a1)|(?P<A>a2)b)/
+Failed: two named subpatterns have the same name at offset 18
+
+/^((?P<A>a1)|(?P<A>a2)b)/J
+Capturing subpattern count = 3
+Named capturing subpatterns:
+ A 2
+ A 3
+Options: anchored dupnames
+No first char
+No need char
+ a1b\CA
+ 0: a1
+ 1: a1
+ 2: a1
+ C a1 (2) A
+ a2b\CA
+ 0: a2b
+ 1: a2b
+ 2: <unset>
+ 3: a2
+ C a2 (2) A
+ ** Failers
+No match
+ a1b\CZ\CA
+no parentheses with name "Z"
+ 0: a1
+ 1: a1
+ 2: a1
+copy substring Z failed -7
+ C a1 (2) A
+
+/^(?P<A>a)(?P<A>b)/J
+Capturing subpattern count = 2
+Named capturing subpatterns:
+ A 1
+ A 2
+Options: anchored dupnames
+No first char
+No need char
+ ab\CA
+ 0: ab
+ 1: a
+ 2: b
+ C a (1) A
+
+/^(?P<A>a)(?P<A>b)|cd/J
+Capturing subpattern count = 2
+Named capturing subpatterns:
+ A 1
+ A 2
+Options: dupnames
+No first char
+No need char
+ ab\CA
+ 0: ab
+ 1: a
+ 2: b
+ C a (1) A
+ cd\CA
+ 0: cd
+copy substring A failed -7
+
+/^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/J
+Capturing subpattern count = 4
+Named capturing subpatterns:
+ A 1
+ A 2
+ A 3
+ A 4
+Options: dupnames
+No first char
+No need char
+ cdefgh\CA
+ 0: cdefgh
+ 1: <unset>
+ 2: <unset>
+ 3: ef
+ 4: gh
+ C ef (2) A
+
+/^((?P<A>a1)|(?P<A>a2)b)/J
+Capturing subpattern count = 3
+Named capturing subpatterns:
+ A 2
+ A 3
+Options: anchored dupnames
+No first char
+No need char
+ a1b\GA
+ 0: a1
+ 1: a1
+ 2: a1
+ G a1 (2) A
+ a2b\GA
+ 0: a2b
+ 1: a2b
+ 2: <unset>
+ 3: a2
+ G a2 (2) A
+ ** Failers
+No match
+ a1b\GZ\GA
+no parentheses with name "Z"
+ 0: a1
+ 1: a1
+ 2: a1
+copy substring Z failed -7
+ G a1 (2) A
+
+/^(?P<A>a)(?P<A>b)/J
+Capturing subpattern count = 2
+Named capturing subpatterns:
+ A 1
+ A 2
+Options: anchored dupnames
+No first char
+No need char
+ ab\GA
+ 0: ab
+ 1: a
+ 2: b
+ G a (1) A
+
+/^(?P<A>a)(?P<A>b)|cd/J
+Capturing subpattern count = 2
+Named capturing subpatterns:
+ A 1
+ A 2
+Options: dupnames
+No first char
+No need char
+ ab\GA
+ 0: ab
+ 1: a
+ 2: b
+ G a (1) A
+ cd\GA
+ 0: cd
+copy substring A failed -7
+
+/^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/J
+Capturing subpattern count = 4
+Named capturing subpatterns:
+ A 1
+ A 2
+ A 3
+ A 4
+Options: dupnames
+No first char
+No need char
+ cdefgh\GA
+ 0: cdefgh
+ 1: <unset>
+ 2: <unset>
+ 3: ef
+ 4: gh
+ G ef (2) A
+
+/(?J)^((?P<A>a1)|(?P<A>a2)b)/
+Capturing subpattern count = 3
+Named capturing subpatterns:
+ A 2
+ A 3
+Options: anchored dupnames
+No first char
+No need char
+ a1b\CA
+ 0: a1
+ 1: a1
+ 2: a1
+ C a1 (2) A
+ a2b\CA
+ 0: a2b
+ 1: a2b
+ 2: <unset>
+ 3: a2
+ C a2 (2) A
+
+/^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/
+Failed: two named subpatterns have the same name at offset 38
+
+/ In this next test, J is not set at the outer level; consequently it isn't
+set in the pattern's options; consequently pcre_get_named_substring() produces
+a random value. /x
+Capturing subpattern count = 1
+Options: extended
+First char = 'I'
+Need char = 'e'
+
+/^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/
+Capturing subpattern count = 4
+Named capturing subpatterns:
+ A 1
+ B 2
+ B 3
+ C 4
+Options: anchored
+No first char
+No need char
+ a bc d\CA\CB\CC
+ 0: a bc d
+ 1: a
+ 2: b
+ 3: c
+ 4: d
+ C a (1) A
+ C b (1) B
+ C d (1) C
+
+/^(?P<A>a)?(?(A)a|b)/
+Capturing subpattern count = 1
+Named capturing subpatterns:
+ A 1
+Options: anchored
+No first char
+No need char
+ aabc
+ 0: aa
+ 1: a
+ bc
+ 0: b
+ ** Failers
+No match
+ abc
+No match
+
+/(?:(?(ZZ)a|b)(?P<ZZ>X))+/
+Capturing subpattern count = 1
+Named capturing subpatterns:
+ ZZ 1
+No options
+No first char
+Need char = 'X'
+ bXaX
+ 0: bXaX
+ 1: X
+
+/(?:(?(2y)a|b)(X))+/
+Failed: reference to non-existent subpattern at offset 9
+
+/(?:(?(ZA)a|b)(?P<ZZ>X))+/
+Failed: reference to non-existent subpattern at offset 9
+
+/(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/
+Capturing subpattern count = 1
+Named capturing subpatterns:
+ ZZ 1
+No options
+No first char
+Need char = 'X'
+ bbXaaX
+ 0: bbXaaX
+ 1: X
+
+/(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/
+Capturing subpattern count = 1
+Named capturing subpatterns:
+ ZZ 1
+No options
+No first char
+Need char = 'X'
+ (b)\\Xa\\X
+ 0: (b)\Xa\X
+ 1: X
+
+/(?P<ABC/
+Failed: syntax error after (?P at offset 7
+
+/(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/
+Capturing subpattern count = 1
+Max back reference = 1
+Named capturing subpatterns:
+ A 1
+No options
+No first char
+No need char
+ bXXaYYaY
+ 0: bXXaYYaY
+ 1: Y
+ bXYaXXaX
+ 0: bX
+ 1: X
+
+/()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/
+Capturing subpattern count = 10
+Max back reference = 10
+Named capturing subpatterns:
+ A 10
+No options
+No first char
+No need char
+ bXXaYYaY
+ 0: bXXaYYaY
+ 1:
+ 2:
+ 3:
+ 4:
+ 5:
+ 6:
+ 7:
+ 8:
+ 9:
+10: Y
+
+/\777/
+Failed: octal value is greater than \377 (not in UTF-8 mode) at offset 3
+
+/\s*,\s*/S
+Capturing subpattern count = 0
+Partial matching not supported
+No options
+No first char
+Need char = ','
+Starting byte set: \x09 \x0a \x0c \x0d \x20 ,
+ \x0b,\x0b
+ 0: ,
+ \x0c,\x0d
+ 0: \x0c,\x0d
+
+/^abc/m
+Capturing subpattern count = 0
+Options: multiline
+First char at start or follows newline
+Need char = 'c'
+ xyz\nabc
+ 0: abc
+ xyz\nabc\<lf>
+ 0: abc
+ xyz\r\nabc\<lf>
+ 0: abc
+ xyz\rabc\<cr>
+ 0: abc
+ xyz\r\nabc\<crlf>
+ 0: abc
+ ** Failers
+No match
+ xyz\nabc\<cr>
+No match
+ xyz\r\nabc\<cr>
+No match
+ xyz\nabc\<crlf>
+No match
+ xyz\rabc\<crlf>
+No match
+ xyz\rabc\<lf>
+No match
+
+/abc$/m
+Capturing subpattern count = 0
+Options: multiline
+First char = 'a'
+Need char = 'c'
+ xyzabc
+ 0: abc
+ xyzabc\n
+ 0: abc
+ xyzabc\npqr
+ 0: abc
+ xyzabc\r\<cr>
+ 0: abc
+ xyzabc\rpqr\<cr>
+ 0: abc
+ xyzabc\r\n\<crlf>
+ 0: abc
+ xyzabc\r\npqr\<crlf>
+ 0: abc
+ ** Failers
+No match
+ xyzabc\r
+No match
+ xyzabc\rpqr
+No match
+ xyzabc\r\n
+No match
+ xyzabc\r\npqr
+No match
+
+/^abc/m<cr>
+Capturing subpattern count = 0
+Options: multiline
+Forced newline sequence: CR
+First char at start or follows newline
+Need char = 'c'
+ xyz\rabcdef
+ 0: abc
+ xyz\nabcdef\<lf>
+ 0: abc
+ ** Failers
+No match
+ xyz\nabcdef
+No match
+
+/^abc/m<lf>
+Capturing subpattern count = 0
+Options: multiline
+Forced newline sequence: LF
+First char at start or follows newline
+Need char = 'c'
+ xyz\nabcdef
+ 0: abc
+ xyz\rabcdef\<cr>
+ 0: abc
+ ** Failers
+No match
+ xyz\rabcdef
+No match
+
+/^abc/m<crlf>
+Capturing subpattern count = 0
+Options: multiline
+Forced newline sequence: CRLF
+First char at start or follows newline
+Need char = 'c'
+ xyz\r\nabcdef
+ 0: abc
+ xyz\rabcdef\<cr>
+ 0: abc
+ ** Failers
+No match
+ xyz\rabcdef
+No match
+
+/^abc/m<bad>
+Unknown newline type at: <bad>
+
+
+/abc/
+Capturing subpattern count = 0
+No options
+First char = 'a'
+Need char = 'c'
+ xyz\rabc\<bad>
+Unknown newline type at: <bad>
+ abc
+ 0: abc
+
+/.*/
+Capturing subpattern count = 0
+Partial matching not supported
+No options
+First char at start or follows newline
+No need char
+ abc\ndef
+ 0: abc
+ abc\rdef
+ 0: abc\x0ddef
+ abc\r\ndef
+ 0: abc\x0d
+ \<cr>abc\ndef
+ 0: abc\x0adef
+ \<cr>abc\rdef
+ 0: abc
+ \<cr>abc\r\ndef
+ 0: abc
+ \<crlf>abc\ndef
+ 0: abc\x0adef
+ \<crlf>abc\rdef
+ 0: abc\x0ddef
+ \<crlf>abc\r\ndef
+ 0: abc
+
+/\w+(.)(.)?def/s
+Capturing subpattern count = 2
+Partial matching not supported
+Options: dotall
+No first char
+Need char = 'f'
+ abc\ndef
+ 0: abc\x0adef
+ 1: \x0a
+ abc\rdef
+ 0: abc\x0ddef
+ 1: \x0d
+ abc\r\ndef
+ 0: abc\x0d\x0adef
+ 1: \x0d
+ 2: \x0a
+
++((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)+
+Capturing subpattern count = 1
+Partial matching not supported
+No options
+No first char
+No need char
+ /* this is a C style comment */\M
+Minimum match() limit = 120
+Minimum match() recursion limit = 6
+ 0: /* this is a C style comment */
+ 1: /* this is a C style comment */
+
+/(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/
+Capturing subpattern count = 1
+Named capturing subpatterns:
+ B 1
+No options
+No first char
+Need char = '.'
+
/ End of testinput2 /
Capturing subpattern count = 0
No options
diff --git a/ext/pcre/pcrelib/testdata/testoutput4 b/ext/pcre/pcrelib/testdata/testoutput4
index 1b98f86a3..3b4945507 100644
--- a/ext/pcre/pcrelib/testdata/testoutput4
+++ b/ext/pcre/pcrelib/testdata/testoutput4
@@ -898,8 +898,20 @@ No match
\x{85}
0: \x{85}
+/^ሴ/8
+ ሴ
+ 0: \x{1234}
+
/^\ሴ/8
ሴ
0: \x{1234}
+"(?s)(.{1,5})"8
+ abcdefg
+ 0: abcde
+ 1: abcde
+ ab
+ 0: ab
+ 1: ab
+
/ End of testinput4 /
diff --git a/ext/pcre/pcrelib/testdata/testoutput5 b/ext/pcre/pcrelib/testdata/testoutput5
index 533fd84b6..2c5e3c09c 100644
--- a/ext/pcre/pcrelib/testdata/testoutput5
+++ b/ext/pcre/pcrelib/testdata/testoutput5
@@ -1107,4 +1107,17 @@ Options: anchored utf8
No first char
No need char
+/\777/I
+Failed: octal value is greater than \377 (not in UTF-8 mode) at offset 3
+
+/\777/8I
+Capturing subpattern count = 0
+Options: utf8
+First char = 199
+Need char = 191
+ \x{1ff}
+ 0: \x{1ff}
+ \777
+ 0: \x{1ff}
+
/ End of testinput5 /
diff --git a/ext/pcre/pcrelib/testdata/testoutput6 b/ext/pcre/pcrelib/testdata/testoutput6
index 87833bd26..ee174a6b0 100644
--- a/ext/pcre/pcrelib/testdata/testoutput6
+++ b/ext/pcre/pcrelib/testdata/testoutput6
@@ -1394,4 +1394,20 @@ No match
AXY
No match
+/^(\p{Z}[^\p{C}\p{Z}]+)*$/
+ \xa0!
+ 0: \xa0!
+ 1: \xa0!
+
+/^[\pL](abc)(?1)/
+ AabcabcYZ
+ 0: Aabcabc
+ 1: abc
+
+/([\pL]=(abc))*X/
+ L=abcX
+ 0: L=abcX
+ 1: L=abc
+ 2: abc
+
/ End of testinput6 /
diff --git a/ext/pcre/pcrelib/testdata/testoutput7 b/ext/pcre/pcrelib/testdata/testoutput7
index b50abeef8..24a3ba8e5 100644
--- a/ext/pcre/pcrelib/testdata/testoutput7
+++ b/ext/pcre/pcrelib/testdata/testoutput7
@@ -3003,13 +3003,13 @@ No match
abc\xd3
0: abc\xd3
-/(abc)\500/
+/(abc)\100/
abc\x40
0: abc@
abc\100
0: abc@
-/(abc)\5000/
+/(abc)\1000/
abc\x400
0: abc@0
abc\x40\x30
@@ -6522,4 +6522,210 @@ Partial match: 123
4\P\R
0: 4
+/^/mg
+ a\nb\nc\n
+ 0:
+ 0:
+ 0:
+ \
+ 0:
+
+/(?<=C\n)^/mg
+ A\nC\nC\n
+ 0:
+
+/(?s)A?B/
+ AB
+ 0: AB
+ aB
+ 0: B
+
+/(?s)A*B/
+ AB
+ 0: AB
+ aB
+ 0: B
+
+/(?m)A?B/
+ AB
+ 0: AB
+ aB
+ 0: B
+
+/(?m)A*B/
+ AB
+ 0: AB
+ aB
+ 0: B
+
+/Content-Type\x3A[^\r\n]{6,}/
+ Content-Type:xxxxxyyy
+ 0: Content-Type:xxxxxyyy
+ 1: Content-Type:xxxxxyy
+ 2: Content-Type:xxxxxy
+
+/Content-Type\x3A[^\r\n]{6,}z/
+ Content-Type:xxxxxyyyz
+ 0: Content-Type:xxxxxyyyz
+
+/Content-Type\x3A[^a]{6,}/
+ Content-Type:xxxyyy
+ 0: Content-Type:xxxyyy
+
+/Content-Type\x3A[^a]{6,}z/
+ Content-Type:xxxyyyz
+ 0: Content-Type:xxxyyyz
+
+/^abc/m
+ xyz\nabc
+ 0: abc
+ xyz\nabc\<lf>
+ 0: abc
+ xyz\r\nabc\<lf>
+ 0: abc
+ xyz\rabc\<cr>
+ 0: abc
+ xyz\r\nabc\<crlf>
+ 0: abc
+ ** Failers
+No match
+ xyz\nabc\<cr>
+No match
+ xyz\r\nabc\<cr>
+No match
+ xyz\nabc\<crlf>
+No match
+ xyz\rabc\<crlf>
+No match
+ xyz\rabc\<lf>
+No match
+
+/abc$/m
+ xyzabc
+ 0: abc
+ xyzabc\n
+ 0: abc
+ xyzabc\npqr
+ 0: abc
+ xyzabc\r\<cr>
+ 0: abc
+ xyzabc\rpqr\<cr>
+ 0: abc
+ xyzabc\r\n\<crlf>
+ 0: abc
+ xyzabc\r\npqr\<crlf>
+ 0: abc
+ ** Failers
+No match
+ xyzabc\r
+No match
+ xyzabc\rpqr
+No match
+ xyzabc\r\n
+No match
+ xyzabc\r\npqr
+No match
+
+/^abc/m<cr>
+ xyz\rabcdef
+ 0: abc
+ xyz\nabcdef\<lf>
+ 0: abc
+ ** Failers
+No match
+ xyz\nabcdef
+No match
+
+/^abc/m<lf>
+ xyz\nabcdef
+ 0: abc
+ xyz\rabcdef\<cr>
+ 0: abc
+ ** Failers
+No match
+ xyz\rabcdef
+No match
+
+/^abc/m<crlf>
+ xyz\r\nabcdef
+ 0: abc
+ xyz\rabcdef\<cr>
+ 0: abc
+ ** Failers
+No match
+ xyz\rabcdef
+No match
+
+/.*/
+ abc\ndef
+ 0: abc
+ 1: ab
+ 2: a
+ 3:
+ abc\rdef
+ 0: abc\x0ddef
+ 1: abc\x0dde
+ 2: abc\x0dd
+ 3: abc\x0d
+ 4: abc
+ 5: ab
+ 6: a
+ 7:
+ abc\r\ndef
+ 0: abc\x0d
+ 1: abc
+ 2: ab
+ 3: a
+ 4:
+ \<cr>abc\ndef
+ 0: abc\x0adef
+ 1: abc\x0ade
+ 2: abc\x0ad
+ 3: abc\x0a
+ 4: abc
+ 5: ab
+ 6: a
+ 7:
+ \<cr>abc\rdef
+ 0: abc
+ 1: ab
+ 2: a
+ 3:
+ \<cr>abc\r\ndef
+ 0: abc
+ 1: ab
+ 2: a
+ 3:
+ \<crlf>abc\ndef
+ 0: abc\x0adef
+ 1: abc\x0ade
+ 2: abc\x0ad
+ 3: abc\x0a
+ 4: abc
+ 5: ab
+ 6: a
+ 7:
+ \<crlf>abc\rdef
+ 0: abc\x0ddef
+ 1: abc\x0dde
+ 2: abc\x0dd
+ 3: abc\x0d
+ 4: abc
+ 5: ab
+ 6: a
+ 7:
+ \<crlf>abc\r\ndef
+ 0: abc
+ 1: ab
+ 2: a
+ 3:
+
+/\w+(.)(.)?def/s
+ abc\ndef
+ 0: abc\x0adef
+ abc\rdef
+ 0: abc\x0ddef
+ abc\r\ndef
+ 0: abc\x0d\x0adef
+
/ End of testinput7 /
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index d1cdc1195..61a153ea5 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -16,13 +16,14 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pcre.c,v 1.168.2.9 2006/04/11 21:33:46 andrei Exp $ */
+/* $Id: php_pcre.c,v 1.168.2.9.2.12 2006/10/10 12:44:02 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
+#include "php_ini.h"
#include "php_globals.h"
#include "php_pcre.h"
#include "ext/standard/info.h"
@@ -44,14 +45,52 @@
#define PREG_GREP_INVERT (1<<0)
+#define PCRE_CACHE_SIZE 4096
+
+enum {
+ PHP_PCRE_NO_ERROR = 0,
+ PHP_PCRE_INTERNAL_ERROR,
+ PHP_PCRE_BACKTRACK_LIMIT_ERROR,
+ PHP_PCRE_RECURSION_LIMIT_ERROR,
+ PHP_PCRE_BAD_UTF8_ERROR,
+};
+
+
+ZEND_DECLARE_MODULE_GLOBALS(pcre);
+
+
+static void pcre_handle_exec_error(int pcre_code TSRMLS_DC)
+{
+ int preg_code = 0;
+
+ switch (pcre_code) {
+ case PCRE_ERROR_MATCHLIMIT:
+ preg_code = PHP_PCRE_BACKTRACK_LIMIT_ERROR;
+ break;
+
+ case PCRE_ERROR_RECURSIONLIMIT:
+ preg_code = PHP_PCRE_RECURSION_LIMIT_ERROR;
+ break;
+
+ case PCRE_ERROR_BADUTF8:
+ preg_code = PHP_PCRE_BAD_UTF8_ERROR;
+ break;
+
+ default:
+ preg_code = PHP_PCRE_INTERNAL_ERROR;
+ break;
+ }
+
+ PCRE_G(error_code) = preg_code;
+}
-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 (pce->extra) pefree(pce->extra, 1);
#if HAVE_SETLOCALE
if ((void*)pce->tables) pefree((void*)pce->tables, 1);
pefree(pce->locale, 1);
@@ -59,16 +98,24 @@ static void php_free_pcre_cache(void *data)
}
-static void php_pcre_init_globals(zend_pcre_globals *pcre_globals TSRMLS_DC)
+static PHP_GINIT_FUNCTION(pcre)
{
zend_hash_init(&pcre_globals->pcre_cache, 0, NULL, php_free_pcre_cache, 1);
+ pcre_globals->backtrack_limit = 0;
+ pcre_globals->recursion_limit = 0;
+ pcre_globals->error_code = PHP_PCRE_NO_ERROR;
}
-static void php_pcre_shutdown_globals(zend_pcre_globals *pcre_globals TSRMLS_DC)
+static PHP_GSHUTDOWN_FUNCTION(pcre)
{
zend_hash_destroy(&pcre_globals->pcre_cache);
}
+PHP_INI_BEGIN()
+ STD_PHP_INI_ENTRY("pcre.backtrack_limit", "100000", PHP_INI_ALL, OnUpdateLong, backtrack_limit, zend_pcre_globals, pcre_globals)
+ STD_PHP_INI_ENTRY("pcre.recursion_limit", "100000", PHP_INI_ALL, OnUpdateLong, recursion_limit, zend_pcre_globals, pcre_globals)
+PHP_INI_END()
+
/* {{{ PHP_MINFO_FUNCTION(pcre) */
static PHP_MINFO_FUNCTION(pcre)
@@ -83,7 +130,7 @@ static PHP_MINFO_FUNCTION(pcre)
/* {{{ PHP_MINIT_FUNCTION(pcre) */
static PHP_MINIT_FUNCTION(pcre)
{
- ZEND_INIT_MODULE_GLOBALS(pcre, php_pcre_init_globals, php_pcre_shutdown_globals);
+ REGISTER_INI_ENTRIES();
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);
@@ -93,6 +140,12 @@ static PHP_MINIT_FUNCTION(pcre)
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);
+ REGISTER_LONG_CONSTANT("PREG_NO_ERROR", PHP_PCRE_NO_ERROR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PREG_INTERNAL_ERROR", PHP_PCRE_INTERNAL_ERROR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PREG_BACKTRACK_LIMIT_ERROR", PHP_PCRE_BACKTRACK_LIMIT_ERROR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PREG_RECURSION_LIMIT_ERROR", PHP_PCRE_RECURSION_LIMIT_ERROR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("PREG_BAD_UTF8_ERROR", PHP_PCRE_BAD_UTF8_ERROR, CONST_CS | CONST_PERSISTENT);
+
return SUCCESS;
}
/* }}} */
@@ -100,18 +153,12 @@ static PHP_MINIT_FUNCTION(pcre)
/* {{{ PHP_MSHUTDOWN_FUNCTION(pcre) */
static PHP_MSHUTDOWN_FUNCTION(pcre)
{
-#ifdef ZTS
- ts_free_id(pcre_globals_id);
-#else
- php_pcre_shutdown_globals(&pcre_globals TSRMLS_CC);
-#endif
+ UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
/* }}} */
-#define PCRE_CACHE_SIZE 4096
-
/* {{{ static pcre_clean_cache */
static int pcre_clean_cache(void *data, void *arg TSRMLS_DC)
{
@@ -126,31 +173,22 @@ static int pcre_clean_cache(void *data, void *arg TSRMLS_DC)
}
/* }}} */
-/* {{{ pcre_get_compiled_regex
- */
-PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC)
-{
- int compile_options;
- return pcre_get_compiled_regex_ex(regex, extra, preg_options, &compile_options TSRMLS_CC);
-}
-/* }}} */
-
-/* {{{ pcre_get_compiled_regex_ex
+/* {{{ pcre_get_compiled_regex_cache
*/
-PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *preg_options, int *compile_options TSRMLS_DC)
+PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len TSRMLS_DC)
{
pcre *re = NULL;
- int coptions = 0;
- int soptions = 0;
- const char *error;
- int erroffset;
- char delimiter;
+ pcre_extra *extra;
+ int coptions = 0;
+ int soptions = 0;
+ const char *error;
+ int erroffset;
+ char delimiter;
char start_delimiter;
char end_delimiter;
- char *p, *pp;
+ char *p, *pp;
char *pattern;
- int regex_len;
- int do_study = 0;
+ int do_study = 0;
int poptions = 0;
unsigned const char *tables = NULL;
#if HAVE_SETLOCALE
@@ -173,10 +211,7 @@ PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *pr
#if HAVE_SETLOCALE
if (!strcmp(pce->locale, locale)) {
#endif
- *extra = pce->extra;
- *preg_options = pce->preg_options;
- *compile_options = pce->compile_options;
- return pce->re;
+ return pce;
#if HAVE_SETLOCALE
}
}
@@ -249,9 +284,6 @@ PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *pr
/* 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) {
@@ -299,21 +331,26 @@ PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *pr
if (re == NULL) {
php_error_docref(NULL TSRMLS_CC,E_WARNING, "Compilation failed: %s at offset %d", error, erroffset);
efree(pattern);
+ if (tables) {
+ pefree((void*)tables, 1);
+ }
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);
+ extra = pcre_study(re, soptions, &error);
+ if (extra) {
+ extra->flags |= PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION;
+ }
if (error != NULL) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Error while studying pattern");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while studying pattern");
}
+ } else {
+ extra = NULL;
}
- *preg_options = poptions;
- *compile_options = coptions;
-
efree(pattern);
/*
@@ -328,7 +365,7 @@ PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *pr
/* Store the compiled pattern and extra info in the cache. */
new_entry.re = re;
- new_entry.extra = *extra;
+ new_entry.extra = extra;
new_entry.preg_options = poptions;
new_entry.compile_options = coptions;
#if HAVE_SETLOCALE
@@ -336,9 +373,46 @@ PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *pr
new_entry.tables = tables;
#endif
zend_hash_update(&PCRE_G(pcre_cache), regex, regex_len+1, (void *)&new_entry,
- sizeof(pcre_cache_entry), NULL);
+ 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)
+{
+ pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex, strlen(regex) TSRMLS_CC);
+
+ if (extra) {
+ *extra = pce ? pce->extra : NULL;
+ }
+ if (preg_options) {
+ *preg_options = pce ? pce->preg_options : 0;
+ }
+
+ return pce ? pce->re : NULL;
+}
+/* }}} */
- return re;
+/* {{{ 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) TSRMLS_CC);
+
+ if (extra) {
+ *extra = pce ? pce->extra : NULL;
+ }
+ if (preg_options) {
+ *preg_options = pce ? pce->preg_options : 0;
+ }
+ if (compile_options) {
+ *compile_options = pce ? pce->compile_options : 0;
+ }
+
+ return pce ? pce->re : NULL;
}
/* }}} */
@@ -363,50 +437,66 @@ static inline void add_offset_pair(zval *result, char *str, int len, int offset,
}
/* }}} */
-/* {{{ php_pcre_match
- */
-static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
+static void php_do_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 */
+ char *regex; /* Regular expression */
+ char *subject; /* String to match against */
+ int regex_len;
+ int subject_len;
+ pcre_cache_entry *pce; /* Compiled regular expression */
+ zval *subpats = NULL; /* Array for subpatterns */
+ long flags = 0; /* Match control flags */
+ long start_offset = 0; /* Where the new search starts */
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ((global) ? "ssz|ll" : "ss|zll"), &regex, &regex_len,
+ &subject, &subject_len, &subpats, &flags, &start_offset) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ /* Compile regex or get it from cache. */
+ if ((pce = pcre_get_compiled_regex_cache(regex, regex_len TSRMLS_CC)) == NULL) {
+ RETURN_FALSE;
+ }
+
+ php_pcre_match_impl(pce, subject, subject_len, return_value, subpats,
+ global, ZEND_NUM_ARGS() >= 4, flags, start_offset TSRMLS_CC);
+}
+PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
+ zval *subpats, int global, int use_flags, long flags, long start_offset TSRMLS_DC)
+{
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 */
+ pcre_extra *extra = pce->extra;/* Holds results of studying */
+ pcre_extra extra_data; /* Used locally for exec options */
+ int exoptions = 0; /* Execution 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 size_offsets; /* Size of the offsets array */
+ int matched; /* Has anything matched */
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"), &regex, &regex_len,
- &subject, &subject_len, &subpats, &flags, &start_offset) == FAILURE) {
- RETURN_FALSE;
+ int subpats_order; /* Order of subpattern matches */
+ int offset_capture; /* Capture match offsets: yes/no */
+
+ /* Overwrite the passed-in value for subpatterns with an empty array. */
+ if (subpats != NULL) {
+ zval_dtor(subpats);
+ array_init(subpats);
}
-
- if (global)
- subpats_order = PREG_PATTERN_ORDER;
- if (ZEND_NUM_ARGS() > 3) {
+ subpats_order = global ? PREG_PATTERN_ORDER : 0;
+
+ if (use_flags) {
offset_capture = flags & PREG_OFFSET_CAPTURE;
+
/*
* subpats_order is pre-set to pattern mode so we change it only if
* necessary.
@@ -416,15 +506,11 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
}
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));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid flags specified");
return;
}
- }
-
- /* Overwrite the passed-in value for subpatterns with an empty array. */
- if (subpats != NULL) {
- zval_dtor(subpats);
- array_init(subpats);
+ } else {
+ offset_capture = 0;
}
/* Negative offset counts from the end of the string. */
@@ -435,16 +521,17 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
}
}
- /* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(regex, &extra, &preg_options TSRMLS_CC)) == NULL) {
- RETURN_FALSE;
+ if (extra == NULL) {
+ extra_data.flags = PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION;
+ extra = &extra_data;
}
+ extra->match_limit = PCRE_G(backtrack_limit);
+ extra->match_limit_recursion = PCRE_G(recursion_limit);
/* Calculate the size of the offsets array, and allocate memory for it. */
- rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &num_subpats);
+ rc = pcre_fullinfo(pce->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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
RETURN_FALSE;
}
num_subpats++;
@@ -463,10 +550,9 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
char *name_table;
unsigned short name_idx;
- rc = pcre_fullinfo(re, extra, PCRE_INFO_NAMECOUNT, &name_cnt);
+ rc = pcre_fullinfo(pce->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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
efree(offsets);
efree(subpat_names);
RETURN_FALSE;
@@ -475,12 +561,11 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
int rc1, rc2;
long dummy_l;
double dummy_d;
- rc1 = pcre_fullinfo(re, extra, PCRE_INFO_NAMETABLE, &name_table);
- rc2 = pcre_fullinfo(re, extra, PCRE_INFO_NAMEENTRYSIZE, &name_size);
+ rc1 = pcre_fullinfo(pce->re, extra, PCRE_INFO_NAMETABLE, &name_table);
+ rc2 = pcre_fullinfo(pce->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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
efree(offsets);
efree(subpat_names);
RETURN_FALSE;
@@ -490,7 +575,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
name_idx = 0xff * name_table[0] + name_table[1];
subpat_names[name_idx] = name_table + 2;
if (is_numeric_string(subpat_names[name_idx], strlen(subpat_names[name_idx]), &dummy_l, &dummy_d, 0) > 0) {
- php_error(E_WARNING, "%s: numeric named subpatterns are not allowed", get_active_function_name(TSRMLS_C));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Numeric named subpatterns are not allowed");
efree(offsets);
efree(subpat_names);
RETURN_FALSE;
@@ -512,20 +597,21 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
match = NULL;
matched = 0;
+ PCRE_G(error_code) = PHP_PCRE_NO_ERROR;
do {
/* Execute the regular expression. */
- count = pcre_exec(re, extra, subject, subject_len, start_offset,
+ count = pcre_exec(pce->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");
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
}
/* If something has matched */
- if (count >= 0) {
+ if (count > 0) {
matched++;
match = subject + offsets[0];
@@ -535,9 +621,8 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
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;
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get subpatterns list failed");
+ RETURN_FALSE;
}
if (global) { /* global pattern matching */
@@ -605,8 +690,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
pcre_free((void *) stringlist);
}
- }
- else { /* Failed to match */
+ } else if (count == PCRE_ERROR_NOMATCH) {
/* 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
@@ -616,6 +700,9 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
offsets[1] = start_offset + 1;
} else
break;
+ } else {
+ pcre_handle_exec_error(count TSRMLS_CC);
+ break;
}
/* If we have matched an empty string, mimic what Perl's /g options does.
@@ -652,7 +739,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
Perform a Perl-style regular expression match */
PHP_FUNCTION(preg_match)
{
- php_pcre_match(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+ php_do_pcre_match(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
@@ -660,7 +747,7 @@ PHP_FUNCTION(preg_match)
Perform a Perl-style global regular expression match */
PHP_FUNCTION(preg_match_all)
{
- php_pcre_match(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+ php_do_pcre_match(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
@@ -763,7 +850,7 @@ static int preg_do_eval(char *eval_str, int eval_str_len, char *subject,
/* If found a backreference.. */
if ('\\' == *walk || '$' == *walk) {
smart_str_appendl(&code, segment, walk - segment);
- if (walk_last == '\\') {
+ if (walk_last == '\\') {
code.c[code.len-1] = *walk++;
segment = walk;
walk_last = 0;
@@ -832,13 +919,26 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_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 */
+ pcre_cache_entry *pce; /* Compiled regular expression */
+
+ /* Compile regex or get it from cache. */
+ if ((pce = pcre_get_compiled_regex_cache(regex, regex_len TSRMLS_CC)) == NULL) {
+ return NULL;
+ }
+
+ return php_pcre_replace_impl(pce, subject, subject_len, replace_val,
+ is_callable_replace, result_len, limit, replace_count TSRMLS_CC);
+}
+
+PHPAPI char *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *replace_val,
+ int is_callable_replace, int *result_len, int limit, int *replace_count TSRMLS_DC)
+{
+ pcre_extra *extra = pce->extra;/* Holds results of studying */
+ pcre_extra extra_data; /* Used locally for exec options */
+ int exoptions = 0; /* Execution 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
@@ -861,15 +961,17 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len,
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;
+ if (extra == NULL) {
+ extra_data.flags = PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION;
+ extra = &extra_data;
}
+ extra->match_limit = PCRE_G(backtrack_limit);
+ extra->match_limit_recursion = PCRE_G(recursion_limit);
- eval = preg_options & PREG_REPLACE_EVAL;
+ eval = pce->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");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modifier /e cannot be used with replacement callback");
return NULL;
}
} else {
@@ -879,10 +981,9 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len,
}
/* Calculate the size of the offsets array, and allocate memory for it. */
- rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &size_offsets);
+ rc = pcre_fullinfo(pce->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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
return NULL;
}
size_offsets = (size_offsets + 1) * 3;
@@ -895,10 +996,11 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len,
match = NULL;
*result_len = 0;
start_offset = 0;
+ PCRE_G(error_code) = PHP_PCRE_NO_ERROR;
while (1) {
/* Execute the regular expression. */
- count = pcre_exec(re, extra, subject, subject_len, start_offset,
+ count = pcre_exec(pce->re, extra, subject, subject_len, start_offset,
exoptions|g_notempty, offsets, size_offsets);
/* Check for too many substrings condition. */
@@ -915,7 +1017,7 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len,
}
/* 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 */
@@ -1000,7 +1102,7 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len,
if (limit != -1)
limit--;
- } else { /* Failed to match */
+ } else if (count == PCRE_ERROR_NOMATCH || limit == 0) {
/* 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
@@ -1025,6 +1127,11 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len,
result[*result_len] = '\0';
break;
}
+ } else {
+ pcre_handle_exec_error(count TSRMLS_CC);
+ efree(result);
+ result = NULL;
+ break;
}
/* If we have matched an empty string, mimic what Perl's /g options does.
@@ -1116,13 +1223,13 @@ static char *php_replace_in_subject(zval *regex, zval *replace, zval **subject,
} else {
result = php_pcre_replace(Z_STRVAL_P(regex),
Z_STRLEN_P(regex),
- Z_STRVAL_PP(subject),
+ Z_STRVAL_PP(subject),
Z_STRLEN_PP(subject),
replace,
is_callable_replace,
result_len,
limit,
- replace_count TSRMLS_CC);
+ replace_count TSRMLS_CC);
return result;
}
}
@@ -1137,15 +1244,15 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl
**subject,
**limit,
**subject_entry,
- **zcount;
+ **zcount;
char *result;
int result_len;
int limit_val = -1;
char *string_key;
ulong num_key;
- char *callback_name = NULL;
- int replace_count=0;
- int *replace_count_ptr=NULL;
+ char *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 ||
@@ -1153,7 +1260,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl
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.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter mismatch, pattern is a string while replacement is an array");
RETURN_FALSE;
}
@@ -1162,10 +1269,11 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl
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, '%s', to be a valid callback", callback_name);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires argument 2, '%s', to be a valid callback", callback_name);
efree(callback_name);
*return_value = **subject;
zval_copy_ctor(return_value);
+ INIT_PZVAL(return_value);
return;
}
efree(callback_name);
@@ -1243,24 +1351,40 @@ PHP_FUNCTION(preg_replace_callback)
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 */
+ char *regex; /* Regular expression */
+ char *subject; /* String to match against */
+ int regex_len;
+ int subject_len;
+ long limit_val = -1;/* Integer value of limit */
+ long flags = 0; /* Match control flags */
+ pcre_cache_entry *pce; /* Compiled regular expression */
+
+ /* Get function parameters and do error checking */
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ll", &regex, &regex_len,
+ &subject, &subject_len, &limit_val, &flags) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ /* Compile regex or get it from cache. */
+ if ((pce = pcre_get_compiled_regex_cache(regex, regex_len TSRMLS_CC)) == NULL) {
+ RETURN_FALSE;
+ }
+
+ php_pcre_split_impl(pce, subject, subject_len, return_value, limit_val, flags TSRMLS_CC);
+}
+
+/* {{{ php_pcre_split
+ */
+PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
+ long limit_val, long flags TSRMLS_DC)
+{
pcre_extra *extra = NULL; /* Holds results of studying */
+ pcre *re_bump = NULL; /* Regex instance for empty matches */
pcre_extra *extra_bump = NULL; /* Almost dummy */
- int *offsets; /* Array of subpattern offsets */
- int size_offsets; /* Size of the offsets array */
+ pcre_extra extra_data; /* Used locally for exec options */
+ 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 */
@@ -1268,44 +1392,32 @@ PHP_FUNCTION(preg_split)
char *match, /* The current match */
*last_match; /* Location of last match */
int rc;
+ int no_empty; /* If NO_EMPTY flag is set */
+ int delim_capture; /* If delimiters should be captured */
+ int offset_capture; /* If offsets should be captured */
- /* Get function parameters and do error checking */
- argc = ZEND_NUM_ARGS();
- if (argc < 2 || argc > 4 || zend_get_parameters_ex(argc, &regex, &subject, &limit, &flags) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
+ no_empty = flags & PREG_SPLIT_NO_EMPTY;
+ delim_capture = flags & PREG_SPLIT_DELIM_CAPTURE;
+ offset_capture = flags & PREG_SPLIT_OFFSET_CAPTURE;
- 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;
- }
+ if (limit_val == 0) {
+ limit_val = -1;
}
-
- /* 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;
+
+ if (extra == NULL) {
+ extra_data.flags = PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION;
+ extra = &extra_data;
}
+ extra->match_limit = PCRE_G(backtrack_limit);
+ extra->match_limit_recursion = PCRE_G(recursion_limit);
/* 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);
+ rc = pcre_fullinfo(pce->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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
RETURN_FALSE;
}
size_offsets = (size_offsets + 1) * 3;
@@ -1314,13 +1426,14 @@ PHP_FUNCTION(preg_split)
/* Start at the beginning of the string */
start_offset = 0;
next_offset = 0;
- last_match = Z_STRVAL_PP(subject);
+ last_match = subject;
match = NULL;
+ PCRE_G(error_code) = PHP_PCRE_NO_ERROR;
/* 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,
+ count = pcre_exec(pce->re, extra, subject,
+ subject_len, start_offset,
exoptions|g_notempty, offsets, size_offsets);
/* Check for too many substrings condition. */
@@ -1331,17 +1444,17 @@ PHP_FUNCTION(preg_split)
/* If something matched */
if (count > 0) {
- match = Z_STRVAL_PP(subject) + offsets[0];
+ match = subject + offsets[0];
- if (!no_empty || &Z_STRVAL_PP(subject)[offsets[0]] != last_match) {
+ if (!no_empty || &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);
+ add_offset_pair(return_value, last_match, &subject[offsets[0]]-last_match, next_offset, NULL);
} else {
- /* Add the piece to the return value */
+ /* Add the piece to the return value */
add_next_index_stringl(return_value, last_match,
- &Z_STRVAL_PP(subject)[offsets[0]]-last_match, 1);
+ &subject[offsets[0]]-last_match, 1);
}
/* One less left to do */
@@ -1349,8 +1462,8 @@ PHP_FUNCTION(preg_split)
limit_val--;
}
- last_match = &Z_STRVAL_PP(subject)[offsets[1]];
- next_offset = offsets[1];
+ last_match = &subject[offsets[1]];
+ next_offset = offsets[1];
if (delim_capture) {
int i, match_len;
@@ -1359,22 +1472,22 @@ PHP_FUNCTION(preg_split)
/* 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);
+ add_offset_pair(return_value, &subject[offsets[i<<1]], match_len, offsets[i<<1], NULL);
} else {
add_next_index_stringl(return_value,
- &Z_STRVAL_PP(subject)[offsets[i<<1]],
+ &subject[offsets[i<<1]],
match_len, 1);
}
}
}
}
- } else { /* Failed to match */
+ } else if (count == PCRE_ERROR_NOMATCH) {
/* 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 (g_notempty != 0 && start_offset < subject_len) {
+ if (pce->compile_options & PCRE_UTF8) {
if (re_bump == NULL) {
int dummy;
@@ -1382,8 +1495,8 @@ PHP_FUNCTION(preg_split)
RETURN_FALSE;
}
}
- count = pcre_exec(re_bump, extra_bump, Z_STRVAL_PP(subject),
- Z_STRLEN_PP(subject), start_offset,
+ count = pcre_exec(re_bump, extra_bump, subject,
+ subject_len, start_offset,
exoptions, offsets, size_offsets);
if (count < 1) {
php_error_docref(NULL TSRMLS_CC,E_NOTICE, "Unknown error");
@@ -1396,6 +1509,9 @@ PHP_FUNCTION(preg_split)
}
} else
break;
+ } else {
+ pcre_handle_exec_error(count TSRMLS_CC);
+ break;
}
/* If we have matched an empty string, mimic what Perl's /g options does.
@@ -1409,14 +1525,14 @@ PHP_FUNCTION(preg_split)
}
- if (!no_empty || start_offset != Z_STRLEN_PP(subject))
+ if (!no_empty || start_offset != subject_len)
{
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);
+ add_offset_pair(return_value, &subject[start_offset], subject_len - 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);
+ add_next_index_stringl(return_value, last_match, subject + subject_len - last_match, 1);
}
}
@@ -1426,48 +1542,43 @@ PHP_FUNCTION(preg_split)
}
/* }}} */
-/* {{{ proto string preg_quote(string str, string delim_char)
+/* {{{ 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 */
+ int in_str_len;
+ char *in_str; /* Input string argument */
+ char *in_str_end; /* End of the input string */
+ int delim_len;
+ char *delim = NULL; /* Additional delimiter argument */
+ char *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 */
+ 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;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &in_str, &in_str_len,
+ &delim, &delim_len) == FAILURE) {
+ return;
}
- /* 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);
+ in_str_end = in_str + in_str_len;
/* 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;
- }
+ if (delim && *delim) {
+ delim_char = 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(4, Z_STRLEN_PP(in_str_arg), 1);
+ out_str = safe_emalloc(4, in_str_len, 1);
/* Go through the string and quote necessary characters */
for(p = in_str, q = out_str; p != in_str_end; p++) {
@@ -1517,58 +1628,58 @@ PHP_FUNCTION(preg_quote)
}
/* }}} */
-/* {{{ proto array preg_grep(string regex, array input)
+/* {{{ proto array preg_grep(string regex, array input [, int flags])
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;
-
+ char *regex; /* Regular expression */
+ int regex_len;
+ zval *input; /* Input array */
+ long flags = 0; /* Match control flags */
+ pcre_cache_entry *pce; /* Compiled regular expression */
+
/* Get arguments and do error checking */
-
- if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3 ||
- zend_get_parameters_ex(ZEND_NUM_ARGS(), &regex, &input, &flags) == FAILURE) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa|l", &regex, &regex_len,
+ &input, &flags) == FAILURE) {
+ return;
}
- 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;
+ /* Compile regex or get it from cache. */
+ if ((pce = pcre_get_compiled_regex_cache(regex, regex_len TSRMLS_CC)) == NULL) {
+ RETURN_FALSE;
}
-
- SEPARATE_ZVAL(input);
- /* Make sure regex is a string */
- convert_to_string_ex(regex);
+ php_pcre_grep_impl(pce, input, return_value, flags TSRMLS_CC);
+}
- if (ZEND_NUM_ARGS() > 2) {
- convert_to_long_ex(flags);
- invert = (Z_LVAL_PP(flags) & PREG_GREP_INVERT) ? 1 : 0;
- }
+PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value,
+ long flags TSRMLS_DC)
+{
+ zval **entry; /* An entry in the input array */
+ pcre_extra *extra = pce->extra;/* Holds results of studying */
+ pcre_extra extra_data; /* Used locally for exec 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; /* Whether to return non-matching
+ entries */
+ int rc;
- /* 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;
+ invert = flags & PREG_GREP_INVERT ? 1 : 0;
+
+ if (extra == NULL) {
+ extra_data.flags = PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION;
+ extra = &extra_data;
}
+ extra->match_limit = PCRE_G(backtrack_limit);
+ extra->match_limit_recursion = PCRE_G(recursion_limit);
/* Calculate the size of the offsets array, and allocate memory for it. */
- rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &size_offsets);
+ rc = pcre_fullinfo(pce->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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
RETURN_FALSE;
}
size_offsets = (size_offsets + 1) * 3;
@@ -1577,14 +1688,16 @@ PHP_FUNCTION(preg_grep)
/* Initialize return array */
array_init(return_value);
+ PCRE_G(error_code) = PHP_PCRE_NO_ERROR;
+
/* 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) {
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(input));
+ while(zend_hash_get_current_data(Z_ARRVAL_P(input), (void **)&entry) == SUCCESS) {
convert_to_string_ex(entry);
/* Perform the match */
- count = pcre_exec(re, extra, Z_STRVAL_PP(entry),
+ count = pcre_exec(pce->re, extra, Z_STRVAL_PP(entry),
Z_STRLEN_PP(entry), 0,
0, offsets, size_offsets);
@@ -1592,15 +1705,18 @@ PHP_FUNCTION(preg_grep)
if (count == 0) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
+ } else if (count < 0 && count != PCRE_ERROR_NOMATCH) {
+ pcre_handle_exec_error(count TSRMLS_CC);
+ break;
}
/* If the entry fits our requirements */
if ((count > 0 && !invert) ||
- (count < 0 && invert)) {
+ (count == PCRE_ERROR_NOMATCH && invert)) {
(*entry)->refcount++;
/* Add to return array */
- switch(zend_hash_get_current_key(Z_ARRVAL_PP(input), &string_key, &num_key, 0))
+ switch (zend_hash_get_current_key(Z_ARRVAL_P(input), &string_key, &num_key, 0))
{
case HASH_KEY_IS_STRING:
zend_hash_update(Z_ARRVAL_P(return_value), string_key,
@@ -1614,7 +1730,7 @@ PHP_FUNCTION(preg_grep)
}
}
- zend_hash_move_forward(Z_ARRVAL_PP(input));
+ zend_hash_move_forward(Z_ARRVAL_P(input));
}
/* Clean up */
@@ -1622,6 +1738,18 @@ PHP_FUNCTION(preg_grep)
}
/* }}} */
+/* {{{ proto int preg_last_error()
+ Returns the error code of the last regexp execution. */
+PHP_FUNCTION(preg_last_error)
+{
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ return;
+ }
+
+ RETURN_LONG(PCRE_G(error_code));
+}
+/* }}} */
+
/* {{{ module definition structures */
zend_function_entry pcre_functions[] = {
@@ -1632,6 +1760,7 @@ zend_function_entry pcre_functions[] = {
PHP_FE(preg_split, NULL)
PHP_FE(preg_quote, NULL)
PHP_FE(preg_grep, NULL)
+ PHP_FE(preg_last_error, NULL)
{NULL, NULL, NULL}
};
@@ -1645,7 +1774,11 @@ zend_module_entry pcre_module_entry = {
NULL,
PHP_MINFO(pcre),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(pcre),
+ PHP_GINIT(pcre),
+ PHP_GSHUTDOWN(pcre),
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
#ifdef COMPILE_DL_PCRE
diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h
index 4e55a6da2..4ad1aad9b 100644
--- a/ext/pcre/php_pcre.h
+++ b/ext/pcre/php_pcre.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pcre.h,v 1.41.2.1 2006/01/01 12:50:11 sniper Exp $ */
+/* $Id: php_pcre.h,v 1.41.2.1.2.4 2006/07/20 22:53:07 helly Exp $ */
#ifndef PHP_PCRE_H
#define PHP_PCRE_H
@@ -41,7 +41,7 @@ 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 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);
@@ -57,10 +57,28 @@ typedef struct {
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 TSRMLS_DC);
+
+PHPAPI void php_pcre_match_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
+ zval *subpats, int global, int use_flags, long flags, long start_offset TSRMLS_DC);
+
+PHPAPI char *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
+ int is_callable_replace, int *result_len, int limit, int *replace_count TSRMLS_DC);
+
+PHPAPI void php_pcre_split_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
+ long limit_val, long flags TSRMLS_DC);
+
+PHPAPI void php_pcre_grep_impl( pcre_cache_entry *pce, zval *input, zval *return_value,
+ long flags TSRMLS_DC);
+
ZEND_BEGIN_MODULE_GLOBALS(pcre)
HashTable pcre_cache;
+ long backtrack_limit;
+ long recursion_limit;
+ int error_code;
ZEND_END_MODULE_GLOBALS(pcre)
#ifdef ZTS
diff --git a/ext/pcre/tests/backtrack_limit.phpt b/ext/pcre/tests/backtrack_limit.phpt
new file mode 100644
index 000000000..ebfd720c3
--- /dev/null
+++ b/ext/pcre/tests/backtrack_limit.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Backtracking limit
+--INI--
+pcre.backtrack_limit=2
+--FILE--
+<?php
+
+var_dump(preg_match_all('/.*\p{N}/', '0123456789', $dummy));
+var_dump(preg_last_error() === PREG_BACKTRACK_LIMIT_ERROR);
+
+var_dump(preg_match_all('/\p{Nd}/', '0123456789', $dummy));
+var_dump(preg_last_error() === PREG_NO_ERROR);
+
+?>
+--EXPECT--
+int(0)
+bool(true)
+int(10)
+bool(true)
diff --git a/ext/pcre/tests/bug37800.phpt b/ext/pcre/tests/bug37800.phpt
new file mode 100644
index 000000000..e8a0036eb
--- /dev/null
+++ b/ext/pcre/tests/bug37800.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Bug #37800 (preg_replace() limit parameter odd behaviour)
+--FILE--
+<?php
+$s_string = '1111111111';
+$s_search = '/1/';
+$s_replace = 'One ';
+$i_limit = 1;
+$i_count = 0;
+
+$s_output = preg_replace($s_search, $s_replace, $s_string, $i_limit,
+$i_count);
+echo "Output = " . var_export($s_output, True) . "\n";
+echo "Count = $i_count\n";
+var_dump(preg_last_error() === PREG_NO_ERROR);
+
+$i_limit = strlen($s_string);
+$s_output = preg_replace($s_search, $s_replace, $s_string, $i_limit,
+$i_count);
+echo "Output = " . var_export($s_output, True) . "\n";
+echo "Count = $i_count\n";
+var_dump(preg_last_error() === PREG_NO_ERROR);
+
+?>
+--EXPECT--
+Output = 'One 111111111'
+Count = 1
+bool(true)
+Output = 'One One One One One One One One One One '
+Count = 10
+bool(true)
diff --git a/ext/pcre/tests/cache_limit.phpt b/ext/pcre/tests/cache_limit.phpt
new file mode 100644
index 000000000..bfe7f1b9a
--- /dev/null
+++ b/ext/pcre/tests/cache_limit.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Compiled regex cache limit
+--FILE--
+<?php
+define('PREG_CACHE_SIZE', 4096+1);
+
+$re = '';
+$str = str_repeat('x', PREG_CACHE_SIZE);
+
+for ($i=0; $i < PREG_CACHE_SIZE; ++$i) {
+ $re .= '.';
+ if (!preg_match("/$re/", $str)) {
+ die('non match. error');
+ }
+}
+
+var_dump(preg_match('/./', $str)); // this one was already deleted from the cache
+var_dump(preg_match("/$re/", $str)); // but not this one
+
+echo "done\n";
+?>
+--EXPECT--
+int(1)
+int(1)
+done
diff --git a/ext/pcre/tests/delimiters.phpt b/ext/pcre/tests/delimiters.phpt
new file mode 100644
index 000000000..1826f8730
--- /dev/null
+++ b/ext/pcre/tests/delimiters.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Delimiters crash test
+--FILE--
+<?php
+
+var_dump(preg_match('', ''));
+var_dump(preg_match(' ', ''));
+var_dump(preg_match('@@', ''));
+var_dump(preg_match('12', ''));
+var_dump(preg_match('<>', ''));
+var_dump(preg_match('~a', ''));
+var_dump(preg_match('@\@\@@', '@@'));
+var_dump(preg_match('//z', '@@'));
+var_dump(preg_match('{', ''));
+
+?>
+--EXPECTF--
+Warning: preg_match(): Empty regular expression in %sdelimiters.php on line 3
+bool(false)
+
+Warning: preg_match(): Empty regular expression in %sdelimiters.php on line 4
+bool(false)
+int(1)
+
+Warning: preg_match(): Delimiter must not be alphanumeric or backslash in %sdelimiters.php on line 6
+bool(false)
+int(1)
+
+Warning: preg_match(): No ending delimiter '~' found in %sdelimiters.php on line 8
+bool(false)
+int(1)
+
+Warning: preg_match(): Unknown modifier 'z' in %sdelimiters.php on line 10
+bool(false)
+
+Warning: preg_match(): No ending matching delimiter '}' found in %sdelimiters.php on line 11
+bool(false)
diff --git a/ext/pcre/tests/dollar_endonly.phpt b/ext/pcre/tests/dollar_endonly.phpt
new file mode 100644
index 000000000..96a52441d
--- /dev/null
+++ b/ext/pcre/tests/dollar_endonly.phpt
@@ -0,0 +1,39 @@
+--TEST--
+D (PCRE_DOLLAR_ENDONLY) modififer
+--FILE--
+<?php
+
+var_dump(preg_match_all('/^\S+.+$/', "aeiou\n", $m));
+var_dump($m);
+
+var_dump(preg_match_all('/^\S+.+$/D', "aeiou\n", $m));
+var_dump($m);
+
+var_dump(preg_match_all('/^\S+\s$/D', "aeiou\n", $m));
+var_dump($m);
+
+?>
+--EXPECT--
+int(1)
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(5) "aeiou"
+ }
+}
+int(0)
+array(1) {
+ [0]=>
+ array(0) {
+ }
+}
+int(1)
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(6) "aeiou
+"
+ }
+}
diff --git a/ext/pcre/tests/grep.phpt b/ext/pcre/tests/grep.phpt
new file mode 100644
index 000000000..d3d9032e4
--- /dev/null
+++ b/ext/pcre/tests/grep.phpt
@@ -0,0 +1,23 @@
+--TEST--
+preg_grep()
+--FILE--
+<?php
+$array = array('a', '1', 'q6', 'h20');
+
+var_dump(preg_grep('/^(\d|.\d)$/', $array));
+var_dump(preg_grep('/^(\d|.\d)$/', $array, PREG_GREP_INVERT));
+
+?>
+--EXPECT--
+array(2) {
+ [1]=>
+ string(1) "1"
+ [2]=>
+ string(2) "q6"
+}
+array(2) {
+ [0]=>
+ string(1) "a"
+ [3]=>
+ string(3) "h20"
+}
diff --git a/ext/pcre/tests/grep2.phpt b/ext/pcre/tests/grep2.phpt
new file mode 100644
index 000000000..0cf8d4aeb
--- /dev/null
+++ b/ext/pcre/tests/grep2.phpt
@@ -0,0 +1,45 @@
+--TEST--
+preg_grep() 2nd test
+--FILE--
+<?php
+
+var_dump(preg_grep(1,array(),3,4));
+var_dump(preg_grep(1, 2));
+var_dump(preg_grep('/+/', array()));
+
+$array = array(5=>'a', 'x' => '1', 'xyz'=>'q6', 'h20');
+
+var_dump(preg_grep('@^[a-z]+@', $array));
+var_dump(preg_grep('@^[a-z]+@', $array, PREG_GREP_INVERT));
+
+ini_set('pcre.recursion_limit', 1);
+var_dump(preg_last_error() == PREG_NO_ERROR);
+var_dump(preg_grep('@^[a-z]+@', $array));
+var_dump(preg_last_error() == PREG_RECURSION_LIMIT_ERROR);
+
+?>
+--EXPECTF--
+Warning: preg_grep() expects at most 3 parameters, 4 given in %sgrep2.php on line 3
+NULL
+
+Warning: preg_grep() expects parameter 2 to be array, integer given in %sgrep2.php on line 4
+NULL
+
+Warning: preg_grep(): Compilation failed: nothing to repeat at offset 0 in %sgrep2.php on line 5
+bool(false)
+array(3) {
+ [5]=>
+ string(1) "a"
+ ["xyz"]=>
+ string(2) "q6"
+ [6]=>
+ string(3) "h20"
+}
+array(1) {
+ ["x"]=>
+ string(1) "1"
+}
+bool(true)
+array(0) {
+}
+bool(true)
diff --git a/ext/pcre/tests/invalid_utf8.phpt b/ext/pcre/tests/invalid_utf8.phpt
new file mode 100644
index 000000000..df2de2da9
--- /dev/null
+++ b/ext/pcre/tests/invalid_utf8.phpt
@@ -0,0 +1,16 @@
+--TEST--
+preg_replace() and invalid UTF8
+--FILE--
+<?php
+
+$string = urldecode("search%e4");
+$result = preg_replace("#(&\#x*)([0-9A-F]+);*#iu","$1$2;",$string);
+var_dump($result);
+var_dump(preg_last_error());
+
+echo "Done\n";
+?>
+--EXPECT--
+NULL
+int(4)
+Done
diff --git a/ext/pcre/tests/locales.phpt b/ext/pcre/tests/locales.phpt
new file mode 100644
index 000000000..6b600236c
--- /dev/null
+++ b/ext/pcre/tests/locales.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Localized match
+--SKIPIF--
+<?php if (!function_exists('setlocale')) die('skip: setlocale() not available'); ?>
+<?php if (!@setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese')) die('skip pt locale not available');
+--FILE--
+<?php
+
+// this tests if the cache is working correctly, as the char tables
+// must be rebuilt after the locale change
+
+setlocale(LC_ALL, 'C', 'POSIX');
+var_dump(preg_match('/^\w{6}$/', 'aàáçéè'));
+
+setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese');
+var_dump(preg_match('/^\w{6}$/', 'aàáçéè'));
+
+setlocale(LC_ALL, 'C', 'POSIX');
+var_dump(preg_match('/^\w{6}$/', 'aàáçéè'));
+
+?>
+--EXPECT--
+int(0)
+int(1)
+int(0)
diff --git a/ext/pcre/tests/match_flags.phpt b/ext/pcre/tests/match_flags.phpt
new file mode 100644
index 000000000..ddd36bf9b
--- /dev/null
+++ b/ext/pcre/tests/match_flags.phpt
@@ -0,0 +1,127 @@
+--TEST--
+preg_match_all() flags
+--FILE--
+<?php
+
+var_dump(preg_match_all('/(.)x/', 'zxax', $match, PREG_PATTERN_ORDER));
+var_dump($match);
+
+var_dump(preg_match_all('/(.)x/', 'zxyx', $match, PREG_SET_ORDER));
+var_dump($match);
+
+var_dump(preg_match_all('/(.)x/', 'zxyx', $match, PREG_OFFSET_CAPTURE));
+var_dump($match);
+
+var_dump(preg_match_all('/(.)x/', 'zxyx', $match, PREG_SET_ORDER | PREG_OFFSET_CAPTURE));
+var_dump($match);
+
+?>
+--EXPECT--
+int(2)
+array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(2) "zx"
+ [1]=>
+ string(2) "ax"
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "z"
+ [1]=>
+ string(1) "a"
+ }
+}
+int(2)
+array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(2) "zx"
+ [1]=>
+ string(1) "z"
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(2) "yx"
+ [1]=>
+ string(1) "y"
+ }
+}
+int(2)
+array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(2) "zx"
+ [1]=>
+ int(0)
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(2) "yx"
+ [1]=>
+ int(2)
+ }
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(1) "z"
+ [1]=>
+ int(0)
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "y"
+ [1]=>
+ int(2)
+ }
+ }
+}
+int(2)
+array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(2) "zx"
+ [1]=>
+ int(0)
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "z"
+ [1]=>
+ int(0)
+ }
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(2) "yx"
+ [1]=>
+ int(2)
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "y"
+ [1]=>
+ int(2)
+ }
+ }
+}
diff --git a/ext/pcre/tests/match_flags2.phpt b/ext/pcre/tests/match_flags2.phpt
new file mode 100644
index 000000000..f70309173
--- /dev/null
+++ b/ext/pcre/tests/match_flags2.phpt
@@ -0,0 +1,95 @@
+--TEST--
+preg_match() flags
+--FILE--
+<?php
+
+var_dump(preg_match('/x(.)/', 'fjszxax', $match, PREG_OFFSET_CAPTURE));
+var_dump($match);
+
+var_dump(preg_match('/(.)x/', 'fjszxax', $match, PREG_OFFSET_CAPTURE, 4));
+var_dump($match);
+
+var_dump(preg_match('/(?P<capt1>.)(x)(?P<letsmix>\S+)/', 'fjszxax', $match, PREG_OFFSET_CAPTURE));
+var_dump($match);
+
+?>
+--EXPECT--
+int(1)
+array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(2) "xa"
+ [1]=>
+ int(4)
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "a"
+ [1]=>
+ int(5)
+ }
+}
+int(1)
+array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(2) "ax"
+ [1]=>
+ int(5)
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "a"
+ [1]=>
+ int(5)
+ }
+}
+int(1)
+array(6) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(4) "zxax"
+ [1]=>
+ int(3)
+ }
+ ["capt1"]=>
+ array(2) {
+ [0]=>
+ string(1) "z"
+ [1]=>
+ int(3)
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "z"
+ [1]=>
+ int(3)
+ }
+ [2]=>
+ array(2) {
+ [0]=>
+ string(1) "x"
+ [1]=>
+ int(4)
+ }
+ ["letsmix"]=>
+ array(2) {
+ [0]=>
+ string(2) "ax"
+ [1]=>
+ int(5)
+ }
+ [3]=>
+ array(2) {
+ [0]=>
+ string(2) "ax"
+ [1]=>
+ int(5)
+ }
+}
diff --git a/ext/pcre/tests/match_flags3.phpt b/ext/pcre/tests/match_flags3.phpt
new file mode 100644
index 000000000..f22205e3d
--- /dev/null
+++ b/ext/pcre/tests/match_flags3.phpt
@@ -0,0 +1,46 @@
+--TEST--
+preg_match() flags 3
+--FILE--
+<?php
+
+var_dump(preg_match('', '', $match, 0xfff));
+
+var_dump(preg_match('/\d+/', '123 456 789 012', $match, 0, -8));
+var_dump($match);
+
+var_dump(preg_match('/\d+/', '123 456 789 012', $match, 0, -500));
+var_dump($match);
+
+var_dump(preg_match_all('/\d+/', '123 456 789 012', $match, 0, -8));
+var_dump($match);
+
+var_dump(preg_match('/(?P<3>)/', ''));
+
+?>
+--EXPECTF--
+
+Warning: preg_match(): Empty regular expression in %smatch_flags3.php on line 3
+bool(false)
+int(1)
+array(1) {
+ [0]=>
+ string(3) "789"
+}
+int(1)
+array(1) {
+ [0]=>
+ string(3) "123"
+}
+int(2)
+array(1) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(3) "789"
+ [1]=>
+ string(3) "012"
+ }
+}
+
+Warning: preg_match(): Numeric named subpatterns are not allowed in %smatch_flags3.php on line 14
+bool(false)
diff --git a/ext/pcre/tests/multiline.phpt b/ext/pcre/tests/multiline.phpt
new file mode 100644
index 000000000..356800917
--- /dev/null
+++ b/ext/pcre/tests/multiline.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Multi-line match
+--FILE--
+<?php
+
+var_dump(preg_match_all('/^.{2,3}$/', "aei\nou", $dummy));
+var_dump(preg_match_all('/^.{2,3}$/', "aei\nou\n", $dummy));
+var_dump(preg_match_all('/^.{2,3}$/m', "aei\nou", $dummy));
+var_dump(preg_match_all('/^.{2,3}$/m', "aei\nou\n", $dummy));
+
+echo "done\n";
+?>
+--EXPECT--
+int(0)
+int(0)
+int(2)
+int(2)
+done
diff --git a/ext/pcre/tests/pcre_anchored.phpt b/ext/pcre/tests/pcre_anchored.phpt
new file mode 100644
index 000000000..caa96437e
--- /dev/null
+++ b/ext/pcre/tests/pcre_anchored.phpt
@@ -0,0 +1,22 @@
+--TEST--
+A (PCRE_ANCHORED) modififer
+--FILE--
+<?php
+
+var_dump(preg_match('/\PN+/', '123abc', $m));
+var_dump($m);
+
+var_dump(preg_match('/\P{N}+/A', '123abc'));
+var_dump(preg_match('/^\P{N}+/', '123abc'));
+var_dump(preg_match('/^\P{N}+/A', '123abc'));
+
+?>
+--EXPECT--
+int(1)
+array(1) {
+ [0]=>
+ string(3) "abc"
+}
+int(0)
+int(0)
+int(0)
diff --git a/ext/pcre/tests/pcre_extended.phpt b/ext/pcre/tests/pcre_extended.phpt
new file mode 100644
index 000000000..6c4b20e7f
--- /dev/null
+++ b/ext/pcre/tests/pcre_extended.phpt
@@ -0,0 +1,29 @@
+--TEST--
+x (PCRE_EXTENDED) modififer
+--FILE--
+<?php
+
+var_dump(preg_match('/a e i o u/', 'aeiou', $m));
+var_dump($m);
+
+var_dump(preg_match('/a e i o u/x', 'aeiou', $m));
+var_dump($m);
+
+var_dump(preg_match("/a e\ni\to\ru/x", 'aeiou', $m));
+var_dump($m);
+
+?>
+--EXPECT--
+int(0)
+array(0) {
+}
+int(1)
+array(1) {
+ [0]=>
+ string(5) "aeiou"
+}
+int(1)
+array(1) {
+ [0]=>
+ string(5) "aeiou"
+}
diff --git a/ext/pcre/tests/pcre_extra.phpt b/ext/pcre/tests/pcre_extra.phpt
new file mode 100644
index 000000000..2bee408fb
--- /dev/null
+++ b/ext/pcre/tests/pcre_extra.phpt
@@ -0,0 +1,14 @@
+--TEST--
+X (PCRE_EXTRA) modififer
+--FILE--
+<?php
+
+var_dump(preg_match('/\y/', '\y'));
+var_dump(preg_match('/\y/X', '\y'));
+
+?>
+--EXPECTF--
+int(1)
+
+Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset 1 in %spcre_extra.php on line 4
+bool(false)
diff --git a/ext/pcre/tests/preg_replace.phpt b/ext/pcre/tests/preg_replace.phpt
new file mode 100644
index 000000000..f7b5f7415
--- /dev/null
+++ b/ext/pcre/tests/preg_replace.phpt
@@ -0,0 +1,25 @@
+--TEST--
+preg_replace()
+--FILE--
+<?php
+
+var_dump(preg_replace('{{\D+}}', 'x', '{abcd}'));
+var_dump(preg_replace('{{\D+}}', 'ddd', 'abcd'));
+
+var_dump(preg_replace('/(ab)(c)(d)(e)(f)(g)(h)(i)(j)(k)/', 'a${1}2$103', 'zabcdefghijkl'));
+
+var_dump(preg_replace_callback('//e', '', ''));
+
+var_dump(preg_replace_callback('//e', 'strtolower', ''));
+
+?>
+--EXPECTF--
+string(1) "x"
+string(4) "abcd"
+string(8) "zaab2k3l"
+
+Warning: preg_replace_callback(): Requires argument 2, '', to be a valid callback in %spreg_replace.php on line 8
+string(0) ""
+
+Warning: preg_replace_callback(): Modifier /e cannot be used with replacement callback in %spreg_replace.php on line 10
+NULL
diff --git a/ext/pcre/tests/preg_replace2.phpt b/ext/pcre/tests/preg_replace2.phpt
new file mode 100644
index 000000000..4e2f39f8c
--- /dev/null
+++ b/ext/pcre/tests/preg_replace2.phpt
@@ -0,0 +1,42 @@
+--TEST--
+preg_replace()
+--FILE--
+<?php
+
+var_dump(preg_replace('', array(), ''));
+
+var_dump(preg_replace(array('/\da(.)/ui', '@..@'), '$1', '12Abc'));
+var_dump(preg_replace(array('/\da(.)/ui', '@(.)@'), '$1', array('x','a2aA', '1av2Ab')));
+
+
+var_dump(preg_replace(array('/[\w]+/'), array('$'), array('xyz', 'bdbd')));
+var_dump(preg_replace(array('/\s+/', '~[b-d]~'), array('$'), array('x y', 'bd bc')));
+
+echo "==done==\n";
+
+?>
+--EXPECTF--
+Warning: preg_replace(): Parameter mismatch, pattern is a string while replacement is an array in %spreg_replace2.php on line 3
+bool(false)
+string(1) "c"
+array(3) {
+ [0]=>
+ string(1) "x"
+ [1]=>
+ string(2) "aA"
+ [2]=>
+ string(2) "vb"
+}
+array(2) {
+ [0]=>
+ string(1) "$"
+ [1]=>
+ string(1) "$"
+}
+array(2) {
+ [0]=>
+ string(3) "x$y"
+ [1]=>
+ string(1) "$"
+}
+==done==
diff --git a/ext/pcre/tests/preg_replace_callback.phpt b/ext/pcre/tests/preg_replace_callback.phpt
new file mode 100644
index 000000000..0b0bc2757
--- /dev/null
+++ b/ext/pcre/tests/preg_replace_callback.phpt
@@ -0,0 +1,25 @@
+--TEST--
+preg_replace_callback()
+--FILE--
+<?php
+$input = "plain [indent] deep [indent] [abcd]deeper[/abcd] [/indent] deep [/indent] plain";
+
+function parseTagsRecursive($input)
+{
+
+ $regex = '#\[indent]((?:[^[]|\[(?!/?indent])|(?R))+)\[/indent]#';
+
+ if (is_array($input)) {
+ $input = '<div style="margin-left: 10px">'.$input[1].'</div>';
+ }
+
+ return preg_replace_callback($regex, 'parseTagsRecursive', $input);
+}
+
+$output = parseTagsRecursive($input);
+
+echo $output, "\n";
+
+?>
+--EXPECT--
+plain <div style="margin-left: 10px"> deep <div style="margin-left: 10px"> [abcd]deeper[/abcd] </div> deep </div> plain
diff --git a/ext/pcre/tests/preg_replace_callback2.phpt b/ext/pcre/tests/preg_replace_callback2.phpt
new file mode 100644
index 000000000..a7f5a362d
--- /dev/null
+++ b/ext/pcre/tests/preg_replace_callback2.phpt
@@ -0,0 +1,40 @@
+--TEST--
+preg_replace_callback() 2
+--FILE--
+<?php
+
+function f() {
+ throw new Exception();
+}
+
+try {
+var_dump(preg_replace_callback('/\w/', 'f', 'z'));
+} catch(Exception $e) {}
+
+function g($x) {
+ return "'$x[0]'";
+}
+
+var_dump(preg_replace_callback('@\b\w{1,2}\b@', 'g', array('a b3 bcd', 'v' => 'aksfjk', 12 => 'aa bb')));
+
+var_dump(preg_replace_callback('~\A.~', 'g', array(array('xyz'))));
+
+var_dump(preg_replace_callback('~\A.~', create_function('$m', 'return strtolower($m[0]);'), 'ABC'));
+?>
+--EXPECTF--
+Warning: preg_replace_callback(): Unable to call custom replacement function in %spreg_replace_callback2.php on line %d
+array(3) {
+ [0]=>
+ string(12) "'a' 'b3' bcd"
+ ["v"]=>
+ string(6) "aksfjk"
+ [12]=>
+ string(9) "'aa' 'bb'"
+}
+
+Notice: Array to string conversion in %spreg_replace_callback2.php on line 17
+array(1) {
+ [0]=>
+ string(7) "'A'rray"
+}
+string(3) "aBC"
diff --git a/ext/pcre/tests/preg_replace_callback3.phpt b/ext/pcre/tests/preg_replace_callback3.phpt
new file mode 100644
index 000000000..fafd966f4
--- /dev/null
+++ b/ext/pcre/tests/preg_replace_callback3.phpt
@@ -0,0 +1,45 @@
+--TEST--
+preg_replace_callback() 3
+--FILE--
+<?php
+
+var_dump(preg_replace_callback());
+var_dump(preg_replace_callback(1));
+var_dump(preg_replace_callback(1,2));
+var_dump(preg_replace_callback(1,2,3));
+var_dump(preg_replace_callback(1,2,3,4));
+$a = 5;
+var_dump(preg_replace_callback(1,2,3,4,$a));
+$a = "";
+var_dump(preg_replace_callback("","","","",$a));
+$a = array();
+var_dump(preg_replace_callback($a,$a,$a,$a,$a));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for preg_replace_callback() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for preg_replace_callback() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for preg_replace_callback() in %s on line %d
+NULL
+
+Warning: preg_replace_callback(): Requires argument 2, '2', to be a valid callback in %s on line %d
+int(3)
+
+Warning: preg_replace_callback(): Requires argument 2, '2', to be a valid callback in %s on line %d
+int(3)
+
+Warning: preg_replace_callback(): Requires argument 2, '2', to be a valid callback in %s on line %d
+int(3)
+
+Warning: preg_replace_callback(): Requires argument 2, '', to be a valid callback in %s on line 1%d
+string(0) ""
+
+Warning: preg_replace_callback(): Requires argument 2, 'Array', to be a valid callback in %s on line %d
+array(0) {
+}
+Done
diff --git a/ext/pcre/tests/recursion_limit.phpt b/ext/pcre/tests/recursion_limit.phpt
new file mode 100644
index 000000000..2a43aa27d
--- /dev/null
+++ b/ext/pcre/tests/recursion_limit.phpt
@@ -0,0 +1,19 @@
+--TEST--
+PCRE Recursion limit
+--INI--
+pcre.recursion_limit=2
+--FILE--
+<?php
+
+var_dump(preg_match_all('/\p{Ll}(\p{L}((\p{Ll}\p{Ll})))/', 'aeiou', $dummy));
+var_dump(preg_last_error() === PREG_RECURSION_LIMIT_ERROR);
+
+var_dump(preg_match_all('/\p{Ll}\p{L}\p{Ll}\p{Ll}/', 'aeiou', $dummy));
+var_dump(preg_last_error() === PREG_NO_ERROR);
+
+?>
+--EXPECT--
+int(0)
+bool(true)
+int(1)
+bool(true)
diff --git a/ext/pcre/tests/split.phpt b/ext/pcre/tests/split.phpt
new file mode 100644
index 000000000..8ec8e655c
--- /dev/null
+++ b/ext/pcre/tests/split.phpt
@@ -0,0 +1,86 @@
+--TEST--
+preg_split()
+--FILE--
+<?php
+
+var_dump(preg_split());
+var_dump(preg_split('/*/', 'x'));
+
+var_dump(preg_split('/[\s, ]+/', 'x yy,zzz'));
+var_dump(preg_split('/[\s, ]+/', 'x yy,zzz', -1));
+var_dump(preg_split('/[\s, ]+/', 'x yy,zzz', 0));
+var_dump(preg_split('/[\s, ]+/', 'x yy,zzz', 1));
+var_dump(preg_split('/[\s, ]+/', 'x yy,zzz', 2));
+
+var_dump(preg_split('/\d*/', 'ab2c3u'));
+var_dump(preg_split('/\d*/', 'ab2c3u', -1, PREG_SPLIT_NO_EMPTY));
+
+?>
+--EXPECTF--
+Warning: preg_split() expects at least 2 parameters, 0 given in %ssplit.php on line 3
+bool(false)
+
+Warning: preg_split(): Compilation failed: nothing to repeat at offset 0 in %ssplit.php on line 4
+bool(false)
+array(3) {
+ [0]=>
+ string(1) "x"
+ [1]=>
+ string(2) "yy"
+ [2]=>
+ string(3) "zzz"
+}
+array(3) {
+ [0]=>
+ string(1) "x"
+ [1]=>
+ string(2) "yy"
+ [2]=>
+ string(3) "zzz"
+}
+array(3) {
+ [0]=>
+ string(1) "x"
+ [1]=>
+ string(2) "yy"
+ [2]=>
+ string(3) "zzz"
+}
+array(1) {
+ [0]=>
+ string(8) "x yy,zzz"
+}
+array(2) {
+ [0]=>
+ string(1) "x"
+ [1]=>
+ string(6) "yy,zzz"
+}
+array(8) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(1) "a"
+ [2]=>
+ string(1) "b"
+ [3]=>
+ string(0) ""
+ [4]=>
+ string(1) "c"
+ [5]=>
+ string(0) ""
+ [6]=>
+ string(1) "u"
+ [7]=>
+ string(0) ""
+}
+array(4) {
+ [0]=>
+ string(1) "a"
+ [1]=>
+ string(1) "b"
+ [2]=>
+ string(1) "c"
+ [3]=>
+ string(1) "u"
+}
diff --git a/ext/pcre/tests/split2.phpt b/ext/pcre/tests/split2.phpt
new file mode 100644
index 000000000..391acb951
--- /dev/null
+++ b/ext/pcre/tests/split2.phpt
@@ -0,0 +1,315 @@
+--TEST--
+preg_split() 2nd test
+--FILE--
+<?php
+
+var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_DELIM_CAPTURE));
+var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_OFFSET_CAPTURE));
+var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE));
+var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_OFFSET_CAPTURE));;
+var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE));
+var_dump(preg_split('/(\d*)/', 'ab2c3u', -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE));
+
+
+var_dump(preg_last_error(1));
+ini_set('pcre.recursion_limit', 1);
+var_dump(preg_last_error() == PREG_NO_ERROR);
+var_dump(preg_split('/(\d*)/', 'ab2c3u'));
+var_dump(preg_last_error() == PREG_RECURSION_LIMIT_ERROR);
+
+?>
+--EXPECTF--
+array(15) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(0) ""
+ [2]=>
+ string(1) "a"
+ [3]=>
+ string(0) ""
+ [4]=>
+ string(1) "b"
+ [5]=>
+ string(1) "2"
+ [6]=>
+ string(0) ""
+ [7]=>
+ string(0) ""
+ [8]=>
+ string(1) "c"
+ [9]=>
+ string(1) "3"
+ [10]=>
+ string(0) ""
+ [11]=>
+ string(0) ""
+ [12]=>
+ string(1) "u"
+ [13]=>
+ string(0) ""
+ [14]=>
+ string(0) ""
+}
+array(8) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(0)
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "a"
+ [1]=>
+ int(0)
+ }
+ [2]=>
+ array(2) {
+ [0]=>
+ string(1) "b"
+ [1]=>
+ int(1)
+ }
+ [3]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(3)
+ }
+ [4]=>
+ array(2) {
+ [0]=>
+ string(1) "c"
+ [1]=>
+ int(3)
+ }
+ [5]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(5)
+ }
+ [6]=>
+ array(2) {
+ [0]=>
+ string(1) "u"
+ [1]=>
+ int(5)
+ }
+ [7]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(6)
+ }
+}
+array(6) {
+ [0]=>
+ string(1) "a"
+ [1]=>
+ string(1) "b"
+ [2]=>
+ string(1) "2"
+ [3]=>
+ string(1) "c"
+ [4]=>
+ string(1) "3"
+ [5]=>
+ string(1) "u"
+}
+array(4) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(1) "a"
+ [1]=>
+ int(0)
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "b"
+ [1]=>
+ int(1)
+ }
+ [2]=>
+ array(2) {
+ [0]=>
+ string(1) "c"
+ [1]=>
+ int(3)
+ }
+ [3]=>
+ array(2) {
+ [0]=>
+ string(1) "u"
+ [1]=>
+ int(5)
+ }
+}
+array(15) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(0)
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(0)
+ }
+ [2]=>
+ array(2) {
+ [0]=>
+ string(1) "a"
+ [1]=>
+ int(0)
+ }
+ [3]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(1)
+ }
+ [4]=>
+ array(2) {
+ [0]=>
+ string(1) "b"
+ [1]=>
+ int(1)
+ }
+ [5]=>
+ array(2) {
+ [0]=>
+ string(1) "2"
+ [1]=>
+ int(2)
+ }
+ [6]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(3)
+ }
+ [7]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(3)
+ }
+ [8]=>
+ array(2) {
+ [0]=>
+ string(1) "c"
+ [1]=>
+ int(3)
+ }
+ [9]=>
+ array(2) {
+ [0]=>
+ string(1) "3"
+ [1]=>
+ int(4)
+ }
+ [10]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(5)
+ }
+ [11]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(5)
+ }
+ [12]=>
+ array(2) {
+ [0]=>
+ string(1) "u"
+ [1]=>
+ int(5)
+ }
+ [13]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(6)
+ }
+ [14]=>
+ array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ int(6)
+ }
+}
+array(6) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(1) "a"
+ [1]=>
+ int(0)
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "b"
+ [1]=>
+ int(1)
+ }
+ [2]=>
+ array(2) {
+ [0]=>
+ string(1) "2"
+ [1]=>
+ int(2)
+ }
+ [3]=>
+ array(2) {
+ [0]=>
+ string(1) "c"
+ [1]=>
+ int(3)
+ }
+ [4]=>
+ array(2) {
+ [0]=>
+ string(1) "3"
+ [1]=>
+ int(4)
+ }
+ [5]=>
+ array(2) {
+ [0]=>
+ string(1) "u"
+ [1]=>
+ int(5)
+ }
+}
+
+Warning: preg_last_error() expects exactly 0 parameters, 1 given in %s on line %d
+NULL
+bool(true)
+array(1) {
+ [0]=>
+ string(6) "ab2c3u"
+}
+bool(true)
diff --git a/ext/pcre/tests/study.phpt b/ext/pcre/tests/study.phpt
new file mode 100644
index 000000000..696a4c0ef
--- /dev/null
+++ b/ext/pcre/tests/study.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Study regex
+--FILE--
+<?php
+
+var_dump(preg_match('/(?:(?:(?:(?:(?:(.))))))/ S', 'aeiou', $dump));
+var_dump($dump[1]);
+var_dump(preg_match('/(?:(?:(?:(?:(?:(.))))))/', 'aeiou', $dump));
+var_dump($dump[1]);
+
+var_dump(preg_match('/(?>..)((?:(?>.)|.|.|.|u))/S', 'aeiou', $dump));
+var_dump($dump[1]);
+
+// try to trigger usual "match known text" optimization
+var_dump(preg_match('/^aeiou$/S', 'aeiou', $dump));
+var_dump($dump[0]);
+var_dump(preg_match('/aeiou/S', 'aeiou', $dump));
+var_dump($dump[0]);
+
+?>
+--EXPECT--
+int(1)
+string(1) "a"
+int(1)
+string(1) "a"
+int(1)
+string(1) "i"
+int(1)
+string(5) "aeiou"
+int(1)
+string(5) "aeiou"
diff --git a/ext/pcre/tests/ungreedy.phpt b/ext/pcre/tests/ungreedy.phpt
new file mode 100644
index 000000000..cf5e8adaf
--- /dev/null
+++ b/ext/pcre/tests/ungreedy.phpt
@@ -0,0 +1,31 @@
+--TEST--
+U (PCRE_UNGREEDY) modififer
+--FILE--
+<?php
+
+var_dump(preg_match('/<.*>/', '<aa> <bb> <cc>', $m));
+var_dump($m);
+
+var_dump(preg_match('/<.*>/U', '<aa> <bb> <cc>', $m));
+var_dump($m);
+
+var_dump(preg_match('/(?U)<.*>/', '<aa> <bb> <cc>', $m));
+var_dump($m);
+
+?>
+--EXPECT--
+int(1)
+array(1) {
+ [0]=>
+ string(14) "<aa> <bb> <cc>"
+}
+int(1)
+array(1) {
+ [0]=>
+ string(4) "<aa>"
+}
+int(1)
+array(1) {
+ [0]=>
+ string(4) "<aa>"
+}
diff --git a/ext/pdo/config.m4 b/ext/pdo/config.m4
index e275fecf6..9497f12da 100755
--- a/ext/pdo/config.m4
+++ b/ext/pdo/config.m4
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.15.2.3 2005/11/24 21:38:09 wez Exp $
+dnl $Id: config.m4,v 1.15.2.3.2.1 2006/08/24 16:00:43 tony2001 Exp $
dnl config.m4 for extension pdo
dnl vim:se ts=2 sw=2 et:
@@ -37,7 +37,6 @@ if test "$PHP_PDO" != "no"; then
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.
@@ -45,7 +44,6 @@ 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
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index 10ece60c7..d6786c4c8 100755
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo.c,v 1.57.2.17 2006/01/01 12:50:11 sniper Exp $ */
+/* $Id: pdo.c,v 1.57.2.17.2.7 2006/10/14 15:06:11 bjori Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -36,6 +36,7 @@
static zend_class_entry *spl_ce_RuntimeException;
ZEND_DECLARE_MODULE_GLOBALS(pdo)
+static PHP_GINIT_FUNCTION(pdo);
/* True global resources - no need for thread safety here */
@@ -53,11 +54,23 @@ int php_pdo_list_entry(void)
/* for exceptional circumstances */
zend_class_entry *pdo_exception_ce;
-PDO_API zend_class_entry *php_pdo_get_exception(void)
+PDO_API zend_class_entry *php_pdo_get_dbh_ce()
+{
+ return pdo_dbh_ce;
+}
+
+PDO_API zend_class_entry *php_pdo_get_exception()
{
return 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))
@@ -74,7 +87,7 @@ PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC)
}
}
#endif
-#if (PHP_MAJOR_VERSION < 6)
+#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 2)
return zend_exception_get_default();
#else
return zend_exception_get_default(TSRMLS_C);
@@ -83,7 +96,7 @@ PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC)
zend_class_entry *pdo_dbh_ce, *pdo_dbstmt_ce, *pdo_row_ce;
-/* proto array pdo_drivers()
+/* {{{ proto array pdo_drivers()
Return array of available PDO drivers */
PHP_FUNCTION(pdo_drivers)
{
@@ -130,26 +143,27 @@ zend_module_entry pdo_module_entry = {
pdo_functions,
PHP_MINIT(pdo),
PHP_MSHUTDOWN(pdo),
- PHP_RINIT(pdo),
- PHP_RSHUTDOWN(pdo),
+ NULL,
+ NULL,
PHP_MINFO(pdo),
- "1.0.3",
- STANDARD_MODULE_PROPERTIES
+ "1.0.4dev",
+ PHP_MODULE_GLOBALS(pdo),
+ PHP_GINIT(pdo),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
+/* TODO: visit persistent handles: for each persistent statement handle,
+ * remove bound parameter associations */
+
#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)
+/* {{{ PHP_GINIT_FUNCTION */
+static PHP_GINIT_FUNCTION(pdo)
{
pdo_globals->global_value = 0;
}
@@ -303,11 +317,8 @@ PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC)
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();
+ spl_ce_RuntimeException = NULL;
if (FAILURE == pdo_sqlstate_init_error_table()) {
return FAILURE;
@@ -334,29 +345,12 @@ PHP_MINIT_FUNCTION(pdo)
/* {{{ 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)
{
@@ -379,13 +373,12 @@ PHP_MINFO_FUNCTION(pdo)
if (drivers) {
efree(drivers);
+ } else {
+ efree(ldrivers);
}
php_info_print_table_end();
-#if 0
- DISPLAY_INI_ENTRIES();
-#endif
}
/* }}} */
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index cbf443bc9..ec6d88041 100755
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_dbh.c,v 1.82.2.31 2006/05/03 21:58:38 pollita Exp $ */
+/* $Id: pdo_dbh.c,v 1.82.2.31.2.7 2006/08/21 16:53:50 iliaa Exp $ */
/* The PDO Database Handle Class */
@@ -36,12 +36,13 @@
#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)
+static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, long attr, zval *value TSRMLS_DC);
+
+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;
-
if (dbh->error_mode == PDO_ERRMODE_SILENT) {
#if 0
@@ -98,8 +99,9 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate
efree(message);
}
}
+/* }}} */
-void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC)
+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>>";
@@ -178,8 +180,9 @@ void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC)
efree(supp);
}
}
+/* }}} */
-static char *dsn_from_uri(char *uri, char *buf, size_t buflen TSRMLS_DC)
+static char *dsn_from_uri(char *uri, char *buf, size_t buflen TSRMLS_DC) /* {{{ */
{
php_stream *stream;
char *dsn = NULL;
@@ -191,6 +194,7 @@ static char *dsn_from_uri(char *uri, char *buf, size_t buflen TSRMLS_DC)
}
return dsn;
}
+/* }}} */
/* {{{ proto void PDO::__construct(string dsn, string username, string passwd [, array options])
*/
@@ -270,7 +274,7 @@ static PHP_METHOD(PDO, dbh_constructor)
/* is this supposed to be a persistent connection ? */
if (options) {
zval **v;
- int plen;
+ int plen = 0;
char *hashkey = NULL;
zend_rsrc_list_entry *le;
pdo_dbh_t *pdbh = NULL;
@@ -338,7 +342,9 @@ static PHP_METHOD(PDO, dbh_constructor)
/* switch over to the persistent one */
dbh = pdbh;
zend_object_store_set_object(object, dbh TSRMLS_CC);
- dbh->refcount++;
+ if (!call_factory) {
+ dbh->refcount++;
+ }
}
if (hashkey) {
@@ -350,6 +356,7 @@ static PHP_METHOD(PDO, dbh_constructor)
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->default_fetch_type = PDO_FETCH_BOTH;
dbh->auto_commit = pdo_attr_lval(options, PDO_ATTR_AUTOCOMMIT, 1 TSRMLS_CC);
@@ -383,6 +390,21 @@ static PHP_METHOD(PDO, dbh_constructor)
}
dbh->driver = driver;
+
+ if (options) {
+ zval **attr_value;
+ char *str_key;
+ long long_key;
+
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(options));
+ while (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(options), (void**)&attr_value)
+ && HASH_KEY_IS_LONG == zend_hash_get_current_key(Z_ARRVAL_P(options), &str_key, &long_key, 0)) {
+
+ pdo_dbh_attribute_set(dbh, long_key, *attr_value TSRMLS_CC);
+ zend_hash_move_forward(Z_ARRVAL_P(options));
+ }
+ }
+
return;
}
@@ -497,7 +519,7 @@ static PHP_METHOD(PDO, prepare)
|| zend_lookup_class(Z_STRVAL_PP(item), Z_STRLEN_PP(item), &pce TSRMLS_CC) == FAILURE
) {
pdo_raise_impl_error(dbh, NULL, "HY000",
- "PDO::ATTR_STATEMENT_CLASS requires format array(classname, ctor_args); "
+ "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();
@@ -546,10 +568,11 @@ static PHP_METHOD(PDO, prepare)
/* 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->default_fetch_type = dbh->default_fetch_type;
stmt->dbh = dbh;
/* give it a reference to me */
zend_objects_store_add_ref(getThis() TSRMLS_CC);
+ php_pdo_dbh_addref(dbh TSRMLS_CC);
stmt->database_object_handle = *getThis();
/* we haven't created a lazy object yet */
ZVAL_NULL(&stmt->lazy_object_ref);
@@ -644,20 +667,8 @@ static PHP_METHOD(PDO, rollBack)
}
/* }}} */
-/* {{{ proto bool PDO::setAttribute(long attribute, mixed value)
- Set an attribute */
-static PHP_METHOD(PDO, setAttribute)
+static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, long attr, zval *value TSRMLS_DC) /* {{{ */
{
- 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);
@@ -666,13 +677,13 @@ static PHP_METHOD(PDO, setAttribute)
case PDO_ERRMODE_WARNING:
case PDO_ERRMODE_EXCEPTION:
dbh->error_mode = Z_LVAL_P(value);
- RETURN_TRUE;
+ return SUCCESS;
default:
pdo_raise_impl_error(dbh, NULL, "HY000", "invalid error mode" TSRMLS_CC);
PDO_HANDLE_DBH_ERR();
- RETURN_FALSE;
+ return FAILURE;
}
- RETURN_FALSE;
+ return FAILURE;
case PDO_ATTR_CASE:
convert_to_long(value);
@@ -681,23 +692,32 @@ static PHP_METHOD(PDO, setAttribute)
case PDO_CASE_UPPER:
case PDO_CASE_LOWER:
dbh->desired_case = Z_LVAL_P(value);
- RETURN_TRUE;
+ return SUCCESS;
default:
pdo_raise_impl_error(dbh, NULL, "HY000", "invalid case folding mode" TSRMLS_CC);
PDO_HANDLE_DBH_ERR();
- RETURN_FALSE;
+ return FAILURE;
}
- RETURN_FALSE;
+ return FAILURE;
case PDO_ATTR_ORACLE_NULLS:
convert_to_long(value);
dbh->oracle_nulls = Z_LVAL_P(value);
- RETURN_TRUE;
+ return SUCCESS;
+
+ case PDO_ATTR_DEFAULT_FETCH_MODE:
+ convert_to_long(value);
+ if (Z_LVAL_P(value) == PDO_FETCH_USE_DEFAULT) {
+ pdo_raise_impl_error(dbh, NULL, "HY000", "invalid fetch mode type" TSRMLS_CC);
+ return FAILURE;
+ }
+ dbh->default_fetch_type = Z_LVAL_P(value);
+ return SUCCESS;
case PDO_ATTR_STRINGIFY_FETCHES:
convert_to_long(value);
dbh->stringify = Z_LVAL_P(value) ? 1 : 0;
- RETURN_TRUE;
+ return SUCCESS;
case PDO_ATTR_STATEMENT_CLASS: {
/* array(string classname, array(mixed ctor_args)) */
@@ -709,7 +729,7 @@ static PHP_METHOD(PDO, setAttribute)
"PDO::ATTR_STATEMENT_CLASS cannot be used with persistent PDO instances"
TSRMLS_CC);
PDO_HANDLE_DBH_ERR();
- RETURN_FALSE;
+ return FAILURE;
}
if (Z_TYPE_P(value) != IS_ARRAY
|| zend_hash_index_find(Z_ARRVAL_P(value), 0, (void**)&item) == FAILURE
@@ -721,19 +741,19 @@ static PHP_METHOD(PDO, setAttribute)
"the classname must be a string specifying an existing class"
TSRMLS_CC);
PDO_HANDLE_DBH_ERR();
- RETURN_FALSE;
+ return FAILURE;
}
if (!instanceof_function(*pce, 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;
+ return FAILURE;
}
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;
+ return FAILURE;
}
dbh->def_stmt_ce = *pce;
if (dbh->def_stmt_ctor_args) {
@@ -747,12 +767,12 @@ static PHP_METHOD(PDO, setAttribute)
"ctor_args must be an array"
TSRMLS_CC);
PDO_HANDLE_DBH_ERR();
- RETURN_FALSE;
+ return FAILURE;
}
(*item)->refcount++;
dbh->def_stmt_ctor_args = *item;
}
- RETURN_TRUE;
+ return SUCCESS;
}
default:
@@ -765,7 +785,7 @@ static PHP_METHOD(PDO, setAttribute)
PDO_DBH_CLEAR_ERR();
if (dbh->methods->set_attribute(dbh, attr, value TSRMLS_CC)) {
- RETURN_TRUE;
+ return SUCCESS;
}
fail:
@@ -776,7 +796,28 @@ fail:
} else {
PDO_HANDLE_DBH_ERR();
}
- RETURN_FALSE;
+ return FAILURE;
+}
+/* }}} */
+
+/* {{{ 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;
+
+ if (pdo_dbh_attribute_set(dbh, attr, value TSRMLS_CC)) {
+ RETURN_TRUE;
+ }
+ RETURN_FALSE;
}
/* }}} */
@@ -819,6 +860,9 @@ static PHP_METHOD(PDO, getAttribute)
add_next_index_zval(return_value, dbh->def_stmt_ctor_args);
}
return;
+ case PDO_ATTR_DEFAULT_FETCH_MODE:
+ RETURN_LONG(dbh->default_fetch_type);
+
}
if (!dbh->methods->get_attribute) {
@@ -968,18 +1012,22 @@ static PHP_METHOD(PDO, query)
/* 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->default_fetch_type = dbh->default_fetch_type;
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);
+ php_pdo_dbh_addref(dbh 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)) {
@@ -1075,8 +1123,8 @@ static PHP_METHOD(PDO, getAvailableDrivers)
zend_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, 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)
@@ -1202,33 +1250,14 @@ static int dbh_compare(zval *object1, zval *object2 TSRMLS_DC)
return -1;
}
-static zend_object_handlers pdo_dbh_object_handlers;
-
-PDO_API void php_pdo_declare_stringl_constant(const char *const_name,
- size_t name_len, const char *value, size_t value_len TSRMLS_DC)
+static zend_object_value dbh_ze1_clone_obj(zval *object TSRMLS_DC)
{
-#if PHP_MAJOR_VERSION > 5 || PHP_MINOR_VERSION >= 1
- zend_declare_class_constant_stringl(pdo_dbh_ce, (char*)const_name, name_len, (char*)value, value_len TSRMLS_CC);
-#else
- zval *constant = malloc(sizeof(*constant));
- ZVAL_STRINGL(constant, zend_strndup(value, value_len), value_len, 0);
- INIT_PZVAL(constant);
- zend_hash_update(&pdo_dbh_ce->constants_table, (char*)const_name, name_len+1, &constant, sizeof(zval*), NULL);
-#endif
+ php_error(E_ERROR, "Cannot clone object of class %s due to 'zend.ze1_compatibility_mode'", Z_OBJCE_P(object)->name);
+ return object->value.obj;
}
-PDO_API void php_pdo_declare_long_constant(const char *const_name,
- size_t name_len, long value TSRMLS_DC)
-{
-#if PHP_MAJOR_VERSION > 5 || PHP_MINOR_VERSION >= 1
- zend_declare_class_constant_long(pdo_dbh_ce, (char*)const_name, name_len, value TSRMLS_CC);
-#else
- zval *constant = malloc(sizeof(*constant));
- ZVAL_LONG(constant, value);
- INIT_PZVAL(constant);
- zend_hash_update(&pdo_dbh_ce->constants_table, (char*)const_name, name_len+1, &constant, sizeof(zval*), NULL);
-#endif
-}
+static zend_object_handlers pdo_dbh_object_handlers;
+static zend_object_handlers pdo_dbh_object_handlers_ze1;
void pdo_dbh_init(TSRMLS_D)
{
@@ -1241,6 +1270,11 @@ void pdo_dbh_init(TSRMLS_D)
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;
+
+ memcpy(&pdo_dbh_object_handlers_ze1, &std_object_handlers, sizeof(zend_object_handlers));
+ pdo_dbh_object_handlers_ze1.get_method = dbh_method_get;
+ pdo_dbh_object_handlers_ze1.compare_objects = dbh_compare;
+ pdo_dbh_object_handlers_ze1.clone_obj = dbh_ze1_clone_obj;
REGISTER_PDO_CLASS_CONST_LONG("PARAM_BOOL", (long)PDO_PARAM_BOOL);
REGISTER_PDO_CLASS_CONST_LONG("PARAM_NULL", (long)PDO_PARAM_NULL);
@@ -1274,6 +1308,7 @@ void pdo_dbh_init(TSRMLS_D)
#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_PROPS_LATE",(long)PDO_FETCH_PROPS_LATE);
REGISTER_PDO_CLASS_CONST_LONG("FETCH_NAMED",(long)PDO_FETCH_NAMED);
REGISTER_PDO_CLASS_CONST_LONG("ATTR_AUTOCOMMIT", (long)PDO_ATTR_AUTOCOMMIT);
@@ -1296,6 +1331,7 @@ void pdo_dbh_init(TSRMLS_D)
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("ATTR_EMULATE_PREPARES",(long)PDO_ATTR_EMULATE_PREPARES);
+ REGISTER_PDO_CLASS_CONST_LONG("ATTR_DEFAULT_FETCH_MODE",(long)PDO_ATTR_DEFAULT_FETCH_MODE);
REGISTER_PDO_CLASS_CONST_LONG("ERRMODE_SILENT", (long)PDO_ERRMODE_SILENT);
REGISTER_PDO_CLASS_CONST_LONG("ERRMODE_WARNING", (long)PDO_ERRMODE_WARNING);
@@ -1339,7 +1375,7 @@ void pdo_dbh_init(TSRMLS_D)
static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC)
{
int i;
-
+
if (--dbh->refcount)
return;
@@ -1361,6 +1397,10 @@ static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC)
if (dbh->password) {
pefree(dbh->password, dbh->is_persistent);
}
+
+ if (dbh->persistent_id) {
+ pefree((char *)dbh->persistent_id, dbh->is_persistent);
+ }
if (dbh->def_stmt_ctor_args) {
zval_ptr_dtor(&dbh->def_stmt_ctor_args);
@@ -1422,7 +1462,7 @@ zend_object_value pdo_dbh_new(zend_class_entry *ce TSRMLS_DC)
dbh->def_stmt_ce = 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;
+ retval.handlers = EG(ze1_compatibility_mode) ? &pdo_dbh_object_handlers_ze1 : &pdo_dbh_object_handlers;
return retval;
}
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index a9f65e28d..a837a14f0 100755
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_stmt.c,v 1.118.2.38 2006/04/22 19:10:53 tony2001 Exp $ */
+/* $Id: pdo_stmt.c,v 1.118.2.38.2.8 2006/08/23 19:15:57 tony2001 Exp $ */
/* The PDO Statement Handle Class */
@@ -392,6 +392,12 @@ static PHP_METHOD(PDOStatement, execute)
zval **tmp;
uint str_length;
ulong num_index;
+
+ if (stmt->bound_params) {
+ zend_hash_destroy(stmt->bound_params);
+ FREE_HASHTABLE(stmt->bound_params);
+ stmt->bound_params = NULL;
+ }
zend_hash_internal_pointer_reset(Z_ARRVAL_P(input_params));
while (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(input_params), (void*)&tmp)) {
@@ -703,8 +709,8 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
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;
- char *fname, *cname;
+ zval **object = NULL, **method = NULL;
+ char *fname = NULL, *cname;
zend_class_entry * ce = NULL, **pce;
zend_function *function_handler;
@@ -717,6 +723,12 @@ static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info *
method = (zval**)Z_ARRVAL_P(callable)->pListHead->pListNext->pData;
if (Z_TYPE_PP(object) == IS_STRING) { /* static call */
+ if (zend_lookup_class(Z_STRVAL_PP(object), Z_STRLEN_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);
@@ -729,10 +741,15 @@ static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info *
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 (Z_TYPE_P(callable) == IS_STRING) {
+ method = &callable;
}
- if (!zend_is_callable(callable, 0, &fname)) {
+ if (!method || !zend_is_callable(callable, 0, &fname)) {
pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback" TSRMLS_CC);
+ if (fname) {
+ efree(fname);
+ }
return 0;
}
@@ -825,9 +842,9 @@ static int do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs TSRMLS_DC) /
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;
+ int flags = how & PDO_FETCH_FLAGS, idx, old_arg_count = 0;
+ zend_class_entry *ce = NULL, *old_ce = NULL;
+ zval grp_val, *grp, **pgrp, *retval, *old_ctor_args = NULL;
how = how & ~PDO_FETCH_FLAGS;
if (how == PDO_FETCH_USE_DEFAULT) {
@@ -854,13 +871,14 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value,
RETVAL_FALSE;
switch (how) {
+ case PDO_FETCH_USE_DEFAULT:
case PDO_FETCH_ASSOC:
case PDO_FETCH_BOTH:
case PDO_FETCH_NUM:
case PDO_FETCH_NAMED:
if (!return_all) {
ALLOC_HASHTABLE(return_value->value.ht);
- zend_hash_init(return_value->value.ht, stmt->column_count, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(return_value->value.ht, stmt->column_count, NULL, ZVAL_PTR_DTOR, 0);
Z_TYPE_P(return_value) = IS_ARRAY;
} else {
array_init(return_value);
@@ -907,6 +925,10 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value,
zval_dtor(&val);
}
ce = stmt->fetch.cls.ce;
+ if (!ce) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch class specified" TSRMLS_CC);
+ return 0;
+ }
if ((flags & PDO_FETCH_SERIALIZE) == 0) {
object_init_ex(return_value, ce);
if (!stmt->fetch.cls.fci.size) {
@@ -915,6 +937,18 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value,
return 0;
}
}
+ if (ce->constructor && (flags & PDO_FETCH_PROPS_LATE)) {
+ 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);
+ }
+ }
+ }
}
break;
@@ -936,6 +970,10 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value,
break;
case PDO_FETCH_FUNC:
+ if (!stmt->fetch.func.function) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch function specified" TSRMLS_CC);
+ return 0;
+ }
if (!stmt->fetch.func.fci.size) {
if (!do_fetch_func_prepare(stmt TSRMLS_CC))
{
@@ -971,6 +1009,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value,
add_assoc_zval(return_value, stmt->columns[i].name, val);
break;
+ case PDO_FETCH_USE_DEFAULT:
case PDO_FETCH_BOTH:
add_assoc_zval(return_value, stmt->columns[i].name, val);
ZVAL_ADDREF(val);
@@ -1077,7 +1116,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value,
switch (how) {
case PDO_FETCH_CLASS:
- if (ce->constructor) {
+ if (ce->constructor && !(flags & PDO_FETCH_PROPS_LATE)) {
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) {
@@ -1505,7 +1544,11 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt,
}
ZVAL_ADDREF(param.parameter);
- return really_register_bound_param(&param, stmt, is_param TSRMLS_CC);
+ if (!really_register_bound_param(&param, stmt, is_param TSRMLS_CC)) {
+ zval_ptr_dtor(&(param.parameter));
+ return 0;
+ }
+ return 1;
} /* }}} */
/* {{{ proto bool PDOStatement::bindValue(mixed $paramno, mixed $param [, int $type ])
@@ -1517,7 +1560,7 @@ static PHP_METHOD(PDOStatement, bindValue)
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", &param.paramno, &param.parameter, &param.param_type)) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|l", &param.name,
@@ -1534,7 +1577,11 @@ static PHP_METHOD(PDOStatement, bindValue)
}
ZVAL_ADDREF(param.parameter);
- RETURN_BOOL(really_register_bound_param(&param, stmt, TRUE TSRMLS_CC));
+ if (!really_register_bound_param(&param, stmt, TRUE TSRMLS_CC)) {
+ zval_ptr_dtor(&(param.parameter));
+ RETURN_FALSE;
+ }
+ RETURN_TRUE;
}
/* }}} */
@@ -2225,6 +2272,9 @@ static void free_statement(pdo_stmt_t *stmt TSRMLS_DC)
do_fetch_opt_finish(stmt, 1 TSRMLS_CC);
zend_objects_store_del_ref(&stmt->database_object_handle TSRMLS_CC);
+ if (stmt->dbh) {
+ php_pdo_dbh_delref(stmt->dbh TSRMLS_CC);
+ }
efree(stmt);
}
@@ -2357,11 +2407,15 @@ static zend_object_iterator_funcs pdo_stmt_iter_funcs = {
NULL
};
-zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC)
+zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
{
pdo_stmt_t *stmt = (pdo_stmt_t*)zend_object_store_get_object(object TSRMLS_CC);
struct php_pdo_iterator *I;
+ if (by_ref) {
+ zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
+ }
+
I = ecalloc(1, sizeof(*I));
I->iter.funcs = &pdo_stmt_iter_funcs;
I->iter.data = I;
diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h
index 74078b4de..31c610c54 100755
--- a/ext/pdo/php_pdo.h
+++ b/ext/pdo/php_pdo.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pdo.h,v 1.7.2.5 2006/01/01 12:50:11 sniper Exp $ */
+/* $Id: php_pdo.h,v 1.7.2.5.2.2 2006/06/07 21:09:52 rasmus Exp $ */
#ifndef PHP_PDO_H
#define PHP_PDO_H
@@ -48,8 +48,6 @@ extern zend_module_entry pdo_module_entry;
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)
@@ -62,14 +60,17 @@ ZEND_END_MODULE_GLOBALS(pdo)
# define PDOG(v) (pdo_globals.v)
#endif
-PDO_API void php_pdo_declare_long_constant(const char *const_name, size_t name_len, long value TSRMLS_DC);
-PDO_API void php_pdo_declare_stringl_constant(const char *const_name, size_t name_len, const char *value, size_t value_len TSRMLS_DC);
-
#define REGISTER_PDO_CLASS_CONST_LONG(const_name, value) \
- php_pdo_declare_long_constant(const_name, sizeof(const_name)-1, (long)value TSRMLS_CC);
+ zend_declare_class_constant_long(php_pdo_get_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) \
- php_pdo_declare_stringl_constant(const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
+ zend_declare_class_constant_stringl(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
#define PDO_CONSTRUCT_CHECK \
if (!dbh->driver) { \
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h
index 451778109..e87650b1b 100755
--- a/ext/pdo/php_pdo_driver.h
+++ b/ext/pdo/php_pdo_driver.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pdo_driver.h,v 1.66.2.11 2006/04/09 08:05:01 wez Exp $ */
+/* $Id: php_pdo_driver.h,v 1.66.2.11.2.3 2006/09/28 23:27:59 tony2001 Exp $ */
#ifndef PHP_PDO_DRIVER_H
#define PHP_PDO_DRIVER_H
@@ -44,7 +44,7 @@ PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC);
# define FALSE 0
#endif
-#define PDO_DRIVER_API 20060409
+#define PDO_DRIVER_API 20060511
enum pdo_param_type {
PDO_PARAM_NULL,
@@ -98,6 +98,7 @@ enum pdo_fetch_type {
#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 */
+#define PDO_FETCH_PROPS_LATE 0x00100000 /* fetch props after calling ctor */
/* fetch orientation for scrollable cursors */
enum pdo_fetch_orientation {
@@ -129,6 +130,7 @@ enum pdo_attribute_type {
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 */
+ PDO_ATTR_DEFAULT_FETCH_MODE, /* Set the default fetch mode */
PDO_ATTR_EMULATE_PREPARES, /* use query emulation rather than native */
/* this defines the start of the range for driver specific options.
@@ -340,7 +342,7 @@ enum pdo_param_event {
PDO_PARAM_EVT_EXEC_POST,
PDO_PARAM_EVT_FETCH_PRE,
PDO_PARAM_EVT_FETCH_POST,
- PDO_PARAM_EVT_NORMALIZE
+ PDO_PARAM_EVT_NORMALIZE,
};
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);
@@ -489,6 +491,7 @@ struct _pdo_dbh_t {
pdo_driver_t *driver;
zend_class_entry *def_stmt_ce;
+
zval *def_stmt_ctor_args;
/* when calling PDO::query(), we need to keep the error
@@ -497,12 +500,15 @@ struct _pdo_dbh_t {
* when PDO::query() fails */
pdo_stmt_t *query_stmt;
zval query_stmt_zval;
+
+ /* defaults for fetches */
+ enum pdo_fetch_type default_fetch_type;
};
/* describes a column */
struct pdo_column_data {
char *name;
- long namelen;
+ int namelen;
unsigned long maxlen;
enum pdo_param_type param_type;
unsigned long precision;
@@ -515,7 +521,7 @@ struct pdo_column_data {
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;
+ int namelen;
long max_value_len; /* as a hint for pre-allocation */
@@ -639,7 +645,8 @@ 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(void);
+PDO_API zend_class_entry *php_pdo_get_dbh_ce();
+PDO_API zend_class_entry *php_pdo_get_exception();
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
char **outquery, int *outquery_len TSRMLS_DC);
diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h
index fb567af8c..c489903dd 100755
--- a/ext/pdo/php_pdo_int.h
+++ b/ext/pdo/php_pdo_int.h
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pdo_int.h,v 1.17.2.6 2006/01/01 12:50:11 sniper Exp $ */
+/* $Id: php_pdo_int.h,v 1.17.2.6.2.1 2006/05/11 22:43:44 helly Exp $ */
/* Stuff private to the PDO extension and not for consumption by PDO drivers
* */
@@ -40,7 +40,7 @@ extern zend_object_value pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC);
extern zend_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);
+zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref 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);
diff --git a/ext/pdo/tests/bug_36428.phpt b/ext/pdo/tests/bug_36428.phpt
new file mode 100755
index 000000000..6abba6bd7
--- /dev/null
+++ b/ext/pdo/tests/bug_36428.phpt
@@ -0,0 +1,33 @@
+--TEST--
+PDO Common: PHP Bug #36428: Incorrect error message for PDO::fetchAll
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+if (!extension_loaded('simplexml')) die('skip SimpleXML not loaded');
+$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 (a VARCHAR(10))");
+$db->exec("INSERT INTO test (a) VALUES ('xyz')");
+$res = $db->query("SELECT a FROM test");
+var_dump($res->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_PROPS_LATE, 'SimpleXMLElement', array('<root/>')));
+
+?>
+===DONE===
+--EXPECTF--
+array(1) {
+ [0]=>
+ object(SimpleXMLElement)#%d (1) {
+ ["a"]=>
+ string(3) "xyz"
+ }
+}
+===DONE===
diff --git a/ext/pdo/tests/bug_38253.phpt b/ext/pdo/tests/bug_38253.phpt
new file mode 100644
index 000000000..6dfdab8df
--- /dev/null
+++ b/ext/pdo/tests/bug_38253.phpt
@@ -0,0 +1,47 @@
+--TEST--
+PDO Common: PHP Bug #38253: PDO produces segfault with default fetch mode
+--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';
+$pdo = PDOTest::factory();
+
+$pdo->exec ("create table test (id integer primary key, n text)");
+$pdo->exec ("INSERT INTO test (id, n) VALUES (1, 'hi')");
+
+$pdo->setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_CLASS);
+$stmt = $pdo->prepare ("SELECT * FROM test");
+$stmt->execute();
+var_dump($stmt->fetchAll());
+
+$pdo = PDOTest::factory();
+
+$pdo->exec ("create table test2 (id integer primary key, n text)");
+$pdo->exec ("INSERT INTO test2 (id, n) VALUES (1,'hi')");
+
+$pdo->setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_FUNC);
+$stmt = $pdo->prepare ("SELECT * FROM test2");
+$stmt->execute();
+var_dump($stmt->fetchAll());
+
+?>
+--EXPECTF--
+Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: No fetch class specified in %s on line %d
+
+Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error%s on line %d
+array(0) {
+}
+
+Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error: No fetch function specified in %s on line %d
+
+Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error%s on line %d
+array(0) {
+}
diff --git a/ext/pdo/tests/bug_38394.phpt b/ext/pdo/tests/bug_38394.phpt
new file mode 100644
index 000000000..38ce9bc36
--- /dev/null
+++ b/ext/pdo/tests/bug_38394.phpt
@@ -0,0 +1,51 @@
+--TEST--
+PDO Common: PHP Bug #38394: Prepared statement error stops subsequent statements
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+if (!strncasecmp(getenv('PDOTEST_DSN'), 'sqlite2', strlen('sqlite2'))) die('skip not relevant for pdo_sqlite2 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 (a INT, b INT, c INT)");
+$s = $db->prepare("INSERT INTO test (a,b,c) VALUES (:a,:b,:c)");
+
+$s->execute(array('a' => 1, 'b' => 2, 'c' => 3));
+
+@$s->execute(array('a' => 5, 'b' => 6, 'c' => 7, 'd' => 8));
+
+$s->execute(array('a' => 9, 'b' => 10, 'c' => 11));
+
+var_dump($db->query("SELECT * FROM test")->fetchAll(PDO::FETCH_ASSOC));
+?>
+===DONE===
+--EXPECTF--
+array(2) {
+ [0]=>
+ array(3) {
+ ["a"]=>
+ string(1) "1"
+ ["b"]=>
+ string(1) "2"
+ ["c"]=>
+ string(1) "3"
+ }
+ [1]=>
+ array(3) {
+ ["a"]=>
+ string(1) "9"
+ ["b"]=>
+ string(2) "10"
+ ["c"]=>
+ string(2) "11"
+ }
+}
+===DONE===
diff --git a/ext/pdo/tests/pdo_017.phpt b/ext/pdo/tests/pdo_017.phpt
index f1bfb97f6..651ee2860 100644
--- a/ext/pdo/tests/pdo_017.phpt
+++ b/ext/pdo/tests/pdo_017.phpt
@@ -56,8 +56,17 @@ $db->rollBack();
echo countRows('rollback');
+$db->beginTransaction();
+$delete->execute();
+echo countRows('delete');
+$db->commit();
+
+echo countRows('commit');
+
?>
--EXPECT--
Counted 3 rows after insert.
Counted 0 rows after delete.
Counted 3 rows after rollback.
+Counted 0 rows after delete.
+Counted 0 rows after commit.
diff --git a/ext/pdo/tests/pdo_026.phpt b/ext/pdo/tests/pdo_026.phpt
index a0891bedf..d993f3244 100644
--- a/ext/pdo/tests/pdo_026.phpt
+++ b/ext/pdo/tests/pdo_026.phpt
@@ -107,5 +107,5 @@ array(3) {
string(3) "tsr"
}
===DONE===
-PDODatabase::__destruct()
PDOStatementX::__destruct()
+PDODatabase::__destruct()
diff --git a/ext/pdo/tests/pdo_029.phpt b/ext/pdo/tests/pdo_029.phpt
index c0b674cd4..a5847149c 100755
--- a/ext/pdo/tests/pdo_029.phpt
+++ b/ext/pdo/tests/pdo_029.phpt
@@ -121,5 +121,5 @@ array(3) {
string(3) "tsr"
}
===DONE===
-PDODatabase::__destruct()
PDOStatementX::__destruct()
+PDODatabase::__destruct()
diff --git a/ext/pdo/tests/pdo_030.phpt b/ext/pdo/tests/pdo_030.phpt
index e9d547540..b6482d69d 100755
--- a/ext/pdo/tests/pdo_030.phpt
+++ b/ext/pdo/tests/pdo_030.phpt
@@ -135,42 +135,5 @@ array(3) {
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_031.phpt b/ext/pdo/tests/pdo_031.phpt
index 79f6b4252..9065ce971 100755
--- a/ext/pdo/tests/pdo_031.phpt
+++ b/ext/pdo/tests/pdo_031.phpt
@@ -3,7 +3,7 @@ PDO Common: PDOStatement SPL iterator
--SKIPIF--
<?php # vim:ft=php
if (!extension_loaded('pdo')) die('skip');
-if (!extension_loaded('SPL')) die ('skip SPL not available');
+if (!extension_loaded('SPL')) die('skip SPL not available');
$dir = getenv('REDIR_TEST_DIR');
if (false == $dir) die('skip no driver');
require_once $dir . 'pdo_test.inc';
diff --git a/ext/pdo/tests/pdo_033.phpt b/ext/pdo/tests/pdo_033.phpt
new file mode 100644
index 000000000..9739c0e0e
--- /dev/null
+++ b/ext/pdo/tests/pdo_033.phpt
@@ -0,0 +1,39 @@
+--TEST--
+PDO Common: PDO::quote()
+--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();
+
+$unquoted = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
+
+$quoted = $db->quote($unquoted);
+
+$db->query("CREATE TABLE test (t char(100))");
+$db->query("INSERT INTO test (t) VALUES($quoted)");
+
+$stmt = $db->prepare('SELECT * from test');
+$stmt->execute();
+
+print_r($stmt->fetchAll(PDO::FETCH_ASSOC));
+
+
+?>
+--EXPECT--
+Array
+(
+ [0] => Array
+ (
+ [t] => !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
+ )
+
+)
diff --git a/ext/pdo/tests/pdo_test.inc b/ext/pdo/tests/pdo_test.inc
index a023fd89b..4d14f32d4 100644
--- a/ext/pdo/tests/pdo_test.inc
+++ b/ext/pdo/tests/pdo_test.inc
@@ -65,9 +65,9 @@ class PDOTest {
}
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];
+ foreach ($db->query("show variables like 'have%'") as $row) {
+ if ($row[1] == 'YES' && ($row[0] == 'have_innodb' || $row[0] == 'have_bdb')) {
+ return str_replace("have_", "", $row[0]);
}
}
return false;
diff --git a/ext/pdo_dblib/config.w32 b/ext/pdo_dblib/config.w32
index 3b7a3a4b8..c853e634d 100755
--- a/ext/pdo_dblib/config.w32
+++ b/ext/pdo_dblib/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.7 2005/02/16 18:09:26 wez Exp $
+// $Id: config.w32,v 1.7.4.1 2006/05/11 21:43:58 edink Exp $
// vim:ft=javascript
ARG_WITH("pdo-dblib", "freetds dblib (Sybase, MS-SQL) support for PDO", "no");
@@ -12,7 +12,7 @@ if (PHP_PDO_DBLIB != "no") {
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_FLAG('CFLAGS_PDO_DBLIB', "/D PDO_DBLIB_FLAVOUR=\\\"freetds\\\"");
}
ADD_EXTENSION_DEP('pdo_dblib', 'pdo');
}
@@ -63,7 +63,7 @@ if (PHP_PDO_MSSQL != "no") {
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_FLAG('CFLAGS_PDO_MSSQL', "/D PDO_DBLIB_FLAVOUR=\\\"" + PDO_DBLIB_FLAVOUR + "\\\"");
}
ADD_EXTENSION_DEP('pdo_mssql', 'pdo');
}
diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c
index cd104a6ef..f0adfd910 100644
--- a/ext/pdo_dblib/pdo_dblib.c
+++ b/ext/pdo_dblib/pdo_dblib.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_dblib.c,v 1.9.2.6 2006/01/01 12:47:32 sniper Exp $ */
+/* $Id: pdo_dblib.c,v 1.9.2.6.2.2 2006/07/24 00:01:02 sniper Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -33,6 +33,7 @@
#include "zend_exceptions.h"
ZEND_DECLARE_MODULE_GLOBALS(dblib)
+static PHP_GINIT_FUNCTION(dblib);
zend_function_entry pdo_dblib_functions[] = {
{NULL, NULL, NULL}
@@ -66,7 +67,11 @@ zend_module_entry pdo_dblib_module_entry = {
PHP_RSHUTDOWN(pdo_dblib),
PHP_MINFO(pdo_dblib),
"1.0.1",
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(dblib),
+ PHP_GINIT(dblib),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
#if defined(COMPILE_DL_PDO_DBLIB) || defined(COMPILE_DL_PDO_MSSQL)
@@ -146,11 +151,10 @@ int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate,
return 0;
}
-static int init_dblib_globals(zend_dblib_globals *g)
+static PHP_GINIT_FUNCTION(dblib)
{
- memset(g, 0, sizeof(*g));
- g->err.sqlstate = g->sqlstate;
- return SUCCESS;
+ memset(dblib_globals, 0, sizeof(*dblib_globals));
+ dblib_globals->err.sqlstate = dblib_globals->sqlstate;
}
PHP_RSHUTDOWN_FUNCTION(pdo_dblib)
@@ -180,8 +184,6 @@ PHP_MINIT_FUNCTION(pdo_dblib)
return FAILURE;
}
- ZEND_INIT_MODULE_GLOBALS(dblib, init_dblib_globals, NULL);
-
/* TODO:
dbsetifile()
diff --git a/ext/pdo_firebird/config.w32 b/ext/pdo_firebird/config.w32
index 952ad79ee..833b7b95f 100644
--- a/ext/pdo_firebird/config.w32
+++ b/ext/pdo_firebird/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.6 2004/06/12 18:42:13 abies Exp $
+// $Id: config.w32,v 1.6.4.1 2006/05/11 21:43:59 edink Exp $
// vim:ft=javascript
ARG_WITH("pdo-firebird", "Firebird support for PDO", "no");
@@ -10,7 +10,6 @@ if (PHP_PDO_FIREBIRD != "no") {
) && 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");
}
diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4
index 26172b644..b08a65f82 100755
--- a/ext/pdo_mysql/config.m4
+++ b/ext/pdo_mysql/config.m4
@@ -1,11 +1,11 @@
dnl
-dnl $Id: config.m4,v 1.25.2.7 2006/05/02 00:59:22 wez Exp $
+dnl $Id: config.m4,v 1.25.2.7.2.3 2006/08/14 20:11:31 tony2001 Exp $
dnl
if test "$PHP_PDO" != "no"; then
AC_DEFUN([PDO_MYSQL_LIB_CHK], [
- str="$PDO_MYSQL_DIR/$1/libmysqlclient.*"
+ str="$PDO_MYSQL_DIR/$1/libmysqlclient*"
for j in `echo $str`; do
if test -r $j; then
PDO_MYSQL_LIB_DIR=$MYSQL_DIR/$1
@@ -53,8 +53,14 @@ if test "$PHP_PDO_MYSQL" != "no"; then
if test "x$SED" = "x"; then
AC_PATH_PROG(SED, sed)
fi
+ if test "$enable_maintainer_zts" = "yes"; then
+ PDO_MYSQL_LIBNAME=mysqlclient_r
+ PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs_r | $SED -e "s/'//g"`
+ else
+ PDO_MYSQL_LIBNAME=mysqlclient
+ PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"`
+ fi
PDO_MYSQL_INCLUDE=`$PDO_MYSQL_CONFIG --cflags | $SED -e "s/'//g"`
- PDO_MYSQL_LIBS=`$PDO_MYSQL_CONFIG --libs | $SED -e "s/'//g"`
PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket`
elif test -z "$PDO_MYSQL_DIR"; then
AC_MSG_RESULT([not found])
@@ -66,7 +72,7 @@ if test "$PHP_PDO_MYSQL" != "no"; then
PDO_MYSQL_INC_DIR=$PDO_MYSQL_DIR/include/mysql
else
PDO_MYSQL_INC_DIR=$PDO_MYSQL_DIR/include
- fi
+ fi
if test -r $PDO_MYSQL_DIR/lib/mysql; then
PDO_MYSQL_LIB_DIR=$PDO_MYSQL_DIR/lib/mysql
else
@@ -80,24 +86,25 @@ if test "$PHP_PDO_MYSQL" != "no"; then
AC_MSG_ERROR([Unable to find your mysql installation])
fi
- PHP_ADD_LIBRARY_WITH_PATH(mysqlclient, $PDO_MYSQL_LIB_DIR, PDO_MYSQL_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH($PDO_MYSQL_LIBNAME, $PDO_MYSQL_LIB_DIR, PDO_MYSQL_SHARED_LIBADD)
PHP_ADD_INCLUDE($PDO_MYSQL_INC_DIR)
PDO_MYSQL_INCLUDE=-I$PDO_MYSQL_INC_DIR
fi
AC_DEFINE_UNQUOTED(PDO_MYSQL_UNIX_ADDR, "$PDO_MYSQL_SOCKET", [ ])
-
- _SAVE_LIBS=$LIBS
- LIBS="$LIBS $PDO_MYSQL_LIBS"
- PHP_CHECK_LIBRARY(mysqlclient, mysql_query,
+
+ PHP_CHECK_LIBRARY($PDO_MYSQL_LIBNAME, mysql_query,
[
+ PHP_EVAL_INCLINE($PDO_MYSQL_INCLUDE)
PHP_EVAL_LIBLINE($PDO_MYSQL_LIBS, PDO_MYSQL_SHARED_LIBADD)
],[
AC_MSG_ERROR([mysql_query missing!?])
],[
$PDO_MYSQL_LIBS
])
+ _SAVE_LIBS=$LIBS
+ LIBS="$LIBS $PDO_MYSQL_LIBS"
AC_CHECK_FUNCS([mysql_commit mysql_stmt_prepare mysql_next_result mysql_sqlstate])
LIBS=$_SAVE_LIBS
@@ -118,14 +125,13 @@ if test "$PHP_PDO_MYSQL" != "no"; then
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 $PDO_MYSQL_INCLUDE)
+ 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_SHARED_LIBADD=$PDO_MYSQL_LIBS
+
PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)
PHP_SUBST_OLD(PDO_MYSQL_MODULE_TYPE)
fi
diff --git a/ext/pdo_mysql/config.w32 b/ext/pdo_mysql/config.w32
index 23ff7daa3..49ba874b5 100644
--- a/ext/pdo_mysql/config.w32
+++ b/ext/pdo_mysql/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.4 2004/08/15 15:56:33 helly Exp $
+// $Id: config.w32,v 1.4.4.1 2006/05/11 21:43:59 edink Exp $
// vim:ft=javascript
ARG_WITH("pdo-mysql", "MySQL support for PDO", "no");
@@ -7,7 +7,6 @@ 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");
}
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index 39a22f164..650b832d9 100755
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysql_driver.c,v 1.59.2.13 2006/04/09 08:11:31 wez Exp $ */
+/* $Id: mysql_driver.c,v 1.59.2.13.2.1 2006/10/02 22:09:49 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -379,6 +379,34 @@ static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value
return 1;
}
+static int pdo_mysql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+{
+ pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
+#if MYSQL_VERSION_ID <= 32230
+ void (*handler) (int);
+ unsigned int my_errno;
+#endif
+
+#if MYSQL_VERSION_ID > 32230
+ if (mysql_ping(H->server)) {
+ return FAILURE;
+ }
+#else /* no mysql_ping() */
+ handler=signal(SIGPIPE, SIG_IGN);
+ mysql_stat(H->server);
+ switch (mysql_errno(H->server)) {
+ case CR_SERVER_GONE_ERROR:
+ /* case CR_SERVER_LOST: I'm not sure this means the same as "gone" for us */
+ signal(SIGPIPE, handler);
+ return FAILURE;
+ default:
+ break;
+ }
+ signal(SIGPIPE, handler);
+#endif /* end mysql_ping() */
+ return SUCCESS;
+}
+/* }}} */
static struct pdo_dbh_methods mysql_methods = {
mysql_handle_closer,
@@ -392,7 +420,7 @@ static struct pdo_dbh_methods mysql_methods = {
pdo_mysql_last_insert_id,
pdo_mysql_fetch_error_func,
pdo_mysql_get_attribute,
- NULL /* check_liveness: TODO: ping */
+ pdo_mysql_check_liveness
};
#ifndef PDO_MYSQL_UNIX_ADDR
diff --git a/ext/pdo_mysql/tests/bug_33689.phpt b/ext/pdo_mysql/tests/bug_33689.phpt
index 609e3dce5..bd0a40904 100644
--- a/ext/pdo_mysql/tests/bug_33689.phpt
+++ b/ext/pdo_mysql/tests/bug_33689.phpt
@@ -5,10 +5,12 @@ PDO MySQL Bug #33689
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
require dirname(__FILE__) . '/config.inc';
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
PDOTest::skip();
?>
--FILE--
<?php
+require dirname(__FILE__) . '/config.inc';
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
diff --git a/ext/pdo_mysql/tests/bug_37445.phpt b/ext/pdo_mysql/tests/bug_37445.phpt
new file mode 100644
index 000000000..c4d760083
--- /dev/null
+++ b/ext/pdo_mysql/tests/bug_37445.phpt
@@ -0,0 +1,21 @@
+--TEST--
+PDO MySQL Bug #37445 (Premature stmt object destruction)
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
+require dirname(__FILE__) . '/config.inc';
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+PDOTest::skip();
+?>
+--FILE--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+
+$db->setAttribute(PDO :: ATTR_EMULATE_PREPARES, true);
+$stmt = $db->prepare("SELECT 1");
+$stmt->bindParam(':a', 'b');
+
+--EXPECTF--
+Fatal error: Cannot pass parameter 2 by reference in %s/bug_37445.php on line %d \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/last_insert_id.phpt b/ext/pdo_mysql/tests/last_insert_id.phpt
new file mode 100644
index 000000000..d48ba1499
--- /dev/null
+++ b/ext/pdo_mysql/tests/last_insert_id.phpt
@@ -0,0 +1,36 @@
+--TEST--
+PDO MySQL auto_increment / last insert id
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
+require dirname(__FILE__) . '/config.inc';
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+PDOTest::skip();
+?>
+--FILE--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+
+print_r($db->query("CREATE TABLE test (id int auto_increment primary key, num int)"));
+
+print_r($db->query("INSERT INTO test (id, num) VALUES (23, 42)"));
+
+print_r($db->query("INSERT INTO test (num) VALUES (451)"));
+
+print_r($db->lastInsertId());
+--EXPECT--
+PDOStatement Object
+(
+ [queryString] => CREATE TABLE test (id int auto_increment primary key, num int)
+)
+PDOStatement Object
+(
+ [queryString] => INSERT INTO test (id, num) VALUES (23, 42)
+)
+PDOStatement Object
+(
+ [queryString] => INSERT INTO test (num) VALUES (451)
+)
+24 \ No newline at end of file
diff --git a/ext/pdo_mysql/tests/pecl_bug_5200.phpt b/ext/pdo_mysql/tests/pecl_bug_5200.phpt
index 2dffd1141..639a640c8 100644
--- a/ext/pdo_mysql/tests/pecl_bug_5200.phpt
+++ b/ext/pdo_mysql/tests/pecl_bug_5200.phpt
@@ -5,6 +5,7 @@ PDO MySQL PECL Bug #5200
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
require dirname(__FILE__) . '/config.inc';
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
PDOTest::skip();
?>
--FILE--
diff --git a/ext/pdo_mysql/tests/pecl_bug_5780.phpt b/ext/pdo_mysql/tests/pecl_bug_5780.phpt
index 643597c01..ef94db13c 100644
--- a/ext/pdo_mysql/tests/pecl_bug_5780.phpt
+++ b/ext/pdo_mysql/tests/pecl_bug_5780.phpt
@@ -5,6 +5,7 @@ PDO MySQL PECL Bug #5780
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
require dirname(__FILE__) . '/config.inc';
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
PDOTest::skip();
?>
--FILE--
diff --git a/ext/pdo_mysql/tests/pecl_bug_5802.phpt b/ext/pdo_mysql/tests/pecl_bug_5802.phpt
index 70bd46163..f154dd13a 100644
--- a/ext/pdo_mysql/tests/pecl_bug_5802.phpt
+++ b/ext/pdo_mysql/tests/pecl_bug_5802.phpt
@@ -5,6 +5,7 @@ PDO MySQL PECL Bug #5802
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
require dirname(__FILE__) . '/config.inc';
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
PDOTest::skip();
?>
--FILE--
diff --git a/ext/pdo_mysql/tests/show_tables.phpt b/ext/pdo_mysql/tests/show_tables.phpt
index 90b07db32..97dfe686e 100644
--- a/ext/pdo_mysql/tests/show_tables.phpt
+++ b/ext/pdo_mysql/tests/show_tables.phpt
@@ -4,7 +4,8 @@ PDO MySQL SHOW TABLES
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
require dirname(__FILE__) . '/config.inc';
-require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
PDOTest::skip();
?>
--FILE--
diff --git a/ext/pdo_oci/config.w32 b/ext/pdo_oci/config.w32
index d58d2e961..3663c940f 100755
--- a/ext/pdo_oci/config.w32
+++ b/ext/pdo_oci/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.6 2005/01/20 15:54:35 edink Exp $
+// $Id: config.w32,v 1.6.4.1 2006/05/11 21:43:59 edink Exp $
// vim:ft=javascript
ARG_WITH("pdo-oci", "Oracle OCI support for PDO", "no");
@@ -32,7 +32,6 @@ if (PHP_PDO_OCI != "no") {
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);
@@ -70,7 +69,6 @@ if (PHP_PDO_OCI8 != "no") {
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);
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c
index 085ca9007..79e4c26b0 100755
--- a/ext/pdo_odbc/odbc_driver.c
+++ b/ext/pdo_odbc/odbc_driver.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: odbc_driver.c,v 1.27.2.4 2006/04/30 01:27:33 wez Exp $ */
+/* $Id: odbc_driver.c,v 1.27.2.4.2.1 2006/10/11 02:10:55 wez Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c
index 2711355ed..a92c27e18 100755
--- a/ext/pdo_odbc/odbc_stmt.c
+++ b/ext/pdo_odbc/odbc_stmt.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: odbc_stmt.c,v 1.26.2.2 2006/03/27 21:04:12 wez Exp $ */
+/* $Id: odbc_stmt.c,v 1.26.2.2.2.2 2006/10/11 03:07:28 wez Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -359,7 +359,10 @@ static int odbc_stmt_fetch(pdo_stmt_t *stmt,
}
rc = SQLFetchScroll(S->stmt, odbcori, offset);
- if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
+ if (rc == SQL_SUCCESS) {
+ return 1;
+ }
+ if (rc == SQL_SUCCESS_WITH_INFO) {
pdo_odbc_stmt_error("SQLFetchScroll");
return 1;
}
@@ -381,16 +384,30 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
zend_bool dyn = FALSE;
RETCODE rc;
SWORD colnamelen;
- SDWORD colsize;
+ SDWORD colsize, displaysize;
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;
+ pdo_odbc_stmt_error("SQLDescribeCol");
+ if (rc != SQL_SUCCESS_WITH_INFO) {
+ return 0;
+ }
+ }
+
+ rc = SQLColAttribute(S->stmt, colno+1,
+ SQL_DESC_DISPLAY_SIZE,
+ NULL, 0, NULL, &displaysize);
+
+ if (rc != SQL_SUCCESS) {
+ pdo_odbc_stmt_error("SQLColAttribute");
+ if (rc != SQL_SUCCESS_WITH_INFO) {
+ return 0;
+ }
}
+ colsize = displaysize;
col->maxlen = S->cols[colno].datalen = colsize;
col->namelen = colnamelen;
@@ -404,6 +421,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
* column. */
if (colsize < 256 && !S->going_long) {
S->cols[colno].data = emalloc(colsize+1);
+ S->cols[colno].is_long = 0;
rc = SQLBindCol(S->stmt, colno+1, SQL_C_CHAR, S->cols[colno].data,
S->cols[colno].datalen+1, &S->cols[colno].fetched_len);
@@ -417,6 +435,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
* "long" columns */
S->cols[colno].data = emalloc(256);
S->going_long = 1;
+ S->cols[colno].is_long = 1;
}
return 1;
@@ -428,7 +447,7 @@ static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned l
pdo_odbc_column *C = &S->cols[colno];
/* if it is a column containing "long" data, perform late binding now */
- if (C->datalen > 255) {
+ if (C->is_long) {
unsigned long alloced = 4096;
unsigned long used = 0;
char *buf;
@@ -468,6 +487,11 @@ static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned l
if (rc == SQL_NO_DATA) {
/* we got the lot */
break;
+ } else if (rc != SQL_SUCCESS) {
+ pdo_odbc_stmt_error("SQLGetData");
+ if (rc != SQL_SUCCESS_WITH_INFO) {
+ break;
+ }
}
if (C->fetched_len == SQL_NO_TOTAL) {
@@ -476,6 +500,11 @@ static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned l
used += C->fetched_len;
}
+ if (rc == SQL_SUCCESS) {
+ /* this was the final fetch */
+ break;
+ }
+
/* we need to fetch another chunk; resize the
* buffer */
alloced *= 2;
diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c
index 43292d8fd..4d3f08d30 100755
--- a/ext/pdo_odbc/pdo_odbc.c
+++ b/ext/pdo_odbc/pdo_odbc.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_odbc.c,v 1.14.2.7 2005/12/04 22:34:26 wez Exp $ */
+/* $Id: pdo_odbc.c,v 1.14.2.7.2.1 2006/10/11 02:10:56 wez Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/pdo_odbc/php_pdo_odbc.h b/ext/pdo_odbc/php_pdo_odbc.h
index 2803e293a..873905b0c 100644
--- a/ext/pdo_odbc/php_pdo_odbc.h
+++ b/ext/pdo_odbc/php_pdo_odbc.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pdo_odbc.h,v 1.2 2005/07/07 12:49:21 wez Exp $ */
+/* $Id: php_pdo_odbc.h,v 1.2.4.1 2006/10/11 02:10:56 wez Exp $ */
#ifndef PHP_PDO_ODBC_H
#define PHP_PDO_ODBC_H
diff --git a/ext/pdo_odbc/php_pdo_odbc_int.h b/ext/pdo_odbc/php_pdo_odbc_int.h
index 5286a8b7e..1c7337193 100755
--- a/ext/pdo_odbc/php_pdo_odbc_int.h
+++ b/ext/pdo_odbc/php_pdo_odbc_int.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pdo_odbc_int.h,v 1.9.2.1 2006/03/27 21:04:12 wez Exp $ */
+/* $Id: php_pdo_odbc_int.h,v 1.9.2.1.2.1 2006/10/11 02:10:56 wez Exp $ */
#ifdef PHP_WIN32
# define PDO_ODBC_TYPE "Win32"
@@ -137,6 +137,7 @@ typedef struct {
long fetched_len;
SWORD coltype;
char colname[128];
+ unsigned is_long;
} pdo_odbc_column;
typedef struct {
diff --git a/ext/pdo_odbc/tests/long_columns.phpt b/ext/pdo_odbc/tests/long_columns.phpt
index bc3abe94c..65ec2f96e 100644
--- a/ext/pdo_odbc/tests/long_columns.phpt
+++ b/ext/pdo_odbc/tests/long_columns.phpt
@@ -12,7 +12,9 @@ $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()));
+ if (false === $db->exec('CREATE TABLE TEST (id INT NOT NULL PRIMARY KEY, data varchar(4000))')) {
+ die("BORK: don't know how to create a long column here:\n" . implode(", ", $db->errorInfo()));
+ }
}
}
diff --git a/ext/pdo_pgsql/config.m4 b/ext/pdo_pgsql/config.m4
index fd9a9297a..2ba87ab8c 100644
--- a/ext/pdo_pgsql/config.m4
+++ b/ext/pdo_pgsql/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.13 2005/07/27 02:51:01 wez Exp $
+dnl $Id: config.m4,v 1.13.4.2 2006/10/06 22:34:16 iliaa Exp $
dnl
if test "$PHP_PDO" != "no"; then
@@ -82,6 +82,8 @@ if test "$PHP_PDO_PGSQL" != "no"; then
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, PQescapeStringConn, AC_DEFINE(HAVE_PQESCAPE_CONN,1,[PostgreSQL 8.1.4 or later]))
+ AC_CHECK_LIB(pq, PQescapeByteaConn, AC_DEFINE(HAVE_PQESCAPE_BYTEA_CONN,1,[PostgreSQL 8.1.4 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]))
diff --git a/ext/pdo_pgsql/config.w32 b/ext/pdo_pgsql/config.w32
index 618ff1fc6..765abedda 100644
--- a/ext/pdo_pgsql/config.w32
+++ b/ext/pdo_pgsql/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.4.2.1 2006/03/14 10:49:18 edink Exp $
+// $Id: config.w32,v 1.4.2.1.2.3 2006/10/11 11:00:03 edink Exp $
// vim:ft=javascript
ARG_WITH("pdo-pgsql", "PostgreSQL support for PDO", "no");
@@ -12,9 +12,8 @@ if (PHP_PDO_PGSQL != "no") {
ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PG_CONFIG_H");
}
- 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");
+ 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 /D HAVE_PQESCAPE_CONN=1 /D HAVE_PQESCAPE_BYTEA_CONN=1");
} else {
WARNING("pdo_pgsql not enabled; libraries and headers not found");
}
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index 84fd076c6..2a8c971df 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql_driver.c,v 1.53.2.14 2006/04/09 08:17:50 wez Exp $ */
+/* $Id: pgsql_driver.c,v 1.53.2.14.2.4 2006/10/06 22:34:16 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -229,6 +229,9 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len,
PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL;
if (scrollable) {
+ if (S->cursor_name) {
+ efree(S->cursor_name);
+ }
/* TODO: check how scrollable cursors related to prepared statements */
spprintf(&S->cursor_name, 0, "pdo_pgsql_cursor_%08x", (unsigned int) stmt);
}
@@ -306,11 +309,16 @@ static long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRM
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;
+ pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
switch (paramtype) {
case PDO_PARAM_LOB:
/* escapedlen returned by PQescapeBytea() accounts for trailing 0 */
+#ifdef HAVE_PQESCAPE_BYTEA_CONN
+ escaped = PQescapeByteaConn(H->server, unquoted, unquotedlen, quotedlen);
+#else
escaped = PQescapeBytea(unquoted, unquotedlen, quotedlen);
+#endif
*quotedlen += 1;
*quoted = emalloc(*quotedlen + 1);
memcpy((*quoted)+1, escaped, *quotedlen-2);
@@ -320,9 +328,13 @@ static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote
free(escaped);
break;
default:
- *quoted = emalloc(2*unquotedlen + 3);
+ *quoted = safe_emalloc(2, unquotedlen, 3);
(*quoted)[0] = '\'';
+#ifndef HAVE_PQESCAPE_CONN
*quotedlen = PQescapeString(*quoted + 1, unquoted, unquotedlen);
+#else
+ *quotedlen = PQescapeStringConn(H->server, *quoted + 1, unquoted, unquotedlen, NULL);
+#endif
(*quoted)[*quotedlen + 1] = '\'';
(*quoted)[*quotedlen + 2] = '\0';
*quotedlen += 2;
@@ -352,7 +364,11 @@ static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned
size_t l = strlen(name);
name_escaped = safe_emalloc(l, 2, 1);
+#ifndef HAVE_PQESCAPE_CONN
PQescapeString(name_escaped, name, l);
+#else
+ PQescapeStringConn(H->server, name_escaped, name, l, NULL);
+#endif
spprintf(&q, 0, "SELECT CURRVAL('%s')", name_escaped);
res = PQexec(H->server, q);
efree(name_escaped);
@@ -469,6 +485,7 @@ static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC)
res = PQexec(H->server, cmd);
if (PQresultStatus(res) != PGRES_COMMAND_OK) {
+ pdo_pgsql_error(dbh, PQresultStatus(res), pdo_pgsql_sqlstate(res));
ret = 0;
}
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c
index 5abdfa111..01271fbaf 100644
--- a/ext/pdo_pgsql/pgsql_statement.c
+++ b/ext/pdo_pgsql/pgsql_statement.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql_statement.c,v 1.31.2.12 2006/03/27 20:51:01 wez Exp $ */
+/* $Id: pgsql_statement.c,v 1.31.2.12.2.3 2006/09/19 15:45:21 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -60,10 +60,14 @@ static int pgsql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
char *q = NULL;
PGresult *res;
- spprintf(&q, 0, "DEALLOCATE %s", S->stmt_name);
- res = PQexec(H->server, q);
- efree(q);
- if (res) PQclear(res);
+ if (S->is_prepared) {
+ 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;
}
@@ -247,16 +251,16 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
case PDO_PARAM_EVT_EXEC_PRE:
if (!S->param_values) {
S->param_values = ecalloc(
- zend_hash_num_elements(stmt->bound_params),
+ zend_hash_num_elements(stmt->bound_param_map),
sizeof(char*));
S->param_lengths = ecalloc(
- zend_hash_num_elements(stmt->bound_params),
+ zend_hash_num_elements(stmt->bound_param_map),
sizeof(int));
S->param_formats = ecalloc(
- zend_hash_num_elements(stmt->bound_params),
+ zend_hash_num_elements(stmt->bound_param_map),
sizeof(int));
S->param_types = ecalloc(
- zend_hash_num_elements(stmt->bound_params),
+ zend_hash_num_elements(stmt->bound_param_map),
sizeof(Oid));
}
if (param->paramno >= 0) {
@@ -341,6 +345,7 @@ static int pgsql_stmt_fetch(pdo_stmt_t *stmt,
spprintf(&q, 0, "FETCH %s %ld FROM %s", ori_str, offset, S->cursor_name);
S->result = PQexec(S->H->server, q);
+ efree(q);
status = PQresultStatus(S->result);
if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) {
diff --git a/ext/pdo_sqlite/config.m4 b/ext/pdo_sqlite/config.m4
index 0d9f59d7f..368f6a080 100644
--- a/ext/pdo_sqlite/config.m4
+++ b/ext/pdo_sqlite/config.m4
@@ -1,14 +1,11 @@
-dnl $Id: config.m4,v 1.26.2.9 2006/05/03 11:12:54 pajoye Exp $
+dnl $Id: config.m4,v 1.26.2.9.2.2 2006/09/09 21:14:05 bjori Exp $
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)
-
PHP_ARG_WITH(pdo-sqlite, for sqlite 3 support for PDO,
-[ --with-pdo-sqlite[=DIR] PDO: sqlite support. DIR is the sqlite base directory, the bundled sqlite is used by default])
+[ --without-pdo-sqlite[=DIR] PDO: sqlite support. DIR is the sqlite base directory, the bundled sqlite is used by default],yes)
if test "$PHP_PDO_SQLITE" != "no"; then
@@ -75,14 +72,14 @@ if test "$PHP_PDO_SQLITE" != "no"; then
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/main.c sqlite/src/os_unix.c sqlite/src/os_win.c sqlite/src/os.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/table.c sqlite/src/tokenize.c sqlite/src/analyze.c sqlite/src/complete.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"
+ sqlite/src/alter.c sqlite/src/vdbefifo.c sqlite/src/vtab.c sqlite/src/loadext.c"
PHP_NEW_EXTENSION(pdo_sqlite,
$php_pdo_sqlite_sources_core $pdo_sqlite_sources,
diff --git a/ext/pdo_sqlite/config.w32 b/ext/pdo_sqlite/config.w32
index 8c0aed648..72ad0b179 100644
--- a/ext/pdo_sqlite/config.w32
+++ b/ext/pdo_sqlite/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.6.2.1 2005/08/28 16:53:20 iliaa Exp $
+// $Id: config.w32,v 1.6.2.1.2.2 2006/08/14 16:15:28 iliaa Exp $
// vim:ft=javascript
ARG_WITH("pdo-sqlite", "for pdo_sqlite support", "no");
@@ -19,12 +19,12 @@ if (PHP_PDO_SQLITE != "no") {
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);
+ EXTENSION("pdo_sqlite", "pdo_sqlite.c sqlite_driver.c sqlite_statement.c", null, "/DSQLITE_OMIT_CURSOR /I" + configure_module_dirname + "/sqlite/src /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");
+ legacy.c main.c os.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 complete.c \
+ vdbeaux.c vdbe.c vdbemem.c vdbefifo.c where.c parse.c opcodes.c alter.c vtab.c loadext.c", "pdo_sqlite");
ADD_EXTENSION_DEP('pdo_sqlite', 'pdo');
}
diff --git a/ext/pdo_sqlite/package2.xml b/ext/pdo_sqlite/package2.xml
index 7ccec31cb..277fa8a69 100644
--- a/ext/pdo_sqlite/package2.xml
+++ b/ext/pdo_sqlite/package2.xml
@@ -57,7 +57,6 @@ http://pecl4win.php.net/ext.php/php_pdo_sqlite.dll
<file name="callback.c" role="src" />
<file name="date.c" role="src" />
<file name="delete.c" role="src" />
- <file name="experimental.c" role="src" />
<file name="expr.c" role="src" />
<file name="func.c" role="src" />
<file name="hash.c" role="src" />
@@ -70,9 +69,8 @@ http://pecl4win.php.net/ext.php/php_pdo_sqlite.dll
<file name="opcodes.c" role="src" />
<file name="opcodes.h" role="src" />
<file name="os.h" role="src" />
+ <file name="os.c" role="src" />
<file name="os_common.h" role="src" />
- <file name="os_mac.c" role="src" />
- <file name="os_mac.h" role="src" />
<file name="os_test.c" role="src" />
<file name="os_test.h" role="src" />
<file name="os_unix.c" role="src" />
@@ -113,6 +111,10 @@ http://pecl4win.php.net/ext.php/php_pdo_sqlite.dll
<file name="vdbeInt.h" role="src" />
<file name="vdbemem.c" role="src" />
<file name="where.c" role="src" />
+ <file name="vtab.c" role="src" />
+ <file name="loadext.c" role="src" />
+ <file name="complete.c" role="src" />
+ <file name="sqlite3ext.h" role="src" />
</dir> <!-- //sqlite/src -->
<dir name="tool">
<file name="diffdb.c" role="src" />
diff --git a/ext/pdo_sqlite/sqlite/Makefile.in b/ext/pdo_sqlite/sqlite/Makefile.in
index db4714422..712823e5f 100644
--- a/ext/pdo_sqlite/sqlite/Makefile.in
+++ b/ext/pdo_sqlite/sqlite/Makefile.in
@@ -32,7 +32,7 @@ TCC = @TARGET_CC@ @TARGET_CFLAGS@ -I. -I${TOP}/src
# Omitting the define will cause extra debugging code to be inserted and
# includes extra comments when "EXPLAIN stmt" is used.
#
-TCC += @TARGET_DEBUG@
+TCC += @TARGET_DEBUG@ @XTHREADCONNECT@
# Compiler options needed for programs that use the TCL library.
#
@@ -58,6 +58,13 @@ TCC += -DTHREADSAFE=@THREADSAFE@
#
LIBPTHREAD=@TARGET_THREAD_LIB@
+# Do threads override each others locks by default (1), or do we test (-1)
+#
+TCC += -DSQLITE_THREAD_OVERRIDE_LOCK=@THREADSOVERRIDELOCKS@
+
+# The fdatasync library
+TLIBS = @TARGET_LIBS@
+
# Flags controlling use of the in memory btree implementation
#
# TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
@@ -104,9 +111,12 @@ LTCOMPILE = $(LIBTOOL) --mode=compile $(TCC)
LTLINK = $(LIBTOOL) --mode=link $(TCC)
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
+# nawk compatible awk.
+NAWK = @AWK@
+
# You should not have to change anything below this line
###############################################################################
-
+OPTS =
OPTS += -DSQLITE_OMIT_CURSOR # Cursors do not work at this time
TCC += -DSQLITE_OMIT_CURSOR
@@ -114,13 +124,13 @@ TCC += -DSQLITE_OMIT_CURSOR
#
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 \
+ delete.lo expr.lo func.lo hash.lo insert.lo loadext.lo \
+ main.lo opcodes.lo os.lo os_unix.lo os_win.lo os_os2.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
+ where.lo utf.lo legacy.lo vtab.lo
# All of the source code files.
#
@@ -142,9 +152,12 @@ SRC = \
$(TOP)/src/hash.h \
$(TOP)/src/insert.c \
$(TOP)/src/legacy.c \
+ $(TOP)/src/loadext.c \
$(TOP)/src/main.c \
+ $(TOP)/src/os.c \
$(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \
+ $(TOP)/src/os_os2.c \
$(TOP)/src/pager.c \
$(TOP)/src/pager.h \
$(TOP)/src/parse.y \
@@ -171,6 +184,7 @@ SRC = \
$(TOP)/src/vdbefifo.c \
$(TOP)/src/vdbemem.c \
$(TOP)/src/vdbeInt.h \
+ $(TOP)/src/vtab.c \
$(TOP)/src/where.c
# Source code to the test files.
@@ -179,8 +193,10 @@ TESTSRC = \
$(TOP)/src/btree.c \
$(TOP)/src/date.c \
$(TOP)/src/func.c \
+ $(TOP)/src/os.c \
$(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \
+ $(TOP)/src/os_os2.c \
$(TOP)/src/pager.c \
$(TOP)/src/pragma.c \
$(TOP)/src/printf.c \
@@ -189,10 +205,17 @@ TESTSRC = \
$(TOP)/src/test3.c \
$(TOP)/src/test4.c \
$(TOP)/src/test5.c \
+ $(TOP)/src/test6.c \
+ $(TOP)/src/test7.c \
+ $(TOP)/src/test8.c \
+ $(TOP)/src/test_async.c \
+ $(TOP)/src/test_md5.c \
+ $(TOP)/src/test_schema.c \
+ $(TOP)/src/test_server.c \
+ $(TOP)/src/test_tclvar.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.
@@ -204,8 +227,7 @@ HDR = \
opcodes.h \
$(TOP)/src/os.h \
$(TOP)/src/os_common.h \
- $(TOP)/src/os_unix.h \
- $(TOP)/src/os_win.h \
+ $(TOP)/src/sqlite3ext.h \
$(TOP)/src/sqliteInt.h \
$(TOP)/src/vdbe.h \
parse.h
@@ -228,8 +250,8 @@ Makefile: $(TOP)/Makefile.in
# 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
+ cat $(SRC) | grep '$$Id: ' | sort -k 5 | tail -1 \
+ | $(NAWK) '{print $$5,$$6}' >last_change
libsqlite3.la: $(LIBOBJ)
$(LTLINK) -o libsqlite3.la $(LIBOBJ) $(LIBPTHREAD) \
@@ -243,7 +265,8 @@ libtclsqlite3.la: tclsqlite.lo libsqlite3.la
sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h
$(LTLINK) $(READLINE_FLAGS) $(LIBPTHREAD) \
- -o sqlite3 $(TOP)/src/shell.c libsqlite3.la $(LIBREADLINE)
+ -o $@ $(TOP)/src/shell.c libsqlite3.la \
+ $(LIBREADLINE) $(TLIBS)
# This target creates a directory named "tsrc" and fills it with
# copies of all of the C source code and header files needed to
@@ -313,6 +336,9 @@ insert.lo: $(TOP)/src/insert.c $(HDR)
legacy.lo: $(TOP)/src/legacy.c $(HDR)
$(LTCOMPILE) -c $(TOP)/src/legacy.c
+loadext.lo: $(TOP)/src/loadext.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/loadext.c
+
main.lo: $(TOP)/src/main.c $(HDR)
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
@@ -323,10 +349,13 @@ 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
+ sort -n -b -k 3 opcodes.h | $(NAWK) -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
+ cat parse.h $(TOP)/src/vdbe.c | $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h
+
+os.lo: $(TOP)/src/os.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/os.c
os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
$(LTCOMPILE) -c $(TOP)/src/os_unix.c
@@ -334,14 +363,19 @@ os_unix.lo: $(TOP)/src/os_unix.c $(HDR)
os_win.lo: $(TOP)/src/os_win.c $(HDR)
$(LTCOMPILE) -c $(TOP)/src/os_win.c
+os_os2.lo: $(TOP)/src/os_os2.c $(HDR)
+ $(LTCOMPILE) -c $(TOP)/src/os_os2.c
+
parse.lo: parse.c $(HDR)
$(LTCOMPILE) -c parse.c
parse.h: parse.c
-parse.c: $(TOP)/src/parse.y lemon$(BEXE)
+parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/addopcodes.awk
cp $(TOP)/src/parse.y .
./lemon $(OPTS) parse.y
+ mv parse.h parse.h.temp
+ awk -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
pragma.lo: $(TOP)/src/pragma.c $(HDR)
$(LTCOMPILE) -c $(TOP)/src/pragma.c
@@ -405,6 +439,9 @@ vdbefifo.lo: $(TOP)/src/vdbefifo.c $(VDBEHDR)
vdbemem.lo: $(TOP)/src/vdbemem.c $(VDBEHDR)
$(LTCOMPILE) -c $(TOP)/src/vdbemem.c
+vtab.lo: $(TOP)/src/vtab.c $(VDBEHDR)
+ $(LTCOMPILE) -c $(TOP)/src/vtab.c
+
where.lo: $(TOP)/src/where.c $(HDR)
$(LTCOMPILE) -c $(TOP)/src/where.c
@@ -419,19 +456,12 @@ tclsqlite3: tclsqlite-shell.lo libsqlite3.la
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 \
+ $(LTLINK) -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_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)
+fulltest: testfixture$(TEXE) sqlite3$(TEXE)
./testfixture $(TOP)/test/all.test
test: testfixture$(TEXE) sqlite3$(TEXE)
diff --git a/ext/pdo_sqlite/sqlite/Makefile.linux-gcc b/ext/pdo_sqlite/sqlite/Makefile.linux-gcc
index 202f4a1ee..c865024b4 100644
--- a/ext/pdo_sqlite/sqlite/Makefile.linux-gcc
+++ b/ext/pdo_sqlite/sqlite/Makefile.linux-gcc
@@ -41,6 +41,11 @@ THREADSAFE = -DTHREADSAFE=0
#THREADLIB = -lpthread
THREADLIB =
+#### Specify any extra libraries needed to access required functions.
+#
+#TLIBS = -lrt # fdatasync on Solaris 8
+TLIBS =
+
#### 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.
@@ -53,6 +58,7 @@ THREADLIB =
#OPTS = -DSQLITE_DEBUG=1
#OPTS =
OPTS = -DNDEBUG=1
+OPTS += -DHAVE_FDATASYNC=1
#### The suffix to add to executable files. ".exe" for windows.
# Nothing for unix.
@@ -77,6 +83,12 @@ AR = ar cr
RANLIB = ranlib
#RANLIB = /opt/mingw/bin/i386-mingw32-ranlib
+MKSHLIB = gcc -shared
+SO = so
+SHPREFIX = lib
+# SO = dll
+# SHPREFIX =
+
#### Extra compiler options needed for programs that use the TCL library.
#
#TCL_FLAGS =
@@ -107,6 +119,12 @@ LIBREADLINE =
# ENCODING = UTF8
ENCODING = ISO8859
+
+#### Which "awk" program provides nawk compatibilty
+#
+# NAWK = nawk
+NAWK = awk
+
# You should not have to change anything below this line
###############################################################################
include $(TOP)/main.mk
diff --git a/ext/pdo_sqlite/sqlite/VERSION b/ext/pdo_sqlite/sqlite/VERSION
index f092941a7..86fb65044 100644
--- a/ext/pdo_sqlite/sqlite/VERSION
+++ b/ext/pdo_sqlite/sqlite/VERSION
@@ -1 +1 @@
-3.2.8
+3.3.7
diff --git a/ext/pdo_sqlite/sqlite/aclocal.m4 b/ext/pdo_sqlite/sqlite/aclocal.m4
index 852eb3134..b50b61e56 100644
--- a/ext/pdo_sqlite/sqlite/aclocal.m4
+++ b/ext/pdo_sqlite/sqlite/aclocal.m4
@@ -151,7 +151,7 @@ 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(AR, ar, AC_CHECK_TOOL(AR, emxomfar, false))
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(STRIP, strip, :)
diff --git a/ext/pdo_sqlite/sqlite/configure b/ext/pdo_sqlite/sqlite/configure
index 11e3c9c51..666f18668 100755
--- a/ext/pdo_sqlite/sqlite/configure
+++ b/ext/pdo_sqlite/sqlite/configure
@@ -463,7 +463,7 @@ ac_includes_default="\
# 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_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 AWK 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 XTHREADCONNECT THREADSOVERRIDELOCKS ALLOWRELEASE TEMP_STORE BUILD_EXEEXT OS_UNIX OS_WIN OS_OS2 TARGET_EXEEXT 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 TARGET_LIBS LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -1025,11 +1025,16 @@ Optional Features:
--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
+ --enable-threadsafe Support threadsafe operation
+ --enable-cross-thread-connections
+ Allow connection sharing across threads
+ --enable-threads-override-locks
+ Threads can override each others locks
+ --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]
@@ -1040,7 +1045,8 @@ Optional Packages:
--with-tags[=TAGS]
include additional configurations [automatic]
--with-hints=FILE Read configuration options from FILE
- --with-tcl=DIR directory containing tcl configuration (tclConfig.sh)
+ --with-tcl=DIR directory containing tcl configuration
+ (tclConfig.sh)
Some influential environment variables:
CC C compiler command
@@ -3055,7 +3061,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 3058 "configure"' > conftest.$ac_ext
+ echo '#line 3064 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -4518,7 +4524,7 @@ fi
# Provide some information about the compiler.
-echo "$as_me:4521:" \
+echo "$as_me:4527:" \
"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
@@ -5552,11 +5558,11 @@ else
-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 echo "\"\$as_me:5561: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:5559: \$? = $ac_status" >&5
+ echo "$as_me:5565: \$? = $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
@@ -5785,11 +5791,11 @@ else
-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 echo "\"\$as_me:5794: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:5792: \$? = $ac_status" >&5
+ echo "$as_me:5798: \$? = $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
@@ -5845,11 +5851,11 @@ else
-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 echo "\"\$as_me:5854: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:5852: \$? = $ac_status" >&5
+ echo "$as_me:5858: \$? = $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
@@ -8029,7 +8035,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 8032 "configure"
+#line 8038 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -8127,7 +8133,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 8130 "configure"
+#line 8136 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10306,11 +10312,11 @@ else
-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 echo "\"\$as_me:10315: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:10313: \$? = $ac_status" >&5
+ echo "$as_me:10319: \$? = $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
@@ -10366,11 +10372,11 @@ else
-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 echo "\"\$as_me:10375: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:10373: \$? = $ac_status" >&5
+ echo "$as_me:10379: \$? = $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
@@ -11727,7 +11733,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 11730 "configure"
+#line 11736 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11825,7 +11831,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 11828 "configure"
+#line 11834 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12652,11 +12658,11 @@ else
-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 echo "\"\$as_me:12661: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12659: \$? = $ac_status" >&5
+ echo "$as_me:12665: \$? = $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
@@ -12712,11 +12718,11 @@ else
-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 echo "\"\$as_me:12721: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12719: \$? = $ac_status" >&5
+ echo "$as_me:12725: \$? = $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
@@ -14746,11 +14752,11 @@ else
-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 echo "\"\$as_me:14755: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14753: \$? = $ac_status" >&5
+ echo "$as_me:14759: \$? = $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
@@ -14979,11 +14985,11 @@ else
-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 echo "\"\$as_me:14988: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14986: \$? = $ac_status" >&5
+ echo "$as_me:14992: \$? = $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
@@ -15039,11 +15045,11 @@ else
-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 echo "\"\$as_me:15048: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:15046: \$? = $ac_status" >&5
+ echo "$as_me:15052: \$? = $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
@@ -17223,7 +17229,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 17226 "configure"
+#line 17232 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17321,7 +17327,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 17324 "configure"
+#line 17330 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -18414,6 +18420,46 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+for ac_prog in gawk mawk nawk awk
+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_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # 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_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
#########
# Set up an appropriate program prefix
@@ -19500,6 +19546,57 @@ fi
##########
+# Do we want to allow a connection created in one thread to be used
+# in another thread. This does not work on many Linux systems (ex: RedHat 9)
+# due to bugs in the threading implementations. This is thus off by default.
+#
+# Check whether --enable-cross-thread-connections or --disable-cross-thread-connections was given.
+if test "${enable_cross_thread_connections+set}" = set; then
+ enableval="$enable_cross_thread_connections"
+
+else
+ enable_xthreadconnect=no
+fi;
+echo "$as_me:$LINENO: checking whether to allow connections to be shared across threads" >&5
+echo $ECHO_N "checking whether to allow connections to be shared across threads... $ECHO_C" >&6
+if test "$enable_xthreadconnect" = "no"; then
+ XTHREADCONNECT=''
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+else
+ XTHREADCONNECT='-DSQLITE_ALLOW_XTHREAD_CONNECT=1'
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+fi
+
+
+##########
+# Do we want to set threadsOverrideEachOthersLocks variable to be 1 (true) by
+# default. Normally, a test at runtime is performed to determine the
+# appropriate value of this variable. Use this option only if you're sure that
+# threads can safely override each others locks in all runtime situations.
+#
+# Check whether --enable-threads-override-locks or --disable-threads-override-locks was given.
+if test "${enable_threads_override_locks+set}" = set; then
+ enableval="$enable_threads_override_locks"
+
+else
+ enable_threads_override_locks=no
+fi;
+echo "$as_me:$LINENO: checking whether threads can override each others locks" >&5
+echo $ECHO_N "checking whether threads can override each others locks... $ECHO_C" >&6
+if test "$enable_threads_override_locks" = "no"; then
+ THREADSOVERRIDELOCKS='-1'
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+else
+ THREADSOVERRIDELOCKS='1'
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+fi
+
+
+##########
# Do we want to support release
#
# Check whether --enable-releasemode or --disable-releasemode was given.
@@ -19530,7 +19627,7 @@ if test "${enable_tempstore+set}" = set; then
enableval="$enable_tempstore"
else
- enable_tempstore=yes
+ enable_tempstore=no
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
@@ -19550,8 +19647,13 @@ echo "${ECHO_T}no" >&6
echo "$as_me:$LINENO: result: always" >&5
echo "${ECHO_T}always" >&6
;;
+ yes )
+ TEMP_STORE=3
+ echo "$as_me:$LINENO: result: always" >&5
+echo "${ECHO_T}always" >&6
+ ;;
* )
- TEMP_STORE=2
+ TEMP_STORE=1
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
;;
@@ -19593,13 +19695,26 @@ 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"
+ if test $OS2_SHELL ; then
+ OS_UNIX=0
+ OS_WIN=0
+ OS_OS2=1
+ TARGET_CFLAGS="$TARGET_CFLAGS -DOS_OS2=1"
+ if test "$ac_compiler_gnu" == "yes" ; then
+ TARGET_CFLAGS="$TARGET_CFLAGS -Zomf -Zexe -Zmap"
+ BUILD_CFLAGS="$BUILD_CFLAGS -Zomf -Zexe"
+ fi
+ else
+ OS_UNIX=0
+ OS_WIN=1
+ OS_OS2=0
+ tclsubdir=win
+ TARGET_CFLAGS="$TARGET_CFLAGS -DOS_WIN=1"
+ fi
else
OS_UNIX=1
OS_WIN=0
+ OS_OS2=0
tclsubdir=unix
TARGET_CFLAGS="$TARGET_CFLAGS -DOS_UNIX=1"
fi
@@ -19618,7 +19733,6 @@ else
TARGET_LIBS=""
fi
-
##########
# Figure out all the parameters needed to compile against Tcl.
#
@@ -20000,6 +20114,140 @@ fi
##########
+# Figure out what C libraries are required to compile programs
+# that use "fdatasync()" function.
+#
+CC=$TARGET_CC
+LIBS=$TARGET_LIBS
+echo "$as_me:$LINENO: checking for library containing fdatasync" >&5
+echo $ECHO_N "checking for library containing fdatasync... $ECHO_C" >&6
+if test "${ac_cv_search_fdatasync+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_fdatasync=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 fdatasync ();
+int
+main ()
+{
+fdatasync ();
+ ;
+ 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_fdatasync="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_fdatasync" = no; then
+ for ac_lib in rt; 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 fdatasync ();
+int
+main ()
+{
+fdatasync ();
+ ;
+ 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_fdatasync="-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_fdatasync" >&5
+echo "${ECHO_T}$ac_cv_search_fdatasync" >&6
+if test "$ac_cv_search_fdatasync" != no; then
+ test "$ac_cv_search_fdatasync" = "none required" || LIBS="$ac_cv_search_fdatasync $LIBS"
+
+fi
+
+TARGET_LIBS="$LIBS"
+
+##########
# Figure out where to get the READLINE header files.
#
echo "$as_me:$LINENO: checking readline header files" >&5
@@ -20236,7 +20484,7 @@ else
use_debug=no
fi;
if test "${use_debug}" = "yes" ; then
- TARGET_DEBUG=""
+ TARGET_DEBUG="-DSQLITE_DEBUG=1"
else
TARGET_DEBUG="-DNDEBUG"
fi
@@ -20340,6 +20588,110 @@ if test $ac_cv_func_usleep = yes; then
fi
+#--------------------------------------------------------------------
+# Redefine fdatasync as fsync on systems that lack fdatasync
+#--------------------------------------------------------------------
+
+echo "$as_me:$LINENO: checking for fdatasync" >&5
+echo $ECHO_N "checking for fdatasync... $ECHO_C" >&6
+if test "${ac_cv_func_fdatasync+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 fdatasync to an innocuous variant, in case <limits.h> declares fdatasync.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define fdatasync innocuous_fdatasync
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char fdatasync (); 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 fdatasync
+
+/* 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 fdatasync ();
+/* 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_fdatasync) || defined (__stub___fdatasync)
+choke me
+#else
+char (*f) () = fdatasync;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != fdatasync;
+ ;
+ 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_fdatasync=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_fdatasync=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_fdatasync" >&5
+echo "${ECHO_T}$ac_cv_func_fdatasync" >&6
+if test $ac_cv_func_fdatasync = yes; then
+ TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_FDATASYNC=1"
+fi
+
+
+#########
+# Put out accumulated miscellaneous LIBRARIES
+#
+
+
#########
# Generate the output files.
#
@@ -21016,6 +21368,7 @@ 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,@AWK@,$AWK,;t t
s,@program_prefix@,$program_prefix,;t t
s,@VERSION@,$VERSION,;t t
s,@RELEASE@,$RELEASE,;t t
@@ -21031,13 +21384,15 @@ 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,@XTHREADCONNECT@,$XTHREADCONNECT,;t t
+s,@THREADSOVERRIDELOCKS@,$THREADSOVERRIDELOCKS,;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,@OS_OS2@,$OS_OS2,;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
@@ -21054,6 +21409,7 @@ 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,@TARGET_LIBS@,$TARGET_LIBS,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
diff --git a/ext/pdo_sqlite/sqlite/configure.ac b/ext/pdo_sqlite/sqlite/configure.ac
index 3682bf821..cfec34ab3 100644
--- a/ext/pdo_sqlite/sqlite/configure.ac
+++ b/ext/pdo_sqlite/sqlite/configure.ac
@@ -123,6 +123,7 @@ dnl show in in configure.
#
AC_PROG_LIBTOOL
AC_PROG_INSTALL
+AC_PROG_AWK
#########
# Set up an appropriate program prefix
@@ -152,7 +153,7 @@ AC_SUBST(VERSION_NUMBER)
# $system is the result of uname -s.
#
AC_ARG_WITH(hints,
- [ --with-hints=FILE Read configuration options from FILE],
+ AC_HELP_STRING([--with-hints=FILE],[Read configuration options from FILE]),
hints=$withval)
if test "$hints" = ""; then
host=`hostname | sed 's/\..*//'`
@@ -278,7 +279,7 @@ fi
# Do we want to support multithreaded use of sqlite
#
AC_ARG_ENABLE(threadsafe,
-[ --enable-threadsafe Support threadsafe operation],,enable_threadsafe=no)
+AC_HELP_STRING([--enable-threadsafe],[Support threadsafe operation]),,enable_threadsafe=no)
AC_MSG_CHECKING([whether to support threadsafe operation])
if test "$enable_threadsafe" = "no"; then
THREADSAFE=0
@@ -300,10 +301,45 @@ fi
AC_SUBST(TARGET_THREAD_LIB)
##########
+# Do we want to allow a connection created in one thread to be used
+# in another thread. This does not work on many Linux systems (ex: RedHat 9)
+# due to bugs in the threading implementations. This is thus off by default.
+#
+AC_ARG_ENABLE(cross-thread-connections,
+AC_HELP_STRING([--enable-cross-thread-connections],[Allow connection sharing across threads]),,enable_xthreadconnect=no)
+AC_MSG_CHECKING([whether to allow connections to be shared across threads])
+if test "$enable_xthreadconnect" = "no"; then
+ XTHREADCONNECT=''
+ AC_MSG_RESULT([no])
+else
+ XTHREADCONNECT='-DSQLITE_ALLOW_XTHREAD_CONNECT=1'
+ AC_MSG_RESULT([yes])
+fi
+AC_SUBST(XTHREADCONNECT)
+
+##########
+# Do we want to set threadsOverrideEachOthersLocks variable to be 1 (true) by
+# default. Normally, a test at runtime is performed to determine the
+# appropriate value of this variable. Use this option only if you're sure that
+# threads can safely override each others locks in all runtime situations.
+#
+AC_ARG_ENABLE(threads-override-locks,
+AC_HELP_STRING([--enable-threads-override-locks],[Threads can override each others locks]),,enable_threads_override_locks=no)
+AC_MSG_CHECKING([whether threads can override each others locks])
+if test "$enable_threads_override_locks" = "no"; then
+ THREADSOVERRIDELOCKS='-1'
+ AC_MSG_RESULT([no])
+else
+ THREADSOVERRIDELOCKS='1'
+ AC_MSG_RESULT([yes])
+fi
+AC_SUBST(THREADSOVERRIDELOCKS)
+
+##########
# Do we want to support release
#
AC_ARG_ENABLE(releasemode,
-[ --enable-releasemode Support libtool link to release mode],,enable_releasemode=no)
+AC_HELP_STRING([--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=""
@@ -318,7 +354,7 @@ 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_HELP_STRING([--enable-tempstore],[Use an in-ram database for temporary tables (never,no,yes,always)]),,enable_tempstore=no)
AC_MSG_CHECKING([whether to use an in-ram database for temporary tables])
case "$enable_tempstore" in
never )
@@ -333,8 +369,12 @@ case "$enable_tempstore" in
TEMP_STORE=3
AC_MSG_RESULT([always])
;;
+ yes )
+ TEMP_STORE=3
+ AC_MSG_RESULT([always])
+ ;;
* )
- TEMP_STORE=2
+ TEMP_STORE=1
AC_MSG_RESULT([yes])
;;
esac
@@ -367,13 +407,26 @@ 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"
+ if test $OS2_SHELL ; then
+ OS_UNIX=0
+ OS_WIN=0
+ OS_OS2=1
+ TARGET_CFLAGS="$TARGET_CFLAGS -DOS_OS2=1"
+ if test "$ac_compiler_gnu" == "yes" ; then
+ TARGET_CFLAGS="$TARGET_CFLAGS -Zomf -Zexe -Zmap"
+ BUILD_CFLAGS="$BUILD_CFLAGS -Zomf -Zexe"
+ fi
+ else
+ OS_UNIX=0
+ OS_WIN=1
+ OS_OS2=0
+ tclsubdir=win
+ TARGET_CFLAGS="$TARGET_CFLAGS -DOS_WIN=1"
+ fi
else
OS_UNIX=1
OS_WIN=0
+ OS_OS2=0
tclsubdir=unix
TARGET_CFLAGS="$TARGET_CFLAGS -DOS_UNIX=1"
fi
@@ -381,6 +434,7 @@ fi
AC_SUBST(BUILD_EXEEXT)
AC_SUBST(OS_UNIX)
AC_SUBST(OS_WIN)
+AC_SUBST(OS_OS2)
AC_SUBST(TARGET_EXEEXT)
##########
@@ -391,7 +445,6 @@ if test "$config_TARGET_LIBS" != ""; then
else
TARGET_LIBS=""
fi
-AC_SUBST(TARGET_LIBS)
##########
# Figure out all the parameters needed to compile against Tcl.
@@ -401,10 +454,10 @@ AC_SUBST(TARGET_LIBS)
# 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],
+AC_ARG_ENABLE(tcl, AC_HELP_STRING([--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_ARG_WITH(tcl, AC_HELP_STRING([--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.
@@ -551,6 +604,15 @@ fi
AC_SUBST(TARGET_READLINE_LIBS)
##########
+# Figure out what C libraries are required to compile programs
+# that use "fdatasync()" function.
+#
+CC=$TARGET_CC
+LIBS=$TARGET_LIBS
+AC_SEARCH_LIBS(fdatasync, [rt])
+TARGET_LIBS="$LIBS"
+
+##########
# Figure out where to get the READLINE header files.
#
AC_MSG_CHECKING([readline header files])
@@ -593,10 +655,10 @@ AC_SUBST(TARGET_HAVE_READLINE)
#########
# check for debug enabled
-AC_ARG_ENABLE(debug, [ --enable-debug enable debugging & verbose explain],
+AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[enable debugging & verbose explain]),
[use_debug=$enableval],[use_debug=no])
if test "${use_debug}" = "yes" ; then
- TARGET_DEBUG=""
+ TARGET_DEBUG="-DSQLITE_DEBUG=1"
else
TARGET_DEBUG="-DNDEBUG"
fi
@@ -607,6 +669,17 @@ AC_SUBST(TARGET_DEBUG)
#
AC_CHECK_FUNC(usleep, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1"])
+#--------------------------------------------------------------------
+# Redefine fdatasync as fsync on systems that lack fdatasync
+#--------------------------------------------------------------------
+
+AC_CHECK_FUNC(fdatasync, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_FDATASYNC=1"])
+
+#########
+# Put out accumulated miscellaneous LIBRARIES
+#
+AC_SUBST(TARGET_LIBS)
+
#########
# Generate the output files.
#
diff --git a/ext/pdo_sqlite/sqlite/main.mk b/ext/pdo_sqlite/sqlite/main.mk
index d931e281a..265381545 100644
--- a/ext/pdo_sqlite/sqlite/main.mk
+++ b/ext/pdo_sqlite/sqlite/main.mk
@@ -42,7 +42,8 @@
# LIBREADLINE Linker options needed by programs using readline() must
# link against.
#
-# ENCODING "UTF8" or "ISO8859"
+# NAWK Nawk compatible awk program. Older (obsolete?) solaris
+# systems need this to avoid using the original AT&T AWK.
#
# Once the macros above are defined, the rest of this make script will
# build the SQLite library and testing tools.
@@ -56,13 +57,13 @@ TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src
#
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 \
+ expr.o func.o hash.o insert.o loadext.o \
+ main.o opcodes.o os.o os_os2.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
+ where.o utf.o legacy.o vtab.o
# All of the source code files.
#
@@ -84,7 +85,10 @@ SRC = \
$(TOP)/src/hash.h \
$(TOP)/src/insert.c \
$(TOP)/src/legacy.c \
+ $(TOP)/src/loadext.c \
$(TOP)/src/main.c \
+ $(TOP)/src/os.c \
+ $(TOP)/src/os_os2.c \
$(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \
$(TOP)/src/pager.c \
@@ -113,6 +117,7 @@ SRC = \
$(TOP)/src/vdbefifo.c \
$(TOP)/src/vdbemem.c \
$(TOP)/src/vdbeInt.h \
+ $(TOP)/src/vtab.c \
$(TOP)/src/where.c
# Source code to the test files.
@@ -121,6 +126,8 @@ TESTSRC = \
$(TOP)/src/btree.c \
$(TOP)/src/date.c \
$(TOP)/src/func.c \
+ $(TOP)/src/os.c \
+ $(TOP)/src/os_os2.c \
$(TOP)/src/os_unix.c \
$(TOP)/src/os_win.c \
$(TOP)/src/pager.c \
@@ -131,10 +138,17 @@ TESTSRC = \
$(TOP)/src/test3.c \
$(TOP)/src/test4.c \
$(TOP)/src/test5.c \
+ $(TOP)/src/test6.c \
+ $(TOP)/src/test7.c \
+ $(TOP)/src/test8.c \
+ $(TOP)/src/test_async.c \
+ $(TOP)/src/test_md5.c \
+ $(TOP)/src/test_schema.c \
+ $(TOP)/src/test_server.c \
+ $(TOP)/src/test_tclvar.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.
@@ -146,8 +160,7 @@ HDR = \
opcodes.h \
$(TOP)/src/os.h \
$(TOP)/src/os_common.h \
- $(TOP)/src/os_unix.h \
- $(TOP)/src/os_win.h \
+ $(TOP)/src/sqlite3ext.h \
$(TOP)/src/sqliteInt.h \
$(TOP)/src/vdbe.h \
parse.h
@@ -167,8 +180,8 @@ all: sqlite3.h libsqlite3.a sqlite3$(EXE)
# 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
+ cat $(SRC) | grep '$$Id: ' | sort -k 5 | tail -1 \
+ | $(NAWK) '{print $$5,$$6}' >last_change
libsqlite3.a: $(LIBOBJ)
$(AR) libsqlite3.a $(LIBOBJ)
@@ -176,7 +189,7 @@ libsqlite3.a: $(LIBOBJ)
sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h
$(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(TOP)/src/shell.c \
- libsqlite3.a $(LIBREADLINE) $(THREADLIB)
+ libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
objects: $(LIBOBJ_ORIG)
@@ -247,6 +260,9 @@ insert.o: $(TOP)/src/insert.c $(HDR)
legacy.o: $(TOP)/src/legacy.c $(HDR)
$(TCCX) -c $(TOP)/src/legacy.c
+loadext.o: $(TOP)/src/loadext.c $(HDR)
+ $(TCCX) -c $(TOP)/src/loadext.c
+
main.o: $(TOP)/src/main.c $(HDR)
$(TCCX) -c $(TOP)/src/main.c
@@ -257,10 +273,16 @@ 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
+ sort -n -b -k 3 opcodes.h | $(NAWK) -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
+ cat parse.h $(TOP)/src/vdbe.c | $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h
+
+os.o: $(TOP)/src/os.c $(HDR)
+ $(TCCX) -c $(TOP)/src/os.c
+
+os_os2.o: $(TOP)/src/os_os2.c $(HDR)
+ $(TCCX) -c $(TOP)/src/os_os2.c
os_unix.o: $(TOP)/src/os_unix.c $(HDR)
$(TCCX) -c $(TOP)/src/os_unix.c
@@ -273,9 +295,11 @@ parse.o: parse.c $(HDR)
parse.h: parse.c
-parse.c: $(TOP)/src/parse.y lemon
+parse.c: $(TOP)/src/parse.y lemon $(TOP)/addopcodes.awk
cp $(TOP)/src/parse.y .
./lemon $(OPTS) parse.y
+ mv parse.h parse.h.temp
+ awk -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
pragma.o: $(TOP)/src/pragma.c $(HDR)
$(TCCX) $(TCL_FLAGS) -c $(TOP)/src/pragma.c
@@ -294,7 +318,7 @@ select.o: $(TOP)/src/select.c $(HDR)
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}'`/ \
+ -e s/--VERSION-NUMBER--/`cat ${TOP}/VERSION | sed 's/[^0-9]/ /g' | $(NAWK) '{printf "%d%03d%03d",$$1,$$2,$$3}'`/ \
$(TOP)/src/sqlite.h.in >sqlite3.h
table.o: $(TOP)/src/table.c $(HDR)
@@ -340,6 +364,9 @@ vdbefifo.o: $(TOP)/src/vdbefifo.c $(VDBEHDR)
vdbemem.o: $(TOP)/src/vdbemem.c $(VDBEHDR)
$(TCCX) -c $(TOP)/src/vdbemem.c
+vtab.o: $(TOP)/src/vtab.c $(VDBEHDR)
+ $(TCCX) -c $(TOP)/src/vtab.c
+
where.o: $(TOP)/src/where.c $(HDR)
$(TCCX) -c $(TOP)/src/where.c
@@ -350,17 +377,12 @@ tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a
$(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) \
+ $(TCCX) $(TCL_FLAGS) -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 \
+ -DSQLITE_SERVER=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
+fulltest: testfixture$(EXE) sqlite3$(EXE)
./testfixture$(EXE) $(TOP)/test/all.test
test: testfixture$(EXE) sqlite3$(EXE)
@@ -375,10 +397,17 @@ sqlite3_analyzer$(EXE): $(TOP)/src/tclsqlite.c libsqlite3.a $(TESTSRC) \
-e 's,^,",' \
-e 's,$$,\\n",' \
$(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h
- $(TCCX) $(TCL_FLAGS) -DTCLSH=2 -DSQLITE_TEST=1 -o \
+ $(TCCX) $(TCL_FLAGS) -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_DEBUG=1 -o \
sqlite3_analyzer$(EXE) $(TESTSRC) $(TOP)/src/tclsqlite.c \
libsqlite3.a $(LIBTCL) $(THREADLIB)
+TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
+$(TEST_EXTENSION): $(TOP)/src/test_loadext.c
+ $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
+
+extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
+ ./testfixture$(EXE) $(TOP)/test/loadext.test
+
# Rules used to build documentation
#
arch.html: $(TOP)/www/arch.tcl
@@ -469,6 +498,9 @@ omitted.html: $(TOP)/www/omitted.tcl
opcode.html: $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c
tclsh $(TOP)/www/opcode.tcl $(TOP)/src/vdbe.c >opcode.html
+sharedcache.html: $(TOP)/www/sharedcache.tcl
+ tclsh $(TOP)/www/sharedcache.tcl >sharedcache.html
+
mingw.html: $(TOP)/www/mingw.tcl
tclsh $(TOP)/www/mingw.tcl >mingw.html
@@ -537,6 +569,7 @@ DOC = \
opcode.html \
pragma.html \
quickstart.html \
+ sharedcache.html \
speed.html \
sqlite.gif \
sqlite.html \
@@ -558,7 +591,7 @@ install: sqlite3 libsqlite3.a sqlite3.h
mv sqlite3.h /usr/include
clean:
- rm -f *.o sqlite3 libsqlite3.a sqlite3.h opcodes.* crashtest
+ rm -f *.o sqlite3 libsqlite3.a sqlite3.h opcodes.*
rm -f lemon lempar.c parse.* sqlite*.tar.gz mkkeywordhash keywordhash.h
rm -f $(PUBLISH)
rm -f *.da *.bb *.bbg gmon.out
diff --git a/ext/pdo_sqlite/sqlite/mkdll.sh b/ext/pdo_sqlite/sqlite/mkdll.sh
index 1ad5f8332..50dd60b71 100644
--- a/ext/pdo_sqlite/sqlite/mkdll.sh
+++ b/ext/pdo_sqlite/sqlite/mkdll.sh
@@ -11,7 +11,7 @@ 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'
+OPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1 -DTHREADSAFE=1 -DBUILD_sqlite=1'
CC="i386-mingw32msvc-gcc -O2 $OPTS -I. -I$TCLDIR"
rm shell.c
for i in *.c; do
@@ -31,7 +31,7 @@ i386-mingw32msvc-dllwrap \
--as i386-mingw32msvc-as \
--target i386-mingw32 \
-dllname tclsqlite3.dll -lmsvcrt *.o $TCLSTUBLIB
-i386-mingw32msvc-strip tclsqlite3.dll
+#i386-mingw32msvc-strip tclsqlite3.dll
rm tclsqlite.o
i386-mingw32msvc-dllwrap \
--def sqlite3.def -v --export-all \
@@ -40,5 +40,5 @@ i386-mingw32msvc-dllwrap \
--as i386-mingw32msvc-as \
--target i386-mingw32 \
-dllname sqlite3.dll -lmsvcrt *.o
-i386-mingw32msvc-strip sqlite3.dll
+#i386-mingw32msvc-strip sqlite3.dll
cd ..
diff --git a/ext/pdo_sqlite/sqlite/mkopcodeh.awk b/ext/pdo_sqlite/sqlite/mkopcodeh.awk
index a258194ca..0fa50ead0 100644
--- a/ext/pdo_sqlite/sqlite/mkopcodeh.awk
+++ b/ext/pdo_sqlite/sqlite/mkopcodeh.awk
@@ -14,14 +14,28 @@
# 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
+# We go to the trouble of making some OP_ values 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 to translate from one to the other is avoided. This makes the
# code generator run (infinitesimally) faster and more importantly it makes
-# the total library smaller.
+# the library footprint smaller.
+#
+# This script also scans for lines of the form:
+#
+# case OP_aaaa: /* no-push */
+#
+# When the no-push comment is found on an opcode, it means that that
+# opcode does not leave a result on the stack. By identifying which
+# opcodes leave results on the stack it is possible to determine a
+# much smaller upper bound on the size of the stack. This allows
+# a smaller stack to be allocated, which is important to embedded
+# systems with limited memory space. This script generates a series
+# of "NOPUSH_MASK" defines that contain bitmaps of opcodes that leave
+# results on the stack. The NOPUSH_MASK defines are used in vdbeaux.c
+# to help determine the maximum stack size.
#
@@ -104,7 +118,10 @@ END {
}
}
printf "\n"
+ print "/* Opcodes that are guaranteed to never push a value onto the stack"
+ print "** contain a 1 their corresponding position of the following mask"
+ print "** set. See the opcodeNoPush() function in vdbeaux.c */"
for(i=0; i<10; i++){
- printf "#define NOPUSH_MASK_%d %d\n", i, nopush[i]
+ printf "#define NOPUSH_MASK_%d 0x%04x\n", i, nopush[i]
}
}
diff --git a/ext/pdo_sqlite/sqlite/publish.sh b/ext/pdo_sqlite/sqlite/publish.sh
index 0a61d90ed..043c89a03 100644
--- a/ext/pdo_sqlite/sqlite/publish.sh
+++ b/ext/pdo_sqlite/sqlite/publish.sh
@@ -113,3 +113,5 @@ mv $HOME/rpm/SRPMS/sqlite-$vers*.rpm doc
#
#cp $srcdir/../historical/* doc
make doc
+cd doc
+chmod 644 *.gz
diff --git a/ext/pdo_sqlite/sqlite/sqlite3.def b/ext/pdo_sqlite/sqlite/sqlite3.def
index c57ca6897..e42a0cd3d 100644
--- a/ext/pdo_sqlite/sqlite/sqlite3.def
+++ b/ext/pdo_sqlite/sqlite/sqlite3.def
@@ -40,6 +40,7 @@ sqlite3_create_function
sqlite3_create_function16
sqlite3_data_count
sqlite3_db_handle
+sqlite3_enable_shared_cache
sqlite3_errcode
sqlite3_errmsg
sqlite3_errmsg16
@@ -75,13 +76,16 @@ sqlite3_result_text16
sqlite3_result_text16be
sqlite3_result_text16le
sqlite3_result_value
+sqlite3_rollback_hook
sqlite3_set_authorizer
sqlite3_set_auxdata
sqlite3_snprintf
sqlite3_step
+sqlite3_thread_cleanup
sqlite3_total_changes
sqlite3_trace
sqlite3_transfer_bindings
+sqlite3_update_hook
sqlite3_user_data
sqlite3_value_blob
sqlite3_value_bytes
diff --git a/ext/pdo_sqlite/sqlite/src/alter.c b/ext/pdo_sqlite/sqlite/src/alter.c
index b8e193cbd..0c00c2c49 100644
--- a/ext/pdo_sqlite/sqlite/src/alter.c
+++ b/ext/pdo_sqlite/sqlite/src/alter.c
@@ -12,7 +12,7 @@
** This file contains C code routines that used to generate VDBE code
** that implements the ALTER TABLE command.
**
-** $Id: alter.c,v 1.2.2.2 2005/09/26 19:33:24 iliaa Exp $
+** $Id: alter.c,v 1.2.2.2.2.1 2006/08/14 16:15:28 iliaa Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -47,7 +47,7 @@ static void renameTableFunc(
int token;
Token tname;
- char const *zCsr = zSql;
+ unsigned char const *zCsr = zSql;
int len = 0;
char *zRet;
@@ -96,7 +96,7 @@ static void renameTriggerFunc(
int token;
Token tname;
int dist = 3;
- char const *zCsr = zSql;
+ unsigned char const *zCsr = zSql;
int len = 0;
char *zRet;
@@ -162,7 +162,7 @@ void sqlite3AlterFunctions(sqlite3 *db){
int i;
for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
- sqlite3_create_function(db, aFuncs[i].zName, aFuncs[i].nArg,
+ sqlite3CreateFunc(db, aFuncs[i].zName, aFuncs[i].nArg,
SQLITE_UTF8, 0, aFuncs[i].xFunc, 0, 0);
}
}
@@ -177,9 +177,16 @@ static char *whereTempTriggers(Parse *pParse, Table *pTab){
Trigger *pTrig;
char *zWhere = 0;
char *tmp = 0;
- if( pTab->iDb!=1 ){
+ const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */
+
+ /* If the table is not located in the temp-db (in which case NULL is
+ ** returned, loop through the tables list of triggers. For each trigger
+ ** that is not part of the temp-db schema, add a clause to the WHERE
+ ** expression being built up in zWhere.
+ */
+ if( pTab->pSchema!=pTempSchema ){
for( pTrig=pTab->pTrigger; pTrig; pTrig=pTrig->pNext ){
- if( pTrig->iDb==1 ){
+ if( pTrig->pSchema==pTempSchema ){
if( !zWhere ){
zWhere = sqlite3MPrintf("name=%Q", pTrig->name);
}else{
@@ -204,20 +211,22 @@ static char *whereTempTriggers(Parse *pParse, Table *pTab){
static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){
Vdbe *v;
char *zWhere;
- int iDb;
+ int iDb; /* Index of database containing pTab */
#ifndef SQLITE_OMIT_TRIGGER
Trigger *pTrig;
#endif
v = sqlite3GetVdbe(pParse);
if( !v ) return;
- iDb = pTab->iDb;
+ iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
+ assert( iDb>=0 );
#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);
+ int iTrigDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
+ assert( iTrigDb==iDb || iTrigDb==1 );
+ sqlite3VdbeOp3(v, OP_DropTrigger, iTrigDb, 0, pTrig->name, 0);
}
#endif
@@ -233,7 +242,7 @@ static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){
/* 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)) ){
+ if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){
sqlite3VdbeOp3(v, OP_ParseSchema, 1, 0, zWhere, P3_DYNAMIC);
}
#endif
@@ -258,12 +267,18 @@ void sqlite3AlterRenameTable(
char *zWhere = 0; /* Where clause to locate temp triggers */
#endif
- if( sqlite3_malloc_failed ) goto exit_rename_table;
+ if( sqlite3MallocFailed() ) 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;
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( IsVirtual(pTab) ){
+ sqlite3ErrorMsg(pParse, "virtual tables may not be altered");
+ goto exit_rename_table;
+ }
+#endif
+ iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
zDb = db->aDb[iDb].zName;
/* Get a NULL terminated version of the new table name. */
@@ -349,7 +364,7 @@ void sqlite3AlterRenameTable(
** table. Don't do this if the table being ALTERed is itself located in
** the temp database.
*/
- if( (zWhere=whereTempTriggers(pParse, pTab)) ){
+ if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){
sqlite3NestedParse(pParse,
"UPDATE sqlite_temp_master SET "
"sql = sqlite_rename_trigger(sql, %Q), "
@@ -385,13 +400,12 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
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;
+ iDb = sqlite3SchemaToIndex(pParse->db, pNew->pSchema);
zDb = pParse->db->aDb[iDb].zName;
zTab = pNew->zName;
pCol = &pNew->aCol[pNew->nCol-1];
@@ -399,6 +413,13 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
pTab = sqlite3FindTable(pParse->db, zTab, zDb);
assert( pTab );
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ /* Invoke the authorization callback. */
+ if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){
+ return;
+ }
+#endif
+
/* 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.
@@ -442,7 +463,7 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
}
/* Modify the CREATE TABLE statement. */
- zCol = sqliteStrNDup(pColDef->z, pColDef->n);
+ zCol = sqliteStrNDup((char*)pColDef->z, pColDef->n);
if( zCol ){
char *zEnd = &zCol[pColDef->n-1];
while( (zEnd>zCol && *zEnd==';') || isspace(*(unsigned char *)zEnd) ){
@@ -462,22 +483,12 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
** 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);
- }
+ sqlite3MinimumFileFormat(pParse, iDb, pDflt ? 3 : 2);
/* 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
@@ -501,13 +512,19 @@ void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
int i;
int nAlloc;
-
/* Look up the table being altered. */
assert( pParse->pNewTable==0 );
- if( sqlite3_malloc_failed ) goto exit_begin_add_column;
+ if( sqlite3MallocFailed() ) goto exit_begin_add_column;
pTab = sqlite3LocateTable(pParse, pSrc->a[0].zName, pSrc->a[0].zDatabase);
if( !pTab ) goto exit_begin_add_column;
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( IsVirtual(pTab) ){
+ sqlite3ErrorMsg(pParse, "virtual tables may not be altered");
+ goto exit_begin_add_column;
+ }
+#endif
+
/* Make sure this is not an attempt to ALTER a view. */
if( pTab->pSelect ){
sqlite3ErrorMsg(pParse, "Cannot add a column to a view");
@@ -515,7 +532,7 @@ void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
}
assert( pTab->addColOffset>0 );
- iDb = pTab->iDb;
+ iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
/* Put a copy of the Table struct in Parse.pNewTable for the
** sqlite3AddColumn() function and friends to modify.
@@ -537,10 +554,11 @@ void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
for(i=0; i<pNew->nCol; i++){
Column *pCol = &pNew->aCol[i];
pCol->zName = sqliteStrDup(pCol->zName);
+ pCol->zColl = 0;
pCol->zType = 0;
pCol->pDflt = 0;
}
- pNew->iDb = iDb;
+ pNew->pSchema = pParse->db->aDb[iDb].pSchema;
pNew->addColOffset = pTab->addColOffset;
pNew->nRef = 1;
diff --git a/ext/pdo_sqlite/sqlite/src/analyze.c b/ext/pdo_sqlite/sqlite/src/analyze.c
index 0285580d3..458d66435 100644
--- a/ext/pdo_sqlite/sqlite/src/analyze.c
+++ b/ext/pdo_sqlite/sqlite/src/analyze.c
@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code associated with the ANALYZE command.
**
-** @(#) $Id: analyze.c,v 1.1.2.2 2005/09/26 19:33:24 iliaa Exp $
+** @(#) $Id: analyze.c,v 1.1.2.2.2.1 2006/08/14 16:15:28 iliaa Exp $
*/
#ifndef SQLITE_OMIT_ANALYZE
#include "sqliteInt.h"
@@ -61,8 +61,14 @@ static void openStatTable(
sqlite3VdbeAddOp(v, OP_Clear, pStat->tnum, iDb);
}
- /* Open the sqlite_stat1 table for writing.
+ /* Open the sqlite_stat1 table for writing. Unless it was created
+ ** by this vdbe program, lock it for writing at the shared-cache level.
+ ** If this vdbe did create the sqlite_stat1 table, then it must have
+ ** already obtained a schema-lock, making the write-lock redundant.
*/
+ if( iRootPage>0 ){
+ sqlite3TableLock(pParse, iDb, iRootPage, 1, "sqlite_stat1");
+ }
sqlite3VdbeAddOp(v, OP_Integer, iDb, 0);
sqlite3VdbeAddOp(v, OP_OpenWrite, iStatCur, iRootPage);
sqlite3VdbeAddOp(v, OP_SetNumColumns, iStatCur, 3);
@@ -86,6 +92,7 @@ static void analyzeOneTable(
int topOfLoop; /* The top of the loop */
int endOfLoop; /* The end of the loop */
int addr; /* The address of an instruction */
+ int iDb; /* Index of database containing pTab */
v = sqlite3GetVdbe(pParse);
if( pTab==0 || pTab->pIndex==0 ){
@@ -93,21 +100,29 @@ static void analyzeOneTable(
return;
}
+ iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
+ assert( iDb>=0 );
#ifndef SQLITE_OMIT_AUTHORIZATION
if( sqlite3AuthCheck(pParse, SQLITE_ANALYZE, pTab->zName, 0,
- pParse->db->aDb[pTab->iDb].zName ) ){
+ pParse->db->aDb[iDb].zName ) ){
return;
}
#endif
+ /* Establish a read-lock on the table at the shared-cache level. */
+ sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
+
iIdxCur = pParse->nTab;
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
+ KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
+
/* Open a cursor to the index to be analyzed
*/
- sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
+ assert( iDb==sqlite3SchemaToIndex(pParse->db, pIdx->pSchema) );
+ sqlite3VdbeAddOp(v, OP_Integer, iDb, 0);
VdbeComment((v, "# %s", pIdx->zName));
sqlite3VdbeOp3(v, OP_OpenRead, iIdxCur, pIdx->tnum,
- (char*)&pIdx->keyInfo, P3_KEYINFO);
+ (char *)pKey, P3_KEYINFO_HANDOFF);
nCol = pIdx->nColumn;
if( iMem+nCol*2>=pParse->nMem ){
pParse->nMem = iMem+nCol*2+1;
@@ -139,7 +154,7 @@ static void analyzeOneTable(
endOfLoop = sqlite3VdbeMakeLabel(v);
sqlite3VdbeAddOp(v, OP_Rewind, iIdxCur, endOfLoop);
topOfLoop = sqlite3VdbeCurrentAddr(v);
- sqlite3VdbeAddOp(v, OP_MemIncr, iMem, 0);
+ sqlite3VdbeAddOp(v, OP_MemIncr, 1, iMem);
for(i=0; i<nCol; i++){
sqlite3VdbeAddOp(v, OP_Column, iIdxCur, i);
sqlite3VdbeAddOp(v, OP_MemLoad, iMem+nCol+i+1, 0);
@@ -147,7 +162,7 @@ static void analyzeOneTable(
}
sqlite3VdbeAddOp(v, OP_Goto, 0, endOfLoop);
for(i=0; i<nCol; i++){
- addr = sqlite3VdbeAddOp(v, OP_MemIncr, iMem+i+1, 0);
+ addr = sqlite3VdbeAddOp(v, OP_MemIncr, 1, iMem+i+1);
sqlite3VdbeChangeP2(v, topOfLoop + 3*i + 3, addr);
sqlite3VdbeAddOp(v, OP_Column, iIdxCur, i);
sqlite3VdbeAddOp(v, OP_MemStore, iMem+nCol+i+1, 1);
@@ -188,13 +203,14 @@ static void analyzeOneTable(
sqlite3VdbeAddOp(v, OP_AddImm, -1, 0);
sqlite3VdbeAddOp(v, OP_MemLoad, iMem+i+1, 0);
sqlite3VdbeAddOp(v, OP_Divide, 0, 0);
+ sqlite3VdbeAddOp(v, OP_ToInt, 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);
+ sqlite3VdbeOp3(v, OP_MakeRecord, 3, 0, "aaa", 0);
sqlite3VdbeAddOp(v, OP_Insert, iStatCur, 0);
sqlite3VdbeJumpHere(v, addr);
}
@@ -214,6 +230,7 @@ static void loadAnalysis(Parse *pParse, int iDb){
*/
static void analyzeDatabase(Parse *pParse, int iDb){
sqlite3 *db = pParse->db;
+ Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */
HashElem *k;
int iStatCur;
int iMem;
@@ -222,7 +239,7 @@ static void analyzeDatabase(Parse *pParse, int iDb){
iStatCur = pParse->nTab++;
openStatTable(pParse, iDb, iStatCur, 0);
iMem = pParse->nMem;
- for(k=sqliteHashFirst(&db->aDb[iDb].tblHash); k; k=sqliteHashNext(k)){
+ for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
Table *pTab = (Table*)sqliteHashData(k);
analyzeOneTable(pParse, pTab, iStatCur, iMem);
}
@@ -238,7 +255,7 @@ static void analyzeTable(Parse *pParse, Table *pTab){
int iStatCur;
assert( pTab!=0 );
- iDb = pTab->iDb;
+ iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
sqlite3BeginWriteOperation(pParse, 0, iDb);
iStatCur = pParse->nTab++;
openStatTable(pParse, iDb, iStatCur, pTab->zName);
@@ -360,7 +377,7 @@ void sqlite3AnalysisLoad(sqlite3 *db, int iDb){
char *zSql;
/* Clear any prior statistics */
- for(i=sqliteHashFirst(&db->aDb[iDb].idxHash); i; i=sqliteHashNext(i)){
+ for(i=sqliteHashFirst(&db->aDb[iDb].pSchema->idxHash);i;i=sqliteHashNext(i)){
Index *pIdx = sqliteHashData(i);
sqlite3DefaultRowEst(pIdx);
}
diff --git a/ext/pdo_sqlite/sqlite/src/attach.c b/ext/pdo_sqlite/sqlite/src/attach.c
index 46b653e97..10abc4901 100644
--- a/ext/pdo_sqlite/sqlite/src/attach.c
+++ b/ext/pdo_sqlite/sqlite/src/attach.c
@@ -16,196 +16,348 @@
#include "sqliteInt.h"
/*
-** This routine is called by the parser to process an ATTACH statement:
+** Resolve an expression that was part of an ATTACH or DETACH statement. This
+** is slightly different from resolving a normal SQL expression, because simple
+** identifiers are treated as strings, not possible column names or aliases.
**
-** ATTACH DATABASE filename AS dbname
+** i.e. if the parser sees:
**
-** The pFilename and pDbname arguments are the tokens that define the
-** filename and dbname in the ATTACH statement.
+** ATTACH DATABASE abc AS def
+**
+** it treats the two expressions as literal strings 'abc' and 'def' instead of
+** looking for columns of the same name.
+**
+** This only applies to the root node of pExpr, so the statement:
+**
+** ATTACH DATABASE abc||def AS 'db2'
+**
+** will fail because neither abc or def can be resolved.
*/
-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 */
+static int resolveAttachExpr(NameContext *pName, Expr *pExpr)
+{
+ int rc = SQLITE_OK;
+ if( pExpr ){
+ if( pExpr->op!=TK_ID ){
+ rc = sqlite3ExprResolveNames(pName, pExpr);
+ }else{
+ pExpr->op = TK_STRING;
+ }
+ }
+ return rc;
+}
+
+/*
+** An SQL user-function registered to do the work of an ATTACH statement. The
+** three arguments to the function come directly from an attach statement:
+**
+** ATTACH DATABASE x AS y KEY z
+**
+** SELECT sqlite_attach(x, y, z)
+**
+** If the optional "KEY z" syntax is omitted, an SQL NULL is passed as the
+** third argument.
+*/
+static void attachFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
){
+ int i;
+ int rc = 0;
+ sqlite3 *db = sqlite3_user_data(context);
+ const char *zName;
+ const char *zFile;
Db *aNew;
- int rc, i;
- char *zFile = 0;
- char *zName = 0;
- sqlite3 *db;
- Vdbe *v;
+ char zErr[128];
+ char *zErrDyn = 0;
- 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;
+ zFile = (const char *)sqlite3_value_text(argv[0]);
+ zName = (const char *)sqlite3_value_text(argv[1]);
+ if( zFile==0 ) zFile = "";
+ if( zName==0 ) zName = "";
+
+ /* Check for the following errors:
+ **
+ ** * Too many attached databases,
+ ** * Transaction currently open
+ ** * Specified database name already being used.
+ */
if( db->nDb>=MAX_ATTACHED+2 ){
- sqlite3ErrorMsg(pParse, "too many attached databases - max %d",
- MAX_ATTACHED);
- pParse->rc = SQLITE_ERROR;
- return;
+ sqlite3_snprintf(
+ sizeof(zErr), zErr, "too many attached databases - max %d", MAX_ATTACHED
+ );
+ goto attach_error;
}
-
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;
+ strcpy(zErr, "cannot ATTACH database within transaction");
+ goto attach_error;
}
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( z && zName && sqlite3StrICmp(z, zName)==0 ){
+ sqlite3_snprintf(sizeof(zErr), zErr, "database %s is already in use", zName);
+ goto attach_error;
}
}
+ /* Allocate the new entry in the db->aDb[] array and initialise the schema
+ ** hash tables.
+ */
if( db->aDb==db->aDbStatic ){
aNew = sqliteMalloc( sizeof(db->aDb[0])*3 );
if( aNew==0 ){
- goto attach_end;
+ 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 ){
- goto attach_end;
+ return;
}
}
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;
+
+ /* Open the database file. If the btree is successfully opened, use
+ ** it to obtain the database schema. At this point the schema may
+ ** or may not be initialised.
+ */
rc = sqlite3BtreeFactory(db, zFile, 0, MAX_PAGES, &aNew->pBt);
- if( rc ){
- sqlite3ErrorMsg(pParse, "unable to open database: %s", zFile);
+ if( rc==SQLITE_OK ){
+ aNew->pSchema = sqlite3SchemaGet(aNew->pBt);
+ if( !aNew->pSchema ){
+ rc = SQLITE_NOMEM;
+ }else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){
+ strcpy(zErr,
+ "attached databases must use the same text encoding as main database");
+ goto attach_error;
+ }
}
+ aNew->zName = sqliteStrDup(zName);
+ aNew->safety_level = 3;
+
#if SQLITE_HAS_CODEC
{
extern int sqlite3CodecAttach(sqlite3*, int, void*, int);
- char *zKey;
+ extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*);
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);
+ char *zKey;
+ int t = sqlite3_value_type(argv[2]);
+ switch( t ){
+ case SQLITE_INTEGER:
+ case SQLITE_FLOAT:
+ zErrDyn = sqliteStrDup("Invalid key value");
+ rc = SQLITE_ERROR;
+ break;
+
+ case SQLITE_TEXT:
+ case SQLITE_BLOB:
+ nKey = sqlite3_value_bytes(argv[2]);
+ zKey = (char *)sqlite3_value_blob(argv[2]);
+ sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
+ break;
+
+ case SQLITE_NULL:
+ /* No key specified. Use the key from the main database */
+ sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
+ sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
+ break;
}
}
#endif
- db->flags &= ~SQLITE_Initialized;
- if( pParse->nErr==0 && rc==SQLITE_OK ){
- rc = sqlite3ReadSchema(pParse);
+
+ /* If the file was opened successfully, read the schema for the new database.
+ ** If this fails, or if opening the file failed, then close the file and
+ ** remove the entry from the db->aDb[] array. i.e. put everything back the way
+ ** we found it.
+ */
+ if( rc==SQLITE_OK ){
+ sqlite3SafetyOn(db);
+ rc = sqlite3Init(db, &zErrDyn);
+ sqlite3SafetyOff(db);
}
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;
+ int iDb = db->nDb - 1;
+ assert( iDb>=2 );
+ if( db->aDb[iDb].pBt ){
+ sqlite3BtreeClose(db->aDb[iDb].pBt);
+ db->aDb[iDb].pBt = 0;
+ db->aDb[iDb].pSchema = 0;
}
sqlite3ResetInternalSchema(db, 0);
- assert( pParse->nErr>0 ); /* Always set by sqlite3ReadSchema() */
- if( pParse->rc==SQLITE_OK ){
- pParse->rc = SQLITE_ERROR;
+ db->nDb = iDb;
+ if( rc==SQLITE_NOMEM ){
+ if( !sqlite3MallocFailed() ) sqlite3FailedMalloc();
+ sqlite3_snprintf(sizeof(zErr),zErr, "out of memory");
+ }else{
+ sqlite3_snprintf(sizeof(zErr),zErr, "unable to open database: %s", zFile);
}
+ goto attach_error;
}
+
+ return;
-attach_end:
- sqliteFree(zFile);
- sqliteFree(zName);
+attach_error:
+ /* Return an error if we get here */
+ if( zErrDyn ){
+ sqlite3_result_error(context, zErrDyn, -1);
+ sqliteFree(zErrDyn);
+ }else{
+ zErr[sizeof(zErr)-1] = 0;
+ sqlite3_result_error(context, zErr, -1);
+ }
}
/*
-** This routine is called by the parser to process a DETACH statement:
+** An SQL user-function registered to do the work of an DETACH statement. The
+** three arguments to the function come directly from a detach statement:
**
-** DETACH DATABASE dbname
+** DETACH DATABASE x
**
-** The pDbname argument is the name of the database in the DETACH statement.
+** SELECT sqlite_detach(x)
*/
-void sqlite3Detach(Parse *pParse, Token *pDbname){
+static void detachFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ const char *zName = (const char *)sqlite3_value_text(argv[0]);
+ sqlite3 *db = sqlite3_user_data(context);
int i;
- sqlite3 *db;
- Vdbe *v;
Db *pDb = 0;
- char *zName;
+ char zErr[128];
- 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;
+ if( zName==0 ) zName = "";
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;
+ sqlite3_snprintf(sizeof(zErr),zErr, "no such database: %s", zName);
+ goto detach_error;
}
if( i<2 ){
- sqlite3ErrorMsg(pParse, "cannot detach database %z", zName);
- return;
+ sqlite3_snprintf(sizeof(zErr),zErr, "cannot detach database %s", zName);
+ goto detach_error;
}
- sqliteFree(zName);
if( !db->autoCommit ){
- sqlite3ErrorMsg(pParse, "cannot DETACH database within transaction");
- pParse->rc = SQLITE_ERROR;
- return;
+ strcpy(zErr, "cannot DETACH database within transaction");
+ goto detach_error;
}
-#ifndef SQLITE_OMIT_AUTHORIZATION
- if( sqlite3AuthCheck(pParse,SQLITE_DETACH,db->aDb[i].zName,0,0)!=SQLITE_OK ){
- return;
+ if( sqlite3BtreeIsInReadTrans(pDb->pBt) ){
+ sqlite3_snprintf(sizeof(zErr),zErr, "database %s is locked", zName);
+ goto detach_error;
}
-#endif /* SQLITE_OMIT_AUTHORIZATION */
+
sqlite3BtreeClose(pDb->pBt);
pDb->pBt = 0;
+ pDb->pSchema = 0;
sqlite3ResetInternalSchema(db, 0);
+ return;
+
+detach_error:
+ sqlite3_result_error(context, zErr, -1);
+}
+
+/*
+** This procedure generates VDBE code for a single invocation of either the
+** sqlite_detach() or sqlite_attach() SQL user functions.
+*/
+static void codeAttach(
+ Parse *pParse, /* The parser context */
+ int type, /* Either SQLITE_ATTACH or SQLITE_DETACH */
+ const char *zFunc, /* Either "sqlite_attach" or "sqlite_detach */
+ int nFunc, /* Number of args to pass to zFunc */
+ Expr *pAuthArg, /* Expression to pass to authorization callback */
+ Expr *pFilename, /* Name of database file */
+ Expr *pDbname, /* Name of the database to use internally */
+ Expr *pKey /* Database key for encryption extension */
+){
+ int rc;
+ NameContext sName;
+ Vdbe *v;
+ FuncDef *pFunc;
+ sqlite3* db = pParse->db;
+
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ assert( sqlite3MallocFailed() || pAuthArg );
+ if( pAuthArg ){
+ char *zAuthArg = sqlite3NameFromToken(&pAuthArg->span);
+ if( !zAuthArg ){
+ goto attach_end;
+ }
+ rc = sqlite3AuthCheck(pParse, type, zAuthArg, 0, 0);
+ sqliteFree(zAuthArg);
+ if(rc!=SQLITE_OK ){
+ goto attach_end;
+ }
+ }
+#endif /* SQLITE_OMIT_AUTHORIZATION */
+
+ memset(&sName, 0, sizeof(NameContext));
+ sName.pParse = pParse;
+
+ if(
+ SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) ||
+ SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) ||
+ SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey))
+ ){
+ pParse->nErr++;
+ goto attach_end;
+ }
+
+ v = sqlite3GetVdbe(pParse);
+ sqlite3ExprCode(pParse, pFilename);
+ sqlite3ExprCode(pParse, pDbname);
+ sqlite3ExprCode(pParse, pKey);
+
+ assert( v || sqlite3MallocFailed() );
+ if( v ){
+ sqlite3VdbeAddOp(v, OP_Function, 0, nFunc);
+ pFunc = sqlite3FindFunction(db, zFunc, strlen(zFunc), nFunc, SQLITE_UTF8,0);
+ sqlite3VdbeChangeP3(v, -1, (char *)pFunc, P3_FUNCDEF);
+
+ /* Code an OP_Expire. For an ATTACH statement, set P1 to true (expire this
+ ** statement only). For DETACH, set it to false (expire all existing
+ ** statements).
+ */
+ sqlite3VdbeAddOp(v, OP_Expire, (type==SQLITE_ATTACH), 0);
+ }
+
+attach_end:
+ sqlite3ExprDelete(pFilename);
+ sqlite3ExprDelete(pDbname);
+ sqlite3ExprDelete(pKey);
+}
+
+/*
+** Called by the parser to compile a DETACH statement.
+**
+** DETACH pDbname
+*/
+void sqlite3Detach(Parse *pParse, Expr *pDbname){
+ codeAttach(pParse, SQLITE_DETACH, "sqlite_detach", 1, pDbname, 0, 0, pDbname);
+}
+
+/*
+** Called by the parser to compile an ATTACH statement.
+**
+** ATTACH p AS pDbname KEY pKey
+*/
+void sqlite3Attach(Parse *pParse, Expr *p, Expr *pDbname, Expr *pKey){
+ codeAttach(pParse, SQLITE_ATTACH, "sqlite_attach", 3, p, p, pDbname, pKey);
+}
+
+/*
+** Register the functions sqlite_attach and sqlite_detach.
+*/
+void sqlite3AttachFunctions(sqlite3 *db){
+ static const int enc = SQLITE_UTF8;
+ sqlite3CreateFunc(db, "sqlite_attach", 3, enc, db, attachFunc, 0, 0);
+ sqlite3CreateFunc(db, "sqlite_detach", 1, enc, db, detachFunc, 0, 0);
}
/*
diff --git a/ext/pdo_sqlite/sqlite/src/auth.c b/ext/pdo_sqlite/sqlite/src/auth.c
index 693baa2c8..3983c1bc6 100644
--- a/ext/pdo_sqlite/sqlite/src/auth.c
+++ b/ext/pdo_sqlite/sqlite/src/auth.c
@@ -112,10 +112,17 @@ void sqlite3AuthRead(
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 */
+ int iDb; /* The index of the database the expression refers to */
if( db->xAuth==0 ) return;
if( pExpr->op==TK_AS ) return;
assert( pExpr->op==TK_COLUMN );
+ iDb = sqlite3SchemaToIndex(pParse->db, pExpr->pSchema);
+ if( iDb<0 ){
+ /* An attempt to read a column out of a subquery or other
+ ** temporary table. */
+ return;
+ }
for(iSrc=0; pTabList && iSrc<pTabList->nSrc; iSrc++){
if( pExpr->iTable==pTabList->a[iSrc].iCursor ) break;
}
@@ -140,14 +147,14 @@ void sqlite3AuthRead(
}else{
zCol = "ROWID";
}
- assert( pExpr->iDb<db->nDb );
- zDBase = db->aDb[pExpr->iDb].zName;
+ assert( iDb>=0 && iDb<db->nDb );
+ zDBase = db->aDb[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 ){
+ if( db->nDb>2 || iDb!=0 ){
sqlite3ErrorMsg(pParse, "access to %s.%s.%s is prohibited",
zDBase, pTab->zName, zCol);
}else{
@@ -175,8 +182,10 @@ int sqlite3AuthCheck(
sqlite3 *db = pParse->db;
int rc;
- /* Don't do any authorization checks if the database is initialising. */
- if( db->init.busy ){
+ /* Don't do any authorization checks if the database is initialising
+ ** or if the parser is being invoked from within sqlite3_declare_vtab.
+ */
+ if( db->init.busy || IN_DECLARE_VTAB ){
return SQLITE_OK;
}
diff --git a/ext/pdo_sqlite/sqlite/src/btree.c b/ext/pdo_sqlite/sqlite/src/btree.c
index f1ef6a2a4..52bc749a3 100644
--- a/ext/pdo_sqlite/sqlite/src/btree.c
+++ b/ext/pdo_sqlite/sqlite/src/btree.c
@@ -230,6 +230,7 @@
/* Forward declarations */
typedef struct MemPage MemPage;
+typedef struct BtLock BtLock;
/*
** This is a magic string that appears at the beginning of every
@@ -285,10 +286,10 @@ struct MemPage {
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 */
+ 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 */
+ BtShared *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 */
@@ -301,14 +302,32 @@ struct MemPage {
*/
#define EXTRA_SIZE sizeof(MemPage)
+/* Btree handle */
+struct Btree {
+ sqlite3 *pSqlite;
+ BtShared *pBt;
+ u8 inTrans; /* TRANS_NONE, TRANS_READ or TRANS_WRITE */
+};
+
+/*
+** Btree.inTrans may take one of the following values.
+**
+** If the shared-data extension is enabled, there may be multiple users
+** of the Btree structure. At most one of these may open a write transaction,
+** but any number may have active read transactions. Variable Btree.pDb
+** points to the handle that owns any current write-transaction.
+*/
+#define TRANS_NONE 0
+#define TRANS_READ 1
+#define TRANS_WRITE 2
+
/*
** Everything we need to know about an open database
*/
-struct Btree {
+struct BtShared {
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 */
@@ -325,15 +344,16 @@ struct Btree {
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 */
+ u8 inTransaction; /* Transaction state */
+ int nRef; /* Number of references to this structure */
+ int nTransaction; /* Number of open transactions (read + write) */
+ void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */
+ void (*xFreeSchema)(void*); /* Destructor for BtShared.pSchema */
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ BtLock *pLock; /* List of locks held on this shared-btree struct */
+ BtShared *pNext; /* Next in ThreadData.pBtree linked list */
+#endif
};
-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
@@ -357,7 +377,7 @@ struct CellInfo {
** MemPage.aCell[] of the entry.
*/
struct BtCursor {
- Btree *pBt; /* The Btree to which this cursor belongs */
+ Btree *pBtree; /* 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() */
@@ -366,10 +386,39 @@ struct BtCursor {
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 */
+ u8 eState; /* One of the CURSOR_XXX constants (see below) */
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ void *pKey; /* Saved key that was cursor's last known position */
+ i64 nKey; /* Size of pKey, or last integer key */
+ int skip; /* (skip<0) -> Prev() is a no-op. (skip>0) -> Next() is */
+#endif
};
/*
+** Potential values for BtCursor.eState. The first two values (VALID and
+** INVALID) may occur in any build. The third (REQUIRESEEK) may only occur
+** if sqlite was compiled without the OMIT_SHARED_CACHE symbol defined.
+**
+** CURSOR_VALID:
+** Cursor points to a valid entry. getPayload() etc. may be called.
+**
+** CURSOR_INVALID:
+** Cursor does not point to a valid entry. This can happen (for example)
+** because the table is empty or because BtreeCursorFirst() has not been
+** called.
+**
+** CURSOR_REQUIRESEEK:
+** The table that this cursor was opened on still exists, but has been
+** modified since the cursor was last used. The cursor position is saved
+** in variables BtCursor.pKey and BtCursor.nKey. When a cursor is in
+** this state, restoreOrClearCursorPosition() can be called to attempt to
+** seek the cursor to the saved position.
+*/
+#define CURSOR_INVALID 0
+#define CURSOR_VALID 1
+#define CURSOR_REQUIRESEEK 2
+
+/*
** The TRACE macro will print high-level status information about the
** btree operation when the global variable sqlite3_btree_trace is
** enabled.
@@ -377,15 +426,15 @@ struct BtCursor {
#if SQLITE_TEST
# define TRACE(X) if( sqlite3_btree_trace )\
{ sqlite3DebugPrintf X; fflush(stdout); }
+int sqlite3_btree_trace=0; /* True to enable tracing */
#else
# define TRACE(X)
#endif
-int sqlite3_btree_trace=0; /* True to enable tracing */
/*
** Forward declaration
*/
-static int checkReadLocks(Btree*,Pgno,BtCursor*);
+static int checkReadLocks(BtShared*,Pgno,BtCursor*);
/*
** Read or write a two- and four-byte big-endian integer values.
@@ -413,14 +462,290 @@ static void put4byte(unsigned char *p, u32 v){
** file.
*/
#define getVarint sqlite3GetVarint
-#define getVarint32 sqlite3GetVarint32
+/* #define getVarint32 sqlite3GetVarint32 */
+#define getVarint32(A,B) ((*B=*(A))<=0x7f?1:sqlite3GetVarint32(A,B))
#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).
+**
+** If disk I/O is omitted (meaning that the database is stored purely
+** in memory) then there is no pending byte.
+*/
+#ifdef SQLITE_OMIT_DISKIO
+# define PENDING_BYTE_PAGE(pBt) 0x7fffffff
+#else
+# define PENDING_BYTE_PAGE(pBt) ((PENDING_BYTE/(pBt)->pageSize)+1)
+#endif
+
+/*
+** A linked list of the following structures is stored at BtShared.pLock.
+** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor
+** is opened on the table with root page BtShared.iTable. Locks are removed
+** from this list when a transaction is committed or rolled back, or when
+** a btree handle is closed.
+*/
+struct BtLock {
+ Btree *pBtree; /* Btree handle holding this lock */
+ Pgno iTable; /* Root page of table */
+ u8 eLock; /* READ_LOCK or WRITE_LOCK */
+ BtLock *pNext; /* Next in BtShared.pLock list */
+};
+
+/* Candidate values for BtLock.eLock */
+#define READ_LOCK 1
+#define WRITE_LOCK 2
+
+#ifdef SQLITE_OMIT_SHARED_CACHE
+ /*
+ ** The functions queryTableLock(), lockTable() and unlockAllTables()
+ ** manipulate entries in the BtShared.pLock linked list used to store
+ ** shared-cache table level locks. If the library is compiled with the
+ ** shared-cache feature disabled, then there is only ever one user
+ ** of each BtShared structure and so this locking is not necessary.
+ ** So define the lock related functions as no-ops.
+ */
+ #define queryTableLock(a,b,c) SQLITE_OK
+ #define lockTable(a,b,c) SQLITE_OK
+ #define unlockAllTables(a)
+ #define restoreOrClearCursorPosition(a,b) SQLITE_OK
+ #define saveAllCursors(a,b,c) SQLITE_OK
+
+#else
+
+static void releasePage(MemPage *pPage);
+
+/*
+** Save the current cursor position in the variables BtCursor.nKey
+** and BtCursor.pKey. The cursor's state is set to CURSOR_REQUIRESEEK.
+*/
+static int saveCursorPosition(BtCursor *pCur){
+ int rc;
+
+ assert( CURSOR_VALID==pCur->eState );
+ assert( 0==pCur->pKey );
+
+ rc = sqlite3BtreeKeySize(pCur, &pCur->nKey);
+
+ /* If this is an intKey table, then the above call to BtreeKeySize()
+ ** stores the integer key in pCur->nKey. In this case this value is
+ ** all that is required. Otherwise, if pCur is not open on an intKey
+ ** table, then malloc space for and store the pCur->nKey bytes of key
+ ** data.
+ */
+ if( rc==SQLITE_OK && 0==pCur->pPage->intKey){
+ void *pKey = sqliteMalloc(pCur->nKey);
+ if( pKey ){
+ rc = sqlite3BtreeKey(pCur, 0, pCur->nKey, pKey);
+ if( rc==SQLITE_OK ){
+ pCur->pKey = pKey;
+ }else{
+ sqliteFree(pKey);
+ }
+ }else{
+ rc = SQLITE_NOMEM;
+ }
+ }
+ assert( !pCur->pPage->intKey || !pCur->pKey );
+
+ if( rc==SQLITE_OK ){
+ releasePage(pCur->pPage);
+ pCur->pPage = 0;
+ pCur->eState = CURSOR_REQUIRESEEK;
+ }
+
+ return rc;
+}
+
+/*
+** Save the positions of all cursors except pExcept open on the table
+** with root-page iRoot. Usually, this is called just before cursor
+** pExcept is used to modify the table (BtreeDelete() or BtreeInsert()).
+*/
+static int saveAllCursors(BtShared *pBt, Pgno iRoot, BtCursor *pExcept){
+ BtCursor *p;
+ if( sqlite3ThreadDataReadOnly()->useSharedData ){
+ for(p=pBt->pCursor; p; p=p->pNext){
+ if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) &&
+ p->eState==CURSOR_VALID ){
+ int rc = saveCursorPosition(p);
+ if( SQLITE_OK!=rc ){
+ return rc;
+ }
+ }
+ }
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Restore the cursor to the position it was in (or as close to as possible)
+** when saveCursorPosition() was called. Note that this call deletes the
+** saved position info stored by saveCursorPosition(), so there can be
+** at most one effective restoreOrClearCursorPosition() call after each
+** saveCursorPosition().
+**
+** If the second argument argument - doSeek - is false, then instead of
+** returning the cursor to it's saved position, any saved position is deleted
+** and the cursor state set to CURSOR_INVALID.
+*/
+static int restoreOrClearCursorPositionX(BtCursor *pCur, int doSeek){
+ int rc = SQLITE_OK;
+ assert( sqlite3ThreadDataReadOnly()->useSharedData );
+ assert( pCur->eState==CURSOR_REQUIRESEEK );
+ pCur->eState = CURSOR_INVALID;
+ if( doSeek ){
+ rc = sqlite3BtreeMoveto(pCur, pCur->pKey, pCur->nKey, &pCur->skip);
+ }
+ if( rc==SQLITE_OK ){
+ sqliteFree(pCur->pKey);
+ pCur->pKey = 0;
+ assert( CURSOR_VALID==pCur->eState || CURSOR_INVALID==pCur->eState );
+ }
+ return rc;
+}
+
+#define restoreOrClearCursorPosition(p,x) \
+ (p->eState==CURSOR_REQUIRESEEK?restoreOrClearCursorPositionX(p,x):SQLITE_OK)
+
+/*
+** Query to see if btree handle p may obtain a lock of type eLock
+** (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return
+** SQLITE_OK if the lock may be obtained (by calling lockTable()), or
+** SQLITE_LOCKED if not.
+*/
+static int queryTableLock(Btree *p, Pgno iTab, u8 eLock){
+ BtShared *pBt = p->pBt;
+ BtLock *pIter;
+
+ /* This is a no-op if the shared-cache is not enabled */
+ if( 0==sqlite3ThreadDataReadOnly()->useSharedData ){
+ return SQLITE_OK;
+ }
+
+ /* This (along with lockTable()) is where the ReadUncommitted flag is
+ ** dealt with. If the caller is querying for a read-lock and the flag is
+ ** set, it is unconditionally granted - even if there are write-locks
+ ** on the table. If a write-lock is requested, the ReadUncommitted flag
+ ** is not considered.
+ **
+ ** In function lockTable(), if a read-lock is demanded and the
+ ** ReadUncommitted flag is set, no entry is added to the locks list
+ ** (BtShared.pLock).
+ **
+ ** To summarize: If the ReadUncommitted flag is set, then read cursors do
+ ** not create or respect table locks. The locking procedure for a
+ ** write-cursor does not change.
+ */
+ if(
+ !p->pSqlite ||
+ 0==(p->pSqlite->flags&SQLITE_ReadUncommitted) ||
+ eLock==WRITE_LOCK ||
+ iTab==MASTER_ROOT
+ ){
+ for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){
+ if( pIter->pBtree!=p && pIter->iTable==iTab &&
+ (pIter->eLock!=eLock || eLock!=READ_LOCK) ){
+ return SQLITE_LOCKED;
+ }
+ }
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Add a lock on the table with root-page iTable to the shared-btree used
+** by Btree handle p. Parameter eLock must be either READ_LOCK or
+** WRITE_LOCK.
+**
+** SQLITE_OK is returned if the lock is added successfully. SQLITE_BUSY and
+** SQLITE_NOMEM may also be returned.
*/
-#define PENDING_BYTE_PAGE(pBt) ((PENDING_BYTE/(pBt)->pageSize)+1)
+static int lockTable(Btree *p, Pgno iTable, u8 eLock){
+ BtShared *pBt = p->pBt;
+ BtLock *pLock = 0;
+ BtLock *pIter;
+
+ /* This is a no-op if the shared-cache is not enabled */
+ if( 0==sqlite3ThreadDataReadOnly()->useSharedData ){
+ return SQLITE_OK;
+ }
+
+ assert( SQLITE_OK==queryTableLock(p, iTable, eLock) );
+
+ /* If the read-uncommitted flag is set and a read-lock is requested,
+ ** return early without adding an entry to the BtShared.pLock list. See
+ ** comment in function queryTableLock() for more info on handling
+ ** the ReadUncommitted flag.
+ */
+ if(
+ (p->pSqlite) &&
+ (p->pSqlite->flags&SQLITE_ReadUncommitted) &&
+ (eLock==READ_LOCK) &&
+ iTable!=MASTER_ROOT
+ ){
+ return SQLITE_OK;
+ }
+
+ /* First search the list for an existing lock on this table. */
+ for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){
+ if( pIter->iTable==iTable && pIter->pBtree==p ){
+ pLock = pIter;
+ break;
+ }
+ }
+
+ /* If the above search did not find a BtLock struct associating Btree p
+ ** with table iTable, allocate one and link it into the list.
+ */
+ if( !pLock ){
+ pLock = (BtLock *)sqliteMalloc(sizeof(BtLock));
+ if( !pLock ){
+ return SQLITE_NOMEM;
+ }
+ pLock->iTable = iTable;
+ pLock->pBtree = p;
+ pLock->pNext = pBt->pLock;
+ pBt->pLock = pLock;
+ }
+
+ /* Set the BtLock.eLock variable to the maximum of the current lock
+ ** and the requested lock. This means if a write-lock was already held
+ ** and a read-lock requested, we don't incorrectly downgrade the lock.
+ */
+ assert( WRITE_LOCK>READ_LOCK );
+ if( eLock>pLock->eLock ){
+ pLock->eLock = eLock;
+ }
+
+ return SQLITE_OK;
+}
+
+/*
+** Release all the table locks (locks obtained via calls to the lockTable()
+** procedure) held by Btree handle p.
+*/
+static void unlockAllTables(Btree *p){
+ BtLock **ppIter = &p->pBt->pLock;
+
+ /* If the shared-cache extension is not enabled, there should be no
+ ** locks in the BtShared.pLock list, making this procedure a no-op. Assert
+ ** that this is the case.
+ */
+ assert( sqlite3ThreadDataReadOnly()->useSharedData || 0==*ppIter );
+
+ while( *ppIter ){
+ BtLock *pLock = *ppIter;
+ if( pLock->pBtree==p ){
+ *ppIter = pLock->pNext;
+ sqliteFree(pLock);
+ }else{
+ ppIter = &pLock->pNext;
+ }
+ }
+}
+#endif /* SQLITE_OMIT_SHARED_CACHE */
#ifndef SQLITE_OMIT_AUTOVACUUM
/*
@@ -438,9 +763,19 @@ static void put4byte(unsigned char *p, u32 v){
** 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)
+#define PTRMAP_PAGENO(pBt, pgno) ptrmapPageno(pBt, pgno)
+#define PTRMAP_PTROFFSET(pBt, pgno) (5*(pgno-ptrmapPageno(pBt, pgno)-1))
+#define PTRMAP_ISPAGE(pBt, pgno) (PTRMAP_PAGENO((pBt),(pgno))==(pgno))
+
+static Pgno ptrmapPageno(BtShared *pBt, Pgno pgno){
+ int nPagesPerMapPage = (pBt->usableSize/5)+1;
+ int iPtrMap = (pgno-2)/nPagesPerMapPage;
+ int ret = (iPtrMap*nPagesPerMapPage) + 2;
+ if( ret==PENDING_BYTE_PAGE(pBt) ){
+ ret++;
+ }
+ return ret;
+}
/*
** The pointer map is a lookup table that identifies the parent page for
@@ -486,22 +821,25 @@ static void put4byte(unsigned char *p, u32 v){
** 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){
+static int ptrmapPut(BtShared *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;
+ /* The master-journal page number must never be used as a pointer map page */
+ assert( 0==PTRMAP_ISPAGE(pBt, PENDING_BYTE_PAGE(pBt)) );
+
assert( pBt->autoVacuum );
if( key==0 ){
return SQLITE_CORRUPT_BKPT;
}
- iPtrmap = PTRMAP_PAGENO(pBt->usableSize, key);
+ iPtrmap = PTRMAP_PAGENO(pBt, key);
rc = sqlite3pager_get(pBt->pPager, iPtrmap, (void **)&pPtrmap);
if( rc!=SQLITE_OK ){
return rc;
}
- offset = PTRMAP_PTROFFSET(pBt->usableSize, key);
+ offset = PTRMAP_PTROFFSET(pBt, key);
if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){
TRACE(("PTRMAP_UPDATE: %d->(%d,%d)\n", key, eType, parent));
@@ -523,20 +861,21 @@ static int ptrmapPut(Btree *pBt, Pgno key, u8 eType, Pgno parent){
** 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){
+static int ptrmapGet(BtShared *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);
+ iPtrmap = PTRMAP_PAGENO(pBt, 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];
+ offset = PTRMAP_PTROFFSET(pBt, key);
+ assert( pEType!=0 );
+ *pEType = pPtrmap[offset];
if( pPgno ) *pPgno = get4byte(&pPtrmap[offset+1]);
sqlite3pager_unref(pPtrmap);
@@ -604,12 +943,16 @@ static void parseCellPtr(
}else{
nPayload = 0;
}
- n += getVarint(&pCell[n], (u64 *)&pInfo->nKey);
- pInfo->nHeader = n;
pInfo->nData = nPayload;
- if( !pPage->intKey ){
- nPayload += pInfo->nKey;
+ if( pPage->intKey ){
+ n += getVarint(&pCell[n], (u64 *)&pInfo->nKey);
+ }else{
+ u32 x;
+ n += getVarint32(&pCell[n], &x);
+ pInfo->nKey = x;
+ nPayload += x;
}
+ pInfo->nHeader = n;
if( nPayload<=pPage->maxLocal ){
/* This is the (easy) common case where the entire payload fits
** on the local page. No overflow is required.
@@ -790,10 +1133,20 @@ static void _pageIntegrity(MemPage *pPage){
# define pageIntegrity(X)
#endif
+/* A bunch of assert() statements to check the transaction state variables
+** of handle p (type Btree*) are internally consistent.
+*/
+#define btreeIntegrity(p) \
+ assert( p->inTrans!=TRANS_NONE || p->pBt->nTransaction<p->pBt->nRef ); \
+ assert( p->pBt->nTransaction<=p->pBt->nRef ); \
+ assert( p->pBt->inTransaction!=TRANS_NONE || p->pBt->nTransaction==0 ); \
+ assert( p->pBt->inTransaction>=p->inTrans );
+
/*
** 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.
+** end of the page and all free space is collected into one
+** big FreeBlk that occurs in between the header and cell
+** pointer array and the cell content area.
*/
static int defragmentPage(MemPage *pPage){
int i; /* Loop counter */
@@ -928,6 +1281,12 @@ static void freeSpace(MemPage *pPage, int start, int size){
assert( (start + size)<=pPage->pBt->usableSize );
if( size<4 ) size = 4;
+#ifdef SQLITE_SECURE_DELETE
+ /* Overwrite deleted information with zeros when the SECURE_DELETE
+ ** option is enabled at compile-time */
+ memset(&data[start], 0, size);
+#endif
+
/* Add the space back into the linked list of freeblocks */
hdr = pPage->hdrOffset;
addr = hdr + 1;
@@ -977,7 +1336,7 @@ static void freeSpace(MemPage *pPage, int start, int size){
** and initialize fields of the MemPage structure accordingly.
*/
static void decodeFlags(MemPage *pPage, int flagByte){
- Btree *pBt; /* A copy of pPage->pBt */
+ BtShared *pBt; /* A copy of pPage->pBt */
assert( pPage->hdrOffset==(pPage->pgno==1 ? 100 : 0) );
pPage->intKey = (flagByte & (PTF_INTKEY|PTF_LEAFDATA))!=0;
@@ -1017,7 +1376,7 @@ static int initPage(
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 */
+ BtShared *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 */
@@ -1090,7 +1449,7 @@ static int initPage(
*/
static void zeroPage(MemPage *pPage, int flags){
unsigned char *data = pPage->aData;
- Btree *pBt = pPage->pBt;
+ BtShared *pBt = pPage->pBt;
int hdr = pPage->hdrOffset;
int first;
@@ -1118,7 +1477,7 @@ static void zeroPage(MemPage *pPage, int flags){
** 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){
+static int getPage(BtShared *pBt, Pgno pgno, MemPage **ppPage){
int rc;
unsigned char *aData;
MemPage *pPage;
@@ -1139,7 +1498,7 @@ static int getPage(Btree *pBt, Pgno pgno, MemPage **ppPage){
** getPage() and initPage().
*/
static int getAndInitPage(
- Btree *pBt, /* The database file */
+ BtShared *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 */
@@ -1212,21 +1571,69 @@ static void pageReinit(void *pData, int pageSize){
*/
int sqlite3BtreeOpen(
const char *zFilename, /* Name of the file containing the BTree database */
+ sqlite3 *pSqlite, /* Associated database handle */
Btree **ppBtree, /* Pointer to new Btree object written here */
int flags /* Options */
){
- Btree *pBt;
+ BtShared *pBt; /* Shared part of btree structure */
+ Btree *p; /* Handle to return */
int rc;
int nReserve;
unsigned char zDbHeader[100];
+#if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO)
+ const ThreadData *pTsdro;
+#endif
+
+ /* Set the variable isMemdb to true for an in-memory database, or
+ ** false for a file-based database. This symbol is only required if
+ ** either of the shared-data or autovacuum features are compiled
+ ** into the library.
+ */
+#if !defined(SQLITE_OMIT_SHARED_CACHE) || !defined(SQLITE_OMIT_AUTOVACUUM)
+ #ifdef SQLITE_OMIT_MEMORYDB
+ const int isMemdb = !zFilename;
+ #else
+ const int isMemdb = !zFilename || (strcmp(zFilename, ":memory:")?0:1);
+ #endif
+#endif
+
+ p = sqliteMalloc(sizeof(Btree));
+ if( !p ){
+ return SQLITE_NOMEM;
+ }
+ p->inTrans = TRANS_NONE;
+ p->pSqlite = pSqlite;
+
+ /* Try to find an existing Btree structure opened on zFilename. */
+#if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO)
+ pTsdro = sqlite3ThreadDataReadOnly();
+ if( pTsdro->useSharedData && zFilename && !isMemdb ){
+ char *zFullPathname = sqlite3OsFullPathname(zFilename);
+ if( !zFullPathname ){
+ sqliteFree(p);
+ return SQLITE_NOMEM;
+ }
+ for(pBt=pTsdro->pBtree; pBt; pBt=pBt->pNext){
+ assert( pBt->nRef>0 );
+ if( 0==strcmp(zFullPathname, sqlite3pager_filename(pBt->pPager)) ){
+ p->pBt = pBt;
+ *ppBtree = p;
+ pBt->nRef++;
+ sqliteFree(zFullPathname);
+ return SQLITE_OK;
+ }
+ }
+ sqliteFree(zFullPathname);
+ }
+#endif
/*
** 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(i64)==8 || sizeof(i64)==4 );
+ assert( sizeof(u64)==8 || sizeof(u64)==4 );
assert( sizeof(u32)==4 );
assert( sizeof(u16)==2 );
assert( sizeof(Pgno)==4 );
@@ -1234,15 +1641,19 @@ int sqlite3BtreeOpen(
pBt = sqliteMalloc( sizeof(*pBt) );
if( pBt==0 ){
*ppBtree = 0;
+ sqliteFree(p);
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);
+ sqliteFree(p);
*ppBtree = 0;
return rc;
}
+ p->pBt = pBt;
+
sqlite3pager_set_destructor(pBt->pPager, pageDestructor);
sqlite3pager_set_reiniter(pBt->pPager, pageReinit);
pBt->pCursor = 0;
@@ -1263,11 +1674,7 @@ int sqlite3BtreeOpen(
** 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
+ if( zFilename && !isMemdb ){
pBt->autoVacuum = SQLITE_DEFAULT_AUTOVACUUM;
}
#endif
@@ -1285,18 +1692,87 @@ int sqlite3BtreeOpen(
pBt->usableSize = pBt->pageSize - nReserve;
assert( (pBt->pageSize & 7)==0 ); /* 8-byte alignment of pageSize */
sqlite3pager_set_pagesize(pBt->pPager, pBt->pageSize);
- *ppBtree = pBt;
+
+#if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO)
+ /* Add the new btree to the linked list starting at ThreadData.pBtree.
+ ** There is no chance that a malloc() may fail inside of the
+ ** sqlite3ThreadData() call, as the ThreadData structure must have already
+ ** been allocated for pTsdro->useSharedData to be non-zero.
+ */
+ if( pTsdro->useSharedData && zFilename && !isMemdb ){
+ pBt->pNext = pTsdro->pBtree;
+ sqlite3ThreadData()->pBtree = pBt;
+ }
+#endif
+ pBt->nRef = 1;
+ *ppBtree = p;
return SQLITE_OK;
}
/*
** Close an open database and invalidate all cursors.
*/
-int sqlite3BtreeClose(Btree *pBt){
- while( pBt->pCursor ){
- sqlite3BtreeCloseCursor(pBt->pCursor);
+int sqlite3BtreeClose(Btree *p){
+ BtShared *pBt = p->pBt;
+ BtCursor *pCur;
+
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ ThreadData *pTsd;
+#endif
+
+ /* Close all cursors opened via this handle. */
+ pCur = pBt->pCursor;
+ while( pCur ){
+ BtCursor *pTmp = pCur;
+ pCur = pCur->pNext;
+ if( pTmp->pBtree==p ){
+ sqlite3BtreeCloseCursor(pTmp);
+ }
+ }
+
+ /* Rollback any active transaction and free the handle structure.
+ ** The call to sqlite3BtreeRollback() drops any table-locks held by
+ ** this handle.
+ */
+ sqlite3BtreeRollback(p);
+ sqliteFree(p);
+
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ /* If there are still other outstanding references to the shared-btree
+ ** structure, return now. The remainder of this procedure cleans
+ ** up the shared-btree.
+ */
+ assert( pBt->nRef>0 );
+ pBt->nRef--;
+ if( pBt->nRef ){
+ return SQLITE_OK;
}
+
+ /* Remove the shared-btree from the thread wide list. Call
+ ** ThreadDataReadOnly() and then cast away the const property of the
+ ** pointer to avoid allocating thread data if it is not really required.
+ */
+ pTsd = (ThreadData *)sqlite3ThreadDataReadOnly();
+ if( pTsd->pBtree==pBt ){
+ assert( pTsd==sqlite3ThreadData() );
+ pTsd->pBtree = pBt->pNext;
+ }else{
+ BtShared *pPrev;
+ for(pPrev=pTsd->pBtree; pPrev && pPrev->pNext!=pBt; pPrev=pPrev->pNext){}
+ if( pPrev ){
+ assert( pTsd==sqlite3ThreadData() );
+ pPrev->pNext = pBt->pNext;
+ }
+ }
+#endif
+
+ /* Close the pager and free the shared-btree structure */
+ assert( !pBt->pCursor );
sqlite3pager_close(pBt->pPager);
+ if( pBt->xFreeSchema && pBt->pSchema ){
+ pBt->xFreeSchema(pBt->pSchema);
+ }
+ sqliteFree(pBt->pSchema);
sqliteFree(pBt);
return SQLITE_OK;
}
@@ -1304,7 +1780,8 @@ int sqlite3BtreeClose(Btree *pBt){
/*
** Change the busy handler callback function.
*/
-int sqlite3BtreeSetBusyHandler(Btree *pBt, BusyHandler *pHandler){
+int sqlite3BtreeSetBusyHandler(Btree *p, BusyHandler *pHandler){
+ BtShared *pBt = p->pBt;
pBt->pBusyHandler = pHandler;
sqlite3pager_set_busyhandler(pBt->pPager, pHandler);
return SQLITE_OK;
@@ -1325,7 +1802,8 @@ int sqlite3BtreeSetBusyHandler(Btree *pBt, BusyHandler *pHandler){
** Synchronous is on by default so database corruption is not
** normally a worry.
*/
-int sqlite3BtreeSetCacheSize(Btree *pBt, int mxPage){
+int sqlite3BtreeSetCacheSize(Btree *p, int mxPage){
+ BtShared *pBt = p->pBt;
sqlite3pager_set_cachesize(pBt->pPager, mxPage);
return SQLITE_OK;
}
@@ -1339,8 +1817,9 @@ int sqlite3BtreeSetCacheSize(Btree *pBt, int mxPage){
** 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);
+int sqlite3BtreeSetSafetyLevel(Btree *p, int level, int fullSync){
+ BtShared *pBt = p->pBt;
+ sqlite3pager_set_safety_level(pBt->pPager, level, fullSync);
return SQLITE_OK;
}
#endif
@@ -1349,7 +1828,8 @@ int sqlite3BtreeSetSafetyLevel(Btree *pBt, int level){
** 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){
+int sqlite3BtreeSyncDisabled(Btree *p){
+ BtShared *pBt = p->pBt;
assert( pBt && pBt->pPager );
return sqlite3pager_nosync(pBt->pPager);
}
@@ -1370,7 +1850,8 @@ int sqlite3BtreeSyncDisabled(Btree *pBt){
** 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){
+int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int nReserve){
+ BtShared *pBt = p->pBt;
if( pBt->pageSizeFixed ){
return SQLITE_READONLY;
}
@@ -1380,6 +1861,7 @@ int sqlite3BtreeSetPageSize(Btree *pBt, int pageSize, int nReserve){
if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE &&
((pageSize-1)&pageSize)==0 ){
assert( (pageSize & 7)==0 );
+ assert( !pBt->pPage1 && !pBt->pCursor );
pBt->pageSize = sqlite3pager_set_pagesize(pBt->pPager, pageSize);
}
pBt->usableSize = pBt->pageSize - nReserve;
@@ -1389,11 +1871,11 @@ int sqlite3BtreeSetPageSize(Btree *pBt, int pageSize, int nReserve){
/*
** Return the currently defined page size
*/
-int sqlite3BtreeGetPageSize(Btree *pBt){
- return pBt->pageSize;
+int sqlite3BtreeGetPageSize(Btree *p){
+ return p->pBt->pageSize;
}
-int sqlite3BtreeGetReserve(Btree *pBt){
- return pBt->pageSize - pBt->usableSize;
+int sqlite3BtreeGetReserve(Btree *p){
+ return p->pBt->pageSize - p->pBt->usableSize;
}
#endif /* !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM) */
@@ -1403,7 +1885,8 @@ int sqlite3BtreeGetReserve(Btree *pBt){
** is disabled. The default value for the auto-vacuum property is
** determined by the SQLITE_DEFAULT_AUTOVACUUM macro.
*/
-int sqlite3BtreeSetAutoVacuum(Btree *pBt, int autoVacuum){
+int sqlite3BtreeSetAutoVacuum(Btree *p, int autoVacuum){
+ BtShared *pBt = p->pBt;;
#ifdef SQLITE_OMIT_AUTOVACUUM
return SQLITE_READONLY;
#else
@@ -1419,11 +1902,11 @@ int sqlite3BtreeSetAutoVacuum(Btree *pBt, int autoVacuum){
** Return the value of the 'auto-vacuum' property. If auto-vacuum is
** enabled 1 is returned. Otherwise 0.
*/
-int sqlite3BtreeGetAutoVacuum(Btree *pBt){
+int sqlite3BtreeGetAutoVacuum(Btree *p){
#ifdef SQLITE_OMIT_AUTOVACUUM
return 0;
#else
- return pBt->autoVacuum;
+ return p->pBt->autoVacuum;
#endif
}
@@ -1438,7 +1921,7 @@ int sqlite3BtreeGetAutoVacuum(Btree *pBt){
** is returned if we run out of memory. SQLITE_PROTOCOL is returned
** if there is a locking protocol violation.
*/
-static int lockBtree(Btree *pBt){
+static int lockBtree(BtShared *pBt){
int rc, pageSize;
MemPage *pPage1;
if( pBt->pPage1 ) return SQLITE_OK;
@@ -1510,11 +1993,18 @@ page1_init_failed:
** This routine works like lockBtree() except that it also invokes the
** busy callback if there is lock contention.
*/
-static int lockBtreeWithRetry(Btree *pBt){
+static int lockBtreeWithRetry(Btree *pRef){
int rc = SQLITE_OK;
- if( pBt->inTrans==TRANS_NONE ){
- rc = sqlite3BtreeBeginTrans(pBt, 0);
- pBt->inTrans = TRANS_NONE;
+ if( pRef->inTrans==TRANS_NONE ){
+ u8 inTransaction = pRef->pBt->inTransaction;
+ btreeIntegrity(pRef);
+ rc = sqlite3BtreeBeginTrans(pRef, 0);
+ pRef->pBt->inTransaction = inTransaction;
+ pRef->inTrans = TRANS_NONE;
+ if( rc==SQLITE_OK ){
+ pRef->pBt->nTransaction--;
+ }
+ btreeIntegrity(pRef);
}
return rc;
}
@@ -1530,11 +2020,11 @@ static int lockBtreeWithRetry(Btree *pBt){
**
** 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 ){
+static void unlockBtreeIfUnused(BtShared *pBt){
+ if( pBt->inTransaction==TRANS_NONE && pBt->pCursor==0 && pBt->pPage1!=0 ){
if( pBt->pPage1->aData==0 ){
MemPage *pPage = pBt->pPage1;
- pPage->aData = &((char*)pPage)[-pBt->pageSize];
+ pPage->aData = &((u8*)pPage)[-pBt->pageSize];
pPage->pBt = pBt;
pPage->pgno = 1;
}
@@ -1548,7 +2038,7 @@ static void unlockBtreeIfUnused(Btree *pBt){
** Create a new database by initializing the first page of the
** file.
*/
-static int newDatabase(Btree *pBt){
+static int newDatabase(BtShared *pBt){
MemPage *pP1;
unsigned char *data;
int rc;
@@ -1613,14 +2103,17 @@ static int newDatabase(Btree *pBt){
** when A already has a read lock, we encourage A to give up and let B
** proceed.
*/
-int sqlite3BtreeBeginTrans(Btree *pBt, int wrflag){
+int sqlite3BtreeBeginTrans(Btree *p, int wrflag){
+ BtShared *pBt = p->pBt;
int rc = SQLITE_OK;
+ btreeIntegrity(p);
+
/* 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) ){
+ if( p->inTrans==TRANS_WRITE || (p->inTrans==TRANS_READ && !wrflag) ){
return SQLITE_OK;
}
@@ -1629,6 +2122,14 @@ int sqlite3BtreeBeginTrans(Btree *pBt, int wrflag){
return SQLITE_READONLY;
}
+ /* If another database handle has already opened a write transaction
+ ** on this shared-btree structure and a second write transaction is
+ ** requested, return SQLITE_BUSY.
+ */
+ if( pBt->inTransaction==TRANS_WRITE && wrflag ){
+ return SQLITE_BUSY;
+ }
+
do {
if( pBt->pPage1==0 ){
rc = lockBtree(pBt);
@@ -1642,13 +2143,24 @@ int sqlite3BtreeBeginTrans(Btree *pBt, int wrflag){
}
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 &&
+ }while( rc==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE &&
sqlite3InvokeBusyHandler(pBt->pBusyHandler) );
+
+ if( rc==SQLITE_OK ){
+ if( p->inTrans==TRANS_NONE ){
+ pBt->nTransaction++;
+ }
+ p->inTrans = (wrflag?TRANS_WRITE:TRANS_READ);
+ if( p->inTrans>pBt->inTransaction ){
+ pBt->inTransaction = p->inTrans;
+ }
+ }
+
+ btreeIntegrity(p);
return rc;
}
@@ -1663,7 +2175,7 @@ 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;
+ BtShared *pBt = pPage->pBt;
int isInitOrig = pPage->isInit;
Pgno pgno = pPage->pgno;
@@ -1763,7 +2275,7 @@ static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){
** database. The pDbPage reference remains valid.
*/
static int relocatePage(
- Btree *pBt, /* Btree */
+ BtShared *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 */
@@ -1833,19 +2345,19 @@ static int relocatePage(
}
/* Forward declaration required by autoVacuumCommit(). */
-static int allocatePage(Btree *, MemPage **, Pgno *, Pgno, u8);
+static int allocatePage(BtShared *, 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){
+static int autoVacuumCommit(BtShared *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 */
+ 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 */
@@ -1855,11 +2367,11 @@ static int autoVacuumCommit(Btree *pBt, Pgno *nTrunc){
MemPage *pFreeMemPage = 0; /* "" */
#ifndef NDEBUG
- int nRef = *sqlite3pager_stats(pPager);
+ int nRef = sqlite3pager_refcount(pPager);
#endif
assert( pBt->autoVacuum );
- if( PTRMAP_ISPAGE(pgsz, sqlite3pager_pagecount(pPager)) ){
+ if( PTRMAP_ISPAGE(pBt, sqlite3pager_pagecount(pPager)) ){
return SQLITE_CORRUPT_BKPT;
}
@@ -1872,14 +2384,26 @@ static int autoVacuumCommit(Btree *pBt, Pgno *nTrunc){
return SQLITE_OK;
}
+ /* This block figures out how many pages there are in the database
+ ** now (variable origSize), and how many there will be after the
+ ** truncation (variable finSize).
+ **
+ ** The final size is the original size, less the number of free pages
+ ** in the database, less any pointer-map pages that will no longer
+ ** be required, less 1 if the pending-byte page was part of the database
+ ** but is not after the truncation.
+ **/
origSize = sqlite3pager_pagecount(pPager);
- nPtrMap = (nFreeList-origSize+PTRMAP_PAGENO(pgsz, origSize)+pgsz/5)/(pgsz/5);
+ if( origSize==PENDING_BYTE_PAGE(pBt) ){
+ origSize--;
+ }
+ nPtrMap = (nFreeList-origSize+PTRMAP_PAGENO(pBt, origSize)+pgsz/5)/(pgsz/5);
finSize = origSize - nFreeList - nPtrMap;
- if( origSize>=PENDING_BYTE_PAGE(pBt) && finSize<=PENDING_BYTE_PAGE(pBt) ){
+ if( origSize>PENDING_BYTE_PAGE(pBt) && finSize<=PENDING_BYTE_PAGE(pBt) ){
+ finSize--;
+ }
+ while( PTRMAP_ISPAGE(pBt, finSize) || finSize==PENDING_BYTE_PAGE(pBt) ){
finSize--;
- if( PTRMAP_ISPAGE(pBt->usableSize, finSize) ){
- finSize--;
- }
}
TRACE(("AUTOVACUUM: Begin (db size %d->%d)\n", origSize, finSize));
@@ -1891,7 +2415,7 @@ static int autoVacuumCommit(Btree *pBt, Pgno *nTrunc){
*/
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) ){
+ if( PTRMAP_ISPAGE(pBt, iDbPage) || iDbPage==PENDING_BYTE_PAGE(pBt) ){
continue;
}
@@ -1928,6 +2452,12 @@ static int autoVacuumCommit(Btree *pBt, Pgno *nTrunc){
releasePage(pFreeMemPage);
pFreeMemPage = 0;
+ /* Relocate the page into the body of the file. Note that although the
+ ** page has moved within the database file, the pDbMemPage pointer
+ ** remains valid. This means that this function can run without
+ ** invalidating cursors open on the btree. This is important in
+ ** shared-cache mode.
+ */
rc = relocatePage(pBt, pDbMemPage, eType, iPtrPage, iFreePage);
releasePage(pDbMemPage);
if( rc!=SQLITE_OK ) goto autovacuum_out;
@@ -1941,11 +2471,11 @@ static int autoVacuumCommit(Btree *pBt, Pgno *nTrunc){
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;
+ assert( finSize!=PENDING_BYTE_PAGE(pBt) );
autovacuum_out:
- assert( nRef==*sqlite3pager_stats(pPager) );
+ assert( nRef==sqlite3pager_refcount(pPager) );
if( rc!=SQLITE_OK ){
sqlite3pager_rollback(pPager);
}
@@ -1959,15 +2489,47 @@ autovacuum_out:
** 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 ){
+int sqlite3BtreeCommit(Btree *p){
+ BtShared *pBt = p->pBt;
+
+ btreeIntegrity(p);
+
+ /* If the handle has a write-transaction open, commit the shared-btrees
+ ** transaction and set the shared state to TRANS_READ.
+ */
+ if( p->inTrans==TRANS_WRITE ){
+ int rc;
+ assert( pBt->inTransaction==TRANS_WRITE );
+ assert( pBt->nTransaction>0 );
rc = sqlite3pager_commit(pBt->pPager);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ pBt->inTransaction = TRANS_READ;
+ pBt->inStmt = 0;
}
- pBt->inTrans = TRANS_NONE;
- pBt->inStmt = 0;
+ unlockAllTables(p);
+
+ /* If the handle has any kind of transaction open, decrement the transaction
+ ** count of the shared btree. If the transaction count reaches 0, set
+ ** the shared state to TRANS_NONE. The unlockBtreeIfUnused() call below
+ ** will unlock the pager.
+ */
+ if( p->inTrans!=TRANS_NONE ){
+ pBt->nTransaction--;
+ if( 0==pBt->nTransaction ){
+ pBt->inTransaction = TRANS_NONE;
+ }
+ }
+
+ /* Set the handles current transaction state to TRANS_NONE and unlock
+ ** the pager if this call closed the only read or write transaction.
+ */
+ p->inTrans = TRANS_NONE;
unlockBtreeIfUnused(pBt);
- return rc;
+
+ btreeIntegrity(p);
+ return SQLITE_OK;
}
#ifndef NDEBUG
@@ -1976,29 +2538,30 @@ int sqlite3BtreeCommit(Btree *pBt){
** in assert() expressions, so it is only compiled if NDEBUG is not
** defined.
*/
-static int countWriteCursors(Btree *pBt){
+static int countWriteCursors(BtShared *pBt){
BtCursor *pCur;
int r = 0;
for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){
- if( pCur->wrFlag ) r++;
+ if( pCur->wrFlag ) r++;
}
return r;
}
#endif
-#ifdef SQLITE_TEST
+#if defined(SQLITE_TEST) && defined(SQLITE_DEBUG)
/*
** Print debugging information about all cursors to standard output.
*/
-void sqlite3BtreeCursorList(Btree *pBt){
+void sqlite3BtreeCursorList(Btree *p){
BtCursor *pCur;
+ BtShared *pBt = p->pBt;
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"
+ (pCur->eState==CURSOR_VALID) ? "" : " eof"
);
}
}
@@ -2013,11 +2576,41 @@ void sqlite3BtreeCursorList(Btree *pBt){
** 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;
+int sqlite3BtreeRollback(Btree *p){
+ int rc;
+ BtShared *pBt = p->pBt;
MemPage *pPage1;
- if( pBt->inTrans==TRANS_WRITE ){
- rc = sqlite3pager_rollback(pBt->pPager);
+
+ rc = saveAllCursors(pBt, 0, 0);
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ if( rc!=SQLITE_OK ){
+ /* This is a horrible situation. An IO or malloc() error occured whilst
+ ** trying to save cursor positions. If this is an automatic rollback (as
+ ** the result of a constraint, malloc() failure or IO error) then
+ ** the cache may be internally inconsistent (not contain valid trees) so
+ ** we cannot simply return the error to the caller. Instead, abort
+ ** all queries that may be using any of the cursors that failed to save.
+ */
+ while( pBt->pCursor ){
+ sqlite3 *db = pBt->pCursor->pBtree->pSqlite;
+ if( db ){
+ sqlite3AbortOtherActiveVdbes(db, 0);
+ }
+ }
+ }
+#endif
+ btreeIntegrity(p);
+ unlockAllTables(p);
+
+ if( p->inTrans==TRANS_WRITE ){
+ int rc2;
+
+ assert( TRANS_WRITE==pBt->inTransaction );
+ rc2 = sqlite3pager_rollback(pBt->pPager);
+ if( rc2!=SQLITE_OK ){
+ rc = rc2;
+ }
+
/* The rollback may have destroyed the pPage1->aData value. So
** call getPage() on page 1 again to make sure pPage1->aData is
** set correctly. */
@@ -2025,10 +2618,22 @@ int sqlite3BtreeRollback(Btree *pBt){
releasePage(pPage1);
}
assert( countWriteCursors(pBt)==0 );
+ pBt->inTransaction = TRANS_READ;
}
- pBt->inTrans = TRANS_NONE;
+
+ if( p->inTrans!=TRANS_NONE ){
+ assert( pBt->nTransaction>0 );
+ pBt->nTransaction--;
+ if( 0==pBt->nTransaction ){
+ pBt->inTransaction = TRANS_NONE;
+ }
+ }
+
+ p->inTrans = TRANS_NONE;
pBt->inStmt = 0;
unlockBtreeIfUnused(pBt);
+
+ btreeIntegrity(p);
return rc;
}
@@ -2047,11 +2652,13 @@ int sqlite3BtreeRollback(Btree *pBt){
** 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 sqlite3BtreeBeginStmt(Btree *p){
int rc;
- if( (pBt->inTrans!=TRANS_WRITE) || pBt->inStmt ){
+ BtShared *pBt = p->pBt;
+ if( (p->inTrans!=TRANS_WRITE) || pBt->inStmt ){
return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
+ assert( pBt->inTransaction==TRANS_WRITE );
rc = pBt->readOnly ? SQLITE_OK : sqlite3pager_stmt_begin(pBt->pPager);
pBt->inStmt = 1;
return rc;
@@ -2062,8 +2669,9 @@ int sqlite3BtreeBeginStmt(Btree *pBt){
** Commit the statment subtransaction currently in progress. If no
** subtransaction is active, this is a no-op.
*/
-int sqlite3BtreeCommitStmt(Btree *pBt){
+int sqlite3BtreeCommitStmt(Btree *p){
int rc;
+ BtShared *pBt = p->pBt;
if( pBt->inStmt && !pBt->readOnly ){
rc = sqlite3pager_stmt_commit(pBt->pPager);
}else{
@@ -2081,12 +2689,16 @@ int sqlite3BtreeCommitStmt(Btree *pBt){
** 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;
+int sqlite3BtreeRollbackStmt(Btree *p){
+ int rc = SQLITE_OK;
+ BtShared *pBt = p->pBt;
+ sqlite3MallocDisallow();
+ if( pBt->inStmt && !pBt->readOnly ){
+ rc = sqlite3pager_stmt_rollback(pBt->pPager);
+ assert( countWriteCursors(pBt)==0 );
+ pBt->inStmt = 0;
+ }
+ sqlite3MallocAllow();
return rc;
}
@@ -2150,7 +2762,7 @@ static int dfltCompare(
** always ignored for INTKEY tables.
*/
int sqlite3BtreeCursor(
- Btree *pBt, /* The btree */
+ Btree *p, /* 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 */
@@ -2159,6 +2771,7 @@ int sqlite3BtreeCursor(
){
int rc;
BtCursor *pCur;
+ BtShared *pBt = p->pBt;
*ppCur = 0;
if( wrFlag ){
@@ -2169,19 +2782,19 @@ int sqlite3BtreeCursor(
return SQLITE_LOCKED;
}
}
+
if( pBt->pPage1==0 ){
- rc = lockBtreeWithRetry(pBt);
+ rc = lockBtreeWithRetry(p);
if( rc!=SQLITE_OK ){
return rc;
}
}
- pCur = sqliteMallocRaw( sizeof(*pCur) );
+ pCur = sqliteMalloc( 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;
@@ -2190,22 +2803,24 @@ int sqlite3BtreeCursor(
if( rc!=SQLITE_OK ){
goto create_cursor_exception;
}
+
+ /* Now that no other errors can occur, finish filling in the BtCursor
+ ** variables, link the cursor into the BtShared list and set *ppCur (the
+ ** output argument to this function).
+ */
pCur->xCompare = xCmp ? xCmp : dfltCompare;
pCur->pArg = pArg;
- pCur->pBt = pBt;
+ pCur->pBtree = p;
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;
+ pCur->eState = CURSOR_INVALID;
*ppCur = pCur;
- return SQLITE_OK;
+ return SQLITE_OK;
create_cursor_exception:
if( pCur ){
releasePage(pCur->pPage);
@@ -2234,7 +2849,8 @@ void sqlite3BtreeSetCompare(
** when the last cursor is closed.
*/
int sqlite3BtreeCloseCursor(BtCursor *pCur){
- Btree *pBt = pCur->pBt;
+ BtShared *pBt = pCur->pBtree->pBt;
+ restoreOrClearCursorPosition(pCur, 0);
if( pCur->pPrev ){
pCur->pPrev->pNext = pCur->pNext;
}else{
@@ -2301,13 +2917,17 @@ static void getCellInfo(BtCursor *pCur){
** 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;
+ int rc = restoreOrClearCursorPosition(pCur, 1);
+ if( rc==SQLITE_OK ){
+ assert( pCur->eState==CURSOR_INVALID || pCur->eState==CURSOR_VALID );
+ if( pCur->eState==CURSOR_INVALID ){
+ *pSize = 0;
+ }else{
+ getCellInfo(pCur);
+ *pSize = pCur->info.nKey;
+ }
}
- return SQLITE_OK;
+ return rc;
}
/*
@@ -2318,14 +2938,18 @@ int sqlite3BtreeKeySize(BtCursor *pCur, i64 *pSize){
** 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;
+ int rc = restoreOrClearCursorPosition(pCur, 1);
+ if( rc==SQLITE_OK ){
+ assert( pCur->eState==CURSOR_INVALID || pCur->eState==CURSOR_VALID );
+ if( pCur->eState==CURSOR_INVALID ){
+ /* Not pointing at a valid entry - set *pSize to 0. */
+ *pSize = 0;
+ }else{
+ getCellInfo(pCur);
+ *pSize = pCur->info.nData;
+ }
}
- return SQLITE_OK;
+ return rc;
}
/*
@@ -2348,19 +2972,18 @@ static int getPayload(
Pgno nextPage;
int rc;
MemPage *pPage;
- Btree *pBt;
+ BtShared *pBt;
int ovflSize;
u32 nKey;
assert( pCur!=0 && pCur->pPage!=0 );
- assert( pCur->isValid );
- pBt = pCur->pBt;
+ assert( pCur->eState==CURSOR_VALID );
+ pBt = pCur->pBtree->pBt;
pPage = pCur->pPage;
pageIntegrity(pPage);
assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
getCellInfo(pCur);
- aPayload = pCur->info.pCell;
- aPayload += pCur->info.nHeader;
+ aPayload = pCur->info.pCell + pCur->info.nHeader;
if( pPage->intKey ){
nKey = 0;
}else{
@@ -2429,14 +3052,18 @@ static int getPayload(
** 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;
+ int rc = restoreOrClearCursorPosition(pCur, 1);
+ if( rc==SQLITE_OK ){
+ assert( pCur->eState==CURSOR_VALID );
+ 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 );
+ rc = getPayload(pCur, offset, amt, (unsigned char*)pBuf, 0);
}
- assert( pCur->pPage->intKey==0 );
- assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell );
- return getPayload(pCur, offset, amt, (unsigned char*)pBuf, 0);
+ return rc;
}
/*
@@ -2449,10 +3076,14 @@ int sqlite3BtreeKey(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
** 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);
+ int rc = restoreOrClearCursorPosition(pCur, 1);
+ if( rc==SQLITE_OK ){
+ assert( pCur->eState==CURSOR_VALID );
+ assert( pCur->pPage!=0 );
+ assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell );
+ rc = getPayload(pCur, offset, amt, pBuf, 1);
+ }
+ return rc;
}
/*
@@ -2485,7 +3116,7 @@ static const unsigned char *fetchPayload(
int nLocal;
assert( pCur!=0 && pCur->pPage!=0 );
- assert( pCur->isValid );
+ assert( pCur->eState==CURSOR_VALID );
pPage = pCur->pPage;
pageIntegrity(pPage);
assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
@@ -2523,10 +3154,16 @@ static const unsigned char *fetchPayload(
** in the common case where no overflow pages are used.
*/
const void *sqlite3BtreeKeyFetch(BtCursor *pCur, int *pAmt){
- return (const void*)fetchPayload(pCur, pAmt, 0);
+ if( pCur->eState==CURSOR_VALID ){
+ return (const void*)fetchPayload(pCur, pAmt, 0);
+ }
+ return 0;
}
const void *sqlite3BtreeDataFetch(BtCursor *pCur, int *pAmt){
- return (const void*)fetchPayload(pCur, pAmt, 1);
+ if( pCur->eState==CURSOR_VALID ){
+ return (const void*)fetchPayload(pCur, pAmt, 1);
+ }
+ return 0;
}
@@ -2538,9 +3175,9 @@ static int moveToChild(BtCursor *pCur, u32 newPgno){
int rc;
MemPage *pNewPage;
MemPage *pOldPage;
- Btree *pBt = pCur->pBt;
+ BtShared *pBt = pCur->pBtree->pBt;
- assert( pCur->isValid );
+ assert( pCur->eState==CURSOR_VALID );
rc = getAndInitPage(pBt, newPgno, &pNewPage, pCur->pPage);
if( rc ) return rc;
pageIntegrity(pNewPage);
@@ -2587,7 +3224,7 @@ static void moveToParent(BtCursor *pCur){
MemPage *pPage;
int idxParent;
- assert( pCur->isValid );
+ assert( pCur->eState==CURSOR_VALID );
pPage = pCur->pPage;
assert( pPage!=0 );
assert( !isRootPage(pPage) );
@@ -2609,17 +3246,24 @@ static void moveToParent(BtCursor *pCur){
*/
static int moveToRoot(BtCursor *pCur){
MemPage *pRoot;
- int rc;
- Btree *pBt = pCur->pBt;
+ int rc = SQLITE_OK;
+ BtShared *pBt = pCur->pBtree->pBt;
- rc = getAndInitPage(pBt, pCur->pgnoRoot, &pRoot, 0);
- if( rc ){
- pCur->isValid = 0;
- return rc;
+ restoreOrClearCursorPosition(pCur, 0);
+ pRoot = pCur->pPage;
+ if( pRoot && pRoot->pgno==pCur->pgnoRoot ){
+ assert( pRoot->isInit );
+ }else{
+ if(
+ SQLITE_OK!=(rc = getAndInitPage(pBt, pCur->pgnoRoot, &pRoot, 0))
+ ){
+ pCur->eState = CURSOR_INVALID;
+ return rc;
+ }
+ releasePage(pCur->pPage);
+ pageIntegrity(pRoot);
+ pCur->pPage = pRoot;
}
- releasePage(pCur->pPage);
- pageIntegrity(pRoot);
- pCur->pPage = pRoot;
pCur->idx = 0;
pCur->info.nSize = 0;
if( pRoot->nCell==0 && !pRoot->leaf ){
@@ -2627,23 +3271,26 @@ static int moveToRoot(BtCursor *pCur){
assert( pRoot->pgno==1 );
subpage = get4byte(&pRoot->aData[pRoot->hdrOffset+8]);
assert( subpage>0 );
- pCur->isValid = 1;
+ pCur->eState = CURSOR_VALID;
rc = moveToChild(pCur, subpage);
}
- pCur->isValid = pCur->pPage->nCell>0;
+ pCur->eState = ((pCur->pPage->nCell>0)?CURSOR_VALID:CURSOR_INVALID);
return rc;
}
/*
** Move the cursor down to the left-most leaf entry beneath the
** entry to which it is currently pointing.
+**
+** The left-most leaf is the one with the smallest key - the first
+** in ascending order.
*/
static int moveToLeftmost(BtCursor *pCur){
Pgno pgno;
int rc;
MemPage *pPage;
- assert( pCur->isValid );
+ assert( pCur->eState==CURSOR_VALID );
while( !(pPage = pCur->pPage)->leaf ){
assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
pgno = get4byte(findCell(pPage, pCur->idx));
@@ -2659,13 +3306,16 @@ static int moveToLeftmost(BtCursor *pCur){
** between moveToLeftmost() and moveToRightmost(). moveToLeftmost()
** finds the left-most entry beneath the *entry* whereas moveToRightmost()
** finds the right-most entry beneath the *page*.
+**
+** The right-most entry is the one with the largest key - the last
+** key in ascending order.
*/
static int moveToRightmost(BtCursor *pCur){
Pgno pgno;
int rc;
MemPage *pPage;
- assert( pCur->isValid );
+ assert( pCur->eState==CURSOR_VALID );
while( !(pPage = pCur->pPage)->leaf ){
pgno = get4byte(&pPage->aData[pPage->hdrOffset+8]);
pCur->idx = pPage->nCell;
@@ -2685,7 +3335,7 @@ int sqlite3BtreeFirst(BtCursor *pCur, int *pRes){
int rc;
rc = moveToRoot(pCur);
if( rc ) return rc;
- if( pCur->isValid==0 ){
+ if( pCur->eState==CURSOR_INVALID ){
assert( pCur->pPage->nCell==0 );
*pRes = 1;
return SQLITE_OK;
@@ -2704,12 +3354,12 @@ int sqlite3BtreeLast(BtCursor *pCur, int *pRes){
int rc;
rc = moveToRoot(pCur);
if( rc ) return rc;
- if( pCur->isValid==0 ){
+ if( CURSOR_INVALID==pCur->eState ){
assert( pCur->pPage->nCell==0 );
*pRes = 1;
return SQLITE_OK;
}
- assert( pCur->isValid );
+ assert( pCur->eState==CURSOR_VALID );
*pRes = 0;
rc = moveToRightmost(pCur);
return rc;
@@ -2720,7 +3370,7 @@ int sqlite3BtreeLast(BtCursor *pCur, int *pRes){
**
** 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
+** in pKey. 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
@@ -2744,11 +3394,13 @@ int sqlite3BtreeLast(BtCursor *pCur, int *pRes){
*/
int sqlite3BtreeMoveto(BtCursor *pCur, const void *pKey, i64 nKey, int *pRes){
int rc;
+ int tryRightmost;
rc = moveToRoot(pCur);
if( rc ) return rc;
assert( pCur->pPage );
assert( pCur->pPage->isInit );
- if( pCur->isValid==0 ){
+ tryRightmost = pCur->pPage->intKey;
+ if( pCur->eState==CURSOR_INVALID ){
*pRes = -1;
assert( pCur->pPage->nCell==0 );
return SQLITE_OK;
@@ -2769,18 +3421,29 @@ int sqlite3BtreeMoveto(BtCursor *pCur, const void *pKey, i64 nKey, int *pRes){
i64 nCellKey;
pCur->idx = (lwr+upr)/2;
pCur->info.nSize = 0;
- sqlite3BtreeKeySize(pCur, &nCellKey);
if( pPage->intKey ){
+ u8 *pCell;
+ if( tryRightmost ){
+ pCur->idx = upr;
+ }
+ pCell = findCell(pPage, pCur->idx) + pPage->childPtrSize;
+ if( pPage->hasData ){
+ u32 dummy;
+ pCell += getVarint32(pCell, &dummy);
+ }
+ getVarint(pCell, (u64 *)&nCellKey);
if( nCellKey<nKey ){
c = -1;
}else if( nCellKey>nKey ){
c = +1;
+ tryRightmost = 0;
}else{
c = 0;
}
}else{
int available;
pCellKey = (void *)fetchPayload(pCur, &available, 0);
+ nCellKey = pCur->info.nKey;
if( available>=nCellKey ){
c = pCur->xCompare(pCur->pArg, nCellKey, pCellKey, nKey, pKey);
}else{
@@ -2840,7 +3503,11 @@ int sqlite3BtreeMoveto(BtCursor *pCur, const void *pKey, i64 nKey, int *pRes){
** the first entry. TRUE is also returned if the table is empty.
*/
int sqlite3BtreeEof(BtCursor *pCur){
- return pCur->isValid==0;
+ /* TODO: What if the cursor is in CURSOR_REQUIRESEEK but all table entries
+ ** have been deleted? This API will need to change to return an error code
+ ** as well as the boolean result value.
+ */
+ return (CURSOR_VALID!=pCur->eState);
}
/*
@@ -2851,10 +3518,24 @@ int sqlite3BtreeEof(BtCursor *pCur){
*/
int sqlite3BtreeNext(BtCursor *pCur, int *pRes){
int rc;
- MemPage *pPage = pCur->pPage;
+ MemPage *pPage;
+
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ rc = restoreOrClearCursorPosition(pCur, 1);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ if( pCur->skip>0 ){
+ pCur->skip = 0;
+ *pRes = 0;
+ return SQLITE_OK;
+ }
+ pCur->skip = 0;
+#endif
assert( pRes!=0 );
- if( pCur->isValid==0 ){
+ pPage = pCur->pPage;
+ if( CURSOR_INVALID==pCur->eState ){
*pRes = 1;
return SQLITE_OK;
}
@@ -2874,7 +3555,7 @@ int sqlite3BtreeNext(BtCursor *pCur, int *pRes){
do{
if( isRootPage(pPage) ){
*pRes = 1;
- pCur->isValid = 0;
+ pCur->eState = CURSOR_INVALID;
return SQLITE_OK;
}
moveToParent(pCur);
@@ -2906,7 +3587,21 @@ int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
int rc;
Pgno pgno;
MemPage *pPage;
- if( pCur->isValid==0 ){
+
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ rc = restoreOrClearCursorPosition(pCur, 1);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ if( pCur->skip<0 ){
+ pCur->skip = 0;
+ *pRes = 0;
+ return SQLITE_OK;
+ }
+ pCur->skip = 0;
+#endif
+
+ if( CURSOR_INVALID==pCur->eState ){
*pRes = 1;
return SQLITE_OK;
}
@@ -2922,7 +3617,7 @@ int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
}else{
while( pCur->idx==0 ){
if( isRootPage(pPage) ){
- pCur->isValid = 0;
+ pCur->eState = CURSOR_INVALID;
*pRes = 1;
return SQLITE_OK;
}
@@ -2963,7 +3658,7 @@ int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
** is only used by auto-vacuum databases when allocating a new table.
*/
static int allocatePage(
- Btree *pBt,
+ BtShared *pBt,
MemPage **ppPage,
Pgno *pPgno,
Pgno nearby,
@@ -3150,7 +3845,7 @@ static int allocatePage(
*pPgno = sqlite3pager_pagecount(pBt->pPager) + 1;
#ifndef SQLITE_OMIT_AUTOVACUUM
- if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt->usableSize, *pPgno) ){
+ if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt, *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.
@@ -3181,7 +3876,7 @@ static int allocatePage(
** sqlite3pager_unref() is NOT called for pPage.
*/
static int freePage(MemPage *pPage){
- Btree *pBt = pPage->pBt;
+ BtShared *pBt = pPage->pBt;
MemPage *pPage1 = pBt->pPage1;
int rc, n, k;
@@ -3197,6 +3892,15 @@ static int freePage(MemPage *pPage){
n = get4byte(&pPage1->aData[36]);
put4byte(&pPage1->aData[36], n+1);
+#ifdef SQLITE_SECURE_DELETE
+ /* If the SQLITE_SECURE_DELETE compile-time option is enabled, then
+ ** always fully overwrite deleted information with zeros.
+ */
+ rc = sqlite3pager_write(pPage->aData);
+ if( rc ) return rc;
+ memset(pPage->aData, 0, pPage->pBt->pageSize);
+#endif
+
#ifndef SQLITE_OMIT_AUTOVACUUM
/* If the database supports auto-vacuum, write an entry in the pointer-map
** to indicate that the page is free.
@@ -3237,7 +3941,9 @@ static int freePage(MemPage *pPage){
if( rc ) return rc;
put4byte(&pTrunk->aData[4], k+1);
put4byte(&pTrunk->aData[8+k*4], pPage->pgno);
+#ifndef SQLITE_SECURE_DELETE
sqlite3pager_dont_write(pBt->pPager, pPage->pgno);
+#endif
TRACE(("FREE-PAGE: %d leaf on trunk page %d\n",pPage->pgno,pTrunk->pgno));
}
releasePage(pTrunk);
@@ -3249,7 +3955,7 @@ static int freePage(MemPage *pPage){
** Free any overflow pages associated with the given Cell.
*/
static int clearCell(MemPage *pPage, unsigned char *pCell){
- Btree *pBt = pPage->pBt;
+ BtShared *pBt = pPage->pBt;
CellInfo info;
Pgno ovflPgno;
int rc;
@@ -3301,7 +4007,7 @@ static int fillInCell(
MemPage *pToRelease = 0;
unsigned char *pPrior;
unsigned char *pPayload;
- Btree *pBt = pPage->pBt;
+ BtShared *pBt = pPage->pBt;
Pgno pgnoOvfl = 0;
int nHeader;
CellInfo info;
@@ -3370,6 +4076,7 @@ static int fillInCell(
n = nPayload;
if( n>spaceLeft ) n = spaceLeft;
if( n>nSrc ) n = nSrc;
+ assert( pSrc );
memcpy(pPayload, pSrc, n);
nPayload -= n;
pPayload += n;
@@ -3390,10 +4097,11 @@ static int fillInCell(
** 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){
+static int reparentPage(BtShared *pBt, Pgno pgno, MemPage *pNewParent, int idx){
MemPage *pThis;
unsigned char *aData;
+ assert( pNewParent!=0 );
if( pgno==0 ) return SQLITE_OK;
assert( pBt->pPager!=0 );
aData = sqlite3pager_lookup(pBt->pPager, pgno);
@@ -3404,7 +4112,7 @@ static int reparentPage(Btree *pBt, Pgno pgno, MemPage *pNewParent, int idx){
if( pThis->pParent!=pNewParent ){
if( pThis->pParent ) sqlite3pager_unref(pThis->pParent->aData);
pThis->pParent = pNewParent;
- if( pNewParent ) sqlite3pager_ref(pNewParent->aData);
+ sqlite3pager_ref(pNewParent->aData);
}
pThis->idxParent = idx;
}
@@ -3433,7 +4141,7 @@ static int reparentPage(Btree *pBt, Pgno pgno, MemPage *pNewParent, int idx){
*/
static int reparentChildPages(MemPage *pPage){
int i;
- Btree *pBt = pPage->pBt;
+ BtShared *pBt = pPage->pBt;
int rc = SQLITE_OK;
if( pPage->leaf ) return SQLITE_OK;
@@ -3666,7 +4374,7 @@ static int balance_quick(MemPage *pPage, MemPage *pParent){
u8 *pCell;
int szCell;
CellInfo info;
- Btree *pBt = pPage->pBt;
+ BtShared *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 */
@@ -3775,7 +4483,7 @@ static int balance_quick(MemPage *pPage, MemPage *pParent){
*/
static int balance_nonroot(MemPage *pPage){
MemPage *pParent; /* The parent of pPage */
- Btree *pBt; /* The whole database */
+ BtShared *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[] */
@@ -3796,7 +4504,6 @@ static int balance_nonroot(MemPage *pPage){
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 */
@@ -3815,8 +4522,10 @@ static int balance_nonroot(MemPage *pPage){
assert( sqlite3pager_iswriteable(pPage->aData) );
pBt = pPage->pBt;
pParent = pPage->pParent;
- sqlite3pager_write(pParent->aData);
assert( pParent );
+ if( SQLITE_OK!=(rc = sqlite3pager_write(pParent->aData)) ){
+ return rc;
+ }
TRACE(("BALANCE: begin page %d child of %d\n", pPage->pgno, pParent->pgno));
#ifndef SQLITE_OMIT_QUICKBALANCE
@@ -3888,7 +4597,6 @@ static int balance_nonroot(MemPage *pPage){
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 );
@@ -4117,6 +4825,7 @@ static int balance_nonroot(MemPage *pPage){
rc = sqlite3pager_write(pNew->aData);
if( rc ) goto balance_cleanup;
}else{
+ assert( i>0 );
rc = allocatePage(pBt, &pNew, &pgnoNew[i], pgnoNew[i-1], 0);
if( rc ) goto balance_cleanup;
apNew[i] = pNew;
@@ -4268,6 +4977,8 @@ static int balance_nonroot(MemPage *pPage){
}
}
assert( j==nCell );
+ assert( nOld>0 );
+ assert( nNew>0 );
if( (pageFlags & PTF_LEAF)==0 ){
memcpy(&apNew[nNew-1]->aData[8], &apCopy[nOld-1]->aData[8], 4);
}
@@ -4326,7 +5037,7 @@ 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 */
+ BtShared *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 */
@@ -4428,7 +5139,7 @@ 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 */
+ BtShared *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 */
@@ -4517,10 +5228,12 @@ static int balance(MemPage *pPage, int insert){
** 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){
+static int checkReadLocks(BtShared *pBt, Pgno pgnoRoot, BtCursor *pExclude){
BtCursor *p;
for(p=pBt->pCursor; p; p=p->pNext){
+ u32 flags = (p->pBtree->pSqlite ? p->pBtree->pSqlite->flags : 0);
if( p->pgnoRoot!=pgnoRoot || p==pExclude ) continue;
+ if( p->wrFlag==0 && flags&SQLITE_ReadUncommitted ) continue;
if( p->wrFlag==0 ) return SQLITE_LOCKED;
if( p->pPage->pgno!=p->pgnoRoot ){
moveToRoot(p);
@@ -4547,11 +5260,11 @@ int sqlite3BtreeInsert(
int loc;
int szNew;
MemPage *pPage;
- Btree *pBt = pCur->pBt;
+ BtShared *pBt = pCur->pBtree->pBt;
unsigned char *oldCell;
unsigned char *newCell = 0;
- if( pBt->inTrans!=TRANS_WRITE ){
+ if( pBt->inTransaction!=TRANS_WRITE ){
/* Must start a transaction before doing an insert */
return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
@@ -4562,8 +5275,16 @@ int sqlite3BtreeInsert(
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;
+
+ /* Save the positions of any other cursors open on this table */
+ restoreOrClearCursorPosition(pCur, 0);
+ if(
+ SQLITE_OK!=(rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur)) ||
+ SQLITE_OK!=(rc = sqlite3BtreeMoveto(pCur, pKey, nKey, &loc))
+ ){
+ return rc;
+ }
+
pPage = pCur->pPage;
assert( pPage->intKey || nKey>=0 );
assert( pPage->leaf || !pPage->leafData );
@@ -4579,7 +5300,7 @@ int sqlite3BtreeInsert(
if( rc ) goto end_insert;
assert( szNew==cellSizePtr(pPage, newCell) );
assert( szNew<=MX_CELL_SIZE(pBt) );
- if( loc==0 && pCur->isValid ){
+ if( loc==0 && CURSOR_VALID==pCur->eState ){
int szOld;
assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
oldCell = findCell(pPage, pCur->idx);
@@ -4619,10 +5340,10 @@ int sqlite3BtreeDelete(BtCursor *pCur){
unsigned char *pCell;
int rc;
Pgno pgnoChild = 0;
- Btree *pBt = pCur->pBt;
+ BtShared *pBt = pCur->pBtree->pBt;
assert( pPage->isInit );
- if( pBt->inTrans!=TRANS_WRITE ){
+ if( pBt->inTransaction!=TRANS_WRITE ){
/* Must start a transaction before doing a delete */
return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
@@ -4636,8 +5357,19 @@ int sqlite3BtreeDelete(BtCursor *pCur){
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;
+
+ /* Restore the current cursor position (a no-op if the cursor is not in
+ ** CURSOR_REQUIRESEEK state) and save the positions of any other cursors
+ ** open on the same table. Then call sqlite3pager_write() on the page
+ ** that the entry will be deleted from.
+ */
+ if(
+ (rc = restoreOrClearCursorPosition(pCur, 1))!=0 ||
+ (rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur))!=0 ||
+ (rc = sqlite3pager_write(pPage->aData))!=0
+ ){
+ 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
@@ -4660,7 +5392,9 @@ int sqlite3BtreeDelete(BtCursor *pCur){
*/
BtCursor leafCur;
unsigned char *pNext;
- int szNext;
+ int szNext; /* The compiler warning is wrong: szNext is always
+ ** initialized before use. Adding an extra initialization
+ ** to silence the compiler slows down the code. */
int notUsed;
unsigned char *tempCell = 0;
assert( !pPage->leafData );
@@ -4722,11 +5456,12 @@ int sqlite3BtreeDelete(BtCursor *pCur){
** 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){
+int sqlite3BtreeCreateTable(Btree *p, int *piTable, int flags){
+ BtShared *pBt = p->pBt;
MemPage *pRoot;
Pgno pgnoRoot;
int rc;
- if( pBt->inTrans!=TRANS_WRITE ){
+ if( pBt->inTransaction!=TRANS_WRITE ){
/* Must start a transaction first */
return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
@@ -4753,14 +5488,14 @@ int sqlite3BtreeCreateTable(Btree *pBt, int *piTable, int flags){
** 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);
+ rc = sqlite3BtreeGetMeta(p, 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) ||
+ if( pgnoRoot==PTRMAP_PAGENO(pBt, pgnoRoot) ||
pgnoRoot==PENDING_BYTE_PAGE(pBt) ){
pgnoRoot++;
}
@@ -4820,7 +5555,7 @@ int sqlite3BtreeCreateTable(Btree *pBt, int *piTable, int flags){
releasePage(pRoot);
return rc;
}
- rc = sqlite3BtreeUpdateMeta(pBt, 4, pgnoRoot);
+ rc = sqlite3BtreeUpdateMeta(p, 4, pgnoRoot);
if( rc ){
releasePage(pRoot);
return rc;
@@ -4843,7 +5578,7 @@ int sqlite3BtreeCreateTable(Btree *pBt, int *piTable, int flags){
** the page to the freelist.
*/
static int clearDatabasePage(
- Btree *pBt, /* The BTree that contains the table */
+ BtShared *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 */
@@ -4894,23 +5629,35 @@ cleardatabasepage_out:
** read cursors on the table. Open write cursors are moved to the
** root of the table.
*/
-int sqlite3BtreeClearTable(Btree *pBt, int iTable){
+int sqlite3BtreeClearTable(Btree *p, int iTable){
int rc;
BtCursor *pCur;
- if( pBt->inTrans!=TRANS_WRITE ){
+ BtShared *pBt = p->pBt;
+ sqlite3 *db = p->pSqlite;
+ if( p->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);
+
+ /* If this connection is not in read-uncommitted mode and currently has
+ ** a read-cursor open on the table being cleared, return SQLITE_LOCKED.
+ */
+ if( 0==db || 0==(db->flags&SQLITE_ReadUncommitted) ){
+ for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){
+ if( pCur->pBtree==p && pCur->pgnoRoot==(Pgno)iTable ){
+ if( 0==pCur->wrFlag ){
+ return SQLITE_LOCKED;
+ }
+ moveToRoot(pCur);
+ }
}
}
- rc = clearDatabasePage(pBt, (Pgno)iTable, 0, 0);
- if( rc ){
- sqlite3BtreeRollback(pBt);
+
+ /* Save the position of all cursors open on this table */
+ if( SQLITE_OK!=(rc = saveAllCursors(pBt, iTable, 0)) ){
+ return rc;
}
- return rc;
+
+ return clearDatabasePage(pBt, (Pgno)iTable, 0, 0);
}
/*
@@ -4933,11 +5680,12 @@ int sqlite3BtreeClearTable(Btree *pBt, int iTable){
** 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 sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){
int rc;
MemPage *pPage = 0;
+ BtShared *pBt = p->pBt;
- if( pBt->inTrans!=TRANS_WRITE ){
+ if( p->inTrans!=TRANS_WRITE ){
return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
@@ -4953,7 +5701,7 @@ int sqlite3BtreeDropTable(Btree *pBt, int iTable, int *piMoved){
rc = getPage(pBt, (Pgno)iTable, &pPage);
if( rc ) return rc;
- rc = sqlite3BtreeClearTable(pBt, iTable);
+ rc = sqlite3BtreeClearTable(p, iTable);
if( rc ){
releasePage(pPage);
return rc;
@@ -4968,7 +5716,7 @@ int sqlite3BtreeDropTable(Btree *pBt, int iTable, int *piMoved){
#else
if( pBt->autoVacuum ){
Pgno maxRootPgno;
- rc = sqlite3BtreeGetMeta(pBt, 4, &maxRootPgno);
+ rc = sqlite3BtreeGetMeta(p, 4, &maxRootPgno);
if( rc!=SQLITE_OK ){
releasePage(pPage);
return rc;
@@ -5020,12 +5768,12 @@ int sqlite3BtreeDropTable(Btree *pBt, int iTable, int *piMoved){
if( maxRootPgno==PENDING_BYTE_PAGE(pBt) ){
maxRootPgno--;
}
- if( maxRootPgno==PTRMAP_PAGENO(pBt->usableSize, maxRootPgno) ){
+ if( maxRootPgno==PTRMAP_PAGENO(pBt, maxRootPgno) ){
maxRootPgno--;
}
assert( maxRootPgno!=PENDING_BYTE_PAGE(pBt) );
- rc = sqlite3BtreeUpdateMeta(pBt, 4, maxRootPgno);
+ rc = sqlite3BtreeUpdateMeta(p, 4, maxRootPgno);
}else{
rc = freePage(pPage);
releasePage(pPage);
@@ -5050,9 +5798,20 @@ int sqlite3BtreeDropTable(Btree *pBt, int iTable, int *piMoved){
** 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 sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){
int rc;
unsigned char *pP1;
+ BtShared *pBt = p->pBt;
+
+ /* Reading a meta-data value requires a read-lock on page 1 (and hence
+ ** the sqlite_master table. We grab this lock regardless of whether or
+ ** not the SQLITE_ReadUncommitted flag is set (the table rooted at page
+ ** 1 is treated as a special case by queryTableLock() and lockTable()).
+ */
+ rc = queryTableLock(p, 1, READ_LOCK);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
assert( idx>=0 && idx<=15 );
rc = sqlite3pager_get(pBt->pPager, 1, (void**)&pP1);
@@ -5067,18 +5826,21 @@ int sqlite3BtreeGetMeta(Btree *pBt, int idx, u32 *pMeta){
if( idx==4 && *pMeta>0 ) pBt->readOnly = 1;
#endif
- return SQLITE_OK;
+ /* Grab the read-lock on page 1. */
+ rc = lockTable(p, 1, READ_LOCK);
+ return rc;
}
/*
** 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){
+int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){
+ BtShared *pBt = p->pBt;
unsigned char *pP1;
int rc;
assert( idx>=1 && idx<=15 );
- if( pBt->inTrans!=TRANS_WRITE ){
+ if( p->inTrans!=TRANS_WRITE ){
return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;
}
assert( pBt->pPage1!=0 );
@@ -5094,6 +5856,9 @@ int sqlite3BtreeUpdateMeta(Btree *pBt, int idx, u32 iMeta){
** is currently pointing to.
*/
int sqlite3BtreeFlags(BtCursor *pCur){
+ /* TODO: What about CURSOR_REQUIRESEEK state? Probably need to call
+ ** restoreOrClearCursorPosition() here.
+ */
MemPage *pPage = pCur->pPage;
return pPage ? pPage->aData[pPage->hdrOffset] : 0;
}
@@ -5103,7 +5868,7 @@ int sqlite3BtreeFlags(BtCursor *pCur){
** 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){
+static int btreePageDump(BtShared *pBt, int pgno, int recursive, MemPage *pParent){
int rc;
MemPage *pPage;
int i, j, c;
@@ -5199,12 +5964,12 @@ static int btreePageDump(Btree *pBt, int pgno, int recursive, MemPage *pParent){
fflush(stdout);
return SQLITE_OK;
}
-int sqlite3BtreePageDump(Btree *pBt, int pgno, int recursive){
- return btreePageDump(pBt, pgno, recursive, 0);
+int sqlite3BtreePageDump(Btree *p, int pgno, int recursive){
+ return btreePageDump(p->pBt, pgno, recursive, 0);
}
#endif
-#ifdef SQLITE_TEST
+#if defined(SQLITE_TEST) && defined(SQLITE_DEBUG)
/*
** Fill aResult[] with information about the entry and page that the
** cursor is pointing to.
@@ -5227,6 +5992,11 @@ int sqlite3BtreeCursorInfo(BtCursor *pCur, int *aResult, int upCnt){
MemPage *pPage = pCur->pPage;
BtCursor tmpCur;
+ int rc = restoreOrClearCursorPosition(pCur, 1);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+
pageIntegrity(pPage);
assert( pPage->isInit );
getTempCursor(pCur, &tmpCur);
@@ -5273,8 +6043,8 @@ int sqlite3BtreeCursorInfo(BtCursor *pCur, int *aResult, int upCnt){
** Return the pager associated with a BTree. This routine is used for
** testing and debugging only.
*/
-Pager *sqlite3BtreePager(Btree *pBt){
- return pBt->pPager;
+Pager *sqlite3BtreePager(Btree *p){
+ return p->pBt->pPager;
}
/*
@@ -5283,7 +6053,7 @@ Pager *sqlite3BtreePager(Btree *pBt){
*/
typedef struct IntegrityCk IntegrityCk;
struct IntegrityCk {
- Btree *pBt; /* The tree being checked out */
+ BtShared *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 */
@@ -5463,19 +6233,14 @@ 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 */
+ char *zParentContext /* Parent context */
){
MemPage *pPage;
int i, rc, depth, d2, pgno, cnt;
int hdr, cellStart;
int nCell;
u8 *data;
- BtCursor cur;
- Btree *pBt;
+ BtShared *pBt;
int usableSize;
char zContext[100];
char *hit;
@@ -5484,7 +6249,7 @@ static int checkTreePage(
/* Check that the page exists
*/
- cur.pBt = pBt = pCheck->pBt;
+ pBt = pCheck->pBt;
usableSize = pBt->usableSize;
if( iPage==0 ) return 0;
if( checkRef(pCheck, iPage, zParentContext) ) return 0;
@@ -5502,7 +6267,6 @@ static int checkTreePage(
/* Check out all the cells.
*/
depth = 0;
- cur.pPage = pPage;
for(i=0; i<pPage->nCell; i++){
u8 *pCell;
int sz;
@@ -5535,7 +6299,7 @@ static int checkTreePage(
checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, zContext);
}
#endif
- d2 = checkTreePage(pCheck,pgno,pPage,zContext,0,0,0,0);
+ d2 = checkTreePage(pCheck,pgno,pPage,zContext);
if( i>0 && d2!=depth ){
checkAppendMsg(pCheck, zContext, "Child page depth differs");
}
@@ -5550,7 +6314,7 @@ static int checkTreePage(
checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, 0);
}
#endif
- checkTreePage(pCheck, pgno, pPage, zContext,0,0,0,0);
+ checkTreePage(pCheck, pgno, pPage, zContext);
}
/* Check for complete coverage of the page
@@ -5618,13 +6382,14 @@ static int checkTreePage(
** 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){
+char *sqlite3BtreeIntegrityCheck(Btree *p, int *aRoot, int nRoot){
int i;
int nRef;
IntegrityCk sCheck;
+ BtShared *pBt = p->pBt;
- nRef = *sqlite3pager_stats(pBt->pPager);
- if( lockBtreeWithRetry(pBt)!=SQLITE_OK ){
+ nRef = sqlite3pager_refcount(pBt->pPager);
+ if( lockBtreeWithRetry(p)!=SQLITE_OK ){
return sqliteStrDup("Unable to acquire a read lock on the database");
}
sCheck.pBt = pBt;
@@ -5661,7 +6426,7 @@ char *sqlite3BtreeIntegrityCheck(Btree *pBt, int *aRoot, int nRoot){
checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0, 0);
}
#endif
- checkTreePage(&sCheck, aRoot[i], 0, "List of tree roots: ", 0,0,0,0);
+ checkTreePage(&sCheck, aRoot[i], 0, "List of tree roots: ");
}
/* Make sure every page in the file is referenced
@@ -5676,11 +6441,11 @@ char *sqlite3BtreeIntegrityCheck(Btree *pBt, int *aRoot, int nRoot){
** references to pointer-map pages.
*/
if( sCheck.anRef[i]==0 &&
- (PTRMAP_PAGENO(pBt->usableSize, i)!=i || !pBt->autoVacuum) ){
+ (PTRMAP_PAGENO(pBt, 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) ){
+ (PTRMAP_PAGENO(pBt, i)==i && pBt->autoVacuum) ){
checkAppendMsg(&sCheck, 0, "Pointer map page %d is referenced", i);
}
#endif
@@ -5689,10 +6454,10 @@ char *sqlite3BtreeIntegrityCheck(Btree *pBt, int *aRoot, int nRoot){
/* Make sure this analysis did not leave any unref() pages
*/
unlockBtreeIfUnused(pBt);
- if( nRef != *sqlite3pager_stats(pBt->pPager) ){
+ if( nRef != sqlite3pager_refcount(pBt->pPager) ){
checkAppendMsg(&sCheck, 0,
"Outstanding page count goes from %d to %d during this analysis",
- nRef, *sqlite3pager_stats(pBt->pPager)
+ nRef, sqlite3pager_refcount(pBt->pPager)
);
}
@@ -5706,17 +6471,17 @@ char *sqlite3BtreeIntegrityCheck(Btree *pBt, int *aRoot, int nRoot){
/*
** Return the full pathname of the underlying database file.
*/
-const char *sqlite3BtreeGetFilename(Btree *pBt){
- assert( pBt->pPager!=0 );
- return sqlite3pager_filename(pBt->pPager);
+const char *sqlite3BtreeGetFilename(Btree *p){
+ assert( p->pBt->pPager!=0 );
+ return sqlite3pager_filename(p->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);
+const char *sqlite3BtreeGetDirname(Btree *p){
+ assert( p->pBt->pPager!=0 );
+ return sqlite3pager_dirname(p->pBt->pPager);
}
/*
@@ -5724,9 +6489,9 @@ const char *sqlite3BtreeGetDirname(Btree *pBt){
** 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);
+const char *sqlite3BtreeGetJournalname(Btree *p){
+ assert( p->pBt->pPager!=0 );
+ return sqlite3pager_journalname(p->pBt->pPager);
}
#ifndef SQLITE_OMIT_VACUUM
@@ -5737,11 +6502,14 @@ const char *sqlite3BtreeGetJournalname(Btree *pBt){
** 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 sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){
int rc = SQLITE_OK;
Pgno i, nPage, nToPage, iSkip;
- if( pBtTo->inTrans!=TRANS_WRITE || pBtFrom->inTrans!=TRANS_WRITE ){
+ BtShared *pBtTo = pTo->pBt;
+ BtShared *pBtFrom = pFrom->pBt;
+
+ if( pTo->inTrans!=TRANS_WRITE || pFrom->inTrans!=TRANS_WRITE ){
return SQLITE_ERROR;
}
if( pBtTo->pCursor ) return SQLITE_BUSY;
@@ -5770,7 +6538,7 @@ int sqlite3BtreeCopyFile(Btree *pBtTo, Btree *pBtFrom){
rc = sqlite3pager_truncate(pBtTo->pPager, nPage);
}
if( rc ){
- sqlite3BtreeRollback(pBtTo);
+ sqlite3BtreeRollback(pTo);
}
return rc;
}
@@ -5779,15 +6547,22 @@ int sqlite3BtreeCopyFile(Btree *pBtTo, Btree *pBtFrom){
/*
** Return non-zero if a transaction is active.
*/
-int sqlite3BtreeIsInTrans(Btree *pBt){
- return (pBt && (pBt->inTrans==TRANS_WRITE));
+int sqlite3BtreeIsInTrans(Btree *p){
+ return (p && (p->inTrans==TRANS_WRITE));
}
/*
** Return non-zero if a statement transaction is active.
*/
-int sqlite3BtreeIsInStmt(Btree *pBt){
- return (pBt && pBt->inStmt);
+int sqlite3BtreeIsInStmt(Btree *p){
+ return (p->pBt && p->pBt->inStmt);
+}
+
+/*
+** Return non-zero if a read (or write) transaction is active.
+*/
+int sqlite3BtreeIsInReadTrans(Btree *p){
+ return (p && (p->inTrans!=TRANS_NONE));
}
/*
@@ -5804,30 +6579,101 @@ int sqlite3BtreeIsInStmt(Btree *pBt){
** 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
+int sqlite3BtreeSync(Btree *p, const char *zMaster){
+ int rc = SQLITE_OK;
+ if( p->inTrans==TRANS_WRITE ){
+ BtShared *pBt = p->pBt;
Pgno nTrunc = 0;
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( pBt->autoVacuum ){
- int rc = autoVacuumCommit(pBt, &nTrunc);
- if( rc!=SQLITE_OK ) return rc;
+ 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);
+ rc = sqlite3pager_sync(pBt->pPager, zMaster, nTrunc);
}
- return SQLITE_OK;
+ return rc;
+}
+
+/*
+** This function returns a pointer to a blob of memory associated with
+** a single shared-btree. The memory is used by client code for it's own
+** purposes (for example, to store a high-level schema associated with
+** the shared-btree). The btree layer manages reference counting issues.
+**
+** The first time this is called on a shared-btree, nBytes bytes of memory
+** are allocated, zeroed, and returned to the caller. For each subsequent
+** call the nBytes parameter is ignored and a pointer to the same blob
+** of memory returned.
+**
+** Just before the shared-btree is closed, the function passed as the
+** xFree argument when the memory allocation was made is invoked on the
+** blob of allocated memory. This function should not call sqliteFree()
+** on the memory, the btree layer does that.
+*/
+void *sqlite3BtreeSchema(Btree *p, int nBytes, void(*xFree)(void *)){
+ BtShared *pBt = p->pBt;
+ if( !pBt->pSchema ){
+ pBt->pSchema = sqliteMalloc(nBytes);
+ pBt->xFreeSchema = xFree;
+ }
+ return pBt->pSchema;
}
-#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.
+** Return true if another user of the same shared btree as the argument
+** handle holds an exclusive lock on the sqlite_master table.
*/
-int sqlite3BtreeReset(Btree *pBt){
- if( pBt->pCursor ) return SQLITE_BUSY;
- pBt->inTrans = TRANS_NONE;
- unlockBtreeIfUnused(pBt);
- return sqlite3pager_reset(pBt->pPager);
+int sqlite3BtreeSchemaLocked(Btree *p){
+ return (queryTableLock(p, MASTER_ROOT, READ_LOCK)!=SQLITE_OK);
+}
+
+
+#ifndef SQLITE_OMIT_SHARED_CACHE
+/*
+** Obtain a lock on the table whose root page is iTab. The
+** lock is a write lock if isWritelock is true or a read lock
+** if it is false.
+*/
+int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){
+ int rc = SQLITE_OK;
+ u8 lockType = (isWriteLock?WRITE_LOCK:READ_LOCK);
+ rc = queryTableLock(p, iTab, lockType);
+ if( rc==SQLITE_OK ){
+ rc = lockTable(p, iTab, lockType);
+ }
+ return rc;
+}
+#endif
+
+/*
+** The following debugging interface has to be in this file (rather
+** than in, for example, test1.c) so that it can get access to
+** the definition of BtShared.
+*/
+#if defined(SQLITE_DEBUG) && defined(TCLSH)
+#include <tcl.h>
+int sqlite3_shared_cache_report(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ const ThreadData *pTd = sqlite3ThreadDataReadOnly();
+ if( pTd->useSharedData ){
+ BtShared *pBt;
+ Tcl_Obj *pRet = Tcl_NewObj();
+ for(pBt=pTd->pBtree; pBt; pBt=pBt->pNext){
+ const char *zFile = sqlite3pager_filename(pBt->pPager);
+ Tcl_ListObjAppendElement(interp, pRet, Tcl_NewStringObj(zFile, -1));
+ Tcl_ListObjAppendElement(interp, pRet, Tcl_NewIntObj(pBt->nRef));
+ }
+ Tcl_SetObjResult(interp, pRet);
+ }
+#endif
+ return TCL_OK;
}
#endif
diff --git a/ext/pdo_sqlite/sqlite/src/btree.h b/ext/pdo_sqlite/sqlite/src/btree.h
index 9d4401ac8..896ebf11b 100644
--- a/ext/pdo_sqlite/sqlite/src/btree.h
+++ b/ext/pdo_sqlite/sqlite/src/btree.h
@@ -36,10 +36,12 @@
*/
typedef struct Btree Btree;
typedef struct BtCursor BtCursor;
+typedef struct BtShared BtShared;
int sqlite3BtreeOpen(
const char *zFilename, /* Name of database file to open */
+ sqlite3 *db, /* Associated database connection */
Btree **, /* Return open Btree* here */
int flags /* Flags */
);
@@ -57,7 +59,7 @@ int sqlite3BtreeOpen(
int sqlite3BtreeClose(Btree*);
int sqlite3BtreeSetBusyHandler(Btree*,BusyHandler*);
int sqlite3BtreeSetCacheSize(Btree*,int);
-int sqlite3BtreeSetSafetyLevel(Btree*,int);
+int sqlite3BtreeSetSafetyLevel(Btree*,int,int);
int sqlite3BtreeSyncDisabled(Btree*);
int sqlite3BtreeSetPageSize(Btree*,int,int);
int sqlite3BtreeGetPageSize(Btree*);
@@ -73,8 +75,11 @@ int sqlite3BtreeRollbackStmt(Btree*);
int sqlite3BtreeCreateTable(Btree*, int*, int flags);
int sqlite3BtreeIsInTrans(Btree*);
int sqlite3BtreeIsInStmt(Btree*);
+int sqlite3BtreeIsInReadTrans(Btree*);
int sqlite3BtreeSync(Btree*, const char *zMaster);
-int sqlite3BtreeReset(Btree *);
+void *sqlite3BtreeSchema(Btree *, int, void(*)(void *));
+int sqlite3BtreeSchemaLocked(Btree *);
+int sqlite3BtreeLockTable(Btree *, int, u8);
const char *sqlite3BtreeGetFilename(Btree *);
const char *sqlite3BtreeGetDirname(Btree *);
diff --git a/ext/pdo_sqlite/sqlite/src/build.c b/ext/pdo_sqlite/sqlite/src/build.c
index 537eede8c..5294c1a31 100644
--- a/ext/pdo_sqlite/sqlite/src/build.c
+++ b/ext/pdo_sqlite/sqlite/src/build.c
@@ -36,6 +36,88 @@ void sqlite3BeginParse(Parse *pParse, int explainFlag){
pParse->nVar = 0;
}
+#ifndef SQLITE_OMIT_SHARED_CACHE
+/*
+** The TableLock structure is only used by the sqlite3TableLock() and
+** codeTableLocks() functions.
+*/
+struct TableLock {
+ int iDb; /* The database containing the table to be locked */
+ int iTab; /* The root page of the table to be locked */
+ u8 isWriteLock; /* True for write lock. False for a read lock */
+ const char *zName; /* Name of the table */
+};
+
+/*
+** Record the fact that we want to lock a table at run-time.
+**
+** The table to be locked has root page iTab and is found in database iDb.
+** A read or a write lock can be taken depending on isWritelock.
+**
+** This routine just records the fact that the lock is desired. The
+** code to make the lock occur is generated by a later call to
+** codeTableLocks() which occurs during sqlite3FinishCoding().
+*/
+void sqlite3TableLock(
+ Parse *pParse, /* Parsing context */
+ int iDb, /* Index of the database containing the table to lock */
+ int iTab, /* Root page number of the table to be locked */
+ u8 isWriteLock, /* True for a write lock */
+ const char *zName /* Name of the table to be locked */
+){
+ int i;
+ int nBytes;
+ TableLock *p;
+
+ if( 0==sqlite3ThreadDataReadOnly()->useSharedData || iDb<0 ){
+ return;
+ }
+
+ for(i=0; i<pParse->nTableLock; i++){
+ p = &pParse->aTableLock[i];
+ if( p->iDb==iDb && p->iTab==iTab ){
+ p->isWriteLock = (p->isWriteLock || isWriteLock);
+ return;
+ }
+ }
+
+ nBytes = sizeof(TableLock) * (pParse->nTableLock+1);
+ sqliteReallocOrFree((void **)&pParse->aTableLock, nBytes);
+ if( pParse->aTableLock ){
+ p = &pParse->aTableLock[pParse->nTableLock++];
+ p->iDb = iDb;
+ p->iTab = iTab;
+ p->isWriteLock = isWriteLock;
+ p->zName = zName;
+ }
+}
+
+/*
+** Code an OP_TableLock instruction for each table locked by the
+** statement (configured by calls to sqlite3TableLock()).
+*/
+static void codeTableLocks(Parse *pParse){
+ int i;
+ Vdbe *pVdbe;
+ assert( sqlite3ThreadDataReadOnly()->useSharedData || pParse->nTableLock==0 );
+
+ if( 0==(pVdbe = sqlite3GetVdbe(pParse)) ){
+ return;
+ }
+
+ for(i=0; i<pParse->nTableLock; i++){
+ TableLock *p = &pParse->aTableLock[i];
+ int p1 = p->iDb;
+ if( p->isWriteLock ){
+ p1 = -1*(p1+1);
+ }
+ sqlite3VdbeOp3(pVdbe, OP_TableLock, p1, p->iTab, p->zName, P3_STATIC);
+ }
+}
+#else
+ #define codeTableLocks(x)
+#endif
+
/*
** This routine is called after a single SQL statement has been
** parsed and a VDBE program to execute that statement has been
@@ -50,13 +132,13 @@ void sqlite3FinishCoding(Parse *pParse){
sqlite3 *db;
Vdbe *v;
- if( sqlite3_malloc_failed ) return;
+ if( sqlite3MallocFailed() ) return;
if( pParse->nested ) return;
if( !pParse->pVdbe ){
if( pParse->rc==SQLITE_OK && pParse->nErr ){
pParse->rc = SQLITE_ERROR;
+ return;
}
- return;
}
/* Begin by generating some termination code at the end of the
@@ -82,6 +164,18 @@ void sqlite3FinishCoding(Parse *pParse){
sqlite3VdbeAddOp(v, OP_Transaction, iDb, (mask & pParse->writeMask)!=0);
sqlite3VdbeAddOp(v, OP_VerifyCookie, iDb, pParse->cookieValue[iDb]);
}
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( pParse->pVirtualLock ){
+ char *vtab = (char *)pParse->pVirtualLock->pVtab;
+ sqlite3VdbeOp3(v, OP_VBegin, 0, 0, vtab, P3_VTAB);
+ }
+#endif
+
+ /* Once all the cookies have been verified and transactions opened,
+ ** obtain the required table-locks. This is a no-op unless the
+ ** shared-cache feature is enabled.
+ */
+ codeTableLocks(pParse);
sqlite3VdbeAddOp(v, OP_Goto, 0, pParse->cookieGoto);
}
@@ -99,7 +193,7 @@ void sqlite3FinishCoding(Parse *pParse){
/* Get the VDBE program ready for execution
*/
- if( v && pParse->nErr==0 ){
+ if( v && pParse->nErr==0 && !sqlite3MallocFailed() ){
FILE *trace = (db->flags & SQLITE_VdbeTrace)!=0 ? stdout : 0;
sqlite3VdbeTrace(v, trace);
sqlite3VdbeMakeReady(v, pParse->nVar, pParse->nMem+3,
@@ -168,11 +262,10 @@ 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);
+ p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName, strlen(zName)+1);
if( p ) break;
}
return p;
@@ -224,11 +317,14 @@ Table *sqlite3LocateTable(Parse *pParse, const char *zName, const char *zDbase){
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 */
+ Schema *pSchema = db->aDb[j].pSchema;
if( zDb && sqlite3StrICmp(zDb, db->aDb[j].zName) ) continue;
- p = sqlite3HashFind(&db->aDb[j].idxHash, zName, strlen(zName)+1);
+ assert( pSchema || (j==1 && !db->aDb[1].pBt) );
+ if( pSchema ){
+ p = sqlite3HashFind(&pSchema->idxHash, zName, strlen(zName)+1);
+ }
if( p ) break;
}
return p;
@@ -250,12 +346,11 @@ static void freeIndex(Index *p){
** 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){
+static void sqliteDeleteIndex(Index *p){
Index *pOld;
+ const char *zName = p->zName;
- assert( db!=0 && p->zName!=0 );
- pOld = sqlite3HashInsert(&db->aDb[p->iDb].idxHash, p->zName,
- strlen(p->zName)+1, 0);
+ pOld = sqlite3HashInsert(&p->pSchema->idxHash, zName, strlen( zName)+1, 0);
assert( pOld==0 || pOld==p );
freeIndex(p);
}
@@ -269,9 +364,10 @@ static void sqliteDeleteIndex(sqlite3 *db, Index *p){
void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const char *zIdxName){
Index *pIndex;
int len;
+ Hash *pHash = &db->aDb[iDb].pSchema->idxHash;
len = strlen(zIdxName);
- pIndex = sqlite3HashInsert(&db->aDb[iDb].idxHash, zIdxName, len+1, 0);
+ pIndex = sqlite3HashInsert(pHash, zIdxName, len+1, 0);
if( pIndex ){
if( pIndex->pTable->pIndex==pIndex ){
pIndex->pTable->pIndex = pIndex->pNext;
@@ -299,39 +395,21 @@ void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const char *zIdxName){
** 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( pDb->pSchema ){
+ sqlite3SchemaFree(pDb->pSchema);
+ }
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
+ ** then remove them 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.
@@ -394,6 +472,7 @@ static void sqliteResetColumnNames(Table *pTable){
sqliteFree(pCol->zName);
sqlite3ExprDelete(pCol->pDflt);
sqliteFree(pCol->zType);
+ sqliteFree(pCol->zColl);
}
sqliteFree(pTable->aCol);
}
@@ -420,6 +499,8 @@ void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
Index *pIndex, *pNext;
FKey *pFKey, *pNextFKey;
+ db = 0;
+
if( pTable==0 ) return;
/* Do not delete the table until the reference count reaches zero. */
@@ -433,8 +514,8 @@ void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
*/
for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
pNext = pIndex->pNext;
- assert( pIndex->iDb==pTable->iDb || (pTable->iDb==0 && pIndex->iDb==1) );
- sqliteDeleteIndex(db, pIndex);
+ assert( pIndex->pSchema==pTable->pSchema );
+ sqliteDeleteIndex(pIndex);
}
#ifndef SQLITE_OMIT_FOREIGN_KEY
@@ -443,8 +524,7 @@ void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
*/
for(pFKey=pTable->pFKey; pFKey; pFKey=pNextFKey){
pNextFKey = pFKey->pNextFrom;
- assert( pTable->iDb<db->nDb );
- assert( sqlite3HashFind(&db->aDb[pTable->iDb].aFKey,
+ assert( sqlite3HashFind(&pTable->pSchema->aFKey,
pFKey->zTo, strlen(pFKey->zTo)+1)!=pFKey );
sqliteFree(pFKey);
}
@@ -456,6 +536,10 @@ void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
sqliteFree(pTable->zName);
sqliteFree(pTable->zColAff);
sqlite3SelectDelete(pTable->pSelect);
+#ifndef SQLITE_OMIT_CHECK
+ sqlite3ExprDelete(pTable->pCheck);
+#endif
+ sqlite3VtabClear(pTable);
sqliteFree(pTable);
}
@@ -472,14 +556,14 @@ void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){
assert( iDb>=0 && iDb<db->nDb );
assert( zTabName && zTabName[0] );
pDb = &db->aDb[iDb];
- p = sqlite3HashInsert(&pDb->tblHash, zTabName, strlen(zTabName)+1, 0);
+ p = sqlite3HashInsert(&pDb->pSchema->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);
+ pF2 = sqlite3HashFind(&pDb->pSchema->aFKey, pF1->zTo, nTo);
if( pF2==pF1 ){
- sqlite3HashInsert(&pDb->aFKey, pF1->zTo, nTo, pF1->pNextTo);
+ sqlite3HashInsert(&pDb->pSchema->aFKey, pF1->zTo, nTo, pF1->pNextTo);
}else{
while( pF2 && pF2->pNextTo!=pF1 ){ pF2=pF2->pNextTo; }
if( pF2 ){
@@ -506,7 +590,7 @@ void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){
char *sqlite3NameFromToken(Token *pName){
char *zName;
if( pName ){
- zName = sqliteStrNDup(pName->z, pName->n);
+ zName = sqliteStrNDup((char*)pName->z, pName->n);
sqlite3Dequote(zName);
}else{
zName = 0;
@@ -518,7 +602,9 @@ char *sqlite3NameFromToken(Token *pName){
** 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){
+void sqlite3OpenMasterTable(Parse *p, int iDb){
+ Vdbe *v = sqlite3GetVdbe(p);
+ sqlite3TableLock(p, iDb, MASTER_ROOT, 1, SCHEMA_TABLE(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 */
@@ -613,8 +699,7 @@ int sqlite3CheckObjectName(Parse *pParse, const char *zName){
** 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
+** after seeing tokens "CREATE" and "TABLE" and 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
@@ -628,11 +713,12 @@ int sqlite3CheckObjectName(Parse *pParse, const char *zName){
*/
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 */
+ int isView, /* True if this is a VIEW */
+ int isVirtual, /* True if this is a VIRTUAL table */
+ int noErr /* Do nothing if table already exists */
){
Table *pTable;
char *zName = 0; /* The name of the new table */
@@ -695,7 +781,7 @@ void sqlite3StartTable(
code = SQLITE_CREATE_TABLE;
}
}
- if( sqlite3AuthCheck(pParse, code, zName, 0, zDb) ){
+ if( !isVirtual && sqlite3AuthCheck(pParse, code, zName, 0, zDb) ){
goto begin_table_error;
}
}
@@ -703,20 +789,28 @@ void sqlite3StartTable(
/* 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.
+ ** it does. The exception is if the statement being parsed was passed
+ ** to an sqlite3_declare_vtab() call. In that case only the column names
+ ** and types will be used, so there is no need to test for namespace
+ ** collisions.
*/
- 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;
+ if( !IN_DECLARE_VTAB ){
+ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
+ goto begin_table_error;
+ }
+ pTable = sqlite3FindTable(db, zName, db->aDb[iDb].zName);
+ if( pTable ){
+ if( !noErr ){
+ 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;
@@ -724,11 +818,8 @@ void sqlite3StartTable(
goto begin_table_error;
}
pTable->zName = zName;
- pTable->nCol = 0;
- pTable->aCol = 0;
pTable->iPKey = -1;
- pTable->pIndex = 0;
- pTable->iDb = iDb;
+ pTable->pSchema = db->aDb[iDb].pSchema;
pTable->nRef = 1;
if( pParse->pNewTable ) sqlite3DeleteTable(db, pParse->pNewTable);
pParse->pNewTable = pTable;
@@ -739,7 +830,7 @@ void sqlite3StartTable(
*/
#ifndef SQLITE_OMIT_AUTOINCREMENT
if( !pParse->nested && strcmp(zName, "sqlite_sequence")==0 ){
- db->aDb[iDb].pSeqTab = pTable;
+ pTable->pSchema->pSeqTab = pTable;
}
#endif
@@ -753,17 +844,26 @@ void sqlite3StartTable(
*/
if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){
int lbl;
+ int fileFormat;
sqlite3BeginWriteOperation(pParse, 0, iDb);
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( isVirtual ){
+ sqlite3VdbeAddOp(v, OP_VBegin, 0, 0);
+ }
+#endif
+
/* 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);
+ fileFormat = (db->flags & SQLITE_LegacyFileFmt)!=0 ?
+ 1 : SQLITE_MAX_FILE_FORMAT;
+ sqlite3VdbeAddOp(v, OP_Integer, fileFormat, 0);
sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 1);
- sqlite3VdbeAddOp(v, OP_Integer, db->enc, 0);
+ sqlite3VdbeAddOp(v, OP_Integer, ENC(db), 0);
sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 4);
sqlite3VdbeResolveLabel(v, lbl);
@@ -775,15 +875,15 @@ void sqlite3StartTable(
** The rowid value is needed by the code that sqlite3EndTable will
** generate.
*/
-#ifndef SQLITE_OMIT_VIEW
- if( isView ){
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE)
+ if( isView || isVirtual ){
sqlite3VdbeAddOp(v, OP_Integer, 0, 0);
}else
#endif
{
sqlite3VdbeAddOp(v, OP_CreateTable, iDb, 0);
}
- sqlite3OpenMasterTable(v, iDb);
+ sqlite3OpenMasterTable(pParse, iDb);
sqlite3VdbeAddOp(v, OP_NewRowid, 0, 0);
sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
sqlite3VdbeAddOp(v, OP_Null, 0, 0);
@@ -855,7 +955,6 @@ void sqlite3AddColumn(Parse *pParse, Token *pName){
** be called next to set pCol->affinity correctly.
*/
pCol->affinity = SQLITE_AFF_NONE;
- pCol->pColl = pParse->db->pDfltColl;
p->nCol++;
}
@@ -891,6 +990,9 @@ void sqlite3AddNotNull(Parse *pParse, int onError){
** 'CLOB' | SQLITE_AFF_TEXT
** 'TEXT' | SQLITE_AFF_TEXT
** 'BLOB' | SQLITE_AFF_NONE
+** 'REAL' | SQLITE_AFF_REAL
+** 'FLOA' | SQLITE_AFF_REAL
+** 'DOUB' | SQLITE_AFF_REAL
**
** If none of the substrings in the above table are found,
** SQLITE_AFF_NUMERIC is returned.
@@ -911,10 +1013,21 @@ char sqlite3AffinityType(const Token *pType){
}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_NUMERIC || aff==SQLITE_AFF_REAL) ){
aff = SQLITE_AFF_NONE;
+#ifndef SQLITE_OMIT_FLOATING_POINT
+ }else if( h==(('r'<<24)+('e'<<16)+('a'<<8)+'l') /* REAL */
+ && aff==SQLITE_AFF_NUMERIC ){
+ aff = SQLITE_AFF_REAL;
+ }else if( h==(('f'<<24)+('l'<<16)+('o'<<8)+'a') /* FLOA */
+ && aff==SQLITE_AFF_NUMERIC ){
+ aff = SQLITE_AFF_REAL;
+ }else if( h==(('d'<<24)+('o'<<16)+('u'<<8)+'b') /* DOUB */
+ && aff==SQLITE_AFF_NUMERIC ){
+ aff = SQLITE_AFF_REAL;
+#endif
}else if( (h&0x00FFFFFF)==(('i'<<16)+('n'<<8)+'t') ){ /* INT */
- aff = SQLITE_AFF_INTEGER;
+ aff = SQLITE_AFF_INTEGER;
break;
}
}
@@ -993,12 +1106,13 @@ 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 */
+ int autoInc, /* True if the AUTOINCREMENT keyword is present */
+ int sortOrder /* SQLITE_SO_ASC or SQLITE_SO_DESC */
){
Table *pTab = pParse->pNewTable;
char *zType = 0;
int iCol = -1, i;
- if( pTab==0 ) goto primary_key_exit;
+ if( pTab==0 || IN_DECLARE_VTAB ) goto primary_key_exit;
if( pTab->hasPrimKey ){
sqlite3ErrorMsg(pParse,
"table \"%s\" has more than one primary key", pTab->zName);
@@ -1024,7 +1138,8 @@ void sqlite3AddPrimaryKey(
if( iCol>=0 && iCol<pTab->nCol ){
zType = pTab->aCol[iCol].zType;
}
- if( zType && sqlite3StrICmp(zType, "INTEGER")==0 ){
+ if( zType && sqlite3StrICmp(zType, "INTEGER")==0
+ && sortOrder==SQLITE_SO_ASC ){
pTab->iPKey = iCol;
pTab->keyConf = onError;
pTab->autoInc = autoInc;
@@ -1034,7 +1149,7 @@ void sqlite3AddPrimaryKey(
"INTEGER PRIMARY KEY");
#endif
}else{
- sqlite3CreateIndex(pParse, 0, 0, 0, pList, onError, 0, 0);
+ sqlite3CreateIndex(pParse, 0, 0, 0, pList, onError, 0, 0, sortOrder, 0);
pList = 0;
}
@@ -1044,46 +1159,50 @@ primary_key_exit:
}
/*
+** Add a new CHECK constraint to the table currently under construction.
+*/
+void sqlite3AddCheckConstraint(
+ Parse *pParse, /* Parsing context */
+ Expr *pCheckExpr /* The check expression */
+){
+#ifndef SQLITE_OMIT_CHECK
+ Table *pTab = pParse->pNewTable;
+ if( pTab && !IN_DECLARE_VTAB ){
+ /* The CHECK expression must be duplicated so that tokens refer
+ ** to malloced space and not the (ephemeral) text of the CREATE TABLE
+ ** statement */
+ pTab->pCheck = sqlite3ExprAnd(pTab->pCheck, sqlite3ExprDup(pCheckExpr));
+ }
+#endif
+ sqlite3ExprDelete(pCheckExpr);
+}
+
+/*
** 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;
+ if( sqlite3LocateCollSeq(pParse, zType, nType) ){
+ Index *pIdx;
+ p->aCol[i].zColl = sqliteStrNDup(zType, nType);
+
+ /* 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->azColl[0] = p->aCol[i].zColl;
}
}
}
- return SQLITE_OK;
}
/*
@@ -1102,10 +1221,11 @@ int sqlite3CheckIndexCollSeq(Parse *pParse, Index *pIdx){
*/
CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName, int nName){
sqlite3 *db = pParse->db;
- u8 enc = db->enc;
+ u8 enc = ENC(db);
u8 initbusy = db->init.busy;
+ CollSeq *pColl;
- CollSeq *pColl = sqlite3FindCollSeq(db, enc, zName, nName, initbusy);
+ pColl = sqlite3FindCollSeq(db, enc, zName, nName, initbusy);
if( !initbusy && (!pColl || !pColl->xCmp) ){
pColl = sqlite3GetCollSeq(db, pColl, zName, nName);
if( !pColl ){
@@ -1138,7 +1258,7 @@ CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName, int nName){
** 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_Integer, db->aDb[iDb].pSchema->schema_cookie+1, 0);
sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 0);
}
@@ -1186,7 +1306,7 @@ static void identPut(char *z, int *pIdx, char *zSignedIdent){
** 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){
+static char *createTableStmt(Table *p, int isTemp){
int i, k, n;
char *zStmt;
char *zSep, *zSep2, *zEnd, *z;
@@ -1212,7 +1332,7 @@ static char *createTableStmt(Table *p){
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 ");
+ strcpy(zStmt, !OMIT_TEMPDB&&isTemp ? "CREATE TEMP TABLE ":"CREATE TABLE ");
k = strlen(zStmt);
identPut(zStmt, &k, p->zName);
zStmt[k++] = '(';
@@ -1259,13 +1379,40 @@ void sqlite3EndTable(
){
Table *p;
sqlite3 *db = pParse->db;
+ int iDb;
- if( (pEnd==0 && pSelect==0) || pParse->nErr || sqlite3_malloc_failed ) return;
+ if( (pEnd==0 && pSelect==0) || pParse->nErr || sqlite3MallocFailed() ) {
+ return;
+ }
p = pParse->pNewTable;
if( p==0 ) return;
assert( !db->init.busy || !pSelect );
+ iDb = sqlite3SchemaToIndex(db, p->pSchema);
+
+#ifndef SQLITE_OMIT_CHECK
+ /* Resolve names in all CHECK constraint expressions.
+ */
+ if( p->pCheck ){
+ SrcList sSrc; /* Fake SrcList for pParse->pNewTable */
+ NameContext sNC; /* Name context for pParse->pNewTable */
+
+ memset(&sNC, 0, sizeof(sNC));
+ memset(&sSrc, 0, sizeof(sSrc));
+ sSrc.nSrc = 1;
+ sSrc.a[0].zName = p->zName;
+ sSrc.a[0].pTab = p;
+ sSrc.a[0].iCursor = -1;
+ sNC.pParse = pParse;
+ sNC.pSrcList = &sSrc;
+ sNC.isCheck = 1;
+ if( sqlite3ExprResolveNames(&sNC, p->pCheck) ){
+ return;
+ }
+ }
+#endif /* !defined(SQLITE_OMIT_CHECK) */
+
/* 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
@@ -1318,11 +1465,16 @@ void sqlite3EndTable(
** 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.
+ **
+ ** A shared-cache write-lock is not required to write to the new table,
+ ** as a schema-lock must have already been obtained to create it. Since
+ ** a schema-lock excludes all other database users, the write-lock would
+ ** be redundant.
*/
if( pSelect ){
Table *pSelTab;
sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
- sqlite3VdbeAddOp(v, OP_Integer, p->iDb, 0);
+ sqlite3VdbeAddOp(v, OP_Integer, iDb, 0);
sqlite3VdbeAddOp(v, OP_OpenWrite, 1, 0);
pParse->nTab = 2;
sqlite3Select(pParse, pSelect, SRT_Table, 1, 0, 0, 0, 0);
@@ -1341,7 +1493,7 @@ void sqlite3EndTable(
/* Compute the complete text of the CREATE statement */
if( pSelect ){
- zStmt = createTableStmt(p);
+ zStmt = createTableStmt(p, p->pSchema==pParse->db->aDb[1].pSchema);
}else{
n = pEnd->z - pParse->sNameToken.z + 1;
zStmt = sqlite3MPrintf("CREATE %s %.*s", zType2, n, pParse->sNameToken.z);
@@ -1357,22 +1509,22 @@ void sqlite3EndTable(
"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),
+ db->aDb[iDb].zName, SCHEMA_TABLE(iDb),
zType,
p->zName,
p->zName,
zStmt
);
sqliteFree(zStmt);
- sqlite3ChangeCookie(db, v, p->iDb);
+ sqlite3ChangeCookie(db, v, 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 ){
+ Db *pDb = &db->aDb[iDb];
+ if( pDb->pSchema->pSeqTab==0 ){
sqlite3NestedParse(pParse,
"CREATE TABLE %Q.sqlite_sequence(name,seq)",
pDb->zName
@@ -1382,7 +1534,7 @@ void sqlite3EndTable(
#endif
/* Reparse everything to update our internal data structures */
- sqlite3VdbeOp3(v, OP_ParseSchema, p->iDb, 0,
+ sqlite3VdbeOp3(v, OP_ParseSchema, iDb, 0,
sqlite3MPrintf("tbl_name='%q'",p->zName), P3_DYNAMIC);
}
@@ -1392,8 +1544,8 @@ void sqlite3EndTable(
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);
+ Schema *pSchema = p->pSchema;
+ pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName, strlen(p->zName)+1,p);
if( pOld ){
assert( p==pOld ); /* Malloc must have failed inside HashInsert() */
return;
@@ -1401,8 +1553,8 @@ void sqlite3EndTable(
#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);
+ pFKey->pNextTo = sqlite3HashFind(&pSchema->aFKey, pFKey->zTo, nTo);
+ sqlite3HashInsert(&pSchema->aFKey, pFKey->zTo, nTo, pFKey);
}
#endif
pParse->pNewTable = 0;
@@ -1411,9 +1563,14 @@ void sqlite3EndTable(
#ifndef SQLITE_OMIT_ALTERTABLE
if( !p->pSelect ){
+ const char *zName = (const char *)pParse->sNameToken.z;
+ int nName;
assert( !pSelect && pCons && pEnd );
- if( pCons->z==0 ) pCons = pEnd;
- p->addColOffset = 13 + (pCons->z - pParse->sNameToken.z);
+ if( pCons->z==0 ){
+ pCons = pEnd;
+ }
+ nName = (const char *)pCons->z - zName;
+ p->addColOffset = 13 + sqlite3utf8CharLen(zName, nName);
}
#endif
}
@@ -1437,20 +1594,22 @@ void sqlite3CreateView(
Token sEnd;
DbFixer sFix;
Token *pName;
+ int iDb;
if( pParse->nVar>0 ){
sqlite3ErrorMsg(pParse, "parameters are not allowed in views");
sqlite3SelectDelete(pSelect);
return;
}
- sqlite3StartTable(pParse, pBegin, pName1, pName2, isTemp, 1);
+ sqlite3StartTable(pParse, pName1, pName2, isTemp, 1, 0, 0);
p = pParse->pNewTable;
if( p==0 || pParse->nErr ){
sqlite3SelectDelete(pSelect);
return;
}
sqlite3TwoPartName(pParse, pName1, pName2, &pName);
- if( sqlite3FixInit(&sFix, pParse, p->iDb, "view", pName)
+ iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
+ if( sqlite3FixInit(&sFix, pParse, iDb, "view", pName)
&& sqlite3FixSelect(&sFix, pSelect)
){
sqlite3SelectDelete(pSelect);
@@ -1464,6 +1623,9 @@ void sqlite3CreateView(
*/
p->pSelect = sqlite3SelectDup(pSelect);
sqlite3SelectDelete(pSelect);
+ if( sqlite3MallocFailed() ){
+ return;
+ }
if( !pParse->db->init.busy ){
sqlite3ViewGetColumnNames(pParse, p);
}
@@ -1488,7 +1650,7 @@ void sqlite3CreateView(
}
#endif /* SQLITE_OMIT_VIEW */
-#ifndef SQLITE_OMIT_VIEW
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE)
/*
** 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
@@ -1502,6 +1664,14 @@ int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
assert( pTable );
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( sqlite3VtabCallConnect(pParse, pTable) ){
+ return SQLITE_ERROR;
+ }
+ if( IsVirtual(pTable) ) return 0;
+#endif
+
+#ifndef SQLITE_OMIT_VIEW
/* A positive nCol means the columns names for this view are
** already known.
*/
@@ -1517,12 +1687,10 @@ int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
** 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.
@@ -1534,27 +1702,32 @@ int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
*/
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;
+ if( pSel ){
+ 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);
+ pTable->pSchema->flags |= DB_UnresetViews;
+ }else{
+ pTable->nCol = 0;
+ nErr++;
+ }
+ sqlite3SelectDelete(pSel);
+ } else {
nErr++;
}
- sqlite3SelectDelete(pSel);
+#endif /* SQLITE_OMIT_VIEW */
return nErr;
}
-#endif /* SQLITE_OMIT_VIEW */
+#endif /* !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE) */
#ifndef SQLITE_OMIT_VIEW
/*
@@ -1563,7 +1736,7 @@ int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
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)){
+ for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){
Table *pTab = sqliteHashData(i);
if( pTab->pSelect ){
sqliteResetColumnNames(pTab);
@@ -1580,26 +1753,37 @@ static void sqliteViewResetAll(sqlite3 *db, int idx){
** 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.
+**
+** Ticket #1728: The symbol table might still contain information
+** on tables and/or indices that are the process of being deleted.
+** If you are unlucky, one of those deleted indices or tables might
+** have the same rootpage number as the real table or index that is
+** being moved. So we cannot stop searching after the first match
+** because the first match might be for one of the deleted indices
+** or tables and not the table/index that is actually being moved.
+** We must continue looping until all tables and indices with
+** rootpage==iFrom have been converted to have a rootpage of iTo
+** in order to be certain that we got the right one.
*/
#ifndef SQLITE_OMIT_AUTOVACUUM
void sqlite3RootPageMoved(Db *pDb, int iFrom, int iTo){
HashElem *pElem;
-
- for(pElem=sqliteHashFirst(&pDb->tblHash); pElem; pElem=sqliteHashNext(pElem)){
+ Hash *pHash;
+
+ pHash = &pDb->pSchema->tblHash;
+ for(pElem=sqliteHashFirst(pHash); 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)){
+ pHash = &pDb->pSchema->idxHash;
+ for(pElem=sqliteHashFirst(pHash); pElem; pElem=sqliteHashNext(pElem)){
Index *pIdx = sqliteHashData(pElem);
if( pIdx->tnum==iFrom ){
pIdx->tnum = iTo;
- return;
}
}
- assert(0);
}
#endif
@@ -1636,9 +1820,10 @@ static void destroyRootPage(Parse *pParse, int iTable, int iDb){
static void destroyTable(Parse *pParse, Table *pTab){
#ifdef SQLITE_OMIT_AUTOVACUUM
Index *pIdx;
- destroyRootPage(pParse, pTab->tnum, pTab->iDb);
+ int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
+ destroyRootPage(pParse, pTab->tnum, iDb);
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
- destroyRootPage(pParse, pIdx->tnum, pIdx->iDb);
+ destroyRootPage(pParse, pIdx->tnum, iDb);
}
#else
/* If the database may be auto-vacuum capable (if SQLITE_OMIT_AUTOVACUUM
@@ -1669,14 +1854,18 @@ static void destroyTable(Parse *pParse, Table *pTab){
}
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
int iIdx = pIdx->tnum;
- assert( pIdx->iDb==pTab->iDb );
+ assert( pIdx->pSchema==pTab->pSchema );
if( (iDestroyed==0 || (iIdx<iDestroyed)) && iIdx>iLargest ){
iLargest = iIdx;
}
}
- if( iLargest==0 ) return;
- destroyRootPage(pParse, iLargest, pTab->iDb);
- iDestroyed = iLargest;
+ if( iLargest==0 ){
+ return;
+ }else{
+ int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
+ destroyRootPage(pParse, iLargest, iDb);
+ iDestroyed = iLargest;
+ }
}
#endif
}
@@ -1685,24 +1874,32 @@ static void destroyTable(Parse *pParse, Table *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 sqlite3DropTable(Parse *pParse, SrcList *pName, int isView){
+void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){
Table *pTab;
Vdbe *v;
sqlite3 *db = pParse->db;
int iDb;
- if( pParse->nErr || sqlite3_malloc_failed ) goto exit_drop_table;
+ if( pParse->nErr || sqlite3MallocFailed() ){
+ 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;
+ if( pTab==0 ){
+ if( noErr ){
+ sqlite3ErrorClear(pParse);
+ }
+ goto exit_drop_table;
+ }
+ iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
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;
+ const char *zTab = SCHEMA_TABLE(iDb);
+ const char *zDb = db->aDb[iDb].zName;
+ const char *zArg2 = 0;
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){
goto exit_drop_table;
}
@@ -1712,6 +1909,14 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView){
}else{
code = SQLITE_DROP_VIEW;
}
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ }else if( IsVirtual(pTab) ){
+ if( sqlite3ViewGetColumnNames(pParse, pTab) ){
+ goto exit_drop_table;
+ }
+ code = SQLITE_DROP_VTABLE;
+ zArg2 = pTab->pMod->zName;
+#endif
}else{
if( !OMIT_TEMPDB && iDb==1 ){
code = SQLITE_DROP_TEMP_TABLE;
@@ -1719,7 +1924,7 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView){
code = SQLITE_DROP_TABLE;
}
}
- if( sqlite3AuthCheck(pParse, code, pTab->zName, 0, zDb) ){
+ if( sqlite3AuthCheck(pParse, code, pTab->zName, zArg2, zDb) ){
goto exit_drop_table;
}
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){
@@ -1727,7 +1932,7 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView){
}
}
#endif
- if( pTab->readOnly || pTab==db->aDb[iDb].pSeqTab ){
+ if( pTab->readOnly || pTab==db->aDb[iDb].pSchema->pSeqTab ){
sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName);
goto exit_drop_table;
}
@@ -1752,18 +1957,27 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView){
v = sqlite3GetVdbe(pParse);
if( v ){
Trigger *pTrigger;
- int iDb = pTab->iDb;
Db *pDb = &db->aDb[iDb];
sqlite3BeginWriteOperation(pParse, 0, iDb);
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( IsVirtual(pTab) ){
+ Vdbe *v = sqlite3GetVdbe(pParse);
+ if( v ){
+ sqlite3VdbeAddOp(v, OP_VBegin, 0, 0);
+ }
+ }
+#endif
+
/* 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);
+ assert( pTrigger->pSchema==pTab->pSchema ||
+ pTrigger->pSchema==db->aDb[1].pSchema );
+ sqlite3DropTriggerPtr(pParse, pTrigger);
pTrigger = pTrigger->pNext;
}
@@ -1791,13 +2005,16 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView){
sqlite3NestedParse(pParse,
"DELETE FROM %Q.%s WHERE tbl_name=%Q and type!='trigger'",
pDb->zName, SCHEMA_TABLE(iDb), pTab->zName);
- if( !isView ){
+ if( !isView && !IsVirtual(pTab) ){
destroyTable(pParse, pTab);
}
/* Remove the table entry from SQLite's internal schema and modify
** the schema cookie.
*/
+ if( IsVirtual(pTab) ){
+ sqlite3VdbeOp3(v, OP_VDestroy, iDb, 0, pTab->zName, 0);
+ }
sqlite3VdbeOp3(v, OP_DropTable, iDb, 0, pTab->zName, 0);
sqlite3ChangeCookie(db, v, iDb);
}
@@ -1841,7 +2058,7 @@ void sqlite3CreateForeignKey(
char *z;
assert( pTo!=0 );
- if( p==0 || pParse->nErr ) goto fk_end;
+ if( p==0 || pParse->nErr || IN_DECLARE_VTAB ) goto fk_end;
if( pFromCol==0 ){
int iCol = p->nCol-1;
if( iCol<0 ) goto fk_end;
@@ -1958,21 +2175,18 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
int addr1; /* Address of top of loop */
int tnum; /* Root page of index */
Vdbe *v; /* Generate code into this virtual machine */
+ KeyInfo *pKey; /* KeyInfo for index */
+ int iDb = sqlite3SchemaToIndex(pParse->db, pIndex->pSchema);
#ifndef SQLITE_OMIT_AUTHORIZATION
if( sqlite3AuthCheck(pParse, SQLITE_REINDEX, pIndex->zName, 0,
- pParse->db->aDb[pIndex->iDb].zName ) ){
+ pParse->db->aDb[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;
- }
+ /* Require a write-lock on the table to perform this operation */
+ sqlite3TableLock(pParse, iDb, pTab->tnum, 1, pTab->zName);
v = sqlite3GetVdbe(pParse);
if( v==0 ) return;
@@ -1981,12 +2195,12 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
tnum = 0;
}else{
tnum = pIndex->tnum;
- sqlite3VdbeAddOp(v, OP_Clear, tnum, pIndex->iDb);
+ sqlite3VdbeAddOp(v, OP_Clear, tnum, iDb);
}
- sqlite3VdbeAddOp(v, OP_Integer, pIndex->iDb, 0);
- sqlite3VdbeOp3(v, OP_OpenWrite, iIdx, tnum,
- (char*)&pIndex->keyInfo, P3_KEYINFO);
- sqlite3OpenTableForReading(v, iTab, pTab);
+ sqlite3VdbeAddOp(v, OP_Integer, iDb, 0);
+ pKey = sqlite3IndexKeyinfo(pParse, pIndex);
+ sqlite3VdbeOp3(v, OP_OpenWrite, iIdx, tnum, (char *)pKey, P3_KEYINFO_HANDOFF);
+ sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
addr1 = sqlite3VdbeAddOp(v, OP_Rewind, iTab, 0);
sqlite3GenerateIndexKey(v, pIndex, iTab);
if( pIndex->onError!=OE_None ){
@@ -2027,20 +2241,30 @@ void sqlite3CreateIndex(
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 */
+ Token *pEnd, /* The ")" that closes the CREATE INDEX statement */
+ int sortOrder, /* Sort order of primary key when pList==NULL */
+ int ifNotExist /* Omit error if index already exists */
){
- Table *pTab = 0; /* Table to be indexed */
- Index *pIndex = 0; /* The index to be created */
- char *zName = 0;
+ Table *pTab = 0; /* Table to be indexed */
+ Index *pIndex = 0; /* The index to be created */
+ char *zName = 0; /* Name of the index */
+ int nName; /* Number of characters in zName */
int i, j;
- Token nullId; /* Fake token for an empty ID list */
- DbFixer sFix; /* For assigning database names to pTable */
+ Token nullId; /* Fake token for an empty ID list */
+ DbFixer sFix; /* For assigning database names to pTable */
+ int sortOrderMask; /* 1 to honor DESC in index. 0 to ignore. */
sqlite3 *db = pParse->db;
+ Db *pDb; /* The specific table containing the indexed database */
+ int iDb; /* Index of the database that is being written */
+ Token *pName = 0; /* Unqualified name of the index to create */
+ struct ExprList_item *pListItem; /* For looping over pList */
+ int nCol;
+ int nExtra = 0;
+ char *zExtra;
- 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;
+ if( pParse->nErr || sqlite3MallocFailed() || IN_DECLARE_VTAB ){
+ goto exit_create_index;
+ }
/*
** Find the table that is to be indexed. Return early if not found.
@@ -2060,7 +2284,7 @@ void sqlite3CreateIndex(
** is a temp table. If so, set the database to 1.
*/
pTab = sqlite3SrcListLookup(pParse, pTblName);
- if( pName2 && pName2->n==0 && pTab && pTab->iDb==1 ){
+ if( pName2 && pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){
iDb = 1;
}
#endif
@@ -2075,12 +2299,14 @@ void sqlite3CreateIndex(
pTab = sqlite3LocateTable(pParse, pTblName->a[0].zName,
pTblName->a[0].zDatabase);
if( !pTab ) goto exit_create_index;
- assert( iDb==pTab->iDb );
+ assert( db->aDb[iDb].pSchema==pTab->pSchema );
}else{
assert( pName==0 );
- pTab = pParse->pNewTable;
- iDb = pTab->iDb;
+ pTab = pParse->pNewTable;
+ if( !pTab ) goto exit_create_index;
+ iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
}
+ pDb = &db->aDb[iDb];
if( pTab==0 || pParse->nErr ) goto exit_create_index;
if( pTab->readOnly ){
@@ -2093,6 +2319,12 @@ void sqlite3CreateIndex(
goto exit_create_index;
}
#endif
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( IsVirtual(pTab) ){
+ sqlite3ErrorMsg(pParse, "virtual tables may not be indexed");
+ goto exit_create_index;
+ }
+#endif
/*
** Find the name of the index. Make sure there is not already another
@@ -2116,8 +2348,10 @@ void sqlite3CreateIndex(
}
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);
+ if( sqlite3FindIndex(db, zName, pDb->zName)!=0 ){
+ if( !ifNotExist ){
+ sqlite3ErrorMsg(pParse, "index %s already exists", zName);
+ }
goto exit_create_index;
}
if( sqlite3FindTable(db, zName, 0)!=0 ){
@@ -2140,7 +2374,7 @@ void sqlite3CreateIndex(
*/
#ifndef SQLITE_OMIT_AUTHORIZATION
{
- const char *zDb = db->aDb[iDb].zName;
+ const char *zDb = pDb->zName;
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){
goto exit_create_index;
}
@@ -2157,56 +2391,96 @@ void sqlite3CreateIndex(
** So create a fake list to simulate this.
*/
if( pList==0 ){
- nullId.z = pTab->aCol[pTab->nCol-1].zName;
- nullId.n = strlen(nullId.z);
+ nullId.z = (u8*)pTab->aCol[pTab->nCol-1].zName;
+ nullId.n = strlen((char*)nullId.z);
pList = sqlite3ExprListAppend(0, 0, &nullId);
if( pList==0 ) goto exit_create_index;
+ pList->a[0].sortOrder = sortOrder;
+ }
+
+ /* Figure out how many bytes of space are required to store explicitly
+ ** specified collation sequence names.
+ */
+ for(i=0; i<pList->nExpr; i++){
+ Expr *pExpr = pList->a[i].pExpr;
+ if( pExpr ){
+ nExtra += (1 + strlen(pExpr->pColl->zName));
+ }
}
/*
** 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];
+ nName = strlen(zName);
+ nCol = pList->nExpr;
+ pIndex = sqliteMalloc(
+ sizeof(Index) + /* Index structure */
+ sizeof(int)*nCol + /* Index.aiColumn */
+ sizeof(int)*(nCol+1) + /* Index.aiRowEst */
+ sizeof(char *)*nCol + /* Index.azColl */
+ sizeof(u8)*nCol + /* Index.aSortOrder */
+ nName + 1 + /* Index.zName */
+ nExtra /* Collation sequence names */
+ );
+ if( sqlite3MallocFailed() ) goto exit_create_index;
+ pIndex->azColl = (char**)(&pIndex[1]);
+ pIndex->aiColumn = (int *)(&pIndex->azColl[nCol]);
+ pIndex->aiRowEst = (unsigned *)(&pIndex->aiColumn[nCol]);
+ pIndex->aSortOrder = (u8 *)(&pIndex->aiRowEst[nCol+1]);
+ pIndex->zName = (char *)(&pIndex->aSortOrder[nCol]);
+ zExtra = (char *)(&pIndex->zName[nName+1]);
strcpy(pIndex->zName, zName);
pIndex->pTable = pTab;
pIndex->nColumn = pList->nExpr;
pIndex->onError = onError;
pIndex->autoIndex = pName==0;
- pIndex->iDb = iDb;
+ pIndex->pSchema = db->aDb[iDb].pSchema;
+
+ /* Check to see if we should honor DESC requests on index columns
+ */
+ if( pDb->pSchema->file_format>=4 ){
+ sortOrderMask = -1; /* Honor DESC */
+ }else{
+ sortOrderMask = 0; /* Ignore DESC */
+ }
/* 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;
+ for(i=0, pListItem=pList->a; i<pList->nExpr; i++, pListItem++){
+ const char *zColName = pListItem->zName;
+ Column *pTabCol;
+ int requestedSortOrder;
+ char *zColl; /* Collation sequence */
+
+ for(j=0, pTabCol=pTab->aCol; j<pTab->nCol; j++, pTabCol++){
+ if( sqlite3StrICmp(zColName, pTabCol->zName)==0 ) break;
}
if( j>=pTab->nCol ){
sqlite3ErrorMsg(pParse, "table %s has no column named %s",
- pTab->zName, pList->a[i].zName);
+ pTab->zName, zColName);
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;
+ if( pListItem->pExpr ){
+ assert( pListItem->pExpr->pColl );
+ zColl = zExtra;
+ strcpy(zExtra, pListItem->pExpr->pColl->zName);
+ zExtra += (strlen(zColl) + 1);
}else{
- pIndex->keyInfo.aColl[i] = pTab->aCol[j].pColl;
+ zColl = pTab->aCol[j].zColl;
+ if( !zColl ){
+ zColl = db->pDfltColl->zName;
+ }
}
- assert( pIndex->keyInfo.aColl[i] );
- if( !db->init.busy &&
- sqlite3CheckCollSeq(pParse, pIndex->keyInfo.aColl[i])
- ){
+ if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl, -1) ){
goto exit_create_index;
}
+ pIndex->azColl[i] = zColl;
+ requestedSortOrder = pListItem->sortOrder & sortOrderMask;
+ pIndex->aSortOrder[i] = requestedSortOrder;
}
- pIndex->keyInfo.nField = pList->nExpr;
sqlite3DefaultRowEst(pIndex);
if( pTab==pParse->pNewTable ){
@@ -2232,8 +2506,11 @@ void sqlite3CreateIndex(
if( pIdx->nColumn!=pIndex->nColumn ) continue;
for(k=0; k<pIdx->nColumn; k++){
+ const char *z1 = pIdx->azColl[k];
+ const char *z2 = pIndex->azColl[k];
if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break;
- if( pIdx->keyInfo.aColl[k]!=pIndex->keyInfo.aColl[k] ) break;
+ if( pIdx->aSortOrder[k]!=pIndex->aSortOrder[k] ) break;
+ if( z1!=z2 && sqlite3StrICmp(z1, z2) ) break;
}
if( k==pIdx->nColumn ){
if( pIdx->onError!=pIndex->onError ){
@@ -2262,7 +2539,7 @@ void sqlite3CreateIndex(
*/
if( db->init.busy ){
Index *p;
- p = sqlite3HashInsert(&db->aDb[pIndex->iDb].idxHash,
+ p = sqlite3HashInsert(&pIndex->pSchema->idxHash,
pIndex->zName, strlen(pIndex->zName)+1, pIndex);
if( p ){
assert( p==pIndex ); /* Malloc must have failed */
@@ -2297,6 +2574,7 @@ void sqlite3CreateIndex(
v = sqlite3GetVdbe(pParse);
if( v==0 ) goto exit_create_index;
+
/* Create the rootpage for the index
*/
sqlite3BeginWriteOperation(pParse, 1, iDb);
@@ -2375,6 +2653,22 @@ exit_create_index:
}
/*
+** Generate code to make sure the file format number is at least minFormat.
+** The generated code will increase the file format number if necessary.
+*/
+void sqlite3MinimumFileFormat(Parse *pParse, int iDb, int minFormat){
+ Vdbe *v;
+ v = sqlite3GetVdbe(pParse);
+ if( v ){
+ sqlite3VdbeAddOp(v, OP_ReadCookie, iDb, 1);
+ sqlite3VdbeAddOp(v, OP_Integer, minFormat, 0);
+ sqlite3VdbeAddOp(v, OP_Ge, 0, sqlite3VdbeCurrentAddr(v)+3);
+ sqlite3VdbeAddOp(v, OP_Integer, minFormat, 0);
+ sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 1);
+ }
+}
+
+/*
** Fill the Index.aiRowEst[] array with default information - information
** to be used when we have not run the ANALYZE command.
**
@@ -2397,8 +2691,12 @@ void sqlite3DefaultRowEst(Index *pIdx){
int i;
assert( a!=0 );
a[0] = 1000000;
- for(i=pIdx->nColumn; i>=1; i--){
- a[i] = 10;
+ for(i=pIdx->nColumn; i>=5; i--){
+ a[i] = 5;
+ }
+ while( i>=1 ){
+ a[i] = 11 - i;
+ i--;
}
if( pIdx->onError!=OE_None ){
a[pIdx->nColumn] = 1;
@@ -2409,12 +2707,13 @@ void sqlite3DefaultRowEst(Index *pIdx){
** This routine will drop an existing named index. This routine
** implements the DROP INDEX statement.
*/
-void sqlite3DropIndex(Parse *pParse, SrcList *pName){
+void sqlite3DropIndex(Parse *pParse, SrcList *pName, int ifExists){
Index *pIndex;
Vdbe *v;
sqlite3 *db = pParse->db;
+ int iDb;
- if( pParse->nErr || sqlite3_malloc_failed ){
+ if( pParse->nErr || sqlite3MallocFailed() ){
goto exit_drop_index;
}
assert( pName->nSrc==1 );
@@ -2423,7 +2722,9 @@ void sqlite3DropIndex(Parse *pParse, SrcList *pName){
}
pIndex = sqlite3FindIndex(db, pName->a[0].zName, pName->a[0].zDatabase);
if( pIndex==0 ){
- sqlite3ErrorMsg(pParse, "no such index: %S", pName, 0);
+ if( !ifExists ){
+ sqlite3ErrorMsg(pParse, "no such index: %S", pName, 0);
+ }
pParse->checkSchema = 1;
goto exit_drop_index;
}
@@ -2432,16 +2733,17 @@ void sqlite3DropIndex(Parse *pParse, SrcList *pName){
"or PRIMARY KEY constraint cannot be dropped", 0);
goto exit_drop_index;
}
+ iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
#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);
+ const char *zDb = db->aDb[iDb].zName;
+ const char *zTab = SCHEMA_TABLE(iDb);
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){
goto exit_drop_index;
}
- if( !OMIT_TEMPDB && pIndex->iDb ) code = SQLITE_DROP_TEMP_INDEX;
+ if( !OMIT_TEMPDB && iDb ) code = SQLITE_DROP_TEMP_INDEX;
if( sqlite3AuthCheck(pParse, code, pIndex->zName, pTab->zName, zDb) ){
goto exit_drop_index;
}
@@ -2451,7 +2753,6 @@ void sqlite3DropIndex(Parse *pParse, SrcList *pName){
/* 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),
@@ -2611,6 +2912,7 @@ SrcList *sqlite3SrcListAppend(SrcList *pList, Token *pTable, Token *pDatabase){
pItem->zName = sqlite3NameFromToken(pTable);
pItem->zDatabase = sqlite3NameFromToken(pDatabase);
pItem->iCursor = -1;
+ pItem->isPopulated = 0;
pList->nSrc++;
return pList;
}
@@ -2621,11 +2923,14 @@ SrcList *sqlite3SrcListAppend(SrcList *pList, Token *pTable, Token *pDatabase){
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);
+ assert(pList || sqlite3MallocFailed() );
+ if( pList ){
+ 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);
+ }
}
}
}
@@ -2667,7 +2972,7 @@ void sqlite3BeginTransaction(Parse *pParse, int type){
int i;
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return;
- if( pParse->nErr || sqlite3_malloc_failed ) return;
+ if( pParse->nErr || sqlite3MallocFailed() ) return;
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "BEGIN", 0, 0) ) return;
v = sqlite3GetVdbe(pParse);
@@ -2688,7 +2993,7 @@ void sqlite3CommitTransaction(Parse *pParse){
Vdbe *v;
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return;
- if( pParse->nErr || sqlite3_malloc_failed ) return;
+ if( pParse->nErr || sqlite3MallocFailed() ) return;
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "COMMIT", 0, 0) ) return;
v = sqlite3GetVdbe(pParse);
@@ -2705,7 +3010,7 @@ void sqlite3RollbackTransaction(Parse *pParse){
Vdbe *v;
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return;
- if( pParse->nErr || sqlite3_malloc_failed ) return;
+ if( pParse->nErr || sqlite3MallocFailed() ) return;
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "ROLLBACK", 0, 0) ) return;
v = sqlite3GetVdbe(pParse);
@@ -2718,7 +3023,7 @@ void sqlite3RollbackTransaction(Parse *pParse){
** 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){
+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);
@@ -2737,6 +3042,7 @@ static int sqlite3OpenTempDatabase(Parse *pParse){
return 1;
}
}
+ assert( db->aDb[1].pSchema );
}
return 0;
}
@@ -2777,11 +3083,11 @@ void sqlite3CodeVerifySchema(Parse *pParse, int iDb){
if( iDb>=0 ){
assert( iDb<db->nDb );
assert( db->aDb[iDb].pBt!=0 || iDb==1 );
- assert( iDb<32 );
+ assert( iDb<MAX_ATTACHED+2 );
mask = 1<<iDb;
if( (pParse->cookieMask & mask)==0 ){
pParse->cookieMask |= mask;
- pParse->cookieValue[iDb] = db->aDb[iDb].schema_cookie;
+ pParse->cookieValue[iDb] = db->aDb[iDb].pSchema->schema_cookie;
if( !OMIT_TEMPDB && iDb==1 ){
sqlite3OpenTempDatabase(pParse);
}
@@ -2825,12 +3131,13 @@ void sqlite3BeginWriteOperation(Parse *pParse, int setStatement, int iDb){
** 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++;
+static int collationMatch(const char *zColl, Index *pIndex){
+ int i;
+ for(i=0; i<pIndex->nColumn; i++){
+ const char *z = pIndex->azColl[i];
+ if( z==zColl || (z && zColl && 0==sqlite3StrICmp(z, zColl)) ){
+ return 1;
+ }
}
return 0;
}
@@ -2841,12 +3148,13 @@ static int collationMatch(CollSeq *pColl, Index *pIndex){
** If pColl==0 then recompute all indices of pTab.
*/
#ifndef SQLITE_OMIT_REINDEX
-static void reindexTable(Parse *pParse, Table *pTab, CollSeq *pColl){
+static void reindexTable(Parse *pParse, Table *pTab, char const *zColl){
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);
+ if( zColl==0 || collationMatch(zColl, pIndex) ){
+ int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
+ sqlite3BeginWriteOperation(pParse, 0, iDb);
sqlite3RefillIndex(pParse, pIndex, -1);
}
}
@@ -2859,7 +3167,7 @@ static void reindexTable(Parse *pParse, Table *pTab, CollSeq *pColl){
** all indices everywhere.
*/
#ifndef SQLITE_OMIT_REINDEX
-static void reindexDatabases(Parse *pParse, CollSeq *pColl){
+static void reindexDatabases(Parse *pParse, char const *zColl){
Db *pDb; /* A single database */
int iDb; /* The database index number */
sqlite3 *db = pParse->db; /* The database connection */
@@ -2867,10 +3175,10 @@ static void reindexDatabases(Parse *pParse, CollSeq *pColl){
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)){
+ assert( pDb!=0 );
+ for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){
pTab = (Table*)sqliteHashData(k);
- reindexTable(pParse, pTab, pColl);
+ reindexTable(pParse, pTab, zColl);
}
}
}
@@ -2910,9 +3218,14 @@ void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2){
reindexDatabases(pParse, 0);
return;
}else if( pName2==0 || pName2->z==0 ){
- pColl = sqlite3FindCollSeq(db, db->enc, pName1->z, pName1->n, 0);
+ assert( pName1->z );
+ pColl = sqlite3FindCollSeq(db, ENC(db), (char*)pName1->z, pName1->n, 0);
if( pColl ){
- reindexDatabases(pParse, pColl);
+ char *zColl = sqliteStrNDup((const char *)pName1->z, pName1->n);
+ if( zColl ){
+ reindexDatabases(pParse, zColl);
+ sqliteFree(zColl);
+ }
return;
}
}
@@ -2936,3 +3249,38 @@ void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2){
sqlite3ErrorMsg(pParse, "unable to identify the object to be reindexed");
}
#endif
+
+/*
+** Return a dynamicly allocated KeyInfo structure that can be used
+** with OP_OpenRead or OP_OpenWrite to access database index pIdx.
+**
+** If successful, a pointer to the new structure is returned. In this case
+** the caller is responsible for calling sqliteFree() on the returned
+** pointer. If an error occurs (out of memory or missing collation
+** sequence), NULL is returned and the state of pParse updated to reflect
+** the error.
+*/
+KeyInfo *sqlite3IndexKeyinfo(Parse *pParse, Index *pIdx){
+ int i;
+ int nCol = pIdx->nColumn;
+ int nBytes = sizeof(KeyInfo) + (nCol-1)*sizeof(CollSeq*) + nCol;
+ KeyInfo *pKey = (KeyInfo *)sqliteMalloc(nBytes);
+
+ if( pKey ){
+ pKey->aSortOrder = (u8 *)&(pKey->aColl[nCol]);
+ assert( &pKey->aSortOrder[nCol]==&(((u8 *)pKey)[nBytes]) );
+ for(i=0; i<nCol; i++){
+ char *zColl = pIdx->azColl[i];
+ assert( zColl );
+ pKey->aColl[i] = sqlite3LocateCollSeq(pParse, zColl, -1);
+ pKey->aSortOrder[i] = pIdx->aSortOrder[i];
+ }
+ pKey->nField = nCol;
+ }
+
+ if( pParse->nErr ){
+ sqliteFree(pKey);
+ pKey = 0;
+ }
+ return pKey;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/callback.c b/ext/pdo_sqlite/sqlite/src/callback.c
index 5673b8d61..ff8bfb010 100644
--- a/ext/pdo_sqlite/sqlite/src/callback.c
+++ b/ext/pdo_sqlite/sqlite/src/callback.c
@@ -13,7 +13,7 @@
** This file contains functions used to access the internal hash tables
** of user defined functions and collation sequences.
**
-** $Id: callback.c,v 1.1.2.2 2005/09/26 19:33:24 iliaa Exp $
+** $Id: callback.c,v 1.1.2.2.2.1 2006/08/14 16:15:28 iliaa Exp $
*/
#include "sqliteInt.h"
@@ -29,17 +29,19 @@ static void callCollNeeded(sqlite3 *db, const char *zName, int nName){
if( db->xCollNeeded ){
char *zExternal = sqliteStrNDup(zName, nName);
if( !zExternal ) return;
- db->xCollNeeded(db->pCollNeededArg, db, (int)db->enc, zExternal);
+ db->xCollNeeded(db->pCollNeededArg, db, (int)ENC(db), 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);
+ sqlite3_value *pTmp = sqlite3ValueNew();
+ sqlite3ValueSetStr(pTmp, nName, zName, SQLITE_UTF8, SQLITE_STATIC);
zExternal = sqlite3ValueText(pTmp, SQLITE_UTF16NATIVE);
- if( !zExternal ) return;
- db->xCollNeeded16(db->pCollNeededArg, db, (int)db->enc, zExternal);
+ if( zExternal ){
+ db->xCollNeeded16(db->pCollNeededArg, db, (int)ENC(db), zExternal);
+ }
+ sqlite3ValueFree(pTmp);
}
#endif
}
@@ -90,14 +92,14 @@ CollSeq *sqlite3GetCollSeq(
p = pColl;
if( !p ){
- p = sqlite3FindCollSeq(db, db->enc, zName, nName, 0);
+ p = sqlite3FindCollSeq(db, ENC(db), 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);
+ p = sqlite3FindCollSeq(db, ENC(db), zName, nName, 0);
}
if( p && !p->xCmp && synthCollSeq(db, p) ){
p = 0;
@@ -128,6 +130,7 @@ int sqlite3CheckCollSeq(Parse *pParse, CollSeq *pColl){
pParse->nErr++;
return SQLITE_ERROR;
}
+ assert( p==pColl );
}
return SQLITE_OK;
}
@@ -175,8 +178,11 @@ static CollSeq *findCollSeqEntry(
** 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);
+ assert( !pDel || (sqlite3MallocFailed() && pDel==pColl) );
+ if( pDel ){
+ sqliteFree(pDel);
+ pColl = 0;
+ }
}
}
return pColl;
@@ -197,7 +203,12 @@ CollSeq *sqlite3FindCollSeq(
int nName,
int create
){
- CollSeq *pColl = findCollSeqEntry(db, zName, nName, create);
+ CollSeq *pColl;
+ if( zName ){
+ pColl = findCollSeqEntry(db, zName, nName, create);
+ }else{
+ pColl = db->pDfltColl;
+ }
assert( SQLITE_UTF8==1 && SQLITE_UTF16LE==2 && SQLITE_UTF16BE==3 );
assert( enc>=SQLITE_UTF8 && enc<=SQLITE_UTF16BE );
if( pColl ) pColl += enc-1;
@@ -286,7 +297,7 @@ FuncDef *sqlite3FindFunction(
** new entry to the hash table and return it.
*/
if( createFlag && bestmatch<6 &&
- (pBest = sqliteMalloc(sizeof(*pBest)+nName)) ){
+ (pBest = sqliteMalloc(sizeof(*pBest)+nName))!=0 ){
pBest->nArg = nArg;
pBest->pNext = pFirst;
pBest->iPrefEnc = enc;
@@ -303,3 +314,55 @@ FuncDef *sqlite3FindFunction(
}
return 0;
}
+
+/*
+** Free all resources held by the schema structure. The void* argument points
+** at a Schema struct. This function does not call sqliteFree() on the
+** pointer itself, it just cleans up subsiduary resources (i.e. the contents
+** of the schema hash tables).
+*/
+void sqlite3SchemaFree(void *p){
+ Hash temp1;
+ Hash temp2;
+ HashElem *pElem;
+ Schema *pSchema = (Schema *)p;
+
+ temp1 = pSchema->tblHash;
+ temp2 = pSchema->trigHash;
+ sqlite3HashInit(&pSchema->trigHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashClear(&pSchema->aFKey);
+ sqlite3HashClear(&pSchema->idxHash);
+ for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){
+ sqlite3DeleteTrigger((Trigger*)sqliteHashData(pElem));
+ }
+ sqlite3HashClear(&temp2);
+ sqlite3HashInit(&pSchema->tblHash, SQLITE_HASH_STRING, 0);
+ for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){
+ Table *pTab = sqliteHashData(pElem);
+ sqlite3DeleteTable(0, pTab);
+ }
+ sqlite3HashClear(&temp1);
+ pSchema->pSeqTab = 0;
+ pSchema->flags &= ~DB_SchemaLoaded;
+}
+
+/*
+** Find and return the schema associated with a BTree. Create
+** a new one if necessary.
+*/
+Schema *sqlite3SchemaGet(Btree *pBt){
+ Schema * p;
+ if( pBt ){
+ p = (Schema *)sqlite3BtreeSchema(pBt,sizeof(Schema),sqlite3SchemaFree);
+ }else{
+ p = (Schema *)sqliteMalloc(sizeof(Schema));
+ }
+ if( p && 0==p->file_format ){
+ sqlite3HashInit(&p->tblHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&p->idxHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&p->trigHash, SQLITE_HASH_STRING, 0);
+ sqlite3HashInit(&p->aFKey, SQLITE_HASH_STRING, 1);
+ p->enc = SQLITE_UTF8;
+ }
+ return p;
+}
diff --git a/ext/pdo_sqlite/sqlite/src/complete.c b/ext/pdo_sqlite/sqlite/src/complete.c
new file mode 100644
index 000000000..a7681be16
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/complete.c
@@ -0,0 +1,263 @@
+/*
+** 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 implements the sqlite3_complete() API.
+** This code used to be part of the tokenizer.c source file. But by
+** separating it out, the code will be automatically omitted from
+** static links that do not use it.
+**
+** $Id: complete.c,v 1.1.2.1 2006/08/14 16:15:28 iliaa Exp $
+*/
+#include "sqliteInt.h"
+#ifndef SQLITE_OMIT_COMPLETE
+
+/*
+** This is defined in tokenize.c. We just have to import the definition.
+*/
+extern const char sqlite3IsIdChar[];
+#define IdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && sqlite3IsIdChar[c-0x20]))
+
+
+/*
+** Token types used by the sqlite3_complete() routine. See the header
+** comments on that procedure for additional information.
+*/
+#define tkSEMI 0
+#define tkWS 1
+#define tkOTHER 2
+#define tkEXPLAIN 3
+#define tkCREATE 4
+#define tkTEMP 5
+#define tkTRIGGER 6
+#define tkEND 7
+
+/*
+** Return TRUE if the given SQL string ends in a semicolon.
+**
+** Special handling is require for CREATE TRIGGER statements.
+** Whenever the CREATE TRIGGER keywords are seen, the statement
+** must end with ";END;".
+**
+** This implementation uses a state machine with 7 states:
+**
+** (0) START At the beginning or end of an SQL statement. This routine
+** returns 1 if it ends in the START state and 0 if it ends
+** in any other state.
+**
+** (1) NORMAL We are in the middle of statement which ends with a single
+** semicolon.
+**
+** (2) EXPLAIN The keyword EXPLAIN has been seen at the beginning of
+** a statement.
+**
+** (3) CREATE The keyword CREATE has been seen at the beginning of a
+** statement, possibly preceeded by EXPLAIN and/or followed by
+** TEMP or TEMPORARY
+**
+** (4) TRIGGER We are in the middle of a trigger definition that must be
+** ended by a semicolon, the keyword END, and another semicolon.
+**
+** (5) SEMI We've seen the first semicolon in the ";END;" that occurs at
+** the end of a trigger definition.
+**
+** (6) END We've seen the ";END" of the ";END;" that occurs at the end
+** of a trigger difinition.
+**
+** Transitions between states above are determined by tokens extracted
+** from the input. The following tokens are significant:
+**
+** (0) tkSEMI A semicolon.
+** (1) tkWS Whitespace
+** (2) tkOTHER Any other SQL token.
+** (3) tkEXPLAIN The "explain" keyword.
+** (4) tkCREATE The "create" keyword.
+** (5) tkTEMP The "temp" or "temporary" keyword.
+** (6) tkTRIGGER The "trigger" keyword.
+** (7) tkEND The "end" keyword.
+**
+** Whitespace never causes a state transition and is always ignored.
+**
+** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
+** to recognize the end of a trigger can be omitted. All we have to do
+** is look for a semicolon that is not part of an string or comment.
+*/
+int sqlite3_complete(const char *zSql){
+ u8 state = 0; /* Current state, using numbers defined in header comment */
+ u8 token; /* Value of the next token */
+
+#ifndef SQLITE_OMIT_TRIGGER
+ /* A complex statement machine used to detect the end of a CREATE TRIGGER
+ ** statement. This is the normal case.
+ */
+ static const u8 trans[7][8] = {
+ /* Token: */
+ /* State: ** SEMI WS OTHER EXPLAIN CREATE TEMP TRIGGER END */
+ /* 0 START: */ { 0, 0, 1, 2, 3, 1, 1, 1, },
+ /* 1 NORMAL: */ { 0, 1, 1, 1, 1, 1, 1, 1, },
+ /* 2 EXPLAIN: */ { 0, 2, 1, 1, 3, 1, 1, 1, },
+ /* 3 CREATE: */ { 0, 3, 1, 1, 1, 3, 4, 1, },
+ /* 4 TRIGGER: */ { 5, 4, 4, 4, 4, 4, 4, 4, },
+ /* 5 SEMI: */ { 5, 5, 4, 4, 4, 4, 4, 6, },
+ /* 6 END: */ { 0, 6, 4, 4, 4, 4, 4, 4, },
+ };
+#else
+ /* If triggers are not suppored by this compile then the statement machine
+ ** used to detect the end of a statement is much simplier
+ */
+ static const u8 trans[2][3] = {
+ /* Token: */
+ /* State: ** SEMI WS OTHER */
+ /* 0 START: */ { 0, 0, 1, },
+ /* 1 NORMAL: */ { 0, 1, 1, },
+ };
+#endif /* SQLITE_OMIT_TRIGGER */
+
+ while( *zSql ){
+ switch( *zSql ){
+ case ';': { /* A semicolon */
+ token = tkSEMI;
+ break;
+ }
+ case ' ':
+ case '\r':
+ case '\t':
+ case '\n':
+ case '\f': { /* White space is ignored */
+ token = tkWS;
+ break;
+ }
+ case '/': { /* C-style comments */
+ if( zSql[1]!='*' ){
+ token = tkOTHER;
+ break;
+ }
+ zSql += 2;
+ while( zSql[0] && (zSql[0]!='*' || zSql[1]!='/') ){ zSql++; }
+ if( zSql[0]==0 ) return 0;
+ zSql++;
+ token = tkWS;
+ break;
+ }
+ case '-': { /* SQL-style comments from "--" to end of line */
+ if( zSql[1]!='-' ){
+ token = tkOTHER;
+ break;
+ }
+ while( *zSql && *zSql!='\n' ){ zSql++; }
+ if( *zSql==0 ) return state==0;
+ token = tkWS;
+ break;
+ }
+ case '[': { /* Microsoft-style identifiers in [...] */
+ zSql++;
+ while( *zSql && *zSql!=']' ){ zSql++; }
+ if( *zSql==0 ) return 0;
+ token = tkOTHER;
+ break;
+ }
+ case '`': /* Grave-accent quoted symbols used by MySQL */
+ case '"': /* single- and double-quoted strings */
+ case '\'': {
+ int c = *zSql;
+ zSql++;
+ while( *zSql && *zSql!=c ){ zSql++; }
+ if( *zSql==0 ) return 0;
+ token = tkOTHER;
+ break;
+ }
+ default: {
+ int c;
+ if( IdChar((u8)*zSql) ){
+ /* Keywords and unquoted identifiers */
+ int nId;
+ for(nId=1; IdChar(zSql[nId]); nId++){}
+#ifdef SQLITE_OMIT_TRIGGER
+ token = tkOTHER;
+#else
+ switch( *zSql ){
+ case 'c': case 'C': {
+ if( nId==6 && sqlite3StrNICmp(zSql, "create", 6)==0 ){
+ token = tkCREATE;
+ }else{
+ token = tkOTHER;
+ }
+ break;
+ }
+ case 't': case 'T': {
+ if( nId==7 && sqlite3StrNICmp(zSql, "trigger", 7)==0 ){
+ token = tkTRIGGER;
+ }else if( nId==4 && sqlite3StrNICmp(zSql, "temp", 4)==0 ){
+ token = tkTEMP;
+ }else if( nId==9 && sqlite3StrNICmp(zSql, "temporary", 9)==0 ){
+ token = tkTEMP;
+ }else{
+ token = tkOTHER;
+ }
+ break;
+ }
+ case 'e': case 'E': {
+ if( nId==3 && sqlite3StrNICmp(zSql, "end", 3)==0 ){
+ token = tkEND;
+ }else
+#ifndef SQLITE_OMIT_EXPLAIN
+ if( nId==7 && sqlite3StrNICmp(zSql, "explain", 7)==0 ){
+ token = tkEXPLAIN;
+ }else
+#endif
+ {
+ token = tkOTHER;
+ }
+ break;
+ }
+ default: {
+ token = tkOTHER;
+ break;
+ }
+ }
+#endif /* SQLITE_OMIT_TRIGGER */
+ zSql += nId-1;
+ }else{
+ /* Operators and special symbols */
+ token = tkOTHER;
+ }
+ break;
+ }
+ }
+ state = trans[state][token];
+ zSql++;
+ }
+ return state==0;
+}
+
+#ifndef SQLITE_OMIT_UTF16
+/*
+** This routine is the same as the sqlite3_complete() routine described
+** above, except that the parameter is required to be UTF-16 encoded, not
+** UTF-8.
+*/
+int sqlite3_complete16(const void *zSql){
+ sqlite3_value *pVal;
+ char const *zSql8;
+ int rc = 0;
+
+ pVal = sqlite3ValueNew();
+ sqlite3ValueSetStr(pVal, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);
+ zSql8 = sqlite3ValueText(pVal, SQLITE_UTF8);
+ if( zSql8 ){
+ rc = sqlite3_complete(zSql8);
+ }
+ sqlite3ValueFree(pVal);
+ return sqlite3ApiExit(0, rc);
+}
+#endif /* SQLITE_OMIT_UTF16 */
+#endif /* SQLITE_OMIT_COMPLETE */
diff --git a/ext/pdo_sqlite/sqlite/src/date.c b/ext/pdo_sqlite/sqlite/src/date.c
index 7d398df48..914690618 100644
--- a/ext/pdo_sqlite/sqlite/src/date.c
+++ b/ext/pdo_sqlite/sqlite/src/date.c
@@ -105,18 +105,20 @@ static int getDigits(const char *zDate, ...){
val = 0;
while( N-- ){
if( !isdigit(*(u8*)zDate) ){
- return cnt;
+ goto end_getDigits;
}
val = val*10 + *zDate - '0';
zDate++;
}
if( val<min || val>max || (nextC!=0 && nextC!=*zDate) ){
- return cnt;
+ goto end_getDigits;
}
*pVal = val;
zDate++;
cnt++;
}while( nextC );
+end_getDigits:
+ va_end(ap);
return cnt;
}
@@ -236,7 +238,7 @@ static void computeJD(DateTime *p){
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->rJD -= p->tz*60/86400.0;
p->validHMS = 0;
p->validTZ = 0;
}
@@ -639,10 +641,10 @@ 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;
+ parseDateOrTime((char*)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;
+ parseModifier((char*)sqlite3_value_text(argv[i]), p) ) return 1;
}
return 0;
}
@@ -755,7 +757,7 @@ static void strftimeFunc(
DateTime x;
int n, i, j;
char *z;
- const char *zFmt = sqlite3_value_text(argv[0]);
+ const char *zFmt = (const char*)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++){
@@ -816,20 +818,20 @@ static void strftimeFunc(
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 */
+ int nDay; /* 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;
+ nDay = 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);
+ sprintf(&z[j],"%02d",(nDay+7-wd)/7);
j += 2;
}else{
- sprintf(&z[j],"%03d",n+1);
+ sprintf(&z[j],"%03d",nDay+1);
j += 3;
}
break;
@@ -974,7 +976,7 @@ void sqlite3RegisterDateTimeFunctions(sqlite3 *db){
int i;
for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
- sqlite3_create_function(db, aFuncs[i].zName, aFuncs[i].nArg,
+ sqlite3CreateFunc(db, aFuncs[i].zName, aFuncs[i].nArg,
SQLITE_UTF8, 0, aFuncs[i].xFunc, 0, 0);
}
#else
@@ -989,7 +991,7 @@ void sqlite3RegisterDateTimeFunctions(sqlite3 *db){
int i;
for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){
- sqlite3_create_function(db, aFuncs[i].zName, 0, SQLITE_UTF8,
+ sqlite3CreateFunc(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
index 7eb618b78..ee1bc930b 100644
--- a/ext/pdo_sqlite/sqlite/src/delete.c
+++ b/ext/pdo_sqlite/sqlite/src/delete.c
@@ -42,8 +42,12 @@ Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){
** writable return 0;
*/
int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){
- if( pTab->readOnly && (pParse->db->flags & SQLITE_WriteSchema)==0
- && pParse->nested==0 ){
+ if( (pTab->readOnly && (pParse->db->flags & SQLITE_WriteSchema)==0
+ && pParse->nested==0)
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ || (pTab->pMod && pTab->pMod->pModule->xUpdate==0)
+#endif
+ ){
sqlite3ErrorMsg(pParse, "table %s may not be modified", pTab->zName);
return 1;
}
@@ -59,14 +63,21 @@ int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){
/*
** Generate code that will open a table for reading.
*/
-void sqlite3OpenTableForReading(
- Vdbe *v, /* Generate code into this VDBE */
+void sqlite3OpenTable(
+ Parse *p, /* Generate code into this VDBE */
int iCur, /* The cursor number of the table */
- Table *pTab /* The table to be opened */
+ int iDb, /* The database index in sqlite3.aDb[] */
+ Table *pTab, /* The table to be opened */
+ int opcode /* OP_OpenRead or OP_OpenWrite */
){
- sqlite3VdbeAddOp(v, OP_Integer, pTab->iDb, 0);
+ Vdbe *v;
+ if( IsVirtual(pTab) ) return;
+ v = sqlite3GetVdbe(p);
+ assert( opcode==OP_OpenWrite || opcode==OP_OpenRead );
+ sqlite3TableLock(p, iDb, pTab->tnum, (opcode==OP_OpenWrite), pTab->zName);
+ sqlite3VdbeAddOp(v, OP_Integer, iDb, 0);
VdbeComment((v, "# %s", pTab->zName));
- sqlite3VdbeAddOp(v, OP_OpenRead, iCur, pTab->tnum);
+ sqlite3VdbeAddOp(v, opcode, iCur, pTab->tnum);
sqlite3VdbeAddOp(v, OP_SetNumColumns, iCur, pTab->nCol);
}
@@ -95,6 +106,7 @@ void sqlite3DeleteFrom(
AuthContext sContext; /* Authorization context */
int oldIdx = -1; /* Cursor for the OLD table of AFTER triggers */
NameContext sNC; /* Name context to resolve expressions in */
+ int iDb;
#ifndef SQLITE_OMIT_TRIGGER
int isView; /* True if attempting to delete from a view */
@@ -102,7 +114,7 @@ void sqlite3DeleteFrom(
#endif
sContext.pParse = 0;
- if( pParse->nErr || sqlite3_malloc_failed ){
+ if( pParse->nErr || sqlite3MallocFailed() ){
goto delete_from_cleanup;
}
db = pParse->db;
@@ -134,15 +146,16 @@ void sqlite3DeleteFrom(
if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){
goto delete_from_cleanup;
}
- assert( pTab->iDb<db->nDb );
- zDb = db->aDb[pTab->iDb].zName;
+ iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
+ assert( iDb<db->nDb );
+ zDb = db->aDb[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) ){
+ if( sqlite3ViewGetColumnNames(pParse, pTab) ){
goto delete_from_cleanup;
}
@@ -176,14 +189,14 @@ void sqlite3DeleteFrom(
goto delete_from_cleanup;
}
if( pParse->nested==0 ) sqlite3VdbeCountChanges(v);
- sqlite3BeginWriteOperation(pParse, triggers_exist, pTab->iDb);
+ sqlite3BeginWriteOperation(pParse, triggers_exist, 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);
+ sqlite3Select(pParse, pView, SRT_EphemTab, iCur, 0, 0, 0, 0);
sqlite3SelectDelete(pView);
}
@@ -198,40 +211,36 @@ void sqlite3DeleteFrom(
** 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( pWhere==0 && !triggers_exist && !IsVirtual(pTab) ){
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;
+ int addr2;
if( !isView ){
- sqlite3OpenTableForReading(v, iCur, pTab);
+ sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead);
}
sqlite3VdbeAddOp(v, OP_Rewind, iCur, sqlite3VdbeCurrentAddr(v)+2);
- addr = sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
- sqlite3VdbeAddOp(v, OP_Next, iCur, addr);
+ addr2 = sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Next, iCur, addr2);
sqlite3VdbeResolveLabel(v, endOfLoop);
sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
}
if( !isView ){
- sqlite3VdbeAddOp(v, OP_Clear, pTab->tnum, pTab->iDb);
+ sqlite3VdbeAddOp(v, OP_Clear, pTab->tnum, iDb);
+ if( !pParse->nested ){
+ sqlite3VdbeChangeP3(v, -1, pTab->zName, P3_STATIC);
+ }
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
- sqlite3VdbeAddOp(v, OP_Clear, pIdx->tnum, pIdx->iDb);
+ assert( pIdx->pSchema==pTab->pSchema );
+ sqlite3VdbeAddOp(v, OP_Clear, pIdx->tnum, 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);
@@ -239,7 +248,7 @@ void sqlite3DeleteFrom(
/* Remember the rowid of every item to be deleted.
*/
- sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
+ sqlite3VdbeAddOp(v, IsVirtual(pTab) ? OP_VRowid : OP_Rowid, iCur, 0);
sqlite3VdbeAddOp(v, OP_FifoWrite, 0, 0);
if( db->flags & SQLITE_CountRows ){
sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
@@ -269,7 +278,7 @@ void sqlite3DeleteFrom(
addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, end);
if( !isView ){
sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
- sqlite3OpenTableForReading(v, iCur, pTab);
+ sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead);
}
sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0);
sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
@@ -300,7 +309,15 @@ void sqlite3DeleteFrom(
}
/* Delete the row */
- sqlite3GenerateRowDelete(db, v, pTab, iCur, pParse->nested==0);
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( IsVirtual(pTab) ){
+ pParse->pVirtualLock = pTab;
+ sqlite3VdbeOp3(v, OP_VUpdate, 0, 1, (const char*)pTab->pVtab, P3_VTAB);
+ }else
+#endif
+ {
+ sqlite3GenerateRowDelete(db, v, pTab, iCur, pParse->nested==0);
+ }
}
/* If there are row triggers, close all cursors then invoke
@@ -323,7 +340,7 @@ void sqlite3DeleteFrom(
sqlite3VdbeResolveLabel(v, end);
/* Close the cursors after the loop if there are no row triggers */
- if( !triggers_exist ){
+ if( !triggers_exist && !IsVirtual(pTab) ){
for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
sqlite3VdbeAddOp(v, OP_Close, iCur + i, pIdx->tnum);
}
@@ -339,7 +356,7 @@ void sqlite3DeleteFrom(
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);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows deleted", P3_STATIC);
}
delete_from_cleanup:
@@ -378,8 +395,11 @@ void sqlite3GenerateRowDelete(
){
int addr;
addr = sqlite3VdbeAddOp(v, OP_NotExists, iCur, 0);
- sqlite3GenerateRowIndexDelete(db, v, pTab, iCur, 0);
+ sqlite3GenerateRowIndexDelete(v, pTab, iCur, 0);
sqlite3VdbeAddOp(v, OP_Delete, iCur, (count?OPFLAG_NCHANGE:0));
+ if( count ){
+ sqlite3VdbeChangeP3(v, -1, pTab->zName, P3_STATIC);
+ }
sqlite3VdbeJumpHere(v, addr);
}
@@ -400,7 +420,6 @@ void sqlite3GenerateRowDelete(
** 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 */
diff --git a/ext/pdo_sqlite/sqlite/src/experimental.c b/ext/pdo_sqlite/sqlite/src/experimental.c
deleted file mode 100644
index cbdcf464a..000000000
--- 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: experimental.c,v 1.3.2.4 2005/10/03 23:48:21 tony2001 Exp $
-*/
-#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
index 1276fe9f6..e26aba5b3 100644
--- a/ext/pdo_sqlite/sqlite/src/expr.c
+++ b/ext/pdo_sqlite/sqlite/src/expr.c
@@ -75,12 +75,10 @@ CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){
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.
+ /* Both sides of the comparison are columns. If one has numeric
+ ** 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 ){
+ if( sqlite3IsNumericAffinity(aff1) || sqlite3IsNumericAffinity(aff2) ){
return SQLITE_AFF_NUMERIC;
}else{
return SQLITE_AFF_NONE;
@@ -89,7 +87,6 @@ char sqlite3CompareAffinity(Expr *pExpr, char 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. */
@@ -129,11 +126,14 @@ static char comparisonAffinity(Expr *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);
+ switch( aff ){
+ case SQLITE_AFF_NONE:
+ return 1;
+ case SQLITE_AFF_TEXT:
+ return idx_affinity==SQLITE_AFF_TEXT;
+ default:
+ return sqlite3IsNumericAffinity(idx_affinity);
+ }
}
/*
@@ -212,6 +212,19 @@ Expr *sqlite3Expr(int op, Expr *pLeft, Expr *pRight, const Token *pToken){
}
/*
+** Works like sqlite3Expr() but frees its pLeft and pRight arguments
+** if it fails due to a malloc problem.
+*/
+Expr *sqlite3ExprOrFree(int op, Expr *pLeft, Expr *pRight, const Token *pToken){
+ Expr *pNew = sqlite3Expr(op, pLeft, pRight, pToken);
+ if( pNew==0 ){
+ sqlite3ExprDelete(pLeft);
+ sqlite3ExprDelete(pRight);
+ }
+ 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.
@@ -235,7 +248,7 @@ Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){
if( p==0 ){
return 0; /* Malloc failed */
}
- depth = atoi(&pToken->z[1]);
+ depth = atoi((char*)&pToken->z[1]);
p->iTable = pParse->nMem++;
sqlite3VdbeAddOp(v, OP_Dup, depth, 0);
sqlite3VdbeAddOp(v, OP_MemStore, p->iTable, 1);
@@ -263,7 +276,7 @@ Expr *sqlite3ExprAnd(Expr *pLeft, Expr *pRight){
void sqlite3ExprSpan(Expr *pExpr, Token *pLeft, Token *pRight){
assert( pRight!=0 );
assert( pLeft!=0 );
- if( !sqlite3_malloc_failed && pRight->z && pLeft->z ){
+ if( !sqlite3MallocFailed() && 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;
@@ -280,6 +293,7 @@ void sqlite3ExprSpan(Expr *pExpr, Token *pLeft, Token *pRight){
*/
Expr *sqlite3ExprFunction(ExprList *pList, Token *pToken){
Expr *pNew;
+ assert( pToken );
pNew = sqliteMalloc( sizeof(Expr) );
if( pNew==0 ){
sqlite3ExprListDelete(pList); /* Avoid leaking memory when malloc fails */
@@ -287,12 +301,8 @@ Expr *sqlite3ExprFunction(ExprList *pList, Token *pToken){
}
pNew->op = TK_FUNCTION;
pNew->pList = pList;
- if( pToken ){
- assert( pToken->dyn==0 );
- pNew->token = *pToken;
- }else{
- pNew->token.z = 0;
- }
+ assert( pToken->dyn==0 );
+ pNew->token = *pToken;
pNew->span = pNew->token;
return pNew;
}
@@ -327,7 +337,7 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
/* 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]);
+ pExpr->iTable = i = atoi((char*)&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);
@@ -355,10 +365,10 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
pExpr->iTable = ++pParse->nVar;
if( pParse->nVarExpr>=pParse->nVarExprAlloc-1 ){
pParse->nVarExprAlloc += pParse->nVarExprAlloc + 10;
- sqlite3ReallocOrFree((void**)&pParse->apVarExpr,
+ sqliteReallocOrFree((void**)&pParse->apVarExpr,
pParse->nVarExprAlloc*sizeof(pParse->apVarExpr[0]) );
}
- if( !sqlite3_malloc_failed ){
+ if( !sqlite3MallocFailed() ){
assert( pParse->apVarExpr!=0 );
pParse->apVarExpr[pParse->nVarExpr++] = pExpr;
}
@@ -415,7 +425,7 @@ Expr *sqlite3ExprDup(Expr *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.z = (u8*)sqliteStrNDup((char*)p->token.z, p->token.n);
pNew->token.dyn = 1;
}else{
assert( pNew->token.z==0 );
@@ -432,7 +442,7 @@ 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->z = (u8*)sqliteStrNDup((char*)pFrom->z, pFrom->n);
pTo->dyn = 1;
}else{
pTo->z = 0;
@@ -462,7 +472,8 @@ ExprList *sqlite3ExprListDup(ExprList *p){
sqlite3TokenCopy(&pNewExpr->span, &pOldExpr->span);
}
assert( pNewExpr==0 || pNewExpr->span.z!=0
- || pOldExpr->span.z==0 || sqlite3_malloc_failed );
+ || pOldExpr->span.z==0
+ || sqlite3MallocFailed() );
pItem->zName = sqliteStrDup(pOldItem->zName);
pItem->sortOrder = pOldItem->sortOrder;
pItem->isAgg = pOldItem->isAgg;
@@ -497,6 +508,7 @@ SrcList *sqlite3SrcListDup(SrcList *p){
pNewItem->zAlias = sqliteStrDup(pOldItem->zAlias);
pNewItem->jointype = pOldItem->jointype;
pNewItem->iCursor = pOldItem->iCursor;
+ pNewItem->isPopulated = pOldItem->isPopulated;
pTab = pNewItem->pTab = pOldItem->pTab;
if( pTab ){
pTab->nRef++;
@@ -548,12 +560,12 @@ Select *sqlite3SelectDup(Select *p){
pNew->iOffset = -1;
pNew->isResolved = p->isResolved;
pNew->isAgg = p->isAgg;
- pNew->usesVirt = 0;
+ pNew->usesEphm = 0;
pNew->disallowOrderBy = 0;
pNew->pRightmost = 0;
- pNew->addrOpenVirt[0] = -1;
- pNew->addrOpenVirt[1] = -1;
- pNew->addrOpenVirt[2] = -1;
+ pNew->addrOpenEphm[0] = -1;
+ pNew->addrOpenEphm[1] = -1;
+ pNew->addrOpenEphm[2] = -1;
return pNew;
}
#else
@@ -752,7 +764,7 @@ int sqlite3ExprIsConstantOrFunction(Expr *p){
int sqlite3ExprIsInteger(Expr *p, int *pValue){
switch( p->op ){
case TK_INTEGER: {
- if( sqlite3GetInt32(p->token.z, pValue) ){
+ if( sqlite3GetInt32((char*)p->token.z, pValue) ){
return 1;
}
break;
@@ -809,7 +821,7 @@ int sqlite3IsRowid(const char *z){
** in pParse and return non-zero. Return zero on success.
*/
static int lookupName(
- Parse *pParse, /* The parsing context */
+ 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. */
@@ -831,22 +843,24 @@ static int lookupName(
zDb = sqlite3NameFromToken(pDbToken);
zTab = sqlite3NameFromToken(pTableToken);
zCol = sqlite3NameFromToken(pColumnToken);
- if( sqlite3_malloc_failed ){
+ if( sqlite3MallocFailed() ){
goto lookupname_end;
}
pExpr->iTable = -1;
while( pNC && cnt==0 ){
+ ExprList *pEList;
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;
+ Table *pTab;
+ int iDb;
Column *pCol;
- if( pTab==0 ) continue;
+ pTab = pItem->pTab;
+ assert( pTab!=0 );
+ iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
assert( pTab->nCol>0 );
if( zTab ){
if( pItem->zAlias ){
@@ -855,27 +869,28 @@ static int lookupName(
}else{
char *zTabName = pTab->zName;
if( zTabName==0 || sqlite3StrICmp(zTabName, zTab)!=0 ) continue;
- if( zDb!=0 && sqlite3StrICmp(db->aDb[pTab->iDb].zName, zDb)!=0 ){
+ if( zDb!=0 && sqlite3StrICmp(db->aDb[iDb].zName, zDb)!=0 ){
continue;
}
}
}
if( 0==(cntTab++) ){
pExpr->iTable = pItem->iCursor;
- pExpr->iDb = pTab->iDb;
+ pExpr->pSchema = pTab->pSchema;
pMatch = pItem;
}
for(j=0, pCol=pTab->aCol; j<pTab->nCol; j++, pCol++){
if( sqlite3StrICmp(pCol->zName, zCol)==0 ){
+ const char *zColl = pTab->aCol[j].zColl;
IdList *pUsing;
cnt++;
pExpr->iTable = pItem->iCursor;
pMatch = pItem;
- pExpr->iDb = pTab->iDb;
+ pExpr->pSchema = pTab->pSchema;
/* 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;
+ pExpr->pColl = sqlite3FindCollSeq(db, ENC(db), zColl,-1, 0);
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 */
@@ -919,17 +934,18 @@ static int lookupName(
}
if( pTab ){
- int j;
+ int iCol;
Column *pCol = pTab->aCol;
- pExpr->iDb = pTab->iDb;
+ pExpr->pSchema = pTab->pSchema;
cntTab++;
- for(j=0; j < pTab->nCol; j++, pCol++) {
+ for(iCol=0; iCol < pTab->nCol; iCol++, pCol++) {
if( sqlite3StrICmp(pCol->zName, zCol)==0 ){
+ const char *zColl = pTab->aCol[iCol].zColl;
cnt++;
- pExpr->iColumn = j==pTab->iPKey ? -1 : j;
- pExpr->affinity = pTab->aCol[j].affinity;
- pExpr->pColl = pTab->aCol[j].pColl;
+ pExpr->iColumn = iCol==pTab->iPKey ? -1 : iCol;
+ pExpr->affinity = pTab->aCol[iCol].affinity;
+ pExpr->pColl = sqlite3FindCollSeq(db, ENC(db), zColl,-1, 0);
pExpr->pTab = pTab;
break;
}
@@ -959,7 +975,7 @@ static int lookupName(
** 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 ){
+ if( cnt==0 && (pEList = pNC->pEList)!=0 && zTab==0 ){
for(j=0; j<pEList->nExpr; j++){
char *zAs = pEList->a[j].zName;
if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){
@@ -1006,9 +1022,9 @@ static int lookupName(
char *zErr;
zErr = cnt==0 ? "no such column: %s" : "ambiguous column name: %s";
if( zDb ){
- sqlite3SetString(&z, zDb, ".", zTab, ".", zCol, 0);
+ sqlite3SetString(&z, zDb, ".", zTab, ".", zCol, (char*)0);
}else if( zTab ){
- sqlite3SetString(&z, zTab, ".", zCol, 0);
+ sqlite3SetString(&z, zTab, ".", zCol, (char*)0);
}else{
z = sqliteStrDup(zCol);
}
@@ -1077,20 +1093,19 @@ lookupname_end_2:
*/
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 ){
+ if( pNC->pSrcList && pNC->pSrcList->nAlloc>0 ){
+ SrcList *pSrcList = pNC->pSrcList;
int i;
- for(i=0; i<pSrcList->nSrc; i++){
+ for(i=0; i<pNC->pSrcList->nSrc; i++){
assert( pSrcList->a[i].iCursor>=0 && pSrcList->a[i].iCursor<pParse->nTab);
}
}
@@ -1149,9 +1164,9 @@ static int nameResolverStep(void *pArg, Expr *pExpr){
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 */
+ int enc = ENC(pParse->db); /* The database encoding */
- zId = pExpr->token.z;
+ zId = (char*)pExpr->token.z;
nId = pExpr->token.n;
pDef = sqlite3FindFunction(pParse->db, zId, nId, n, enc, 0);
if( pDef==0 ){
@@ -1197,13 +1212,27 @@ static int nameResolverStep(void *pArg, Expr *pExpr){
case TK_IN: {
if( pExpr->pSelect ){
int nRef = pNC->nRef;
+#ifndef SQLITE_OMIT_CHECK
+ if( pNC->isCheck ){
+ sqlite3ErrorMsg(pParse,"subqueries prohibited in CHECK constraints");
+ }
+#endif
sqlite3SelectResolve(pParse, pExpr->pSelect, pNC);
assert( pNC->nRef>=nRef );
if( nRef!=pNC->nRef ){
ExprSetProperty(pExpr, EP_VarSelect);
}
}
+ break;
+ }
+#ifndef SQLITE_OMIT_CHECK
+ case TK_VARIABLE: {
+ if( pNC->isCheck ){
+ sqlite3ErrorMsg(pParse,"parameters prohibited in CHECK constraints");
+ }
+ break;
}
+#endif
}
return 0;
}
@@ -1261,17 +1290,16 @@ struct QueryCoder {
/*
-** Generate code for subqueries and IN operators.
+** Generate code for scalar subqueries used as an expression
+** and IN operators. Examples:
**
-** IN operators comes in two forms:
+** (SELECT a FROM b) -- subquery
+** EXISTS (SELECT a FROM b) -- EXISTS subquery
+** x IN (4,5,11) -- IN operator with list on right-hand side
+** x IN (SELECT a FROM b) -- IN operator with subquery on the right
**
-** 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.
+** The pExpr parameter describes the expression that contains the IN
+** operator or subquery.
*/
#ifndef SQLITE_OMIT_SUBQUERY
void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
@@ -1293,7 +1321,7 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
int mem = pParse->nMem++;
sqlite3VdbeAddOp(v, OP_MemLoad, mem, 0);
testAddr = sqlite3VdbeAddOp(v, OP_If, 0, 0);
- assert( testAddr>0 || sqlite3_malloc_failed );
+ assert( testAddr>0 || sqlite3MallocFailed() );
sqlite3VdbeAddOp(v, OP_MemInt, 1, mem);
}
@@ -1301,7 +1329,7 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
case TK_IN: {
char affinity;
KeyInfo keyInfo;
- int addr; /* Address of OP_OpenVirtual instruction */
+ int addr; /* Address of OP_OpenEphemeral instruction */
affinity = sqlite3ExprAffinity(pExpr->pLeft);
@@ -1319,7 +1347,7 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
** is used.
*/
pExpr->iTable = pParse->nTab++;
- addr = sqlite3VdbeAddOp(v, OP_OpenVirtual, pExpr->iTable, 0);
+ addr = sqlite3VdbeAddOp(v, OP_OpenEphemeral, pExpr->iTable, 0);
memset(&keyInfo, 0, sizeof(keyInfo));
keyInfo.nField = 1;
sqlite3VdbeAddOp(v, OP_SetNumColumns, pExpr->iTable, 1);
@@ -1352,7 +1380,7 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
struct ExprList_item *pItem;
if( !affinity ){
- affinity = SQLITE_AFF_NUMERIC;
+ affinity = SQLITE_AFF_NONE;
}
keyInfo.aColl[0] = pExpr->pLeft->pColl;
@@ -1366,11 +1394,7 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
** 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;
- }
+ sqlite3VdbeChangeToNoop(v, testAddr-1, 3);
testAddr = 0;
}
@@ -1390,21 +1414,25 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
** value of this select in a memory cell and record the number
** of the memory cell in iColumn.
*/
- int sop;
+ static const Token one = { (u8*)"1", 0, 1 };
Select *pSel;
+ int iMem;
+ int sop;
- pExpr->iColumn = pParse->nMem++;
+ pExpr->iColumn = iMem = pParse->nMem++;
pSel = pExpr->pSelect;
if( pExpr->op==TK_SELECT ){
sop = SRT_Mem;
+ sqlite3VdbeAddOp(v, OP_MemNull, iMem, 0);
+ VdbeComment((v, "# Init subquery result"));
}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);
+ sqlite3VdbeAddOp(v, OP_MemInt, 0, iMem);
+ VdbeComment((v, "# Init EXISTS result"));
}
- sqlite3Select(pParse, pSel, sop, pExpr->iColumn, 0, 0, 0, 0);
+ sqlite3ExprDelete(pSel->pLimit);
+ pSel->pLimit = sqlite3Expr(TK_INTEGER, 0, 0, &one);
+ sqlite3Select(pParse, pSel, sop, iMem, 0, 0, 0, 0);
break;
}
}
@@ -1444,6 +1472,8 @@ static void codeInteger(Vdbe *v, const char *z, int n){
void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
Vdbe *v = pParse->pVdbe;
int op;
+ int stackChng = 1; /* Amount of change to stack depth */
+
if( v==0 ) return;
if( pExpr==0 ){
sqlite3VdbeAddOp(v, OP_Null, 0, 0);
@@ -1465,16 +1495,30 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
/* 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);
+ if( pExpr->iTable<0 ){
+ /* This only happens when coding check constraints */
+ assert( pParse->ckOffset>0 );
+ sqlite3VdbeAddOp(v, OP_Dup, pParse->ckOffset-pExpr->iColumn-1, 1);
+ }else if( pExpr->iColumn>=0 ){
+ Table *pTab = pExpr->pTab;
+ int iCol = pExpr->iColumn;
+ int op = (pTab && IsVirtual(pTab)) ? OP_VColumn : OP_Column;
+ sqlite3VdbeAddOp(v, op, pExpr->iTable, iCol);
+ sqlite3ColumnDefault(v, pTab, iCol);
+#ifndef SQLITE_OMIT_FLOATING_POINT
+ if( pTab && pTab->aCol[iCol].affinity==SQLITE_AFF_REAL ){
+ sqlite3VdbeAddOp(v, OP_RealAffinity, 0, 0);
+ }
+#endif
}else{
- sqlite3VdbeAddOp(v, OP_Rowid, pExpr->iTable, 0);
+ Table *pTab = pExpr->pTab;
+ int op = (pTab && IsVirtual(pTab)) ? OP_VRowid : OP_Rowid;
+ sqlite3VdbeAddOp(v, op, pExpr->iTable, 0);
}
break;
}
case TK_INTEGER: {
- codeInteger(v, pExpr->token.z, pExpr->token.n);
+ codeInteger(v, (char*)pExpr->token.z, pExpr->token.n);
break;
}
case TK_FLOAT:
@@ -1482,7 +1526,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
assert( TK_FLOAT==OP_Real );
assert( TK_STRING==OP_String8 );
sqlite3DequoteExpr(pExpr);
- sqlite3VdbeOp3(v, op, 0, 0, pExpr->token.z, pExpr->token.n);
+ sqlite3VdbeOp3(v, op, 0, 0, (char*)pExpr->token.z, pExpr->token.n);
break;
}
case TK_NULL: {
@@ -1495,7 +1539,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
const char *z;
assert( TK_BLOB==OP_HexBlob );
n = pExpr->token.n - 3;
- z = pExpr->token.z + 2;
+ z = (char*)pExpr->token.z + 2;
assert( n>=0 );
if( n==0 ){
z = "";
@@ -1507,7 +1551,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
case TK_VARIABLE: {
sqlite3VdbeAddOp(v, OP_Variable, pExpr->iTable, 0);
if( pExpr->token.n>1 ){
- sqlite3VdbeChangeP3(v, -1, pExpr->token.z, pExpr->token.n);
+ sqlite3VdbeChangeP3(v, -1, (char*)pExpr->token.z, pExpr->token.n);
}
break;
}
@@ -1518,16 +1562,17 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
#ifndef SQLITE_OMIT_CAST
case TK_CAST: {
/* Expressions of the form: CAST(pLeft AS token) */
- int aff, op;
+ int aff, to_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);
+ to_op = aff - SQLITE_AFF_TEXT + OP_ToText;
+ assert( to_op==OP_ToText || aff!=SQLITE_AFF_TEXT );
+ assert( to_op==OP_ToBlob || aff!=SQLITE_AFF_NONE );
+ assert( to_op==OP_ToNumeric || aff!=SQLITE_AFF_NUMERIC );
+ assert( to_op==OP_ToInt || aff!=SQLITE_AFF_INTEGER );
+ assert( to_op==OP_ToReal || aff!=SQLITE_AFF_REAL );
+ sqlite3VdbeAddOp(v, to_op, 0, 0);
+ stackChng = 0;
break;
}
#endif /* SQLITE_OMIT_CAST */
@@ -1546,6 +1591,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
sqlite3ExprCode(pParse, pExpr->pLeft);
sqlite3ExprCode(pParse, pExpr->pRight);
codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, 0, 0);
+ stackChng = -1;
break;
}
case TK_AND:
@@ -1574,6 +1620,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
sqlite3ExprCode(pParse, pExpr->pLeft);
sqlite3ExprCode(pParse, pExpr->pRight);
sqlite3VdbeAddOp(v, op, 0, 0);
+ stackChng = -1;
break;
}
case TK_UMINUS: {
@@ -1581,8 +1628,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
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);
+ char *z = sqlite3MPrintf("-%.*s", p->n, p->z);
if( pLeft->op==TK_FLOAT ){
sqlite3VdbeOp3(v, OP_Real, 0, 0, z, p->n+1);
}else{
@@ -1599,6 +1645,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
assert( TK_NOT==OP_Not );
sqlite3ExprCode(pParse, pExpr->pLeft);
sqlite3VdbeAddOp(v, op, 0, 0);
+ stackChng = 0;
break;
}
case TK_ISNULL:
@@ -1611,11 +1658,17 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
dest = sqlite3VdbeCurrentAddr(v) + 2;
sqlite3VdbeAddOp(v, op, 1, dest);
sqlite3VdbeAddOp(v, OP_AddImm, -1, 0);
+ stackChng = 0;
break;
}
case TK_AGG_FUNCTION: {
AggInfo *pInfo = pExpr->pAggInfo;
- sqlite3VdbeAddOp(v, OP_MemLoad, pInfo->aFunc[pExpr->iAgg].iMem, 0);
+ if( pInfo==0 ){
+ sqlite3ErrorMsg(pParse, "misuse of aggregate: %T",
+ &pExpr->span);
+ }else{
+ sqlite3VdbeAddOp(v, OP_MemLoad, pInfo->aFunc[pExpr->iAgg].iMem, 0);
+ }
break;
}
case TK_CONST_FUNC:
@@ -1627,13 +1680,32 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
const char *zId;
int constMask = 0;
int i;
- u8 enc = pParse->db->enc;
+ u8 enc = ENC(pParse->db);
CollSeq *pColl = 0;
- zId = pExpr->token.z;
+ zId = (char*)pExpr->token.z;
nId = pExpr->token.n;
pDef = sqlite3FindFunction(pParse->db, zId, nId, nExpr, enc, 0);
assert( pDef!=0 );
nExpr = sqlite3ExprCodeExprList(pParse, pList);
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ /* Possibly overload the function if the first argument is
+ ** a virtual table column.
+ **
+ ** For infix functions (LIKE, GLOB, REGEXP, and MATCH) use the
+ ** second argument, not the first, as the argument to test to
+ ** see if it is a column in a virtual table. This is done because
+ ** the left operand of infix functions (the operand we want to
+ ** control overloading) ends up as the second argument to the
+ ** function. The expression "A glob B" is equivalent to
+ ** "glob(B,A). We want to use the A in "A glob B" to test
+ ** for function overloading. But we use the B term in "glob(B,A)".
+ */
+ if( nExpr>=2 && (pExpr->flags & EP_InfixFunc) ){
+ pDef = sqlite3VtabOverloadFunction(pDef, nExpr, pList->a[1].pExpr);
+ }else if( nExpr>0 ){
+ pDef = sqlite3VtabOverloadFunction(pDef, nExpr, pList->a[0].pExpr);
+ }
+#endif
for(i=0; i<nExpr && i<32; i++){
if( sqlite3ExprIsConstant(pList->a[i].pExpr) ){
constMask |= (1<<i);
@@ -1647,12 +1719,15 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
sqlite3VdbeOp3(v, OP_CollSeq, 0, 0, (char *)pColl, P3_COLLSEQ);
}
sqlite3VdbeOp3(v, OP_Function, constMask, nExpr, (char*)pDef, P3_FUNCDEF);
+ stackChng = 1-nExpr;
break;
}
#ifndef SQLITE_OMIT_SUBQUERY
case TK_EXISTS:
case TK_SELECT: {
- sqlite3CodeSubselect(pParse, pExpr);
+ if( pExpr->iColumn==0 ){
+ sqlite3CodeSubselect(pParse, pExpr);
+ }
sqlite3VdbeAddOp(v, OP_MemLoad, pExpr->iColumn, 0);
VdbeComment((v, "# load subquery result"));
break;
@@ -1660,6 +1735,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
case TK_IN: {
int addr;
char affinity;
+ int ckOffset = pParse->ckOffset;
sqlite3CodeSubselect(pParse, pExpr);
/* Figure out the affinity to use to create a key from the results
@@ -1669,6 +1745,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
affinity = comparisonAffinity(pExpr);
sqlite3VdbeAddOp(v, OP_Integer, 1, 0);
+ pParse->ckOffset = ckOffset+1;
/* Code the <expr> from "<expr> IN (...)". The temporary table
** pExpr->iTable contains the values that make up the (...) set.
@@ -1705,6 +1782,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
case TK_UPLUS:
case TK_AS: {
sqlite3ExprCode(pParse, pExpr->pLeft);
+ stackChng = 0;
break;
}
case TK_CASE: {
@@ -1763,16 +1841,22 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
pExpr->iColumn == OE_Fail );
sqlite3DequoteExpr(pExpr);
sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, pExpr->iColumn,
- pExpr->token.z, pExpr->token.n);
+ (char*)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)"));
}
+ stackChng = 0;
+ break;
}
#endif
- break;
+ }
+
+ if( pParse->ckOffset ){
+ pParse->ckOffset += stackChng;
+ assert( pParse->ckOffset );
}
}
@@ -1840,6 +1924,7 @@ int sqlite3ExprCodeExprList(
void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
Vdbe *v = pParse->pVdbe;
int op = 0;
+ int ckOffset = pParse->ckOffset;
if( v==0 || pExpr==0 ) return;
op = pExpr->op;
switch( op ){
@@ -1914,6 +1999,7 @@ void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
break;
}
}
+ pParse->ckOffset = ckOffset;
}
/*
@@ -1927,6 +2013,7 @@ void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
Vdbe *v = pParse->pVdbe;
int op = 0;
+ int ckOffset = pParse->ckOffset;
if( v==0 || pExpr==0 ) return;
/* The value of pExpr->op and op are related as follows:
@@ -2023,6 +2110,7 @@ void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
break;
}
}
+ pParse->ckOffset = ckOffset;
}
/*
@@ -2031,10 +2119,8 @@ void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
*/
int sqlite3ExprCompare(Expr *pA, Expr *pB){
int i;
- if( pA==0 ){
- return pB==0;
- }else if( pB==0 ){
- return 0;
+ if( pA==0||pB==0 ){
+ return pB==pA;
}
if( pA->op!=pB->op ) return 0;
if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 0;
@@ -2056,7 +2142,9 @@ int sqlite3ExprCompare(Expr *pA, Expr *pB){
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;
+ if( sqlite3StrNICmp((char*)pA->token.z,(char*)pB->token.z,pB->token.n)!=0 ){
+ return 0;
+ }
}
return 1;
}
@@ -2180,14 +2268,14 @@ static int analyzeAggregate(void *pArg, Expr *pExpr){
if( i>=pAggInfo->nFunc ){
/* pExpr is original. Make a new entry in pAggInfo->aFunc[]
*/
- u8 enc = pParse->db->enc;
+ u8 enc = ENC(pParse->db);
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,
+ (char*)pExpr->token.z, pExpr->token.n,
pExpr->pList ? pExpr->pList->nExpr : 0, enc, 0);
if( pExpr->flags & EP_Distinct ){
pItem->iDistinct = pParse->nTab++;
diff --git a/ext/pdo_sqlite/sqlite/src/func.c b/ext/pdo_sqlite/sqlite/src/func.c
index cdb674fa2..bf422f92c 100644
--- a/ext/pdo_sqlite/sqlite/src/func.c
+++ b/ext/pdo_sqlite/sqlite/src/func.c
@@ -20,7 +20,6 @@
*/
#include "sqliteInt.h"
#include <ctype.h>
-#include <math.h>
#include <stdlib.h>
#include <assert.h>
#include "vdbeInt.h"
@@ -101,7 +100,7 @@ static void lengthFunc(
break;
}
case SQLITE_TEXT: {
- const char *z = sqlite3_value_text(argv[0]);
+ const unsigned char *z = sqlite3_value_text(argv[0]);
for(len=0; *z; z++){ if( (0xc0&*z)!=0x80 ) len++; }
sqlite3_result_int(context, len);
break;
@@ -121,7 +120,13 @@ static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
switch( sqlite3_value_type(argv[0]) ){
case SQLITE_INTEGER: {
i64 iVal = sqlite3_value_int64(argv[0]);
- if( iVal<0 ) iVal = iVal * -1;
+ if( iVal<0 ){
+ if( (iVal<<1)==0 ){
+ sqlite3_result_error(context, "integer overflow", -1);
+ return;
+ }
+ iVal = -iVal;
+ }
sqlite3_result_int64(context, iVal);
break;
}
@@ -131,7 +136,7 @@ static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
}
default: {
double rVal = sqlite3_value_double(argv[0]);
- if( rVal<0 ) rVal = rVal * -1.0;
+ if( rVal<0 ) rVal = -rVal;
sqlite3_result_double(context, rVal);
break;
}
@@ -146,8 +151,8 @@ static void substrFunc(
int argc,
sqlite3_value **argv
){
- const char *z;
- const char *z2;
+ const unsigned char *z;
+ const unsigned char *z2;
int i;
int p1, p2, len;
@@ -178,7 +183,7 @@ static void substrFunc(
}
while( z[i] && (z[i]&0xc0)==0x80 ){ i++; p2++; }
if( p2<0 ) p2 = 0;
- sqlite3_result_text(context, &z[p1], p2, SQLITE_TRANSIENT);
+ sqlite3_result_text(context, (char*)&z[p1], p2, SQLITE_TRANSIENT);
}
/*
@@ -195,10 +200,11 @@ static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
if( n>30 ) n = 30;
if( n<0 ) n = 0;
}
- if( SQLITE_NULL==sqlite3_value_type(argv[0]) ) return;
+ if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
r = sqlite3_value_double(argv[0]);
sqlite3_snprintf(sizeof(zBuf),zBuf,"%.*f",n,r);
- sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
+ sqlite3AtoF(zBuf, &r);
+ sqlite3_result_double(context, r);
}
/*
@@ -210,11 +216,11 @@ static void upperFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
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]));
+ strcpy((char*)z, (char*)sqlite3_value_text(argv[0]));
for(i=0; z[i]; i++){
z[i] = toupper(z[i]);
}
- sqlite3_result_text(context, z, -1, SQLITE_TRANSIENT);
+ sqlite3_result_text(context, (char*)z, -1, SQLITE_TRANSIENT);
sqliteFree(z);
}
static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
@@ -223,11 +229,11 @@ static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
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]));
+ strcpy((char*)z, (char*)sqlite3_value_text(argv[0]));
for(i=0; z[i]; i++){
z[i] = tolower(z[i]);
}
- sqlite3_result_text(context, z, -1, SQLITE_TRANSIENT);
+ sqlite3_result_text(context, (char*)z, -1, SQLITE_TRANSIENT);
sqliteFree(z);
}
@@ -258,9 +264,11 @@ static void randomFunc(
int argc,
sqlite3_value **argv
){
- int r;
+ sqlite_int64 r;
sqlite3Randomness(sizeof(r), &r);
- sqlite3_result_int(context, r);
+ if( (r<<1)==0 ) r = 0; /* Prevent 0x8000.... as the result so that we */
+ /* can always do abs() of the result */
+ sqlite3_result_int64(context, r);
}
/*
@@ -495,7 +503,7 @@ static void likeFunc(
** Otherwise, return an error.
*/
const unsigned char *zEsc = sqlite3_value_text(argv[2]);
- if( sqlite3utf8CharLen(zEsc, -1)!=1 ){
+ if( sqlite3utf8CharLen((char*)zEsc, -1)!=1 ){
sqlite3_result_error(context,
"ESCAPE expression must be a single character", -1);
return;
@@ -539,6 +547,19 @@ static void versionFunc(
sqlite3_result_text(context, sqlite3_version, -1, SQLITE_STATIC);
}
+/*
+** The MATCH() function is unimplemented. If anybody tries to use it,
+** return an error.
+*/
+static void matchStub(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ static const char zErr[] = "MATCH is not implemented";
+ sqlite3_result_error(context, zErr, sizeof(zErr)-1);
+}
+
/*
** EXPERIMENTAL - This is not an official function. The interface may
@@ -592,7 +613,7 @@ static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
}
case SQLITE_TEXT: {
int i,j,n;
- const char *zArg = sqlite3_value_text(argv[0]);
+ const unsigned char *zArg = sqlite3_value_text(argv[0]);
char *z;
for(i=n=0; zArg[i]; i++){ if( zArg[i]=='\'' ) n++; }
@@ -633,6 +654,7 @@ static void soundexFunc(sqlite3_context *context, int argc, sqlite3_value **argv
};
assert( argc==1 );
zIn = (u8*)sqlite3_value_text(argv[0]);
+ if( zIn==0 ) zIn = "";
for(i=0; zIn[i] && !isalpha(zIn[i]); i++){}
if( zIn[i] ){
zResult[0] = toupper(zIn[i]);
@@ -653,6 +675,26 @@ static void soundexFunc(sqlite3_context *context, int argc, sqlite3_value **argv
}
#endif
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
+/*
+** A function that loads a shared-library extension then returns NULL.
+*/
+static void loadExt(sqlite3_context *context, int argc, sqlite3_value **argv){
+ const char *zFile = (const char *)sqlite3_value_text(argv[0]);
+ const char *zProc = 0;
+ sqlite3 *db = sqlite3_user_data(context);
+ char *zErrMsg = 0;
+
+ if( argc==2 ){
+ zProc = (const char *)sqlite3_value_text(argv[1]);
+ }
+ if( sqlite3_load_extension(db, zFile, zProc, &zErrMsg) ){
+ sqlite3_result_error(context, zErrMsg, -1);
+ sqlite3_free(zErrMsg);
+ }
+}
+#endif
+
#ifdef SQLITE_TEST
/*
** This function generates a string of random characters. Used for
@@ -692,7 +734,7 @@ static void randStr(sqlite3_context *context, int argc, sqlite3_value **argv){
zBuf[i] = zSrc[zBuf[i]%(sizeof(zSrc)-1)];
}
zBuf[n] = 0;
- sqlite3_result_text(context, zBuf, n, SQLITE_TRANSIENT);
+ sqlite3_result_text(context, (char*)zBuf, n, SQLITE_TRANSIENT);
}
#endif /* SQLITE_TEST */
@@ -728,17 +770,17 @@ static void test_destructor(
test_destructor_count_var++;
assert( nArg==1 );
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
- len = sqlite3ValueBytes(argv[0], db->enc);
+ len = sqlite3ValueBytes(argv[0], ENC(db));
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 ){
+ memcpy(zVal, sqlite3ValueText(argv[0], ENC(db)), len);
+ if( ENC(db)==SQLITE_UTF8 ){
sqlite3_result_text(pCtx, zVal, -1, destructor);
#ifndef SQLITE_OMIT_UTF16
- }else if( db->enc==SQLITE_UTF16LE ){
+ }else if( ENC(db)==SQLITE_UTF16LE ){
sqlite3_result_text16le(pCtx, zVal, -1, destructor);
}else{
sqlite3_result_text16be(pCtx, zVal, -1, destructor);
@@ -776,7 +818,7 @@ static void test_auxdata(
char *zRet = sqliteMalloc(nArg*2);
if( !zRet ) return;
for(i=0; i<nArg; i++){
- char const *z = sqlite3_value_text(argv[i]);
+ char const *z = (char*)sqlite3_value_text(argv[i]);
if( z ){
char *zAux = sqlite3_get_auxdata(pCtx, i);
if( zAux ){
@@ -807,7 +849,7 @@ static void test_error(
int nArg,
sqlite3_value **argv
){
- sqlite3_result_error(pCtx, sqlite3_value_text(argv[0]), 0);
+ sqlite3_result_error(pCtx, (char*)sqlite3_value_text(argv[0]), 0);
}
#endif /* SQLITE_TEST */
@@ -817,25 +859,45 @@ static void test_error(
*/
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 */
+ double rSum; /* Floating point sum */
+ i64 iSum; /* Integer sum */
+ i64 cnt; /* Number of elements summed */
+ u8 overflow; /* True if integer overflow seen */
+ u8 approx; /* True if non-integer value was input to the sum */
};
/*
-** Routines used to compute the sum or average.
+** Routines used to compute the sum, average, and total.
+**
+** The SUM() function follows the (broken) SQL standard which means
+** that it returns NULL if it sums over no inputs. TOTAL returns
+** 0.0 in that case. In addition, TOTAL always returns a float where
+** SUM might return an integer if it never encounters a floating point
+** value. TOTAL never fails, but SUM might through an exception if
+** it overflows an integer.
*/
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]);
+ type = sqlite3_value_numeric_type(argv[0]);
if( p && type!=SQLITE_NULL ){
- p->sum += sqlite3_value_double(argv[0]);
p->cnt++;
- if( type==SQLITE_FLOAT ){
- p->seenFloat = 1;
+ if( type==SQLITE_INTEGER ){
+ i64 v = sqlite3_value_int64(argv[0]);
+ p->rSum += v;
+ if( (p->approx|p->overflow)==0 ){
+ i64 iNewSum = p->iSum + v;
+ int s1 = p->iSum >> (sizeof(i64)*8-1);
+ int s2 = v >> (sizeof(i64)*8-1);
+ int s3 = iNewSum >> (sizeof(i64)*8-1);
+ p->overflow = (s1&s2&~s3) | (~s1&~s2&s3);
+ p->iSum = iNewSum;
+ }
+ }else{
+ p->rSum += sqlite3_value_double(argv[0]);
+ p->approx = 1;
}
}
}
@@ -843,10 +905,12 @@ 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);
+ if( p->overflow ){
+ sqlite3_result_error(context,"integer overflow",-1);
+ }else if( p->approx ){
+ sqlite3_result_double(context, p->rSum);
}else{
- sqlite3_result_int64(context, (i64)p->sum);
+ sqlite3_result_int64(context, p->iSum);
}
}
}
@@ -854,20 +918,14 @@ 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);
+ sqlite3_result_double(context, p->rSum/(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 */
-};
+static void totalFinalize(sqlite3_context *context){
+ SumCtx *p;
+ p = sqlite3_aggregate_context(context, 0);
+ sqlite3_result_double(context, p ? p->rSum : 0.0);
+}
/*
** The following structure keeps track of state information for the
@@ -875,7 +933,7 @@ struct StdDevCtx {
*/
typedef struct CountCtx CountCtx;
struct CountCtx {
- int n;
+ i64 n;
};
/*
@@ -891,7 +949,7 @@ static void countStep(sqlite3_context *context, int argc, sqlite3_value **argv){
static void countFinalize(sqlite3_context *context){
CountCtx *p;
p = sqlite3_aggregate_context(context, 0);
- sqlite3_result_int(context, p ? p->n : 0);
+ sqlite3_result_int64(context, p ? p->n : 0);
}
/*
@@ -978,9 +1036,14 @@ void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
{ "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 },
+ { "match", 2, 0, SQLITE_UTF8, 0, matchStub },
#ifdef SQLITE_SOUNDEX
{ "soundex", 1, 0, SQLITE_UTF8, 0, soundexFunc},
#endif
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
+ { "load_extension", 1, 1, SQLITE_UTF8, 0, loadExt },
+ { "load_extension", 2, 1, SQLITE_UTF8, 0, loadExt },
+#endif
#ifdef SQLITE_TEST
{ "randstr", 2, 0, SQLITE_UTF8, 0, randStr },
{ "test_destructor", 1, 1, SQLITE_UTF8, 0, test_destructor},
@@ -1000,6 +1063,7 @@ void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
{ "min", 1, 0, 1, minmaxStep, minMaxFinalize },
{ "max", 1, 2, 1, minmaxStep, minMaxFinalize },
{ "sum", 1, 0, 0, sumStep, sumFinalize },
+ { "total", 1, 0, 0, sumStep, totalFinalize },
{ "avg", 1, 0, 0, sumStep, avgFinalize },
{ "count", 0, 0, 0, countStep, countFinalize },
{ "count", 1, 0, 0, countStep, countFinalize },
@@ -1012,7 +1076,7 @@ void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
case 1: pArg = db; break;
case 2: pArg = (void *)(-1); break;
}
- sqlite3_create_function(db, aFuncs[i].zName, aFuncs[i].nArg,
+ sqlite3CreateFunc(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,
@@ -1025,13 +1089,16 @@ void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
#ifndef SQLITE_OMIT_ALTERTABLE
sqlite3AlterFunctions(db);
#endif
+#ifndef SQLITE_OMIT_PARSER
+ sqlite3AttachFunctions(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,
+ sqlite3CreateFunc(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,
@@ -1043,7 +1110,7 @@ void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
}
sqlite3RegisterDateTimeFunctions(db);
#ifdef SQLITE_SSE
- sqlite3SseFunctions(db);
+ (void)sqlite3SseFunctions(db);
#endif
#ifdef SQLITE_CASE_SENSITIVE_LIKE
sqlite3RegisterLikeFunctions(db, 1);
@@ -1075,9 +1142,9 @@ void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){
}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,
+ sqlite3CreateFunc(db, "like", 2, SQLITE_UTF8, pInfo, likeFunc, 0, 0);
+ sqlite3CreateFunc(db, "like", 3, SQLITE_UTF8, pInfo, likeFunc, 0, 0);
+ sqlite3CreateFunc(db, "glob", 2, SQLITE_UTF8,
(struct compareInfo*)&globInfo, likeFunc, 0,0);
setLikeOptFlag(db, "glob", SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE);
setLikeOptFlag(db, "like",
@@ -1099,7 +1166,7 @@ int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){
if( pExpr->pList->nExpr!=2 ){
return 0;
}
- pDef = sqlite3FindFunction(db, pExpr->token.z, pExpr->token.n, 2,
+ pDef = sqlite3FindFunction(db, (char*)pExpr->token.z, pExpr->token.n, 2,
SQLITE_UTF8, 0);
if( pDef==0 || (pDef->flags & SQLITE_FUNC_LIKE)==0 ){
return 0;
diff --git a/ext/pdo_sqlite/sqlite/src/hash.c b/ext/pdo_sqlite/sqlite/src/hash.c
index e01aae716..1c32c1b7c 100644
--- a/ext/pdo_sqlite/sqlite/src/hash.c
+++ b/ext/pdo_sqlite/sqlite/src/hash.c
@@ -41,6 +41,8 @@ void sqlite3HashInit(Hash *pNew, int keyClass, int copyKey){
pNew->count = 0;
pNew->htsize = 0;
pNew->ht = 0;
+ pNew->xMalloc = sqlite3MallocX;
+ pNew->xFree = sqlite3FreeX;
}
/* Remove all entries from a hash table. Reclaim all memory.
@@ -53,15 +55,15 @@ void sqlite3HashClear(Hash *pH){
assert( pH!=0 );
elem = pH->first;
pH->first = 0;
- if( pH->ht ) sqliteFree(pH->ht);
+ if( pH->ht ) pH->xFree(pH->ht);
pH->ht = 0;
pH->htsize = 0;
while( elem ){
HashElem *next_elem = elem->next;
if( pH->copyKey && elem->pKey ){
- sqliteFree(elem->pKey);
+ pH->xFree(elem->pKey);
}
- sqliteFree(elem);
+ pH->xFree(elem);
elem = next_elem;
}
pH->count = 0;
@@ -222,9 +224,9 @@ static void rehash(Hash *pH, int new_size){
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) );
+ new_ht = (struct _ht *)pH->xMalloc( new_size*sizeof(struct _ht) );
if( new_ht==0 ) return;
- if( pH->ht ) sqliteFree(pH->ht);
+ if( pH->ht ) pH->xFree(pH->ht);
pH->ht = new_ht;
pH->htsize = new_size;
xHash = hashFunction(pH->keyClass);
@@ -290,10 +292,15 @@ static void removeElementGivenHash(
pEntry->chain = 0;
}
if( pH->copyKey && elem->pKey ){
- sqliteFree(elem->pKey);
+ pH->xFree(elem->pKey);
}
- sqliteFree( elem );
+ pH->xFree( elem );
pH->count--;
+ if( pH->count<=0 ){
+ assert( pH->first==0 );
+ assert( pH->count==0 );
+ sqlite3HashClear(pH);
+ }
}
/* Attempt to locate an element of the hash table pH with a key
@@ -353,12 +360,12 @@ void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, void *data){
return old_data;
}
if( data==0 ) return 0;
- new_elem = (HashElem*)sqliteMalloc( sizeof(HashElem) );
+ new_elem = (HashElem*)pH->xMalloc( sizeof(HashElem) );
if( new_elem==0 ) return data;
if( pH->copyKey && pKey!=0 ){
- new_elem->pKey = sqliteMallocRaw( nKey );
+ new_elem->pKey = pH->xMalloc( nKey );
if( new_elem->pKey==0 ){
- sqliteFree(new_elem);
+ pH->xFree(new_elem);
return data;
}
memcpy((void*)new_elem->pKey, pKey, nKey);
@@ -371,7 +378,7 @@ void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, void *data){
rehash(pH,8);
if( pH->htsize==0 ){
pH->count = 0;
- sqliteFree(new_elem);
+ pH->xFree(new_elem);
return data;
}
}
diff --git a/ext/pdo_sqlite/sqlite/src/hash.h b/ext/pdo_sqlite/sqlite/src/hash.h
index cf004ddc5..470764948 100644
--- a/ext/pdo_sqlite/sqlite/src/hash.h
+++ b/ext/pdo_sqlite/sqlite/src/hash.h
@@ -34,6 +34,8 @@ struct Hash {
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 */
+ void *(*xMalloc)(int); /* malloc() function to use */
+ void (*xFree)(void *); /* free() function to use */
int htsize; /* Number of buckets in the hash table */
struct _ht { /* the hash table */
int count; /* Number of entries with this hash */
diff --git a/ext/pdo_sqlite/sqlite/src/insert.c b/ext/pdo_sqlite/sqlite/src/insert.c
index 37f9f4ee5..d4cf74a3d 100644
--- a/ext/pdo_sqlite/sqlite/src/insert.c
+++ b/ext/pdo_sqlite/sqlite/src/insert.c
@@ -23,10 +23,11 @@
**
** Character Column affinity
** ------------------------------
-** 'n' NUMERIC
-** 'i' INTEGER
-** 't' TEXT
-** 'o' NONE
+** 'a' TEXT
+** 'b' NONE
+** 'c' NUMERIC
+** 'd' INTEGER
+** 'e' REAL
*/
void sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
if( !pIdx->zColAff ){
@@ -61,10 +62,11 @@ void sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
**
** Character Column affinity
** ------------------------------
-** 'n' NUMERIC
-** 'i' INTEGER
-** 't' TEXT
-** 'o' NONE
+** 'a' TEXT
+** 'b' NONE
+** 'c' NUMERIC
+** 'd' INTEGER
+** 'e' REAL
*/
void sqlite3TableAffinityStr(Vdbe *v, Table *pTab){
/* The first time a column affinity string for a particular table
@@ -102,15 +104,15 @@ void sqlite3TableAffinityStr(Vdbe *v, Table *pTab){
**
** No checking is done for sub-selects that are part of expressions.
*/
-static int selectReadsTable(Select *p, int iDb, int iTab){
+static int selectReadsTable(Select *p, Schema *pSchema, 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;
+ if( selectReadsTable(pItem->pSelect, pSchema, iTab) ) return 1;
}else{
- if( pItem->pTab->iDb==iDb && pItem->pTab->tnum==iTab ) return 1;
+ if( pItem->pTab->pSchema==pSchema && pItem->pTab->tnum==iTab ) return 1;
}
}
return 0;
@@ -212,6 +214,7 @@ void sqlite3Insert(
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 */
+ int iDb;
#ifndef SQLITE_OMIT_TRIGGER
int isView; /* True if attempting to insert into a view */
@@ -219,10 +222,12 @@ void sqlite3Insert(
#endif
#ifndef SQLITE_OMIT_AUTOINCREMENT
- int counterRowid; /* Memory cell holding rowid of autoinc counter */
+ int counterRowid = 0; /* Memory cell holding rowid of autoinc counter */
#endif
- if( pParse->nErr || sqlite3_malloc_failed ) goto insert_cleanup;
+ if( pParse->nErr || sqlite3MallocFailed() ){
+ goto insert_cleanup;
+ }
db = pParse->db;
/* Locate the table into which we will be inserting new information.
@@ -234,8 +239,9 @@ void sqlite3Insert(
if( pTab==0 ){
goto insert_cleanup;
}
- assert( pTab->iDb<db->nDb );
- pDb = &db->aDb[pTab->iDb];
+ iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
+ assert( iDb<db->nDb );
+ pDb = &db->aDb[iDb];
zDb = pDb->zName;
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, zDb) ){
goto insert_cleanup;
@@ -263,27 +269,22 @@ void sqlite3Insert(
if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){
goto insert_cleanup;
}
- if( pTab==0 ) goto insert_cleanup;
+ assert( pTab!=0 );
/* If pTab is really a view, make sure it has been initialized.
+ ** ViewGetColumnNames() is a no-op if pTab is not a view (or virtual
+ ** module table).
*/
- if( isView && sqlite3ViewGetColumnNames(pParse, pTab) ){
+ if( 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);
+ sqlite3BeginWriteOperation(pParse, pSelect || triggers_exist, iDb);
/* if there are row triggers, allocate a temp table for new.* references. */
if( triggers_exist ){
@@ -298,22 +299,20 @@ void sqlite3Insert(
*/
if( pTab->autoInc ){
int iCur = pParse->nTab;
- int base = sqlite3VdbeCurrentAddr(v);
+ int addr = 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);
+ sqlite3OpenTable(pParse, iCur, iDb, pDb->pSchema->pSeqTab, OP_OpenRead);
+ sqlite3VdbeAddOp(v, OP_Rewind, iCur, addr+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_Ne, 0x100, addr+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_Goto, 0, addr+13);
+ sqlite3VdbeAddOp(v, OP_Next, iCur, addr+4);
sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
}
#endif /* SQLITE_OMIT_AUTOINCREMENT */
@@ -336,7 +335,9 @@ void sqlite3Insert(
/* 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;
+ if( rc || pParse->nErr || sqlite3MallocFailed() ){
+ goto insert_cleanup;
+ }
iCleanup = sqlite3VdbeMakeLabel(v);
sqlite3VdbeAddOp(v, OP_Goto, 0, iCleanup);
@@ -351,7 +352,7 @@ void sqlite3Insert(
** 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) ){
+ if( triggers_exist || selectReadsTable(pSelect,pTab->pSchema,pTab->tnum) ){
useTempTable = 1;
}
@@ -362,7 +363,6 @@ void sqlite3Insert(
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);
@@ -373,7 +373,7 @@ void sqlite3Insert(
** back up and execute the SELECT code above.
*/
sqlite3VdbeJumpHere(v, iInitCode);
- sqlite3VdbeAddOp(v, OP_OpenVirtual, srcTab, 0);
+ sqlite3VdbeAddOp(v, OP_OpenEphemeral, srcTab, 0);
sqlite3VdbeAddOp(v, OP_SetNumColumns, srcTab, nColumn);
sqlite3VdbeAddOp(v, OP_Goto, 0, iSelectLoop);
sqlite3VdbeResolveLabel(v, iCleanup);
@@ -569,6 +569,10 @@ void sqlite3Insert(
** case the record number is the same as that column.
*/
if( !isView ){
+ if( IsVirtual(pTab) ){
+ /* The row that the VUpdate opcode will delete: none */
+ sqlite3VdbeAddOp(v, OP_Null, 0, 0);
+ }
if( keyColumn>=0 ){
if( useTempTable ){
sqlite3VdbeAddOp(v, OP_Column, srcTab, keyColumn);
@@ -584,6 +588,8 @@ void sqlite3Insert(
sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
sqlite3VdbeAddOp(v, OP_NewRowid, base, counterMem);
sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0);
+ }else if( IsVirtual(pTab) ){
+ sqlite3VdbeAddOp(v, OP_Null, 0, 0);
}else{
sqlite3VdbeAddOp(v, OP_NewRowid, base, counterMem);
}
@@ -626,16 +632,25 @@ void sqlite3Insert(
/* 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,
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( IsVirtual(pTab) ){
+ pParse->pVirtualLock = pTab;
+ sqlite3VdbeOp3(v, OP_VUpdate, 1, pTab->nCol+2,
+ (const char*)pTab->pVtab, P3_VTAB);
+ }else
+#endif
+ {
+ 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);
+ sqlite3VdbeAddOp(v, OP_MemIncr, 1, iCntMem);
}
if( triggers_exist ){
@@ -667,7 +682,7 @@ void sqlite3Insert(
sqlite3VdbeResolveLabel(v, iCleanup);
}
- if( !triggers_exist ){
+ if( !triggers_exist && !IsVirtual(pTab) ){
/* Close all tables opened */
sqlite3VdbeAddOp(v, OP_Close, base, 0);
for(idx=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, idx++){
@@ -682,12 +697,10 @@ void sqlite3Insert(
*/
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);
+ int addr = sqlite3VdbeCurrentAddr(v);
+ sqlite3OpenTable(pParse, iCur, iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
sqlite3VdbeAddOp(v, OP_MemLoad, counterRowid, 0);
- sqlite3VdbeAddOp(v, OP_NotNull, -1, base+7);
+ sqlite3VdbeAddOp(v, OP_NotNull, -1, addr+7);
sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
sqlite3VdbeAddOp(v, OP_NewRowid, iCur, 0);
sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->zName, 0);
@@ -707,7 +720,7 @@ void sqlite3Insert(
sqlite3VdbeAddOp(v, OP_MemLoad, iCntMem, 0);
sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
sqlite3VdbeSetNumCols(v, 1);
- sqlite3VdbeSetColName(v, 0, "rows inserted", P3_STATIC);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows inserted", P3_STATIC);
}
insert_cleanup:
@@ -870,7 +883,24 @@ void sqlite3GenerateConstraintChecks(
/* Test all CHECK constraints
*/
- /**** TBD ****/
+#ifndef SQLITE_OMIT_CHECK
+ if( pTab->pCheck && (pParse->db->flags & SQLITE_IgnoreChecks)==0 ){
+ int allOk = sqlite3VdbeMakeLabel(v);
+ assert( pParse->ckOffset==0 );
+ pParse->ckOffset = nCol;
+ sqlite3ExprIfTrue(pParse, pTab->pCheck, allOk, 1);
+ assert( pParse->ckOffset==nCol );
+ pParse->ckOffset = 0;
+ onError = overrideError!=OE_Default ? overrideError : OE_Abort;
+ if( onError==OE_Ignore || onError==OE_Replace ){
+ sqlite3VdbeAddOp(v, OP_Pop, nCol+1+hasTwoRowids, 0);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, ignoreDest);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError);
+ }
+ sqlite3VdbeResolveLabel(v, allOk);
+ }
+#endif /* !defined(SQLITE_OMIT_CHECK) */
/* If we have an INTEGER PRIMARY KEY, make sure the primary key
** of the new record does not previously exist. Except, if this
@@ -904,7 +934,7 @@ void sqlite3GenerateConstraintChecks(
break;
}
case OE_Replace: {
- sqlite3GenerateRowIndexDelete(pParse->db, v, pTab, base, 0);
+ sqlite3GenerateRowIndexDelete(v, pTab, base, 0);
if( isUpdate ){
sqlite3VdbeAddOp(v, OP_Dup, nCol+hasTwoRowids, 1);
sqlite3VdbeAddOp(v, OP_MoveGe, base, 0);
@@ -1067,9 +1097,13 @@ void sqlite3CompleteInsertion(
if( pParse->nested ){
pik_flags = 0;
}else{
- pik_flags = (OPFLAG_NCHANGE|(isUpdate?0:OPFLAG_LASTROWID));
+ pik_flags = OPFLAG_NCHANGE;
+ pik_flags |= (isUpdate?OPFLAG_ISUPDATE:OPFLAG_LASTROWID);
}
sqlite3VdbeAddOp(v, OP_Insert, base, pik_flags);
+ if( !pParse->nested ){
+ sqlite3VdbeChangeP3(v, -1, pTab->zName, P3_STATIC);
+ }
if( isUpdate && rowidChng ){
sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
@@ -1088,18 +1122,21 @@ void sqlite3OpenTableAndIndices(
int op /* OP_OpenRead or OP_OpenWrite */
){
int i;
+ int iDb;
Index *pIdx;
- Vdbe *v = sqlite3GetVdbe(pParse);
+ Vdbe *v;
+
+ if( IsVirtual(pTab) ) return;
+ iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
+ 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);
+ sqlite3OpenTable(pParse, base, iDb, pTab, op);
for(i=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
- sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
+ KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
+ assert( pIdx->pSchema==pTab->pSchema );
+ sqlite3VdbeAddOp(v, OP_Integer, iDb, 0);
VdbeComment((v, "# %s", pIdx->zName));
- sqlite3VdbeOp3(v, op, i+base, pIdx->tnum,
- (char*)&pIdx->keyInfo, P3_KEYINFO);
+ sqlite3VdbeOp3(v, op, i+base, pIdx->tnum, (char*)pKey, P3_KEYINFO_HANDOFF);
}
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
index f825ba977..bc0898f3b 100644
--- a/ext/pdo_sqlite/sqlite/src/keywordhash.h
+++ b/ext/pdo_sqlite/sqlite/src/keywordhash.h
@@ -1,61 +1,61 @@
-/* Hash score: 156 */
+/* Hash score: 167 */
static int keywordCode(const char *z, int n){
- static const char zText[526] =
+ static const char zText[544] =
"ABORTABLEFTEMPORARYADDATABASELECTHENDEFAULTRANSACTIONATURALTER"
"AISEACHECKEYAFTEREFERENCESCAPELSEXCEPTRIGGEREGEXPLAINITIALLYANALYZE"
"XCLUSIVEXISTSTATEMENTANDEFERRABLEATTACHAVINGLOBEFOREIGNOREINDEX"
"AUTOINCREMENTBEGINNERENAMEBETWEENOTNULLIKEBYCASCADEFERREDELETE"
"CASECASTCOLLATECOLUMNCOMMITCONFLICTCONSTRAINTERSECTCREATECROSS"
- "CURRENT_DATECURRENT_TIMESTAMPRAGMATCHDESCDETACHDISTINCTDROPRIMARY"
- "FAILIMITFROMFULLGROUPDATEIMMEDIATEINSERTINSTEADINTOFFSETISNULL"
- "JOINORDEREPLACEOUTERESTRICTRIGHTROLLBACKROWHENUNIONUNIQUEUSING"
- "VACUUMVALUESVIEWHERE";
+ "CURRENT_DATECURRENT_TIMESTAMPLANDESCDETACHDISTINCTDROPRAGMATCH"
+ "FAILIMITFROMFULLGROUPDATEIFIMMEDIATEINSERTINSTEADINTOFFSETISNULL"
+ "JOINORDEREPLACEOUTERESTRICTPRIMARYQUERYRIGHTROLLBACKROWHENUNION"
+ "UNIQUEUSINGVACUUMVALUESVIEWHEREVIRTUAL";
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,
+ 92, 80, 107, 91, 0, 4, 0, 0, 114, 0, 83, 0, 0,
+ 95, 44, 76, 93, 0, 106, 109, 97, 90, 0, 10, 0, 0,
+ 113, 0, 117, 103, 0, 28, 48, 0, 41, 0, 0, 65, 71,
+ 0, 63, 19, 0, 105, 36, 104, 0, 108, 74, 0, 0, 33,
+ 0, 61, 37, 0, 8, 0, 115, 38, 12, 0, 77, 40, 25,
+ 66, 0, 0, 31, 81, 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,
+ 69, 86, 0, 1, 0, 9, 101, 58, 18, 0, 112, 82, 99,
+ 54, 6, 85, 0, 0, 49, 94, 0, 102, 0, 70, 0, 0,
+ 15, 0, 116, 51, 56, 0, 2, 55, 0, 111,
};
- static const unsigned char aNext[113] = {
+ static const unsigned char aNext[117] = {
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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 73, 42, 0, 24, 60,
+ 21, 0, 79, 0, 0, 68, 0, 0, 84, 46, 0, 0, 0,
+ 0, 0, 0, 0, 0, 39, 96, 98, 0, 0, 100, 0, 32,
+ 0, 14, 27, 78, 0, 57, 89, 0, 35, 0, 62, 0, 110,
};
- static const unsigned char aLen[113] = {
+ static const unsigned char aLen[117] = {
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,
+ 6, 6, 8, 10, 9, 6, 5, 12, 12, 17, 4, 4, 6,
+ 8, 2, 4, 6, 5, 4, 5, 4, 4, 5, 6, 2, 9,
+ 6, 7, 4, 2, 6, 3, 6, 4, 5, 7, 5, 8, 7,
+ 5, 5, 8, 3, 4, 5, 6, 5, 6, 6, 4, 5, 7,
};
- static const unsigned short int aOffset[113] = {
+ static const unsigned short int aOffset[117] = {
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,
+ 269, 275, 281, 289, 296, 305, 311, 316, 328, 328, 344, 348, 352,
+ 358, 359, 366, 369, 373, 378, 381, 386, 390, 394, 397, 403, 405,
+ 414, 420, 427, 430, 430, 433, 436, 442, 446, 450, 457, 461, 469,
+ 476, 481, 486, 494, 496, 500, 505, 511, 516, 522, 528, 531, 536,
};
- static const unsigned char aCode[113] = {
+ static const unsigned char aCode[117] = {
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,
@@ -71,19 +71,20 @@ static int keywordCode(const char *z, int n){
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,
+ TK_PLAN, TK_DESC, TK_DETACH, TK_DISTINCT, TK_IS,
+ TK_DROP, TK_PRAGMA, TK_MATCH, TK_FAIL, TK_LIMIT,
+ TK_FROM, TK_JOIN_KW, TK_GROUP, TK_UPDATE, TK_IF,
+ 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_PRIMARY, TK_QUERY,
+ TK_JOIN_KW, TK_ROLLBACK, TK_ROW, TK_WHEN, TK_UNION,
+ TK_UNIQUE, TK_USING, TK_VACUUM, TK_VALUES, TK_VIEW,
+ TK_WHERE, TK_VIRTUAL,
};
int h, i;
if( n<2 ) return TK_ID;
- h = ((sqlite3UpperToLower[((unsigned char*)z)[0]]*4) ^
- (sqlite3UpperToLower[((unsigned char*)z)[n-1]]*3) ^
+ h = ((charMap(z[0])*4) ^
+ (charMap(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 ){
@@ -92,6 +93,6 @@ static int keywordCode(const char *z, int n){
}
return TK_ID;
}
-int sqlite3KeywordCode(const char *z, int n){
- return keywordCode(z, n);
+int sqlite3KeywordCode(const unsigned char *z, int n){
+ return keywordCode((char*)z, n);
}
diff --git a/ext/pdo_sqlite/sqlite/src/legacy.c b/ext/pdo_sqlite/sqlite/src/legacy.c
index f575f1f0c..c75791e1b 100644
--- a/ext/pdo_sqlite/sqlite/src/legacy.c
+++ b/ext/pdo_sqlite/sqlite/src/legacy.c
@@ -54,8 +54,8 @@ int sqlite3_exec(
pStmt = 0;
rc = sqlite3_prepare(db, zSql, -1, &pStmt, &zLeftover);
+ assert( rc==SQLITE_OK || pStmt==0 );
if( rc!=SQLITE_OK ){
- if( pStmt ) sqlite3_finalize(pStmt);
continue;
}
if( !pStmt ){
@@ -68,9 +68,8 @@ int sqlite3_exec(
nCallback = 0;
nCol = sqlite3_column_count(pStmt);
- azCols = sqliteMalloc(2*nCol*sizeof(const char *));
- if( nCol && !azCols ){
- rc = SQLITE_NOMEM;
+ azCols = sqliteMalloc(2*nCol*sizeof(const char *) + 1);
+ if( azCols==0 ){
goto exec_out;
}
@@ -122,11 +121,9 @@ exec_out:
if( pStmt ) sqlite3_finalize(pStmt);
if( azCols ) sqliteFree(azCols);
- if( sqlite3_malloc_failed ){
- rc = SQLITE_NOMEM;
- }
+ rc = sqlite3ApiExit(0, rc);
if( rc!=SQLITE_OK && rc==sqlite3_errcode(db) && pzErrMsg ){
- *pzErrMsg = malloc(1+strlen(sqlite3_errmsg(db)));
+ *pzErrMsg = sqlite3_malloc(1+strlen(sqlite3_errmsg(db)));
if( *pzErrMsg ){
strcpy(*pzErrMsg, sqlite3_errmsg(db));
}
diff --git a/ext/pdo_sqlite/sqlite/src/loadext.c b/ext/pdo_sqlite/sqlite/src/loadext.c
new file mode 100644
index 000000000..60ec053cf
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/loadext.c
@@ -0,0 +1,355 @@
+/*
+** 2006 June 7
+**
+** 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 dynamically load extensions into
+** the SQLite library.
+*/
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
+
+#define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
+#include "sqlite3ext.h"
+#include "sqliteInt.h"
+#include <string.h>
+#include <ctype.h>
+
+/*
+** Some API routines are omitted when various features are
+** excluded from a build of SQLite. Substitute a NULL pointer
+** for any missing APIs.
+*/
+#ifndef SQLITE_ENABLE_COLUMN_METADATA
+# define sqlite3_column_database_name 0
+# define sqlite3_column_database_name16 0
+# define sqlite3_column_table_name 0
+# define sqlite3_column_table_name16 0
+# define sqlite3_column_origin_name 0
+# define sqlite3_column_origin_name16 0
+# define sqlite3_table_column_metadata 0
+#endif
+
+#ifdef SQLITE_OMIT_AUTHORIZATION
+# define sqlite3_set_authorizer 0
+#endif
+
+#ifdef SQLITE_OMIT_UTF16
+# define sqlite3_bind_text16 0
+# define sqlite3_collation_needed16 0
+# define sqlite3_column_decltype16 0
+# define sqlite3_column_name16 0
+# define sqlite3_column_text16 0
+# define sqlite3_complete16 0
+# define sqlite3_create_collation16 0
+# define sqlite3_create_function16 0
+# define sqlite3_errmsg16 0
+# define sqlite3_open16 0
+# define sqlite3_prepare16 0
+# define sqlite3_result_error16 0
+# define sqlite3_result_text16 0
+# define sqlite3_result_text16be 0
+# define sqlite3_result_text16le 0
+# define sqlite3_value_text16 0
+# define sqlite3_value_text16be 0
+# define sqlite3_value_text16le 0
+#endif
+
+#ifdef SQLITE_OMIT_COMPLETE
+# define sqlite3_complete 0
+# define sqlite3_complete16 0
+#endif
+
+#ifdef SQLITE_OMIT_PROGRESS_CALLBACK
+# define sqlite3_progress_handler 0
+#endif
+
+#ifdef SQLITE_OMIT_VIRTUALTABLE
+# define sqlite3_create_module 0
+# define sqlite3_declare_vtab 0
+#endif
+
+/*
+** The following structure contains pointers to all SQLite API routines.
+** A pointer to this structure is passed into extensions when they are
+** loaded so that the extension can make calls back into the SQLite
+** library.
+**
+** When adding new APIs, add them to the bottom of this structure
+** in order to preserve backwards compatibility.
+**
+** Extensions that use newer APIs should first call the
+** sqlite3_libversion_number() to make sure that the API they
+** intend to use is supported by the library. Extensions should
+** also check to make sure that the pointer to the function is
+** not NULL before calling it.
+*/
+const sqlite3_api_routines sqlite3_api = {
+ 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_bind_value,
+ 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_database_name,
+ sqlite3_column_database_name16,
+ sqlite3_column_decltype,
+ sqlite3_column_decltype16,
+ sqlite3_column_double,
+ sqlite3_column_int,
+ sqlite3_column_int64,
+ sqlite3_column_name,
+ sqlite3_column_name16,
+ sqlite3_column_origin_name,
+ sqlite3_column_origin_name16,
+ sqlite3_column_table_name,
+ sqlite3_column_table_name16,
+ sqlite3_column_text,
+ sqlite3_column_text16,
+ sqlite3_column_type,
+ sqlite3_column_value,
+ sqlite3_commit_hook,
+ sqlite3_complete,
+ sqlite3_complete16,
+ sqlite3_create_collation,
+ sqlite3_create_collation16,
+ sqlite3_create_function,
+ sqlite3_create_function16,
+ sqlite3_create_module,
+ sqlite3_data_count,
+ sqlite3_db_handle,
+ sqlite3_declare_vtab,
+ sqlite3_enable_shared_cache,
+ 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_malloc,
+ sqlite3_mprintf,
+ sqlite3_open,
+ sqlite3_open16,
+ sqlite3_prepare,
+ sqlite3_prepare16,
+ sqlite3_profile,
+ sqlite3_progress_handler,
+ sqlite3_realloc,
+ 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_rollback_hook,
+ sqlite3_set_authorizer,
+ sqlite3_set_auxdata,
+ sqlite3_snprintf,
+ sqlite3_step,
+ sqlite3_table_column_metadata,
+ sqlite3_thread_cleanup,
+ sqlite3_total_changes,
+ sqlite3_trace,
+ sqlite3_transfer_bindings,
+ sqlite3_update_hook,
+ sqlite3_user_data,
+ sqlite3_value_blob,
+ sqlite3_value_bytes,
+ sqlite3_value_bytes16,
+ sqlite3_value_double,
+ sqlite3_value_int,
+ sqlite3_value_int64,
+ sqlite3_value_numeric_type,
+ sqlite3_value_text,
+ sqlite3_value_text16,
+ sqlite3_value_text16be,
+ sqlite3_value_text16le,
+ sqlite3_value_type,
+ sqlite3_vmprintf,
+ /*
+ ** The original API set ends here. All extensions can call any
+ ** of the APIs above provided that the pointer is not NULL. But
+ ** before calling APIs that follow, extension should check the
+ ** sqlite3_libversion_number() to make sure they are dealing with
+ ** a library that is new enough to support that API.
+ *************************************************************************
+ */
+};
+
+/*
+** The windows implementation of shared-library loaders
+*/
+#if defined(_WIN32) || defined(WIN32) || defined(__MINGW32__) || defined(__BORLANDC__)
+# include <windows.h>
+# define SQLITE_LIBRARY_TYPE HANDLE
+# define SQLITE_OPEN_LIBRARY(A) LoadLibrary(A)
+# define SQLITE_FIND_SYMBOL(A,B) GetProcAddress(A,B)
+# define SQLITE_CLOSE_LIBRARY(A) FreeLibrary(A)
+#endif /* windows */
+
+/*
+** The unix implementation of shared-library loaders
+*/
+#if defined(HAVE_DLOPEN) && !defined(SQLITE_LIBRARY_TYPE)
+# include <dlfcn.h>
+# define SQLITE_LIBRARY_TYPE void*
+# define SQLITE_OPEN_LIBRARY(A) dlopen(A, RTLD_NOW | RTLD_GLOBAL)
+# define SQLITE_FIND_SYMBOL(A,B) dlsym(A,B)
+# define SQLITE_CLOSE_LIBRARY(A) dlclose(A)
+#endif
+
+/*
+** Attempt to load an SQLite extension library contained in the file
+** zFile. The entry point is zProc. zProc may be 0 in which case a
+** default entry point name (sqlite3_extension_init) is used. Use
+** of the default name is recommended.
+**
+** Return SQLITE_OK on success and SQLITE_ERROR if something goes wrong.
+**
+** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with
+** error message text. The calling function should free this memory
+** by calling sqlite3_free().
+*/
+int sqlite3_load_extension(
+ sqlite3 *db, /* Load the extension into this database connection */
+ const char *zFile, /* Name of the shared library containing extension */
+ const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */
+ char **pzErrMsg /* Put error message here if not 0 */
+){
+#ifdef SQLITE_LIBRARY_TYPE
+ SQLITE_LIBRARY_TYPE handle;
+ int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
+ char *zErrmsg = 0;
+ SQLITE_LIBRARY_TYPE *aHandle;
+
+ /* Ticket #1863. To avoid a creating security problems for older
+ ** applications that relink against newer versions of SQLite, the
+ ** ability to run load_extension is turned off by default. One
+ ** must call sqlite3_enable_load_extension() to turn on extension
+ ** loading. Otherwise you get the following error.
+ */
+ if( (db->flags & SQLITE_LoadExtension)==0 ){
+ if( pzErrMsg ){
+ *pzErrMsg = sqlite3_mprintf("not authorized");
+ }
+ return SQLITE_ERROR;
+ }
+
+ if( zProc==0 ){
+ zProc = "sqlite3_extension_init";
+ }
+
+ handle = SQLITE_OPEN_LIBRARY(zFile);
+ if( handle==0 ){
+ if( pzErrMsg ){
+ *pzErrMsg = sqlite3_mprintf("unable to open shared library [%s]", zFile);
+ }
+ return SQLITE_ERROR;
+ }
+ xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
+ SQLITE_FIND_SYMBOL(handle, zProc);
+ if( xInit==0 ){
+ if( pzErrMsg ){
+ *pzErrMsg = sqlite3_mprintf("no entry point [%s] in shared library [%s]",
+ zProc, zFile);
+ }
+ SQLITE_CLOSE_LIBRARY(handle);
+ return SQLITE_ERROR;
+ }else if( xInit(db, &zErrmsg, &sqlite3_api) ){
+ if( pzErrMsg ){
+ *pzErrMsg = sqlite3_mprintf("error during initialization: %s", zErrmsg);
+ }
+ sqlite3_free(zErrmsg);
+ SQLITE_CLOSE_LIBRARY(handle);
+ return SQLITE_ERROR;
+ }
+
+ /* Append the new shared library handle to the db->aExtension array. */
+ db->nExtension++;
+ aHandle = sqliteMalloc(sizeof(handle)*db->nExtension);
+ if( aHandle==0 ){
+ return SQLITE_NOMEM;
+ }
+ if( db->nExtension>0 ){
+ memcpy(aHandle, db->aExtension, sizeof(handle)*(db->nExtension-1));
+ }
+ sqliteFree(db->aExtension);
+ db->aExtension = aHandle;
+
+ ((SQLITE_LIBRARY_TYPE*)db->aExtension)[db->nExtension-1] = handle;
+ return SQLITE_OK;
+#else
+ if( pzErrMsg ){
+ *pzErrMsg = sqlite3_mprintf("extension loading is disabled");
+ }
+ return SQLITE_ERROR;
+#endif
+}
+
+/*
+** Call this routine when the database connection is closing in order
+** to clean up loaded extensions
+*/
+void sqlite3CloseExtensions(sqlite3 *db){
+#ifdef SQLITE_LIBRARY_TYPE
+ int i;
+ for(i=0; i<db->nExtension; i++){
+ SQLITE_CLOSE_LIBRARY(((SQLITE_LIBRARY_TYPE*)db->aExtension)[i]);
+ }
+ sqliteFree(db->aExtension);
+#endif
+}
+
+/*
+** Enable or disable extension loading. Extension loading is disabled by
+** default so as not to open security holes in older applications.
+*/
+int sqlite3_enable_load_extension(sqlite3 *db, int onoff){
+ if( onoff ){
+ db->flags |= SQLITE_LoadExtension;
+ }else{
+ db->flags &= ~SQLITE_LoadExtension;
+ }
+ return SQLITE_OK;
+}
+
+#endif /* SQLITE_OMIT_LOAD_EXTENSION */
diff --git a/ext/pdo_sqlite/sqlite/src/main.c b/ext/pdo_sqlite/sqlite/src/main.c
index c42df158e..eccf83be6 100644
--- a/ext/pdo_sqlite/sqlite/src/main.c
+++ b/ext/pdo_sqlite/sqlite/src/main.c
@@ -26,32 +26,9 @@
*/
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; }
@@ -132,10 +109,14 @@ int sqlite3_close(sqlite3 *db){
}
#ifdef SQLITE_SSE
- sqlite3_finalize(db->pFetch);
+ {
+ extern void sqlite3SseCleanup(sqlite3*);
+ sqlite3SseCleanup(db);
+ }
#endif
/* If there are any outstanding VMs, return SQLITE_BUSY. */
+ sqlite3ResetInternalSchema(db, 0);
if( db->pVdbe ){
sqlite3Error(db, SQLITE_BUSY,
"Unable to close due to unfinalised statements");
@@ -153,11 +134,16 @@ int sqlite3_close(sqlite3 *db){
return SQLITE_ERROR;
}
+ sqlite3VtabRollback(db);
+
for(j=0; j<db->nDb; j++){
struct Db *pDb = &db->aDb[j];
if( pDb->pBt ){
sqlite3BtreeClose(pDb->pBt);
pDb->pBt = 0;
+ if( j!=1 ){
+ pDb->pSchema = 0;
+ }
}
}
sqlite3ResetInternalSchema(db, 0);
@@ -176,36 +162,32 @@ int sqlite3_close(sqlite3 *db){
sqliteFree(pColl);
}
sqlite3HashClear(&db->aCollSeq);
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ for(i=sqliteHashFirst(&db->aModule); i; i=sqliteHashNext(i)){
+ Module *pMod = (Module *)sqliteHashData(i);
+ sqliteFree(pMod);
+ }
+ sqlite3HashClear(&db->aModule);
+#endif
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
+ sqlite3CloseExtensions(db);
db->magic = SQLITE_MAGIC_ERROR;
+
+ /* The temp-database schema is allocated differently from the other schema
+ ** objects (using sqliteMalloc() directly, instead of sqlite3BtreeSchema()).
+ ** So it needs to be freed here. Todo: Why not roll the temp schema into
+ ** the same sqliteMalloc() as the one that allocates the database
+ ** structure?
+ */
+ sqliteFree(db->aDb[1].pSchema);
sqliteFree(db);
+ sqlite3ReleaseThreadData();
return SQLITE_OK;
}
@@ -214,13 +196,25 @@ int sqlite3_close(sqlite3 *db){
*/
void sqlite3RollbackAll(sqlite3 *db){
int i;
+ int inTrans = 0;
for(i=0; i<db->nDb; i++){
if( db->aDb[i].pBt ){
+ if( sqlite3BtreeIsInTrans(db->aDb[i].pBt) ){
+ inTrans = 1;
+ }
sqlite3BtreeRollback(db->aDb[i].pBt);
db->aDb[i].inTrans = 0;
}
}
- sqlite3ResetInternalSchema(db, 0);
+ sqlite3VtabRollback(db);
+ if( db->flags&SQLITE_InternChanges ){
+ sqlite3ResetInternalSchema(db, 0);
+ }
+
+ /* If one has been configured, invoke the rollback-hook callback */
+ if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){
+ db->xRollbackCallback(db->pRollbackArg);
+ }
}
/*
@@ -271,7 +265,7 @@ static int sqliteDefaultBusyCallback(
void *ptr, /* Database connection */
int count /* Number of times table has been busy */
){
-#if SQLITE_MIN_SLEEP_MS==1
+#if OS_WIN || (defined(HAVE_USLEEP) && HAVE_USLEEP)
static const u8 delays[] =
{ 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 };
static const u8 totals[] =
@@ -373,6 +367,9 @@ void sqlite3_progress_handler(
** specified number of milliseconds before returning 0.
*/
int sqlite3_busy_timeout(sqlite3 *db, int ms){
+ if( sqlite3SafetyCheck(db) ){
+ return SQLITE_MISUSE;
+ }
if( ms>0 ){
db->busyTimeout = ms;
sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
@@ -386,25 +383,43 @@ int sqlite3_busy_timeout(sqlite3 *db, int ms){
** Cause any pending operation to stop at its earliest opportunity.
*/
void sqlite3_interrupt(sqlite3 *db){
- if( !sqlite3SafetyCheck(db) ){
- db->flags |= SQLITE_Interrupt;
+ if( db && (db->magic==SQLITE_MAGIC_OPEN || db->magic==SQLITE_MAGIC_BUSY) ){
+ db->u1.isInterrupted = 1;
}
}
/*
-** 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.
+** Memory allocation routines that use SQLites internal memory
+** memory allocator. Depending on how SQLite is compiled, the
+** internal memory allocator might be just an alias for the
+** system default malloc/realloc/free. Or the built-in allocator
+** might do extra stuff like put sentinals around buffers to
+** check for overruns or look for memory leaks.
**
-** Note that we need to call free() not sqliteFree() here.
+** Use sqlite3_free() to free memory returned by sqlite3_mprintf().
*/
-void sqlite3_free(char *p){ free(p); }
+void sqlite3_free(void *p){ if( p ) sqlite3OsFree(p); }
+void *sqlite3_malloc(int nByte){ return nByte>0 ? sqlite3OsMalloc(nByte) : 0; }
+void *sqlite3_realloc(void *pOld, int nByte){
+ if( pOld ){
+ if( nByte>0 ){
+ return sqlite3OsRealloc(pOld, nByte);
+ }else{
+ sqlite3OsFree(pOld);
+ return 0;
+ }
+ }else{
+ return sqlite3_malloc(nByte);
+ }
+}
/*
-** Create new user functions.
+** This function is exactly the same as sqlite3_create_function(), except
+** that it is designed to be called by internal code. The difference is
+** that if a malloc() fails in sqlite3_create_function(), an error code
+** is returned and the mallocFailed flag cleared.
*/
-int sqlite3_create_function(
+int sqlite3CreateFunc(
sqlite3 *db,
const char *zFunctionName,
int nArg,
@@ -426,6 +441,7 @@ int sqlite3_create_function(
(!xFunc && (!xFinal && xStep)) ||
(nArg<-1 || nArg>127) ||
(255<(nName = strlen(zFunctionName))) ){
+ sqlite3Error(db, SQLITE_ERROR, "bad parameters");
return SQLITE_ERROR;
}
@@ -441,10 +457,10 @@ int sqlite3_create_function(
enc = SQLITE_UTF16NATIVE;
}else if( enc==SQLITE_ANY ){
int rc;
- rc = sqlite3_create_function(db, zFunctionName, nArg, SQLITE_UTF8,
+ rc = sqlite3CreateFunc(db, zFunctionName, nArg, SQLITE_UTF8,
pUserData, xFunc, xStep, xFinal);
if( rc!=SQLITE_OK ) return rc;
- rc = sqlite3_create_function(db, zFunctionName, nArg, SQLITE_UTF16LE,
+ rc = sqlite3CreateFunc(db, zFunctionName, nArg, SQLITE_UTF16LE,
pUserData, xFunc, xStep, xFinal);
if( rc!=SQLITE_OK ) return rc;
enc = SQLITE_UTF16BE;
@@ -463,6 +479,7 @@ int sqlite3_create_function(
if( db->activeVdbeCnt ){
sqlite3Error(db, SQLITE_BUSY,
"Unable to delete/modify user-function due to active statements");
+ assert( !sqlite3MallocFailed() );
return SQLITE_BUSY;
}else{
sqlite3ExpirePreparedStatements(db);
@@ -470,42 +487,57 @@ int sqlite3_create_function(
}
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;
+ if( p ){
+ p->flags = 0;
+ p->xFunc = xFunc;
+ p->xStep = xStep;
+ p->xFinalize = xFinal;
+ p->pUserData = pUserData;
+ p->nArg = nArg;
+ }
return SQLITE_OK;
}
+
+/*
+** Create new user functions.
+*/
+int sqlite3_create_function(
+ sqlite3 *db,
+ const char *zFunctionName,
+ int nArg,
+ int enc,
+ void *p,
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value **),
+ void (*xStep)(sqlite3_context*,int,sqlite3_value **),
+ void (*xFinal)(sqlite3_context*)
+){
+ int rc;
+ assert( !sqlite3MallocFailed() );
+ rc = sqlite3CreateFunc(db, zFunctionName, nArg, enc, p, xFunc, xStep, xFinal);
+
+ return sqlite3ApiExit(db, rc);
+}
+
#ifndef SQLITE_OMIT_UTF16
int sqlite3_create_function16(
sqlite3 *db,
const void *zFunctionName,
int nArg,
int eTextRep,
- void *pUserData,
+ void *p,
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;
+ char *zFunc8;
+ assert( !sqlite3MallocFailed() );
- if( sqlite3SafetyCheck(db) ){
- return SQLITE_MISUSE;
- }
- pTmp = sqlite3GetTransientValue(db);
- sqlite3ValueSetStr(pTmp, -1, zFunctionName, SQLITE_UTF16NATIVE,SQLITE_STATIC);
- zFunc8 = sqlite3ValueText(pTmp, SQLITE_UTF8);
+ zFunc8 = sqlite3utf16to8(zFunctionName, -1);
+ rc = sqlite3CreateFunc(db, zFunc8, nArg, eTextRep, p, xFunc, xStep, xFinal);
+ sqliteFree(zFunc8);
- if( !zFunc8 ){
- return SQLITE_NOMEM;
- }
- rc = sqlite3_create_function(db, zFunc8, nArg, eTextRep,
- pUserData, xFunc, xStep, xFinal);
- return rc;
+ return sqlite3ApiExit(db, rc);
}
#endif
@@ -547,7 +579,7 @@ void *sqlite3_profile(
/*** EXPERIMENTAL ***
**
** Register a function to be invoked when a transaction comments.
-** If either function returns non-zero, then the commit becomes a
+** If the invoked function returns non-zero, then the commit becomes a
** rollback.
*/
void *sqlite3_commit_hook(
@@ -561,6 +593,35 @@ void *sqlite3_commit_hook(
return pOld;
}
+/*
+** Register a callback to be invoked each time a row is updated,
+** inserted or deleted using this database connection.
+*/
+void *sqlite3_update_hook(
+ sqlite3 *db, /* Attach the hook to this database */
+ void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
+ void *pArg /* Argument to the function */
+){
+ void *pRet = db->pUpdateArg;
+ db->xUpdateCallback = xCallback;
+ db->pUpdateArg = pArg;
+ return pRet;
+}
+
+/*
+** Register a callback to be invoked each time a transaction is rolled
+** back by this database connection.
+*/
+void *sqlite3_rollback_hook(
+ sqlite3 *db, /* Attach the hook to this database */
+ void (*xCallback)(void*), /* Callback function */
+ void *pArg /* Argument to the function */
+){
+ void *pRet = db->pRollbackArg;
+ db->xRollbackCallback = xCallback;
+ db->pRollbackArg = pArg;
+ return pRet;
+}
/*
** This routine is called to create a connection to a database BTree
@@ -621,7 +682,7 @@ int sqlite3BtreeFactory(
#endif /* SQLITE_OMIT_MEMORYDB */
}
- rc = sqlite3BtreeOpen(zFilename, ppBtree, btree_flags);
+ rc = sqlite3BtreeOpen(zFilename, (sqlite3 *)db, ppBtree, btree_flags);
if( rc==SQLITE_OK ){
sqlite3BtreeSetBusyHandler(*ppBtree, (void*)&db->busyHandler);
sqlite3BtreeSetCacheSize(*ppBtree, nCache);
@@ -635,13 +696,13 @@ int sqlite3BtreeFactory(
*/
const char *sqlite3_errmsg(sqlite3 *db){
const char *z;
- if( sqlite3_malloc_failed ){
+ if( !db || sqlite3MallocFailed() ){
return sqlite3ErrStr(SQLITE_NOMEM);
}
if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){
return sqlite3ErrStr(SQLITE_MISUSE);
}
- z = sqlite3_value_text(db->pErr);
+ z = (char*)sqlite3_value_text(db->pErr);
if( z==0 ){
z = sqlite3ErrStr(db->errCode);
}
@@ -674,7 +735,7 @@ const void *sqlite3_errmsg16(sqlite3 *db){
};
const void *z;
- if( sqlite3_malloc_failed ){
+ if( sqlite3MallocFailed() ){
return (void *)(&outOfMemBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
}
if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){
@@ -686,15 +747,17 @@ const void *sqlite3_errmsg16(sqlite3 *db){
SQLITE_UTF8, SQLITE_STATIC);
z = sqlite3_value_text16(db->pErr);
}
+ sqlite3ApiExit(0, 0);
return z;
}
#endif /* SQLITE_OMIT_UTF16 */
/*
-** Return the most recent error code generated by an SQLite routine.
+** Return the most recent error code generated by an SQLite routine. If NULL is
+** passed to this function, we assume a malloc() failed during sqlite3_open().
*/
int sqlite3_errcode(sqlite3 *db){
- if( sqlite3_malloc_failed ){
+ if( !db || sqlite3MallocFailed() ){
return SQLITE_NOMEM;
}
if( sqlite3SafetyCheck(db) ){
@@ -704,6 +767,63 @@ int sqlite3_errcode(sqlite3 *db){
}
/*
+** Create a new collating function for database "db". The name is zName
+** and the encoding is enc.
+*/
+static int createCollation(
+ sqlite3* db,
+ const char *zName,
+ int enc,
+ void* pCtx,
+ int(*xCompare)(void*,int,const void*,int,const void*)
+){
+ CollSeq *pColl;
+ int enc2;
+
+ 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.
+ */
+ enc2 = enc & ~SQLITE_UTF16_ALIGNED;
+ if( enc2==SQLITE_UTF16 ){
+ enc2 = SQLITE_UTF16NATIVE;
+ }
+
+ if( (enc2&~3)!=0 ){
+ sqlite3Error(db, SQLITE_ERROR, "unknown encoding");
+ 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)enc2, 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)enc2, zName, strlen(zName), 1);
+ if( pColl ){
+ pColl->xCmp = xCompare;
+ pColl->pUser = pCtx;
+ pColl->enc = enc2 | (enc & SQLITE_UTF16_ALIGNED);
+ }
+ sqlite3Error(db, SQLITE_OK, 0);
+ return SQLITE_OK;
+}
+
+
+/*
** 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.
@@ -713,9 +833,11 @@ static int openDatabase(
sqlite3 **ppDb /* OUT: Returned database handle */
){
sqlite3 *db;
- int rc, i;
+ int rc;
CollSeq *pColl;
+ assert( !sqlite3MallocFailed() );
+
/* Allocate the sqlite data structure */
db = sqliteMalloc( sizeof(sqlite3) );
if( db==0 ) goto opendb_out;
@@ -723,33 +845,34 @@ static int openDatabase(
db->magic = SQLITE_MAGIC_BUSY;
db->nDb = 2;
db->aDb = db->aDbStatic;
- db->enc = SQLITE_UTF8;
db->autoCommit = 1;
- db->flags |= SQLITE_ShortColNames;
+ db->flags |= SQLITE_ShortColNames
+#if SQLITE_DEFAULT_FILE_FORMAT<4
+ | SQLITE_LegacyFileFmt
+#endif
+ ;
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);
- }
-
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ sqlite3HashInit(&db->aModule, SQLITE_HASH_STRING, 0);
+#endif
+
/* 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 );
+ if( createCollation(db, "BINARY", SQLITE_UTF8, 0, binCollFunc) ||
+ createCollation(db, "BINARY", SQLITE_UTF16BE, 0, binCollFunc) ||
+ createCollation(db, "BINARY", SQLITE_UTF16LE, 0, binCollFunc) ||
+ (db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 6, 0))==0
+ ){
+ assert( sqlite3MallocFailed() );
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);
+ createCollation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc);
/* Set flags on the built-in collating sequences */
db->pDfltColl->type = SQLITE_COLL_BINARY;
@@ -765,6 +888,9 @@ static int openDatabase(
db->magic = SQLITE_MAGIC_CLOSED;
goto opendb_out;
}
+ db->aDb[0].pSchema = sqlite3SchemaGet(db->aDb[0].pBt);
+ db->aDb[1].pSchema = sqlite3SchemaGet(0);
+
/* The default safety_level for the main database is 'full'; for the temp
** database it is 'NONE'. This matches the pager layer defaults.
@@ -776,29 +902,23 @@ static int openDatabase(
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);
+ if( !sqlite3MallocFailed() ){
+ 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);
+ if( SQLITE_NOMEM==(rc = sqlite3_errcode(db)) ){
+ sqlite3_close(db);
+ db = 0;
}
*ppDb = db;
-#ifndef SQLITE_OMIT_GLOBALRECOVER
- if( db ){
- sqlite3OsEnterMutex();
- db->pNext = pDbList;
- pDbList = db;
- sqlite3OsLeaveMutex();
- }
-#endif
- return sqlite3_errcode(db);
+ return sqlite3ApiExit(0, rc);
}
/*
@@ -820,9 +940,10 @@ int sqlite3_open16(
sqlite3 **ppDb
){
char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
- int rc = SQLITE_NOMEM;
+ int rc = SQLITE_OK;
sqlite3_value *pVal;
+ assert( zFilename );
assert( ppDb );
*ppDb = 0;
pVal = sqlite3ValueNew();
@@ -831,14 +952,16 @@ int sqlite3_open16(
if( zFilename8 ){
rc = openDatabase(zFilename8, ppDb);
if( rc==SQLITE_OK && *ppDb ){
- sqlite3_exec(*ppDb, "PRAGMA encoding = 'UTF-16'", 0, 0, 0);
+ rc = sqlite3_exec(*ppDb, "PRAGMA encoding = 'UTF-16'", 0, 0, 0);
+ if( rc!=SQLITE_OK ){
+ sqlite3_close(*ppDb);
+ *ppDb = 0;
+ }
}
}
- if( pVal ){
- sqlite3ValueFree(pVal);
- }
+ sqlite3ValueFree(pVal);
- return rc;
+ return sqlite3ApiExit(0, rc);
}
#endif /* SQLITE_OMIT_UTF16 */
@@ -890,53 +1013,10 @@ int sqlite3_create_collation(
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;
+ int rc;
+ assert( !sqlite3MallocFailed() );
+ rc = createCollation(db, zName, enc, pCtx, xCompare);
+ return sqlite3ApiExit(db, rc);
}
#ifndef SQLITE_OMIT_UTF16
@@ -950,15 +1030,15 @@ int sqlite3_create_collation16(
void* pCtx,
int(*xCompare)(void*,int,const void*,int,const void*)
){
- char const *zName8;
- sqlite3_value *pTmp;
- if( sqlite3SafetyCheck(db) ){
- return SQLITE_MISUSE;
+ int rc = SQLITE_OK;
+ char *zName8;
+ assert( !sqlite3MallocFailed() );
+ zName8 = sqlite3utf16to8(zName, -1);
+ if( zName8 ){
+ rc = createCollation(db, zName8, enc, pCtx, xCompare);
+ sqliteFree(zName8);
}
- 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);
+ return sqlite3ApiExit(db, rc);
}
#endif /* SQLITE_OMIT_UTF16 */
@@ -1002,37 +1082,11 @@ int sqlite3_collation_needed16(
#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.
+** This function is now an anachronism. It used to be used to recover from a
+** malloc() failure, but SQLite now does this automatically.
*/
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;
+ return SQLITE_OK;
}
#endif
@@ -1058,3 +1112,176 @@ int sqlite3Corrupt(void){
return SQLITE_CORRUPT;
}
#endif
+
+
+#ifndef SQLITE_OMIT_SHARED_CACHE
+/*
+** Enable or disable the shared pager and schema features for the
+** current thread.
+**
+** This routine should only be called when there are no open
+** database connections.
+*/
+int sqlite3_enable_shared_cache(int enable){
+ ThreadData *pTd = sqlite3ThreadData();
+ if( pTd ){
+ /* It is only legal to call sqlite3_enable_shared_cache() when there
+ ** are no currently open b-trees that were opened by the calling thread.
+ ** This condition is only easy to detect if the shared-cache were
+ ** previously enabled (and is being disabled).
+ */
+ if( pTd->pBtree && !enable ){
+ assert( pTd->useSharedData );
+ return SQLITE_MISUSE;
+ }
+
+ pTd->useSharedData = enable;
+ sqlite3ReleaseThreadData();
+ }
+ return sqlite3ApiExit(0, SQLITE_OK);
+}
+#endif
+
+/*
+** This is a convenience routine that makes sure that all thread-specific
+** data for this thread has been deallocated.
+*/
+void sqlite3_thread_cleanup(void){
+ ThreadData *pTd = sqlite3OsThreadSpecificData(0);
+ if( pTd ){
+ memset(pTd, 0, sizeof(*pTd));
+ sqlite3OsThreadSpecificData(-1);
+ }
+}
+
+/*
+** Return meta information about a specific column of a database table.
+** See comment in sqlite3.h (sqlite.h.in) for details.
+*/
+#ifdef SQLITE_ENABLE_COLUMN_METADATA
+int sqlite3_table_column_metadata(
+ sqlite3 *db, /* Connection handle */
+ const char *zDbName, /* Database name or NULL */
+ const char *zTableName, /* Table name */
+ const char *zColumnName, /* Column name */
+ char const **pzDataType, /* OUTPUT: Declared data type */
+ char const **pzCollSeq, /* OUTPUT: Collation sequence name */
+ int *pNotNull, /* OUTPUT: True if NOT NULL constraint exists */
+ int *pPrimaryKey, /* OUTPUT: True if column part of PK */
+ int *pAutoinc /* OUTPUT: True if colums is auto-increment */
+){
+ int rc;
+ char *zErrMsg = 0;
+ Table *pTab = 0;
+ Column *pCol = 0;
+ int iCol;
+
+ char const *zDataType = 0;
+ char const *zCollSeq = 0;
+ int notnull = 0;
+ int primarykey = 0;
+ int autoinc = 0;
+
+ /* Ensure the database schema has been loaded */
+ if( sqlite3SafetyOn(db) ){
+ return SQLITE_MISUSE;
+ }
+ rc = sqlite3Init(db, &zErrMsg);
+ if( SQLITE_OK!=rc ){
+ goto error_out;
+ }
+
+ /* Locate the table in question */
+ pTab = sqlite3FindTable(db, zTableName, zDbName);
+ if( !pTab || pTab->pSelect ){
+ pTab = 0;
+ goto error_out;
+ }
+
+ /* Find the column for which info is requested */
+ if( sqlite3IsRowid(zColumnName) ){
+ iCol = pTab->iPKey;
+ if( iCol>=0 ){
+ pCol = &pTab->aCol[iCol];
+ }
+ }else{
+ for(iCol=0; iCol<pTab->nCol; iCol++){
+ pCol = &pTab->aCol[iCol];
+ if( 0==sqlite3StrICmp(pCol->zName, zColumnName) ){
+ break;
+ }
+ }
+ if( iCol==pTab->nCol ){
+ pTab = 0;
+ goto error_out;
+ }
+ }
+
+ /* The following block stores the meta information that will be returned
+ ** to the caller in local variables zDataType, zCollSeq, notnull, primarykey
+ ** and autoinc. At this point there are two possibilities:
+ **
+ ** 1. The specified column name was rowid", "oid" or "_rowid_"
+ ** and there is no explicitly declared IPK column.
+ **
+ ** 2. The table is not a view and the column name identified an
+ ** explicitly declared column. Copy meta information from *pCol.
+ */
+ if( pCol ){
+ zDataType = pCol->zType;
+ zCollSeq = pCol->zColl;
+ notnull = (pCol->notNull?1:0);
+ primarykey = (pCol->isPrimKey?1:0);
+ autoinc = ((pTab->iPKey==iCol && pTab->autoInc)?1:0);
+ }else{
+ zDataType = "INTEGER";
+ primarykey = 1;
+ }
+ if( !zCollSeq ){
+ zCollSeq = "BINARY";
+ }
+
+error_out:
+ if( sqlite3SafetyOff(db) ){
+ rc = SQLITE_MISUSE;
+ }
+
+ /* Whether the function call succeeded or failed, set the output parameters
+ ** to whatever their local counterparts contain. If an error did occur,
+ ** this has the effect of zeroing all output parameters.
+ */
+ if( pzDataType ) *pzDataType = zDataType;
+ if( pzCollSeq ) *pzCollSeq = zCollSeq;
+ if( pNotNull ) *pNotNull = notnull;
+ if( pPrimaryKey ) *pPrimaryKey = primarykey;
+ if( pAutoinc ) *pAutoinc = autoinc;
+
+ if( SQLITE_OK==rc && !pTab ){
+ sqlite3SetString(&zErrMsg, "no such table column: ", zTableName, ".",
+ zColumnName, 0);
+ rc = SQLITE_ERROR;
+ }
+ sqlite3Error(db, rc, (zErrMsg?"%s":0), zErrMsg);
+ sqliteFree(zErrMsg);
+ return sqlite3ApiExit(db, rc);
+}
+#endif
+
+/*
+** 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/opcodes.h b/ext/pdo_sqlite/sqlite/src/opcodes.h
index 4db3ec163..c113f8f1c 100644
--- a/ext/pdo_sqlite/sqlite/src/opcodes.h
+++ b/ext/pdo_sqlite/sqlite/src/opcodes.h
@@ -1,149 +1,161 @@
/* 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_VNext 2
+#define OP_HexBlob 127 /* same as TK_BLOB */
+#define OP_Column 3
+#define OP_SetCookie 4
+#define OP_IfMemPos 5
+#define OP_Real 126 /* same as TK_FLOAT */
+#define OP_Sequence 6
+#define OP_MoveGt 7
+#define OP_Ge 73 /* same as TK_GE */
+#define OP_RowKey 8
+#define OP_Eq 69 /* same as TK_EQ */
+#define OP_OpenWrite 9
+#define OP_NotNull 67 /* same as TK_NOTNULL */
+#define OP_If 10
+#define OP_ToInt 142 /* same as TK_TO_INT */
+#define OP_String8 88 /* 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
+#define OP_VRowid 12
+#define OP_CollSeq 13
+#define OP_OpenRead 14
+#define OP_Expire 15
+#define OP_AutoCommit 17
+#define OP_Gt 70 /* same as TK_GT */
+#define OP_IntegrityCk 18
+#define OP_Sort 19
+#define OP_Function 20
+#define OP_And 62 /* same as TK_AND */
+#define OP_Subtract 80 /* same as TK_MINUS */
+#define OP_Noop 21
+#define OP_Return 22
+#define OP_Remainder 83 /* same as TK_REM */
+#define OP_NewRowid 23
+#define OP_Multiply 81 /* same as TK_STAR */
+#define OP_IfMemNeg 24
+#define OP_Variable 25
+#define OP_String 26
+#define OP_RealAffinity 27
+#define OP_ParseSchema 28
+#define OP_VOpen 29
+#define OP_Close 30
+#define OP_CreateIndex 31
+#define OP_IsUnique 32
+#define OP_IdxIsNull 33
+#define OP_NotFound 34
+#define OP_Int64 35
+#define OP_MustBeInt 36
+#define OP_Halt 37
+#define OP_Rowid 38
+#define OP_IdxLT 39
+#define OP_AddImm 40
+#define OP_Statement 41
+#define OP_RowData 42
+#define OP_MemMax 43
+#define OP_Push 44
+#define OP_Or 61 /* same as TK_OR */
+#define OP_NotExists 45
+#define OP_MemIncr 46
+#define OP_Gosub 47
+#define OP_Divide 82 /* same as TK_SLASH */
+#define OP_Integer 48
+#define OP_ToNumeric 141 /* same as TK_TO_NUMERIC*/
+#define OP_MemInt 49
+#define OP_Prev 50
+#define OP_Concat 84 /* same as TK_CONCAT */
+#define OP_BitAnd 75 /* same as TK_BITAND */
+#define OP_VColumn 51
+#define OP_CreateTable 52
+#define OP_Last 53
+#define OP_IsNull 66 /* same as TK_ISNULL */
+#define OP_IdxRowid 54
+#define OP_MakeIdxRec 55
+#define OP_ShiftRight 78 /* same as TK_RSHIFT */
+#define OP_ResetCount 56
+#define OP_FifoWrite 57
+#define OP_Callback 58
+#define OP_ContextPush 59
+#define OP_DropTrigger 60
+#define OP_DropIndex 63
+#define OP_IdxGE 64
+#define OP_IdxDelete 65
+#define OP_Vacuum 74
+#define OP_MoveLe 86
+#define OP_IfNot 89
+#define OP_DropTable 90
+#define OP_MakeRecord 91
+#define OP_ToBlob 140 /* same as TK_TO_BLOB */
+#define OP_Delete 92
+#define OP_AggFinal 93
+#define OP_ShiftLeft 77 /* same as TK_LSHIFT */
+#define OP_Dup 94
+#define OP_Goto 95
+#define OP_TableLock 96
+#define OP_FifoRead 97
+#define OP_Clear 98
+#define OP_IdxGT 99
+#define OP_MoveLt 100
+#define OP_Le 71 /* same as TK_LE */
+#define OP_VerifyCookie 101
+#define OP_AggStep 102
+#define OP_Pull 103
+#define OP_ToText 139 /* same as TK_TO_TEXT */
+#define OP_Not 16 /* same as TK_NOT */
+#define OP_ToReal 143 /* same as TK_TO_REAL */
+#define OP_SetNumColumns 104
+#define OP_AbsValue 105
+#define OP_Transaction 106
+#define OP_VFilter 107
+#define OP_Negative 85 /* same as TK_UMINUS */
+#define OP_Ne 68 /* same as TK_NE */
+#define OP_VDestroy 108
+#define OP_ContextPop 109
+#define OP_BitOr 76 /* same as TK_BITOR */
+#define OP_Next 110
+#define OP_IdxInsert 111
+#define OP_Distinct 112
+#define OP_Lt 72 /* same as TK_LT */
+#define OP_Insert 113
+#define OP_Destroy 114
+#define OP_ReadCookie 115
+#define OP_ForceInt 116
+#define OP_LoadAnalysis 117
+#define OP_Explain 118
+#define OP_IfMemZero 119
+#define OP_OpenPseudo 120
+#define OP_OpenEphemeral 121
+#define OP_Null 122
+#define OP_Blob 123
+#define OP_Add 79 /* same as TK_PLUS */
+#define OP_MemStore 124
+#define OP_Rewind 125
+#define OP_MoveGe 128
+#define OP_VBegin 129
+#define OP_VUpdate 130
+#define OP_BitNot 87 /* same as TK_BITNOT */
+#define OP_VCreate 131
+#define OP_MemMove 132
+#define OP_MemNull 133
+#define OP_Found 134
+#define OP_NullRow 135
/* 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 OP_NotUsed_136 136
+#define OP_NotUsed_137 137
+#define OP_NotUsed_138 138
-#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
+/* Opcodes that are guaranteed to never push a value onto the stack
+** contain a 1 their corresponding position of the following mask
+** set. See the opcodeNoPush() function in vdbeaux.c */
+#define NOPUSH_MASK_0 0xeeb4
+#define NOPUSH_MASK_1 0x796b
+#define NOPUSH_MASK_2 0xfbb7
+#define NOPUSH_MASK_3 0xff24
+#define NOPUSH_MASK_4 0xffff
+#define NOPUSH_MASK_5 0xb6ef
+#define NOPUSH_MASK_6 0xfdfd
+#define NOPUSH_MASK_7 0x33b3
+#define NOPUSH_MASK_8 0xf8cf
+#define NOPUSH_MASK_9 0x0000
diff --git a/ext/pdo_sqlite/sqlite/src/os.c b/ext/pdo_sqlite/sqlite/src/os.c
new file mode 100644
index 000000000..ec482fe0e
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/os.c
@@ -0,0 +1,92 @@
+/*
+** 2005 November 29
+**
+** 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 OS interface code that is common to all
+** architectures.
+*/
+#define _SQLITE_OS_C_ 1
+#include "sqliteInt.h"
+#include "os.h"
+
+/*
+** The following routines are convenience wrappers around methods
+** of the OsFile object. This is mostly just syntactic sugar. All
+** of this would be completely automatic if SQLite were coded using
+** C++ instead of plain old C.
+*/
+int sqlite3OsClose(OsFile **pId){
+ OsFile *id;
+ if( pId!=0 && (id = *pId)!=0 ){
+ return id->pMethod->xClose(pId);
+ }else{
+ return SQLITE_OK;
+ }
+}
+int sqlite3OsOpenDirectory(OsFile *id, const char *zName){
+ return id->pMethod->xOpenDirectory(id, zName);
+}
+int sqlite3OsRead(OsFile *id, void *pBuf, int amt){
+ return id->pMethod->xRead(id, pBuf, amt);
+}
+int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){
+ return id->pMethod->xWrite(id, pBuf, amt);
+}
+int sqlite3OsSeek(OsFile *id, i64 offset){
+ return id->pMethod->xSeek(id, offset);
+}
+int sqlite3OsTruncate(OsFile *id, i64 size){
+ return id->pMethod->xTruncate(id, size);
+}
+int sqlite3OsSync(OsFile *id, int fullsync){
+ return id->pMethod->xSync(id, fullsync);
+}
+void sqlite3OsSetFullSync(OsFile *id, int value){
+ id->pMethod->xSetFullSync(id, value);
+}
+#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
+/* This method is currently only used while interactively debugging the
+** pager. More specificly, it can only be used when sqlite3DebugPrintf() is
+** included in the build. */
+int sqlite3OsFileHandle(OsFile *id){
+ return id->pMethod->xFileHandle(id);
+}
+#endif
+int sqlite3OsFileSize(OsFile *id, i64 *pSize){
+ return id->pMethod->xFileSize(id, pSize);
+}
+int sqlite3OsLock(OsFile *id, int lockType){
+ return id->pMethod->xLock(id, lockType);
+}
+int sqlite3OsUnlock(OsFile *id, int lockType){
+ return id->pMethod->xUnlock(id, lockType);
+}
+int sqlite3OsLockState(OsFile *id){
+ return id->pMethod->xLockState(id);
+}
+int sqlite3OsCheckReservedLock(OsFile *id){
+ return id->pMethod->xCheckReservedLock(id);
+}
+
+#ifdef SQLITE_ENABLE_REDEF_IO
+/*
+** A function to return a pointer to the virtual function table.
+** This routine really does not accomplish very much since the
+** virtual function table is a global variable and anybody who
+** can call this function can just as easily access the variable
+** for themselves. Nevertheless, we include this routine for
+** backwards compatibility with an earlier redefinable I/O
+** interface design.
+*/
+struct sqlite3OsVtbl *sqlite3_os_switch(void){
+ return &sqlite3Os;
+}
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/os.h b/ext/pdo_sqlite/sqlite/src/os.h
index a161d134a..4433f5d02 100644
--- a/ext/pdo_sqlite/sqlite/src/os.h
+++ b/ext/pdo_sqlite/sqlite/src/os.h
@@ -18,23 +18,28 @@
#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)
+** Figure out if we are dealing with Unix, Windows, or some other
+** operating system.
*/
-#if !defined(OS_UNIX) && !defined(OS_TEST) && !defined(OS_OTHER)
+#if !defined(OS_UNIX) && !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
+# define OS_OS2 0
+# elif defined(_EMX_) || defined(_OS2) || defined(OS2) || defined(_OS2_) || defined(__OS2__)
+# define OS_WIN 0
+# define OS_UNIX 0
+# define OS_OS2 1
# else
# define OS_WIN 0
# define OS_UNIX 1
+# define OS_OS2 0
# endif
# else
# define OS_UNIX 0
+# define OS_OS2 0
# endif
#else
# ifndef OS_WIN
@@ -42,25 +47,23 @@
# endif
#endif
+
/*
-** Invoke the appropriate operating-system specific header file.
+** Define the maximum size of a temporary filename
*/
-#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"
+# include <windows.h>
+# define SQLITE_TEMPNAME_SIZE (MAX_PATH+50)
+#elif OS_OS2
+# define INCL_DOSDATETIME
+# define INCL_DOSFILEMGR
+# define INCL_DOSERRORS
+# define INCL_DOSMISC
+# define INCL_DOSPROCESS
+# include <os2.h>
+# define SQLITE_TEMPNAME_SIZE (CCHMAXPATHCOMP)
+#else
+# define SQLITE_TEMPNAME_SIZE 200
#endif
/* If the SET_FULLSYNC macro is not defined above, then make it
@@ -84,6 +87,129 @@
#endif
/*
+** Define the interfaces for Unix, Windows, and OS/2.
+*/
+#if OS_UNIX
+#define sqlite3OsOpenReadWrite sqlite3UnixOpenReadWrite
+#define sqlite3OsOpenExclusive sqlite3UnixOpenExclusive
+#define sqlite3OsOpenReadOnly sqlite3UnixOpenReadOnly
+#define sqlite3OsDelete sqlite3UnixDelete
+#define sqlite3OsFileExists sqlite3UnixFileExists
+#define sqlite3OsFullPathname sqlite3UnixFullPathname
+#define sqlite3OsIsDirWritable sqlite3UnixIsDirWritable
+#define sqlite3OsSyncDirectory sqlite3UnixSyncDirectory
+#define sqlite3OsTempFileName sqlite3UnixTempFileName
+#define sqlite3OsRandomSeed sqlite3UnixRandomSeed
+#define sqlite3OsSleep sqlite3UnixSleep
+#define sqlite3OsCurrentTime sqlite3UnixCurrentTime
+#define sqlite3OsEnterMutex sqlite3UnixEnterMutex
+#define sqlite3OsLeaveMutex sqlite3UnixLeaveMutex
+#define sqlite3OsInMutex sqlite3UnixInMutex
+#define sqlite3OsThreadSpecificData sqlite3UnixThreadSpecificData
+#define sqlite3OsMalloc sqlite3GenericMalloc
+#define sqlite3OsRealloc sqlite3GenericRealloc
+#define sqlite3OsFree sqlite3GenericFree
+#define sqlite3OsAllocationSize sqlite3GenericAllocationSize
+#endif
+#if OS_WIN
+#define sqlite3OsOpenReadWrite sqlite3WinOpenReadWrite
+#define sqlite3OsOpenExclusive sqlite3WinOpenExclusive
+#define sqlite3OsOpenReadOnly sqlite3WinOpenReadOnly
+#define sqlite3OsDelete sqlite3WinDelete
+#define sqlite3OsFileExists sqlite3WinFileExists
+#define sqlite3OsFullPathname sqlite3WinFullPathname
+#define sqlite3OsIsDirWritable sqlite3WinIsDirWritable
+#define sqlite3OsSyncDirectory sqlite3WinSyncDirectory
+#define sqlite3OsTempFileName sqlite3WinTempFileName
+#define sqlite3OsRandomSeed sqlite3WinRandomSeed
+#define sqlite3OsSleep sqlite3WinSleep
+#define sqlite3OsCurrentTime sqlite3WinCurrentTime
+#define sqlite3OsEnterMutex sqlite3WinEnterMutex
+#define sqlite3OsLeaveMutex sqlite3WinLeaveMutex
+#define sqlite3OsInMutex sqlite3WinInMutex
+#define sqlite3OsThreadSpecificData sqlite3WinThreadSpecificData
+#define sqlite3OsMalloc sqlite3GenericMalloc
+#define sqlite3OsRealloc sqlite3GenericRealloc
+#define sqlite3OsFree sqlite3GenericFree
+#define sqlite3OsAllocationSize sqlite3GenericAllocationSize
+#endif
+#if OS_OS2
+#define sqlite3OsOpenReadWrite sqlite3Os2OpenReadWrite
+#define sqlite3OsOpenExclusive sqlite3Os2OpenExclusive
+#define sqlite3OsOpenReadOnly sqlite3Os2OpenReadOnly
+#define sqlite3OsDelete sqlite3Os2Delete
+#define sqlite3OsFileExists sqlite3Os2FileExists
+#define sqlite3OsFullPathname sqlite3Os2FullPathname
+#define sqlite3OsIsDirWritable sqlite3Os2IsDirWritable
+#define sqlite3OsSyncDirectory sqlite3Os2SyncDirectory
+#define sqlite3OsTempFileName sqlite3Os2TempFileName
+#define sqlite3OsRandomSeed sqlite3Os2RandomSeed
+#define sqlite3OsSleep sqlite3Os2Sleep
+#define sqlite3OsCurrentTime sqlite3Os2CurrentTime
+#define sqlite3OsEnterMutex sqlite3Os2EnterMutex
+#define sqlite3OsLeaveMutex sqlite3Os2LeaveMutex
+#define sqlite3OsInMutex sqlite3Os2InMutex
+#define sqlite3OsThreadSpecificData sqlite3Os2ThreadSpecificData
+#define sqlite3OsMalloc sqlite3GenericMalloc
+#define sqlite3OsRealloc sqlite3GenericRealloc
+#define sqlite3OsFree sqlite3GenericFree
+#define sqlite3OsAllocationSize sqlite3GenericAllocationSize
+#endif
+
+
+
+
+/*
+** If using an alternative OS interface, then we must have an "os_other.h"
+** header file available for that interface. Presumably the "os_other.h"
+** header file contains #defines similar to those above.
+*/
+#if OS_OTHER
+# include "os_other.h"
+#endif
+
+
+
+/*
+** Forward declarations
+*/
+typedef struct OsFile OsFile;
+typedef struct IoMethod IoMethod;
+
+/*
+** An instance of the following structure contains pointers to all
+** methods on an OsFile object.
+*/
+struct IoMethod {
+ int (*xClose)(OsFile**);
+ int (*xOpenDirectory)(OsFile*, const char*);
+ int (*xRead)(OsFile*, void*, int amt);
+ int (*xWrite)(OsFile*, const void*, int amt);
+ int (*xSeek)(OsFile*, i64 offset);
+ int (*xTruncate)(OsFile*, i64 size);
+ int (*xSync)(OsFile*, int);
+ void (*xSetFullSync)(OsFile *id, int setting);
+ int (*xFileHandle)(OsFile *id);
+ int (*xFileSize)(OsFile*, i64 *pSize);
+ int (*xLock)(OsFile*, int);
+ int (*xUnlock)(OsFile*, int);
+ int (*xLockState)(OsFile *id);
+ int (*xCheckReservedLock)(OsFile *id);
+};
+
+/*
+** The OsFile object describes an open disk file in an OS-dependent way.
+** The version of OsFile defined here is a generic version. Each OS
+** implementation defines its own subclass of this structure that contains
+** additional information needed to handle file I/O. But the pMethod
+** entry (pointing to the virtual function table) always occurs first
+** so that we can always find the appropriate methods.
+*/
+struct OsFile {
+ IoMethod const *pMethod;
+};
+
+/*
** The following values may be passed as the second argument to
** sqlite3OsLock(). The various locks exhibit the following semantics:
**
@@ -137,8 +263,10 @@
** 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
+** These #defines are available in sqlite_aux.h so that adaptors for
+** connecting SQLite to other operating systems can use the same byte
+** ranges for locking. In particular, the same locking strategy and
+** byte ranges are used for Unix. 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
@@ -172,36 +300,181 @@ extern unsigned int sqlite3_pending_byte;
#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*);
+/*
+** Prototypes for operating system interface routines.
+*/
+int sqlite3OsClose(OsFile**);
+int sqlite3OsOpenDirectory(OsFile*, const char*);
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 sqlite3OsSync(OsFile*, int);
+void sqlite3OsSetFullSync(OsFile *id, int setting);
+int sqlite3OsFileHandle(OsFile *id);
int sqlite3OsFileSize(OsFile*, i64 *pSize);
-char *sqlite3OsFullPathname(const char*);
int sqlite3OsLock(OsFile*, int);
int sqlite3OsUnlock(OsFile*, int);
+int sqlite3OsLockState(OsFile *id);
int sqlite3OsCheckReservedLock(OsFile *id);
-
-
-/* The interface for file I/O is above. Other miscellaneous functions
-** are below */
-
+int sqlite3OsOpenReadWrite(const char*, OsFile**, int*);
+int sqlite3OsOpenExclusive(const char*, OsFile**, int);
+int sqlite3OsOpenReadOnly(const char*, OsFile**);
+int sqlite3OsDelete(const char*);
+int sqlite3OsFileExists(const char*);
+char *sqlite3OsFullPathname(const char*);
+int sqlite3OsIsDirWritable(char*);
+int sqlite3OsSyncDirectory(const char*);
+int sqlite3OsTempFileName(char*);
int sqlite3OsRandomSeed(char*);
int sqlite3OsSleep(int ms);
int sqlite3OsCurrentTime(double*);
void sqlite3OsEnterMutex(void);
void sqlite3OsLeaveMutex(void);
+int sqlite3OsInMutex(int);
+ThreadData *sqlite3OsThreadSpecificData(int);
+void *sqlite3OsMalloc(int);
+void *sqlite3OsRealloc(void *, int);
+void sqlite3OsFree(void *);
+int sqlite3OsAllocationSize(void *);
+
+/*
+** If the SQLITE_ENABLE_REDEF_IO macro is defined, then the OS-layer
+** interface routines are not called directly but are invoked using
+** pointers to functions. This allows the implementation of various
+** OS-layer interface routines to be modified at run-time. There are
+** obscure but legitimate reasons for wanting to do this. But for
+** most users, a direct call to the underlying interface is preferable
+** so the the redefinable I/O interface is turned off by default.
+*/
+#ifdef SQLITE_ENABLE_REDEF_IO
+
+/*
+** When redefinable I/O is enabled, a single global instance of the
+** following structure holds pointers to the routines that SQLite
+** uses to talk with the underlying operating system. Modify this
+** structure (before using any SQLite API!) to accomodate perculiar
+** operating system interfaces or behaviors.
+*/
+struct sqlite3OsVtbl {
+ int (*xOpenReadWrite)(const char*, OsFile**, int*);
+ int (*xOpenExclusive)(const char*, OsFile**, int);
+ int (*xOpenReadOnly)(const char*, OsFile**);
+
+ int (*xDelete)(const char*);
+ int (*xFileExists)(const char*);
+ char *(*xFullPathname)(const char*);
+ int (*xIsDirWritable)(char*);
+ int (*xSyncDirectory)(const char*);
+ int (*xTempFileName)(char*);
+
+ int (*xRandomSeed)(char*);
+ int (*xSleep)(int ms);
+ int (*xCurrentTime)(double*);
+
+ void (*xEnterMutex)(void);
+ void (*xLeaveMutex)(void);
+ int (*xInMutex)(int);
+ ThreadData *(*xThreadSpecificData)(int);
+
+ void *(*xMalloc)(int);
+ void *(*xRealloc)(void *, int);
+ void (*xFree)(void *);
+ int (*xAllocationSize)(void *);
+};
+
+/* Macro used to comment out routines that do not exists when there is
+** no disk I/O
+*/
+#ifdef SQLITE_OMIT_DISKIO
+# define IF_DISKIO(X) 0
+#else
+# define IF_DISKIO(X) X
+#endif
+
+#ifdef _SQLITE_OS_C_
+ /*
+ ** The os.c file implements the global virtual function table.
+ */
+ struct sqlite3OsVtbl sqlite3Os = {
+ IF_DISKIO( sqlite3OsOpenReadWrite ),
+ IF_DISKIO( sqlite3OsOpenExclusive ),
+ IF_DISKIO( sqlite3OsOpenReadOnly ),
+ IF_DISKIO( sqlite3OsDelete ),
+ IF_DISKIO( sqlite3OsFileExists ),
+ IF_DISKIO( sqlite3OsFullPathname ),
+ IF_DISKIO( sqlite3OsIsDirWritable ),
+ IF_DISKIO( sqlite3OsSyncDirectory ),
+ IF_DISKIO( sqlite3OsTempFileName ),
+ sqlite3OsRandomSeed,
+ sqlite3OsSleep,
+ sqlite3OsCurrentTime,
+ sqlite3OsEnterMutex,
+ sqlite3OsLeaveMutex,
+ sqlite3OsInMutex,
+ sqlite3OsThreadSpecificData,
+ sqlite3OsMalloc,
+ sqlite3OsRealloc,
+ sqlite3OsFree,
+ sqlite3OsAllocationSize
+ };
+#else
+ /*
+ ** Files other than os.c just reference the global virtual function table.
+ */
+ extern struct sqlite3OsVtbl sqlite3Os;
+#endif /* _SQLITE_OS_C_ */
+
+
+/* This additional API routine is available with redefinable I/O */
+struct sqlite3OsVtbl *sqlite3_os_switch(void);
+
+
+/*
+** Redefine the OS interface to go through the virtual function table
+** rather than calling routines directly.
+*/
+#undef sqlite3OsOpenReadWrite
+#undef sqlite3OsOpenExclusive
+#undef sqlite3OsOpenReadOnly
+#undef sqlite3OsDelete
+#undef sqlite3OsFileExists
+#undef sqlite3OsFullPathname
+#undef sqlite3OsIsDirWritable
+#undef sqlite3OsSyncDirectory
+#undef sqlite3OsTempFileName
+#undef sqlite3OsRandomSeed
+#undef sqlite3OsSleep
+#undef sqlite3OsCurrentTime
+#undef sqlite3OsEnterMutex
+#undef sqlite3OsLeaveMutex
+#undef sqlite3OsInMutex
+#undef sqlite3OsThreadSpecificData
+#undef sqlite3OsMalloc
+#undef sqlite3OsRealloc
+#undef sqlite3OsFree
+#undef sqlite3OsAllocationSize
+#define sqlite3OsOpenReadWrite sqlite3Os.xOpenReadWrite
+#define sqlite3OsOpenExclusive sqlite3Os.xOpenExclusive
+#define sqlite3OsOpenReadOnly sqlite3Os.xOpenReadOnly
+#define sqlite3OsDelete sqlite3Os.xDelete
+#define sqlite3OsFileExists sqlite3Os.xFileExists
+#define sqlite3OsFullPathname sqlite3Os.xFullPathname
+#define sqlite3OsIsDirWritable sqlite3Os.xIsDirWritable
+#define sqlite3OsSyncDirectory sqlite3Os.xSyncDirectory
+#define sqlite3OsTempFileName sqlite3Os.xTempFileName
+#define sqlite3OsRandomSeed sqlite3Os.xRandomSeed
+#define sqlite3OsSleep sqlite3Os.xSleep
+#define sqlite3OsCurrentTime sqlite3Os.xCurrentTime
+#define sqlite3OsEnterMutex sqlite3Os.xEnterMutex
+#define sqlite3OsLeaveMutex sqlite3Os.xLeaveMutex
+#define sqlite3OsInMutex sqlite3Os.xInMutex
+#define sqlite3OsThreadSpecificData sqlite3Os.xThreadSpecificData
+#define sqlite3OsMalloc sqlite3Os.xMalloc
+#define sqlite3OsRealloc sqlite3Os.xRealloc
+#define sqlite3OsFree sqlite3Os.xFree
+#define sqlite3OsAllocationSize sqlite3Os.xAllocationSize
+
+#endif /* SQLITE_ENABLE_REDEF_IO */
#endif /* _SQLITE_OS_H_ */
diff --git a/ext/pdo_sqlite/sqlite/src/os_common.h b/ext/pdo_sqlite/sqlite/src/os_common.h
index b19ff0590..d65c352dd 100644
--- a/ext/pdo_sqlite/sqlite/src/os_common.h
+++ b/ext/pdo_sqlite/sqlite/src/os_common.h
@@ -88,6 +88,7 @@ static unsigned int elapse;
** is used for testing the I/O recovery logic.
*/
#ifdef SQLITE_TEST
+int sqlite3_io_error_hit = 0;
int sqlite3_io_error_pending = 0;
int sqlite3_diskfull_pending = 0;
int sqlite3_diskfull = 0;
@@ -95,7 +96,7 @@ int sqlite3_diskfull = 0;
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 */
+ sqlite3_io_error_hit = 1; /* Really just a place to set a breakpoint */
}
#define SimulateDiskfullError \
if( sqlite3_diskfull_pending ){ \
@@ -121,3 +122,67 @@ int sqlite3_open_file_count = 0;
#else
#define OpenCounter(X)
#endif
+
+/*
+** sqlite3GenericMalloc
+** sqlite3GenericRealloc
+** sqlite3GenericOsFree
+** sqlite3GenericAllocationSize
+**
+** Implementation of the os level dynamic memory allocation interface in terms
+** of the standard malloc(), realloc() and free() found in many operating
+** systems. No rocket science here.
+**
+** There are two versions of these four functions here. The version
+** implemented here is only used if memory-management or memory-debugging is
+** enabled. This version allocates an extra 8-bytes at the beginning of each
+** block and stores the size of the allocation there.
+**
+** If neither memory-management or debugging is enabled, the second
+** set of implementations is used instead.
+*/
+#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || defined (SQLITE_MEMDEBUG)
+void *sqlite3GenericMalloc(int n){
+ char *p = (char *)malloc(n+8);
+ assert(n>0);
+ assert(sizeof(int)<=8);
+ if( p ){
+ *(int *)p = n;
+ p += 8;
+ }
+ return (void *)p;
+}
+void *sqlite3GenericRealloc(void *p, int n){
+ char *p2 = ((char *)p - 8);
+ assert(n>0);
+ p2 = (char*)realloc(p2, n+8);
+ if( p2 ){
+ *(int *)p2 = n;
+ p2 += 8;
+ }
+ return (void *)p2;
+}
+void sqlite3GenericFree(void *p){
+ assert(p);
+ free((void *)((char *)p - 8));
+}
+int sqlite3GenericAllocationSize(void *p){
+ return p ? *(int *)((char *)p - 8) : 0;
+}
+#else
+void *sqlite3GenericMalloc(int n){
+ char *p = (char *)malloc(n);
+ return (void *)p;
+}
+void *sqlite3GenericRealloc(void *p, int n){
+ assert(n>0);
+ p = realloc(p, n);
+ return p;
+}
+void sqlite3GenericFree(void *p){
+ assert(p);
+ free(p);
+}
+/* Never actually used, but needed for the linker */
+int sqlite3GenericAllocationSize(void *p){ return 0; }
+#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 f84c168d4..000000000
--- 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(&params, 0, sizeof(ParamBlockRec));
- params.ioParam.ioRefNum = id->refNum;
- if( PBFlushFileSync(&params) != 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(&params, 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(&params))!=noErr ){
- UInt32 finalTicks;
- Delay(1, &finalTicks); /* 1/60 sec */
- }
- if( res == noErr ){
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1;
- params.ioParam.ioReqCount = N_LOCKBYTE;
- PBUnlockRangeSync(&params);
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE+lk;
- params.ioParam.ioReqCount = 1;
- res = PBLockRangeSync(&params);
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE;
- params.ioParam.ioReqCount = 1;
- PBUnlockRangeSync(&params);
- }
- 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(&params, 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(&params))!=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(&params)==noErr ){
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE+1;
- params.ioParam.ioReqCount = N_LOCKBYTE;
- res = PBLockRangeSync(&params);
- }else{
- res = afpRangeNotLocked;
- }
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE;
- params.ioParam.ioReqCount = 1;
- PBUnlockRangeSync(&params);
- }
- 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(&params, 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(&params);
- rc = SQLITE_OK;
- id->locked = 0;
- }else{
- params.ioParam.ioPosOffset = FIRST_LOCKBYTE+id->locked;
- params.ioParam.ioReqCount = 1;
- PBUnlockRangeSync(&params);
- 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 5b60f8183..000000000
--- 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_unix.c b/ext/pdo_sqlite/sqlite/src/os_unix.c
index f4e09b536..5b58cb7aa 100644
--- a/ext/pdo_sqlite/sqlite/src/os_unix.c
+++ b/ext/pdo_sqlite/sqlite/src/os_unix.c
@@ -16,15 +16,101 @@
#include "os.h"
#if OS_UNIX /* This file is used on unix only */
+/*
+** These #defines should enable >2GB file support on Posix if the
+** underlying operating system supports it. If the OS lacks
+** large file support, 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.
+*/
+#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>
#include <time.h>
#include <sys/time.h>
#include <errno.h>
-#include <unistd.h>
+
+/*
+** If we are to be thread-safe, include the pthreads header and define
+** the SQLITE_UNIX_THREADS macro.
+*/
+#if defined(THREADSAFE) && THREADSAFE
+# include <pthread.h>
+# define SQLITE_UNIX_THREADS 1
+#endif
+
+/*
+** Default permissions when creating a new file
+*/
+#ifndef SQLITE_DEFAULT_FILE_PERMISSIONS
+# define SQLITE_DEFAULT_FILE_PERMISSIONS 0644
+#endif
+
+
+
+/*
+** The unixFile structure is subclass of OsFile specific for the unix
+** protability layer.
+*/
+typedef struct unixFile unixFile;
+struct unixFile {
+ IoMethod const *pMethod; /* Always the first entry */
+ 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 */
+ i64 offset; /* Seek offset */
+#ifdef SQLITE_UNIX_THREADS
+ pthread_t tid; /* The thread that "owns" this OsFile */
+#endif
+};
+
+/*
+** Provide the ability to override some OS-layer functions during
+** testing. This is used to simulate OS crashes to verify that
+** commits are atomic even in the event of an OS crash.
+*/
+#ifdef SQLITE_CRASH_TEST
+ extern int sqlite3CrashTestEnable;
+ extern int sqlite3CrashOpenReadWrite(const char*, OsFile**, int*);
+ extern int sqlite3CrashOpenExclusive(const char*, OsFile**, int);
+ extern int sqlite3CrashOpenReadOnly(const char*, OsFile**, int);
+# define CRASH_TEST_OVERRIDE(X,A,B,C) \
+ if(sqlite3CrashTestEnable){ return X(A,B,C); }
+#else
+# define CRASH_TEST_OVERRIDE(X,A,B,C) /* no-op */
+#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
+** SQLITE_OMIT_DISKIO macro is defined (indicating that the database
** will be in-memory only)
*/
#ifndef SQLITE_OMIT_DISKIO
@@ -51,18 +137,13 @@
** 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?
+** DJGPP. But it's 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.
*/
@@ -80,10 +161,18 @@
** 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.
+**
+** Version 3.3.1 (2006-01-15): OsFiles can be moved from one thread to
+** another as long as we are running on a system that supports threads
+** overriding each others locks (which now the most common behavior)
+** or if no locks are held. But the OsFile.pLock field needs to be
+** recomputed because its key includes the thread-id. See the
+** transferOwnership() function below for additional information
*/
-#ifdef SQLITE_UNIX_THREADS
-# define SET_THREADID(X) X->tid = pthread_self()
-# define CHECK_THREADID(X) (!pthread_equal(X->tid, pthread_self()))
+#if defined(SQLITE_UNIX_THREADS)
+# define SET_THREADID(X) (X)->tid = pthread_self()
+# define CHECK_THREADID(X) (threadsOverrideEachOthersLocks==0 && \
+ !pthread_equal((X)->tid, pthread_self()))
#else
# define SET_THREADID(X)
# define CHECK_THREADID(X) 0
@@ -195,14 +284,14 @@
**
** 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.
+** each others locks then tid is always set to zero. tid is omitted
+** 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 */
+ pthread_t tid; /* Thread ID or zero if threads can override each other */
#endif
};
@@ -248,12 +337,14 @@ struct openCnt {
};
/*
-** These hash table maps inodes and process IDs into lockInfo and openCnt
-** structures. Access to these hash tables must be protected by a mutex.
+** These hash tables map inodes and file descriptors (really, lockKey and
+** openKey structures) 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 };
-
+static Hash lockHash = {SQLITE_HASH_BINARY, 0, 0, 0,
+ sqlite3ThreadSafeMalloc, sqlite3ThreadSafeFree, 0, 0};
+static Hash openHash = {SQLITE_HASH_BINARY, 0, 0, 0,
+ sqlite3ThreadSafeMalloc, sqlite3ThreadSafeFree, 0, 0};
#ifdef SQLITE_UNIX_THREADS
/*
@@ -263,8 +354,25 @@ static Hash openHash = { SQLITE_HASH_BINARY, 0, 0, 0, 0, 0 };
** 0: No. Threads cannot override each others locks.
** 1: Yes. Threads can override each others locks.
** -1: We don't know yet.
+**
+** On some systems, we know at compile-time if threads can override each
+** others locks. On those systems, the SQLITE_THREAD_OVERRIDE_LOCK macro
+** will be set appropriately. On other systems, we have to check at
+** runtime. On these latter systems, SQLTIE_THREAD_OVERRIDE_LOCK is
+** undefined.
+**
+** This variable normally has file scope only. But during testing, we make
+** it a global so that the test code can change its value in order to verify
+** that the right stuff happens in either case.
*/
-static int threadsOverrideEachOthersLocks = -1;
+#ifndef SQLITE_THREAD_OVERRIDE_LOCK
+# define SQLITE_THREAD_OVERRIDE_LOCK -1
+#endif
+#ifdef SQLITE_TEST
+int threadsOverrideEachOthersLocks = SQLITE_THREAD_OVERRIDE_LOCK;
+#else
+static int threadsOverrideEachOthersLocks = SQLITE_THREAD_OVERRIDE_LOCK;
+#endif
/*
** This structure holds information passed into individual test
@@ -283,7 +391,7 @@ struct threadTestData {
** 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.
+** turned off.
*/
static int lockTrace(int fd, int op, struct flock *p){
char *zOpName, *zType;
@@ -353,7 +461,7 @@ static void *threadLockingTest(void *pArg){
** can override each others locks then sets the
** threadsOverrideEachOthersLocks variable appropriately.
*/
-static void testThreadLockingBehavior(fd_orig){
+static void testThreadLockingBehavior(int fd_orig){
int fd;
struct threadTestData d[2];
pthread_t t[2];
@@ -381,10 +489,11 @@ static void testThreadLockingBehavior(fd_orig){
** Release a lockInfo structure previously allocated by findLockInfo().
*/
static void releaseLockInfo(struct lockInfo *pLock){
+ assert( sqlite3OsInMutex(1) );
pLock->nRef--;
if( pLock->nRef==0 ){
sqlite3HashInsert(&lockHash, &pLock->key, sizeof(pLock->key), 0);
- sqliteFree(pLock);
+ sqlite3ThreadSafeFree(pLock);
}
}
@@ -392,18 +501,19 @@ static void releaseLockInfo(struct lockInfo *pLock){
** Release a openCnt structure previously allocated by findLockInfo().
*/
static void releaseOpenCnt(struct openCnt *pOpen){
+ assert( sqlite3OsInMutex(1) );
pOpen->nRef--;
if( pOpen->nRef==0 ){
sqlite3HashInsert(&openHash, &pOpen->key, sizeof(pOpen->key), 0);
- sqliteFree(pOpen->aPending);
- sqliteFree(pOpen);
+ free(pOpen->aPending);
+ sqlite3ThreadSafeFree(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.
+** describes that file descriptor. Create new ones if necessary. The
+** return values might be uninitialized if an error occurs.
**
** Return the number of errors.
*/
@@ -420,6 +530,8 @@ static int findLockInfo(
struct openCnt *pOpen;
rc = fstat(fd, &statbuf);
if( rc!=0 ) return 1;
+
+ assert( sqlite3OsInMutex(1) );
memset(&key1, 0, sizeof(key1));
key1.dev = statbuf.st_dev;
key1.ino = statbuf.st_ino;
@@ -435,8 +547,11 @@ static int findLockInfo(
pLock = (struct lockInfo*)sqlite3HashFind(&lockHash, &key1, sizeof(key1));
if( pLock==0 ){
struct lockInfo *pOld;
- pLock = sqliteMallocRaw( sizeof(*pLock) );
- if( pLock==0 ) return 1;
+ pLock = sqlite3ThreadSafeMalloc( sizeof(*pLock) );
+ if( pLock==0 ){
+ rc = 1;
+ goto exit_findlockinfo;
+ }
pLock->key = key1;
pLock->nRef = 1;
pLock->cnt = 0;
@@ -444,44 +559,114 @@ static int findLockInfo(
pOld = sqlite3HashInsert(&lockHash, &pLock->key, sizeof(key1), pLock);
if( pOld!=0 ){
assert( pOld==pLock );
- sqliteFree(pLock);
- return 1;
+ sqlite3ThreadSafeFree(pLock);
+ rc = 1;
+ goto exit_findlockinfo;
}
}else{
pLock->nRef++;
}
*ppLock = pLock;
- pOpen = (struct openCnt*)sqlite3HashFind(&openHash, &key2, sizeof(key2));
- if( pOpen==0 ){
- struct openCnt *pOld;
- pOpen = sqliteMallocRaw( sizeof(*pOpen) );
+ if( ppOpen!=0 ){
+ pOpen = (struct openCnt*)sqlite3HashFind(&openHash, &key2, sizeof(key2));
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;
+ struct openCnt *pOld;
+ pOpen = sqlite3ThreadSafeMalloc( sizeof(*pOpen) );
+ if( pOpen==0 ){
+ releaseLockInfo(pLock);
+ rc = 1;
+ goto exit_findlockinfo;
+ }
+ 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 );
+ sqlite3ThreadSafeFree(pOpen);
+ releaseLockInfo(pLock);
+ rc = 1;
+ goto exit_findlockinfo;
+ }
+ }else{
+ pOpen->nRef++;
}
- }else{
- pOpen->nRef++;
+ *ppOpen = pOpen;
}
- *ppOpen = pOpen;
- return 0;
+
+exit_findlockinfo:
+ return rc;
+}
+
+#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
+
+/*
+** If we are currently in a different thread than the thread that the
+** unixFile argument belongs to, then transfer ownership of the unixFile
+** over to the current thread.
+**
+** A unixFile is only owned by a thread on systems where one thread is
+** unable to override locks created by a different thread. RedHat9 is
+** an example of such a system.
+**
+** Ownership transfer is only allowed if the unixFile is currently unlocked.
+** If the unixFile is locked and an ownership is wrong, then return
+** SQLITE_MISUSE. SQLITE_OK is returned if everything works.
+*/
+#ifdef SQLITE_UNIX_THREADS
+static int transferOwnership(unixFile *pFile){
+ int rc;
+ pthread_t hSelf;
+ if( threadsOverrideEachOthersLocks ){
+ /* Ownership transfers not needed on this system */
+ return SQLITE_OK;
+ }
+ hSelf = pthread_self();
+ if( pthread_equal(pFile->tid, hSelf) ){
+ /* We are still in the same thread */
+ TRACE1("No-transfer, same thread\n");
+ return SQLITE_OK;
+ }
+ if( pFile->locktype!=NO_LOCK ){
+ /* We cannot change ownership while we are holding a lock! */
+ return SQLITE_MISUSE;
+ }
+ TRACE4("Transfer ownership of %d from %d to %d\n", pFile->h,pFile->tid,hSelf);
+ pFile->tid = hSelf;
+ releaseLockInfo(pFile->pLock);
+ rc = findLockInfo(pFile->h, &pFile->pLock, 0);
+ TRACE5("LOCK %d is now %s(%s,%d)\n", pFile->h,
+ locktypeName(pFile->locktype),
+ locktypeName(pFile->pLock->locktype), pFile->pLock->cnt);
+ return rc;
+}
+#else
+ /* On single-threaded builds, ownership transfer is a no-op */
+# define transferOwnership(X) SQLITE_OK
+#endif
/*
** Delete the named file
*/
-int sqlite3OsDelete(const char *zFilename){
+int sqlite3UnixDelete(const char *zFilename){
unlink(zFilename);
return SQLITE_OK;
}
@@ -489,10 +674,13 @@ int sqlite3OsDelete(const char *zFilename){
/*
** Return TRUE if the named file exists.
*/
-int sqlite3OsFileExists(const char *zFilename){
+int sqlite3UnixFileExists(const char *zFilename){
return access(zFilename, 0)==0;
}
+/* Forward declaration */
+static int allocateUnixFile(unixFile *pInit, OsFile **pId);
+
/*
** Attempt to open a file for both reading and writing. If that
** fails, try opening it read-only. If the file does not exist,
@@ -506,25 +694,26 @@ int sqlite3OsFileExists(const char *zFilename){
** On failure, the function returns SQLITE_CANTOPEN and leaves
** *id and *pReadonly unchanged.
*/
-int sqlite3OsOpenReadWrite(
+int sqlite3UnixOpenReadWrite(
const char *zFilename,
- OsFile *id,
+ OsFile **pId,
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,
+ unixFile f;
+
+ CRASH_TEST_OVERRIDE(sqlite3CrashOpenReadWrite, zFilename, pId, pReadonly);
+ assert( 0==*pId );
+ f.h = open(zFilename, O_RDWR|O_CREAT|O_LARGEFILE|O_BINARY,
SQLITE_DEFAULT_FILE_PERMISSIONS);
- if( id->h<0 ){
+ if( f.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 ){
+ f.h = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY);
+ if( f.h<0 ){
return SQLITE_CANTOPEN;
}
*pReadonly = 1;
@@ -532,17 +721,14 @@ int sqlite3OsOpenReadWrite(
*pReadonly = 0;
}
sqlite3OsEnterMutex();
- rc = findLockInfo(id->h, &id->pLock, &id->pOpen);
+ rc = findLockInfo(f.h, &f.pLock, &f.pOpen);
sqlite3OsLeaveMutex();
if( rc ){
- close(id->h);
+ close(f.h);
return SQLITE_NOMEM;
}
- id->locktype = 0;
- id->isOpen = 1;
- TRACE3("OPEN %-3d %s\n", id->h, zFilename);
- OpenCounter(+1);
- return SQLITE_OK;
+ TRACE3("OPEN %-3d %s\n", f.h, zFilename);
+ return allocateUnixFile(&f, pId);
}
@@ -560,36 +746,31 @@ int sqlite3OsOpenReadWrite(
**
** On failure, return SQLITE_CANTOPEN.
*/
-int sqlite3OsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){
+int sqlite3UnixOpenExclusive(const char *zFilename, OsFile **pId, 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,
+ unixFile f;
+
+ CRASH_TEST_OVERRIDE(sqlite3CrashOpenExclusive, zFilename, pId, delFlag);
+ assert( 0==*pId );
+ f.h = open(zFilename,
O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_LARGEFILE|O_BINARY,
SQLITE_DEFAULT_FILE_PERMISSIONS);
- if( id->h<0 ){
+ if( f.h<0 ){
return SQLITE_CANTOPEN;
}
sqlite3OsEnterMutex();
- rc = findLockInfo(id->h, &id->pLock, &id->pOpen);
+ rc = findLockInfo(f.h, &f.pLock, &f.pOpen);
sqlite3OsLeaveMutex();
if( rc ){
- close(id->h);
+ close(f.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;
+ TRACE3("OPEN-EX %-3d %s\n", f.h, zFilename);
+ return allocateUnixFile(&f, pId);
}
/*
@@ -599,27 +780,25 @@ int sqlite3OsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){
**
** On failure, return SQLITE_CANTOPEN.
*/
-int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){
+int sqlite3UnixOpenReadOnly(const char *zFilename, OsFile **pId){
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 ){
+ unixFile f;
+
+ CRASH_TEST_OVERRIDE(sqlite3CrashOpenReadOnly, zFilename, pId, 0);
+ assert( 0==*pId );
+ f.h = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY);
+ if( f.h<0 ){
return SQLITE_CANTOPEN;
}
sqlite3OsEnterMutex();
- rc = findLockInfo(id->h, &id->pLock, &id->pOpen);
+ rc = findLockInfo(f.h, &f.pLock, &f.pOpen);
sqlite3OsLeaveMutex();
if( rc ){
- close(id->h);
+ close(f.h);
return SQLITE_NOMEM;
}
- id->locktype = 0;
- id->isOpen = 1;
- TRACE3("OPEN-RO %-3d %s\n", id->h, zFilename);
- OpenCounter(+1);
- return SQLITE_OK;
+ TRACE3("OPEN-RO %-3d %s\n", f.h, zFilename);
+ return allocateUnixFile(&f, pId);
}
/*
@@ -631,29 +810,30 @@ int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){
** 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
+** On success, a handle for a previously open file 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
+static int unixOpenDirectory(
+ OsFile *id,
+ const char *zDirname
){
- if( !id->isOpen ){
+ unixFile *pFile = (unixFile*)id;
+ if( pFile==0 ){
/* 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 ){
+ SET_THREADID(pFile);
+ assert( pFile->dirfd<0 );
+ pFile->dirfd = open(zDirname, O_RDONLY|O_BINARY, 0);
+ if( pFile->dirfd<0 ){
return SQLITE_CANTOPEN;
}
- TRACE3("OPENDIR %-3d %s\n", id->dirfd, zDirname);
+ TRACE3("OPENDIR %-3d %s\n", pFile->dirfd, zDirname);
return SQLITE_OK;
}
@@ -661,6 +841,8 @@ int sqlite3OsOpenDirectory(
** 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.
+**
+** See also the "PRAGMA temp_store_directory" SQL command.
*/
char *sqlite3_temp_directory = 0;
@@ -668,7 +850,7 @@ 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){
+int sqlite3UnixTempFileName(char *zBuf){
static const char *azDirs[] = {
0,
"/var/tmp",
@@ -704,35 +886,54 @@ int sqlite3OsTempFileName(char *zBuf){
return SQLITE_OK;
}
-#ifndef SQLITE_OMIT_PAGER_PRAGMAS
/*
** Check that a given pathname is a directory and is writable
**
*/
-int sqlite3OsIsDirWritable(char *zBuf){
+int sqlite3UnixIsDirWritable(char *zBuf){
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
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;
+#endif /* SQLITE_OMIT_PAGER_PRAGMAS */
return 1;
}
-#endif /* SQLITE_OMIT_PAGER_PRAGMAS */
+
+/*
+** Seek to the offset in id->offset then read cnt bytes into pBuf.
+** Return the number of bytes actually read. Update the offset.
+*/
+static int seekAndRead(unixFile *id, void *pBuf, int cnt){
+ int got;
+#ifdef USE_PREAD
+ got = pread(id->h, pBuf, cnt, id->offset);
+#else
+ lseek(id->h, id->offset, SEEK_SET);
+ got = read(id->h, pBuf, cnt);
+#endif
+ if( got>0 ){
+ id->offset += got;
+ }
+ return got;
+}
/*
** 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){
+static int unixRead(OsFile *id, void *pBuf, int amt){
int got;
- assert( id->isOpen );
+ assert( id );
SimulateIOError(SQLITE_IOERR);
TIMER_START;
- got = read(id->h, pBuf, amt);
+ got = seekAndRead((unixFile*)id, pBuf, amt);
TIMER_END;
- TRACE5("READ %-3d %5d %7d %d\n", id->h, got, last_page, TIMER_ELAPSED);
+ TRACE5("READ %-3d %5d %7d %d\n", ((unixFile*)id)->h, got,
+ last_page, TIMER_ELAPSED);
SEEK(0);
/* if( got<0 ) got = 0; */
if( got==amt ){
@@ -743,22 +944,42 @@ int sqlite3OsRead(OsFile *id, void *pBuf, int amt){
}
/*
+** Seek to the offset in id->offset then read cnt bytes into pBuf.
+** Return the number of bytes actually read. Update the offset.
+*/
+static int seekAndWrite(unixFile *id, const void *pBuf, int cnt){
+ int got;
+#ifdef USE_PREAD
+ got = pwrite(id->h, pBuf, cnt, id->offset);
+#else
+ lseek(id->h, id->offset, SEEK_SET);
+ got = write(id->h, pBuf, cnt);
+#endif
+ if( got>0 ){
+ id->offset += got;
+ }
+ return got;
+}
+
+
+/*
** 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){
+static int unixWrite(OsFile *id, const void *pBuf, int amt){
int wrote = 0;
- assert( id->isOpen );
+ assert( id );
assert( amt>0 );
SimulateIOError(SQLITE_IOERR);
SimulateDiskfullError;
TIMER_START;
- while( amt>0 && (wrote = write(id->h, pBuf, amt))>0 ){
+ while( amt>0 && (wrote = seekAndWrite((unixFile*)id, 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);
+ TRACE5("WRITE %-3d %5d %7d %d\n", ((unixFile*)id)->h, wrote,
+ last_page, TIMER_ELAPSED);
SEEK(0);
if( amt>0 ){
return SQLITE_FULL;
@@ -769,13 +990,13 @@ int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){
/*
** Move the read/write pointer in a file.
*/
-int sqlite3OsSeek(OsFile *id, i64 offset){
- assert( id->isOpen );
+static int unixSeek(OsFile *id, i64 offset){
+ assert( id );
SEEK(offset/1024 + 1);
#ifdef SQLITE_TEST
if( offset ) SimulateDiskfullError
#endif
- lseek(id->h, offset, SEEK_SET);
+ ((unixFile*)id)->offset = offset;
return SQLITE_OK;
}
@@ -788,6 +1009,25 @@ int sqlite3_sync_count = 0;
int sqlite3_fullsync_count = 0;
#endif
+/*
+** Use the fdatasync() API only if the HAVE_FDATASYNC macro is defined.
+** Otherwise use fsync() in its place.
+*/
+#ifndef HAVE_FDATASYNC
+# define fdatasync fsync
+#endif
+
+/*
+** Define HAVE_FULLFSYNC to 0 or 1 depending on whether or not
+** the F_FULLFSYNC macro is defined. F_FULLFSYNC is currently
+** only available on Mac OS X. But that could change.
+*/
+#ifdef F_FULLFSYNC
+# define HAVE_FULLFSYNC 1
+#else
+# define HAVE_FULLFSYNC 0
+#endif
+
/*
** The fsync() system call does not work as advertised on many
@@ -819,7 +1059,7 @@ static int full_fsync(int fd, int fullSync, int dataOnly){
rc = SQLITE_OK;
#else
-#ifdef F_FULLFSYNC
+#if HAVE_FULLFSYNC
if( fullSync ){
rc = fcntl(fd, F_FULLFSYNC, 0);
}else{
@@ -829,12 +1069,9 @@ static int full_fsync(int fd, int fullSync, int dataOnly){
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 */
- {
+ }else{
rc = fsync(fd);
}
#endif /* defined(F_FULLFSYNC) */
@@ -858,18 +1095,34 @@ static int full_fsync(int fd, int fullSync, int dataOnly){
** 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 );
+static int unixSync(OsFile *id, int dataOnly){
+ unixFile *pFile = (unixFile*)id;
+ assert( pFile );
SimulateIOError(SQLITE_IOERR);
- TRACE2("SYNC %-3d\n", id->h);
- if( full_fsync(id->h, id->fullSync, dataOnly) ){
+ TRACE2("SYNC %-3d\n", pFile->h);
+ if( full_fsync(pFile->h, pFile->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. */
+ if( pFile->dirfd>=0 ){
+ TRACE4("DIRSYNC %-3d (have_fullfsync=%d fullsync=%d)\n", pFile->dirfd,
+ HAVE_FULLFSYNC, pFile->fullSync);
+#ifndef SQLITE_DISABLE_DIRSYNC
+ /* The directory sync is only attempted if full_fsync is
+ ** turned off or unavailable. If a full_fsync occurred above,
+ ** then the directory sync is superfluous.
+ */
+ if( (!HAVE_FULLFSYNC || !pFile->fullSync) && full_fsync(pFile->dirfd,0,0) ){
+ /*
+ ** We have received multiple reports of fsync() returning
+ ** errors when applied to directories on certain file systems.
+ ** A failed directory sync is not a big deal. So it seems
+ ** better to ignore the error. Ticket #1657
+ */
+ /* return SQLITE_IOERR; */
+ }
+#endif
+ close(pFile->dirfd); /* Only need to sync once, so close the directory */
+ pFile->dirfd = -1; /* when we are done. */
}
return SQLITE_OK;
}
@@ -882,7 +1135,10 @@ int sqlite3OsSync(OsFile *id, int dataOnly){
** 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 sqlite3UnixSyncDirectory(const char *zDirname){
+#ifdef SQLITE_DISABLE_DIRSYNC
+ return SQLITE_OK;
+#else
int fd;
int r;
SimulateIOError(SQLITE_IOERR);
@@ -894,25 +1150,26 @@ int sqlite3OsSyncDirectory(const char *zDirname){
r = fsync(fd);
close(fd);
return ((r==0)?SQLITE_OK:SQLITE_IOERR);
+#endif
}
/*
** Truncate an open file to a specified size
*/
-int sqlite3OsTruncate(OsFile *id, i64 nByte){
- assert( id->isOpen );
+static int unixTruncate(OsFile *id, i64 nByte){
+ assert( id );
SimulateIOError(SQLITE_IOERR);
- return ftruncate(id->h, nByte)==0 ? SQLITE_OK : SQLITE_IOERR;
+ return ftruncate(((unixFile*)id)->h, nByte)==0 ? SQLITE_OK : SQLITE_IOERR;
}
/*
** Determine the current size of a file in bytes
*/
-int sqlite3OsFileSize(OsFile *id, i64 *pSize){
+static int unixFileSize(OsFile *id, i64 *pSize){
struct stat buf;
- assert( id->isOpen );
+ assert( id );
SimulateIOError(SQLITE_IOERR);
- if( fstat(id->h, &buf)!=0 ){
+ if( fstat(((unixFile*)id)->h, &buf)!=0 ){
return SQLITE_IOERR;
}
*pSize = buf.st_size;
@@ -925,15 +1182,15 @@ int sqlite3OsFileSize(OsFile *id, i64 *pSize){
** non-zero. If the file is unlocked or holds only SHARED locks, then
** return zero.
*/
-int sqlite3OsCheckReservedLock(OsFile *id){
+static int unixCheckReservedLock(OsFile *id){
int r = 0;
+ unixFile *pFile = (unixFile*)id;
- assert( id->isOpen );
- if( CHECK_THREADID(id) ) return SQLITE_MISUSE;
- sqlite3OsEnterMutex(); /* Needed because id->pLock is shared across threads */
+ assert( pFile );
+ sqlite3OsEnterMutex(); /* Because pFile->pLock is shared across threads */
/* Check if a thread in this process holds such a lock */
- if( id->pLock->locktype>SHARED_LOCK ){
+ if( pFile->pLock->locktype>SHARED_LOCK ){
r = 1;
}
@@ -945,36 +1202,18 @@ int sqlite3OsCheckReservedLock(OsFile *id){
lock.l_start = RESERVED_BYTE;
lock.l_len = 1;
lock.l_type = F_WRLCK;
- fcntl(id->h, F_GETLK, &lock);
+ fcntl(pFile->h, F_GETLK, &lock);
if( lock.l_type!=F_UNLCK ){
r = 1;
}
}
sqlite3OsLeaveMutex();
- TRACE3("TEST WR-LOCK %d %d\n", id->h, r);
+ TRACE3("TEST WR-LOCK %d %d\n", pFile->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:
@@ -999,7 +1238,7 @@ static const char * locktypeName(int locktype){
** This routine will only increase a lock. Use the sqlite3OsUnlock()
** routine to lower a locking level.
*/
-int sqlite3OsLock(OsFile *id, int locktype){
+static int unixLock(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
@@ -1039,39 +1278,49 @@ int sqlite3OsLock(OsFile *id, int locktype){
** even if the locking primitive used is always a write-lock.
*/
int rc = SQLITE_OK;
- struct lockInfo *pLock = id->pLock;
+ unixFile *pFile = (unixFile*)id;
+ struct lockInfo *pLock = pFile->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;
+ assert( pFile );
+ TRACE7("LOCK %d %s was %s(%s,%d) pid=%d\n", pFile->h,
+ locktypeName(locktype), locktypeName(pFile->locktype),
+ locktypeName(pLock->locktype), pLock->cnt , getpid());
/* 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));
+ if( pFile->locktype>=locktype ){
+ TRACE3("LOCK %d %s ok (already held)\n", pFile->h,
+ locktypeName(locktype));
return SQLITE_OK;
}
/* Make sure the locking sequence is correct
*/
- assert( id->locktype!=NO_LOCK || locktype==SHARED_LOCK );
+ assert( pFile->locktype!=NO_LOCK || locktype==SHARED_LOCK );
assert( locktype!=PENDING_LOCK );
- assert( locktype!=RESERVED_LOCK || id->locktype==SHARED_LOCK );
+ assert( locktype!=RESERVED_LOCK || pFile->locktype==SHARED_LOCK );
- /* This mutex is needed because id->pLock is shared across threads
+ /* This mutex is needed because pFile->pLock is shared across threads
*/
sqlite3OsEnterMutex();
+ /* Make sure the current thread owns the pFile.
+ */
+ rc = transferOwnership(pFile);
+ if( rc!=SQLITE_OK ){
+ sqlite3OsLeaveMutex();
+ return rc;
+ }
+ pLock = pFile->pLock;
+
/* 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 &&
+ if( (pFile->locktype!=pLock->locktype &&
(pLock->locktype>=PENDING_LOCK || locktype>SHARED_LOCK))
){
rc = SQLITE_BUSY;
@@ -1085,11 +1334,11 @@ int sqlite3OsLock(OsFile *id, int locktype){
if( locktype==SHARED_LOCK &&
(pLock->locktype==SHARED_LOCK || pLock->locktype==RESERVED_LOCK) ){
assert( locktype==SHARED_LOCK );
- assert( id->locktype==0 );
+ assert( pFile->locktype==0 );
assert( pLock->cnt>0 );
- id->locktype = SHARED_LOCK;
+ pFile->locktype = SHARED_LOCK;
pLock->cnt++;
- id->pOpen->nLock++;
+ pFile->pOpen->nLock++;
goto end_lock;
}
@@ -1102,11 +1351,11 @@ int sqlite3OsLock(OsFile *id, int locktype){
** be released.
*/
if( locktype==SHARED_LOCK
- || (locktype==EXCLUSIVE_LOCK && id->locktype<PENDING_LOCK)
+ || (locktype==EXCLUSIVE_LOCK && pFile->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);
+ s = fcntl(pFile->h, F_SETLK, &lock);
if( s ){
rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY;
goto end_lock;
@@ -1124,21 +1373,21 @@ int sqlite3OsLock(OsFile *id, int locktype){
/* Now get the read-lock */
lock.l_start = SHARED_FIRST;
lock.l_len = SHARED_SIZE;
- s = fcntl(id->h, F_SETLK, &lock);
+ s = fcntl(pFile->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 ){
+ if( fcntl(pFile->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++;
+ pFile->locktype = SHARED_LOCK;
+ pFile->pOpen->nLock++;
pLock->cnt = 1;
}
}else if( locktype==EXCLUSIVE_LOCK && pLock->cnt>1 ){
@@ -1150,7 +1399,7 @@ int sqlite3OsLock(OsFile *id, int locktype){
** assumed that there is a SHARED or greater lock on the file
** already.
*/
- assert( 0!=id->locktype );
+ assert( 0!=pFile->locktype );
lock.l_type = F_WRLCK;
switch( locktype ){
case RESERVED_LOCK:
@@ -1163,63 +1412,62 @@ int sqlite3OsLock(OsFile *id, int locktype){
default:
assert(0);
}
- s = fcntl(id->h, F_SETLK, &lock);
+ s = fcntl(pFile->h, F_SETLK, &lock);
if( s ){
rc = (errno==EINVAL) ? SQLITE_NOLFS : SQLITE_BUSY;
}
}
if( rc==SQLITE_OK ){
- id->locktype = locktype;
+ pFile->locktype = locktype;
pLock->locktype = locktype;
}else if( locktype==EXCLUSIVE_LOCK ){
- id->locktype = PENDING_LOCK;
+ pFile->locktype = PENDING_LOCK;
pLock->locktype = PENDING_LOCK;
}
end_lock:
sqlite3OsLeaveMutex();
- TRACE4("LOCK %d %s %s\n", id->h, locktypeName(locktype),
+ TRACE4("LOCK %d %s %s\n", pFile->h, locktypeName(locktype),
rc==SQLITE_OK ? "ok" : "failed");
return rc;
}
/*
-** Lower the locking level on file descriptor id to locktype. locktype
+** Lower the locking level on file descriptor pFile 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){
+static int unixUnlock(OsFile *id, int locktype){
struct lockInfo *pLock;
struct flock lock;
int rc = SQLITE_OK;
+ unixFile *pFile = (unixFile*)id;
- 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( pFile );
+ TRACE7("UNLOCK %d %d was %d(%d,%d) pid=%d\n", pFile->h, locktype,
+ pFile->locktype, pFile->pLock->locktype, pFile->pLock->cnt, getpid());
assert( locktype<=SHARED_LOCK );
- if( id->locktype<=locktype ){
+ if( pFile->locktype<=locktype ){
return SQLITE_OK;
}
+ if( CHECK_THREADID(pFile) ){
+ return SQLITE_MISUSE;
+ }
sqlite3OsEnterMutex();
- pLock = id->pLock;
+ pLock = pFile->pLock;
assert( pLock->cnt!=0 );
- if( id->locktype>SHARED_LOCK ){
- assert( pLock->locktype==id->locktype );
+ if( pFile->locktype>SHARED_LOCK ){
+ assert( pLock->locktype==pFile->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 ){
+ if( fcntl(pFile->h, F_SETLK, &lock)!=0 ){
/* This should never happen */
rc = SQLITE_IOERR;
}
@@ -1228,7 +1476,7 @@ int sqlite3OsUnlock(OsFile *id, int locktype){
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 ){
+ if( fcntl(pFile->h, F_SETLK, &lock)==0 ){
pLock->locktype = SHARED_LOCK;
}else{
rc = SQLITE_IOERR; /* This should never happen */
@@ -1246,7 +1494,7 @@ int sqlite3OsUnlock(OsFile *id, int locktype){
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 ){
+ if( fcntl(pFile->h, F_SETLK, &lock)==0 ){
pLock->locktype = NO_LOCK;
}else{
rc = SQLITE_IOERR; /* This should never happen */
@@ -1257,7 +1505,7 @@ int sqlite3OsUnlock(OsFile *id, int locktype){
** count reaches zero, close any other file descriptors whose close
** was deferred because of outstanding locks.
*/
- pOpen = id->pOpen;
+ pOpen = pFile->pOpen;
pOpen->nLock--;
assert( pOpen->nLock>=0 );
if( pOpen->nLock==0 && pOpen->nPending>0 ){
@@ -1265,26 +1513,28 @@ int sqlite3OsUnlock(OsFile *id, int locktype){
for(i=0; i<pOpen->nPending; i++){
close(pOpen->aPending[i]);
}
- sqliteFree(pOpen->aPending);
+ free(pOpen->aPending);
pOpen->nPending = 0;
pOpen->aPending = 0;
}
}
sqlite3OsLeaveMutex();
- id->locktype = locktype;
+ pFile->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);
+static int unixClose(OsFile **pId){
+ unixFile *id = (unixFile*)*pId;
+
+ if( !id ) return SQLITE_OK;
+ unixUnlock(*pId, 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
@@ -1293,7 +1543,7 @@ int sqlite3OsClose(OsFile *id){
*/
int *aNew;
struct openCnt *pOpen = id->pOpen;
- aNew = sqliteRealloc( pOpen->aPending, (pOpen->nPending+1)*sizeof(int) );
+ aNew = realloc( pOpen->aPending, (pOpen->nPending+1)*sizeof(int) );
if( aNew==0 ){
/* If a malloc fails, just leak the file descriptor */
}else{
@@ -1307,10 +1557,13 @@ int sqlite3OsClose(OsFile *id){
}
releaseLockInfo(id->pLock);
releaseOpenCnt(id->pOpen);
+
sqlite3OsLeaveMutex();
id->isOpen = 0;
TRACE2("CLOSE %-3d\n", id->h);
OpenCounter(-1);
+ sqlite3ThreadSafeFree(id);
+ *pId = 0;
return SQLITE_OK;
}
@@ -1320,7 +1573,7 @@ int sqlite3OsClose(OsFile *id){
** The calling function is responsible for freeing this space once it
** is no longer needed.
*/
-char *sqlite3OsFullPathname(const char *zRelative){
+char *sqlite3UnixFullPathname(const char *zRelative){
char *zFull = 0;
if( zRelative[0]=='/' ){
sqlite3SetString(&zFull, zRelative, (char*)0);
@@ -1334,9 +1587,109 @@ char *sqlite3OsFullPathname(const char *zRelative){
(char*)0);
sqliteFree(zBuf);
}
+
+#if 0
+ /*
+ ** Remove "/./" path elements and convert "/A/./" path elements
+ ** to just "/".
+ */
+ if( zFull ){
+ int i, j;
+ for(i=j=0; zFull[i]; i++){
+ if( zFull[i]=='/' ){
+ if( zFull[i+1]=='/' ) continue;
+ if( zFull[i+1]=='.' && zFull[i+2]=='/' ){
+ i += 1;
+ continue;
+ }
+ if( zFull[i+1]=='.' && zFull[i+2]=='.' && zFull[i+3]=='/' ){
+ while( j>0 && zFull[j-1]!='/' ){ j--; }
+ i += 3;
+ continue;
+ }
+ }
+ zFull[j++] = zFull[i];
+ }
+ zFull[j] = 0;
+ }
+#endif
+
return zFull;
}
+/*
+** Change the value of the fullsync flag in the given file descriptor.
+*/
+static void unixSetFullSync(OsFile *id, int v){
+ ((unixFile*)id)->fullSync = v;
+}
+
+/*
+** Return the underlying file handle for an OsFile
+*/
+static int unixFileHandle(OsFile *id){
+ return ((unixFile*)id)->h;
+}
+
+/*
+** Return an integer that indices the type of lock currently held
+** by this handle. (Used for testing and analysis only.)
+*/
+static int unixLockState(OsFile *id){
+ return ((unixFile*)id)->locktype;
+}
+
+/*
+** This vector defines all the methods that can operate on an OsFile
+** for unix.
+*/
+static const IoMethod sqlite3UnixIoMethod = {
+ unixClose,
+ unixOpenDirectory,
+ unixRead,
+ unixWrite,
+ unixSeek,
+ unixTruncate,
+ unixSync,
+ unixSetFullSync,
+ unixFileHandle,
+ unixFileSize,
+ unixLock,
+ unixUnlock,
+ unixLockState,
+ unixCheckReservedLock,
+};
+
+/*
+** Allocate memory for a unixFile. Initialize the new unixFile
+** to the value given in pInit and return a pointer to the new
+** OsFile. If we run out of memory, close the file and return NULL.
+*/
+static int allocateUnixFile(unixFile *pInit, OsFile **pId){
+ unixFile *pNew;
+ pInit->dirfd = -1;
+ pInit->fullSync = 0;
+ pInit->locktype = 0;
+ pInit->offset = 0;
+ SET_THREADID(pInit);
+ pNew = sqlite3ThreadSafeMalloc( sizeof(unixFile) );
+ if( pNew==0 ){
+ close(pInit->h);
+ sqlite3OsEnterMutex();
+ releaseLockInfo(pInit->pLock);
+ releaseOpenCnt(pInit->pOpen);
+ sqlite3OsLeaveMutex();
+ *pId = 0;
+ return SQLITE_NOMEM;
+ }else{
+ *pNew = *pInit;
+ pNew->pMethod = &sqlite3UnixIoMethod;
+ *pId = (OsFile*)pNew;
+ OpenCounter(+1);
+ return SQLITE_OK;
+ }
+}
+
#endif /* SQLITE_OMIT_DISKIO */
/***************************************************************************
@@ -1350,7 +1703,7 @@ char *sqlite3OsFullPathname(const char *zRelative){
** is written into the buffer zBuf[256]. The calling function must
** supply a sufficiently large buffer.
*/
-int sqlite3OsRandomSeed(char *zBuf){
+int sqlite3UnixRandomSeed(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
@@ -1360,7 +1713,7 @@ int sqlite3OsRandomSeed(char *zBuf){
** 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
+ ** that we always use the same random number sequence. This makes the
** tests repeatable.
*/
memset(zBuf, 0, 256);
@@ -1369,7 +1722,9 @@ int sqlite3OsRandomSeed(char *zBuf){
int pid, fd;
fd = open("/dev/urandom", O_RDONLY);
if( fd<0 ){
- time((time_t*)zBuf);
+ time_t t;
+ time(&t);
+ memcpy(zBuf, &t, sizeof(t));
pid = getpid();
memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid));
}else{
@@ -1383,8 +1738,9 @@ int sqlite3OsRandomSeed(char *zBuf){
/*
** Sleep for a little while. Return the amount of time slept.
+** The argument is the number of milliseconds we want to sleep.
*/
-int sqlite3OsSleep(int ms){
+int sqlite3UnixSleep(int ms){
#if defined(HAVE_USLEEP) && HAVE_USLEEP
usleep(ms*1000);
return ms;
@@ -1395,11 +1751,42 @@ int sqlite3OsSleep(int ms){
}
/*
-** Static variables used for thread synchronization
+** Static variables used for thread synchronization.
+**
+** inMutex the nesting depth of the recursive mutex. The thread
+** holding mutexMain can read this variable at any time.
+** But is must hold mutexAux to change this variable. Other
+** threads must hold mutexAux to read the variable and can
+** never write.
+**
+** mutexOwner The thread id of the thread holding mutexMain. Same
+** access rules as for inMutex.
+**
+** mutexOwnerValid True if the value in mutexOwner is valid. The same
+** access rules apply as for inMutex.
+**
+** mutexMain The main mutex. Hold this mutex in order to get exclusive
+** access to SQLite data structures.
+**
+** mutexAux An auxiliary mutex needed to access variables defined above.
+**
+** Mutexes are always acquired in this order: mutexMain mutexAux. It
+** is not necessary to acquire mutexMain in order to get mutexAux - just
+** do not attempt to acquire them in the reverse order: mutexAux mutexMain.
+** Either get the mutexes with mutexMain first or get mutexAux only.
+**
+** When running on a platform where the three variables inMutex, mutexOwner,
+** and mutexOwnerValid can be set atomically, the mutexAux is not required.
+** On many systems, all three are 32-bit integers and writing to a 32-bit
+** integer is atomic. I think. But there are no guarantees. So it seems
+** safer to protect them using mutexAux.
*/
static int inMutex = 0;
#ifdef SQLITE_UNIX_THREADS
-static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_t mutexOwner; /* Thread holding mutexMain */
+static int mutexOwnerValid = 0; /* True if mutexOwner is valid */
+static pthread_mutex_t mutexMain = PTHREAD_MUTEX_INITIALIZER; /* The mutex */
+static pthread_mutex_t mutexAux = PTHREAD_MUTEX_INITIALIZER; /* Aux mutex */
#endif
/*
@@ -1409,19 +1796,164 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
**
** SQLite uses only a single Mutex. There is not much critical
** code and what little there is executes quickly and without blocking.
+**
+** As of version 3.3.2, this mutex must be recursive.
*/
-void sqlite3OsEnterMutex(){
+void sqlite3UnixEnterMutex(){
+#ifdef SQLITE_UNIX_THREADS
+ pthread_mutex_lock(&mutexAux);
+ if( !mutexOwnerValid || !pthread_equal(mutexOwner, pthread_self()) ){
+ pthread_mutex_unlock(&mutexAux);
+ pthread_mutex_lock(&mutexMain);
+ assert( inMutex==0 );
+ assert( !mutexOwnerValid );
+ pthread_mutex_lock(&mutexAux);
+ mutexOwner = pthread_self();
+ mutexOwnerValid = 1;
+ }
+ inMutex++;
+ pthread_mutex_unlock(&mutexAux);
+#else
+ inMutex++;
+#endif
+}
+void sqlite3UnixLeaveMutex(){
+ assert( inMutex>0 );
#ifdef SQLITE_UNIX_THREADS
- pthread_mutex_lock(&mutex);
+ pthread_mutex_lock(&mutexAux);
+ inMutex--;
+ assert( pthread_equal(mutexOwner, pthread_self()) );
+ if( inMutex==0 ){
+ assert( mutexOwnerValid );
+ mutexOwnerValid = 0;
+ pthread_mutex_unlock(&mutexMain);
+ }
+ pthread_mutex_unlock(&mutexAux);
+#else
+ inMutex--;
#endif
- assert( !inMutex );
- inMutex = 1;
}
-void sqlite3OsLeaveMutex(){
- assert( inMutex );
- inMutex = 0;
+
+/*
+** Return TRUE if the mutex is currently held.
+**
+** If the thisThrd parameter is true, return true only if the
+** calling thread holds the mutex. If the parameter is false, return
+** true if any thread holds the mutex.
+*/
+int sqlite3UnixInMutex(int thisThrd){
#ifdef SQLITE_UNIX_THREADS
- pthread_mutex_unlock(&mutex);
+ int rc;
+ pthread_mutex_lock(&mutexAux);
+ rc = inMutex>0 && (thisThrd==0 || pthread_equal(mutexOwner,pthread_self()));
+ pthread_mutex_unlock(&mutexAux);
+ return rc;
+#else
+ return inMutex>0;
+#endif
+}
+
+/*
+** Remember the number of thread-specific-data blocks allocated.
+** Use this to verify that we are not leaking thread-specific-data.
+** Ticket #1601
+*/
+#ifdef SQLITE_TEST
+int sqlite3_tsd_count = 0;
+# ifdef SQLITE_UNIX_THREADS
+ static pthread_mutex_t tsd_counter_mutex = PTHREAD_MUTEX_INITIALIZER;
+# define TSD_COUNTER(N) \
+ pthread_mutex_lock(&tsd_counter_mutex); \
+ sqlite3_tsd_count += N; \
+ pthread_mutex_unlock(&tsd_counter_mutex);
+# else
+# define TSD_COUNTER(N) sqlite3_tsd_count += N
+# endif
+#else
+# define TSD_COUNTER(N) /* no-op */
+#endif
+
+/*
+** If called with allocateFlag>0, then return a pointer to thread
+** specific data for the current thread. Allocate and zero the
+** thread-specific data if it does not already exist.
+**
+** If called with allocateFlag==0, then check the current thread
+** specific data. Return it if it exists. If it does not exist,
+** then return NULL.
+**
+** If called with allocateFlag<0, check to see if the thread specific
+** data is allocated and is all zero. If it is then deallocate it.
+** Return a pointer to the thread specific data or NULL if it is
+** unallocated or gets deallocated.
+*/
+ThreadData *sqlite3UnixThreadSpecificData(int allocateFlag){
+ static const ThreadData zeroData = {0}; /* Initializer to silence warnings
+ ** from broken compilers */
+#ifdef SQLITE_UNIX_THREADS
+ static pthread_key_t key;
+ static int keyInit = 0;
+ ThreadData *pTsd;
+
+ if( !keyInit ){
+ sqlite3OsEnterMutex();
+ if( !keyInit ){
+ int rc;
+ rc = pthread_key_create(&key, 0);
+ if( rc ){
+ sqlite3OsLeaveMutex();
+ return 0;
+ }
+ keyInit = 1;
+ }
+ sqlite3OsLeaveMutex();
+ }
+
+ pTsd = pthread_getspecific(key);
+ if( allocateFlag>0 ){
+ if( pTsd==0 ){
+ if( !sqlite3TestMallocFail() ){
+ pTsd = sqlite3OsMalloc(sizeof(zeroData));
+ }
+#ifdef SQLITE_MEMDEBUG
+ sqlite3_isFail = 0;
+#endif
+ if( pTsd ){
+ *pTsd = zeroData;
+ pthread_setspecific(key, pTsd);
+ TSD_COUNTER(+1);
+ }
+ }
+ }else if( pTsd!=0 && allocateFlag<0
+ && memcmp(pTsd, &zeroData, sizeof(ThreadData))==0 ){
+ sqlite3OsFree(pTsd);
+ pthread_setspecific(key, 0);
+ TSD_COUNTER(-1);
+ pTsd = 0;
+ }
+ return pTsd;
+#else
+ static ThreadData *pTsd = 0;
+ if( allocateFlag>0 ){
+ if( pTsd==0 ){
+ if( !sqlite3TestMallocFail() ){
+ pTsd = sqlite3OsMalloc( sizeof(zeroData) );
+ }
+#ifdef SQLITE_MEMDEBUG
+ sqlite3_isFail = 0;
+#endif
+ if( pTsd ){
+ *pTsd = zeroData;
+ TSD_COUNTER(+1);
+ }
+ }
+ }else if( pTsd!=0 && allocateFlag<0
+ && memcmp(pTsd, &zeroData, sizeof(ThreadData))==0 ){
+ sqlite3OsFree(pTsd);
+ TSD_COUNTER(-1);
+ pTsd = 0;
+ }
+ return pTsd;
#endif
}
@@ -1438,7 +1970,7 @@ int sqlite3_current_time = 0;
** 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){
+int sqlite3UnixCurrentTime(double *prNow){
#ifdef NO_GETTOD
time_t t;
time(&t);
diff --git a/ext/pdo_sqlite/sqlite/src/os_win.c b/ext/pdo_sqlite/sqlite/src/os_win.c
index ad874ae63..6c167ab5b 100644
--- a/ext/pdo_sqlite/sqlite/src/os_win.c
+++ b/ext/pdo_sqlite/sqlite/src/os_win.c
@@ -35,6 +35,49 @@
#include "os_common.h"
/*
+** Determine if we are dealing with WindowsCE - which has a much
+** reduced API.
+*/
+#if defined(_WIN32_WCE)
+# define OS_WINCE 1
+#else
+# define OS_WINCE 0
+#endif
+
+/*
+** WinCE lacks native support for file locking so we have to fake it
+** with some code of our own.
+*/
+#if OS_WINCE
+typedef struct winceLock {
+ int nReaders; /* Number of reader locks obtained */
+ BOOL bPending; /* Indicates a pending lock has been obtained */
+ BOOL bReserved; /* Indicates a reserved lock has been obtained */
+ BOOL bExclusive; /* Indicates an exclusive lock has been obtained */
+} winceLock;
+#endif
+
+/*
+** The winFile structure is a subclass of OsFile specific to the win32
+** portability layer.
+*/
+typedef struct winFile winFile;
+struct winFile {
+ IoMethod const *pMethod;/* Must be first */
+ HANDLE h; /* Handle for accessing the file */
+ unsigned char locktype; /* Type of lock currently held on this file */
+ short sharedLockByte; /* Randomly chosen byte used as a shared lock */
+#if OS_WINCE
+ WCHAR *zDeleteOnClose; /* Name of file to delete when closing */
+ HANDLE hMutex; /* Mutex used to control access to shared lock */
+ HANDLE hShared; /* Shared memory segment used for locking */
+ winceLock local; /* Locks obtained by this instance of winFile */
+ winceLock *shared; /* Global shared lock memory for the file */
+#endif
+};
+
+
+/*
** 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)
@@ -56,8 +99,8 @@
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.
+** Return true (non-zero) if we are running under WinNT, Win2K, WinXP,
+** or WinCE. 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
@@ -66,34 +109,38 @@ int sqlite3_os_type = 0;
** 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;
+#if OS_WINCE
+# define isNT() (1)
+#else
+ 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;
}
- return sqlite3_os_type==2;
-}
+#endif /* OS_WINCE */
/*
** 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;
+ int nChar;
WCHAR *zWideFilename;
if( !isNT() ){
return 0;
}
- nByte = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0)*sizeof(WCHAR);
- zWideFilename = sqliteMalloc( nByte*sizeof(zWideFilename[0]) );
+ nChar = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0);
+ zWideFilename = sqliteMalloc( nChar*sizeof(zWideFilename[0]) );
if( zWideFilename==0 ){
return 0;
}
- nByte = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, zWideFilename, nByte);
- if( nByte==0 ){
+ nChar = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, zWideFilename, nChar);
+ if( nChar==0 ){
sqliteFree(zWideFilename);
zWideFilename = 0;
}
@@ -122,37 +169,369 @@ static char *unicodeToUtf8(const WCHAR *zWideFilename){
return zFilename;
}
+#if OS_WINCE
+/*************************************************************************
+** This section contains code for WinCE only.
+*/
+/*
+** WindowsCE does not have a localtime() function. So create a
+** substitute.
+*/
+#include <time.h>
+struct tm *__cdecl localtime(const time_t *t)
+{
+ static struct tm y;
+ FILETIME uTm, lTm;
+ SYSTEMTIME pTm;
+ i64 t64;
+ t64 = *t;
+ t64 = (t64 + 11644473600)*10000000;
+ uTm.dwLowDateTime = t64 & 0xFFFFFFFF;
+ uTm.dwHighDateTime= t64 >> 32;
+ FileTimeToLocalFileTime(&uTm,&lTm);
+ FileTimeToSystemTime(&lTm,&pTm);
+ y.tm_year = pTm.wYear - 1900;
+ y.tm_mon = pTm.wMonth - 1;
+ y.tm_wday = pTm.wDayOfWeek;
+ y.tm_mday = pTm.wDay;
+ y.tm_hour = pTm.wHour;
+ y.tm_min = pTm.wMinute;
+ y.tm_sec = pTm.wSecond;
+ return &y;
+}
+
+/* This will never be called, but defined to make the code compile */
+#define GetTempPathA(a,b)
+
+#define LockFile(a,b,c,d,e) winceLockFile(&a, b, c, d, e)
+#define UnlockFile(a,b,c,d,e) winceUnlockFile(&a, b, c, d, e)
+#define LockFileEx(a,b,c,d,e,f) winceLockFileEx(&a, b, c, d, e, f)
+
+#define HANDLE_TO_WINFILE(a) (winFile*)&((char*)a)[-offsetof(winFile,h)]
+
+/*
+** Acquire a lock on the handle h
+*/
+static void winceMutexAcquire(HANDLE h){
+ DWORD dwErr;
+ do {
+ dwErr = WaitForSingleObject(h, INFINITE);
+ } while (dwErr != WAIT_OBJECT_0 && dwErr != WAIT_ABANDONED);
+}
+/*
+** Release a lock acquired by winceMutexAcquire()
+*/
+#define winceMutexRelease(h) ReleaseMutex(h)
+
+/*
+** Create the mutex and shared memory used for locking in the file
+** descriptor pFile
+*/
+static BOOL winceCreateLock(const char *zFilename, winFile *pFile){
+ WCHAR *zTok;
+ WCHAR *zName = utf8ToUnicode(zFilename);
+ BOOL bInit = TRUE;
+
+ /* Initialize the local lockdata */
+ ZeroMemory(&pFile->local, sizeof(pFile->local));
+
+ /* Replace the backslashes from the filename and lowercase it
+ ** to derive a mutex name. */
+ zTok = CharLowerW(zName);
+ for (;*zTok;zTok++){
+ if (*zTok == '\\') *zTok = '_';
+ }
+
+ /* Create/open the named mutex */
+ pFile->hMutex = CreateMutexW(NULL, FALSE, zName);
+ if (!pFile->hMutex){
+ sqliteFree(zName);
+ return FALSE;
+ }
+
+ /* Acquire the mutex before continuing */
+ winceMutexAcquire(pFile->hMutex);
+
+ /* Since the names of named mutexes, semaphores, file mappings etc are
+ ** case-sensitive, take advantage of that by uppercasing the mutex name
+ ** and using that as the shared filemapping name.
+ */
+ CharUpperW(zName);
+ pFile->hShared = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL,
+ PAGE_READWRITE, 0, sizeof(winceLock),
+ zName);
+
+ /* Set a flag that indicates we're the first to create the memory so it
+ ** must be zero-initialized */
+ if (GetLastError() == ERROR_ALREADY_EXISTS){
+ bInit = FALSE;
+ }
+
+ sqliteFree(zName);
+
+ /* If we succeeded in making the shared memory handle, map it. */
+ if (pFile->hShared){
+ pFile->shared = (winceLock*)MapViewOfFile(pFile->hShared,
+ FILE_MAP_READ|FILE_MAP_WRITE, 0, 0, sizeof(winceLock));
+ /* If mapping failed, close the shared memory handle and erase it */
+ if (!pFile->shared){
+ CloseHandle(pFile->hShared);
+ pFile->hShared = NULL;
+ }
+ }
+
+ /* If shared memory could not be created, then close the mutex and fail */
+ if (pFile->hShared == NULL){
+ winceMutexRelease(pFile->hMutex);
+ CloseHandle(pFile->hMutex);
+ pFile->hMutex = NULL;
+ return FALSE;
+ }
+
+ /* Initialize the shared memory if we're supposed to */
+ if (bInit) {
+ ZeroMemory(pFile->shared, sizeof(winceLock));
+ }
+
+ winceMutexRelease(pFile->hMutex);
+ return TRUE;
+}
+
+/*
+** Destroy the part of winFile that deals with wince locks
+*/
+static void winceDestroyLock(winFile *pFile){
+ if (pFile->hMutex){
+ /* Acquire the mutex */
+ winceMutexAcquire(pFile->hMutex);
+
+ /* The following blocks should probably assert in debug mode, but they
+ are to cleanup in case any locks remained open */
+ if (pFile->local.nReaders){
+ pFile->shared->nReaders --;
+ }
+ if (pFile->local.bReserved){
+ pFile->shared->bReserved = FALSE;
+ }
+ if (pFile->local.bPending){
+ pFile->shared->bPending = FALSE;
+ }
+ if (pFile->local.bExclusive){
+ pFile->shared->bExclusive = FALSE;
+ }
+
+ /* De-reference and close our copy of the shared memory handle */
+ UnmapViewOfFile(pFile->shared);
+ CloseHandle(pFile->hShared);
+
+ /* Done with the mutex */
+ winceMutexRelease(pFile->hMutex);
+ CloseHandle(pFile->hMutex);
+ pFile->hMutex = NULL;
+ }
+}
+
+/*
+** An implementation of the LockFile() API of windows for wince
+*/
+static BOOL winceLockFile(
+ HANDLE *phFile,
+ DWORD dwFileOffsetLow,
+ DWORD dwFileOffsetHigh,
+ DWORD nNumberOfBytesToLockLow,
+ DWORD nNumberOfBytesToLockHigh
+){
+ winFile *pFile = HANDLE_TO_WINFILE(phFile);
+ BOOL bReturn = FALSE;
+
+ if (!pFile->hMutex) return TRUE;
+ winceMutexAcquire(pFile->hMutex);
+
+ /* Wanting an exclusive lock? */
+ if (dwFileOffsetLow == SHARED_FIRST
+ && nNumberOfBytesToLockLow == SHARED_SIZE){
+ if (pFile->shared->nReaders == 0 && pFile->shared->bExclusive == 0){
+ pFile->shared->bExclusive = TRUE;
+ pFile->local.bExclusive = TRUE;
+ bReturn = TRUE;
+ }
+ }
+
+ /* Want a read-only lock? */
+ else if ((dwFileOffsetLow >= SHARED_FIRST &&
+ dwFileOffsetLow < SHARED_FIRST + SHARED_SIZE) &&
+ nNumberOfBytesToLockLow == 1){
+ if (pFile->shared->bExclusive == 0){
+ pFile->local.nReaders ++;
+ if (pFile->local.nReaders == 1){
+ pFile->shared->nReaders ++;
+ }
+ bReturn = TRUE;
+ }
+ }
+
+ /* Want a pending lock? */
+ else if (dwFileOffsetLow == PENDING_BYTE && nNumberOfBytesToLockLow == 1){
+ /* If no pending lock has been acquired, then acquire it */
+ if (pFile->shared->bPending == 0) {
+ pFile->shared->bPending = TRUE;
+ pFile->local.bPending = TRUE;
+ bReturn = TRUE;
+ }
+ }
+ /* Want a reserved lock? */
+ else if (dwFileOffsetLow == RESERVED_BYTE && nNumberOfBytesToLockLow == 1){
+ if (pFile->shared->bReserved == 0) {
+ pFile->shared->bReserved = TRUE;
+ pFile->local.bReserved = TRUE;
+ bReturn = TRUE;
+ }
+ }
+
+ winceMutexRelease(pFile->hMutex);
+ return bReturn;
+}
+
+/*
+** An implementation of the UnlockFile API of windows for wince
+*/
+static BOOL winceUnlockFile(
+ HANDLE *phFile,
+ DWORD dwFileOffsetLow,
+ DWORD dwFileOffsetHigh,
+ DWORD nNumberOfBytesToUnlockLow,
+ DWORD nNumberOfBytesToUnlockHigh
+){
+ winFile *pFile = HANDLE_TO_WINFILE(phFile);
+ BOOL bReturn = FALSE;
+
+ if (!pFile->hMutex) return TRUE;
+ winceMutexAcquire(pFile->hMutex);
+
+ /* Releasing a reader lock or an exclusive lock */
+ if (dwFileOffsetLow >= SHARED_FIRST &&
+ dwFileOffsetLow < SHARED_FIRST + SHARED_SIZE){
+ /* Did we have an exclusive lock? */
+ if (pFile->local.bExclusive){
+ pFile->local.bExclusive = FALSE;
+ pFile->shared->bExclusive = FALSE;
+ bReturn = TRUE;
+ }
+
+ /* Did we just have a reader lock? */
+ else if (pFile->local.nReaders){
+ pFile->local.nReaders --;
+ if (pFile->local.nReaders == 0)
+ {
+ pFile->shared->nReaders --;
+ }
+ bReturn = TRUE;
+ }
+ }
+
+ /* Releasing a pending lock */
+ else if (dwFileOffsetLow == PENDING_BYTE && nNumberOfBytesToUnlockLow == 1){
+ if (pFile->local.bPending){
+ pFile->local.bPending = FALSE;
+ pFile->shared->bPending = FALSE;
+ bReturn = TRUE;
+ }
+ }
+ /* Releasing a reserved lock */
+ else if (dwFileOffsetLow == RESERVED_BYTE && nNumberOfBytesToUnlockLow == 1){
+ if (pFile->local.bReserved) {
+ pFile->local.bReserved = FALSE;
+ pFile->shared->bReserved = FALSE;
+ bReturn = TRUE;
+ }
+ }
+
+ winceMutexRelease(pFile->hMutex);
+ return bReturn;
+}
+
+/*
+** An implementation of the LockFileEx() API of windows for wince
+*/
+static BOOL winceLockFileEx(
+ HANDLE *phFile,
+ DWORD dwFlags,
+ DWORD dwReserved,
+ DWORD nNumberOfBytesToLockLow,
+ DWORD nNumberOfBytesToLockHigh,
+ LPOVERLAPPED lpOverlapped
+){
+ /* If the caller wants a shared read lock, forward this call
+ ** to winceLockFile */
+ if (lpOverlapped->Offset == SHARED_FIRST &&
+ dwFlags == 1 &&
+ nNumberOfBytesToLockLow == SHARED_SIZE){
+ return winceLockFile(phFile, SHARED_FIRST, 0, 1, 0);
+ }
+ return FALSE;
+}
+/*
+** End of the special code for wince
+*****************************************************************************/
+#endif /* OS_WINCE */
/*
-** Delete the named file
+** Delete the named file.
+**
+** Note that windows does not allow a file to be deleted if some other
+** process has it open. Sometimes a virus scanner or indexing program
+** will open a journal file shortly after it is created in order to do
+** whatever it is it does. While this other process is holding the
+** file open, we will be unable to delete it. To work around this
+** problem, we delay 100 milliseconds and try to delete again. Up
+** to MX_DELETION_ATTEMPTs deletion attempts are run before giving
+** up and returning an error.
*/
-int sqlite3OsDelete(const char *zFilename){
+#define MX_DELETION_ATTEMPTS 3
+int sqlite3WinDelete(const char *zFilename){
WCHAR *zWide = utf8ToUnicode(zFilename);
+ int cnt = 0;
+ int rc;
if( zWide ){
- DeleteFileW(zWide);
+ do{
+ rc = DeleteFileW(zWide);
+ }while( rc==0 && cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
sqliteFree(zWide);
}else{
- DeleteFileA(zFilename);
+#if OS_WINCE
+ return SQLITE_NOMEM;
+#else
+ do{
+ rc = DeleteFileA(zFilename);
+ }while( rc==0 && cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
+#endif
}
TRACE2("DELETE \"%s\"\n", zFilename);
- return SQLITE_OK;
+ return rc==0 ? SQLITE_OK : SQLITE_IOERR;
}
/*
** Return TRUE if the named file exists.
*/
-int sqlite3OsFileExists(const char *zFilename){
+int sqlite3WinFileExists(const char *zFilename){
int exists = 0;
WCHAR *zWide = utf8ToUnicode(zFilename);
if( zWide ){
exists = GetFileAttributesW(zWide) != 0xffffffff;
sqliteFree(zWide);
}else{
+#if OS_WINCE
+ return SQLITE_NOMEM;
+#else
exists = GetFileAttributesA(zFilename) != 0xffffffff;
+#endif
}
return exists;
}
+/* Forward declaration */
+static int allocateWinFile(winFile *pInit, OsFile **pId);
+
/*
** Attempt to open a file for both reading and writing. If that
** fails, try opening it read-only. If the file does not exist,
@@ -166,14 +545,15 @@ int sqlite3OsFileExists(const char *zFilename){
** On failure, the function returns SQLITE_CANTOPEN and leaves
** *id and *pReadonly unchanged.
*/
-int sqlite3OsOpenReadWrite(
+int sqlite3WinOpenReadWrite(
const char *zFilename,
- OsFile *id,
+ OsFile **pId,
int *pReadonly
){
+ winFile f;
HANDLE h;
WCHAR *zWide = utf8ToUnicode(zFilename);
- assert( !id->isOpen );
+ assert( *pId==0 );
if( zWide ){
h = CreateFileW(zWide,
GENERIC_READ | GENERIC_WRITE,
@@ -186,7 +566,7 @@ int sqlite3OsOpenReadWrite(
if( h==INVALID_HANDLE_VALUE ){
h = CreateFileW(zWide,
GENERIC_READ,
- FILE_SHARE_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
@@ -200,8 +580,18 @@ int sqlite3OsOpenReadWrite(
}else{
*pReadonly = 0;
}
+#if OS_WINCE
+ if (!winceCreateLock(zFilename, &f)){
+ CloseHandle(h);
+ sqliteFree(zWide);
+ return SQLITE_CANTOPEN;
+ }
+#endif
sqliteFree(zWide);
}else{
+#if OS_WINCE
+ return SQLITE_NOMEM;
+#else
h = CreateFileA(zFilename,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
@@ -213,7 +603,7 @@ int sqlite3OsOpenReadWrite(
if( h==INVALID_HANDLE_VALUE ){
h = CreateFileA(zFilename,
GENERIC_READ,
- FILE_SHARE_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
@@ -226,14 +616,14 @@ int sqlite3OsOpenReadWrite(
}else{
*pReadonly = 0;
}
+#endif /* OS_WINCE */
}
- id->h = h;
- id->locktype = NO_LOCK;
- id->sharedLockByte = 0;
- id->isOpen = 1;
- OpenCounter(+1);
+ f.h = h;
+#if OS_WINCE
+ f.zDeleteOnClose = 0;
+#endif
TRACE3("OPEN R/W %d \"%s\"\n", h, zFilename);
- return SQLITE_OK;
+ return allocateWinFile(&f, pId);
}
@@ -250,48 +640,65 @@ int sqlite3OsOpenReadWrite(
** On success, write the file handle into *id and return SQLITE_OK.
**
** On failure, return SQLITE_CANTOPEN.
+**
+** Sometimes if we have just deleted a prior journal file, windows
+** will fail to open a new one because there is a "pending delete".
+** To work around this bug, we pause for 100 milliseconds and attempt
+** a second open after the first one fails. The whole operation only
+** fails if both open attempts are unsuccessful.
*/
-int sqlite3OsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){
+int sqlite3WinOpenExclusive(const char *zFilename, OsFile **pId, int delFlag){
+ winFile f;
HANDLE h;
int fileflags;
WCHAR *zWide = utf8ToUnicode(zFilename);
- assert( !id->isOpen );
+ assert( *pId == 0 );
+ fileflags = FILE_FLAG_RANDOM_ACCESS;
+#if !OS_WINCE
if( delFlag ){
- fileflags = FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_RANDOM_ACCESS
- | FILE_FLAG_DELETE_ON_CLOSE;
- }else{
- fileflags = FILE_FLAG_RANDOM_ACCESS;
+ fileflags |= FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE;
}
+#endif
if( zWide ){
- h = CreateFileW(zWide,
- GENERIC_READ | GENERIC_WRITE,
- 0,
- NULL,
- CREATE_ALWAYS,
- fileflags,
- NULL
- );
+ int cnt = 0;
+ do{
+ h = CreateFileW(zWide,
+ GENERIC_READ | GENERIC_WRITE,
+ 0,
+ NULL,
+ CREATE_ALWAYS,
+ fileflags,
+ NULL
+ );
+ }while( h==INVALID_HANDLE_VALUE && cnt++ < 2 && (Sleep(100), 1) );
sqliteFree(zWide);
}else{
- h = CreateFileA(zFilename,
- GENERIC_READ | GENERIC_WRITE,
- 0,
- NULL,
- CREATE_ALWAYS,
- fileflags,
- NULL
- );
+#if OS_WINCE
+ return SQLITE_NOMEM;
+#else
+ int cnt = 0;
+ do{
+ h = CreateFileA(zFilename,
+ GENERIC_READ | GENERIC_WRITE,
+ 0,
+ NULL,
+ CREATE_ALWAYS,
+ fileflags,
+ NULL
+ );
+ }while( h==INVALID_HANDLE_VALUE && cnt++ < 2 && (Sleep(100), 1) );
+#endif /* OS_WINCE */
}
if( h==INVALID_HANDLE_VALUE ){
return SQLITE_CANTOPEN;
}
- id->h = h;
- id->locktype = NO_LOCK;
- id->sharedLockByte = 0;
- id->isOpen = 1;
- OpenCounter(+1);
+ f.h = h;
+#if OS_WINCE
+ f.zDeleteOnClose = delFlag ? utf8ToUnicode(zFilename) : 0;
+ f.hMutex = NULL;
+#endif
TRACE3("OPEN EX %d \"%s\"\n", h, zFilename);
- return SQLITE_OK;
+ return allocateWinFile(&f, pId);
}
/*
@@ -301,10 +708,11 @@ int sqlite3OsOpenExclusive(const char *zFilename, OsFile *id, int delFlag){
**
** On failure, return SQLITE_CANTOPEN.
*/
-int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){
+int sqlite3WinOpenReadOnly(const char *zFilename, OsFile **pId){
+ winFile f;
HANDLE h;
WCHAR *zWide = utf8ToUnicode(zFilename);
- assert( !id->isOpen );
+ assert( *pId==0 );
if( zWide ){
h = CreateFileW(zWide,
GENERIC_READ,
@@ -316,6 +724,9 @@ int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){
);
sqliteFree(zWide);
}else{
+#if OS_WINCE
+ return SQLITE_NOMEM;
+#else
h = CreateFileA(zFilename,
GENERIC_READ,
0,
@@ -324,17 +735,18 @@ int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
NULL
);
+#endif
}
if( h==INVALID_HANDLE_VALUE ){
return SQLITE_CANTOPEN;
}
- id->h = h;
- id->locktype = NO_LOCK;
- id->sharedLockByte = 0;
- id->isOpen = 1;
- OpenCounter(+1);
+ f.h = h;
+#if OS_WINCE
+ f.zDeleteOnClose = 0;
+ f.hMutex = NULL;
+#endif
TRACE3("OPEN RO %d \"%s\"\n", h, zFilename);
- return SQLITE_OK;
+ return allocateWinFile(&f, pId);
}
/*
@@ -353,9 +765,9 @@ int sqlite3OsOpenReadOnly(const char *zFilename, OsFile *id){
** On failure, the function returns SQLITE_CANTOPEN and leaves
** *id unchanged.
*/
-int sqlite3OsOpenDirectory(
- const char *zDirname,
- OsFile *id
+static int winOpenDirectory(
+ OsFile *id,
+ const char *zDirname
){
return SQLITE_OK;
}
@@ -371,7 +783,7 @@ 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){
+int sqlite3WinTempFileName(char *zBuf){
static char zChars[] =
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
@@ -412,15 +824,36 @@ int sqlite3OsTempFileName(char *zBuf){
/*
** Close a file.
+**
+** It is reported that an attempt to close a handle might sometimes
+** fail. This is a very unreasonable result, but windows is notorious
+** for being unreasonable so I do not doubt that it might happen. If
+** the close fails, we pause for 100 milliseconds and try again. As
+** many as MX_CLOSE_ATTEMPT attempts to close the handle are made before
+** giving up and returning an error.
*/
-int sqlite3OsClose(OsFile *id){
- if( id->isOpen ){
- TRACE2("CLOSE %d\n", id->h);
- CloseHandle(id->h);
+#define MX_CLOSE_ATTEMPT 3
+static int winClose(OsFile **pId){
+ winFile *pFile;
+ int rc = 1;
+ if( pId && (pFile = (winFile*)*pId)!=0 ){
+ int rc, cnt = 0;
+ TRACE2("CLOSE %d\n", pFile->h);
+ do{
+ rc = CloseHandle(pFile->h);
+ }while( rc==0 && cnt++ < MX_CLOSE_ATTEMPT && (Sleep(100), 1) );
+#if OS_WINCE
+ winceDestroyLock(pFile);
+ if( pFile->zDeleteOnClose ){
+ DeleteFileW(pFile->zDeleteOnClose);
+ sqliteFree(pFile->zDeleteOnClose);
+ }
+#endif
OpenCounter(-1);
- id->isOpen = 0;
+ sqliteFree(pFile);
+ *pId = 0;
}
- return SQLITE_OK;
+ return rc ? SQLITE_OK : SQLITE_IOERR;
}
/*
@@ -428,12 +861,12 @@ int sqlite3OsClose(OsFile *id){
** bytes were read successfully and SQLITE_IOERR if anything goes
** wrong.
*/
-int sqlite3OsRead(OsFile *id, void *pBuf, int amt){
+static int winRead(OsFile *id, void *pBuf, int amt){
DWORD got;
- assert( id->isOpen );
+ assert( id!=0 );
SimulateIOError(SQLITE_IOERR);
- TRACE3("READ %d lock=%d\n", id->h, id->locktype);
- if( !ReadFile(id->h, pBuf, amt, &got, 0) ){
+ TRACE3("READ %d lock=%d\n", ((winFile*)id)->h, ((winFile*)id)->locktype);
+ if( !ReadFile(((winFile*)id)->h, pBuf, amt, &got, 0) ){
got = 0;
}
if( got==(DWORD)amt ){
@@ -447,15 +880,16 @@ int sqlite3OsRead(OsFile *id, void *pBuf, int amt){
** 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){
+static int winWrite(OsFile *id, const void *pBuf, int amt){
int rc = 0;
DWORD wrote;
- assert( id->isOpen );
+ assert( id!=0 );
SimulateIOError(SQLITE_IOERR);
SimulateDiskfullError;
- TRACE3("WRITE %d lock=%d\n", id->h, id->locktype);
+ TRACE3("WRITE %d lock=%d\n", ((winFile*)id)->h, ((winFile*)id)->locktype);
assert( amt>0 );
- while( amt>0 && (rc = WriteFile(id->h, pBuf, amt, &wrote, 0))!=0 && wrote>0 ){
+ while( amt>0 && (rc = WriteFile(((winFile*)id)->h, pBuf, amt, &wrote, 0))!=0
+ && wrote>0 ){
amt -= wrote;
pBuf = &((char*)pBuf)[wrote];
}
@@ -475,17 +909,17 @@ int sqlite3OsWrite(OsFile *id, const void *pBuf, int amt){
/*
** Move the read/write pointer in a file.
*/
-int sqlite3OsSeek(OsFile *id, i64 offset){
+static int winSeek(OsFile *id, i64 offset){
LONG upperBits = offset>>32;
LONG lowerBits = offset & 0xffffffff;
DWORD rc;
- assert( id->isOpen );
+ assert( id!=0 );
#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);
+ rc = SetFilePointer(((winFile*)id)->h, lowerBits, &upperBits, FILE_BEGIN);
+ TRACE3("SEEK %d %lld\n", ((winFile*)id)->h, offset);
if( rc==INVALID_SET_FILE_POINTER && GetLastError()!=NO_ERROR ){
return SQLITE_FULL;
}
@@ -495,10 +929,10 @@ int sqlite3OsSeek(OsFile *id, i64 offset){
/*
** 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) ){
+static int winSync(OsFile *id, int dataOnly){
+ assert( id!=0 );
+ TRACE3("SYNC %d lock=%d\n", ((winFile*)id)->h, ((winFile*)id)->locktype);
+ if( FlushFileBuffers(((winFile*)id)->h) ){
return SQLITE_OK;
}else{
return SQLITE_IOERR;
@@ -509,7 +943,7 @@ int sqlite3OsSync(OsFile *id, int dataOnly){
** Sync the directory zDirname. This is a no-op on operating systems other
** than UNIX.
*/
-int sqlite3OsSyncDirectory(const char *zDirname){
+int sqlite3WinSyncDirectory(const char *zDirname){
SimulateIOError(SQLITE_IOERR);
return SQLITE_OK;
}
@@ -517,34 +951,41 @@ int sqlite3OsSyncDirectory(const char *zDirname){
/*
** Truncate an open file to a specified size
*/
-int sqlite3OsTruncate(OsFile *id, i64 nByte){
+static int winTruncate(OsFile *id, i64 nByte){
LONG upperBits = nByte>>32;
- assert( id->isOpen );
- TRACE3("TRUNCATE %d %lld\n", id->h, nByte);
+ assert( id!=0 );
+ TRACE3("TRUNCATE %d %lld\n", ((winFile*)id)->h, nByte);
SimulateIOError(SQLITE_IOERR);
- SetFilePointer(id->h, nByte, &upperBits, FILE_BEGIN);
- SetEndOfFile(id->h);
+ SetFilePointer(((winFile*)id)->h, nByte, &upperBits, FILE_BEGIN);
+ SetEndOfFile(((winFile*)id)->h);
return SQLITE_OK;
}
/*
** Determine the current size of a file in bytes
*/
-int sqlite3OsFileSize(OsFile *id, i64 *pSize){
+static int winFileSize(OsFile *id, i64 *pSize){
DWORD upperBits, lowerBits;
- assert( id->isOpen );
+ assert( id!=0 );
SimulateIOError(SQLITE_IOERR);
- lowerBits = GetFileSize(id->h, &upperBits);
+ lowerBits = GetFileSize(((winFile*)id)->h, &upperBits);
*pSize = (((i64)upperBits)<<32) + lowerBits;
return SQLITE_OK;
}
/*
+** LOCKFILE_FAIL_IMMEDIATELY is undefined on some Windows systems.
+*/
+#ifndef LOCKFILE_FAIL_IMMEDIATELY
+# define LOCKFILE_FAIL_IMMEDIATELY 1
+#endif
+
+/*
** Acquire a reader lock.
** Different API routines are called depending on whether or not this
** is Win95 or WinNT.
*/
-static int getReadLock(OsFile *id){
+static int getReadLock(winFile *id){
int res;
if( isNT() ){
OVERLAPPED ovlp;
@@ -564,12 +1005,12 @@ static int getReadLock(OsFile *id){
/*
** Undo a readlock
*/
-static int unlockReadLock(OsFile *id){
+static int unlockReadLock(winFile *pFile){
int res;
if( isNT() ){
- res = UnlockFile(id->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
+ res = UnlockFile(pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
}else{
- res = UnlockFile(id->h, SHARED_FIRST + id->sharedLockByte, 0, 1, 0);
+ res = UnlockFile(pFile->h, SHARED_FIRST + pFile->sharedLockByte, 0, 1, 0);
}
return res;
}
@@ -579,7 +1020,7 @@ static int unlockReadLock(OsFile *id){
** Check that a given pathname is a directory and is writable
**
*/
-int sqlite3OsIsDirWritable(char *zDirname){
+int sqlite3WinIsDirWritable(char *zDirname){
int fileAttr;
WCHAR *zWide;
if( zDirname==0 ) return 0;
@@ -589,7 +1030,11 @@ int sqlite3OsIsDirWritable(char *zDirname){
fileAttr = GetFileAttributesW(zWide);
sqliteFree(zWide);
}else{
+#if OS_WINCE
+ return 0;
+#else
fileAttr = GetFileAttributesA(zDirname);
+#endif
}
if( fileAttr == 0xffffffff ) return 0;
if( (fileAttr & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY ){
@@ -620,45 +1065,46 @@ int sqlite3OsIsDirWritable(char *zDirname){
** RESERVED -> (PENDING) -> EXCLUSIVE
** PENDING -> EXCLUSIVE
**
-** This routine will only increase a lock. The sqlite3OsUnlock() routine
+** This routine will only increase a lock. The winUnlock() 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){
+static int winLock(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 */
+ winFile *pFile = (winFile*)id;
- assert( id->isOpen );
+ assert( pFile!=0 );
TRACE5("LOCK %d %d was %d(%d)\n",
- id->h, locktype, id->locktype, id->sharedLockByte);
+ pFile->h, locktype, pFile->locktype, pFile->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 ){
+ if( pFile->locktype>=locktype ){
return SQLITE_OK;
}
/* Make sure the locking sequence is correct
*/
- assert( id->locktype!=NO_LOCK || locktype==SHARED_LOCK );
+ assert( pFile->locktype!=NO_LOCK || locktype==SHARED_LOCK );
assert( locktype!=PENDING_LOCK );
- assert( locktype!=RESERVED_LOCK || id->locktype==SHARED_LOCK );
+ assert( locktype!=RESERVED_LOCK || pFile->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)
+ newLocktype = pFile->locktype;
+ if( pFile->locktype==NO_LOCK
+ || (locktype==EXCLUSIVE_LOCK && pFile->locktype==RESERVED_LOCK)
){
int cnt = 3;
- while( cnt-->0 && (res = LockFile(id->h, PENDING_BYTE, 0, 1, 0))==0 ){
+ while( cnt-->0 && (res = LockFile(pFile->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.
*/
@@ -671,8 +1117,8 @@ int sqlite3OsLock(OsFile *id, int locktype){
/* Acquire a shared lock
*/
if( locktype==SHARED_LOCK && res ){
- assert( id->locktype==NO_LOCK );
- res = getReadLock(id);
+ assert( pFile->locktype==NO_LOCK );
+ res = getReadLock(pFile);
if( res ){
newLocktype = SHARED_LOCK;
}
@@ -681,8 +1127,8 @@ int sqlite3OsLock(OsFile *id, int locktype){
/* Acquire a RESERVED lock
*/
if( locktype==RESERVED_LOCK && res ){
- assert( id->locktype==SHARED_LOCK );
- res = LockFile(id->h, RESERVED_BYTE, 0, 1, 0);
+ assert( pFile->locktype==SHARED_LOCK );
+ res = LockFile(pFile->h, RESERVED_BYTE, 0, 1, 0);
if( res ){
newLocktype = RESERVED_LOCK;
}
@@ -698,10 +1144,10 @@ int sqlite3OsLock(OsFile *id, int locktype){
/* Acquire an EXCLUSIVE lock
*/
if( locktype==EXCLUSIVE_LOCK && res ){
- assert( id->locktype>=SHARED_LOCK );
- res = unlockReadLock(id);
+ assert( pFile->locktype>=SHARED_LOCK );
+ res = unlockReadLock(pFile);
TRACE2("unreadlock = %d\n", res);
- res = LockFile(id->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
+ res = LockFile(pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
if( res ){
newLocktype = EXCLUSIVE_LOCK;
}else{
@@ -713,7 +1159,7 @@ int sqlite3OsLock(OsFile *id, int locktype){
** release it now.
*/
if( gotPendingLock && locktype==SHARED_LOCK ){
- UnlockFile(id->h, PENDING_BYTE, 0, 1, 0);
+ UnlockFile(pFile->h, PENDING_BYTE, 0, 1, 0);
}
/* Update the state of the lock has held in the file descriptor then
@@ -722,11 +1168,11 @@ int sqlite3OsLock(OsFile *id, int locktype){
if( res ){
rc = SQLITE_OK;
}else{
- TRACE4("LOCK FAILED %d trying for %d but got %d\n", id->h,
+ TRACE4("LOCK FAILED %d trying for %d but got %d\n", pFile->h,
locktype, newLocktype);
rc = SQLITE_BUSY;
}
- id->locktype = newLocktype;
+ pFile->locktype = newLocktype;
return rc;
}
@@ -735,19 +1181,20 @@ int sqlite3OsLock(OsFile *id, int locktype){
** file by this or any other process. If such a lock is held, return
** non-zero, otherwise zero.
*/
-int sqlite3OsCheckReservedLock(OsFile *id){
+static int winCheckReservedLock(OsFile *id){
int rc;
- assert( id->isOpen );
- if( id->locktype>=RESERVED_LOCK ){
+ winFile *pFile = (winFile*)id;
+ assert( pFile!=0 );
+ if( pFile->locktype>=RESERVED_LOCK ){
rc = 1;
- TRACE3("TEST WR-LOCK %d %d (local)\n", id->h, rc);
+ TRACE3("TEST WR-LOCK %d %d (local)\n", pFile->h, rc);
}else{
- rc = LockFile(id->h, RESERVED_BYTE, 0, 1, 0);
+ rc = LockFile(pFile->h, RESERVED_BYTE, 0, 1, 0);
if( rc ){
- UnlockFile(id->h, RESERVED_BYTE, 0, 1, 0);
+ UnlockFile(pFile->h, RESERVED_BYTE, 0, 1, 0);
}
rc = !rc;
- TRACE3("TEST WR-LOCK %d %d (remote)\n", id->h, rc);
+ TRACE3("TEST WR-LOCK %d %d (remote)\n", pFile->h, rc);
}
return rc;
}
@@ -763,32 +1210,33 @@ int sqlite3OsCheckReservedLock(OsFile *id){
** is NO_LOCK. If the second argument is SHARED_LOCK then this routine
** might return SQLITE_IOERR;
*/
-int sqlite3OsUnlock(OsFile *id, int locktype){
+static int winUnlock(OsFile *id, int locktype){
int type;
int rc = SQLITE_OK;
- assert( id->isOpen );
+ winFile *pFile = (winFile*)id;
+ assert( pFile!=0 );
assert( locktype<=SHARED_LOCK );
- TRACE5("UNLOCK %d to %d was %d(%d)\n", id->h, locktype,
- id->locktype, id->sharedLockByte);
- type = id->locktype;
+ TRACE5("UNLOCK %d to %d was %d(%d)\n", pFile->h, locktype,
+ pFile->locktype, pFile->sharedLockByte);
+ type = pFile->locktype;
if( type>=EXCLUSIVE_LOCK ){
- UnlockFile(id->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
- if( locktype==SHARED_LOCK && !getReadLock(id) ){
+ UnlockFile(pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
+ if( locktype==SHARED_LOCK && !getReadLock(pFile) ){
/* 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);
+ UnlockFile(pFile->h, RESERVED_BYTE, 0, 1, 0);
}
if( locktype==NO_LOCK && type>=SHARED_LOCK ){
- unlockReadLock(id);
+ unlockReadLock(pFile);
}
if( type>=PENDING_LOCK ){
- UnlockFile(id->h, PENDING_BYTE, 0, 1, 0);
+ UnlockFile(pFile->h, PENDING_BYTE, 0, 1, 0);
}
- id->locktype = locktype;
+ pFile->locktype = locktype;
return rc;
}
@@ -798,17 +1246,21 @@ int sqlite3OsUnlock(OsFile *id, int locktype){
** The calling function is responsible for freeing this space once it
** is no longer needed.
*/
-char *sqlite3OsFullPathname(const char *zRelative){
- char *zNotUsed;
+char *sqlite3WinFullPathname(const char *zRelative){
char *zFull;
- WCHAR *zWide;
+#if defined(__CYGWIN__)
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;
+#elif OS_WINCE
+ /* WinCE has no concept of a relative pathname, or so I am told. */
+ zFull = sqliteStrDup(zRelative);
#else
+ char *zNotUsed;
+ WCHAR *zWide;
+ int nByte;
zWide = utf8ToUnicode(zRelative);
if( zWide ){
WCHAR *zTemp, *zNotUsedW;
@@ -829,6 +1281,76 @@ char *sqlite3OsFullPathname(const char *zRelative){
return zFull;
}
+/*
+** The fullSync option is meaningless on windows. This is a no-op.
+*/
+static void winSetFullSync(OsFile *id, int v){
+ return;
+}
+
+/*
+** Return the underlying file handle for an OsFile
+*/
+static int winFileHandle(OsFile *id){
+ return (int)((winFile*)id)->h;
+}
+
+/*
+** Return an integer that indices the type of lock currently held
+** by this handle. (Used for testing and analysis only.)
+*/
+static int winLockState(OsFile *id){
+ return ((winFile*)id)->locktype;
+}
+
+/*
+** This vector defines all the methods that can operate on an OsFile
+** for win32.
+*/
+static const IoMethod sqlite3WinIoMethod = {
+ winClose,
+ winOpenDirectory,
+ winRead,
+ winWrite,
+ winSeek,
+ winTruncate,
+ winSync,
+ winSetFullSync,
+ winFileHandle,
+ winFileSize,
+ winLock,
+ winUnlock,
+ winLockState,
+ winCheckReservedLock,
+};
+
+/*
+** Allocate memory for an OsFile. Initialize the new OsFile
+** to the value given in pInit and return a pointer to the new
+** OsFile. If we run out of memory, close the file and return NULL.
+*/
+static int allocateWinFile(winFile *pInit, OsFile **pId){
+ winFile *pNew;
+ pNew = sqliteMalloc( sizeof(*pNew) );
+ if( pNew==0 ){
+ CloseHandle(pInit->h);
+#if OS_WINCE
+ sqliteFree(pInit->zDeleteOnClose);
+#endif
+ *pId = 0;
+ return SQLITE_NOMEM;
+ }else{
+ *pNew = *pInit;
+ pNew->pMethod = &sqlite3WinIoMethod;
+ pNew->locktype = NO_LOCK;
+ pNew->sharedLockByte = 0;
+ *pId = (OsFile*)pNew;
+ OpenCounter(+1);
+ return SQLITE_OK;
+ }
+}
+
+
#endif /* SQLITE_OMIT_DISKIO */
/***************************************************************************
** Everything above deals with file I/O. Everything that follows deals
@@ -840,7 +1362,7 @@ char *sqlite3OsFullPathname(const char *zRelative){
** is written into the buffer zBuf[256]. The calling function must
** supply a sufficiently large buffer.
*/
-int sqlite3OsRandomSeed(char *zBuf){
+int sqlite3WinRandomSeed(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
@@ -861,7 +1383,7 @@ int sqlite3OsRandomSeed(char *zBuf){
/*
** Sleep for a little while. Return the amount of time slept.
*/
-int sqlite3OsSleep(int ms){
+int sqlite3WinSleep(int ms){
Sleep(ms);
return ms;
}
@@ -871,18 +1393,22 @@ int sqlite3OsSleep(int ms){
*/
static int inMutex = 0;
#ifdef SQLITE_W32_THREADS
+ static DWORD mutexOwner;
static CRITICAL_SECTION cs;
#endif
/*
-** The following pair of routine implement mutual exclusion for
+** The following pair of routines 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.
+**
+** Version 3.3.1 and earlier used a simple mutex. Beginning with
+** version 3.3.2, a recursive mutex is required.
*/
-void sqlite3OsEnterMutex(){
+void sqlite3WinEnterMutex(){
#ifdef SQLITE_W32_THREADS
static int isInit = 0;
while( !isInit ){
@@ -895,19 +1421,36 @@ void sqlite3OsEnterMutex(){
}
}
EnterCriticalSection(&cs);
+ mutexOwner = GetCurrentThreadId();
#endif
- assert( !inMutex );
- inMutex = 1;
+ inMutex++;
}
-void sqlite3OsLeaveMutex(){
+void sqlite3WinLeaveMutex(){
assert( inMutex );
- inMutex = 0;
+ inMutex--;
#ifdef SQLITE_W32_THREADS
+ assert( mutexOwner==GetCurrentThreadId() );
LeaveCriticalSection(&cs);
#endif
}
/*
+** Return TRUE if the mutex is currently held.
+**
+** If the thisThreadOnly parameter is true, return true if and only if the
+** calling thread holds the mutex. If the parameter is false, return
+** true if any thread holds the mutex.
+*/
+int sqlite3WinInMutex(int thisThreadOnly){
+#ifdef SQLITE_W32_THREADS
+ return inMutex>0 && (thisThreadOnly==0 || mutexOwner==GetCurrentThreadId());
+#else
+ return inMutex>0;
+#endif
+}
+
+
+/*
** The following variable, if set to a non-zero value, becomes the result
** returned from sqlite3OsCurrentTime(). This is used for testing.
*/
@@ -920,13 +1463,19 @@ int sqlite3_current_time = 0;
** 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){
+int sqlite3WinCurrentTime(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;
+#if OS_WINCE
+ SYSTEMTIME time;
+ GetSystemTime(&time);
+ SystemTimeToFileTime(&time,&ft);
+#else
GetSystemTimeAsFileTime( &ft );
+#endif
now = ((double)ft.dwHighDateTime) * 4294967296.0;
*prNow = (now + ft.dwLowDateTime)/864000000000.0 + 2305813.5;
#ifdef SQLITE_TEST
@@ -937,4 +1486,71 @@ int sqlite3OsCurrentTime(double *prNow){
return 0;
}
+/*
+** Remember the number of thread-specific-data blocks allocated.
+** Use this to verify that we are not leaking thread-specific-data.
+** Ticket #1601
+*/
+#ifdef SQLITE_TEST
+int sqlite3_tsd_count = 0;
+# define TSD_COUNTER_INCR InterlockedIncrement(&sqlite3_tsd_count)
+# define TSD_COUNTER_DECR InterlockedDecrement(&sqlite3_tsd_count)
+#else
+# define TSD_COUNTER_INCR /* no-op */
+# define TSD_COUNTER_DECR /* no-op */
+#endif
+
+
+
+/*
+** If called with allocateFlag>1, then return a pointer to thread
+** specific data for the current thread. Allocate and zero the
+** thread-specific data if it does not already exist necessary.
+**
+** If called with allocateFlag==0, then check the current thread
+** specific data. Return it if it exists. If it does not exist,
+** then return NULL.
+**
+** If called with allocateFlag<0, check to see if the thread specific
+** data is allocated and is all zero. If it is then deallocate it.
+** Return a pointer to the thread specific data or NULL if it is
+** unallocated or gets deallocated.
+*/
+ThreadData *sqlite3WinThreadSpecificData(int allocateFlag){
+ static int key;
+ static int keyInit = 0;
+ static const ThreadData zeroData = {0};
+ ThreadData *pTsd;
+
+ if( !keyInit ){
+ sqlite3OsEnterMutex();
+ if( !keyInit ){
+ key = TlsAlloc();
+ if( key==0xffffffff ){
+ sqlite3OsLeaveMutex();
+ return 0;
+ }
+ keyInit = 1;
+ }
+ sqlite3OsLeaveMutex();
+ }
+ pTsd = TlsGetValue(key);
+ if( allocateFlag>0 ){
+ if( !pTsd ){
+ pTsd = sqlite3OsMalloc( sizeof(zeroData) );
+ if( pTsd ){
+ *pTsd = zeroData;
+ TlsSetValue(key, pTsd);
+ TSD_COUNTER_INCR;
+ }
+ }
+ }else if( pTsd!=0 && allocateFlag<0
+ && memcmp(pTsd, &zeroData, sizeof(ThreadData))==0 ){
+ sqlite3OsFree(pTsd);
+ TlsSetValue(key, 0);
+ TSD_COUNTER_DECR;
+ pTsd = 0;
+ }
+ return pTsd;
+}
#endif /* OS_WIN */
diff --git a/ext/pdo_sqlite/sqlite/src/pager.c b/ext/pdo_sqlite/sqlite/src/pager.c
index f06d3fec6..7f4b6f952 100644
--- a/ext/pdo_sqlite/sqlite/src/pager.c
+++ b/ext/pdo_sqlite/sqlite/src/pager.c
@@ -46,21 +46,14 @@
/*
** 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.
+** to print out file-descriptors.
**
** 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
+#define PAGERID(p) ((int)(p->fd))
+#define FILEHANDLEID(fd) ((int)fd)
/*
** The page cache as a whole is always in one of the following
@@ -168,7 +161,8 @@ struct PgHdr {
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 */
+ PgHdr *pDirty, *pPrevDirty; /* Dirty pages */
+ u32 notUsed; /* Buffer space */
#ifdef SQLITE_CHECK_PAGES
u32 pageHash;
#endif
@@ -197,9 +191,11 @@ struct PgHistory {
** 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); }
+# define CODEC1(P,D,N,X) if( P->xCodec!=0 ){ P->xCodec(P->pCodecArg,D,N,X); }
+# define CODEC2(P,D,N,X) ((char*)(P->xCodec!=0?P->xCodec(P->pCodecArg,D,N,X):D))
#else
-# define CODEC(P,D,N,X)
+# define CODEC1(P,D,N,X) /* NO-OP */
+# define CODEC2(P,D,N,X) ((char*)D)
#endif
/*
@@ -213,25 +209,15 @@ struct PgHistory {
((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.
+**
+** Pager.errCode may be set to SQLITE_IOERR, SQLITE_CORRUPT, SQLITE_PROTOCOL
+** or SQLITE_FULL. Once one of the first three errors occurs, it persists
+** and is returned as the result of every major pager API call. The
+** SQLITE_FULL return code is slightly different. It persists only until the
+** next successful rollback is performed on the pager cache. Also,
+** SQLITE_FULL does not affect the sqlite3pager_get() and sqlite3pager_lookup()
+** APIs, they may still be used successfully.
*/
struct Pager {
u8 journalOpen; /* True if journal file descriptors is valid */
@@ -243,8 +229,9 @@ struct Pager {
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 full_fsync; /* Use F_FULLFSYNC when available */
u8 state; /* PAGER_UNLOCK, _SHARED, _RESERVED, etc. */
- u8 errMask; /* One of several kinds of errors */
+ u8 errCode; /* 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 */
@@ -269,13 +256,14 @@ 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 stfd; /* File descriptor for the statement subjournal*/
+ 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 */
+ PgHdr *pDirty; /* List of all dirty pages */
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 */
@@ -288,9 +276,13 @@ struct Pager {
#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 *(*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 */
+ int nHash; /* Size of the pager hash table */
+ PgHdr **aHash; /* Hash table to map page number to PgHdr */
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ Pager *pNext; /* Linked list of pagers in this thread */
+#endif
};
/*
@@ -304,15 +296,6 @@ struct Pager {
#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.
**
@@ -387,7 +370,7 @@ static const unsigned char aJournalMagic[] = {
/*
** Enable reference count tracking (for debugging) here:
*/
-#ifdef SQLITE_DEBUG
+#ifdef SQLITE_TEST
int pager3_refinfo_enable = 0;
static void pager_refinfo(PgHdr *p){
static int cnt = 0;
@@ -403,6 +386,38 @@ static const unsigned char aJournalMagic[] = {
# define REFINFO(X)
#endif
+
+/*
+** Change the size of the pager hash table to N. N must be a power
+** of two.
+*/
+static void pager_resize_hash_table(Pager *pPager, int N){
+ PgHdr **aHash, *pPg;
+ assert( N>0 && (N&(N-1))==0 );
+ aHash = sqliteMalloc( sizeof(aHash[0])*N );
+ if( aHash==0 ){
+ /* Failure to rehash is not an error. It is only a performance hit. */
+ return;
+ }
+ sqliteFree(pPager->aHash);
+ pPager->nHash = N;
+ pPager->aHash = aHash;
+ for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){
+ int h;
+ if( pPg->pgno==0 ){
+ assert( pPg->pNextHash==0 && pPg->pPrevHash==0 );
+ continue;
+ }
+ h = pPg->pgno & (N-1);
+ pPg->pNextHash = aHash[h];
+ if( aHash[h] ){
+ aHash[h]->pPrevHash = pPg;
+ }
+ aHash[h] = pPg;
+ pPg->pPrevHash = 0;
+ }
+}
+
/*
** 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
@@ -411,42 +426,32 @@ static const unsigned char aJournalMagic[] = {
** 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));
+ unsigned char ac[4];
+ int rc = sqlite3OsRead(fd, ac, sizeof(ac));
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 = (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.
+** Write a 32-bit integer into a string buffer in big-endian byte order.
*/
-static int write32bits(OsFile *fd, u32 val){
- unsigned char ac[4];
+static void put32bits(char *ac, u32 val){
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'.
+** Write a 32-bit integer into the given file descriptor. Return SQLITE_OK
+** on success or an error code is something goes wrong.
*/
-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;
+static int write32bits(OsFile *fd, u32 val){
+ char ac[4];
+ put32bits(ac, val);
+ return sqlite3OsWrite(fd, ac, 4);
}
/*
@@ -461,16 +466,25 @@ static u32 retrieve32bits(PgHdr *p, int offset){
/*
-** Convert the bits in the pPager->errMask into an approprate
-** return code.
+** This function should be called when an error occurs within the pager
+** code. The first argument is a pointer to the pager structure, the
+** second the error-code about to be returned by a pager API function.
+** The value returned is a copy of the second argument to this function.
+**
+** If the second argument is SQLITE_IOERR, SQLITE_CORRUPT or SQLITE_PROTOCOL,
+** the error becomes persistent. All subsequent API calls on this Pager
+** will immediately return the same error 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;
+static int pager_error(Pager *pPager, int rc){
+ assert( pPager->errCode==SQLITE_FULL || pPager->errCode==SQLITE_OK );
+ if(
+ rc==SQLITE_FULL ||
+ rc==SQLITE_IOERR ||
+ rc==SQLITE_CORRUPT ||
+ rc==SQLITE_PROTOCOL
+ ){
+ pPager->errCode = rc;
+ }
return rc;
}
@@ -496,7 +510,7 @@ static u32 pager_pagehash(PgHdr *pPage){
#define CHECK_PAGE(x) checkPage(x)
static void checkPage(PgHdr *pPg){
Pager *pPager = pPg->pPager;
- assert( !pPg->pageHash || pPager->errMask || MEMDB || pPg->dirty ||
+ assert( !pPg->pageHash || pPager->errCode || MEMDB || pPg->dirty ||
pPg->pageHash==pager_pagehash(pPg) );
}
@@ -597,7 +611,7 @@ static int seekJournalHdr(Pager *pPager){
assert( offset>=c );
assert( (offset-c)<JOURNAL_HDR_SZ(pPager) );
pPager->journalOff = offset;
- return sqlite3OsSeek(&pPager->jfd, pPager->journalOff);
+ return sqlite3OsSeek(pPager->jfd, pPager->journalOff);
}
/*
@@ -615,6 +629,7 @@ static int seekJournalHdr(Pager *pPager){
** Followed by (JOURNAL_HDR_SZ - 24) bytes of unused space.
*/
static int writeJournalHdr(Pager *pPager){
+ char zHeader[sizeof(aJournalMagic)+16];
int rc = seekJournalHdr(pPager);
if( rc ) return rc;
@@ -633,33 +648,25 @@ static int writeJournalHdr(Pager *pPager){
** 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);
- }
+ memcpy(zHeader, aJournalMagic, sizeof(aJournalMagic));
+ /* The nRec Field. 0xFFFFFFFF for no-sync journals. */
+ put32bits(&zHeader[sizeof(aJournalMagic)], pPager->noSync ? 0xffffffff : 0);
+ /* The random check-hash initialiser */
+ sqlite3Randomness(sizeof(pPager->cksumInit), &pPager->cksumInit);
+ put32bits(&zHeader[sizeof(aJournalMagic)+4], pPager->cksumInit);
+ /* The initial database size */
+ put32bits(&zHeader[sizeof(aJournalMagic)+8], pPager->dbSize);
+ /* The assumed sector size for this process */
+ put32bits(&zHeader[sizeof(aJournalMagic)+12], pPager->sectorSize);
+ rc = sqlite3OsWrite(pPager->jfd, zHeader, sizeof(zHeader));
/* 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);
+ rc = sqlite3OsSeek(pPager->jfd, pPager->journalOff-1);
if( rc==SQLITE_OK ){
- rc = sqlite3OsWrite(&pPager->jfd, "\000", 1);
+ rc = sqlite3OsWrite(pPager->jfd, "\000", 1);
}
}
return rc;
@@ -697,20 +704,20 @@ static int readJournalHdr(
return SQLITE_DONE;
}
- rc = sqlite3OsRead(&pPager->jfd, aMagic, sizeof(aMagic));
+ 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);
+ rc = read32bits(pPager->jfd, pNRec);
if( rc ) return rc;
- rc = read32bits(&pPager->jfd, &pPager->cksumInit);
+ rc = read32bits(pPager->jfd, &pPager->cksumInit);
if( rc ) return rc;
- rc = read32bits(&pPager->jfd, pDbSize);
+ rc = read32bits(pPager->jfd, pDbSize);
if( rc ) return rc;
/* Update the assumed sector-size to match the value used by
@@ -719,11 +726,11 @@ static int readJournalHdr(
** 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);
+ rc = read32bits(pPager->jfd, (u32 *)&pPager->sectorSize);
if( rc ) return rc;
pPager->journalOff += JOURNAL_HDR_SZ(pPager);
- rc = sqlite3OsSeek(&pPager->jfd, pPager->journalOff);
+ rc = sqlite3OsSeek(pPager->jfd, pPager->journalOff);
return rc;
}
@@ -743,12 +750,16 @@ static int readJournalHdr(
**
** The master journal page checksum is the sum of the bytes in the master
** journal name.
+**
+** If zMaster is a NULL pointer (occurs for a single database transaction),
+** this call is a no-op.
*/
static int writeMasterJournal(Pager *pPager, const char *zMaster){
int rc;
int len;
int i;
- u32 cksum = 0;
+ u32 cksum = 0;
+ char zBuf[sizeof(aJournalMagic)+2*4];
if( !zMaster || pPager->setMaster) return SQLITE_OK;
pPager->setMaster = 1;
@@ -768,19 +779,16 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){
}
pPager->journalOff += (len+20);
- rc = write32bits(&pPager->jfd, PAGER_MJ_PGNO(pPager));
+ rc = write32bits(pPager->jfd, PAGER_MJ_PGNO(pPager));
if( rc!=SQLITE_OK ) return rc;
- rc = sqlite3OsWrite(&pPager->jfd, zMaster, len);
+ 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));
+ put32bits(zBuf, len);
+ put32bits(&zBuf[4], cksum);
+ memcpy(&zBuf[8], aJournalMagic, sizeof(aJournalMagic));
+ rc = sqlite3OsWrite(pPager->jfd, zBuf, 8+sizeof(aJournalMagic));
pPager->needSync = !pPager->noSync;
return rc;
}
@@ -829,7 +837,9 @@ static void page_remove_from_stmt_list(PgHdr *pPg){
** 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)];
+ PgHdr *p;
+ if( pPager->aHash==0 ) return 0;
+ p = pPager->aHash[pgno & (pPager->nHash-1)];
while( p && p->pgno!=pgno ){
p = p->pNextHash;
}
@@ -844,7 +854,7 @@ static PgHdr *pager_lookup(Pager *pPager, Pgno pgno){
*/
static void pager_reset(Pager *pPager){
PgHdr *pPg, *pNext;
- if( pPager->errMask ) return;
+ if( pPager->errCode ) return;
for(pPg=pPager->pAll; pPg; pPg=pNext){
pNext = pPg->pNextAll;
sqliteFree(pPg);
@@ -853,12 +863,14 @@ static void pager_reset(Pager *pPager){
pPager->pFirstSynced = 0;
pPager->pLast = 0;
pPager->pAll = 0;
- memset(pPager->aHash, 0, sizeof(pPager->aHash));
+ pPager->nHash = 0;
+ sqliteFree(pPager->aHash);
pPager->nPage = 0;
+ pPager->aHash = 0;
if( pPager->state>=PAGER_RESERVED ){
sqlite3pager_rollback(pPager);
}
- sqlite3OsUnlock(&pPager->fd, NO_LOCK);
+ sqlite3OsUnlock(pPager->fd, NO_LOCK);
pPager->state = PAGER_UNLOCK;
pPager->dbSize = -1;
pPager->nRef = 0;
@@ -866,29 +878,6 @@ static void pager_reset(Pager *pPager){
}
/*
-** 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
@@ -924,16 +913,19 @@ static int pager_unwritelock(Pager *pPager){
pPg->pageHash = pager_pagehash(pPg);
#endif
}
+ pPager->pDirty = 0;
pPager->dirtyCache = 0;
pPager->nRec = 0;
}else{
assert( pPager->aInJournal==0 );
assert( pPager->dirtyCache==0 || pPager->useJournal==0 );
}
- rc = sqlite3OsUnlock(&pPager->fd, SHARED_LOCK);
+ rc = sqlite3OsUnlock(pPager->fd, SHARED_LOCK);
pPager->state = PAGER_SHARED;
pPager->origDbSize = 0;
pPager->setMaster = 0;
+ pPager->needSync = 0;
+ pPager->pFirstSynced = pPager->pFirst;
return rc;
}
@@ -957,7 +949,7 @@ static int pager_unwritelock(Pager *pPager){
** 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){
+static u32 pager_cksum(Pager *pPager, const u8 *aData){
u32 cksum = pPager->cksumInit;
int i = pPager->pageSize-200;
while( i>0 ){
@@ -967,6 +959,9 @@ static u32 pager_cksum(Pager *pPager, Pgno pgno, const char *aData){
return cksum;
}
+/* Forward declaration */
+static void makeClean(PgHdr*);
+
/*
** Read a single page from the journal file opened on file descriptor
** jfd. Playback this one page.
@@ -985,7 +980,7 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
/* 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) );
+ assert( jfd == (useCksum ? pPager->jfd : pPager->stfd) );
rc = read32bits(jfd, &pgno);
@@ -1009,7 +1004,7 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
rc = read32bits(jfd, &cksum);
if( rc ) return rc;
pPager->journalOff += 4;
- if( pager_cksum(pPager, pgno, aData)!=cksum ){
+ if( pager_cksum(pPager, aData)!=cksum ){
return SQLITE_DONE;
}
}
@@ -1040,11 +1035,13 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
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);
+ rc = sqlite3OsSeek(pPager->fd, (pgno-1)*(i64)pPager->pageSize);
if( rc==SQLITE_OK ){
- rc = sqlite3OsWrite(&pPager->fd, aData, pPager->pageSize);
+ rc = sqlite3OsWrite(pPager->fd, aData, pPager->pageSize);
+ }
+ if( pPg ){
+ makeClean(pPg);
}
- if( pPg ) pPg->dirty = 0;
}
if( pPg ){
/* No page should ever be explicitly rolled back that is in use, except
@@ -1063,7 +1060,7 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
#ifdef SQLITE_CHECK_PAGES
pPg->pageHash = pager_pagehash(pPg);
#endif
- CODEC(pPager, pData, pPg->pgno, 3);
+ CODEC1(pPager, pData, pPg->pgno, 3);
}
return rc;
}
@@ -1082,18 +1079,17 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
static int pager_delmaster(const char *zMaster){
int rc;
int master_open = 0;
- OsFile master;
+ OsFile *master = 0;
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);
+ rc = sqlite3OsFileSize(master, &nMasterJournal);
if( rc!=SQLITE_OK ) goto delmaster_out;
if( nMasterJournal>0 ){
@@ -1108,7 +1104,7 @@ static int pager_delmaster(const char *zMaster){
rc = SQLITE_NOMEM;
goto delmaster_out;
}
- rc = sqlite3OsRead(&master, zMasterJournal, nMasterJournal);
+ rc = sqlite3OsRead(master, zMasterJournal, nMasterJournal);
if( rc!=SQLITE_OK ) goto delmaster_out;
zJournal = zMasterJournal;
@@ -1118,16 +1114,15 @@ static int pager_delmaster(const char *zMaster){
** Open it and check if it points at the master journal. If
** so, return without deleting the master journal file.
*/
- OsFile journal;
+ OsFile *journal = 0;
int c;
- memset(&journal, 0, sizeof(journal));
rc = sqlite3OsOpenReadOnly(zJournal, &journal);
if( rc!=SQLITE_OK ){
goto delmaster_out;
}
- rc = readMasterJournal(&journal, &zMasterPtr);
+ rc = readMasterJournal(journal, &zMasterPtr);
sqlite3OsClose(&journal);
if( rc!=SQLITE_OK ){
goto delmaster_out;
@@ -1172,13 +1167,13 @@ static int pager_reload_cache(Pager *pPager){
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));
+ rc = sqlite3OsSeek(pPager->fd, pPager->pageSize*(i64)(pPg->pgno-1));
if( rc==SQLITE_OK ){
- rc = sqlite3OsRead(&pPager->fd, zBuf, pPager->pageSize);
+ 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);
+ CODEC1(pPager, zBuf, pPg->pgno, 2);
}else{
memset(zBuf, 0, pPager->pageSize);
}
@@ -1196,6 +1191,7 @@ static int pager_reload_cache(Pager *pPager){
pPg->pageHash = pager_pagehash(pPg);
#endif
}
+ pPager->pDirty = 0;
return rc;
}
@@ -1205,7 +1201,7 @@ static int pager_reload_cache(Pager *pPager){
*/
static int pager_truncate(Pager *pPager, int nPage){
assert( pPager->state>=PAGER_EXCLUSIVE );
- return sqlite3OsTruncate(&pPager->fd, pPager->pageSize*(i64)nPage);
+ return sqlite3OsTruncate(pPager->fd, pPager->pageSize*(i64)nPage);
}
/*
@@ -1273,7 +1269,7 @@ static int pager_playback(Pager *pPager){
** the journal is empty.
*/
assert( pPager->journalOpen );
- rc = sqlite3OsFileSize(&pPager->jfd, &szJ);
+ rc = sqlite3OsFileSize(pPager->jfd, &szJ);
if( rc!=SQLITE_OK ){
goto end_playback;
}
@@ -1283,7 +1279,7 @@ static int pager_playback(Pager *pPager){
** present on disk, then the journal is not hot and does not need to be
** played back.
*/
- rc = readMasterJournal(&pPager->jfd, &zMaster);
+ rc = readMasterJournal(pPager->jfd, &zMaster);
assert( rc!=SQLITE_DONE );
if( rc!=SQLITE_OK || (zMaster && !sqlite3OsFileExists(zMaster)) ){
sqliteFree(zMaster);
@@ -1291,7 +1287,7 @@ static int pager_playback(Pager *pPager){
if( rc==SQLITE_DONE ) rc = SQLITE_OK;
goto end_playback;
}
- sqlite3OsSeek(&pPager->jfd, 0);
+ sqlite3OsSeek(pPager->jfd, 0);
pPager->journalOff = 0;
/* This loop terminates either when the readJournalHdr() call returns
@@ -1334,13 +1330,10 @@ static int pager_playback(Pager *pPager){
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);
+ rc = pager_playback_one_page(pPager, pPager->jfd, 1);
if( rc!=SQLITE_OK ){
if( rc==SQLITE_DONE ){
rc = SQLITE_OK;
@@ -1352,13 +1345,8 @@ static int pager_playback(Pager *pPager){
}
}
}
-
- /* 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);
+ /*NOTREACHED*/
+ assert( 0 );
end_playback:
if( rc==SQLITE_OK ){
@@ -1407,7 +1395,7 @@ static int pager_stmt_playback(Pager *pPager){
#ifndef NDEBUG
{
i64 os_szJ;
- rc = sqlite3OsFileSize(&pPager->jfd, &os_szJ);
+ rc = sqlite3OsFileSize(pPager->jfd, &os_szJ);
if( rc!=SQLITE_OK ) return rc;
assert( szJ==os_szJ );
}
@@ -1433,7 +1421,7 @@ static int pager_stmt_playback(Pager *pPager){
/* Figure out how many records are in the statement journal.
*/
assert( pPager->stmtInUse && pPager->journalOpen );
- sqlite3OsSeek(&pPager->stfd, 0);
+ sqlite3OsSeek(pPager->stfd, 0);
nRec = pPager->stmtNRec;
/* Copy original pages out of the statement journal and back into the
@@ -1442,7 +1430,7 @@ static int pager_stmt_playback(Pager *pPager){
** journals.
*/
for(i=nRec-1; i>=0; i--){
- rc = pager_playback_one_page(pPager, &pPager->stfd, 0);
+ rc = pager_playback_one_page(pPager, pPager->stfd, 0);
assert( rc!=SQLITE_DONE );
if( rc!=SQLITE_OK ) goto end_stmt_playback;
}
@@ -1455,7 +1443,7 @@ static int pager_stmt_playback(Pager *pPager){
** 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);
+ rc = sqlite3OsSeek(pPager->jfd, pPager->stmtJSize);
if( rc!=SQLITE_OK ){
goto end_stmt_playback;
}
@@ -1463,24 +1451,24 @@ static int pager_stmt_playback(Pager *pPager){
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);
+ 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 nJRec; /* Number of Journal Records */
u32 dummy;
- rc = readJournalHdr(pPager, szJ, &nRec, &dummy);
+ rc = readJournalHdr(pPager, szJ, &nJRec, &dummy);
if( rc!=SQLITE_OK ){
assert( rc!=SQLITE_DONE );
goto end_stmt_playback;
}
- if( nRec==0 ){
- nRec = (szJ - pPager->journalOff) / (pPager->pageSize+8);
+ if( nJRec==0 ){
+ nJRec = (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);
+ for(i=nJRec-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;
}
@@ -1489,10 +1477,7 @@ static int pager_stmt_playback(Pager *pPager){
pPager->journalOff = szJ;
end_stmt_playback:
- if( rc!=SQLITE_OK ){
- pPager->errMask |= PAGER_ERR_CORRUPT;
- rc = SQLITE_CORRUPT;
- }else{
+ if( rc==SQLITE_OK) {
pPager->journalOff = szJ;
/* pager_reload_cache(pPager); */
}
@@ -1537,9 +1522,10 @@ void sqlite3pager_set_cachesize(Pager *pPager, int mxPage){
** and FULL=3.
*/
#ifndef SQLITE_OMIT_PAGER_PRAGMAS
-void sqlite3pager_set_safety_level(Pager *pPager, int level){
+void sqlite3pager_set_safety_level(Pager *pPager, int level, int full_fsync){
pPager->noSync = level==1 || pPager->tempFile;
pPager->fullSync = level==3 && !pPager->tempFile;
+ pPager->full_fsync = full_fsync;
if( pPager->noSync ) pPager->needSync = 0;
}
#endif
@@ -1549,7 +1535,9 @@ void sqlite3pager_set_safety_level(Pager *pPager, int level){
** attempts to open a temporary file. This information is used for
** testing and analysis only.
*/
+#ifdef SQLITE_TEST
int sqlite3_opentemp_count = 0;
+#endif
/*
** Open a temporary file. Write the name of the file into zFile
@@ -1560,14 +1548,16 @@ int sqlite3_opentemp_count = 0;
** The OS will automatically delete the temporary file when it is
** closed.
*/
-static int sqlite3pager_opentemp(char *zFile, OsFile *fd){
+static int sqlite3pager_opentemp(char *zFile, OsFile **pFd){
int cnt = 8;
int rc;
+#ifdef SQLITE_TEST
sqlite3_opentemp_count++; /* Used for testing and analysis only */
+#endif
do{
cnt--;
sqlite3OsTempFileName(zFile);
- rc = sqlite3OsOpenExclusive(zFile, fd, 1);
+ rc = sqlite3OsOpenExclusive(zFile, pFd, 1);
}while( cnt>0 && rc!=SQLITE_OK && rc!=SQLITE_NOMEM );
return rc;
}
@@ -1592,10 +1582,10 @@ int sqlite3pager_open(
int nExtra, /* Extra bytes append to each in-memory page */
int flags /* flags controlling this file */
){
- Pager *pPager;
+ Pager *pPager = 0;
char *zFullPathname = 0;
- int nameLen;
- OsFile fd;
+ int nameLen; /* Compiler is wrong. This is always initialized before use */
+ OsFile *fd;
int rc = SQLITE_OK;
int i;
int tempFile = 0;
@@ -1604,18 +1594,36 @@ int sqlite3pager_open(
int useJournal = (flags & PAGER_OMIT_JOURNAL)==0;
int noReadlock = (flags & PAGER_NO_READLOCK)!=0;
char zTemp[SQLITE_TEMPNAME_SIZE];
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ /* A malloc() cannot fail in sqlite3ThreadData() as one or more calls to
+ ** malloc() must have already been made by this thread before it gets
+ ** to this point. This means the ThreadData must have been allocated already
+ ** so that ThreadData.nAlloc can be set. It would be nice to assert
+ ** that ThreadData.nAlloc is non-zero, but alas this breaks test cases
+ ** written to invoke the pager directly.
+ */
+ ThreadData *pTsd = sqlite3ThreadData();
+ assert( pTsd );
+#endif
+ /* If malloc() has already failed return SQLITE_NOMEM. Before even
+ ** testing for this, set *ppPager to NULL so the caller knows the pager
+ ** structure was never allocated.
+ */
*ppPager = 0;
- memset(&fd, 0, sizeof(fd));
- if( sqlite3_malloc_failed ){
+ if( sqlite3MallocFailed() ){
return SQLITE_NOMEM;
}
+ memset(&fd, 0, sizeof(fd));
+
+ /* Open the pager file and set zFullPathname to point at malloc()ed
+ ** memory containing the complete filename (i.e. including the directory).
+ */
if( zFilename && zFilename[0] ){
#ifndef SQLITE_OMIT_MEMORYDB
if( strcmp(zFilename,":memory:")==0 ){
memDb = 1;
zFullPathname = sqliteStrDup("");
- rc = SQLITE_OK;
}else
#endif
{
@@ -1632,66 +1640,75 @@ int sqlite3pager_open(
tempFile = 1;
}
}
- if( !zFullPathname ){
- sqlite3OsClose(&fd);
- return SQLITE_NOMEM;
- }
- if( rc!=SQLITE_OK ){
- sqlite3OsClose(&fd);
- sqliteFree(zFullPathname);
- return rc;
+
+ /* Allocate the Pager structure. As part of the same allocation, allocate
+ ** space for the full paths of the file, directory and journal
+ ** (Pager.zFilename, Pager.zDirectory and Pager.zJournal).
+ */
+ if( zFullPathname ){
+ nameLen = strlen(zFullPathname);
+ pPager = sqliteMalloc( sizeof(*pPager) + nameLen*3 + 30 );
}
- nameLen = strlen(zFullPathname);
- pPager = sqliteMalloc( sizeof(*pPager) + nameLen*3 + 30 );
- if( pPager==0 ){
+
+ /* If an error occured in either of the blocks above, free the memory
+ ** pointed to by zFullPathname, free the Pager structure and close the
+ ** file. Since the pager is not allocated there is no need to set
+ ** any Pager.errMask variables.
+ */
+ if( !pPager || !zFullPathname || rc!=SQLITE_OK ){
sqlite3OsClose(&fd);
sqliteFree(zFullPathname);
- return SQLITE_NOMEM;
+ sqliteFree(pPager);
+ return ((rc==SQLITE_OK)?SQLITE_NOMEM:rc);
}
+
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->journalOpen = 0; */
pPager->useJournal = useJournal && !memDb;
pPager->noReadlock = noReadlock && readOnly;
- pPager->stmtOpen = 0;
- pPager->stmtInUse = 0;
- pPager->nRef = 0;
+ /* 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->stmtSize = 0; */
+ /* pPager->stmtJSize = 0; */
+ /* pPager->nPage = 0; */
+ /* pPager->nMaxPage = 0; */
pPager->mxPage = 100;
- pPager->state = PAGER_UNLOCK;
- pPager->errMask = 0;
+ assert( PAGER_UNLOCK==0 );
+ /* pPager->state = PAGER_UNLOCK; */
+ /* pPager->errMask = 0; */
pPager->tempFile = tempFile;
pPager->memDb = memDb;
pPager->readOnly = readOnly;
- pPager->needSync = 0;
+ /* pPager->needSync = 0; */
pPager->noSync = pPager->tempFile || !useJournal;
pPager->fullSync = (pPager->noSync?0:1);
- pPager->pFirst = 0;
- pPager->pFirstSynced = 0;
- pPager->pLast = 0;
+ /* 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));
+ /* pPager->pBusyHandler = 0; */
+ /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */
*ppPager = pPager;
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ pPager->pNext = pTsd->pPager;
+ pTsd->pPager = pPager;
+#endif
return SQLITE_OK;
}
@@ -1739,14 +1756,50 @@ int sqlite3pager_set_pagesize(Pager *pPager, int pageSize){
}
/*
+** The following set of routines are used to disable the simulated
+** I/O error mechanism. These routines are used to avoid simulated
+** errors in places where we do not care about errors.
+**
+** Unless -DSQLITE_TEST=1 is used, these routines are all no-ops
+** and generate no code.
+*/
+#ifdef SQLITE_TEST
+extern int sqlite3_io_error_pending;
+extern int sqlite3_io_error_hit;
+static int saved_cnt;
+void clear_simulated_io_error(){
+ sqlite3_io_error_hit = 0;
+}
+void disable_simulated_io_errors(void){
+ saved_cnt = sqlite3_io_error_pending;
+ sqlite3_io_error_pending = -1;
+}
+void enable_simulated_io_errors(void){
+ sqlite3_io_error_pending = saved_cnt;
+}
+#else
+# define clear_simulated_io_error()
+# define disable_simulated_io_errors()
+# define enable_simulated_io_errors()
+#endif
+
+/*
** Read the first N bytes from the beginning of the file into memory
-** that pDest points to. No error checking is done.
+** that pDest points to.
+**
+** No error checking is done. The rational for this is that this function
+** may be called even if the file does not exist or contain a header. In
+** these cases sqlite3OsRead() will return an error, to which the correct
+** response is to zero the memory at pDest and continue. A real IO error
+** will presumably recur and be picked up later (Todo: Think about this).
*/
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);
+ disable_simulated_io_errors();
+ sqlite3OsSeek(pPager->fd, 0);
+ sqlite3OsRead(pPager->fd, pDest, N);
+ enable_simulated_io_errors();
}
}
@@ -1765,8 +1818,8 @@ int sqlite3pager_pagecount(Pager *pPager){
if( pPager->dbSize>=0 ){
n = pPager->dbSize;
} else {
- if( sqlite3OsFileSize(&pPager->fd, &n)!=SQLITE_OK ){
- pPager->errMask |= PAGER_ERR_DISK;
+ if( sqlite3OsFileSize(pPager->fd, &n)!=SQLITE_OK ){
+ pager_error(pPager, SQLITE_IOERR);
return 0;
}
if( n>0 && n<pPager->pageSize ){
@@ -1784,12 +1837,26 @@ int sqlite3pager_pagecount(Pager *pPager){
return n;
}
+
+#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
+
/*
** 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
@@ -1798,21 +1865,22 @@ static int syncJournal(Pager*);
*/
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. */
+ assert( pPg->pNextHash==0 && pPg->pPrevHash==0 );
return;
}
if( pPg->pNextHash ){
pPg->pNextHash->pPrevHash = pPg->pPrevHash;
}
if( pPg->pPrevHash ){
- assert( pPager->aHash[pager_hash(pPg->pgno)]!=pPg );
+ assert( pPager->aHash[pPg->pgno & (pPager->nHash-1)]!=pPg );
pPg->pPrevHash->pNextHash = pPg->pNextHash;
}else{
- int h = pager_hash(pPg->pgno);
- assert( pPager->aHash[h]==pPg );
+ int h = pPg->pgno & (pPager->nHash-1);
pPager->aHash[h] = pPg->pNextHash;
}
-
+ if( MEMDB ){
+ clearHistory(PGHDR_TO_HIST(pPg, pPager));
+ }
pPg->pgno = 0;
pPg->pNextHash = pPg->pPrevHash = 0;
}
@@ -1871,6 +1939,7 @@ static void memoryTruncate(Pager *pPager){
}else{
*ppPg = pPg->pNextAll;
unlinkPage(pPg);
+ makeClean(pPg);
sqliteFree(pPg);
pPager->nPage--;
}
@@ -1897,7 +1966,7 @@ static int pager_wait_on_lock(Pager *pPager, int locktype){
rc = SQLITE_OK;
}else{
do {
- rc = sqlite3OsLock(&pPager->fd, locktype);
+ rc = sqlite3OsLock(pPager->fd, locktype);
}while( rc==SQLITE_BUSY && sqlite3InvokeBusyHandler(pPager->pBusyHandler) );
if( rc==SQLITE_OK ){
pPager->state = locktype;
@@ -1912,8 +1981,8 @@ static int pager_wait_on_lock(Pager *pPager, int locktype){
int sqlite3pager_truncate(Pager *pPager, Pgno nPage){
int rc;
sqlite3pager_pagecount(pPager);
- if( pPager->errMask!=0 ){
- rc = pager_errcode(pPager);
+ if( pPager->errCode ){
+ rc = pPager->errCode;
return rc;
}
if( nPage>=(unsigned)pPager->dbSize ){
@@ -1950,9 +2019,25 @@ int sqlite3pager_truncate(Pager *pPager, Pgno nPage){
** 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.
+**
+** This function always succeeds. If a transaction is active an attempt
+** is made to roll it back. If an error occurs during the rollback
+** a hot journal may be left in the filesystem but no error is returned
+** to the caller.
*/
int sqlite3pager_close(Pager *pPager){
PgHdr *pPg, *pNext;
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ /* A malloc() cannot fail in sqlite3ThreadData() as one or more calls to
+ ** malloc() must have already been made by this thread before it gets
+ ** to this point. This means the ThreadData must have been allocated already
+ ** so that ThreadData.nAlloc can be set.
+ */
+ ThreadData *pTsd = sqlite3ThreadData();
+ assert( pPager );
+ assert( pTsd && pTsd->nAlloc );
+#endif
+
switch( pPager->state ){
case PAGER_RESERVED:
case PAGER_SYNCED:
@@ -1961,24 +2046,18 @@ int sqlite3pager_close(Pager *pPager){
** 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
+ disable_simulated_io_errors();
sqlite3pager_rollback(pPager);
-#if defined(SQLITE_TEST) && (defined(OS_UNIX) || defined(OS_WIN))
- sqlite3_io_error_pending = ioerr_cnt;
-#endif
+ enable_simulated_io_errors();
if( !MEMDB ){
- sqlite3OsUnlock(&pPager->fd, NO_LOCK);
+ sqlite3OsUnlock(pPager->fd, NO_LOCK);
}
- assert( pPager->errMask || pPager->journalOpen==0 );
+ assert( pPager->errCode || pPager->journalOpen==0 );
break;
}
case PAGER_SHARED: {
if( !MEMDB ){
- sqlite3OsUnlock(&pPager->fd, NO_LOCK);
+ sqlite3OsUnlock(pPager->fd, NO_LOCK);
}
break;
}
@@ -2000,7 +2079,7 @@ int sqlite3pager_close(Pager *pPager){
sqliteFree(pPg);
}
TRACE2("CLOSE %d\n", PAGERID(pPager));
- assert( pPager->errMask || (pPager->journalOpen==0 && pPager->stmtOpen==0) );
+ assert( pPager->errCode || (pPager->journalOpen==0 && pPager->stmtOpen==0) );
if( pPager->journalOpen ){
sqlite3OsClose(&pPager->jfd);
}
@@ -2015,6 +2094,19 @@ int sqlite3pager_close(Pager *pPager){
** }
*/
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ /* Remove the pager from the linked list of pagers starting at
+ ** ThreadData.pPager if memory-management is enabled.
+ */
+ if( pPager==pTsd->pPager ){
+ pTsd->pPager = pPager->pNext;
+ }else{
+ Pager *pTmp;
+ for(pTmp = pTsd->pPager; pTmp->pNext!=pPager; pTmp=pTmp->pNext){}
+ pTmp->pNext = pPager->pNext;
+ }
+#endif
+ sqliteFree(pPager->aHash);
sqliteFree(pPager);
return SQLITE_OK;
}
@@ -2120,7 +2212,7 @@ static int syncJournal(Pager *pPager){
** with the nRec computed from the size of the journal file.
*/
i64 jSz;
- rc = sqlite3OsFileSize(&pPager->jfd, &jSz);
+ rc = sqlite3OsFileSize(pPager->jfd, &jSz);
if( rc!=0 ) return rc;
assert( pPager->journalOff==jSz );
}
@@ -2133,20 +2225,20 @@ static int syncJournal(Pager *pPager){
*/
if( pPager->fullSync ){
TRACE2("SYNC journal of %d\n", PAGERID(pPager));
- rc = sqlite3OsSync(&pPager->jfd, 0);
+ rc = sqlite3OsSync(pPager->jfd, 0);
if( rc!=0 ) return rc;
}
- rc = sqlite3OsSeek(&pPager->jfd,
+ rc = sqlite3OsSeek(pPager->jfd,
pPager->journalHdr + sizeof(aJournalMagic));
if( rc ) return rc;
- rc = write32bits(&pPager->jfd, pPager->nRec);
+ rc = write32bits(pPager->jfd, pPager->nRec);
if( rc ) return rc;
- rc = sqlite3OsSeek(&pPager->jfd, pPager->journalOff);
+ rc = sqlite3OsSeek(pPager->jfd, pPager->journalOff);
if( rc ) return rc;
}
TRACE2("SYNC journal of %d\n", PAGERID(pPager));
- rc = sqlite3OsSync(&pPager->jfd, pPager->fullSync);
+ rc = sqlite3OsSync(pPager->jfd, pPager->full_fsync);
if( rc!=0 ) return rc;
pPager->journalStarted = 1;
}
@@ -2177,6 +2269,68 @@ static int syncJournal(Pager *pPager){
}
/*
+** Merge two lists of pages connected by pDirty and in pgno order.
+** Do not both fixing the pPrevDirty pointers.
+*/
+static PgHdr *merge_pagelist(PgHdr *pA, PgHdr *pB){
+ PgHdr result, *pTail;
+ pTail = &result;
+ while( pA && pB ){
+ if( pA->pgno<pB->pgno ){
+ pTail->pDirty = pA;
+ pTail = pA;
+ pA = pA->pDirty;
+ }else{
+ pTail->pDirty = pB;
+ pTail = pB;
+ pB = pB->pDirty;
+ }
+ }
+ if( pA ){
+ pTail->pDirty = pA;
+ }else if( pB ){
+ pTail->pDirty = pB;
+ }else{
+ pTail->pDirty = 0;
+ }
+ return result.pDirty;
+}
+
+/*
+** Sort the list of pages in accending order by pgno. Pages are
+** connected by pDirty pointers. The pPrevDirty pointers are
+** corrupted by this sort.
+*/
+#define N_SORT_BUCKET 25
+static PgHdr *sort_pagelist(PgHdr *pIn){
+ PgHdr *a[N_SORT_BUCKET], *p;
+ int i;
+ memset(a, 0, sizeof(a));
+ while( pIn ){
+ p = pIn;
+ pIn = p->pDirty;
+ p->pDirty = 0;
+ for(i=0; i<N_SORT_BUCKET-1; i++){
+ if( a[i]==0 ){
+ a[i] = p;
+ break;
+ }else{
+ p = merge_pagelist(a[i], p);
+ a[i] = 0;
+ }
+ }
+ if( i==N_SORT_BUCKET-1 ){
+ a[i] = merge_pagelist(a[i], p);
+ }
+ }
+ p = a[0];
+ for(i=1; i<N_SORT_BUCKET; i++){
+ p = merge_pagelist(p, a[i]);
+ }
+ return p;
+}
+
+/*
** 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.
@@ -2209,9 +2363,10 @@ static int pager_write_pagelist(PgHdr *pList){
return rc;
}
+ pList = sort_pagelist(pList);
while( pList ){
assert( pList->dirty );
- rc = sqlite3OsSeek(&pPager->fd, (pList->pgno-1)*(i64)pPager->pageSize);
+ 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
@@ -2219,10 +2374,9 @@ static int pager_write_pagelist(PgHdr *pList){
** any such pages to the file.
*/
if( pList->pgno<=pPager->dbSize ){
- CODEC(pPager, PGHDR_TO_DATA(pList), pList->pgno, 6);
+ char *pData = CODEC2(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);
+ rc = sqlite3OsWrite(pPager->fd, pData, pPager->pageSize);
TEST_INCR(pPager->nWrite);
}
#ifndef NDEBUG
@@ -2246,15 +2400,7 @@ static int pager_write_pagelist(PgHdr *pList){
** 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 pPager->pDirty;
}
/*
@@ -2268,7 +2414,7 @@ static PgHdr *pager_get_all_dirty_pages(Pager *pPager){
static int hasHotJournal(Pager *pPager){
if( !pPager->useJournal ) return 0;
if( !sqlite3OsFileExists(pPager->zJournal) ) return 0;
- if( sqlite3OsCheckReservedLock(&pPager->fd) ) return 0;
+ if( sqlite3OsCheckReservedLock(pPager->fd) ) return 0;
if( sqlite3pager_pagecount(pPager)==0 ){
sqlite3OsDelete(pPager->zJournal);
return 0;
@@ -2278,6 +2424,172 @@ static int hasHotJournal(Pager *pPager){
}
/*
+** Try to find a page in the cache that can be recycled.
+**
+** This routine may return SQLITE_IOERR, SQLITE_FULL or SQLITE_OK. It
+** does not set the pPager->errCode variable.
+*/
+static int pager_recycle(Pager *pPager, int syncOk, PgHdr **ppPg){
+ PgHdr *pPg;
+ *ppPg = 0;
+
+ /* 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 && pPager->pFirst && syncOk && !MEMDB){
+ int rc = syncJournal(pPager);
+ if( rc!=0 ){
+ return rc;
+ }
+ 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 ){
+ return rc;
+ }
+ }
+ pPg = pPager->pFirst;
+ }
+ if( pPg==0 ){
+ return SQLITE_OK;
+ }
+
+ assert( pPg->nRef==0 );
+
+ /* Write the page to the database file if it is dirty.
+ */
+ if( pPg->dirty ){
+ int rc;
+ assert( pPg->needSync==0 );
+ makeClean(pPg);
+ pPg->dirty = 1;
+ pPg->pDirty = 0;
+ rc = pager_write_pagelist( pPg );
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ }
+ 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);
+
+ *ppPg = pPg;
+ return SQLITE_OK;
+}
+
+/*
+** This function is called to free superfluous dynamically allocated memory
+** held by the pager system. Memory in use by any SQLite pager allocated
+** by the current thread may be sqliteFree()ed.
+**
+** nReq is the number of bytes of memory required. Once this much has
+** been released, the function returns. A negative value for nReq means
+** free as much memory as possible. The return value is the total number
+** of bytes of memory released.
+*/
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+int sqlite3pager_release_memory(int nReq){
+ const ThreadData *pTsdro = sqlite3ThreadDataReadOnly();
+ Pager *p;
+ int nReleased = 0;
+ int i;
+
+ /* If the the global mutex is held, this subroutine becomes a
+ ** o-op; zero bytes of memory are freed. This is because
+ ** some of the code invoked by this function may also
+ ** try to obtain the mutex, resulting in a deadlock.
+ */
+ if( sqlite3OsInMutex(0) ){
+ return 0;
+ }
+
+ /* Outermost loop runs for at most two iterations. First iteration we
+ ** try to find memory that can be released without calling fsync(). Second
+ ** iteration (which only runs if the first failed to free nReq bytes of
+ ** memory) is permitted to call fsync(). This is of course much more
+ ** expensive.
+ */
+ for(i=0; i<=1; i++){
+
+ /* Loop through all the SQLite pagers opened by the current thread. */
+ for(p=pTsdro->pPager; p && (nReq<0 || nReleased<nReq); p=p->pNext){
+ PgHdr *pPg;
+ int rc;
+
+ /* For each pager, try to free as many pages as possible (without
+ ** calling fsync() if this is the first iteration of the outermost
+ ** loop).
+ */
+ while( SQLITE_OK==(rc = pager_recycle(p, i, &pPg)) && pPg) {
+ /* We've found a page to free. At this point the page has been
+ ** removed from the page hash-table, free-list and synced-list
+ ** (pFirstSynced). It is still in the all pages (pAll) list.
+ ** Remove it from this list before freeing.
+ **
+ ** Todo: Check the Pager.pStmt list to make sure this is Ok. It
+ ** probably is though.
+ */
+ PgHdr *pTmp;
+ assert( pPg );
+ page_remove_from_stmt_list(pPg);
+ if( pPg==p->pAll ){
+ p->pAll = pPg->pNextAll;
+ }else{
+ for( pTmp=p->pAll; pTmp->pNextAll!=pPg; pTmp=pTmp->pNextAll ){}
+ pTmp->pNextAll = pPg->pNextAll;
+ }
+ nReleased += sqliteAllocSize(pPg);
+ sqliteFree(pPg);
+ }
+
+ if( rc!=SQLITE_OK ){
+ /* An error occured whilst writing to the database file or
+ ** journal in pager_recycle(). The error is not returned to the
+ ** caller of this function. Instead, set the Pager.errCode variable.
+ ** The error will be returned to the user (or users, in the case
+ ** of a shared pager cache) of the pager for which the error occured.
+ */
+ assert( rc==SQLITE_IOERR || rc==SQLITE_FULL );
+ assert( p->state>=PAGER_RESERVED );
+ pager_error(p, rc);
+ }
+ }
+ }
+
+ return nReleased;
+}
+#endif /* SQLITE_ENABLE_MEMORY_MANAGEMENT */
+
+/*
** Acquire a page.
**
** A read lock on the disk file is obtained when the first page is acquired.
@@ -2315,8 +2627,8 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
*/
assert( pPager!=0 );
*ppPage = 0;
- if( pPager->errMask & ~(PAGER_ERR_FULL) ){
- return pager_errcode(pPager);
+ if( pPager->errCode && pPager->errCode!=SQLITE_FULL ){
+ return pPager->errCode;
}
/* If this is the first page accessed, then get a SHARED lock
@@ -2326,7 +2638,7 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
if( !pPager->noReadlock ){
rc = pager_wait_on_lock(pPager, SHARED_LOCK);
if( rc!=SQLITE_OK ){
- return rc;
+ return pager_error(pPager, rc);
}
}
@@ -2334,8 +2646,6 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
** 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
@@ -2347,11 +2657,11 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
** 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);
+ rc = sqlite3OsLock(pPager->fd, EXCLUSIVE_LOCK);
if( rc!=SQLITE_OK ){
- sqlite3OsUnlock(&pPager->fd, NO_LOCK);
+ sqlite3OsUnlock(pPager->fd, NO_LOCK);
pPager->state = PAGER_UNLOCK;
- return rc;
+ return pager_error(pPager, rc);
}
pPager->state = PAGER_EXCLUSIVE;
@@ -2365,7 +2675,7 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
*/
rc = sqlite3OsOpenReadOnly(pPager->zJournal, &pPager->jfd);
if( rc!=SQLITE_OK ){
- sqlite3OsUnlock(&pPager->fd, NO_LOCK);
+ sqlite3OsUnlock(pPager->fd, NO_LOCK);
pPager->state = PAGER_UNLOCK;
return SQLITE_BUSY;
}
@@ -2380,7 +2690,7 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
*/
rc = pager_playback(pPager);
if( rc!=SQLITE_OK ){
- return rc;
+ return pager_error(pPager, rc);
}
}
pPg = 0;
@@ -2397,11 +2707,17 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
TEST_INCR(pPager->nMiss);
if( pPager->nPage<pPager->mxPage || pPager->pFirst==0 || MEMDB ){
/* Create a new page */
+ if( pPager->nPage>=pPager->nHash ){
+ pager_resize_hash_table(pPager,
+ pPager->nHash<256 ? 256 : pPager->nHash*2);
+ if( pPager->nHash==0 ){
+ return SQLITE_NOMEM;
+ }
+ }
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));
@@ -2417,70 +2733,11 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
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;
+ rc = pager_recycle(pPager, 1, &pPg);
+ if( rc!=SQLITE_OK ){
+ return rc;
}
-
- /* Unlink the old page from the free list and the hash table
- */
- unlinkPage(pPg);
- TEST_INCR(pPager->nOvfl);
+ assert(pPg) ;
}
pPg->pgno = pgno;
if( pPager->aInJournal && (int)pgno<=pPager->origDbSize ){
@@ -2498,49 +2755,62 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
}else{
page_remove_from_stmt_list(pPg);
}
- pPg->dirty = 0;
+ makeClean(pPg);
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 ){
+ if( pPager->errCode ){
sqlite3pager_unref(PGHDR_TO_DATA(pPg));
- rc = pager_errcode(pPager);
+ rc = pPager->errCode;
return rc;
}
- if( sqlite3pager_pagecount(pPager)<(int)pgno ){
+
+ /* Populate the page with data, either by reading from the database
+ ** file, or by setting the entire page to zero.
+ */
+ if( sqlite3pager_pagecount(pPager)<(int)pgno || MEMDB ){
memset(PGHDR_TO_DATA(pPg), 0, pPager->pageSize);
}else{
- int rc;
assert( MEMDB==0 );
- rc = sqlite3OsSeek(&pPager->fd, (pgno-1)*(i64)pPager->pageSize);
+ rc = sqlite3OsSeek(pPager->fd, (pgno-1)*(i64)pPager->pageSize);
if( rc==SQLITE_OK ){
- rc = sqlite3OsRead(&pPager->fd, PGHDR_TO_DATA(pPg), pPager->pageSize);
+ 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);
+ CODEC1(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 ){
+ int rc2 = sqlite3OsFileSize(pPager->fd, &fileSize);
+ if( rc2!=SQLITE_OK || fileSize>=pgno*pPager->pageSize ){
+ /* An IO error occured in one of the the sqlite3OsSeek() or
+ ** sqlite3OsRead() calls above. */
+ pPg->pgno = 0;
sqlite3pager_unref(PGHDR_TO_DATA(pPg));
return rc;
}else{
+ clear_simulated_io_error();
memset(PGHDR_TO_DATA(pPg), 0, pPager->pageSize);
}
}else{
TEST_INCR(pPager->nRead);
}
}
+
+ /* Link the page into the page hash table */
+ h = pgno & (pPager->nHash-1);
+ assert( pgno!=0 );
+ pPg->pNextHash = pPager->aHash[h];
+ pPager->aHash[h] = pPg;
+ if( pPg->pNextHash ){
+ assert( pPg->pNextHash->pPrevHash==0 );
+ pPg->pNextHash->pPrevHash = pPg;
+ }
+
#ifdef SQLITE_CHECK_PAGES
pPg->pageHash = pager_pagehash(pPg);
#endif
@@ -2569,7 +2839,7 @@ void *sqlite3pager_lookup(Pager *pPager, Pgno pgno){
assert( pPager!=0 );
assert( pgno!=0 );
- if( pPager->errMask & ~(PAGER_ERR_FULL) ){
+ if( pPager->errCode && pPager->errCode!=SQLITE_FULL ){
return 0;
}
pPg = pager_lookup(pPager, pgno);
@@ -2651,23 +2921,24 @@ static int pager_open_journal(Pager *pPager){
rc = SQLITE_NOMEM;
goto failed_to_open_journal;
}
- rc = sqlite3OsOpenExclusive(pPager->zJournal, &pPager->jfd,pPager->tempFile);
+ 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);
+ sqlite3OsSetFullSync(pPager->jfd, pPager->full_fsync);
+ sqlite3OsSetFullSync(pPager->fd, pPager->full_fsync);
+ sqlite3OsOpenDirectory(pPager->jfd, pPager->zDirectory);
pPager->journalOpen = 1;
pPager->journalStarted = 0;
pPager->needSync = 0;
pPager->alwaysRollback = 0;
pPager->nRec = 0;
- if( pPager->errMask!=0 ){
- rc = pager_errcode(pPager);
+ if( pPager->errCode ){
+ rc = pPager->errCode;
goto failed_to_open_journal;
}
pPager->origDbSize = pPager->dbSize;
@@ -2677,7 +2948,7 @@ static int pager_open_journal(Pager *pPager){
if( pPager->stmtAutoopen && rc==SQLITE_OK ){
rc = sqlite3pager_stmt_begin(pPager);
}
- if( rc!=SQLITE_OK ){
+ if( rc!=SQLITE_OK && rc!=SQLITE_NOMEM ){
rc = pager_unwritelock(pPager);
if( rc==SQLITE_OK ){
rc = SQLITE_FULL;
@@ -2688,8 +2959,17 @@ static int pager_open_journal(Pager *pPager){
failed_to_open_journal:
sqliteFree(pPager->aInJournal);
pPager->aInJournal = 0;
- sqlite3OsUnlock(&pPager->fd, NO_LOCK);
- pPager->state = PAGER_UNLOCK;
+ if( rc==SQLITE_NOMEM ){
+ /* If this was a malloc() failure, then we will not be closing the pager
+ ** file. So delete any journal file we may have just created. Otherwise,
+ ** the system will get confused, we have a read-lock on the file and a
+ ** mysterious journal has appeared in the filesystem.
+ */
+ sqlite3OsDelete(pPager->zJournal);
+ }else{
+ sqlite3OsUnlock(pPager->fd, NO_LOCK);
+ pPager->state = PAGER_UNLOCK;
+ }
return rc;
}
@@ -2732,7 +3012,7 @@ int sqlite3pager_begin(void *pData, int exFlag){
pPager->state = PAGER_EXCLUSIVE;
pPager->origDbSize = pPager->dbSize;
}else{
- rc = sqlite3OsLock(&pPager->fd, RESERVED_LOCK);
+ rc = sqlite3OsLock(pPager->fd, RESERVED_LOCK);
if( rc==SQLITE_OK ){
pPager->state = PAGER_RESERVED;
if( exFlag ){
@@ -2753,6 +3033,42 @@ int sqlite3pager_begin(void *pData, int exFlag){
}
/*
+** Make a page dirty. Set its dirty flag and add it to the dirty
+** page list.
+*/
+static void makeDirty(PgHdr *pPg){
+ if( pPg->dirty==0 ){
+ Pager *pPager = pPg->pPager;
+ pPg->dirty = 1;
+ pPg->pDirty = pPager->pDirty;
+ if( pPager->pDirty ){
+ pPager->pDirty->pPrevDirty = pPg;
+ }
+ pPg->pPrevDirty = 0;
+ pPager->pDirty = pPg;
+ }
+}
+
+/*
+** Make a page clean. Clear its dirty bit and remove it from the
+** dirty page list.
+*/
+static void makeClean(PgHdr *pPg){
+ if( pPg->dirty ){
+ pPg->dirty = 0;
+ if( pPg->pDirty ){
+ pPg->pDirty->pPrevDirty = pPg->pPrevDirty;
+ }
+ if( pPg->pPrevDirty ){
+ pPg->pPrevDirty->pDirty = pPg->pDirty;
+ }else{
+ pPg->pPager->pDirty = pPg->pDirty;
+ }
+ }
+}
+
+
+/*
** 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.
@@ -2776,8 +3092,8 @@ int sqlite3pager_write(void *pData){
/* Check for errors
*/
- if( pPager->errMask ){
- return pager_errcode(pPager);
+ if( pPager->errCode ){
+ return pPager->errCode;
}
if( pPager->readOnly ){
return SQLITE_PERM;
@@ -2790,7 +3106,7 @@ int sqlite3pager_write(void *pData){
/* Mark the page as dirty. If the page has already been written
** to the journal then we can return right away.
*/
- pPg->dirty = 1;
+ makeDirty(pPg);
if( pPg->inJournal && (pPg->inStmt || pPager->stmtInUse==0) ){
pPager->dirtyCache = 1;
}else{
@@ -2822,7 +3138,6 @@ int sqlite3pager_write(void *pData){
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);
@@ -2832,28 +3147,33 @@ int sqlite3pager_write(void *pData){
memcpy(pHist->pOrig, PGHDR_TO_DATA(pPg), pPager->pageSize);
}
}else{
- u32 cksum;
+ u32 cksum, saved;
+ char *pData2, *pEnd;
/* 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);
+ pData2 = CODEC2(pPager, pData, pPg->pgno, 7);
+ cksum = pager_cksum(pPager, (u8*)pData2);
+ pEnd = pData2 + pPager->pageSize;
+ pData2 -= 4;
+ saved = *(u32*)pEnd;
+ put32bits(pEnd, cksum);
szPg = pPager->pageSize+8;
- store32bits(pPg->pgno, pPg, -4);
- rc = sqlite3OsWrite(&pPager->jfd, &((char*)pData)[-4], szPg);
+ put32bits(pData2, pPg->pgno);
+ rc = sqlite3OsWrite(pPager->jfd, pData2, 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;
+ *(u32*)pEnd = saved;
+
+ /* An error has occured writing to the journal file. The
+ ** transaction will be rolled back by the layer above.
+ */
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);
@@ -2890,14 +3210,11 @@ int sqlite3pager_write(void *pData){
}
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);
+ char *pData2 = CODEC2(pPager, pData, pPg->pgno, 7)-4;
+ put32bits(pData2, pPg->pgno);
+ rc = sqlite3OsWrite(pPager->stfd, pData2, 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++;
@@ -2924,10 +3241,12 @@ int sqlite3pager_write(void *pData){
** to sqlite3pager_write(). In other words, return TRUE if it is ok
** to change the content of the page.
*/
+#ifndef NDEBUG
int sqlite3pager_iswriteable(void *pData){
PgHdr *pPg = DATA_TO_PGHDR(pData);
return pPg->dirty;
}
+#endif
#ifndef SQLITE_OMIT_VACUUM
/*
@@ -2980,8 +3299,9 @@ void sqlite3pager_dont_write(Pager *pPager, Pgno pgno){
if( MEMDB ) return;
pPg = pager_lookup(pPager, pgno);
+ assert( pPg!=0 ); /* We never call _dont_write unless the page is in mem */
pPg->alwaysRollback = 1;
- if( pPg && pPg->dirty && !pPager->stmtInUse ){
+ if( pPg->dirty && !pPager->stmtInUse ){
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.
@@ -2993,7 +3313,7 @@ void sqlite3pager_dont_write(Pager *pPager, Pgno pgno){
*/
}else{
TRACE3("DONT_WRITE page %d of %d\n", pgno, PAGERID(pPager));
- pPg->dirty = 0;
+ makeClean(pPg);
#ifdef SQLITE_CHECK_PAGES
pPg->pageHash = pager_pagehash(pPg);
#endif
@@ -3032,20 +3352,6 @@ void sqlite3pager_dont_rollback(void *pData){
}
-#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.
**
@@ -3057,16 +3363,8 @@ 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->errCode ){
+ return pPager->errCode;
}
if( pPager->state<PAGER_RESERVED ){
return SQLITE_ERROR;
@@ -3079,9 +3377,11 @@ int sqlite3pager_commit(Pager *pPager){
pPg->dirty = 0;
pPg->inJournal = 0;
pPg->inStmt = 0;
+ pPg->needSync = 0;
pPg->pPrevStmt = pPg->pNextStmt = 0;
pPg = pPg->pDirty;
}
+ pPager->pDirty = 0;
#ifndef NDEBUG
for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){
PgHistory *pHist = PGHDR_TO_HIST(pPg, pPager);
@@ -3104,17 +3404,10 @@ int sqlite3pager_commit(Pager *pPager){
}
assert( pPager->journalOpen );
rc = sqlite3pager_sync(pPager, 0, 0);
- if( rc!=SQLITE_OK ){
- goto commit_abort;
+ if( rc==SQLITE_OK ){
+ rc = pager_unwritelock(pPager);
+ pPager->dbSize = -1;
}
- 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;
}
@@ -3156,12 +3449,11 @@ int sqlite3pager_rollback(Pager *pPager){
p->inJournal = 0;
p->inStmt = 0;
p->pPrevStmt = p->pNextStmt = 0;
-
if( pPager->xReiniter ){
pPager->xReiniter(PGHDR_TO_DATA(p), pPager->pageSize);
}
-
}
+ pPager->pDirty = 0;
pPager->pStmt = 0;
pPager->dbSize = pPager->origDbSize;
memoryTruncate(pPager);
@@ -3176,11 +3468,11 @@ int sqlite3pager_rollback(Pager *pPager){
return rc;
}
- if( pPager->errMask!=0 && pPager->errMask!=PAGER_ERR_FULL ){
+ if( pPager->errCode && pPager->errCode!=SQLITE_FULL ){
if( pPager->state>=PAGER_EXCLUSIVE ){
pager_playback(pPager);
}
- return pager_errcode(pPager);
+ return pPager->errCode;
}
if( pPager->state==PAGER_RESERVED ){
int rc2;
@@ -3192,12 +3484,13 @@ int sqlite3pager_rollback(Pager *pPager){
}else{
rc = pager_playback(pPager);
}
- if( rc!=SQLITE_OK ){
- rc = SQLITE_CORRUPT_BKPT;
- pPager->errMask |= PAGER_ERR_CORRUPT;
- }
pPager->dbSize = -1;
- return rc;
+
+ /* If an error occurs during a ROLLBACK, we can no longer trust the pager
+ ** cache. So call pager_error() on the way out to make any error
+ ** persistent.
+ */
+ return pager_error(pPager, rc);
}
/*
@@ -3209,6 +3502,14 @@ int sqlite3pager_isreadonly(Pager *pPager){
}
/*
+** Return the number of references to the pager.
+*/
+int sqlite3pager_refcount(Pager *pPager){
+ return pPager->nRef;
+}
+
+#ifdef SQLITE_TEST
+/*
** This routine is used for testing and analysis only.
*/
int *sqlite3pager_stats(Pager *pPager){
@@ -3218,16 +3519,15 @@ int *sqlite3pager_stats(Pager *pPager){
a[2] = pPager->mxPage;
a[3] = pPager->dbSize;
a[4] = pPager->state;
- a[5] = pPager->errMask;
-#ifdef SQLITE_TEST
+ a[5] = pPager->errCode;
a[6] = pPager->nHit;
a[7] = pPager->nMiss;
a[8] = pPager->nOvfl;
a[9] = pPager->nRead;
a[10] = pPager->nWrite;
-#endif
return a;
}
+#endif
/*
** Set the statement rollback point.
@@ -3254,11 +3554,11 @@ int sqlite3pager_stmt_begin(Pager *pPager){
assert( pPager->journalOpen );
pPager->aInStmt = sqliteMalloc( pPager->dbSize/8 + 1 );
if( pPager->aInStmt==0 ){
- sqlite3OsLock(&pPager->fd, SHARED_LOCK);
+ /* sqlite3OsLock(pPager->fd, SHARED_LOCK); */
return SQLITE_NOMEM;
}
#ifndef NDEBUG
- rc = sqlite3OsFileSize(&pPager->jfd, &pPager->stmtJSize);
+ rc = sqlite3OsFileSize(pPager->jfd, &pPager->stmtJSize);
if( rc ) goto stmt_begin_failed;
assert( pPager->stmtJSize == pPager->journalOff );
#endif
@@ -3291,8 +3591,8 @@ int sqlite3pager_stmt_commit(Pager *pPager){
PgHdr *pPg, *pNext;
TRACE2("STMT-COMMIT %d\n", PAGERID(pPager));
if( !MEMDB ){
- sqlite3OsSeek(&pPager->stfd, 0);
- /* sqlite3OsTruncate(&pPager->stfd, 0); */
+ sqlite3OsSeek(pPager->stfd, 0);
+ /* sqlite3OsTruncate(pPager->stfd, 0); */
sqliteFree( pPager->aInStmt );
pPager->aInStmt = 0;
}
@@ -3380,7 +3680,7 @@ int sqlite3pager_nosync(Pager *pPager){
*/
void sqlite3pager_set_codec(
Pager *pPager,
- void (*xCodec)(void*,void*,Pgno,int),
+ void *(*xCodec)(void*,void*,Pgno,int),
void *pCodecArg
){
pPager->xCodec = xCodec;
@@ -3409,7 +3709,7 @@ static int pager_incr_changecounter(Pager *pPager){
/* Increment the value just read and write it back to byte 24. */
change_counter++;
- store32bits(change_counter, pPgHdr, 24);
+ put32bits(((char*)PGHDR_TO_DATA(pPgHdr))+24, change_counter);
/* Release the page reference. */
sqlite3pager_unref(pPage);
@@ -3495,10 +3795,12 @@ int sqlite3pager_sync(Pager *pPager, const char *zMaster, Pgno nTrunc){
/* Sync the database file. */
if( !pPager->noSync ){
- rc = sqlite3OsSync(&pPager->fd, 0);
+ rc = sqlite3OsSync(pPager->fd, 0);
}
pPager->state = PAGER_SYNCED;
+ }else if( MEMDB && nTrunc!=0 ){
+ rc = sqlite3pager_truncate(pPager, nTrunc);
}
sync_exit:
@@ -3553,7 +3855,7 @@ int sqlite3pager_movepage(Pager *pPager, void *pData, Pgno pgno){
if( pPgOld ){
assert( pPgOld->nRef==0 );
unlinkHashChain(pPager, pPgOld);
- pPgOld->dirty = 0;
+ makeClean(pPgOld);
if( pPgOld->needSync ){
assert( pPgOld->inJournal );
pPg->inJournal = 1;
@@ -3563,8 +3865,9 @@ int sqlite3pager_movepage(Pager *pPager, void *pData, Pgno pgno){
}
/* Change the page number for pPg and insert it into the new hash-chain. */
+ assert( pgno!=0 );
pPg->pgno = pgno;
- h = pager_hash(pgno);
+ h = pgno & (pPager->nHash-1);
if( pPager->aHash[h] ){
assert( pPager->aHash[h]->pPrevHash==0 );
pPager->aHash[h]->pPrevHash = pPg;
@@ -3573,7 +3876,7 @@ int sqlite3pager_movepage(Pager *pPager, void *pData, Pgno pgno){
pPager->aHash[h] = pPg;
pPg->pPrevHash = 0;
- pPg->dirty = 1;
+ makeDirty(pPg);
pPager->dirtyCache = 1;
if( needSyncPgno ){
@@ -3594,7 +3897,7 @@ int sqlite3pager_movepage(Pager *pPager, void *pData, Pgno pgno){
pPager->needSync = 1;
DATA_TO_PGHDR(pNeedSync)->needSync = 1;
DATA_TO_PGHDR(pNeedSync)->inJournal = 1;
- DATA_TO_PGHDR(pNeedSync)->dirty = 1;
+ makeDirty(DATA_TO_PGHDR(pNeedSync));
sqlite3pager_unref(pNeedSync);
}
@@ -3609,11 +3912,7 @@ int sqlite3pager_movepage(Pager *pPager, void *pData, Pgno pgno){
** PENDING_LOCK, or EXCLUSIVE_LOCK.
*/
int sqlite3pager_lockstate(Pager *pPager){
-#ifdef OS_TEST
- return pPager->fd->fd.locktype;
-#else
- return pPager->fd.locktype;
-#endif
+ return sqlite3OsLockState(pPager->fd);
}
#endif
diff --git a/ext/pdo_sqlite/sqlite/src/pager.h b/ext/pdo_sqlite/sqlite/src/pager.h
index feba78a7a..555e52a03 100644
--- a/ext/pdo_sqlite/sqlite/src/pager.h
+++ b/ext/pdo_sqlite/sqlite/src/pager.h
@@ -16,6 +16,9 @@
** @(#) $Id$
*/
+#ifndef _PAGER_H_
+#define _PAGER_H_
+
/*
** The default size of a database page.
*/
@@ -95,16 +98,18 @@ int sqlite3pager_stmt_commit(Pager*);
int sqlite3pager_stmt_rollback(Pager*);
void sqlite3pager_dont_rollback(void*);
void sqlite3pager_dont_write(Pager*, Pgno);
+int sqlite3pager_refcount(Pager*);
int *sqlite3pager_stats(Pager*);
-void sqlite3pager_set_safety_level(Pager*,int);
+void sqlite3pager_set_safety_level(Pager*,int,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*);
+void sqlite3pager_set_codec(Pager*,void*(*)(void*,void*,Pgno,int),void*);
int sqlite3pager_movepage(Pager*,void*,Pgno);
int sqlite3pager_reset(Pager*);
+int sqlite3pager_release_memory(int);
#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
int sqlite3pager_lockstate(Pager*);
@@ -114,3 +119,5 @@ int sqlite3pager_lockstate(Pager*);
void sqlite3pager_refdump(Pager*);
int pager3_refinfo_enable;
#endif
+
+#endif /* _PAGER_H_ */
diff --git a/ext/pdo_sqlite/sqlite/src/parse.c b/ext/pdo_sqlite/sqlite/src/parse.c
index 432a262fd..801bb7ca1 100644
--- a/ext/pdo_sqlite/sqlite/src/parse.c
+++ b/ext/pdo_sqlite/sqlite/src/parse.c
@@ -4,7 +4,7 @@
/* First off, code is include which follows the "include" declaration
** in the input file. */
#include <stdio.h>
-#line 51 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 56 "ext/pdo_sqlite/sqlite/src/parse.y"
#include "sqliteInt.h"
#include "parse.h"
@@ -23,7 +23,7 @@ struct LimitVal {
** GLOB, NOT LIKE, and NOT GLOB operators.
*/
struct LikeOp {
- Token operator; /* "like" or "glob" or "regexp" */
+ Token eOperator; /* "like" or "glob" or "regexp" */
int not; /* True if the NOT keyword is present */
};
@@ -93,25 +93,26 @@ struct AttachKey { int type; Token key; };
** defined, then do no error processing.
*/
#define YYCODETYPE unsigned char
-#define YYNOCODE 247
+#define YYNOCODE 248
#define YYACTIONTYPE unsigned short int
+#define YYWILDCARD 60
#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;
+ int yy46;
+ struct LikeOp yy72;
+ Expr* yy172;
+ ExprList* yy174;
+ Select* yy219;
+ struct LimitVal yy234;
+ TriggerStep* yy243;
+ struct TrigEvent yy370;
+ SrcList* yy373;
+ Expr * yy386;
+ struct {int value; int mask;} yy405;
+ Token yy410;
+ IdList* yy432;
+ int yy495;
} YYMINORTYPE;
#define YYSTACKDEPTH 100
#define sqlite3ParserARG_SDECL Parse *pParse;
@@ -119,9 +120,9 @@ typedef union {
#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 YYNRULE 309
+#define YYERRORSYMBOL 139
+#define YYERRSYMDT yy495
#define YYFALLBACK 1
#define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
@@ -175,487 +176,411 @@ typedef union {
** 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,
+ /* 0 */ 287, 67, 291, 69, 150, 168, 206, 431, 61, 61,
+ /* 10 */ 61, 61, 66, 63, 63, 63, 63, 64, 64, 65,
+ /* 20 */ 65, 65, 66, 441, 322, 164, 444, 450, 68, 63,
+ /* 30 */ 63, 63, 63, 64, 64, 65, 65, 65, 66, 64,
+ /* 40 */ 64, 65, 65, 65, 66, 60, 58, 295, 454, 455,
+ /* 50 */ 451, 451, 62, 62, 61, 61, 61, 61, 513, 63,
+ /* 60 */ 63, 63, 63, 64, 64, 65, 65, 65, 66, 287,
+ /* 70 */ 318, 67, 431, 69, 150, 79, 160, 114, 224, 314,
+ /* 80 */ 229, 315, 172, 249, 891, 120, 580, 515, 518, 2,
+ /* 90 */ 250, 566, 422, 35, 223, 444, 450, 528, 20, 57,
+ /* 100 */ 384, 381, 63, 63, 63, 63, 64, 64, 65, 65,
+ /* 110 */ 65, 66, 287, 473, 60, 58, 295, 454, 455, 451,
+ /* 120 */ 451, 62, 62, 61, 61, 61, 61, 389, 63, 63,
+ /* 130 */ 63, 63, 64, 64, 65, 65, 65, 66, 444, 450,
+ /* 140 */ 91, 311, 385, 480, 236, 383, 269, 204, 2, 83,
+ /* 150 */ 581, 384, 381, 470, 196, 439, 209, 60, 58, 295,
+ /* 160 */ 454, 455, 451, 451, 62, 62, 61, 61, 61, 61,
+ /* 170 */ 170, 63, 63, 63, 63, 64, 64, 65, 65, 65,
+ /* 180 */ 66, 287, 486, 439, 209, 132, 109, 270, 423, 443,
+ /* 190 */ 402, 281, 390, 391, 441, 517, 164, 318, 507, 67,
+ /* 200 */ 526, 69, 150, 562, 423, 143, 516, 444, 450, 145,
+ /* 210 */ 146, 578, 882, 373, 882, 511, 171, 156, 514, 422,
+ /* 220 */ 40, 337, 426, 19, 287, 140, 60, 58, 295, 454,
+ /* 230 */ 455, 451, 451, 62, 62, 61, 61, 61, 61, 380,
+ /* 240 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66,
+ /* 250 */ 444, 450, 575, 404, 405, 428, 428, 428, 329, 332,
+ /* 260 */ 240, 545, 67, 468, 69, 150, 271, 287, 291, 60,
+ /* 270 */ 58, 295, 454, 455, 451, 451, 62, 62, 61, 61,
+ /* 280 */ 61, 61, 124, 63, 63, 63, 63, 64, 64, 65,
+ /* 290 */ 65, 65, 66, 444, 450, 401, 510, 389, 290, 544,
+ /* 300 */ 65, 65, 65, 66, 507, 389, 542, 405, 443, 294,
+ /* 310 */ 434, 435, 60, 58, 295, 454, 455, 451, 451, 62,
+ /* 320 */ 62, 61, 61, 61, 61, 206, 63, 63, 63, 63,
+ /* 330 */ 64, 64, 65, 65, 65, 66, 519, 514, 366, 287,
+ /* 340 */ 75, 426, 148, 490, 224, 314, 229, 315, 172, 249,
+ /* 350 */ 367, 265, 264, 1, 574, 286, 250, 389, 416, 445,
+ /* 360 */ 446, 206, 390, 391, 177, 444, 450, 340, 343, 344,
+ /* 370 */ 390, 391, 208, 357, 428, 428, 428, 360, 168, 345,
+ /* 380 */ 431, 448, 449, 78, 60, 58, 295, 454, 455, 451,
+ /* 390 */ 451, 62, 62, 61, 61, 61, 61, 476, 63, 63,
+ /* 400 */ 63, 63, 64, 64, 65, 65, 65, 66, 287, 447,
+ /* 410 */ 177, 561, 493, 340, 343, 344, 21, 318, 518, 318,
+ /* 420 */ 431, 318, 390, 391, 318, 345, 475, 400, 20, 563,
+ /* 430 */ 564, 489, 151, 177, 444, 450, 340, 343, 344, 422,
+ /* 440 */ 34, 422, 34, 422, 34, 431, 422, 34, 345, 192,
+ /* 450 */ 237, 147, 527, 60, 58, 295, 454, 455, 451, 451,
+ /* 460 */ 62, 62, 61, 61, 61, 61, 423, 63, 63, 63,
+ /* 470 */ 63, 64, 64, 65, 65, 65, 66, 287, 230, 348,
+ /* 480 */ 408, 512, 298, 423, 334, 431, 318, 206, 318, 296,
+ /* 490 */ 318, 208, 409, 154, 465, 9, 465, 458, 464, 389,
+ /* 500 */ 374, 465, 173, 444, 450, 410, 173, 406, 422, 40,
+ /* 510 */ 422, 48, 422, 48, 321, 434, 435, 407, 324, 475,
+ /* 520 */ 457, 457, 60, 58, 295, 454, 455, 451, 451, 62,
+ /* 530 */ 62, 61, 61, 61, 61, 459, 63, 63, 63, 63,
+ /* 540 */ 64, 64, 65, 65, 65, 66, 287, 318, 499, 238,
+ /* 550 */ 253, 480, 389, 338, 408, 149, 421, 306, 289, 307,
+ /* 560 */ 420, 389, 289, 389, 390, 391, 409, 250, 500, 422,
+ /* 570 */ 27, 155, 444, 450, 431, 422, 3, 208, 539, 410,
+ /* 580 */ 335, 328, 578, 881, 324, 881, 457, 457, 484, 423,
+ /* 590 */ 242, 60, 58, 295, 454, 455, 451, 451, 62, 62,
+ /* 600 */ 61, 61, 61, 61, 255, 63, 63, 63, 63, 64,
+ /* 610 */ 64, 65, 65, 65, 66, 287, 368, 390, 391, 488,
+ /* 620 */ 90, 299, 324, 575, 457, 457, 390, 391, 390, 391,
+ /* 630 */ 318, 525, 494, 318, 392, 393, 394, 518, 524, 431,
+ /* 640 */ 241, 444, 450, 183, 477, 181, 571, 20, 324, 297,
+ /* 650 */ 457, 457, 422, 28, 541, 422, 23, 505, 287, 339,
+ /* 660 */ 60, 58, 295, 454, 455, 451, 451, 62, 62, 61,
+ /* 670 */ 61, 61, 61, 318, 63, 63, 63, 63, 64, 64,
+ /* 680 */ 65, 65, 65, 66, 444, 450, 421, 535, 354, 535,
+ /* 690 */ 420, 259, 300, 505, 816, 422, 32, 74, 505, 76,
+ /* 700 */ 188, 287, 505, 60, 58, 295, 454, 455, 451, 451,
+ /* 710 */ 62, 62, 61, 61, 61, 61, 318, 63, 63, 63,
+ /* 720 */ 63, 64, 64, 65, 65, 65, 66, 444, 450, 174,
+ /* 730 */ 175, 176, 377, 216, 423, 480, 248, 301, 422, 53,
+ /* 740 */ 505, 505, 259, 259, 287, 259, 60, 70, 295, 454,
+ /* 750 */ 455, 451, 451, 62, 62, 61, 61, 61, 61, 365,
+ /* 760 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66,
+ /* 770 */ 444, 450, 247, 319, 244, 302, 304, 248, 167, 156,
+ /* 780 */ 361, 248, 379, 260, 552, 259, 554, 287, 259, 219,
+ /* 790 */ 58, 295, 454, 455, 451, 451, 62, 62, 61, 61,
+ /* 800 */ 61, 61, 318, 63, 63, 63, 63, 64, 64, 65,
+ /* 810 */ 65, 65, 66, 444, 450, 484, 432, 484, 22, 248,
+ /* 820 */ 248, 207, 388, 364, 422, 24, 555, 364, 54, 556,
+ /* 830 */ 309, 119, 437, 437, 295, 454, 455, 451, 451, 62,
+ /* 840 */ 62, 61, 61, 61, 61, 318, 63, 63, 63, 63,
+ /* 850 */ 64, 64, 65, 65, 65, 66, 71, 325, 318, 4,
+ /* 860 */ 318, 537, 318, 293, 259, 536, 259, 422, 51, 318,
+ /* 870 */ 161, 320, 71, 325, 318, 4, 355, 356, 305, 293,
+ /* 880 */ 422, 96, 422, 93, 422, 98, 225, 320, 327, 217,
+ /* 890 */ 115, 422, 99, 218, 190, 318, 422, 110, 226, 443,
+ /* 900 */ 318, 259, 318, 417, 327, 272, 427, 372, 318, 5,
+ /* 910 */ 418, 318, 413, 414, 330, 443, 318, 422, 111, 73,
+ /* 920 */ 72, 197, 422, 16, 422, 97, 152, 71, 316, 317,
+ /* 930 */ 422, 33, 426, 422, 94, 73, 72, 487, 422, 52,
+ /* 940 */ 318, 200, 274, 71, 316, 317, 71, 325, 426, 4,
+ /* 950 */ 318, 206, 318, 293, 318, 423, 463, 318, 12, 179,
+ /* 960 */ 423, 320, 422, 112, 615, 428, 428, 428, 429, 430,
+ /* 970 */ 11, 323, 422, 113, 422, 25, 422, 36, 327, 422,
+ /* 980 */ 37, 428, 428, 428, 429, 430, 11, 498, 497, 443,
+ /* 990 */ 158, 18, 318, 423, 81, 220, 221, 222, 101, 182,
+ /* 1000 */ 482, 318, 169, 318, 491, 318, 12, 318, 440, 73,
+ /* 1010 */ 72, 202, 466, 276, 422, 26, 474, 71, 316, 317,
+ /* 1020 */ 277, 318, 426, 422, 38, 422, 39, 422, 41, 422,
+ /* 1030 */ 42, 318, 199, 423, 544, 503, 252, 124, 124, 198,
+ /* 1040 */ 318, 479, 201, 422, 43, 318, 483, 452, 318, 246,
+ /* 1050 */ 347, 318, 124, 422, 29, 428, 428, 428, 429, 430,
+ /* 1060 */ 11, 495, 422, 30, 496, 576, 318, 422, 44, 501,
+ /* 1070 */ 422, 45, 318, 422, 46, 520, 318, 533, 534, 318,
+ /* 1080 */ 540, 318, 124, 502, 185, 371, 273, 264, 422, 47,
+ /* 1090 */ 254, 288, 256, 257, 422, 31, 206, 258, 422, 10,
+ /* 1100 */ 352, 422, 49, 422, 50, 577, 548, 549, 169, 88,
+ /* 1110 */ 559, 263, 88, 359, 362, 573, 363, 285, 266, 267,
+ /* 1120 */ 376, 268, 551, 560, 275, 375, 278, 279, 231, 570,
+ /* 1130 */ 227, 142, 398, 326, 469, 436, 438, 472, 494, 159,
+ /* 1140 */ 504, 547, 506, 558, 387, 395, 342, 396, 397, 8,
+ /* 1150 */ 312, 313, 292, 416, 81, 403, 333, 232, 411, 80,
+ /* 1160 */ 228, 331, 419, 415, 56, 77, 210, 412, 239, 166,
+ /* 1170 */ 467, 211, 470, 471, 121, 82, 102, 336, 349, 282,
+ /* 1180 */ 508, 424, 521, 522, 529, 523, 351, 180, 233, 509,
+ /* 1190 */ 234, 184, 235, 283, 531, 425, 353, 85, 186, 117,
+ /* 1200 */ 358, 128, 369, 370, 308, 567, 568, 243, 543, 481,
+ /* 1210 */ 245, 212, 485, 189, 386, 569, 572, 129, 95, 214,
+ /* 1220 */ 215, 399, 550, 116, 130, 205, 55, 616, 131, 617,
+ /* 1230 */ 162, 163, 433, 134, 59, 213, 442, 557, 137, 100,
+ /* 1240 */ 138, 139, 453, 456, 460, 153, 165, 461, 261, 462,
+ /* 1250 */ 6, 122, 13, 12, 7, 532, 478, 123, 157, 492,
+ /* 1260 */ 103, 341, 89, 251, 104, 84, 105, 346, 226, 178,
+ /* 1270 */ 350, 141, 530, 125, 303, 169, 262, 187, 106, 126,
+ /* 1280 */ 538, 284, 546, 127, 191, 14, 194, 92, 17, 86,
+ /* 1290 */ 87, 193, 195, 133, 108, 553, 135, 565, 136, 15,
+ /* 1300 */ 107, 203, 378, 280, 144, 382, 558, 118, 579, 558,
+ /* 1310 */ 558, 310,
};
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,
+ /* 0 */ 16, 218, 16, 220, 221, 21, 111, 23, 70, 71,
+ /* 10 */ 72, 73, 84, 75, 76, 77, 78, 79, 80, 81,
+ /* 20 */ 82, 83, 84, 162, 163, 164, 42, 43, 74, 75,
+ /* 30 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 79,
+ /* 40 */ 80, 81, 82, 83, 84, 61, 62, 63, 64, 65,
+ /* 50 */ 66, 67, 68, 69, 70, 71, 72, 73, 170, 75,
+ /* 60 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
+ /* 70 */ 148, 218, 88, 220, 221, 22, 90, 91, 92, 93,
+ /* 80 */ 94, 95, 96, 97, 140, 141, 142, 170, 148, 145,
+ /* 90 */ 104, 238, 170, 171, 154, 42, 43, 157, 158, 46,
+ /* 100 */ 1, 2, 75, 76, 77, 78, 79, 80, 81, 82,
+ /* 110 */ 83, 84, 16, 22, 61, 62, 63, 64, 65, 66,
+ /* 120 */ 67, 68, 69, 70, 71, 72, 73, 23, 75, 76,
+ /* 130 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43,
+ /* 140 */ 44, 143, 144, 162, 222, 142, 14, 149, 145, 19,
+ /* 150 */ 0, 1, 2, 23, 156, 79, 80, 61, 62, 63,
+ /* 160 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+ /* 170 */ 156, 75, 76, 77, 78, 79, 80, 81, 82, 83,
+ /* 180 */ 84, 16, 201, 79, 80, 53, 21, 55, 190, 59,
+ /* 190 */ 169, 159, 88, 89, 162, 163, 164, 148, 177, 218,
+ /* 200 */ 182, 220, 221, 99, 190, 114, 161, 42, 43, 79,
+ /* 210 */ 80, 19, 20, 215, 22, 170, 202, 203, 88, 170,
+ /* 220 */ 171, 207, 92, 19, 16, 21, 61, 62, 63, 64,
+ /* 230 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 241,
+ /* 240 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ /* 250 */ 42, 43, 60, 186, 187, 125, 126, 127, 187, 210,
+ /* 260 */ 211, 11, 218, 219, 220, 221, 134, 16, 16, 61,
+ /* 270 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
+ /* 280 */ 72, 73, 22, 75, 76, 77, 78, 79, 80, 81,
+ /* 290 */ 82, 83, 84, 42, 43, 168, 169, 23, 151, 49,
+ /* 300 */ 81, 82, 83, 84, 177, 23, 186, 187, 59, 165,
+ /* 310 */ 166, 167, 61, 62, 63, 64, 65, 66, 67, 68,
+ /* 320 */ 69, 70, 71, 72, 73, 111, 75, 76, 77, 78,
+ /* 330 */ 79, 80, 81, 82, 83, 84, 182, 88, 124, 16,
+ /* 340 */ 132, 92, 22, 20, 92, 93, 94, 95, 96, 97,
+ /* 350 */ 100, 101, 102, 19, 244, 245, 104, 23, 98, 42,
+ /* 360 */ 43, 111, 88, 89, 90, 42, 43, 93, 94, 95,
+ /* 370 */ 88, 89, 228, 226, 125, 126, 127, 230, 21, 105,
+ /* 380 */ 23, 64, 65, 132, 61, 62, 63, 64, 65, 66,
+ /* 390 */ 67, 68, 69, 70, 71, 72, 73, 115, 75, 76,
+ /* 400 */ 77, 78, 79, 80, 81, 82, 83, 84, 16, 92,
+ /* 410 */ 90, 148, 20, 93, 94, 95, 19, 148, 148, 148,
+ /* 420 */ 23, 148, 88, 89, 148, 105, 22, 157, 158, 166,
+ /* 430 */ 167, 20, 156, 90, 42, 43, 93, 94, 95, 170,
+ /* 440 */ 171, 170, 171, 170, 171, 88, 170, 171, 105, 156,
+ /* 450 */ 148, 181, 182, 61, 62, 63, 64, 65, 66, 67,
+ /* 460 */ 68, 69, 70, 71, 72, 73, 190, 75, 76, 77,
+ /* 470 */ 78, 79, 80, 81, 82, 83, 84, 16, 191, 16,
+ /* 480 */ 12, 20, 213, 190, 213, 88, 148, 111, 148, 213,
+ /* 490 */ 148, 228, 24, 89, 225, 19, 225, 20, 225, 23,
+ /* 500 */ 124, 225, 43, 42, 43, 37, 43, 39, 170, 171,
+ /* 510 */ 170, 171, 170, 171, 165, 166, 167, 49, 107, 115,
+ /* 520 */ 109, 110, 61, 62, 63, 64, 65, 66, 67, 68,
+ /* 530 */ 69, 70, 71, 72, 73, 20, 75, 76, 77, 78,
+ /* 540 */ 79, 80, 81, 82, 83, 84, 16, 148, 30, 211,
+ /* 550 */ 20, 162, 23, 148, 12, 156, 108, 217, 99, 217,
+ /* 560 */ 112, 23, 99, 23, 88, 89, 24, 104, 50, 170,
+ /* 570 */ 171, 148, 42, 43, 23, 170, 171, 228, 18, 37,
+ /* 580 */ 148, 39, 19, 20, 107, 22, 109, 110, 148, 190,
+ /* 590 */ 201, 61, 62, 63, 64, 65, 66, 67, 68, 69,
+ /* 600 */ 70, 71, 72, 73, 14, 75, 76, 77, 78, 79,
+ /* 610 */ 80, 81, 82, 83, 84, 16, 56, 88, 89, 81,
+ /* 620 */ 21, 103, 107, 60, 109, 110, 88, 89, 88, 89,
+ /* 630 */ 148, 177, 178, 148, 7, 8, 9, 148, 184, 88,
+ /* 640 */ 148, 42, 43, 53, 115, 55, 157, 158, 107, 209,
+ /* 650 */ 109, 110, 170, 171, 94, 170, 171, 148, 16, 81,
+ /* 660 */ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
+ /* 670 */ 71, 72, 73, 148, 75, 76, 77, 78, 79, 80,
+ /* 680 */ 81, 82, 83, 84, 42, 43, 108, 100, 101, 102,
+ /* 690 */ 112, 148, 183, 148, 134, 170, 171, 131, 148, 133,
+ /* 700 */ 156, 16, 148, 61, 62, 63, 64, 65, 66, 67,
+ /* 710 */ 68, 69, 70, 71, 72, 73, 148, 75, 76, 77,
+ /* 720 */ 78, 79, 80, 81, 82, 83, 84, 42, 43, 100,
+ /* 730 */ 101, 102, 189, 183, 190, 162, 227, 183, 170, 171,
+ /* 740 */ 148, 148, 148, 148, 16, 148, 61, 62, 63, 64,
+ /* 750 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 215,
+ /* 760 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ /* 770 */ 42, 43, 227, 148, 201, 183, 183, 227, 202, 203,
+ /* 780 */ 236, 227, 239, 189, 189, 148, 189, 16, 148, 146,
+ /* 790 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
+ /* 800 */ 72, 73, 148, 75, 76, 77, 78, 79, 80, 81,
+ /* 810 */ 82, 83, 84, 42, 43, 148, 20, 148, 22, 227,
+ /* 820 */ 227, 193, 148, 148, 170, 171, 189, 148, 200, 189,
+ /* 830 */ 242, 243, 125, 126, 63, 64, 65, 66, 67, 68,
+ /* 840 */ 69, 70, 71, 72, 73, 148, 75, 76, 77, 78,
+ /* 850 */ 79, 80, 81, 82, 83, 84, 16, 17, 148, 19,
+ /* 860 */ 148, 25, 148, 23, 148, 29, 148, 170, 171, 148,
+ /* 870 */ 19, 31, 16, 17, 148, 19, 209, 41, 209, 23,
+ /* 880 */ 170, 171, 170, 171, 170, 171, 92, 31, 48, 214,
+ /* 890 */ 148, 170, 171, 214, 22, 148, 170, 171, 104, 59,
+ /* 900 */ 148, 148, 148, 27, 48, 189, 148, 189, 148, 192,
+ /* 910 */ 34, 148, 7, 8, 148, 59, 148, 170, 171, 79,
+ /* 920 */ 80, 156, 170, 171, 170, 171, 156, 87, 88, 89,
+ /* 930 */ 170, 171, 92, 170, 171, 79, 80, 81, 170, 171,
+ /* 940 */ 148, 19, 189, 87, 88, 89, 16, 17, 92, 19,
+ /* 950 */ 148, 111, 148, 23, 148, 190, 20, 148, 22, 156,
+ /* 960 */ 190, 31, 170, 171, 113, 125, 126, 127, 128, 129,
+ /* 970 */ 130, 16, 170, 171, 170, 171, 170, 171, 48, 170,
+ /* 980 */ 171, 125, 126, 127, 128, 129, 130, 91, 92, 59,
+ /* 990 */ 5, 69, 148, 190, 122, 10, 11, 12, 13, 156,
+ /* 1000 */ 20, 148, 22, 148, 20, 148, 22, 148, 162, 79,
+ /* 1010 */ 80, 26, 148, 28, 170, 171, 204, 87, 88, 89,
+ /* 1020 */ 35, 148, 92, 170, 171, 170, 171, 170, 171, 170,
+ /* 1030 */ 171, 148, 47, 190, 49, 20, 20, 22, 22, 54,
+ /* 1040 */ 148, 148, 57, 170, 171, 148, 148, 92, 148, 148,
+ /* 1050 */ 20, 148, 22, 170, 171, 125, 126, 127, 128, 129,
+ /* 1060 */ 130, 148, 170, 171, 179, 20, 148, 170, 171, 179,
+ /* 1070 */ 170, 171, 148, 170, 171, 148, 148, 51, 52, 148,
+ /* 1080 */ 20, 148, 22, 179, 232, 100, 101, 102, 170, 171,
+ /* 1090 */ 148, 106, 148, 148, 170, 171, 111, 148, 170, 171,
+ /* 1100 */ 233, 170, 171, 170, 171, 60, 20, 20, 22, 22,
+ /* 1110 */ 20, 148, 22, 148, 148, 20, 148, 22, 148, 148,
+ /* 1120 */ 135, 148, 148, 148, 148, 148, 148, 148, 194, 148,
+ /* 1130 */ 173, 192, 150, 224, 173, 229, 229, 173, 178, 6,
+ /* 1140 */ 173, 195, 173, 195, 147, 147, 174, 147, 147, 22,
+ /* 1150 */ 155, 99, 40, 98, 122, 172, 119, 195, 172, 120,
+ /* 1160 */ 172, 117, 172, 174, 121, 131, 223, 180, 97, 113,
+ /* 1170 */ 153, 212, 23, 161, 153, 99, 19, 116, 15, 175,
+ /* 1180 */ 161, 190, 172, 172, 153, 172, 153, 152, 196, 180,
+ /* 1190 */ 197, 153, 198, 175, 153, 199, 38, 131, 152, 61,
+ /* 1200 */ 153, 19, 153, 15, 153, 33, 153, 205, 185, 206,
+ /* 1210 */ 205, 212, 206, 185, 1, 153, 138, 188, 160, 212,
+ /* 1220 */ 212, 20, 195, 32, 188, 44, 19, 113, 188, 113,
+ /* 1230 */ 113, 113, 20, 185, 19, 176, 20, 195, 216, 176,
+ /* 1240 */ 216, 19, 92, 108, 11, 19, 22, 20, 234, 20,
+ /* 1250 */ 118, 19, 22, 22, 118, 235, 115, 20, 113, 20,
+ /* 1260 */ 19, 44, 237, 20, 19, 19, 19, 44, 104, 96,
+ /* 1270 */ 16, 21, 17, 99, 36, 22, 134, 99, 19, 45,
+ /* 1280 */ 45, 5, 1, 103, 123, 19, 14, 237, 231, 69,
+ /* 1290 */ 69, 114, 116, 114, 240, 17, 103, 20, 123, 19,
+ /* 1300 */ 14, 136, 58, 137, 19, 3, 247, 243, 4, 247,
+ /* 1310 */ 247, 246,
};
-#define YY_SHIFT_USE_DFLT (-75)
+#define YY_SHIFT_USE_DFLT (-106)
+#define YY_SHIFT_MAX 382
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,
+ /* 0 */ 99, 840, 985, -16, 840, 930, 930, 930, 274, -105,
+ /* 10 */ 96, 930, 930, 930, 930, 930, -46, 250, 104, 540,
+ /* 20 */ 551, 76, 76, 53, 165, 208, 251, 323, 392, 461,
+ /* 30 */ 530, 599, 642, 685, 642, 642, 642, 642, 642, 642,
+ /* 40 */ 642, 642, 642, 642, 642, 642, 642, 642, 642, 642,
+ /* 50 */ 642, 728, 771, 771, 856, 930, 930, 930, 930, 930,
+ /* 60 */ 930, 930, 930, 930, 930, 930, 930, 930, 930, 930,
+ /* 70 */ 930, 930, 930, 930, 930, 930, 930, 930, 930, 930,
+ /* 80 */ 930, 930, 930, 930, 930, 930, 930, 930, 930, 930,
+ /* 90 */ 930, 930, 930, -62, -62, -14, 27, 27, -40, 219,
+ /* 100 */ 463, 560, 540, 540, 540, 540, 540, 540, 540, 551,
+ /* 110 */ -72, -106, -106, -106, 130, 252, 468, 468, 192, 563,
+ /* 120 */ 150, 357, 540, 357, 540, 540, 540, 540, 540, 540,
+ /* 130 */ 540, 540, 540, 540, 540, 540, 540, 214, 376, -105,
+ /* 140 */ -105, -105, -106, -106, -106, 249, 249, 320, 343, 411,
+ /* 150 */ 334, 477, 515, 542, 282, 529, 476, 538, 627, 540,
+ /* 160 */ 540, 578, 540, 540, 397, 540, 540, 404, 540, 540,
+ /* 170 */ 541, 404, 540, 540, 518, 518, 518, 540, 540, 541,
+ /* 180 */ 540, 540, 541, 540, 836, 587, 540, 540, 541, 540,
+ /* 190 */ 540, 540, 541, 540, 540, 540, 541, 541, 540, 540,
+ /* 200 */ 540, 540, 540, 540, 204, 876, 448, 91, 707, 707,
+ /* 210 */ 566, 876, 876, 459, 876, 876, 260, 872, 872, 1133,
+ /* 220 */ 1133, 1133, 1133, 1127, 1052, 1052, 1112, 1052, 1055, 1052,
+ /* 230 */ -105, 1032, 1037, 1039, 1044, 1043, 1034, 1056, 1071, 1149,
+ /* 240 */ 1071, 1056, 1076, 1061, 1076, 1061, 1157, 1071, 1071, 1149,
+ /* 250 */ 1112, 1052, 1052, 1052, 1157, 1163, 1056, 1056, 1056, 1056,
+ /* 260 */ 1158, 1066, 1163, 1056, 1138, 1138, 1182, 1032, 1056, 1188,
+ /* 270 */ 1188, 1188, 1032, 1138, 1182, 1056, 1172, 1172, 1056, 1056,
+ /* 280 */ 1078, -106, -106, -106, -106, -106, -106, 317, 132, 629,
+ /* 290 */ 590, 794, 905, 851, 796, 955, 936, 980, 984, 896,
+ /* 300 */ 1015, 1016, 1030, 1026, 1060, 1086, 1087, 1090, 922, 1095,
+ /* 310 */ 1045, 1213, 1201, 1191, 1181, 1207, 1114, 1116, 1117, 1118,
+ /* 320 */ 1215, 1212, 1216, 1150, 1135, 1222, 1233, 1226, 1227, 1224,
+ /* 330 */ 1229, 1132, 1230, 1136, 1231, 1141, 1232, 1237, 1145, 1239,
+ /* 340 */ 1217, 1241, 1243, 1245, 1246, 1223, 1247, 1173, 1164, 1254,
+ /* 350 */ 1255, 1250, 1174, 1238, 1234, 1253, 1235, 1142, 1178, 1259,
+ /* 360 */ 1276, 1281, 1180, 1220, 1221, 1161, 1266, 1177, 1272, 1176,
+ /* 370 */ 1278, 1179, 1193, 1175, 1280, 1277, 1286, 1244, 1165, 1166,
+ /* 380 */ 1285, 1302, 1304,
};
-#define YY_REDUCE_USE_DFLT (-61)
+#define YY_REDUCE_USE_DFLT (-218)
+#define YY_REDUCE_MAX 286
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,
+ /* 0 */ -56, 276, -2, -19, 399, 269, 49, 271, 270, 14,
+ /* 10 */ -147, -78, 273, 338, 340, 342, 44, 544, 263, -60,
+ /* 20 */ 32, 144, 349, -217, -217, -217, -217, -217, -217, -217,
+ /* 30 */ -217, -217, -217, -217, -217, -217, -217, -217, -217, -217,
+ /* 40 */ -217, -217, -217, -217, -217, -217, -217, -217, -217, -217,
+ /* 50 */ -217, -217, -217, -217, 405, 482, 485, 525, 568, 654,
+ /* 60 */ 697, 710, 712, 714, 721, 726, 747, 752, 754, 760,
+ /* 70 */ 763, 768, 792, 802, 804, 806, 809, 844, 853, 855,
+ /* 80 */ 857, 859, 873, 883, 892, 897, 900, 903, 918, 924,
+ /* 90 */ 928, 931, 933, -217, -217, 127, -217, -217, -217, -217,
+ /* 100 */ 454, 147, 509, 550, 554, 592, 593, 543, 489, -139,
+ /* 110 */ -217, -217, -217, -217, 45, 21, 67, 120, 110, 110,
+ /* 120 */ 3, 389, 440, 573, 545, 594, 667, 675, 669, 595,
+ /* 130 */ 597, 637, 640, 716, 718, 679, 753, 293, 765, 770,
+ /* 140 */ 803, 843, 628, 576, 588, -112, -83, 18, 154, 287,
+ /* 150 */ 302, 287, 287, 71, 423, 432, 492, 625, 643, 674,
+ /* 160 */ 742, 717, 625, 758, 846, 766, 864, 812, 893, 898,
+ /* 170 */ 287, 812, 901, 913, 885, 890, 904, 927, 942, 287,
+ /* 180 */ 944, 945, 287, 949, 852, 867, 963, 965, 287, 966,
+ /* 190 */ 968, 970, 287, 971, 973, 974, 287, 287, 975, 976,
+ /* 200 */ 977, 978, 979, 981, 982, 957, 939, 934, 906, 907,
+ /* 210 */ 909, 961, 964, 960, 967, 969, 972, 946, 948, 997,
+ /* 220 */ 998, 1000, 1001, 995, 983, 986, 987, 988, 989, 990,
+ /* 230 */ 991, 962, 992, 993, 994, 996, 943, 1017, 959, 1012,
+ /* 240 */ 999, 1021, 1002, 1003, 1005, 1006, 1004, 1007, 1008, 1019,
+ /* 250 */ 1009, 1010, 1011, 1013, 1018, 1035, 1031, 1033, 1038, 1041,
+ /* 260 */ 1014, 1020, 1046, 1047, 1023, 1028, 1022, 1027, 1049, 1029,
+ /* 270 */ 1036, 1040, 1042, 1048, 1024, 1051, 1025, 1050, 1053, 1062,
+ /* 280 */ 1054, 1058, 1059, 1063, 1057, 1064, 1065,
};
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,
+ /* 0 */ 587, 813, 890, 702, 890, 813, 890, 813, 890, 706,
+ /* 10 */ 864, 809, 813, 890, 890, 890, 784, 890, 835, 890,
+ /* 20 */ 618, 835, 835, 737, 890, 890, 890, 890, 890, 890,
+ /* 30 */ 890, 890, 738, 890, 812, 808, 804, 806, 805, 739,
+ /* 40 */ 726, 735, 742, 718, 849, 744, 745, 750, 751, 865,
+ /* 50 */ 868, 772, 790, 771, 890, 890, 890, 890, 890, 890,
+ /* 60 */ 890, 890, 890, 890, 890, 890, 890, 890, 890, 890,
+ /* 70 */ 890, 890, 890, 890, 890, 890, 890, 890, 890, 890,
+ /* 80 */ 890, 890, 890, 890, 890, 890, 890, 890, 890, 890,
+ /* 90 */ 890, 890, 890, 774, 795, 611, 773, 783, 775, 776,
+ /* 100 */ 671, 606, 890, 890, 890, 890, 890, 890, 890, 890,
+ /* 110 */ 777, 778, 791, 792, 890, 890, 890, 890, 890, 890,
+ /* 120 */ 587, 702, 890, 702, 890, 890, 890, 890, 890, 890,
+ /* 130 */ 890, 890, 890, 890, 890, 890, 890, 890, 890, 890,
+ /* 140 */ 890, 890, 696, 706, 883, 890, 890, 662, 890, 890,
+ /* 150 */ 890, 890, 890, 890, 890, 890, 890, 890, 594, 592,
+ /* 160 */ 890, 694, 890, 890, 620, 890, 890, 704, 890, 890,
+ /* 170 */ 709, 710, 890, 890, 890, 890, 890, 890, 890, 608,
+ /* 180 */ 890, 890, 683, 890, 841, 890, 890, 890, 856, 890,
+ /* 190 */ 890, 890, 854, 890, 890, 890, 685, 747, 823, 890,
+ /* 200 */ 890, 869, 871, 890, 890, 729, 694, 703, 890, 890,
+ /* 210 */ 807, 729, 729, 641, 729, 729, 644, 741, 741, 591,
+ /* 220 */ 591, 591, 591, 661, 673, 673, 658, 673, 644, 673,
+ /* 230 */ 890, 741, 732, 734, 722, 736, 890, 711, 730, 890,
+ /* 240 */ 730, 711, 719, 721, 719, 721, 817, 730, 730, 890,
+ /* 250 */ 658, 673, 673, 673, 817, 603, 711, 711, 711, 711,
+ /* 260 */ 845, 848, 603, 711, 675, 675, 752, 741, 711, 682,
+ /* 270 */ 682, 682, 741, 675, 752, 711, 867, 867, 711, 711,
+ /* 280 */ 876, 628, 646, 646, 851, 883, 888, 890, 890, 890,
+ /* 290 */ 890, 890, 890, 759, 890, 890, 890, 890, 890, 890,
+ /* 300 */ 890, 890, 890, 890, 890, 890, 890, 890, 830, 890,
+ /* 310 */ 890, 890, 890, 890, 890, 890, 764, 760, 890, 761,
+ /* 320 */ 890, 890, 890, 890, 688, 890, 890, 890, 890, 890,
+ /* 330 */ 890, 890, 723, 890, 733, 890, 890, 890, 890, 890,
+ /* 340 */ 890, 890, 890, 890, 890, 890, 890, 890, 890, 890,
+ /* 350 */ 890, 890, 890, 890, 843, 844, 890, 890, 890, 890,
+ /* 360 */ 890, 890, 890, 890, 890, 890, 890, 890, 890, 890,
+ /* 370 */ 890, 890, 890, 890, 890, 890, 890, 875, 890, 890,
+ /* 380 */ 878, 588, 890, 582, 585, 584, 586, 590, 593, 615,
+ /* 390 */ 616, 617, 595, 596, 597, 598, 599, 600, 601, 607,
+ /* 400 */ 609, 627, 629, 636, 674, 677, 678, 679, 859, 860,
+ /* 410 */ 861, 637, 656, 659, 660, 638, 645, 727, 728, 639,
+ /* 420 */ 692, 693, 756, 686, 687, 691, 758, 762, 763, 765,
+ /* 430 */ 766, 614, 621, 622, 625, 626, 831, 833, 832, 834,
+ /* 440 */ 624, 623, 767, 770, 779, 780, 782, 788, 794, 797,
+ /* 450 */ 781, 786, 787, 789, 793, 796, 689, 690, 800, 802,
+ /* 460 */ 803, 857, 858, 798, 810, 811, 712, 801, 785, 724,
+ /* 470 */ 613, 731, 725, 695, 705, 714, 715, 716, 717, 700,
+ /* 480 */ 701, 707, 720, 754, 755, 708, 697, 698, 699, 799,
+ /* 490 */ 757, 768, 769, 640, 647, 648, 649, 652, 653, 654,
+ /* 500 */ 655, 650, 651, 818, 819, 821, 820, 642, 643, 657,
+ /* 510 */ 630, 631, 632, 633, 764, 634, 635, 619, 612, 663,
+ /* 520 */ 666, 667, 668, 669, 670, 672, 664, 665, 610, 602,
+ /* 530 */ 604, 713, 837, 846, 847, 842, 838, 839, 840, 605,
+ /* 540 */ 814, 815, 676, 748, 749, 836, 850, 852, 753, 853,
+ /* 550 */ 855, 880, 680, 681, 684, 822, 862, 740, 743, 746,
+ /* 560 */ 824, 825, 826, 827, 828, 829, 863, 866, 870, 872,
+ /* 570 */ 873, 874, 877, 879, 884, 885, 886, 889, 887, 589,
/* 580 */ 583,
};
-#define YY_SZ_ACTTAB (sizeof(yy_action)/sizeof(yy_action[0]))
+#define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))
/* The next table maps tokens into fallback tokens. If a construct
** like the following:
@@ -670,75 +595,68 @@ static const YYACTIONTYPE yy_default[] = {
#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 */
+ 23, /* EXPLAIN => ID */
+ 23, /* QUERY => ID */
+ 23, /* PLAN => ID */
+ 23, /* BEGIN => ID */
0, /* TRANSACTION => nothing */
- 30, /* DEFERRED => ID */
- 30, /* IMMEDIATE => ID */
- 30, /* EXCLUSIVE => ID */
+ 23, /* DEFERRED => ID */
+ 23, /* IMMEDIATE => ID */
+ 23, /* EXCLUSIVE => ID */
0, /* COMMIT => nothing */
- 30, /* END => ID */
+ 23, /* END => ID */
0, /* ROLLBACK => nothing */
0, /* CREATE => nothing */
0, /* TABLE => nothing */
- 30, /* TEMP => ID */
+ 23, /* IF => ID */
+ 0, /* NOT => nothing */
+ 0, /* EXISTS => nothing */
+ 23, /* 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 */
+ 23, /* ABORT => ID */
+ 23, /* AFTER => ID */
+ 23, /* ANALYZE => ID */
+ 23, /* ASC => ID */
+ 23, /* ATTACH => ID */
+ 23, /* BEFORE => ID */
+ 23, /* CASCADE => ID */
+ 23, /* CAST => ID */
+ 23, /* CONFLICT => ID */
+ 23, /* DATABASE => ID */
+ 23, /* DESC => ID */
+ 23, /* DETACH => ID */
+ 23, /* EACH => ID */
+ 23, /* FAIL => ID */
+ 23, /* FOR => ID */
+ 23, /* IGNORE => ID */
+ 23, /* INITIALLY => ID */
+ 23, /* INSTEAD => ID */
+ 23, /* LIKE_KW => 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 */
+ 23, /* VIRTUAL => ID */
+ 23, /* REINDEX => ID */
+ 23, /* RENAME => ID */
+ 23, /* CTIME_KW => ID */
+ 0, /* ANY => nothing */
0, /* OR => nothing */
0, /* AND => nothing */
- 0, /* NOT => nothing */
0, /* IS => nothing */
0, /* BETWEEN => nothing */
0, /* IN => nothing */
@@ -785,8 +703,8 @@ static const YYCODETYPE yyFallback[] = {
0, /* DROP => nothing */
0, /* UNION => nothing */
0, /* ALL => nothing */
- 0, /* INTERSECT => nothing */
0, /* EXCEPT => nothing */
+ 0, /* INTERSECT => nothing */
0, /* SELECT => nothing */
0, /* DISTINCT => nothing */
0, /* DOT => nothing */
@@ -806,12 +724,12 @@ static const YYCODETYPE yyFallback[] = {
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, /* ALTER => nothing */
0, /* TO => nothing */
0, /* ADD => nothing */
0, /* COLUMNKW => nothing */
@@ -885,68 +803,68 @@ void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){
/* 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",
+ "$", "SEMI", "EXPLAIN", "QUERY",
+ "PLAN", "BEGIN", "TRANSACTION", "DEFERRED",
+ "IMMEDIATE", "EXCLUSIVE", "COMMIT", "END",
+ "ROLLBACK", "CREATE", "TABLE", "IF",
+ "NOT", "EXISTS", "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",
+ "VIRTUAL", "REINDEX", "RENAME", "CTIME_KW",
+ "ANY", "OR", "AND", "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", "EXCEPT", "INTERSECT", "SELECT",
+ "DISTINCT", "DOT", "FROM", "JOIN",
+ "USING", "ORDER", "BY", "GROUP",
+ "HAVING", "LIMIT", "WHERE", "INTO",
+ "VALUES", "INTEGER", "FLOAT", "BLOB",
+ "REGISTER", "VARIABLE", "CASE", "WHEN",
+ "THEN", "ELSE", "INDEX", "ALTER",
+ "TO", "ADD", "COLUMNKW", "error",
+ "input", "cmdlist", "ecmd", "cmdx",
+ "cmd", "explain", "transtype", "trans_opt",
+ "nm", "create_table", "create_table_args", "temp",
+ "ifnotexists", "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",
+ "ifexists", "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", "create_vtab", "vtabarglist", "vtabarg",
+ "vtabargtoken", "lp", "anylist",
};
#endif /* NDEBUG */
@@ -975,296 +893,294 @@ static const char *const yyRuleName[] = {
/* 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",
+ /* 21 */ "create_table ::= CREATE temp TABLE ifnotexists nm dbnm",
+ /* 22 */ "ifnotexists ::=",
+ /* 23 */ "ifnotexists ::= IF NOT EXISTS",
+ /* 24 */ "temp ::= TEMP",
+ /* 25 */ "temp ::=",
+ /* 26 */ "create_table_args ::= LP columnlist conslist_opt RP",
+ /* 27 */ "create_table_args ::= AS select",
+ /* 28 */ "columnlist ::= columnlist COMMA column",
+ /* 29 */ "columnlist ::= column",
+ /* 30 */ "column ::= columnid type carglist",
+ /* 31 */ "columnid ::= nm",
+ /* 32 */ "id ::= ID",
+ /* 33 */ "ids ::= ID|STRING",
+ /* 34 */ "nm ::= ID",
+ /* 35 */ "nm ::= STRING",
+ /* 36 */ "nm ::= JOIN_KW",
+ /* 37 */ "type ::=",
+ /* 38 */ "type ::= typetoken",
+ /* 39 */ "typetoken ::= typename",
+ /* 40 */ "typetoken ::= typename LP signed RP",
+ /* 41 */ "typetoken ::= typename LP signed COMMA signed RP",
+ /* 42 */ "typename ::= ids",
+ /* 43 */ "typename ::= typename ids",
+ /* 44 */ "signed ::= plus_num",
+ /* 45 */ "signed ::= minus_num",
+ /* 46 */ "carglist ::= carglist carg",
+ /* 47 */ "carglist ::=",
+ /* 48 */ "carg ::= CONSTRAINT nm ccons",
+ /* 49 */ "carg ::= ccons",
+ /* 50 */ "carg ::= DEFAULT term",
+ /* 51 */ "carg ::= DEFAULT LP expr RP",
+ /* 52 */ "carg ::= DEFAULT PLUS term",
+ /* 53 */ "carg ::= DEFAULT MINUS term",
+ /* 54 */ "carg ::= DEFAULT id",
+ /* 55 */ "ccons ::= NULL onconf",
+ /* 56 */ "ccons ::= NOT NULL onconf",
+ /* 57 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
+ /* 58 */ "ccons ::= UNIQUE onconf",
+ /* 59 */ "ccons ::= CHECK LP expr RP",
+ /* 60 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
+ /* 61 */ "ccons ::= defer_subclause",
+ /* 62 */ "ccons ::= COLLATE id",
+ /* 63 */ "autoinc ::=",
+ /* 64 */ "autoinc ::= AUTOINCR",
+ /* 65 */ "refargs ::=",
+ /* 66 */ "refargs ::= refargs refarg",
+ /* 67 */ "refarg ::= MATCH nm",
+ /* 68 */ "refarg ::= ON DELETE refact",
+ /* 69 */ "refarg ::= ON UPDATE refact",
+ /* 70 */ "refarg ::= ON INSERT refact",
+ /* 71 */ "refact ::= SET NULL",
+ /* 72 */ "refact ::= SET DEFAULT",
+ /* 73 */ "refact ::= CASCADE",
+ /* 74 */ "refact ::= RESTRICT",
+ /* 75 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
+ /* 76 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
+ /* 77 */ "init_deferred_pred_opt ::=",
+ /* 78 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
+ /* 79 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
+ /* 80 */ "conslist_opt ::=",
+ /* 81 */ "conslist_opt ::= COMMA conslist",
+ /* 82 */ "conslist ::= conslist COMMA tcons",
+ /* 83 */ "conslist ::= conslist tcons",
+ /* 84 */ "conslist ::= tcons",
+ /* 85 */ "tcons ::= CONSTRAINT nm",
+ /* 86 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
+ /* 87 */ "tcons ::= UNIQUE LP idxlist RP onconf",
+ /* 88 */ "tcons ::= CHECK LP expr RP onconf",
+ /* 89 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
+ /* 90 */ "defer_subclause_opt ::=",
+ /* 91 */ "defer_subclause_opt ::= defer_subclause",
+ /* 92 */ "onconf ::=",
+ /* 93 */ "onconf ::= ON CONFLICT resolvetype",
+ /* 94 */ "orconf ::=",
+ /* 95 */ "orconf ::= OR resolvetype",
+ /* 96 */ "resolvetype ::= raisetype",
+ /* 97 */ "resolvetype ::= IGNORE",
+ /* 98 */ "resolvetype ::= REPLACE",
+ /* 99 */ "cmd ::= DROP TABLE ifexists fullname",
+ /* 100 */ "ifexists ::= IF EXISTS",
+ /* 101 */ "ifexists ::=",
+ /* 102 */ "cmd ::= CREATE temp VIEW nm dbnm AS select",
+ /* 103 */ "cmd ::= DROP VIEW ifexists fullname",
+ /* 104 */ "cmd ::= select",
+ /* 105 */ "select ::= oneselect",
+ /* 106 */ "select ::= select multiselect_op oneselect",
+ /* 107 */ "multiselect_op ::= UNION",
+ /* 108 */ "multiselect_op ::= UNION ALL",
+ /* 109 */ "multiselect_op ::= EXCEPT|INTERSECT",
+ /* 110 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
+ /* 111 */ "distinct ::= DISTINCT",
+ /* 112 */ "distinct ::= ALL",
+ /* 113 */ "distinct ::=",
+ /* 114 */ "sclp ::= selcollist COMMA",
+ /* 115 */ "sclp ::=",
+ /* 116 */ "selcollist ::= sclp expr as",
+ /* 117 */ "selcollist ::= sclp STAR",
+ /* 118 */ "selcollist ::= sclp nm DOT STAR",
+ /* 119 */ "as ::= AS nm",
+ /* 120 */ "as ::= ids",
+ /* 121 */ "as ::=",
+ /* 122 */ "from ::=",
+ /* 123 */ "from ::= FROM seltablist",
+ /* 124 */ "stl_prefix ::= seltablist joinop",
+ /* 125 */ "stl_prefix ::=",
+ /* 126 */ "seltablist ::= stl_prefix nm dbnm as on_opt using_opt",
+ /* 127 */ "seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt",
+ /* 128 */ "seltablist_paren ::= select",
+ /* 129 */ "seltablist_paren ::= seltablist",
+ /* 130 */ "dbnm ::=",
+ /* 131 */ "dbnm ::= DOT nm",
+ /* 132 */ "fullname ::= nm dbnm",
+ /* 133 */ "joinop ::= COMMA|JOIN",
+ /* 134 */ "joinop ::= JOIN_KW JOIN",
+ /* 135 */ "joinop ::= JOIN_KW nm JOIN",
+ /* 136 */ "joinop ::= JOIN_KW nm nm JOIN",
+ /* 137 */ "on_opt ::= ON expr",
+ /* 138 */ "on_opt ::=",
+ /* 139 */ "using_opt ::= USING LP inscollist RP",
+ /* 140 */ "using_opt ::=",
+ /* 141 */ "orderby_opt ::=",
+ /* 142 */ "orderby_opt ::= ORDER BY sortlist",
+ /* 143 */ "sortlist ::= sortlist COMMA sortitem collate sortorder",
+ /* 144 */ "sortlist ::= sortitem collate sortorder",
+ /* 145 */ "sortitem ::= expr",
+ /* 146 */ "sortorder ::= ASC",
+ /* 147 */ "sortorder ::= DESC",
+ /* 148 */ "sortorder ::=",
+ /* 149 */ "collate ::=",
+ /* 150 */ "collate ::= COLLATE id",
+ /* 151 */ "groupby_opt ::=",
+ /* 152 */ "groupby_opt ::= GROUP BY exprlist",
+ /* 153 */ "having_opt ::=",
+ /* 154 */ "having_opt ::= HAVING expr",
+ /* 155 */ "limit_opt ::=",
+ /* 156 */ "limit_opt ::= LIMIT expr",
+ /* 157 */ "limit_opt ::= LIMIT expr OFFSET expr",
+ /* 158 */ "limit_opt ::= LIMIT expr COMMA expr",
+ /* 159 */ "cmd ::= DELETE FROM fullname where_opt",
+ /* 160 */ "where_opt ::=",
+ /* 161 */ "where_opt ::= WHERE expr",
+ /* 162 */ "cmd ::= UPDATE orconf fullname SET setlist where_opt",
+ /* 163 */ "setlist ::= setlist COMMA nm EQ expr",
+ /* 164 */ "setlist ::= nm EQ expr",
+ /* 165 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP",
+ /* 166 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select",
+ /* 167 */ "insert_cmd ::= INSERT orconf",
+ /* 168 */ "insert_cmd ::= REPLACE",
+ /* 169 */ "itemlist ::= itemlist COMMA expr",
+ /* 170 */ "itemlist ::= expr",
+ /* 171 */ "inscollist_opt ::=",
+ /* 172 */ "inscollist_opt ::= LP inscollist RP",
+ /* 173 */ "inscollist ::= inscollist COMMA nm",
+ /* 174 */ "inscollist ::= nm",
+ /* 175 */ "expr ::= term",
+ /* 176 */ "expr ::= LP expr RP",
+ /* 177 */ "term ::= NULL",
+ /* 178 */ "expr ::= ID",
+ /* 179 */ "expr ::= JOIN_KW",
+ /* 180 */ "expr ::= nm DOT nm",
+ /* 181 */ "expr ::= nm DOT nm DOT nm",
+ /* 182 */ "term ::= INTEGER|FLOAT|BLOB",
/* 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",
+ /* 184 */ "expr ::= REGISTER",
+ /* 185 */ "expr ::= VARIABLE",
+ /* 186 */ "expr ::= CAST LP expr AS typetoken RP",
+ /* 187 */ "expr ::= ID LP distinct exprlist RP",
+ /* 188 */ "expr ::= ID LP STAR RP",
+ /* 189 */ "term ::= CTIME_KW",
+ /* 190 */ "expr ::= expr AND expr",
+ /* 191 */ "expr ::= expr OR expr",
+ /* 192 */ "expr ::= expr LT|GT|GE|LE expr",
+ /* 193 */ "expr ::= expr EQ|NE expr",
+ /* 194 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
+ /* 195 */ "expr ::= expr PLUS|MINUS expr",
+ /* 196 */ "expr ::= expr STAR|SLASH|REM expr",
+ /* 197 */ "expr ::= expr CONCAT expr",
+ /* 198 */ "likeop ::= LIKE_KW",
+ /* 199 */ "likeop ::= NOT LIKE_KW",
+ /* 200 */ "likeop ::= MATCH",
+ /* 201 */ "likeop ::= NOT MATCH",
+ /* 202 */ "escape ::= ESCAPE expr",
+ /* 203 */ "escape ::=",
+ /* 204 */ "expr ::= expr likeop expr escape",
+ /* 205 */ "expr ::= expr ISNULL|NOTNULL",
+ /* 206 */ "expr ::= expr IS NULL",
+ /* 207 */ "expr ::= expr NOT NULL",
+ /* 208 */ "expr ::= expr IS NOT NULL",
+ /* 209 */ "expr ::= NOT|BITNOT expr",
+ /* 210 */ "expr ::= MINUS expr",
+ /* 211 */ "expr ::= PLUS expr",
+ /* 212 */ "between_op ::= BETWEEN",
+ /* 213 */ "between_op ::= NOT BETWEEN",
+ /* 214 */ "expr ::= expr between_op expr AND expr",
+ /* 215 */ "in_op ::= IN",
+ /* 216 */ "in_op ::= NOT IN",
+ /* 217 */ "expr ::= expr in_op LP exprlist RP",
+ /* 218 */ "expr ::= LP select RP",
+ /* 219 */ "expr ::= expr in_op LP select RP",
+ /* 220 */ "expr ::= expr in_op nm dbnm",
+ /* 221 */ "expr ::= EXISTS LP select RP",
+ /* 222 */ "expr ::= CASE case_operand case_exprlist case_else END",
+ /* 223 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
+ /* 224 */ "case_exprlist ::= WHEN expr THEN expr",
+ /* 225 */ "case_else ::= ELSE expr",
+ /* 226 */ "case_else ::=",
+ /* 227 */ "case_operand ::= expr",
+ /* 228 */ "case_operand ::=",
+ /* 229 */ "exprlist ::= exprlist COMMA expritem",
+ /* 230 */ "exprlist ::= expritem",
+ /* 231 */ "expritem ::= expr",
+ /* 232 */ "expritem ::=",
+ /* 233 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP",
+ /* 234 */ "uniqueflag ::= UNIQUE",
+ /* 235 */ "uniqueflag ::=",
+ /* 236 */ "idxlist_opt ::=",
+ /* 237 */ "idxlist_opt ::= LP idxlist RP",
+ /* 238 */ "idxlist ::= idxlist COMMA idxitem collate sortorder",
+ /* 239 */ "idxlist ::= idxitem collate sortorder",
+ /* 240 */ "idxitem ::= nm",
+ /* 241 */ "cmd ::= DROP INDEX ifexists fullname",
+ /* 242 */ "cmd ::= VACUUM",
+ /* 243 */ "cmd ::= VACUUM nm",
+ /* 244 */ "cmd ::= PRAGMA nm dbnm EQ nm",
+ /* 245 */ "cmd ::= PRAGMA nm dbnm EQ ON",
+ /* 246 */ "cmd ::= PRAGMA nm dbnm EQ plus_num",
+ /* 247 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
+ /* 248 */ "cmd ::= PRAGMA nm dbnm LP nm RP",
+ /* 249 */ "cmd ::= PRAGMA nm dbnm",
+ /* 250 */ "plus_num ::= plus_opt number",
+ /* 251 */ "minus_num ::= MINUS number",
+ /* 252 */ "number ::= INTEGER|FLOAT",
+ /* 253 */ "plus_opt ::= PLUS",
+ /* 254 */ "plus_opt ::=",
+ /* 255 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END",
+ /* 256 */ "trigger_decl ::= temp TRIGGER nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
+ /* 257 */ "trigger_time ::= BEFORE",
+ /* 258 */ "trigger_time ::= AFTER",
+ /* 259 */ "trigger_time ::= INSTEAD OF",
+ /* 260 */ "trigger_time ::=",
+ /* 261 */ "trigger_event ::= DELETE|INSERT",
+ /* 262 */ "trigger_event ::= UPDATE",
+ /* 263 */ "trigger_event ::= UPDATE OF inscollist",
+ /* 264 */ "foreach_clause ::=",
+ /* 265 */ "foreach_clause ::= FOR EACH ROW",
+ /* 266 */ "foreach_clause ::= FOR EACH STATEMENT",
+ /* 267 */ "when_clause ::=",
+ /* 268 */ "when_clause ::= WHEN expr",
+ /* 269 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
+ /* 270 */ "trigger_cmd_list ::=",
+ /* 271 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt",
+ /* 272 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP",
+ /* 273 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select",
+ /* 274 */ "trigger_cmd ::= DELETE FROM nm where_opt",
+ /* 275 */ "trigger_cmd ::= select",
+ /* 276 */ "expr ::= RAISE LP IGNORE RP",
+ /* 277 */ "expr ::= RAISE LP raisetype COMMA nm RP",
+ /* 278 */ "raisetype ::= ROLLBACK",
+ /* 279 */ "raisetype ::= ABORT",
+ /* 280 */ "raisetype ::= FAIL",
+ /* 281 */ "cmd ::= DROP TRIGGER fullname",
+ /* 282 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
+ /* 283 */ "key_opt ::=",
+ /* 284 */ "key_opt ::= KEY expr",
+ /* 285 */ "database_kw_opt ::= DATABASE",
+ /* 286 */ "database_kw_opt ::=",
+ /* 287 */ "cmd ::= DETACH database_kw_opt expr",
+ /* 288 */ "cmd ::= REINDEX",
+ /* 289 */ "cmd ::= REINDEX nm dbnm",
+ /* 290 */ "cmd ::= ANALYZE",
+ /* 291 */ "cmd ::= ANALYZE nm dbnm",
+ /* 292 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
+ /* 293 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
+ /* 294 */ "add_column_fullname ::= fullname",
+ /* 295 */ "kwcolumn_opt ::=",
+ /* 296 */ "kwcolumn_opt ::= COLUMNKW",
+ /* 297 */ "cmd ::= create_vtab",
+ /* 298 */ "cmd ::= create_vtab LP vtabarglist RP",
+ /* 299 */ "create_vtab ::= CREATE VIRTUAL TABLE nm dbnm USING nm",
+ /* 300 */ "vtabarglist ::= vtabarg",
+ /* 301 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
+ /* 302 */ "vtabarg ::=",
+ /* 303 */ "vtabarg ::= vtabarg vtabargtoken",
+ /* 304 */ "vtabargtoken ::= ANY",
+ /* 305 */ "vtabargtoken ::= lp anylist RP",
+ /* 306 */ "lp ::= LP",
+ /* 307 */ "anylist ::=",
+ /* 308 */ "anylist ::= anylist ANY",
};
#endif /* NDEBUG */
@@ -1322,72 +1238,81 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
** which appear on the RHS of the rule, but which are not used
** inside the C code.
*/
- case 162:
+ case 156:
+ case 190:
+ case 207:
+#line 374 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3SelectDelete((yypminor->yy219));}
+#line 1248 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 170:
+ case 171:
case 195:
- case 212:
-#line 370 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3SelectDelete((yypminor->yy375));}
-#line 1332 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 197:
+ case 205:
+ case 211:
+ case 219:
+ case 222:
+ case 224:
+ case 225:
+ case 235:
+#line 631 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3ExprDelete((yypminor->yy172));}
+#line 1263 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 176:
- case 177:
+ case 175:
+ case 183:
+ case 193:
+ case 196:
+ case 198:
case 200:
- case 202:
case 210:
- case 216:
- case 230:
-#line 629 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3ExprDelete((yypminor->yy62));}
-#line 1343 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 213:
+ case 214:
+ case 217:
+ case 223:
+#line 865 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3ExprListDelete((yypminor->yy174));}
+#line 1278 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 181:
case 189:
- case 198:
- case 201:
+ case 194:
+ case 202:
case 203:
- case 205:
- case 215:
- case 218:
- case 219:
- case 222:
- case 228:
-#line 876 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3ExprListDelete((yypminor->yy418));}
-#line 1358 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 502 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3SrcListDelete((yypminor->yy373));}
+#line 1286 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 194:
case 199:
- case 207:
- case 208:
-#line 499 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3SrcListDelete((yypminor->yy151));}
-#line 1366 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 204:
-#line 561 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 563 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- sqlite3ExprDelete((yypminor->yy220).pLimit);
- sqlite3ExprDelete((yypminor->yy220).pOffset);
+ sqlite3ExprDelete((yypminor->yy234).pLimit);
+ sqlite3ExprDelete((yypminor->yy234).pOffset);
}
-#line 1374 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1294 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 211:
- case 214:
- case 221:
-#line 517 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3IdListDelete((yypminor->yy240));}
-#line 1381 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 206:
+ case 209:
+ case 216:
+#line 519 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3IdListDelete((yypminor->yy432));}
+#line 1301 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
+ case 231:
case 236:
- case 241:
-#line 969 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3DeleteTriggerStep((yypminor->yy360));}
-#line 1387 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 959 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3DeleteTriggerStep((yypminor->yy243));}
+#line 1307 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 233:
+#line 943 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3IdListDelete((yypminor->yy370).b);}
+#line 1312 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 238:
-#line 953 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3IdListDelete((yypminor->yy30).b);}
-#line 1392 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1027 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3ExprDelete((yypminor->yy386));}
+#line 1317 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
default: break; /* If no destructor action specified: do nothing */
}
@@ -1451,14 +1376,12 @@ void sqlite3ParserFree(
*/
static int yy_find_shift_action(
yyParser *pParser, /* The parser */
- int iLookAhead /* The look-ahead token */
+ YYCODETYPE 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 ){
+ if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
return yy_default[stateno];
}
if( iLookAhead==YYNOCODE ){
@@ -1466,19 +1389,35 @@ static int yy_find_shift_action(
}
i += iLookAhead;
if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
+ if( iLookAhead>0 ){
#ifdef YYFALLBACK
- int iFallback; /* Fallback token */
- if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
- && (iFallback = yyFallback[iLookAhead])!=0 ){
+ 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]);
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
+ yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
+ }
+#endif
+ return yy_find_shift_action(pParser, iFallback);
}
#endif
- return yy_find_shift_action(pParser, iFallback);
+#ifdef YYWILDCARD
+ {
+ int j = i - iLookAhead + YYWILDCARD;
+ if( j>=0 && j<YY_SZ_ACTTAB && yy_lookahead[j]==YYWILDCARD ){
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
+ yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
+ }
+#endif /* NDEBUG */
+ return yy_action[j];
+ }
+ }
+#endif /* YYWILDCARD */
}
-#endif
return yy_default[stateno];
}else{
return yy_action[i];
@@ -1495,13 +1434,13 @@ static int yy_find_shift_action(
*/
static int yy_find_reduce_action(
int stateno, /* Current state number */
- int iLookAhead /* The look-ahead token */
+ YYCODETYPE 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 ){
+ if( stateno>YY_REDUCE_MAX ||
+ (i = yy_reduce_ofst[stateno])==YY_REDUCE_USE_DFLT ){
return yy_default[stateno];
}
if( iLookAhead==YYNOCODE ){
@@ -1537,6 +1476,11 @@ static void yy_shift(
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will execute if the parser
** stack every overflows */
+#line 44 "ext/pdo_sqlite/sqlite/src/parse.y"
+
+ sqlite3ErrorMsg(pParse, "parser stack overflow");
+ pParse->parseError = 1;
+#line 1486 "ext/pdo_sqlite/sqlite/src/parse.c"
sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
return;
}
@@ -1563,317 +1507,315 @@ 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[] = {
+ { 140, 1 },
+ { 141, 2 },
+ { 141, 1 },
+ { 143, 1 },
+ { 142, 1 },
+ { 142, 3 },
+ { 145, 0 },
+ { 145, 1 },
+ { 145, 3 },
+ { 144, 3 },
+ { 147, 0 },
{ 147, 1 },
- { 148, 2 },
- { 148, 1 },
- { 150, 1 },
- { 149, 1 },
- { 149, 3 },
+ { 147, 2 },
+ { 146, 0 },
+ { 146, 1 },
+ { 146, 1 },
+ { 146, 1 },
+ { 144, 2 },
+ { 144, 2 },
+ { 144, 2 },
+ { 144, 2 },
+ { 149, 6 },
{ 152, 0 },
- { 152, 1 },
{ 152, 3 },
- { 151, 3 },
- { 154, 0 },
+ { 151, 1 },
+ { 151, 0 },
+ { 150, 4 },
+ { 150, 2 },
+ { 154, 3 },
{ 154, 1 },
- { 154, 2 },
- { 153, 0 },
- { 153, 1 },
- { 153, 1 },
- { 153, 1 },
- { 151, 2 },
- { 151, 2 },
- { 151, 2 },
- { 151, 2 },
- { 156, 5 },
+ { 157, 3 },
{ 158, 1 },
- { 158, 0 },
- { 157, 4 },
- { 157, 2 },
- { 160, 3 },
- { 160, 1 },
- { 163, 3 },
+ { 161, 1 },
+ { 162, 1 },
+ { 148, 1 },
+ { 148, 1 },
+ { 148, 1 },
+ { 159, 0 },
+ { 159, 1 },
+ { 163, 1 },
+ { 163, 4 },
+ { 163, 6 },
{ 164, 1 },
- { 167, 1 },
- { 168, 1 },
- { 168, 1 },
- { 155, 1 },
- { 155, 1 },
- { 155, 1 },
- { 165, 0 },
+ { 164, 2 },
{ 165, 1 },
- { 169, 1 },
+ { 165, 1 },
+ { 160, 2 },
+ { 160, 0 },
+ { 168, 3 },
+ { 168, 1 },
+ { 168, 2 },
+ { 168, 4 },
+ { 168, 3 },
+ { 168, 3 },
+ { 168, 2 },
+ { 169, 2 },
+ { 169, 3 },
+ { 169, 5 },
+ { 169, 2 },
{ 169, 4 },
- { 169, 6 },
- { 170, 1 },
- { 170, 2 },
- { 171, 1 },
- { 171, 1 },
- { 166, 2 },
- { 166, 0 },
- { 174, 3 },
+ { 169, 4 },
+ { 169, 1 },
+ { 169, 2 },
+ { 174, 0 },
{ 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 },
+ { 176, 0 },
+ { 176, 2 },
+ { 178, 2 },
+ { 178, 3 },
+ { 178, 3 },
+ { 178, 3 },
+ { 179, 2 },
+ { 179, 2 },
+ { 179, 1 },
+ { 179, 1 },
+ { 177, 3 },
+ { 177, 2 },
{ 180, 0 },
- { 180, 1 },
- { 182, 0 },
+ { 180, 2 },
+ { 180, 2 },
+ { 155, 0 },
+ { 155, 2 },
+ { 181, 3 },
+ { 181, 2 },
+ { 181, 1 },
{ 182, 2 },
- { 184, 2 },
- { 184, 3 },
- { 184, 3 },
- { 184, 3 },
- { 185, 2 },
+ { 182, 7 },
+ { 182, 5 },
+ { 182, 5 },
+ { 182, 10 },
+ { 184, 0 },
+ { 184, 1 },
+ { 172, 0 },
+ { 172, 3 },
+ { 185, 0 },
{ 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 },
+ { 186, 1 },
+ { 186, 1 },
+ { 186, 1 },
+ { 144, 4 },
{ 188, 2 },
- { 188, 7 },
- { 188, 5 },
- { 188, 3 },
- { 188, 10 },
- { 190, 0 },
- { 190, 1 },
- { 178, 0 },
- { 178, 3 },
- { 191, 0 },
+ { 188, 0 },
+ { 144, 7 },
+ { 144, 4 },
+ { 144, 1 },
+ { 156, 1 },
+ { 156, 3 },
+ { 191, 1 },
{ 191, 2 },
+ { 191, 1 },
+ { 190, 9 },
{ 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 },
+ { 192, 0 },
+ { 200, 2 },
+ { 200, 0 },
+ { 193, 3 },
+ { 193, 2 },
+ { 193, 4 },
+ { 201, 2 },
+ { 201, 1 },
+ { 201, 0 },
+ { 194, 0 },
+ { 194, 2 },
+ { 203, 2 },
+ { 203, 0 },
+ { 202, 6 },
+ { 202, 7 },
+ { 207, 1 },
+ { 207, 1 },
+ { 153, 0 },
+ { 153, 2 },
+ { 189, 2 },
+ { 204, 1 },
+ { 204, 2 },
+ { 204, 3 },
+ { 204, 4 },
{ 205, 2 },
{ 205, 0 },
- { 198, 3 },
- { 198, 2 },
- { 198, 4 },
- { 206, 2 },
- { 206, 1 },
+ { 206, 4 },
{ 206, 0 },
+ { 198, 0 },
+ { 198, 3 },
+ { 210, 5 },
+ { 210, 3 },
+ { 211, 1 },
+ { 173, 1 },
+ { 173, 1 },
+ { 173, 0 },
+ { 212, 0 },
+ { 212, 2 },
+ { 196, 0 },
+ { 196, 3 },
+ { 197, 0 },
+ { 197, 2 },
{ 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 },
+ { 199, 4 },
+ { 199, 4 },
+ { 144, 4 },
+ { 195, 0 },
+ { 195, 2 },
+ { 144, 6 },
+ { 214, 5 },
+ { 214, 3 },
+ { 144, 8 },
+ { 144, 5 },
+ { 215, 2 },
+ { 215, 1 },
+ { 217, 3 },
+ { 217, 1 },
+ { 216, 0 },
+ { 216, 3 },
{ 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 },
+ { 209, 1 },
+ { 171, 1 },
+ { 171, 3 },
+ { 170, 1 },
+ { 171, 1 },
+ { 171, 1 },
+ { 171, 3 },
+ { 171, 5 },
+ { 170, 1 },
+ { 170, 1 },
+ { 171, 1 },
+ { 171, 1 },
+ { 171, 6 },
+ { 171, 5 },
+ { 171, 4 },
+ { 170, 1 },
+ { 171, 3 },
+ { 171, 3 },
+ { 171, 3 },
+ { 171, 3 },
+ { 171, 3 },
+ { 171, 3 },
+ { 171, 3 },
+ { 171, 3 },
+ { 218, 1 },
+ { 218, 2 },
+ { 218, 1 },
+ { 218, 2 },
+ { 219, 2 },
+ { 219, 0 },
+ { 171, 4 },
+ { 171, 2 },
+ { 171, 3 },
+ { 171, 3 },
+ { 171, 4 },
+ { 171, 2 },
+ { 171, 2 },
+ { 171, 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 },
+ { 220, 2 },
+ { 171, 5 },
+ { 221, 1 },
+ { 221, 2 },
+ { 171, 5 },
+ { 171, 3 },
+ { 171, 5 },
+ { 171, 4 },
+ { 171, 4 },
+ { 171, 5 },
+ { 223, 5 },
+ { 223, 4 },
{ 224, 2 },
{ 224, 0 },
- { 177, 4 },
- { 177, 2 },
- { 177, 3 },
- { 177, 2 },
- { 177, 3 },
- { 177, 4 },
- { 177, 2 },
- { 177, 2 },
- { 177, 2 },
- { 177, 2 },
+ { 222, 1 },
+ { 222, 0 },
+ { 213, 3 },
+ { 213, 1 },
{ 225, 1 },
- { 225, 2 },
- { 177, 5 },
+ { 225, 0 },
+ { 144, 11 },
{ 226, 1 },
- { 226, 2 },
- { 177, 5 },
- { 177, 3 },
- { 177, 5 },
- { 177, 4 },
- { 177, 4 },
- { 177, 5 },
- { 228, 5 },
- { 228, 4 },
- { 229, 2 },
- { 229, 0 },
+ { 226, 0 },
+ { 175, 0 },
+ { 175, 3 },
+ { 183, 5 },
+ { 183, 3 },
{ 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 },
+ { 144, 4 },
+ { 144, 1 },
+ { 144, 2 },
+ { 144, 5 },
+ { 144, 5 },
+ { 144, 5 },
+ { 144, 5 },
+ { 144, 6 },
+ { 144, 3 },
+ { 166, 2 },
+ { 167, 2 },
+ { 229, 1 },
+ { 228, 1 },
+ { 228, 0 },
+ { 144, 5 },
+ { 230, 10 },
{ 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 },
+ { 232, 1 },
+ { 232, 2 },
+ { 232, 0 },
{ 233, 1 },
- { 233, 0 },
- { 151, 5 },
- { 235, 10 },
- { 237, 1 },
+ { 233, 1 },
+ { 233, 3 },
+ { 234, 0 },
+ { 234, 3 },
+ { 234, 3 },
+ { 235, 0 },
+ { 235, 2 },
+ { 231, 3 },
+ { 231, 0 },
+ { 236, 6 },
+ { 236, 8 },
+ { 236, 5 },
+ { 236, 4 },
+ { 236, 1 },
+ { 171, 4 },
+ { 171, 6 },
+ { 187, 1 },
+ { 187, 1 },
+ { 187, 1 },
+ { 144, 3 },
+ { 144, 6 },
+ { 238, 0 },
+ { 238, 2 },
{ 237, 1 },
- { 237, 2 },
{ 237, 0 },
- { 238, 1 },
- { 238, 1 },
- { 238, 1 },
- { 238, 3 },
- { 239, 0 },
- { 239, 3 },
- { 239, 3 },
+ { 144, 3 },
+ { 144, 1 },
+ { 144, 3 },
+ { 144, 1 },
+ { 144, 3 },
+ { 144, 6 },
+ { 144, 6 },
+ { 239, 1 },
{ 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 },
+ { 240, 1 },
+ { 144, 1 },
+ { 144, 4 },
+ { 241, 7 },
+ { 242, 1 },
+ { 242, 3 },
{ 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 },
+ { 244, 3 },
{ 245, 1 },
+ { 246, 0 },
+ { 246, 2 },
};
static void yy_accept(yyParser*); /* Forward Declaration */
@@ -1895,7 +1837,7 @@ static void yy_reduce(
yymsp = &yypParser->yystack[yypParser->yyidx];
#ifndef NDEBUG
if( yyTraceFILE && yyruleno>=0
- && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
+ && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
yyRuleName[yyruleno]);
}
@@ -1923,777 +1865,781 @@ static void yy_reduce(
** break;
*/
case 3:
-#line 102 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 100 "ext/pdo_sqlite/sqlite/src/parse.y"
{ sqlite3FinishCoding(pParse); }
-#line 1930 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1873 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 6:
-#line 105 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 103 "ext/pdo_sqlite/sqlite/src/parse.y"
{ sqlite3BeginParse(pParse, 0); }
-#line 1935 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1878 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 7:
-#line 107 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 105 "ext/pdo_sqlite/sqlite/src/parse.y"
{ sqlite3BeginParse(pParse, 1); }
-#line 1940 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1883 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 8:
-#line 108 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 106 "ext/pdo_sqlite/sqlite/src/parse.y"
{ sqlite3BeginParse(pParse, 2); }
-#line 1945 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1888 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 9:
-#line 114 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy280);}
-#line 1950 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 112 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy46);}
+#line 1893 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 13:
-#line 119 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = TK_DEFERRED;}
-#line 1955 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 117 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = TK_DEFERRED;}
+#line 1898 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 14:
case 15:
case 16:
- case 104:
- case 106:
case 107:
-#line 120 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = yymsp[0].major;}
-#line 1965 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 109:
+#line 118 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = yymsp[0].major;}
+#line 1907 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 17:
case 18:
-#line 123 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 121 "ext/pdo_sqlite/sqlite/src/parse.y"
{sqlite3CommitTransaction(pParse);}
-#line 1971 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1913 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 19:
-#line 125 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 123 "ext/pdo_sqlite/sqlite/src/parse.y"
{sqlite3RollbackTransaction(pParse);}
-#line 1976 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1918 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 21:
-#line 130 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 128 "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);
+ sqlite3StartTable(pParse,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410,yymsp[-4].minor.yy46,0,0,yymsp[-2].minor.yy46);
}
-#line 1983 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1925 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 22:
+ case 25:
case 63:
case 77:
- case 109:
- case 224:
- case 227:
-#line 135 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = 1;}
-#line 1993 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 79:
+ case 90:
+ case 101:
+ case 112:
+ case 113:
+ case 212:
+ case 215:
+#line 132 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = 0;}
+#line 1940 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 23:
- case 62:
- case 76:
+ case 24:
+ case 64:
case 78:
- case 89:
- case 110:
+ case 100:
case 111:
- case 223:
- case 226:
-#line 137 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = 0;}
-#line 2006 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 213:
+ case 216:
+#line 133 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = 1;}
+#line 1952 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 24:
-#line 138 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 26:
+#line 139 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- sqlite3EndTable(pParse,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy0,0);
+ sqlite3EndTable(pParse,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy0,0);
}
-#line 2013 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1959 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 25:
-#line 141 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 27:
+#line 142 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy375);
- sqlite3SelectDelete(yymsp[0].minor.yy375);
+ sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy219);
+ sqlite3SelectDelete(yymsp[0].minor.yy219);
}
-#line 2021 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1967 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 28:
-#line 153 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 30:
+#line 154 "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;
+ yygotominor.yy410.z = yymsp[-2].minor.yy410.z;
+ yygotominor.yy410.n = (pParse->sLastToken.z-yymsp[-2].minor.yy410.z) + pParse->sLastToken.n;
}
-#line 2029 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1975 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 29:
-#line 157 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 31:
+#line 158 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- sqlite3AddColumn(pParse,&yymsp[0].minor.yy198);
- yygotominor.yy198 = yymsp[0].minor.yy198;
+ sqlite3AddColumn(pParse,&yymsp[0].minor.yy410);
+ yygotominor.yy410 = yymsp[0].minor.yy410;
}
-#line 2037 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1983 "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 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy198 = yymsp[0].minor.yy0;}
-#line 2049 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 37:
-#line 227 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy198);}
-#line 2054 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 36:
+ case 252:
+#line 168 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy410 = yymsp[0].minor.yy0;}
+#line 1993 "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 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy198 = yymsp[0].minor.yy198;}
-#line 2067 "ext/pdo_sqlite/sqlite/src/parse.c"
+{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy410);}
+#line 1998 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 39:
+ case 42:
+ case 119:
+ case 120:
+ case 131:
+ case 150:
+ case 240:
+ case 250:
+ case 251:
#line 229 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
+{yygotominor.yy410 = yymsp[0].minor.yy410;}
+#line 2011 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 40:
-#line 233 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 230 "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;
+ yygotominor.yy410.z = yymsp[-3].minor.yy410.z;
+ yygotominor.yy410.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy410.z;
}
-#line 2083 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2019 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 42:
-#line 239 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 41:
+#line 234 "ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy410.z = yymsp[-5].minor.yy410.z;
+ yygotominor.yy410.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy410.z;
+}
+#line 2027 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 43:
-#line 241 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = atoi(yymsp[0].minor.yy198.z); }
-#line 2093 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 240 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy410.z=yymsp[-1].minor.yy410.z; yygotominor.yy410.n=yymsp[0].minor.yy410.n+(yymsp[0].minor.yy410.z-yymsp[-1].minor.yy410.z);}
+#line 2032 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 44:
#line 242 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = -atoi(yymsp[0].minor.yy198.z); }
-#line 2098 "ext/pdo_sqlite/sqlite/src/parse.c"
+{ yygotominor.yy46 = atoi((char*)yymsp[0].minor.yy410.z); }
+#line 2037 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 49:
- case 51:
-#line 251 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy62);}
-#line 2104 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 45:
+#line 243 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy46 = -atoi((char*)yymsp[0].minor.yy410.z); }
+#line 2042 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 50:
+ case 52:
#line 252 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy62);}
-#line 2109 "ext/pdo_sqlite/sqlite/src/parse.c"
+{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy172);}
+#line 2048 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 52:
-#line 254 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 51:
+#line 253 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy172);}
+#line 2053 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 53:
+#line 255 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- Expr *p = sqlite3Expr(TK_UMINUS, yymsp[0].minor.yy62, 0, 0);
+ Expr *p = sqlite3Expr(TK_UMINUS, yymsp[0].minor.yy172, 0, 0);
sqlite3AddDefaultValue(pParse,p);
}
-#line 2117 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2061 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 53:
-#line 258 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 54:
+#line 259 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- Expr *p = sqlite3Expr(TK_STRING, 0, 0, &yymsp[0].minor.yy198);
+ Expr *p = sqlite3Expr(TK_STRING, 0, 0, &yymsp[0].minor.yy410);
sqlite3AddDefaultValue(pParse,p);
}
-#line 2125 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 55:
-#line 267 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3AddNotNull(pParse, yymsp[0].minor.yy280);}
-#line 2130 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2069 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 56:
-#line 269 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy280,yymsp[0].minor.yy280);}
-#line 2135 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 268 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddNotNull(pParse, yymsp[0].minor.yy46);}
+#line 2074 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 57:
#line 270 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy280,0,0);}
-#line 2140 "ext/pdo_sqlite/sqlite/src/parse.c"
+{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy46,yymsp[0].minor.yy46,yymsp[-2].minor.yy46);}
+#line 2079 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 58:
#line 271 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3ExprDelete(yymsp[-2].minor.yy62);}
-#line 2145 "ext/pdo_sqlite/sqlite/src/parse.c"
+{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy46,0,0,0,0);}
+#line 2084 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 59:
-#line 273 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy198,yymsp[-1].minor.yy418,yymsp[0].minor.yy280);}
-#line 2150 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 272 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy172);}
+#line 2089 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 60:
#line 274 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy280);}
-#line 2155 "ext/pdo_sqlite/sqlite/src/parse.c"
+{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy410,yymsp[-1].minor.yy174,yymsp[0].minor.yy46);}
+#line 2094 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 61:
#line 275 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3AddCollateType(pParse, yymsp[0].minor.yy198.z, yymsp[0].minor.yy198.n);}
-#line 2160 "ext/pdo_sqlite/sqlite/src/parse.c"
+{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy46);}
+#line 2099 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 64:
-#line 288 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = OE_Restrict * 0x010101; }
-#line 2165 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 62:
+#line 276 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddCollateType(pParse, (char*)yymsp[0].minor.yy410.z, yymsp[0].minor.yy410.n);}
+#line 2104 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 65:
#line 289 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
+{ yygotominor.yy46 = OE_Restrict * 0x010101; }
+#line 2109 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 66:
-#line 291 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy359.value = 0; yygotominor.yy359.mask = 0x000000; }
-#line 2175 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 290 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy46 = (yymsp[-1].minor.yy46 & yymsp[0].minor.yy405.mask) | yymsp[0].minor.yy405.value; }
+#line 2114 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 67:
#line 292 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy359.value = yymsp[0].minor.yy280; yygotominor.yy359.mask = 0x0000ff; }
-#line 2180 "ext/pdo_sqlite/sqlite/src/parse.c"
+{ yygotominor.yy405.value = 0; yygotominor.yy405.mask = 0x000000; }
+#line 2119 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 68:
#line 293 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy359.value = yymsp[0].minor.yy280<<8; yygotominor.yy359.mask = 0x00ff00; }
-#line 2185 "ext/pdo_sqlite/sqlite/src/parse.c"
+{ yygotominor.yy405.value = yymsp[0].minor.yy46; yygotominor.yy405.mask = 0x0000ff; }
+#line 2124 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 69:
#line 294 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy359.value = yymsp[0].minor.yy280<<16; yygotominor.yy359.mask = 0xff0000; }
-#line 2190 "ext/pdo_sqlite/sqlite/src/parse.c"
+{ yygotominor.yy405.value = yymsp[0].minor.yy46<<8; yygotominor.yy405.mask = 0x00ff00; }
+#line 2129 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 70:
-#line 296 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = OE_SetNull; }
-#line 2195 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 295 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy405.value = yymsp[0].minor.yy46<<16; yygotominor.yy405.mask = 0xff0000; }
+#line 2134 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 71:
#line 297 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = OE_SetDflt; }
-#line 2200 "ext/pdo_sqlite/sqlite/src/parse.c"
+{ yygotominor.yy46 = OE_SetNull; }
+#line 2139 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 72:
#line 298 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = OE_Cascade; }
-#line 2205 "ext/pdo_sqlite/sqlite/src/parse.c"
+{ yygotominor.yy46 = OE_SetDflt; }
+#line 2144 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 73:
#line 299 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = OE_Restrict; }
-#line 2210 "ext/pdo_sqlite/sqlite/src/parse.c"
+{ yygotominor.yy46 = OE_Cascade; }
+#line 2149 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 74:
+#line 300 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy46 = OE_Restrict; }
+#line 2154 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
case 75:
- case 90:
- case 92:
- case 94:
+ case 76:
+ case 91:
+ case 93:
case 95:
- case 166:
-#line 301 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = yymsp[0].minor.yy280;}
-#line 2221 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 79:
-#line 311 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy198.n = 0; yygotominor.yy198.z = 0;}
-#line 2226 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 96:
+ case 167:
+#line 302 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = yymsp[0].minor.yy46;}
+#line 2165 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 80:
#line 312 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy198 = yymsp[-1].minor.yy0;}
-#line 2231 "ext/pdo_sqlite/sqlite/src/parse.c"
+{yygotominor.yy410.n = 0; yygotominor.yy410.z = 0;}
+#line 2170 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 85:
-#line 318 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy418,yymsp[0].minor.yy280,yymsp[-2].minor.yy280);}
-#line 2236 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 81:
+#line 313 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy410 = yymsp[-1].minor.yy0;}
+#line 2175 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 86:
-#line 320 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy418,yymsp[0].minor.yy280,0,0);}
-#line 2241 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 319 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy174,yymsp[0].minor.yy46,yymsp[-2].minor.yy46,0);}
+#line 2180 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 87:
+#line 321 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy174,yymsp[0].minor.yy46,0,0,0,0);}
+#line 2185 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 88:
-#line 323 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 322 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy172);}
+#line 2190 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 89:
+#line 324 "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);
+ sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy174, &yymsp[-3].minor.yy410, yymsp[-2].minor.yy174, yymsp[-1].minor.yy46);
+ sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy46);
}
-#line 2249 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 91:
- case 93:
-#line 337 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = OE_Default;}
-#line 2255 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2198 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 96:
-#line 342 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = OE_Ignore;}
-#line 2260 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 92:
+ case 94:
+#line 338 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = OE_Default;}
+#line 2204 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 97:
- case 167:
#line 343 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = OE_Replace;}
-#line 2266 "ext/pdo_sqlite/sqlite/src/parse.c"
+{yygotominor.yy46 = OE_Ignore;}
+#line 2209 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 98:
-#line 347 "ext/pdo_sqlite/sqlite/src/parse.y"
-{
- sqlite3DropTable(pParse, yymsp[0].minor.yy151, 0);
-}
-#line 2273 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 168:
+#line 344 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = OE_Replace;}
+#line 2215 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 99:
-#line 354 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 348 "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);
+ sqlite3DropTable(pParse, yymsp[0].minor.yy373, 0, yymsp[-1].minor.yy46);
}
-#line 2280 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2222 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 100:
-#line 357 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 102:
+#line 358 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- sqlite3DropTable(pParse, yymsp[0].minor.yy151, 1);
+ sqlite3CreateView(pParse, &yymsp[-6].minor.yy0, &yymsp[-3].minor.yy410, &yymsp[-2].minor.yy410, yymsp[0].minor.yy219, yymsp[-5].minor.yy46);
}
-#line 2287 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2229 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 101:
-#line 364 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 103:
+#line 361 "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);
+ sqlite3DropTable(pParse, yymsp[0].minor.yy373, 1, yymsp[-1].minor.yy46);
}
-#line 2295 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 102:
- case 126:
-#line 374 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy375 = yymsp[0].minor.yy375;}
-#line 2301 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2236 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 103:
-#line 376 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 104:
+#line 368 "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;
+ sqlite3Select(pParse, yymsp[0].minor.yy219, SRT_Callback, 0, 0, 0, 0, 0);
+ sqlite3SelectDelete(yymsp[0].minor.yy219);
}
-#line 2312 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2244 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 105:
-#line 385 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = TK_ALL;}
-#line 2317 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 128:
+#line 378 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy219 = yymsp[0].minor.yy219;}
+#line 2250 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 108:
-#line 390 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 106:
+#line 380 "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);
+ if( yymsp[0].minor.yy219 ){
+ yymsp[0].minor.yy219->op = yymsp[-1].minor.yy46;
+ yymsp[0].minor.yy219->pPrior = yymsp[-2].minor.yy219;
+ }
+ yygotominor.yy219 = yymsp[0].minor.yy219;
}
-#line 2324 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2261 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 112:
- case 248:
-#line 411 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy418 = yymsp[-1].minor.yy418;}
-#line 2330 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 113:
- case 140:
- case 150:
- case 247:
-#line 412 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy418 = 0;}
-#line 2338 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 108:
+#line 389 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = TK_ALL;}
+#line 2266 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 114:
-#line 413 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 110:
+#line 393 "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);
+ yygotominor.yy219 = sqlite3SelectNew(yymsp[-6].minor.yy174,yymsp[-5].minor.yy373,yymsp[-4].minor.yy172,yymsp[-3].minor.yy174,yymsp[-2].minor.yy172,yymsp[-1].minor.yy174,yymsp[-7].minor.yy46,yymsp[0].minor.yy234.pLimit,yymsp[0].minor.yy234.pOffset);
}
-#line 2345 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2273 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 114:
+ case 237:
+#line 414 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy174 = yymsp[-1].minor.yy174;}
+#line 2279 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 115:
+ case 141:
+ case 151:
+ case 236:
+#line 415 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy174 = 0;}
+#line 2287 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 116:
#line 416 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-1].minor.yy418, sqlite3Expr(TK_ALL, 0, 0, 0), 0);
+ yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-2].minor.yy174,yymsp[-1].minor.yy172,yymsp[0].minor.yy410.n?&yymsp[0].minor.yy410:0);
}
-#line 2352 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2294 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 116:
+ case 117:
#line 419 "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);
+ yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-1].minor.yy174, sqlite3Expr(TK_ALL, 0, 0, 0), 0);
}
-#line 2361 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 119:
-#line 431 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy198.n = 0;}
-#line 2366 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2301 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 120:
-#line 443 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy151 = sqliteMalloc(sizeof(*yygotominor.yy151));}
-#line 2371 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 118:
+#line 422 "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.yy410);
+ yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-3].minor.yy174, sqlite3Expr(TK_DOT, pLeft, pRight, 0), 0);
+}
+#line 2310 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 121:
-#line 444 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy151 = yymsp[0].minor.yy151;}
-#line 2376 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 434 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy410.n = 0;}
+#line 2315 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 122:
-#line 449 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 446 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy373 = sqliteMalloc(sizeof(*yygotominor.yy373));}
+#line 2320 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 123:
-#line 453 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy151 = 0;}
-#line 2389 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 447 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy373 = yymsp[0].minor.yy373;}
+#line 2325 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 124:
-#line 454 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 452 "ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy373 = yymsp[-1].minor.yy373;
+ if( yygotominor.yy373 && yygotominor.yy373->nSrc>0 ) yygotominor.yy373->a[yygotominor.yy373->nSrc-1].jointype = yymsp[0].minor.yy46;
+}
+#line 2333 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 125:
+#line 456 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy373 = 0;}
+#line 2338 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 126:
+#line 457 "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); }
+ yygotominor.yy373 = sqlite3SrcListAppend(yymsp[-5].minor.yy373,&yymsp[-4].minor.yy410,&yymsp[-3].minor.yy410);
+ if( yymsp[-2].minor.yy410.n ) sqlite3SrcListAddAlias(yygotominor.yy373,&yymsp[-2].minor.yy410);
+ if( yymsp[-1].minor.yy172 ){
+ if( yygotominor.yy373 && yygotominor.yy373->nSrc>1 ){ yygotominor.yy373->a[yygotominor.yy373->nSrc-2].pOn = yymsp[-1].minor.yy172; }
+ else { sqlite3ExprDelete(yymsp[-1].minor.yy172); }
}
- 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); }
+ if( yymsp[0].minor.yy432 ){
+ if( yygotominor.yy373 && yygotominor.yy373->nSrc>1 ){ yygotominor.yy373->a[yygotominor.yy373->nSrc-2].pUsing = yymsp[0].minor.yy432; }
+ else { sqlite3IdListDelete(yymsp[0].minor.yy432); }
}
}
-#line 2405 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2354 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 125:
-#line 468 "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); }
+ case 127:
+#line 471 "ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy373 = sqlite3SrcListAppend(yymsp[-6].minor.yy373,0,0);
+ if( yygotominor.yy373 && yygotominor.yy373->nSrc>0 ) yygotominor.yy373->a[yygotominor.yy373->nSrc-1].pSelect = yymsp[-4].minor.yy219;
+ if( yymsp[-2].minor.yy410.n ) sqlite3SrcListAddAlias(yygotominor.yy373,&yymsp[-2].minor.yy410);
+ if( yymsp[-1].minor.yy172 ){
+ if( yygotominor.yy373 && yygotominor.yy373->nSrc>1 ){ yygotominor.yy373->a[yygotominor.yy373->nSrc-2].pOn = yymsp[-1].minor.yy172; }
+ else { sqlite3ExprDelete(yymsp[-1].minor.yy172); }
}
- 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); }
+ if( yymsp[0].minor.yy432 ){
+ if( yygotominor.yy373 && yygotominor.yy373->nSrc>1 ){ yygotominor.yy373->a[yygotominor.yy373->nSrc-2].pUsing = yymsp[0].minor.yy432; }
+ else { sqlite3IdListDelete(yymsp[0].minor.yy432); }
}
}
-#line 2422 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2371 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 127:
-#line 489 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 129:
+#line 492 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- yygotominor.yy375 = sqlite3SelectNew(0,yymsp[0].minor.yy151,0,0,0,0,0,0,0);
+ yygotominor.yy219 = sqlite3SelectNew(0,yymsp[0].minor.yy373,0,0,0,0,0,0,0);
}
-#line 2429 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 128:
-#line 495 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy198.z=0; yygotominor.yy198.n=0;}
-#line 2434 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2378 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 130:
-#line 500 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy151 = sqlite3SrcListAppend(0,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy198);}
-#line 2439 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 498 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy410.z=0; yygotominor.yy410.n=0;}
+#line 2383 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 131:
case 132:
-#line 504 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = JT_INNER; }
-#line 2445 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 503 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy373 = sqlite3SrcListAppend(0,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410);}
+#line 2388 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 133:
-#line 506 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
-#line 2450 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 507 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy46 = JT_INNER; }
+#line 2393 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 134:
-#line 507 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy198,0); }
-#line 2455 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 508 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy46 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
+#line 2398 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 135:
#line 509 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
+{ yygotominor.yy46 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy410,0); }
+#line 2403 "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 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy62 = yymsp[0].minor.yy62;}
-#line 2473 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 511 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy46 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy410,&yymsp[-1].minor.yy410); }
+#line 2408 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 137:
- case 152:
- case 159:
- case 212:
- case 237:
- case 239:
- case 243:
-#line 514 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy62 = 0;}
-#line 2484 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 145:
+ case 154:
+ case 161:
+ case 175:
+ case 202:
+ case 225:
+ case 227:
+ case 231:
+#line 515 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy172 = yymsp[0].minor.yy172;}
+#line 2421 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 138:
- case 171:
-#line 518 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy240 = yymsp[-1].minor.yy240;}
-#line 2490 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 153:
+ case 160:
+ case 203:
+ case 226:
+ case 228:
+ case 232:
+#line 516 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy172 = 0;}
+#line 2432 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 139:
- case 170:
-#line 519 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy240 = 0;}
-#line 2496 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 172:
+#line 520 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy432 = yymsp[-1].minor.yy432;}
+#line 2438 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 141:
- case 151:
-#line 530 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy418 = yymsp[0].minor.yy418;}
-#line 2502 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 140:
+ case 171:
+#line 521 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy432 = 0;}
+#line 2444 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 142:
-#line 531 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 152:
+#line 532 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy174 = yymsp[0].minor.yy174;}
+#line 2450 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 143:
-#line 535 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 533 "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;
+ yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-4].minor.yy174,yymsp[-2].minor.yy172,yymsp[-1].minor.yy410.n>0?&yymsp[-1].minor.yy410:0);
+ if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
}
-#line 2518 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2458 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 145:
- case 147:
-#line 544 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = SQLITE_SO_ASC;}
-#line 2524 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 144:
+#line 537 "ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy174 = sqlite3ExprListAppend(0,yymsp[-2].minor.yy172,yymsp[-1].minor.yy410.n>0?&yymsp[-1].minor.yy410:0);
+ if( yygotominor.yy174 && yygotominor.yy174->a ) yygotominor.yy174->a[0].sortOrder = yymsp[0].minor.yy46;
+}
+#line 2466 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 146:
-#line 545 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = SQLITE_SO_DESC;}
-#line 2529 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
case 148:
+#line 546 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = SQLITE_SO_ASC;}
+#line 2472 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 147:
#line 547 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy198.z = 0; yygotominor.yy198.n = 0;}
-#line 2534 "ext/pdo_sqlite/sqlite/src/parse.c"
+{yygotominor.yy46 = SQLITE_SO_DESC;}
+#line 2477 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 154:
-#line 565 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy220.pLimit = 0; yygotominor.yy220.pOffset = 0;}
-#line 2539 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 149:
+#line 549 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy410.z = 0; yygotominor.yy410.n = 0;}
+#line 2482 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 155:
-#line 566 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy220.pLimit = yymsp[0].minor.yy62; yygotominor.yy220.pOffset = 0;}
-#line 2544 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 567 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy234.pLimit = 0; yygotominor.yy234.pOffset = 0;}
+#line 2487 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 156:
#line 568 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy220.pLimit = yymsp[-2].minor.yy62; yygotominor.yy220.pOffset = yymsp[0].minor.yy62;}
-#line 2549 "ext/pdo_sqlite/sqlite/src/parse.c"
+{yygotominor.yy234.pLimit = yymsp[0].minor.yy172; yygotominor.yy234.pOffset = 0;}
+#line 2492 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 157:
#line 570 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy220.pOffset = yymsp[-2].minor.yy62; yygotominor.yy220.pLimit = yymsp[0].minor.yy62;}
-#line 2554 "ext/pdo_sqlite/sqlite/src/parse.c"
+{yygotominor.yy234.pLimit = yymsp[-2].minor.yy172; yygotominor.yy234.pOffset = yymsp[0].minor.yy172;}
+#line 2497 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 158:
-#line 574 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3DeleteFrom(pParse,yymsp[-1].minor.yy151,yymsp[0].minor.yy62);}
-#line 2559 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 572 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy234.pOffset = yymsp[-2].minor.yy172; yygotominor.yy234.pLimit = yymsp[0].minor.yy172;}
+#line 2502 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 161:
-#line 585 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 159:
+#line 576 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3DeleteFrom(pParse,yymsp[-1].minor.yy373,yymsp[0].minor.yy172);}
+#line 2507 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 162:
-#line 591 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-4].minor.yy418,yymsp[0].minor.yy62,&yymsp[-2].minor.yy198);}
-#line 2569 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 587 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Update(pParse,yymsp[-3].minor.yy373,yymsp[-1].minor.yy174,yymsp[0].minor.yy172,yymsp[-4].minor.yy46);}
+#line 2512 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 163:
-#line 592 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy418 = sqlite3ExprListAppend(0,yymsp[0].minor.yy62,&yymsp[-2].minor.yy198);}
-#line 2574 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 593 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-4].minor.yy174,yymsp[0].minor.yy172,&yymsp[-2].minor.yy410);}
+#line 2517 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 164:
-#line 598 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 594 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy174 = sqlite3ExprListAppend(0,yymsp[0].minor.yy172,&yymsp[-2].minor.yy410);}
+#line 2522 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 165:
#line 600 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
+{sqlite3Insert(pParse, yymsp[-5].minor.yy373, yymsp[-1].minor.yy174, 0, yymsp[-4].minor.yy432, yymsp[-7].minor.yy46);}
+#line 2527 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 168:
- case 240:
-#line 610 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-2].minor.yy418,yymsp[0].minor.yy62,0);}
-#line 2590 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 166:
+#line 602 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Insert(pParse, yymsp[-2].minor.yy373, 0, yymsp[0].minor.yy219, yymsp[-1].minor.yy432, yymsp[-4].minor.yy46);}
+#line 2532 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 169:
- case 241:
-#line 611 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy418 = sqlite3ExprListAppend(0,yymsp[0].minor.yy62,0);}
-#line 2596 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 229:
+#line 612 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-2].minor.yy174,yymsp[0].minor.yy172,0);}
+#line 2538 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 172:
-#line 620 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy240 = sqlite3IdListAppend(yymsp[-2].minor.yy240,&yymsp[0].minor.yy198);}
-#line 2601 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 170:
+ case 230:
+#line 613 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy174 = sqlite3ExprListAppend(0,yymsp[0].minor.yy172,0);}
+#line 2544 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 173:
-#line 621 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy240 = sqlite3IdListAppend(0,&yymsp[0].minor.yy198);}
-#line 2606 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 622 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy432 = sqlite3IdListAppend(yymsp[-2].minor.yy432,&yymsp[0].minor.yy410);}
+#line 2549 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 175:
-#line 632 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 174:
+#line 623 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy432 = sqlite3IdListAppend(0,&yymsp[0].minor.yy410);}
+#line 2554 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 176:
- case 181:
+#line 634 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy172 = yymsp[-1].minor.yy172; sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); }
+#line 2559 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 177:
case 182:
case 183:
- case 184:
-#line 633 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy62 = sqlite3Expr(yymsp[0].major, 0, 0, &yymsp[0].minor.yy0);}
-#line 2620 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 635 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy172 = sqlite3Expr(yymsp[0].major, 0, 0, &yymsp[0].minor.yy0);}
+#line 2566 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 177:
case 178:
-#line 634 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy62 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy0);}
-#line 2626 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
case 179:
#line 636 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy172 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy0);}
+#line 2572 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 180:
+#line 638 "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);
+ Expr *temp1 = sqlite3Expr(TK_ID, 0, 0, &yymsp[-2].minor.yy410);
+ Expr *temp2 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy410);
+ yygotominor.yy172 = sqlite3Expr(TK_DOT, temp1, temp2, 0);
}
-#line 2635 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2581 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 180:
-#line 641 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 181:
+#line 643 "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 *temp1 = sqlite3Expr(TK_ID, 0, 0, &yymsp[-4].minor.yy410);
+ Expr *temp2 = sqlite3Expr(TK_ID, 0, 0, &yymsp[-2].minor.yy410);
+ Expr *temp3 = sqlite3Expr(TK_ID, 0, 0, &yymsp[0].minor.yy410);
Expr *temp4 = sqlite3Expr(TK_DOT, temp2, temp3, 0);
- yygotominor.yy62 = sqlite3Expr(TK_DOT, temp1, temp4, 0);
+ yygotominor.yy172 = sqlite3Expr(TK_DOT, temp1, temp4, 0);
}
-#line 2646 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2592 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 185:
+ case 184:
#line 652 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy62 = sqlite3RegisterExpr(pParse, &yymsp[0].minor.yy0);}
-#line 2651 "ext/pdo_sqlite/sqlite/src/parse.c"
+{yygotominor.yy172 = sqlite3RegisterExpr(pParse, &yymsp[0].minor.yy0);}
+#line 2597 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 186:
+ case 185:
#line 653 "ext/pdo_sqlite/sqlite/src/parse.y"
{
Token *pToken = &yymsp[0].minor.yy0;
- Expr *pExpr = yygotominor.yy62 = sqlite3Expr(TK_VARIABLE, 0, 0, pToken);
+ Expr *pExpr = yygotominor.yy172 = sqlite3Expr(TK_VARIABLE, 0, 0, pToken);
sqlite3ExprAssignVarNumber(pParse, pExpr);
}
-#line 2660 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2606 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 187:
+ case 186:
#line 659 "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);
+ yygotominor.yy172 = sqlite3Expr(TK_CAST, yymsp[-3].minor.yy172, 0, &yymsp[-1].minor.yy410);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
}
-#line 2668 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2614 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 188:
+ case 187:
#line 664 "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;
+ yygotominor.yy172 = sqlite3ExprFunction(yymsp[-1].minor.yy174, &yymsp[-4].minor.yy0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
+ if( yymsp[-2].minor.yy46 && yygotominor.yy172 ){
+ yygotominor.yy172->flags |= EP_Distinct;
}
}
-#line 2679 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2625 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 189:
+ case 188:
#line 671 "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);
+ yygotominor.yy172 = sqlite3ExprFunction(0, &yymsp[-3].minor.yy0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
}
-#line 2687 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2633 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 190:
+ case 189:
#line 675 "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;
+ yygotominor.yy172 = sqlite3ExprFunction(0,&yymsp[0].minor.yy0);
+ if( yygotominor.yy172 ) yygotominor.yy172->op = TK_CONST_FUNC;
}
-#line 2697 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2643 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
+ case 190:
case 191:
case 192:
case 193:
@@ -2701,516 +2647,534 @@ static void yy_reduce(
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 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy62 = sqlite3Expr(yymsp[-1].major, yymsp[-2].minor.yy62, yymsp[0].minor.yy62, 0);}
-#line 2719 "ext/pdo_sqlite/sqlite/src/parse.c"
+{yygotominor.yy172 = sqlite3Expr(yymsp[-1].major, yymsp[-2].minor.yy172, yymsp[0].minor.yy172, 0);}
+#line 2655 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 209:
-#line 700 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy222.operator = yymsp[0].minor.yy0; yygotominor.yy222.not = 0;}
-#line 2724 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 198:
+ case 200:
+#line 691 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy72.eOperator = yymsp[0].minor.yy0; yygotominor.yy72.not = 0;}
+#line 2661 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 210:
-#line 701 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy222.operator = yymsp[0].minor.yy0; yygotominor.yy222.not = 1;}
-#line 2729 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 199:
+ case 201:
+#line 692 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy72.eOperator = yymsp[0].minor.yy0; yygotominor.yy72.not = 1;}
+#line 2667 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 213:
-#line 705 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 204:
+#line 699 "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);
+ ExprList *pList;
+ pList = sqlite3ExprListAppend(0, yymsp[-1].minor.yy172, 0);
+ pList = sqlite3ExprListAppend(pList, yymsp[-3].minor.yy172, 0);
+ if( yymsp[0].minor.yy172 ){
+ pList = sqlite3ExprListAppend(pList, yymsp[0].minor.yy172, 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);
+ yygotominor.yy172 = sqlite3ExprFunction(pList, &yymsp[-2].minor.yy72.eOperator);
+ if( yymsp[-2].minor.yy72.not ) yygotominor.yy172 = sqlite3Expr(TK_NOT, yygotominor.yy172, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy172, &yymsp[-3].minor.yy172->span, &yymsp[-1].minor.yy172->span);
+ if( yygotominor.yy172 ) yygotominor.yy172->flags |= EP_InfixFunc;
}
-#line 2743 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2683 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 214:
+ case 205:
+#line 712 "ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy172 = sqlite3Expr(yymsp[0].major, yymsp[-1].minor.yy172, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy172->span,&yymsp[0].minor.yy0);
+}
+#line 2691 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 206:
#line 716 "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);
+ yygotominor.yy172 = sqlite3Expr(TK_ISNULL, yymsp[-2].minor.yy172, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy172->span,&yymsp[0].minor.yy0);
}
-#line 2751 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2699 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 215:
+ case 207:
#line 720 "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);
+ yygotominor.yy172 = sqlite3Expr(TK_NOTNULL, yymsp[-2].minor.yy172, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy172->span,&yymsp[0].minor.yy0);
}
-#line 2759 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2707 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 216:
+ case 208:
#line 724 "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);
+ yygotominor.yy172 = sqlite3Expr(TK_NOTNULL, yymsp[-3].minor.yy172, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-3].minor.yy172->span,&yymsp[0].minor.yy0);
}
-#line 2767 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2715 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 217:
+ case 209:
#line 728 "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);
+ yygotominor.yy172 = sqlite3Expr(yymsp[-1].major, yymsp[0].minor.yy172, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy172->span);
}
-#line 2775 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2723 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 218:
+ case 210:
#line 732 "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);
+ yygotominor.yy172 = sqlite3Expr(TK_UMINUS, yymsp[0].minor.yy172, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy172->span);
}
-#line 2783 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2731 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 219:
- case 220:
+ case 211:
#line 736 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 221:
-#line 744 "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);
+ yygotominor.yy172 = sqlite3Expr(TK_UPLUS, yymsp[0].minor.yy172, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy172->span);
}
-#line 2800 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2739 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 222:
-#line 748 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 225:
-#line 755 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 214:
+#line 743 "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;
+ ExprList *pList = sqlite3ExprListAppend(0, yymsp[-2].minor.yy172, 0);
+ pList = sqlite3ExprListAppend(pList, yymsp[0].minor.yy172, 0);
+ yygotominor.yy172 = sqlite3Expr(TK_BETWEEN, yymsp[-4].minor.yy172, 0, 0);
+ if( yygotominor.yy172 ){
+ yygotominor.yy172->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);
+ if( yymsp[-3].minor.yy46 ) yygotominor.yy172 = sqlite3Expr(TK_NOT, yygotominor.yy172, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy172->span,&yymsp[0].minor.yy172->span);
}
-#line 2824 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2755 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 228:
-#line 771 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 217:
+#line 759 "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;
+ yygotominor.yy172 = sqlite3Expr(TK_IN, yymsp[-4].minor.yy172, 0, 0);
+ if( yygotominor.yy172 ){
+ yygotominor.yy172->pList = yymsp[-1].minor.yy174;
}else{
- sqlite3ExprListDelete(yymsp[-1].minor.yy418);
+ sqlite3ExprListDelete(yymsp[-1].minor.yy174);
}
- 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);
+ if( yymsp[-3].minor.yy46 ) yygotominor.yy172 = sqlite3Expr(TK_NOT, yygotominor.yy172, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy172->span,&yymsp[0].minor.yy0);
}
-#line 2838 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2769 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 229:
-#line 781 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 218:
+#line 769 "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;
+ yygotominor.yy172 = sqlite3Expr(TK_SELECT, 0, 0, 0);
+ if( yygotominor.yy172 ){
+ yygotominor.yy172->pSelect = yymsp[-1].minor.yy219;
}else{
- sqlite3SelectDelete(yymsp[-1].minor.yy375);
+ sqlite3SelectDelete(yymsp[-1].minor.yy219);
}
- sqlite3ExprSpan(yygotominor.yy62,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
}
-#line 2851 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2782 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 230:
-#line 790 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 219:
+#line 778 "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;
+ yygotominor.yy172 = sqlite3Expr(TK_IN, yymsp[-4].minor.yy172, 0, 0);
+ if( yygotominor.yy172 ){
+ yygotominor.yy172->pSelect = yymsp[-1].minor.yy219;
}else{
- sqlite3SelectDelete(yymsp[-1].minor.yy375);
+ sqlite3SelectDelete(yymsp[-1].minor.yy219);
}
- 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);
+ if( yymsp[-3].minor.yy46 ) yygotominor.yy172 = sqlite3Expr(TK_NOT, yygotominor.yy172, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy172->span,&yymsp[0].minor.yy0);
}
-#line 2865 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2796 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 231:
-#line 800 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 220:
+#line 788 "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);
+ SrcList *pSrc = sqlite3SrcListAppend(0,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410);
+ yygotominor.yy172 = sqlite3Expr(TK_IN, yymsp[-3].minor.yy172, 0, 0);
+ if( yygotominor.yy172 ){
+ yygotominor.yy172->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);
+ if( yymsp[-2].minor.yy46 ) yygotominor.yy172 = sqlite3Expr(TK_NOT, yygotominor.yy172, 0, 0);
+ sqlite3ExprSpan(yygotominor.yy172,&yymsp[-3].minor.yy172->span,yymsp[0].minor.yy410.z?&yymsp[0].minor.yy410:&yymsp[-1].minor.yy410);
}
-#line 2880 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2811 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 232:
-#line 811 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 221:
+#line 799 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- Expr *p = yygotominor.yy62 = sqlite3Expr(TK_EXISTS, 0, 0, 0);
+ Expr *p = yygotominor.yy172 = sqlite3Expr(TK_EXISTS, 0, 0, 0);
if( p ){
- p->pSelect = yymsp[-1].minor.yy375;
+ p->pSelect = yymsp[-1].minor.yy219;
sqlite3ExprSpan(p,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
}else{
- sqlite3SelectDelete(yymsp[-1].minor.yy375);
+ sqlite3SelectDelete(yymsp[-1].minor.yy219);
}
}
-#line 2893 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2824 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 233:
-#line 823 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 222:
+#line 811 "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;
+ yygotominor.yy172 = sqlite3Expr(TK_CASE, yymsp[-3].minor.yy172, yymsp[-1].minor.yy172, 0);
+ if( yygotominor.yy172 ){
+ yygotominor.yy172->pList = yymsp[-2].minor.yy174;
}else{
- sqlite3ExprListDelete(yymsp[-2].minor.yy418);
+ sqlite3ExprListDelete(yymsp[-2].minor.yy174);
}
- sqlite3ExprSpan(yygotominor.yy62, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0);
+ sqlite3ExprSpan(yygotominor.yy172, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0);
}
-#line 2906 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2837 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 234:
-#line 834 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 223:
+#line 822 "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);
+ yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-4].minor.yy174, yymsp[-2].minor.yy172, 0);
+ yygotominor.yy174 = sqlite3ExprListAppend(yygotominor.yy174, yymsp[0].minor.yy172, 0);
}
-#line 2914 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2845 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 235:
-#line 838 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 224:
+#line 826 "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);
+ yygotominor.yy174 = sqlite3ExprListAppend(0, yymsp[-2].minor.yy172, 0);
+ yygotominor.yy174 = sqlite3ExprListAppend(yygotominor.yy174, yymsp[0].minor.yy172, 0);
}
-#line 2922 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2853 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 244:
-#line 863 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 233:
+#line 853 "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);
+ sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy410, &yymsp[-5].minor.yy410, sqlite3SrcListAppend(0,&yymsp[-3].minor.yy410,0), yymsp[-1].minor.yy174, yymsp[-9].minor.yy46,
+ &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy46);
}
-#line 2931 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2861 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 245:
- case 292:
-#line 870 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = OE_Abort;}
-#line 2937 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 234:
+ case 279:
+#line 859 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = OE_Abort;}
+#line 2867 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 246:
-#line 871 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = OE_None;}
-#line 2942 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 235:
+#line 860 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = OE_None;}
+#line 2872 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 249:
-#line 881 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 238:
+#line 870 "ext/pdo_sqlite/sqlite/src/parse.y"
{
Expr *p = 0;
- if( yymsp[-1].minor.yy198.n>0 ){
+ if( yymsp[-1].minor.yy410.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);
+ if( p ) p->pColl = sqlite3LocateCollSeq(pParse, (char*)yymsp[-1].minor.yy410.z, yymsp[-1].minor.yy410.n);
}
- yygotominor.yy418 = sqlite3ExprListAppend(yymsp[-4].minor.yy418, p, &yymsp[-2].minor.yy198);
+ yygotominor.yy174 = sqlite3ExprListAppend(yymsp[-4].minor.yy174, p, &yymsp[-2].minor.yy410);
+ if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
}
-#line 2954 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2885 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 250:
-#line 889 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 239:
+#line 879 "ext/pdo_sqlite/sqlite/src/parse.y"
{
Expr *p = 0;
- if( yymsp[-1].minor.yy198.n>0 ){
+ if( yymsp[-1].minor.yy410.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);
+ if( p ) p->pColl = sqlite3LocateCollSeq(pParse, (char*)yymsp[-1].minor.yy410.z, yymsp[-1].minor.yy410.n);
}
- yygotominor.yy418 = sqlite3ExprListAppend(0, p, &yymsp[-2].minor.yy198);
+ yygotominor.yy174 = sqlite3ExprListAppend(0, p, &yymsp[-2].minor.yy410);
+ if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
}
-#line 2966 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2898 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 252:
-#line 902 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3DropIndex(pParse, yymsp[0].minor.yy151);}
-#line 2971 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 241:
+#line 893 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3DropIndex(pParse, yymsp[0].minor.yy373, yymsp[-1].minor.yy46);}
+#line 2903 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 253:
- case 254:
-#line 906 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3Vacuum(pParse,0);}
-#line 2977 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 242:
+ case 243:
+#line 897 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Vacuum(pParse);}
+#line 2909 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 255:
- case 257:
-#line 912 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3Pragma(pParse,&yymsp[-3].minor.yy198,&yymsp[-2].minor.yy198,&yymsp[0].minor.yy198,0);}
-#line 2983 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 244:
+ case 246:
+#line 903 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Pragma(pParse,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,&yymsp[0].minor.yy410,0);}
+#line 2915 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 256:
-#line 913 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3Pragma(pParse,&yymsp[-3].minor.yy198,&yymsp[-2].minor.yy198,&yymsp[0].minor.yy0,0);}
-#line 2988 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 245:
+#line 904 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Pragma(pParse,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,&yymsp[0].minor.yy0,0);}
+#line 2920 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 258:
-#line 915 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 247:
+#line 906 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- sqlite3Pragma(pParse,&yymsp[-3].minor.yy198,&yymsp[-2].minor.yy198,&yymsp[0].minor.yy198,1);
+ sqlite3Pragma(pParse,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,&yymsp[0].minor.yy410,1);
}
-#line 2995 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2927 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 259:
-#line 918 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3Pragma(pParse,&yymsp[-4].minor.yy198,&yymsp[-3].minor.yy198,&yymsp[-1].minor.yy198,0);}
-#line 3000 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 248:
+#line 909 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Pragma(pParse,&yymsp[-4].minor.yy410,&yymsp[-3].minor.yy410,&yymsp[-1].minor.yy410,0);}
+#line 2932 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 260:
-#line 919 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3Pragma(pParse,&yymsp[-1].minor.yy198,&yymsp[0].minor.yy198,0,0);}
-#line 3005 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 249:
+#line 910 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Pragma(pParse,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410,0,0);}
+#line 2937 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 267:
-#line 932 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 255:
+#line 922 "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);
+ all.z = yymsp[-3].minor.yy410.z;
+ all.n = (yymsp[0].minor.yy0.z - yymsp[-3].minor.yy410.z) + yymsp[0].minor.yy0.n;
+ sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy243, &all);
}
-#line 3015 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2947 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 268:
-#line 941 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 256:
+#line 931 "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);
+ sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy410, &yymsp[-6].minor.yy410, yymsp[-5].minor.yy46, yymsp[-4].minor.yy370.a, yymsp[-4].minor.yy370.b, yymsp[-2].minor.yy373, yymsp[-1].minor.yy46, yymsp[0].minor.yy172, yymsp[-9].minor.yy46);
+ yygotominor.yy410 = (yymsp[-6].minor.yy410.n==0?yymsp[-7].minor.yy410:yymsp[-6].minor.yy410);
}
-#line 3023 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 2955 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 257:
+ case 260:
+#line 937 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy46 = TK_BEFORE; }
+#line 2961 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 258:
+#line 938 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy46 = TK_AFTER; }
+#line 2966 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 259:
+#line 939 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy46 = TK_INSTEAD;}
+#line 2971 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 261:
+ case 262:
+#line 944 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy370.a = yymsp[0].major; yygotominor.yy370.b = 0;}
+#line 2977 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 263:
+#line 946 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy370.a = TK_UPDATE; yygotominor.yy370.b = yymsp[0].minor.yy432;}
+#line 2982 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 264:
+ case 265:
+#line 949 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy46 = TK_ROW; }
+#line 2988 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 266:
+#line 951 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy46 = TK_STATEMENT; }
+#line 2993 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 267:
+#line 955 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy172 = 0; }
+#line 2998 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 268:
+#line 956 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy172 = yymsp[0].minor.yy172; }
+#line 3003 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 269:
- case 272:
-#line 947 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = TK_BEFORE; }
-#line 3029 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 960 "ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ if( yymsp[-2].minor.yy243 ){
+ yymsp[-2].minor.yy243->pLast->pNext = yymsp[-1].minor.yy243;
+ }else{
+ yymsp[-2].minor.yy243 = yymsp[-1].minor.yy243;
+ }
+ yymsp[-2].minor.yy243->pLast = yymsp[-1].minor.yy243;
+ yygotominor.yy243 = yymsp[-2].minor.yy243;
+}
+#line 3016 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 270:
-#line 948 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = TK_AFTER; }
-#line 3034 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 969 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy243 = 0; }
+#line 3021 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 271:
-#line 949 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = TK_INSTEAD;}
-#line 3039 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 975 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy243 = sqlite3TriggerUpdateStep(&yymsp[-3].minor.yy410, yymsp[-1].minor.yy174, yymsp[0].minor.yy172, yymsp[-4].minor.yy46); }
+#line 3026 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
+ case 272:
+#line 980 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy243 = sqlite3TriggerInsertStep(&yymsp[-5].minor.yy410, yymsp[-4].minor.yy432, yymsp[-1].minor.yy174, 0, yymsp[-7].minor.yy46);}
+#line 3031 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 273:
+#line 983 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy243 = sqlite3TriggerInsertStep(&yymsp[-2].minor.yy410, yymsp[-1].minor.yy432, 0, yymsp[0].minor.yy219, yymsp[-4].minor.yy46);}
+#line 3036 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
case 274:
+#line 987 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy243 = sqlite3TriggerDeleteStep(&yymsp[-1].minor.yy410, yymsp[0].minor.yy172);}
+#line 3041 "ext/pdo_sqlite/sqlite/src/parse.c"
+ break;
case 275:
-#line 954 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy30.a = yymsp[0].major; yygotominor.yy30.b = 0;}
+#line 990 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy243 = sqlite3TriggerSelectStep(yymsp[0].minor.yy219); }
#line 3046 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 276:
-#line 957 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy30.a = TK_UPDATE; yygotominor.yy30.b = yymsp[0].minor.yy240;}
-#line 3051 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 993 "ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy172 = sqlite3Expr(TK_RAISE, 0, 0, 0);
+ if( yygotominor.yy172 ){
+ yygotominor.yy172->iColumn = OE_Ignore;
+ sqlite3ExprSpan(yygotominor.yy172, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0);
+ }
+}
+#line 3057 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 277:
- case 278:
-#line 960 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = TK_ROW; }
-#line 3057 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1000 "ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ yygotominor.yy172 = sqlite3Expr(TK_RAISE, 0, 0, &yymsp[-1].minor.yy410);
+ if( yygotominor.yy172 ) {
+ yygotominor.yy172->iColumn = yymsp[-3].minor.yy46;
+ sqlite3ExprSpan(yygotominor.yy172, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0);
+ }
+}
+#line 3068 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 279:
-#line 962 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy280 = TK_STATEMENT; }
-#line 3062 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 278:
+#line 1010 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = OE_Rollback;}
+#line 3073 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 280:
-#line 965 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy62 = 0; }
-#line 3067 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1012 "ext/pdo_sqlite/sqlite/src/parse.y"
+{yygotominor.yy46 = OE_Fail;}
+#line 3078 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 281:
-#line 966 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy62 = yymsp[0].minor.yy62; }
-#line 3072 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1017 "ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3DropTrigger(pParse,yymsp[0].minor.yy373);
+}
+#line 3085 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 282:
-#line 970 "ext/pdo_sqlite/sqlite/src/parse.y"
+#line 1023 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- yymsp[-2].minor.yy360->pNext = yymsp[0].minor.yy360;
- yygotominor.yy360 = yymsp[-2].minor.yy360;
+ sqlite3Attach(pParse, yymsp[-3].minor.yy172, yymsp[-1].minor.yy172, yymsp[0].minor.yy386);
}
-#line 3080 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 3092 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 283:
-#line 974 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy360 = 0; }
-#line 3085 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1028 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy386 = 0; }
+#line 3097 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 284:
-#line 980 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 285:
-#line 985 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 286:
-#line 988 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1029 "ext/pdo_sqlite/sqlite/src/parse.y"
+{ yygotominor.yy386 = yymsp[0].minor.yy172; }
+#line 3102 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 287:
-#line 992 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy360 = sqlite3TriggerDeleteStep(&yymsp[-1].minor.yy198, yymsp[0].minor.yy62);}
-#line 3105 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1035 "ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3Detach(pParse, yymsp[0].minor.yy172);
+}
+#line 3109 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 288:
-#line 995 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy360 = sqlite3TriggerSelectStep(yymsp[0].minor.yy375); }
-#line 3110 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1041 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Reindex(pParse, 0, 0);}
+#line 3114 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 289:
-#line 998 "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 1042 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Reindex(pParse, &yymsp[-1].minor.yy410, &yymsp[0].minor.yy410);}
#line 3119 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 290:
-#line 1003 "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 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1047 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Analyze(pParse, 0, 0);}
+#line 3124 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 291:
-#line 1011 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = OE_Rollback;}
-#line 3133 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 293:
-#line 1013 "ext/pdo_sqlite/sqlite/src/parse.y"
-{yygotominor.yy280 = OE_Fail;}
-#line 3138 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1048 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3Analyze(pParse, &yymsp[-1].minor.yy410, &yymsp[0].minor.yy410);}
+#line 3129 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 294:
-#line 1018 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 292:
+#line 1053 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- sqlite3DropTrigger(pParse,yymsp[0].minor.yy151);
+ sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy373,&yymsp[0].minor.yy410);
}
-#line 3145 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 3136 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 295:
-#line 1024 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 293:
+#line 1056 "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);
+ sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy410);
}
-#line 3152 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 3143 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 296:
-#line 1028 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy361.type = 0; }
-#line 3157 "ext/pdo_sqlite/sqlite/src/parse.c"
+ case 294:
+#line 1059 "ext/pdo_sqlite/sqlite/src/parse.y"
+{
+ sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy373);
+}
+#line 3150 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 297:
-#line 1029 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy361.type=1; yygotominor.yy361.key = yymsp[0].minor.yy198; }
-#line 3162 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1068 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3VtabFinishParse(pParse,0);}
+#line 3155 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 298:
-#line 1030 "ext/pdo_sqlite/sqlite/src/parse.y"
-{ yygotominor.yy361.type=2; yygotominor.yy361.key = yymsp[0].minor.yy0; }
-#line 3167 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1069 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
+#line 3160 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
- case 301:
-#line 1036 "ext/pdo_sqlite/sqlite/src/parse.y"
+ case 299:
+#line 1070 "ext/pdo_sqlite/sqlite/src/parse.y"
{
- sqlite3Detach(pParse, &yymsp[0].minor.yy198);
+ sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy410, &yymsp[-2].minor.yy410, &yymsp[0].minor.yy410);
}
-#line 3174 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 3167 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 302:
-#line 1042 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3Reindex(pParse, 0, 0);}
-#line 3179 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 303:
-#line 1043 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3Reindex(pParse, &yymsp[-1].minor.yy198, &yymsp[0].minor.yy198);}
-#line 3184 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1075 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3VtabArgInit(pParse);}
+#line 3172 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
case 304:
-#line 1048 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3Analyze(pParse, 0, 0);}
-#line 3189 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
case 305:
-#line 1049 "ext/pdo_sqlite/sqlite/src/parse.y"
-{sqlite3Analyze(pParse, &yymsp[-1].minor.yy198, &yymsp[0].minor.yy198);}
-#line 3194 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
case 306:
-#line 1054 "ext/pdo_sqlite/sqlite/src/parse.y"
-{
- sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy151,&yymsp[0].minor.yy198);
-}
-#line 3201 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
- case 307:
-#line 1057 "ext/pdo_sqlite/sqlite/src/parse.y"
-{
- sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy198);
-}
-#line 3208 "ext/pdo_sqlite/sqlite/src/parse.c"
- break;
case 308:
-#line 1060 "ext/pdo_sqlite/sqlite/src/parse.y"
-{
- sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy151);
-}
-#line 3215 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 1077 "ext/pdo_sqlite/sqlite/src/parse.y"
+{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
+#line 3180 "ext/pdo_sqlite/sqlite/src/parse.c"
break;
};
yygoto = yyRuleInfo[yyruleno].lhs;
@@ -3269,14 +3233,15 @@ static void yy_syntax_error(
#define TOKEN (yyminor.yy0)
#line 34 "ext/pdo_sqlite/sqlite/src/parse.y"
- if( pParse->zErrMsg==0 ){
+ if( !pParse->parseError ){
if( TOKEN.z[0] ){
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
}else{
sqlite3ErrorMsg(pParse, "incomplete SQL statement");
}
+ pParse->parseError = 1;
}
-#line 3282 "ext/pdo_sqlite/sqlite/src/parse.c"
+#line 3248 "ext/pdo_sqlite/sqlite/src/parse.c"
sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
@@ -3404,7 +3369,9 @@ void sqlite3Parser(
while(
yypParser->yyidx >= 0 &&
yymx != YYERRORSYMBOL &&
- (yyact = yy_find_shift_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE
+ (yyact = yy_find_reduce_action(
+ yypParser->yystack[yypParser->yyidx].stateno,
+ YYERRORSYMBOL)) >= YYNSTATE
){
yy_pop_parser_stack(yypParser);
}
diff --git a/ext/pdo_sqlite/sqlite/src/parse.h b/ext/pdo_sqlite/sqlite/src/parse.h
index fcedda589..65c9a5ce9 100644
--- a/ext/pdo_sqlite/sqlite/src/parse.h
+++ b/ext/pdo_sqlite/sqlite/src/parse.h
@@ -1,145 +1,153 @@
-#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
+#define TK_SEMI 1
+#define TK_EXPLAIN 2
+#define TK_QUERY 3
+#define TK_PLAN 4
+#define TK_BEGIN 5
+#define TK_TRANSACTION 6
+#define TK_DEFERRED 7
+#define TK_IMMEDIATE 8
+#define TK_EXCLUSIVE 9
+#define TK_COMMIT 10
+#define TK_END 11
+#define TK_ROLLBACK 12
+#define TK_CREATE 13
+#define TK_TABLE 14
+#define TK_IF 15
+#define TK_NOT 16
+#define TK_EXISTS 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_ANALYZE 26
+#define TK_ASC 27
+#define TK_ATTACH 28
+#define TK_BEFORE 29
+#define TK_CASCADE 30
+#define TK_CAST 31
+#define TK_CONFLICT 32
+#define TK_DATABASE 33
+#define TK_DESC 34
+#define TK_DETACH 35
+#define TK_EACH 36
+#define TK_FAIL 37
+#define TK_FOR 38
+#define TK_IGNORE 39
+#define TK_INITIALLY 40
+#define TK_INSTEAD 41
+#define TK_LIKE_KW 42
+#define TK_MATCH 43
+#define TK_KEY 44
+#define TK_OF 45
+#define TK_OFFSET 46
+#define TK_PRAGMA 47
+#define TK_RAISE 48
+#define TK_REPLACE 49
+#define TK_RESTRICT 50
+#define TK_ROW 51
+#define TK_STATEMENT 52
+#define TK_TRIGGER 53
+#define TK_VACUUM 54
+#define TK_VIEW 55
+#define TK_VIRTUAL 56
+#define TK_REINDEX 57
+#define TK_RENAME 58
+#define TK_CTIME_KW 59
+#define TK_ANY 60
+#define TK_OR 61
+#define TK_AND 62
+#define TK_IS 63
+#define TK_BETWEEN 64
+#define TK_IN 65
+#define TK_ISNULL 66
+#define TK_NOTNULL 67
+#define TK_NE 68
+#define TK_EQ 69
+#define TK_GT 70
+#define TK_LE 71
+#define TK_LT 72
+#define TK_GE 73
+#define TK_ESCAPE 74
+#define TK_BITAND 75
+#define TK_BITOR 76
+#define TK_LSHIFT 77
+#define TK_RSHIFT 78
+#define TK_PLUS 79
+#define TK_MINUS 80
+#define TK_STAR 81
+#define TK_SLASH 82
+#define TK_REM 83
+#define TK_CONCAT 84
+#define TK_UMINUS 85
+#define TK_UPLUS 86
+#define TK_BITNOT 87
+#define TK_STRING 88
+#define TK_JOIN_KW 89
+#define TK_CONSTRAINT 90
+#define TK_DEFAULT 91
+#define TK_NULL 92
+#define TK_PRIMARY 93
+#define TK_UNIQUE 94
+#define TK_CHECK 95
+#define TK_REFERENCES 96
+#define TK_COLLATE 97
+#define TK_AUTOINCR 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_EXCEPT 109
+#define TK_INTERSECT 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_INTEGER 125
+#define TK_FLOAT 126
+#define TK_BLOB 127
+#define TK_REGISTER 128
+#define TK_VARIABLE 129
+#define TK_CASE 130
+#define TK_WHEN 131
+#define TK_THEN 132
+#define TK_ELSE 133
+#define TK_INDEX 134
+#define TK_ALTER 135
+#define TK_TO 136
+#define TK_ADD 137
+#define TK_COLUMNKW 138
+#define TK_TO_TEXT 139
+#define TK_TO_BLOB 140
+#define TK_TO_NUMERIC 141
+#define TK_TO_INT 142
+#define TK_TO_REAL 143
+#define TK_END_OF_FILE 144
+#define TK_ILLEGAL 145
+#define TK_SPACE 146
+#define TK_UNCLOSED_STRING 147
+#define TK_COMMENT 148
+#define TK_FUNCTION 149
+#define TK_COLUMN 150
+#define TK_AGG_FUNCTION 151
+#define TK_AGG_COLUMN 152
+#define TK_CONST_FUNC 153
diff --git a/ext/pdo_sqlite/sqlite/src/parse.y b/ext/pdo_sqlite/sqlite/src/parse.y
index 1f16c20a8..301eb9b8e 100644
--- a/ext/pdo_sqlite/sqlite/src/parse.y
+++ b/ext/pdo_sqlite/sqlite/src/parse.y
@@ -32,14 +32,19 @@
// This code runs whenever there is a syntax error
//
%syntax_error {
- if( pParse->zErrMsg==0 ){
+ if( !pParse->parseError ){
if( TOKEN.z[0] ){
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
}else{
sqlite3ErrorMsg(pParse, "incomplete SQL statement");
}
+ pParse->parseError = 1;
}
}
+%stack_overflow {
+ sqlite3ErrorMsg(pParse, "parser stack overflow");
+ pParse->parseError = 1;
+}
// The name of the generated procedure that implements the parser
// is as follows:
@@ -66,7 +71,7 @@ struct LimitVal {
** GLOB, NOT LIKE, and NOT GLOB operators.
*/
struct LikeOp {
- Token operator; /* "like" or "glob" or "regexp" */
+ Token eOperator; /* "like" or "glob" or "regexp" */
int not; /* True if the NOT keyword is present */
};
@@ -88,13 +93,6 @@ 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.
@@ -127,9 +125,12 @@ 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);
+create_table ::= CREATE temp(T) TABLE ifnotexists(E) nm(Y) dbnm(Z). {
+ sqlite3StartTable(pParse,&Y,&Z,T,0,0,E);
}
+%type ifnotexists {int}
+ifnotexists(A) ::= . {A = 0;}
+ifnotexists(A) ::= IF NOT EXISTS. {A = 1;}
%type temp {int}
%ifndef SQLITE_OMIT_TEMPDB
temp(A) ::= TEMP. {A = 1;}
@@ -175,12 +176,13 @@ id(A) ::= ID(X). {A = X;}
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
+ TEMP TRIGGER VACUUM VIEW VIRTUAL
%ifdef SQLITE_OMIT_COMPOUND_SELECT
EXCEPT INTERSECT UNION
%endif
- REINDEX RENAME CTIME_KW ALTER
+ REINDEX RENAME CTIME_KW IF
.
+%wildcard ANY.
// Define operator precedence early so that this is the first occurance
// of the operator tokens in the grammer. Keeping the operators together
@@ -196,7 +198,7 @@ id(A) ::= ID(X). {A = X;}
%left OR.
%left AND.
%right NOT.
-%left IS LIKE_KW BETWEEN IN ISNULL NOTNULL NE EQ.
+%left IS MATCH LIKE_KW BETWEEN IN ISNULL NOTNULL NE EQ.
%left GT LE LT GE.
%right ESCAPE.
%left BITAND BITOR LSHIFT RSHIFT.
@@ -208,8 +210,7 @@ id(A) ::= ID(X). {A = X;}
// And "ids" is an identifer-or-string.
//
%type ids {Token}
-ids(A) ::= ID(X). {A = X;}
-ids(A) ::= STRING(X). {A = X;}
+ids(A) ::= ID|STRING(X). {A = X;}
// The name of a column or table can be any of the following:
//
@@ -238,8 +239,8 @@ typetoken(A) ::= typename(X) LP signed COMMA signed RP(Y). {
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); }
+signed(A) ::= plus_num(X). { A = atoi((char*)X.z); }
+signed(A) ::= minus_num(X). { A = -atoi((char*)X.z); }
// "carglist" is a list of additional constraints that come after the
// column name and column type in a CREATE TABLE statement.
@@ -265,14 +266,14 @@ carg ::= DEFAULT id(X). {
//
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 ::= PRIMARY KEY sortorder(Z) onconf(R) autoinc(I).
+ {sqlite3AddPrimaryKey(pParse,0,R,I,Z);}
+ccons ::= UNIQUE onconf(R). {sqlite3CreateIndex(pParse,0,0,0,0,R,0,0,0,0);}
+ccons ::= CHECK LP expr(X) RP. {sqlite3AddCheckConstraint(pParse,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);}
+ccons ::= COLLATE id(C). {sqlite3AddCollateType(pParse, (char*)C.z, C.n);}
// The optional AUTOINCREMENT keyword
%type autoinc {int}
@@ -315,10 +316,10 @@ conslist ::= conslist tcons.
conslist ::= tcons.
tcons ::= CONSTRAINT nm.
tcons ::= PRIMARY KEY LP idxlist(X) autoinc(I) RP onconf(R).
- {sqlite3AddPrimaryKey(pParse,X,R,I);}
+ {sqlite3AddPrimaryKey(pParse,X,R,I,0);}
tcons ::= UNIQUE LP idxlist(X) RP onconf(R).
- {sqlite3CreateIndex(pParse,0,0,0,X,R,0,0);}
-tcons ::= CHECK expr onconf.
+ {sqlite3CreateIndex(pParse,0,0,0,X,R,0,0,0,0);}
+tcons ::= CHECK LP expr(E) RP onconf. {sqlite3AddCheckConstraint(pParse,E);}
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);
@@ -344,9 +345,12 @@ resolvetype(A) ::= REPLACE. {A = OE_Replace;}
////////////////////////// The DROP TABLE /////////////////////////////////////
//
-cmd ::= DROP TABLE fullname(X). {
- sqlite3DropTable(pParse, X, 0);
+cmd ::= DROP TABLE ifexists(E) fullname(X). {
+ sqlite3DropTable(pParse, X, 0, E);
}
+%type ifexists {int}
+ifexists(A) ::= IF EXISTS. {A = 1;}
+ifexists(A) ::= . {A = 0;}
///////////////////// The CREATE VIEW statement /////////////////////////////
//
@@ -354,8 +358,8 @@ cmd ::= DROP TABLE fullname(X). {
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);
+cmd ::= DROP VIEW ifexists(E) fullname(X). {
+ sqlite3DropTable(pParse, X, 1, E);
}
%endif // SQLITE_OMIT_VIEW
@@ -381,10 +385,9 @@ select(A) ::= select(X) multiselect_op(Y) oneselect(Z). {
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;}
+multiselect_op(A) ::= UNION(OP). {A = @OP;}
+multiselect_op(A) ::= UNION ALL. {A = TK_ALL;}
+multiselect_op(A) ::= EXCEPT|INTERSECT(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). {
@@ -467,7 +470,7 @@ seltablist(A) ::= stl_prefix(X) nm(Y) dbnm(D) as(Z) on_opt(N) using_opt(U). {
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( A && A->nSrc>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; }
@@ -479,7 +482,7 @@ seltablist(A) ::= stl_prefix(X) nm(Y) dbnm(D) as(Z) on_opt(N) using_opt(U). {
}
}
- // A seltablist_paren nonterminal represents anything in a FROM that
+ // 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.
//
@@ -501,8 +504,7 @@ 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) ::= COMMA|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.
@@ -645,10 +647,8 @@ expr(A) ::= nm(X) DOT nm(Y) DOT nm(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) ::= INTEGER|FLOAT|BLOB(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;
@@ -664,7 +664,7 @@ expr(A) ::= CAST(X) LP expr(E) AS typetoken(T) RP(Y). {
expr(A) ::= ID(X) LP distinct(D) exprlist(Y) RP(E). {
A = sqlite3ExprFunction(Y, &X);
sqlite3ExprSpan(A,&X,&E);
- if( D ){
+ if( D && A ){
A->flags |= EP_Distinct;
}
}
@@ -678,53 +678,45 @@ term(A) ::= CTIME_KW(OP). {
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);}
+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|GT|GE|LE(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) EQ|NE(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) BITAND|BITOR|LSHIFT|RSHIFT(OP) expr(Y).
+ {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) PLUS|MINUS(OP) expr(Y). {A = sqlite3Expr(@OP, X, Y, 0);}
+expr(A) ::= expr(X) STAR|SLASH|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;}
+likeop(A) ::= LIKE_KW(X). {A.eOperator = X; A.not = 0;}
+likeop(A) ::= NOT LIKE_KW(X). {A.eOperator = X; A.not = 1;}
+likeop(A) ::= MATCH(X). {A.eOperator = X; A.not = 0;}
+likeop(A) ::= NOT MATCH(X). {A.eOperator = X; A.not = 1;}
%type escape {Expr*}
+%destructor escape {sqlite3ExprDelete($$);}
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);
+ ExprList *pList;
+ pList = sqlite3ExprListAppend(0, Y, 0);
pList = sqlite3ExprListAppend(pList, X, 0);
if( E ){
pList = sqlite3ExprListAppend(pList, E, 0);
}
- A = sqlite3ExprFunction(pList, &OP.operator);
+ A = sqlite3ExprFunction(pList, &OP.eOperator);
if( OP.not ) A = sqlite3Expr(TK_NOT, A, 0, 0);
sqlite3ExprSpan(A, &X->span, &Y->span);
+ if( A ) A->flags |= EP_InfixFunc;
}
-expr(A) ::= expr(X) ISNULL(E). {
- A = sqlite3Expr(TK_ISNULL, X, 0, 0);
+expr(A) ::= expr(X) ISNULL|NOTNULL(E). {
+ A = sqlite3Expr(@E, 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);
@@ -733,11 +725,7 @@ 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). {
+expr(A) ::= NOT|BITNOT(B) expr(X). {
A = sqlite3Expr(@B, X, 0, 0);
sqlite3ExprSpan(A,&B,&X->span);
}
@@ -840,9 +828,11 @@ case_exprlist(A) ::= WHEN expr(Y) THEN expr(Z). {
A = sqlite3ExprListAppend(A, Z, 0);
}
%type case_else {Expr*}
+%destructor case_else {sqlite3ExprDelete($$);}
case_else(A) ::= ELSE expr(X). {A = X;}
case_else(A) ::= . {A = 0;}
%type case_operand {Expr*}
+%destructor case_operand {sqlite3ExprDelete($$);}
case_operand(A) ::= expr(X). {A = X;}
case_operand(A) ::= . {A = 0;}
@@ -859,11 +849,10 @@ 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);
+cmd ::= CREATE(S) uniqueflag(U) INDEX ifnotexists(NE) nm(X) dbnm(D)
+ ON nm(Y) LP idxlist(Z) RP(E). {
+ sqlite3CreateIndex(pParse, &X, &D, sqlite3SrcListAppend(0,&Y,0), Z, U,
+ &S, &E, SQLITE_SO_ASC, NE);
}
%type uniqueflag {int}
@@ -878,33 +867,35 @@ uniqueflag(A) ::= . {A = OE_None;}
idxlist_opt(A) ::= . {A = 0;}
idxlist_opt(A) ::= LP idxlist(X) RP. {A = X;}
-idxlist(A) ::= idxlist(X) COMMA idxitem(Y) collate(C) sortorder. {
+idxlist(A) ::= idxlist(X) COMMA idxitem(Y) collate(C) sortorder(Z). {
Expr *p = 0;
if( C.n>0 ){
p = sqlite3Expr(TK_COLUMN, 0, 0, 0);
- if( p ) p->pColl = sqlite3LocateCollSeq(pParse, C.z, C.n);
+ if( p ) p->pColl = sqlite3LocateCollSeq(pParse, (char*)C.z, C.n);
}
A = sqlite3ExprListAppend(X, p, &Y);
+ if( A ) A->a[A->nExpr-1].sortOrder = Z;
}
-idxlist(A) ::= idxitem(Y) collate(C) sortorder. {
+idxlist(A) ::= idxitem(Y) collate(C) sortorder(Z). {
Expr *p = 0;
if( C.n>0 ){
p = sqlite3Expr(TK_COLUMN, 0, 0, 0);
- if( p ) p->pColl = sqlite3LocateCollSeq(pParse, C.z, C.n);
+ if( p ) p->pColl = sqlite3LocateCollSeq(pParse, (char*)C.z, C.n);
}
A = sqlite3ExprListAppend(0, p, &Y);
+ if( A ) A->a[A->nExpr-1].sortOrder = Z;
}
idxitem(A) ::= nm(X). {A = X;}
///////////////////////////// The DROP INDEX command /////////////////////////
//
-cmd ::= DROP INDEX fullname(X). {sqlite3DropIndex(pParse, X);}
+cmd ::= DROP INDEX ifexists(E) fullname(X). {sqlite3DropIndex(pParse, X, E);}
///////////////////////////// The VACUUM command /////////////////////////////
//
-cmd ::= VACUUM. {sqlite3Vacuum(pParse,0);}
-cmd ::= VACUUM nm. {sqlite3Vacuum(pParse,0);}
+cmd ::= VACUUM. {sqlite3Vacuum(pParse);}
+cmd ::= VACUUM nm. {sqlite3Vacuum(pParse);}
///////////////////////////// The PRAGMA command /////////////////////////////
//
@@ -920,8 +911,7 @@ 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;}
+number(A) ::= INTEGER|FLOAT(X). {A = X;}
plus_opt ::= PLUS.
plus_opt ::= .
@@ -951,8 +941,7 @@ 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) ::= DELETE|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;}
@@ -962,14 +951,20 @@ foreach_clause(A) ::= FOR EACH ROW. { A = TK_ROW; }
foreach_clause(A) ::= FOR EACH STATEMENT. { A = TK_STATEMENT; }
%type when_clause {Expr*}
+%destructor when_clause {sqlite3ExprDelete($$);}
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) ::= trigger_cmd_list(Y) trigger_cmd(X) SEMI. {
+ if( Y ){
+ Y->pLast->pNext = X;
+ }else{
+ Y = X;
+ }
+ Y->pLast = X;
+ A = Y;
}
trigger_cmd_list(A) ::= . { A = 0; }
@@ -997,13 +992,17 @@ 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);
+ if( A ){
+ 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);
+ if( A ) {
+ A->iColumn = T;
+ sqlite3ExprSpan(A, &X, &Y);
+ }
}
%endif // !SQLITE_OMIT_TRIGGER
@@ -1021,20 +1020,20 @@ cmd ::= DROP TRIGGER fullname(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);
+cmd ::= ATTACH database_kw_opt expr(F) AS expr(D) key_opt(K). {
+ sqlite3Attach(pParse, F, D, K);
}
-%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; }
+%type key_opt {Expr *}
+%destructor key_opt {sqlite3ExprDelete($$);}
+key_opt(A) ::= . { A = 0; }
+key_opt(A) ::= KEY expr(X). { A = X; }
database_kw_opt ::= DATABASE.
database_kw_opt ::= .
//////////////////////// DETACH DATABASE name /////////////////////////////////
-cmd ::= DETACH database_kw_opt nm(D). {
- sqlite3Detach(pParse, &D);
+cmd ::= DETACH database_kw_opt expr(D). {
+ sqlite3Detach(pParse, D);
}
////////////////////////// REINDEX collation //////////////////////////////////
@@ -1063,3 +1062,21 @@ add_column_fullname ::= fullname(X). {
kwcolumn_opt ::= .
kwcolumn_opt ::= COLUMNKW.
%endif
+
+//////////////////////// CREATE VIRTUAL TABLE ... /////////////////////////////
+%ifndef SQLITE_OMIT_VIRTUALTABLE
+cmd ::= create_vtab. {sqlite3VtabFinishParse(pParse,0);}
+cmd ::= create_vtab LP vtabarglist RP(X). {sqlite3VtabFinishParse(pParse,&X);}
+create_vtab ::= CREATE VIRTUAL TABLE nm(X) dbnm(Y) USING nm(Z). {
+ sqlite3VtabBeginParse(pParse, &X, &Y, &Z);
+}
+vtabarglist ::= vtabarg.
+vtabarglist ::= vtabarglist COMMA vtabarg.
+vtabarg ::= . {sqlite3VtabArgInit(pParse);}
+vtabarg ::= vtabarg vtabargtoken.
+vtabargtoken ::= ANY(X). {sqlite3VtabArgExtend(pParse,&X);}
+vtabargtoken ::= lp anylist RP(X). {sqlite3VtabArgExtend(pParse,&X);}
+lp ::= LP(X). {sqlite3VtabArgExtend(pParse,&X);}
+anylist ::= .
+anylist ::= anylist ANY(X). {sqlite3VtabArgExtend(pParse,&X);}
+%endif
diff --git a/ext/pdo_sqlite/sqlite/src/pragma.c b/ext/pdo_sqlite/sqlite/src/pragma.c
index e366401d2..fbcc1adc0 100644
--- a/ext/pdo_sqlite/sqlite/src/pragma.c
+++ b/ext/pdo_sqlite/sqlite/src/pragma.c
@@ -36,7 +36,7 @@
** 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){
+static int getSafetyLevel(const char *z){
/* 123456789 123456789 */
static const char zText[] = "onoffalseyestruefull";
static const u8 iOffset[] = {0, 1, 2, 4, 9, 12, 16};
@@ -58,7 +58,7 @@ static int getSafetyLevel(const u8 *z){
/*
** Interpret the given string as a boolean value.
*/
-static int getBoolean(const u8 *z){
+static int getBoolean(const char *z){
return getSafetyLevel(z)&1;
}
@@ -128,7 +128,7 @@ static void returnSingleInt(Parse *pParse, const char *zLabel, int value){
sqlite3VdbeAddOp(v, OP_Integer, value, 0);
if( pParse->explain==0 ){
sqlite3VdbeSetNumCols(v, 1);
- sqlite3VdbeSetColName(v, 0, zLabel, P3_STATIC);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zLabel, P3_STATIC);
}
sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
}
@@ -151,9 +151,18 @@ static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){
{ "short_column_names", SQLITE_ShortColNames },
{ "count_changes", SQLITE_CountRows },
{ "empty_result_callbacks", SQLITE_NullCallback },
+ { "legacy_file_format", SQLITE_LegacyFileFmt },
+ { "fullfsync", SQLITE_FullFSync },
+#ifndef SQLITE_OMIT_CHECK
+ { "ignore_check_constraints", SQLITE_IgnoreChecks },
+#endif
/* The following is VERY experimental */
{ "writable_schema", SQLITE_WriteSchema },
{ "omit_readlock", SQLITE_NoReadlock },
+
+ /* TODO: Maybe it shouldn't be possible to change the ReadUncommitted
+ ** flag if there are any active statements. */
+ { "read_uncommitted", SQLITE_ReadUncommitted },
};
int i;
const struct sPragmaType *p;
@@ -172,10 +181,6 @@ static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){
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;
}
@@ -222,6 +227,13 @@ void sqlite3Pragma(
if( iDb<0 ) return;
pDb = &db->aDb[iDb];
+ /* If the temp database has been explicitly named as part of the
+ ** pragma, make sure it is open.
+ */
+ if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){
+ return;
+ }
+
zLeft = sqlite3NameFromToken(pId);
if( !zLeft ) return;
if( minusFlag ){
@@ -266,7 +278,7 @@ void sqlite3Pragma(
if( sqlite3ReadSchema(pParse) ) goto pragma_out;
if( !zRight ){
sqlite3VdbeSetNumCols(v, 1);
- sqlite3VdbeSetColName(v, 0, "cache_size", P3_STATIC);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "cache_size", P3_STATIC);
addr = sqlite3VdbeAddOpList(v, ArraySize(getCacheSize), getCacheSize);
sqlite3VdbeChangeP1(v, addr, iDb);
sqlite3VdbeChangeP1(v, addr+5, MAX_PAGES);
@@ -280,8 +292,8 @@ void sqlite3Pragma(
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);
+ pDb->pSchema->cache_size = size;
+ sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
}
}else
@@ -342,12 +354,12 @@ void sqlite3Pragma(
if( sqlite3StrICmp(zLeft,"cache_size")==0 ){
if( sqlite3ReadSchema(pParse) ) goto pragma_out;
if( !zRight ){
- returnSingleInt(pParse, "cache_size", pDb->cache_size);
+ returnSingleInt(pParse, "cache_size", pDb->pSchema->cache_size);
}else{
int size = atoi(zRight);
if( size<0 ) size = -size;
- pDb->cache_size = size;
- sqlite3BtreeSetCacheSize(pDb->pBt, pDb->cache_size);
+ pDb->pSchema->cache_size = size;
+ sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
}
}else
@@ -384,7 +396,8 @@ void sqlite3Pragma(
if( !zRight ){
if( sqlite3_temp_directory ){
sqlite3VdbeSetNumCols(v, 1);
- sqlite3VdbeSetColName(v, 0, "temp_store_directory", P3_STATIC);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME,
+ "temp_store_directory", P3_STATIC);
sqlite3VdbeOp3(v, OP_String8, 0, 0, sqlite3_temp_directory, 0);
sqlite3VdbeAddOp(v, OP_Callback, 1, 0);
}
@@ -428,7 +441,6 @@ void sqlite3Pragma(
"Safety level may not be changed inside a transaction");
}else{
pDb->safety_level = getSafetyLevel(zRight)+1;
- sqlite3BtreeSetSafetyLevel(pDb->pBt, pDb->safety_level);
}
}
}else
@@ -460,22 +472,23 @@ void sqlite3Pragma(
pTab = sqlite3FindTable(db, zRight, zDb);
if( pTab ){
int i;
+ Column *pCol;
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);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "cid", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "name", P3_STATIC);
+ sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "type", P3_STATIC);
+ sqlite3VdbeSetColName(v, 3, COLNAME_NAME, "notnull", P3_STATIC);
+ sqlite3VdbeSetColName(v, 4, COLNAME_NAME, "dflt_value", P3_STATIC);
+ sqlite3VdbeSetColName(v, 5, COLNAME_NAME, "pk", P3_STATIC);
sqlite3ViewGetColumnNames(pParse, pTab);
- for(i=0; i<pTab->nCol; i++){
+ for(i=0, pCol=pTab->aCol; i<pTab->nCol; i++, pCol++){
sqlite3VdbeAddOp(v, OP_Integer, i, 0);
- sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->aCol[i].zName, 0);
+ sqlite3VdbeOp3(v, OP_String8, 0, 0, pCol->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);
+ pCol->zType ? pCol->zType : "", 0);
+ sqlite3VdbeAddOp(v, OP_Integer, pCol->notNull, 0);
+ sqlite3ExprCode(pParse, pCol->pDflt);
+ sqlite3VdbeAddOp(v, OP_Integer, pCol->isPrimKey, 0);
sqlite3VdbeAddOp(v, OP_Callback, 6, 0);
}
}
@@ -490,9 +503,9 @@ void sqlite3Pragma(
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);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seqno", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "cid", P3_STATIC);
+ sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "name", P3_STATIC);
for(i=0; i<pIdx->nColumn; i++){
int cnum = pIdx->aiColumn[i];
sqlite3VdbeAddOp(v, OP_Integer, i, 0);
@@ -515,9 +528,9 @@ void sqlite3Pragma(
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);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seq", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "name", P3_STATIC);
+ sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "unique", P3_STATIC);
while(pIdx){
sqlite3VdbeAddOp(v, OP_Integer, i, 0);
sqlite3VdbeOp3(v, OP_String8, 0, 0, pIdx->zName, 0);
@@ -534,9 +547,9 @@ void sqlite3Pragma(
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);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seq", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "name", P3_STATIC);
+ sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "file", P3_STATIC);
for(i=0; i<db->nDb; i++){
if( db->aDb[i].pBt==0 ) continue;
assert( db->aDb[i].zName!=0 );
@@ -552,8 +565,8 @@ void sqlite3Pragma(
int i = 0;
HashElem *p;
sqlite3VdbeSetNumCols(v, 2);
- sqlite3VdbeSetColName(v, 0, "seq", P3_STATIC);
- sqlite3VdbeSetColName(v, 1, "name", P3_STATIC);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seq", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "name", P3_STATIC);
for(p=sqliteHashFirst(&db->aCollSeq); p; p=sqliteHashNext(p)){
CollSeq *pColl = (CollSeq *)sqliteHashData(p);
sqlite3VdbeAddOp(v, OP_Integer, i++, 0);
@@ -575,11 +588,11 @@ void sqlite3Pragma(
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);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "id", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "seq", P3_STATIC);
+ sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "table", P3_STATIC);
+ sqlite3VdbeSetColName(v, 3, COLNAME_NAME, "from", P3_STATIC);
+ sqlite3VdbeSetColName(v, 4, COLNAME_NAME, "to", P3_STATIC);
while(pFK){
int j;
for(j=0; j<pFK->nCol; j++){
@@ -641,12 +654,13 @@ void sqlite3Pragma(
/* Initialize the VDBE program */
if( sqlite3ReadSchema(pParse) ) goto pragma_out;
sqlite3VdbeSetNumCols(v, 1);
- sqlite3VdbeSetColName(v, 0, "integrity_check", P3_STATIC);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "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;
+ Hash *pTbls;
int cnt = 0;
if( OMIT_TEMPDB && i==1 ) continue;
@@ -655,13 +669,13 @@ void sqlite3Pragma(
/* Do an integrity check of the B-Tree
*/
- for(x=sqliteHashFirst(&db->aDb[i].tblHash); x; x=sqliteHashNext(x)){
+ pTbls = &db->aDb[i].pSchema->tblHash;
+ for(x=sqliteHashFirst(pTbls); 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++;
}
@@ -670,18 +684,19 @@ void sqlite3Pragma(
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);
+ sqlite3VdbeAddOp(v, OP_Eq, 0, addr+7);
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);
+ sqlite3VdbeAddOp(v, OP_MemIncr, 1, 0);
/* Make sure all the indices are constructed correctly.
*/
sqlite3CodeVerifySchema(pParse, i);
- for(x=sqliteHashFirst(&db->aDb[i].tblHash); x; x=sqliteHashNext(x)){
+ for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){
Table *pTab = sqliteHashData(x);
Index *pIdx;
int loopTop;
@@ -690,11 +705,11 @@ void sqlite3Pragma(
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);
+ sqlite3VdbeAddOp(v, OP_MemIncr, 1, 1);
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
int jmp2;
static const VdbeOpList idxErr[] = {
- { OP_MemIncr, 0, 0, 0},
+ { OP_MemIncr, 1, 0, 0},
{ OP_String8, 0, 0, "rowid "},
{ OP_Rowid, 1, 0, 0},
{ OP_String8, 0, 0, " missing from index "},
@@ -714,12 +729,12 @@ void sqlite3Pragma(
static const VdbeOpList cntIdx[] = {
{ OP_MemInt, 0, 2, 0},
{ OP_Rewind, 0, 0, 0}, /* 1 */
- { OP_MemIncr, 2, 0, 0},
+ { OP_MemIncr, 1, 2, 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_MemIncr, 1, 0, 0},
{ OP_String8, 0, 0, "wrong # of entries in index "},
{ OP_String8, 0, 0, 0}, /* 9 */
{ OP_Concat, 0, 0, 0},
@@ -765,7 +780,7 @@ void sqlite3Pragma(
** useful if invoked immediately after the main database i
*/
if( sqlite3StrICmp(zLeft, "encoding")==0 ){
- static struct EncName {
+ static const struct EncName {
char *zName;
u8 enc;
} encnames[] = {
@@ -775,19 +790,18 @@ void sqlite3Pragma(
{ "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 */ },
+ { "UTF-16", 0 }, /* SQLITE_UTF16NATIVE */
+ { "UTF16", 0 }, /* SQLITE_UTF16NATIVE */
{ 0, 0 }
};
- struct EncName *pEnc;
- encnames[6].enc = encnames[7].enc = SQLITE_UTF16NATIVE;
+ const struct EncName *pEnc;
if( !zRight ){ /* "PRAGMA encoding" */
if( sqlite3ReadSchema(pParse) ) goto pragma_out;
sqlite3VdbeSetNumCols(v, 1);
- sqlite3VdbeSetColName(v, 0, "encoding", P3_STATIC);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "encoding", P3_STATIC);
sqlite3VdbeAddOp(v, OP_String8, 0, 0);
for(pEnc=&encnames[0]; pEnc->zName; pEnc++){
- if( pEnc->enc==pParse->db->enc ){
+ if( pEnc->enc==ENC(pParse->db) ){
sqlite3VdbeChangeP3(v, -1, pEnc->zName, P3_STATIC);
break;
}
@@ -799,10 +813,13 @@ void sqlite3Pragma(
** 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) ){
+ if(
+ !(DbHasProperty(db, 0, DB_SchemaLoaded)) ||
+ DbHasProperty(db, 0, DB_Empty)
+ ){
for(pEnc=&encnames[0]; pEnc->zName; pEnc++){
if( 0==sqlite3StrICmp(zRight, pEnc->zName) ){
- pParse->db->enc = pEnc->enc;
+ ENC(pParse->db) = pEnc->enc ? pEnc->enc : SQLITE_UTF16NATIVE;
break;
}
}
@@ -887,8 +904,8 @@ void sqlite3Pragma(
int i;
Vdbe *v = sqlite3GetVdbe(pParse);
sqlite3VdbeSetNumCols(v, 2);
- sqlite3VdbeSetColName(v, 0, "database", P3_STATIC);
- sqlite3VdbeSetColName(v, 1, "status", P3_STATIC);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "database", P3_STATIC);
+ sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "status", P3_STATIC);
for(i=0; i<db->nDb; i++){
Btree *pBt;
Pager *pPager;
@@ -918,6 +935,12 @@ void sqlite3Pragma(
}else
#endif
+#if SQLITE_HAS_CODEC
+ if( sqlite3StrICmp(zLeft, "key")==0 ){
+ sqlite3_key(db, zRight, strlen(zRight));
+ }else
+#endif
+
{}
if( v ){
@@ -926,6 +949,17 @@ void sqlite3Pragma(
** are only valid for a single execution.
*/
sqlite3VdbeAddOp(v, OP_Expire, 1, 0);
+
+ /*
+ ** Reset the safety level, in case the fullfsync flag or synchronous
+ ** setting changed.
+ */
+#ifndef SQLITE_OMIT_PAGER_PRAGMAS
+ if( db->autoCommit ){
+ sqlite3BtreeSetSafetyLevel(pDb->pBt, pDb->safety_level,
+ (db->flags&SQLITE_FullFSync)!=0);
+ }
+#endif
}
pragma_out:
sqliteFree(zLeft);
diff --git a/ext/pdo_sqlite/sqlite/src/prepare.c b/ext/pdo_sqlite/sqlite/src/prepare.c
index c9266eb74..2191a9242 100644
--- a/ext/pdo_sqlite/sqlite/src/prepare.c
+++ b/ext/pdo_sqlite/sqlite/src/prepare.c
@@ -13,7 +13,7 @@
** interface, and routines that contribute to loading the database schema
** from disk.
**
-** $Id: prepare.c,v 1.1.2.2 2005/09/26 19:33:25 iliaa Exp $
+** $Id: prepare.c,v 1.1.2.2.2.1 2006/08/14 16:15:29 iliaa Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -24,10 +24,11 @@
** that the database is corrupt.
*/
static void corruptSchema(InitData *pData, const char *zExtra){
- if( !sqlite3_malloc_failed ){
+ if( !sqlite3MallocFailed() ){
sqlite3SetString(pData->pzErrMsg, "malformed database schema",
zExtra!=0 && zExtra[0]!=0 ? " - " : (char*)0, zExtra, (char*)0);
}
+ pData->rc = SQLITE_CORRUPT;
}
/*
@@ -38,7 +39,7 @@ static void corruptSchema(InitData *pData, const char *zExtra){
** 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[1] = root page number for table or index. 0 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.
@@ -49,6 +50,12 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){
sqlite3 *db = pData->db;
int iDb;
+ pData->rc = SQLITE_OK;
+ if( sqlite3MallocFailed() ){
+ corruptSchema(pData, 0);
+ return SQLITE_NOMEM;
+ }
+
assert( argc==4 );
if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */
if( argv[1]==0 || argv[3]==0 ){
@@ -70,10 +77,16 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){
db->init.newTnum = atoi(argv[1]);
rc = sqlite3_exec(db, argv[2], 0, 0, &zErr);
db->init.iDb = 0;
+ assert( rc!=SQLITE_OK || zErr==0 );
if( SQLITE_OK!=rc ){
- corruptSchema(pData, zErr);
+ pData->rc = rc;
+ if( rc==SQLITE_NOMEM ){
+ sqlite3FailedMalloc();
+ }else if( rc!=SQLITE_INTERRUPT ){
+ corruptSchema(pData, zErr);
+ }
sqlite3_free(zErr);
- return rc;
+ return 1;
}
}else{
/* If the SQL column is blank it means this is an index that
@@ -111,6 +124,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
BtCursor *curMain;
int size;
Table *pTab;
+ Db *pDb;
char const *azArg[5];
char zDbNum[30];
int meta[10];
@@ -145,6 +159,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
#endif
assert( iDb>=0 && iDb<db->nDb );
+ assert( db->aDb[iDb].pSchema );
/* zMasterSchema and zInitScript are set to point at the master schema
** and initialisation script appropriate for the database being
@@ -168,9 +183,9 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
initData.db = db;
initData.pzErrMsg = pzErrMsg;
rc = sqlite3InitCallback(&initData, 4, (char **)azArg, 0);
- if( rc!=SQLITE_OK ){
+ if( rc ){
sqlite3SafetyOn(db);
- return rc;
+ return initData.rc;
}
pTab = sqlite3FindTable(db, zMasterName, db->aDb[iDb].zName);
if( pTab ){
@@ -180,11 +195,14 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
/* Create a cursor to hold the database open
*/
- if( db->aDb[iDb].pBt==0 ){
- if( !OMIT_TEMPDB && iDb==1 ) DbSetProperty(db, 1, DB_SchemaLoaded);
+ pDb = &db->aDb[iDb];
+ if( pDb->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);
+ rc = sqlite3BtreeCursor(pDb->pBt, MASTER_ROOT, 0, 0, 0, &curMain);
if( rc!=SQLITE_OK && rc!=SQLITE_EMPTY ){
sqlite3SetString(pzErrMsg, sqlite3ErrStr(rc), (char*)0);
return rc;
@@ -197,20 +215,20 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
** 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[4] Db text encoding. 1:UTF-8 2:UTF-16LE 3:UTF-16BE
** 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
+ ** Note: The #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]);
+ rc = sqlite3BtreeGetMeta(pDb->pBt, i+1, (u32 *)&meta[i]);
}
if( rc ){
sqlite3SetString(pzErrMsg, sqlite3ErrStr(rc), (char*)0);
@@ -220,7 +238,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
}else{
memset(meta, 0, sizeof(meta));
}
- db->aDb[iDb].schema_cookie = meta[0];
+ pDb->pSchema->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.
@@ -229,55 +247,44 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
*/
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);
+ /* If opening the main database, set ENC(db). */
+ ENC(db) = (u8)meta[4];
+ db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 6, 0);
}else{
- /* If opening an attached database, the encoding much match db->enc */
- if( meta[4]!=db->enc ){
+ /* If opening an attached database, the encoding much match ENC(db) */
+ if( meta[4]!=ENC(db) ){
sqlite3BtreeCloseCursor(curMain);
sqlite3SetString(pzErrMsg, "attached databases must use the same"
" text encoding as main database", (char*)0);
return SQLITE_ERROR;
}
}
+ }else{
+ DbSetProperty(db, iDb, DB_Empty);
}
+ pDb->pSchema->enc = ENC(db);
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;
- }
- }
+ pDb->pSchema->cache_size = size;
+ sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
/*
** 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.
+ ** file_format==2 Version 3.1.3. // ALTER TABLE ADD COLUMN
+ ** file_format==3 Version 3.1.4. // ditto but with non-NULL defaults
+ ** file_format==4 Version 3.3.0. // DESC indices. Boolean constants
*/
- if( meta[1]>3 ){
+ pDb->pSchema->file_format = meta[1];
+ if( pDb->pSchema->file_format==0 ){
+ pDb->pSchema->file_format = 1;
+ }
+ if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
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
*/
@@ -292,6 +299,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
zDbNum, db->aDb[iDb].zName, zMasterName);
sqlite3SafetyOff(db);
rc = sqlite3_exec(db, zSql, sqlite3InitCallback, &initData, 0);
+ if( rc==SQLITE_ABORT ) rc = initData.rc;
sqlite3SafetyOn(db);
sqliteFree(zSql);
#ifndef SQLITE_OMIT_ANALYZE
@@ -301,8 +309,8 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
#endif
sqlite3BtreeCloseCursor(curMain);
}
- if( sqlite3_malloc_failed ){
- sqlite3SetString(pzErrMsg, "out of memory", (char*)0);
+ if( sqlite3MallocFailed() ){
+ /* sqlite3SetString(pzErrMsg, "out of memory", (char*)0); */
rc = SQLITE_NOMEM;
sqlite3ResetInternalSchema(db, 0);
}
@@ -320,14 +328,15 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
** 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.
+** After a database is initialized, the DB_SchemaLoaded bit is set
+** bit is set in the flags field of the Db structure. If the database
+** file was of zero-length, then the DB_Empty flag is also set.
*/
int sqlite3Init(sqlite3 *db, char **pzErrMsg){
int i, rc;
+ int called_initone = 0;
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++){
@@ -336,6 +345,7 @@ int sqlite3Init(sqlite3 *db, char **pzErrMsg){
if( rc ){
sqlite3ResetInternalSchema(db, i);
}
+ called_initone = 1;
}
/* Once all the other databases have been initialised, load the schema
@@ -348,19 +358,16 @@ int sqlite3Init(sqlite3 *db, char **pzErrMsg){
if( rc ){
sqlite3ResetInternalSchema(db, 1);
}
+ called_initone = 1;
}
#endif
db->init.busy = 0;
- if( rc==SQLITE_OK ){
- db->flags |= SQLITE_Initialized;
+ if( rc==SQLITE_OK && called_initone ){
sqlite3CommitInternalChanges(db);
}
- if( rc!=SQLITE_OK ){
- db->flags &= ~SQLITE_Initialized;
- }
- return rc;
+ return rc;
}
/*
@@ -371,11 +378,8 @@ 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);
- }
+ 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++;
@@ -402,7 +406,7 @@ static int schemaIsValid(sqlite3 *db){
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 ){
+ if( rc==SQLITE_OK && cookie!=db->aDb[iDb].pSchema->schema_cookie ){
allOk = 0;
}
sqlite3BtreeCloseCursor(curTemp);
@@ -412,6 +416,37 @@ static int schemaIsValid(sqlite3 *db){
}
/*
+** Convert a schema pointer into the iDb index that indicates
+** which database file in db->aDb[] the schema refers to.
+**
+** If the same database is attached more than once, the first
+** attached database is returned.
+*/
+int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
+ int i = -1000000;
+
+ /* If pSchema is NULL, then return -1000000. This happens when code in
+ ** expr.c is trying to resolve a reference to a transient table (i.e. one
+ ** created by a sub-select). In this case the return value of this
+ ** function should never be used.
+ **
+ ** We return -1000000 instead of the more usual -1 simply because using
+ ** -1000000 as incorrectly using -1000000 index into db->aDb[] is much
+ ** more likely to cause a segfault than -1 (of course there are assert()
+ ** statements too, but it never hurts to play the odds).
+ */
+ if( pSchema ){
+ for(i=0; i<db->nDb; i++){
+ if( db->aDb[i].pSchema==pSchema ){
+ break;
+ }
+ }
+ assert( i>=0 &&i>=0 && i<db->nDb );
+ }
+ return i;
+}
+
+/*
** Compile the UTF-8 encoded SQL statement zSql into a statement handle.
*/
int sqlite3_prepare(
@@ -424,10 +459,10 @@ int sqlite3_prepare(
Parse sParse;
char *zErrMsg = 0;
int rc = SQLITE_OK;
+ int i;
- if( sqlite3_malloc_failed ){
- return SQLITE_NOMEM;
- }
+ /* Assert that malloc() has not failed */
+ assert( !sqlite3MallocFailed() );
assert( ppStmt );
*ppStmt = 0;
@@ -435,24 +470,43 @@ int sqlite3_prepare(
return SQLITE_MISUSE;
}
+ /* If any attached database schemas are locked, do not proceed with
+ ** compilation. Instead return SQLITE_LOCKED immediately.
+ */
+ for(i=0; i<db->nDb; i++) {
+ Btree *pBt = db->aDb[i].pBt;
+ if( pBt && sqlite3BtreeSchemaLocked(pBt) ){
+ const char *zDb = db->aDb[i].zName;
+ sqlite3Error(db, SQLITE_LOCKED, "database schema is locked: %s", zDb);
+ sqlite3SafetyOff(db);
+ return SQLITE_LOCKED;
+ }
+ }
+
memset(&sParse, 0, sizeof(sParse));
sParse.db = db;
- sqlite3RunParser(&sParse, zSql, &zErrMsg);
+ if( nBytes>=0 && zSql[nBytes]!=0 ){
+ char *zSqlCopy = sqlite3StrNDup(zSql, nBytes);
+ sqlite3RunParser(&sParse, zSqlCopy, &zErrMsg);
+ sParse.zTail += zSql - zSqlCopy;
+ sqliteFree(zSqlCopy);
+ }else{
+ sqlite3RunParser(&sParse, zSql, &zErrMsg);
+ }
- if( sqlite3_malloc_failed ){
- rc = SQLITE_NOMEM;
- sqlite3RollbackAll(db);
- sqlite3ResetInternalSchema(db, 0);
- db->flags &= ~SQLITE_InTrans;
- goto prepare_out;
+ if( sqlite3MallocFailed() ){
+ sParse.rc = SQLITE_NOMEM;
}
if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK;
- if( sParse.rc!=SQLITE_OK && sParse.checkSchema && !schemaIsValid(db) ){
+ if( sParse.checkSchema && !schemaIsValid(db) ){
sParse.rc = SQLITE_SCHEMA;
}
if( sParse.rc==SQLITE_SCHEMA ){
sqlite3ResetInternalSchema(db, 0);
}
+ if( sqlite3MallocFailed() ){
+ sParse.rc = SQLITE_NOMEM;
+ }
if( pzTail ) *pzTail = sParse.zTail;
rc = sParse.rc;
@@ -460,21 +514,20 @@ int sqlite3_prepare(
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);
+ sqlite3VdbeSetColName(sParse.pVdbe, 0, COLNAME_NAME, "order", P3_STATIC);
+ sqlite3VdbeSetColName(sParse.pVdbe, 1, COLNAME_NAME, "from", P3_STATIC);
+ sqlite3VdbeSetColName(sParse.pVdbe, 2, COLNAME_NAME, "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);
+ sqlite3VdbeSetColName(sParse.pVdbe, 0, COLNAME_NAME, "addr", P3_STATIC);
+ sqlite3VdbeSetColName(sParse.pVdbe, 1, COLNAME_NAME, "opcode", P3_STATIC);
+ sqlite3VdbeSetColName(sParse.pVdbe, 2, COLNAME_NAME, "p1", P3_STATIC);
+ sqlite3VdbeSetColName(sParse.pVdbe, 3, COLNAME_NAME, "p2", P3_STATIC);
+ sqlite3VdbeSetColName(sParse.pVdbe, 4, COLNAME_NAME, "p3", P3_STATIC);
}
}
#endif
-prepare_out:
if( sqlite3SafetyOff(db) ){
rc = SQLITE_MISUSE;
}
@@ -490,6 +543,9 @@ prepare_out:
}else{
sqlite3Error(db, rc, 0);
}
+
+ rc = sqlite3ApiExit(db, rc);
+ sqlite3ReleaseThreadData();
return rc;
}
@@ -508,22 +564,17 @@ int sqlite3_prepare16(
** 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;
+ char *zSql8;
+ const char *zTail8 = 0;
+ int rc = SQLITE_OK;
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;
+ zSql8 = sqlite3utf16to8(zSql, nBytes);
+ if( zSql8 ){
+ rc = sqlite3_prepare(db, zSql8, -1, ppStmt, &zTail8);
}
- rc = sqlite3_prepare(db, zSql8, -1, ppStmt, &zTail8);
if( zTail8 && pzTail ){
/* If sqlite3_prepare returns a tail pointer, we calculate the
@@ -534,7 +585,7 @@ int sqlite3_prepare16(
int chars_parsed = sqlite3utf8CharLen(zSql8, zTail8-zSql8);
*pzTail = (u8 *)zSql + sqlite3utf16ByteLen(zSql, chars_parsed);
}
-
- return rc;
+ sqliteFree(zSql8);
+ return sqlite3ApiExit(db, rc);
}
#endif /* SQLITE_OMIT_UTF16 */
diff --git a/ext/pdo_sqlite/sqlite/src/printf.c b/ext/pdo_sqlite/sqlite/src/printf.c
index a669eb8d4..b4c37fb61 100644
--- a/ext/pdo_sqlite/sqlite/src/printf.c
+++ b/ext/pdo_sqlite/sqlite/src/printf.c
@@ -65,15 +65,14 @@
#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 '',
+#define etCHARLIT 10 /* Literal characters. %' */
+#define etSQLESCAPE 11 /* Strings with '\'' doubled. %q */
+#define etSQLESCAPE2 12 /* 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 */
+#define etTOKEN 13 /* a pointer to a Token structure */
+#define etSRCLIST 14 /* a pointer to a SrcList */
+#define etPOINTER 15 /* The %p conversion */
/*
@@ -120,10 +119,12 @@ static const et_info fmtinfo[] = {
{ 'u', 10, 0, etRADIX, 0, 0 },
{ 'x', 16, 0, etRADIX, 16, 1 },
{ 'X', 16, 0, etRADIX, 0, 4 },
+#ifndef SQLITE_OMIT_FLOATING_POINT
{ 'f', 0, 1, etFLOAT, 0, 0 },
{ 'e', 0, 1, etEXP, 30, 0 },
{ 'E', 0, 1, etEXP, 14, 0 },
{ 'G', 0, 1, etGENERIC, 14, 0 },
+#endif
{ 'i', 10, 1, etRADIX, 0, 0 },
{ 'n', 0, 0, etSIZE, 0, 0 },
{ '%', 0, 0, etPERCENT, 0, 0 },
@@ -134,10 +135,10 @@ static const et_info fmtinfo[] = {
#define etNINFO (sizeof(fmtinfo)/sizeof(fmtinfo[0]))
/*
-** If NOFLOATINGPOINT is defined, then none of the floating point
+** If SQLITE_OMIT_FLOATING_POINT is defined, then none of the floating point
** conversions will work.
*/
-#ifndef etNOFLOATINGPOINT
+#ifndef SQLITE_OMIT_FLOATING_POINT
/*
** "*val" is a double such that 0.1 <= *val < 10.0
** Return the ascii code for the leading digit of *val, then
@@ -161,7 +162,7 @@ static int et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){
*val = (*val - d)*10.0;
return digit;
}
-#endif
+#endif /* SQLITE_OMIT_FLOATING_POINT */
/*
** On machines with a small stack size, you can redefine the
@@ -223,7 +224,7 @@ static int vxprintf(
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 */
+ sqlite_uint64 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 */
@@ -234,7 +235,7 @@ static int vxprintf(
static const char spaces[] =
" ";
#define etSPACESIZE (sizeof(spaces)-1)
-#ifndef etNOFLOATINGPOINT
+#ifndef SQLITE_OMIT_FLOATING_POINT
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 */
@@ -327,17 +328,22 @@ static int vxprintf(
}
/* 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;
+ }else{
+ return -1;
}
break;
}
}
zExtra = 0;
+ if( infop==0 ){
+ return -1;
+ }
+
/* Limit the precision to prevent overflowing buf[] during conversion */
if( precision>etBUFSIZE-40 && (infop->flags & FLAG_STRING)==0 ){
@@ -425,7 +431,7 @@ static int vxprintf(
case etEXP:
case etGENERIC:
realvalue = va_arg(ap,double);
-#ifndef etNOFLOATINGPOINT
+#ifndef SQLITE_OMIT_FLOATING_POINT
if( precision<0 ) precision = 6; /* Set default precision */
if( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10;
if( realvalue<0.0 ){
@@ -442,7 +448,7 @@ static int vxprintf(
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);
+ 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 */
@@ -594,13 +600,13 @@ static int vxprintf(
break;
case etSQLESCAPE:
case etSQLESCAPE2: {
- int i, j, n, c, isnull;
+ int i, j, n, ch, 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++;
+ char *escarg = va_arg(ap,char*);
+ isnull = escarg==0;
+ if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
+ for(i=n=0; (ch=escarg[i])!=0; i++){
+ if( ch=='\'' ) n++;
}
needQuote = !isnull && xtype==etSQLESCAPE2;
n += i + 1 + needQuote*2;
@@ -612,20 +618,21 @@ static int vxprintf(
}
j = 0;
if( needQuote ) bufpt[j++] = '\'';
- for(i=0; (c=arg[i])!=0; i++){
- bufpt[j++] = c;
- if( c=='\'' ) bufpt[j++] = c;
+ for(i=0; (ch=escarg[i])!=0; i++){
+ bufpt[j++] = ch;
+ if( ch=='\'' ) bufpt[j++] = ch;
}
if( needQuote ) bufpt[j++] = '\'';
bufpt[j] = 0;
length = j;
- if( precision>=0 && precision<length ) length = precision;
+ /* The precision is ignored on %q and %Q */
+ /* 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);
+ (*func)(arg, (char*)pToken->z, pToken->n);
}
length = width = 0;
break;
@@ -643,15 +650,6 @@ static int vxprintf(
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
@@ -808,29 +806,28 @@ char *sqlite3MPrintf(const char *zFormat, ...){
}
/*
-** Print into memory obtained from malloc(). Do not use the internal
-** %-conversion extensions. This routine is for use by external users.
+** Print into memory obtained from sqlite3_malloc(). Omit the internal
+** %-conversion extensions.
+*/
+char *sqlite3_vmprintf(const char *zFormat, va_list ap){
+ char zBase[SQLITE_PRINT_BUF_SIZE];
+ return base_vprintf(sqlite3_realloc, 0, zBase, sizeof(zBase), zFormat, ap);
+}
+
+/*
+** Print into memory obtained from sqlite3_malloc()(). Omit the internal
+** %-conversion extensions.
*/
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);
+ char zBase[SQLITE_PRINT_BUF_SIZE];
+ va_start(ap, zFormat);
+ z = base_vprintf(sqlite3_realloc, 0, zBase, sizeof(zBase), 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
diff --git a/ext/pdo_sqlite/sqlite/src/select.c b/ext/pdo_sqlite/sqlite/src/select.c
index 8a51208d7..57b415bf5 100644
--- a/ext/pdo_sqlite/sqlite/src/select.c
+++ b/ext/pdo_sqlite/sqlite/src/select.c
@@ -16,6 +16,21 @@
*/
#include "sqliteInt.h"
+/*
+** Delete all the content of a Select structure but do not deallocate
+** the select structure itself.
+*/
+static void clearSelect(Select *p){
+ 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);
+}
/*
** Allocate a new Select structure and return a pointer to that
@@ -33,41 +48,49 @@ Select *sqlite3SelectNew(
Expr *pOffset /* OFFSET value. NULL means no offset */
){
Select *pNew;
+ Select standin;
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;
+ pNew = &standin;
+ memset(pNew, 0, sizeof(*pNew));
+ }
+ 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->addrOpenEphm[0] = -1;
+ pNew->addrOpenEphm[1] = -1;
+ pNew->addrOpenEphm[2] = -1;
+ if( pNew==&standin) {
+ clearSelect(pNew);
+ pNew = 0;
}
return pNew;
}
/*
+** Delete the given Select structure and all of its substructures.
+*/
+void sqlite3SelectDelete(Select *p){
+ if( p ){
+ clearSelect(p);
+ sqliteFree(p);
+ }
+}
+
+/*
** 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:
@@ -109,7 +132,7 @@ int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
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 ){
+ && sqlite3StrNICmp((char*)p->z, keywords[j].zKeyword, p->n)==0 ){
jointype |= keywords[j].code;
break;
}
@@ -154,15 +177,15 @@ static int columnIndex(Table *pTab, const char *zCol){
** 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->z = (u8*)z;
+ p->n = z ? strlen(z) : 0;
p->dyn = 0;
}
/*
** Create an expression node for an identifier with the name of zName
*/
-static Expr *createIdExpr(const char *zName){
+Expr *sqlite3CreateIdExpr(const char *zName){
Token dummy;
setToken(&dummy, zName);
return sqlite3Expr(TK_ID, 0, 0, &dummy);
@@ -186,22 +209,27 @@ static void addWhereTerm(
Expr *pE2a, *pE2b, *pE2c;
Expr *pE;
- pE1a = createIdExpr(zCol);
- pE2a = createIdExpr(zCol);
+ pE1a = sqlite3CreateIdExpr(zCol);
+ pE2a = sqlite3CreateIdExpr(zCol);
if( zAlias1==0 ){
zAlias1 = pTab1->zName;
}
- pE1b = createIdExpr(zAlias1);
+ pE1b = sqlite3CreateIdExpr(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);
+ pE2b = sqlite3CreateIdExpr(zAlias2);
+ pE1c = sqlite3ExprOrFree(TK_DOT, pE1b, pE1a, 0);
+ pE2c = sqlite3ExprOrFree(TK_DOT, pE2b, pE2a, 0);
+ pE = sqlite3ExprOrFree(TK_EQ, pE1c, pE2c, 0);
+ if( pE ){
+ ExprSetProperty(pE, EP_FromJoin);
+ pE->iRightJoinTable = iRightJoinTable;
+ }
+ pE = sqlite3ExprAnd(*ppExpr, pE);
+ if( pE ){
+ *ppExpr = pE;
+ }
}
/*
@@ -331,58 +359,52 @@ static int sqliteProcessJoin(Parse *pParse, Select *p){
}
/*
-** 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){
+static void pushOntoSorter(
+ Parse *pParse, /* Parser context */
+ ExprList *pOrderBy, /* The ORDER BY clause */
+ Select *pSelect /* The whole SELECT statement */
+){
+ Vdbe *v = pParse->pVdbe;
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);
+ if( pSelect->iLimit>=0 ){
+ int addr1, addr2;
+ addr1 = sqlite3VdbeAddOp(v, OP_IfMemZero, pSelect->iLimit+1, 0);
+ sqlite3VdbeAddOp(v, OP_MemIncr, -1, pSelect->iLimit+1);
+ addr2 = sqlite3VdbeAddOp(v, OP_Goto, 0, 0);
+ sqlite3VdbeJumpHere(v, addr1);
+ sqlite3VdbeAddOp(v, OP_Last, pOrderBy->iECursor, 0);
+ sqlite3VdbeAddOp(v, OP_Delete, pOrderBy->iECursor, 0);
+ sqlite3VdbeJumpHere(v, addr2);
+ pSelect->iLimit = -1;
+ }
}
/*
-** Add code to implement the OFFSET and LIMIT
+** Add code to implement the OFFSET
*/
-static void codeLimiter(
+static void codeOffset(
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);
+ int addr;
+ sqlite3VdbeAddOp(v, OP_MemIncr, -1, p->iOffset);
+ addr = sqlite3VdbeAddOp(v, OP_IfMemNeg, p->iOffset, 0);
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"));
+ sqlite3VdbeJumpHere(v, addr);
}
}
@@ -392,22 +414,18 @@ static void codeLimiter(
** 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
+** A jump to addrRepeat is made and the N+1 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 */
+ int N /* The top N elements of the stack must be distinct */
){
-#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_Pop, N+1, 0);
sqlite3VdbeAddOp(v, OP_Goto, 0, addrRepeat);
VdbeComment((v, "# skip indistinct records"));
sqlite3VdbeAddOp(v, OP_IdxInsert, iTab, 0);
@@ -447,9 +465,9 @@ static int selectInnerLoop(
/* 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;
+ hasDistinct = distinct>=0 && pEList->nExpr>0;
if( pOrderBy==0 && !hasDistinct ){
- codeLimiter(v, p, iContinue, iBreak, 0);
+ codeOffset(v, p, iContinue, 0);
}
/* Pull the requested columns.
@@ -468,10 +486,11 @@ static int selectInnerLoop(
** part of the result.
*/
if( hasDistinct ){
- int n = pEList->nExpr;
- codeDistinct(v, distinct, iContinue, n, n+1);
+ assert( pEList!=0 );
+ assert( pEList->nExpr==nColumn );
+ codeDistinct(v, distinct, iContinue, nColumn);
if( pOrderBy==0 ){
- codeLimiter(v, p, iContinue, iBreak, nColumn);
+ codeOffset(v, p, iContinue, nColumn);
}
}
@@ -481,7 +500,7 @@ static int selectInnerLoop(
*/
#ifndef SQLITE_OMIT_COMPOUND_SELECT
case SRT_Union: {
- sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT);
+ sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0);
if( aff ){
sqlite3VdbeChangeP3(v, -1, aff, P3_STATIC);
}
@@ -495,7 +514,7 @@ static int selectInnerLoop(
*/
case SRT_Except: {
int addr;
- addr = sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, NULL_ALWAYS_DISTINCT);
+ addr = sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0);
sqlite3VdbeChangeP3(v, -1, aff, P3_STATIC);
sqlite3VdbeAddOp(v, OP_NotFound, iParm, addr+3);
sqlite3VdbeAddOp(v, OP_Delete, iParm, 0);
@@ -506,10 +525,10 @@ static int selectInnerLoop(
/* Store the result as data using a unique key.
*/
case SRT_Table:
- case SRT_VirtualTab: {
+ case SRT_EphemTab: {
sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0);
if( pOrderBy ){
- pushOntoSorter(pParse, v, pOrderBy);
+ pushOntoSorter(pParse, pOrderBy, p);
}else{
sqlite3VdbeAddOp(v, OP_NewRowid, iParm, 0);
sqlite3VdbeAddOp(v, OP_Pull, 1, 0);
@@ -536,29 +555,37 @@ static int selectInnerLoop(
** 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);
+ pushOntoSorter(pParse, pOrderBy, p);
}else{
- char aff = (iParm>>16)&0xFF;
- aff = sqlite3CompareAffinity(pEList->a[0].pExpr, aff);
- sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, &aff, 1);
+ char affinity = (iParm>>16)&0xFF;
+ affinity = sqlite3CompareAffinity(pEList->a[0].pExpr, affinity);
+ sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, &affinity, 1);
sqlite3VdbeAddOp(v, OP_IdxInsert, (iParm&0x0000FFFF), 0);
}
sqlite3VdbeJumpHere(v, addr2);
break;
}
+ /* If any row exist in the result set, record that fact and abort.
+ */
+ case SRT_Exists: {
+ sqlite3VdbeAddOp(v, OP_MemInt, 1, iParm);
+ sqlite3VdbeAddOp(v, OP_Pop, nColumn, 0);
+ /* The LIMIT clause will terminate the loop for us */
+ 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);
+ pushOntoSorter(pParse, pOrderBy, p);
}else{
sqlite3VdbeAddOp(v, OP_MemStore, iParm, 1);
- sqlite3VdbeAddOp(v, OP_Goto, 0, iBreak);
+ /* The LIMIT clause will jump out of the loop for us */
}
break;
}
@@ -572,7 +599,7 @@ static int selectInnerLoop(
case SRT_Callback: {
if( pOrderBy ){
sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0);
- pushOntoSorter(pParse, v, pOrderBy);
+ pushOntoSorter(pParse, pOrderBy, p);
}else if( eDest==SRT_Subroutine ){
sqlite3VdbeAddOp(v, OP_Gosub, 0, iParm);
}else{
@@ -594,6 +621,13 @@ static int selectInnerLoop(
}
#endif
}
+
+ /* Jump to the end of the loop if the LIMIT is reached.
+ */
+ if( p->iLimit>=0 && pOrderBy==0 ){
+ sqlite3VdbeAddOp(v, OP_MemIncr, -1, p->iLimit);
+ sqlite3VdbeAddOp(v, OP_IfMemZero, p->iLimit, iBreak);
+ }
return 0;
}
@@ -622,9 +656,9 @@ static KeyInfo *keyInfoFromExprList(Parse *pParse, ExprList *pList){
nExpr = pList->nExpr;
pInfo = sqliteMalloc( sizeof(*pInfo) + nExpr*(sizeof(CollSeq*)+1) );
if( pInfo ){
- pInfo->aSortOrder = (char*)&pInfo->aColl[nExpr];
+ pInfo->aSortOrder = (u8*)&pInfo->aColl[nExpr];
pInfo->nField = nExpr;
- pInfo->enc = db->enc;
+ pInfo->enc = ENC(db);
for(i=0, pItem=pList->a; i<nExpr; i++, pItem++){
CollSeq *pColl;
pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr);
@@ -646,7 +680,7 @@ static KeyInfo *keyInfoFromExprList(Parse *pParse, ExprList *pList){
** routine generates the code needed to do that.
*/
static void generateSortTail(
- Parse *pParse, /* The parsing context */
+ Parse *pParse, /* Parsing context */
Select *p, /* The SELECT statement */
Vdbe *v, /* Generate code into this VDBE */
int nColumn, /* Number of columns of data */
@@ -657,15 +691,24 @@ static void generateSortTail(
int cont = sqlite3VdbeMakeLabel(v);
int addr;
int iTab;
+ int pseudoTab;
ExprList *pOrderBy = p->pOrderBy;
iTab = pOrderBy->iECursor;
+ if( eDest==SRT_Callback || eDest==SRT_Subroutine ){
+ pseudoTab = pParse->nTab++;
+ sqlite3VdbeAddOp(v, OP_OpenPseudo, pseudoTab, 0);
+ sqlite3VdbeAddOp(v, OP_SetNumColumns, pseudoTab, nColumn);
+ }
addr = 1 + sqlite3VdbeAddOp(v, OP_Sort, iTab, brk);
- codeLimiter(v, p, cont, brk, 0);
+ codeOffset(v, p, cont, 0);
+ if( eDest==SRT_Callback || eDest==SRT_Subroutine ){
+ sqlite3VdbeAddOp(v, OP_Integer, 1, 0);
+ }
sqlite3VdbeAddOp(v, OP_Column, iTab, pOrderBy->nExpr + 1);
switch( eDest ){
case SRT_Table:
- case SRT_VirtualTab: {
+ case SRT_EphemTab: {
sqlite3VdbeAddOp(v, OP_NewRowid, iParm, 0);
sqlite3VdbeAddOp(v, OP_Pull, 1, 0);
sqlite3VdbeAddOp(v, OP_Insert, iParm, 0);
@@ -677,32 +720,29 @@ static void generateSortTail(
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);
+ sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, "c", 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);
+ /* The LIMIT clause will terminate the loop for us */
break;
}
#endif
case SRT_Callback:
case SRT_Subroutine: {
int i;
- sqlite3VdbeAddOp(v, OP_Integer, p->pEList->nExpr, 0);
- sqlite3VdbeAddOp(v, OP_Pull, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Insert, pseudoTab, 0);
for(i=0; i<nColumn; i++){
- sqlite3VdbeAddOp(v, OP_Column, -1-i, i);
+ sqlite3VdbeAddOp(v, OP_Column, pseudoTab, 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: {
@@ -710,23 +750,54 @@ static void generateSortTail(
break;
}
}
+
+ /* Jump to the end of the loop when the LIMIT is reached
+ */
+ if( p->iLimit>=0 ){
+ sqlite3VdbeAddOp(v, OP_MemIncr, -1, p->iLimit);
+ sqlite3VdbeAddOp(v, OP_IfMemZero, p->iLimit, brk);
+ }
+
+ /* The bottom of the loop
+ */
sqlite3VdbeResolveLabel(v, cont);
sqlite3VdbeAddOp(v, OP_Next, iTab, addr);
sqlite3VdbeResolveLabel(v, brk);
+ if( eDest==SRT_Callback || eDest==SRT_Subroutine ){
+ sqlite3VdbeAddOp(v, OP_Close, pseudoTab, 0);
+ }
+
}
/*
** 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 is the exact datatype definition extracted from the
+** original CREATE TABLE statement if the expression is a column. The
+** declaration type for a ROWID field is INTEGER. Exactly when an expression
+** is considered a column can be complex in the presence of subqueries. The
+** result-set expression in all of the following SELECT statements is
+** considered a column by this function.
+**
+** SELECT col FROM tbl;
+** SELECT (SELECT col FROM tbl;
+** SELECT (SELECT col FROM tbl);
+** SELECT abc FROM (SELECT col AS abc FROM tbl);
**
-** The declaration type for an expression is either TEXT, NUMERIC or ANY.
-** The declaration type for a ROWID field is INTEGER.
+** The declaration type for any expression other than a column is NULL.
*/
-static const char *columnType(NameContext *pNC, Expr *pExpr){
- char const *zType;
+static const char *columnType(
+ NameContext *pNC,
+ Expr *pExpr,
+ const char **pzOriginDb,
+ const char **pzOriginTab,
+ const char **pzOriginCol
+){
+ char const *zType = 0;
+ char const *zOriginDb = 0;
+ char const *zOriginTab = 0;
+ char const *zOriginCol = 0;
int j;
if( pExpr==0 || pNC->pSrcList==0 ) return 0;
@@ -737,18 +808,26 @@ static const char *columnType(NameContext *pNC, Expr *pExpr){
assert( pExpr->op!=TK_AS );
switch( pExpr->op ){
+ case TK_AGG_COLUMN:
case TK_COLUMN: {
- Table *pTab = 0;
- int iCol = pExpr->iColumn;
+ /* The expression is a column. Locate the table the column is being
+ ** extracted from in NameContext.pSrcList. This table may be real
+ ** database table or a subquery.
+ */
+ Table *pTab = 0; /* Table structure column is extracted from */
+ Select *pS = 0; /* Select the column is extracted from */
+ int iCol = pExpr->iColumn; /* Index of column in pTab */
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;
+ pS = pTabList->a[j].pSelect;
}else{
pNC = pNC->pNext;
}
}
+
if( pTab==0 ){
/* FIX ME:
** This can occurs if you have something like "SELECT new.x;" inside
@@ -763,30 +842,69 @@ static const char *columnType(NameContext *pNC, Expr *pExpr){
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;
+ if( pS ){
+ /* The "table" is actually a sub-select or a view in the FROM clause
+ ** of the SELECT statement. Return the declaration type and origin
+ ** data for the result-set column of the sub-select.
+ */
+ if( iCol>=0 && iCol<pS->pEList->nExpr ){
+ /* If iCol is less than zero, then the expression requests the
+ ** rowid of the sub-select or view. This expression is legal (see
+ ** test case misc2.2.2) - it always evaluates to NULL.
+ */
+ NameContext sNC;
+ Expr *p = pS->pEList->a[iCol].pExpr;
+ sNC.pSrcList = pS->pSrc;
+ sNC.pNext = 0;
+ sNC.pParse = pNC->pParse;
+ zType = columnType(&sNC, p, &zOriginDb, &zOriginTab, &zOriginCol);
+ }
+ }else if( pTab->pSchema ){
+ /* A real table */
+ assert( !pS );
+ if( iCol<0 ) iCol = pTab->iPKey;
+ assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
+ if( iCol<0 ){
+ zType = "INTEGER";
+ zOriginCol = "rowid";
+ }else{
+ zType = pTab->aCol[iCol].zType;
+ zOriginCol = pTab->aCol[iCol].zName;
+ }
+ zOriginTab = pTab->zName;
+ if( pNC->pParse ){
+ int iDb = sqlite3SchemaToIndex(pNC->pParse->db, pTab->pSchema);
+ zOriginDb = pNC->pParse->db->aDb[iDb].zName;
+ }
}
break;
}
#ifndef SQLITE_OMIT_SUBQUERY
case TK_SELECT: {
+ /* The expression is a sub-select. Return the declaration type and
+ ** origin info for the single column in the result set of the SELECT
+ ** statement.
+ */
NameContext sNC;
Select *pS = pExpr->pSelect;
- sNC.pSrcList = pExpr->pSelect->pSrc;
+ Expr *p = pS->pEList->a[0].pExpr;
+ sNC.pSrcList = pS->pSrc;
sNC.pNext = pNC;
- zType = columnType(&sNC, pS->pEList->a[0].pExpr);
+ sNC.pParse = pNC->pParse;
+ zType = columnType(&sNC, p, &zOriginDb, &zOriginTab, &zOriginCol);
break;
}
#endif
- default:
- zType = 0;
}
+ if( pzOriginDb ){
+ assert( pzOriginTab && pzOriginCol );
+ *pzOriginDb = zOriginDb;
+ *pzOriginTab = zOriginTab;
+ *pzOriginCol = zOriginCol;
+ }
return zType;
}
@@ -803,14 +921,22 @@ static void generateColumnTypes(
int i;
NameContext sNC;
sNC.pSrcList = pTabList;
+ sNC.pParse = pParse;
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.
+ const char *zOrigDb = 0;
+ const char *zOrigTab = 0;
+ const char *zOrigCol = 0;
+ const char *zType = columnType(&sNC, p, &zOrigDb, &zOrigTab, &zOrigCol);
+
+ /* The vdbe must make it's own copy of the column-type and other
+ ** column specific strings, in case the schema is reset before this
+ ** virtual machine is deleted.
*/
- sqlite3VdbeSetColName(v, i+pEList->nExpr, zType, strlen(zType));
+ sqlite3VdbeSetColName(v, i, COLNAME_DECLTYPE, zType, P3_TRANSIENT);
+ sqlite3VdbeSetColName(v, i, COLNAME_DATABASE, zOrigDb, P3_TRANSIENT);
+ sqlite3VdbeSetColName(v, i, COLNAME_TABLE, zOrigTab, P3_TRANSIENT);
+ sqlite3VdbeSetColName(v, i, COLNAME_COLUMN, zOrigCol, P3_TRANSIENT);
}
}
@@ -837,7 +963,7 @@ static void generateColumnNames(
#endif
assert( v!=0 );
- if( pParse->colNamesSet || v==0 || sqlite3_malloc_failed ) return;
+ if( pParse->colNamesSet || v==0 || sqlite3MallocFailed() ) return;
pParse->colNamesSet = 1;
fullNames = (db->flags & SQLITE_FullColNames)!=0;
shortNames = (db->flags & SQLITE_ShortColNames)!=0;
@@ -848,7 +974,7 @@ static void generateColumnNames(
if( p==0 ) continue;
if( pEList->a[i].zName ){
char *zName = pEList->a[i].zName;
- sqlite3VdbeSetColName(v, i, zName, strlen(zName));
+ sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, strlen(zName));
continue;
}
if( p->op==TK_COLUMN && pTabList ){
@@ -866,26 +992,26 @@ static void generateColumnNames(
zCol = pTab->aCol[iCol].zName;
}
if( !shortNames && !fullNames && p->span.z && p->span.z[0] ){
- sqlite3VdbeSetColName(v, i, p->span.z, p->span.n);
+ sqlite3VdbeSetColName(v, i, COLNAME_NAME, (char*)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);
+ sqlite3SetString(&zName, zTab, ".", zCol, (char*)0);
+ sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, P3_DYNAMIC);
}else{
- sqlite3VdbeSetColName(v, i, zCol, strlen(zCol));
+ sqlite3VdbeSetColName(v, i, COLNAME_NAME, zCol, strlen(zCol));
}
}else if( p->span.z && p->span.z[0] ){
- sqlite3VdbeSetColName(v, i, p->span.z, p->span.n);
+ sqlite3VdbeSetColName(v, i, COLNAME_NAME, (char*)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);
+ sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, 0);
}
}
generateColumnTypes(pParse, pTabList, pEList);
@@ -922,6 +1048,7 @@ Table *sqlite3ResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){
ExprList *pEList;
Column *aCol, *pCol;
+ while( pSelect->pPrior ) pSelect = pSelect->pPrior;
if( prepSelectStmt(pParse, pSelect) ){
return 0;
}
@@ -943,6 +1070,7 @@ Table *sqlite3ResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){
char *zType;
char *zName;
char *zBasename;
+ CollSeq *pColl;
int cnt;
NameContext sNC;
@@ -965,7 +1093,7 @@ Table *sqlite3ResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){
zName = sqlite3MPrintf("column%d", i+1);
}
sqlite3Dequote(zName);
- if( sqlite3_malloc_failed ){
+ if( sqlite3MallocFailed() ){
sqliteFree(zName);
sqlite3DeleteTable(0, pTab);
return 0;
@@ -992,12 +1120,12 @@ Table *sqlite3ResultSetOfSelect(Parse *pParse, char *zTabName, Select *pSelect){
*/
memset(&sNC, 0, sizeof(sNC));
sNC.pSrcList = pSelect->pSrc;
- zType = sqliteStrDup(columnType(&sNC, p));
+ zType = sqliteStrDup(columnType(&sNC, p, 0, 0, 0));
pCol->zType = zType;
pCol->affinity = sqlite3ExprAffinity(p);
- pCol->pColl = sqlite3ExprCollSeq(pParse, p);
- if( !pCol->pColl ){
- pCol->pColl = pParse->db->pDfltColl;
+ pColl = sqlite3ExprCollSeq(pParse, p);
+ if( pColl ){
+ pCol->zColl = sqliteStrDup(pColl->zName);
}
}
pTab->iPKey = -1;
@@ -1034,10 +1162,11 @@ 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;
+ if( p==0 || p->pSrc==0 || sqlite3MallocFailed() ){
+ return 1;
+ }
pTabList = p->pSrc;
pEList = p->pEList;
@@ -1051,6 +1180,7 @@ static int prepSelectStmt(Parse *pParse, Select *p){
** then create a transient table structure to describe the subquery.
*/
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
+ Table *pTab;
if( pFrom->pTab!=0 ){
/* This statement has already been prepared. There is no need
** to go further. */
@@ -1071,11 +1201,11 @@ static int prepSelectStmt(Parse *pParse, Select *p){
if( pTab==0 ){
return 1;
}
- /* The isTransient flag indicates that the Table structure has been
+ /* The isEphem 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;
+ pTab->isEphem = 1;
#endif
}else{
/* An ordinary table or view name in the FROM clause */
@@ -1086,8 +1216,8 @@ static int prepSelectStmt(Parse *pParse, Select *p){
return 1;
}
pTab->nRef++;
-#ifndef SQLITE_OMIT_VIEW
- if( pTab->pSelect ){
+#if !defined(SQLITE_OMIT_VIEW) || !defined (SQLITE_OMIT_VIRTUALTABLE)
+ if( pTab->pSelect || IsVirtual(pTab) ){
/* We reach here if the named table is a really a view */
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
return 1;
@@ -1145,7 +1275,11 @@ static int prepSelectStmt(Parse *pParse, Select *p){
/* 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;
+ if( pNew ){
+ pNew->a[pNew->nExpr-1].zName = a[k].zName;
+ }else{
+ rc = 1;
+ }
a[k].pExpr = 0;
a[k].zName = 0;
}else{
@@ -1170,7 +1304,7 @@ static int prepSelectStmt(Parse *pParse, Select *p){
}
tableSeen = 1;
for(j=0; j<pTab->nCol; j++){
- Expr *pExpr, *pLeft, *pRight;
+ Expr *pExpr, *pRight;
char *zName = pTab->aCol[j].zName;
if( i>0 ){
@@ -1191,7 +1325,7 @@ static int prepSelectStmt(Parse *pParse, Select *p){
if( pRight==0 ) break;
setToken(&pRight->token, zName);
if( zTabName && (longNames || pTabList->nSrc>1) ){
- pLeft = sqlite3Expr(TK_ID, 0, 0, 0);
+ Expr *pLeft = sqlite3Expr(TK_ID, 0, 0, 0);
pExpr = sqlite3Expr(TK_DOT, pLeft, pRight, 0);
if( pExpr==0 ) break;
setToken(&pLeft->token, zTabName);
@@ -1326,25 +1460,31 @@ Vdbe *sqlite3GetVdbe(Parse *pParse){
return v;
}
+
/*
** Compute the iLimit and iOffset fields of the SELECT based on the
-** pLimit and pOffset expressions. nLimit and nOffset hold the expressions
+** pLimit and pOffset expressions. pLimit and pOffset 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
+** This routine changes the values of iLimit and iOffset only if
+** a limit or offset is defined by pLimit and pOffset. 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
+** Only if pLimit!=0 or pOffset!=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){
+static void computeLimitRegisters(Parse *pParse, Select *p, int iBreak){
+ Vdbe *v = 0;
+ int iLimit = 0;
+ int iOffset;
+ int addr1, addr2;
+
/*
** "LIMIT -1" always shows all rows. There is some
** contraversy about what the correct behavior should be.
@@ -1352,26 +1492,41 @@ static void computeLimitRegisters(Parse *pParse, Select *p){
** no rows.
*/
if( p->pLimit ){
- int iMem = pParse->nMem++;
- Vdbe *v = sqlite3GetVdbe(pParse);
+ p->iLimit = iLimit = pParse->nMem;
+ pParse->nMem += 2;
+ 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);
+ sqlite3VdbeAddOp(v, OP_MemStore, iLimit, 0);
VdbeComment((v, "# LIMIT counter"));
- p->iLimit = iMem;
+ sqlite3VdbeAddOp(v, OP_IfMemZero, iLimit, iBreak);
}
if( p->pOffset ){
- int iMem = pParse->nMem++;
- Vdbe *v = sqlite3GetVdbe(pParse);
+ p->iOffset = iOffset = pParse->nMem++;
+ 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);
+ sqlite3VdbeAddOp(v, OP_MemStore, iOffset, p->pLimit==0);
VdbeComment((v, "# OFFSET counter"));
- p->iOffset = iMem;
+ addr1 = sqlite3VdbeAddOp(v, OP_IfMemPos, iOffset, 0);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Integer, 0, 0);
+ sqlite3VdbeJumpHere(v, addr1);
+ if( p->pLimit ){
+ sqlite3VdbeAddOp(v, OP_Add, 0, 0);
+ }
+ }
+ if( p->pLimit ){
+ addr1 = sqlite3VdbeAddOp(v, OP_IfMemPos, iLimit, 0);
+ sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
+ sqlite3VdbeAddOp(v, OP_MemInt, -1, iLimit+1);
+ addr2 = sqlite3VdbeAddOp(v, OP_Goto, 0, 0);
+ sqlite3VdbeJumpHere(v, addr1);
+ sqlite3VdbeAddOp(v, OP_MemStore, iLimit+1, 1);
+ VdbeComment((v, "# LIMIT+OFFSET"));
+ sqlite3VdbeJumpHere(v, addr2);
}
}
@@ -1383,27 +1538,13 @@ static void createSortingIndex(Parse *pParse, Select *p, ExprList *pOrderBy){
int addr;
assert( pOrderBy->iECursor==0 );
pOrderBy->iECursor = pParse->nTab++;
- addr = sqlite3VdbeAddOp(pParse->pVdbe, OP_OpenVirtual,
+ addr = sqlite3VdbeAddOp(pParse->pVdbe, OP_OpenEphemeral,
pOrderBy->iECursor, pOrderBy->nExpr+1);
- assert( p->addrOpenVirt[2] == -1 );
- p->addrOpenVirt[2] = addr;
+ assert( p->addrOpenEphm[2] == -1 );
+ p->addrOpenEphm[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
@@ -1506,10 +1647,10 @@ static int multiSelect(
/* Create the destination temporary table if necessary
*/
- if( eDest==SRT_VirtualTab ){
+ if( eDest==SRT_EphemTab ){
assert( p->pEList );
assert( nSetP2<sizeof(aSetP2)/sizeof(aSetP2[0]) );
- aSetP2[nSetP2++] = sqlite3VdbeAddOp(v, OP_OpenVirtual, iParm, 0);
+ aSetP2[nSetP2++] = sqlite3VdbeAddOp(v, OP_OpenEphemeral, iParm, 0);
eDest = SRT_Table;
}
@@ -1519,23 +1660,31 @@ static int multiSelect(
switch( p->op ){
case TK_ALL: {
if( pOrderBy==0 ){
+ int addr = 0;
assert( !pPrior->pLimit );
pPrior->pLimit = p->pLimit;
pPrior->pOffset = p->pOffset;
rc = sqlite3Select(pParse, pPrior, eDest, iParm, 0, 0, 0, aff);
+ p->pLimit = 0;
+ p->pOffset = 0;
if( rc ){
goto multi_select_end;
}
p->pPrior = 0;
p->iLimit = pPrior->iLimit;
p->iOffset = pPrior->iOffset;
- p->pLimit = 0;
- p->pOffset = 0;
+ if( p->iLimit>=0 ){
+ addr = sqlite3VdbeAddOp(v, OP_IfMemZero, p->iLimit, 0);
+ VdbeComment((v, "# Jump ahead if LIMIT reached"));
+ }
rc = sqlite3Select(pParse, p, eDest, iParm, 0, 0, 0, aff);
p->pPrior = pPrior;
if( rc ){
goto multi_select_end;
}
+ if( addr ){
+ sqlite3VdbeJumpHere(v, addr);
+ }
break;
}
/* For UNION ALL ... ORDER BY fall through to the next case */
@@ -1563,14 +1712,14 @@ static int multiSelect(
rc = 1;
goto multi_select_end;
}
- addr = sqlite3VdbeAddOp(v, OP_OpenVirtual, unionTab, 0);
+ addr = sqlite3VdbeAddOp(v, OP_OpenEphemeral, 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;
+ assert( p->addrOpenEphm[0] == -1 );
+ p->addrOpenEphm[0] = addr;
+ p->pRightmost->usesEphm = 1;
}
createSortingIndex(pParse, p, pOrderBy);
assert( p->pEList );
@@ -1618,12 +1767,14 @@ static int multiSelect(
int iCont, iBreak, iStart;
assert( p->pEList );
if( eDest==SRT_Callback ){
- generateColumnNames(pParse, 0, p->pEList);
+ Select *pFirst = p;
+ while( pFirst->pPrior ) pFirst = pFirst->pPrior;
+ generateColumnNames(pParse, 0, pFirst->pEList);
}
iBreak = sqlite3VdbeMakeLabel(v);
iCont = sqlite3VdbeMakeLabel(v);
+ computeLimitRegisters(pParse, p, iBreak);
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,
@@ -1657,10 +1808,10 @@ static int multiSelect(
}
createSortingIndex(pParse, p, pOrderBy);
- addr = sqlite3VdbeAddOp(v, OP_OpenVirtual, tab1, 0);
- assert( p->addrOpenVirt[0] == -1 );
- p->addrOpenVirt[0] = addr;
- p->pRightmost->usesVirt = 1;
+ addr = sqlite3VdbeAddOp(v, OP_OpenEphemeral, tab1, 0);
+ assert( p->addrOpenEphm[0] == -1 );
+ p->addrOpenEphm[0] = addr;
+ p->pRightmost->usesEphm = 1;
assert( p->pEList );
/* Code the SELECTs to our left into temporary table "tab1".
@@ -1672,9 +1823,9 @@ static int multiSelect(
/* Code the current SELECT into temporary table "tab2"
*/
- addr = sqlite3VdbeAddOp(v, OP_OpenVirtual, tab2, 0);
- assert( p->addrOpenVirt[1] == -1 );
- p->addrOpenVirt[1] = addr;
+ addr = sqlite3VdbeAddOp(v, OP_OpenEphemeral, tab2, 0);
+ assert( p->addrOpenEphm[1] == -1 );
+ p->addrOpenEphm[1] = addr;
p->pPrior = 0;
pLimit = p->pLimit;
p->pLimit = 0;
@@ -1694,12 +1845,14 @@ static int multiSelect(
*/
assert( p->pEList );
if( eDest==SRT_Callback ){
- generateColumnNames(pParse, 0, p->pEList);
+ Select *pFirst = p;
+ while( pFirst->pPrior ) pFirst = pFirst->pPrior;
+ generateColumnNames(pParse, 0, pFirst->pEList);
}
iBreak = sqlite3VdbeMakeLabel(v);
iCont = sqlite3VdbeMakeLabel(v);
+ computeLimitRegisters(pParse, p, iBreak);
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,
@@ -1746,21 +1899,23 @@ static int multiSelect(
** SELECT might also skip this part if it has no ORDER BY clause and
** no temp tables are required.
*/
- if( pOrderBy || p->usesVirt ){
+ if( pOrderBy || p->usesEphm ){
int i; /* Loop counter */
KeyInfo *pKeyInfo; /* Collating sequence for the result set */
Select *pLoop; /* For looping through SELECT statements */
+ int nKeyCol; /* Number of entries in pKeyInfo->aCol[] */
CollSeq **apColl;
CollSeq **aCopy;
assert( p->pRightmost==p );
- pKeyInfo = sqliteMalloc(sizeof(*pKeyInfo)+nCol*2*sizeof(CollSeq*) + nCol);
+ nKeyCol = nCol + (pOrderBy ? pOrderBy->nExpr : 0);
+ pKeyInfo = sqliteMalloc(sizeof(*pKeyInfo)+nKeyCol*(sizeof(CollSeq*) + 1));
if( !pKeyInfo ){
rc = SQLITE_NOMEM;
goto multi_select_end;
}
- pKeyInfo->enc = pParse->db->enc;
+ pKeyInfo->enc = ENC(pParse->db);
pKeyInfo->nField = nCol;
for(i=0, apColl=pKeyInfo->aColl; i<nCol; i++, apColl++){
@@ -1772,11 +1927,11 @@ static int multiSelect(
for(pLoop=p; pLoop; pLoop=pLoop->pPrior){
for(i=0; i<2; i++){
- int addr = pLoop->addrOpenVirt[i];
+ int addr = pLoop->addrOpenEphm[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 );
+ assert( pLoop->addrOpenEphm[1]<0 );
break;
}
sqlite3VdbeChangeP2(v, addr, nCol);
@@ -1786,15 +1941,15 @@ static int multiSelect(
if( pOrderBy ){
struct ExprList_item *pOTerm = pOrderBy->a;
- int nExpr = pOrderBy->nExpr;
+ int nOrderByExpr = pOrderBy->nExpr;
int addr;
u8 *pSortOrder;
- aCopy = (CollSeq**)&pKeyInfo[1];
- pSortOrder = pKeyInfo->aSortOrder = (u8*)&aCopy[nExpr];
+ aCopy = &pKeyInfo->aColl[nOrderByExpr];
+ pSortOrder = pKeyInfo->aSortOrder = (u8*)&aCopy[nCol];
memcpy(aCopy, pKeyInfo->aColl, nCol*sizeof(CollSeq*));
apColl = pKeyInfo->aColl;
- for(i=0; i<pOrderBy->nExpr; i++, pOTerm++, apColl++, pSortOrder++){
+ for(i=0; i<nOrderByExpr; i++, pOTerm++, apColl++, pSortOrder++){
Expr *pExpr = pOTerm->pExpr;
char *zName = pOTerm->zName;
assert( pExpr->op==TK_COLUMN && pExpr->iColumn<nCol );
@@ -1806,10 +1961,10 @@ static int multiSelect(
*pSortOrder = pOTerm->sortOrder;
}
assert( p->pRightmost==p );
- assert( p->addrOpenVirt[2]>=0 );
- addr = p->addrOpenVirt[2];
+ assert( p->addrOpenEphm[2]>=0 );
+ addr = p->addrOpenEphm[2];
sqlite3VdbeChangeP2(v, addr, p->pEList->nExpr+2);
- pKeyInfo->nField = pOrderBy->nExpr;
+ pKeyInfo->nField = nOrderByExpr;
sqlite3VdbeChangeP3(v, addr, (char*)pKeyInfo, P3_KEYINFO_HANDOFF);
pKeyInfo = 0;
generateSortTail(pParse, p, v, p->pEList->nExpr, eDest, iParm);
@@ -1858,6 +2013,7 @@ static void substExpr(Expr *pExpr, int iTable, ExprList *pEList){
assert( pExpr->pList==0 );
pExpr->pList = sqlite3ExprListDup(pNew->pList);
pExpr->iTable = pNew->iTable;
+ pExpr->pTab = pNew->pTab;
pExpr->iColumn = pNew->iColumn;
pExpr->iAgg = pNew->iAgg;
sqlite3TokenCopy(&pExpr->token, &pNew->token);
@@ -1949,6 +2105,10 @@ static void substSelect(Select *p, int iTable, ExprList *pEList){
** (12) The subquery is not the right term of a LEFT OUTER JOIN or the
** subquery has no WHERE clause. (added by ticket #350)
**
+** (13) The subquery and outer query do not both use LIMIT
+**
+** (14) The subquery does not use OFFSET
+**
** 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.
@@ -1960,7 +2120,6 @@ static void substSelect(Select *p, int iTable, ExprList *pEList){
** 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 */
@@ -1983,18 +2142,26 @@ static int flattenSubquery(
pSubitem = &pSrc->a[iFrom];
pSub = pSubitem->pSelect;
assert( pSub!=0 );
- if( isAgg && subqueryIsAgg ) return 0;
- if( subqueryIsAgg && pSrc->nSrc>1 ) return 0;
+ if( isAgg && subqueryIsAgg ) return 0; /* Restriction (1) */
+ if( subqueryIsAgg && pSrc->nSrc>1 ) return 0; /* Restriction (2) */
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;
+ /* Prior to version 3.1.2, when LIMIT and OFFSET had to be simple constants,
+ ** not arbitrary expresssions, we allowed some combining of LIMIT and OFFSET
+ ** because they could be computed at compile-time. But when LIMIT and OFFSET
+ ** became arbitrary expressions, we were forced to add restrictions (13)
+ ** and (14). */
+ if( pSub->pLimit && p->pLimit ) return 0; /* Restriction (13) */
+ if( pSub->pOffset ) return 0; /* Restriction (14) */
+ if( pSubSrc->nSrc==0 ) return 0; /* Restriction (7) */
+ if( (pSub->isDistinct || pSub->pLimit)
+ && (pSrc->nSrc>1 || isAgg) ){ /* Restrictions (4)(5)(8)(9) */
+ return 0;
+ }
+ if( p->isDistinct && subqueryIsAgg ) return 0; /* Restriction (6) */
+ if( (p->disallowOrderBy || p->pOrderBy) && pSub->pOrderBy ){
+ return 0; /* Restriction (11) */
}
- 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
@@ -2080,14 +2247,14 @@ static int flattenSubquery(
** 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);
+ pList->a[i].zName = sqliteStrNDup((char*)pExpr->span.z, pExpr->span.n);
}
}
+ substExprList(p->pEList, iParent, pSub->pEList);
if( isAgg ){
substExprList(p->pGroupBy, iParent, pSub->pEList);
substExpr(p->pHaving, iParent, pSub->pEList);
@@ -2124,6 +2291,9 @@ static int flattenSubquery(
/*
** SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y;
+ **
+ ** One is tempted to try to add a and b to combine the limits. But this
+ ** does not work if either limit is negative.
*/
if( pSub->pLimit ){
p->pLimit = pSub->pLimit;
@@ -2166,10 +2336,11 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
int base;
Vdbe *v;
int seekOp;
- int cont;
ExprList *pEList, *pList, eList;
struct ExprList_item eListItem;
SrcList *pSrc;
+ int brk;
+ int iDb;
/* Check to see if this query is a simple min() or max() query. Return
** zero if it is not.
@@ -2184,9 +2355,9 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
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 ){
+ if( sqlite3StrNICmp((char*)pExpr->token.z,"min",3)==0 ){
seekOp = OP_Rewind;
- }else if( sqlite3StrNICmp(pExpr->token.z,"max",3)==0 ){
+ }else if( sqlite3StrNICmp((char*)pExpr->token.z,"max",3)==0 ){
seekOp = OP_Last;
}else{
return 0;
@@ -2196,6 +2367,7 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
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
@@ -2206,9 +2378,13 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
pIdx = 0;
}else{
CollSeq *pColl = sqlite3ExprCollSeq(pParse, pExpr);
+ if( pColl==0 ) return 0;
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->aiColumn[0]==iCol &&
+ 0==sqlite3StrICmp(pIdx->azColl[0], pColl->zName) ){
+ break;
+ }
}
if( pIdx==0 ) return 0;
}
@@ -2222,8 +2398,8 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
/* If the output is destined for a temporary table, open that table.
*/
- if( eDest==SRT_VirtualTab ){
- sqlite3VdbeAddOp(v, OP_OpenVirtual, iParm, 1);
+ if( eDest==SRT_EphemTab ){
+ sqlite3VdbeAddOp(v, OP_OpenEphemeral, iParm, 1);
}
/* Generating code to find the min or the max. Basically all we have
@@ -2231,13 +2407,16 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
** 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);
+ iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
+ assert( iDb>=0 || pTab->isEphem );
+ sqlite3CodeVerifySchema(pParse, iDb);
+ sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
base = pSrc->a[0].iCursor;
- computeLimitRegisters(pParse, p);
+ brk = sqlite3VdbeMakeLabel(v);
+ computeLimitRegisters(pParse, p, brk);
if( pSrc->a[0].pSelect==0 ){
- sqlite3OpenTableForReading(v, base, pTab);
+ sqlite3OpenTable(pParse, base, iDb, pTab, OP_OpenRead);
}
- cont = sqlite3VdbeMakeLabel(v);
if( pIdx==0 ){
sqlite3VdbeAddOp(v, seekOp, base, 0);
}else{
@@ -2248,10 +2427,12 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
** "INSERT INTO x SELECT max() FROM x".
*/
int iIdx;
+ KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
iIdx = pParse->nTab++;
- sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
- sqlite3VdbeOp3(v, OP_OpenRead, iIdx, pIdx->tnum,
- (char*)&pIdx->keyInfo, P3_KEYINFO);
+ assert( pIdx->pSchema==pTab->pSchema );
+ sqlite3VdbeAddOp(v, OP_Integer, iDb, 0);
+ sqlite3VdbeOp3(v, OP_OpenRead, iIdx, pIdx->tnum,
+ (char*)pKey, P3_KEYINFO_HANDOFF);
if( seekOp==OP_Rewind ){
sqlite3VdbeAddOp(v, OP_Null, 0, 0);
sqlite3VdbeAddOp(v, OP_MakeRecord, 1, 0);
@@ -2266,8 +2447,8 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){
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);
+ selectInnerLoop(pParse, p, &eList, 0, 0, 0, -1, eDest, iParm, brk, brk, 0);
+ sqlite3VdbeResolveLabel(v, brk);
sqlite3VdbeAddOp(v, OP_Close, base, 0);
return 1;
@@ -2309,11 +2490,6 @@ static int processOrderGroupBy(
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;
}
@@ -2356,14 +2532,8 @@ int sqlite3SelectResolve(
/* Resolve the expressions in the LIMIT and OFFSET clauses. These
** are not allowed to refer to any names, so pass an empty NameContext.
*/
+ memset(&sNC, 0, sizeof(sNC));
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;
@@ -2465,7 +2635,7 @@ static void resetAccumulator(Parse *pParse, AggInfo *pAggInfo){
pFunc->iDistinct = -1;
}else{
KeyInfo *pKeyInfo = keyInfoFromExprList(pParse, pE->pList);
- sqlite3VdbeOp3(v, OP_OpenVirtual, pFunc->iDistinct, 0,
+ sqlite3VdbeOp3(v, OP_OpenEphemeral, pFunc->iDistinct, 0,
(char*)pKeyInfo, P3_KEYINFO_HANDOFF);
}
}
@@ -2511,13 +2681,14 @@ static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){
if( pF->iDistinct>=0 ){
addrNext = sqlite3VdbeMakeLabel(v);
assert( nArg==1 );
- codeDistinct(v, pF->iDistinct, addrNext, 1, 2);
+ codeDistinct(v, pF->iDistinct, addrNext, 1);
}
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++){
+ assert( pList!=0 ); /* pList!=0 if pF->pFunc->needCollSeq is true */
+ for(j=0, pItem=pList->a; !pColl && j<nArg; j++, pItem++){
pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr);
}
if( !pColl ){
@@ -2613,10 +2784,13 @@ int sqlite3Select(
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 */
+ int addrSortIndex; /* Address of an OP_OpenEphemeral instruction */
AggInfo sAggInfo; /* Information used by aggregate queries */
+ int iEnd; /* Address of the end of the query */
- if( sqlite3_malloc_failed || pParse->nErr || p==0 ) return 1;
+ if( p==0 || sqlite3MallocFailed() || pParse->nErr ){
+ return 1;
+ }
if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
memset(&sAggInfo, 0, sizeof(sAggInfo));
@@ -2663,7 +2837,6 @@ int sqlite3Select(
/* 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 "
@@ -2683,13 +2856,6 @@ int sqlite3Select(
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)
@@ -2698,7 +2864,7 @@ int sqlite3Select(
int needRestoreContext;
struct SrcList_item *pItem = &pTabList->a[i];
- if( pItem->pSelect==0 ) continue;
+ if( pItem->pSelect==0 || pItem->isPopulated ) continue;
if( pItem->zName!=0 ){
zSavedAuthContext = pParse->zAuthContext;
pParse->zAuthContext = pItem->zName;
@@ -2706,7 +2872,7 @@ int sqlite3Select(
}else{
needRestoreContext = 0;
}
- sqlite3Select(pParse, pItem->pSelect, SRT_VirtualTab,
+ sqlite3Select(pParse, pItem->pSelect, SRT_EphemTab,
pItem->iCursor, p, i, &isAgg, 0);
if( needRestoreContext ){
pParse->zAuthContext = zSavedAuthContext;
@@ -2735,7 +2901,7 @@ int sqlite3Select(
*/
#ifndef SQLITE_OMIT_VIEW
if( pParent && pParentAgg &&
- flattenSubquery(pParse, pParent, parentTab, *pParentAgg, isAgg) ){
+ flattenSubquery(pParent, parentTab, *pParentAgg, isAgg) ){
if( isAgg ) *pParentAgg = 1;
goto select_end;
}
@@ -2746,7 +2912,7 @@ int sqlite3Select(
**
** 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
+ ** OP_OpenEphemeral 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.
*/
@@ -2763,31 +2929,22 @@ int sqlite3Select(
}
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);
+ p->addrOpenEphm[2] = addrSortIndex =
+ sqlite3VdbeOp3(v, OP_OpenEphemeral, 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);
+ if( eDest==SRT_EphemTab ){
+ sqlite3VdbeAddOp(v, OP_OpenEphemeral, iParm, pEList->nExpr);
}
-
- /* Initialize the memory cell to NULL for SRT_Mem or 0 for SRT_Exists
+ /* Set the limiter.
*/
- if( eDest==SRT_Mem ){
- sqlite3VdbeAddOp(v, OP_MemNull, iParm, 0);
- }else if( eDest==SRT_Exists ){
- sqlite3VdbeAddOp(v, OP_MemInt, 0, iParm);
- }
+ iEnd = sqlite3VdbeMakeLabel(v);
+ computeLimitRegisters(pParse, p, iEnd);
/* Open a virtual index to use for the distinct set.
*/
@@ -2795,7 +2952,7 @@ int sqlite3Select(
KeyInfo *pKeyInfo;
distinct = pParse->nTab++;
pKeyInfo = keyInfoFromExprList(pParse, p->pEList);
- sqlite3VdbeOp3(v, OP_OpenVirtual, distinct, 0,
+ sqlite3VdbeOp3(v, OP_OpenEphemeral, distinct, 0,
(char*)pKeyInfo, P3_KEYINFO_HANDOFF);
}else{
distinct = -1;
@@ -2809,13 +2966,13 @@ int sqlite3Select(
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
+ /* If sorting index that was created by a prior OP_OpenEphemeral
+ ** instruction ended up not being needed, then change the OP_OpenEphemeral
** into an OP_Noop.
*/
if( addrSortIndex>=0 && pOrderBy==0 ){
- uncreateSortingIndex(pParse, addrSortIndex);
- p->addrOpenVirt[2] = -1;
+ sqlite3VdbeChangeToNoop(v, addrSortIndex, 1);
+ p->addrOpenEphm[2] = -1;
}
/* Use the standard inner loop
@@ -2849,7 +3006,7 @@ int sqlite3Select(
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 addrSortingIdx; /* The OP_OpenEphemeral for the sorting index */
int addrReset; /* Subroutine for resetting the accumulator */
addrEnd = sqlite3VdbeMakeLabel(v);
@@ -2879,7 +3036,7 @@ int sqlite3Select(
goto select_end;
}
}
- if( sqlite3_malloc_failed ) goto select_end;
+ if( sqlite3MallocFailed() ) goto select_end;
/* Processing for aggregates with GROUP BY is very different and
** much more complex tha aggregates without a GROUP BY.
@@ -2896,13 +3053,13 @@ int sqlite3Select(
/* 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
+ ** that we do not need it after all, the OpenEphemeral instruction
** will be converted into a Noop.
*/
sAggInfo.sortingIdx = pParse->nTab++;
pKeyInfo = keyInfoFromExprList(pParse, pGroupBy);
addrSortingIdx =
- sqlite3VdbeOp3(v, OP_OpenVirtual, sAggInfo.sortingIdx,
+ sqlite3VdbeOp3(v, OP_OpenEphemeral, sAggInfo.sortingIdx,
sAggInfo.nSortingColumn,
(char*)pKeyInfo, P3_KEYINFO_HANDOFF);
@@ -2965,7 +3122,7 @@ int sqlite3Select(
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
+ ** we do not have to sort. The OP_OpenEphemeral table will be
** cancelled later because we still need to use the pKeyInfo
*/
pGroupBy = p->pGroupBy;
@@ -3060,7 +3217,7 @@ int sqlite3Select(
sqlite3VdbeAddOp(v, OP_Next, sAggInfo.sortingIdx, addrTopOfLoop);
}else{
sqlite3WhereEnd(pWInfo);
- uncreateSortingIndex(pParse, addrSortingIdx);
+ sqlite3VdbeChangeToNoop(v, addrSortingIdx, 1);
}
/* Output the final row of result
@@ -3100,18 +3257,21 @@ int sqlite3Select(
#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.
+ ** temporary table. So set the SrcList_item.isPopulated flag to prevent
+ ** this subquery from being evaluated again and to force 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;
+ pParent->pSrc->a[parentTab].isPopulated = 1;
}
#endif
+ /* Jump here to skip this query
+ */
+ sqlite3VdbeResolveLabel(v, iEnd);
+
/* The SELECT was successfully coded. Set the return code to 0
** to indicate no errors.
*/
@@ -3121,6 +3281,14 @@ int sqlite3Select(
** successful coding of the SELECT.
*/
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( rc==SQLITE_OK && eDest==SRT_Callback ){
+ generateColumnNames(pParse, pTabList, pEList);
+ }
+
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
index 61ff2482d..6058bc195 100644
--- a/ext/pdo_sqlite/sqlite/src/shell.c
+++ b/ext/pdo_sqlite/sqlite/src/shell.c
@@ -21,7 +21,7 @@
#include "sqlite3.h"
#include <ctype.h>
-#if !defined(_WIN32) && !defined(WIN32) && !defined(__MACOS__)
+#if !defined(_WIN32) && !defined(WIN32) && !defined(__MACOS__) && !defined(__OS2__)
# include <signal.h>
# include <pwd.h>
# include <unistd.h>
@@ -37,6 +37,10 @@
# include <Folders.h>
#endif
+#ifdef __OS2__
+# include <unistd.h>
+#endif
+
#if defined(HAVE_READLINE) && HAVE_READLINE==1
# include <readline/readline.h>
# include <readline/history.h>
@@ -62,7 +66,7 @@ static sqlite3 *db = 0;
/*
** True if an interrupt (Control-C) has been received.
*/
-static int seenInterrupt = 0;
+static volatile int seenInterrupt = 0;
/*
** This is the name of our program. It is set in main(), used
@@ -81,7 +85,7 @@ 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){
+static int isNumber(const char *z, int *realnum){
if( *z=='-' || *z=='+' ) z++;
if( !isdigit(*z) ){
return 0;
@@ -197,7 +201,7 @@ static char *one_input_line(const char *zPrior, FILE *in){
}
zResult = readline(zPrompt);
#if defined(HAVE_READLINE) && HAVE_READLINE==1
- if( zResult ) add_history(zResult);
+ if( zResult && *zResult ) add_history(zResult);
#endif
return zResult;
}
@@ -247,7 +251,7 @@ struct callback_data {
#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] = {
+static const char *modeDescr[MODE_NUM_OF] = {
"line",
"column",
"list",
@@ -384,12 +388,12 @@ static int callback(void *pArg, int nArg, char **azArg, char **azCol){
int w = 5;
if( azArg==0 ) break;
for(i=0; i<nArg; i++){
- int len = strlen(azCol[i]);
+ int len = strlen(azCol[i] ? 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],
+ fprintf(p->out,"%*s = %s\n", w, azCol[i],
azArg[i] ? azArg[i] : p->nullvalue);
}
break;
@@ -486,7 +490,7 @@ static int callback(void *pArg, int nArg, char **azArg, char **azCol){
case MODE_Tcl: {
if( p->cnt++==0 && p->showHeader ){
for(i=0; i<nArg; i++){
- output_c_string(p->out,azCol[i]);
+ output_c_string(p->out,azCol[i] ? azCol[i] : "");
fprintf(p->out, "%s", p->separator);
}
fprintf(p->out,"\n");
@@ -502,7 +506,7 @@ static int callback(void *pArg, int nArg, char **azArg, char **azCol){
case MODE_Csv: {
if( p->cnt++==0 && p->showHeader ){
for(i=0; i<nArg; i++){
- output_csv(p, azCol[i], i<nArg-1);
+ output_csv(p, azCol[i] ? azCol[i] : "", i<nArg-1);
}
fprintf(p->out,"\n");
}
@@ -690,8 +694,9 @@ static int dump_callback(void *pArg, int nArg, char **azArg, char **azCol){
zSelect = appendText(zSelect, " || ' VALUES(' || ", 0);
rc = sqlite3_step(pTableInfo);
while( rc==SQLITE_ROW ){
+ const char *zText = (const char *)sqlite3_column_text(pTableInfo, 1);
zSelect = appendText(zSelect, "quote(", 0);
- zSelect = appendText(zSelect, sqlite3_column_text(pTableInfo, 1), '"');
+ zSelect = appendText(zSelect, zText, '"');
rc = sqlite3_step(pTableInfo);
if( rc==SQLITE_ROW ){
zSelect = appendText(zSelect, ") || ', ' || ", 0);
@@ -758,6 +763,9 @@ static char zHelp[] =
".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"
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
+ ".load FILE ?ENTRY? Load an extension library\n"
+#endif
".mode MODE ?TABLE? Set output mode where MODE is one of:\n"
" csv Comma-separated values\n"
" column Left-aligned columns. (See .width)\n"
@@ -773,9 +781,6 @@ static char zHelp[] =
".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"
@@ -795,9 +800,6 @@ 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) ){
@@ -805,6 +807,9 @@ static void open_db(struct callback_data *p){
p->zDbFilename, sqlite3_errmsg(db));
exit(1);
}
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
+ sqlite3_enable_load_extension(p->db, 1);
+#endif
}
}
@@ -829,7 +834,7 @@ static void resolve_backslashes(char *z){
}else if( c=='r' ){
c = '\r';
}else if( c>='0' && c<='7' ){
- c =- '0';
+ c -= '0';
if( z[i+1]>='0' && z[i+1]<='7' ){
i++;
c = (c<<3) + z[i] - '0';
@@ -1037,6 +1042,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
FILE *in; /* The input file */
int lineno = 0; /* Line number of input file */
+ open_db(p);
nSep = strlen(p->separator);
if( nSep==0 ){
fprintf(stderr, "non-null separator required for import\n");
@@ -1045,7 +1051,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
zSql = sqlite3_mprintf("SELECT * FROM '%q'", zTable);
if( zSql==0 ) return 0;
nByte = strlen(zSql);
- rc = sqlite3_prepare(p->db, zSql, 0, &pStmt, 0);
+ rc = sqlite3_prepare(p->db, zSql, -1, &pStmt, 0);
sqlite3_free(zSql);
if( rc ){
fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db));
@@ -1065,7 +1071,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
}
zSql[j++] = ')';
zSql[j] = 0;
- rc = sqlite3_prepare(p->db, zSql, 0, &pStmt, 0);
+ rc = sqlite3_prepare(p->db, zSql, -1, &pStmt, 0);
free(zSql);
if( rc ){
fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db));
@@ -1079,7 +1085,10 @@ static int do_meta_command(char *zLine, struct callback_data *p){
return 0;
}
azCol = malloc( sizeof(azCol[0])*(nCol+1) );
- if( azCol==0 ) return 0;
+ if( azCol==0 ){
+ fclose(in);
+ return 0;
+ }
sqlite3_exec(p->db, "BEGIN", 0, 0, 0);
zCommit = "COMMIT";
while( (zLine = local_getline(0, in))!=0 ){
@@ -1146,6 +1155,22 @@ static int do_meta_command(char *zLine, struct callback_data *p){
}
}else
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
+ if( c=='l' && strncmp(azArg[0], "load", n)==0 && nArg>=2 ){
+ const char *zFile, *zProc;
+ char *zErrMsg = 0;
+ int rc;
+ zFile = azArg[1];
+ zProc = nArg>=3 ? azArg[2] : 0;
+ open_db(p);
+ rc = sqlite3_load_extension(p->db, zFile, zProc, &zErrMsg);
+ if( rc!=SQLITE_OK ){
+ fprintf(stderr, "%s\n", zErrMsg);
+ sqlite3_free(zErrMsg);
+ }
+ }else
+#endif
+
if( c=='m' && strncmp(azArg[0], "mode", n)==0 && nArg>=2 ){
int n2 = strlen(azArg[1]);
if( strncmp(azArg[1],"line",n2)==0
@@ -1226,22 +1251,6 @@ static int do_meta_command(char *zLine, struct callback_data *p){
}
}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;
@@ -1392,6 +1401,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
if( c=='w' && strncmp(azArg[0], "width", n)==0 ){
int j;
+ assert( nArg<=ArraySize(azArg) );
for(j=1; j<nArg && j<ArraySize(p->colWidth); j++){
p->colWidth[j-1] = atoi(azArg[j]);
}
@@ -1488,6 +1498,10 @@ static void process_input(struct callback_data *p, FILE *in){
if( zLine[i]!=0 ){
nSql = strlen(zLine);
zSql = malloc( nSql+1 );
+ if( zSql==0 ){
+ fprintf(stderr, "out of memory\n");
+ exit(1);
+ }
strcpy(zSql, zLine);
}
}else{
@@ -1507,7 +1521,7 @@ static void process_input(struct callback_data *p, FILE *in){
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( in!=0 && !p->echoOn ) printf("%s\n",zSql); */
if( zErrMsg!=0 ){
printf("SQL error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
@@ -1536,7 +1550,7 @@ static void process_input(struct callback_data *p, FILE *in){
static char *find_home_dir(void){
char *home_dir = NULL;
-#if !defined(_WIN32) && !defined(WIN32) && !defined(__MACOS__)
+#if !defined(_WIN32) && !defined(WIN32) && !defined(__MACOS__) && !defined(__OS2__)
struct passwd *pwent;
uid_t uid = getuid();
if( (pwent=getpwuid(uid)) != NULL) {
@@ -1556,7 +1570,7 @@ static char *find_home_dir(void){
}
}
-#if defined(_WIN32) || defined(WIN32)
+#if defined(_WIN32) || defined(WIN32) || defined(__OS2__)
if (!home_dir) {
home_dir = "c:";
}
@@ -1581,7 +1595,7 @@ static void process_sqliterc(
){
char *home_dir = NULL;
const char *sqliterc = sqliterc_override;
- char *zBuf;
+ char *zBuf = 0;
FILE *in = NULL;
if (sqliterc == NULL) {
@@ -1607,6 +1621,7 @@ static void process_sqliterc(
process_input(p,in);
fclose(in);
}
+ free(zBuf);
return;
}
@@ -1619,9 +1634,6 @@ static const char zOptions[] =
" -[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"
@@ -1642,7 +1654,7 @@ static void usage(int showDetail){
/*
** Initialize the state information in data
*/
-void main_init(struct callback_data *data) {
+static void main_init(struct callback_data *data) {
memset(data, 0, sizeof(*data));
data->mode = MODE_List;
strcpy(data->separator,"|");
@@ -1755,7 +1767,7 @@ int main(int argc, char **argv){
data.echoOn = 1;
}else if( strcmp(z,"-version")==0 ){
printf("%s\n", sqlite3_libversion());
- return 1;
+ return 0;
}else if( strcmp(z,"-help")==0 ){
usage(1);
}else{
@@ -1802,12 +1814,18 @@ int main(int argc, char **argv){
if( zHistory ){
stifle_history(100);
write_history(zHistory);
+ free(zHistory);
}
+ free(zHome);
}else{
process_input(&data, stdin);
}
}
set_table_name(&data, 0);
- if( db ) sqlite3_close(db);
+ if( db ){
+ if( sqlite3_close(db)!=SQLITE_OK ){
+ fprintf(stderr,"error closing database: %s\n", sqlite3_errmsg(db));
+ }
+ }
return 0;
}
diff --git a/ext/pdo_sqlite/sqlite/src/sqlite.h.in b/ext/pdo_sqlite/sqlite/src/sqlite.h.in
index 6b2dd551d..a1b4759f8 100644
--- a/ext/pdo_sqlite/sqlite/src/sqlite.h.in
+++ b/ext/pdo_sqlite/sqlite/src/sqlite.h.in
@@ -78,7 +78,10 @@ typedef struct sqlite3 sqlite3;
** to do a typedef that for 64-bit integers that depends on what compiler
** is being used.
*/
-#if defined(_MSC_VER) || defined(__BORLANDC__)
+#ifdef SQLITE_INT64_TYPE
+ typedef SQLITE_INT64_TYPE sqlite_int64;
+ typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
+#elif defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 sqlite_int64;
typedef unsigned __int64 sqlite_uint64;
#else
@@ -86,6 +89,13 @@ typedef struct sqlite3 sqlite3;
typedef unsigned long long int sqlite_uint64;
#endif
+/*
+** If compiling for a processor that lacks floating point support,
+** substitute integer for floating-point
+*/
+#ifdef SQLITE_OMIT_FLOATING_POINT
+# define double sqlite_int64
+#endif
/*
** A function to close the database.
@@ -157,6 +167,7 @@ int sqlite3_exec(
** Return values for sqlite3_exec() and sqlite3_step()
*/
#define SQLITE_OK 0 /* Successful result */
+/* beginning-of-error-codes */
#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 */
@@ -185,6 +196,7 @@ int sqlite3_exec(
#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 */
+/* end-of-error-codes */
/*
** Each entry in an SQLite table has a unique integer key. (The key is
@@ -393,9 +405,19 @@ void sqlite3_free_table(char **result);
*/
char *sqlite3_mprintf(const char*,...);
char *sqlite3_vmprintf(const char*, va_list);
-void sqlite3_free(char *z);
char *sqlite3_snprintf(int,char*,const char*, ...);
+/*
+** SQLite uses its own memory allocator. On many installations, this
+** memory allocator is identical to the standard malloc()/realloc()/free()
+** and can be used interchangable. On others, the implementations are
+** different. For maximum portability, it is best not to mix calls
+** to the standard malloc/realloc/free with the sqlite versions.
+*/
+void *sqlite3_malloc(int);
+void *sqlite3_realloc(void*, int);
+void sqlite3_free(void*);
+
#ifndef SQLITE_OMIT_AUTHORIZATION
/*
** This routine registers a callback with the SQLite library. The
@@ -454,7 +476,8 @@ int sqlite3_set_authorizer(
#define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */
#define SQLITE_REINDEX 27 /* Index Name NULL */
#define SQLITE_ANALYZE 28 /* Table Name NULL */
-
+#define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
+#define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
/*
** The return value of the authorization function should be one of the
@@ -717,6 +740,30 @@ const char *sqlite3_column_name(sqlite3_stmt*,int);
const void *sqlite3_column_name16(sqlite3_stmt*,int);
/*
+** The first parameter to the following calls is a compiled SQL statement.
+** These functions return information about the Nth column returned by
+** the statement, where N is the second function argument.
+**
+** If the Nth column returned by the statement is not a column value,
+** then all of the functions return NULL. Otherwise, the return the
+** name of the attached database, table and column that the expression
+** extracts a value from.
+**
+** As with all other SQLite APIs, those postfixed with "16" return UTF-16
+** encoded strings, the other functions return UTF-8. The memory containing
+** the returned strings is valid until the statement handle is finalized().
+**
+** These APIs are only available if the library was compiled with the
+** SQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.
+*/
+const char *sqlite3_column_database_name(sqlite3_stmt*,int);
+const void *sqlite3_column_database_name16(sqlite3_stmt*,int);
+const char *sqlite3_column_table_name(sqlite3_stmt*,int);
+const void *sqlite3_column_table_name16(sqlite3_stmt*,int);
+const char *sqlite3_column_origin_name(sqlite3_stmt*,int);
+const void *sqlite3_column_origin_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
@@ -728,7 +775,7 @@ const void *sqlite3_column_name16(sqlite3_stmt*,int);
**
** And the following statement compiled:
**
-** SELECT c1 + 1, 0 FROM t1;
+** SELECT c1 + 1, c1 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
@@ -748,7 +795,7 @@ const char *sqlite3_column_decltype(sqlite3_stmt *, int i);
**
** And the following statement compiled:
**
-** SELECT c1 + 1, 0 FROM t1;
+** SELECT c1 + 1, c1 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
@@ -889,6 +936,8 @@ 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);
+int sqlite3_column_numeric_type(sqlite3_stmt*, int iCol);
+sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);
/*
** The sqlite3_finalize() function is called to delete a compiled
@@ -972,9 +1021,8 @@ int sqlite3_create_function16(
);
/*
-** 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.
+** This function is deprecated. Do not use it. It continues to exist
+** so as not to break legacy code. But new code should avoid using it.
*/
int sqlite3_aggregate_count(sqlite3_context*);
@@ -997,6 +1045,7 @@ 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*);
+int sqlite3_value_numeric_type(sqlite3_value*);
/*
** Aggregate functions use the following routine to allocate
@@ -1080,11 +1129,12 @@ 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 */
+#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 */
+#define SQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */
/*
** These two functions are used to add new collation sequences to the
@@ -1251,7 +1301,7 @@ extern char *sqlite3_temp_directory;
** This functionality can be omitted from a build by defining the
** SQLITE_OMIT_GLOBALRECOVER at compile time.
*/
-int sqlite3_global_recover();
+int sqlite3_global_recover(void);
/*
** Test to see whether or not the database connection is in autocommit
@@ -1269,6 +1319,403 @@ int sqlite3_get_autocommit(sqlite3*);
*/
sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
+/*
+** Register a callback function with the database connection identified by the
+** first argument to be invoked whenever a row is updated, inserted or deleted.
+** Any callback set by a previous call to this function for the same
+** database connection is overridden.
+**
+** The second argument is a pointer to the function to invoke when a
+** row is updated, inserted or deleted. The first argument to the callback is
+** a copy of the third argument to sqlite3_update_hook. The second callback
+** argument is one of SQLITE_INSERT, SQLITE_DELETE or SQLITE_UPDATE, depending
+** on the operation that caused the callback to be invoked. The third and
+** fourth arguments to the callback contain pointers to the database and
+** table name containing the affected row. The final callback parameter is
+** the rowid of the row. In the case of an update, this is the rowid after
+** the update takes place.
+**
+** The update hook is not invoked when internal system tables are
+** modified (i.e. sqlite_master and sqlite_sequence).
+**
+** If another function was previously registered, its pArg value is returned.
+** Otherwise NULL is returned.
+*/
+void *sqlite3_update_hook(
+ sqlite3*,
+ void(*)(void *,int ,char const *,char const *,sqlite_int64),
+ void*
+);
+
+/*
+** Register a callback to be invoked whenever a transaction is rolled
+** back.
+**
+** The new callback function overrides any existing rollback-hook
+** callback. If there was an existing callback, then it's pArg value
+** (the third argument to sqlite3_rollback_hook() when it was registered)
+** is returned. Otherwise, NULL is returned.
+**
+** For the purposes of this API, a transaction is said to have been
+** rolled back if an explicit "ROLLBACK" statement is executed, or
+** an error or constraint causes an implicit rollback to occur. The
+** callback is not invoked if a transaction is automatically rolled
+** back because the database connection is closed.
+*/
+void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
+
+/*
+** This function is only available if the library is compiled without
+** the SQLITE_OMIT_SHARED_CACHE macro defined. It is used to enable or
+** disable (if the argument is true or false, respectively) the
+** "shared pager" feature.
+*/
+int sqlite3_enable_shared_cache(int);
+
+/*
+** Attempt to free N bytes of heap memory by deallocating non-essential
+** memory allocations held by the database library (example: memory
+** used to cache database pages to improve performance).
+**
+** This function is not a part of standard builds. It is only created
+** if SQLite is compiled with the SQLITE_ENABLE_MEMORY_MANAGEMENT macro.
+*/
+int sqlite3_release_memory(int);
+
+/*
+** Place a "soft" limit on the amount of heap memory that may be allocated by
+** SQLite within the current thread. If an internal allocation is requested
+** that would exceed the specified limit, sqlite3_release_memory() is invoked
+** one or more times to free up some space before the allocation is made.
+**
+** The limit is called "soft", because if sqlite3_release_memory() cannot free
+** sufficient memory to prevent the limit from being exceeded, the memory is
+** allocated anyway and the current operation proceeds.
+**
+** This function is only available if the library was compiled with the
+** SQLITE_ENABLE_MEMORY_MANAGEMENT option set.
+** memory-management has been enabled.
+*/
+void sqlite3_soft_heap_limit(int);
+
+/*
+** This routine makes sure that all thread-local storage has been
+** deallocated for the current thread.
+**
+** This routine is not technically necessary. All thread-local storage
+** will be automatically deallocated once memory-management and
+** shared-cache are disabled and the soft heap limit has been set
+** to zero. This routine is provided as a convenience for users who
+** want to make absolutely sure they have not forgotten something
+** prior to killing off a thread.
+*/
+void sqlite3_thread_cleanup(void);
+
+/*
+** Return meta information about a specific column of a specific database
+** table accessible using the connection handle passed as the first function
+** argument.
+**
+** The column is identified by the second, third and fourth parameters to
+** this function. The second parameter is either the name of the database
+** (i.e. "main", "temp" or an attached database) containing the specified
+** table or NULL. If it is NULL, then all attached databases are searched
+** for the table using the same algorithm as the database engine uses to
+** resolve unqualified table references.
+**
+** The third and fourth parameters to this function are the table and column
+** name of the desired column, respectively. Neither of these parameters
+** may be NULL.
+**
+** Meta information is returned by writing to the memory locations passed as
+** the 5th and subsequent parameters to this function. Any of these
+** arguments may be NULL, in which case the corresponding element of meta
+** information is ommitted.
+**
+** Parameter Output Type Description
+** -----------------------------------
+**
+** 5th const char* Data type
+** 6th const char* Name of the default collation sequence
+** 7th int True if the column has a NOT NULL constraint
+** 8th int True if the column is part of the PRIMARY KEY
+** 9th int True if the column is AUTOINCREMENT
+**
+**
+** The memory pointed to by the character pointers returned for the
+** declaration type and collation sequence is valid only until the next
+** call to any sqlite API function.
+**
+** If the specified table is actually a view, then an error is returned.
+**
+** If the specified column is "rowid", "oid" or "_rowid_" and an
+** INTEGER PRIMARY KEY column has been explicitly declared, then the output
+** parameters are set for the explicitly declared column. If there is no
+** explicitly declared IPK column, then the output parameters are set as
+** follows:
+**
+** data type: "INTEGER"
+** collation sequence: "BINARY"
+** not null: 0
+** primary key: 1
+** auto increment: 0
+**
+** This function may load one or more schemas from database files. If an
+** error occurs during this process, or if the requested table or column
+** cannot be found, an SQLITE error code is returned and an error message
+** left in the database handle (to be retrieved using sqlite3_errmsg()).
+**
+** This API is only available if the library was compiled with the
+** SQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.
+*/
+int sqlite3_table_column_metadata(
+ sqlite3 *db, /* Connection handle */
+ const char *zDbName, /* Database name or NULL */
+ const char *zTableName, /* Table name */
+ const char *zColumnName, /* Column name */
+ char const **pzDataType, /* OUTPUT: Declared data type */
+ char const **pzCollSeq, /* OUTPUT: Collation sequence name */
+ int *pNotNull, /* OUTPUT: True if NOT NULL constraint exists */
+ int *pPrimaryKey, /* OUTPUT: True if column part of PK */
+ int *pAutoinc /* OUTPUT: True if colums is auto-increment */
+);
+
+/*
+****** EXPERIMENTAL - subject to change without notice **************
+**
+** Attempt to load an SQLite extension library contained in the file
+** zFile. The entry point is zProc. zProc may be 0 in which case the
+** name of the entry point defaults to "sqlite3_extension_init".
+**
+** Return SQLITE_OK on success and SQLITE_ERROR if something goes wrong.
+**
+** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with
+** error message text. The calling function should free this memory
+** by calling sqlite3_free().
+**
+** Extension loading must be enabled using sqlite3_enable_load_extension()
+** prior to calling this API or an error will be returned.
+**
+****** EXPERIMENTAL - subject to change without notice **************
+*/
+int sqlite3_load_extension(
+ sqlite3 *db, /* Load the extension into this database connection */
+ const char *zFile, /* Name of the shared library containing extension */
+ const char *zProc, /* Entry point. Derived from zFile if 0 */
+ char **pzErrMsg /* Put error message here if not 0 */
+);
+
+/*
+** So as not to open security holes in older applications that are
+** unprepared to deal with extension load, and as a means of disabling
+** extension loading while executing user-entered SQL, the following
+** API is provided to turn the extension loading mechanism on and
+** off. It is off by default. See ticket #1863.
+**
+** Call this routine with onoff==1 to turn extension loading on
+** and call it with onoff==0 to turn it back off again.
+*/
+int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
+
+/*
+****** EXPERIMENTAL - subject to change without notice **************
+**
+** The interface to the virtual-table mechanism is currently considered
+** to be experimental. The interface might change in incompatible ways.
+** If this is a problem for you, do not use the interface at this time.
+**
+** When the virtual-table mechanism stablizes, we will declare the
+** interface fixed, support it indefinitely, and remove this comment.
+*/
+
+/*
+** Structures used by the virtual table interface
+*/
+typedef struct sqlite3_vtab sqlite3_vtab;
+typedef struct sqlite3_index_info sqlite3_index_info;
+typedef struct sqlite3_vtab_cursor sqlite3_vtab_cursor;
+typedef struct sqlite3_module sqlite3_module;
+
+/*
+** A module is a class of virtual tables. Each module is defined
+** by an instance of the following structure. This structure consists
+** mostly of methods for the module.
+*/
+struct sqlite3_module {
+ int iVersion;
+ int (*xCreate)(sqlite3*, void *pAux,
+ int argc, char **argv,
+ sqlite3_vtab **ppVTab);
+ int (*xConnect)(sqlite3*, void *pAux,
+ int argc, char **argv,
+ sqlite3_vtab **ppVTab);
+ int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
+ int (*xDisconnect)(sqlite3_vtab *pVTab);
+ int (*xDestroy)(sqlite3_vtab *pVTab);
+ int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
+ int (*xClose)(sqlite3_vtab_cursor*);
+ int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
+ int argc, sqlite3_value **argv);
+ int (*xNext)(sqlite3_vtab_cursor*);
+ int (*xEof)(sqlite3_vtab_cursor*);
+ int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
+ int (*xRowid)(sqlite3_vtab_cursor*, sqlite_int64 *pRowid);
+ int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite_int64 *);
+ int (*xBegin)(sqlite3_vtab *pVTab);
+ int (*xSync)(sqlite3_vtab *pVTab);
+ int (*xCommit)(sqlite3_vtab *pVTab);
+ int (*xRollback)(sqlite3_vtab *pVTab);
+ int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
+ void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
+ void **ppArg);
+};
+
+/*
+** The sqlite3_index_info structure and its substructures is used to
+** pass information into and receive the reply from the xBestIndex
+** method of an sqlite3_module. The fields under **Inputs** are the
+** inputs to xBestIndex and are read-only. xBestIndex inserts its
+** results into the **Outputs** fields.
+**
+** The aConstraint[] array records WHERE clause constraints of the
+** form:
+**
+** column OP expr
+**
+** Where OP is =, <, <=, >, or >=. The particular operator is stored
+** in aConstraint[].op. The index of the column is stored in
+** aConstraint[].iColumn. aConstraint[].usable is TRUE if the
+** expr on the right-hand side can be evaluated (and thus the constraint
+** is usable) and false if it cannot.
+**
+** The optimizer automatically inverts terms of the form "expr OP column"
+** and makes other simplificatinos to the WHERE clause in an attempt to
+** get as many WHERE clause terms into the form shown above as possible.
+** The aConstraint[] array only reports WHERE clause terms in the correct
+** form that refer to the particular virtual table being queried.
+**
+** Information about the ORDER BY clause is stored in aOrderBy[].
+** Each term of aOrderBy records a column of the ORDER BY clause.
+**
+** The xBestIndex method must fill aConstraintUsage[] with information
+** about what parameters to pass to xFilter. If argvIndex>0 then
+** the right-hand side of the corresponding aConstraint[] is evaluated
+** and becomes the argvIndex-th entry in argv. If aConstraintUsage[].omit
+** is true, then the constraint is assumed to be fully handled by the
+** virtual table and is not checked again by SQLite.
+**
+** The idxNum and idxPtr values are recorded and passed into xFilter.
+** sqlite3_free() is used to free idxPtr if needToFreeIdxPtr is true.
+**
+** The orderByConsumed means that output from xFilter will occur in
+** the correct order to satisfy the ORDER BY clause so that no separate
+** sorting step is required.
+**
+** The estimatedCost value is an estimate of the cost of doing the
+** particular lookup. A full scan of a table with N entries should have
+** a cost of N. A binary search of a table of N entries should have a
+** cost of approximately log(N).
+*/
+struct sqlite3_index_info {
+ /* Inputs */
+ const int nConstraint; /* Number of entries in aConstraint */
+ const struct sqlite3_index_constraint {
+ int iColumn; /* Column on left-hand side of constraint */
+ unsigned char op; /* Constraint operator */
+ unsigned char usable; /* True if this constraint is usable */
+ int iTermOffset; /* Used internally - xBestIndex should ignore */
+ } *const aConstraint; /* Table of WHERE clause constraints */
+ const int nOrderBy; /* Number of terms in the ORDER BY clause */
+ const struct sqlite3_index_orderby {
+ int iColumn; /* Column number */
+ unsigned char desc; /* True for DESC. False for ASC. */
+ } *const aOrderBy; /* The ORDER BY clause */
+
+ /* Outputs */
+ struct sqlite3_index_constraint_usage {
+ int argvIndex; /* if >0, constraint is part of argv to xFilter */
+ unsigned char omit; /* Do not code a test for this constraint */
+ } *const aConstraintUsage;
+ int idxNum; /* Number used to identify the index */
+ char *idxStr; /* String, possibly obtained from sqlite3_malloc */
+ int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */
+ int orderByConsumed; /* True if output is already ordered */
+ double estimatedCost; /* Estimated cost of using this index */
+};
+#define SQLITE_INDEX_CONSTRAINT_EQ 2
+#define SQLITE_INDEX_CONSTRAINT_GT 4
+#define SQLITE_INDEX_CONSTRAINT_LE 8
+#define SQLITE_INDEX_CONSTRAINT_LT 16
+#define SQLITE_INDEX_CONSTRAINT_GE 32
+#define SQLITE_INDEX_CONSTRAINT_MATCH 64
+
+/*
+** This routine is used to register a new module name with an SQLite
+** connection. Module names must be registered before creating new
+** virtual tables on the module, or before using preexisting virtual
+** tables of the module.
+*/
+int sqlite3_create_module(
+ sqlite3 *db, /* SQLite connection to register module with */
+ const char *zName, /* Name of the module */
+ const sqlite3_module *, /* Methods for the module */
+ void * /* Client data for xCreate/xConnect */
+);
+
+/*
+** Every module implementation uses a subclass of the following structure
+** to describe a particular instance of the module. Each subclass will
+** be taylored to the specific needs of the module implementation. The
+** purpose of this superclass is to define certain fields that are common
+** to all module implementations.
+*/
+struct sqlite3_vtab {
+ const sqlite3_module *pModule; /* The module for this virtual table */
+ int nRef; /* Used internally */
+ /* Virtual table implementations will typically add additional fields */
+};
+
+/* Every module implementation uses a subclass of the following structure
+** to describe cursors that point into the virtual table and are used
+** to loop through the virtual table. Cursors are created using the
+** xOpen method of the module. Each module implementation will define
+** the content of a cursor structure to suit its own needs.
+**
+** This superclass exists in order to define fields of the cursor that
+** are common to all implementations.
+*/
+struct sqlite3_vtab_cursor {
+ sqlite3_vtab *pVtab; /* Virtual table of this cursor */
+ /* Virtual table implementations will typically add additional fields */
+};
+
+/*
+** The xCreate and xConnect methods of a module use the following API
+** to declare the format (the names and datatypes of the columns) of
+** the virtual tables they implement.
+*/
+int sqlite3_declare_vtab(sqlite3*, const char *zCreateTable);
+
+/*
+** The interface to the virtual-table mechanism defined above (back up
+** to a comment remarkably similar to this one) is currently considered
+** to be experimental. The interface might change in incompatible ways.
+** If this is a problem for you, do not use the interface at this time.
+**
+** When the virtual-table mechanism stablizes, we will declare the
+** interface fixed, support it indefinitely, and remove this comment.
+**
+****** EXPERIMENTAL - subject to change without notice **************
+*/
+
+/*
+** Undo the hack that converts floating point types to integer for
+** builds on processors without floating point support.
+*/
+#ifdef SQLITE_OMIT_FLOATING_POINT
+# undef double
+#endif
+
#ifdef __cplusplus
} /* End of the 'extern "C"' block */
#endif
diff --git a/ext/pdo_sqlite/sqlite/src/sqlite3ext.h b/ext/pdo_sqlite/sqlite/src/sqlite3ext.h
new file mode 100644
index 000000000..948206066
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/sqlite3ext.h
@@ -0,0 +1,280 @@
+/*
+** 2006 June 7
+**
+** 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 SQLite interface for use by
+** shared libraries that want to be imported as extensions into
+** an SQLite instance. Shared libraries that intend to be loaded
+** as extensions by SQLite should #include this file instead of
+** sqlite3.h.
+**
+** @(#) $Id: sqlite3ext.h,v 1.1.2.1 2006/08/14 16:15:29 iliaa Exp $
+*/
+#ifndef _SQLITE3EXT_H_
+#define _SQLITE3EXT_H_
+#include <sqlite3.h>
+
+typedef struct sqlite3_api_routines sqlite3_api_routines;
+
+/*
+** The following structure hold pointers to all of the SQLite API
+** routines.
+*/
+struct sqlite3_api_routines {
+ void * (*aggregate_context)(sqlite3_context*,int nBytes);
+ int (*aggregate_count)(sqlite3_context*);
+ int (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*));
+ int (*bind_double)(sqlite3_stmt*,int,double);
+ int (*bind_int)(sqlite3_stmt*,int,int);
+ int (*bind_int64)(sqlite3_stmt*,int,sqlite_int64);
+ int (*bind_null)(sqlite3_stmt*,int);
+ int (*bind_parameter_count)(sqlite3_stmt*);
+ int (*bind_parameter_index)(sqlite3_stmt*,const char*zName);
+ const char * (*bind_parameter_name)(sqlite3_stmt*,int);
+ int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));
+ int (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*));
+ int (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*);
+ int (*busy_handler)(sqlite3*,int(*)(void*,int),void*);
+ int (*busy_timeout)(sqlite3*,int ms);
+ int (*changes)(sqlite3*);
+ int (*close)(sqlite3*);
+ int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,int eTextRep,const char*));
+ int (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*,int eTextRep,const void*));
+ const void * (*column_blob)(sqlite3_stmt*,int iCol);
+ int (*column_bytes)(sqlite3_stmt*,int iCol);
+ int (*column_bytes16)(sqlite3_stmt*,int iCol);
+ int (*column_count)(sqlite3_stmt*pStmt);
+ const char * (*column_database_name)(sqlite3_stmt*,int);
+ const void * (*column_database_name16)(sqlite3_stmt*,int);
+ const char * (*column_decltype)(sqlite3_stmt*,int i);
+ const void * (*column_decltype16)(sqlite3_stmt*,int);
+ double (*column_double)(sqlite3_stmt*,int iCol);
+ int (*column_int)(sqlite3_stmt*,int iCol);
+ sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol);
+ const char * (*column_name)(sqlite3_stmt*,int);
+ const void * (*column_name16)(sqlite3_stmt*,int);
+ const char * (*column_origin_name)(sqlite3_stmt*,int);
+ const void * (*column_origin_name16)(sqlite3_stmt*,int);
+ const char * (*column_table_name)(sqlite3_stmt*,int);
+ const void * (*column_table_name16)(sqlite3_stmt*,int);
+ const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
+ const void * (*column_text16)(sqlite3_stmt*,int iCol);
+ int (*column_type)(sqlite3_stmt*,int iCol);
+ sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol);
+ void * (*commit_hook)(sqlite3*,int(*)(void*),void*);
+ int (*complete)(const char*sql);
+ int (*complete16)(const void*sql);
+ int (*create_collation)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*));
+ int (*create_collation16)(sqlite3*,const char*,int,void*,int(*)(void*,int,const void*,int,const void*));
+ int (*create_function)(sqlite3*,const char*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*));
+ int (*create_function16)(sqlite3*,const void*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*));
+ int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
+ int (*data_count)(sqlite3_stmt*pStmt);
+ sqlite3 * (*db_handle)(sqlite3_stmt*);
+ int (*declare_vtab)(sqlite3*,const char*);
+ int (*enable_shared_cache)(int);
+ int (*errcode)(sqlite3*db);
+ const char * (*errmsg)(sqlite3*);
+ const void * (*errmsg16)(sqlite3*);
+ int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);
+ int (*expired)(sqlite3_stmt*);
+ int (*finalize)(sqlite3_stmt*pStmt);
+ void (*free)(void*);
+ void (*free_table)(char**result);
+ int (*get_autocommit)(sqlite3*);
+ void * (*get_auxdata)(sqlite3_context*,int);
+ int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);
+ int (*global_recover)(void);
+ void (*interrupt)(sqlite3*);
+ sqlite_int64 (*last_insert_rowid)(sqlite3*);
+ const char * (*libversion)(void);
+ int (*libversion_number)(void);
+ void *(*malloc)(int);
+ char * (*mprintf)(const char*,...);
+ int (*open)(const char*,sqlite3**);
+ int (*open16)(const void*,sqlite3**);
+ int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
+ int (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
+ void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);
+ void (*progress_handler)(sqlite3*,int,int(*)(void*),void*);
+ void *(*realloc)(void*,int);
+ int (*reset)(sqlite3_stmt*pStmt);
+ void (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*));
+ void (*result_double)(sqlite3_context*,double);
+ void (*result_error)(sqlite3_context*,const char*,int);
+ void (*result_error16)(sqlite3_context*,const void*,int);
+ void (*result_int)(sqlite3_context*,int);
+ void (*result_int64)(sqlite3_context*,sqlite_int64);
+ void (*result_null)(sqlite3_context*);
+ void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));
+ void (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*));
+ void (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*));
+ void (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*));
+ void (*result_value)(sqlite3_context*,sqlite3_value*);
+ void * (*rollback_hook)(sqlite3*,void(*)(void*),void*);
+ int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,const char*,const char*),void*);
+ void (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*));
+ char * (*snprintf)(int,char*,const char*,...);
+ int (*step)(sqlite3_stmt*);
+ int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,char const**,char const**,int*,int*,int*);
+ void (*thread_cleanup)(void);
+ int (*total_changes)(sqlite3*);
+ void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);
+ int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*);
+ void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,sqlite_int64),void*);
+ void * (*user_data)(sqlite3_context*);
+ const void * (*value_blob)(sqlite3_value*);
+ int (*value_bytes)(sqlite3_value*);
+ int (*value_bytes16)(sqlite3_value*);
+ double (*value_double)(sqlite3_value*);
+ int (*value_int)(sqlite3_value*);
+ sqlite_int64 (*value_int64)(sqlite3_value*);
+ int (*value_numeric_type)(sqlite3_value*);
+ const unsigned char * (*value_text)(sqlite3_value*);
+ const void * (*value_text16)(sqlite3_value*);
+ const void * (*value_text16be)(sqlite3_value*);
+ const void * (*value_text16le)(sqlite3_value*);
+ int (*value_type)(sqlite3_value*);
+ char * (*vmprintf)(const char*,va_list);
+};
+
+/*
+** The following macros redefine the API routines so that they are
+** redirected throught the global sqlite3_api structure.
+**
+** This header file is also used by the loadext.c source file
+** (part of the main SQLite library - not an extension) so that
+** it can get access to the sqlite3_api_routines structure
+** definition. But the main library does not want to redefine
+** the API. So the redefinition macros are only valid if the
+** SQLITE_CORE macros is undefined.
+*/
+#ifndef SQLITE_CORE
+#define sqlite3_aggregate_context sqlite3_api->aggregate_context
+#define sqlite3_aggregate_count sqlite3_api->aggregate_count
+#define sqlite3_bind_blob sqlite3_api->bind_blob
+#define sqlite3_bind_double sqlite3_api->bind_double
+#define sqlite3_bind_int sqlite3_api->bind_int
+#define sqlite3_bind_int64 sqlite3_api->bind_int64
+#define sqlite3_bind_null sqlite3_api->bind_null
+#define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count
+#define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index
+#define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name
+#define sqlite3_bind_text sqlite3_api->bind_text
+#define sqlite3_bind_text16 sqlite3_api->bind_text16
+#define sqlite3_bind_value sqlite3_api->bind_value
+#define sqlite3_busy_handler sqlite3_api->busy_handler
+#define sqlite3_busy_timeout sqlite3_api->busy_timeout
+#define sqlite3_changes sqlite3_api->changes
+#define sqlite3_close sqlite3_api->close
+#define sqlite3_collation_needed sqlite3_api->collation_needed
+#define sqlite3_collation_needed16 sqlite3_api->collation_needed16
+#define sqlite3_column_blob sqlite3_api->column_blob
+#define sqlite3_column_bytes sqlite3_api->column_bytes
+#define sqlite3_column_bytes16 sqlite3_api->column_bytes16
+#define sqlite3_column_count sqlite3_api->column_count
+#define sqlite3_column_database_name sqlite3_api->column_database_name
+#define sqlite3_column_database_name16 sqlite3_api->column_database_name16
+#define sqlite3_column_decltype sqlite3_api->column_decltype
+#define sqlite3_column_decltype16 sqlite3_api->column_decltype16
+#define sqlite3_column_double sqlite3_api->column_double
+#define sqlite3_column_int sqlite3_api->column_int
+#define sqlite3_column_int64 sqlite3_api->column_int64
+#define sqlite3_column_name sqlite3_api->column_name
+#define sqlite3_column_name16 sqlite3_api->column_name16
+#define sqlite3_column_origin_name sqlite3_api->column_origin_name
+#define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16
+#define sqlite3_column_table_name sqlite3_api->column_table_name
+#define sqlite3_column_table_name16 sqlite3_api->column_table_name16
+#define sqlite3_column_text sqlite3_api->column_text
+#define sqlite3_column_text16 sqlite3_api->column_text16
+#define sqlite3_column_type sqlite3_api->column_type
+#define sqlite3_column_value sqlite3_api->column_value
+#define sqlite3_commit_hook sqlite3_api->commit_hook
+#define sqlite3_complete sqlite3_api->complete
+#define sqlite3_complete16 sqlite3_api->complete16
+#define sqlite3_create_collation sqlite3_api->create_collation
+#define sqlite3_create_collation16 sqlite3_api->create_collation16
+#define sqlite3_create_function sqlite3_api->create_function
+#define sqlite3_create_function16 sqlite3_api->create_function16
+#define sqlite3_create_module sqlite3_api->create_module
+#define sqlite3_data_count sqlite3_api->data_count
+#define sqlite3_db_handle sqlite3_api->db_handle
+#define sqlite3_declare_vtab sqlite3_api->declare_vtab
+#define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache
+#define sqlite3_errcode sqlite3_api->errcode
+#define sqlite3_errmsg sqlite3_api->errmsg
+#define sqlite3_errmsg16 sqlite3_api->errmsg16
+#define sqlite3_exec sqlite3_api->exec
+#define sqlite3_expired sqlite3_api->expired
+#define sqlite3_finalize sqlite3_api->finalize
+#define sqlite3_free sqlite3_api->free
+#define sqlite3_free_table sqlite3_api->free_table
+#define sqlite3_get_autocommit sqlite3_api->get_autocommit
+#define sqlite3_get_auxdata sqlite3_api->get_auxdata
+#define sqlite3_get_table sqlite3_api->get_table
+#define sqlite3_global_recover sqlite3_api->global_recover
+#define sqlite3_interrupt sqlite3_api->interrupt
+#define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid
+#define sqlite3_libversion sqlite3_api->libversion
+#define sqlite3_libversion_number sqlite3_api->libversion_number
+#define sqlite3_malloc sqlite3_api->malloc
+#define sqlite3_mprintf sqlite3_api->mprintf
+#define sqlite3_open sqlite3_api->open
+#define sqlite3_open16 sqlite3_api->open16
+#define sqlite3_prepare sqlite3_api->prepare
+#define sqlite3_prepare16 sqlite3_api->prepare16
+#define sqlite3_profile sqlite3_api->profile
+#define sqlite3_progress_handler sqlite3_api->progress_handler
+#define sqlite3_realloc sqlite3_api->realloc
+#define sqlite3_reset sqlite3_api->reset
+#define sqlite3_result_blob sqlite3_api->result_blob
+#define sqlite3_result_double sqlite3_api->result_double
+#define sqlite3_result_error sqlite3_api->result_error
+#define sqlite3_result_error16 sqlite3_api->result_error16
+#define sqlite3_result_int sqlite3_api->result_int
+#define sqlite3_result_int64 sqlite3_api->result_int64
+#define sqlite3_result_null sqlite3_api->result_null
+#define sqlite3_result_text sqlite3_api->result_text
+#define sqlite3_result_text16 sqlite3_api->result_text16
+#define sqlite3_result_text16be sqlite3_api->result_text16be
+#define sqlite3_result_text16le sqlite3_api->result_text16le
+#define sqlite3_result_value sqlite3_api->result_value
+#define sqlite3_rollback_hook sqlite3_api->rollback_hook
+#define sqlite3_set_authorizer sqlite3_api->set_authorizer
+#define sqlite3_set_auxdata sqlite3_api->set_auxdata
+#define sqlite3_snprintf sqlite3_api->snprintf
+#define sqlite3_step sqlite3_api->step
+#define sqlite3_table_column_metadata sqlite3_api->table_column_metadata
+#define sqlite3_thread_cleanup sqlite3_api->thread_cleanup
+#define sqlite3_total_changes sqlite3_api->total_changes
+#define sqlite3_trace sqlite3_api->trace
+#define sqlite3_transfer_bindings sqlite3_api->transfer_bindings
+#define sqlite3_update_hook sqlite3_api->update_hook
+#define sqlite3_user_data sqlite3_api->user_data
+#define sqlite3_value_blob sqlite3_api->value_blob
+#define sqlite3_value_bytes sqlite3_api->value_bytes
+#define sqlite3_value_bytes16 sqlite3_api->value_bytes16
+#define sqlite3_value_double sqlite3_api->value_double
+#define sqlite3_value_int sqlite3_api->value_int
+#define sqlite3_value_int64 sqlite3_api->value_int64
+#define sqlite3_value_numeric_type sqlite3_api->value_numeric_type
+#define sqlite3_value_text sqlite3_api->value_text
+#define sqlite3_value_text16 sqlite3_api->value_text16
+#define sqlite3_value_text16be sqlite3_api->value_text16be
+#define sqlite3_value_text16le sqlite3_api->value_text16le
+#define sqlite3_value_type sqlite3_api->value_type
+#define sqlite3_vmprintf sqlite3_api->vmprintf
+#endif /* SQLITE_CORE */
+
+#define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api;
+#define SQLITE_EXTENSION_INIT2(v) sqlite3_api = v;
+
+#endif /* _SQLITE3EXT_H_ */
diff --git a/ext/pdo_sqlite/sqlite/src/sqliteInt.h b/ext/pdo_sqlite/sqlite/src/sqliteInt.h
index 1635369c4..58e21c4f3 100644
--- a/ext/pdo_sqlite/sqlite/src/sqliteInt.h
+++ b/ext/pdo_sqlite/sqlite/src/sqliteInt.h
@@ -17,6 +17,13 @@
#define _SQLITEINT_H_
/*
+** Extra interface definitions for those who need them
+*/
+#ifdef SQLITE_EXTRA
+# include "sqliteExtra.h"
+#endif
+
+/*
** 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
@@ -60,6 +67,23 @@
#include <stddef.h>
/*
+** If compiling for a processor that lacks floating point support,
+** substitute integer for floating-point
+*/
+#ifdef SQLITE_OMIT_FLOATING_POINT
+# define double sqlite_int64
+# define LONGDOUBLE_TYPE sqlite_int64
+# ifndef SQLITE_BIG_DBL
+# define SQLITE_BIG_DBL (0x7fffffffffffffff)
+# endif
+# define SQLITE_OMIT_DATETIME_FUNCS 1
+# define SQLITE_OMIT_TRACE 1
+#endif
+#ifndef SQLITE_BIG_DBL
+# define SQLITE_BIG_DBL (1e99)
+#endif
+
+/*
** 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
@@ -90,18 +114,6 @@
/*
** 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
@@ -129,18 +141,15 @@
#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.
+** The "file format" number is an integer that is incremented whenever
+** the VDBE-level file format changes. The following macros define the
+** the default file format for new databases and the maximum file format
+** that the library can read.
*/
-/* #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 */
+#define SQLITE_MAX_FILE_FORMAT 4
+#ifndef SQLITE_DEFAULT_FILE_FORMAT
+# define SQLITE_DEFAULT_FILE_FORMAT 1
+#endif
/*
** Provide a default value for TEMP_STORE in case it is not specified
@@ -159,19 +168,22 @@
#endif
/*
+** Check to see if this machine uses EBCDIC. (Yes, believe it or
+** not, there are still machines out there that use EBCDIC.)
+*/
+#if 'A' == '\301'
+# define SQLITE_EBCDIC 1
+#else
+# define SQLITE_ASCII 1
+#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
@@ -191,7 +203,7 @@
# define LONGDOUBLE_TYPE long double
#endif
typedef sqlite_int64 i64; /* 8-byte signed integer */
-typedef UINT64_TYPE u64; /* 8-byte unsigned integer */
+typedef sqlite_uint64 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 */
@@ -228,59 +240,67 @@ struct BusyHandler {
*/
#include "vdbe.h"
#include "btree.h"
+#include "pager.h"
+#ifdef SQLITE_MEMDEBUG
/*
-** This macro casts a pointer to an integer. Useful for doing
-** pointer arithmetic.
+** The following global variables are used for testing and debugging
+** only. They only work if SQLITE_MEMDEBUG is defined.
*/
-#define Addr(X) ((uptr)X)
+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 */
+
+extern void *sqlite3_pFirst; /* Pointer to linked list of allocations */
+extern int sqlite3_nMaxAlloc; /* High water mark of ThreadData.nAlloc */
+extern int sqlite3_mallocDisallowed; /* assert() in sqlite3Malloc() if set */
+extern int sqlite3_isFail; /* True if all malloc calls should fail */
+extern const char *sqlite3_zFile; /* Filename to associate debug info with */
+extern int sqlite3_iLine; /* Line number for debug info */
+
+#define ENTER_MALLOC (sqlite3_zFile = __FILE__, sqlite3_iLine = __LINE__)
+#define sqliteMalloc(x) (ENTER_MALLOC, sqlite3Malloc(x,1))
+#define sqliteMallocRaw(x) (ENTER_MALLOC, sqlite3MallocRaw(x,1))
+#define sqliteRealloc(x,y) (ENTER_MALLOC, sqlite3Realloc(x,y))
+#define sqliteStrDup(x) (ENTER_MALLOC, sqlite3StrDup(x))
+#define sqliteStrNDup(x,y) (ENTER_MALLOC, sqlite3StrNDup(x,y))
+#define sqliteReallocOrFree(x,y) (ENTER_MALLOC, sqlite3ReallocOrFree(x,y))
-/*
-** 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
+
+#define ENTER_MALLOC 0
+#define sqliteMalloc(x) sqlite3Malloc(x,1)
+#define sqliteMallocRaw(x) sqlite3MallocRaw(x,1)
+#define sqliteRealloc(x,y) sqlite3Realloc(x,y)
+#define sqliteStrDup(x) sqlite3StrDup(x)
+#define sqliteStrNDup(x,y) sqlite3StrNDup(x,y)
+#define sqliteReallocOrFree(x,y) sqlite3ReallocOrFree(x,y)
+
#endif
-/*
-** This variable gets set if malloc() ever fails. After it gets set,
-** the SQLite library shuts down permanently.
-*/
-extern int sqlite3_malloc_failed;
+#define sqliteFree(x) sqlite3FreeX(x)
+#define sqliteAllocSize(x) sqlite3AllocSize(x)
+
/*
-** The following global variables are used for testing and debugging
-** only. They only work if SQLITE_DEBUG is defined.
+** An instance of this structure might be allocated to store information
+** specific to a single thread.
*/
-#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 */
+struct ThreadData {
+ int dummy; /* So that this structure is never empty */
+
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ int nSoftHeapLimit; /* Suggested max mem allocation. No limit if <0 */
+ int nAlloc; /* Number of bytes currently allocated */
+ Pager *pPager; /* Linked list of all pagers in this thread */
+#endif
+
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ u8 useSharedData; /* True if shared pagers and schemas are enabled */
+ BtShared *pBtree; /* Linked list of all currently open BTrees */
#endif
+};
/*
** Name of the master database table. The master database table
@@ -314,6 +334,7 @@ typedef struct AuthContext AuthContext;
typedef struct CollSeq CollSeq;
typedef struct Column Column;
typedef struct Db Db;
+typedef struct Schema Schema;
typedef struct Expr Expr;
typedef struct ExprList ExprList;
typedef struct FKey FKey;
@@ -322,11 +343,14 @@ typedef struct IdList IdList;
typedef struct Index Index;
typedef struct KeyClass KeyClass;
typedef struct KeyInfo KeyInfo;
+typedef struct Module Module;
typedef struct NameContext NameContext;
typedef struct Parse Parse;
typedef struct Select Select;
typedef struct SrcList SrcList;
+typedef struct ThreadData ThreadData;
typedef struct Table Table;
+typedef struct TableLock TableLock;
typedef struct Token Token;
typedef struct TriggerStack TriggerStack;
typedef struct TriggerStep TriggerStep;
@@ -344,28 +368,37 @@ typedef struct WhereLevel WhereLevel;
struct Db {
char *zName; /* Name of this database */
Btree *pBt; /* The B*Tree structure for this database file */
+ u8 inTrans; /* 0: not writable. 1: Transaction. 2: Checkpoint */
+ u8 safety_level; /* How aggressive at synching data to disk */
+ void *pAux; /* Auxiliary data. Usually NULL */
+ void (*xFreeAux)(void*); /* Routine to free pAux */
+ Schema *pSchema; /* Pointer to database schema (possibly shared) */
+};
+
+/*
+** An instance of the following structure stores a database schema.
+*/
+struct Schema {
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 */
+ u8 file_format; /* Schema format version for this file */
+ u8 enc; /* Text encoding used by this database */
+ u16 flags; /* Flags associated with this schema */
+ int cache_size; /* Number of pages to use in the cache */
};
/*
** 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)
+#define DbHasProperty(D,I,P) (((D)->aDb[I].pSchema->flags&(P))==(P))
+#define DbHasAnyProperty(D,I,P) (((D)->aDb[I].pSchema->flags&(P))!=0)
+#define DbSetProperty(D,I,P) (D)->aDb[I].pSchema->flags|=(P)
+#define DbClearProperty(D,I,P) (D)->aDb[I].pSchema->flags&=~(P)
/*
** Allowed values for the DB.flags field.
@@ -379,6 +412,7 @@ struct Db {
*/
#define DB_SchemaLoaded 0x0001 /* The schema has been loaded */
#define DB_UnresetViews 0x0002 /* Some views have defined column names */
+#define DB_Empty 0x0004 /* The file is empty (length 0 bytes) */
#define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE)
@@ -413,9 +447,7 @@ struct sqlite3 {
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) */
@@ -429,21 +461,30 @@ struct sqlite3 {
int newTnum; /* Rootpage of table being initialized */
u8 busy; /* TRUE if currently initializing */
} init;
+ int nExtension; /* Number of loaded extensions */
+ void *aExtension; /* Array of shared libraray handles */
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 *pCommitArg; /* Argument to xCommitCallback() */
+ int (*xCommitCallback)(void*); /* Invoked at every commit. */
+ void *pRollbackArg; /* Argument to xRollbackCallback() */
+ void (*xRollbackCallback)(void*); /* Invoked at every commit. */
+ void *pUpdateArg;
+ void (*xUpdateCallback)(void*,int, const char*,const char*,sqlite_int64);
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) */
+ union {
+ int isInterrupted; /* True if sqlite3_interrupt has been called */
+ double notUsed1; /* Spacer */
+ } u1;
#ifndef SQLITE_OMIT_AUTHORIZATION
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*);
/* Access authorization function */
@@ -454,13 +495,16 @@ struct sqlite3 {
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. */
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ Hash aModule; /* populated by sqlite3_create_module() */
+ Table *pVTab; /* vtab with active Connect/Create method */
+ sqlite3_vtab **aVTrans; /* Virtual tables with open transactions */
+ int nVTrans; /* Allocated size of aVTrans */
#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 */
+ 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 */
@@ -468,6 +512,11 @@ struct sqlite3 {
};
/*
+** A macro to discover the encoding of a database.
+*/
+#define ENC(db) ((db)->aDb[0].pSchema->enc)
+
+/*
** Possible values for the sqlite.flags and or Db.flags fields.
**
** On sqlite.flags, the SQLITE_InTrans value means that we have
@@ -475,8 +524,6 @@ struct sqlite3 {
** 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 */
@@ -491,6 +538,11 @@ struct sqlite3 {
#define SQLITE_WriteSchema 0x00000800 /* OK to update SQLITE_MASTER */
#define SQLITE_NoReadlock 0x00001000 /* Readlocks are omitted when
** accessing read-only databases */
+#define SQLITE_IgnoreChecks 0x00002000 /* Do not enforce check constraints */
+#define SQLITE_ReadUncommitted 0x00004000 /* For shared-cache mode */
+#define SQLITE_LegacyFileFmt 0x00008000 /* Create new databases in format 1 */
+#define SQLITE_FullFSync 0x00010000 /* Use full fsync on the backend */
+#define SQLITE_LoadExtension 0x00020000 /* Enable load_extension */
/*
** Possible values for the sqlite.magic field.
@@ -522,10 +574,22 @@ struct FuncDef {
};
/*
+** Each SQLite module (virtual table definition) is defined by an
+** instance of the following structure, stored in the sqlite3.aModule
+** hash table.
+*/
+struct Module {
+ const sqlite3_module *pModule; /* Callback pointers */
+ const char *zName; /* Name passed to create_module() */
+ void *pAux; /* pAux passed to create_module() */
+};
+
+/*
** 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 */
+#define SQLITE_FUNC_EPHEM 0x04 /* Ephermeral. Delete with VDBE */
/*
** information about each column of an SQL table is held in an instance
@@ -535,7 +599,7 @@ 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 */
+ char *zColl; /* 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 */
@@ -551,7 +615,7 @@ struct Column {
** 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.
+** translations, 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.
@@ -586,12 +650,25 @@ struct CollSeq {
/*
** Column affinity types.
+**
+** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and
+** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve
+** the speed a little by number the values consecutively.
+**
+** But rather than start with 0 or 1, we begin with 'a'. That way,
+** when multiple affinity types are concatenated into a string and
+** used as the P3 operand, they will be more readable.
+**
+** Note also that the numeric types are grouped together so that testing
+** for a numeric type is a single comparison.
*/
-#define SQLITE_AFF_INTEGER 'i'
-#define SQLITE_AFF_NUMERIC 'n'
-#define SQLITE_AFF_TEXT 't'
-#define SQLITE_AFF_NONE 'o'
+#define SQLITE_AFF_TEXT 'a'
+#define SQLITE_AFF_NONE 'b'
+#define SQLITE_AFF_NUMERIC 'c'
+#define SQLITE_AFF_INTEGER 'd'
+#define SQLITE_AFF_REAL 'e'
+#define sqlite3IsNumericAffinity(X) ((X)>=SQLITE_AFF_NUMERIC)
/*
** Each SQL table is represented in memory by an instance of the
@@ -615,7 +692,7 @@ struct CollSeq {
** 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
+** holds temporary tables and indices. If Table.isEphem
** 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
@@ -631,22 +708,44 @@ struct Table {
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_CHECK
+ Expr *pCheck; /* The AND of all CHECK constraints */
+#endif
#ifndef SQLITE_OMIT_ALTERTABLE
int addColOffset; /* Offset in CREATE TABLE statement to add a new column */
#endif
+ u8 readOnly; /* True if this table should not be written by the user */
+ u8 isEphem; /* True if created using OP_OpenEphermeral */
+ 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 */
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ u8 isVirtual; /* True if this is a virtual table */
+ u8 isCommit; /* True once the CREATE TABLE has been committed */
+ Module *pMod; /* Pointer to the implementation of the module */
+ sqlite3_vtab *pVtab; /* Pointer to the module instance */
+ int nModuleArg; /* Number of arguments to the module */
+ char **azModuleArg; /* Text of all module args. [0] is module name */
+#endif
+ Schema *pSchema;
};
/*
+** Test to see whether or not a table is a virtual table. This is
+** done as a macro so that it will be optimized out when virtual
+** table support is omitted from the build.
+*/
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+# define IsVirtual(X) ((X)->isVirtual)
+#else
+# define IsVirtual(X) 0
+#endif
+
+/*
** Each foreign key constraint is an instance of the following structure.
**
** A foreign key is associated with two tables. The "from" table is
@@ -779,10 +878,11 @@ struct Index {
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 */
+ Schema *pSchema; /* Schema containing this index */
+ u8 *aSortOrder; /* Array of size Index.nColumn. True==DESC, False==ASC */
+ char **azColl; /* Array of collation sequence names for index */
};
/*
@@ -836,7 +936,7 @@ struct AggInfo {
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 */
+ int iDistinct; /* Ephermeral table used to enforce DISTINCT */
} *aFunc;
int nFunc; /* Number of entries in aFunc[] */
int nFuncAlloc; /* Number of slots allocated for aFunc[] */
@@ -891,8 +991,7 @@ struct AggInfo {
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 */
+ u16 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
@@ -907,6 +1006,7 @@ struct Expr {
Select *pSelect; /* When the expression is a sub-select. Also the
** right side of "<expr> IN (<select>)" */
Table *pTab; /* Table for OP_Column expressions. */
+ Schema *pSchema;
};
/*
@@ -919,6 +1019,7 @@ struct Expr {
#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 */
+#define EP_InfixFunc 0x80 /* True for an infix function: LIKE, GLOB, etc */
/*
** These macros can be used to test, set, or clear bits in the
@@ -999,6 +1100,7 @@ struct SrcList {
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 isPopulated; /* Temporary table associated with SELECT is populated */
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 */
@@ -1023,6 +1125,19 @@ struct SrcList {
** 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.
+**
+** The pIdxInfo and pBestIdx fields are used to help pick the best
+** index on a virtual table. The pIdxInfo pointer contains indexing
+** information for the i-th table in the FROM clause before reordering.
+** All the pIdxInfo pointers are freed by whereInfoFree() in where.c.
+** The pBestIdx pointer is a copy of pIdxInfo for the i-th table after
+** FROM clause ordering. This is a little confusing so I will repeat
+** it in different words. WhereInfo.a[i].pIdxInfo is index information
+** for WhereInfo.pTabList.a[i]. WhereInfo.a[i].pBestInfo is the
+** index information for the i-th loop of the join. pBestInfo is always
+** either NULL or a copy of some pIdxInfo. So for cleanup it is
+** sufficient to free all of the pIdxInfo pointers.
+**
*/
struct WhereLevel {
int iFrom; /* Which entry in the FROM clause */
@@ -1039,6 +1154,13 @@ struct WhereLevel {
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 */
+ sqlite3_index_info *pBestIdx; /* Index information for this level */
+
+ /* The following field is really not part of the current level. But
+ ** we need a place to cache index information for each table in the
+ ** FROM clause and the WhereLevel structure is a convenient place.
+ */
+ sqlite3_index_info *pIdxInfo; /* Index info for n-th source table */
};
/*
@@ -1055,6 +1177,7 @@ struct WhereInfo {
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 */
+ sqlite3_index_info **apInfo; /* Array of pointers to index info structures */
WhereLevel a[1]; /* Information about each nest loop in the WHERE */
};
@@ -1087,6 +1210,7 @@ struct NameContext {
int nErr; /* Number of errors encountered while resolving names */
u8 allowAgg; /* Aggregate functions allowed here */
u8 hasAgg; /* True if aggregates are seen */
+ u8 isCheck; /* True if resolving names in a CHECK constraint */
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 */
@@ -1102,14 +1226,14 @@ struct NameContext {
** 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.
+** addrOpenEphm[] entries contain the address of OP_OpenEphemeral 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
+** as the OP_OpenEphm 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
+** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences
+** for the result set. The KeyInfo for addrOpenTran[2] contains collating
** sequences for the ORDER BY clause.
*/
struct Select {
@@ -1118,7 +1242,7 @@ struct Select {
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 usesEphm; /* True if uses an OpenEphemeral opcode */
u8 disallowOrderBy; /* Do not allow an ORDER BY to be attached if TRUE */
SrcList *pSrc; /* The FROM clause */
Expr *pWhere; /* The WHERE clause */
@@ -1130,7 +1254,7 @@ struct Select {
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 */
+ int addrOpenEphm[3]; /* OP_OpenEphem opcodes related to this select */
};
/*
@@ -1147,9 +1271,9 @@ struct Select {
#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_EphemTab 8 /* Create transient tab 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 */
+#define SRT_Exists 10 /* Store 1 if the result is not empty */
/*
** An SQL parser context. A copy of this structure is passed through
@@ -1160,6 +1284,12 @@ struct Select {
** 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.
+**
+** The nTableLock and aTableLock variables are only used if the shared-cache
+** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are
+** used to store the set of table-locks required by the statement being
+** compiled. Function sqlite3TableLock() is used to add entries to the
+** list.
*/
struct Parse {
sqlite3 *db; /* The main database structure */
@@ -1170,14 +1300,20 @@ struct Parse {
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 */
+ u8 parseError; /* True if a parsing error has been seen */
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 */
+ int ckOffset; /* Stack offset to data used by CHECK constraints */
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 */
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ int nTableLock; /* Number of locks in aTableLock */
+ TableLock *aTableLock; /* Required table locks for shared-cache mode */
+#endif
/* Above is constant between recursions. Below is reset before and after
** each recursion */
@@ -1196,8 +1332,19 @@ struct Parse {
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 */
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ Token sArg; /* Complete text of a module argument */
+ u8 declareVtab; /* True if inside sqlite3_declare_vtab() */
+ Table *pVirtualLock; /* Require virtual table lock on this table */
+#endif
};
+#ifdef SQLITE_OMIT_VIRTUALTABLE
+ #define IN_DECLARE_VTAB 0
+#else
+ #define IN_DECLARE_VTAB (pParse->declareVtab)
+#endif
+
/*
** 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.
@@ -1212,6 +1359,7 @@ struct AuthContext {
*/
#define OPFLAG_NCHANGE 1 /* Set to update db->nChange */
#define OPFLAG_LASTROWID 2 /* Set to update db->lastRowid */
+#define OPFLAG_ISUPDATE 4 /* This OP_Insert is an sql UPDATE */
/*
* Each trigger present in the database schema is stored as an instance of
@@ -1231,8 +1379,6 @@ struct AuthContext {
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) */
@@ -1240,7 +1386,8 @@ struct 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 */
-
+ Schema *pSchema; /* Schema containing the trigger */
+ Schema *pTabSchema; /* Schema containing the table */
TriggerStep *step_list; /* Link list of trigger program steps */
Trigger *pNext; /* Next trigger associated with the table */
};
@@ -1305,8 +1452,8 @@ struct TriggerStep {
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 */
+ TriggerStep *pNext; /* Next in the link-list */
+ TriggerStep *pLast; /* Last element in link-list. Valid for 1st elem only */
};
/*
@@ -1366,6 +1513,7 @@ struct DbFixer {
typedef struct {
sqlite3 *db; /* The database being initialized */
char **pzErrMsg; /* Error message stored here */
+ int rc; /* Result code stored here */
} InitData;
/*
@@ -1398,38 +1546,33 @@ 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);
+
+void *sqlite3Malloc(int,int);
+void *sqlite3MallocRaw(int,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);
+int sqlite3AllocSize(void *);
+
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 sqlite3ErrorClear(Parse*);
void sqlite3Dequote(char*);
void sqlite3DequoteExpr(Expr*);
-int sqlite3KeywordCode(const char*, int);
+int sqlite3KeywordCode(const unsigned char*, int);
int sqlite3RunParser(Parse*, const char*, char **);
void sqlite3FinishCoding(Parse*);
Expr *sqlite3Expr(int, Expr*, Expr*, const Token*);
+Expr *sqlite3ExprOrFree(int, Expr*, Expr*, const Token*);
Expr *sqlite3RegisterExpr(Parse*,Token*);
Expr *sqlite3ExprAnd(Expr*, Expr*);
void sqlite3ExprSpan(Expr*,Token*,Token*);
@@ -1446,24 +1589,26 @@ 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 sqlite3OpenMasterTable(Parse *, int);
+void sqlite3StartTable(Parse*,Token*,Token*,int,int,int,int);
void sqlite3AddColumn(Parse*,Token*);
void sqlite3AddNotNull(Parse*, int);
-void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int);
+void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int, int);
+void sqlite3AddCheckConstraint(Parse*, Expr*);
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);
+void sqlite3CreateView(Parse*,Token*,Token*,Token*,Select*,int);
+
+#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE)
int sqlite3ViewGetColumnNames(Parse*,Table*);
#else
# define sqlite3ViewGetColumnNames(A,B) 0
#endif
-void sqlite3DropTable(Parse*, SrcList*, int);
+void sqlite3DropTable(Parse*, SrcList*, int, int);
void sqlite3DeleteTable(sqlite3*, Table*);
void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, int);
int sqlite3ArrayAllocate(void**,int,int);
@@ -1475,8 +1620,8 @@ void sqlite3SrcListAssignCursors(Parse*, SrcList*);
void sqlite3IdListDelete(IdList*);
void sqlite3SrcListDelete(SrcList*);
void sqlite3CreateIndex(Parse*,Token*,Token*,SrcList*,ExprList*,int,Token*,
- Token*);
-void sqlite3DropIndex(Parse*, SrcList*);
+ Token*, int, int);
+void sqlite3DropIndex(Parse*, SrcList*, int);
void sqlite3AddKeyType(Vdbe*, ExprList*);
void sqlite3AddIdxKeyType(Vdbe*, Index*);
int sqlite3Select(Parse*, Select*, int, int, Select*, int, int*, char *aff);
@@ -1486,8 +1631,7 @@ 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 sqlite3OpenTable(Parse*, int iCur, int iDb, Table*, int);
void sqlite3DeleteFrom(Parse*, SrcList*, Expr*);
void sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int);
WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**);
@@ -1503,7 +1647,7 @@ 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*);
+void sqlite3Vacuum(Parse*);
int sqlite3RunVacuum(char**, sqlite3*);
char *sqlite3NameFromToken(Token*);
int sqlite3ExprCheck(Parse*, Expr*, int, int*);
@@ -1513,6 +1657,7 @@ int sqlite3ExprResolveNames(NameContext *, Expr *);
int sqlite3ExprAnalyzeAggregates(NameContext*, Expr*);
int sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
Vdbe *sqlite3GetVdbe(Parse*);
+Expr *sqlite3CreateIdExpr(const char*);
void sqlite3Randomness(int, void*);
void sqlite3RollbackAll(sqlite3*);
void sqlite3CodeVerifySchema(Parse*, int);
@@ -1524,7 +1669,7 @@ 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 sqlite3GenerateRowIndexDelete(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);
@@ -1549,7 +1694,7 @@ void sqlite3ChangeCookie(sqlite3*, Vdbe*, int);
int,Expr*,int);
void sqlite3FinishTrigger(Parse*, TriggerStep*, Token*);
void sqlite3DropTrigger(Parse*, SrcList*);
- void sqlite3DropTriggerPtr(Parse*, Trigger*, int);
+ void sqlite3DropTriggerPtr(Parse*, Trigger*);
int sqlite3TriggersExist(Parse*, Table*, int, ExprList*);
int sqlite3CodeRowTrigger(Parse*, int, ExprList*, int, Table *, int, int,
int, int);
@@ -1564,7 +1709,7 @@ void sqlite3ChangeCookie(sqlite3*, Vdbe*, int);
#else
# define sqlite3TriggersExist(A,B,C,D,E,F) 0
# define sqlite3DeleteTrigger(A)
-# define sqlite3DropTriggerPtr(A,B,C)
+# define sqlite3DropTriggerPtr(A,B)
# define sqlite3UnlinkAndDeleteTrigger(A,B,C)
# define sqlite3CodeRowTrigger(A,B,C,D,E,F,G,H,I) 0
#endif
@@ -1583,8 +1728,8 @@ void sqlite3DeferForeignKey(Parse*, int);
# define sqlite3AuthContextPush(a,b,c)
# define sqlite3AuthContextPop(a) ((void)(a))
#endif
-void sqlite3Attach(Parse*, Token*, Token*, int, Token*);
-void sqlite3Detach(Parse*, Token*);
+void sqlite3Attach(Parse*, Expr*, Expr*, Expr*);
+void sqlite3Detach(Parse*, Expr*);
int sqlite3BtreeFactory(const sqlite3 *db, const char *zFilename,
int omitJournal, int nCache, Btree **ppBtree);
int sqlite3FixInit(DbFixer*, Parse*, int, const char*, const Token*);
@@ -1630,7 +1775,7 @@ 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);
+char *sqlite3utf16to8(const void*, int);
int sqlite3ValueFromExpr(Expr *, u8, u8, sqlite3_value **);
void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8);
extern const unsigned char sqlite3UpperToLower[];
@@ -1656,6 +1801,74 @@ void sqlite3AnalysisLoad(sqlite3*,int iDB);
void sqlite3DefaultRowEst(Index*);
void sqlite3RegisterLikeFunctions(sqlite3*, int);
int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*);
+ThreadData *sqlite3ThreadData(void);
+const ThreadData *sqlite3ThreadDataReadOnly(void);
+void sqlite3ReleaseThreadData(void);
+void sqlite3AttachFunctions(sqlite3 *);
+void sqlite3MinimumFileFormat(Parse*, int, int);
+void sqlite3SchemaFree(void *);
+Schema *sqlite3SchemaGet(Btree *);
+int sqlite3SchemaToIndex(sqlite3 *db, Schema *);
+KeyInfo *sqlite3IndexKeyinfo(Parse *, Index *);
+int sqlite3CreateFunc(sqlite3 *, const char *, int, int, void *,
+ void (*)(sqlite3_context*,int,sqlite3_value **),
+ void (*)(sqlite3_context*,int,sqlite3_value **), void (*)(sqlite3_context*));
+int sqlite3ApiExit(sqlite3 *db, int);
+int sqlite3MallocFailed(void);
+void sqlite3FailedMalloc(void);
+void sqlite3AbortOtherActiveVdbes(sqlite3 *, Vdbe *);
+int sqlite3OpenTempDatabase(Parse *);
+
+#ifndef SQLITE_OMIT_LOAD_EXTENSION
+ void sqlite3CloseExtensions(sqlite3*);
+#else
+# define sqlite3CloseExtensions(X)
+#endif
+
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ void sqlite3TableLock(Parse *, int, int, u8, const char *);
+#else
+ #define sqlite3TableLock(v,w,x,y,z)
+#endif
+
+#ifdef SQLITE_MEMDEBUG
+ void sqlite3MallocDisallow(void);
+ void sqlite3MallocAllow(void);
+ int sqlite3TestMallocFail(void);
+#else
+ #define sqlite3TestMallocFail() 0
+ #define sqlite3MallocDisallow()
+ #define sqlite3MallocAllow()
+#endif
+
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ void *sqlite3ThreadSafeMalloc(int);
+ void sqlite3ThreadSafeFree(void *);
+#else
+ #define sqlite3ThreadSafeMalloc sqlite3MallocX
+ #define sqlite3ThreadSafeFree sqlite3FreeX
+#endif
+
+#ifdef SQLITE_OMIT_VIRTUALTABLE
+# define sqlite3VtabClear(X)
+# define sqlite3VtabSync(X,Y) (Y)
+# define sqlite3VtabRollback(X)
+# define sqlite3VtabCommit(X)
+#else
+ void sqlite3VtabClear(Table*);
+ int sqlite3VtabSync(sqlite3 *db, int rc);
+ int sqlite3VtabRollback(sqlite3 *db);
+ int sqlite3VtabCommit(sqlite3 *db);
+#endif
+void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*);
+void sqlite3VtabFinishParse(Parse*, Token*);
+void sqlite3VtabArgInit(Parse*);
+void sqlite3VtabArgExtend(Parse*, Token*);
+int sqlite3VtabCallCreate(sqlite3*, int, const char *, char **);
+int sqlite3VtabCallConnect(Parse*, Table*);
+int sqlite3VtabCallDestroy(sqlite3*, int, const char *);
+int sqlite3VtabBegin(sqlite3 *, sqlite3_vtab *);
+FuncDef *sqlite3VtabOverloadFunction(FuncDef*, int nArg, Expr*);
#ifdef SQLITE_SSE
#include "sseInt.h"
diff --git a/ext/pdo_sqlite/sqlite/src/table.c b/ext/pdo_sqlite/sqlite/src/table.c
index d4ef2c8a7..c4e228361 100644
--- a/ext/pdo_sqlite/sqlite/src/table.c
+++ b/ext/pdo_sqlite/sqlite/src/table.c
@@ -16,9 +16,11 @@
** These routines are in a separate files so that they will not be linked
** if they are not used.
*/
+#include "sqliteInt.h"
#include <stdlib.h>
#include <string.h>
-#include "sqliteInt.h"
+
+#ifndef SQLITE_OMIT_GET_TABLE
/*
** This structure is used to pass data from sqlite3_get_table() through
@@ -57,7 +59,7 @@ static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
if( p->nData + need >= p->nAlloc ){
char **azNew;
p->nAlloc = p->nAlloc*2 + need + 1;
- azNew = realloc( p->azResult, sizeof(char*)*p->nAlloc );
+ azNew = sqlite3_realloc( p->azResult, sizeof(char*)*p->nAlloc );
if( azNew==0 ) goto malloc_failed;
p->azResult = azNew;
}
@@ -69,11 +71,9 @@ static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
p->nColumn = nCol;
for(i=0; i<nCol; i++){
if( colv[i]==0 ){
- z = 0;
+ z = sqlite3_mprintf("");
}else{
- z = malloc( strlen(colv[i])+1 );
- if( z==0 ) goto malloc_failed;
- strcpy(z, colv[i]);
+ z = sqlite3_mprintf("%s", colv[i]);
}
p->azResult[p->nData++] = z;
}
@@ -92,7 +92,7 @@ static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
if( argv[i]==0 ){
z = 0;
}else{
- z = malloc( strlen(argv[i])+1 );
+ z = sqlite3_malloc( strlen(argv[i])+1 );
if( z==0 ) goto malloc_failed;
strcpy(z, argv[i]);
}
@@ -138,18 +138,19 @@ int sqlite3_get_table(
res.nData = 1;
res.nAlloc = 20;
res.rc = SQLITE_OK;
- res.azResult = malloc( sizeof(char*)*res.nAlloc );
+ res.azResult = sqlite3_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 ){
+ assert( sizeof(res.azResult[0])>= sizeof(res.nData) );
res.azResult[0] = (char*)res.nData;
}
if( rc==SQLITE_ABORT ){
sqlite3_free_table(&res.azResult[1]);
if( res.zErrMsg ){
if( pzErrMsg ){
- free(*pzErrMsg);
+ sqlite3_free(*pzErrMsg);
*pzErrMsg = sqlite3_mprintf("%s",res.zErrMsg);
}
sqliteFree(res.zErrMsg);
@@ -164,7 +165,7 @@ int sqlite3_get_table(
}
if( res.nAlloc>res.nData ){
char **azNew;
- azNew = realloc( res.azResult, sizeof(char*)*(res.nData+1) );
+ azNew = sqlite3_realloc( res.azResult, sizeof(char*)*(res.nData+1) );
if( azNew==0 ){
sqlite3_free_table(&res.azResult[1]);
return SQLITE_NOMEM;
@@ -189,7 +190,9 @@ void sqlite3_free_table(
azResult--;
if( azResult==0 ) return;
n = (int)azResult[0];
- for(i=1; i<n; i++){ if( azResult[i] ) free(azResult[i]); }
- free(azResult);
+ for(i=1; i<n; i++){ if( azResult[i] ) sqlite3_free(azResult[i]); }
+ sqlite3_free(azResult);
}
}
+
+#endif /* SQLITE_OMIT_GET_TABLE */
diff --git a/ext/pdo_sqlite/sqlite/src/tclsqlite.c b/ext/pdo_sqlite/sqlite/src/tclsqlite.c
index 9a8b823b7..8572b7cf6 100644
--- a/ext/pdo_sqlite/sqlite/src/tclsqlite.c
+++ b/ext/pdo_sqlite/sqlite/src/tclsqlite.c
@@ -23,6 +23,15 @@
#include <assert.h>
#include <ctype.h>
+/*
+ * Windows needs to know which symbols to export. Unix does not.
+ * BUILD_sqlite should be undefined for Unix.
+ */
+#ifdef BUILD_sqlite
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLEXPORT
+#endif /* BUILD_sqlite */
+
#define NUM_PREPARED_STMTS 10
#define MAX_PREPARED_STMTS 100
@@ -79,7 +88,7 @@ struct SqlPreparedStmt {
*/
typedef struct SqliteDb SqliteDb;
struct SqliteDb {
- sqlite3 *db; /* The "real" database structure */
+ sqlite3 *db; /* The "real" database structure. MUST BE FIRST */
Tcl_Interp *interp; /* The interpreter used for this database */
char *zBusy; /* The busy callback routine */
char *zCommit; /* The commit hook callback routine */
@@ -89,6 +98,8 @@ struct SqliteDb {
char *zAuth; /* The authorization callback routine */
char *zNull; /* Text to substitute for an SQL NULL value */
SqlFunc *pFunc; /* List of SQL functions */
+ Tcl_Obj *pUpdateHook; /* Update hook script (if any) */
+ Tcl_Obj *pRollbackHook; /* Rollback hook script (if any) */
SqlCollate *pCollate; /* List of SQL collation functions */
int rc; /* Return code of most recent sqlite3_exec() */
Tcl_Obj *pCollateNeeded; /* Collation needed script */
@@ -200,6 +211,15 @@ static void DbDeleteCmd(void *db){
if( pDb->zNull ){
Tcl_Free(pDb->zNull);
}
+ if( pDb->pUpdateHook ){
+ Tcl_DecrRefCount(pDb->pUpdateHook);
+ }
+ if( pDb->pRollbackHook ){
+ Tcl_DecrRefCount(pDb->pRollbackHook);
+ }
+ if( pDb->pCollateNeeded ){
+ Tcl_DecrRefCount(pDb->pCollateNeeded);
+ }
Tcl_Free((char*)pDb);
}
@@ -235,6 +255,7 @@ static int DbProgressHandler(void *cd){
return 0;
}
+#ifndef SQLITE_OMIT_TRACE
/*
** 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.
@@ -250,7 +271,9 @@ static void DbTraceHandler(void *cd, const char *zSql){
Tcl_DStringFree(&str);
Tcl_ResetResult(pDb->interp);
}
+#endif
+#ifndef SQLITE_OMIT_TRACE
/*
** This routine is called by the SQLite profile handler after a statement
** SQL has executed. The TCL script in pDb->zProfile is evaluated.
@@ -269,6 +292,7 @@ static void DbProfileHandler(void *cd, const char *zSql, sqlite_uint64 tm){
Tcl_DStringFree(&str);
Tcl_ResetResult(pDb->interp);
}
+#endif
/*
** This routine is called when a transaction is committed. The
@@ -287,6 +311,37 @@ static int DbCommitHandler(void *cd){
return 0;
}
+static void DbRollbackHandler(void *clientData){
+ SqliteDb *pDb = (SqliteDb*)clientData;
+ assert(pDb->pRollbackHook);
+ if( TCL_OK!=Tcl_EvalObjEx(pDb->interp, pDb->pRollbackHook, 0) ){
+ Tcl_BackgroundError(pDb->interp);
+ }
+}
+
+static void DbUpdateHandler(
+ void *p,
+ int op,
+ const char *zDb,
+ const char *zTbl,
+ sqlite_int64 rowid
+){
+ SqliteDb *pDb = (SqliteDb *)p;
+ Tcl_Obj *pCmd;
+
+ assert( pDb->pUpdateHook );
+ assert( op==SQLITE_INSERT || op==SQLITE_UPDATE || op==SQLITE_DELETE );
+
+ pCmd = Tcl_DuplicateObj(pDb->pUpdateHook);
+ Tcl_IncrRefCount(pCmd);
+ Tcl_ListObjAppendElement(0, pCmd, Tcl_NewStringObj(
+ ( (op==SQLITE_INSERT)?"INSERT":(op==SQLITE_UPDATE)?"UPDATE":"DELETE"), -1));
+ Tcl_ListObjAppendElement(0, pCmd, Tcl_NewStringObj(zDb, -1));
+ Tcl_ListObjAppendElement(0, pCmd, Tcl_NewStringObj(zTbl, -1));
+ Tcl_ListObjAppendElement(0, pCmd, Tcl_NewWideIntObj(rowid));
+ Tcl_EvalObjEx(pDb->interp, pCmd, TCL_EVAL_DIRECT);
+}
+
static void tclCollateNeeded(
void *pCtx,
sqlite3 *db,
@@ -392,7 +447,7 @@ static void tclSqlFunc(sqlite3_context *context, int argc, sqlite3_value**argv){
}
default: {
int bytes = sqlite3_value_bytes(pIn);
- pVal = Tcl_NewStringObj(sqlite3_value_text(pIn), bytes);
+ pVal = Tcl_NewStringObj((char *)sqlite3_value_text(pIn), bytes);
break;
}
}
@@ -439,8 +494,8 @@ static void tclSqlFunc(sqlite3_context *context, int argc, sqlite3_value**argv){
Tcl_GetWideIntFromObj(0, pVar, &v);
sqlite3_result_int64(context, v);
}else{
- data = Tcl_GetStringFromObj(pVar, &n);
- sqlite3_result_text(context, data, n, SQLITE_TRANSIENT);
+ data = (unsigned char *)Tcl_GetStringFromObj(pVar, &n);
+ sqlite3_result_text(context, (char *)data, n, SQLITE_TRANSIENT);
}
}
}
@@ -496,6 +551,8 @@ static int auth_callback(
case SQLITE_ALTER_TABLE : zCode="SQLITE_ALTER_TABLE"; break;
case SQLITE_REINDEX : zCode="SQLITE_REINDEX"; break;
case SQLITE_ANALYZE : zCode="SQLITE_ANALYZE"; break;
+ case SQLITE_CREATE_VTABLE : zCode="SQLITE_CREATE_VTABLE"; break;
+ case SQLITE_DROP_VTABLE : zCode="SQLITE_DROP_VTABLE"; break;
default : zCode="????"; break;
}
Tcl_DStringInit(&str);
@@ -610,22 +667,25 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
"authorizer", "busy", "cache",
"changes", "close", "collate",
"collation_needed", "commit_hook", "complete",
- "copy", "errorcode", "eval",
- "function", "last_insert_rowid", "nullvalue",
+ "copy", "enable_load_extension","errorcode",
+ "eval", "exists", "function",
+ "interrupt", "last_insert_rowid", "nullvalue",
"onecolumn", "profile", "progress",
- "rekey", "timeout", "total_changes",
- "trace", "transaction", "version",
- 0
+ "rekey", "rollback_hook", "timeout",
+ "total_changes", "trace", "transaction",
+ "update_hook", "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_COPY, DB_ENABLE_LOAD_EXTENSION,DB_ERRORCODE,
+ DB_EVAL, DB_EXISTS, DB_FUNCTION,
+ DB_INTERRUPT, 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
+ DB_REKEY, DB_ROLLBACK_HOOK, DB_TIMEOUT,
+ DB_TOTAL_CHANGES, DB_TRACE, DB_TRANSACTION,
+ DB_UPDATE_HOOK, DB_VERSION,
};
/* don't leave trailing commas on DB_enum, it confuses the AIX xlc compiler */
@@ -1036,9 +1096,10 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
azCol = malloc( sizeof(azCol[0])*(nCol+1) );
if( azCol==0 ) {
Tcl_AppendResult(interp, "Error: can't malloc()", 0);
+ fclose(in);
return TCL_ERROR;
}
- sqlite3_exec(pDb->db, "BEGIN", 0, 0, 0);
+ (void)sqlite3_exec(pDb->db, "BEGIN", 0, 0, 0);
zCommit = "COMMIT";
while( (zLine = local_getline(0, in))!=0 ){
char *z;
@@ -1058,10 +1119,13 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
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);
+ if( zErr ){
+ 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;
}
@@ -1085,7 +1149,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
free(azCol);
fclose(in);
sqlite3_finalize(pStmt);
- sqlite3_exec(pDb->db, zCommit, 0, 0, 0);
+ (void)sqlite3_exec(pDb->db, zCommit, 0, 0, 0);
if( zCommit[0] == 'C' ){
/* success, set result as number of lines processed */
@@ -1102,6 +1166,25 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
}
/*
+ ** $db enable_load_extension BOOLEAN
+ **
+ ** Turn the extension loading feature on or off. It if off by
+ ** default.
+ */
+ case DB_ENABLE_LOAD_EXTENSION: {
+ int onoff;
+ if( objc!=3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "BOOLEAN");
+ return TCL_ERROR;
+ }
+ if( Tcl_GetBooleanFromObj(interp, objv[2], &onoff) ){
+ return TCL_ERROR;
+ }
+ sqlite3_enable_load_extension(pDb->db, onoff);
+ break;
+ }
+
+ /*
** $db errorcode
**
** Return the numeric error code that was returned by the most recent
@@ -1126,7 +1209,8 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
** lindex [$db eval $sql] 0
*/
case DB_ONECOLUMN:
- case DB_EVAL: {
+ case DB_EVAL:
+ case DB_EXISTS: {
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 */
@@ -1139,19 +1223,24 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
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( choice==DB_EVAL ){
if( objc<3 || objc>5 ){
Tcl_WrongNumArgs(interp, 2, objv, "SQL ?ARRAY-NAME? ?SCRIPT?");
return TCL_ERROR;
}
pRet = Tcl_NewObj();
Tcl_IncrRefCount(pRet);
+ }else{
+ if( objc!=3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "SQL");
+ return TCL_ERROR;
+ }
+ if( choice==DB_EXISTS ){
+ pRet = Tcl_NewBooleanObj(0);
+ Tcl_IncrRefCount(pRet);
+ }else{
+ pRet = 0;
+ }
}
if( objc==3 ){
pArray = pScript = 0;
@@ -1275,8 +1364,8 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
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);
+ data = (unsigned char *)Tcl_GetStringFromObj(pVar, &n);
+ sqlite3_bind_text(pStmt, i, (char *)data, n, SQLITE_STATIC);
Tcl_IncrRefCount(pVar);
apParm[nParm++] = pVar;
}
@@ -1344,7 +1433,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
break;
}
default: {
- pVal = dbTextToObj(sqlite3_column_text(pStmt, i));
+ pVal = dbTextToObj((char *)sqlite3_column_text(pStmt, i));
break;
}
}
@@ -1356,11 +1445,19 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
Tcl_ObjSetVar2(interp, pArray, apColName[i], pVal, 0);
}
}else if( choice==DB_ONECOLUMN ){
+ assert( pRet==0 );
if( pRet==0 ){
pRet = pVal;
Tcl_IncrRefCount(pRet);
}
rc = TCL_BREAK;
+ i = nCol;
+ }else if( choice==DB_EXISTS ){
+ Tcl_DecrRefCount(pRet);
+ pRet = Tcl_NewBooleanObj(1);
+ Tcl_IncrRefCount(pRet);
+ rc = TCL_BREAK;
+ i = nCol;
}else{
Tcl_ListObjAppendElement(interp, pRet, pVal);
}
@@ -1471,6 +1568,8 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
Tcl_SetObjResult(interp, pRet);
}
Tcl_DecrRefCount(pRet);
+ }else if( rc==TCL_OK ){
+ Tcl_ResetResult(interp);
}
break;
}
@@ -1512,6 +1611,17 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
}
/*
+ ** $db interrupt
+ **
+ ** Interrupt the execution of the inner-most SQL interpreter. This
+ ** causes the SQL statement to return an error of SQLITE_INTERRUPT.
+ */
+ case DB_INTERRUPT: {
+ sqlite3_interrupt(pDb->db);
+ break;
+ }
+
+ /*
** $db nullvalue ?STRING?
**
** Change text used when a NULL comes back from the database. If ?STRING?
@@ -1549,14 +1659,14 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
*/
case DB_LAST_INSERT_ROWID: {
Tcl_Obj *pResult;
- int rowid;
+ Tcl_WideInt 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);
+ Tcl_SetWideIntObj(pResult, rowid);
break;
}
@@ -1782,7 +1892,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
}
inTrans = !sqlite3_get_autocommit(pDb->db);
if( !inTrans ){
- sqlite3_exec(pDb->db, zBegin, 0, 0, 0);
+ (void)sqlite3_exec(pDb->db, zBegin, 0, 0, 0);
}
rc = Tcl_EvalObjEx(interp, pScript, 0);
if( !inTrans ){
@@ -1792,8 +1902,50 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
} else {
zEnd = "COMMIT";
}
- sqlite3_exec(pDb->db, zEnd, 0, 0, 0);
+ (void)sqlite3_exec(pDb->db, zEnd, 0, 0, 0);
+ }
+ break;
+ }
+
+ /*
+ ** $db update_hook ?script?
+ ** $db rollback_hook ?script?
+ */
+ case DB_UPDATE_HOOK:
+ case DB_ROLLBACK_HOOK: {
+
+ /* set ppHook to point at pUpdateHook or pRollbackHook, depending on
+ ** whether [$db update_hook] or [$db rollback_hook] was invoked.
+ */
+ Tcl_Obj **ppHook;
+ if( choice==DB_UPDATE_HOOK ){
+ ppHook = &pDb->pUpdateHook;
+ }else{
+ ppHook = &pDb->pRollbackHook;
+ }
+
+ if( objc!=2 && objc!=3 ){
+ Tcl_WrongNumArgs(interp, 2, objv, "?SCRIPT?");
+ return TCL_ERROR;
+ }
+ if( *ppHook ){
+ Tcl_SetObjResult(interp, *ppHook);
+ if( objc==3 ){
+ Tcl_DecrRefCount(*ppHook);
+ *ppHook = 0;
+ }
}
+ if( objc==3 ){
+ assert( !(*ppHook) );
+ if( Tcl_GetCharLength(objv[2])>0 ){
+ *ppHook = objv[2];
+ Tcl_IncrRefCount(*ppHook);
+ }
+ }
+
+ sqlite3_update_hook(pDb->db, (pDb->pUpdateHook?DbUpdateHandler:0), pDb);
+ sqlite3_rollback_hook(pDb->db,(pDb->pRollbackHook?DbRollbackHandler:0),pDb);
+
break;
}
@@ -1849,7 +2001,6 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
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 ){
@@ -1917,14 +2068,6 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
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.
*/
@@ -1939,7 +2082,7 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
#ifdef SQLITE_MEMDEBUG
sqlite3_iMallocFail = mallocfail;
#endif
- }
+ }
#endif
p->interp = interp;
return TCL_OK;
@@ -1955,6 +2098,15 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
#endif
/*
+** Make sure we have a PACKAGE_VERSION macro defined. This will be
+** defined automatically by the TEA makefile. But other makefiles
+** do not define it.
+*/
+#ifndef PACKAGE_VERSION
+# define PACKAGE_VERSION SQLITE_VERSION
+#endif
+
+/*
** Initialize this module.
**
** This Tcl module contains only a single new Tcl command named "sqlite".
@@ -1963,23 +2115,23 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
** used to open a new SQLite database. See the DbMain() routine above
** for additional information.
*/
-int Sqlite3_Init(Tcl_Interp *interp){
+EXTERN 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_PkgProvide(interp, "sqlite3", PACKAGE_VERSION);
Tcl_CreateObjCommand(interp, "sqlite", (Tcl_ObjCmdProc*)DbMain, 0, 0);
- Tcl_PkgProvide(interp, "sqlite", "3.0");
+ Tcl_PkgProvide(interp, "sqlite", PACKAGE_VERSION);
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; }
+EXTERN int Tclsqlite3_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); }
+EXTERN int Sqlite3_SafeInit(Tcl_Interp *interp){ return TCL_OK; }
+EXTERN 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; }
+EXTERN int Sqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); }
+EXTERN int Tclsqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); }
+EXTERN int Sqlite_SafeInit(Tcl_Interp *interp){ return TCL_OK; }
+EXTERN int Tclsqlite_SafeInit(Tcl_Interp *interp){ return TCL_OK; }
#endif
#ifdef TCLSH
@@ -2040,14 +2192,26 @@ int TCLSH_MAIN(int argc, char **argv){
extern int Sqlitetest3_Init(Tcl_Interp*);
extern int Sqlitetest4_Init(Tcl_Interp*);
extern int Sqlitetest5_Init(Tcl_Interp*);
+ extern int Sqlitetest6_Init(Tcl_Interp*);
+ extern int Sqlitetest7_Init(Tcl_Interp*);
+ extern int Sqlitetest8_Init(Tcl_Interp*);
extern int Md5_Init(Tcl_Interp*);
extern int Sqlitetestsse_Init(Tcl_Interp*);
+ extern int Sqlitetestasync_Init(Tcl_Interp*);
+ extern int Sqlitetesttclvar_Init(Tcl_Interp*);
+ extern int Sqlitetestschema_Init(Tcl_Interp*);
Sqlitetest1_Init(interp);
Sqlitetest2_Init(interp);
Sqlitetest3_Init(interp);
Sqlitetest4_Init(interp);
Sqlitetest5_Init(interp);
+ Sqlitetest6_Init(interp);
+ Sqlitetest7_Init(interp);
+ Sqlitetest8_Init(interp);
+ Sqlitetestasync_Init(interp);
+ Sqlitetesttclvar_Init(interp);
+ Sqlitetestschema_Init(interp);
Md5_Init(interp);
#ifdef SQLITE_SSE
Sqlitetestsse_Init(interp);
diff --git a/ext/pdo_sqlite/sqlite/src/test1.c b/ext/pdo_sqlite/sqlite/src/test1.c
index ceac5cd6d..fd474b276 100644
--- a/ext/pdo_sqlite/sqlite/src/test1.c
+++ b/ext/pdo_sqlite/sqlite/src/test1.c
@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
-** Code for testing the printf() interface to SQLite. This code
+** Code for testing all sorts of SQLite interfaces. This code
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
@@ -21,6 +21,48 @@
#include <stdlib.h>
#include <string.h>
+/*
+** This is a copy of the first part of the SqliteDb structure in
+** tclsqlite.c. We need it here so that the get_sqlite_pointer routine
+** can extract the sqlite3* pointer from an existing Tcl SQLite
+** connection.
+*/
+struct SqliteDb {
+ sqlite3 *db;
+};
+
+/*
+** A TCL command that returns the address of the sqlite* pointer
+** for an sqlite connection instance. Bad things happen if the
+** input is not an sqlite connection.
+*/
+static int get_sqlite_pointer(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ struct SqliteDb *p;
+ Tcl_CmdInfo cmdInfo;
+ char zBuf[100];
+ if( objc!=2 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "SQLITE-CONNECTION");
+ return TCL_ERROR;
+ }
+ if( !Tcl_GetCommandInfo(interp, Tcl_GetString(objv[1]), &cmdInfo) ){
+ Tcl_AppendResult(interp, "command not found: ",
+ Tcl_GetString(objv[1]), (char*)0);
+ return TCL_ERROR;
+ }
+ p = (struct SqliteDb*)cmdInfo.objClientData;
+ sprintf(zBuf, "%p", p->db);
+ if( strncmp(zBuf,"0x",2) ){
+ sprintf(zBuf, "0x%p", p->db);
+ }
+ Tcl_AppendResult(interp, zBuf, 0);
+ return TCL_OK;
+}
+
const char *sqlite3TestErrorName(int rc){
const char *zName = 0;
switch( rc ){
@@ -124,7 +166,7 @@ static int getFilePointer(
** 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){
+int sqlite3TestMakePointerStr(Tcl_Interp *interp, char *zPtr, void *p){
sqlite3_snprintf(100, zPtr, "%p", p);
return TCL_OK;
}
@@ -180,7 +222,7 @@ static int test_exec_printf(
Tcl_AppendElement(interp, zBuf);
Tcl_AppendElement(interp, rc==SQLITE_OK ? Tcl_DStringValue(&str) : zErr);
Tcl_DStringFree(&str);
- if( zErr ) free(zErr);
+ if( zErr ) sqlite3_free(zErr);
if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
return TCL_OK;
}
@@ -188,7 +230,7 @@ static int test_exec_printf(
/*
** Usage: sqlite3_mprintf_z_test SEPARATOR ARG0 ARG1 ...
**
-** Test the %z format of mprintf(). Use multiple mprintf() calls to
+** Test the %z format of sqliteMPrintf(). Use multiple mprintf() calls to
** concatenate arg0 through argn using separator as the separator.
** Return the result.
*/
@@ -210,6 +252,26 @@ static int test_mprintf_z(
}
/*
+** Usage: sqlite3_mprintf_n_test STRING
+**
+** Test the %n format of sqliteMPrintf(). Return the length of the
+** input string.
+*/
+static int test_mprintf_n(
+ void *NotUsed,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int argc, /* Number of arguments */
+ char **argv /* Text of each argument */
+){
+ char *zStr;
+ int n = 0;
+ zStr = sqlite3MPrintf("%s%n", argv[1], &n);
+ sqliteFree(zStr);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(n));
+ return TCL_OK;
+}
+
+/*
** Usage: sqlite3_get_table_printf DB FORMAT STRING
**
** Invoke the sqlite3_get_table_printf() interface using the open database
@@ -255,7 +317,7 @@ static int test_get_table_printf(
Tcl_AppendElement(interp, zErr);
}
sqlite3_free_table(aResult);
- if( zErr ) free(zErr);
+ if( zErr ) sqlite3_free(zErr);
if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
return TCL_OK;
}
@@ -373,8 +435,8 @@ 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);
+ sqlite3_result_text(context, (char*)sqlite3_value_text(argv[i]),
+ sqlite3_value_bytes(argv[i]), SQLITE_TRANSIENT);
break;
}
}
@@ -446,8 +508,8 @@ static void sqlite3ExecFunc(
){
struct dstr x;
memset(&x, 0, sizeof(x));
- sqlite3_exec((sqlite3*)sqlite3_user_data(context),
- sqlite3_value_text(argv[0]),
+ (void)sqlite3_exec((sqlite3*)sqlite3_user_data(context),
+ (char*)sqlite3_value_text(argv[0]),
execFuncCallback, &x, 0);
sqlite3_result_text(context, x.z, x.nUsed, SQLITE_TRANSIENT);
sqliteFree(x.z);
@@ -492,6 +554,11 @@ static int test_create_function(
** because it is not tested anywhere else. */
if( rc==SQLITE_OK ){
sqlite3_value *pVal;
+#ifdef SQLITE_MEMDEBUG
+ if( sqlite3_iMallocFail>0 ){
+ sqlite3_iMallocFail++;
+ }
+#endif
pVal = sqlite3ValueNew();
sqlite3ValueSetStr(pVal, -1, "x_sqlite_exec", SQLITE_UTF8, SQLITE_STATIC);
rc = sqlite3_create_function16(db,
@@ -508,6 +575,14 @@ static int test_create_function(
/*
** Routines to implement the x_count() aggregate function.
+**
+** x_count() counts the number of non-null arguments. But there are
+** some twists for testing purposes.
+**
+** If the argument to x_count() is 40 then a UTF-8 error is reported
+** on the step function. If x_count(41) is seen, then a UTF-16 error
+** is reported on the step function. If the total count is 42, then
+** a UTF-8 error is reported on the finalize function.
*/
typedef struct CountCtx CountCtx;
struct CountCtx {
@@ -519,11 +594,28 @@ static void countStep(sqlite3_context *context, int argc, sqlite3_value **argv){
if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0]) ) && p ){
p->n++;
}
+ if( argc>0 ){
+ int v = sqlite3_value_int(argv[0]);
+ if( v==40 ){
+ sqlite3_result_error(context, "value of 40 handed to x_count", -1);
+#ifndef SQLITE_OMIT_UTF16
+ }else if( v==41 ){
+ const char zUtf16ErrMsg[] = { 0, 0x61, 0, 0x62, 0, 0x63, 0, 0, 0};
+ sqlite3_result_error16(context, &zUtf16ErrMsg[1-SQLITE_BIGENDIAN], -1);
+#endif
+ }
+ }
}
static void countFinalize(sqlite3_context *context){
CountCtx *p;
p = sqlite3_aggregate_context(context, sizeof(*p));
- sqlite3_result_int(context, p ? p->n : 0);
+ if( p ){
+ if( p->n==42 ){
+ sqlite3_result_error(context, "x_count totals to 42", -1);
+ }else{
+ sqlite3_result_int(context, p ? p->n : 0);
+ }
+ }
}
/*
@@ -535,7 +627,10 @@ static void countFinalize(sqlite3_context *context){
**
** 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.
+** to test the SQLITE_MISUSE detection logic. See misuse.test.
+**
+** This routine was later extended to test the use of sqlite3_result_error()
+** within aggregate functions.
*/
static int test_create_aggregate(
void *NotUsed,
@@ -787,7 +882,8 @@ static int sqlite3_mprintf_hexdouble(
** 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.
+** Turn off this mechanism and reset the sqlite3ThreadData()->mallocFailed
+** variable if N==0.
*/
#ifdef SQLITE_MEMDEBUG
static int sqlite_malloc_fail(
@@ -810,7 +906,6 @@ static int sqlite_malloc_fail(
}
sqlite3_iMallocFail = n;
sqlite3_iMallocReset = rep;
- sqlite3_malloc_failed = 0;
return TCL_OK;
}
#endif
@@ -828,13 +923,277 @@ static int sqlite_malloc_stat(
char **argv /* Text of each argument */
){
char zBuf[200];
- sprintf(zBuf, "%d %d %d", sqlite3_nMalloc, sqlite3_nFree, sqlite3_iMallocFail);
+ sprintf(zBuf, "%d %d %d", sqlite3_nMalloc,sqlite3_nFree,sqlite3_iMallocFail);
Tcl_AppendResult(interp, zBuf, 0);
return TCL_OK;
}
+
+/*
+** This function implements a Tcl command that may be invoked using any of
+** the four forms enumerated below.
+**
+** sqlite_malloc_outstanding
+** Return a summary of all unfreed blocks of memory allocated by the
+** current thread. See comments above function sqlite3OutstandingMallocs()
+** in util.c for a description of the returned value.
+**
+** sqlite_malloc_outstanding -bytes
+** Return the total amount of unfreed memory (in bytes) allocated by
+** this thread.
+**
+** sqlite_malloc_outstanding -maxbytes
+** Return the maximum amount of dynamic memory in use at one time
+** by this thread.
+**
+** sqlite_malloc_outstanding -clearmaxbytes
+** Set the value returned by [sqlite_malloc_outstanding -maxbytes]
+** to the current value of [sqlite_malloc_outstanding -bytes].
+*/
+static int sqlite_malloc_outstanding(
+ ClientData clientData,
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int objc, /* Number of arguments */
+ Tcl_Obj *CONST objv[] /* Command arguments */
+){
+ extern int sqlite3OutstandingMallocs(Tcl_Interp *interp);
+
+#if defined(SQLITE_DEBUG) && defined(SQLITE_MEMDEBUG) && SQLITE_MEMDEBUG>1
+ if( objc==2 ){
+ const char *zArg = Tcl_GetString(objv[1]);
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ ThreadData const *pTd = sqlite3ThreadDataReadOnly();
+ if( 0==strcmp(zArg, "-bytes") ){
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(pTd->nAlloc));
+ }else if( 0==strcmp(zArg, "-clearmaxbytes") ){
+ sqlite3_nMaxAlloc = pTd->nAlloc;
+ }else
+#endif
+ if( 0==strcmp(zArg, "-maxbytes") ){
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(sqlite3_nMaxAlloc));
+ }else{
+ Tcl_AppendResult(interp, "bad option \"", zArg,
+ "\": must be -bytes, -maxbytes or -clearmaxbytes", 0
+ );
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+ }
+
+ if( objc!=1 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "?-bytes?");
+ return TCL_ERROR;
+ }
+
+ return sqlite3OutstandingMallocs(interp);
+#else
+ return TCL_OK;
+#endif
+}
#endif
/*
+** Usage: sqlite3_enable_shared_cache BOOLEAN
+**
+*/
+#if !defined(SQLITE_OMIT_SHARED_CACHE)
+static int test_enable_shared(
+ ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int objc, /* Number of arguments */
+ Tcl_Obj *CONST objv[] /* Command arguments */
+){
+ int rc;
+ int enable;
+ int ret = 0;
+
+ if( objc!=2 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "BOOLEAN");
+ return TCL_ERROR;
+ }
+ if( Tcl_GetBooleanFromObj(interp, objv[1], &enable) ){
+ return TCL_ERROR;
+ }
+ ret = sqlite3ThreadDataReadOnly()->useSharedData;
+ rc = sqlite3_enable_shared_cache(enable);
+ if( rc!=SQLITE_OK ){
+ Tcl_SetResult(interp, (char *)sqlite3ErrStr(rc), TCL_STATIC);
+ return TCL_ERROR;
+ }
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(ret));
+ return TCL_OK;
+}
+#endif
+
+/*
+** Usage: sqlite3_libversion_number
+**
+*/
+static int test_libversion_number(
+ ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int objc, /* Number of arguments */
+ Tcl_Obj *CONST objv[] /* Command arguments */
+){
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_libversion_number()));
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_table_column_metadata DB dbname tblname colname
+**
+*/
+#ifdef SQLITE_ENABLE_COLUMN_METADATA
+static int test_table_column_metadata(
+ ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int objc, /* Number of arguments */
+ Tcl_Obj *CONST objv[] /* Command arguments */
+){
+ sqlite3 *db;
+ const char *zDb;
+ const char *zTbl;
+ const char *zCol;
+ int rc;
+ Tcl_Obj *pRet;
+
+ const char *zDatatype;
+ const char *zCollseq;
+ int notnull;
+ int primarykey;
+ int autoincrement;
+
+ if( objc!=5 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "DB dbname tblname colname");
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
+ zDb = Tcl_GetString(objv[2]);
+ zTbl = Tcl_GetString(objv[3]);
+ zCol = Tcl_GetString(objv[4]);
+
+ if( strlen(zDb)==0 ) zDb = 0;
+
+ rc = sqlite3_table_column_metadata(db, zDb, zTbl, zCol,
+ &zDatatype, &zCollseq, &notnull, &primarykey, &autoincrement);
+
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, sqlite3_errmsg(db), 0);
+ return TCL_ERROR;
+ }
+
+ pRet = Tcl_NewObj();
+ Tcl_ListObjAppendElement(0, pRet, Tcl_NewStringObj(zDatatype, -1));
+ Tcl_ListObjAppendElement(0, pRet, Tcl_NewStringObj(zCollseq, -1));
+ Tcl_ListObjAppendElement(0, pRet, Tcl_NewIntObj(notnull));
+ Tcl_ListObjAppendElement(0, pRet, Tcl_NewIntObj(primarykey));
+ Tcl_ListObjAppendElement(0, pRet, Tcl_NewIntObj(autoincrement));
+ Tcl_SetObjResult(interp, pRet);
+
+ return TCL_OK;
+}
+#endif
+
+
+/*
+** Usage: sqlite3_load_extension DB-HANDLE FILE ?PROC?
+*/
+static int test_load_extension(
+ ClientData clientData, /* Not used */
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int objc, /* Number of arguments */
+ Tcl_Obj *CONST objv[] /* Command arguments */
+){
+ Tcl_CmdInfo cmdInfo;
+ sqlite3 *db;
+ int rc;
+ char *zDb;
+ char *zFile;
+ char *zProc = 0;
+ char *zErr = 0;
+
+ if( objc!=4 && objc!=3 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "DB-HANDLE FILE ?PROC?");
+ return TCL_ERROR;
+ }
+ zDb = Tcl_GetString(objv[1]);
+ zFile = Tcl_GetString(objv[2]);
+ if( objc==4 ){
+ zProc = Tcl_GetString(objv[3]);
+ }
+
+ /* Extract the C database handle from the Tcl command name */
+ if( !Tcl_GetCommandInfo(interp, zDb, &cmdInfo) ){
+ Tcl_AppendResult(interp, "command not found: ", zDb, (char*)0);
+ return TCL_ERROR;
+ }
+ db = ((struct SqliteDb*)cmdInfo.objClientData)->db;
+ assert(db);
+
+ /* Call the underlying C function. If an error occurs, set rc to
+ ** TCL_ERROR and load any error string into the interpreter. If no
+ ** error occurs, set rc to TCL_OK.
+ */
+#ifdef SQLITE_OMIT_LOAD_EXTENSION
+ rc = SQLITE_ERROR;
+ zErr = sqlite3_mprintf("this build omits sqlite3_load_extension()");
+#else
+ rc = sqlite3_load_extension(db, zFile, zProc, &zErr);
+#endif
+ if( rc!=SQLITE_OK ){
+ Tcl_SetResult(interp, zErr ? zErr : "", TCL_VOLATILE);
+ rc = TCL_ERROR;
+ }else{
+ rc = TCL_OK;
+ }
+ sqlite3_free(zErr);
+
+ return rc;
+}
+
+/*
+** Usage: sqlite3_enable_load_extension DB-HANDLE ONOFF
+*/
+static int test_enable_load(
+ ClientData clientData, /* Not used */
+ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
+ int objc, /* Number of arguments */
+ Tcl_Obj *CONST objv[] /* Command arguments */
+){
+ Tcl_CmdInfo cmdInfo;
+ sqlite3 *db;
+ char *zDb;
+ int onoff;
+
+ if( objc!=3 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "DB-HANDLE ONOFF");
+ return TCL_ERROR;
+ }
+ zDb = Tcl_GetString(objv[1]);
+
+ /* Extract the C database handle from the Tcl command name */
+ if( !Tcl_GetCommandInfo(interp, zDb, &cmdInfo) ){
+ Tcl_AppendResult(interp, "command not found: ", zDb, (char*)0);
+ return TCL_ERROR;
+ }
+ db = ((struct SqliteDb*)cmdInfo.objClientData)->db;
+ assert(db);
+
+ /* Get the onoff parameter */
+ if( Tcl_GetBooleanFromObj(interp, objv[2], &onoff) ){
+ return TCL_ERROR;
+ }
+
+#ifdef SQLITE_OMIT_LOAD_EXTENSION
+ Tcl_AppendResult(interp, "this build omits sqlite3_load_extension()");
+ return TCL_ERROR;
+#else
+ sqlite3_enable_load_extension(db, onoff);
+ return TCL_OK;
+#endif
+}
+
+/*
** Usage: sqlite_abort
**
** Shutdown the process immediately. This is not a clean shutdown.
@@ -857,14 +1216,14 @@ static int sqlite_abort(
*/
static void testFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
while( argc>=2 ){
- const char *zArg0 = sqlite3_value_text(argv[0]);
+ const char *zArg0 = (char*)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,
+ sqlite3_result_text(context, (char*)sqlite3_value_text(argv[1]), -1,
SQLITE_TRANSIENT);
}else if( sqlite3StrICmp(zArg0,"double")==0 ){
sqlite3_result_double(context, sqlite3_value_double(argv[1]));
@@ -952,7 +1311,7 @@ static int test_finalize(
/*
** Usage: sqlite3_reset STMT
**
-** Finalize a statement handle.
+** Reset a statement handle.
*/
static int test_reset(
void * clientData,
@@ -972,12 +1331,15 @@ static int test_reset(
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;
+ 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;
}
@@ -1064,7 +1426,8 @@ static char *sqlite_static_bind_value = 0;
** 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.
+** of the VALUE is made. If FLAGS=="blob10" then a VALUE is ignored
+** an a 10-byte blob "abc\000xyz\000pq" is inserted.
*/
static int test_bind(
void *NotUsed,
@@ -1088,6 +1451,8 @@ static int test_bind(
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 if( strcmp(argv[4],"blob10")==0 ){
+ rc = sqlite3_bind_text(pStmt, idx, "abc\000xyz\000pq", 10, SQLITE_STATIC);
}else{
Tcl_AppendResult(interp, "4th argument should be "
"\"null\" or \"static\" or \"normal\"", 0);
@@ -1166,10 +1531,12 @@ static int test_collate_func(
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));
+ Tcl_ListObjAppendElement(i,pX,
+ Tcl_NewStringObj((char*)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));
+ Tcl_ListObjAppendElement(i,pX,
+ Tcl_NewStringObj((char*)sqlite3_value_text(pVal),n));
sqlite3ValueFree(pVal);
Tcl_EvalObjEx(i, pX, 0);
@@ -1201,13 +1568,24 @@ static int test_collate(
(void *)SQLITE_UTF16LE, val?test_collate_func:0);
if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[4], &val) ) return TCL_ERROR;
+#ifdef SQLITE_MEMDEBUG
+ if( sqlite3_iMallocFail>0 ){
+ sqlite3_iMallocFail++;
+ }
+#endif
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);
+ rc = 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;
+
+ if( rc!=SQLITE_OK ){
+ Tcl_AppendResult(interp, sqlite3TestErrorName(rc), 0);
+ return TCL_ERROR;
+ }
return TCL_OK;
bad_args:
@@ -1216,15 +1594,35 @@ bad_args:
return TCL_ERROR;
}
+/*
+** When the collation needed callback is invoked, record the name of
+** the requested collating function here. The recorded name is linked
+** to a TCL variable and used to make sure that the requested collation
+** name is correct.
+*/
+static char zNeededCollation[200];
+static char *pzNeededCollation = zNeededCollation;
+
+
+/*
+** Called when a collating sequence is needed. Registered using
+** sqlite3_collation_needed16().
+*/
static void test_collate_needed_cb(
void *pCtx,
sqlite3 *db,
int eTextRep,
- const void *notUsed
+ const void *pName
){
- int enc = db->enc;
+ int enc = ENC(db);
+ int i;
+ char *z;
+ for(z = (char*)pName, i=0; *z || z[1]; z++){
+ if( *z ) zNeededCollation[i++] = *z;
+ }
+ zNeededCollation[i] = 0;
sqlite3_create_collation(
- db, "test_collate", db->enc, (void *)enc, test_collate_func);
+ db, "test_collate", ENC(db), (void *)enc, test_collate_func);
}
/*
@@ -1242,6 +1640,7 @@ static int test_collate_needed(
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);
+ zNeededCollation[0] = 0;
if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
return TCL_OK;
@@ -1249,7 +1648,56 @@ bad_args:
Tcl_WrongNumArgs(interp, 1, objv, "DB");
return TCL_ERROR;
}
-#endif /* SQLITE_OMIT_UTF16 */
+
+/*
+** tclcmd: add_alignment_test_collations DB
+**
+** Add two new collating sequences to the database DB
+**
+** utf16_aligned
+** utf16_unaligned
+**
+** Both collating sequences use the same sort order as BINARY.
+** The only difference is that the utf16_aligned collating
+** sequence is declared with the SQLITE_UTF16_ALIGNED flag.
+** Both collating functions increment the unaligned utf16 counter
+** whenever they see a string that begins on an odd byte boundary.
+*/
+static int unaligned_string_counter = 0;
+static int alignmentCollFunc(
+ void *NotUsed,
+ int nKey1, const void *pKey1,
+ int nKey2, const void *pKey2
+){
+ int rc, n;
+ n = nKey1<nKey2 ? nKey1 : nKey2;
+ if( nKey1>0 && 1==(1&(int)pKey1) ) unaligned_string_counter++;
+ if( nKey2>0 && 1==(1&(int)pKey2) ) unaligned_string_counter++;
+ rc = memcmp(pKey1, pKey2, n);
+ if( rc==0 ){
+ rc = nKey1 - nKey2;
+ }
+ return rc;
+}
+static int add_alignment_test_collations(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3 *db;
+ if( objc>=2 ){
+ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
+ sqlite3_create_collation(db, "utf16_unaligned",
+ SQLITE_UTF16,
+ 0, alignmentCollFunc);
+ sqlite3_create_collation(db, "utf16_aligned",
+ SQLITE_UTF16 | SQLITE_UTF16_ALIGNED,
+ 0, alignmentCollFunc);
+ }
+ return SQLITE_OK;
+}
+#endif /* !defined(SQLITE_OMIT_UTF16) */
/*
** Usage: add_test_function <db ptr> <utf8> <utf16le> <utf16be>
@@ -1290,7 +1738,7 @@ static void test_function_utf8(
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_NewStringObj((char*)sqlite3_value_text(argv[0]), -1));
Tcl_EvalObjEx(interp, pX, 0);
Tcl_DecrRefCount(pX);
sqlite3_result_text(pCtx, Tcl_GetStringResult(interp), -1, SQLITE_TRANSIENT);
@@ -1314,13 +1762,13 @@ static void test_function_utf16le(
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_NewStringObj((char*)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);
+ sqlite3_result_text(pCtx,(char*)sqlite3_value_text(pVal),-1,SQLITE_TRANSIENT);
sqlite3ValueFree(pVal);
}
static void test_function_utf16be(
@@ -1336,7 +1784,7 @@ static void test_function_utf16be(
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_NewStringObj((char*)sqlite3_value_text(argv[0]), -1));
Tcl_EvalObjEx(interp, pX, 0);
Tcl_DecrRefCount(pX);
pVal = sqlite3ValueNew();
@@ -1412,29 +1860,6 @@ static int test_errstr(
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
**
@@ -1647,7 +2072,7 @@ static int test_bind_text(
}
/*
-** Usage: sqlite3_bind_text16 STMT N STRING BYTES
+** Usage: sqlite3_bind_text16 ?-static? 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
@@ -1667,18 +2092,24 @@ static int test_bind_text16(
char *value;
int rc;
- if( objc!=5 ){
+ void (*xDel)() = (objc==6?SQLITE_STATIC:SQLITE_TRANSIENT);
+ Tcl_Obj *oStmt = objv[objc-4];
+ Tcl_Obj *oN = objv[objc-3];
+ Tcl_Obj *oString = objv[objc-2];
+ Tcl_Obj *oBytes = objv[objc-1];
+
+ if( objc!=5 && objc!=6){
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;
+ if( getStmtPointer(interp, Tcl_GetString(oStmt), &pStmt) ) return TCL_ERROR;
+ if( Tcl_GetIntFromObj(interp, oN, &idx) ) return TCL_ERROR;
+ value = (char*)Tcl_GetByteArrayFromObj(oString, 0);
+ if( Tcl_GetIntFromObj(interp, oBytes, &bytes) ) return TCL_ERROR;
- rc = sqlite3_bind_text16(pStmt, idx, (void *)value, bytes, SQLITE_TRANSIENT);
+ rc = sqlite3_bind_text16(pStmt, idx, (void *)value, bytes, xDel);
if( sqlite3TestErrCode(interp, StmtToDb(pStmt), rc) ) return TCL_ERROR;
if( rc!=SQLITE_OK ){
return TCL_ERROR;
@@ -1808,7 +2239,6 @@ static int test_bind_parameter_index(
** Usage: sqlite3_clear_bindings STMT
**
*/
-#if 0
static int test_clear_bindings(
void * clientData,
Tcl_Interp *interp,
@@ -1825,7 +2255,28 @@ static int test_clear_bindings(
Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_clear_bindings(pStmt)));
return TCL_OK;
}
-#endif
+
+/*
+** Usage: sqlite3_sleep MILLISECONDS
+*/
+static int test_sleep(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ int ms;
+
+ if( objc!=2 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "MILLISECONDS");
+ return TCL_ERROR;
+ }
+ if( Tcl_GetIntFromObj(interp, objv[1], &ms) ){
+ return TCL_ERROR;
+ }
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_sleep(ms)));
+ return TCL_OK;
+}
/*
** Usage: sqlite3_errcode DB
@@ -1895,7 +2346,7 @@ static int test_errmsg16(
#ifndef SQLITE_OMIT_UTF16
sqlite3 *db;
const void *zErr;
- int bytes;
+ int bytes = 0;
if( objc!=2 ){
Tcl_AppendResult(interp, "wrong # args: should be \"",
@@ -1905,7 +2356,9 @@ static int test_errmsg16(
if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
zErr = sqlite3_errmsg16(db);
- bytes = sqlite3utf16ByteLen(zErr, -1);
+ if( zErr ){
+ bytes = sqlite3utf16ByteLen(zErr, -1);
+ }
Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(zErr, bytes));
#endif /* SQLITE_OMIT_UTF16 */
return TCL_OK;
@@ -1958,7 +2411,7 @@ static int test_prepare(
}
if( pStmt ){
- if( makePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR;
+ if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR;
Tcl_AppendResult(interp, zBuf, 0);
}
return TCL_OK;
@@ -2015,7 +2468,7 @@ static int test_prepare16(
Tcl_DecrRefCount(pTail);
if( pStmt ){
- if( makePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR;
+ if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR;
}
Tcl_AppendResult(interp, zBuf, 0);
#endif /* SQLITE_OMIT_UTF16 */
@@ -2045,7 +2498,7 @@ static int test_open(
zFilename = Tcl_GetString(objv[1]);
rc = sqlite3_open(zFilename, &db);
- if( makePointerStr(interp, zBuf, db) ) return TCL_ERROR;
+ if( sqlite3TestMakePointerStr(interp, zBuf, db) ) return TCL_ERROR;
Tcl_AppendResult(interp, zBuf, 0);
return TCL_OK;
}
@@ -2074,7 +2527,7 @@ static int test_open16(
zFilename = Tcl_GetByteArrayFromObj(objv[1], 0);
rc = sqlite3_open16(zFilename, &db);
- if( makePointerStr(interp, zBuf, db) ) return TCL_ERROR;
+ if( sqlite3TestMakePointerStr(interp, zBuf, db) ) return TCL_ERROR;
Tcl_AppendResult(interp, zBuf, 0);
#endif /* SQLITE_OMIT_UTF16 */
return TCL_OK;
@@ -2100,7 +2553,7 @@ static int test_complete16(
return TCL_ERROR;
}
- zBuf = Tcl_GetByteArrayFromObj(objv[1], 0);
+ zBuf = (char*)Tcl_GetByteArrayFromObj(objv[1], 0);
Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_complete16(zBuf)));
#endif /* SQLITE_OMIT_COMPLETE && SQLITE_OMIT_UTF16 */
return TCL_OK;
@@ -2452,7 +2905,7 @@ static int test_sqlite3OsOpenReadWrite(
int objc,
Tcl_Obj *CONST objv[]
){
- OsFile * pFile;
+ OsFile *pFile;
int rc;
int dummy;
char zBuf[100];
@@ -2463,14 +2916,12 @@ static int test_sqlite3OsOpenReadWrite(
return TCL_ERROR;
}
- pFile = sqliteMalloc(sizeof(OsFile));
- rc = sqlite3OsOpenReadWrite(Tcl_GetString(objv[1]), pFile, &dummy);
+ 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);
+ sqlite3TestMakePointerStr(interp, zBuf, pFile);
Tcl_SetResult(interp, zBuf, 0);
return TCL_ERROR;
}
@@ -2484,7 +2935,7 @@ static int test_sqlite3OsClose(
int objc,
Tcl_Obj *CONST objv[]
){
- OsFile * pFile;
+ OsFile *pFile;
int rc;
if( objc!=2 ){
@@ -2496,12 +2947,11 @@ static int test_sqlite3OsClose(
if( getFilePointer(interp, Tcl_GetString(objv[1]), &pFile) ){
return TCL_ERROR;
}
- rc = sqlite3OsClose(pFile);
+ rc = sqlite3OsClose(&pFile);
if( rc!=SQLITE_OK ){
Tcl_SetResult(interp, (char *)errorName(rc), TCL_STATIC);
return TCL_ERROR;
}
- sqliteFree(pFile);
return TCL_OK;
}
@@ -2697,7 +3147,7 @@ static int test_stack_used(
}
if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
prepStack();
- sqlite3_exec(db, argv[2], 0, 0, 0);
+ (void)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;
@@ -2781,6 +3231,33 @@ static int get_autocommit(
}
/*
+** Usage: sqlite3_busy_timeout DB MS
+**
+** Set the busy timeout. This is more easily done using the timeout
+** method of the TCL interface. But we need a way to test the case
+** where it returns SQLITE_MISUSE.
+*/
+static int test_busy_timeout(
+ void * clientData,
+ Tcl_Interp *interp,
+ int argc,
+ char **argv
+){
+ int rc, ms;
+ sqlite3 *db;
+ if( argc!=3 ){
+ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+ " DB", 0);
+ return TCL_ERROR;
+ }
+ if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
+ if( Tcl_GetInt(interp, argv[2], &ms) ) return TCL_ERROR;
+ rc = sqlite3_busy_timeout(db, ms);
+ Tcl_AppendResult(interp, sqlite3TestErrorName(rc), 0);
+ return TCL_OK;
+}
+
+/*
** Usage: tcl_variable_type VARIABLENAME
**
** Return the name of the internal representation for the
@@ -2806,6 +3283,115 @@ static int tcl_variable_type(
}
/*
+** Usage: sqlite3_release_memory ?N?
+**
+** Attempt to release memory currently held but not actually required.
+** The integer N is the number of bytes we are trying to release. The
+** return value is the amount of memory actually released.
+*/
+static int test_release_memory(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) && !defined(SQLITE_OMIT_DISKIO)
+ int N;
+ int amt;
+ if( objc!=1 && objc!=2 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "?N?");
+ return TCL_ERROR;
+ }
+ if( objc==2 ){
+ if( Tcl_GetIntFromObj(interp, objv[1], &N) ) return TCL_ERROR;
+ }else{
+ N = -1;
+ }
+ amt = sqlite3_release_memory(N);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(amt));
+#endif
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_soft_heap_limit ?N?
+**
+** Query or set the soft heap limit for the current thread. The
+** limit is only changed if the N is present. The previous limit
+** is returned.
+*/
+static int test_soft_heap_limit(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) && !defined(SQLITE_OMIT_DISKIO)
+ int amt;
+ if( objc!=1 && objc!=2 ){
+ Tcl_WrongNumArgs(interp, 1, objv, "?N?");
+ return TCL_ERROR;
+ }
+ amt = sqlite3ThreadDataReadOnly()->nSoftHeapLimit;
+ if( objc==2 ){
+ int N;
+ if( Tcl_GetIntFromObj(interp, objv[1], &N) ) return TCL_ERROR;
+ sqlite3_soft_heap_limit(N);
+ }
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(amt));
+#endif
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_clear_tsd_memdebug
+**
+** Clear all of the MEMDEBUG information out of thread-specific data.
+** This will allow it to be deallocated.
+*/
+static int test_clear_tsd_memdebug(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_tsd_release
+**
+** Call sqlite3ReleaseThreadData.
+*/
+static int test_tsd_release(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+#if defined(SQLITE_MEMDEBUG)
+ sqlite3ReleaseThreadData();
+#endif
+ return TCL_OK;
+}
+
+/*
+** Usage: sqlite3_thread_cleanup
+**
+** Call the sqlite3_thread_cleanup API.
+*/
+static int test_thread_cleanup(
+ void * clientData,
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *CONST objv[]
+){
+ sqlite3_thread_cleanup();
+ 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.
@@ -2823,6 +3409,18 @@ static void set_options(Tcl_Interp *interp){
Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","0",TCL_GLOBAL_ONLY);
#endif
+#ifdef SQLITE_DISABLE_DIRSYNC
+ Tcl_SetVar2(interp, "sqlite_options", "dirsync", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "dirsync", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_DISABLE_LFS
+ Tcl_SetVar2(interp, "sqlite_options", "lfs", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "lfs", "1", TCL_GLOBAL_ONLY);
+#endif
+
#ifdef SQLITE_OMIT_ALTERTABLE
Tcl_SetVar2(interp, "sqlite_options", "altertable", "0", TCL_GLOBAL_ONLY);
#else
@@ -2876,6 +3474,18 @@ static void set_options(Tcl_Interp *interp){
Tcl_SetVar2(interp, "sqlite_options", "cast", "1", TCL_GLOBAL_ONLY);
#endif
+#ifdef SQLITE_OMIT_CHECK
+ Tcl_SetVar2(interp, "sqlite_options", "check", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "check", "1", TCL_GLOBAL_ONLY);
+#endif
+
+#ifdef SQLITE_ENABLE_COLUMN_METADATA
+ Tcl_SetVar2(interp, "sqlite_options", "columnmetadata", "1", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "columnmetadata", "0", TCL_GLOBAL_ONLY);
+#endif
+
#ifdef SQLITE_OMIT_COMPLETE
Tcl_SetVar2(interp, "sqlite_options", "complete", "0", TCL_GLOBAL_ONLY);
#else
@@ -2894,6 +3504,12 @@ static void set_options(Tcl_Interp *interp){
Tcl_SetVar2(interp, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY);
#endif
+#if OS_UNIX
+ Tcl_SetVar2(interp, "sqlite_options", "crashtest", "1", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "crashtest", "0", TCL_GLOBAL_ONLY);
+#endif
+
#ifdef SQLITE_OMIT_DATETIME_FUNCS
Tcl_SetVar2(interp, "sqlite_options", "datetime", "0", TCL_GLOBAL_ONLY);
#else
@@ -2936,6 +3552,12 @@ static void set_options(Tcl_Interp *interp){
Tcl_SetVar2(interp, "sqlite_options", "integrityck", "1", TCL_GLOBAL_ONLY);
#endif
+#if defined(SQLITE_DEFAULT_FILE_FORMAT) && SQLITE_DEFAULT_FILE_FORMAT==1
+ Tcl_SetVar2(interp, "sqlite_options", "legacyformat", "1", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "legacyformat", "0", TCL_GLOBAL_ONLY);
+#endif
+
#ifdef SQLITE_OMIT_LIKE_OPTIMIZATION
Tcl_SetVar2(interp, "sqlite_options", "like_opt", "0", TCL_GLOBAL_ONLY);
#else
@@ -2948,6 +3570,12 @@ static void set_options(Tcl_Interp *interp){
Tcl_SetVar2(interp, "sqlite_options", "memorydb", "1", TCL_GLOBAL_ONLY);
#endif
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "1", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "0", TCL_GLOBAL_ONLY);
+#endif
+
#ifdef SQLITE_OMIT_OR_OPTIMIZATION
Tcl_SetVar2(interp, "sqlite_options", "or_opt", "0", TCL_GLOBAL_ONLY);
#else
@@ -2979,6 +3607,12 @@ static void set_options(Tcl_Interp *interp){
Tcl_SetVar2(interp, "sqlite_options", "progress", "1", TCL_GLOBAL_ONLY);
#endif
+#ifdef SQLITE_ENABLE_REDEF_IO
+ Tcl_SetVar2(interp, "sqlite_options", "redefio", "1", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "redefio", "0", TCL_GLOBAL_ONLY);
+#endif
+
#ifdef SQLITE_OMIT_REINDEX
Tcl_SetVar2(interp, "sqlite_options", "reindex", "0", TCL_GLOBAL_ONLY);
#else
@@ -2997,6 +3631,12 @@ static void set_options(Tcl_Interp *interp){
Tcl_SetVar2(interp, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY);
#endif
+#ifdef SQLITE_OMIT_SHARED_CACHE
+ Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "1", TCL_GLOBAL_ONLY);
+#endif
+
#ifdef SQLITE_OMIT_SUBQUERY
Tcl_SetVar2(interp, "sqlite_options", "subquery", "0", TCL_GLOBAL_ONLY);
#else
@@ -3050,6 +3690,12 @@ static void set_options(Tcl_Interp *interp){
#else
Tcl_SetVar2(interp, "sqlite_options", "view", "1", TCL_GLOBAL_ONLY);
#endif
+
+#ifdef SQLITE_OMIT_VIRTUALTABLE
+ Tcl_SetVar2(interp, "sqlite_options", "vtab", "0", TCL_GLOBAL_ONLY);
+#else
+ Tcl_SetVar2(interp, "sqlite_options", "vtab", "1", TCL_GLOBAL_ONLY);
+#endif
}
/*
@@ -3073,6 +3719,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "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_mprintf_n_test", (Tcl_CmdProc*)test_mprintf_n },
{ "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 },
@@ -3091,19 +3738,18 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "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 },
+ { "sqlite3_busy_timeout", (Tcl_CmdProc*)test_busy_timeout },
};
static struct {
char *zName;
Tcl_ObjCmdProc *xProc;
void *clientData;
} aObjCmd[] = {
+ { "sqlite3_connection_pointer", get_sqlite_pointer, 0 },
{ "sqlite3_bind_int", test_bind_int, 0 },
{ "sqlite3_bind_int64", test_bind_int64, 0 },
{ "sqlite3_bind_double", test_bind_double, 0 },
@@ -3114,9 +3760,8 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "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_sleep", test_sleep, 0},
{ "sqlite3_errcode", test_errcode ,0 },
{ "sqlite3_errmsg", test_errmsg ,0 },
{ "sqlite3_errmsg16", test_errmsg16 ,0 },
@@ -3133,6 +3778,15 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "sqlite3_changes", test_changes ,0 },
{ "sqlite3_step", test_step ,0 },
+ { "sqlite3_release_memory", test_release_memory, 0},
+ { "sqlite3_soft_heap_limit", test_soft_heap_limit, 0},
+ { "sqlite3_clear_tsd_memdebug", test_clear_tsd_memdebug, 0},
+ { "sqlite3_tsd_release", test_tsd_release, 0},
+ { "sqlite3_thread_cleanup", test_thread_cleanup, 0},
+
+ { "sqlite3_load_extension", test_load_extension, 0},
+ { "sqlite3_enable_load_extension", test_enable_load, 0},
+
/* sqlite3_column_*() API */
{ "sqlite3_column_count", test_column_count ,0 },
{ "sqlite3_data_count", test_data_count ,0 },
@@ -3145,11 +3799,24 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "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 },
+#ifdef SQLITE_ENABLE_COLUMN_METADATA
+{ "sqlite3_column_database_name", test_stmt_utf8, sqlite3_column_database_name},
+{ "sqlite3_column_table_name", test_stmt_utf8, sqlite3_column_table_name},
+{ "sqlite3_column_origin_name", test_stmt_utf8, sqlite3_column_origin_name},
+#endif
+
#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 },
+ { "add_alignment_test_collations", add_alignment_test_collations, 0 },
+#ifdef SQLITE_ENABLE_COLUMN_METADATA
+{"sqlite3_column_database_name16",
+ test_stmt_utf16, sqlite3_column_database_name16},
+{"sqlite3_column_table_name16", test_stmt_utf16, sqlite3_column_table_name16},
+{"sqlite3_column_origin_name16", test_stmt_utf16, sqlite3_column_origin_name16},
+#endif
#endif
{ "sqlite3_global_recover", test_global_recover, 0 },
@@ -3168,9 +3835,18 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "add_test_collate_needed", test_collate_needed, 0 },
{ "add_test_function", test_function, 0 },
#endif
- { "sqlite3_crashparams", sqlite3_crashparams, 0 },
+#ifdef SQLITE_MEMDEBUG
+ { "sqlite_malloc_outstanding", sqlite_malloc_outstanding, 0},
+#endif
{ "sqlite3_test_errstr", test_errstr, 0 },
{ "tcl_variable_type", tcl_variable_type, 0 },
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ { "sqlite3_enable_shared_cache", test_enable_shared, 0 },
+#endif
+ { "sqlite3_libversion_number", test_libversion_number, 0 },
+#ifdef SQLITE_ENABLE_COLUMN_METADATA
+ { "sqlite3_table_column_metadata", test_table_column_metadata, 0 },
+#endif
};
static int bitmask_size = sizeof(Bitmask)*8;
int i;
@@ -3179,8 +3855,13 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
extern int sqlite3_sync_count, sqlite3_fullsync_count;
extern int sqlite3_opentemp_count;
extern int sqlite3_memUsed;
+ extern int sqlite3_malloc_id;
extern int sqlite3_memMax;
extern int sqlite3_like_count;
+ extern int sqlite3_tsd_count;
+#if OS_UNIX && defined(SQLITE_TEST) && defined(THREADSAFE) && THREADSAFE
+ extern int threadsOverrideEachOthersLocks;
+#endif
#if OS_WIN
extern int sqlite3_os_type;
#endif
@@ -3213,6 +3894,24 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
(char*)&sqlite3_current_time, TCL_LINK_INT);
Tcl_LinkVar(interp, "sqlite_os_trace",
(char*)&sqlite3_os_trace, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite3_tsd_count",
+ (char*)&sqlite3_tsd_count, TCL_LINK_INT);
+#ifndef SQLITE_OMIT_UTF16
+ Tcl_LinkVar(interp, "unaligned_string_counter",
+ (char*)&unaligned_string_counter, TCL_LINK_INT);
+#endif
+#if OS_UNIX && defined(SQLITE_TEST) && defined(THREADSAFE) && THREADSAFE
+ Tcl_LinkVar(interp, "threadsOverrideEachOthersLocks",
+ (char*)&threadsOverrideEachOthersLocks, TCL_LINK_INT);
+#endif
+#ifndef SQLITE_OMIT_UTF16
+ Tcl_LinkVar(interp, "sqlite_last_needed_collation",
+ (char*)&pzNeededCollation, TCL_LINK_STRING|TCL_LINK_READ_ONLY);
+#endif
+#ifdef SQLITE_MEMDEBUG
+ Tcl_LinkVar(interp, "sqlite_malloc_id",
+ (char*)&sqlite3_malloc_id, TCL_LINK_STRING);
+#endif
#if OS_WIN
Tcl_LinkVar(interp, "sqlite_os_type",
(char*)&sqlite3_os_type, TCL_LINK_INT);
@@ -3250,5 +3949,14 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
(char*)&sqlite3_fullsync_count, TCL_LINK_INT);
#endif /* OS_UNIX */
set_options(interp);
+
+ {
+#ifdef SQLITE_DEBUG
+ extern int sqlite3_shared_cache_report(void *, Tcl_Interp *,
+ int, Tcl_Obj *CONST[]);
+ Tcl_CreateObjCommand(interp, "sqlite_shared_cache_report",
+ sqlite3_shared_cache_report, 0, 0);
+#endif
+ }
return TCL_OK;
}
diff --git a/ext/pdo_sqlite/sqlite/src/test2.c b/ext/pdo_sqlite/sqlite/src/test2.c
index d4c5544b6..80e57cd87 100644
--- a/ext/pdo_sqlite/sqlite/src/test2.c
+++ b/ext/pdo_sqlite/sqlite/src/test2.c
@@ -524,7 +524,7 @@ static int fake_big_file(
int rc;
int n;
i64 offset;
- OsFile fd;
+ OsFile *fd = 0;
int readOnly = 0;
if( argc!=3 ){
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -532,7 +532,6 @@ static int fake_big_file(
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);
@@ -540,12 +539,12 @@ static int fake_big_file(
}
offset = n;
offset *= 1024*1024;
- rc = sqlite3OsSeek(&fd, offset);
+ rc = sqlite3OsSeek(fd, offset);
if( rc ){
Tcl_AppendResult(interp, "seek failed: ", errorName(rc), 0);
return TCL_ERROR;
}
- rc = sqlite3OsWrite(&fd, "Hello, World!", 14);
+ rc = sqlite3OsWrite(fd, "Hello, World!", 14);
sqlite3OsClose(&fd);
if( rc ){
Tcl_AppendResult(interp, "write failed: ", errorName(rc), 0);
@@ -560,6 +559,7 @@ static int fake_big_file(
*/
int Sqlitetest2_Init(Tcl_Interp *interp){
extern int sqlite3_io_error_pending;
+ extern int sqlite3_io_error_hit;
extern int sqlite3_diskfull_pending;
extern int sqlite3_diskfull;
static struct {
@@ -592,6 +592,8 @@ int Sqlitetest2_Init(Tcl_Interp *interp){
}
Tcl_LinkVar(interp, "sqlite_io_error_pending",
(char*)&sqlite3_io_error_pending, TCL_LINK_INT);
+ Tcl_LinkVar(interp, "sqlite_io_error_hit",
+ (char*)&sqlite3_io_error_hit, TCL_LINK_INT);
Tcl_LinkVar(interp, "sqlite_diskfull_pending",
(char*)&sqlite3_diskfull_pending, TCL_LINK_INT);
Tcl_LinkVar(interp, "sqlite_diskfull",
diff --git a/ext/pdo_sqlite/sqlite/src/test3.c b/ext/pdo_sqlite/sqlite/src/test3.c
index 6b973a147..6557fb4f4 100644
--- a/ext/pdo_sqlite/sqlite/src/test3.c
+++ b/ext/pdo_sqlite/sqlite/src/test3.c
@@ -69,7 +69,7 @@ static int btree_open(
}
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);
+ rc = sqlite3BtreeOpen(argv[1], 0, &pBt, flags);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR;
@@ -585,6 +585,7 @@ static int btree_integrity_check(
#else
zResult = 0;
#endif
+ free(aRoot);
if( zResult ){
Tcl_AppendResult(interp, zResult, 0);
sqliteFree(zResult);
@@ -597,6 +598,7 @@ static int btree_integrity_check(
**
** Print information about all cursors to standard output for debugging.
*/
+#ifdef SQLITE_DEBUG
static int btree_cursor_list(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
@@ -614,6 +616,7 @@ static int btree_cursor_list(
sqlite3BtreeCursorList(pBt);
return SQLITE_OK;
}
+#endif
/*
** Usage: btree_cursor ID TABLENUM WRITEABLE
@@ -972,7 +975,7 @@ static int btree_keysize(
return TCL_ERROR;
}
pCur = sqlite3TextToPtr(argv[1]);
- sqlite3BtreeKeySize(pCur, &n);
+ sqlite3BtreeKeySize(pCur, (i64*)&n);
sqlite3_snprintf(sizeof(zBuf),zBuf, "%llu", n);
Tcl_AppendResult(interp, zBuf, 0);
return SQLITE_OK;
@@ -1000,7 +1003,7 @@ static int btree_key(
return TCL_ERROR;
}
pCur = sqlite3TextToPtr(argv[1]);
- sqlite3BtreeKeySize(pCur, &n);
+ sqlite3BtreeKeySize(pCur, (i64*)&n);
if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
char zBuf2[60];
sqlite3_snprintf(sizeof(zBuf2),zBuf2, "%llu", n);
@@ -1084,7 +1087,7 @@ static int btree_fetch_key(
}
pCur = sqlite3TextToPtr(argv[1]);
if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
- sqlite3BtreeKeySize(pCur, &nKey);
+ sqlite3BtreeKeySize(pCur, (i64*)&nKey);
zBuf = sqlite3BtreeKeyFetch(pCur, &amt);
if( zBuf && amt>=n ){
assert( nKey<sizeof(zStatic) );
@@ -1159,9 +1162,9 @@ static int btree_payload_size(
if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
n1 = 0;
}else{
- sqlite3BtreeKeySize(pCur, &n1);
+ sqlite3BtreeKeySize(pCur, (i64*)&n1);
}
- sqlite3BtreeDataSize(pCur, &n2);
+ sqlite3BtreeDataSize(pCur, (u32*)&n2);
sqlite3_snprintf(sizeof(zBuf),zBuf, "%d", (int)(n1+n2));
Tcl_AppendResult(interp, zBuf, 0);
return SQLITE_OK;
@@ -1184,6 +1187,7 @@ static int btree_payload_size(
** aResult[8] = Local payload size
** aResult[9] = Parent page number
*/
+#ifdef SQLITE_DEBUG
static int btree_cursor_info(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
@@ -1221,6 +1225,7 @@ static int btree_cursor_info(
Tcl_AppendResult(interp, &zBuf[1], 0);
return SQLITE_OK;
}
+#endif
/*
** The command is provided for the purpose of setting breakpoints.
@@ -1428,8 +1433,6 @@ int Sqlitetest3_Init(Tcl_Interp *interp){
{ "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 },
@@ -1438,6 +1441,10 @@ int Sqlitetest3_Init(Tcl_Interp *interp){
{ "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 },
+#ifdef SQLITE_DEBUG
+ { "btree_cursor_info", (Tcl_CmdProc*)btree_cursor_info },
+ { "btree_cursor_list", (Tcl_CmdProc*)btree_cursor_list },
+#endif
};
int i;
diff --git a/ext/pdo_sqlite/sqlite/src/test4.c b/ext/pdo_sqlite/sqlite/src/test4.c
index 45991ba3a..a7af48299 100644
--- a/ext/pdo_sqlite/sqlite/src/test4.c
+++ b/ext/pdo_sqlite/sqlite/src/test4.c
@@ -97,6 +97,7 @@ static void *thread_main(void *pArg){
p->zErr = 0;
}
p->completed++;
+ sqlite3_thread_cleanup();
return 0;
}
@@ -495,7 +496,7 @@ static void do_step(Thread *p){
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);
+ p->argv[i] = (char*)sqlite3_column_text(p->pStmt, i);
}
for(i=0; i<p->argc; i++){
p->colv[i] = sqlite3_column_name(p->pStmt, i);
@@ -615,6 +616,73 @@ static int tcl_thread_swap(
}
/*
+** Usage: thread_db_get ID
+**
+** Return the database connection pointer for the given thread. Then
+** remove the pointer from the thread itself. Afterwards, the thread
+** can be stopped and the connection can be used by the main thread.
+*/
+static int tcl_thread_db_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 */
+){
+ int i;
+ char zBuf[100];
+ extern int sqlite3TestMakePointerStr(Tcl_Interp*, char*, void*);
+ 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]);
+ sqlite3TestMakePointerStr(interp, zBuf, threadset[i].db);
+ threadset[i].db = 0;
+ Tcl_AppendResult(interp, zBuf, (char*)0);
+ return TCL_OK;
+}
+
+/*
+** Usage: thread_stmt_get ID
+**
+** Return the database stmt pointer for the given thread. Then
+** remove the pointer from the thread itself.
+*/
+static int tcl_thread_stmt_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 */
+){
+ int i;
+ char zBuf[100];
+ extern int sqlite3TestMakePointerStr(Tcl_Interp*, char*, void*);
+ 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]);
+ sqlite3TestMakePointerStr(interp, zBuf, threadset[i].pStmt);
+ threadset[i].pStmt = 0;
+ Tcl_AppendResult(interp, zBuf, (char*)0);
+ return TCL_OK;
+}
+
+/*
** Register commands with the TCL interpreter.
*/
int Sqlitetest4_Init(Tcl_Interp *interp){
@@ -634,6 +702,8 @@ int Sqlitetest4_Init(Tcl_Interp *interp){
{ "thread_step", (Tcl_CmdProc*)tcl_thread_step },
{ "thread_finalize", (Tcl_CmdProc*)tcl_thread_finalize },
{ "thread_swap", (Tcl_CmdProc*)tcl_thread_swap },
+ { "thread_db_get", (Tcl_CmdProc*)tcl_thread_db_get },
+ { "thread_stmt_get", (Tcl_CmdProc*)tcl_thread_stmt_get },
};
int i;
diff --git a/ext/pdo_sqlite/sqlite/src/test5.c b/ext/pdo_sqlite/sqlite/src/test5.c
index 28f546f60..aaa7979a9 100644
--- a/ext/pdo_sqlite/sqlite/src/test5.c
+++ b/ext/pdo_sqlite/sqlite/src/test5.c
@@ -41,7 +41,7 @@ static int binarize(
assert(objc==2);
bytes = Tcl_GetStringFromObj(objv[1], &len);
- pRet = Tcl_NewByteArrayObj(bytes, len+1);
+ pRet = Tcl_NewByteArrayObj((u8*)bytes, len+1);
Tcl_SetObjResult(interp, pRet);
return TCL_OK;
}
@@ -85,7 +85,7 @@ static int test_value_overhead(
for(i=0; i<repeat_count; i++){
if( do_calls ){
- zVal = sqlite3_value_text(&val);
+ zVal = (char*)sqlite3_value_text(&val);
}
}
@@ -159,7 +159,7 @@ static int test_translate(
}
sqlite3ValueSetStr(pVal, -1, z, enc_from, xDel);
}else{
- z = Tcl_GetByteArrayFromObj(objv[1], &len);
+ z = (char*)Tcl_GetByteArrayFromObj(objv[1], &len);
if( objc==5 ){
char *zTmp = z;
z = sqliteMalloc(len);
@@ -170,7 +170,7 @@ static int test_translate(
z = (char *)sqlite3ValueText(pVal, enc_to);
len = sqlite3ValueBytes(pVal, enc_to) + (enc_to==SQLITE_UTF8?1:2);
- Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(z, len));
+ Tcl_SetObjResult(interp, Tcl_NewByteArrayObj((u8*)z, len));
sqlite3ValueFree(pVal);
diff --git a/ext/pdo_sqlite/sqlite/src/tokenize.c b/ext/pdo_sqlite/sqlite/src/tokenize.c
index 7346f5b54..69db09aa4 100644
--- a/ext/pdo_sqlite/sqlite/src/tokenize.c
+++ b/ext/pdo_sqlite/sqlite/src/tokenize.c
@@ -23,6 +23,39 @@
#include <stdlib.h>
/*
+** The charMap() macro maps alphabetic characters into their
+** lower-case ASCII equivalent. On ASCII machines, this is just
+** an upper-to-lower case map. On EBCDIC machines we also need
+** to adjust the encoding. Only alphabetic characters and underscores
+** need to be translated.
+*/
+#ifdef SQLITE_ASCII
+# define charMap(X) sqlite3UpperToLower[(unsigned char)X]
+#endif
+#ifdef SQLITE_EBCDIC
+# define charMap(X) ebcdicToAscii[(unsigned char)X]
+const unsigned char ebcdicToAscii[] = {
+/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 1x */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 3x */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 4x */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 5x */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, /* 6x */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 7x */
+ 0, 97, 98, 99,100,101,102,103,104,105, 0, 0, 0, 0, 0, 0, /* 8x */
+ 0,106,107,108,109,110,111,112,113,114, 0, 0, 0, 0, 0, 0, /* 9x */
+ 0, 0,115,116,117,118,119,120,121,122, 0, 0, 0, 0, 0, 0, /* Ax */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Bx */
+ 0, 97, 98, 99,100,101,102,103,104,105, 0, 0, 0, 0, 0, 0, /* Cx */
+ 0,106,107,108,109,110,111,112,113,114, 0, 0, 0, 0, 0, 0, /* Dx */
+ 0, 0,115,116,117,118,119,120,121,122, 0, 0, 0, 0, 0, 0, /* Ex */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Fx */
+};
+#endif
+
+/*
** 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.
@@ -37,24 +70,22 @@
/*
-** 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.
+** If X is a character that can be used in an identifier then
+** IdChar(X) will be true. Otherwise it is false.
**
-** 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.
+** For ASCII, any character with the high-order bit set is
+** allowed in an identifier. For 7-bit characters,
+** sqlite3IsIdChar[X] must be 1.
+**
+** For EBCDIC, the rules are more complex but have the same
+** end result.
**
** 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.
*/
+#ifdef SQLITE_ASCII
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 */
@@ -64,8 +95,27 @@ const char sqlite3IsIdChar[] = {
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]))
+#endif
+#ifdef SQLITE_EBCDIC
+const char sqlite3IsIdChar[] = {
+/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */
+ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 4x */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, /* 5x */
+ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, /* 6x */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, /* 7x */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, /* 8x */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, /* 9x */
+ 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, /* Ax */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Bx */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, /* Cx */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, /* Dx */
+ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, /* Ex */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, /* Fx */
+};
+#define IdChar(C) (((c=C)>=0x42 && sqlite3IsIdChar[c-0x40]))
+#endif
+
/*
** Return the length of the token that begins at z[0].
@@ -196,9 +246,13 @@ static int getToken(const unsigned char *z, int *tokenType){
}
}
}
- if( c ) i++;
- *tokenType = TK_STRING;
- return i;
+ if( c ){
+ *tokenType = TK_STRING;
+ return i+1;
+ }else{
+ *tokenType = TK_ILLEGAL;
+ return i;
+ }
}
case '.': {
#ifndef SQLITE_OMIT_FLOATING_POINT
@@ -231,6 +285,10 @@ static int getToken(const unsigned char *z, int *tokenType){
*tokenType = TK_FLOAT;
}
#endif
+ while( IdChar(z[i]) ){
+ *tokenType = TK_ILLEGAL;
+ i++;
+ }
return i;
}
case '[': {
@@ -257,6 +315,7 @@ static int getToken(const unsigned char *z, int *tokenType){
#ifndef SQLITE_OMIT_TCL_VARIABLE
case '$':
#endif
+ case '@': /* For compatibility with MS SQL Server */
case ':': {
int n = 0;
*tokenType = TK_VARIABLE;
@@ -339,12 +398,13 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){
extern void sqlite3ParserFree(void*, void(*)(void*));
extern int sqlite3Parser(void*, int, Token, Parse*);
- db->flags &= ~SQLITE_Interrupt;
+ if( db->activeVdbeCnt==0 ){
+ db->u1.isInterrupted = 0;
+ }
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 );
@@ -355,16 +415,16 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){
assert( pParse->nVarExprAlloc==0 );
assert( pParse->apVarExpr==0 );
pParse->zTail = pParse->zSql = zSql;
- while( sqlite3_malloc_failed==0 && zSql[i]!=0 ){
+ while( !sqlite3MallocFailed() && zSql[i]!=0 ){
assert( i>=0 );
- pParse->sLastToken.z = &zSql[i];
+ pParse->sLastToken.z = (u8*)&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 ){
+ if( db->u1.isInterrupted ){
pParse->rc = SQLITE_INTERRUPT;
sqlite3SetString(pzErrMsg, "interrupt", (char*)0);
goto abort_parse;
@@ -403,12 +463,11 @@ abort_parse:
sqlite3Parser(pEngine, 0, pParse->sLastToken, pParse);
}
sqlite3ParserFree(pEngine, sqlite3FreeX);
- if( sqlite3_malloc_failed ){
+ if( sqlite3MallocFailed() ){
pParse->rc = SQLITE_NOMEM;
}
if( pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE && pParse->zErrMsg==0 ){
- sqlite3SetString(&pParse->zErrMsg, sqlite3ErrStr(pParse->rc),
- (char*)0);
+ sqlite3SetString(&pParse->zErrMsg, sqlite3ErrStr(pParse->rc), (char*)0);
}
if( pParse->zErrMsg ){
if( pzErrMsg && *pzErrMsg==0 ){
@@ -423,7 +482,22 @@ abort_parse:
sqlite3VdbeDelete(pParse->pVdbe);
pParse->pVdbe = 0;
}
- sqlite3DeleteTable(pParse->db, pParse->pNewTable);
+#ifndef SQLITE_OMIT_SHARED_CACHE
+ if( pParse->nested==0 ){
+ sqliteFree(pParse->aTableLock);
+ pParse->aTableLock = 0;
+ pParse->nTableLock = 0;
+ }
+#endif
+
+ if( !IN_DECLARE_VTAB ){
+ /* If the pParse->declareVtab flag is set, do not delete any table
+ ** structure built up in pParse->pNewTable. The calling code (see vtab.c)
+ ** will take responsibility for freeing the Table structure.
+ */
+ sqlite3DeleteTable(pParse->db, pParse->pNewTable);
+ }
+
sqlite3DeleteTrigger(pParse->pNewTrigger);
sqliteFree(pParse->apVarExpr);
if( nErr>0 && (pParse->rc==SQLITE_OK || pParse->rc==SQLITE_DONE) ){
diff --git a/ext/pdo_sqlite/sqlite/src/trigger.c b/ext/pdo_sqlite/sqlite/src/trigger.c
index 348dfdd57..15992df38 100644
--- a/ext/pdo_sqlite/sqlite/src/trigger.c
+++ b/ext/pdo_sqlite/sqlite/src/trigger.c
@@ -11,7 +11,6 @@
*
*/
#include "sqliteInt.h"
-#include "vdbe.h"
#ifndef SQLITE_OMIT_TRIGGER
/*
@@ -59,10 +58,13 @@ void sqlite3BeginTrigger(
int iDb; /* The database to store the trigger in */
Token *pName; /* The unqualified db name */
DbFixer sFix;
+ int iTabDb;
+ assert( pName1!=0 ); /* pName1->z might be NULL, but not pName1 itself */
+ assert( pName2!=0 );
if( isTemp ){
/* If TEMP was specified, then the trigger name may not be qualified. */
- if( pName2 && pName2->n>0 ){
+ if( pName2->n>0 ){
sqlite3ErrorMsg(pParse, "temporary trigger may not have qualified name");
goto trigger_cleanup;
}
@@ -81,14 +83,16 @@ void sqlite3BeginTrigger(
** 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;
+ if( !pTableName || sqlite3MallocFailed() ){
+ goto trigger_cleanup;
+ }
pTab = sqlite3SrcListLookup(pParse, pTableName);
- if( pName2->n==0 && pTab && pTab->iDb==1 ){
+ if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){
iDb = 1;
}
/* Ensure the table name matches database name and that the table exists */
- if( sqlite3_malloc_failed ) goto trigger_cleanup;
+ if( sqlite3MallocFailed() ) goto trigger_cleanup;
assert( pTableName->nSrc==1 );
if( sqlite3FixInit(&sFix, pParse, iDb, "trigger", pName) &&
sqlite3FixSrcList(&sFix, pTableName) ){
@@ -99,6 +103,10 @@ void sqlite3BeginTrigger(
/* The table does not exist. */
goto trigger_cleanup;
}
+ if( IsVirtual(pTab) ){
+ sqlite3ErrorMsg(pParse, "cannot create triggers on virtual tables");
+ goto trigger_cleanup;
+ }
/* Check that the trigger name is not reserved and that no trigger of the
** specified name exists */
@@ -106,7 +114,7 @@ void sqlite3BeginTrigger(
if( !zName || SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
goto trigger_cleanup;
}
- if( sqlite3HashFind(&(db->aDb[iDb].trigHash), zName,pName->n+1) ){
+ if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash), zName,strlen(zName)) ){
sqlite3ErrorMsg(pParse, "trigger %T already exists", pName);
goto trigger_cleanup;
}
@@ -131,17 +139,18 @@ void sqlite3BeginTrigger(
" trigger on table: %S", pTableName, 0);
goto trigger_cleanup;
}
+ iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
#ifndef SQLITE_OMIT_AUTHORIZATION
{
int code = SQLITE_CREATE_TRIGGER;
- const char *zDb = db->aDb[pTab->iDb].zName;
+ const char *zDb = db->aDb[iTabDb].zName;
const char *zDbTrig = isTemp ? db->aDb[1].zName : zDb;
- if( pTab->iDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER;
+ if( iTabDb==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)){
+ if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iTabDb),0,zDb)){
goto trigger_cleanup;
}
}
@@ -162,8 +171,8 @@ void sqlite3BeginTrigger(
pTrigger->name = zName;
zName = 0;
pTrigger->table = sqliteStrDup(pTableName->a[0].zName);
- pTrigger->iDb = iDb;
- pTrigger->iTabDb = pTab->iDb;
+ pTrigger->pSchema = db->aDb[iDb].pSchema;
+ pTrigger->pTabSchema = pTab->pSchema;
pTrigger->op = op;
pTrigger->tr_tm = tr_tm==TK_BEFORE ? TRIGGER_BEFORE : TRIGGER_AFTER;
pTrigger->pWhen = sqlite3ExprDup(pWhen);
@@ -197,16 +206,18 @@ void sqlite3FinishTrigger(
Trigger *pTrig = 0; /* The trigger whose construction is finishing up */
sqlite3 *db = pParse->db; /* The database */
DbFixer sFix;
+ int iDb; /* Database containing the trigger */
pTrig = pParse->pNewTrigger;
pParse->pNewTrigger = 0;
- if( pParse->nErr || pTrig==0 ) goto triggerfinish_cleanup;
+ if( pParse->nErr || !pTrig ) goto triggerfinish_cleanup;
+ iDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
pTrig->step_list = pStepList;
while( pStepList ){
pStepList->pTrig = pTrig;
pStepList = pStepList->pNext;
}
- if( sqlite3FixInit(&sFix, pParse, pTrig->iDb, "trigger", &pTrig->nameToken)
+ if( sqlite3FixInit(&sFix, pParse, iDb, "trigger", &pTrig->nameToken)
&& sqlite3FixTriggerStep(&sFix, pTrig->step_list) ){
goto triggerfinish_cleanup;
}
@@ -224,7 +235,7 @@ void sqlite3FinishTrigger(
{ OP_String8, 0, 0, "CREATE TRIGGER "},
{ OP_String8, 0, 0, 0 }, /* 6: SQL */
{ OP_Concat, 0, 0, 0 },
- { OP_MakeRecord, 5, 0, "tttit" },
+ { OP_MakeRecord, 5, 0, "aaada" },
{ OP_Insert, 0, 0, 0 },
};
int addr;
@@ -233,28 +244,30 @@ void sqlite3FinishTrigger(
/* 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);
+ sqlite3BeginWriteOperation(pParse, 0, iDb);
+ sqlite3OpenMasterTable(pParse, 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);
+ sqlite3VdbeChangeP3(v, addr+6, (char*)pAll->z, pAll->n);
+ sqlite3ChangeCookie(db, v, iDb);
sqlite3VdbeAddOp(v, OP_Close, 0, 0);
- sqlite3VdbeOp3(v, OP_ParseSchema, pTrig->iDb, 0,
+ sqlite3VdbeOp3(v, OP_ParseSchema, iDb, 0,
sqlite3MPrintf("type='trigger' AND name='%q'", pTrig->name), P3_DYNAMIC);
}
if( db->init.busy ){
+ int n;
Table *pTab;
Trigger *pDel;
- pDel = sqlite3HashInsert(&db->aDb[pTrig->iDb].trigHash,
- pTrig->name, strlen(pTrig->name)+1, pTrig);
+ pDel = sqlite3HashInsert(&db->aDb[iDb].pSchema->trigHash,
+ pTrig->name, strlen(pTrig->name), pTrig);
if( pDel ){
- assert( sqlite3_malloc_failed && pDel==pTrig );
+ assert( sqlite3MallocFailed() && pDel==pTrig );
goto triggerfinish_cleanup;
}
- pTab = sqlite3LocateTable(pParse,pTrig->table,db->aDb[pTrig->iTabDb].zName);
+ n = strlen(pTrig->table) + 1;
+ pTab = sqlite3HashFind(&pTrig->pTabSchema->tblHash, pTrig->table, n);
assert( pTab!=0 );
pTrig->pNext = pTab->pTrigger;
pTab->pTrigger = pTrig;
@@ -279,7 +292,7 @@ triggerfinish_cleanup:
*/
static void sqlitePersistTriggerStep(TriggerStep *p){
if( p->target.z ){
- p->target.z = sqliteStrNDup(p->target.z, p->target.n);
+ p->target.z = (u8*)sqliteStrNDup((char*)p->target.z, p->target.n);
p->target.dyn = 1;
}
if( p->pSelect ){
@@ -313,7 +326,10 @@ static void sqlitePersistTriggerStep(TriggerStep *p){
*/
TriggerStep *sqlite3TriggerSelectStep(Select *pSelect){
TriggerStep *pTriggerStep = sqliteMalloc(sizeof(TriggerStep));
- if( pTriggerStep==0 ) return 0;
+ if( pTriggerStep==0 ) {
+ sqlite3SelectDelete(pSelect);
+ return 0;
+ }
pTriggerStep->op = TK_SELECT;
pTriggerStep->pSelect = pSelect;
@@ -431,7 +447,7 @@ void sqlite3DropTrigger(Parse *pParse, SrcList *pName){
int nName;
sqlite3 *db = pParse->db;
- if( sqlite3_malloc_failed ) goto drop_trigger_cleanup;
+ if( sqlite3MallocFailed() ) goto drop_trigger_cleanup;
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
goto drop_trigger_cleanup;
}
@@ -443,14 +459,14 @@ void sqlite3DropTrigger(Parse *pParse, SrcList *pName){
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);
+ pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName, nName);
if( pTrigger ) break;
}
if( !pTrigger ){
sqlite3ErrorMsg(pParse, "no such trigger: %S", pName, 0);
goto drop_trigger_cleanup;
}
- sqlite3DropTriggerPtr(pParse, pTrigger, 0);
+ sqlite3DropTriggerPtr(pParse, pTrigger);
drop_trigger_cleanup:
sqlite3SrcListDelete(pName);
@@ -460,27 +476,26 @@ drop_trigger_cleanup:
** 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);
+static Table *tableOfTrigger(Trigger *pTrigger){
+ int n = strlen(pTrigger->table) + 1;
+ return sqlite3HashFind(&pTrigger->pTabSchema->tblHash, pTrigger->table, n);
}
/*
-** 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.
+** Drop a trigger given a pointer to that trigger.
*/
-void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger, int nested){
+void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
Table *pTable;
Vdbe *v;
sqlite3 *db = pParse->db;
int iDb;
- iDb = pTrigger->iDb;
+ iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
assert( iDb>=0 && iDb<db->nDb );
- pTable = tableOfTrigger(db, pTrigger);
- assert(pTable);
- assert( pTable->iDb==iDb || iDb==1 );
+ pTable = tableOfTrigger(pTrigger);
+ assert( pTable );
+ assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
#ifndef SQLITE_OMIT_AUTHORIZATION
{
int code = SQLITE_DROP_TRIGGER;
@@ -496,7 +511,8 @@ void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger, int nested){
/* Generate code to destroy the database record of the trigger.
*/
- if( pTable!=0 && (v = sqlite3GetVdbe(pParse))!=0 ){
+ assert( pTable!=0 );
+ if( (v = sqlite3GetVdbe(pParse))!=0 ){
int base;
static const VdbeOpList dropTrigger[] = {
{ OP_Rewind, 0, ADDR(9), 0},
@@ -511,7 +527,7 @@ void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger, int nested){
};
sqlite3BeginWriteOperation(pParse, 0, iDb);
- sqlite3OpenMasterTable(v, iDb);
+ sqlite3OpenMasterTable(pParse, iDb);
base = sqlite3VdbeAddOpList(v, ArraySize(dropTrigger), dropTrigger);
sqlite3VdbeChangeP3(v, base+1, pTrigger->name, 0);
sqlite3ChangeCookie(db, v, iDb);
@@ -526,9 +542,10 @@ void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger, int nested){
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);
+ pTrigger = sqlite3HashInsert(&(db->aDb[iDb].pSchema->trigHash),
+ zName, nName, 0);
if( pTrigger ){
- Table *pTable = tableOfTrigger(db, pTrigger);
+ Table *pTable = tableOfTrigger(pTrigger);
assert( pTable!=0 );
if( pTable->pTrigger == pTrigger ){
pTable->pTrigger = pTrigger->pNext;
@@ -581,19 +598,13 @@ int sqlite3TriggersExist(
int op, /* one of TK_DELETE, TK_INSERT, TK_UPDATE */
ExprList *pChanges /* Columns that change in an UPDATE statement */
){
- Trigger *pTrigger = pTab->pTrigger;
+ Trigger *pTrigger;
int mask = 0;
+ pTrigger = IsVirtual(pTab) ? 0 : pTab->pTrigger;
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;
- }
+ mask |= pTrigger->tr_tm;
}
pTrigger = pTrigger->pNext;
}
@@ -618,11 +629,11 @@ static SrcList *targetSrcList(
int iDb; /* Index of the database to use */
SrcList *pSrc; /* SrcList to be returned */
- iDb = pStep->pTrig->iDb;
+ iDb = sqlite3SchemaToIndex(pParse->db, pStep->pTrig->pSchema);
if( iDb==0 || iDb>=2 ){
assert( iDb<pParse->db->nDb );
- sDb.z = pParse->db->aDb[iDb].zName;
- sDb.n = strlen(sDb.z);
+ sDb.z = (u8*)pParse->db->aDb[iDb].zName;
+ sDb.n = strlen((char*)sDb.z);
pSrc = sqlite3SrcListAppend(0, &sDb, &pStep->target);
} else {
pSrc = sqlite3SrcListAppend(0, &pStep->target, 0);
@@ -731,8 +742,7 @@ int sqlite3CodeRowTrigger(
int orconf, /* ON CONFLICT policy */
int ignoreJump /* Instruction to jump to for RAISE(IGNORE) */
){
- Trigger *pTrigger;
- TriggerStack *pStack;
+ Trigger *p;
TriggerStack trigStackEntry;
assert(op == TK_UPDATE || op == TK_INSERT || op == TK_DELETE);
@@ -740,22 +750,28 @@ int sqlite3CodeRowTrigger(
assert(newIdx != -1 || oldIdx != -1);
- pTrigger = pTab->pTrigger;
- while( pTrigger ){
+ for(p=pTab->pTrigger; p; p=p->pNext){
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;
- }
+ /* Determine whether we should code this trigger */
+ if(
+ p->op==op &&
+ p->tr_tm==tr_tm &&
+ (p->pSchema==p->pTabSchema || p->pSchema==pParse->db->aDb[1].pSchema) &&
+ (op!=TK_UPDATE||!p->pColumns||checkColumnOverLap(p->pColumns,pChanges))
+ ){
+ TriggerStack *pS; /* Pointer to trigger-stack entry */
+ for(pS=pParse->trigStack; pS && p!=pS->pTrigger; pS=pS->pNext){}
+ if( !pS ){
+ fire_this = 1;
}
- if( op == TK_UPDATE && pTrigger->pColumns &&
- !checkColumnOverLap(pTrigger->pColumns, pChanges) ){
- fire_this = 0;
+#if 0 /* Give no warning for recursive triggers. Just do not do them */
+ else{
+ sqlite3ErrorMsg(pParse, "recursive triggers not supported (%s)",
+ p->name);
+ return SQLITE_ERROR;
}
+#endif
}
if( fire_this ){
@@ -768,18 +784,18 @@ int sqlite3CodeRowTrigger(
sNC.pParse = pParse;
/* Push an entry on to the trigger stack */
- trigStackEntry.pTrigger = pTrigger;
+ trigStackEntry.pTrigger = p;
trigStackEntry.newIdx = newIdx;
trigStackEntry.oldIdx = oldIdx;
trigStackEntry.pTab = pTab;
trigStackEntry.pNext = pParse->trigStack;
trigStackEntry.ignoreJump = ignoreJump;
pParse->trigStack = &trigStackEntry;
- sqlite3AuthContextPush(pParse, &sContext, pTrigger->name);
+ sqlite3AuthContextPush(pParse, &sContext, p->name);
/* code the WHEN clause */
endTrigger = sqlite3VdbeMakeLabel(pParse->pVdbe);
- whenExpr = sqlite3ExprDup(pTrigger->pWhen);
+ whenExpr = sqlite3ExprDup(p->pWhen);
if( sqlite3ExprResolveNames(&sNC, whenExpr) ){
pParse->trigStack = trigStackEntry.pNext;
sqlite3ExprDelete(whenExpr);
@@ -788,7 +804,7 @@ int sqlite3CodeRowTrigger(
sqlite3ExprIfFalse(pParse, whenExpr, endTrigger, 1);
sqlite3ExprDelete(whenExpr);
- codeTriggerProgram(pParse, pTrigger->step_list, orconf);
+ codeTriggerProgram(pParse, p->step_list, orconf);
/* Pop the entry off the trigger stack */
pParse->trigStack = trigStackEntry.pNext;
@@ -796,7 +812,6 @@ int sqlite3CodeRowTrigger(
sqlite3VdbeResolveLabel(pParse->pVdbe, endTrigger);
}
- pTrigger = pTrigger->pNext;
}
return 0;
}
diff --git a/ext/pdo_sqlite/sqlite/src/update.c b/ext/pdo_sqlite/sqlite/src/update.c
index b6c6b8b1e..2565787f0 100644
--- a/ext/pdo_sqlite/sqlite/src/update.c
+++ b/ext/pdo_sqlite/sqlite/src/update.c
@@ -16,9 +16,22 @@
*/
#include "sqliteInt.h"
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/* Forward declaration */
+static void updateVirtualTable(
+ Parse *pParse, /* The parsing context */
+ SrcList *pSrc, /* The virtual table to be modified */
+ Table *pTab, /* The virtual table */
+ ExprList *pChanges, /* The columns to change in the UPDATE statement */
+ Expr *pRowidExpr, /* Expression used to recompute the rowid */
+ int *aXRef, /* Mapping from columns of pTab to entries in pChanges */
+ Expr *pWhere /* WHERE clause of the UPDATE statement */
+);
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
+
/*
-** The most recently coded instruction was an OP_Column to retrieve column
-** 'i' of table pTab. This routine sets the P3 parameter of the
+** The most recently coded instruction was an OP_Column to retrieve the
+** i-th column 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
@@ -44,7 +57,7 @@
void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){
if( pTab && !pTab->pSelect ){
sqlite3_value *pValue;
- u8 enc = sqlite3VdbeDb(v)->enc;
+ u8 enc = ENC(sqlite3VdbeDb(v));
Column *pCol = &pTab->aCol[i];
sqlite3ValueFromExpr(pCol->pDflt, enc, pCol->affinity, &pValue);
if( pValue ){
@@ -89,6 +102,7 @@ void sqlite3Update(
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 */
+ int iDb; /* Database containing the table being updated */
#ifndef SQLITE_OMIT_TRIGGER
int isView; /* Trying to update a view */
@@ -99,7 +113,9 @@ void sqlite3Update(
int oldIdx = -1; /* index of trigger "old" temp table */
sContext.pParse = 0;
- if( pParse->nErr || sqlite3_malloc_failed ) goto update_cleanup;
+ if( pParse->nErr || sqlite3MallocFailed() ){
+ goto update_cleanup;
+ }
db = pParse->db;
assert( pTabList->nSrc==1 );
@@ -107,6 +123,7 @@ void sqlite3Update(
*/
pTab = sqlite3SrcListLookup(pParse, pTabList);
if( pTab==0 ) goto update_cleanup;
+ iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
/* Figure out if we have any triggers and if the table being
** updated is a view
@@ -126,10 +143,8 @@ void sqlite3Update(
if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){
goto update_cleanup;
}
- if( isView ){
- if( sqlite3ViewGetColumnNames(pParse, pTab) ){
- goto update_cleanup;
- }
+ if( sqlite3ViewGetColumnNames(pParse, pTab) ){
+ goto update_cleanup;
}
aXRef = sqliteMallocRaw( sizeof(int) * pTab->nCol );
if( aXRef==0 ) goto update_cleanup;
@@ -192,7 +207,7 @@ void sqlite3Update(
{
int rc;
rc = sqlite3AuthCheck(pParse, SQLITE_UPDATE, pTab->zName,
- pTab->aCol[j].zName, db->aDb[pTab->iDb].zName);
+ pTab->aCol[j].zName, db->aDb[iDb].zName);
if( rc==SQLITE_DENY ){
goto update_cleanup;
}else if( rc==SQLITE_IGNORE ){
@@ -231,7 +246,6 @@ void sqlite3Update(
}
}
if( i<pIdx->nColumn ){
- if( sqlite3CheckIndexCollSeq(pParse, pIdx) ) goto update_cleanup;
apIdx[nIdx++] = pIdx;
aIdxUsed[j] = 1;
}else{
@@ -239,6 +253,24 @@ void sqlite3Update(
}
}
+ /* Begin generating code.
+ */
+ v = sqlite3GetVdbe(pParse);
+ if( v==0 ) goto update_cleanup;
+ if( pParse->nested==0 ) sqlite3VdbeCountChanges(v);
+ sqlite3BeginWriteOperation(pParse, 1, iDb);
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ /* Virtual tables must be handled separately */
+ if( IsVirtual(pTab) ){
+ updateVirtualTable(pParse, pTabList, pTab, pChanges, pRowidExpr, aXRef,
+ pWhere);
+ pWhere = 0;
+ pTabList = 0;
+ goto update_cleanup;
+ }
+#endif
+
/* Resolve the column names in all the expressions in the
** WHERE clause.
*/
@@ -252,20 +284,13 @@ void sqlite3Update(
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);
+ sqlite3Select(pParse, pView, SRT_EphemTab, iCur, 0, 0, 0, 0);
sqlite3SelectDelete(pView);
}
@@ -274,9 +299,9 @@ void sqlite3Update(
pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0);
if( pWInfo==0 ) goto update_cleanup;
- /* Remember the index of every item to be updated.
+ /* Remember the rowid of every item to be updated.
*/
- sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
+ sqlite3VdbeAddOp(v, IsVirtual(pTab) ? OP_VRowid : OP_Rowid, iCur, 0);
sqlite3VdbeAddOp(v, OP_FifoWrite, 0, 0);
/* End the database scan loop.
@@ -307,7 +332,7 @@ void sqlite3Update(
/* Open a cursor and make it point to the record that is
** being updated.
*/
- sqlite3OpenTableForReading(v, iCur, pTab);
+ sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead);
}
sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0);
@@ -355,16 +380,14 @@ void sqlite3Update(
}
}
- if( !isView ){
+ if( !isView && !IsVirtual(pTab) ){
/*
** 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);
+ sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenWrite);
if( onError==OE_Replace ){
openAll = 1;
}else{
@@ -378,9 +401,10 @@ void sqlite3Update(
}
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
if( openAll || aIdxUsed[i] ){
- sqlite3VdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
+ KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
+ sqlite3VdbeAddOp(v, OP_Integer, iDb, 0);
sqlite3VdbeOp3(v, OP_OpenWrite, iCur+i+1, pIdx->tnum,
- (char*)&pIdx->keyInfo, P3_KEYINFO);
+ (char*)pKey, P3_KEYINFO_HANDOFF);
assert( pParse->nTab>iCur+i+1 );
}
}
@@ -388,7 +412,7 @@ void sqlite3Update(
/* 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.
+ ** Also, the old data is needed to delete the old index entries.
** So make the cursor point at the old record.
*/
if( !triggers_exist ){
@@ -429,7 +453,7 @@ void sqlite3Update(
/* Delete the old indices for the current record.
*/
- sqlite3GenerateRowIndexDelete(db, v, pTab, iCur, aIdxUsed);
+ sqlite3GenerateRowIndexDelete(v, pTab, iCur, aIdxUsed);
/* If changing the record number, delete the old record.
*/
@@ -492,7 +516,7 @@ void sqlite3Update(
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);
+ sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows updated", P3_STATIC);
}
update_cleanup:
@@ -504,3 +528,95 @@ update_cleanup:
sqlite3ExprDelete(pWhere);
return;
}
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/*
+** Generate code for an UPDATE of a virtual table.
+**
+** The strategy is that we create an ephemerial table that contains
+** for each row to be changed:
+**
+** (A) The original rowid of that row.
+** (B) The revised rowid for the row. (note1)
+** (C) The content of every column in the row.
+**
+** Then we loop over this ephemeral table and for each row in
+** the ephermeral table call VUpdate.
+**
+** When finished, drop the ephemeral table.
+**
+** (note1) Actually, if we know in advance that (A) is always the same
+** as (B) we only store (A), then duplicate (A) when pulling
+** it out of the ephemeral table before calling VUpdate.
+*/
+static void updateVirtualTable(
+ Parse *pParse, /* The parsing context */
+ SrcList *pSrc, /* The virtual table to be modified */
+ Table *pTab, /* The virtual table */
+ ExprList *pChanges, /* The columns to change in the UPDATE statement */
+ Expr *pRowid, /* Expression used to recompute the rowid */
+ int *aXRef, /* Mapping from columns of pTab to entries in pChanges */
+ Expr *pWhere /* WHERE clause of the UPDATE statement */
+){
+ Vdbe *v = pParse->pVdbe; /* Virtual machine under construction */
+ ExprList *pEList = 0; /* The result set of the SELECT statement */
+ Select *pSelect = 0; /* The SELECT statement */
+ Expr *pExpr; /* Temporary expression */
+ int ephemTab; /* Table holding the result of the SELECT */
+ int i; /* Loop counter */
+ int addr; /* Address of top of loop */
+
+ /* Construct the SELECT statement that will find the new values for
+ ** all updated rows.
+ */
+ pEList = sqlite3ExprListAppend(0, sqlite3CreateIdExpr("_rowid_"), 0);
+ if( pRowid ){
+ pEList = sqlite3ExprListAppend(pEList, sqlite3ExprDup(pRowid), 0);
+ }
+ assert( pTab->iPKey<0 );
+ for(i=0; i<pTab->nCol; i++){
+ if( aXRef[i]>=0 ){
+ pExpr = sqlite3ExprDup(pChanges->a[aXRef[i]].pExpr);
+ }else{
+ pExpr = sqlite3CreateIdExpr(pTab->aCol[i].zName);
+ }
+ pEList = sqlite3ExprListAppend(pEList, pExpr, 0);
+ }
+ pSelect = sqlite3SelectNew(pEList, pSrc, pWhere, 0, 0, 0, 0, 0, 0);
+
+ /* Create the ephemeral table into which the update results will
+ ** be stored.
+ */
+ assert( v );
+ ephemTab = pParse->nTab++;
+ sqlite3VdbeAddOp(v, OP_OpenEphemeral, ephemTab, pTab->nCol+1+(pRowid!=0));
+
+ /* fill the ephemeral table
+ */
+ sqlite3Select(pParse, pSelect, SRT_Table, ephemTab, 0, 0, 0, 0);
+
+ /*
+ ** Generate code to scan the ephemeral table and call VDelete and
+ ** VInsert
+ */
+ sqlite3VdbeAddOp(v, OP_Rewind, ephemTab, 0);
+ addr = sqlite3VdbeCurrentAddr(v);
+ sqlite3VdbeAddOp(v, OP_Column, ephemTab, 0);
+ if( pRowid ){
+ sqlite3VdbeAddOp(v, OP_Column, ephemTab, 1);
+ }else{
+ sqlite3VdbeAddOp(v, OP_Dup, 0, 0);
+ }
+ for(i=0; i<pTab->nCol; i++){
+ sqlite3VdbeAddOp(v, OP_Column, ephemTab, i+1+(pRowid!=0));
+ }
+ pParse->pVirtualLock = pTab;
+ sqlite3VdbeOp3(v, OP_VUpdate, 0, pTab->nCol+2,
+ (const char*)pTab->pVtab, P3_VTAB);
+ sqlite3VdbeAddOp(v, OP_Next, ephemTab, addr);
+ sqlite3VdbeAddOp(v, OP_Close, ephemTab, 0);
+
+ /* Cleanup */
+ sqlite3SelectDelete(pSelect);
+}
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
diff --git a/ext/pdo_sqlite/sqlite/src/utf.c b/ext/pdo_sqlite/sqlite/src/utf.c
index a96b36c6d..05d238433 100644
--- a/ext/pdo_sqlite/sqlite/src/utf.c
+++ b/ext/pdo_sqlite/sqlite/src/utf.c
@@ -255,7 +255,7 @@ int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
{
char zBuf[100];
- sqlite3VdbeMemPrettyPrint(pMem, zBuf, 100);
+ sqlite3VdbeMemPrettyPrint(pMem, zBuf);
fprintf(stderr, "INPUT: %s\n", zBuf);
}
#endif
@@ -272,7 +272,7 @@ int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
assert( rc==SQLITE_NOMEM );
return SQLITE_NOMEM;
}
- zIn = pMem->z;
+ zIn = (u8*)pMem->z;
zTerm = &zIn[pMem->n];
while( zIn<zTerm ){
temp = *zIn;
@@ -287,11 +287,11 @@ int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
/* 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
+ ** translating a 2-byte character to a 4-byte UTF-8 character.
+ ** A single byte is required for the output string
** nul-terminator.
*/
- len = (pMem->n/2) * 3 + 1;
+ len = pMem->n * 2 + 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
@@ -308,7 +308,7 @@ int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
** 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;
+ zIn = (u8*)pMem->z;
zTerm = &zIn[pMem->n];
if( len>NBFS ){
zOut = sqliteMallocRaw(len);
@@ -360,18 +360,18 @@ int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
pMem->enc = desiredEnc;
if( zOut==zShort ){
memcpy(pMem->zShort, zOut, len);
- zOut = pMem->zShort;
+ zOut = (u8*)pMem->zShort;
pMem->flags |= (MEM_Term|MEM_Short);
}else{
pMem->flags |= (MEM_Term|MEM_Dyn);
}
- pMem->z = zOut;
+ pMem->z = (char*)zOut;
translate_out:
#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
{
char zBuf[100];
- sqlite3VdbeMemPrettyPrint(pMem, zBuf, 100);
+ sqlite3VdbeMemPrettyPrint(pMem, zBuf);
fprintf(stderr, "OUTPUT: %s\n", zBuf);
}
#endif
@@ -451,6 +451,23 @@ int sqlite3utf8CharLen(const char *z, int nByte){
#ifndef SQLITE_OMIT_UTF16
/*
+** Convert a UTF-16 string in the native encoding into a UTF-8 string.
+** Memory to hold the UTF-8 string is obtained from malloc and must be
+** freed by the calling function.
+**
+** NULL is returned if there is an allocation error.
+*/
+char *sqlite3utf16to8(const void *z, int nByte){
+ Mem m;
+ memset(&m, 0, sizeof(m));
+ sqlite3VdbeMemSetStr(&m, z, nByte, SQLITE_UTF16NATIVE, SQLITE_STATIC);
+ sqlite3VdbeChangeEncoding(&m, SQLITE_UTF8);
+ assert( (m.flags & MEM_Term)!=0 || sqlite3MallocFailed() );
+ assert( (m.flags & MEM_Str)!=0 || sqlite3MallocFailed() );
+ return (m.flags & MEM_Dyn)!=0 ? m.z : sqliteStrDup(m.z);
+}
+
+/*
** 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,
@@ -462,6 +479,15 @@ int sqlite3utf16ByteLen(const void *zIn, int nChar){
char const *z = zIn;
int n = 0;
if( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ){
+ /* Using an "if (SQLITE_UTF16NATIVE==SQLITE_UTF16BE)" construct here
+ ** and in other parts of this file means that at one branch will
+ ** not be covered by coverage testing on any single host. But coverage
+ ** will be complete if the tests are run on both a little-endian and
+ ** big-endian host. Because both the UTF16NATIVE and SQLITE_UTF16BE
+ ** macros are constant at compile time the compiler can determine
+ ** which branch will be followed. It is therefore assumed that no runtime
+ ** penalty is paid for this "if" statement.
+ */
while( c && ((nChar<0) || n<nChar) ){
READ_UTF16BE(z, c);
n++;
diff --git a/ext/pdo_sqlite/sqlite/src/util.c b/ext/pdo_sqlite/sqlite/src/util.c
index de716d982..5ca9ec408 100644
--- a/ext/pdo_sqlite/sqlite/src/util.c
+++ b/ext/pdo_sqlite/sqlite/src/util.c
@@ -17,37 +17,173 @@
** $Id$
*/
#include "sqliteInt.h"
+#include "os.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);
+/*
+** MALLOC WRAPPER ARCHITECTURE
+**
+** The sqlite code accesses dynamic memory allocation/deallocation by invoking
+** the following six APIs (which may be implemented as macros).
+**
+** sqlite3Malloc()
+** sqlite3MallocRaw()
+** sqlite3Realloc()
+** sqlite3ReallocOrFree()
+** sqlite3Free()
+** sqlite3AllocSize()
+**
+** The function sqlite3FreeX performs the same task as sqlite3Free and is
+** guaranteed to be a real function. The same holds for sqlite3MallocX
+**
+** The above APIs are implemented in terms of the functions provided in the
+** operating-system interface. The OS interface is never accessed directly
+** by code outside of this file.
+**
+** sqlite3OsMalloc()
+** sqlite3OsRealloc()
+** sqlite3OsFree()
+** sqlite3OsAllocationSize()
+**
+** Functions sqlite3MallocRaw() and sqlite3Realloc() may invoke
+** sqlite3_release_memory() if a call to sqlite3OsMalloc() or
+** sqlite3OsRealloc() fails (or if the soft-heap-limit for the thread is
+** exceeded). Function sqlite3Malloc() usually invokes
+** sqlite3MallocRaw().
+**
+** MALLOC TEST WRAPPER ARCHITECTURE
+**
+** The test wrapper provides extra test facilities to ensure the library
+** does not leak memory and handles the failure of the underlying OS level
+** allocation system correctly. It is only present if the library is
+** compiled with the SQLITE_MEMDEBUG macro set.
+**
+** * Guardposts to detect overwrites.
+** * Ability to cause a specific Malloc() or Realloc() to fail.
+** * Audit outstanding memory allocations (i.e check for leaks).
+*/
+
+#define MAX(x,y) ((x)>(y)?(x):(y))
- fprintf(stderr, "STACK: ");
- for(i=0; i<n;i++){
- fprintf(stderr, "%p ", bt[i]);
+#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) && !defined(SQLITE_OMIT_DISKIO)
+/*
+** Set the soft heap-size limit for the current thread. Passing a negative
+** value indicates no limit.
+*/
+void sqlite3_soft_heap_limit(int n){
+ ThreadData *pTd = sqlite3ThreadData();
+ if( pTd ){
+ pTd->nSoftHeapLimit = n;
}
- fprintf(stderr, "\n");
+ sqlite3ReleaseThreadData();
+}
+
+/*
+** Release memory held by SQLite instances created by the current thread.
+*/
+int sqlite3_release_memory(int n){
+ return sqlite3pager_release_memory(n);
}
#else
-#define print_stack_trace()
+/* If SQLITE_ENABLE_MEMORY_MANAGEMENT is not defined, then define a version
+** of sqlite3_release_memory() to be used by other code in this file.
+** This is done for no better reason than to reduce the number of
+** pre-processor #ifndef statements.
+*/
+#define sqlite3_release_memory(x) 0 /* 0 == no memory freed */
+#endif
+
+#ifdef SQLITE_MEMDEBUG
+/*--------------------------------------------------------------------------
+** Begin code for memory allocation system test layer.
+**
+** Memory debugging is turned on by defining the SQLITE_MEMDEBUG macro.
+**
+** SQLITE_MEMDEBUG==1 -> Fence-posting only (thread safe)
+** SQLITE_MEMDEBUG==2 -> Fence-posting + linked list of allocations (not ts)
+** SQLITE_MEMDEBUG==3 -> Above + backtraces (not thread safe, req. glibc)
+*/
+
+/* Figure out whether or not to store backtrace() information for each malloc.
+** The backtrace() function is only used if SQLITE_MEMDEBUG is set to 2 or
+** greater and glibc is in use. If we don't want to use backtrace(), then just
+** define it as an empty macro and set the amount of space reserved to 0.
+*/
+#if defined(__GLIBC__) && SQLITE_MEMDEBUG>2
+ extern int backtrace(void **, int);
+ #define TESTALLOC_STACKSIZE 128
+ #define TESTALLOC_STACKFRAMES ((TESTALLOC_STACKSIZE-8)/sizeof(void*))
+#else
+ #define backtrace(x, y)
+ #define TESTALLOC_STACKSIZE 0
+ #define TESTALLOC_STACKFRAMES 0
#endif
/*
-** If malloc() ever fails, this global variable gets set to 1.
-** This causes the library to abort and never again function.
+** 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.
*/
-int sqlite3_malloc_failed = 0;
+#ifndef TESTALLOC_NGUARD
+# define TESTALLOC_NGUARD 2
+#endif
/*
-** If SQLITE_MEMDEBUG is defined, then use versions of malloc() and
-** free() that track memory usage and check for buffer overruns.
+** Size reserved for storing file-name along with each malloc()ed blob.
*/
-#ifdef SQLITE_MEMDEBUG
+#define TESTALLOC_FILESIZE 64
+
+/*
+** Size reserved for storing the user string. Each time a Malloc() or Realloc()
+** call succeeds, up to TESTALLOC_USERSIZE bytes of the string pointed to by
+** sqlite3_malloc_id are stored along with the other test system metadata.
+*/
+#define TESTALLOC_USERSIZE 64
+const char *sqlite3_malloc_id = 0;
+
+/*
+** Blocks used by the test layer have the following format:
+**
+** <sizeof(void *) pNext pointer>
+** <sizeof(void *) pPrev pointer>
+** <TESTALLOC_NGUARD 32-bit guard words>
+** <The application level allocation>
+** <TESTALLOC_NGUARD 32-bit guard words>
+** <32-bit line number>
+** <TESTALLOC_FILESIZE bytes containing null-terminated file name>
+** <TESTALLOC_STACKSIZE bytes of backtrace() output>
+*/
+
+#define TESTALLOC_OFFSET_GUARD1(p) (sizeof(void *) * 2)
+#define TESTALLOC_OFFSET_DATA(p) ( \
+ TESTALLOC_OFFSET_GUARD1(p) + sizeof(u32) * TESTALLOC_NGUARD \
+)
+#define TESTALLOC_OFFSET_GUARD2(p) ( \
+ TESTALLOC_OFFSET_DATA(p) + sqlite3OsAllocationSize(p) - TESTALLOC_OVERHEAD \
+)
+#define TESTALLOC_OFFSET_LINENUMBER(p) ( \
+ TESTALLOC_OFFSET_GUARD2(p) + sizeof(u32) * TESTALLOC_NGUARD \
+)
+#define TESTALLOC_OFFSET_FILENAME(p) ( \
+ TESTALLOC_OFFSET_LINENUMBER(p) + sizeof(u32) \
+)
+#define TESTALLOC_OFFSET_USER(p) ( \
+ TESTALLOC_OFFSET_FILENAME(p) + TESTALLOC_FILESIZE \
+)
+#define TESTALLOC_OFFSET_STACK(p) ( \
+ TESTALLOC_OFFSET_USER(p) + TESTALLOC_USERSIZE + 8 - \
+ (TESTALLOC_OFFSET_USER(p) % 8) \
+)
+
+#define TESTALLOC_OVERHEAD ( \
+ sizeof(void *)*2 + /* pPrev and pNext pointers */ \
+ TESTALLOC_NGUARD*sizeof(u32)*2 + /* Guard words */ \
+ sizeof(u32) + TESTALLOC_FILESIZE + /* File and line number */ \
+ TESTALLOC_USERSIZE + /* User string */ \
+ TESTALLOC_STACKSIZE /* backtrace() stack */ \
+)
+
/*
** For keeping track of the number of mallocs and frees. This
@@ -58,35 +194,31 @@ int sqlite3_malloc_failed = 0;
*/
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_memUsed; /* TODO Total memory obtained from malloc */
+int sqlite3_memMax; /* TODO 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
+void *sqlite3_pFirst = 0; /* Pointer to linked list of allocations */
+int sqlite3_nMaxAlloc = 0; /* High water mark of ThreadData.nAlloc */
+int sqlite3_mallocDisallowed = 0; /* assert() in sqlite3Malloc() if set */
+int sqlite3_isFail = 0; /* True if all malloc calls should fail */
+const char *sqlite3_zFile = 0; /* Filename to associate debug info with */
+int sqlite3_iLine = 0; /* Line number for debug info */
/*
** 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){
+int sqlite3TestMallocFail(){
+ if( sqlite3_isFail ){
+ return 1;
+ }
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;
+ sqlite3_isFail = 1;
return 1;
}
}
@@ -94,290 +226,516 @@ static int simulatedMallocFailure(int n, char *zFile, int line){
}
/*
-** Allocate new memory and set it to zero. Return NULL if
-** no memory is available.
+** The argument is a pointer returned by sqlite3OsMalloc() or xRealloc().
+** assert() that the first and last (TESTALLOC_NGUARD*4) bytes are set to the
+** values set by the applyGuards() function.
*/
-void *sqlite3Malloc_(int n, int bZero, char *zFile, int line){
- void *p;
- int *pi;
- int i, k;
- if( n==0 ){
- return 0;
+static void checkGuards(u32 *p)
+{
+ int i;
+ char *zAlloc = (char *)p;
+ char *z;
+
+ /* First set of guard words */
+ z = &zAlloc[TESTALLOC_OFFSET_GUARD1(p)];
+ for(i=0; i<TESTALLOC_NGUARD; i++){
+ assert(((u32 *)z)[i]==0xdead1122);
}
- if( simulatedMallocFailure(n, zFile, line) ){
- return 0;
+
+ /* Second set of guard words */
+ z = &zAlloc[TESTALLOC_OFFSET_GUARD2(p)];
+ for(i=0; i<TESTALLOC_NGUARD; i++){
+ u32 guard = 0;
+ memcpy(&guard, &z[i*sizeof(u32)], sizeof(u32));
+ assert(guard==0xdead3344);
}
- 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;
+}
+
+/*
+** The argument is a pointer returned by sqlite3OsMalloc() or Realloc(). The
+** first and last (TESTALLOC_NGUARD*4) bytes are set to known values for use as
+** guard-posts.
+*/
+static void applyGuards(u32 *p)
+{
+ int i;
+ char *z;
+ char *zAlloc = (char *)p;
+
+ /* First set of guard words */
+ z = &zAlloc[TESTALLOC_OFFSET_GUARD1(p)];
+ for(i=0; i<TESTALLOC_NGUARD; i++){
+ ((u32 *)z)[i] = 0xdead1122;
}
- 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;
+
+ /* Second set of guard words */
+ z = &zAlloc[TESTALLOC_OFFSET_GUARD2(p)];
+ for(i=0; i<TESTALLOC_NGUARD; i++){
+ static const int guard = 0xdead3344;
+ memcpy(&z[i*sizeof(u32)], &guard, sizeof(u32));
+ }
+
+ /* Line number */
+ z = &((char *)z)[TESTALLOC_NGUARD*sizeof(u32)]; /* Guard words */
+ z = &zAlloc[TESTALLOC_OFFSET_LINENUMBER(p)];
+ memcpy(z, &sqlite3_iLine, sizeof(u32));
+
+ /* File name */
+ z = &zAlloc[TESTALLOC_OFFSET_FILENAME(p)];
+ strncpy(z, sqlite3_zFile, TESTALLOC_FILESIZE);
+ z[TESTALLOC_FILESIZE - 1] = '\0';
+
+ /* User string */
+ z = &zAlloc[TESTALLOC_OFFSET_USER(p)];
+ z[0] = 0;
+ if( sqlite3_malloc_id ){
+ strncpy(z, sqlite3_malloc_id, TESTALLOC_USERSIZE);
+ z[TESTALLOC_USERSIZE-1] = 0;
+ }
+
+ /* backtrace() stack */
+ z = &zAlloc[TESTALLOC_OFFSET_STACK(p)];
+ backtrace((void **)z, TESTALLOC_STACKFRAMES);
+
+ /* Sanity check to make sure checkGuards() is working */
+ checkGuards(p);
}
/*
-** This version of malloc is always a real function, never a macro
+** The argument is a malloc()ed pointer as returned by the test-wrapper.
+** Return a pointer to the Os level allocation.
*/
-void *sqlite3MallocX(int n){
- return sqlite3Malloc_(n, 0, __FILE__, __LINE__);
+static void *getOsPointer(void *p)
+{
+ char *z = (char *)p;
+ return (void *)(&z[-1 * TESTALLOC_OFFSET_DATA(p)]);
}
+
+#if SQLITE_MEMDEBUG>1
/*
-** 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.
+** The argument points to an Os level allocation. Link it into the threads list
+** of allocations.
*/
-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 );
+static void linkAlloc(void *p){
+ void **pp = (void **)p;
+ pp[0] = 0;
+ pp[1] = sqlite3_pFirst;
+ if( sqlite3_pFirst ){
+ ((void **)sqlite3_pFirst)[0] = p;
}
+ sqlite3_pFirst = p;
}
/*
-** Free memory previously obtained from sqliteMalloc()
+** The argument points to an Os level allocation. Unlinke it from the threads
+** list of allocations.
*/
-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;
- }
+static void unlinkAlloc(void *p)
+{
+ void **pp = (void **)p;
+ if( p==sqlite3_pFirst ){
+ assert(!pp[0]);
+ assert(!pp[1] || ((void **)(pp[1]))[0]==p);
+ sqlite3_pFirst = pp[1];
+ if( sqlite3_pFirst ){
+ ((void **)sqlite3_pFirst)[0] = 0;
}
- 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;
- }
+ }else{
+ void **pprev = pp[0];
+ void **pnext = pp[1];
+ assert(pprev);
+ assert(pprev[1]==p);
+ pprev[1] = (void *)pnext;
+ if( pnext ){
+ assert(pnext[0]==p);
+ pnext[0] = (void *)pprev;
}
- 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().
+** Pointer p is a pointer to an OS level allocation that has just been
+** realloc()ed. Set the list pointers that point to this entry to it's new
+** location.
*/
-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;
+static void relinkAlloc(void *p)
+{
+ void **pp = (void **)p;
+ if( pp[0] ){
+ ((void **)(pp[0]))[1] = p;
+ }else{
+ sqlite3_pFirst = p;
}
- 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;
+ if( pp[1] ){
+ ((void **)(pp[1]))[0] = p;
}
- 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;
+}
+#else
+#define linkAlloc(x)
+#define relinkAlloc(x)
+#define unlinkAlloc(x)
+#endif
+
+/*
+** This function sets the result of the Tcl interpreter passed as an argument
+** to a list containing an entry for each currently outstanding call made to
+** sqliteMalloc and friends by the current thread. Each list entry is itself a
+** list, consisting of the following (in order):
+**
+** * The number of bytes allocated
+** * The __FILE__ macro at the time of the sqliteMalloc() call.
+** * The __LINE__ macro ...
+** * The value of the sqlite3_malloc_id variable ...
+** * The output of backtrace() (if available) ...
+**
+** Todo: We could have a version of this function that outputs to stdout,
+** to debug memory leaks when Tcl is not available.
+*/
+#if defined(TCLSH) && defined(SQLITE_DEBUG) && SQLITE_MEMDEBUG>1
+#include <tcl.h>
+int sqlite3OutstandingMallocs(Tcl_Interp *interp){
+ void *p;
+ Tcl_Obj *pRes = Tcl_NewObj();
+ Tcl_IncrRefCount(pRes);
+
+
+ for(p=sqlite3_pFirst; p; p=((void **)p)[1]){
+ Tcl_Obj *pEntry = Tcl_NewObj();
+ Tcl_Obj *pStack = Tcl_NewObj();
+ char *z;
+ u32 iLine;
+ int nBytes = sqlite3OsAllocationSize(p) - TESTALLOC_OVERHEAD;
+ char *zAlloc = (char *)p;
+ int i;
+
+ Tcl_ListObjAppendElement(0, pEntry, Tcl_NewIntObj(nBytes));
+
+ z = &zAlloc[TESTALLOC_OFFSET_FILENAME(p)];
+ Tcl_ListObjAppendElement(0, pEntry, Tcl_NewStringObj(z, -1));
+
+ z = &zAlloc[TESTALLOC_OFFSET_LINENUMBER(p)];
+ memcpy(&iLine, z, sizeof(u32));
+ Tcl_ListObjAppendElement(0, pEntry, Tcl_NewIntObj(iLine));
+
+ z = &zAlloc[TESTALLOC_OFFSET_USER(p)];
+ Tcl_ListObjAppendElement(0, pEntry, Tcl_NewStringObj(z, -1));
+
+ z = &zAlloc[TESTALLOC_OFFSET_STACK(p)];
+ for(i=0; i<TESTALLOC_STACKFRAMES; i++){
+ char zHex[128];
+ sprintf(zHex, "%p", ((void **)z)[i]);
+ Tcl_ListObjAppendElement(0, pStack, Tcl_NewStringObj(zHex, -1));
}
+
+ Tcl_ListObjAppendElement(0, pEntry, pStack);
+ Tcl_ListObjAppendElement(0, pRes, pEntry);
}
- 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;
+
+ Tcl_ResetResult(interp);
+ Tcl_SetObjResult(interp, pRes);
+ Tcl_DecrRefCount(pRes);
+ return TCL_OK;
}
+#endif
/*
-** Make a copy of a string in memory obtained from sqliteMalloc()
+** This is the test layer's wrapper around sqlite3OsMalloc().
*/
-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;
+static void * OSMALLOC(int n){
+ sqlite3OsEnterMutex();
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ sqlite3_nMaxAlloc =
+ MAX(sqlite3_nMaxAlloc, sqlite3ThreadDataReadOnly()->nAlloc);
+#endif
+ assert( !sqlite3_mallocDisallowed );
+ if( !sqlite3TestMallocFail() ){
+ u32 *p;
+ p = (u32 *)sqlite3OsMalloc(n + TESTALLOC_OVERHEAD);
+ assert(p);
+ sqlite3_nMalloc++;
+ applyGuards(p);
+ linkAlloc(p);
+ sqlite3OsLeaveMutex();
+ return (void *)(&p[TESTALLOC_NGUARD + 2*sizeof(void *)/sizeof(u32)]);
+ }
+ sqlite3OsLeaveMutex();
+ return 0;
}
-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;
+
+static int OSSIZEOF(void *p){
+ if( p ){
+ u32 *pOs = (u32 *)getOsPointer(p);
+ return sqlite3OsAllocationSize(pOs) - TESTALLOC_OVERHEAD;
}
- return zNew;
+ return 0;
}
/*
-** A version of sqliteFree that is always a function, not a macro.
+** This is the test layer's wrapper around sqlite3OsFree(). The argument is a
+** pointer to the space allocated for the application to use.
*/
-void sqlite3FreeX(void *p){
- sqliteFree(p);
+static void OSFREE(void *pFree){
+ u32 *p; /* Pointer to the OS-layer allocation */
+ sqlite3OsEnterMutex();
+ p = (u32 *)getOsPointer(pFree);
+ checkGuards(p);
+ unlinkAlloc(p);
+ memset(pFree, 0x55, OSSIZEOF(pFree));
+ sqlite3OsFree(p);
+ sqlite3_nFree++;
+ sqlite3OsLeaveMutex();
}
-#endif /* SQLITE_MEMDEBUG */
/*
-** The following versions of malloc() and free() are for use in a
-** normal build.
+** This is the test layer's wrapper around sqlite3OsRealloc().
*/
-#if !defined(SQLITE_MEMDEBUG)
+static void * OSREALLOC(void *pRealloc, int n){
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ sqlite3_nMaxAlloc =
+ MAX(sqlite3_nMaxAlloc, sqlite3ThreadDataReadOnly()->nAlloc);
+#endif
+ assert( !sqlite3_mallocDisallowed );
+ if( !sqlite3TestMallocFail() ){
+ u32 *p = (u32 *)getOsPointer(pRealloc);
+ checkGuards(p);
+ p = sqlite3OsRealloc(p, n + TESTALLOC_OVERHEAD);
+ applyGuards(p);
+ relinkAlloc(p);
+ return (void *)(&p[TESTALLOC_NGUARD + 2*sizeof(void *)/sizeof(u32)]);
+ }
+ return 0;
+}
+static void OSMALLOC_FAILED(){
+ sqlite3_isFail = 0;
+}
+
+#else
+/* Define macros to call the sqlite3OsXXX interface directly if
+** the SQLITE_MEMDEBUG macro is not defined.
+*/
+#define OSMALLOC(x) sqlite3OsMalloc(x)
+#define OSREALLOC(x,y) sqlite3OsRealloc(x,y)
+#define OSFREE(x) sqlite3OsFree(x)
+#define OSSIZEOF(x) sqlite3OsAllocationSize(x)
+#define OSMALLOC_FAILED()
+
+#endif /* SQLITE_MEMDEBUG */
/*
-** Allocate new memory and set it to zero. Return NULL if
-** no memory is available. See also sqliteMallocRaw().
+** End code for memory allocation system test layer.
+**--------------------------------------------------------------------------*/
+
+/*
+** This routine is called when we are about to allocate n additional bytes
+** of memory. If the new allocation will put is over the soft allocation
+** limit, then invoke sqlite3_release_memory() to try to release some
+** memory before continuing with the allocation.
+**
+** This routine also makes sure that the thread-specific-data (TSD) has
+** be allocated. If it has not and can not be allocated, then return
+** false. The updateMemoryUsedCount() routine below will deallocate
+** the TSD if it ought to be.
+**
+** If SQLITE_ENABLE_MEMORY_MANAGEMENT is not defined, this routine is
+** a no-op
+*/
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+static int enforceSoftLimit(int n){
+ ThreadData *pTsd = sqlite3ThreadData();
+ if( pTsd==0 ){
+ return 0;
+ }
+ assert( pTsd->nAlloc>=0 );
+ if( n>0 && pTsd->nSoftHeapLimit>0 ){
+ while( pTsd->nAlloc+n>pTsd->nSoftHeapLimit && sqlite3_release_memory(n) ){}
+ }
+ return 1;
+}
+#else
+# define enforceSoftLimit(X) 1
+#endif
+
+/*
+** Update the count of total outstanding memory that is held in
+** thread-specific-data (TSD). If after this update the TSD is
+** no longer being used, then deallocate it.
+**
+** If SQLITE_ENABLE_MEMORY_MANAGEMENT is not defined, this routine is
+** a no-op
*/
-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);
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+static void updateMemoryUsedCount(int n){
+ ThreadData *pTsd = sqlite3ThreadData();
+ if( pTsd ){
+ pTsd->nAlloc += n;
+ assert( pTsd->nAlloc>=0 );
+ if( pTsd->nAlloc==0 && pTsd->nSoftHeapLimit==0 ){
+ sqlite3ReleaseThreadData();
+ }
}
- return p;
}
+#else
+#define updateMemoryUsedCount(x) /* no-op */
+#endif
/*
-** Allocate new memory but do not set it to zero. Return NULL if
-** no memory is available. See also sqliteMalloc().
+** Allocate and return N bytes of uninitialised memory by calling
+** sqlite3OsMalloc(). If the Malloc() call fails, attempt to free memory
+** by calling sqlite3_release_memory().
*/
-void *sqlite3MallocRaw(int n){
- void *p;
- if( n==0 ) return 0;
- if( (p = malloc(n))==0 ){
- if( n>0 ) sqlite3_malloc_failed++;
+void *sqlite3MallocRaw(int n, int doMemManage){
+ void *p = 0;
+ if( n>0 && !sqlite3MallocFailed() && (!doMemManage || enforceSoftLimit(n)) ){
+ while( (p = OSMALLOC(n))==0 && sqlite3_release_memory(n) ){}
+ if( !p ){
+ sqlite3FailedMalloc();
+ OSMALLOC_FAILED();
+ }else if( doMemManage ){
+ updateMemoryUsedCount(OSSIZEOF(p));
+ }
}
return p;
}
/*
-** Free memory previously obtained from sqliteMalloc()
+** Resize the allocation at p to n bytes by calling sqlite3OsRealloc(). The
+** pointer to the new allocation is returned. If the Realloc() call fails,
+** attempt to free memory by calling sqlite3_release_memory().
+*/
+void *sqlite3Realloc(void *p, int n){
+ if( sqlite3MallocFailed() ){
+ return 0;
+ }
+
+ if( !p ){
+ return sqlite3Malloc(n, 1);
+ }else{
+ void *np = 0;
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+ int origSize = OSSIZEOF(p);
+#endif
+ if( enforceSoftLimit(n - origSize) ){
+ while( (np = OSREALLOC(p, n))==0 && sqlite3_release_memory(n) ){}
+ if( !np ){
+ sqlite3FailedMalloc();
+ OSMALLOC_FAILED();
+ }else{
+ updateMemoryUsedCount(OSSIZEOF(np) - origSize);
+ }
+ }
+ return np;
+ }
+}
+
+/*
+** Free the memory pointed to by p. p must be either a NULL pointer or a
+** value returned by a previous call to sqlite3Malloc() or sqlite3Realloc().
*/
void sqlite3FreeX(void *p){
if( p ){
- free(p);
+ updateMemoryUsedCount(0 - OSSIZEOF(p));
+ OSFREE(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().
+** A version of sqliteMalloc() that is always a function, not a macro.
+** Currently, this is used only to alloc to allocate the parser engine.
*/
-void *sqlite3Realloc(void *p, int n){
- void *p2;
- if( p==0 ){
- return sqliteMalloc(n);
+void *sqlite3MallocX(int n){
+ return sqliteMalloc(n);
+}
+
+/*
+** sqlite3Malloc
+** sqlite3ReallocOrFree
+**
+** These two are implemented as wrappers around sqlite3MallocRaw(),
+** sqlite3Realloc() and sqlite3Free().
+*/
+void *sqlite3Malloc(int n, int doMemManage){
+ void *p = sqlite3MallocRaw(n, doMemManage);
+ if( p ){
+ memset(p, 0, n);
}
- if( n==0 ){
- sqliteFree(p);
- return 0;
+ return p;
+}
+void sqlite3ReallocOrFree(void **pp, int n){
+ void *p = sqlite3Realloc(*pp, n);
+ if( !p ){
+ sqlite3FreeX(*pp);
}
- p2 = realloc(p, n);
- if( p2==0 ){
- if( n>0 ) sqlite3_malloc_failed++;
+ *pp = p;
+}
+
+/*
+** sqlite3ThreadSafeMalloc() and sqlite3ThreadSafeFree() are used in those
+** rare scenarios where sqlite may allocate memory in one thread and free
+** it in another. They are exactly the same as sqlite3Malloc() and
+** sqlite3Free() except that:
+**
+** * The allocated memory is not included in any calculations with
+** respect to the soft-heap-limit, and
+**
+** * sqlite3ThreadSafeMalloc() must be matched with ThreadSafeFree(),
+** not sqlite3Free(). Calling sqlite3Free() on memory obtained from
+** ThreadSafeMalloc() will cause an error somewhere down the line.
+*/
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+void *sqlite3ThreadSafeMalloc(int n){
+ (void)ENTER_MALLOC;
+ return sqlite3Malloc(n, 0);
+}
+void sqlite3ThreadSafeFree(void *p){
+ (void)ENTER_MALLOC;
+ if( p ){
+ OSFREE(p);
}
- return p2;
}
+#endif
+
/*
-** Make a copy of a string in memory obtained from sqliteMalloc()
+** Return the number of bytes allocated at location p. p must be either
+** a NULL pointer (in which case 0 is returned) or a pointer returned by
+** sqlite3Malloc(), sqlite3Realloc() or sqlite3ReallocOrFree().
+**
+** The number of bytes allocated does not include any overhead inserted by
+** any malloc() wrapper functions that may be called. So the value returned
+** is the number of bytes that were available to SQLite using pointer p,
+** regardless of how much memory was actually allocated.
+*/
+#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+int sqlite3AllocSize(void *p){
+ return OSSIZEOF(p);
+}
+#endif
+
+/*
+** Make a copy of a string in memory obtained from sqliteMalloc(). These
+** functions call sqlite3MallocRaw() directly instead of sqliteMalloc(). This
+** is because when memory debugging is turned on, these two functions are
+** called via macros that record the current file and line number in the
+** ThreadData structure.
*/
char *sqlite3StrDup(const char *z){
char *zNew;
if( z==0 ) return 0;
- zNew = sqliteMallocRaw(strlen(z)+1);
+ zNew = sqlite3MallocRaw(strlen(z)+1, 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);
+ zNew = sqlite3MallocRaw(n+1, 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
@@ -411,11 +769,6 @@ void sqlite3SetString(char **pz, ...){
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
}
/*
@@ -440,7 +793,7 @@ void sqlite3SetString(char **pz, ...){
** to NULL.
*/
void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){
- if( db && (db->pErr || (db->pErr = sqlite3ValueNew())) ){
+ if( db && (db->pErr || (db->pErr = sqlite3ValueNew())!=0) ){
db->errCode = err_code;
if( zFormat ){
char *z;
@@ -482,6 +835,15 @@ void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
}
/*
+** Clear the error message in pParse, if any
+*/
+void sqlite3ErrorClear(Parse *pParse){
+ sqliteFree(pParse->zErrMsg);
+ pParse->zErrMsg = 0;
+ pParse->nErr = 0;
+}
+
+/*
** 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
@@ -522,6 +884,7 @@ void sqlite3Dequote(char *z){
** lower-case character.
*/
const unsigned char sqlite3UpperToLower[] = {
+#ifdef SQLITE_ASCII
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,
@@ -537,6 +900,25 @@ const unsigned char sqlite3UpperToLower[] = {
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
+#endif
+#ifdef SQLITE_EBCDIC
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 0x */
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, /* 1x */
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, /* 2x */
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, /* 3x */
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, /* 4x */
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, /* 5x */
+ 96, 97, 66, 67, 68, 69, 70, 71, 72, 73,106,107,108,109,110,111, /* 6x */
+ 112, 81, 82, 83, 84, 85, 86, 87, 88, 89,122,123,124,125,126,127, /* 7x */
+ 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, /* 8x */
+ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,156,159, /* 9x */
+ 160,161,162,163,164,165,166,167,168,169,170,171,140,141,142,175, /* Ax */
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, /* Bx */
+ 192,129,130,131,132,133,134,135,136,137,202,203,204,205,206,207, /* Cx */
+ 208,145,146,147,148,149,150,151,152,153,218,219,220,221,222,223, /* Dx */
+ 224,225,162,163,164,165,166,167,168,169,232,203,204,205,206,207, /* Ex */
+ 239,240,241,242,243,244,245,246,247,248,249,219,220,221,222,255, /* Fx */
+#endif
};
#define UpperToLower sqlite3UpperToLower
@@ -606,9 +988,11 @@ int sqlite3IsNumber(const char *z, int *realnum, u8 enc){
** for SQL. So this routine always uses "." regardless of locale.
*/
int sqlite3AtoF(const char *z, double *pResult){
+#ifndef SQLITE_OMIT_FLOATING_POINT
int sign = 1;
const char *zBegin = z;
LONGDOUBLE_TYPE v1 = 0.0;
+ while( isspace(*z) ) z++;
if( *z=='-' ){
sign = -1;
z++;
@@ -656,6 +1040,9 @@ int sqlite3AtoF(const char *z, double *pResult){
}
*pResult = sign<0 ? -v1 : v1;
return z - zBegin;
+#else
+ return sqlite3atoi64(z, pResult);
+#endif /* SQLITE_OMIT_FLOATING_POINT */
}
/*
@@ -673,6 +1060,7 @@ int sqlite3atoi64(const char *zNum, i64 *pNum){
i64 v = 0;
int neg;
int i, c;
+ while( isspace(*zNum) ) zNum++;
if( *zNum=='-' ){
neg = 1;
zNum++;
@@ -763,7 +1151,7 @@ int sqlite3SafetyOn(sqlite3 *db){
return 0;
}else if( db->magic==SQLITE_MAGIC_BUSY ){
db->magic = SQLITE_MAGIC_ERROR;
- db->flags |= SQLITE_Interrupt;
+ db->u1.isInterrupted = 1;
}
return 1;
}
@@ -779,7 +1167,7 @@ int sqlite3SafetyOff(sqlite3 *db){
return 0;
}else if( db->magic==SQLITE_MAGIC_OPEN ){
db->magic = SQLITE_MAGIC_ERROR;
- db->flags |= SQLITE_Interrupt;
+ db->u1.isInterrupted = 1;
}
return 1;
}
@@ -969,8 +1357,10 @@ void *sqlite3HexToBlob(const char *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]);
+ if( zBlob ){
+ for(i=0; i<n; i+=2){
+ zBlob[i/2] = (hexToInt(z[i])<<4) | hexToInt(z[i+1]);
+ }
}
return zBlob;
}
@@ -1003,3 +1393,95 @@ void *sqlite3TextToPtr(const char *z){
return p;
}
#endif
+
+/*
+** Return a pointer to the ThreadData associated with the calling thread.
+*/
+ThreadData *sqlite3ThreadData(){
+ ThreadData *p = (ThreadData*)sqlite3OsThreadSpecificData(1);
+ if( !p ){
+ sqlite3FailedMalloc();
+ }
+ return p;
+}
+
+/*
+** Return a pointer to the ThreadData associated with the calling thread.
+** If no ThreadData has been allocated to this thread yet, return a pointer
+** to a substitute ThreadData structure that is all zeros.
+*/
+const ThreadData *sqlite3ThreadDataReadOnly(){
+ static const ThreadData zeroData = {0}; /* Initializer to silence warnings
+ ** from broken compilers */
+ const ThreadData *pTd = sqlite3OsThreadSpecificData(0);
+ return pTd ? pTd : &zeroData;
+}
+
+/*
+** Check to see if the ThreadData for this thread is all zero. If it
+** is, then deallocate it.
+*/
+void sqlite3ReleaseThreadData(){
+ sqlite3OsThreadSpecificData(-1);
+}
+
+/*
+** This function must be called before exiting any API function (i.e.
+** returning control to the user) that has called sqlite3Malloc or
+** sqlite3Realloc.
+**
+** The returned value is normally a copy of the second argument to this
+** function. However, if a malloc() failure has occured since the previous
+** invocation SQLITE_NOMEM is returned instead.
+**
+** If the first argument, db, is not NULL and a malloc() error has occured,
+** then the connection error-code (the value returned by sqlite3_errcode())
+** is set to SQLITE_NOMEM.
+*/
+static int mallocHasFailed = 0;
+int sqlite3ApiExit(sqlite3* db, int rc){
+ if( sqlite3MallocFailed() ){
+ mallocHasFailed = 0;
+ sqlite3OsLeaveMutex();
+ sqlite3Error(db, SQLITE_NOMEM, 0);
+ rc = SQLITE_NOMEM;
+ }
+ return rc;
+}
+
+/*
+** Return true is a malloc has failed in this thread since the last call
+** to sqlite3ApiExit(), or false otherwise.
+*/
+int sqlite3MallocFailed(){
+ return (mallocHasFailed && sqlite3OsInMutex(1));
+}
+
+/*
+** Set the "malloc has failed" condition to true for this thread.
+*/
+void sqlite3FailedMalloc(){
+ sqlite3OsEnterMutex();
+ assert( mallocHasFailed==0 );
+ mallocHasFailed = 1;
+}
+
+#ifdef SQLITE_MEMDEBUG
+/*
+** This function sets a flag in the thread-specific-data structure that will
+** cause an assert to fail if sqliteMalloc() or sqliteRealloc() is called.
+*/
+void sqlite3MallocDisallow(){
+ assert( sqlite3_mallocDisallowed>=0 );
+ sqlite3_mallocDisallowed++;
+}
+
+/*
+** This function clears the flag set in the thread-specific-data structure set
+** by sqlite3MallocDisallow().
+*/
+void sqlite3MallocAllow(){
+ assert( sqlite3_mallocDisallowed>0 );
+ sqlite3_mallocDisallowed--;
+}
+#endif
diff --git a/ext/pdo_sqlite/sqlite/src/vacuum.c b/ext/pdo_sqlite/sqlite/src/vacuum.c
index 8254528d9..336df67cc 100644
--- a/ext/pdo_sqlite/sqlite/src/vacuum.c
+++ b/ext/pdo_sqlite/sqlite/src/vacuum.c
@@ -17,6 +17,7 @@
** $Id$
*/
#include "sqliteInt.h"
+#include "vdbeInt.h"
#include "os.h"
#ifndef SQLITE_OMIT_VACUUM
@@ -42,7 +43,7 @@ static int execSql(sqlite3 *db, const char *zSql){
if( SQLITE_OK!=sqlite3_prepare(db, zSql, -1, &pStmt, 0) ){
return sqlite3_errcode(db);
}
- while( SQLITE_ROW==sqlite3_step(pStmt) );
+ while( SQLITE_ROW==sqlite3_step(pStmt) ){}
return sqlite3_finalize(pStmt);
}
@@ -58,7 +59,7 @@ static int execExecSql(sqlite3 *db, const char *zSql){
if( rc!=SQLITE_OK ) return rc;
while( SQLITE_ROW==sqlite3_step(pStmt) ){
- rc = execSql(db, sqlite3_column_text(pStmt, 0));
+ rc = execSql(db, (char*)sqlite3_column_text(pStmt, 0));
if( rc!=SQLITE_OK ){
sqlite3_finalize(pStmt);
return rc;
@@ -80,7 +81,7 @@ static int execExecSql(sqlite3 *db, const char *zSql){
** with 2.0.0, SQLite no longer uses GDBM so this command has
** become a no-op.
*/
-void sqlite3Vacuum(Parse *pParse, Token *pTableName){
+void sqlite3Vacuum(Parse *pParse){
Vdbe *v = sqlite3GetVdbe(pParse);
if( v ){
sqlite3VdbeAddOp(v, OP_Vacuum, 0, 0);
@@ -100,11 +101,12 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
Btree *pMain; /* The database being vacuumed */
Btree *pTemp;
char *zSql = 0;
- int writeschema_flag; /* Saved value of the write-schema flag */
+ int saved_flags; /* Saved value of the db->flags */
+ Db *pDb = 0; /* Database to detach at end of vacuum */
/* Save the current value of the write-schema flag before setting it. */
- writeschema_flag = db->flags&SQLITE_WriteSchema;
- db->flags |= SQLITE_WriteSchema;
+ saved_flags = db->flags;
+ db->flags |= SQLITE_WriteSchema | SQLITE_IgnoreChecks;
if( !db->autoCommit ){
sqlite3SetString(pzErrMsg, "cannot VACUUM from within a transaction",
@@ -164,19 +166,23 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
sqliteFree(zSql);
zSql = 0;
if( rc!=SQLITE_OK ) goto end_of_vacuum;
+ pDb = &db->aDb[db->nDb-1];
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");
+ rc = execSql(db, "PRAGMA vacuum_db.synchronous=OFF");
+ if( rc!=SQLITE_OK ){
+ goto end_of_vacuum;
+ }
#ifndef SQLITE_OMIT_AUTOVACUUM
sqlite3BtreeSetAutoVacuum(pTemp, sqlite3BtreeGetAutoVacuum(pMain));
#endif
/* Begin a transaction */
- rc = execSql(db, "BEGIN;");
+ rc = execSql(db, "BEGIN EXCLUSIVE;");
if( rc!=SQLITE_OK ) goto end_of_vacuum;
/* Query the schema of the main database. Create a mirror schema
@@ -247,7 +253,7 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
** opened for writing. This way, the SQL transaction used to create the
** temporary database never needs to be committed.
*/
- if( sqlite3BtreeIsInTrans(pTemp) ){
+ if( rc==SQLITE_OK ){
u32 meta;
int i;
@@ -264,26 +270,27 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
6, 0, /* Preserve the user version */
};
- assert( 0==sqlite3BtreeIsInTrans(pMain) );
- rc = sqlite3BtreeBeginTrans(pMain, 1);
- if( rc!=SQLITE_OK ) goto end_of_vacuum;
+ assert( 1==sqlite3BtreeIsInTrans(pTemp) );
+ assert( 1==sqlite3BtreeIsInTrans(pMain) );
/* 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]);
+ if( rc!=SQLITE_OK ) goto end_of_vacuum;
}
rc = sqlite3BtreeCopyFile(pMain, pTemp);
if( rc!=SQLITE_OK ) goto end_of_vacuum;
+ rc = sqlite3BtreeCommit(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;
+ /* Restore the original value of db->flags */
+ db->flags = saved_flags;
/* Currently there is an SQL level transaction open on the vacuum
** database. No locks are held on any other files (since the main file
@@ -293,16 +300,28 @@ end_of_vacuum:
** 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( pDb ){
+ sqlite3MallocDisallow();
+ sqlite3BtreeClose(pDb->pBt);
+ sqlite3MallocAllow();
+ pDb->pBt = 0;
+ pDb->pSchema = 0;
+ }
+
+ /* If one of the execSql() calls above returned SQLITE_NOMEM, then the
+ ** mallocFailed flag will be clear (because execSql() calls sqlite3_exec()).
+ ** Fix this so the flag and return code match.
+ */
+ if( rc==SQLITE_NOMEM ){
+ sqlite3MallocFailed();
}
+
if( zTemp ){
sqlite3OsDelete(zTemp);
sqliteFree(zTemp);
}
- if( zSql ) sqliteFree( zSql );
+ sqliteFree( zSql );
sqlite3ResetInternalSchema(db, 0);
#endif
diff --git a/ext/pdo_sqlite/sqlite/src/vdbe.c b/ext/pdo_sqlite/sqlite/src/vdbe.c
index a3c3cd11f..98b9916ab 100644
--- a/ext/pdo_sqlite/sqlite/src/vdbe.c
+++ b/ext/pdo_sqlite/sqlite/src/vdbe.c
@@ -57,17 +57,21 @@
** working correctly. This variable has no function other than to
** help verify the correct operation of the library.
*/
+#ifdef SQLITE_TEST
int sqlite3_search_count = 0;
+#endif
/*
** 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.
+** each instruction in the VDBE. When reaches zero, the u1.isInterrupted
+** field of the sqlite3 structure is set in order to simulate and interrupt.
**
** This facility is used for testing purposes only. It does not function
** in an ordinary build.
*/
+#ifdef SQLITE_TEST
int sqlite3_interrupt_count = 0;
+#endif
/*
** The next global variable is incremented each type the OP_Sort opcode
@@ -76,7 +80,9 @@ int sqlite3_interrupt_count = 0;
** has no function other than to help verify the correct operation of the
** library.
*/
+#ifdef SQLITE_TEST
int sqlite3_sort_count = 0;
+#endif
/*
** Release the memory associated with the given stack level. This
@@ -101,6 +107,22 @@ int sqlite3_sort_count = 0;
*/
#define Dynamicify(P,enc) sqlite3VdbeMemDynamicify(P)
+/*
+** The header of a record consists of a sequence variable-length integers.
+** These integers are almost always small and are encoded as a single byte.
+** The following macro takes advantage this fact to provide a fast decode
+** of the integers in a record header. It is faster for the common case
+** where the integer is a single byte. It is a little slower when the
+** integer is two or more bytes. But overall it is faster.
+**
+** The following expressions are equivalent:
+**
+** x = sqlite3GetVarint32( A, &B );
+**
+** x = GetVarint( A, B );
+**
+*/
+#define GetVarint(A,B) ((B = *(A))<=0x7f ? 1 : sqlite3GetVarint32(A, &B))
/*
** An ephemeral string value (signified by the MEM_Ephem flag) contains
@@ -118,23 +140,6 @@ int sqlite3_sort_count = 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
@@ -177,30 +182,64 @@ static void popStack(Mem **ppTos, int N){
** Allocate cursor number iCur. Return a pointer to it. Return NULL
** if we run out of memory.
*/
-static Cursor *allocateCursor(Vdbe *p, int iCur){
+static Cursor *allocateCursor(Vdbe *p, int iCur, int iDb){
Cursor *pCx;
assert( iCur<p->nCursor );
if( p->apCsr[iCur] ){
- sqlite3VdbeFreeCursor(p->apCsr[iCur]);
+ sqlite3VdbeFreeCursor(p, p->apCsr[iCur]);
}
p->apCsr[iCur] = pCx = sqliteMalloc( sizeof(Cursor) );
+ if( pCx ){
+ pCx->iDb = iDb;
+ }
return pCx;
}
/*
-** Apply any conversion required by the supplied column affinity to
-** memory cell pRec. affinity may be one of:
+** Try to convert a value into a numeric representation if we can
+** do so without loss of information. In other words, if the string
+** looks like a number, convert it into a number. If it does not
+** look like a number, leave it alone.
+*/
+static void applyNumericAffinity(Mem *pRec){
+ if( (pRec->flags & (MEM_Real|MEM_Int))==0 ){
+ int realnum;
+ sqlite3VdbeMemNulTerminate(pRec);
+ if( (pRec->flags&MEM_Str)
+ && sqlite3IsNumber(pRec->z, &realnum, pRec->enc) ){
+ i64 value;
+ sqlite3VdbeChangeEncoding(pRec, SQLITE_UTF8);
+ if( !realnum && sqlite3atoi64(pRec->z, &value) ){
+ sqlite3VdbeMemRelease(pRec);
+ pRec->i = value;
+ pRec->flags = MEM_Int;
+ }else{
+ sqlite3VdbeMemRealify(pRec);
+ }
+ }
+ }
+}
+
+/*
+** Processing is determine by the affinity parameter:
+**
+** SQLITE_AFF_INTEGER:
+** SQLITE_AFF_REAL:
+** SQLITE_AFF_NUMERIC:
+** Try to convert pRec to an integer representation or a
+** floating-point representation if an integer representation
+** is not possible. Note that the integer representation is
+** always preferred, even if the affinity is REAL, because
+** an integer representation is more space efficient on disk.
**
-** SQLITE_AFF_NUMERIC
-** SQLITE_AFF_TEXT
-** SQLITE_AFF_NONE
-** SQLITE_AFF_INTEGER
+** SQLITE_AFF_TEXT:
+** Convert pRec to a text representation.
**
+** SQLITE_AFF_NONE:
+** No-op. pRec is unchanged.
*/
static void applyAffinity(Mem *pRec, char affinity, u8 enc){
- if( affinity==SQLITE_AFF_NONE ){
- /* do nothing */
- }else if( affinity==SQLITE_AFF_TEXT ){
+ 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.
@@ -209,36 +248,32 @@ static void applyAffinity(Mem *pRec, char affinity, u8 enc){
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;
- }
- }
+ }else if( affinity!=SQLITE_AFF_NONE ){
+ assert( affinity==SQLITE_AFF_INTEGER || affinity==SQLITE_AFF_REAL
+ || affinity==SQLITE_AFF_NUMERIC );
+ applyNumericAffinity(pRec);
+ if( pRec->flags & MEM_Real ){
+ sqlite3VdbeIntegerAffinity(pRec);
}
}
}
/*
+** Try to convert the type of a function argument or a result column
+** into a numeric representation. Use either INTEGER or REAL whichever
+** is appropriate. But only do the conversion if it is possible without
+** loss of information and return the revised type of the argument.
+**
+** This is an EXPERIMENTAL api and is subject to change or removal.
+*/
+int sqlite3_value_numeric_type(sqlite3_value *pVal){
+ Mem *pMem = (Mem*)pVal;
+ applyNumericAffinity(pMem);
+ storeTypeInfo(pMem, 0);
+ return pMem->type;
+}
+
+/*
** Exported version of applyAffinity(). This one works on sqlite3_value*,
** not the internal Mem* type.
*/
@@ -251,7 +286,7 @@ void sqlite3ValueApplyAffinity(sqlite3_value *pVal, u8 affinity, u8 enc){
** Write a nice string representation of the contents of cell pMem
** into buffer zBuf, length nBuf.
*/
-void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf, int nBuf){
+void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){
char *zCsr = zBuf;
int f = pMem->flags;
@@ -347,7 +382,7 @@ __inline__ unsigned long long int hwtime(void){
** flag on jump instructions, we get a (small) speed improvement.
*/
#define CHECK_FOR_INTERRUPT \
- if( db->flags & SQLITE_Interrupt ) goto abort_due_to_interrupt;
+ if( db->u1.isInterrupted ) goto abort_due_to_interrupt;
/*
@@ -388,6 +423,7 @@ int sqlite3VdbeExec(
Op *pOp; /* Current operation */
int rc = SQLITE_OK; /* Value to return */
sqlite3 *db = p->db; /* The database */
+ u8 encoding = ENC(db); /* The database encoding */
Mem *pTos; /* Top entry in the operand stack */
#ifdef VDBE_PROFILE
unsigned long long start; /* CPU clock count at start of opcode */
@@ -402,11 +438,15 @@ int sqlite3VdbeExec(
if( p->magic!=VDBE_MAGIC_RUN ) return SQLITE_MISUSE;
assert( db->magic==SQLITE_MAGIC_BUSY );
+ pTos = p->pTos;
+ if( p->rc==SQLITE_NOMEM ){
+ /* This happens if a malloc() inside a call to sqlite3_column_text() or
+ ** sqlite3_column_text16() failed. */
+ goto no_mem;
+ }
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;
@@ -417,7 +457,7 @@ int sqlite3VdbeExec(
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;
+ if( sqlite3MallocFailed() ) goto no_mem;
#ifdef VDBE_PROFILE
origPc = pc;
start = hwtime();
@@ -461,11 +501,14 @@ int sqlite3VdbeExec(
*/
if( db->xProgress ){
if( db->nProgressOps==nProgressOps ){
+ if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
if( db->xProgress(db->pProgressArg)!=0 ){
+ sqlite3SafetyOn(db);
rc = SQLITE_ABORT;
continue; /* skip to the next iteration of the for loop */
}
nProgressOps = 0;
+ if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
}
nProgressOps++;
}
@@ -644,24 +687,25 @@ case OP_Real: { /* same as TK_FLOAT, */
pTos->enc = SQLITE_UTF8;
pTos->r = sqlite3VdbeRealValue(pTos);
pTos->flags |= MEM_Real;
- sqlite3VdbeChangeEncoding(pTos, db->enc);
+ sqlite3VdbeChangeEncoding(pTos, encoding);
break;
}
/* Opcode: String8 * * P3
**
-** P3 points to a nul terminated UTF-8 string. This opcode is transformed
+** 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
+ assert( pOp->p3!=0 );
pOp->opcode = OP_String;
+ pOp->p1 = strlen(pOp->p3);
- assert( pOp->p3!=0 );
- if( db->enc!=SQLITE_UTF8 ){
+#ifndef SQLITE_OMIT_UTF16
+ if( encoding!=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!=sqlite3VdbeChangeEncoding(pTos, encoding) ) goto no_mem;
if( SQLITE_OK!=sqlite3VdbeMemDynamicify(pTos) ) goto no_mem;
pTos->flags &= ~(MEM_Dyn);
pTos->flags |= MEM_Static;
@@ -670,34 +714,24 @@ case OP_String8: { /* same as TK_STRING */
}
pOp->p3type = P3_DYNAMIC;
pOp->p3 = pTos->z;
+ pOp->p1 = pTos->n;
break;
}
#endif
/* Otherwise fall through to the next case, OP_String */
}
-/* Opcode: String * * P3
+/* Opcode: String P1 * 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.
+** The string value P3 of length P1 (bytes) is pushed onto the stack.
*/
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;
+ pTos->n = pOp->p1;
+ pTos->enc = encoding;
break;
}
@@ -868,20 +902,45 @@ case OP_Push: { /* no-push */
/* 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.
+** The top P1 values on the stack represent a single result row from
+** a query. This opcode causes the sqlite3_step() call to terminate
+** with an SQLITE_ROW return code and it sets up the sqlite3_stmt
+** structure to provide access to the top P1 values as the result
+** row. When the sqlite3_step() function is run again, the top P1
+** values will be automatically popped from the stack before the next
+** instruction executes.
*/
case OP_Callback: { /* no-push */
- int i;
+ Mem *pMem;
+ Mem *pFirstColumn;
assert( p->nResColumn==pOp->p1 );
- for(i=0; i<pOp->p1; i++){
- Mem *pVal = &pTos[0-i];
- sqlite3VdbeMemNulTerminate(pVal);
- storeTypeInfo(pVal, db->enc);
+ /* Data in the pager might be moved or changed out from under us
+ ** in between the return from this sqlite3_step() call and the
+ ** next call to sqlite3_step(). So deephermeralize everything on
+ ** the stack. Note that ephemeral data is never stored in memory
+ ** cells so we do not have to worry about them.
+ */
+ pFirstColumn = &pTos[0-pOp->p1];
+ for(pMem = p->aStack; pMem<pFirstColumn; pMem++){
+ Deephemeralize(pMem);
}
+ /* Invalidate all ephemeral cursor row caches */
+ p->cacheCtr = (p->cacheCtr + 2)|1;
+
+ /* Make sure the results of the current row are \000 terminated
+ ** and have an assigned type. The results are deephemeralized as
+ ** as side effect.
+ */
+ for(; pMem<=pTos; pMem++ ){
+ sqlite3VdbeMemNulTerminate(pMem);
+ storeTypeInfo(pMem, encoding);
+ }
+
+ /* Set up the statement structure so that it will pop the current
+ ** results from the stack when the statement returns.
+ */
p->resOnStack = 1;
p->nCallback++;
p->popStack = pOp->p1;
@@ -917,7 +976,7 @@ case OP_Concat: { /* same as TK_CONCAT */
nByte = -1;
break;
}
- Stringify(pTerm, db->enc);
+ Stringify(pTerm, encoding);
nByte += pTerm->n;
}
@@ -956,7 +1015,7 @@ case OP_Concat: { /* same as TK_CONCAT */
pTos->n = j;
pTos->flags = MEM_Str|MEM_Dyn|MEM_Term;
pTos->xDel = 0;
- pTos->enc = db->enc;
+ pTos->enc = encoding;
pTos->z = zNew;
}
break;
@@ -1014,8 +1073,10 @@ 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];
+ int flags;
assert( pNos>=p->aStack );
- if( ((pTos->flags | pNos->flags) & MEM_Null)!=0 ){
+ flags = pTos->flags | pNos->flags;
+ if( (flags & MEM_Null)!=0 ){
Release(pTos);
pTos--;
Release(pTos);
@@ -1070,6 +1131,9 @@ case OP_Remainder: { /* same as TK_REM, no-push */
Release(pTos);
pTos->r = b;
pTos->flags = MEM_Real;
+ if( (flags & MEM_Real)==0 ){
+ sqlite3VdbeIntegerAffinity(pTos);
+ }
}
break;
@@ -1125,7 +1189,7 @@ case OP_Function: {
pArg = &pTos[1-n];
for(i=0; i<n; i++, pArg++){
apVal[i] = pArg;
- storeTypeInfo(pArg, db->enc);
+ storeTypeInfo(pArg, encoding);
}
assert( pOp->p3type==P3_FUNCDEF || pOp->p3type==P3_VDBEFUNC );
@@ -1150,7 +1214,7 @@ case OP_Function: {
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;
+ if( sqlite3MallocFailed() ) goto no_mem;
popStack(&pTos, n);
/* If any auxilary data functions have been called by this user function,
@@ -1162,22 +1226,17 @@ case OP_Function: {
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);
- }
+ sqlite3SetString(&p->zErrMsg, sqlite3_value_text(&ctx.s), (char*)0);
rc = SQLITE_ERROR;
}
+
+ /* Copy the result of the function to the top of the stack */
+ sqlite3VdbeChangeEncoding(&ctx.s, encoding);
+ pTos++;
+ pTos->flags = 0;
+ sqlite3VdbeMemMove(pTos, &ctx.s);
break;
}
@@ -1214,7 +1273,7 @@ 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;
+ i64 a, b;
assert( pNos>=p->aStack );
if( (pTos->flags | pNos->flags) & MEM_Null ){
@@ -1249,7 +1308,7 @@ case OP_ShiftRight: { /* same as TK_RSHIFT, no-push */
*/
case OP_AddImm: { /* no-push */
assert( pTos>=p->aStack );
- Integerify(pTos);
+ sqlite3VdbeMemIntegerify(pTos);
pTos->i += pOp->p1;
break;
}
@@ -1267,7 +1326,7 @@ case OP_AddImm: { /* no-push */
case OP_ForceInt: { /* no-push */
i64 v;
assert( pTos>=p->aStack );
- applyAffinity(pTos, SQLITE_AFF_INTEGER, db->enc);
+ applyAffinity(pTos, SQLITE_AFF_NUMERIC, encoding);
if( (pTos->flags & (MEM_Int|MEM_Real))==0 ){
Release(pTos);
pTos--;
@@ -1277,7 +1336,8 @@ case OP_ForceInt: { /* no-push */
if( pTos->flags & MEM_Int ){
v = pTos->i + (pOp->p1!=0);
}else{
- Realify(pTos);
+ /* FIX ME: should this not be assert( pTos->flags & MEM_Real ) ??? */
+ sqlite3VdbeMemRealify(pTos);
v = (int)pTos->r;
if( pTos->r>(double)v ) v++;
if( pOp->p1 && pTos->r==(double)v ) v++;
@@ -1301,7 +1361,7 @@ case OP_ForceInt: { /* no-push */
*/
case OP_MustBeInt: { /* no-push */
assert( pTos>=p->aStack );
- applyAffinity(pTos, SQLITE_AFF_INTEGER, db->enc);
+ applyAffinity(pTos, SQLITE_AFF_NUMERIC, encoding);
if( (pTos->flags & MEM_Int)==0 ){
if( pOp->p2==0 ){
rc = SQLITE_MISMATCH;
@@ -1317,67 +1377,39 @@ case OP_MustBeInt: { /* no-push */
break;
}
-#ifndef SQLITE_OMIT_CAST
-/* Opcode: ToInt * * *
+/* Opcode: RealAffinity * * *
**
-** 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.
+** If the top of the stack is an integer, convert it to a real value.
**
-** A NULL value is not changed by this routine. It remains NULL.
+** This opcode is used when extracting information from a column that
+** has REAL affinity. Such column values may still be stored as
+** integers, for space efficiency, but after extraction we want them
+** to have only a real value.
*/
-case OP_ToNumeric: { /* no-push */
+case OP_RealAffinity: { /* 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 ){
+ if( pTos->flags & MEM_Int ){
sqlite3VdbeMemRealify(pTos);
- }else{
- sqlite3VdbeMemRelease(pTos);
}
- assert( (pTos->flags & MEM_Dyn)==0 );
- pTos->flags &= (MEM_Int|MEM_Real);
break;
}
+#ifndef SQLITE_OMIT_CAST
/* 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
+** If the value is numeric, convert it to a string 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 */
+case OP_ToText: { /* same as TK_TO_TEXT, 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);
+ applyAffinity(pTos, SQLITE_AFF_TEXT, encoding);
assert( pTos->flags & MEM_Str );
pTos->flags &= ~(MEM_Int|MEM_Real|MEM_Blob);
break;
@@ -1392,17 +1424,71 @@ case OP_ToText: { /* no-push */
**
** A NULL value is not changed by this routine. It remains NULL.
*/
-case OP_ToBlob: { /* no-push */
+case OP_ToBlob: { /* same as TK_TO_BLOB, 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);
+ applyAffinity(pTos, SQLITE_AFF_TEXT, encoding);
assert( pTos->flags & MEM_Str );
pTos->flags |= MEM_Blob;
}
pTos->flags &= ~(MEM_Int|MEM_Real|MEM_Str);
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: { /* same as TK_TO_NUMERIC, no-push */
+ assert( pTos>=p->aStack );
+ if( (pTos->flags & MEM_Null)==0 ){
+ sqlite3VdbeMemNumerify(pTos);
+ }
+ break;
+}
+#endif /* 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: { /* same as TK_TO_INT, no-push */
+ assert( pTos>=p->aStack );
+ if( (pTos->flags & MEM_Null)==0 ){
+ sqlite3VdbeMemIntegerify(pTos);
+ }
+ break;
+}
+
+#ifndef SQLITE_OMIT_CAST
+/* Opcode: ToReal * * *
+**
+** Force the value on the top of the stack to be a floating point number.
+** If The value is currently an integer, convert it.
+** 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_ToReal: { /* same as TK_TO_REAL, no-push */
+ assert( pTos>=p->aStack );
+ if( (pTos->flags & MEM_Null)==0 ){
+ sqlite3VdbeMemRealify(pTos);
+ }
+ break;
+}
#endif /* SQLITE_OMIT_CAST */
/* Opcode: Eq P1 P2 P3
@@ -1422,7 +1508,8 @@ case OP_ToBlob: { /* no-push */
** 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
+** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. 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.
**
@@ -1522,8 +1609,8 @@ case OP_Ge: { /* same as TK_GE, no-push */
affinity = pOp->p1 & 0xFF;
if( affinity ){
- applyAffinity(pNos, affinity, db->enc);
- applyAffinity(pTos, affinity, db->enc);
+ applyAffinity(pNos, affinity, encoding);
+ applyAffinity(pTos, affinity, encoding);
}
assert( pOp->p3type==P3_COLLSEQ || pOp->p3==0 );
@@ -1571,13 +1658,13 @@ case OP_Or: { /* same as TK_OR, no-push */
if( pTos->flags & MEM_Null ){
v1 = 2;
}else{
- Integerify(pTos);
+ sqlite3VdbeMemIntegerify(pTos);
v1 = pTos->i==0;
}
if( pNos->flags & MEM_Null ){
v2 = 2;
}else{
- Integerify(pNos);
+ sqlite3VdbeMemIntegerify(pNos);
v2 = pNos->i==0;
}
if( pOp->opcode==OP_And ){
@@ -1614,6 +1701,7 @@ case OP_Negative: /* same as TK_UMINUS, no-push */
case OP_AbsValue: {
assert( pTos>=p->aStack );
if( pTos->flags & MEM_Real ){
+ neg_abs_real_case:
Release(pTos);
if( pOp->opcode==OP_Negative || pTos->r<0.0 ){
pTos->r = -pTos->r;
@@ -1628,11 +1716,8 @@ case OP_AbsValue: {
}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;
+ sqlite3VdbeMemNumerify(pTos);
+ goto neg_abs_real_case;
}
break;
}
@@ -1646,7 +1731,7 @@ case OP_AbsValue: {
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);
+ sqlite3VdbeMemIntegerify(pTos);
assert( (pTos->flags & MEM_Dyn)==0 );
pTos->i = !pTos->i;
pTos->flags = MEM_Int;
@@ -1662,7 +1747,7 @@ case OP_Not: { /* same as TK_NOT, no-push */
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);
+ sqlite3VdbeMemIntegerify(pTos);
assert( (pTos->flags & MEM_Dyn)==0 );
pTos->i = ~pTos->i;
pTos->flags = MEM_Int;
@@ -1795,13 +1880,6 @@ case OP_SetNumColumns: { /* no-push */
** 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
@@ -1819,10 +1897,7 @@ case OP_Column: {
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 */
@@ -1836,31 +1911,19 @@ case OP_Column: {
** 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.
+ ** The complete record text is always available for pseudo-tables
+ ** 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 ){
+ pC = p->apCsr[p1];
+ assert( pC!=0 );
+ if( pC->pCursor!=0 ){
/* The record is stored in a B-Tree */
rc = sqlite3VdbeCursorMoveto(pC);
if( rc ) goto abort_due_to_error;
@@ -1868,9 +1931,9 @@ case OP_Column: {
pCrsr = pC->pCursor;
if( pC->nullRow ){
payloadSize = 0;
- }else if( pC->cacheValid ){
+ }else if( pC->cacheStatus==p->cacheCtr ){
payloadSize = pC->payloadSize;
- zRec = pC->aRow;
+ zRec = (char*)pC->aRow;
}else if( pC->isIndex ){
i64 payloadSize64;
sqlite3BtreeKeySize(pCrsr, &payloadSize64);
@@ -1879,16 +1942,14 @@ case OP_Column: {
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;
+ pC->cacheStatus = CACHE_STALE;
assert( payloadSize==0 || zRec!=0 );
nField = pC->nField;
pCrsr = 0;
-#endif
}else{
zRec = 0;
payloadSize = 0;
@@ -1898,7 +1959,7 @@ case OP_Column: {
/* If payloadSize is 0, then just push a NULL onto the stack. */
if( payloadSize==0 ){
- pTos->flags = MEM_Null;
+ assert( pTos->flags==MEM_Null );
break;
}
@@ -1907,20 +1968,26 @@ case OP_Column: {
/* 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 ){
+ if( pC && pC->cacheStatus==p->cacheCtr ){
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) );
+ u8 *zIdx; /* Index into header */
+ u8 *zEndHdr; /* Pointer to first byte after the header */
+ u32 offset; /* Offset into the data */
+ int szHdrSz; /* Size of the header size field at start of record */
+ int avail; /* Number of bytes of available data */
+
+ aType = pC->aType;
+ if( aType==0 ){
+ pC->aType = aType = sqliteMallocRaw( 2*nField*sizeof(aType) );
}
- aOffset = &aType[nField];
if( aType==0 ){
goto no_mem;
}
+ pC->aOffset = aOffset = &aType[nField];
+ pC->payloadSize = payloadSize;
+ pC->cacheStatus = p->cacheCtr;
/* Figure out how many bytes are in the header */
if( zRec ){
@@ -1937,13 +2004,14 @@ case OP_Column: {
** the record.
*/
if( avail>=payloadSize ){
- zRec = pC->aRow = zData;
+ zRec = zData;
+ pC->aRow = (u8*)zData;
}else{
pC->aRow = 0;
}
}
- idx = sqlite3GetVarint32(zData, &szHdr);
-
+ assert( zRec!=0 || avail>=payloadSize || avail>=9 );
+ szHdrSz = GetVarint((u8*)zData, offset);
/* 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
@@ -1951,58 +2019,47 @@ case OP_Column: {
** 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( !zRec && avail<offset ){
+ rc = sqlite3VdbeMemFromBtree(pCrsr, 0, offset, pC->isIndex, &sMem);
if( rc!=SQLITE_OK ){
goto op_column_out;
}
zData = sMem.z;
}
+ zEndHdr = (u8 *)&zData[offset];
+ zIdx = (u8 *)&zData[szHdrSz];
/* 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++;
+ for(i=0; i<nField; i++){
+ if( zIdx<zEndHdr ){
+ aOffset[i] = offset;
+ zIdx += GetVarint(zIdx, aType[i]);
+ offset += sqlite3VdbeSerialTypeLen(aType[i]);
+ }else{
+ /* 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.
+ */
+ aOffset[i] = 0;
+ }
}
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 we have read more header data than was contained in the header,
+ ** or if the end of the last field appears to be past the end of the
+ ** record, then we must be dealing with a corrupt database.
*/
- if( idx!=szHdr || offset!=payloadSize ){
+ if( zIdx>zEndHdr || 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
@@ -2023,8 +2080,8 @@ case OP_Column: {
}
zData = sMem.z;
}
- sqlite3VdbeSerialGet(zData, aType[p2], pTos);
- pTos->enc = db->enc;
+ sqlite3VdbeSerialGet((u8*)zData, aType[p2], pTos);
+ pTos->enc = encoding;
}else{
if( pOp->p3type==P3_MEM ){
sqlite3VdbeMemShallowCopy(pTos, (Mem *)(pOp->p3), MEM_Static);
@@ -2035,7 +2092,7 @@ case OP_Column: {
/* 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.
+ ** dynamically allocated space over to the pTos structure.
** This prevents a memory copy.
*/
if( (sMem.flags & MEM_Dyn)!=0 ){
@@ -2052,10 +2109,6 @@ case OP_Column: {
rc = sqlite3VdbeMemMakeWriteable(pTos);
op_column_out:
- /* Release the aType[] memory if we are not dealing with cursor */
- if( !pC || !pC->aType ){
- sqliteFree(aType);
- }
break;
}
@@ -2081,17 +2134,14 @@ op_column_out:
** 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.
+** The mapping from character to affinity is given by the SQLITE_AFF_
+** macros defined in sqliteInt.h.
**
** If P3 is NULL then all index fields have the affinity NONE.
**
** See also OP_MakeIdxRec
*/
-/* Opcode: MakeRecordI P1 P2 P3
+/* Opcode: MakeIdxRec 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)
@@ -2133,6 +2183,7 @@ case OP_MakeRecord: {
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 */
+ int file_format; /* File format to use for encoding */
leaveOnStack = ((pOp->p1<0)?1:0);
nField = pOp->p1 * (leaveOnStack?-1:1);
@@ -2143,18 +2194,19 @@ case OP_MakeRecord: {
pData0 = &pTos[1-nField];
assert( pData0>=p->aStack );
containsNull = 0;
+ file_format = p->minWriteFileFormat;
/* 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);
+ applyAffinity(pRec, zAffinity[pRec-pData0], encoding);
}
if( pRec->flags&MEM_Null ){
containsNull = 1;
}
- serial_type = sqlite3VdbeSerialType(pRec);
+ serial_type = sqlite3VdbeSerialType(pRec, file_format);
nData += sqlite3VdbeSerialTypeLen(serial_type);
nHdr += sqlite3VarintLen(serial_type);
}
@@ -2166,8 +2218,8 @@ case OP_MakeRecord: {
if( addRowid ){
pRowid = &pTos[0-nField];
assert( pRowid>=p->aStack );
- Integerify(pRowid);
- serial_type = sqlite3VdbeSerialType(pRowid);
+ sqlite3VdbeMemIntegerify(pRowid);
+ serial_type = sqlite3VdbeSerialType(pRowid, 0);
nData += sqlite3VdbeSerialTypeLen(serial_type);
nHdr += sqlite3VarintLen(serial_type);
}
@@ -2186,24 +2238,24 @@ case OP_MakeRecord: {
goto no_mem;
}
}else{
- zNewRecord = zTemp;
+ zNewRecord = (u8*)zTemp;
}
/* Write the record */
zCsr = zNewRecord;
zCsr += sqlite3PutVarint(zCsr, nHdr);
for(pRec=pData0; pRec<=pTos; pRec++){
- serial_type = sqlite3VdbeSerialType(pRec);
+ serial_type = sqlite3VdbeSerialType(pRec, file_format);
zCsr += sqlite3PutVarint(zCsr, serial_type); /* serial type */
}
if( addRowid ){
- zCsr += sqlite3PutVarint(zCsr, sqlite3VdbeSerialType(pRowid));
+ zCsr += sqlite3PutVarint(zCsr, sqlite3VdbeSerialType(pRowid, 0));
}
for(pRec=pData0; pRec<=pTos; pRec++){
- zCsr += sqlite3VdbeSerialPut(zCsr, pRec); /* serial data */
+ zCsr += sqlite3VdbeSerialPut(zCsr, pRec, file_format); /* serial data */
}
if( addRowid ){
- zCsr += sqlite3VdbeSerialPut(zCsr, pRowid);
+ zCsr += sqlite3VdbeSerialPut(zCsr, pRowid, 0);
}
assert( zCsr==(zNewRecord+nByte) );
@@ -2220,7 +2272,7 @@ case OP_MakeRecord: {
pTos->flags = MEM_Blob | MEM_Short;
}else{
assert( zNewRecord!=(unsigned char *)zTemp );
- pTos->z = zNewRecord;
+ pTos->z = (char*)zNewRecord;
pTos->flags = MEM_Blob | MEM_Dyn;
pTos->xDel = 0;
}
@@ -2248,7 +2300,7 @@ case OP_MakeRecord: {
case OP_Statement: { /* no-push */
int i = pOp->p1;
Btree *pBt;
- if( i>=0 && i<db->nDb && (pBt = db->aDb[i].pBt) && !(db->autoCommit) ){
+ if( i>=0 && i<db->nDb && (pBt = db->aDb[i].pBt)!=0 && !(db->autoCommit) ){
assert( sqlite3BtreeIsInTrans(pBt) );
if( !sqlite3BtreeIsInStmt(pBt) ){
rc = sqlite3BtreeBeginStmt(pBt);
@@ -2280,26 +2332,29 @@ case OP_AutoCommit: { /* no-push */
** that the other VMs must complete first.
*/
sqlite3SetString(&p->zErrMsg, "cannot ", rollback?"rollback":"commit",
- " transaction - SQL statements in progress", 0);
+ " transaction - SQL statements in progress", (char*)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;
+ db->autoCommit = 1;
+ }else{
+ db->autoCommit = i;
+ 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);
+ "cannot commit - no transaction is active"), (char*)0);
rc = SQLITE_ERROR;
}
@@ -2396,16 +2451,24 @@ case OP_SetCookie: { /* no-push */
pDb = &db->aDb[pOp->p1];
assert( pDb->pBt!=0 );
assert( pTos>=p->aStack );
- Integerify(pTos);
+ sqlite3VdbeMemIntegerify(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;
+ pDb->pSchema->schema_cookie = pTos->i;
db->flags |= SQLITE_InternChanges;
+ }else if( pOp->p2==1 ){
+ /* Record changes in the file format */
+ pDb->pSchema->file_format = pTos->i;
}
assert( (pTos->flags & MEM_Dyn)==0 );
pTos--;
+ if( pOp->p1==1 ){
+ /* Invalidate all prepared statements whenever the TEMP database
+ ** schema is changed. Ticket #1644 */
+ sqlite3ExpirePreparedStatements(db);
+ }
break;
}
@@ -2493,26 +2556,35 @@ case OP_OpenWrite: { /* no-push */
Btree *pX;
int iDb;
Cursor *pCur;
+ Db *pDb;
assert( pTos>=p->aStack );
- Integerify(pTos);
+ sqlite3VdbeMemIntegerify(pTos);
iDb = pTos->i;
assert( (pTos->flags & MEM_Dyn)==0 );
pTos--;
assert( iDb>=0 && iDb<db->nDb );
- pX = db->aDb[iDb].pBt;
+ pDb = &db->aDb[iDb];
+ pX = pDb->pBt;
assert( pX!=0 );
- wrFlag = pOp->opcode==OP_OpenWrite;
+ if( pOp->opcode==OP_OpenWrite ){
+ wrFlag = 1;
+ if( pDb->pSchema->file_format < p->minWriteFileFormat ){
+ p->minWriteFileFormat = pDb->pSchema->file_format;
+ }
+ }else{
+ wrFlag = 0;
+ }
if( p2<=0 ){
assert( pTos>=p->aStack );
- Integerify(pTos);
+ sqlite3VdbeMemIntegerify(pTos);
p2 = pTos->i;
assert( (pTos->flags & MEM_Dyn)==0 );
pTos--;
assert( p2>=2 );
}
assert( i>=0 );
- pCur = allocateCursor(p, i);
+ pCur = allocateCursor(p, i, iDb);
if( pCur==0 ) goto no_mem;
pCur->nullRow = 1;
if( pX==0 ) break;
@@ -2524,7 +2596,7 @@ case OP_OpenWrite: { /* no-push */
if( pOp->p3type==P3_KEYINFO ){
pCur->pKeyInfo = (KeyInfo*)pOp->p3;
pCur->pIncrKey = &pCur->pKeyInfo->incrKey;
- pCur->pKeyInfo->enc = p->db->enc;
+ pCur->pKeyInfo->enc = ENC(p->db);
}else{
pCur->pKeyInfo = 0;
pCur->pIncrKey = &pCur->bogusIncrKey;
@@ -2574,9 +2646,9 @@ case OP_OpenWrite: { /* no-push */
break;
}
-/* Opcode: OpenVirtual P1 P2 P3
+/* Opcode: OpenEphemeral P1 P2 P3
**
-** Open a new cursor P1 to a transient or virtual table.
+** Open a new cursor P1 to a transient 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.
@@ -2585,12 +2657,18 @@ case OP_OpenWrite: { /* no-push */
** 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.
+**
+** This opcode was once called OpenTemp. But that created
+** confusion because the term "temp table", might refer either
+** to a TEMP table at the SQL level, or to a table opened by
+** this opcode. Then this opcode was call OpenVirtual. But
+** that created confusion with the whole virtual-table idea.
*/
-case OP_OpenVirtual: { /* no-push */
+case OP_OpenEphemeral: { /* no-push */
int i = pOp->p1;
Cursor *pCx;
assert( i>=0 );
- pCx = allocateCursor(p, i);
+ pCx = allocateCursor(p, i, -1);
if( pCx==0 ) goto no_mem;
pCx->nullRow = 1;
rc = sqlite3BtreeFactory(db, 0, 1, TEMP_PAGES, &pCx->pBt);
@@ -2612,7 +2690,7 @@ case OP_OpenVirtual: { /* no-push */
rc = sqlite3BtreeCursor(pCx->pBt, pgno, 1, sqlite3VdbeRecordCompare,
pOp->p3, &pCx->pCursor);
pCx->pKeyInfo = (KeyInfo*)pOp->p3;
- pCx->pKeyInfo->enc = p->db->enc;
+ pCx->pKeyInfo->enc = ENC(p->db);
pCx->pIncrKey = &pCx->pKeyInfo->incrKey;
}
pCx->isTable = 0;
@@ -2627,7 +2705,6 @@ case OP_OpenVirtual: { /* no-push */
break;
}
-#ifndef SQLITE_OMIT_TRIGGER
/* Opcode: OpenPseudo P1 * *
**
** Open a new cursor that points to a fake table that contains a single
@@ -2636,13 +2713,15 @@ case OP_OpenVirtual: { /* no-push */
** closed.
**
** A pseudo-table created by this opcode is useful for holding the
-** NEW or OLD tables in a trigger.
+** NEW or OLD tables in a trigger. Also used to hold the a single
+** row output from the sorter so that the row can be decomposed into
+** individual columns using the OP_Column opcode.
*/
case OP_OpenPseudo: { /* no-push */
int i = pOp->p1;
Cursor *pCx;
assert( i>=0 );
- pCx = allocateCursor(p, i);
+ pCx = allocateCursor(p, i, -1);
if( pCx==0 ) goto no_mem;
pCx->nullRow = 1;
pCx->pseudoTable = 1;
@@ -2651,7 +2730,6 @@ case OP_OpenPseudo: { /* no-push */
pCx->isIndex = 0;
break;
}
-#endif
/* Opcode: Close P1 * *
**
@@ -2661,7 +2739,7 @@ case OP_OpenPseudo: { /* no-push */
case OP_Close: { /* no-push */
int i = pOp->p1;
if( i>=0 && i<p->nCursor ){
- sqlite3VdbeFreeCursor(p->apCsr[i]);
+ sqlite3VdbeFreeCursor(p, p->apCsr[i]);
p->apCsr[i] = 0;
}
break;
@@ -2725,7 +2803,7 @@ case OP_MoveGt: { /* no-push */
*pC->pIncrKey = oc==OP_MoveGt || oc==OP_MoveLe;
if( pC->isTable ){
i64 iKey;
- Integerify(pTos);
+ sqlite3VdbeMemIntegerify(pTos);
iKey = intToKey(pTos->i);
if( pOp->p2==0 && pOp->opcode==OP_MoveGe ){
pC->movetoTarget = iKey;
@@ -2741,7 +2819,8 @@ case OP_MoveGt: { /* no-push */
pC->lastRowid = pTos->i;
pC->rowidIsValid = res==0;
}else{
- Stringify(pTos, db->enc);
+ assert( pTos->flags & MEM_Blob );
+ /* Stringify(pTos, encoding); */
rc = sqlite3BtreeMoveto(pC->pCursor, pTos->z, pTos->n, &res);
if( rc!=SQLITE_OK ){
goto abort_due_to_error;
@@ -2749,9 +2828,11 @@ case OP_MoveGt: { /* no-push */
pC->rowidIsValid = 0;
}
pC->deferredMoveto = 0;
- pC->cacheValid = 0;
+ pC->cacheStatus = CACHE_STALE;
*pC->pIncrKey = 0;
+#ifdef SQLITE_TEST
sqlite3_search_count++;
+#endif
if( oc==OP_MoveGe || oc==OP_MoveGt ){
if( res<0 ){
rc = sqlite3BtreeNext(pC->pCursor, &res);
@@ -2846,11 +2927,11 @@ case OP_Found: { /* no-push */
if( (pC = p->apCsr[i])->pCursor!=0 ){
int res, rx;
assert( pC->isTable==0 );
- Stringify(pTos, db->enc);
+ Stringify(pTos, encoding);
rx = sqlite3BtreeMoveto(pC->pCursor, pTos->z, pTos->n, &res);
alreadyExists = rx==SQLITE_OK && res==0;
pC->deferredMoveto = 0;
- pC->cacheValid = 0;
+ pC->cacheStatus = CACHE_STALE;
}
if( pOp->opcode==OP_Found ){
if( alreadyExists ) pc = pOp->p2 - 1;
@@ -2868,7 +2949,7 @@ case OP_Found: { /* no-push */
**
** 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
+** using MakeIdxRec. 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
@@ -2895,7 +2976,7 @@ case OP_IsUnique: { /* no-push */
/* Pop the value R off the top of the stack
*/
assert( pNos>=p->aStack );
- Integerify(pTos);
+ sqlite3VdbeMemIntegerify(pTos);
R = pTos->i;
assert( (pTos->flags & MEM_Dyn)==0 );
pTos--;
@@ -2904,7 +2985,7 @@ case OP_IsUnique: { /* no-push */
assert( pCx!=0 );
pCrsr = pCx->pCursor;
if( pCrsr!=0 ){
- int res, rc;
+ int res;
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 */
@@ -2913,20 +2994,22 @@ case OP_IsUnique: { /* no-push */
/* Make sure K is a string and make zKey point to K
*/
- Stringify(pNos, db->enc);
+ Stringify(pNos, encoding);
zKey = pNos->z;
nKey = pNos->n;
- szRowid = sqlite3VdbeIdxRowidLen(nKey, zKey);
+ szRowid = sqlite3VdbeIdxRowidLen((u8*)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;
+ pCx->cacheStatus = CACHE_STALE;
rc = sqlite3BtreeMoveto(pCrsr, zKey, len, &res);
- if( rc!=SQLITE_OK ) goto abort_due_to_error;
+ if( rc!=SQLITE_OK ){
+ goto abort_due_to_error;
+ }
if( res<0 ){
rc = sqlite3BtreeNext(pCrsr, &res);
if( res ){
@@ -2934,7 +3017,7 @@ case OP_IsUnique: { /* no-push */
break;
}
}
- rc = sqlite3VdbeIdxKeyCompare(pCx, len, zKey, &res);
+ rc = sqlite3VdbeIdxKeyCompare(pCx, len, (u8*)zKey, &res);
if( rc!=SQLITE_OK ) goto abort_due_to_error;
if( res>0 ){
pc = pOp->p2 - 1;
@@ -2997,7 +3080,7 @@ case OP_NotExists: { /* no-push */
pC->lastRowid = pTos->i;
pC->rowidIsValid = res==0;
pC->nullRow = 0;
- pC->cacheValid = 0;
+ pC->cacheStatus = CACHE_STALE;
if( res!=0 ){
pc = pOp->p2 - 1;
pC->rowidIsValid = 0;
@@ -3105,7 +3188,10 @@ case OP_NewRowid: {
if( pC->nextRowidValid ){
v = pC->nextRowid;
}else{
- rx = sqlite3BtreeLast(pC->pCursor, &res);
+ rc = sqlite3BtreeLast(pC->pCursor, &res);
+ if( rc!=SQLITE_OK ){
+ goto abort_due_to_error;
+ }
if( res ){
v = 1;
}else{
@@ -3124,7 +3210,7 @@ case OP_NewRowid: {
Mem *pMem;
assert( pOp->p2>0 && pOp->p2<p->nMem ); /* P2 is a valid memory cell */
pMem = &p->aMem[pOp->p2];
- Integerify(pMem);
+ sqlite3VdbeMemIntegerify(pMem);
assert( (pMem->flags & MEM_Int)!=0 ); /* mem(P2) holds an integer */
if( pMem->i==MAX_ROWID || pC->useRandomRowid ){
rc = SQLITE_FULL;
@@ -3170,7 +3256,7 @@ case OP_NewRowid: {
}
pC->rowidIsValid = 0;
pC->deferredMoveto = 0;
- pC->cacheValid = 0;
+ pC->cacheStatus = CACHE_STALE;
}
pTos++;
pTos->i = v;
@@ -3178,7 +3264,7 @@ case OP_NewRowid: {
break;
}
-/* Opcode: Insert P1 P2 *
+/* Opcode: Insert P1 P2 P3
**
** 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
@@ -3191,6 +3277,10 @@ case OP_NewRowid: {
** then rowid is stored for subsequent return by the
** sqlite3_last_insert_rowid() function (otherwise it's unmodified).
**
+** Parameter P3 may point to a string containing the table-name, or
+** may be NULL. If it is not NULL, then the update-hook
+** (sqlite3.xUpdateCallback) is invoked following a successful insert.
+**
** This instruction only works on tables. The equivalent instruction
** for indices is OP_IdxInsert.
*/
@@ -3210,7 +3300,7 @@ case OP_Insert: { /* no-push */
if( pOp->p2 & OPFLAG_NCHANGE ) p->nChange++;
if( pOp->p2 & OPFLAG_LASTROWID ) db->lastRowid = pNos->i;
- if( pC->nextRowidValid && pTos->i>=pC->nextRowid ){
+ if( pC->nextRowidValid && pNos->i>=pC->nextRowid ){
pC->nextRowidValid = 0;
}
if( pTos->flags & MEM_Null ){
@@ -3219,7 +3309,6 @@ case OP_Insert: { /* no-push */
}else{
assert( pTos->flags & (MEM_Blob|MEM_Str) );
}
-#ifndef SQLITE_OMIT_TRIGGER
if( pC->pseudoTable ){
sqliteFree(pC->pData);
pC->iKey = iKey;
@@ -3236,21 +3325,29 @@ case OP_Insert: { /* no-push */
}
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;
+ pC->cacheStatus = CACHE_STALE;
+
+ /* Invoke the update-hook if required. */
+ if( rc==SQLITE_OK && db->xUpdateCallback && pOp->p3 ){
+ const char *zDb = db->aDb[pC->iDb].zName;
+ const char *zTbl = pOp->p3;
+ int op = ((pOp->p2 & OPFLAG_ISUPDATE) ? SQLITE_UPDATE : SQLITE_INSERT);
+ assert( pC->isTable );
+ db->xUpdateCallback(db->pUpdateArg, op, zDb, zTbl, iKey);
+ assert( pC->iDb>=0 );
+ }
}
popStack(&pTos, 2);
+
break;
}
-/* Opcode: Delete P1 P2 *
+/* Opcode: Delete P1 P2 P3
**
** Delete the record at which the P1 cursor is currently pointing.
**
@@ -3271,11 +3368,37 @@ case OP_Delete: { /* no-push */
pC = p->apCsr[i];
assert( pC!=0 );
if( pC->pCursor!=0 ){
+ i64 iKey;
+
+ /* If the update-hook will be invoked, set iKey to the rowid of the
+ ** row being deleted.
+ */
+ if( db->xUpdateCallback && pOp->p3 ){
+ assert( pC->isTable );
+ if( pC->rowidIsValid ){
+ iKey = pC->lastRowid;
+ }else{
+ rc = sqlite3BtreeKeySize(pC->pCursor, &iKey);
+ if( rc ){
+ goto abort_due_to_error;
+ }
+ iKey = keyToInt(iKey);
+ }
+ }
+
rc = sqlite3VdbeCursorMoveto(pC);
if( rc ) goto abort_due_to_error;
rc = sqlite3BtreeDelete(pC->pCursor);
pC->nextRowidValid = 0;
- pC->cacheValid = 0;
+ pC->cacheStatus = CACHE_STALE;
+
+ /* Invoke the update-hook if required. */
+ if( rc==SQLITE_OK && db->xUpdateCallback && pOp->p3 ){
+ const char *zDb = db->aDb[pC->iDb].zName;
+ const char *zTbl = pOp->p3;
+ db->xUpdateCallback(db->pUpdateArg, SQLITE_DELETE, zDb, zTbl, iKey);
+ assert( pC->iDb>=0 );
+ }
}
if( pOp->p2 & OPFLAG_NCHANGE ) p->nChange++;
break;
@@ -3360,12 +3483,10 @@ case OP_RowData: {
}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;
}
@@ -3445,7 +3566,7 @@ case OP_Last: { /* no-push */
rc = sqlite3BtreeLast(pCrsr, &res);
pC->nullRow = res;
pC->deferredMoveto = 0;
- pC->cacheValid = 0;
+ pC->cacheStatus = CACHE_STALE;
if( res && pOp->p2>0 ){
pc = pOp->p2 - 1;
}
@@ -3469,8 +3590,10 @@ case OP_Last: { /* no-push */
** correctly optimizing out sorts.
*/
case OP_Sort: { /* no-push */
+#ifdef SQLITE_TEST
sqlite3_sort_count++;
sqlite3_search_count--;
+#endif
/* Fall through into OP_Rewind */
}
/* Opcode: Rewind P1 P2 *
@@ -3494,7 +3617,7 @@ case OP_Rewind: { /* no-push */
rc = sqlite3BtreeFirst(pCrsr, &res);
pC->atFirst = res==0;
pC->deferredMoveto = 0;
- pC->cacheValid = 0;
+ pC->cacheStatus = CACHE_STALE;
}else{
res = 1;
}
@@ -3539,11 +3662,13 @@ case OP_Next: { /* no-push */
rc = pOp->opcode==OP_Next ? sqlite3BtreeNext(pCrsr, &res) :
sqlite3BtreePrevious(pCrsr, &res);
pC->nullRow = res;
- pC->cacheValid = 0;
+ pC->cacheStatus = CACHE_STALE;
}
if( res==0 ){
pc = pOp->p2 - 1;
+#ifdef SQLITE_TEST
sqlite3_search_count++;
+#endif
}
}else{
pC->nullRow = 1;
@@ -3554,9 +3679,9 @@ case OP_Next: { /* no-push */
/* 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.
+** The top of the stack holds a SQL index key made using either the
+** MakeIdxRec or MakeRecord instructions. 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.
@@ -3576,7 +3701,7 @@ case OP_IdxInsert: { /* no-push */
assert( pC->isTable==0 );
rc = sqlite3BtreeInsert(pCrsr, zKey, nKey, "", 0);
assert( pC->deferredMoveto==0 );
- pC->cacheValid = 0;
+ pC->cacheStatus = CACHE_STALE;
}
Release(pTos);
pTos--;
@@ -3585,7 +3710,8 @@ case OP_IdxInsert: { /* no-push */
/* Opcode: IdxDelete P1 * *
**
-** The top of the stack is an index key built using the MakeIdxKey opcode.
+** The top of the stack is an index key built using the either the
+** MakeIdxRec or MakeRecord opcodes.
** This opcode removes that entry from the index.
*/
case OP_IdxDelete: { /* no-push */
@@ -3597,13 +3723,13 @@ case OP_IdxDelete: { /* no-push */
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 ){
+ int res;
+ rc = sqlite3BtreeMoveto(pCrsr, pTos->z, pTos->n, &res);
+ if( rc==SQLITE_OK && res==0 ){
rc = sqlite3BtreeDelete(pCrsr);
}
assert( pC->deferredMoveto==0 );
- pC->cacheValid = 0;
+ pC->cacheStatus = CACHE_STALE;
}
Release(pTos);
pTos--;
@@ -3616,7 +3742,7 @@ case OP_IdxDelete: { /* no-push */
** 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.
+** See also: Rowid, MakeIdxRec.
*/
case OP_IdxRowid: {
int i = pOp->p1;
@@ -3700,14 +3826,14 @@ case OP_IdxGE: { /* no-push */
assert( p->apCsr[i]!=0 );
assert( pTos>=p->aStack );
if( (pC = p->apCsr[i])->pCursor!=0 ){
- int res, rc;
+ int res;
assert( pTos->flags & MEM_Blob ); /* Created using OP_Make*Key */
- Stringify(pTos, db->enc);
+ Stringify(pTos, encoding);
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);
+ rc = sqlite3VdbeIdxKeyCompare(pC, pTos->n, (u8*)pTos->z, &res);
*pC->pIncrKey = 0;
if( rc!=SQLITE_OK ){
break;
@@ -3729,7 +3855,7 @@ case OP_IdxGE: { /* no-push */
/* 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
+** by the MakeIdxRec 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.
**
@@ -3745,9 +3871,9 @@ case OP_IdxIsNull: { /* no-push */
assert( pTos->flags & MEM_Blob );
z = pTos->z;
n = pTos->n;
- k = sqlite3GetVarint32(z, &serial_type);
+ k = sqlite3GetVarint32((u8*)z, &serial_type);
for(; k<n && i>0; i--){
- k += sqlite3GetVarint32(&z[k], &serial_type);
+ k += sqlite3GetVarint32((u8*)&z[k], &serial_type);
if( serial_type==0 ){ /* Serial type 0 is a NULL */
pc = pOp->p2-1;
break;
@@ -3780,19 +3906,31 @@ case OP_IdxIsNull: { /* no-push */
*/
case OP_Destroy: {
int iMoved;
- if( db->activeVdbeCnt>1 ){
+ Vdbe *pVdbe;
+ int iCnt;
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ iCnt = 0;
+ for(pVdbe=db->pVdbe; pVdbe; pVdbe=pVdbe->pNext){
+ if( pVdbe->magic==VDBE_MAGIC_RUN && pVdbe->inVtabMethod<2 && pVdbe->pc>=0 ){
+ iCnt++;
+ }
+ }
+#else
+ iCnt = db->activeVdbeCnt;
+#endif
+ if( iCnt>1 ){
rc = SQLITE_LOCKED;
}else{
- assert( db->activeVdbeCnt==1 );
+ assert( iCnt==1 );
rc = sqlite3BtreeDropTable(db->aDb[pOp->p2].pBt, pOp->p1, &iMoved);
pTos++;
pTos->flags = MEM_Int;
pTos->i = iMoved;
- #ifndef SQLITE_OMIT_AUTOVACUUM
+#ifndef SQLITE_OMIT_AUTOVACUUM
if( rc==SQLITE_OK && iMoved!=0 ){
sqlite3RootPageMoved(&db->aDb[pOp->p2], iMoved, pOp->p1);
}
- #endif
+#endif
}
break;
}
@@ -3810,6 +3948,41 @@ case OP_Destroy: {
** See also: Destroy
*/
case OP_Clear: { /* no-push */
+
+ /* For consistency with the way other features of SQLite operate
+ ** with a truncate, we will also skip the update callback.
+ */
+#if 0
+ Btree *pBt = db->aDb[pOp->p2].pBt;
+ if( db->xUpdateCallback && pOp->p3 ){
+ const char *zDb = db->aDb[pOp->p2].zName;
+ const char *zTbl = pOp->p3;
+ BtCursor *pCur = 0;
+ int fin = 0;
+
+ rc = sqlite3BtreeCursor(pBt, pOp->p1, 0, 0, 0, &pCur);
+ if( rc!=SQLITE_OK ){
+ goto abort_due_to_error;
+ }
+ for(
+ rc=sqlite3BtreeFirst(pCur, &fin);
+ rc==SQLITE_OK && !fin;
+ rc=sqlite3BtreeNext(pCur, &fin)
+ ){
+ i64 iKey;
+ rc = sqlite3BtreeKeySize(pCur, &iKey);
+ if( rc ){
+ break;
+ }
+ iKey = keyToInt(iKey);
+ db->xUpdateCallback(db->pUpdateArg, SQLITE_DELETE, zDb, zTbl, iKey);
+ }
+ sqlite3BtreeCloseCursor(pCur);
+ if( rc!=SQLITE_OK ){
+ goto abort_due_to_error;
+ }
+ }
+#endif
rc = sqlite3BtreeClearTable(db->aDb[pOp->p2].pBt, pOp->p1);
break;
}
@@ -3885,14 +4058,20 @@ case OP_ParseSchema: { /* no-push */
sqlite3SafetyOff(db);
assert( db->init.busy==0 );
db->init.busy = 1;
+ assert( !sqlite3MallocFailed() );
rc = sqlite3_exec(db, zSql, sqlite3InitCallback, &initData, 0);
+ if( rc==SQLITE_ABORT ) rc = initData.rc;
+ sqliteFree(zSql);
db->init.busy = 0;
sqlite3SafetyOn(db);
- sqliteFree(zSql);
+ if( rc==SQLITE_NOMEM ){
+ sqlite3FailedMalloc();
+ goto no_mem;
+ }
break;
}
-#ifndef SQLITE_OMIT_ANALYZE
+#if !defined(SQLITE_OMIT_ANALYZE) && !defined(SQLITE_OMIT_PARSER)
/* Opcode: LoadAnalysis P1 * *
**
** Read the sqlite_stat1 table for database P1 and load the content
@@ -3905,7 +4084,7 @@ case OP_LoadAnalysis: { /* no-push */
sqlite3AnalysisLoad(db, iDb);
break;
}
-#endif /* SQLITE_OMIT_ANALYZE */
+#endif /* !defined(SQLITE_OMIT_ANALYZE) && !defined(SQLITE_OMIT_PARSER) */
/* Opcode: DropTable P1 * P3
**
@@ -3992,7 +4171,7 @@ case OP_IntegrityCk: {
pTos->xDel = 0;
}
pTos->enc = SQLITE_UTF8;
- sqlite3VdbeChangeEncoding(pTos, db->enc);
+ sqlite3VdbeChangeEncoding(pTos, encoding);
sqliteFree(aRoot);
break;
}
@@ -4005,7 +4184,7 @@ case OP_IntegrityCk: {
*/
case OP_FifoWrite: { /* no-push */
assert( pTos>=p->aStack );
- Integerify(pTos);
+ sqlite3VdbeMemIntegerify(pTos);
sqlite3VdbeFifoPush(&p->sFifo, pTos->i);
assert( (pTos->flags & MEM_Dyn)==0 );
pTos--;
@@ -4046,7 +4225,7 @@ case OP_ContextPush: { /* no-push */
/* 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));
+ sqliteReallocOrFree((void**)&p->contextStack, sizeof(Context)*(i+1));
if( p->contextStack==0 ) goto no_mem;
}
pContext = &p->contextStack[i];
@@ -4129,8 +4308,8 @@ case OP_MemMax: { /* no-push */
assert( pTos>=p->aStack );
assert( i>=0 && i<p->nMem );
pMem = &p->aMem[i];
- Integerify(pMem);
- Integerify(pTos);
+ sqlite3VdbeMemIntegerify(pMem);
+ sqlite3VdbeMemIntegerify(pTos);
if( pMem->i<pTos->i){
pMem->i = pTos->i;
}
@@ -4140,30 +4319,27 @@ case OP_MemMax: { /* no-push */
/* 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.
+** Increment the integer valued memory cell P2 by the value in P1.
**
-** This instruction throws an error if the memory cell is not initially
-** an integer.
+** It is illegal to use this instruction on a memory cell that does
+** not contain an integer. An assertion fault will result if you try.
*/
case OP_MemIncr: { /* no-push */
- int i = pOp->p1;
+ int i = pOp->p2;
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;
- }
+ pMem->i += pOp->p1;
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.
+** If the value of memory cell P1 is 1 or greater, jump to P2.
+**
+** It is illegal to use this instruction on a memory cell that does
+** not contain an integer. An assertion fault will result if you try.
*/
case OP_IfMemPos: { /* no-push */
int i = pOp->p1;
@@ -4177,6 +4353,44 @@ case OP_IfMemPos: { /* no-push */
break;
}
+/* Opcode: IfMemNeg P1 P2 *
+**
+** If the value of memory cell P1 is less than zero, jump to P2.
+**
+** It is illegal to use this instruction on a memory cell that does
+** not contain an integer. An assertion fault will result if you try.
+*/
+case OP_IfMemNeg: { /* 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: IfMemZero P1 P2 *
+**
+** If the value of memory cell P1 is exactly 0, jump to P2.
+**
+** It is illegal to use this instruction on a memory cell that does
+** not contain an integer. An assertion fault will result if you try.
+*/
+case OP_IfMemZero: { /* 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
@@ -4233,12 +4447,15 @@ case OP_AggStep: { /* no-push */
assert( apVal || n==0 );
for(i=0; i<n; i++, pRec++){
apVal[i] = pRec;
- storeTypeInfo(pRec, db->enc);
+ storeTypeInfo(pRec, encoding);
}
ctx.pFunc = (FuncDef*)pOp->p3;
assert( pOp->p1>=0 && pOp->p1<p->nMem );
ctx.pMem = pMem = &p->aMem[pOp->p1];
pMem->n++;
+ ctx.s.flags = MEM_Null;
+ ctx.s.z = 0;
+ ctx.s.xDel = 0;
ctx.isError = 0;
ctx.pColl = 0;
if( ctx.pFunc->needCollSeq ){
@@ -4250,8 +4467,10 @@ case OP_AggStep: { /* no-push */
(ctx.pFunc->xStep)(&ctx, n, apVal);
popStack(&pTos, n);
if( ctx.isError ){
+ sqlite3SetString(&p->zErrMsg, sqlite3_value_text(&ctx.s), (char*)0);
rc = SQLITE_ERROR;
}
+ sqlite3VdbeMemRelease(&ctx.s);
break;
}
@@ -4272,7 +4491,10 @@ case OP_AggFinal: { /* no-push */
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);
+ rc = sqlite3VdbeMemFinalize(pMem, (FuncDef*)pOp->p3);
+ if( rc==SQLITE_ERROR ){
+ sqlite3SetString(&p->zErrMsg, sqlite3_value_text(pMem), (char*)0);
+ }
break;
}
@@ -4308,6 +4530,344 @@ case OP_Expire: { /* no-push */
break;
}
+#ifndef SQLITE_OMIT_SHARED_CACHE
+/* Opcode: TableLock P1 P2 P3
+**
+** Obtain a lock on a particular table. This instruction is only used when
+** the shared-cache feature is enabled.
+**
+** If P1 is not negative, then it is the index of the database
+** in sqlite3.aDb[] and a read-lock is required. If P1 is negative, a
+** write-lock is required. In this case the index of the database is the
+** absolute value of P1 minus one (iDb = abs(P1) - 1;) and a write-lock is
+** required.
+**
+** P2 contains the root-page of the table to lock.
+**
+** P3 contains a pointer to the name of the table being locked. This is only
+** used to generate an error message if the lock cannot be obtained.
+*/
+case OP_TableLock: { /* no-push */
+ int p1 = pOp->p1;
+ u8 isWriteLock = (p1<0);
+ if( isWriteLock ){
+ p1 = (-1*p1)-1;
+ }
+ rc = sqlite3BtreeLockTable(db->aDb[p1].pBt, pOp->p2, isWriteLock);
+ if( rc==SQLITE_LOCKED ){
+ const char *z = (const char *)pOp->p3;
+ sqlite3SetString(&p->zErrMsg, "database table is locked: ", z, (char*)0);
+ }
+ break;
+}
+#endif /* SQLITE_OMIT_SHARED_CACHE */
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/* Opcode: VBegin * * P3
+**
+** P3 a pointer to an sqlite3_vtab structure. Call the xBegin method
+** for that table.
+*/
+case OP_VBegin: { /* no-push */
+ rc = sqlite3VtabBegin(db, (sqlite3_vtab *)pOp->p3);
+ break;
+}
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/* Opcode: VCreate P1 * P3
+**
+** P3 is the name of a virtual table in database P1. Call the xCreate method
+** for that table.
+*/
+case OP_VCreate: { /* no-push */
+ rc = sqlite3VtabCallCreate(db, pOp->p1, pOp->p3, &p->zErrMsg);
+ break;
+}
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/* Opcode: VDestroy P1 * P3
+**
+** P3 is the name of a virtual table in database P1. Call the xDestroy method
+** of that table.
+*/
+case OP_VDestroy: { /* no-push */
+ p->inVtabMethod = 2;
+ rc = sqlite3VtabCallDestroy(db, pOp->p1, pOp->p3);
+ p->inVtabMethod = 0;
+ break;
+}
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/* Opcode: VOpen P1 * P3
+**
+** P3 is a pointer to a virtual table object, an sqlite3_vtab structure.
+** P1 is a cursor number. This opcode opens a cursor to the virtual
+** table and stores that cursor in P1.
+*/
+case OP_VOpen: { /* no-push */
+ Cursor *pCur = 0;
+ sqlite3_vtab_cursor *pVtabCursor = 0;
+
+ sqlite3_vtab *pVtab = (sqlite3_vtab *)(pOp->p3);
+ sqlite3_module *pModule = (sqlite3_module *)pVtab->pModule;
+
+ assert(pVtab && pModule);
+ if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
+ rc = pModule->xOpen(pVtab, &pVtabCursor);
+ if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
+ if( SQLITE_OK==rc ){
+ /* Initialise sqlite3_vtab_cursor base class */
+ pVtabCursor->pVtab = pVtab;
+
+ /* Initialise vdbe cursor object */
+ pCur = allocateCursor(p, pOp->p1, -1);
+ if( pCur ){
+ pCur->pVtabCursor = pVtabCursor;
+ pCur->pModule = pVtabCursor->pVtab->pModule;
+ }else{
+ pModule->xClose(pVtabCursor);
+ }
+ }
+ break;
+}
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/* Opcode: VFilter P1 P2 P3
+**
+** P1 is a cursor opened using VOpen. P2 is an address to jump to if
+** the filtered result set is empty.
+**
+** P3 is either NULL or a string that was generated by the xBestIndex
+** method of the module. The interpretation of the P3 string is left
+** to the module implementation.
+**
+** This opcode invokes the xFilter method on the virtual table specified
+** by P1. The integer query plan parameter to xFilter is the top of the
+** stack. Next down on the stack is the argc parameter. Beneath the
+** next of stack are argc additional parameters which are passed to
+** xFilter as argv. The topmost parameter (i.e. 3rd element popped from
+** the stack) becomes argv[argc-1] when passed to xFilter.
+**
+** The integer query plan parameter, argc, and all argv stack values
+** are popped from the stack before this instruction completes.
+**
+** A jump is made to P2 if the result set after filtering would be
+** empty.
+*/
+case OP_VFilter: { /* no-push */
+ int nArg;
+
+ const sqlite3_module *pModule;
+
+ Cursor *pCur = p->apCsr[pOp->p1];
+ assert( pCur->pVtabCursor );
+ pModule = pCur->pVtabCursor->pVtab->pModule;
+
+ /* Grab the index number and argc parameters off the top of the stack. */
+ assert( (&pTos[-1])>=p->aStack );
+ assert( (pTos[0].flags&MEM_Int)!=0 && pTos[-1].flags==MEM_Int );
+ nArg = pTos[-1].i;
+
+ /* Invoke the xFilter method if one is defined. */
+ if( pModule->xFilter ){
+ int res;
+ int i;
+ Mem **apArg = p->apArg;
+ for(i = 0; i<nArg; i++){
+ apArg[i] = &pTos[i+1-2-nArg];
+ storeTypeInfo(apArg[i], 0);
+ }
+
+ if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
+ p->inVtabMethod = 1;
+ rc = pModule->xFilter(pCur->pVtabCursor, pTos->i, pOp->p3, nArg, apArg);
+ p->inVtabMethod = 0;
+ if( rc==SQLITE_OK ){
+ res = pModule->xEof(pCur->pVtabCursor);
+ }
+ if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
+
+ if( res ){
+ pc = pOp->p2 - 1;
+ }
+ }
+
+ /* Pop the index number, argc value and parameters off the stack */
+ popStack(&pTos, 2+nArg);
+ break;
+}
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/* Opcode: VRowid P1 * *
+**
+** Push an integer onto the stack which is the rowid of
+** the virtual-table that the P1 cursor is pointing to.
+*/
+case OP_VRowid: {
+ const sqlite3_module *pModule;
+
+ Cursor *pCur = p->apCsr[pOp->p1];
+ assert( pCur->pVtabCursor );
+ pModule = pCur->pVtabCursor->pVtab->pModule;
+ if( pModule->xRowid==0 ){
+ sqlite3SetString(&p->zErrMsg, "Unsupported module operation: xRowid", 0);
+ rc = SQLITE_ERROR;
+ } else {
+ sqlite_int64 iRow;
+
+ if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
+ rc = pModule->xRowid(pCur->pVtabCursor, &iRow);
+ if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
+
+ pTos++;
+ pTos->flags = MEM_Int;
+ pTos->i = iRow;
+ }
+
+ break;
+}
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/* Opcode: VColumn P1 P2 *
+**
+** Push onto the stack the value of the P2-th column of
+** the row of the virtual-table that the P1 cursor is pointing to.
+*/
+case OP_VColumn: {
+ const sqlite3_module *pModule;
+
+ Cursor *pCur = p->apCsr[pOp->p1];
+ assert( pCur->pVtabCursor );
+ pModule = pCur->pVtabCursor->pVtab->pModule;
+ if( pModule->xColumn==0 ){
+ sqlite3SetString(&p->zErrMsg, "Unsupported module operation: xColumn", 0);
+ rc = SQLITE_ERROR;
+ } else {
+ sqlite3_context sContext;
+ memset(&sContext, 0, sizeof(sContext));
+ sContext.s.flags = MEM_Null;
+ if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
+ rc = pModule->xColumn(pCur->pVtabCursor, &sContext, pOp->p2);
+
+ /* Copy the result of the function to the top of the stack. We
+ ** do this regardless of whether or not an error occured to ensure any
+ ** dynamic allocation in sContext.s (a Mem struct) is released.
+ */
+ sqlite3VdbeChangeEncoding(&sContext.s, encoding);
+ pTos++;
+ pTos->flags = 0;
+ sqlite3VdbeMemMove(pTos, &sContext.s);
+
+ if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
+ }
+
+ break;
+}
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/* Opcode: VNext P1 P2 *
+**
+** Advance virtual table P1 to the next row in its result set and
+** jump to instruction P2. Or, if the virtual table has reached
+** the end of its result set, then fall through to the next instruction.
+*/
+case OP_VNext: { /* no-push */
+ const sqlite3_module *pModule;
+ int res = 0;
+
+ Cursor *pCur = p->apCsr[pOp->p1];
+ assert( pCur->pVtabCursor );
+ pModule = pCur->pVtabCursor->pVtab->pModule;
+ if( pModule->xNext==0 ){
+ sqlite3SetString(&p->zErrMsg, "Unsupported module operation: xNext", 0);
+ rc = SQLITE_ERROR;
+ } else {
+ /* Invoke the xNext() method of the module. There is no way for the
+ ** underlying implementation to return an error if one occurs during
+ ** xNext(). Instead, if an error occurs, true is returned (indicating that
+ ** data is available) and the error code returned when xColumn or
+ ** some other method is next invoked on the save virtual table cursor.
+ */
+ if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
+ p->inVtabMethod = 1;
+ rc = pModule->xNext(pCur->pVtabCursor);
+ p->inVtabMethod = 0;
+ if( rc==SQLITE_OK ){
+ res = pModule->xEof(pCur->pVtabCursor);
+ }
+ if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
+
+ if( !res ){
+ /* If there is data, jump to P2 */
+ pc = pOp->p2 - 1;
+ }
+ }
+
+ break;
+}
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
+
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/* Opcode: VUpdate P1 P2 P3
+**
+** P3 is a pointer to a virtual table object, an sqlite3_vtab structure.
+** This opcode invokes the corresponding xUpdate method. P2 values
+** are taken from the stack to pass to the xUpdate invocation. The
+** value on the top of the stack corresponds to the p2th element
+** of the argv array passed to xUpdate.
+**
+** The xUpdate method will do a DELETE or an INSERT or both.
+** The argv[0] element (which corresponds to the P2-th element down
+** on the stack) is the rowid of a row to delete. If argv[0] is
+** NULL then no deletion occurs. The argv[1] element is the rowid
+** of the new row. This can be NULL to have the virtual table
+** select the new rowid for itself. The higher elements in the
+** stack are the values of columns in the new row.
+**
+** If P2==1 then no insert is performed. argv[0] is the rowid of
+** a row to delete.
+**
+** P1 is a boolean flag. If it is set to true and the xUpdate call
+** is successful, then the value returned by sqlite3_last_insert_rowid()
+** is set to the value of the rowid for the row just inserted.
+*/
+case OP_VUpdate: { /* no-push */
+ sqlite3_vtab *pVtab = (sqlite3_vtab *)(pOp->p3);
+ sqlite3_module *pModule = (sqlite3_module *)pVtab->pModule;
+ int nArg = pOp->p2;
+ assert( pOp->p3type==P3_VTAB );
+ if( pModule->xUpdate==0 ){
+ sqlite3SetString(&p->zErrMsg, "read-only table", 0);
+ rc = SQLITE_ERROR;
+ }else{
+ int i;
+ sqlite_int64 rowid;
+ Mem **apArg = p->apArg;
+ Mem *pX = &pTos[1-nArg];
+ for(i = 0; i<nArg; i++, pX++){
+ storeTypeInfo(pX, 0);
+ apArg[i] = pX;
+ }
+ if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
+ rc = pModule->xUpdate(pVtab, nArg, apArg, &rowid);
+ if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse;
+ if( pOp->p1 && rc==SQLITE_OK ){
+ assert( nArg>1 && apArg[0] && (apArg[0]->flags&MEM_Null) );
+ db->lastRowid = rowid;
+ }
+ }
+ popStack(&pTos, nArg);
+ break;
+}
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
/* An other opcode is illegal...
*/
@@ -4345,9 +4905,13 @@ default: {
** 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);
+ /* Sanity checking on the top element of the stack. If the previous
+ ** instruction was VNoChange, then the flags field of the top
+ ** of the stack is set to 0. This is technically invalid for a memory
+ ** cell, so avoid calling MemSanity() in this case.
+ */
+ if( pTos>=p->aStack && pTos->flags ){
+ sqlite3VdbeMemSanity(pTos);
}
assert( pc>=-1 && pc<p->nOp );
#ifdef SQLITE_DEBUG
@@ -4366,7 +4930,7 @@ default: {
fprintf(p->trace, " r:%g", pTos[i].r);
}else{
char zBuf[100];
- sqlite3VdbeMemPrettyPrint(&pTos[i], zBuf, 100);
+ sqlite3VdbeMemPrettyPrint(&pTos[i], zBuf);
fprintf(p->trace, " ");
fprintf(p->trace, "%s", zBuf);
}
@@ -4410,7 +4974,7 @@ abort_due_to_misuse:
*/
abort_due_to_error:
if( p->zErrMsg==0 ){
- if( sqlite3_malloc_failed ) rc = SQLITE_NOMEM;
+ if( sqlite3MallocFailed() ) rc = SQLITE_NOMEM;
sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(rc), (char*)0);
}
goto vdbe_halt;
@@ -4419,8 +4983,7 @@ abort_due_to_error:
** flag.
*/
abort_due_to_interrupt:
- assert( db->flags & SQLITE_Interrupt );
- db->flags &= ~SQLITE_Interrupt;
+ assert( db->u1.isInterrupted );
if( db->magic!=SQLITE_MAGIC_BUSY ){
rc = SQLITE_MISUSE;
}else{
diff --git a/ext/pdo_sqlite/sqlite/src/vdbe.h b/ext/pdo_sqlite/sqlite/src/vdbe.h
index 06932503f..903a18dcd 100644
--- a/ext/pdo_sqlite/sqlite/src/vdbe.h
+++ b/ext/pdo_sqlite/sqlite/src/vdbe.h
@@ -69,6 +69,9 @@ typedef struct VdbeOpList VdbeOpList;
#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 */
+#define P3_TRANSIENT (-9) /* P3 is a pointer to a transient string */
+#define P3_VTAB (-10) /* P3 is a pointer to an sqlite3_vtab structure */
+#define P3_MPRINTF (-11) /* P3 is a string obtained from sqlite3_mprintf() */
/* 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
@@ -80,6 +83,17 @@ typedef struct VdbeOpList VdbeOpList;
#define P3_KEYINFO_HANDOFF (-9)
/*
+** The Vdbe.aColName array contains 5n Mem structures, where n is the
+** number of columns of data returned by the statement.
+*/
+#define COLNAME_NAME 0
+#define COLNAME_DECLTYPE 1
+#define COLNAME_DATABASE 2
+#define COLNAME_TABLE 3
+#define COLNAME_COLUMN 4
+#define COLNAME_N 5 /* Number of COLNAME_xxx symbols */
+
+/*
** 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
@@ -105,6 +119,7 @@ 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 sqlite3VdbeChangeToNoop(Vdbe*, int addr, int N);
void sqlite3VdbeChangeP3(Vdbe*, int addr, const char *zP1, int N);
VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
int sqlite3VdbeMakeLabel(Vdbe*);
@@ -117,7 +132,7 @@ void sqlite3VdbeTrace(Vdbe*,FILE*);
int sqlite3VdbeReset(Vdbe*);
int sqliteVdbeSetVariables(Vdbe*,int,const char**);
void sqlite3VdbeSetNumCols(Vdbe*,int);
-int sqlite3VdbeSetColName(Vdbe*, int, const char *, int);
+int sqlite3VdbeSetColName(Vdbe*, int, int, const char *, int);
void sqlite3VdbeCountChanges(Vdbe*);
sqlite3 *sqlite3VdbeDb(Vdbe*);
diff --git a/ext/pdo_sqlite/sqlite/src/vdbeInt.h b/ext/pdo_sqlite/sqlite/src/vdbeInt.h
index 1746ee561..db8034061 100644
--- a/ext/pdo_sqlite/sqlite/src/vdbeInt.h
+++ b/ext/pdo_sqlite/sqlite/src/vdbeInt.h
@@ -60,6 +60,7 @@ typedef unsigned char Bool;
*/
struct Cursor {
BtCursor *pCursor; /* The cursor structure of the backend */
+ int iDb; /* Index of cursor database in db->aDb[] (or -1) */
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 */
@@ -82,12 +83,15 @@ struct Cursor {
KeyInfo *pKeyInfo; /* Info about index keys needed by index cursors */
int nField; /* Number of fields in the header */
i64 seqCount; /* Sequence counter */
+ sqlite3_vtab_cursor *pVtabCursor; /* The cursor for a virtual table */
+ const sqlite3_module *pModule; /* Module for cursor pVtabCursor */
/* 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 */
+ ** aRow might point to (ephemeral) data for the current row, or it might
+ ** be NULL.
+ */
+ int cacheStatus; /* Cache is valid if this matches Vdbe.cacheCtr */
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 */
@@ -103,6 +107,11 @@ typedef struct Cursor Cursor;
#define NBFS 32
/*
+** A value for Cursor.cacheValid that means the cache is always invalid.
+*/
+#define CACHE_STALE 0
+
+/*
** 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)
@@ -250,7 +259,7 @@ struct Fifo {
*/
typedef struct Context Context;
struct Context {
- int lastRowid; /* Last insert rowid (sqlite3.lastRowid) */
+ i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */
int nChange; /* Statement changes (Vdbe.nChanges) */
Fifo sFifo; /* Records that will participate in a DELETE or UPDATE */
};
@@ -261,6 +270,14 @@ struct Context {
**
** The "sqlite3_stmt" structure pointer that is returned by sqlite3_compile()
** is really a pointer to an instance of this structure.
+**
+** The Vdbe.inVtabMethod variable is set to non-zero for the duration of
+** any virtual table method invocations made by the vdbe program. It is
+** set to 2 for xDestroy method calls and 1 for all other methods. This
+** variable is used for two purposes: to allow xDestroy methods to execute
+** "DROP TABLE" statements and to prevent some nasty side effects of
+** malloc failure when SQLite is invoked recursively by a virtual table
+** method function.
*/
struct Vdbe {
sqlite3 *db; /* The whole database */
@@ -286,6 +303,7 @@ struct Vdbe {
int nMem; /* Number of memory locations currently allocated */
Mem *aMem; /* The memory locations */
int nCallback; /* Number of callbacks invoked so far */
+ int cacheCtr; /* Cursor row cache generation counter */
Fifo sFifo; /* A list of ROWIDs */
int contextStackTop; /* Index of top element in the context stack */
int contextStackDepth; /* The size of the "context" stack */
@@ -306,8 +324,14 @@ struct Vdbe {
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 */
+ u8 minWriteFileFormat; /* Minimum file format for writable database files */
+ u8 inVtabMethod; /* See comments above */
int nChange; /* Number of db changes made since last reset */
i64 startTime; /* Time when query started - used for profiling */
+#ifdef SQLITE_SSE
+ int fetchId; /* Statement number used by sqlite3_fetch_statement */
+ int lru; /* Counter used for LRU cache replacement */
+#endif
};
/*
@@ -321,7 +345,7 @@ struct Vdbe {
/*
** Function prototypes
*/
-void sqlite3VdbeFreeCursor(Cursor*);
+void sqlite3VdbeFreeCursor(Vdbe *, Cursor*);
void sqliteVdbePopStack(Vdbe*,int);
int sqlite3VdbeCursorMoveto(Cursor*);
#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
@@ -331,8 +355,8 @@ void sqlite3VdbePrintOp(FILE*, int, Op*);
void sqlite3VdbePrintSql(Vdbe*);
#endif
int sqlite3VdbeSerialTypeLen(u32);
-u32 sqlite3VdbeSerialType(Mem*);
-int sqlite3VdbeSerialPut(unsigned char*, Mem*);
+u32 sqlite3VdbeSerialType(Mem*, int);
+int sqlite3VdbeSerialPut(unsigned char*, Mem*, int);
int sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
void sqlite3VdbeDeleteAuxData(VdbeFunc*, int);
@@ -341,7 +365,7 @@ 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 sqlite3VdbeIdxRowidLen(const u8*);
int sqlite3VdbeExec(Vdbe*);
int sqlite3VdbeList(Vdbe*);
int sqlite3VdbeHalt(Vdbe*);
@@ -360,16 +384,18 @@ int sqlite3VdbeMemStringify(Mem*, int);
i64 sqlite3VdbeIntValue(Mem*);
int sqlite3VdbeMemIntegerify(Mem*);
double sqlite3VdbeRealValue(Mem*);
+void sqlite3VdbeIntegerAffinity(Mem*);
int sqlite3VdbeMemRealify(Mem*);
+int sqlite3VdbeMemNumerify(Mem*);
int sqlite3VdbeMemFromBtree(BtCursor*,int,int,int,Mem*);
void sqlite3VdbeMemRelease(Mem *p);
-void sqlite3VdbeMemFinalize(Mem*, FuncDef*);
+int sqlite3VdbeMemFinalize(Mem*, FuncDef*);
#ifndef NDEBUG
-void sqlite3VdbeMemSanity(Mem*, u8);
+void sqlite3VdbeMemSanity(Mem*);
int sqlite3VdbeOpcodeNoPush(u8);
#endif
int sqlite3VdbeMemTranslate(Mem*, u8);
-void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf, int nBuf);
+void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf);
int sqlite3VdbeMemHandleBom(Mem *pMem);
void sqlite3VdbeFifoInit(Fifo*);
int sqlite3VdbeFifoPush(Fifo*, i64);
diff --git a/ext/pdo_sqlite/sqlite/src/vdbeapi.c b/ext/pdo_sqlite/sqlite/src/vdbeapi.c
index 2fd54f38e..a0ced3d79 100644
--- a/ext/pdo_sqlite/sqlite/src/vdbeapi.c
+++ b/ext/pdo_sqlite/sqlite/src/vdbeapi.c
@@ -58,7 +58,7 @@ 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);
+ return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
}
#ifndef SQLITE_OMIT_UTF16
const void *sqlite3_value_text16(sqlite3_value* pVal){
@@ -74,6 +74,7 @@ const void *sqlite3_value_text16le(sqlite3_value *pVal){
int sqlite3_value_type(sqlite3_value* pVal){
return pVal->type;
}
+/* sqlite3_value_numeric_type() defined in vdbe.c */
/**************************** sqlite3_result_ *******************************
** The following routines are used by user-defined functions to specify
@@ -95,10 +96,12 @@ void sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
pCtx->isError = 1;
sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
}
+#ifndef SQLITE_OMIT_UTF16
void sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
pCtx->isError = 1;
sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
}
+#endif
void sqlite3_result_int(sqlite3_context *pCtx, int iVal){
sqlite3VdbeMemSetInt64(&pCtx->s, (i64)iVal);
}
@@ -156,6 +159,9 @@ int sqlite3_step(sqlite3_stmt *pStmt){
sqlite3 *db;
int rc;
+ /* Assert that malloc() has not failed */
+ assert( !sqlite3MallocFailed() );
+
if( p==0 || p->magic!=VDBE_MAGIC_RUN ){
return SQLITE_MISUSE;
}
@@ -174,6 +180,14 @@ int sqlite3_step(sqlite3_stmt *pStmt){
return SQLITE_MISUSE;
}
if( p->pc<0 ){
+ /* If there are no other statements currently running, then
+ ** reset the interrupt flag. This prevents a call to sqlite3_interrupt
+ ** from interrupting a statement that has not yet started.
+ */
+ if( db->activeVdbeCnt==0 ){
+ db->u1.isInterrupted = 0;
+ }
+
#ifndef SQLITE_OMIT_TRACE
/* Invoke the trace callback if there is one
*/
@@ -238,7 +252,8 @@ int sqlite3_step(sqlite3_stmt *pStmt){
}
#endif
- sqlite3Error(p->db, rc, p->zErrMsg ? "%s" : 0, p->zErrMsg);
+ sqlite3Error(p->db, rc, 0);
+ p->rc = sqlite3ApiExit(p->db, p->rc);
return rc;
}
@@ -329,9 +344,10 @@ void sqlite3_set_auxdata(
** 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.
+** This function is deprecated. Do not use it for new code. It is
+** provide only to avoid breaking legacy code. New aggregate function
+** implementations should keep their own counts within their aggregate
+** context.
*/
int sqlite3_aggregate_count(sqlite3_context *p){
assert( p && p->pFunc && p->pFunc->xStep );
@@ -367,53 +383,105 @@ 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; }
+ static const Mem nullMem = {0, 0.0, "", 0, MEM_Null, MEM_Null };
sqlite3Error(pVm->db, SQLITE_RANGE, 0);
- return &nullMem;
+ return (Mem*)&nullMem;
}
return &pVm->pTos[(1-vals)+i];
}
+/*
+** This function is called after invoking an sqlite3_value_XXX function on a
+** column value (i.e. a value returned by evaluating an SQL expression in the
+** select list of a SELECT statement) that may cause a malloc() failure. If
+** malloc() has failed, the threads mallocFailed flag is cleared and the result
+** code of statement pStmt set to SQLITE_NOMEM.
+**
+** Specificly, this is called from within:
+**
+** sqlite3_column_int()
+** sqlite3_column_int64()
+** sqlite3_column_text()
+** sqlite3_column_text16()
+** sqlite3_column_real()
+** sqlite3_column_bytes()
+** sqlite3_column_bytes16()
+**
+** But not for sqlite3_column_blob(), which never calls malloc().
+*/
+static void columnMallocFailure(sqlite3_stmt *pStmt)
+{
+ /* If malloc() failed during an encoding conversion within an
+ ** sqlite3_column_XXX API, then set the return code of the statement to
+ ** SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR
+ ** and _finalize() will return NOMEM.
+ */
+ Vdbe *p = (Vdbe *)pStmt;
+ p->rc = sqlite3ApiExit(0, p->rc);
+}
+
/**************************** 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) );
+ const void *val;
+ sqlite3MallocDisallow();
+ val = sqlite3_value_blob( columnMem(pStmt,i) );
+ sqlite3MallocAllow();
+ return val;
}
int sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
- return sqlite3_value_bytes( columnMem(pStmt,i) );
+ int val = sqlite3_value_bytes( columnMem(pStmt,i) );
+ columnMallocFailure(pStmt);
+ return val;
}
int sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){
- return sqlite3_value_bytes16( columnMem(pStmt,i) );
+ int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
+ columnMallocFailure(pStmt);
+ return val;
}
double sqlite3_column_double(sqlite3_stmt *pStmt, int i){
- return sqlite3_value_double( columnMem(pStmt,i) );
+ double val = sqlite3_value_double( columnMem(pStmt,i) );
+ columnMallocFailure(pStmt);
+ return val;
}
int sqlite3_column_int(sqlite3_stmt *pStmt, int i){
- return sqlite3_value_int( columnMem(pStmt,i) );
+ int val = sqlite3_value_int( columnMem(pStmt,i) );
+ columnMallocFailure(pStmt);
+ return val;
}
sqlite_int64 sqlite3_column_int64(sqlite3_stmt *pStmt, int i){
- return sqlite3_value_int64( columnMem(pStmt,i) );
+ sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
+ columnMallocFailure(pStmt);
+ return val;
}
const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){
- return sqlite3_value_text( columnMem(pStmt,i) );
+ const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
+ columnMallocFailure(pStmt);
+ return val;
}
-#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) );
+ const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
+ columnMallocFailure(pStmt);
+ return val;
}
#endif /* SQLITE_OMIT_UTF16 */
int sqlite3_column_type(sqlite3_stmt *pStmt, int i){
return sqlite3_value_type( columnMem(pStmt,i) );
}
+/* The following function is experimental and subject to change or
+** removal */
+/*int sqlite3_column_numeric_type(sqlite3_stmt *pStmt, int i){
+** return sqlite3_value_numeric_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.
@@ -436,6 +504,7 @@ static const void *columnName(
const void *(*xFunc)(Mem*),
int useType
){
+ const void *ret;
Vdbe *p = (Vdbe *)pStmt;
int n = sqlite3_column_count(pStmt);
@@ -443,20 +512,27 @@ static const void *columnName(
return 0;
}
N += useType*n;
- return xFunc(&p->aColName[N]);
-}
+ ret = xFunc(&p->aColName[N]);
+ /* A malloc may have failed inside of the xFunc() call. If this is the case,
+ ** clear the mallocFailed flag and return NULL.
+ */
+ sqlite3ApiExit(0, 0);
+ return ret;
+}
/*
** 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);
+ return columnName(
+ pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
}
#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);
+ return columnName(
+ pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
}
#endif
@@ -465,26 +541,30 @@ const void *sqlite3_column_name16(sqlite3_stmt *pStmt, int N){
** 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);
+ return columnName(
+ pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
}
#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);
+ return columnName(
+ pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
}
#endif /* SQLITE_OMIT_UTF16 */
-#if !defined(SQLITE_OMIT_ORIGIN_NAMES) && 0
+#ifdef SQLITE_ENABLE_COLUMN_METADATA
/*
** 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);
+ return columnName(
+ pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
}
#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);
+ return columnName(
+ pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
}
#endif /* SQLITE_OMIT_UTF16 */
@@ -494,11 +574,13 @@ const void *sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){
** 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);
+ return columnName(
+ pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
}
#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);
+ return columnName(
+ pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
}
#endif /* SQLITE_OMIT_UTF16 */
@@ -508,16 +590,16 @@ const void *sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){
** 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);
+ return columnName(
+ pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
}
#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);
+ return columnName(
+ pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
}
#endif /* SQLITE_OMIT_UTF16 */
-#endif /* SQLITE_OMIT_ORIGIN_NAMES */
-
-
+#endif /* SQLITE_ENABLE_COLUMN_METADATA */
/******************************* sqlite3_bind_ ***************************
@@ -571,13 +653,12 @@ static int bindText(
}
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);
+ rc = sqlite3VdbeChangeEncoding(pVar, ENC(p->db));
}
- return rc;
+
+ sqlite3Error(((Vdbe *)pStmt)->db, rc, 0);
+ return sqlite3ApiExit(((Vdbe *)pStmt)->db, rc);
}
@@ -637,6 +718,15 @@ int sqlite3_bind_text16(
return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
}
#endif /* SQLITE_OMIT_UTF16 */
+int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
+ int rc;
+ Vdbe *p = (Vdbe *)pStmt;
+ rc = vdbeUnbind(p, i);
+ if( rc==SQLITE_OK ){
+ sqlite3VdbeMemCopy(&p->aVar[i-1], pValue);
+ }
+ return rc;
+}
/*
** Return the number of wildcards that can be potentially bound to.
@@ -721,7 +811,9 @@ int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
return SQLITE_ERROR;
}
for(i=0; rc==SQLITE_OK && i<pFrom->nVar; i++){
+ sqlite3MallocDisallow();
rc = sqlite3VdbeMemMove(&pTo->aVar[i], &pFrom->aVar[i]);
+ sqlite3MallocAllow();
}
return rc;
}
diff --git a/ext/pdo_sqlite/sqlite/src/vdbeaux.c b/ext/pdo_sqlite/sqlite/src/vdbeaux.c
index cba9c096d..c71c8f4ea 100644
--- a/ext/pdo_sqlite/sqlite/src/vdbeaux.c
+++ b/ext/pdo_sqlite/sqlite/src/vdbeaux.c
@@ -58,8 +58,14 @@ void sqlite3VdbeTrace(Vdbe *p, FILE *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.
+** the Vdbe.aOp array will be sized to contain exactly N
+** elements. Vdbe.nOpAlloc is set to reflect the new size of
+** the array.
+**
+** If an out-of-memory error occurs while resizing the array,
+** Vdbe.aOp and Vdbe.nOpAlloc remain unchanged (this is so that
+** any opcodes already allocated can be correctly deallocated
+** along with the rest of the Vdbe).
*/
static void resizeOpArray(Vdbe *p, int N){
int runMode = p->magic==VDBE_MAGIC_RUN;
@@ -101,9 +107,11 @@ int sqlite3VdbeAddOp(Vdbe *p, int op, int p1, int p2){
i = p->nOp;
p->nOp++;
assert( p->magic==VDBE_MAGIC_INIT );
- resizeOpArray(p, i+1);
- if( sqlite3_malloc_failed ){
- return 0;
+ if( p->nOpAlloc<=i ){
+ resizeOpArray(p, i+1);
+ if( sqlite3MallocFailed() ){
+ return 0;
+ }
}
pOp = &p->aOp[i];
pOp->opcode = op;
@@ -147,7 +155,7 @@ int sqlite3VdbeMakeLabel(Vdbe *p){
assert( p->magic==VDBE_MAGIC_INIT );
if( i>=p->nLabelAlloc ){
p->nLabelAlloc = p->nLabelAlloc*2 + 10;
- sqlite3ReallocOrFree((void**)&p->aLabel,
+ sqliteReallocOrFree((void**)&p->aLabel,
p->nLabelAlloc*sizeof(p->aLabel[0]));
}
if( p->aLabel ){
@@ -196,12 +204,13 @@ static int opcodeNoPush(u8 op){
** 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)
+ NOPUSH_MASK_0 + (((unsigned)NOPUSH_MASK_1)<<16),
+ NOPUSH_MASK_2 + (((unsigned)NOPUSH_MASK_3)<<16),
+ NOPUSH_MASK_4 + (((unsigned)NOPUSH_MASK_5)<<16),
+ NOPUSH_MASK_6 + (((unsigned)NOPUSH_MASK_7)<<16),
+ NOPUSH_MASK_8 + (((unsigned)NOPUSH_MASK_9)<<16)
};
+ assert( op<32*5 );
return (masks[op>>5] & (1<<(op&0x1F)));
}
@@ -219,7 +228,7 @@ int sqlite3VdbeOpcodeNoPush(u8 op){
** 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
+** to an OP_Function, OP_AggStep or OP_VFilter opcode. This is used by
** sqlite3VdbeMakeReady() to size the Vdbe.apArg[] array.
**
** The integer *pMaxStack is set to the maximum number of vdbe stack
@@ -242,20 +251,25 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs, int *pMaxStack){
for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){
u8 opcode = pOp->opcode;
- if( opcode==OP_Function || opcode==OP_AggStep ){
+ if( opcode==OP_Function || opcode==OP_AggStep
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ || opcode==OP_VUpdate
+#endif
+ ){
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;
+ }else if( opcode==OP_VFilter ){
+ int n;
+ assert( p->nOp - i >= 3 );
+ assert( pOp[-2].opcode==OP_Integer );
+ n = pOp[-2].p1;
+ if( n>nMaxArgs ) nMaxArgs = n;
}
-
if( opcodeNoPush(opcode) ){
nMaxStack--;
}
@@ -300,7 +314,7 @@ 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 ){
+ if( sqlite3MallocFailed() ){
return 0;
}
addr = p->nOp;
@@ -333,7 +347,7 @@ int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){
** few minor changes to the program.
*/
void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
- assert( p->magic==VDBE_MAGIC_INIT );
+ assert( p==0 || p->magic==VDBE_MAGIC_INIT );
if( p && addr>=0 && p->nOp>addr && p->aOp ){
p->aOp[addr].p1 = val;
}
@@ -345,20 +359,31 @@ void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
*/
void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
assert( val>=0 );
- assert( p->magic==VDBE_MAGIC_INIT );
+ assert( p==0 || 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
+** Change the 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);
}
+
+/*
+** If the input FuncDef structure is ephemeral, then free it. If
+** the FuncDef is not ephermal, then do nothing.
+*/
+static void freeEphemeralFunction(FuncDef *pDef){
+ if( pDef && (pDef->flags & SQLITE_FUNC_EPHEM)!=0 ){
+ sqliteFree(pDef);
+ }
+}
+
/*
** Delete a P3 value if necessary.
*/
@@ -371,12 +396,21 @@ static void freeP3(int p3type, void *p3){
sqliteFree(p3);
break;
}
+ case P3_MPRINTF: {
+ sqlite3_free(p3);
+ break;
+ }
case P3_VDBEFUNC: {
VdbeFunc *pVdbeFunc = (VdbeFunc *)p3;
+ freeEphemeralFunction(pVdbeFunc->pFunc);
sqlite3VdbeDeleteAuxData(pVdbeFunc, 0);
sqliteFree(pVdbeFunc);
break;
}
+ case P3_FUNCDEF: {
+ freeEphemeralFunction((FuncDef*)p3);
+ break;
+ }
case P3_MEM: {
sqlite3ValueFree((sqlite3_value*)p3);
break;
@@ -387,6 +421,19 @@ static void freeP3(int p3type, void *p3){
/*
+** Change N opcodes starting at addr to No-ops.
+*/
+void sqlite3VdbeChangeToNoop(Vdbe *p, int addr, int N){
+ VdbeOp *pOp = &p->aOp[addr];
+ while( N-- ){
+ freeP3(pOp->p3type, pOp->p3);
+ memset(pOp, 0, sizeof(pOp[0]));
+ pOp->opcode = OP_Noop;
+ pOp++;
+ }
+}
+
+/*
** 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
@@ -413,9 +460,11 @@ static void freeP3(int p3type, void *p3){
*/
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);
+ assert( p==0 || p->magic==VDBE_MAGIC_INIT );
+ if( p==0 || p->aOp==0 || sqlite3MallocFailed() ){
+ if (n != P3_KEYINFO) {
+ freeP3(n, (void*)*(char**)&zP3);
+ }
return;
}
if( addr<0 || addr>=p->nOp ){
@@ -432,16 +481,18 @@ void sqlite3VdbeChangeP3(Vdbe *p, int addr, const char *zP3, int n){
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]);
+ nByte = sizeof(*pKeyInfo) + (nField-1)*sizeof(pKeyInfo->aColl[0]) + nField;
pKeyInfo = sqliteMallocRaw( nByte );
pOp->p3 = (char*)pKeyInfo;
if( pKeyInfo ){
+ unsigned char *aSortOrder;
memcpy(pKeyInfo, zP3, nByte);
+ aSortOrder = pKeyInfo->aSortOrder;
+ if( aSortOrder ){
+ pKeyInfo->aSortOrder = (unsigned char*)&pKeyInfo->aColl[nField];
+ memcpy(pKeyInfo->aSortOrder, aSortOrder, nField);
+ }
pOp->p3type = P3_KEYINFO;
}else{
pOp->p3type = P3_NOTUSED;
@@ -467,7 +518,8 @@ void sqlite3VdbeChangeP3(Vdbe *p, int addr, const char *zP3, int n){
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 );
+ assert( p->aOp==0 || p->aOp[p->nOp-1].p3==0
+ || sqlite3MallocFailed() );
va_start(ap, zFormat);
sqlite3VdbeChangeP3(p, -1, sqlite3VMPrintf(zFormat, ap), P3_DYNAMIC);
va_end(ap);
@@ -531,15 +583,18 @@ static char *displayP3(Op *pOp, char *zTemp, int nTemp){
}
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);
- }
+ sqlite3_snprintf(nTemp, zTemp, "%s(%d)", pDef->zName, pDef->nArg);
+ zP3 = zTemp;
+ break;
+ }
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ case P3_VTAB: {
+ sqlite3_vtab *pVtab = (sqlite3_vtab*)pOp->p3;
+ sqlite3_snprintf(nTemp, zTemp, "vtab:%p:%p", pVtab, pVtab->pModule);
zP3 = zTemp;
break;
}
+#endif
default: {
zP3 = pOp->p3;
if( zP3==0 || pOp->opcode==OP_Noop ){
@@ -547,6 +602,7 @@ static char *displayP3(Op *pOp, char *zTemp, int nTemp){
}
}
}
+ assert( zP3!=0 );
return zP3;
}
#endif
@@ -614,8 +670,7 @@ int sqlite3VdbeList(
if( i>=p->nOp ){
p->rc = SQLITE_OK;
rc = SQLITE_DONE;
- }else if( db->flags & SQLITE_Interrupt ){
- db->flags &= ~SQLITE_Interrupt;
+ }else if( db->u1.isInterrupted ){
p->rc = SQLITE_INTERRUPT;
rc = SQLITE_ERROR;
sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(p->rc), (char*)0);
@@ -629,6 +684,7 @@ int sqlite3VdbeList(
pMem->flags = MEM_Static|MEM_Str|MEM_Term;
pMem->z = sqlite3OpcodeNames[pOp->opcode]; /* Opcode */
+ assert( pMem->z!=0 );
pMem->n = strlen(pMem->z);
pMem->type = SQLITE_TEXT;
pMem->enc = SQLITE_UTF8;
@@ -644,8 +700,10 @@ int sqlite3VdbeList(
pMem->type = SQLITE_INTEGER;
pMem++;
- pMem->flags = MEM_Short|MEM_Str|MEM_Term; /* P3 */
+ pMem->flags = MEM_Ephem|MEM_Str|MEM_Term; /* P3 */
pMem->z = displayP3(pOp, pMem->zShort, sizeof(pMem->zShort));
+ assert( pMem->z!=0 );
+ pMem->n = strlen(pMem->z);
pMem->type = SQLITE_TEXT;
pMem->enc = SQLITE_UTF8;
@@ -724,7 +782,9 @@ void sqlite3VdbeMakeReady(
resizeOpArray(p, p->nOp);
assert( nVar>=0 );
assert( nStack<p->nOp );
- nStack = isExplain ? 10 : nStack;
+ if( isExplain ){
+ nStack = 10;
+ }
p->aStack = sqliteMalloc(
nStack*sizeof(p->aStack[0]) /* aStack */
+ nArg*sizeof(Mem*) /* apArg */
@@ -733,7 +793,7 @@ void sqlite3VdbeMakeReady(
+ nMem*sizeof(Mem) /* aMem */
+ nCursor*sizeof(Cursor*) /* apCsr */
);
- if( !sqlite3_malloc_failed ){
+ if( !sqlite3MallocFailed() ){
p->aMem = &p->aStack[nStack];
p->nMem = nMem;
p->aVar = &p->aMem[nMem];
@@ -777,6 +837,8 @@ void sqlite3VdbeMakeReady(
p->explain |= isExplain;
p->magic = VDBE_MAGIC_RUN;
p->nChange = 0;
+ p->cacheCtr = 1;
+ p->minWriteFileFormat = 255;
#ifdef VDBE_PROFILE
{
int i;
@@ -792,7 +854,7 @@ void sqlite3VdbeMakeReady(
** Close a cursor and release all the resources that cursor happens
** to hold.
*/
-void sqlite3VdbeFreeCursor(Cursor *pCx){
+void sqlite3VdbeFreeCursor(Vdbe *p, Cursor *pCx){
if( pCx==0 ){
return;
}
@@ -802,6 +864,17 @@ void sqlite3VdbeFreeCursor(Cursor *pCx){
if( pCx->pBt ){
sqlite3BtreeClose(pCx->pBt);
}
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( pCx->pVtabCursor ){
+ sqlite3_vtab_cursor *pVtabCursor = pCx->pVtabCursor;
+ const sqlite3_module *pModule = pCx->pModule;
+ p->inVtabMethod = 1;
+ sqlite3SafetyOff(p->db);
+ pModule->xClose(pVtabCursor);
+ sqlite3SafetyOn(p->db);
+ p->inVtabMethod = 0;
+ }
+#endif
sqliteFree(pCx->pData);
sqliteFree(pCx->aType);
sqliteFree(pCx);
@@ -814,8 +887,10 @@ 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;
+ if( !p->inVtabMethod || (p->apCsr[i] && !p->apCsr[i]->pVtabCursor) ){
+ sqlite3VdbeFreeCursor(p, p->apCsr[i]);
+ p->apCsr[i] = 0;
+ }
}
}
@@ -857,9 +932,10 @@ static void Cleanup(Vdbe *p){
void sqlite3VdbeSetNumCols(Vdbe *p, int nResColumn){
Mem *pColName;
int n;
- assert( 0==p->nResColumn );
+ releaseMemArray(p->aColName, p->nResColumn*COLNAME_N);
+ sqliteFree(p->aColName);
+ n = nResColumn*COLNAME_N;
p->nResColumn = nResColumn;
- n = nResColumn*2;
p->aColName = pColName = (Mem*)sqliteMalloc( sizeof(Mem)*n );
if( p->aColName==0 ) return;
while( n-- > 0 ){
@@ -878,13 +954,14 @@ void sqlite3VdbeSetNumCols(Vdbe *p, int nResColumn){
** 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 sqlite3VdbeSetColName(Vdbe *p, int idx, int var, const char *zName, int N){
int rc;
Mem *pColName;
- assert( idx<(2*p->nResColumn) );
- if( sqlite3_malloc_failed ) return SQLITE_NOMEM;
+ assert( idx<p->nResColumn );
+ assert( var<COLNAME_N );
+ if( sqlite3MallocFailed() ) return SQLITE_NOMEM;
assert( p->aColName!=0 );
- pColName = &(p->aColName[idx]);
+ pColName = &(p->aColName[idx+var*p->nResColumn]);
if( N==P3_DYNAMIC || N==P3_STATIC ){
rc = sqlite3VdbeMemSetStr(pColName, zName, -1, SQLITE_UTF8, SQLITE_STATIC);
}else{
@@ -909,6 +986,23 @@ static int vdbeCommit(sqlite3 *db){
int rc = SQLITE_OK;
int needXcommit = 0;
+ /* Before doing anything else, call the xSync() callback for any
+ ** virtual module tables written in this transaction. This has to
+ ** be done before determining whether a master journal file is
+ ** required, as an xSync() callback may add an attached database
+ ** to the transaction.
+ */
+ rc = sqlite3VtabSync(db, rc);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+
+ /* This loop determines (a) if the commit hook should be invoked and
+ ** (b) how many database files have open write transactions, not
+ ** including the temp database. (b) is important because if more than
+ ** one database file has an open write transaction, a master journal
+ ** file is required for an atomic commit.
+ */
for(i=0; i<db->nDb; i++){
Btree *pBt = db->aDb[i].pBt;
if( pBt && sqlite3BtreeIsInTrans(pBt) ){
@@ -919,7 +1013,6 @@ static int vdbeCommit(sqlite3 *db){
/* 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);
@@ -953,6 +1046,7 @@ static int vdbeCommit(sqlite3 *db){
sqlite3BtreeCommit(pBt);
}
}
+ sqlite3VtabCommit(db);
}
}
@@ -965,7 +1059,7 @@ static int vdbeCommit(sqlite3 *db){
int needSync = 0;
char *zMaster = 0; /* File-name for the master journal */
char const *zMainFile = sqlite3BtreeGetFilename(db->aDb[0].pBt);
- OsFile master;
+ OsFile *master = 0;
/* Select a master journal file name */
do {
@@ -979,7 +1073,6 @@ static int vdbeCommit(sqlite3 *db){
}while( sqlite3OsFileExists(zMaster) );
/* Open the master journal. */
- memset(&master, 0, sizeof(master));
rc = sqlite3OsOpenExclusive(zMaster, &master, 0);
if( rc!=SQLITE_OK ){
sqliteFree(zMaster);
@@ -1001,7 +1094,7 @@ static int vdbeCommit(sqlite3 *db){
if( !needSync && !sqlite3BtreeSyncDisabled(pBt) ){
needSync = 1;
}
- rc = sqlite3OsWrite(&master, zFile, strlen(zFile)+1);
+ rc = sqlite3OsWrite(master, zFile, strlen(zFile)+1);
if( rc!=SQLITE_OK ){
sqlite3OsClose(&master);
sqlite3OsDelete(zMaster);
@@ -1016,9 +1109,9 @@ static int vdbeCommit(sqlite3 *db){
** the master journal file is store in so that it gets synced too.
*/
zMainFile = sqlite3BtreeGetDirname(db->aDb[0].pBt);
- rc = sqlite3OsOpenDirectory(zMainFile, &master);
+ rc = sqlite3OsOpenDirectory(master, zMainFile);
if( rc!=SQLITE_OK ||
- (needSync && (rc=sqlite3OsSync(&master,0))!=SQLITE_OK) ){
+ (needSync && (rc=sqlite3OsSync(master,0))!=SQLITE_OK) ){
sqlite3OsClose(&master);
sqlite3OsDelete(zMaster);
sqliteFree(zMaster);
@@ -1035,18 +1128,17 @@ static int vdbeCommit(sqlite3 *db){
** file name was written into the journal file before the failure
** occured.
*/
- for(i=0; i<db->nDb; i++){
+ for(i=0; rc==SQLITE_OK && 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);
+ if( rc!=SQLITE_OK ){
+ sqliteFree(zMaster);
+ return rc;
+ }
/* Delete the master journal file. This commits the transaction. After
** doing this the directory is synced again before any individual
@@ -1081,29 +1173,13 @@ static int vdbeCommit(sqlite3 *db){
sqlite3BtreeCommit(pBt);
}
}
+ sqlite3VtabCommit(db);
}
#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
@@ -1131,6 +1207,25 @@ static void checkActiveVdbeCnt(sqlite3 *db){
#endif
/*
+** 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.
+*/
+void sqlite3AbortOtherActiveVdbes(sqlite3 *db, Vdbe *pExcept){
+ Vdbe *pOther;
+ for(pOther=db->pVdbe; pOther; pOther=pOther->pNext){
+ if( pOther==pExcept ) continue;
+ if( pOther->magic!=VDBE_MAGIC_RUN || pOther->pc<0 ) continue;
+ checkActiveVdbeCnt(db);
+ closeAllCursors(pOther);
+ checkActiveVdbeCnt(db);
+ pOther->aborted = 1;
+ }
+}
+
+/*
** 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.
@@ -1146,73 +1241,174 @@ int sqlite3VdbeHalt(Vdbe *p){
sqlite3 *db = p->db;
int i;
int (*xFunc)(Btree *pBt) = 0; /* Function to call on each btree backend */
+ int isSpecialError; /* Set to true if SQLITE_NOMEM or IOERR */
+
+ /* This function contains the logic that determines if a statement or
+ ** transaction will be committed or rolled back as a result of the
+ ** execution of this virtual machine.
+ **
+ ** Special errors:
+ **
+ ** If an SQLITE_NOMEM error has occured in a statement that writes to
+ ** the database, then either a statement or transaction must be rolled
+ ** back to ensure the tree-structures are in a consistent state. A
+ ** statement transaction is rolled back if one is open, otherwise the
+ ** entire transaction must be rolled back.
+ **
+ ** If an SQLITE_IOERR error has occured in a statement that writes to
+ ** the database, then the entire transaction must be rolled back. The
+ ** I/O error may have caused garbage to be written to the journal
+ ** file. Were the transaction to continue and eventually be rolled
+ ** back that garbage might end up in the database file.
+ **
+ ** In both of the above cases, the Vdbe.errorAction variable is
+ ** ignored. If the sqlite3.autoCommit flag is false and a transaction
+ ** is rolled back, it will be set to true.
+ **
+ ** Other errors:
+ **
+ ** No error:
+ **
+ */
+ if( sqlite3MallocFailed() ){
+ p->rc = SQLITE_NOMEM;
+ }
if( p->magic!=VDBE_MAGIC_RUN ){
/* Already halted. Nothing to do. */
assert( p->magic==VDBE_MAGIC_HALT );
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ closeAllCursors(p);
+#endif
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.
+
+ /* No commit or rollback needed if the program never started */
+ if( p->pc>=0 ){
+
+ /* Check for one of the special errors - SQLITE_NOMEM or SQLITE_IOERR */
+ isSpecialError = ((p->rc==SQLITE_NOMEM || p->rc==SQLITE_IOERR)?1:0);
+ if( isSpecialError ){
+ /* This loop does static analysis of the query to see which of the
+ ** following three categories it falls into:
+ **
+ ** Read-only
+ ** Query with statement journal
+ ** Query without statement journal
+ **
+ ** We could do something more elegant than this static analysis (i.e.
+ ** store the type of query as part of the compliation phase), but
+ ** handling malloc() or IO failure is a fairly obscure edge case so
+ ** this is probably easier. Todo: Might be an opportunity to reduce
+ ** code size a very small amount though...
*/
- int rc = vdbeCommit(db);
- if( rc==SQLITE_BUSY ){
- return SQLITE_BUSY;
- }else if( rc!=SQLITE_OK ){
- p->rc = rc;
- xFunc = sqlite3BtreeRollback;
+ int isReadOnly = 1;
+ int isStatement = 0;
+ assert(p->aOp || p->nOp==0);
+ for(i=0; i<p->nOp; i++){
+ switch( p->aOp[i].opcode ){
+ case OP_Transaction:
+ isReadOnly = 0;
+ break;
+ case OP_Statement:
+ isStatement = 1;
+ break;
+ }
+ }
+
+ /* If the query was read-only, we need do no rollback at all. Otherwise,
+ ** proceed with the special handling.
+ */
+ if( !isReadOnly ){
+ if( p->rc==SQLITE_NOMEM && isStatement ){
+ xFunc = sqlite3BtreeRollbackStmt;
+ }else{
+ /* We are forced to roll back the active transaction. Before doing
+ ** so, abort any other statements this handle currently has active.
+ */
+ sqlite3AbortOtherActiveVdbes(db, p);
+ sqlite3RollbackAll(db);
+ db->autoCommit = 1;
+ }
}
- }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 the auto-commit flag is set and this is the only active vdbe, then
+ ** we do either a commit or rollback of the current transaction.
+ **
+ ** Note: This block also runs if one of the special errors handled
+ ** above has occured.
+ */
+ if( db->autoCommit && db->activeVdbeCnt==1 ){
+ if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){
+ /* The auto-commit flag is true, 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;
+ sqlite3RollbackAll(db);
+ }else{
+ sqlite3CommitInternalChanges(db);
+ }
+ }else{
+ sqlite3RollbackAll(db);
+ }
+ }else if( !xFunc ){
+ if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){
+ xFunc = sqlite3BtreeCommitStmt;
+ }else if( p->errorAction==OE_Abort ){
+ xFunc = sqlite3BtreeRollbackStmt;
+ }else{
+ sqlite3AbortOtherActiveVdbes(db, p);
+ sqlite3RollbackAll(db);
+ db->autoCommit = 1;
+ }
}
- }
-
- /* 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 xFunc is not NULL, then it is one of 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.
+ */
+ assert(!xFunc ||
+ xFunc==sqlite3BtreeCommitStmt ||
+ xFunc==sqlite3BtreeRollbackStmt
+ );
+ for(i=0; xFunc && i<db->nDb; i++){
+ int rc;
+ Btree *pBt = db->aDb[i].pBt;
+ if( pBt ){
+ rc = xFunc(pBt);
+ if( rc && (p->rc==SQLITE_OK || p->rc==SQLITE_CONSTRAINT) ){
+ p->rc = rc;
+ sqlite3SetString(&p->zErrMsg, 0);
+ }
+ }
}
- }
-
- /* 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);
+
+ /* If this was an INSERT, UPDATE or DELETE and the statement was committed,
+ ** 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 && db->flags&SQLITE_InternChanges ){
+ sqlite3ResetInternalSchema(db, 0);
+ db->flags = (db->flags | SQLITE_InternChanges);
}
- 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. */
@@ -1246,7 +1442,9 @@ int sqlite3VdbeReset(Vdbe *p){
** error, then it might not have been halted properly. So halt
** it now.
*/
+ sqlite3SafetyOn(p->db);
sqlite3VdbeHalt(p);
+ sqlite3SafetyOff(p->db);
/* 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
@@ -1255,8 +1453,9 @@ int sqlite3VdbeReset(Vdbe *p){
*/
if( p->pc>=0 ){
if( p->zErrMsg ){
- sqlite3Error(p->db, p->rc, "%s", p->zErrMsg);
- sqliteFree(p->zErrMsg);
+ sqlite3* db = p->db;
+ sqlite3ValueSetStr(db->pErr, -1, p->zErrMsg, SQLITE_UTF8, sqlite3FreeX);
+ db->errCode = p->rc;
p->zErrMsg = 0;
}else if( p->rc ){
sqlite3Error(p->db, p->rc, 0);
@@ -1277,7 +1476,7 @@ int sqlite3VdbeReset(Vdbe *p){
/* Save profiling information from this VDBE run.
*/
- assert( p->pTos<&p->aStack[p->pc<0?0:p->pc] || sqlite3_malloc_failed==1 );
+ assert( p->pTos<&p->aStack[p->pc<0?0:p->pc] || !p->aStack );
#ifdef VDBE_PROFILE
{
FILE *out = fopen("vdbe_profile.out", "a");
@@ -1314,7 +1513,6 @@ int sqlite3VdbeReset(Vdbe *p){
*/
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 ){
@@ -1369,7 +1567,7 @@ void sqlite3VdbeDelete(Vdbe *p){
releaseMemArray(p->aVar, p->nVar);
sqliteFree(p->aLabel);
sqliteFree(p->aStack);
- releaseMemArray(p->aColName, p->nResColumn*2);
+ releaseMemArray(p->aColName, p->nResColumn*COLNAME_N);
sqliteFree(p->aColName);
p->magic = VDBE_MAGIC_DEAD;
sqliteFree(p);
@@ -1383,7 +1581,9 @@ void sqlite3VdbeDelete(Vdbe *p){
int sqlite3VdbeCursorMoveto(Cursor *p){
if( p->deferredMoveto ){
int res, rc;
+#ifdef SQLITE_TEST
extern int sqlite3_search_count;
+#endif
assert( p->isTable );
if( p->isTable ){
rc = sqlite3BtreeMoveto(p->pCursor, 0, p->movetoTarget, &res);
@@ -1399,9 +1599,11 @@ int sqlite3VdbeCursorMoveto(Cursor *p){
rc = sqlite3BtreeNext(p->pCursor, &res);
if( rc ) return rc;
}
+#ifdef SQLITE_TEST
sqlite3_search_count++;
+#endif
p->deferredMoveto = 0;
- p->cacheValid = 0;
+ p->cacheStatus = CACHE_STALE;
}
return SQLITE_OK;
}
@@ -1438,16 +1640,20 @@ int sqlite3VdbeCursorMoveto(Cursor *p){
** 5 6 signed integer
** 6 8 signed integer
** 7 8 IEEE float
-** 8-11 reserved for expansion
+** 8 0 Integer constant 0
+** 9 0 Integer constant 1
+** 10,11 reserved for expansion
** N>=12 and even (N-12)/2 BLOB
** N>=13 and odd (N-13)/2 text
**
+** The 8 and 9 types were added in 3.3.0, file format 4. Prior versions
+** of SQLite will not understand those serial types.
*/
/*
** Return the serial-type for the value stored in pMem.
*/
-u32 sqlite3VdbeSerialType(Mem *pMem){
+u32 sqlite3VdbeSerialType(Mem *pMem, int file_format){
int flags = pMem->flags;
if( flags&MEM_Null ){
@@ -1457,7 +1663,11 @@ u32 sqlite3VdbeSerialType(Mem *pMem){
/* 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;
+ u64 u;
+ if( file_format>=4 && (i&1)==i ){
+ return 8+i;
+ }
+ u = i<0 ? -i : i;
if( u<=127 ) return 1;
if( u<=32767 ) return 2;
if( u<=8388607 ) return 3;
@@ -1496,17 +1706,12 @@ int sqlite3VdbeSerialTypeLen(u32 serial_type){
** 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 sqlite3VdbeSerialPut(unsigned char *buf, Mem *pMem, int file_format){
+ u32 serial_type = sqlite3VdbeSerialType(pMem, file_format);
int len;
- /* NULL */
- if( serial_type==0 ){
- return 0;
- }
-
/* Integer and Real */
- if( serial_type<=7 ){
+ if( serial_type<=7 && serial_type>0 ){
u64 v;
int i;
if( serial_type==7 ){
@@ -1521,12 +1726,16 @@ int sqlite3VdbeSerialPut(unsigned char *buf, Mem *pMem){
}
return len;
}
-
+
/* String or blob */
- assert( serial_type>=12 );
- len = sqlite3VdbeSerialTypeLen(serial_type);
- memcpy(buf, pMem->z, len);
- return len;
+ if( serial_type>=12 ){
+ len = sqlite3VdbeSerialTypeLen(serial_type);
+ memcpy(buf, pMem->z, len);
+ return len;
+ }
+
+ /* NULL or constants 0 or 1 */
+ return 0;
}
/*
@@ -1539,8 +1748,6 @@ int sqlite3VdbeSerialGet(
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 */
@@ -1579,7 +1786,7 @@ int sqlite3VdbeSerialGet(
case 7: { /* IEEE floating point */
u64 x;
u32 y;
-#ifndef NDEBUG
+#if !defined(NDEBUG) && !defined(SQLITE_OMIT_FLOATING_POINT)
/* Verify that integers and floating point values use the same
** byte order. The byte order differs on some (broken) architectures.
*/
@@ -1599,6 +1806,12 @@ int sqlite3VdbeSerialGet(
}
return 8;
}
+ case 8: /* Integer 0 */
+ case 9: { /* Integer 1 */
+ pMem->i = serial_type-8;
+ pMem->flags = MEM_Int;
+ return 0;
+ }
default: {
int len = (serial_type-12)/2;
pMem->z = (char *)buf;
@@ -1616,6 +1829,23 @@ int sqlite3VdbeSerialGet(
}
/*
+** The header of a record consists of a sequence variable-length integers.
+** These integers are almost always small and are encoded as a single byte.
+** The following macro takes advantage this fact to provide a fast decode
+** of the integers in a record header. It is faster for the common case
+** where the integer is a single byte. It is a little slower when the
+** integer is two or more bytes. But overall it is faster.
+**
+** The following expressions are equivalent:
+**
+** x = sqlite3GetVarint32( A, &B );
+**
+** x = GetVarint( A, B );
+**
+*/
+#define GetVarint(A,B) ((B = *(A))<=0x7f ? 1 : sqlite3GetVarint32(A, &B))
+
+/*
** 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
@@ -1642,9 +1872,9 @@ int sqlite3VdbeRecordCompare(
mem1.enc = pKeyInfo->enc;
mem2.enc = pKeyInfo->enc;
- idx1 = sqlite3GetVarint32(pKey1, &szHdr1);
+ idx1 = GetVarint(aKey1, szHdr1);
d1 = szHdr1;
- idx2 = sqlite3GetVarint32(pKey2, &szHdr2);
+ idx2 = GetVarint(aKey2, szHdr2);
d2 = szHdr2;
nField = pKeyInfo->nField;
while( idx1<szHdr1 && idx2<szHdr2 ){
@@ -1652,9 +1882,9 @@ int sqlite3VdbeRecordCompare(
u32 serial_type2;
/* Read the serial types for the next element in each key. */
- idx1 += sqlite3GetVarint32(&aKey1[idx1], &serial_type1);
+ idx1 += GetVarint( aKey1+idx1, serial_type1 );
if( d1>=nKey1 && sqlite3VdbeSerialTypeLen(serial_type1)>0 ) break;
- idx2 += sqlite3GetVarint32(&aKey2[idx2], &serial_type2);
+ idx2 += GetVarint( 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
@@ -1686,9 +1916,8 @@ int sqlite3VdbeRecordCompare(
}else if( d2<nKey2 ){
rc = -1;
}
- }
-
- if( pKeyInfo->aSortOrder && i<pKeyInfo->nField && pKeyInfo->aSortOrder[i] ){
+ }else if( pKeyInfo->aSortOrder && i<pKeyInfo->nField
+ && pKeyInfo->aSortOrder[i] ){
rc = -rc;
}
@@ -1701,7 +1930,7 @@ int sqlite3VdbeRecordCompare(
** an integer rowid). This routine returns the number of bytes in
** that integer.
*/
-int sqlite3VdbeIdxRowidLen(int nKey, const u8 *aKey){
+int sqlite3VdbeIdxRowidLen(const u8 *aKey){
u32 szHdr; /* Size of the header */
u32 typeRowid; /* Serial type of the rowid */
@@ -1732,10 +1961,10 @@ int sqlite3VdbeIdxRowid(BtCursor *pCur, i64 *rowid){
if( rc ){
return rc;
}
- sqlite3GetVarint32(m.z, &szHdr);
- sqlite3GetVarint32(&m.z[szHdr-1], &typeRowid);
+ sqlite3GetVarint32((u8*)m.z, &szHdr);
+ sqlite3GetVarint32((u8*)&m.z[szHdr-1], &typeRowid);
lenRowid = sqlite3VdbeSerialTypeLen(typeRowid);
- sqlite3VdbeSerialGet(&m.z[m.n-lenRowid], typeRowid, &v);
+ sqlite3VdbeSerialGet((u8*)&m.z[m.n-lenRowid], typeRowid, &v);
*rowid = v.i;
sqlite3VdbeMemRelease(&m);
return SQLITE_OK;
@@ -1771,7 +2000,7 @@ int sqlite3VdbeIdxKeyCompare(
if( rc ){
return rc;
}
- lenRowid = sqlite3VdbeIdxRowidLen(m.n, m.z);
+ lenRowid = sqlite3VdbeIdxRowidLen((u8*)m.z);
*res = sqlite3VdbeRecordCompare(pC->pKeyInfo, m.n-lenRowid, m.z, nKey, pKey);
sqlite3VdbeMemRelease(&m);
return SQLITE_OK;
diff --git a/ext/pdo_sqlite/sqlite/src/vdbemem.c b/ext/pdo_sqlite/sqlite/src/vdbemem.c
index 0b7e193be..51cd6827f 100644
--- a/ext/pdo_sqlite/sqlite/src/vdbemem.c
+++ b/ext/pdo_sqlite/sqlite/src/vdbemem.c
@@ -41,11 +41,22 @@ int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
#ifdef SQLITE_OMIT_UTF16
return SQLITE_ERROR;
#else
+
+
+ /* MemTranslate() may return SQLITE_OK or SQLITE_NOMEM. If NOMEM is returned,
+ ** then the encoding of the value may not have changed.
+ */
rc = sqlite3VdbeMemTranslate(pMem, desiredEnc);
+ assert(rc==SQLITE_OK || rc==SQLITE_NOMEM);
+ assert(rc==SQLITE_OK || pMem->enc!=desiredEnc);
+ assert(rc==SQLITE_NOMEM || pMem->enc==desiredEnc);
+
if( rc==SQLITE_NOMEM ){
+/*
sqlite3VdbeMemRelease(pMem);
pMem->flags = MEM_Null;
pMem->z = 0;
+*/
}
return rc;
#endif
@@ -73,7 +84,7 @@ int sqlite3VdbeMemDynamicify(Mem *pMem){
memcpy(z, pMem->z, n );
z[n] = 0;
z[n+1] = 0;
- pMem->z = z;
+ pMem->z = (char*)z;
pMem->flags &= ~(MEM_Ephem|MEM_Static|MEM_Short);
return SQLITE_OK;
}
@@ -93,7 +104,7 @@ int sqlite3VdbeMemMakeWriteable(Mem *pMem){
assert( (pMem->flags & MEM_Dyn)==0 );
assert( pMem->flags & (MEM_Str|MEM_Blob) );
if( (n = pMem->n)+2<sizeof(pMem->zShort) ){
- z = pMem->zShort;
+ z = (u8*)pMem->zShort;
pMem->flags |= MEM_Short|MEM_Term;
}else{
z = sqliteMallocRaw( n+2 );
@@ -106,8 +117,9 @@ int sqlite3VdbeMemMakeWriteable(Mem *pMem){
memcpy(z, pMem->z, n );
z[n] = 0;
z[n+1] = 0;
- pMem->z = z;
+ pMem->z = (char*)z;
pMem->flags &= ~(MEM_Ephem|MEM_Static);
+ assert(0==(1&(int)pMem->z));
return SQLITE_OK;
}
@@ -162,7 +174,7 @@ int sqlite3VdbeMemNulTerminate(Mem *pMem){
int sqlite3VdbeMemStringify(Mem *pMem, int enc){
int rc = SQLITE_OK;
int fg = pMem->flags;
- u8 *z = pMem->zShort;
+ char *z = pMem->zShort;
assert( !(fg&(MEM_Str|MEM_Blob)) );
assert( fg&(MEM_Int|MEM_Real) );
@@ -173,11 +185,11 @@ int sqlite3VdbeMemStringify(Mem *pMem, int enc){
**
** 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 );
+ if( fg & MEM_Int ){
sqlite3_snprintf(NBFS, z, "%lld", pMem->i);
+ }else{
+ assert( fg & MEM_Real );
+ sqlite3_snprintf(NBFS, z, "%!.15g", pMem->r);
}
pMem->n = strlen(z);
pMem->z = z;
@@ -191,8 +203,12 @@ int sqlite3VdbeMemStringify(Mem *pMem, int enc){
** 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.
+**
+** Return SQLITE_ERROR if the finalizer reports an error. SQLITE_OK
+** otherwise.
*/
-void sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
+int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
+ int rc = SQLITE_OK;
if( pFunc && pFunc->xFinalize ){
sqlite3_context ctx;
assert( (pMem->flags & MEM_Null)!=0 || pFunc==*(FuncDef**)&pMem->i );
@@ -200,6 +216,7 @@ void sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
ctx.s.z = pMem->zShort;
ctx.pMem = pMem;
ctx.pFunc = pFunc;
+ ctx.isError = 0;
pFunc->xFinalize(&ctx);
if( pMem->z && pMem->z!=pMem->zShort ){
sqliteFree( pMem->z );
@@ -208,7 +225,11 @@ void sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
if( pMem->flags & MEM_Short ){
pMem->z = pMem->zShort;
}
+ if( ctx.isError ){
+ rc = SQLITE_ERROR;
+ }
}
+ return rc;
}
/*
@@ -254,7 +275,7 @@ i64 sqlite3VdbeIntValue(Mem *pMem){
i64 value;
if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8)
|| sqlite3VdbeMemNulTerminate(pMem) ){
- return SQLITE_NOMEM;
+ return 0;
}
assert( pMem->z );
sqlite3atoi64(pMem->z, &value);
@@ -265,16 +286,6 @@ i64 sqlite3VdbeIntValue(Mem *pMem){
}
/*
-** 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.
@@ -289,7 +300,7 @@ double sqlite3VdbeRealValue(Mem *pMem){
double val = 0.0;
if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8)
|| sqlite3VdbeMemNulTerminate(pMem) ){
- return SQLITE_NOMEM;
+ return 0.0;
}
assert( pMem->z );
sqlite3AtoF(pMem->z, &val);
@@ -300,8 +311,30 @@ double sqlite3VdbeRealValue(Mem *pMem){
}
/*
-** Convert pMem so that it is of type MEM_Real. Invalidate any
-** prior representations.
+** The MEM structure is already a MEM_Real. Try to also make it a
+** MEM_Int if we can.
+*/
+void sqlite3VdbeIntegerAffinity(Mem *pMem){
+ assert( pMem->flags & MEM_Real );
+ pMem->i = pMem->r;
+ if( ((double)pMem->i)==pMem->r ){
+ pMem->flags |= MEM_Int;
+ }
+}
+
+/*
+** 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;
+}
+
+/*
+** Convert pMem so that it is of type MEM_Real.
+** Invalidate any prior representations.
*/
int sqlite3VdbeMemRealify(Mem *pMem){
pMem->r = sqlite3VdbeRealValue(pMem);
@@ -311,6 +344,16 @@ int sqlite3VdbeMemRealify(Mem *pMem){
}
/*
+** Convert pMem so that it has types MEM_Real or MEM_Int or both.
+** Invalidate any prior representations.
+*/
+int sqlite3VdbeMemNumerify(Mem *pMem){
+ sqlite3VdbeMemRealify(pMem);
+ sqlite3VdbeIntegerAffinity(pMem);
+ return SQLITE_OK;
+}
+
+/*
** Delete any previous value and set the value stored in *pMem to NULL.
*/
void sqlite3VdbeMemSetNull(Mem *pMem){
@@ -547,27 +590,33 @@ int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){
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.
+ /* The collation sequence must be defined at this point, even if
+ ** the user deletes the collation sequence after the vdbe program is
+ ** compiled (this was not always the case).
*/
assert( !pColl || pColl->xCmp );
if( pColl ){
if( pMem1->enc==pColl->enc ){
+ /* The strings are already in the correct encoding. Call the
+ ** comparison function directly */
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);
+ const void *v1, *v2;
+ int n1, n2;
+ /* Convert the strings into the encoding that the comparison
+ ** function expects */
+ v1 = sqlite3ValueText((sqlite3_value*)pMem1, pColl->enc);
+ n1 = v1==0 ? 0 : pMem1->n;
+ assert( n1==sqlite3ValueBytes((sqlite3_value*)pMem1, pColl->enc) );
+ v2 = sqlite3ValueText((sqlite3_value*)pMem2, pColl->enc);
+ n2 = v2==0 ? 0 : pMem2->n;
+ assert( n2==sqlite3ValueBytes((sqlite3_value*)pMem2, pColl->enc) );
+ /* Do the comparison */
+ rc = pColl->xCmp(pColl->pUser, n1, v1, n2, v2);
+ /* Convert the strings back into the database encoding */
sqlite3ValueText((sqlite3_value*)pMem1, origEnc);
- sqlite3ValueBytes((sqlite3_value*)pMem2, origEnc);
sqlite3ValueText((sqlite3_value*)pMem2, origEnc);
return rc;
}
@@ -662,7 +711,7 @@ int sqlite3VdbeMemFromBtree(
** Perform various checks on the memory cell pMem. An assert() will
** fail if pMem is internally inconsistent.
*/
-void sqlite3VdbeMemSanity(Mem *pMem, u8 db_enc){
+void sqlite3VdbeMemSanity(Mem *pMem){
int flags = pMem->flags;
assert( flags!=0 ); /* Must define some type */
if( pMem->flags & (MEM_Str|MEM_Blob) ){
@@ -711,20 +760,38 @@ void sqlite3VdbeMemSanity(Mem *pMem, u8 db_enc){
** 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.
+**
+** (2006-02-16:) The enc value can be or-ed with SQLITE_UTF16_ALIGNED.
+** If that is the case, then the result must be aligned on an even byte
+** boundary.
*/
const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
if( !pVal ) return 0;
- assert( enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE || enc==SQLITE_UTF8);
+ assert( (enc&3)==(enc&~SQLITE_UTF16_ALIGNED) );
if( pVal->flags&MEM_Null ){
return 0;
}
+ assert( (MEM_Blob>>3) == MEM_Str );
+ pVal->flags |= (pVal->flags & MEM_Blob)>>3;
if( pVal->flags&MEM_Str ){
- sqlite3VdbeChangeEncoding(pVal, enc);
+ sqlite3VdbeChangeEncoding(pVal, enc & ~SQLITE_UTF16_ALIGNED);
+ if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&(int)pVal->z) ){
+ assert( (pVal->flags & (MEM_Ephem|MEM_Static))!=0 );
+ if( sqlite3VdbeMemMakeWriteable(pVal)!=SQLITE_OK ){
+ return 0;
+ }
+ }
}else if( !(pVal->flags&MEM_Blob) ){
sqlite3VdbeMemStringify(pVal, enc);
+ assert( 0==(1&(int)pVal->z) );
+ }
+ assert(pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) || sqlite3MallocFailed() );
+ if( pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) ){
+ return pVal->z;
+ }else{
+ return 0;
}
- return (const void *)(pVal->z);
}
/*
@@ -766,7 +833,7 @@ int sqlite3ValueFromExpr(
op = pExpr->op;
if( op==TK_STRING || op==TK_FLOAT || op==TK_INTEGER ){
- zVal = sqliteStrNDup(pExpr->token.z, pExpr->token.n);
+ zVal = sqliteStrNDup((char*)pExpr->token.z, pExpr->token.n);
pVal = sqlite3ValueNew();
if( !zVal || !pVal ) goto no_mem;
sqlite3Dequote(zVal);
@@ -786,7 +853,7 @@ int sqlite3ValueFromExpr(
else if( op==TK_BLOB ){
int nVal;
pVal = sqlite3ValueNew();
- zVal = sqliteStrNDup(pExpr->token.z+1, pExpr->token.n-1);
+ zVal = sqliteStrNDup((char*)pExpr->token.z+1, pExpr->token.n-1);
if( !zVal || !pVal ) goto no_mem;
sqlite3Dequote(zVal);
nVal = strlen(zVal)/2;
diff --git a/ext/pdo_sqlite/sqlite/src/vtab.c b/ext/pdo_sqlite/sqlite/src/vtab.c
new file mode 100644
index 000000000..d1bf95f98
--- /dev/null
+++ b/ext/pdo_sqlite/sqlite/src/vtab.c
@@ -0,0 +1,659 @@
+/*
+** 2006 June 10
+**
+** 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 help implement virtual tables.
+**
+** $Id: vtab.c,v 1.1.2.1 2006/08/14 16:15:29 iliaa Exp $
+*/
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+#include "sqliteInt.h"
+
+/*
+** External API function used to create a new virtual-table module.
+*/
+int sqlite3_create_module(
+ sqlite3 *db, /* Database in which module is registered */
+ const char *zName, /* Name assigned to this module */
+ const sqlite3_module *pModule, /* The definition of the module */
+ void *pAux /* Context pointer for xCreate/xConnect */
+){
+ int nName = strlen(zName);
+ Module *pMod = (Module *)sqliteMallocRaw(sizeof(Module) + nName + 1);
+ if( pMod ){
+ char *zCopy = (char *)(&pMod[1]);
+ strcpy(zCopy, zName);
+ pMod->zName = zCopy;
+ pMod->pModule = pModule;
+ pMod->pAux = pAux;
+ pMod = (Module *)sqlite3HashInsert(&db->aModule, zCopy, nName, (void*)pMod);
+ sqliteFree(pMod);
+ sqlite3ResetInternalSchema(db, 0);
+ }
+ return sqlite3ApiExit(db, SQLITE_OK);
+}
+
+/*
+** Clear any and all virtual-table information from the Table record.
+** This routine is called, for example, just before deleting the Table
+** record.
+*/
+void sqlite3VtabClear(Table *p){
+ sqlite3_vtab *pVtab = p->pVtab;
+ if( pVtab ){
+ assert( p->pMod && p->pMod->pModule );
+ pVtab->nRef--;
+ if( pVtab->nRef==0 ){
+ pVtab->pModule->xDisconnect(pVtab);
+ }
+ p->pVtab = 0;
+ }
+ if( p->azModuleArg ){
+ int i;
+ for(i=0; i<p->nModuleArg; i++){
+ sqliteFree(p->azModuleArg[i]);
+ }
+ sqliteFree(p->azModuleArg);
+ }
+}
+
+/*
+** Add a new module argument to pTable->azModuleArg[].
+** The string is not copied - the pointer is stored. The
+** string will be freed automatically when the table is
+** deleted.
+*/
+static void addModuleArgument(Table *pTable, char *zArg){
+ int i = pTable->nModuleArg++;
+ int nBytes = sizeof(char *)*(1+pTable->nModuleArg);
+ char **azModuleArg;
+ azModuleArg = sqliteRealloc(pTable->azModuleArg, nBytes);
+ if( azModuleArg==0 ){
+ int j;
+ for(j=0; j<i; j++){
+ sqliteFree(pTable->azModuleArg[j]);
+ }
+ sqliteFree(zArg);
+ sqliteFree(pTable->azModuleArg);
+ pTable->nModuleArg = 0;
+ }else{
+ azModuleArg[i] = zArg;
+ azModuleArg[i+1] = 0;
+ }
+ pTable->azModuleArg = azModuleArg;
+}
+
+/*
+** The parser calls this routine when it first sees a CREATE VIRTUAL TABLE
+** statement. The module name has been parsed, but the optional list
+** of parameters that follow the module name are still pending.
+*/
+void sqlite3VtabBeginParse(
+ Parse *pParse, /* Parsing context */
+ Token *pName1, /* Name of new table, or database name */
+ Token *pName2, /* Name of new table or NULL */
+ Token *pModuleName /* Name of the module for the virtual table */
+){
+ int iDb; /* The database the table is being created in */
+ Table *pTable; /* The new virtual table */
+
+ sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, 0);
+ pTable = pParse->pNewTable;
+ if( pTable==0 || pParse->nErr ) return;
+ assert( 0==pTable->pIndex );
+
+ iDb = sqlite3SchemaToIndex(pParse->db, pTable->pSchema);
+ assert( iDb>=0 );
+
+ pTable->isVirtual = 1;
+ pTable->nModuleArg = 0;
+ addModuleArgument(pTable, sqlite3NameFromToken(pModuleName));
+ addModuleArgument(pTable, sqlite3StrDup(pParse->db->aDb[iDb].zName));
+ addModuleArgument(pTable, sqlite3StrDup(pTable->zName));
+ pParse->sNameToken.n = pModuleName->z + pModuleName->n - pName1->z;
+
+#ifndef SQLITE_OMIT_AUTHORIZATION
+ /* Creating a virtual table invokes the authorization callback twice.
+ ** The first invocation, to obtain permission to INSERT a row into the
+ ** sqlite_master table, has already been made by sqlite3StartTable().
+ ** The second call, to obtain permission to create the table, is made now.
+ */
+ if( pTable->azModuleArg ){
+ sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName,
+ pTable->azModuleArg[0], pParse->db->aDb[iDb].zName);
+ }
+#endif
+}
+
+/*
+** This routine takes the module argument that has been accumulating
+** in pParse->zArg[] and appends it to the list of arguments on the
+** virtual table currently under construction in pParse->pTable.
+*/
+static void addArgumentToVtab(Parse *pParse){
+ if( pParse->sArg.z && pParse->pNewTable ){
+ const char *z = pParse->sArg.z;
+ int n = pParse->sArg.n;
+ addModuleArgument(pParse->pNewTable, sqliteStrNDup(z, n));
+ }
+}
+
+/*
+** The parser calls this routine after the CREATE VIRTUAL TABLE statement
+** has been completely parsed.
+*/
+void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){
+ Table *pTab; /* The table being constructed */
+ sqlite3 *db; /* The database connection */
+ char *zModule; /* The module name of the table: USING modulename */
+ Module *pMod = 0;
+
+ addArgumentToVtab(pParse);
+ pParse->sArg.z = 0;
+
+ /* Lookup the module name. */
+ pTab = pParse->pNewTable;
+ if( pTab==0 ) return;
+ db = pParse->db;
+ if( pTab->nModuleArg<1 ) return;
+ zModule = pTab->azModuleArg[0];
+ pMod = (Module *)sqlite3HashFind(&db->aModule, zModule, strlen(zModule));
+ pTab->pMod = pMod;
+
+ /* If the CREATE VIRTUAL TABLE statement is being entered for the
+ ** first time (in other words if the virtual table is actually being
+ ** created now instead of just being read out of sqlite_master) then
+ ** do additional initialization work and store the statement text
+ ** in the sqlite_master table.
+ */
+ if( !db->init.busy ){
+ char *zStmt;
+ char *zWhere;
+ int iDb;
+ Vdbe *v;
+
+ /* Compute the complete text of the CREATE VIRTUAL TABLE statement */
+ if( pEnd ){
+ pParse->sNameToken.n = pEnd->z - pParse->sNameToken.z + pEnd->n;
+ }
+ zStmt = sqlite3MPrintf("CREATE VIRTUAL TABLE %T", &pParse->sNameToken);
+
+ /* 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 top of the stack is the rootpage allocated by sqlite3StartTable().
+ ** This value is always 0 and is ignored, a virtual table does not have a
+ ** rootpage. The next entry on the stack is the rowid of the record
+ ** in the sqlite_master table.
+ */
+ iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
+ sqlite3NestedParse(pParse,
+ "UPDATE %Q.%s "
+ "SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q "
+ "WHERE rowid=#1",
+ db->aDb[iDb].zName, SCHEMA_TABLE(iDb),
+ pTab->zName,
+ pTab->zName,
+ zStmt
+ );
+ sqliteFree(zStmt);
+ v = sqlite3GetVdbe(pParse);
+ sqlite3ChangeCookie(db, v, iDb);
+
+ sqlite3VdbeAddOp(v, OP_Expire, 0, 0);
+ zWhere = sqlite3MPrintf("name='%q'", pTab->zName);
+ sqlite3VdbeOp3(v, OP_ParseSchema, iDb, 0, zWhere, P3_DYNAMIC);
+ sqlite3VdbeOp3(v, OP_VCreate, iDb, 0, pTab->zName, strlen(pTab->zName) + 1);
+ }
+
+ /* If we are rereading the sqlite_master table create the in-memory
+ ** record of the table. If the module has already been registered,
+ ** also call the xConnect method here.
+ */
+ else {
+ Table *pOld;
+ Schema *pSchema = pTab->pSchema;
+ const char *zName = pTab->zName;
+ int nName = strlen(zName) + 1;
+ pOld = sqlite3HashInsert(&pSchema->tblHash, zName, nName, pTab);
+ if( pOld ){
+ assert( pTab==pOld ); /* Malloc must have failed inside HashInsert() */
+ return;
+ }
+ pParse->pNewTable = 0;
+ }
+}
+
+/*
+** The parser calls this routine when it sees the first token
+** of an argument to the module name in a CREATE VIRTUAL TABLE statement.
+*/
+void sqlite3VtabArgInit(Parse *pParse){
+ addArgumentToVtab(pParse);
+ pParse->sArg.z = 0;
+ pParse->sArg.n = 0;
+}
+
+/*
+** The parser calls this routine for each token after the first token
+** in an argument to the module name in a CREATE VIRTUAL TABLE statement.
+*/
+void sqlite3VtabArgExtend(Parse *pParse, Token *p){
+ Token *pArg = &pParse->sArg;
+ if( pArg->z==0 ){
+ pArg->z = p->z;
+ pArg->n = p->n;
+ }else{
+ assert(pArg->z < p->z);
+ pArg->n = (p->z + p->n - pArg->z);
+ }
+}
+
+/*
+** Invoke a virtual table constructor (either xCreate or xConnect). The
+** pointer to the function to invoke is passed as the fourth parameter
+** to this procedure.
+*/
+static int vtabCallConstructor(
+ sqlite3 *db,
+ Table *pTab,
+ Module *pMod,
+ int (*xConstruct)(sqlite3*, void *, int, char **, sqlite3_vtab **),
+ char **pzErr
+){
+ int rc;
+ int rc2;
+ char **azArg = pTab->azModuleArg;
+ int nArg = pTab->nModuleArg;
+ char *zErr = sqlite3MPrintf("vtable constructor failed: %s", pTab->zName);
+
+ assert( !db->pVTab );
+ assert( xConstruct );
+
+ db->pVTab = pTab;
+ rc = sqlite3SafetyOff(db);
+ assert( rc==SQLITE_OK );
+ rc = xConstruct(db, pMod->pAux, nArg, azArg, &pTab->pVtab);
+ rc2 = sqlite3SafetyOn(db);
+ if( rc==SQLITE_OK && pTab->pVtab ){
+ pTab->pVtab->pModule = pMod->pModule;
+ pTab->pVtab->nRef = 1;
+ }
+
+ if( SQLITE_OK!=rc ){
+ *pzErr = zErr;
+ zErr = 0;
+ } else if( db->pVTab ){
+ const char *zFormat = "vtable constructor did not declare schema: %s";
+ *pzErr = sqlite3MPrintf(zFormat, pTab->zName);
+ rc = SQLITE_ERROR;
+ }
+ if( rc==SQLITE_OK ){
+ rc = rc2;
+ }
+ db->pVTab = 0;
+ sqliteFree(zErr);
+ return rc;
+}
+
+/*
+** This function is invoked by the parser to call the xConnect() method
+** of the virtual table pTab. If an error occurs, an error code is returned
+** and an error left in pParse.
+**
+** This call is a no-op if table pTab is not a virtual table.
+*/
+int sqlite3VtabCallConnect(Parse *pParse, Table *pTab){
+ Module *pMod;
+ const char *zModule;
+ int rc = SQLITE_OK;
+
+ if( !pTab || !pTab->isVirtual || pTab->pVtab ){
+ return SQLITE_OK;
+ }
+
+ pMod = pTab->pMod;
+ zModule = pTab->azModuleArg[0];
+ if( !pMod ){
+ const char *zModule = pTab->azModuleArg[0];
+ sqlite3ErrorMsg(pParse, "no such module: %s", zModule);
+ rc = SQLITE_ERROR;
+ } else {
+ char *zErr = 0;
+ sqlite3 *db = pParse->db;
+ rc = vtabCallConstructor(db, pTab, pMod, pMod->pModule->xConnect, &zErr);
+ if( rc!=SQLITE_OK ){
+ sqlite3ErrorMsg(pParse, "%s", zErr);
+ }
+ sqliteFree(zErr);
+ }
+
+ return rc;
+}
+
+/*
+** Add the virtual table pVtab to the array sqlite3.aVTrans[].
+*/
+static int addToVTrans(sqlite3 *db, sqlite3_vtab *pVtab){
+ const int ARRAY_INCR = 5;
+
+ /* Grow the sqlite3.aVTrans array if required */
+ if( (db->nVTrans%ARRAY_INCR)==0 ){
+ sqlite3_vtab **aVTrans;
+ int nBytes = sizeof(sqlite3_vtab *) * (db->nVTrans + ARRAY_INCR);
+ aVTrans = sqliteRealloc((void *)db->aVTrans, nBytes);
+ if( !aVTrans ){
+ return SQLITE_NOMEM;
+ }
+ memset(&aVTrans[db->nVTrans], 0, sizeof(sqlite3_vtab *)*ARRAY_INCR);
+ db->aVTrans = aVTrans;
+ }
+
+ /* Add pVtab to the end of sqlite3.aVTrans */
+ db->aVTrans[db->nVTrans++] = pVtab;
+ pVtab->nRef++;
+ return SQLITE_OK;
+}
+
+/*
+** This function is invoked by the vdbe to call the xCreate method
+** of the virtual table named zTab in database iDb.
+**
+** If an error occurs, *pzErr is set to point an an English language
+** description of the error and an SQLITE_XXX error code is returned.
+** In this case the caller must call sqliteFree() on *pzErr.
+*/
+int sqlite3VtabCallCreate(sqlite3 *db, int iDb, const char *zTab, char **pzErr){
+ int rc = SQLITE_OK;
+ Table *pTab;
+ Module *pMod;
+ const char *zModule;
+
+ pTab = sqlite3FindTable(db, zTab, db->aDb[iDb].zName);
+ assert(pTab && pTab->isVirtual && !pTab->pVtab);
+ pMod = pTab->pMod;
+ zModule = pTab->azModuleArg[0];
+
+ /* If the module has been registered and includes a Create method,
+ ** invoke it now. If the module has not been registered, return an
+ ** error. Otherwise, do nothing.
+ */
+ if( !pMod ){
+ *pzErr = sqlite3MPrintf("no such module: %s", zModule);
+ rc = SQLITE_ERROR;
+ }else{
+ rc = vtabCallConstructor(db, pTab, pMod, pMod->pModule->xCreate, pzErr);
+ }
+
+ if( rc==SQLITE_OK && pTab->pVtab ){
+ rc = addToVTrans(db, pTab->pVtab);
+ }
+
+ return rc;
+}
+
+/*
+** This function is used to set the schema of a virtual table. It is only
+** valid to call this function from within the xCreate() or xConnect() of a
+** virtual table module.
+*/
+int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
+ Parse sParse;
+
+ int rc = SQLITE_OK;
+ Table *pTab = db->pVTab;
+ char *zErr = 0;
+
+ if( !pTab ){
+ sqlite3Error(db, SQLITE_MISUSE, 0);
+ return SQLITE_MISUSE;
+ }
+ assert(pTab->isVirtual && pTab->nCol==0 && pTab->aCol==0);
+
+ memset(&sParse, 0, sizeof(Parse));
+ sParse.declareVtab = 1;
+ sParse.db = db;
+
+ if(
+ SQLITE_OK == sqlite3RunParser(&sParse, zCreateTable, &zErr) &&
+ sParse.pNewTable &&
+ !sParse.pNewTable->pSelect &&
+ !sParse.pNewTable->isVirtual
+ ){
+ pTab->aCol = sParse.pNewTable->aCol;
+ pTab->nCol = sParse.pNewTable->nCol;
+ sParse.pNewTable->nCol = 0;
+ sParse.pNewTable->aCol = 0;
+ } else {
+ sqlite3Error(db, SQLITE_ERROR, zErr);
+ sqliteFree(zErr);
+ rc = SQLITE_ERROR;
+ }
+ sParse.declareVtab = 0;
+
+ sqlite3_finalize((sqlite3_stmt*)sParse.pVdbe);
+ sqlite3DeleteTable(0, sParse.pNewTable);
+ sParse.pNewTable = 0;
+ db->pVTab = 0;
+
+ return rc;
+}
+
+/*
+** This function is invoked by the vdbe to call the xDestroy method
+** of the virtual table named zTab in database iDb. This occurs
+** when a DROP TABLE is mentioned.
+**
+** This call is a no-op if zTab is not a virtual table.
+*/
+int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab)
+{
+ int rc = SQLITE_OK;
+ Table *pTab;
+
+ pTab = sqlite3FindTable(db, zTab, db->aDb[iDb].zName);
+ assert(pTab);
+ if( pTab->pVtab ){
+ int (*xDestroy)(sqlite3_vtab *pVTab) = pTab->pMod->pModule->xDestroy;
+ rc = sqlite3SafetyOff(db);
+ assert( rc==SQLITE_OK );
+ if( xDestroy ){
+ rc = xDestroy(pTab->pVtab);
+ }
+ sqlite3SafetyOn(db);
+ if( rc==SQLITE_OK ){
+ pTab->pVtab = 0;
+ }
+ }
+
+ return rc;
+}
+
+/*
+** This function invokes either the xRollback or xCommit method
+** of each of the virtual tables in the sqlite3.aVTrans array. The method
+** called is identified by the second argument, "offset", which is
+** the offset of the method to call in the sqlite3_module structure.
+**
+** The array is cleared after invoking the callbacks.
+*/
+static void callFinaliser(sqlite3 *db, int offset){
+ int i;
+ for(i=0; i<db->nVTrans && db->aVTrans[i]; i++){
+ sqlite3_vtab *pVtab = db->aVTrans[i];
+ int (*x)(sqlite3_vtab *);
+ x = *(int (**)(sqlite3_vtab *))((char *)pVtab->pModule + offset);
+ if( x ) x(pVtab);
+ pVtab->nRef--;
+ if( pVtab->nRef==0 ){
+ pVtab->pModule->xDisconnect(pVtab);
+ }
+ }
+ sqliteFree(db->aVTrans);
+ db->nVTrans = 0;
+ db->aVTrans = 0;
+}
+
+/*
+** If argument rc2 is not SQLITE_OK, then return it and do nothing.
+** Otherwise, invoke the xSync method of all virtual tables in the
+** sqlite3.aVTrans array. Return the error code for the first error
+** that occurs, or SQLITE_OK if all xSync operations are successful.
+*/
+int sqlite3VtabSync(sqlite3 *db, int rc2){
+ int i;
+ int rc = SQLITE_OK;
+ int rcsafety;
+ sqlite3_vtab **aVTrans = db->aVTrans;
+ if( rc2!=SQLITE_OK ) return rc2;
+
+ rc = sqlite3SafetyOff(db);
+ db->aVTrans = 0;
+ for(i=0; rc==SQLITE_OK && i<db->nVTrans && aVTrans[i]; i++){
+ sqlite3_vtab *pVtab = aVTrans[i];
+ int (*x)(sqlite3_vtab *);
+ x = pVtab->pModule->xSync;
+ if( x ){
+ rc = x(pVtab);
+ }
+ }
+ db->aVTrans = aVTrans;
+ rcsafety = sqlite3SafetyOn(db);
+
+ if( rc==SQLITE_OK ){
+ rc = rcsafety;
+ }
+ return rc;
+}
+
+/*
+** Invoke the xRollback method of all virtual tables in the
+** sqlite3.aVTrans array. Then clear the array itself.
+*/
+int sqlite3VtabRollback(sqlite3 *db){
+ callFinaliser(db, (int)(&((sqlite3_module *)0)->xRollback));
+ return SQLITE_OK;
+}
+
+/*
+** Invoke the xCommit method of all virtual tables in the
+** sqlite3.aVTrans array. Then clear the array itself.
+*/
+int sqlite3VtabCommit(sqlite3 *db){
+ callFinaliser(db, (int)(&((sqlite3_module *)0)->xCommit));
+ return SQLITE_OK;
+}
+
+/*
+** If the virtual table pVtab supports the transaction interface
+** (xBegin/xRollback/xCommit and optionally xSync) and a transaction is
+** not currently open, invoke the xBegin method now.
+**
+** If the xBegin call is successful, place the sqlite3_vtab pointer
+** in the sqlite3.aVTrans array.
+*/
+int sqlite3VtabBegin(sqlite3 *db, sqlite3_vtab *pVtab){
+ int rc = SQLITE_OK;
+ const sqlite3_module *pModule;
+
+ /* Special case: If db->aVTrans is NULL and db->nVTrans is greater
+ ** than zero, then this function is being called from within a
+ ** virtual module xSync() callback. It is illegal to write to
+ ** virtual module tables in this case, so return SQLITE_LOCKED.
+ */
+ if( 0==db->aVTrans && db->nVTrans>0 ){
+ return SQLITE_LOCKED;
+ }
+ if( !pVtab ){
+ return SQLITE_OK;
+ }
+ pModule = pVtab->pModule;
+
+ if( pModule->xBegin ){
+ int i;
+
+
+ /* If pVtab is already in the aVTrans array, return early */
+ for(i=0; (i<db->nVTrans) && 0!=db->aVTrans[i]; i++){
+ if( db->aVTrans[i]==pVtab ){
+ return SQLITE_OK;
+ }
+ }
+
+ /* Invoke the xBegin method */
+ rc = pModule->xBegin(pVtab);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+
+ rc = addToVTrans(db, pVtab);
+ }
+ return rc;
+}
+
+/*
+** The first parameter (pDef) is a function implementation. The
+** second parameter (pExpr) is the first argument to this function.
+** If pExpr is a column in a virtual table, then let the virtual
+** table implementation have an opportunity to overload the function.
+**
+** This routine is used to allow virtual table implementations to
+** overload MATCH, LIKE, GLOB, and REGEXP operators.
+**
+** Return either the pDef argument (indicating no change) or a
+** new FuncDef structure that is marked as ephemeral using the
+** SQLITE_FUNC_EPHEM flag.
+*/
+FuncDef *sqlite3VtabOverloadFunction(
+ FuncDef *pDef, /* Function to possibly overload */
+ int nArg, /* Number of arguments to the function */
+ Expr *pExpr /* First argument to the function */
+){
+ Table *pTab;
+ sqlite3_vtab *pVtab;
+ sqlite3_module *pMod;
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**);
+ void *pArg;
+ FuncDef *pNew;
+
+ /* Check to see the left operand is a column in a virtual table */
+ if( pExpr==0 ) return pDef;
+ if( pExpr->op!=TK_COLUMN ) return pDef;
+ pTab = pExpr->pTab;
+ if( pTab==0 ) return pDef;
+ if( !pTab->isVirtual ) return pDef;
+ pVtab = pTab->pVtab;
+ assert( pVtab!=0 );
+ assert( pVtab->pModule!=0 );
+ pMod = (sqlite3_module *)pVtab->pModule;
+ if( pMod->xFindFunction==0 ) return pDef;
+
+ /* Call the xFuncFunction method on the virtual table implementation
+ ** to see if the implementation wants to overload this function */
+ if( pMod->xFindFunction(pVtab, nArg, pDef->zName, &xFunc, &pArg)==0 ){
+ return pDef;
+ }
+
+ /* Create a new ephemeral function definition for the overloaded
+ ** function */
+ pNew = sqliteMalloc( sizeof(*pNew) + strlen(pDef->zName) );
+ if( pNew==0 ){
+ return pDef;
+ }
+ *pNew = *pDef;
+ strcpy(pNew->zName, pDef->zName);
+ pNew->xFunc = xFunc;
+ pNew->pUserData = pArg;
+ pNew->flags |= SQLITE_FUNC_EPHEM;
+ return pNew;
+}
+
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
diff --git a/ext/pdo_sqlite/sqlite/src/where.c b/ext/pdo_sqlite/sqlite/src/where.c
index d057acd0f..bdbac8112 100644
--- a/ext/pdo_sqlite/sqlite/src/where.c
+++ b/ext/pdo_sqlite/sqlite/src/where.c
@@ -83,7 +83,7 @@ struct WhereTerm {
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> */
+ u16 eOperator; /* 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 */
@@ -156,6 +156,7 @@ struct ExprMaskSet {
#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))
+#define WO_MATCH 64
/*
** Value for flags returned by bestIndex()
@@ -171,6 +172,7 @@ struct ExprMaskSet {
#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 */
+#define WHERE_VIRTUALTABLE 0x8000 /* Use virtual-table processing */
/*
** Initialize a preallocated WhereClause structure.
@@ -418,13 +420,13 @@ static WhereTerm *findTerm(
if( pTerm->leftCursor==iCur
&& (pTerm->prereqRight & notReady)==0
&& pTerm->leftColumn==iColumn
- && (pTerm->operator & op)!=0
+ && (pTerm->eOperator & op)!=0
){
if( iCur>=0 && pIdx ){
Expr *pX = pTerm->pExpr;
CollSeq *pColl;
char idxaff;
- int k;
+ int j;
Parse *pParse = pWC->pParse;
idxaff = pIdx->pTable->aCol[iColumn].affinity;
@@ -438,9 +440,9 @@ static WhereTerm *findTerm(
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;
+ for(j=0; j<pIdx->nColumn && pIdx->aiColumn[j]!=iColumn; j++){}
+ assert( j<pIdx->nColumn );
+ if( sqlite3StrICmp(pColl->zName, pIdx->azColl[j]) ) continue;
}
return pTerm;
}
@@ -511,7 +513,7 @@ static int isLikeOrGlob(
return 0;
}
sqlite3DequoteExpr(pRight);
- z = pRight->token.z;
+ z = (char *)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;
@@ -522,6 +524,48 @@ static int isLikeOrGlob(
}
#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/*
+** Check to see if the given expression is of the form
+**
+** column MATCH expr
+**
+** If it is then return TRUE. If not, return FALSE.
+*/
+static int isMatchOfColumn(
+ Expr *pExpr /* Test this expression */
+){
+ ExprList *pList;
+
+ if( pExpr->op!=TK_FUNCTION ){
+ return 0;
+ }
+ if( pExpr->token.n!=5 ||
+ sqlite3StrNICmp((const char*)pExpr->token.z,"match",5)!=0 ){
+ return 0;
+ }
+ pList = pExpr->pList;
+ if( pList->nExpr!=2 ){
+ return 0;
+ }
+ if( pList->a[1].pExpr->op != TK_COLUMN ){
+ return 0;
+ }
+ return 1;
+}
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
+
+/*
+** If the pBase expression originated in the ON or USING clause of
+** a join, then transfer the appropriate markings over to derived.
+*/
+static void transferJoinMarkings(Expr *pDerived, Expr *pBase){
+ pDerived->flags |= pBase->flags & EP_FromJoin;
+ pDerived->iRightJoinTable = pBase->iRightJoinTable;
+}
+
+
/*
** 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
@@ -547,7 +591,7 @@ static void exprAnalyze(
int nPattern;
int isComplete;
- if( sqlite3_malloc_failed ) return;
+ if( sqlite3MallocFailed() ) return;
prereqLeft = exprTableUsage(pMaskSet, pExpr->pLeft);
if( pExpr->op==TK_IN ){
assert( pExpr->pRight==0 );
@@ -563,14 +607,14 @@ static void exprAnalyze(
pTerm->prereqAll = prereqAll;
pTerm->leftCursor = -1;
pTerm->iParent = -1;
- pTerm->operator = 0;
+ pTerm->eOperator = 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);
+ pTerm->eOperator = operatorMask(pExpr->op);
}
if( pRight && pRight->op==TK_COLUMN ){
WhereTerm *pNew;
@@ -595,7 +639,7 @@ static void exprAnalyze(
pNew->leftColumn = pLeft->iColumn;
pNew->prereqRight = prereqLeft;
pNew->prereqAll = prereqAll;
- pNew->operator = operatorMask(pDup->op);
+ pNew->eOperator = operatorMask(pDup->op);
}
}
@@ -623,7 +667,7 @@ static void exprAnalyze(
}
#endif /* SQLITE_OMIT_BETWEEN_OPTIMIZATION */
-#ifndef SQLITE_OMIT_OR_OPTIMIZATION
+#if !defined(SQLITE_OMIT_OR_OPTIMIZATION) && !defined(SQLITE_OMIT_SUBQUERY)
/* Attempt to convert OR-connected terms into an IN operator so that
** they can make use of indices. Example:
**
@@ -632,6 +676,9 @@ static void exprAnalyze(
** is converted into
**
** x IN (expr1,expr2,expr3)
+ **
+ ** This optimization must be omitted if OMIT_SUBQUERY is defined because
+ ** the compiler for the the IN operator is part of sub-queries.
*/
else if( pExpr->op==TK_OR ){
int ok;
@@ -651,7 +698,7 @@ static void exprAnalyze(
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 ){
+ if( pOrTerm->eOperator!=WO_EQ ){
goto or_not_possible;
}
if( pOrTerm->leftCursor==iCursor && pOrTerm->leftColumn==iColumn ){
@@ -680,14 +727,17 @@ static void exprAnalyze(
}
pNew = sqlite3Expr(TK_IN, pDup, 0, 0);
if( pNew ){
+ int idxNew;
+ transferJoinMarkings(pNew, pExpr);
pNew->pList = pList;
+ idxNew = whereClauseInsert(pWC, pNew, TERM_VIRTUAL|TERM_DYNAMIC);
+ exprAnalyze(pSrc, pMaskSet, pWC, idxNew);
+ pTerm = &pWC->a[idxTerm];
+ pWC->a[idxNew].iParent = idxTerm;
+ pTerm->nChild = 1;
}else{
sqlite3ExprListDelete(pList);
}
- pTerm->pExpr = pNew;
- pTerm->flags |= TERM_DYNAMIC;
- exprAnalyze(pSrc, pMaskSet, pWC, idxTerm);
- pTerm = &pWC->a[idxTerm];
}
or_not_possible:
whereClauseClear(&sOr);
@@ -730,6 +780,41 @@ or_not_possible:
}
}
#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ /* Add a WO_MATCH auxiliary term to the constraint set if the
+ ** current expression is of the form: column MATCH expr.
+ ** This information is used by the xBestIndex methods of
+ ** virtual tables. The native query optimizer does not attempt
+ ** to do anything with MATCH functions.
+ */
+ if( isMatchOfColumn(pExpr) ){
+ int idxNew;
+ Expr *pRight, *pLeft;
+ WhereTerm *pNewTerm;
+ Bitmask prereqColumn, prereqExpr;
+
+ pRight = pExpr->pList->a[0].pExpr;
+ pLeft = pExpr->pList->a[1].pExpr;
+ prereqExpr = exprTableUsage(pMaskSet, pRight);
+ prereqColumn = exprTableUsage(pMaskSet, pLeft);
+ if( (prereqExpr & prereqColumn)==0 ){
+ Expr *pNewExpr;
+ pNewExpr = sqlite3Expr(TK_MATCH, 0, sqlite3ExprDup(pRight), 0);
+ idxNew = whereClauseInsert(pWC, pNewExpr, TERM_VIRTUAL|TERM_DYNAMIC);
+ pNewTerm = &pWC->a[idxNew];
+ pNewTerm->prereqRight = prereqExpr;
+ pNewTerm->leftCursor = pLeft->iTable;
+ pNewTerm->leftColumn = pLeft->iColumn;
+ pNewTerm->eOperator = WO_MATCH;
+ pNewTerm->iParent = idxTerm;
+ pTerm = &pWC->a[idxTerm];
+ pTerm->nChild = 1;
+ pTerm->flags |= TERM_COPIED;
+ pNewTerm->prereqAll = pTerm->prereqAll;
+ }
+ }
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
}
@@ -755,14 +840,13 @@ or_not_possible:
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 */
+ int base, /* Cursor number for the table to be sorted */
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 sortOrder = 0; /* XOR of index and ORDER BY sort direction */
int nTerm; /* Number of ORDER BY terms */
struct ExprList_item *pTerm; /* A term of the ORDER BY clause */
sqlite3 *db = pParse->db;
@@ -777,6 +861,7 @@ static int isSortingIndex(
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 */
+ int termSortOrder; /* Sort order for this term */
pExpr = pTerm->pExpr;
if( pExpr->op!=TK_COLUMN || pExpr->iTable!=base ){
@@ -786,7 +871,8 @@ static int isSortingIndex(
}
pColl = sqlite3ExprCollSeq(pParse, pExpr);
if( !pColl ) pColl = db->pDfltColl;
- if( pExpr->iColumn!=pIdx->aiColumn[i] || pColl!=pIdx->keyInfo.aColl[i] ){
+ if( pExpr->iColumn!=pIdx->aiColumn[i] ||
+ sqlite3StrICmp(pColl->zName, pIdx->azColl[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
@@ -800,14 +886,18 @@ static int isSortingIndex(
return 0;
}
}
+ assert( pIdx->aSortOrder!=0 );
+ assert( pTerm->sortOrder==0 || pTerm->sortOrder==1 );
+ assert( pIdx->aSortOrder[i]==0 || pIdx->aSortOrder[i]==1 );
+ termSortOrder = pIdx->aSortOrder[i] ^ pTerm->sortOrder;
if( i>nEqCol ){
- if( pTerm->sortOrder!=sortOrder ){
+ if( termSortOrder!=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;
+ sortOrder = termSortOrder;
}
j++;
pTerm++;
@@ -817,7 +907,7 @@ static int isSortingIndex(
** are covered.
*/
if( j>=nTerm ){
- *pbRev = sortOrder==SQLITE_SO_DESC;
+ *pbRev = sortOrder!=0;
return 1;
}
return 0;
@@ -854,16 +944,257 @@ static int sortableByRowid(
** logN is a little off.
*/
static double estLog(double N){
- double logN = 1.0;
- double x = 10.0;
+ double logN = 1;
+ double x = 10;
while( N>x ){
- logN += 1.0;
+ logN += 1;
x *= 10;
}
return logN;
}
/*
+** Two routines for printing the content of an sqlite3_index_info
+** structure. Used for testing and debugging only. If neither
+** SQLITE_TEST or SQLITE_DEBUG are defined, then these routines
+** are no-ops.
+*/
+#if !defined(SQLITE_OMIT_VIRTUALTABLE) && \
+ (defined(SQLITE_TEST) || defined(SQLITE_DEBUG))
+static void TRACE_IDX_INPUTS(sqlite3_index_info *p){
+ int i;
+ if( !sqlite3_where_trace ) return;
+ for(i=0; i<p->nConstraint; i++){
+ sqlite3DebugPrintf(" constraint[%d]: col=%d termid=%d op=%d usabled=%d\n",
+ i,
+ p->aConstraint[i].iColumn,
+ p->aConstraint[i].iTermOffset,
+ p->aConstraint[i].op,
+ p->aConstraint[i].usable);
+ }
+ for(i=0; i<p->nOrderBy; i++){
+ sqlite3DebugPrintf(" orderby[%d]: col=%d desc=%d\n",
+ i,
+ p->aOrderBy[i].iColumn,
+ p->aOrderBy[i].desc);
+ }
+}
+static void TRACE_IDX_OUTPUTS(sqlite3_index_info *p){
+ int i;
+ if( !sqlite3_where_trace ) return;
+ for(i=0; i<p->nConstraint; i++){
+ sqlite3DebugPrintf(" usage[%d]: argvIdx=%d omit=%d\n",
+ i,
+ p->aConstraintUsage[i].argvIndex,
+ p->aConstraintUsage[i].omit);
+ }
+ sqlite3DebugPrintf(" idxNum=%d\n", p->idxNum);
+ sqlite3DebugPrintf(" idxStr=%s\n", p->idxStr);
+ sqlite3DebugPrintf(" orderByConsumed=%d\n", p->orderByConsumed);
+ sqlite3DebugPrintf(" estimatedCost=%g\n", p->estimatedCost);
+}
+#else
+#define TRACE_IDX_INPUTS(A)
+#define TRACE_IDX_OUTPUTS(A)
+#endif
+
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+/*
+** Compute the best index for a virtual table.
+**
+** The best index is computed by the xBestIndex method of the virtual
+** table module. This routine is really just a wrapper that sets up
+** the sqlite3_index_info structure that is used to communicate with
+** xBestIndex.
+**
+** In a join, this routine might be called multiple times for the
+** same virtual table. The sqlite3_index_info structure is created
+** and initialized on the first invocation and reused on all subsequent
+** invocations. The sqlite3_index_info structure is also used when
+** code is generated to access the virtual table. The whereInfoDelete()
+** routine takes care of freeing the sqlite3_index_info structure after
+** everybody has finished with it.
+*/
+static double bestVirtualIndex(
+ 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 */
+ int orderByUsable, /* True if we can potential sort */
+ sqlite3_index_info **ppIdxInfo /* Index information passed to xBestIndex */
+){
+ Table *pTab = pSrc->pTab;
+ sqlite3_index_info *pIdxInfo;
+ struct sqlite3_index_constraint *pIdxCons;
+ struct sqlite3_index_orderby *pIdxOrderBy;
+ struct sqlite3_index_constraint_usage *pUsage;
+ WhereTerm *pTerm;
+ int i, j;
+ int nOrderBy;
+ int rc;
+
+ /* If the sqlite3_index_info structure has not been previously
+ ** allocated and initialized for this virtual table, then allocate
+ ** and initialize it now
+ */
+ pIdxInfo = *ppIdxInfo;
+ if( pIdxInfo==0 ){
+ WhereTerm *pTerm;
+ int nTerm;
+ TRACE(("Recomputing index info for %s...\n", pTab->zName));
+
+ /* Count the number of possible WHERE clause constraints referring
+ ** to this virtual table */
+ for(i=nTerm=0, pTerm=pWC->a; i<pWC->nTerm; i++, pTerm++){
+ if( pTerm->leftCursor != pSrc->iCursor ) continue;
+ if( pTerm->eOperator==WO_IN ) continue;
+ nTerm++;
+ }
+
+ /* If the ORDER BY clause contains only columns in the current
+ ** virtual table then allocate space for the aOrderBy part of
+ ** the sqlite3_index_info structure.
+ */
+ nOrderBy = 0;
+ if( pOrderBy ){
+ for(i=0; i<pOrderBy->nExpr; i++){
+ Expr *pExpr = pOrderBy->a[i].pExpr;
+ if( pExpr->op!=TK_COLUMN || pExpr->iTable!=pSrc->iCursor ) break;
+ }
+ if( i==pOrderBy->nExpr ){
+ nOrderBy = pOrderBy->nExpr;
+ }
+ }
+
+ /* Allocate the sqlite3_index_info structure
+ */
+ pIdxInfo = sqliteMalloc( sizeof(*pIdxInfo)
+ + (sizeof(*pIdxCons) + sizeof(*pUsage))*nTerm
+ + sizeof(*pIdxOrderBy)*nOrderBy );
+ if( pIdxInfo==0 ){
+ sqlite3ErrorMsg(pParse, "out of memory");
+ return 0.0;
+ }
+ *ppIdxInfo = pIdxInfo;
+
+ /* Initialize the structure. The sqlite3_index_info structure contains
+ ** many fields that are declared "const" to prevent xBestIndex from
+ ** changing them. We have to do some funky casting in order to
+ ** initialize those fields.
+ */
+ pIdxCons = (struct sqlite3_index_constraint*)&pIdxInfo[1];
+ pIdxOrderBy = (struct sqlite3_index_orderby*)&pIdxCons[nTerm];
+ pUsage = (struct sqlite3_index_constraint_usage*)&pIdxOrderBy[nOrderBy];
+ *(int*)&pIdxInfo->nConstraint = nTerm;
+ *(int*)&pIdxInfo->nOrderBy = nOrderBy;
+ *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint = pIdxCons;
+ *(struct sqlite3_index_orderby**)&pIdxInfo->aOrderBy = pIdxOrderBy;
+ *(struct sqlite3_index_constraint_usage**)&pIdxInfo->aConstraintUsage =
+ pUsage;
+
+ for(i=j=0, pTerm=pWC->a; i<pWC->nTerm; i++, pTerm++){
+ if( pTerm->leftCursor != pSrc->iCursor ) continue;
+ if( pTerm->eOperator==WO_IN ) continue;
+ pIdxCons[j].iColumn = pTerm->leftColumn;
+ pIdxCons[j].iTermOffset = i;
+ pIdxCons[j].op = pTerm->eOperator;
+ /* The direct assignment in the previous line is possible only because
+ ** the WO_ and SQLITE_INDEX_CONSTRAINT_ codes are identical. The
+ ** following asserts verify this fact. */
+ assert( WO_EQ==SQLITE_INDEX_CONSTRAINT_EQ );
+ assert( WO_LT==SQLITE_INDEX_CONSTRAINT_LT );
+ assert( WO_LE==SQLITE_INDEX_CONSTRAINT_LE );
+ assert( WO_GT==SQLITE_INDEX_CONSTRAINT_GT );
+ assert( WO_GE==SQLITE_INDEX_CONSTRAINT_GE );
+ assert( WO_MATCH==SQLITE_INDEX_CONSTRAINT_MATCH );
+ assert( pTerm->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE|WO_MATCH) );
+ j++;
+ }
+ for(i=0; i<nOrderBy; i++){
+ Expr *pExpr = pOrderBy->a[i].pExpr;
+ pIdxOrderBy[i].iColumn = pExpr->iColumn;
+ pIdxOrderBy[i].desc = pOrderBy->a[i].sortOrder;
+ }
+ }
+
+ /* At this point, the sqlite3_index_info structure that pIdxInfo points
+ ** to will have been initialized, either during the current invocation or
+ ** during some prior invocation. Now we just have to customize the
+ ** details of pIdxInfo for the current invocation and pass it to
+ ** xBestIndex.
+ */
+
+ /* The module name must be defined */
+ assert( pTab->azModuleArg && pTab->azModuleArg[0] );
+ if( pTab->pVtab==0 ){
+ sqlite3ErrorMsg(pParse, "undefined module %s for table %s",
+ pTab->azModuleArg[0], pTab->zName);
+ return 0.0;
+ }
+
+ /* Set the aConstraint[].usable fields and initialize all
+ ** output variables to zero.
+ **
+ ** aConstraint[].usable is true for constraints where the right-hand
+ ** side contains only references to tables to the left of the current
+ ** table. In other words, if the constraint is of the form:
+ **
+ ** column = expr
+ **
+ ** and we are evaluating a join, then the constraint on column is
+ ** only valid if all tables referenced in expr occur to the left
+ ** of the table containing column.
+ **
+ ** The aConstraints[] array contains entries for all constraints
+ ** on the current table. That way we only have to compute it once
+ ** even though we might try to pick the best index multiple times.
+ ** For each attempt at picking an index, the order of tables in the
+ ** join might be different so we have to recompute the usable flag
+ ** each time.
+ */
+ pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint;
+ pUsage = pIdxInfo->aConstraintUsage;
+ for(i=0; i<pIdxInfo->nConstraint; i++, pIdxCons++){
+ j = pIdxCons->iTermOffset;
+ pTerm = &pWC->a[j];
+ pIdxCons->usable = (pTerm->prereqRight & notReady)==0;
+ }
+ memset(pUsage, 0, sizeof(pUsage[0])*pIdxInfo->nConstraint);
+ if( pIdxInfo->needToFreeIdxStr ){
+ sqlite3_free(pIdxInfo->idxStr);
+ }
+ pIdxInfo->idxStr = 0;
+ pIdxInfo->idxNum = 0;
+ pIdxInfo->needToFreeIdxStr = 0;
+ pIdxInfo->orderByConsumed = 0;
+ pIdxInfo->estimatedCost = SQLITE_BIG_DBL / 2.0;
+ nOrderBy = pIdxInfo->nOrderBy;
+ if( pIdxInfo->nOrderBy && !orderByUsable ){
+ *(int*)&pIdxInfo->nOrderBy = 0;
+ }
+
+ sqlite3SafetyOff(pParse->db);
+ TRACE(("xBestIndex for %s\n", pTab->zName));
+ TRACE_IDX_INPUTS(pIdxInfo);
+ rc = pTab->pVtab->pModule->xBestIndex(pTab->pVtab, pIdxInfo);
+ TRACE_IDX_OUTPUTS(pIdxInfo);
+ if( rc!=SQLITE_OK ){
+ if( rc==SQLITE_NOMEM ){
+ sqlite3FailedMalloc();
+ }else {
+ sqlite3ErrorMsg(pParse, "%s", sqlite3ErrStr(rc));
+ }
+ sqlite3SafetyOn(pParse->db);
+ }else{
+ rc = sqlite3SafetyOn(pParse->db);
+ }
+ *(int*)&pIdxInfo->nOrderBy = nOrderBy;
+ return pIdxInfo->estimatedCost;
+}
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
+
+/*
** 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.
@@ -893,7 +1224,7 @@ static double bestIndex(
){
WhereTerm *pTerm;
Index *bestIdx = 0; /* Index that gives the lowest cost */
- double lowestCost = 1.0e99; /* The cost of using bestIdx */
+ double lowestCost; /* 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 */
@@ -904,6 +1235,23 @@ static double bestIndex(
double cost; /* Cost of using pProbe */
TRACE(("bestIndex: tbl=%s notReady=%x\n", pSrc->pTab->zName, notReady));
+ lowestCost = SQLITE_BIG_DBL;
+ pProbe = pSrc->pTab->pIndex;
+
+ /* If the table has no indices and there are no terms in the where
+ ** clause that refer to the ROWID, then we will never be able to do
+ ** anything other than a full table scan on this table. We might as
+ ** well put it first in the join order. That way, perhaps it can be
+ ** referenced by other tables in the join.
+ */
+ if( pProbe==0 &&
+ findTerm(pWC, iCur, -1, 0, WO_EQ|WO_IN|WO_LT|WO_LE|WO_GT|WO_GE,0)==0 &&
+ (pOrderBy==0 || !sortableByRowid(iCur, pOrderBy, &rev)) ){
+ *pFlags = 0;
+ *ppIndex = 0;
+ *pnEq = 0;
+ return 0.0;
+ }
/* Check for a rowid=EXPR or rowid IN (...) constraints
*/
@@ -912,7 +1260,7 @@ static double bestIndex(
Expr *pExpr;
*ppIndex = 0;
bestFlags = WHERE_ROWID_EQ;
- if( pTerm->operator & WO_EQ ){
+ if( pTerm->eOperator & 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;
@@ -928,7 +1276,7 @@ static double bestIndex(
/* 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;
+ lowestCost = 200;
}
TRACE(("... rowid IN cost: %.9g\n", lowestCost));
}
@@ -936,8 +1284,7 @@ static double bestIndex(
/* 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;
+ cost = pProbe ? pProbe->aiRowEst[0] : 1000000;
TRACE(("... table scan base cost: %.9g\n", cost));
flags = WHERE_ROWID_RANGE;
@@ -947,11 +1294,11 @@ static double bestIndex(
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 */
+ cost /= 3; /* 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 */
+ cost /= 3; /* Guess that rowid>EXPR eliminates two-thirds of rows */
}
TRACE(("... rowid range reduces cost to %.9g\n", cost));
}else{
@@ -980,7 +1327,7 @@ static double bestIndex(
*/
for(; pProbe; pProbe=pProbe->pNext){
int i; /* Loop counter */
- double inMultiplier = 1.0;
+ double inMultiplier = 1;
TRACE(("... index %s:\n", pProbe->zName));
@@ -993,13 +1340,13 @@ static double bestIndex(
pTerm = findTerm(pWC, iCur, j, notReady, WO_EQ|WO_IN, pProbe);
if( pTerm==0 ) break;
flags |= WHERE_COLUMN_EQ;
- if( pTerm->operator & WO_IN ){
+ if( pTerm->eOperator & WO_IN ){
Expr *pExpr = pTerm->pExpr;
flags |= WHERE_COLUMN_IN;
if( pExpr->pSelect!=0 ){
- inMultiplier *= 100.0;
+ inMultiplier *= 25;
}else if( pExpr->pList!=0 ){
- inMultiplier *= pExpr->pList->nExpr + 1.0;
+ inMultiplier *= pExpr->pList->nExpr + 1;
}
}
}
@@ -1020,11 +1367,11 @@ static double bestIndex(
flags |= WHERE_COLUMN_RANGE;
if( findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE, pProbe) ){
flags |= WHERE_TOP_LIMIT;
- cost *= 0.333;
+ cost /= 3;
}
if( findTerm(pWC, iCur, j, notReady, WO_GT|WO_GE, pProbe) ){
flags |= WHERE_BTM_LIMIT;
- cost *= 0.333;
+ cost /= 3;
}
TRACE(("...... range reduces cost to %.9g\n", cost));
}
@@ -1034,7 +1381,7 @@ static double bestIndex(
*/
if( pOrderBy ){
if( (flags & WHERE_COLUMN_IN)==0 &&
- isSortingIndex(pParse,pProbe,pSrc->pTab,iCur,pOrderBy,nEq,&rev) ){
+ isSortingIndex(pParse,pProbe,iCur,pOrderBy,nEq,&rev) ){
if( flags==0 ){
flags = WHERE_COLUMN_RANGE;
}
@@ -1063,7 +1410,7 @@ static double bestIndex(
}
if( m==0 ){
flags |= WHERE_IDX_ONLY;
- cost *= 0.5;
+ cost /= 2;
TRACE(("...... idx-only reduces cost to %.9g\n", cost));
}
}
@@ -1134,14 +1481,24 @@ static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){
** * 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.
+** if any part of the key is NULL. Pop (nColumn+nExtra)
+** elements from the stack.
**
** * Construct a probe entry from the top nColumn entries in
-** the stack with affinities appropriate for index pIdx.
+** the stack with affinities appropriate for index pIdx.
+** Only nColumn elements are popped from the stack in this case
+** (by OP_MakeRecord).
+**
*/
-static void buildIndexProbe(Vdbe *v, int nColumn, int brk, Index *pIdx){
+static void buildIndexProbe(
+ Vdbe *v,
+ int nColumn,
+ int nExtra,
+ int brk,
+ Index *pIdx
+){
sqlite3VdbeAddOp(v, OP_NotNull, -nColumn, sqlite3VdbeCurrentAddr(v)+3);
- sqlite3VdbeAddOp(v, OP_Pop, nColumn, 0);
+ sqlite3VdbeAddOp(v, OP_Pop, nColumn+nExtra, 0);
sqlite3VdbeAddOp(v, OP_Goto, 0, brk);
sqlite3VdbeAddOp(v, OP_MakeRecord, nColumn, 0);
sqlite3IndexAffinityStr(v, pIdx);
@@ -1177,17 +1534,16 @@ static void codeEqualityTerm(
sqlite3CodeSubselect(pParse, pX);
iTab = pX->iTable;
- sqlite3VdbeAddOp(v, OP_Rewind, iTab, brk);
+ sqlite3VdbeAddOp(v, OP_Rewind, iTab, 0);
VdbeComment((v, "# %.*s", pX->span.n, pX->span.z));
pLevel->nIn++;
- sqlite3ReallocOrFree((void**)&pLevel->aInLoop,
- sizeof(pLevel->aInLoop[0])*3*pLevel->nIn);
+ sqliteReallocOrFree((void**)&pLevel->aInLoop,
+ sizeof(pLevel->aInLoop[0])*2*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);
+ aIn += pLevel->nIn*2 - 2;
+ aIn[0] = iTab;
+ aIn[1] = sqlite3VdbeAddOp(v, OP_Column, iTab, 0);
}else{
pLevel->nIn = 0;
}
@@ -1281,6 +1637,25 @@ static int nQPlan = 0; /* Next free slow in _query_plan[] */
#endif /* SQLITE_TEST */
+/*
+** Free a WhereInfo structure
+*/
+static void whereInfoFree(WhereInfo *pWInfo){
+ if( pWInfo ){
+ int i;
+ for(i=0; i<pWInfo->nLevel; i++){
+ sqlite3_index_info *pInfo = pWInfo->a[i].pIdxInfo;
+ if( pInfo ){
+ if( pInfo->needToFreeIdxStr ){
+ sqlite3_free(pInfo->idxStr);
+ }
+ sqliteFree(pInfo);
+ }
+ }
+ sqliteFree(pWInfo);
+ }
+}
+
/*
** Generate the beginning of the loop used for WHERE clause processing.
@@ -1408,9 +1783,10 @@ WhereInfo *sqlite3WhereBegin(
** return value.
*/
pWInfo = sqliteMalloc( sizeof(WhereInfo) + pTabList->nSrc*sizeof(WhereLevel));
- if( sqlite3_malloc_failed ){
+ if( sqlite3MallocFailed() ){
goto whereBeginNoMem;
}
+ pWInfo->nLevel = pTabList->nSrc;
pWInfo->pParse = pParse;
pWInfo->pTabList = pTabList;
pWInfo->iBreak = sqlite3VdbeMakeLabel(v);
@@ -1432,7 +1808,7 @@ WhereInfo *sqlite3WhereBegin(
createMask(&maskSet, pTabList->a[i].iCursor);
}
exprAnalyzeAll(pTabList, &maskSet, &wc);
- if( sqlite3_malloc_failed ){
+ if( sqlite3MallocFailed() ){
goto whereBeginNoMem;
}
@@ -1464,31 +1840,56 @@ WhereInfo *sqlite3WhereBegin(
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 */
+ double lowestCost; /* Cost of the pBest */
+ int bestJ = 0; /* The value of j */
Bitmask m; /* Bitmask value for j or bestJ */
+ int once = 0; /* True when first table is seen */
+ sqlite3_index_info *pIndex; /* Current virtual index */
+ lowestCost = SQLITE_BIG_DBL;
for(j=iFrom, pTabItem=&pTabList->a[j]; j<pTabList->nSrc; j++, pTabItem++){
+ int doNotReorder; /* True if this table should not be reordered */
+
+ doNotReorder = (pTabItem->jointype & (JT_LEFT|JT_CROSS))!=0
+ || (j>0 && (pTabItem[-1].jointype & (JT_LEFT|JT_CROSS))!=0);
+ if( once && doNotReorder ) break;
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);
+ assert( pTabItem->pTab );
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( IsVirtual(pTabItem->pTab) ){
+ sqlite3_index_info **ppIdxInfo = &pWInfo->a[j].pIdxInfo;
+ cost = bestVirtualIndex(pParse, &wc, pTabItem, notReady,
+ ppOrderBy ? *ppOrderBy : 0, i==0,
+ ppIdxInfo);
+ flags = WHERE_VIRTUALTABLE;
+ pIndex = *ppIdxInfo;
+ if( pIndex && pIndex->orderByConsumed ){
+ flags = WHERE_VIRTUALTABLE | WHERE_ORDERBY;
+ }
+ pIdx = 0;
+ nEq = 0;
+ }else
+#endif
+ {
+ cost = bestIndex(pParse, &wc, pTabItem, notReady,
+ (i==0 && ppOrderBy) ? *ppOrderBy : 0,
+ &pIdx, &flags, &nEq);
+ pIndex = 0;
+ }
if( cost<lowestCost ){
+ once = 1;
lowestCost = cost;
pBest = pIdx;
bestFlags = flags;
bestNEq = nEq;
bestJ = j;
+ pLevel->pBestIdx = pIndex;
}
- if( (pTabItem->jointype & (JT_LEFT|JT_CROSS))!=0
- || (j>0 && (pTabItem[-1].jointype & (JT_LEFT|JT_CROSS))!=0)
- ){
- break;
- }
+ if( doNotReorder ) break;
}
TRACE(("*** Optimizer choose table %d for loop %d\n", bestJ,
pLevel-pWInfo->a));
@@ -1522,10 +1923,10 @@ WhereInfo *sqlite3WhereBegin(
** 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;
+ Table *pTab; /* Table to open */
+ Index *pIx; /* Index used to access pTab (if any) */
+ int iDb; /* Index of database containing table/index */
int iIdxCur = pLevel->iIdxCur;
#ifndef SQLITE_OMIT_EXPLAIN
@@ -1538,27 +1939,57 @@ WhereInfo *sqlite3WhereBegin(
}
if( (pIx = pLevel->pIdx)!=0 ){
zMsg = sqlite3MPrintf("%z WITH INDEX %s", zMsg, pIx->zName);
+ }else if( pLevel->flags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){
+ zMsg = sqlite3MPrintf("%z USING PRIMARY KEY", zMsg);
+ }
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ else if( pLevel->pBestIdx ){
+ sqlite3_index_info *pBestIdx = pLevel->pBestIdx;
+ zMsg = sqlite3MPrintf("%z VIRTUAL TABLE INDEX %d:%s", zMsg,
+ pBestIdx->idxNum, pBestIdx->idxStr);
+ }
+#endif
+ if( pLevel->flags & WHERE_ORDERBY ){
+ zMsg = sqlite3MPrintf("%z ORDER BY", zMsg);
}
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;
+ iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
+ if( pTab->isEphem || pTab->pSelect ) continue;
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( pLevel->pBestIdx ){
+ int iCur = pTabItem->iCursor;
+ sqlite3VdbeOp3(v, OP_VOpen, iCur, 0, (const char*)pTab->pVtab, P3_VTAB);
+ }else
+#endif
if( (pLevel->flags & WHERE_IDX_ONLY)==0 ){
- sqlite3OpenTableForReading(v, pTabItem->iCursor, pTab);
+ sqlite3OpenTable(pParse, pTabItem->iCursor, iDb, pTab, OP_OpenRead);
+ if( pTab->nCol<(sizeof(Bitmask)*8) ){
+ Bitmask b = pTabItem->colUsed;
+ int n = 0;
+ for(; b; b=b>>1, n++){}
+ sqlite3VdbeChangeP2(v, sqlite3VdbeCurrentAddr(v)-1, n);
+ assert( n<=pTab->nCol );
+ }
+ }else{
+ sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
}
pLevel->iTabCur = pTabItem->iCursor;
if( (pIx = pLevel->pIdx)!=0 ){
- sqlite3VdbeAddOp(v, OP_Integer, pIx->iDb, 0);
+ KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIx);
+ assert( pIx->pSchema==pTab->pSchema );
+ sqlite3VdbeAddOp(v, OP_Integer, iDb, 0);
VdbeComment((v, "# %s", pIx->zName));
sqlite3VdbeOp3(v, OP_OpenRead, iIdxCur, pIx->tnum,
- (char*)&pIx->keyInfo, P3_KEYINFO);
+ (char*)pKey, P3_KEYINFO_HANDOFF);
}
if( (pLevel->flags & WHERE_IDX_ONLY)!=0 ){
sqlite3VdbeAddOp(v, OP_SetNumColumns, iIdxCur, pIx->nColumn+1);
}
- sqlite3CodeVerifySchema(pParse, pTab->iDb);
+ sqlite3CodeVerifySchema(pParse, iDb);
}
pWInfo->iTop = sqlite3VdbeCurrentAddr(v);
@@ -1601,6 +2032,47 @@ WhereInfo *sqlite3WhereBegin(
VdbeComment((v, "# init LEFT JOIN no-match flag"));
}
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ if( pLevel->pBestIdx ){
+ /* Case 0: The table is a virtual-table. Use the VFilter and VNext
+ ** to access the data.
+ */
+ int j;
+ sqlite3_index_info *pBestIdx = pLevel->pBestIdx;
+ int nConstraint = pBestIdx->nConstraint;
+ struct sqlite3_index_constraint_usage *aUsage =
+ pBestIdx->aConstraintUsage;
+ const struct sqlite3_index_constraint *aConstraint =
+ pBestIdx->aConstraint;
+
+ for(j=1; j<=nConstraint; j++){
+ int k;
+ for(k=0; k<nConstraint; k++){
+ if( aUsage[k].argvIndex==j ){
+ int iTerm = aConstraint[k].iTermOffset;
+ sqlite3ExprCode(pParse, wc.a[iTerm].pExpr->pRight);
+ break;
+ }
+ }
+ if( k==nConstraint ) break;
+ }
+ sqlite3VdbeAddOp(v, OP_Integer, j-1, 0);
+ sqlite3VdbeAddOp(v, OP_Integer, pBestIdx->idxNum, 0);
+ sqlite3VdbeOp3(v, OP_VFilter, iCur, brk, pBestIdx->idxStr,
+ pBestIdx->needToFreeIdxStr ? P3_MPRINTF : P3_STATIC);
+ pBestIdx->needToFreeIdxStr = 0;
+ for(j=0; j<pBestIdx->nConstraint; j++){
+ if( aUsage[j].omit ){
+ int iTerm = aConstraint[j].iTermOffset;
+ disableTerm(pLevel, &wc.a[iTerm]);
+ }
+ }
+ pLevel->op = OP_VNext;
+ pLevel->p1 = iCur;
+ pLevel->p2 = sqlite3VdbeCurrentAddr(v);
+ }else
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
+
if( pLevel->flags & WHERE_ROWID_EQ ){
/* Case 1: We can directly reference a single row using an
** equality comparison against the ROWID field. Or
@@ -1667,7 +2139,7 @@ WhereInfo *sqlite3WhereBegin(
if( testOp!=OP_Noop ){
sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0);
- sqlite3VdbeAddOp(v, testOp, 'n', brk);
+ sqlite3VdbeAddOp(v, testOp, SQLITE_AFF_NUMERIC, brk);
}
}else if( pLevel->flags & WHERE_COLUMN_RANGE ){
/* Case 3: The WHERE clause term that refers to the right-most
@@ -1683,8 +2155,11 @@ WhereInfo *sqlite3WhereBegin(
*/
int start;
int nEq = pLevel->nEq;
- int leFlag=0, geFlag=0;
+ int topEq=0; /* True if top limit uses ==. False is strictly < */
+ int btmEq=0; /* True if btm limit uses ==. False if strictly > */
+ int topOp, btmOp; /* Operators for the top and bottom search bounds */
int testOp;
+ int nNotNull; /* Number of rows of index that must be non-NULL */
int topLimit = (pLevel->flags & WHERE_TOP_LIMIT)!=0;
int btmLimit = (pLevel->flags & WHERE_BTM_LIMIT)!=0;
@@ -1701,6 +2176,21 @@ WhereInfo *sqlite3WhereBegin(
sqlite3VdbeAddOp(v, OP_Dup, nEq-1, 0);
}
+ /* Figure out what comparison operators to use for top and bottom
+ ** search bounds. For an ascending index, the bottom bound is a > or >=
+ ** operator and the top bound is a < or <= operator. For a descending
+ ** index the operators are reversed.
+ */
+ nNotNull = nEq + topLimit;
+ if( pIdx->aSortOrder[nEq]==SQLITE_SO_ASC ){
+ topOp = WO_LT|WO_LE;
+ btmOp = WO_GT|WO_GE;
+ }else{
+ topOp = WO_GT|WO_GE;
+ btmOp = WO_LT|WO_LE;
+ SWAP(int, topLimit, btmLimit);
+ }
+
/* 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.
@@ -1711,24 +2201,24 @@ WhereInfo *sqlite3WhereBegin(
if( topLimit ){
Expr *pX;
int k = pIdx->aiColumn[j];
- pTerm = findTerm(&wc, iCur, k, notReady, WO_LT|WO_LE, pIdx);
+ pTerm = findTerm(&wc, iCur, k, notReady, topOp, pIdx);
assert( pTerm!=0 );
pX = pTerm->pExpr;
assert( (pTerm->flags & TERM_CODED)==0 );
sqlite3ExprCode(pParse, pX->pRight);
- leFlag = pX->op==TK_LE;
+ topEq = pTerm->eOperator & (WO_LE|WO_GE);
disableTerm(pLevel, pTerm);
testOp = OP_IdxGE;
}else{
testOp = nEq>0 ? OP_IdxGE : OP_Noop;
- leFlag = 1;
+ topEq = 1;
}
if( testOp!=OP_Noop ){
int nCol = nEq + topLimit;
pLevel->iMem = pParse->nMem++;
- buildIndexProbe(v, nCol, brk, pIdx);
+ buildIndexProbe(v, nCol, nEq, brk, pIdx);
if( bRev ){
- int op = leFlag ? OP_MoveLe : OP_MoveLt;
+ int op = topEq ? OP_MoveLe : OP_MoveLt;
sqlite3VdbeAddOp(v, op, iIdxCur, brk);
}else{
sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem, 1);
@@ -1749,25 +2239,25 @@ WhereInfo *sqlite3WhereBegin(
if( btmLimit ){
Expr *pX;
int k = pIdx->aiColumn[j];
- pTerm = findTerm(&wc, iCur, k, notReady, WO_GT|WO_GE, pIdx);
+ pTerm = findTerm(&wc, iCur, k, notReady, btmOp, pIdx);
assert( pTerm!=0 );
pX = pTerm->pExpr;
assert( (pTerm->flags & TERM_CODED)==0 );
sqlite3ExprCode(pParse, pX->pRight);
- geFlag = pX->op==TK_GE;
+ btmEq = pTerm->eOperator & (WO_LE|WO_GE);
disableTerm(pLevel, pTerm);
}else{
- geFlag = 1;
+ btmEq = 1;
}
if( nEq>0 || btmLimit ){
int nCol = nEq + btmLimit;
- buildIndexProbe(v, nCol, brk, pIdx);
+ buildIndexProbe(v, nCol, 0, 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;
+ int op = btmEq ? OP_MoveGe : OP_MoveGt;
sqlite3VdbeAddOp(v, op, iIdxCur, brk);
}
}else if( bRev ){
@@ -1784,12 +2274,12 @@ WhereInfo *sqlite3WhereBegin(
if( testOp!=OP_Noop ){
sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem, 0);
sqlite3VdbeAddOp(v, testOp, iIdxCur, brk);
- if( (leFlag && !bRev) || (!geFlag && bRev) ){
+ if( (topEq && !bRev) || (!btmEq && bRev) ){
sqlite3VdbeChangeP3(v, -1, "+", P3_STATIC);
}
}
sqlite3VdbeAddOp(v, OP_RowKey, iIdxCur, 0);
- sqlite3VdbeAddOp(v, OP_IdxIsNull, nEq + topLimit, cont);
+ sqlite3VdbeAddOp(v, OP_IdxIsNull, nNotNull, cont);
if( !omitTable ){
sqlite3VdbeAddOp(v, OP_IdxRowid, iIdxCur, 0);
sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0);
@@ -1815,7 +2305,7 @@ WhereInfo *sqlite3WhereBegin(
/* Generate a single key that will be used to both start and terminate
** the search
*/
- buildIndexProbe(v, nEq, brk, pIdx);
+ buildIndexProbe(v, nEq, 0, brk, pIdx);
sqlite3VdbeAddOp(v, OP_MemStore, pLevel->iMem, 0);
/* Generate code (1) to move to the first matching element of the table.
@@ -1946,7 +2436,7 @@ WhereInfo *sqlite3WhereBegin(
/* Jump here if malloc fails */
whereBeginNoMem:
whereClauseClear(&wc);
- sqliteFree(pWInfo);
+ whereInfoFree(pWInfo);
return 0;
}
@@ -1972,8 +2462,9 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
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]);
+ for(j=pLevel->nIn, a=&pLevel->aInLoop[j*2-2]; j>0; j--, a-=2){
+ sqlite3VdbeAddOp(v, OP_Next, a[0], a[1]);
+ sqlite3VdbeJumpHere(v, a[1]-1);
}
sqliteFree(pLevel->aInLoop);
}
@@ -2000,7 +2491,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
struct SrcList_item *pTabItem = &pTabList->a[pLevel->iFrom];
Table *pTab = pTabItem->pTab;
assert( pTab!=0 );
- if( pTab->isTransient || pTab->pSelect ) continue;
+ if( pTab->isEphem || pTab->pSelect ) continue;
if( (pLevel->flags & WHERE_IDX_ONLY)==0 ){
sqlite3VdbeAddOp(v, OP_Close, pTabItem->iCursor, 0);
}
@@ -2018,14 +2509,14 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
** reference the index.
*/
if( pLevel->flags & WHERE_IDX_ONLY ){
- int i, j, last;
+ int k, 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++){
+ for(k=pWInfo->iTop; k<last; k++, pOp++){
if( pOp->p1!=pLevel->iTabCur ) continue;
if( pOp->opcode==OP_Column ){
pOp->p1 = pLevel->iIdxCur;
@@ -2047,6 +2538,6 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
/* Final cleanup
*/
- sqliteFree(pWInfo);
+ whereInfoFree(pWInfo);
return;
}
diff --git a/ext/pdo_sqlite/sqlite/tool/lemon.c b/ext/pdo_sqlite/sqlite/tool/lemon.c
index 8f6e87330..759e1c378 100644
--- a/ext/pdo_sqlite/sqlite/tool/lemon.c
+++ b/ext/pdo_sqlite/sqlite/tool/lemon.c
@@ -94,6 +94,7 @@ void ReportOutput(/* struct lemon * */);
void ReportTable(/* struct lemon * */);
void ReportHeader(/* struct lemon * */);
void CompressTables(/* struct lemon * */);
+void ResortStates(/* struct lemon * */);
/********** From the file "set.h" ****************************************/
void SetSize(/* int N */); /* All sets will be of size N */
@@ -119,7 +120,8 @@ struct symbol {
int index; /* Index number for this symbol */
enum {
TERMINAL,
- NONTERMINAL
+ NONTERMINAL,
+ MULTITERMINAL
} 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 */
@@ -140,6 +142,9 @@ struct symbol {
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 */
+ /* The following fields are used by MULTITERMINALs only */
+ int nsubsym; /* Number of constituent symbols in the MULTI */
+ struct symbol **subsym; /* Array of constituent symbols */
};
/* Each production rule in the grammar is stored in the following
@@ -206,7 +211,7 @@ struct action {
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 */
+ int statenum; /* 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 */
@@ -236,6 +241,7 @@ struct lemon {
struct symbol **symbols; /* Sorted array of pointers to symbols */
int errorcnt; /* Number of errors */
struct symbol *errsym; /* The error symbol */
+ struct symbol *wildcard; /* Token that matches anything */
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 */
@@ -584,11 +590,18 @@ 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 ){
+ int i, j;
+ for(i=0; i<rp->nrhs && rp->precsym==0; i++){
+ struct symbol *sp = rp->rhs[i];
+ if( sp->type==MULTITERMINAL ){
+ for(j=0; j<sp->nsubsym; j++){
+ if( sp->subsym[j]->prec>=0 ){
+ rp->precsym = sp->subsym[j];
+ break;
+ }
+ }
+ }else if( sp->prec>=0 ){
rp->precsym = rp->rhs[i];
- break;
}
}
}
@@ -604,7 +617,7 @@ struct lemon *xp;
void FindFirstSets(lemp)
struct lemon *lemp;
{
- int i;
+ int i, j;
struct rule *rp;
int progress;
@@ -621,7 +634,8 @@ struct lemon *lemp;
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;
+ struct symbol *sp = rp->rhs[i];
+ if( sp->type!=TERMINAL || sp->lambda==B_FALSE ) break;
}
if( i==rp->nrhs ){
rp->lhs->lambda = B_TRUE;
@@ -641,6 +655,11 @@ struct lemon *lemp;
if( s2->type==TERMINAL ){
progress += SetAdd(s1->firstset,s2->index);
break;
+ }else if( s2->type==MULTITERMINAL ){
+ for(j=0; j<s2->nsubsym; j++){
+ progress += SetAdd(s1->firstset,s2->subsym[j]->index);
+ }
+ break;
}else if( s1==s2 ){
if( s1->lambda==B_FALSE ) break;
}else{
@@ -687,7 +706,7 @@ symbol instead.",lemp->start,lemp->rule->lhs->name);
for(rp=lemp->rule; rp; rp=rp->next){
int i;
for(i=0; i<rp->nrhs; i++){
- if( rp->rhs[i]==sp ){
+ if( rp->rhs[i]==sp ){ /* FIX ME: Deal with multiterminals */
ErrorMsg(lemp->filename,0,
"The start symbol \"%s\" occurs on the \
right-hand side of a rule. This will result in a parser which \
@@ -751,7 +770,7 @@ struct lemon *lemp;
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->statenum = 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 */
@@ -759,6 +778,24 @@ struct lemon *lemp;
return stp;
}
+/*
+** Return true if two symbols are the same.
+*/
+int same_symbol(a,b)
+struct symbol *a;
+struct symbol *b;
+{
+ int i;
+ if( a==b ) return 1;
+ if( a->type!=MULTITERMINAL ) return 0;
+ if( b->type!=MULTITERMINAL ) return 0;
+ if( a->nsubsym!=b->nsubsym ) return 0;
+ for(i=0; i<a->nsubsym; i++){
+ if( a->subsym[i]!=b->subsym[i] ) return 0;
+ }
+ return 1;
+}
+
/* Construct all successor states to the given state. A "successor"
** state is any state which can be reached by a shift action.
*/
@@ -791,7 +828,7 @@ struct state *stp; /* The state from which successors are computed */
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" */
+ if( !same_symbol(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);
@@ -803,7 +840,14 @@ struct state *stp; /* The state from which successors are computed */
/* 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);
+ if( sp->type==MULTITERMINAL ){
+ int i;
+ for(i=0; i<sp->nsubsym; i++){
+ Action_add(&stp->ap,SHIFT,sp->subsym[i],(char*)newstp);
+ }
+ }else{
+ Action_add(&stp->ap,SHIFT,sp,(char *)newstp);
+ }
}
}
@@ -1166,6 +1210,12 @@ struct lemon *lemp;
if( xsp->type==TERMINAL ){
SetAdd(newcfp->fws,xsp->index);
break;
+ }else if( xsp->type==MULTITERMINAL ){
+ int k;
+ for(k=0; k<xsp->nsubsym; k++){
+ SetAdd(newcfp->fws, xsp->subsym[k]->index);
+ }
+ break;
}else{
SetUnion(newcfp->fws,xsp->firstset);
if( xsp->lambda==B_FALSE ) break;
@@ -1373,6 +1423,7 @@ char **argv;
fprintf(stderr,"Exactly one filename argument is required.\n");
exit(1);
}
+ memset(&lem, 0, sizeof(lem));
lem.errorcnt = 0;
/* Initialize the machine */
@@ -1382,22 +1433,13 @@ char **argv;
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 ){
+ if( lem.nrule==0 ){
fprintf(stderr,"Empty grammar.\n");
exit(1);
}
@@ -1445,6 +1487,10 @@ char **argv;
/* Compress the action tables */
if( compress==0 ) CompressTables(&lem);
+ /* Reorder and renumber the states so that states with fewer choices
+ ** occur at the end. */
+ ResortStates(&lem);
+
/* Generate a report of the parser generated. (the "y.output" file) */
if( !quiet ) ReportOutput(&lem);
@@ -1694,6 +1740,7 @@ FILE *err;
int j;
int errcnt = 0;
cp = strchr(argv[i],'=');
+ assert( cp!=0 );
*cp = 0;
for(j=0; op[j].label; j++){
if( strcmp(argv[i],op[j].label)==0 ) break;
@@ -1906,7 +1953,8 @@ struct pstate {
RESYNC_AFTER_DECL_ERROR,
WAITING_FOR_DESTRUCTOR_SYMBOL,
WAITING_FOR_DATATYPE_SYMBOL,
- WAITING_FOR_FALLBACK_ID
+ WAITING_FOR_FALLBACK_ID,
+ WAITING_FOR_WILDCARD_ID
} state; /* The state of the parser */
struct symbol *fallback; /* The fallback token */
struct symbol *lhs; /* Left-hand side of current rule */
@@ -2086,7 +2134,7 @@ to follow the previous 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\".",
+ "Too many symbols on RHS or rule beginning at \"%s\".",
x);
psp->errorcnt++;
psp->state = RESYNC_AFTER_RULE_ERROR;
@@ -2095,6 +2143,27 @@ to follow the previous rule.");
psp->alias[psp->nrhs] = 0;
psp->nrhs++;
}
+ }else if( (x[0]=='|' || x[0]=='/') && psp->nrhs>0 ){
+ struct symbol *msp = psp->rhs[psp->nrhs-1];
+ if( msp->type!=MULTITERMINAL ){
+ struct symbol *origsp = msp;
+ msp = malloc(sizeof(*msp));
+ memset(msp, 0, sizeof(*msp));
+ msp->type = MULTITERMINAL;
+ msp->nsubsym = 1;
+ msp->subsym = malloc(sizeof(struct symbol*));
+ msp->subsym[0] = origsp;
+ msp->name = origsp->name;
+ psp->rhs[psp->nrhs-1] = msp;
+ }
+ msp->nsubsym++;
+ msp->subsym = realloc(msp->subsym, sizeof(struct symbol*)*msp->nsubsym);
+ msp->subsym[msp->nsubsym-1] = Symbol_new(&x[1]);
+ if( islower(x[1]) || islower(msp->subsym[0]->name[0]) ){
+ ErrorMsg(psp->filename,psp->tokenlineno,
+ "Cannot form a compound containing a non-terminal");
+ psp->errorcnt++;
+ }
}else if( x[0]=='(' && psp->nrhs>0 ){
psp->state = RHS_ALIAS_1;
}else{
@@ -2189,6 +2258,8 @@ to follow the previous rule.");
}else if( strcmp(x,"fallback")==0 ){
psp->fallback = 0;
psp->state = WAITING_FOR_FALLBACK_ID;
+ }else if( strcmp(x,"wildcard")==0 ){
+ psp->state = WAITING_FOR_WILDCARD_ID;
}else{
ErrorMsg(psp->filename,psp->tokenlineno,
"Unknown declaration keyword: \"%%%s\".",x);
@@ -2289,6 +2360,24 @@ to follow the previous rule.");
}
}
break;
+ case WAITING_FOR_WILDCARD_ID:
+ if( x[0]=='.' ){
+ psp->state = WAITING_FOR_DECL_OR_RULE;
+ }else if( !isupper(x[0]) ){
+ ErrorMsg(psp->filename, psp->tokenlineno,
+ "%%wildcard argument \"%s\" should be a token", x);
+ psp->errorcnt++;
+ }else{
+ struct symbol *sp = Symbol_new(x);
+ if( psp->gp->wildcard==0 ){
+ psp->gp->wildcard = sp;
+ }else{
+ ErrorMsg(psp->filename, psp->tokenlineno,
+ "Extra wildcard to token: %s", x);
+ psp->errorcnt++;
+ }
+ }
+ break;
case RESYNC_AFTER_RULE_ERROR:
/* if( x[0]=='.' ) psp->state = WAITING_FOR_DECL_OR_RULE;
** break; */
@@ -2482,6 +2571,10 @@ struct lemon *gp;
}else if( c==':' && cp[1]==':' && cp[2]=='=' ){ /* The operator "::=" */
cp += 3;
nextcp = cp;
+ }else if( (c=='/' || c=='|') && isalpha(cp[1]) ){
+ cp += 2;
+ while( (c = *cp)!=0 && (isalnum(c) || c=='_') ) cp++;
+ nextcp = cp;
}else{ /* All other (one character) operators */
cp++;
nextcp = cp;
@@ -2641,15 +2734,21 @@ struct lemon *lemp;
}
for(rp=lemp->rule; rp; rp=rp->next){
printf("%s",rp->lhs->name);
-/* if( rp->lhsalias ) printf("(%s)",rp->lhsalias); */
+ /* 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]); */
+ sp = rp->rhs[i];
+ printf(" %s", sp->name);
+ if( sp->type==MULTITERMINAL ){
+ for(j=1; j<sp->nsubsym; j++){
+ printf("|%s", sp->subsym[j]->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); */
+ /* if( rp->code ) printf("\n %s",rp->code); */
printf("\n");
}
}
@@ -2659,18 +2758,25 @@ FILE *fp;
struct config *cfp;
{
struct rule *rp;
- int i;
+ struct symbol *sp;
+ int i, j;
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);
+ sp = rp->rhs[i];
+ fprintf(fp," %s", sp->name);
+ if( sp->type==MULTITERMINAL ){
+ for(j=1; j<sp->nsubsym; j++){
+ fprintf(fp,"|%s",sp->subsym[j]->name);
+ }
+ }
}
}
/* #define TEST */
-#ifdef TEST
+#if 0
/* Print a set */
PRIVATE void SetPrint(out,set,lemp)
FILE *out;
@@ -2697,7 +2803,7 @@ struct plink *plp;
char *tag;
{
while( plp ){
- fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->index);
+ fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->statenum);
ConfigPrint(out,plp->cfp);
fprintf(out,"\n");
plp = plp->next;
@@ -2712,7 +2818,7 @@ 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);
+ fprintf(fp,"%*s shift %d",indent,ap->sp->name,ap->x.stp->statenum);
break;
case REDUCE:
fprintf(fp,"%*s reduce %d",indent,ap->sp->name,ap->x.rp->index);
@@ -2751,7 +2857,7 @@ struct lemon *lemp;
fprintf(fp," \b");
for(i=0; i<lemp->nstate; i++){
stp = lemp->sorted[i];
- fprintf(fp,"State %d:\n",stp->index);
+ fprintf(fp,"State %d:\n",stp->statenum);
if( lemp->basisflag ) cfp=stp->bp;
else cfp=stp->cfp;
while( cfp ){
@@ -2764,7 +2870,7 @@ struct lemon *lemp;
}
ConfigPrint(fp,cfp);
fprintf(fp,"\n");
-#ifdef TEST
+#if 0
SetPrint(fp,cfp->fws,lemp);
PlinkPrint(fp,cfp->fplp,"To ");
PlinkPrint(fp,cfp->bplp,"From");
@@ -2837,7 +2943,7 @@ struct action *ap;
{
int act;
switch( ap->type ){
- case SHIFT: act = ap->x.stp->index; break;
+ case SHIFT: act = ap->x.stp->statenum; 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;
@@ -3108,8 +3214,14 @@ PRIVATE void translate_code(struct lemon *lemp, struct rule *rp){
** 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);
+ struct symbol *sp = rp->rhs[i];
+ int dtnum;
+ if( sp->type==MULTITERMINAL ){
+ dtnum = sp->subsym[0]->dtnum;
+ }else{
+ dtnum = sp->dtnum;
+ }
+ append_str("yymsp[%d].minor.yy%d",0,i-rp->nrhs+1, dtnum);
}
cp = xp;
used[i] = 1;
@@ -3391,6 +3503,10 @@ int mhflag; /* Output in makeheaders format if true */
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++;
+ if( lemp->wildcard ){
+ fprintf(out,"#define YYWILDCARD %d\n",
+ lemp->wildcard->index); lineno++;
+ }
print_stack_union(out,lemp,&lineno,mhflag);
if( lemp->stacksize ){
if( atoi(lemp->stacksize)<=0 ){
@@ -3457,21 +3573,6 @@ int mhflag; /* Output in makeheaders format if true */
}
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;
@@ -3552,9 +3653,11 @@ int mhflag; /* Output in makeheaders format if true */
/* Output the yy_shift_ofst[] table */
fprintf(out, "#define YY_SHIFT_USE_DFLT (%d)\n", mnTknOfst-1); lineno++;
+ n = lemp->nstate;
+ while( n>0 && lemp->sorted[n-1]->iTknOfst==NO_OFFSET ) n--;
+ fprintf(out, "#define YY_SHIFT_MAX %d\n", n-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];
@@ -3573,9 +3676,11 @@ int mhflag; /* Output in makeheaders format if true */
/* Output the yy_reduce_ofst[] table */
fprintf(out, "#define YY_REDUCE_USE_DFLT (%d)\n", mnNtOfst-1); lineno++;
+ n = lemp->nstate;
+ while( n>0 && lemp->sorted[n-1]->iNtOfst==NO_OFFSET ) n--;
+ fprintf(out, "#define YY_REDUCE_MAX %d\n", n-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];
@@ -3642,7 +3747,16 @@ int mhflag; /* Output in makeheaders format if true */
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);
+ for(j=0; j<rp->nrhs; j++){
+ struct symbol *sp = rp->rhs[j];
+ fprintf(out," %s", sp->name);
+ if( sp->type==MULTITERMINAL ){
+ int k;
+ for(k=1; k<sp->nsubsym; k++){
+ fprintf(out,"|%s",sp->subsym[k]->name);
+ }
+ }
+ }
fprintf(out,"\",\n"); lineno++;
}
tplt_xfer(lemp->name,in,out,&lineno);
@@ -3789,7 +3903,8 @@ struct lemon *lemp;
** 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.
+** it the default. Except, there is no default if the wildcard token
+** is a possible look-ahead.
*/
void CompressTables(lemp)
struct lemon *lemp;
@@ -3799,13 +3914,18 @@ struct lemon *lemp;
struct rule *rp, *rp2, *rbest;
int nbest, n;
int i;
+ int usesWildcard;
for(i=0; i<lemp->nstate; i++){
stp = lemp->sorted[i];
nbest = 0;
rbest = 0;
+ usesWildcard = 0;
for(ap=stp->ap; ap; ap=ap->next){
+ if( ap->type==SHIFT && ap->sp==lemp->wildcard ){
+ usesWildcard = 1;
+ }
if( ap->type!=REDUCE ) continue;
rp = ap->x.rp;
if( rp==rbest ) continue;
@@ -3823,8 +3943,10 @@ struct lemon *lemp;
}
/* Do not make a default if the number of rules to default
- ** is not at least 2 */
- if( nbest<2 ) continue;
+ ** is not at least 1 or if the wildcard token is a possible
+ ** lookahead.
+ */
+ if( nbest<1 || usesWildcard ) continue;
/* Combine matching REDUCE actions into a single default */
@@ -3840,6 +3962,63 @@ struct lemon *lemp;
}
}
+
+/*
+** Compare two states for sorting purposes. The smaller state is the
+** one with the most non-terminal actions. If they have the same number
+** of non-terminal actions, then the smaller is the one with the most
+** token actions.
+*/
+static int stateResortCompare(const void *a, const void *b){
+ const struct state *pA = *(const struct state**)a;
+ const struct state *pB = *(const struct state**)b;
+ int n;
+
+ n = pB->nNtAct - pA->nNtAct;
+ if( n==0 ){
+ n = pB->nTknAct - pA->nTknAct;
+ }
+ return n;
+}
+
+
+/*
+** Renumber and resort states so that states with fewer choices
+** occur at the end. Except, keep state 0 as the first state.
+*/
+void ResortStates(lemp)
+struct lemon *lemp;
+{
+ int i;
+ struct state *stp;
+ struct action *ap;
+
+ 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);
+ }
+ }
+ }
+ }
+ qsort(&lemp->sorted[1], lemp->nstate-1, sizeof(lemp->sorted[0]),
+ stateResortCompare);
+ for(i=0; i<lemp->nstate; i++){
+ lemp->sorted[i]->statenum = i;
+ }
+}
+
+
/***************** From the file "set.c" ************************************/
/*
** Set manipulation routines for the LEMON parser generator.
@@ -3932,6 +4111,7 @@ char *y;
{
char *z;
+ if( y==0 ) return 0;
z = Strsafe_find(y);
if( z==0 && (z=malloc( strlen(y)+1 ))!=0 ){
strcpy(z,y);
diff --git a/ext/pdo_sqlite/sqlite/tool/lempar.c b/ext/pdo_sqlite/sqlite/tool/lempar.c
index 57ec97f6a..a18c43a24 100644
--- a/ext/pdo_sqlite/sqlite/tool/lempar.c
+++ b/ext/pdo_sqlite/sqlite/tool/lempar.c
@@ -107,7 +107,7 @@
** yy_default[] Default action for each state.
*/
%%
-#define YY_SZ_ACTTAB (sizeof(yy_action)/sizeof(yy_action[0]))
+#define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))
/* The next table maps tokens into fallback tokens. If a construct
** like the following:
@@ -321,14 +321,12 @@ void ParseFree(
*/
static int yy_find_shift_action(
yyParser *pParser, /* The parser */
- int iLookAhead /* The look-ahead token */
+ YYCODETYPE 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 ){
+ if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
return yy_default[stateno];
}
if( iLookAhead==YYNOCODE ){
@@ -336,19 +334,35 @@ static int yy_find_shift_action(
}
i += iLookAhead;
if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
+ if( iLookAhead>0 ){
#ifdef YYFALLBACK
- int iFallback; /* Fallback token */
- if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
- && (iFallback = yyFallback[iLookAhead])!=0 ){
+ 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]);
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
+ yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
+ }
+#endif
+ return yy_find_shift_action(pParser, iFallback);
}
#endif
- return yy_find_shift_action(pParser, iFallback);
+#ifdef YYWILDCARD
+ {
+ int j = i - iLookAhead + YYWILDCARD;
+ if( j>=0 && j<YY_SZ_ACTTAB && yy_lookahead[j]==YYWILDCARD ){
+#ifndef NDEBUG
+ if( yyTraceFILE ){
+ fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
+ yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
+ }
+#endif /* NDEBUG */
+ return yy_action[j];
+ }
+ }
+#endif /* YYWILDCARD */
}
-#endif
return yy_default[stateno];
}else{
return yy_action[i];
@@ -365,13 +379,13 @@ static int yy_find_shift_action(
*/
static int yy_find_reduce_action(
int stateno, /* Current state number */
- int iLookAhead /* The look-ahead token */
+ YYCODETYPE 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 ){
+ if( stateno>YY_REDUCE_MAX ||
+ (i = yy_reduce_ofst[stateno])==YY_REDUCE_USE_DFLT ){
return yy_default[stateno];
}
if( iLookAhead==YYNOCODE ){
@@ -456,7 +470,7 @@ static void yy_reduce(
yymsp = &yypParser->yystack[yypParser->yyidx];
#ifndef NDEBUG
if( yyTraceFILE && yyruleno>=0
- && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
+ && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
yyRuleName[yyruleno]);
}
@@ -669,7 +683,9 @@ void Parse(
while(
yypParser->yyidx >= 0 &&
yymx != YYERRORSYMBOL &&
- (yyact = yy_find_shift_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE
+ (yyact = yy_find_reduce_action(
+ yypParser->yystack[yypParser->yyidx].stateno,
+ YYERRORSYMBOL)) >= YYNSTATE
){
yy_pop_parser_stack(yypParser);
}
diff --git a/ext/pdo_sqlite/sqlite/tool/memleak3.tcl b/ext/pdo_sqlite/sqlite/tool/memleak3.tcl
index 2e3f43bc1..3c6e9b9c5 100644
--- a/ext/pdo_sqlite/sqlite/tool/memleak3.tcl
+++ b/ext/pdo_sqlite/sqlite/tool/memleak3.tcl
@@ -198,6 +198,7 @@ proc report {} {
lappend summarymap($stack) $bytes
}
+ set sorted [list]
foreach stack [array names summarymap] {
set allocs $summarymap($stack)
set sum 0
diff --git a/ext/pdo_sqlite/sqlite/tool/mkkeywordhash.c b/ext/pdo_sqlite/sqlite/tool/mkkeywordhash.c
index 58d4b9cb7..3301a40e9 100644
--- a/ext/pdo_sqlite/sqlite/tool/mkkeywordhash.c
+++ b/ext/pdo_sqlite/sqlite/tool/mkkeywordhash.c
@@ -105,7 +105,11 @@ struct Keyword {
#else
# define VIEW 0x00008000
#endif
-
+#ifdef SQLITE_OMIT_VIRTUALTABLE
+# define VTAB 0
+#else
+# define VTAB 0x00010000
+#endif
/*
** These are the keywords
@@ -155,7 +159,7 @@ static Keyword aKeywordTable[] = {
{ "ESCAPE", "TK_ESCAPE", ALWAYS },
{ "EXCEPT", "TK_EXCEPT", COMPOUND },
{ "EXCLUSIVE", "TK_EXCLUSIVE", ALWAYS },
- { "EXISTS", "TK_EXISTS", SUBQUERY },
+ { "EXISTS", "TK_EXISTS", ALWAYS },
{ "EXPLAIN", "TK_EXPLAIN", EXPLAIN },
{ "FAIL", "TK_FAIL", CONFLICT|TRIGGER },
{ "FOR", "TK_FOR", TRIGGER },
@@ -165,6 +169,7 @@ static Keyword aKeywordTable[] = {
{ "GLOB", "TK_LIKE_KW", ALWAYS },
{ "GROUP", "TK_GROUP", ALWAYS },
{ "HAVING", "TK_HAVING", ALWAYS },
+ { "IF", "TK_IF", ALWAYS },
{ "IGNORE", "TK_IGNORE", CONFLICT|TRIGGER },
{ "IMMEDIATE", "TK_IMMEDIATE", ALWAYS },
{ "IN", "TK_IN", ALWAYS },
@@ -222,6 +227,7 @@ static Keyword aKeywordTable[] = {
{ "VACUUM", "TK_VACUUM", VACUUM },
{ "VALUES", "TK_VALUES", ALWAYS },
{ "VIEW", "TK_VIEW", VIEW },
+ { "VIRTUAL", "TK_VIRTUAL", VTAB },
{ "WHEN", "TK_WHEN", ALWAYS },
{ "WHERE", "TK_WHERE", ALWAYS },
};
@@ -482,8 +488,8 @@ int main(int argc, char **argv){
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"
+ printf(" h = ((charMap(z[0])*4) ^\n"
+ " (charMap(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 &&"
@@ -493,8 +499,8 @@ int main(int argc, char **argv){
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("int sqlite3KeywordCode(const unsigned char *z, int n){\n");
+ printf(" return keywordCode((char*)z, n);\n");
printf("}\n");
return 0;
diff --git a/ext/pdo_sqlite/sqlite/tool/showdb.c b/ext/pdo_sqlite/sqlite/tool/showdb.c
index fe105c7bb..b2ed562e9 100644
--- a/ext/pdo_sqlite/sqlite/tool/showdb.c
+++ b/ext/pdo_sqlite/sqlite/tool/showdb.c
@@ -13,6 +13,7 @@
static int pagesize = 1024;
static int db = -1;
static int mxPage = 0;
+static int perLine = 32;
static void out_of_memory(void){
fprintf(stderr,"Out of memory...\n");
@@ -27,12 +28,12 @@ static print_page(int iPg){
lseek(db, (iPg-1)*pagesize, SEEK_SET);
read(db, aData, pagesize);
fprintf(stdout, "Page %d:\n", iPg);
- for(i=0; i<pagesize; i += 16){
+ for(i=0; i<pagesize; i += perLine){
fprintf(stdout, " %03x: ",i);
- for(j=0; j<16; j++){
+ for(j=0; j<perLine; j++){
fprintf(stdout,"%02x ", aData[i+j]);
}
- for(j=0; j<16; j++){
+ for(j=0; j<perLine; j++){
fprintf(stdout,"%c", isprint(aData[i+j]) ? aData[i+j] : '.');
}
fprintf(stdout,"\n");
diff --git a/ext/pdo_sqlite/sqlite/tool/spaceanal.tcl b/ext/pdo_sqlite/sqlite/tool/spaceanal.tcl
index c9b8f92e2..c0fe5b5d8 100644
--- a/ext/pdo_sqlite/sqlite/tool/spaceanal.tcl
+++ b/ext/pdo_sqlite/sqlite/tool/spaceanal.tcl
@@ -3,6 +3,8 @@
# versus how much space is unused.
#
+if {[catch {
+
# Get the name of the database to analyze
#
#set argv $argv0
@@ -122,6 +124,7 @@ set sql {
SELECT 'sqlite_master', 1
ORDER BY 1
}
+set wideZero [expr {10000000000 - 10000000000}]
foreach {name rootpage} [db eval $sql] {
puts stderr "Analyzing table $name..."
@@ -129,18 +132,18 @@ foreach {name rootpage} [db eval $sql] {
# 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
+ set total_payload $wideZero ;# Payload space used by all entries
+ set total_ovfl $wideZero ;# Payload space on overflow pages
+ set unused_int $wideZero ;# Unused space on interior nodes
+ set unused_leaf $wideZero ;# Unused space on leaf nodes
+ set unused_ovfl $wideZero ;# Unused space on overflow pages
+ set cnt_ovfl $wideZero ;# Number of entries that use overflows
+ set cnt_leaf_entry $wideZero ;# Number of leaf entries
+ set cnt_int_entry $wideZero ;# Number of interor entries
+ set mx_payload $wideZero ;# Maximum payload size
+ set ovfl_pages $wideZero ;# Number of overflow pages used
+ set leaf_pages $wideZero ;# Number of leaf pages
+ set int_pages $wideZero ;# 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.
@@ -266,15 +269,15 @@ foreach {name tbl_name rootpage} [db eval $sql] {
# 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
+ set total_payload $wideZero ;# Payload space used by all entries
+ set total_ovfl $wideZero ;# Payload space on overflow pages
+ set unused_leaf $wideZero ;# Unused space on leaf nodes
+ set unused_ovfl $wideZero ;# Unused space on overflow pages
+ set cnt_ovfl $wideZero ;# Number of entries that use overflows
+ set cnt_leaf_entry $wideZero ;# Number of leaf entries
+ set mx_payload $wideZero ;# Maximum payload size
+ set ovfl_pages $wideZero ;# Number of overflow pages used
+ set leaf_pages $wideZero ;# 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.
@@ -799,3 +802,9 @@ mem eval {SELECT * FROM space_used} x {
puts ");"
}
puts "COMMIT;"
+
+} err]} {
+ puts "ERROR: $err"
+ puts $errorInfo
+ exit 1
+}
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c
index 8caba37aa..5d65c22fe 100644
--- a/ext/pdo_sqlite/sqlite_driver.c
+++ b/ext/pdo_sqlite/sqlite_driver.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sqlite_driver.c,v 1.20.2.5 2006/01/01 12:50:12 sniper Exp $ */
+/* $Id: sqlite_driver.c,v 1.20.2.5.2.1 2006/09/16 18:30:03 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -642,6 +642,10 @@ 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 (!fullpath) {
+ return NULL;
+ }
+
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
efree(fullpath);
return NULL;
diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4
index e15344d91..88d0faff1 100644
--- a/ext/pgsql/config.m4
+++ b/ext/pgsql/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.46.2.1 2006/01/05 21:53:19 sniper Exp $
+dnl $Id: config.m4,v 1.46.2.1.2.3 2006/10/06 21:45:10 iliaa Exp $
dnl
AC_DEFUN([PHP_PGSQL_CHECK_FUNCTIONS],[
@@ -90,6 +90,9 @@ if test "$PHP_PGSQL" != "no"; then
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, PQftable,AC_DEFINE(HAVE_PQFTABLE,1,[PostgreSQL 7.4 or later]))
+ AC_CHECK_LIB(pq, PQescapeStringConn, AC_DEFINE(HAVE_PQESCAPE_CONN,1,[PostgreSQL 8.1.4 or later]))
+ AC_CHECK_LIB(pq, PQescapeByteaConn, AC_DEFINE(HAVE_PQESCAPE_BYTEA_CONN,1,[PostgreSQL 8.1.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
diff --git a/ext/pgsql/config.w32 b/ext/pgsql/config.w32
index 4ac49276f..414bfbd97 100644
--- a/ext/pgsql/config.w32
+++ b/ext/pgsql/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.7 2005/06/05 19:25:01 wez Exp $
+// $Id: config.w32,v 1.7.4.3 2006/10/11 11:00:02 edink Exp $
// vim:ft=javascript
ARG_WITH("pgsql", "PostgreSQL support", "no");
@@ -8,7 +8,7 @@ if (PHP_PGSQL != "no") {
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");
+ 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 /D HAVE_PQFTABLE /D HAVE_PQESCAPE_CONN /D HAVE_PQESCAPE_BYTEA_CONN");
} else {
WARNING("pgsql not enabled; libraries and headers not found");
}
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index df233118e..7439d7f3d 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.331.2.13 2006/04/10 19:51:55 helly Exp $ */
+/* $Id: pgsql.c,v 1.331.2.13.2.9 2006/10/06 21:45:10 iliaa Exp $ */
#include <stdlib.h>
@@ -81,6 +81,9 @@
#define CHECK_DEFAULT_LINK(x) if ((x) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "No PostgreSQL link opened yet"); }
+ZEND_DECLARE_MODULE_GLOBALS(pgsql)
+static PHP_GINIT_FUNCTION(pgsql);
+
/* {{{ pgsql_functions[]
*/
zend_function_entry pgsql_functions[] = {
@@ -151,6 +154,9 @@ zend_function_entry pgsql_functions[] = {
PHP_FE(pg_field_type_oid, NULL)
PHP_FE(pg_field_prtlen, NULL)
PHP_FE(pg_field_is_null,NULL)
+#ifdef HAVE_PQFTABLE
+ PHP_FE(pg_field_table, NULL)
+#endif
/* async message function */
PHP_FE(pg_get_notify, NULL)
PHP_FE(pg_get_pid, NULL)
@@ -247,7 +253,11 @@ zend_module_entry pgsql_module_entry = {
PHP_RSHUTDOWN(pgsql),
PHP_MINFO(pgsql),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(pgsql),
+ PHP_GINIT(pgsql),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
@@ -257,8 +267,6 @@ ZEND_GET_MODULE(pgsql)
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)
{
@@ -445,9 +453,9 @@ STD_PHP_INI_BOOLEAN( "pgsql.log_notice", "0", PHP_INI_ALL, OnUpda
PHP_INI_END()
/* }}} */
-/* {{{ php_pgsql_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
-static void php_pgsql_init_globals(zend_pgsql_globals *pgsql_globals)
+static PHP_GINIT_FUNCTION(pgsql)
{
memset(pgsql_globals, 0, sizeof(zend_pgsql_globals));
/* Initilize notice message hash at MINIT only */
@@ -459,8 +467,6 @@ static void php_pgsql_init_globals(zend_pgsql_globals *pgsql_globals)
*/
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);
@@ -1694,6 +1700,97 @@ static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC)
}
/* }}} */
+#ifdef HAVE_PQFTABLE
+/* {{{ proto mixed pg_field_table(resource result, int field_number[, bool oid_only])
+ Returns the name of the table field belongs to, or table's oid if oid_only is true */
+PHP_FUNCTION(pg_field_table)
+{
+ zval *result;
+ pgsql_result_handle *pg_result;
+ long fnum = -1;
+ zend_bool return_oid = 0;
+ Oid oid;
+ smart_str hash_key = {0};
+ char *table_name;
+ zend_rsrc_list_entry *field_table;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|b!", &result, &fnum, &return_oid) == FAILURE) {
+ return;
+ }
+
+ ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result);
+
+ if (fnum < 0 || fnum >= PQnfields(pg_result->result)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset specified");
+ RETURN_FALSE;
+ }
+
+ oid = PQftable(pg_result->result, fnum);
+
+ if (InvalidOid == oid) {
+ RETURN_FALSE;
+ }
+
+
+ if (return_oid) {
+ if (oid > LONG_MAX) {
+ smart_str oidstr = {0};
+ smart_str_append_unsigned(&oidstr, oid);
+ smart_str_0(&oidstr);
+ RETURN_STRINGL(oidstr.c, oidstr.len, 0);
+ } else {
+ RETURN_LONG((long)oid);
+ }
+ }
+
+ /* try to lookup the table name in the resource list */
+ smart_str_appends(&hash_key, "pgsql_table_oid_");
+ smart_str_append_unsigned(&hash_key, oid);
+ smart_str_0(&hash_key);
+
+ if (zend_hash_find(&EG(regular_list), hash_key.c, hash_key.len+1, (void **) &field_table) == SUCCESS) {
+ smart_str_free(&hash_key);
+ RETURN_STRING((char *)field_table->ptr, 1);
+ } else { /* Not found, lookup by querying PostgreSQL system tables */
+ PGresult *tmp_res;
+ smart_str querystr = {0};
+ zend_rsrc_list_entry new_field_table;
+
+ smart_str_appends(&querystr, "select relname from pg_class where oid=");
+ smart_str_append_unsigned(&querystr, oid);
+ smart_str_0(&querystr);
+
+
+ if ((tmp_res = PQexec(pg_result->conn, querystr.c)) == NULL || PQresultStatus(tmp_res) != PGRES_TUPLES_OK) {
+ if (tmp_res) {
+ PQclear(tmp_res);
+ }
+ smart_str_free(&querystr);
+ smart_str_free(&hash_key);
+ RETURN_FALSE;
+ }
+
+ smart_str_free(&querystr);
+
+ if ((table_name = PQgetvalue(tmp_res, 0, 0)) == NULL) {
+ PQclear(tmp_res);
+ smart_str_free(&hash_key);
+ RETURN_FALSE;
+ }
+
+ Z_TYPE(new_field_table) = le_string;
+ new_field_table.ptr = estrdup(table_name);
+ zend_hash_update(&EG(regular_list), hash_key.c, hash_key.len+1, (void *) &new_field_table, sizeof(zend_rsrc_list_entry), NULL);
+
+ smart_str_free(&hash_key);
+ PQclear(tmp_res);
+ RETURN_STRING(table_name, 1);
+ }
+
+}
+/* }}} */
+#endif
+
#define PHP_PG_FIELD_NAME 1
#define PHP_PG_FIELD_SIZE 2
#define PHP_PG_FIELD_TYPE 3
@@ -2017,7 +2114,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type,
* single value is an array. Also we'd have to make that one
* argument passed by reference.
*/
- zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
return;
}
} else {
@@ -2032,7 +2129,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type,
fcc.object_pp = &return_value;
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
- zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
+ 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);
@@ -2042,7 +2139,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type,
efree(fci.params);
}
} else if (ctor_params) {
- zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
+ 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);
}
}
}
@@ -3216,12 +3313,13 @@ PHP_FUNCTION(pg_copy_to)
if (!pg_delim) {
pg_delim = "\t";
}
+
+ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+
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);
@@ -3449,37 +3547,67 @@ PHP_FUNCTION(pg_copy_from)
/* }}} */
#ifdef HAVE_PQESCAPE
-/* {{{ proto string pg_escape_string(string data)
+/* {{{ proto string pg_escape_string([resource connection,] string data)
Escape string for text/char type */
PHP_FUNCTION(pg_escape_string)
{
char *from = NULL, *to = NULL;
+ zval *pgsql_link;
+#ifdef HAVE_PQESCAPE_CONN
+ PGconn *pgsql;
+#endif
int to_len;
int from_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
- &from, &from_len) == FAILURE) {
+ int id = -1;
+
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == SUCCESS) {
+ pgsql_link = NULL;
+ id = PGG(default_link);
+ } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &from, &from_len) == FAILURE) {
return;
}
- to = (char *)safe_emalloc(from_len, 2, 1);
- to_len = (int)PQescapeString(to, from, from_len);
+ to = (char *) safe_emalloc(from_len, 2, 1);
+
+#ifdef HAVE_PQESCAPE_CONN
+ if (pgsql_link != NULL || id != -1) {
+ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+ to_len = (int) PQescapeStringConn(pgsql, to, from, (size_t)from_len, NULL);
+ } else
+#endif
+ to_len = (int) PQescapeString(to, from, (size_t)from_len);
+
RETURN_STRINGL(to, to_len, 0);
}
/* }}} */
-/* {{{ proto string pg_escape_bytea(string data)
+/* {{{ proto string pg_escape_bytea([resource connection,] 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) {
+ int from_len, id = -1;
+#ifdef HAVE_PQESCAPE_BYTEA_CONN
+ PGconn *pgsql;
+#endif
+ zval *pgsql_link;
+
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == SUCCESS) {
+ pgsql_link = NULL;
+ id = PGG(default_link);
+ } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &from, &from_len) == FAILURE) {
return;
}
- to = (char *)PQescapeBytea((unsigned char*)from, from_len, &to_len);
+#ifdef HAVE_PQESCAPE_BYTEA_CONN
+ if (pgsql_link != NULL || id != -1) {
+ ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+ to = (char *)PQescapeByteaConn(pgsql, from, (size_t)from_len, &to_len);
+ } else
+#endif
+ to = (char *)PQescapeBytea((unsigned char*)from, from_len, &to_len);
+
RETVAL_STRINGL(to, to_len-1, 1); /* to_len includes addtional '\0' */
free(to);
}
@@ -3899,7 +4027,7 @@ PHP_FUNCTION(pg_send_query_params)
int leftover = 0;
if (zend_get_parameters_ex(3, &pgsql_link, &query, &pv_param_arr) == FAILURE) {
- return;
+ WRONG_PARAM_COUNT;
}
if (pgsql_link == NULL && id == -1) {
@@ -3989,7 +4117,7 @@ PHP_FUNCTION(pg_send_prepare)
int leftover = 0;
if (zend_get_parameters_ex(3, &pgsql_link, &stmtname, &query) == FAILURE) {
- return;
+ WRONG_PARAM_COUNT;
}
if (pgsql_link == NULL && id == -1) {
RETURN_FALSE;
@@ -4043,7 +4171,7 @@ PHP_FUNCTION(pg_send_execute)
int leftover = 0;
if (zend_get_parameters_ex(3, &pgsql_link, &stmtname, &pv_param_arr)==FAILURE) {
- return;
+ WRONG_PARAM_COUNT;
}
if (pgsql_link == NULL && id == -1) {
RETURN_FALSE;
@@ -5015,7 +5143,11 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
else {
unsigned char *tmp;
size_t to_len;
+#ifdef HAVE_PQESCAPE_BYTEA_CONN
+ tmp = PQescapeByteaConn(pg_link, Z_STRVAL_PP(val), Z_STRLEN_PP(val), &to_len);
+#else
tmp = PQescapeBytea(Z_STRVAL_PP(val), Z_STRLEN_PP(val), &to_len);
+#endif
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);
diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h
index 68f110107..0b31b3733 100644
--- a/ext/pgsql/php_pgsql.h
+++ b/ext/pgsql/php_pgsql.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pgsql.h,v 1.73.2.1 2006/01/01 12:50:12 sniper Exp $ */
+/* $Id: php_pgsql.h,v 1.73.2.1.2.1 2006/05/07 00:28:32 edink Exp $ */
#ifndef PHP_PGSQL_H
#define PHP_PGSQL_H
@@ -125,6 +125,7 @@ PHP_FUNCTION(pg_field_type);
PHP_FUNCTION(pg_field_type_oid);
PHP_FUNCTION(pg_field_prtlen);
PHP_FUNCTION(pg_field_is_null);
+PHP_FUNCTION(pg_field_table);
/* async message functions */
PHP_FUNCTION(pg_get_notify);
PHP_FUNCTION(pg_get_pid);
diff --git a/ext/posix/config.m4 b/ext/posix/config.m4
index fbd2afed6..211907f99 100644
--- a/ext/posix/config.m4
+++ b/ext/posix/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.12 2005/06/30 13:39:42 sniper Exp $
+dnl $Id: config.m4,v 1.12.4.1 2006/06/19 02:19:13 iliaa Exp $
dnl
PHP_ARG_ENABLE(posix,whether to enable POSIX-like functions,
@@ -11,5 +11,5 @@ if test "$PHP_POSIX" = "yes"; then
AC_CHECK_HEADERS(sys/mkdev.h)
- AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev)
+ AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev initgroups)
fi
diff --git a/ext/posix/php_posix.h b/ext/posix/php_posix.h
index c27b811e5..52d71bf58 100644
--- a/ext/posix/php_posix.h
+++ b/ext/posix/php_posix.h
@@ -17,7 +17,7 @@
*/
-/* $Id: php_posix.h,v 1.18.2.1 2006/01/01 12:50:12 sniper Exp $ */
+/* $Id: php_posix.h,v 1.18.2.1.2.1 2006/06/19 02:19:13 iliaa Exp $ */
#ifndef PHP_POSIX_H
#define PHP_POSIX_H
@@ -110,6 +110,10 @@ PHP_FUNCTION(posix_getpwuid);
PHP_FUNCTION(posix_getrlimit);
#endif
+#ifdef HAVE_INITGROUPS
+PHP_FUNCTION(posix_initgroups);
+#endif
+
PHP_FUNCTION(posix_get_last_error);
PHP_FUNCTION(posix_strerror);
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index 229ae3027..049dcecf8 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: posix.c,v 1.70.2.3 2006/01/01 12:50:12 sniper Exp $ */
+/* $Id: posix.c,v 1.70.2.3.2.6 2006/10/02 07:58:13 bjori Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -49,6 +49,7 @@
#endif
ZEND_DECLARE_MODULE_GLOBALS(posix)
+static PHP_MINFO_FUNCTION(posix);
/* {{{ posix_functions[]
*/
@@ -133,6 +134,9 @@ zend_function_entry posix_functions[] = {
PHP_FE(posix_get_last_error, NULL)
PHP_FALIAS(posix_errno, posix_get_last_error, NULL)
PHP_FE(posix_strerror, NULL)
+#ifdef HAVE_INITGROUPS
+ PHP_FE(posix_initgroups, NULL)
+#endif
{NULL, NULL, NULL}
};
@@ -143,12 +147,12 @@ zend_function_entry posix_functions[] = {
static PHP_MINFO_FUNCTION(posix)
{
php_info_print_table_start();
- php_info_print_table_row(2, "Revision", "$Revision: 1.70.2.3 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.70.2.3.2.6 $");
php_info_print_table_end();
}
/* }}} */
-static void php_posix_init_globals(zend_posix_globals *posix_globals TSRMLS_DC)
+static PHP_GINIT_FUNCTION(posix)
{
posix_globals->last_error = 0;
}
@@ -157,7 +161,6 @@ static void php_posix_init_globals(zend_posix_globals *posix_globals TSRMLS_DC)
*/
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);
@@ -182,8 +185,6 @@ static PHP_MINIT_FUNCTION(posix)
}
/* }}} */
-static PHP_MINFO_FUNCTION(posix);
-
/* {{{ posix_module_entry
*/
zend_module_entry posix_module_entry = {
@@ -195,8 +196,12 @@ zend_module_entry posix_module_entry = {
NULL,
NULL,
PHP_MINFO(posix),
- NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ NO_VERSION_YET,
+ PHP_MODULE_GLOBALS(posix),
+ PHP_GINIT(posix),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
@@ -547,23 +552,23 @@ static int php_posix_stream_get_fd(zval *zfp, int *fd TSRMLS_DC)
Determine terminal device name (POSIX.1, 4.7.2) */
PHP_FUNCTION(posix_ttyname)
{
- zval *z_fd;
+ zval **z_fd;
char *p;
int fd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &z_fd) == FAILURE) {
RETURN_FALSE;
}
- switch (Z_TYPE_P(z_fd)) {
+ switch (Z_TYPE_PP(z_fd)) {
case IS_RESOURCE:
- if (!php_posix_stream_get_fd(z_fd, &fd TSRMLS_CC)) {
+ 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);
+ convert_to_long_ex(z_fd);
+ fd = Z_LVAL_PP(z_fd);
}
if (NULL == (p = ttyname(fd))) {
@@ -579,22 +584,22 @@ PHP_FUNCTION(posix_ttyname)
Determine if filedesc is a tty (POSIX.1, 4.7.1) */
PHP_FUNCTION(posix_isatty)
{
- zval *z_fd;
+ zval **z_fd;
int fd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &z_fd) == FAILURE) {
RETURN_FALSE;
}
- switch (Z_TYPE_P(z_fd)) {
+ switch (Z_TYPE_PP(z_fd)) {
case IS_RESOURCE:
- if (!php_posix_stream_get_fd(z_fd, &fd TSRMLS_CC)) {
+ 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);
+ convert_to_long_ex(z_fd);
+ fd = Z_LVAL_PP(z_fd);
}
if (isatty(fd)) {
@@ -766,6 +771,10 @@ PHP_FUNCTION(posix_access)
}
path = expand_filepath(filename, NULL TSRMLS_CC);
+ if (!path) {
+ POSIX_G(last_error) = EIO;
+ RETURN_FALSE;
+ }
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)))) {
@@ -1054,6 +1063,24 @@ PHP_FUNCTION(posix_strerror)
#endif
+#ifdef HAVE_INITGROUPS
+/* {{{ proto bool posix_initgroups(string name, int base_group_id)
+ Calculate the group access list for the user specified in name. */
+PHP_FUNCTION(posix_initgroups)
+{
+ long basegid;
+ char *name;
+ int name_len;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &name, &name_len, &basegid) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ RETURN_BOOL(!initgroups((const char *)name, basegid));
+}
+/* }}} */
+#endif
+
/*
* Local variables:
* tab-width: 4
diff --git a/ext/posix/tests/001.phpt b/ext/posix/tests/001.phpt
new file mode 100644
index 000000000..e6c629ce6
--- /dev/null
+++ b/ext/posix/tests/001.phpt
@@ -0,0 +1,12 @@
+--TEST--
+posix_access() with bogus paths
+--SKIPIF--
+<?php if (!extension_loaded('posix')) echo 'skip'; ?>
+--FILE--
+<?php
+
+var_dump(posix_access(str_repeat('bogus path', 1042)));
+
+?>
+--EXPECT--
+bool(false)
diff --git a/ext/pspell/php_pspell.h b/ext/pspell/php_pspell.h
index 4121ae668..8114cf3ff 100644
--- a/ext/pspell/php_pspell.h
+++ b/ext/pspell/php_pspell.h
@@ -16,35 +16,13 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pspell.h,v 1.15.2.1 2006/01/01 12:50:12 sniper Exp $ */
+/* $Id: php_pspell.h,v 1.15.2.1.2.2 2006/08/14 20:08:17 nlopess Exp $ */
#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
diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c
index 0cba3757a..51fc0b12c 100644
--- a/ext/pspell/pspell.c
+++ b/ext/pspell/pspell.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pspell.c,v 1.45.2.4 2006/01/01 12:50:12 sniper Exp $ */
+/* $Id: pspell.c,v 1.45.2.4.2.2 2006/08/14 20:08:18 nlopess Exp $ */
#define IS_EXT_MODULE
@@ -50,9 +50,31 @@
*/
#define PSPELL_LARGEST_WORD 3
+static PHP_MINIT_FUNCTION(pspell);
+static PHP_MINFO_FUNCTION(pspell);
+static PHP_FUNCTION(pspell_new);
+static PHP_FUNCTION(pspell_new_personal);
+static PHP_FUNCTION(pspell_new_config);
+static PHP_FUNCTION(pspell_check);
+static PHP_FUNCTION(pspell_suggest);
+static PHP_FUNCTION(pspell_store_replacement);
+static PHP_FUNCTION(pspell_add_to_personal);
+static PHP_FUNCTION(pspell_add_to_session);
+static PHP_FUNCTION(pspell_clear_session);
+static PHP_FUNCTION(pspell_save_wordlist);
+static PHP_FUNCTION(pspell_config_create);
+static PHP_FUNCTION(pspell_config_runtogether);
+static PHP_FUNCTION(pspell_config_mode);
+static PHP_FUNCTION(pspell_config_ignore);
+static PHP_FUNCTION(pspell_config_personal);
+static PHP_FUNCTION(pspell_config_dict_dir);
+static PHP_FUNCTION(pspell_config_data_dir);
+static PHP_FUNCTION(pspell_config_repl);
+static PHP_FUNCTION(pspell_config_save_repl);
+
/* {{{ pspell_functions[]
*/
-zend_function_entry pspell_functions[] = {
+static zend_function_entry pspell_functions[] = {
PHP_FE(pspell_new, NULL)
PHP_FE(pspell_new_personal, NULL)
PHP_FE(pspell_new_config, NULL)
@@ -119,7 +141,7 @@ static void php_pspell_close_config(zend_rsrc_list_entry *rsrc TSRMLS_DC)
/* {{{ PHP_MINIT_FUNCTION
*/
-PHP_MINIT_FUNCTION(pspell)
+static 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);
@@ -133,7 +155,7 @@ PHP_MINIT_FUNCTION(pspell)
/* {{{ proto int pspell_new(string language [, string spelling [, string jargon [, string encoding [, int mode]]]])
Load a dictionary */
-PHP_FUNCTION(pspell_new)
+static PHP_FUNCTION(pspell_new)
{
zval **language,**spelling,**jargon,**encoding,**pmode;
long mode = 0L, speed = 0L;
@@ -236,7 +258,7 @@ PHP_FUNCTION(pspell_new)
/* {{{ 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)
+static PHP_FUNCTION(pspell_new_personal)
{
zval **personal, **language,**spelling,**jargon,**encoding,**pmode;
long mode = 0L, speed = 0L;
@@ -352,7 +374,7 @@ PHP_FUNCTION(pspell_new_personal)
/* {{{ proto int pspell_new_config(int config)
Load a dictionary based on the given config */
-PHP_FUNCTION(pspell_new_config)
+static PHP_FUNCTION(pspell_new_config)
{
int type;
zval **conf;
@@ -385,7 +407,7 @@ PHP_FUNCTION(pspell_new_config)
/* {{{ proto bool pspell_check(int pspell, string word)
Returns true if word is valid */
-PHP_FUNCTION(pspell_check)
+static PHP_FUNCTION(pspell_check)
{
int type;
zval **scin,**word;
@@ -411,7 +433,7 @@ PHP_FUNCTION(pspell_check)
/* {{{ proto array pspell_suggest(int pspell, string word)
Returns array of suggestions */
-PHP_FUNCTION(pspell_suggest)
+static PHP_FUNCTION(pspell_suggest)
{
zval **scin, **word;
int argc;
@@ -446,7 +468,7 @@ PHP_FUNCTION(pspell_suggest)
/* {{{ proto bool pspell_store_replacement(int pspell, string misspell, string correct)
Notify the dictionary of a user-selected replacement */
-PHP_FUNCTION(pspell_store_replacement)
+static PHP_FUNCTION(pspell_store_replacement)
{
int type;
zval **scin,**miss,**corr;
@@ -474,7 +496,7 @@ PHP_FUNCTION(pspell_store_replacement)
/* {{{ proto bool pspell_add_to_personal(int pspell, string word)
Adds a word to a personal list */
-PHP_FUNCTION(pspell_add_to_personal)
+static PHP_FUNCTION(pspell_add_to_personal)
{
int type;
zval **scin,**word;
@@ -506,7 +528,7 @@ PHP_FUNCTION(pspell_add_to_personal)
/* {{{ proto bool pspell_add_to_session(int pspell, string word)
Adds a word to the current session */
-PHP_FUNCTION(pspell_add_to_session)
+static PHP_FUNCTION(pspell_add_to_session)
{
int type;
zval **scin,**word;
@@ -538,7 +560,7 @@ PHP_FUNCTION(pspell_add_to_session)
/* {{{ proto bool pspell_clear_session(int pspell)
Clears the current session */
-PHP_FUNCTION(pspell_clear_session)
+static PHP_FUNCTION(pspell_clear_session)
{
int type;
zval **scin;
@@ -564,7 +586,7 @@ PHP_FUNCTION(pspell_clear_session)
/* {{{ proto bool pspell_save_wordlist(int pspell)
Saves the current (personal) wordlist */
-PHP_FUNCTION(pspell_save_wordlist)
+static PHP_FUNCTION(pspell_save_wordlist)
{
int type;
zval **scin;
@@ -592,7 +614,7 @@ PHP_FUNCTION(pspell_save_wordlist)
/* {{{ 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)
+static PHP_FUNCTION(pspell_config_create)
{
zval **language,**spelling,**jargon,**encoding;
int argc;
@@ -667,7 +689,7 @@ PHP_FUNCTION(pspell_config_create)
/* {{{ proto bool pspell_config_runtogether(int conf, bool runtogether)
Consider run-together words as valid components */
-PHP_FUNCTION(pspell_config_runtogether)
+static PHP_FUNCTION(pspell_config_runtogether)
{
int type;
zval **conf, **runtogether;
@@ -691,7 +713,7 @@ PHP_FUNCTION(pspell_config_runtogether)
/* {{{ 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)
+static PHP_FUNCTION(pspell_config_mode)
{
int type;
zval **conf, **mode;
@@ -723,7 +745,7 @@ PHP_FUNCTION(pspell_config_mode)
/* {{{ proto bool pspell_config_ignore(int conf, int ignore)
Ignore words <= n chars */
-PHP_FUNCTION(pspell_config_ignore)
+static PHP_FUNCTION(pspell_config_ignore)
{
int type;
zval **conf, **pignore;
@@ -797,7 +819,7 @@ static void pspell_config_path(INTERNAL_FUNCTION_PARAMETERS, char *option)
/* {{{ proto bool pspell_config_personal(int conf, string personal)
Use a personal dictionary for this config */
-PHP_FUNCTION(pspell_config_personal)
+static PHP_FUNCTION(pspell_config_personal)
{
pspell_config_path(INTERNAL_FUNCTION_PARAM_PASSTHRU, "personal");
}
@@ -805,7 +827,7 @@ PHP_FUNCTION(pspell_config_personal)
/* {{{ proto bool pspell_config_dict_dir(int conf, string directory)
location of the main word list */
-PHP_FUNCTION(pspell_config_dict_dir)
+static PHP_FUNCTION(pspell_config_dict_dir)
{
pspell_config_path(INTERNAL_FUNCTION_PARAM_PASSTHRU, "dict-dir");
}
@@ -813,7 +835,7 @@ PHP_FUNCTION(pspell_config_dict_dir)
/* {{{ proto bool pspell_config_data_dir(int conf, string directory)
location of language data files */
-PHP_FUNCTION(pspell_config_data_dir)
+static PHP_FUNCTION(pspell_config_data_dir)
{
pspell_config_path(INTERNAL_FUNCTION_PARAM_PASSTHRU, "data-dir");
}
@@ -821,7 +843,7 @@ PHP_FUNCTION(pspell_config_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)
+static PHP_FUNCTION(pspell_config_repl)
{
int type;
zval **conf, **repl;
@@ -856,7 +878,7 @@ PHP_FUNCTION(pspell_config_repl)
/* {{{ 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)
+static PHP_FUNCTION(pspell_config_save_repl)
{
int type;
zval **conf, **save;
@@ -880,7 +902,7 @@ PHP_FUNCTION(pspell_config_save_repl)
/* {{{ PHP_MINFO_FUNCTION
*/
-PHP_MINFO_FUNCTION(pspell)
+static PHP_MINFO_FUNCTION(pspell)
{
php_info_print_table_start();
php_info_print_table_row(2, "PSpell Support", "enabled");
diff --git a/ext/pspell/tests/01pspell_basic.phpt b/ext/pspell/tests/001.phpt
index 1c996a6da..7c6b4d516 100644
--- a/ext/pspell/tests/01pspell_basic.phpt
+++ b/ext/pspell/tests/001.phpt
@@ -2,13 +2,13 @@
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");
- }
+if (!extension_loaded("pspell")) die("skip");
+if (!@pspell_new ("en", "", "", "", (PSPELL_FAST|PSPELL_RUN_TOGETHER))) {
+ die("skip English dictionary is not available");
+}
?>
--FILE--
-<?php // $Id: 01pspell_basic.phpt,v 1.7 2005/07/25 18:27:41 helly Exp $
+<?php // $Id: 001.phpt,v 1.1.2.1 2006/06/28 14:36:23 nlopess Exp $
error_reporting(E_ALL);
$string = "";
diff --git a/ext/pspell/tests/002.phpt b/ext/pspell/tests/002.phpt
new file mode 100644
index 000000000..5e29a1e62
--- /dev/null
+++ b/ext/pspell/tests/002.phpt
@@ -0,0 +1,44 @@
+--TEST--
+pspell session
+--SKIPIF--
+<?php
+if (!extension_loaded('pspell')) die('skip');
+if (!@pspell_new('en')) die('skip English dictionary is not available');
+?>
+--FILE--
+<?php
+
+$p = pspell_new('en');
+
+var_dump(pspell_check('a'));
+var_dump(pspell_check($p, 'somebogusword'));
+
+var_dump(pspell_add_to_session($p, ''));
+var_dump(pspell_add_to_session($p, 'somebogusword'));
+var_dump(pspell_check($p, 'somebogusword'));
+
+var_dump(pspell_clear_session(new stdclass));
+
+$res = @pspell_clear_session($p);
+if ($res) {
+ var_dump($res);
+ var_dump(pspell_check($p, 'somebogusword'));
+} else {
+ echo "bool(true)\n";
+ echo "bool(false)\n";
+}
+?>
+--EXPECTF--
+Warning: Wrong parameter count for pspell_check() in %s002.php on line 5
+NULL
+bool(false)
+bool(false)
+bool(true)
+bool(true)
+
+Notice: Object of class stdClass could not be converted to int in %s002.php on line 12
+
+Warning: pspell_clear_session(): 1 is not a PSPELL result index in %s002.php on line 12
+bool(false)
+bool(true)
+bool(false)
diff --git a/ext/pspell/tests/003.phpt b/ext/pspell/tests/003.phpt
new file mode 100644
index 000000000..33aa2dac6
--- /dev/null
+++ b/ext/pspell/tests/003.phpt
@@ -0,0 +1,39 @@
+--TEST--
+pspell_config_ignore
+--SKIPIF--
+<?php
+if (!extension_loaded('pspell')) die('skip');
+if (!@pspell_new('en')) die('skip English dictionary is not available');
+?>
+--FILE--
+<?php
+
+$cfg = pspell_config_create('en', 'british', '', 'iso8859-1');
+$cfg2 = pspell_config_create('en', 'british', '', 'b0rked');
+
+$p = pspell_new_config($cfg);
+var_dump(pspell_check($p, 'yy'));
+
+$p2 = pspell_new_config($cfg2);
+var_dump(pspell_check($p2, 'yy'));
+
+echo "---\n";
+var_dump(pspell_config_ignore($cfg, 2));
+$p = pspell_new_config($cfg);
+var_dump(pspell_check($p, 'yy'));
+
+// segfault it?
+var_dump(pspell_config_ignore($cfg, PHP_INT_MAX));
+
+?>
+--EXPECTF--
+bool(false)
+
+Warning: pspell_new_config(): PSPELL couldn't open the dictionary. reason: The encoding "b0rked" is not known.%sThis could also mean that the file "%sb0rked.%s" could not be opened for reading or does not exist. in %s003.php on line 9
+
+Warning: pspell_check(): 0 is not a PSPELL result index in %s003.php on line 10
+bool(false)
+---
+bool(true)
+bool(true)
+bool(true)
diff --git a/ext/pspell/tests/004.phpt b/ext/pspell/tests/004.phpt
new file mode 100644
index 000000000..80602bce3
--- /dev/null
+++ b/ext/pspell/tests/004.phpt
@@ -0,0 +1,35 @@
+--TEST--
+pspell configs
+--SKIPIF--
+<?php
+if (!extension_loaded('pspell')) die('skip');
+if (!@pspell_new('en')) die('skip English dictionary is not available');
+?>
+--FILE--
+<?php
+
+$cfg = pspell_config_create('en', 'british', '', 'iso8859-1');
+var_dump(pspell_config_mode($cfg, PSPELL_BAD_SPELLERS));
+
+var_dump(pspell_config_runtogether($cfg, false));
+$p = pspell_new_config($cfg);
+var_dump(pspell_check($p, 'theoasis'));
+
+echo "---\n";
+
+// now it should pass
+var_dump(pspell_config_runtogether($cfg, true));
+$p = pspell_new_config($cfg);
+var_dump(pspell_check($p, 'theoasis'));
+
+var_dump(pspell_config_runtogether($cfg, NULL))
+
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(false)
+---
+bool(true)
+bool(true)
+bool(true)
diff --git a/ext/pspell/tests/005.phpt b/ext/pspell/tests/005.phpt
new file mode 100644
index 000000000..8aeb20603
--- /dev/null
+++ b/ext/pspell/tests/005.phpt
@@ -0,0 +1,46 @@
+--TEST--
+pspell configs
+--SKIPIF--
+<?php
+if (!extension_loaded('pspell')) die('skip');
+if (!@pspell_new('en')) die('skip English dictionary is not available');
+?>
+--FILE--
+<?php
+
+$wordlist = dirname(__FILE__).'/wordlist.txt';
+
+var_dump(pspell_new_personal(__FILE__, 'en'));
+$p = pspell_new_personal($wordlist, 'en');
+
+var_dump(pspell_check($p, 'dfnvnsafksfksf'));
+
+echo "--\n";
+$cfg = pspell_config_create('en');
+var_dump(pspell_config_personal($cfg, "$wordlist.tmp"));
+$p = pspell_new_config($cfg);
+
+copy($wordlist, "$wordlist.tmp");
+
+var_dump(pspell_check($p, 'ola'));
+var_dump(pspell_add_to_personal($p, 'ola'));
+var_dump(pspell_check($p, 'ola'));
+
+echo "--\n";
+var_dump(pspell_save_wordlist($p));
+var_dump(strpos(file_get_contents("$wordlist.tmp"), 'ola') !== FALSE);
+
+unlink("$wordlist.tmp");
+?>
+--EXPECTF--
+Warning: pspell_new_personal(): PSPELL couldn't open the dictionary. reason: The file "%s005.php" is not in the proper format. in %s005.php on line 5
+bool(false)
+bool(true)
+--
+bool(true)
+bool(false)
+bool(true)
+bool(true)
+--
+bool(true)
+bool(true)
diff --git a/ext/pspell/tests/wordlist.txt b/ext/pspell/tests/wordlist.txt
new file mode 100644
index 000000000..e9d8da7ca
--- /dev/null
+++ b/ext/pspell/tests/wordlist.txt
@@ -0,0 +1,5 @@
+personal_ws-1.1 en 4
+dfnvnsafksfksf
+fg
+iufrsn
+jsksjfsjf
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 31db9eaf0..9b0b1cf3f 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: readline.c,v 1.42.2.3 2006/01/01 12:50:12 sniper Exp $ */
+/* $Id: readline.c,v 1.42.2.3.2.1 2006/09/04 18:59:01 nlopess Exp $ */
/* {{{ includes & prototypes */
@@ -363,7 +363,7 @@ PHP_FUNCTION(readline_write_history)
/* {{{ proto bool readline_completion_function(string funcname)
Readline completion function? */
-static char *_readline_command_generator(char *text,int state)
+static char *_readline_command_generator(const char *text, int state)
{
HashTable *myht = Z_ARRVAL(_readline_array);
zval **entry;
diff --git a/ext/recode/recode.c b/ext/recode/recode.c
index 5b380eeef..bfd6fd939 100644
--- a/ext/recode/recode.c
+++ b/ext/recode/recode.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: recode.c,v 1.37.2.1 2006/01/01 12:50:12 sniper Exp $ */
+/* $Id: recode.c,v 1.37.2.1.2.1 2006/06/15 18:33:08 dmitry Exp $ */
/* {{{ includes & prototypes */
@@ -64,6 +64,7 @@ ZEND_END_MODULE_GLOBALS(recode)
#endif
ZEND_DECLARE_MODULE_GLOBALS(recode);
+static PHP_GINIT_FUNCTION(recode);
/* {{{ module stuff */
static zend_function_entry php_recode_functions[] = {
@@ -83,22 +84,24 @@ zend_module_entry recode_module_entry = {
NULL,
PHP_MINFO(recode),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(recode),
+ PHP_GINIT(recode),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
#ifdef COMPILE_DL_RECODE
ZEND_GET_MODULE(recode)
#endif
-static void php_recode_init_globals (zend_recode_globals *rg)
+static PHP_GINIT_FUNCTION(recode)
{
- rg->outer = NULL;
+ recode_globals->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;
@@ -119,7 +122,7 @@ 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: 1.37.2.1 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.37.2.1.2.1 $");
php_info_print_table_end();
}
diff --git a/ext/reflection/config.m4 b/ext/reflection/config.m4
index 616c396b0..23a3048cd 100755
--- a/ext/reflection/config.m4
+++ b/ext/reflection/config.m4
@@ -1,13 +1,10 @@
-dnl $Id: config.m4,v 1.4.2.3 2005/12/03 01:12:45 sniper Exp $
+dnl $Id: config.m4,v 1.4.2.3.2.1 2006/08/23 09:47:21 tony2001 Exp $
dnl config.m4 for extension reflection
PHP_ARG_ENABLE(reflection, whether to enable reflection support,
[ --disable-reflection Disable reflection support], yes, no)
if test "$PHP_REFLECTION" != "no"; then
- if test "$ext_shared" = "yes"; then
- AC_MSG_ERROR(Cannot build reflection as a shared module)
- fi
AC_DEFINE(HAVE_REFLECTION, 1, [Whether Reflection is enabled])
- PHP_NEW_EXTENSION(reflection, php_reflection.c)
+ PHP_NEW_EXTENSION(reflection, php_reflection.c, no)
fi
diff --git a/ext/reflection/config.w32 b/ext/reflection/config.w32
index 1437c448e..04f101f2d 100755
--- a/ext/reflection/config.w32
+++ b/ext/reflection/config.w32
@@ -1,9 +1,10 @@
-// $Id: config.w32,v 1.2.2.2 2005/11/30 21:52:38 helly Exp $
+// $Id: config.w32,v 1.2.2.2.2.1 2006/09/02 19:13:23 johannes Exp $
// vim:ft=javascript
ARG_ENABLE("reflection", "disable reflection support", "yes");
if (PHP_REFLECTION != "no") {
EXTENSION("reflection", "php_reflection.c");
+ AC_DEFINE('HAVE_REFLECTION', 1, 'Reflection support enabled');
}
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 1eedbb6e3..0685541ad 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_reflection.c,v 1.164.2.33 2006/03/29 14:28:42 tony2001 Exp $ */
+/* $Id: php_reflection.c,v 1.164.2.33.2.31 2006/10/18 16:35:15 johannes Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -48,6 +48,7 @@
PHPAPI zend_class_entry *reflector_ptr;
PHPAPI zend_class_entry *reflection_exception_ptr;
PHPAPI zend_class_entry *reflection_ptr;
+PHPAPI zend_class_entry *reflection_function_abstract_ptr;
PHPAPI zend_class_entry *reflection_function_ptr;
PHPAPI zend_class_entry *reflection_parameter_ptr;
PHPAPI zend_class_entry *reflection_class_ptr;
@@ -210,6 +211,7 @@ static void _default_get_entry(zval *object, char *name, int name_len, zval *ret
*return_value = **value;
zval_copy_ctor(return_value);
+ INIT_PZVAL(return_value);
}
static void reflection_register_implement(zend_class_entry *class_entry, zend_class_entry *interface_entry TSRMLS_DC)
@@ -507,22 +509,40 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
/* 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;
+ string dyn;
+ count = 0;
+ string_init(&dyn);
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);
+ char *key;
+ uint key_len;
+ ulong num_index;
+ uint len = strlen(mptr->common.function_name);
+
+ /* Do not display old-style inherited constructors */
+ if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
+ mptr->common.scope == ce ||
+ zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_STRING ||
+ zend_binary_strcasecmp(key, key_len-1, mptr->common.function_name, len) == 0) {
+
+ string_printf(&dyn, "\n");
+ _function_string(&dyn, mptr, ce, sub_indent.string TSRMLS_CC);
+ count++;
+ }
}
zend_hash_move_forward_ex(&ce->function_table, &pos);
}
+ string_printf(str, "\n%s - Methods [%d] {", indent, count);
+ string_append(str, &dyn);
+ string_free(&dyn);
} else {
- string_printf(str, "\n");
+ string_printf(str, "\n%s - Methods [0] {\n", indent);
}
string_printf(str, "%s }\n", indent);
}
@@ -535,10 +555,26 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
/* {{{ _const_string */
static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC)
{
- string_printf(str, "%s Constant [ %s %s ] { }\n",
+ char *type;
+ zval value_copy;
+ int use_copy;
+
+ type = zend_zval_type_name(value);
+
+ zend_make_printable_zval(value, &value_copy, &use_copy);
+ if (use_copy) {
+ value = &value_copy;
+ }
+
+ string_printf(str, "%s Constant [ %s %s ] { %s }\n",
indent,
- zend_zval_type_name(value),
- name);
+ type,
+ name,
+ Z_STRVAL_P(value));
+
+ if (use_copy) {
+ zval_dtor(value);
+ }
}
/* }}} */
@@ -780,7 +816,7 @@ static void _property_string(string *str, zend_property_info *prop, char *prop_n
string_printf(str, "static ");
}
- zend_unmangle_property_name(prop->name, &class_name, &prop_name);
+ zend_unmangle_property_name(prop->name, prop->name_length, &class_name, &prop_name);
string_printf(str, "$%s", prop_name);
}
@@ -1102,10 +1138,10 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info
property_reference *reference;
char *class_name, *prop_name;
- zend_unmangle_property_name(prop->name, &class_name, &prop_name);
+ zend_unmangle_property_name(prop->name, prop->name_length, &class_name, &prop_name);
if (!(prop->flags & ZEND_ACC_PRIVATE)) {
- /* we have to seach the class hierarchy for this (implicit) public or protected property */
+ /* we have to search the class hierarchy for this (implicit) public or protected property */
zend_class_entry *tmp_ce = ce;
zend_property_info *tmp_info;
@@ -1370,7 +1406,7 @@ ZEND_METHOD(reflection_function, __toString)
zend_function *fptr;
string str;
- METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0);
+ METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
GET_REFLECTION_OBJECT_PTR(fptr);
string_init(&str);
_function_string(&str, fptr, intern->ce, "" TSRMLS_CC);
@@ -1382,7 +1418,7 @@ ZEND_METHOD(reflection_function, __toString)
Returns this function's name */
ZEND_METHOD(reflection, function_getName)
{
- METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0);
+ METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
_default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC);
}
/* }}} */
@@ -1394,7 +1430,7 @@ ZEND_METHOD(reflection, function_isInternal)
reflection_object *intern;
zend_function *fptr;
- METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0);
+ METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
GET_REFLECTION_OBJECT_PTR(fptr);
RETURN_BOOL(fptr->type == ZEND_INTERNAL_FUNCTION);
}
@@ -1407,12 +1443,25 @@ ZEND_METHOD(reflection_function, isUserDefined)
reflection_object *intern;
zend_function *fptr;
- METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0);
+ METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
GET_REFLECTION_OBJECT_PTR(fptr);
RETURN_BOOL(fptr->type == ZEND_USER_FUNCTION);
}
/* }}} */
+/* {{{ proto public bool ReflectionFunction::isDisabled()
+ Returns whether this function has been disabled or not */
+ZEND_METHOD(reflection_function, isDisabled)
+{
+ reflection_object *intern;
+ zend_function *fptr;
+
+ METHOD_NOTSTATIC(reflection_function_ptr);
+ GET_REFLECTION_OBJECT_PTR(fptr);
+ RETURN_BOOL(fptr->type == ZEND_INTERNAL_FUNCTION && fptr->internal_function.handler == zif_display_disabled_function);
+}
+/* }}} */
+
/* {{{ proto public string ReflectionFunction::getFileName()
Returns the filename of the file this function was declared in */
ZEND_METHOD(reflection_function, getFileName)
@@ -1420,7 +1469,7 @@ ZEND_METHOD(reflection_function, getFileName)
reflection_object *intern;
zend_function *fptr;
- METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0);
+ METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type == ZEND_USER_FUNCTION) {
RETURN_STRING(fptr->op_array.filename, 1);
@@ -1436,7 +1485,7 @@ ZEND_METHOD(reflection_function, getStartLine)
reflection_object *intern;
zend_function *fptr;
- METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0);
+ METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type == ZEND_USER_FUNCTION) {
RETURN_LONG(fptr->op_array.line_start);
@@ -1452,7 +1501,7 @@ ZEND_METHOD(reflection_function, getEndLine)
reflection_object *intern;
zend_function *fptr;
- METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0);
+ METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type == ZEND_USER_FUNCTION) {
RETURN_LONG(fptr->op_array.line_end);
@@ -1468,7 +1517,7 @@ ZEND_METHOD(reflection_function, getDocComment)
reflection_object *intern;
zend_function *fptr;
- METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0);
+ METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_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);
@@ -1485,7 +1534,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
reflection_object *intern;
zend_function *fptr;
- METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0);
+ METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
GET_REFLECTION_OBJECT_PTR(fptr);
/* Return an empty array in case no static variables exist */
@@ -1621,7 +1670,7 @@ ZEND_METHOD(reflection_function, returnsReference)
reflection_object *intern;
zend_function *fptr;
- METHOD_NOTSTATIC(reflection_function_ptr);
+ METHOD_NOTSTATIC(reflection_function_abstract_ptr);
GET_REFLECTION_OBJECT_PTR(fptr);
RETURN_BOOL(fptr->op_array.return_reference);
@@ -1635,7 +1684,7 @@ ZEND_METHOD(reflection_function, getNumberOfParameters)
reflection_object *intern;
zend_function *fptr;
- METHOD_NOTSTATIC(reflection_function_ptr);
+ METHOD_NOTSTATIC(reflection_function_abstract_ptr);
GET_REFLECTION_OBJECT_PTR(fptr);
RETURN_LONG(fptr->common.num_args);
@@ -1649,7 +1698,7 @@ ZEND_METHOD(reflection_function, getNumberOfRequiredParameters)
reflection_object *intern;
zend_function *fptr;
- METHOD_NOTSTATIC(reflection_function_ptr);
+ METHOD_NOTSTATIC(reflection_function_abstract_ptr);
GET_REFLECTION_OBJECT_PTR(fptr);
RETURN_LONG(fptr->common.required_num_args);
@@ -1665,7 +1714,7 @@ ZEND_METHOD(reflection_function, getParameters)
zend_uint i;
struct _zend_arg_info *arg_info;
- METHOD_NOTSTATIC(reflection_function_ptr);
+ METHOD_NOTSTATIC(reflection_function_abstract_ptr);
GET_REFLECTION_OBJECT_PTR(fptr);
arg_info= fptr->common.arg_info;
@@ -1692,7 +1741,7 @@ ZEND_METHOD(reflection_function, getExtension)
zend_function *fptr;
zend_internal_function *internal;
- METHOD_NOTSTATIC(reflection_function_ptr);
+ METHOD_NOTSTATIC(reflection_function_abstract_ptr);
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type != ZEND_INTERNAL_FUNCTION) {
@@ -1718,7 +1767,7 @@ ZEND_METHOD(reflection_function, getExtensionName)
zend_function *fptr;
zend_internal_function *internal;
- METHOD_NOTSTATIC(reflection_function_ptr);
+ METHOD_NOTSTATIC(reflection_function_abstract_ptr);
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type != ZEND_INTERNAL_FUNCTION) {
@@ -1748,7 +1797,7 @@ ZEND_METHOD(reflection_parameter, export)
ZEND_METHOD(reflection_parameter, __construct)
{
parameter_reference *ref;
- zval *reference, *parameter;
+ zval *reference, **parameter;
zval *object;
zval *name;
reflection_object *intern;
@@ -1757,7 +1806,7 @@ ZEND_METHOD(reflection_parameter, __construct)
int position;
zend_class_entry *ce = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &reference, &parameter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zZ", &reference, &parameter) == FAILURE) {
return;
}
@@ -1771,9 +1820,8 @@ ZEND_METHOD(reflection_parameter, __construct)
switch (Z_TYPE_P(reference)) {
case IS_STRING: {
unsigned int lcname_len;
- char *lcname;
+ char *lcname;
- convert_to_string_ex(&reference);
lcname_len = Z_STRLEN_P(reference);
lcname = zend_str_tolower_dup(Z_STRVAL_P(reference), lcname_len);
if (zend_hash_find(EG(function_table), lcname, lcname_len + 1, (void**) &fptr) == FAILURE) {
@@ -1832,8 +1880,8 @@ ZEND_METHOD(reflection_parameter, __construct)
/* Now, search for the parameter */
arg_info = fptr->common.arg_info;
- if (Z_TYPE_P(parameter) == IS_LONG) {
- position= Z_LVAL_P(parameter);
+ if (Z_TYPE_PP(parameter) == IS_LONG) {
+ position= Z_LVAL_PP(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 */
@@ -1842,9 +1890,9 @@ ZEND_METHOD(reflection_parameter, __construct)
zend_uint i;
position= -1;
- convert_to_string_ex(&parameter);
+ convert_to_string_ex(parameter);
for (i = 0; i < fptr->common.num_args; i++) {
- if (arg_info[i].name && strcmp(arg_info[i].name, Z_STRVAL_P(parameter)) == 0) {
+ if (arg_info[i].name && strcmp(arg_info[i].name, Z_STRVAL_PP(parameter)) == 0) {
position= i;
break;
}
@@ -2084,7 +2132,7 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
zv_copy = precv->op2.u.constant;
zv = &zv_copy;
- zval_update_constant(&zv, (void*)0 TSRMLS_CC);
+ zval_update_constant_ex(&zv, (void*)0, param->fptr->common.scope TSRMLS_CC);
RETURN_ZVAL(zv, 1, 1);
}
/* }}} */
@@ -2117,6 +2165,7 @@ ZEND_METHOD(reflection_method, __construct)
return;
}
if ((tmp = strstr(name_str, "::")) == NULL) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Invalid method name %s", name_str);
return;
}
classname = &ztmp;
@@ -2138,6 +2187,9 @@ ZEND_METHOD(reflection_method, __construct)
if (zend_lookup_class(Z_STRVAL_P(classname), Z_STRLEN_P(classname), &pce TSRMLS_CC) == FAILURE) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Class %s does not exist", Z_STRVAL_P(classname));
+ if (classname == &ztmp) {
+ zval_dtor(&ztmp);
+ }
return;
}
ce = *pce;
@@ -2148,6 +2200,9 @@ ZEND_METHOD(reflection_method, __construct)
break;
default:
+ if (classname == &ztmp) {
+ zval_dtor(&ztmp);
+ }
_DO_THROW("The parameter class is expected to be either a string or an object");
/* returns out of this function */
}
@@ -2609,17 +2664,36 @@ ZEND_METHOD(reflection_class, __construct)
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;
-
+ HashPosition pos;
+ zval **value;
+
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(ce), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *));
+
+ zend_hash_internal_pointer_reset_ex(CE_STATIC_MEMBERS(ce), &pos);
+
+ while (zend_hash_get_current_data_ex(CE_STATIC_MEMBERS(ce), (void **) &value, &pos) == SUCCESS) {
+ uint key_len;
+ char *key;
+ ulong num_index;
+
+ if (zend_hash_get_current_key_ex(CE_STATIC_MEMBERS(ce), &key, &key_len, &num_index, 0, &pos) != FAILURE && key) {
+ char *prop_name, *class_name;
+
+ zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name);
+
+ zval_add_ref(value);
+
+ zend_hash_update(Z_ARRVAL_P(return_value), prop_name, strlen(prop_name)+1, value, sizeof(zval *), NULL);
+ }
+ zend_hash_move_forward_ex(CE_STATIC_MEMBERS(ce), &pos);
+ }
}
/* }}} */
@@ -2719,7 +2793,7 @@ ZEND_METHOD(reflection_class, getDefaultProperties)
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);
+ zend_unmangle_property_name(key, key_len-1, &class_name, &prop_name);
if (class_name && class_name[0] != '*' && strcmp(class_name, ce->name)) {
/* filter privates from base classes */
continue;
@@ -2926,7 +3000,7 @@ ZEND_METHOD(reflection_class, getMethod)
/* }}} */
/* {{{ _addmethod */
-static int _addmethod(zend_function *mptr, int num_args, va_list args, zend_hash_key *hash_key TSRMLS_DC)
+static int _addmethod(zend_function *mptr, int num_args, va_list args, zend_hash_key *hash_key)
{
zval *method;
zend_class_entry *ce = *va_arg(args, zend_class_entry**);
@@ -2943,7 +3017,7 @@ static int _addmethod(zend_function *mptr, int num_args, va_list args, zend_hash
}
/* }}} */
-/* {{{ proto public ReflectionMethod[] ReflectionClass::getMethods()
+/* {{{ proto public ReflectionMethod[] ReflectionClass::getMethods([long $filter])
Returns an array of this class' methods */
ZEND_METHOD(reflection_class, getMethods)
{
@@ -3056,7 +3130,7 @@ ZEND_METHOD(reflection_class, getProperty)
/* }}} */
/* {{{ _addproperty */
-static int _addproperty(zend_property_info *pptr, int num_args, va_list args, zend_hash_key *hash_key TSRMLS_DC)
+static int _addproperty(zend_property_info *pptr, int num_args, va_list args, zend_hash_key *hash_key)
{
zval *property;
zend_class_entry *ce = *va_arg(args, zend_class_entry**);
@@ -3077,7 +3151,29 @@ static int _addproperty(zend_property_info *pptr, int num_args, va_list args, ze
}
/* }}} */
-/* {{{ proto public ReflectionProperty[] ReflectionClass::getProperties()
+/* {{{ _adddynproperty */
+static int _adddynproperty(zval **pptr, int num_args, va_list args, zend_hash_key *hash_key)
+{
+ zval *property;
+ zend_class_entry *ce = *va_arg(args, zend_class_entry**);
+ zval *retval = va_arg(args, zval*), member;
+ TSRMLS_FETCH();
+
+ if (hash_key->arKey[0] == '\0') {
+ return 0; /* non public cannot be dynamic */
+ }
+
+ ZVAL_STRINGL(&member, hash_key->arKey, hash_key->nKeyLength-1, 0);
+ if (zend_get_property_info(ce, &member, 1 TSRMLS_CC) == &EG(std_property_info)) {
+ ALLOC_ZVAL(property);
+ reflection_property_factory(ce, &EG(std_property_info), property TSRMLS_CC);
+ add_next_index_zval(retval, property);
+ }
+ return 0;
+}
+/* }}} */
+
+/* {{{ proto public ReflectionProperty[] ReflectionClass::getProperties([long $filter])
Returns an array of this class' properties */
ZEND_METHOD(reflection_class, getProperties)
{
@@ -3100,6 +3196,11 @@ ZEND_METHOD(reflection_class, getProperties)
array_init(return_value);
zend_hash_apply_with_arguments(&ce->properties_info, (apply_func_args_t) _addproperty, 3, &ce, return_value, filter);
+
+ if (intern->obj && (filter & ZEND_ACC_PUBLIC) != 0 && Z_OBJ_HT_P(intern->obj)->get_properties) {
+ HashTable *properties = Z_OBJ_HT_P(intern->obj)->get_properties(intern->obj TSRMLS_CC);
+ zend_hash_apply_with_arguments(properties, (apply_func_args_t) _adddynproperty, 2, &ce, return_value);
+ }
}
/* }}} */
@@ -3164,6 +3265,7 @@ ZEND_METHOD(reflection_class, getConstant)
}
*return_value = **value;
zval_copy_ctor(return_value);
+ INIT_PZVAL(return_value);
}
/* }}} */
@@ -3321,14 +3423,14 @@ ZEND_METHOD(reflection_class, newInstance)
}
/* }}} */
-/* {{{ proto public stdclass ReflectionClass::newInstanceArgs(array args)
+/* {{{ proto public stdclass ReflectionClass::newInstanceArgs([array args])
Returns an instance of this class */
ZEND_METHOD(reflection_class, newInstanceArgs)
{
zval *retval_ptr;
reflection_object *intern;
zend_class_entry *ce;
- int argc;
+ int argc = 0;
HashTable *args;
@@ -3338,11 +3440,13 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|h", &args) == FAILURE) {
return;
}
- argc = args->nNumOfElements;
+ if (ZEND_NUM_ARGS() > 0) {
+ argc = args->nNumOfElements;
+ }
/* Run the constructor if there is one */
if (ce->constructor) {
- zval ***params;
+ zval ***params = NULL;
zend_fcall_info fci;
zend_fcall_info_cache fcc;
@@ -3350,10 +3454,12 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Access to non-public constructor of class %s", ce->name);
return;
}
-
- params = safe_emalloc(sizeof(zval **), argc, 0);
- zend_hash_apply_with_argument(args, (apply_func_arg_t)_zval_array_to_c_array, &params TSRMLS_CC);
- params -= argc;
+
+ if (argc) {
+ params = safe_emalloc(sizeof(zval **), argc, 0);
+ zend_hash_apply_with_argument(args, (apply_func_arg_t)_zval_array_to_c_array, &params TSRMLS_CC);
+ params -= argc;
+ }
object_init_ex(return_value, ce);
@@ -3373,7 +3479,9 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
fcc.object_pp = &return_value;
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
- efree(params);
+ if (params) {
+ efree(params);
+ }
zval_ptr_dtor(&retval_ptr);
zend_error(E_WARNING, "Invocation of %s's constructor failed", ce->name);
RETURN_NULL();
@@ -3381,7 +3489,9 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
if (retval_ptr) {
zval_ptr_dtor(&retval_ptr);
}
- efree(params);
+ if (params) {
+ efree(params);
+ }
} else if (!ZEND_NUM_ARGS()) {
object_init_ex(return_value, ce);
} else {
@@ -3416,6 +3526,26 @@ ZEND_METHOD(reflection_class, getInterfaces)
}
/* }}} */
+/* {{{ proto public String[] ReflectionClass::getInterfaceNames()
+ Returns an array of names of interfaces this class implements */
+ZEND_METHOD(reflection_class, getInterfaceNames)
+{
+ reflection_object *intern;
+ zend_class_entry *ce;
+ zend_uint i;
+
+ 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);
+
+ for (i=0; i < ce->num_interfaces; i++) {
+ add_next_index_stringl(return_value, ce->interfaces[i]->name, ce->interfaces[i]->name_length, 1);
+ }
+}
+/* }}} */
+
/* {{{ proto public ReflectionClass ReflectionClass::getParentClass()
Returns the class' parent class, or, if none exists, FALSE */
ZEND_METHOD(reflection_class, getParentClass)
@@ -3475,8 +3605,7 @@ ZEND_METHOD(reflection_class, isSubclassOf)
return;
}
-
- RETURN_BOOL(instanceof_function(ce, class_ce TSRMLS_CC));
+ RETURN_BOOL((ce != class_ce && instanceof_function(ce, class_ce TSRMLS_CC)));
}
/* }}} */
@@ -3653,7 +3782,7 @@ ZEND_METHOD(reflection_property, __construct)
}
if (!(property_info->flags & ZEND_ACC_PRIVATE)) {
- /* we have to seach the class hierarchy for this (implicit) public or protected property */
+ /* we have to search the class hierarchy for this (implicit) public or protected property */
zend_class_entry *tmp_ce = ce;
zend_property_info *tmp_info;
@@ -3668,7 +3797,7 @@ ZEND_METHOD(reflection_property, __construct)
ZVAL_STRINGL(classname, ce->name, ce->name_length, 1);
zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL);
- zend_unmangle_property_name(property_info->name, &class_name, &prop_name);
+ zend_unmangle_property_name(property_info->name, property_info->name_length, &class_name, &prop_name);
MAKE_STD_ZVAL(propname);
ZVAL_STRING(propname, prop_name, 1);
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &propname, sizeof(zval *), NULL);
@@ -3777,38 +3906,42 @@ ZEND_METHOD(reflection_property, getValue)
{
reflection_object *intern;
property_reference *ref;
- zval *object;
- zval **member= NULL;
+ zval *object, name;
+ zval **member = NULL, *member_p = NULL;
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 */
+ _default_get_entry(getThis(), "name", sizeof("name"), &name TSRMLS_CC);
+ zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ "Cannot access non-public member %s::%s", intern->ce->name, Z_STRVAL(name));
+ zval_dtor(&name);
+ return;
}
-#endif
if ((ref->prop->flags & ZEND_ACC_STATIC)) {
zend_update_class_constants(intern->ce TSRMLS_CC);
if (zend_hash_quick_find(CE_STATIC_MEMBERS(intern->ce), 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 %s", ref->prop->name);
+ zend_error(E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name, ref->prop->name);
/* Bails out */
}
+ *return_value= **member;
+ zval_copy_ctor(return_value);
+ INIT_PZVAL(return_value);
} else {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) {
return;
}
- if (zend_hash_quick_find(Z_OBJPROP_P(object), 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 %s", ref->prop->name);
- /* Bails out */
+ member_p = zend_read_property(Z_OBJCE_P(object), object, ref->prop->name, ref->prop->name_length, 1 TSRMLS_CC);
+ *return_value= *member_p;
+ zval_copy_ctor(return_value);
+ INIT_PZVAL(return_value);
+ if (member_p != EG(uninitialized_zval_ptr)) {
+ zval_add_ref(&member_p);
+ zval_ptr_dtor(&member_p);
}
}
-
- *return_value= **member;
- zval_copy_ctor(return_value);
- INIT_PZVAL(return_value);
}
/* }}} */
@@ -3819,7 +3952,7 @@ ZEND_METHOD(reflection_property, setValue)
reflection_object *intern;
property_reference *ref;
zval **variable_ptr;
- zval *object;
+ zval *object, name;
zval *value;
int setter_done = 0;
zval *tmp;
@@ -3828,9 +3961,12 @@ ZEND_METHOD(reflection_property, setValue)
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_PUBLIC)) {
+ _default_get_entry(getThis(), "name", sizeof("name"), &name TSRMLS_CC);
+ zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ "Cannot access non-public member %s::%s", intern->ce->name, Z_STRVAL(name));
+ zval_dtor(&name);
+ return;
}
if ((ref->prop->flags & ZEND_ACC_STATIC)) {
@@ -3841,38 +3977,38 @@ ZEND_METHOD(reflection_property, setValue)
}
zend_update_class_constants(intern->ce TSRMLS_CC);
prop_table = CE_STATIC_MEMBERS(intern->ce);
- } else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oz", &object, &value) == FAILURE) {
- return;
- }
- prop_table = Z_OBJPROP_P(object);
- }
- if (zend_hash_quick_find(prop_table, 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 %s", 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);
- }
+ if (zend_hash_quick_find(prop_table, 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 %s::%s", intern->ce->name, 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;
+ if (!setter_done) {
+ zval **foo;
- value->refcount++;
- if (PZVAL_IS_REF(value)) {
- SEPARATE_ZVAL(&value);
+ value->refcount++;
+ if (PZVAL_IS_REF(value)) {
+ SEPARATE_ZVAL(&value);
+ }
+ zend_hash_quick_update(prop_table, ref->prop->name, ref->prop->name_length+1, ref->prop->h, &value, sizeof(zval *), (void **) &foo);
}
- zend_hash_quick_update(prop_table, ref->prop->name, ref->prop->name_length+1, ref->prop->h, &value, sizeof(zval *), (void **) &foo);
+ } else {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oz", &object, &value) == FAILURE) {
+ return;
+ }
+ zend_update_property(Z_OBJCE_P(object), object, ref->prop->name, ref->prop->name_length, value TSRMLS_CC);
}
}
/* }}} */
@@ -3885,18 +4021,30 @@ ZEND_METHOD(reflection_property, getDeclaringClass)
property_reference *ref;
zend_class_entry *tmp_ce, *ce;
zend_property_info *tmp_info;
+ char *prop_name, *class_name;
+ int prop_name_len;
METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0);
GET_REFLECTION_OBJECT_PTR(ref);
+ if (zend_unmangle_property_name(ref->prop->name, ref->prop->name_length, &class_name, &prop_name) != SUCCESS) {
+ RETURN_FALSE;
+ }
+
+ prop_name_len = strlen(prop_name);
ce = tmp_ce = ref->ce;
- while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, ref->prop->name, ref->prop->name_length + 1, (void **) &tmp_info) == SUCCESS) {
+ while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, prop_name, prop_name_len + 1, (void **) &tmp_info) == SUCCESS) {
+ if (tmp_info->flags & ZEND_ACC_PRIVATE) {
+ /* it's a private property, so it can't be inherited */
+ break;
+ }
ce = tmp_ce;
- tmp_ce = tmp_ce->parent;
+ tmp_ce = tmp_ce->parent;
}
zend_reflection_class_factory(ce, return_value TSRMLS_CC);
}
+/* }}} */
/* {{{ proto public string ReflectionProperty::getDocComment()
Returns the doc comment for this property */
@@ -3913,6 +4061,7 @@ ZEND_METHOD(reflection_property, getDocComment)
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)
@@ -4207,9 +4356,21 @@ static zend_function_entry reflection_exception_functions[] = {
{NULL, NULL, NULL}
};
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_getModifierNames, 0)
+ ZEND_ARG_INFO(0, modifiers)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_export, 0, 0, 1)
+ ZEND_ARG_OBJ_INFO(0, reflector, Reflector, 0)
+ ZEND_ARG_INFO(0, return)
+ZEND_END_ARG_INFO()
+
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)
+ ZEND_ME(reflection, getModifierNames, arginfo_reflection_getModifierNames, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ ZEND_ME(reflection, export, arginfo_reflection_export, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
{NULL, NULL, NULL}
};
@@ -4219,11 +4380,30 @@ static zend_function_entry reflector_functions[] = {
{NULL, NULL, NULL}
};
-static zend_function_entry reflection_function_functions[] = {
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_function_export, 0, 0, 1)
+ ZEND_ARG_INFO(0, name)
+ ZEND_ARG_INFO(0, return)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_function___construct, 0)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_function_invoke, 0)
+ ZEND_ARG_INFO(0, args)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_function_invokeArgs, 0)
+ ZEND_ARG_ARRAY_INFO(0, args, 0)
+ZEND_END_ARG_INFO()
+
+static zend_function_entry reflection_function_abstract_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)
+ PHP_ABSTRACT_ME(reflection_function, __toString, NULL)
ZEND_ME(reflection_function, isInternal, NULL, 0)
ZEND_ME(reflection_function, isUserDefined, NULL, 0)
ZEND_ME(reflection_function, getName, NULL, 0)
@@ -4232,8 +4412,6 @@ static zend_function_entry reflection_function_functions[] = {
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)
@@ -4246,9 +4424,44 @@ static zend_function_entry reflection_function_functions[] = {
{NULL, NULL, NULL}
};
+static zend_function_entry reflection_function_functions[] = {
+ ZEND_ME(reflection_function, __construct, arginfo_reflection_function___construct, 0)
+ ZEND_ME(reflection_function, __toString, NULL, 0)
+ ZEND_ME(reflection_function, export, arginfo_reflection_function_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC)
+ ZEND_ME(reflection_function, isDisabled, NULL, 0)
+ ZEND_ME(reflection_function, invoke, arginfo_reflection_function_invoke, 0)
+ ZEND_ME(reflection_function, invokeArgs, arginfo_reflection_function_invokeArgs, 0)
+ {NULL, NULL, NULL}
+};
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_method_export, 0, 0, 2)
+ ZEND_ARG_INFO(0, class)
+ ZEND_ARG_INFO(0, name)
+ ZEND_ARG_INFO(0, return)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_method___construct, 0, 0, 1)
+ ZEND_ARG_INFO(0, class_or_method)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_invoke, 0)
+ ZEND_ARG_INFO(0, object)
+ ZEND_ARG_INFO(0, args)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_invokeArgs, 0)
+ ZEND_ARG_INFO(0, object)
+ ZEND_ARG_ARRAY_INFO(0, args, 0)
+ZEND_END_ARG_INFO()
+
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, export, arginfo_reflection_method_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC)
+ ZEND_ME(reflection_method, __construct, arginfo_reflection_method___construct, 0)
ZEND_ME(reflection_method, __toString, NULL, 0)
ZEND_ME(reflection_method, isPublic, NULL, 0)
ZEND_ME(reflection_method, isPrivate, NULL, 0)
@@ -4259,17 +4472,106 @@ static zend_function_entry reflection_method_functions[] = {
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, invoke, arginfo_reflection_method_invoke, 0)
+ ZEND_ME(reflection_method, invokeArgs, arginfo_reflection_method_invokeArgs, 0)
ZEND_ME(reflection_method, getDeclaringClass, NULL, 0)
ZEND_ME(reflection_method, getPrototype, NULL, 0)
{NULL, NULL, NULL}
};
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_class_export, 0, 0, 1)
+ ZEND_ARG_INFO(0, argument)
+ ZEND_ARG_INFO(0, return)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class___construct, 0)
+ ZEND_ARG_INFO(0, argument)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_class_getStaticPropertyValue, 0, 0, 1)
+ ZEND_ARG_INFO(0, name)
+ ZEND_ARG_INFO(0, default)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_setStaticPropertyValue, 0)
+ ZEND_ARG_INFO(0, name)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_hasMethod, 0)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_getMethod, 0)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_class_getMethods, 0, 0, 0)
+ ZEND_ARG_INFO(0, filter)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_hasProperty, 0)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_getProperty, 0)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_class_getProperties, 0, 0, 0)
+ ZEND_ARG_INFO(0, filter)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_hasConstant, 0)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_getConstant, 0)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_isInstance, 0)
+ ZEND_ARG_INFO(0, object)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_newInstance, 0)
+ ZEND_ARG_INFO(0, args)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_class_newInstanceArgs, 0, 0, 0)
+ ZEND_ARG_ARRAY_INFO(0, args, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_isSubclassOf, 0)
+ ZEND_ARG_INFO(0, class)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_implementsInterface, 0)
+ ZEND_ARG_INFO(0, interface)
+ZEND_END_ARG_INFO()
+
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, export, arginfo_reflection_class_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC)
+ ZEND_ME(reflection_class, __construct, arginfo_reflection_class___construct, 0)
ZEND_ME(reflection_class, __toString, NULL, 0)
ZEND_ME(reflection_class, getName, NULL, 0)
ZEND_ME(reflection_class, isInternal, NULL, 0)
@@ -4280,50 +4582,86 @@ static zend_function_entry reflection_class_functions[] = {
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, hasMethod, arginfo_reflection_class_hasMethod, 0)
+ ZEND_ME(reflection_class, getMethod, arginfo_reflection_class_getMethod, 0)
+ ZEND_ME(reflection_class, getMethods, arginfo_reflection_class_getMethods, 0)
+ ZEND_ME(reflection_class, hasProperty, arginfo_reflection_class_hasProperty, 0)
+ ZEND_ME(reflection_class, getProperty, arginfo_reflection_class_getProperty, 0)
+ ZEND_ME(reflection_class, getProperties, arginfo_reflection_class_getProperties, 0)
+ ZEND_ME(reflection_class, hasConstant, arginfo_reflection_class_hasConstant, 0)
ZEND_ME(reflection_class, getConstants, NULL, 0)
- ZEND_ME(reflection_class, getConstant, NULL, 0)
+ ZEND_ME(reflection_class, getConstant, arginfo_reflection_class_getConstant, 0)
ZEND_ME(reflection_class, getInterfaces, NULL, 0)
+ ZEND_ME(reflection_class, getInterfaceNames, 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, newInstanceArgs, NULL, 0)
+ ZEND_ME(reflection_class, isInstance, arginfo_reflection_class_isInstance, 0)
+ ZEND_ME(reflection_class, newInstance, arginfo_reflection_class_newInstance, 0)
+ ZEND_ME(reflection_class, newInstanceArgs, arginfo_reflection_class_newInstanceArgs, 0)
ZEND_ME(reflection_class, getParentClass, NULL, 0)
- ZEND_ME(reflection_class, isSubclassOf, NULL, 0)
+ ZEND_ME(reflection_class, isSubclassOf, arginfo_reflection_class_isSubclassOf, 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, getStaticPropertyValue, arginfo_reflection_class_getStaticPropertyValue, 0)
+ ZEND_ME(reflection_class, setStaticPropertyValue, arginfo_reflection_class_setStaticPropertyValue, 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, implementsInterface, arginfo_reflection_class_implementsInterface, 0)
ZEND_ME(reflection_class, getExtension, NULL, 0)
ZEND_ME(reflection_class, getExtensionName, NULL, 0)
{NULL, NULL, NULL}
};
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_object_export, 0, 0, 1)
+ ZEND_ARG_INFO(0, argument)
+ ZEND_ARG_INFO(0, return)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_object___construct, 0)
+ ZEND_ARG_INFO(0, argument)
+ZEND_END_ARG_INFO()
+
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)
+ ZEND_ME(reflection_object, export, arginfo_reflection_object_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC)
+ ZEND_ME(reflection_object, __construct, arginfo_reflection_object___construct, 0)
{NULL, NULL, NULL}
};
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_property_export, 0, 0, 1)
+ ZEND_ARG_INFO(0, argument)
+ ZEND_ARG_INFO(0, return)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_property___construct, 0)
+ ZEND_ARG_INFO(0, argument)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_property_getValue, 0)
+ ZEND_ARG_INFO(0, object)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_property_setValue, 0)
+ ZEND_ARG_INFO(0, object)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
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, export, arginfo_reflection_property_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC)
+ ZEND_ME(reflection_property, __construct, arginfo_reflection_property___construct, 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, getValue, arginfo_reflection_property_getValue, 0)
+ ZEND_ME(reflection_property, setValue, arginfo_reflection_property_setValue, 0)
ZEND_ME(reflection_property, isPublic, NULL, 0)
ZEND_ME(reflection_property, isPrivate, NULL, 0)
ZEND_ME(reflection_property, isProtected, NULL, 0)
@@ -4335,10 +4673,23 @@ static zend_function_entry reflection_property_functions[] = {
{NULL, NULL, NULL}
};
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_parameter_export, 0, 0, 2)
+ ZEND_ARG_INFO(0, function)
+ ZEND_ARG_INFO(0, parameter)
+ ZEND_ARG_INFO(0, return)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_parameter___construct, 0)
+ ZEND_ARG_INFO(0, function)
+ ZEND_ARG_INFO(0, parameter)
+ZEND_END_ARG_INFO()
+
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, export, arginfo_reflection_parameter_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC)
+ ZEND_ME(reflection_parameter, __construct, arginfo_reflection_parameter___construct, 0)
ZEND_ME(reflection_parameter, __toString, NULL, 0)
ZEND_ME(reflection_parameter, getName, NULL, 0)
ZEND_ME(reflection_parameter, isPassedByReference, NULL, 0)
@@ -4358,10 +4709,21 @@ static zend_function_entry reflection_parameter_functions[] = {
{NULL, NULL, NULL}
};
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_extension_export, 0, 0, 1)
+ ZEND_ARG_INFO(0, name)
+ ZEND_ARG_INFO(0, return)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reflection_extension___construct, 0)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
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, export, arginfo_reflection_extension_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC)
+ ZEND_ME(reflection_extension, __construct, arginfo_reflection_extension___construct, 0)
ZEND_ME(reflection_extension, __toString, NULL, 0)
ZEND_ME(reflection_extension, getName, NULL, 0)
ZEND_ME(reflection_extension, getVersion, NULL, 0)
@@ -4409,19 +4771,23 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
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(), NULL TSRMLS_CC);
+ 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;
+ reflector_ptr = zend_register_internal_interface(&_reflection_entry TSRMLS_CC);
+ INIT_CLASS_ENTRY(_reflection_entry, "ReflectionFunctionAbstract", reflection_function_abstract_functions);
+ _reflection_entry.create_object = reflection_objects_new;
+ reflection_function_abstract_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
+ reflection_register_implement(reflection_function_abstract_ptr, reflector_ptr TSRMLS_CC);
+ zend_declare_property_string(reflection_function_abstract_ptr, "name", sizeof("name")-1, "", ZEND_ACC_ABSTRACT TSRMLS_CC);
+
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);
+ reflection_function_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_abstract_ptr, NULL TSRMLS_CC);
zend_declare_property_string(reflection_function_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
REGISTER_REFLECTION_CLASS_CONST_LONG(function, "IS_DEPRECATED", ZEND_ACC_DEPRECATED);
@@ -4434,7 +4800,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
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);
+ reflection_method_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_abstract_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);
@@ -4485,7 +4851,7 @@ PHP_MINFO_FUNCTION(reflection) /* {{{ */
php_info_print_table_start();
php_info_print_table_header(2, "Reflection", "enabled");
- php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.164.2.33 2006/03/29 14:28:42 tony2001 Exp $");
+ php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.164.2.33.2.31 2006/10/18 16:35:15 johannes Exp $");
php_info_print_table_end();
} /* }}} */
@@ -4509,4 +4875,5 @@ zend_module_entry reflection_module_entry = { /* {{{ */
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
+ * vim600: noet sw=4 ts=4 fdm=marker
*/
diff --git a/ext/reflection/php_reflection.h b/ext/reflection/php_reflection.h
index a5c758964..78a10aa8c 100644
--- a/ext/reflection/php_reflection.h
+++ b/ext/reflection/php_reflection.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_reflection.h,v 1.4.2.3 2006/01/01 12:50:12 sniper Exp $ */
+/* $Id: php_reflection.h,v 1.4.2.3.2.1 2006/06/10 00:40:57 bjori Exp $ */
#ifndef PHP_REFLECTION_H
#define PHP_REFLECTION_H
@@ -32,6 +32,7 @@ BEGIN_EXTERN_C()
extern PHPAPI zend_class_entry *reflector_ptr;
extern PHPAPI zend_class_entry *reflection_exception_ptr;
extern PHPAPI zend_class_entry *reflection_ptr;
+extern PHPAPI zend_class_entry *reflection_function_abstract_ptr;
extern PHPAPI zend_class_entry *reflection_function_ptr;
extern PHPAPI zend_class_entry *reflection_parameter_ptr;
extern PHPAPI zend_class_entry *reflection_class_ptr;
diff --git a/ext/reflection/tests/008.phpt b/ext/reflection/tests/008.phpt
new file mode 100755
index 000000000..2abdcdb57
--- /dev/null
+++ b/ext/reflection/tests/008.phpt
@@ -0,0 +1,39 @@
+--TEST--
+ReflectionMethod::__construct() tests
+--FILE--
+<?php
+
+$a = array("", 1, "::", "a::", "::b", "a::b");
+
+foreach ($a as $val) {
+ try {
+ new ReflectionMethod($val);
+ } catch (Exception $e) {
+ var_dump($e->getMessage());
+ }
+}
+
+$a = array("", 1, "");
+$b = array("", "", 1);
+
+foreach ($a as $key=>$val) {
+ try {
+ new ReflectionMethod($val, $b[$key]);
+ } catch (Exception $e) {
+ var_dump($e->getMessage());
+ }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(20) "Invalid method name "
+string(21) "Invalid method name 1"
+string(21) "Class does not exist"
+string(22) "Class a does not exist"
+string(21) "Class does not exist"
+string(22) "Class a does not exist"
+string(21) "Class does not exist"
+string(66) "The parameter class is expected to be either a string or an object"
+string(21) "Class does not exist"
+Done
diff --git a/ext/reflection/tests/bug29986.phpt b/ext/reflection/tests/bug29986.phpt
index 85bad6d6e..997bcf7cc 100644
--- a/ext/reflection/tests/bug29986.phpt
+++ b/ext/reflection/tests/bug29986.phpt
@@ -17,14 +17,14 @@ Reflection::export(new ReflectionClass('just_constants'));
?>
--EXPECTF--
Class [ <user> class just_constants ] {
- @@ %s
+ @@ %s %d-%d
- Constants [5] {
- Constant [ boolean BOOLEAN_CONSTANT ] { }
- Constant [ null NULL_CONSTANT ] { }
- Constant [ string STRING_CONSTANT ] { }
- Constant [ integer INTEGER_CONSTANT ] { }
- Constant [ double FLOAT_CONSTANT ] { }
+ Constant [ boolean BOOLEAN_CONSTANT ] { 1 }
+ Constant [ null NULL_CONSTANT ] { }
+ Constant [ string STRING_CONSTANT ] { This is a string }
+ Constant [ integer INTEGER_CONSTANT ] { 1000 }
+ Constant [ double FLOAT_CONSTANT ] { 3.14159265 }
}
- Static properties [0] {
diff --git a/ext/reflection/tests/bug37816.phpt b/ext/reflection/tests/bug37816.phpt
new file mode 100755
index 000000000..18a49046d
--- /dev/null
+++ b/ext/reflection/tests/bug37816.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #37816 (ReflectionProperty does not throw exception when accessing protected attribute)
+--FILE--
+<?php
+
+class TestClass
+{
+ protected $p = 2;
+}
+
+$o = new TestClass;
+
+$r = new ReflectionProperty($o, 'p');
+
+try
+{
+ $x = $r->getValue($o);
+}
+catch (Exception $e)
+{
+ echo 'Caught: ' . $e->getMessage() . "\n";
+}
+
+?>
+===DONE===
+--EXPECTF--
+Caught: Cannot access non-public member TestClass::p
+===DONE===
diff --git a/ext/reflection/tests/bug38132.phpt b/ext/reflection/tests/bug38132.phpt
new file mode 100755
index 000000000..aeb6246b8
--- /dev/null
+++ b/ext/reflection/tests/bug38132.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Reflection Bug #38132 (ReflectionClass::getStaticProperties() retains \0 in key names)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+class foo {
+ static protected $bar = 'baz';
+ static public $a = 'a';
+}
+
+$class = new ReflectionClass('foo');
+$properties = $class->getStaticProperties();
+var_dump($properties, array_keys($properties));
+var_dump(isset($properties['*bar']));
+var_dump(isset($properties["\0*\0bar"]));
+var_dump(isset($properties["bar"]));
+?>
+--EXPECT--
+array(2) {
+ ["bar"]=>
+ string(3) "baz"
+ ["a"]=>
+ string(1) "a"
+}
+array(2) {
+ [0]=>
+ string(3) "bar"
+ [1]=>
+ string(1) "a"
+}
+bool(false)
+bool(false)
+bool(true)
diff --git a/ext/reflection/tests/bug38194.phpt b/ext/reflection/tests/bug38194.phpt
new file mode 100755
index 000000000..5c888af59
--- /dev/null
+++ b/ext/reflection/tests/bug38194.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Reflection Bug #38194 (ReflectionClass::isSubclassOf() returns TRUE for the class itself)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+class Object { }
+
+$objectClass= new ReflectionClass('Object');
+var_dump($objectClass->isSubclassOf($objectClass));
+?>
+--EXPECT--
+bool(false)
diff --git a/ext/reflection/tests/bug38217.phpt b/ext/reflection/tests/bug38217.phpt
new file mode 100644
index 000000000..55e0c4664
--- /dev/null
+++ b/ext/reflection/tests/bug38217.phpt
@@ -0,0 +1,40 @@
+--TEST--
+#38217 (ReflectionClass::newInstanceArgs() tries to allocate too much memory)
+--FILE--
+<?php
+
+class Object {
+ public function __construct() {
+ }
+}
+
+$class= new ReflectionClass('Object');
+var_dump($class->newInstanceArgs());
+
+class Object1 {
+ public function __construct($var) {
+ var_dump($var);
+ }
+}
+
+$class= new ReflectionClass('Object1');
+var_dump($class->newInstanceArgs());
+var_dump($class->newInstanceArgs(array('test')));
+
+
+echo "Done\n";
+?>
+--EXPECTF--
+object(Object)#%d (0) {
+}
+
+Warning: Missing argument 1 for Object1::__construct() in %s on line %d
+
+Notice: Undefined variable: var in %s on line %d
+NULL
+object(Object1)#%d (0) {
+}
+string(4) "test"
+object(Object1)#%d (0) {
+}
+Done
diff --git a/ext/reflection/tests/bug38465.phpt b/ext/reflection/tests/bug38465.phpt
new file mode 100644
index 000000000..4947180e9
--- /dev/null
+++ b/ext/reflection/tests/bug38465.phpt
@@ -0,0 +1,66 @@
+--TEST--
+Reflection Bug #38465 (ReflectionParameter fails on access to self::)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+class Baz {
+ const B = 3;
+}
+
+class Foo {
+ const X = 1;
+ public function x($a = self::X, $b = Baz::B, $c = 99) {}
+}
+
+class Bar extends Foo {
+ const Y = 2;
+ public function y($a = self::Y, $b = Baz::B, $c = 99) {}
+}
+
+
+echo "From global scope:\n";
+
+$clazz = new ReflectionClass('Bar');
+foreach ($clazz->getMethods() as $method) {
+ foreach ($method->getParameters() as $param) {
+ if ($param->isDefaultValueAvailable()) {
+ echo $method->getDeclaringClass()->getName(), '::', $method->getName(), '($', $param->getName(), ' = ', $param->getDefaultValue(), ")\n";
+ }
+ }
+}
+
+echo "\nFrom class context:\n";
+
+class Test {
+ function __construct() {
+ $clazz = new ReflectionClass('Bar');
+ foreach ($clazz->getMethods() as $method) {
+ foreach ($method->getParameters() as $param) {
+ if ($param->isDefaultValueAvailable()) {
+ echo $method->getDeclaringClass()->getName(), '::', $method->getName(), '($', $param->getName(), ' = ', $param->getDefaultValue(), ")\n";
+ }
+ }
+ }
+ }
+}
+
+new Test();
+
+?>
+--EXPECT--
+From global scope:
+Bar::y($a = 2)
+Bar::y($b = 3)
+Bar::y($c = 99)
+Foo::x($a = 1)
+Foo::x($b = 3)
+Foo::x($c = 99)
+
+From class context:
+Bar::y($a = 2)
+Bar::y($b = 3)
+Bar::y($c = 99)
+Foo::x($a = 1)
+Foo::x($b = 3)
+Foo::x($c = 99)
diff --git a/ext/reflection/tests/bug38653.phpt b/ext/reflection/tests/bug38653.phpt
new file mode 100644
index 000000000..68781d2ab
--- /dev/null
+++ b/ext/reflection/tests/bug38653.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #38653 (memory leak in ReflectionClass::getConstant())
+--FILE--
+<?php
+
+class foo {
+ const cons = 10;
+ const cons1 = "";
+ const cons2 = "test";
+}
+
+class bar extends foo {
+}
+
+$foo = new ReflectionClass("foo");
+var_dump($foo->getConstant("cons"));
+var_dump($foo->getConstant("cons1"));
+var_dump($foo->getConstant("cons2"));
+var_dump($foo->getConstant("no such const"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(10)
+string(0) ""
+string(4) "test"
+bool(false)
+Done
diff --git a/ext/reflection/tests/bug38942.phpt b/ext/reflection/tests/bug38942.phpt
new file mode 100755
index 000000000..f66f2552b
--- /dev/null
+++ b/ext/reflection/tests/bug38942.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #38942 (Double old-style-ctor inheritance)
+--FILE--
+<?php
+class foo {
+ public function foo() {}
+}
+
+class bar extends foo {
+}
+ReflectionClass::export("bar");
+?>
+--EXPECTF--
+Class [ <user> class bar extends foo ] {
+ @@ %sbug38942.php 6-7
+
+ - Constants [0] {
+ }
+
+ - Static properties [0] {
+ }
+
+ - Static methods [0] {
+ }
+
+ - Properties [0] {
+ }
+
+ - Methods [1] {
+ Method [ <user, inherits foo, ctor> public method foo ] {
+ @@ %sbug38942.php 3 - 3
+ }
+ }
+}
diff --git a/ext/reflection/tests/bug39001.phpt b/ext/reflection/tests/bug39001.phpt
new file mode 100644
index 000000000..1ed675f02
--- /dev/null
+++ b/ext/reflection/tests/bug39001.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #39001 (ReflectionProperty returns incorrect declaring class for protected properties)
+--FILE--
+<?php
+
+class Meta {
+}
+
+class CParent extends Meta {
+ public $publicVar;
+ protected $protectedVar;
+}
+
+class Child extends CParent {
+}
+
+$r = new ReflectionClass('Child');
+
+var_dump($r->getProperty('publicVar')->getDeclaringClass()->getName());
+var_dump($r->getProperty('protectedVar')->getDeclaringClass()->getName());
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(7) "CParent"
+string(7) "CParent"
+Done
diff --git a/ext/reflection/tests/bug39067.phpt b/ext/reflection/tests/bug39067.phpt
new file mode 100644
index 000000000..8a7a6044e
--- /dev/null
+++ b/ext/reflection/tests/bug39067.phpt
@@ -0,0 +1,45 @@
+--TEST--
+Bug #39067 (getDeclaringClass() and private properties)
+--FILE--
+<?php
+
+class A {
+ private $x;
+}
+
+class B extends A {
+ private $x;
+}
+
+class C extends B {
+ private $x;
+}
+
+$rc = new ReflectionClass('C');
+var_dump($rc->getProperty('x')->getDeclaringClass()->getName());
+
+$rc = new ReflectionClass('B');
+var_dump($rc->getProperty('x')->getDeclaringClass()->getName());
+
+$rc = new ReflectionClass('A');
+var_dump($rc->getProperty('x')->getDeclaringClass()->getName());
+
+class Test {
+ private $x;
+}
+
+class Test2 extends Test {
+ public $x;
+}
+
+$rc = new ReflectionClass('Test2');
+var_dump($rc->getProperty('x')->getDeclaringClass()->getName());
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(1) "C"
+string(1) "B"
+string(1) "A"
+string(5) "Test2"
+Done
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index 89f072f53..c233118ca 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mod_files.c,v 1.100.2.3 2006/04/18 00:31:45 iliaa Exp $ */
+/* $Id: mod_files.c,v 1.100.2.3.2.2 2006/08/08 14:54:49 iliaa Exp $ */
#include "php.h"
@@ -152,6 +152,7 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
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 '-,'");
+ PS(invalid_session_id) = 1;
return;
}
if (!ps_files_path_create(buf, sizeof(buf), data, key))
@@ -401,7 +402,12 @@ PS_DESTROY_FUNC(files)
ps_files_close(data);
if (VCWD_UNLINK(buf) == -1) {
- return FAILURE;
+ /* This is a little safety check for instances when we are dealing with a regenerated session
+ * that was not yet written to disk
+ */
+ if (!VCWD_ACCESS(buf, F_OK)) {
+ return FAILURE;
+ }
}
}
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index 6e13d5415..13bf5998d 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_session.h,v 1.101.2.2 2006/01/28 06:14:49 fmk Exp $ */
+/* $Id: php_session.h,v 1.101.2.2.2.3 2006/10/06 21:11:36 iliaa Exp $ */
#ifndef PHP_SESSION_H
#define PHP_SESSION_H
@@ -103,6 +103,7 @@ typedef struct _php_ps_globals {
char *cookie_path;
char *cookie_domain;
zend_bool cookie_secure;
+ zend_bool cookie_httponly;
ps_module *mod;
void *mod_data;
php_session_status session_status;
@@ -125,6 +126,7 @@ typedef struct _php_ps_globals {
long hash_bits_per_character;
int send_cookie;
int define_sid;
+ zend_bool invalid_session_id; /* allows the driver to report about an invalid session id and request id regeneration */
} php_ps_globals;
typedef php_ps_globals zend_ps_globals;
@@ -197,6 +199,9 @@ PHPAPI int php_session_register_serializer(const char *name,
PHPAPI void php_session_set_id(char *id TSRMLS_DC);
PHPAPI void php_session_start(TSRMLS_D);
+PHPAPI ps_module *_php_find_ps_module(char *name TSRMLS_DC);
+PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC);
+
#define PS_ADD_VARL(name,namelen) do { \
php_add_session_var(name, namelen TSRMLS_CC); \
} while (0)
diff --git a/ext/session/session.c b/ext/session/session.c
index b9c6a2201..ea6b88f1d 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: session.c,v 1.417.2.8 2006/02/10 07:39:13 rasmus Exp $ */
+/* $Id: session.c,v 1.417.2.8.2.16 2006/10/06 21:11:36 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -82,9 +82,7 @@ zend_function_entry session_functions[] = {
/* }}} */
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);
+static PHP_GINIT_FUNCTION(ps);
#define SESSION_CHECK_ACTIVE_STATE \
if (PS(session_status) == php_session_active) { \
@@ -94,13 +92,22 @@ static const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC);
static PHP_INI_MH(OnUpdateSaveHandler)
{
+ ps_module *tmp;
SESSION_CHECK_ACTIVE_STATE;
- PS(mod) = _php_find_ps_module(new_value TSRMLS_CC);
+ tmp = _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);
+ if (PG(modules_activated) && !tmp) {
+ int err_type;
+ if (stage == ZEND_INI_STAGE_RUNTIME) {
+ err_type = E_WARNING;
+ } else {
+ err_type = E_ERROR;
+ }
+ php_error_docref(NULL TSRMLS_CC, err_type, "Cannot find save handler %s", new_value);
+ return FAILURE;
}
+ PS(mod) = tmp;
return SUCCESS;
}
@@ -120,13 +127,22 @@ static PHP_INI_MH(OnUpdateTransSid)
static PHP_INI_MH(OnUpdateSerializer)
{
+ const ps_serializer *tmp;
SESSION_CHECK_ACTIVE_STATE;
- PS(serializer) = _php_find_ps_serializer(new_value TSRMLS_CC);
+ tmp = _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);
+ if (PG(modules_activated) && !tmp) {
+ int err_type;
+ if (stage == ZEND_INI_STAGE_RUNTIME) {
+ err_type = E_WARNING;
+ } else {
+ err_type = E_ERROR;
+ }
+ php_error_docref(NULL TSRMLS_CC, err_type, "Cannot find serialization handler %s", new_value);
+ return FAILURE;
}
+ PS(serializer) = tmp;
return SUCCESS;
}
@@ -135,11 +151,19 @@ 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))) {
+ char *p;
+
+ if ((p = zend_memrchr(new_value, ';', new_value_length))) {
+ p++;
+ } else {
+ p = new_value;
+ }
+
+ if (PG(safe_mode) && (!php_checkuid(p, NULL, CHECKUID_ALLOW_ONLY_DIR))) {
return FAILURE;
}
- if (php_check_open_basedir(new_value TSRMLS_CC)) {
+ if (php_check_open_basedir(p TSRMLS_CC)) {
return FAILURE;
}
}
@@ -164,6 +188,7 @@ PHP_INI_BEGIN()
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.cookie_httponly", "", PHP_INI_ALL, OnUpdateBool, cookie_httponly, 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)
@@ -257,7 +282,11 @@ zend_module_entry session_module_entry = {
PHP_RINIT(session), PHP_RSHUTDOWN(session),
PHP_MINFO(session),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(ps),
+ PHP_GINIT(ps),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
#ifdef COMPILE_DL_SESSION
@@ -280,9 +309,13 @@ typedef struct {
PHPAPI 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);
+
+ IF_SESSION_VARS() {
+ zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1,
+ (void *) &sym_track);
+ } else {
+ return;
+ }
/*
* Set up a proper reference between $_SESSION["x"] and $x.
@@ -441,7 +474,7 @@ PS_SERIALIZER_DECODE_FUNC(php_binary)
if (has_value) {
ALLOC_INIT_ZVAL(current);
- if (php_var_unserialize(&current, (const unsigned char **) &p, endptr, &var_hash TSRMLS_CC)) {
+ if (php_var_unserialize(&current, (const unsigned char **) &p, (const unsigned char *) endptr, &var_hash TSRMLS_CC)) {
php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC);
}
zval_ptr_dtor(&current);
@@ -521,7 +554,7 @@ PS_SERIALIZER_DECODE_FUNC(php)
if (has_value) {
ALLOC_INIT_ZVAL(current);
- if (php_var_unserialize(&current, (const unsigned char **) &q, endptr, &var_hash TSRMLS_CC)) {
+ if (php_var_unserialize(&current, (const unsigned char **) &q, (const unsigned char *) endptr, &var_hash TSRMLS_CC)) {
php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC);
}
zval_ptr_dtor(&current);
@@ -611,8 +644,8 @@ static char *bin_to_readable(char *in, size_t inlen, char *out, char nbits)
int mask;
int have;
- p = in;
- q = in + inlen;
+ p = (unsigned char *) in;
+ q = (unsigned char *)in + inlen;
w = 0;
have = 0;
@@ -668,17 +701,17 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS)
/* 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);
+ tv.tv_sec, (long int)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));
+ PHP_MD5Update(&md5_context, (unsigned char *) buf, strlen(buf));
digest_len = 16;
break;
case PS_HASH_FUNC_SHA1:
PHP_SHA1Init(&sha1_context);
- PHP_SHA1Update(&sha1_context, buf, strlen(buf));
+ PHP_SHA1Update(&sha1_context, (unsigned char *) buf, strlen(buf));
digest_len = 20;
break;
default:
@@ -729,7 +762,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS)
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);
+ j = (int) (bin_to_readable((char *)digest, digest_len, buf, PS(hash_bits_per_character)) - buf);
if (newlen)
*newlen = j;
@@ -759,8 +792,13 @@ static void php_session_initialize(TSRMLS_D)
}
/* If there is no ID, use session module to create one */
- if (!PS(id))
+ if (!PS(id)) {
+new_session:
PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC);
+ if (PS(use_cookies)) {
+ PS(send_cookie) = 1;
+ }
+ }
/* Read data */
/* Question: if you create a SID here, should you also try to read data?
@@ -769,9 +807,14 @@ static void php_session_initialize(TSRMLS_D)
* session information
*/
php_session_track_init(TSRMLS_C);
+ PS(invalid_session_id) = 0;
if (PS(mod)->s_read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) == SUCCESS) {
php_session_decode(val, vallen TSRMLS_CC);
efree(val);
+ } else if (PS(invalid_session_id)) { /* address instances where the session read fails due to an invalid id */
+ PS(invalid_session_id) = 0;
+ efree(PS(id));
+ goto new_session;
}
}
@@ -993,6 +1036,7 @@ static int php_session_cache_limiter(TSRMLS_D)
#define COOKIE_PATH "; path="
#define COOKIE_DOMAIN "; domain="
#define COOKIE_SECURE "; secure"
+#define COOKIE_HTTPONLY "; HttpOnly"
static void php_session_send_cookie(TSRMLS_D)
{
@@ -1046,12 +1090,18 @@ static void php_session_send_cookie(TSRMLS_D)
smart_str_appends(&ncookie, COOKIE_SECURE);
}
+ if (PS(cookie_httponly)) {
+ smart_str_appends(&ncookie, COOKIE_HTTPONLY);
+ }
+
smart_str_0(&ncookie);
+ /* 'replace' must be 0 here, else a previous Set-Cookie
+ header, probably sent with setcookie() will be replaced! */
sapi_add_header_ex(ncookie.c, ncookie.len, 0, 0 TSRMLS_CC);
}
-static ps_module *_php_find_ps_module(char *name TSRMLS_DC)
+PHPAPI ps_module *_php_find_ps_module(char *name TSRMLS_DC)
{
ps_module *ret = NULL;
ps_module **mod;
@@ -1066,7 +1116,7 @@ static ps_module *_php_find_ps_module(char *name TSRMLS_DC)
return ret;
}
-static const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC)
+PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC)
{
const ps_serializer *ret = NULL;
const ps_serializer *mod;
@@ -1271,17 +1321,17 @@ static zend_bool php_session_destroy(TSRMLS_D)
}
-/* {{{ proto void session_set_cookie_params(int lifetime [, string path [, string domain [, bool secure]]])
+/* {{{ proto void session_set_cookie_params(int lifetime [, string path [, string domain [, bool secure[, bool httponly]]]])
Set session cookie parameters */
PHP_FUNCTION(session_set_cookie_params)
{
- zval **lifetime, **path, **domain, **secure;
+ zval **lifetime, **path, **domain, **secure, **httponly;
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)
+ if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 5 ||
+ zend_get_parameters_ex(ZEND_NUM_ARGS(), &lifetime, &path, &domain, &secure, &httponly) == FAILURE)
WRONG_PARAM_COUNT;
convert_to_string_ex(lifetime);
@@ -1298,6 +1348,10 @@ PHP_FUNCTION(session_set_cookie_params)
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);
}
+ if (ZEND_NUM_ARGS() > 4) {
+ convert_to_long_ex(httponly);
+ zend_alter_ini_entry("session.cookie_httponly", sizeof("session.cookie_httponly"), Z_BVAL_PP(httponly)?"1":"0", 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
+ }
}
}
}
@@ -1317,6 +1371,7 @@ PHP_FUNCTION(session_get_cookie_params)
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));
+ add_assoc_bool(return_value, "httponly", PS(cookie_httponly));
}
/* }}} */
@@ -1363,8 +1418,9 @@ PHP_FUNCTION(session_module_name)
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)",
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find named PHP session module (%s)",
Z_STRVAL_PP(p_name));
+ zval_dtor(return_value);
RETURN_FALSE;
}
if (PS(mod_data)) {
@@ -1475,6 +1531,11 @@ PHP_FUNCTION(session_regenerate_id)
WRONG_PARAM_COUNT;
}
+ if (SG(headers_sent)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot regenerate session id - headers already sent");
+ RETURN_FALSE;
+ }
+
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) {
@@ -1531,8 +1592,8 @@ PHP_FUNCTION(session_cache_expire)
WRONG_PARAM_COUNT;
if (ac == 1) {
- convert_to_long_ex(p_cache_expire);
- PS(cache_expire) = Z_LVAL_PP(p_cache_expire);
+ convert_to_string_ex(p_cache_expire);
+ zend_alter_ini_entry("session.cache_expire", sizeof("session.cache_expire"), Z_STRVAL_PP(p_cache_expire), Z_STRLEN_PP(p_cache_expire), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
}
RETVAL_LONG(old);
@@ -1826,7 +1887,7 @@ PHP_RSHUTDOWN_FUNCTION(session)
}
/* }}} */
-static void php_minit_session_globals(php_ps_globals *ps_globals)
+static PHP_GINIT_FUNCTION(ps)
{
ps_globals->save_path = NULL;
ps_globals->session_name = NULL;
@@ -1839,15 +1900,6 @@ static void php_minit_session_globals(php_ps_globals *ps_globals)
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! */
@@ -1930,6 +1982,6 @@ PHP_MINFO_FUNCTION(session)
* tab-width: 4
* c-basic-offset: 4
* End:
- * vim600: sw=4 ts=4 fdm=marker
+ * vim600: noet sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
diff --git a/ext/session/tests/008-php4.2.3.phpt b/ext/session/tests/008-php4.2.3.phpt
index 0057f2be4..537858a36 100644
--- a/ext/session/tests/008-php4.2.3.phpt
+++ b/ext/session/tests/008-php4.2.3.phpt
@@ -58,7 +58,7 @@ 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.
+session_write_close(): 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)
diff --git a/ext/session/tests/bug38377.phpt b/ext/session/tests/bug38377.phpt
new file mode 100644
index 000000000..514e45963
--- /dev/null
+++ b/ext/session/tests/bug38377.phpt
@@ -0,0 +1,13 @@
+--TEST--
+bug #38377 (session_destroy() gives warning after session_regenerate_id())
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+session_start();
+session_regenerate_id();
+session_destroy();
+echo "Done\n";
+?>
+--EXPECT--
+Done
diff --git a/ext/shmop/tests/001.phpt b/ext/shmop/tests/001.phpt
index fc293c82e..74f53a037 100644
--- a/ext/shmop/tests/001.phpt
+++ b/ext/shmop/tests/001.phpt
@@ -84,7 +84,7 @@ 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
+shmop_write(): 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
diff --git a/ext/simplexml/php_simplexml.h b/ext/simplexml/php_simplexml.h
index 400c4f5c4..4c39360b9 100644
--- a/ext/simplexml/php_simplexml.h
+++ b/ext/simplexml/php_simplexml.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_simplexml.h,v 1.20.2.2 2006/02/26 23:14:45 helly Exp $ */
+/* $Id: php_simplexml.h,v 1.20.2.2.2.2 2006/08/07 10:09:52 rrichards Exp $ */
#ifndef PHP_SIMPLEXML_H
#define PHP_SIMPLEXML_H
@@ -67,9 +67,9 @@ typedef struct {
HashTable *properties;
xmlXPathContextPtr xpath;
struct {
- int itertype;
- char *name;
- char *nsprefix;
+ xmlChar *name;
+ xmlChar *nsprefix;
+ int isprefix;
SXE_ITER type;
zval *data;
} iter;
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index a82b9b82c..f2b766a34 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: simplexml.c,v 1.151.2.22 2006/04/14 15:19:45 helly Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.15 2006/09/06 15:31:48 nlopess Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -48,6 +48,7 @@ ZEND_API zend_class_entry *sxe_get_element_class_entry()
}
#define SXE_ME(func, arg_info, flags) PHP_ME(simplexml_element, func, arg_info, flags)
+#define SXE_MALIAS(func, alias, arg_info, flags) PHP_MALIAS(simplexml_element, func, alias, arg_info, flags)
#define SXE_METHOD(func) PHP_METHOD(simplexml_element, func)
@@ -58,7 +59,7 @@ static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, i
/* {{{ _node_as_zval()
*/
-static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, int itertype, char *name, char *prefix TSRMLS_DC)
+static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE_ITER itertype, char *name, xmlChar *nsprefix, int isprefix TSRMLS_DC)
{
php_sxe_object *subnode;
@@ -67,10 +68,11 @@ static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, int
subnode->document->refcount++;
subnode->iter.type = itertype;
if (name) {
- subnode->iter.name = xmlStrdup(name);
+ subnode->iter.name = xmlStrdup((xmlChar *)name);
}
- if (prefix) {
- subnode->iter.nsprefix = xmlStrdup(prefix);
+ if (nsprefix && *nsprefix) {
+ subnode->iter.nsprefix = xmlStrdup((xmlChar *)nsprefix);
+ subnode->iter.isprefix = isprefix;
}
php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL TSRMLS_CC);
@@ -116,13 +118,13 @@ static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node TS
}
}
-static inline int match_ns(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name) /* {{{ */
+static inline int match_ns(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name, int prefix) /* {{{ */
{
if (name == NULL && (node->ns == NULL || node->ns->prefix == NULL)) {
return 1;
}
- if (node->ns && !xmlStrcmp(node->ns->href, name)) {
+ if (node->ns && !xmlStrcmp(prefix ? node->ns->prefix : node->ns->href, name)) {
return 1;
}
@@ -139,7 +141,7 @@ static xmlNodePtr sxe_get_element_by_offset(php_sxe_object *sxe, long offset, xm
}
while (node && nodendx <= offset) {
SKIP_TEXT(node)
- if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix)) {
+ if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefix)) {
if (sxe->iter.type == SXE_ITER_CHILD || (
sxe->iter.type == SXE_ITER_ELEMENT && !xmlStrcmp(node->name, sxe->iter.name))) {
if (nodendx == offset) {
@@ -160,11 +162,11 @@ next_iter:
}
/* }}} */
-static xmlNodePtr sxe_find_element_by_name(php_sxe_object *sxe, xmlNodePtr node, char *name TSRMLS_DC) /* {{{ */
+static xmlNodePtr sxe_find_element_by_name(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name TSRMLS_DC) /* {{{ */
{
while (node) {
SKIP_TEXT(node)
- if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix)) {
+ if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefix)) {
if (!xmlStrcmp(node->name, name)) {
return node;
}
@@ -193,13 +195,16 @@ static xmlNodePtr sxe_get_element_by_name(php_sxe_object *sxe, xmlNodePtr node,
if (sxe->iter.type == SXE_ITER_ELEMENT) {
orgnode = sxe_find_element_by_name(sxe, node, sxe->iter.name TSRMLS_CC);
+ if (!orgnode) {
+ return NULL;
+ }
node = orgnode->children;
}
while (node) {
SKIP_TEXT(node)
- if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix)) {
- if (!xmlStrcmp(node->name, *name)) {
+ if (node->type == XML_ELEMENT_NODE && match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefix)) {
+ if (!xmlStrcmp(node->name, (xmlChar *)*name)) {
if (1||retnode)
{
*type = SXE_ITER_ELEMENT;
@@ -276,9 +281,9 @@ static zval * sxe_prop_dim_read(zval *object, zval *member, zend_bool elements,
if (Z_TYPE_P(member) != IS_LONG || sxe->iter.type == SXE_ITER_ATTRLIST) {
if (Z_TYPE_P(member) == IS_LONG) {
while (attr && nodendx <= Z_LVAL_P(member)) {
- if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) {
+ if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
if (nodendx == Z_LVAL_P(member)) {
- _node_as_zval(sxe, (xmlNodePtr) attr, return_value, SXE_ITER_NONE, NULL, sxe->iter.nsprefix TSRMLS_CC);
+ _node_as_zval(sxe, (xmlNodePtr) attr, return_value, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
break;
}
nodendx++;
@@ -287,8 +292,8 @@ static zval * sxe_prop_dim_read(zval *object, zval *member, zend_bool elements,
}
} else {
while (attr) {
- if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && !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);
+ if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && !xmlStrcmp(attr->name, (xmlChar *)name) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
+ _node_as_zval(sxe, (xmlNodePtr) attr, return_value, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
break;
}
attr = attr->next;
@@ -307,7 +312,7 @@ static zval * sxe_prop_dim_read(zval *object, zval *member, zend_bool elements,
}
node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL);
if (node) {
- _node_as_zval(sxe, node, return_value, SXE_ITER_NONE, NULL, sxe->iter.nsprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, return_value, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
}
} else {
#if SXE_ELEMENT_BY_NAME
@@ -316,10 +321,10 @@ static zval * sxe_prop_dim_read(zval *object, zval *member, zend_bool elements,
GET_NODE(sxe, node);
node = sxe_get_element_by_name(sxe, node, &name, &newtype TSRMLS_CC);
if (node) {
- _node_as_zval(sxe, node, return_value, newtype, name, sxe->iter.nsprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, return_value, newtype, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
}
#else
- _node_as_zval(sxe, node, return_value, SXE_ITER_ELEMENT, name, sxe->iter.nsprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, return_value, SXE_ITER_ELEMENT, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
#endif
}
}
@@ -361,10 +366,12 @@ static zval * sxe_dimension_read(zval *object, zval *offset, int type TSRMLS_DC)
static void change_node_zval(xmlNodePtr node, zval *value TSRMLS_DC)
{
zval value_copy;
+ xmlChar *buffer;
+ int buffer_len;
if (!value)
{
- xmlNodeSetContentLen(node, "", 0);
+ xmlNodeSetContentLen(node, (xmlChar *)"", 0);
return;
}
switch (Z_TYPE_P(value)) {
@@ -380,7 +387,20 @@ static void change_node_zval(xmlNodePtr node, zval *value TSRMLS_DC)
convert_to_string(value);
/* break missing intentionally */
case IS_STRING:
- xmlNodeSetContentLen(node, Z_STRVAL_P(value), Z_STRLEN_P(value));
+ if (node->type == XML_ATTRIBUTE_NODE) {
+ buffer = xmlEncodeEntitiesReentrant(node->doc, (xmlChar *)Z_STRVAL_P(value));
+ buffer_len = xmlStrlen(buffer);
+ } else {
+ buffer = (xmlChar *)Z_STRVAL_P(value);
+ buffer_len = Z_STRLEN_P(value);
+ }
+ /* check for NULL buffer in case of memory error in xmlEncodeEntitiesReentrant */
+ if (buffer) {
+ xmlNodeSetContentLen(node, buffer, buffer_len);
+ if (node->type == XML_ATTRIBUTE_NODE) {
+ xmlFree(buffer);
+ }
+ }
if (value == &value_copy) {
zval_dtor(value);
}
@@ -493,7 +513,7 @@ static void sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_boo
if (attribs) {
if (Z_TYPE_P(member) == IS_LONG) {
while (attr && nodendx <= Z_LVAL_P(member)) {
- if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) {
+ if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
if (nodendx == Z_LVAL_P(member)) {
is_attr = 1;
++counter;
@@ -505,7 +525,7 @@ static void sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_boo
}
} else {
while (attr) {
- if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && !xmlStrcmp(attr->name, name) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) {
+ if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && !xmlStrcmp(attr->name, (xmlChar *)name) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
is_attr = 1;
++counter;
break;
@@ -527,7 +547,7 @@ static void sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_boo
while (node) {
SKIP_TEXT(node);
- if (!xmlStrcmp(node->name, name)) {
+ if (!xmlStrcmp(node->name, (xmlChar *)name)) {
newnode = node;
++counter;
}
@@ -553,15 +573,15 @@ next_iter:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot assign to an array of nodes (duplicate subnodes or attr detected)");
} else if (elements) {
if (!node) {
- newnode = xmlNewTextChild(mynode, mynode->ns, name, value ? Z_STRVAL_P(value) : NULL);
+ newnode = xmlNewTextChild(mynode, mynode->ns, (xmlChar *)name, value ? (xmlChar *)Z_STRVAL_P(value) : NULL);
} else if (Z_TYPE_P(member) == IS_LONG) {
if (cnt < Z_LVAL_P(member)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element %s number %ld when only %ld such elements exist", mynode->name, Z_LVAL_P(member), cnt);
}
- newnode = xmlNewTextChild(mynode->parent, mynode->ns, mynode->name, value ? Z_STRVAL_P(value) : NULL);
+ newnode = xmlNewTextChild(mynode->parent, mynode->ns, mynode->name, value ? (xmlChar *)Z_STRVAL_P(value) : NULL);
}
} else if (attribs) {
- newnode = (xmlNodePtr)xmlNewProp(node, name, value ? Z_STRVAL_P(value) : NULL);
+ newnode = (xmlNodePtr)xmlNewProp(node, (xmlChar *)name, value ? (xmlChar *)Z_STRVAL_P(value) : NULL);
}
}
@@ -613,7 +633,7 @@ static zval** sxe_property_get_adr(zval *object, zval *member TSRMLS_DC) /* {{{
name = NULL;
}
MAKE_STD_ZVAL(return_value);
- _node_as_zval(sxe, node, return_value, type, name, sxe->iter.nsprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, return_value, type, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
sxe = php_sxe_fetch_object(return_value TSRMLS_CC);
sxe->tmp = return_value;
@@ -673,7 +693,7 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend
int nodendx = 0;
while (attr && nodendx <= Z_LVAL_P(member)) {
- if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) {
+ if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
if (nodendx == Z_LVAL_P(member)) {
exists = 1;
break;
@@ -684,7 +704,7 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend
}
} else {
while (attr) {
- if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && !xmlStrcmp(attr->name, Z_STRVAL_P(member)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) {
+ if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && !xmlStrcmp(attr->name, (xmlChar *)Z_STRVAL_P(member)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
exists = 1;
break;
}
@@ -706,7 +726,7 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend
while (node) {
xmlNodePtr nnext;
nnext = node->next;
- if (!xmlStrcmp(node->name, Z_STRVAL_P(member))) {
+ if (!xmlStrcmp(node->name, (xmlChar *)Z_STRVAL_P(member))) {
break;
}
node = nnext;
@@ -793,7 +813,7 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
int nodendx = 0;
while (attr && nodendx <= Z_LVAL_P(member)) {
- if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) {
+ if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
if (nodendx == Z_LVAL_P(member)) {
xmlUnlinkNode((xmlNodePtr) attr);
php_libxml_node_free_resource((xmlNodePtr) attr TSRMLS_CC);
@@ -806,7 +826,7 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
} else {
while (attr) {
anext = attr->next;
- if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && !xmlStrcmp(attr->name, Z_STRVAL_P(member)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix)) {
+ if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && !xmlStrcmp(attr->name, (xmlChar *)Z_STRVAL_P(member)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
xmlUnlinkNode((xmlNodePtr) attr);
php_libxml_node_free_resource((xmlNodePtr) attr TSRMLS_CC);
break;
@@ -833,7 +853,7 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
SKIP_TEXT(node);
- if (!xmlStrcmp(node->name, Z_STRVAL_P(member))) {
+ if (!xmlStrcmp(node->name, (xmlChar *)Z_STRVAL_P(member))) {
xmlUnlinkNode(node);
php_libxml_node_free_resource(node TSRMLS_CC);
}
@@ -879,7 +899,7 @@ static inline char * sxe_xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, in
/* {{{ _get_base_node_value()
*/
-static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval **value, char *prefix TSRMLS_DC)
+static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval **value, xmlChar *nsprefix, int isprefix TSRMLS_DC)
{
php_sxe_object *subnode;
xmlChar *contents;
@@ -889,15 +909,16 @@ static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval
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);
+ ZVAL_STRING(*value, (char *)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);
+ if (nsprefix && *nsprefix) {
+ subnode->iter.nsprefix = xmlStrdup((xmlChar *)nsprefix);
+ subnode->iter.isprefix = isprefix;
}
php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL TSRMLS_CC);
@@ -958,6 +979,9 @@ static HashTable * sxe_properties_get(zval *object TSRMLS_DC)
}
GET_NODE(sxe, node);
+ if (!node) {
+ return rv;
+ }
if (1||sxe->iter.type != SXE_ITER_CHILD) {
if (sxe->iter.type == SXE_ITER_ELEMENT) {
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
@@ -966,7 +990,7 @@ static HashTable * sxe_properties_get(zval *object TSRMLS_DC)
zattr = NULL;
test = sxe->iter.name && sxe->iter.type == SXE_ITER_ATTRLIST;
while (attr) {
- if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr)attr, sxe->iter.nsprefix)) {
+ if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr)attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
MAKE_STD_ZVAL(value);
ZVAL_STRING(value, sxe_xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, attr->children, 1), 0);
namelen = xmlStrlen(attr->name) + 1;
@@ -1005,7 +1029,7 @@ static HashTable * sxe_properties_get(zval *object TSRMLS_DC)
}
}
- if (node->type == XML_ELEMENT_NODE && (! match_ns(sxe, node, sxe->iter.nsprefix))) {
+ if (node->type == XML_ELEMENT_NODE && (! match_ns(sxe, node, sxe->iter.nsprefix, sxe->iter.isprefix))) {
goto next_iter;
}
@@ -1016,7 +1040,7 @@ static HashTable * sxe_properties_get(zval *object TSRMLS_DC)
namelen = xmlStrlen(node->name) + 1;
}
- _get_base_node_value(sxe, node, &value, sxe->iter.nsprefix TSRMLS_CC);
+ _get_base_node_value(sxe, node, &value, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
sxe_properties_add(rv, name, namelen, value TSRMLS_CC);
next_iter:
@@ -1049,7 +1073,7 @@ static int sxe_objects_compare(zval *object1, zval *object2 TSRMLS_DC) /* {{{ */
}
/* }}} */
-/* {{{ array SimpleXMLElement::xpath(string path)
+/* {{{ proto array SimpleXMLElement::xpath(string path)
Runs XPath query on the XML data */
SXE_METHOD(xpath)
{
@@ -1093,7 +1117,7 @@ SXE_METHOD(xpath)
sxe->xpath->namespaces = ns;
sxe->xpath->nsNr = nsnbr;
- retval = xmlXPathEval(query, sxe->xpath);
+ retval = xmlXPathEval((xmlChar *)query, sxe->xpath);
if (ns != NULL) {
xmlFree(ns);
sxe->xpath->namespaces = NULL;
@@ -1122,11 +1146,11 @@ SXE_METHOD(xpath)
* to the parent node.
*/
if (nodeptr->type == XML_TEXT_NODE) {
- _node_as_zval(sxe, nodeptr->parent, value, SXE_ITER_NONE, NULL, NULL TSRMLS_CC);
+ _node_as_zval(sxe, nodeptr->parent, value, SXE_ITER_NONE, NULL, NULL, 0 TSRMLS_CC);
} else if (nodeptr->type == XML_ATTRIBUTE_NODE) {
- _node_as_zval(sxe, nodeptr->parent, value, SXE_ITER_ATTRLIST, (char*)nodeptr->name, NULL TSRMLS_CC);
+ _node_as_zval(sxe, nodeptr->parent, value, SXE_ITER_ATTRLIST, (char*)nodeptr->name, NULL, 0 TSRMLS_CC);
} else {
- _node_as_zval(sxe, nodeptr, value, SXE_ITER_NONE, NULL, NULL TSRMLS_CC);
+ _node_as_zval(sxe, nodeptr, value, SXE_ITER_NONE, NULL, NULL, 0 TSRMLS_CC);
}
add_next_index_zval(return_value, value);
@@ -1136,6 +1160,8 @@ SXE_METHOD(xpath)
xmlXPathFreeObject(retval);
}
+/* {{{ proto bool SimpleXMLElement::registerXPathNamespace(string prefix, string ns)
+ Creates a prefix/ns context for the next XPath query */
SXE_METHOD(registerXPathNamespace)
{
php_sxe_object *sxe;
@@ -1151,7 +1177,7 @@ SXE_METHOD(registerXPathNamespace)
sxe->xpath = xmlXPathNewContext((xmlDocPtr) sxe->document->ptr);
}
- if (xmlXPathRegisterNs(sxe->xpath, prefix, ns_uri) != 0) {
+ if (xmlXPathRegisterNs(sxe->xpath, (xmlChar *)prefix, (xmlChar *)ns_uri) != 0) {
RETURN_FALSE
}
RETURN_TRUE;
@@ -1186,7 +1212,13 @@ SXE_METHOD(asXML)
if (node) {
if (XML_DOCUMENT_NODE == node->parent->type) {
- xmlSaveFile(filename, (xmlDocPtr) sxe->document->ptr);
+ int bytes;
+ bytes = xmlSaveFile(filename, (xmlDocPtr) sxe->document->ptr);
+ if (bytes == -1) {
+ RETURN_FALSE;
+ } else {
+ RETURN_TRUE;
+ }
} else {
outbuf = xmlOutputBufferCreateFilename(filename, NULL, 0);
@@ -1194,7 +1226,7 @@ SXE_METHOD(asXML)
RETURN_FALSE;
}
- xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 1, NULL);
+ xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, NULL);
xmlOutputBufferClose(outbuf);
RETURN_TRUE;
}
@@ -1210,6 +1242,8 @@ SXE_METHOD(asXML)
if (node) {
if (XML_DOCUMENT_NODE == node->parent->type) {
xmlDocDumpMemory((xmlDocPtr) sxe->document->ptr, &strval, &strval_len);
+ RETVAL_STRINGL((char *)strval, strval_len, 1);
+ xmlFree(strval);
} else {
/* Should we be passing encoding information instead of NULL? */
outbuf = xmlAllocOutputBuffer(NULL);
@@ -1218,14 +1252,11 @@ SXE_METHOD(asXML)
RETURN_FALSE;
}
- xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 1, ((xmlDocPtr) sxe->document->ptr)->encoding);
+ xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, ((xmlDocPtr) sxe->document->ptr)->encoding);
xmlOutputBufferFlush(outbuf);
- strval = xmlStrndup(outbuf->buffer->content, outbuf->buffer->use);
+ RETVAL_STRINGL((char *)outbuf->buffer->content, outbuf->buffer->use, 1);
xmlOutputBufferClose(outbuf);
}
-
- RETVAL_STRINGL(strval, strlen(strval), 1);
- xmlFree(strval);
} else {
RETVAL_FALSE;
}
@@ -1340,7 +1371,7 @@ SXE_METHOD(getDocNamespaces)
}
/* }}} */
-/* {{{ proto object SimpleXMLElement::children([string ns])
+/* {{{ proto object SimpleXMLElement::children([string ns [, bool is_prefix]])
Finds children of given node */
SXE_METHOD(children)
{
@@ -1348,8 +1379,9 @@ SXE_METHOD(children)
char *nsprefix = NULL;
int nsprefix_len;
xmlNodePtr node;
+ zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &nsprefix, &nsprefix_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
return;
}
@@ -1362,7 +1394,7 @@ SXE_METHOD(children)
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);
+ _node_as_zval(sxe, node, return_value, SXE_ITER_CHILD, NULL, (xmlChar *)nsprefix, isprefix TSRMLS_CC);
}
/* }}} */
@@ -1384,7 +1416,7 @@ SXE_METHOD(getName)
}
/* }}} */
-/* {{{ proto array SimpleXMLElement::attributes([string ns])
+/* {{{ proto array SimpleXMLElement::attributes([string ns [, bool is_prefix]])
Identifies an element's attributes */
SXE_METHOD(attributes)
{
@@ -1392,8 +1424,9 @@ SXE_METHOD(attributes)
char *nsprefix = NULL;
int nsprefix_len;
xmlNodePtr node;
+ zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &nsprefix, &nsprefix_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
return;
}
@@ -1406,11 +1439,11 @@ SXE_METHOD(attributes)
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
- _node_as_zval(sxe, node, return_value, SXE_ITER_ATTRLIST, NULL, nsprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, return_value, SXE_ITER_ATTRLIST, NULL, (xmlChar *)nsprefix, isprefix TSRMLS_CC);
}
/* }}} */
-/* {{{ proto void SimpleXMLElement::addChild(string qName [, string value [,string ns]])
+/* {{{ proto void SimpleXMLElement::addChild(string qName [, string value [, string ns]])
Add Element with optional namespace information */
SXE_METHOD(addChild)
{
@@ -1441,23 +1474,22 @@ SXE_METHOD(addChild)
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
- localname = xmlSplitQName2(qname, &prefix);
+ localname = xmlSplitQName2((xmlChar *)qname, &prefix);
if (localname == NULL) {
- localname = xmlStrdup(qname);
+ localname = xmlStrdup((xmlChar *)qname);
}
-
- newnode = xmlNewChild(node, NULL, localname, value);
+ newnode = xmlNewChild(node, NULL, localname, (xmlChar *)value);
if (nsuri != NULL) {
- nsptr = xmlSearchNsByHref(node->doc, node, nsuri);
+ nsptr = xmlSearchNsByHref(node->doc, node, (xmlChar *)nsuri);
if (nsptr == NULL) {
- nsptr = xmlNewNs(newnode, nsuri, prefix);
+ nsptr = xmlNewNs(newnode, (xmlChar *)nsuri, prefix);
}
newnode->ns = nsptr;
}
- _node_as_zval(sxe, newnode, return_value, SXE_ITER_NONE, localname, prefix TSRMLS_CC);
+ _node_as_zval(sxe, newnode, return_value, SXE_ITER_NONE, (char *)localname, prefix, 0 TSRMLS_CC);
xmlFree(localname);
if (prefix != NULL) {
@@ -1502,12 +1534,12 @@ SXE_METHOD(addAttribute)
return;
}
- localname = xmlSplitQName2(qname, &prefix);
+ localname = xmlSplitQName2((xmlChar *)qname, &prefix);
if (localname == NULL) {
- localname = xmlStrdup(qname);
+ localname = xmlStrdup((xmlChar *)qname);
}
- attrp = xmlHasNsProp(node, localname, nsuri);
+ attrp = xmlHasNsProp(node, localname, (xmlChar *)nsuri);
if (attrp != NULL && attrp->type != XML_ATTRIBUTE_DECL) {
xmlFree(localname);
if (prefix != NULL) {
@@ -1518,13 +1550,13 @@ SXE_METHOD(addAttribute)
}
if (nsuri != NULL) {
- nsptr = xmlSearchNsByHref(node->doc, node, nsuri);
+ nsptr = xmlSearchNsByHref(node->doc, node, (xmlChar *)nsuri);
if (nsptr == NULL) {
- nsptr = xmlNewNs(node, nsuri, prefix);
+ nsptr = xmlNewNs(node, (xmlChar *)nsuri, prefix);
}
}
- attrp = xmlNewNsProp(node, nsptr, localname, value);
+ attrp = xmlNewNsProp(node, nsptr, localname, (xmlChar *)value);
xmlFree(localname);
if (prefix != NULL) {
@@ -1567,23 +1599,19 @@ static int cast_object(zval *object, int type, char *contents TSRMLS_DC)
/* {{{ sxe_object_cast()
*/
-static int sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC)
+static int sxe_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
{
php_sxe_object *sxe;
- char *contents = NULL;
+ xmlChar *contents = NULL;
xmlNodePtr node;
- int rv, empty;
+ int rv;
sxe = php_sxe_fetch_object(readobj TSRMLS_CC);
-
+
if (type == IS_BOOL) {
node = php_sxe_get_first_node(sxe, NULL TSRMLS_CC);
- empty = node == NULL && zend_hash_num_elements(sxe_properties_get(readobj TSRMLS_CC)) == 0;
- if (should_free) {
- zval_dtor(readobj);
- }
INIT_PZVAL(writeobj);
- ZVAL_BOOL(writeobj, !empty);
+ ZVAL_BOOL(writeobj, node != NULL || zend_hash_num_elements(sxe_properties_get(readobj TSRMLS_CC)) > 0);
return SUCCESS;
}
@@ -1606,11 +1634,7 @@ static int sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_f
}
}
- if (should_free) {
- zval_dtor(readobj);
- }
-
- rv = cast_object(writeobj, type, contents TSRMLS_CC);
+ rv = cast_object(writeobj, type, (char *)contents TSRMLS_CC);
if (contents) {
xmlFree(contents);
@@ -1639,7 +1663,6 @@ static int sxe_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */
node = php_sxe_iterator_fetch(sxe, node->next, 0 TSRMLS_CC);
}
-
if (sxe->iter.data) {
zval_ptr_dtor(&sxe->iter.data);
}
@@ -1655,7 +1678,7 @@ static zval *sxe_get_value(zval *z TSRMLS_DC)
MAKE_STD_ZVAL(retval);
- if (sxe_object_cast(z, retval, IS_STRING, 0 TSRMLS_CC)==FAILURE) {
+ 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 */
}
@@ -1870,7 +1893,7 @@ sxe_object_new(zend_class_entry *ce TSRMLS_DC)
}
/* }}} */
-/* {{{ proto simplemxml_element simplexml_load_file(string filename [, string class_name [, int options]])
+/* {{{ proto simplemxml_element simplexml_load_file(string filename [, string class_name [, int options [, string ns [, bool is_prefix]]]])
Load a filename and return a simplexml_element object to allow for processing */
PHP_FUNCTION(simplexml_load_file)
{
@@ -1878,12 +1901,13 @@ PHP_FUNCTION(simplexml_load_file)
char *filename;
int filename_len;
xmlDocPtr docp;
- char *classname = "";
- int classname_len = 0;
+ char *ns = NULL;
+ int ns_len = 0;
long options = 0;
zend_class_entry *ce= sxe_class_entry;
+ zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &filename, &filename_len, &classname, &classname_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|C!lsb", &filename, &filename_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
return;
}
@@ -1893,15 +1917,12 @@ PHP_FUNCTION(simplexml_load_file)
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;
+ if (!ce) {
+ ce = sxe_class_entry;
}
-
sxe = php_sxe_object_new(ce TSRMLS_CC);
+ sxe->iter.nsprefix = ns_len ? xmlStrdup((xmlChar *)ns) : NULL;
+ sxe->iter.isprefix = isprefix;
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);
@@ -1910,7 +1931,7 @@ PHP_FUNCTION(simplexml_load_file)
}
/* }}} */
-/* {{{ proto simplemxml_element simplexml_load_string(string data [, string class_name [, int options]])
+/* {{{ proto simplemxml_element simplexml_load_string(string data [, string class_name [, int options [, string ns [, bool is_prefix]]]])
Load a string and return a simplexml_element object to allow for processing */
PHP_FUNCTION(simplexml_load_string)
{
@@ -1918,12 +1939,13 @@ PHP_FUNCTION(simplexml_load_string)
char *data;
int data_len;
xmlDocPtr docp;
- char *classname = "";
- int classname_len = 0;
+ char *ns = NULL;
+ int ns_len = 0;
long options = 0;
zend_class_entry *ce= sxe_class_entry;
+ zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &data, &data_len, &classname, &classname_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|C!lsb", &data, &data_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
return;
}
@@ -1933,15 +1955,12 @@ PHP_FUNCTION(simplexml_load_string)
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;
+ if (!ce) {
+ ce = sxe_class_entry;
}
-
sxe = php_sxe_object_new(ce TSRMLS_CC);
+ sxe->iter.nsprefix = ns_len ? xmlStrdup((xmlChar *)ns) : NULL;
+ sxe->iter.isprefix = isprefix;
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);
@@ -1951,19 +1970,19 @@ PHP_FUNCTION(simplexml_load_string)
/* }}} */
-/* {{{ proto SimpleXMLElement::__construct(string data [, int options [, bool data_is_url]])
+/* {{{ proto SimpleXMLElement::__construct(string data [, int options [, bool data_is_url [, string ns [, bool is_prefix]]]])
SimpleXMLElement constructor */
SXE_METHOD(__construct)
{
php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC);
- char *data;
- int data_len;
+ char *data, *ns = NULL;
+ int data_len, ns_len = 0;
xmlDocPtr docp;
long options = 0;
- zend_bool is_url = 0;
+ zend_bool is_url = 0, isprefix = 0;
- php_set_error_handling(EH_THROW, zend_exception_get_default() TSRMLS_CC);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lb", &data, &data_len, &options, &is_url) == FAILURE) {
+ php_set_error_handling(EH_THROW, zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lbsb", &data, &data_len, &options, &is_url, &ns, &ns_len, &isprefix) == FAILURE) {
php_std_error_handling();
return;
}
@@ -1974,10 +1993,12 @@ SXE_METHOD(__construct)
if (!docp) {
((php_libxml_node_object *)sxe)->document = NULL;
- zend_throw_exception(zend_exception_get_default(), "String could not be parsed as XML", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(TSRMLS_C), "String could not be parsed as XML", 0 TSRMLS_CC);
return;
}
+ sxe->iter.nsprefix = ns_len ? xmlStrdup((xmlChar *)ns) : NULL;
+ sxe->iter.isprefix = isprefix;
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);
}
@@ -2002,18 +2023,19 @@ zend_object_iterator_funcs php_sxe_iterator_funcs = {
static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data TSRMLS_DC)
{
- char *prefix = sxe->iter.nsprefix;
+ xmlChar *prefix = sxe->iter.nsprefix;
+ int isprefix = sxe->iter.isprefix;
int test_elem = sxe->iter.type == SXE_ITER_ELEMENT && sxe->iter.name;
int test_attr = sxe->iter.type == SXE_ITER_ATTRLIST && sxe->iter.name;
while (node) {
SKIP_TEXT(node);
if (sxe->iter.type != SXE_ITER_ATTRLIST && node->type == XML_ELEMENT_NODE) {
- if ((!test_elem || !xmlStrcmp(node->name, sxe->iter.name)) && match_ns(sxe, node, prefix)) {
+ if ((!test_elem || !xmlStrcmp(node->name, sxe->iter.name)) && match_ns(sxe, node, prefix, isprefix)) {
break;
}
} else if (node->type == XML_ATTRIBUTE_NODE) {
- if ((!test_attr || !xmlStrcmp(node->name, sxe->iter.name)) && match_ns(sxe, node, prefix)) {
+ if ((!test_attr || !xmlStrcmp(node->name, sxe->iter.name)) && match_ns(sxe, node, prefix, isprefix)) {
break;
}
}
@@ -2023,7 +2045,7 @@ next_iter:
if (node && use_data) {
ALLOC_INIT_ZVAL(sxe->iter.data);
- _node_as_zval(sxe, node, sxe->iter.data, SXE_ITER_NONE, NULL, sxe->iter.nsprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, sxe->iter.data, SXE_ITER_NONE, NULL, prefix, isprefix TSRMLS_CC);
}
return node;
@@ -2055,9 +2077,14 @@ static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data TSRML
return NULL;
}
-zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC)
+zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
{
- php_sxe_iterator *iterator = emalloc(sizeof(php_sxe_iterator));
+ php_sxe_iterator *iterator;
+
+ if (by_ref) {
+ zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
+ }
+ iterator = emalloc(sizeof(php_sxe_iterator));
object->refcount++;
iterator->intern.data = (void*)object;
@@ -2112,7 +2139,7 @@ static int php_sxe_iterator_current_key(zend_object_iterator *iter, char **str_k
}
namelen = xmlStrlen(curnode->name);
- *str_key = estrndup(curnode->name, namelen);
+ *str_key = estrndup((char *)curnode->name, namelen);
*str_key_len = namelen + 1;
return HASH_KEY_IS_STRING;
@@ -2169,11 +2196,9 @@ PHP_FUNCTION(simplexml_import_dom)
zval *node;
php_libxml_node_object *object;
xmlNodePtr nodep = NULL;
- char *classname = "";
- int classname_len = 0;
zend_class_entry *ce= sxe_class_entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|s", &node, &classname, &classname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|C!", &node, &ce) == FAILURE) {
return;
}
@@ -2192,14 +2217,9 @@ PHP_FUNCTION(simplexml_import_dom)
}
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;
+ if (!ce) {
+ ce = sxe_class_entry;
}
-
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);
@@ -2249,6 +2269,7 @@ ZEND_GET_MODULE(simplexml)
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_MALIAS(saveXML, 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)
@@ -2310,7 +2331,7 @@ 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: 1.151.2.22 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.15 $");
php_info_print_table_row(2, "Schema support",
#ifdef LIBXML_SCHEMAS_ENABLED
"enabled");
diff --git a/ext/simplexml/tests/032.phpt b/ext/simplexml/tests/032.phpt
index 5c2225146..48bc887ec 100755
--- a/ext/simplexml/tests/032.phpt
+++ b/ext/simplexml/tests/032.phpt
@@ -39,7 +39,7 @@ var_dump($people2 == $people1);
?>
===DONE===
--EXPECTF--
-bool(true)
+bool(false)
bool(false)
bool(false)
===DONE===
diff --git a/ext/simplexml/tests/bug35785.phpt b/ext/simplexml/tests/bug35785.phpt
index de65a1956..096ab7a68 100755
--- a/ext/simplexml/tests/bug35785.phpt
+++ b/ext/simplexml/tests/bug35785.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #35785 (SimpleXML memory read error)
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
diff --git a/ext/simplexml/tests/bug36611.phpt b/ext/simplexml/tests/bug36611.phpt
index fdfed0d01..835e926fe 100644
--- a/ext/simplexml/tests/bug36611.phpt
+++ b/ext/simplexml/tests/bug36611.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #36611 (assignment to SimpleXML object attribute changes argument type to string)
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
diff --git a/ext/simplexml/tests/bug37565.phpt b/ext/simplexml/tests/bug37565.phpt
new file mode 100755
index 000000000..e04f9577f
--- /dev/null
+++ b/ext/simplexml/tests/bug37565.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Bug #37565 Using reflection::export with simplexml causing a crash
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php
+
+function my_error_handler($errno, $errstr, $errfile, $errline) {
+ echo "Error: $errstr\n";
+}
+
+set_error_handler('my_error_handler');
+
+class Setting extends ReflectionObject
+{
+}
+
+Reflection::export(simplexml_load_string('<test/>', 'Setting'));
+
+Reflection::export(simplexml_load_file('data:,<test/>', 'Setting'));
+
+?>
+===DONE===
+--EXPECTF--
+Error: simplexml_load_string() expects parameter 2 to be a class name derived from SimpleXMLElement, 'Setting' given
+Error: Argument 1 passed to Reflection::export() must implement interface Reflector, null given
+Error: Reflection::export() expects parameter 1 to be Reflector, null given
+Error: simplexml_load_file() expects parameter 2 to be a class name derived from SimpleXMLElement, 'Setting' given
+Error: Argument 1 passed to Reflection::export() must implement interface Reflector, null given
+Error: Reflection::export() expects parameter 1 to be Reflector, null given
+===DONE===
diff --git a/ext/simplexml/tests/bug38347.phpt b/ext/simplexml/tests/bug38347.phpt
new file mode 100644
index 000000000..c25fccea2
--- /dev/null
+++ b/ext/simplexml/tests/bug38347.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #38347 (Segmentation fault when using foreach with an unknown/empty SimpleXMLElement)
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php
+
+function iterate($xml)
+{
+ print_r($xml);
+ foreach ($xml->item as $item) {
+ echo "This code will crash!";
+ }
+}
+
+$xmlstr = "<xml><item>Item 1</item><item>Item 2</item></xml>";
+$xml = simplexml_load_string($xmlstr);
+iterate($xml->unknown);
+
+echo "Done\n";
+?>
+--EXPECTF--
+SimpleXMLElement Object
+(
+)
+
+Warning: iterate(): Node no longer exists in %s on line %d
+Done
diff --git a/ext/simplexml/tests/bug38354.phpt b/ext/simplexml/tests/bug38354.phpt
new file mode 100644
index 000000000..d2fcde11c
--- /dev/null
+++ b/ext/simplexml/tests/bug38354.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #38354 (Unwanted reformatting of XML when using AsXML)
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php
+
+$xml = simplexml_load_string(
+'<code>
+ <a href="javascript:alert(\'1\');"><strong>Item Two</strong></a>
+</code>'
+);
+
+foreach ($xml->xpath("//*") as $element) {
+ var_dump($element->asXML());
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(101) "<?xml version="1.0"?>
+<code>
+ <a href="javascript:alert('1');"><strong>Item Two</strong></a>
+</code>
+"
+string(62) "<a href="javascript:alert('1');"><strong>Item Two</strong></a>"
+string(25) "<strong>Item Two</strong>"
+Done
diff --git a/ext/simplexml/tests/bug38424.phpt b/ext/simplexml/tests/bug38424.phpt
new file mode 100644
index 000000000..baab45fe5
--- /dev/null
+++ b/ext/simplexml/tests/bug38424.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Bug #38424 (Different attribute assignment if new or exists)
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php
+
+$xml = simplexml_load_string('<xml></xml>');
+
+$str = "abc & def" ;
+
+$xml["a1"] = "" ;
+$xml["a1"] = htmlspecialchars($str,ENT_NOQUOTES) ;
+
+$xml["a2"] = htmlspecialchars($str,ENT_NOQUOTES) ;
+
+$xml["a3"] = "" ;
+$xml["a3"] = $str ;
+
+$xml["a4"] = $str ;
+
+echo $xml->asXML();
+?>
+--EXPECT--
+<?xml version="1.0"?>
+<xml a1="abc &amp;amp; def" a2="abc &amp;amp; def" a3="abc &amp; def" a4="abc &amp; def"/>
diff --git a/ext/simplexml/tests/profile12.phpt b/ext/simplexml/tests/profile12.phpt
new file mode 100755
index 000000000..51a0d3553
--- /dev/null
+++ b/ext/simplexml/tests/profile12.phpt
@@ -0,0 +1,74 @@
+--TEST--
+SimpleXML [profile]: Accessing namespaced root and non namespaced children
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php
+
+$xml =<<<EOF
+<?xml version="1.0" encoding="utf-8"?>
+<soap:Envelope
+xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+>
+<soap:Body>
+<businessList foo="bar">
+<businessInfo businessKey="bla"/>
+</businessList>
+</soap:Body>
+</soap:Envelope>
+EOF;
+
+$sxe = simplexml_load_string($xml);
+$nsl = $sxe->getNamespaces();
+var_dump($nsl);
+
+$sxe = simplexml_load_string($xml, NULL, 0, $nsl['soap']);
+var_dump($sxe->Body);
+var_dump($sxe->Body->children(''));
+var_dump($sxe->Body->children('')->businessList);
+
+?>
+===DONE===
+--EXPECTF--
+array(1) {
+ ["soap"]=>
+ string(41) "http://schemas.xmlsoap.org/soap/envelope/"
+}
+object(SimpleXMLElement)#%s (0) {
+}
+object(SimpleXMLElement)#%s (1) {
+ ["businessList"]=>
+ object(SimpleXMLElement)#%s (2) {
+ ["@attributes"]=>
+ array(1) {
+ ["foo"]=>
+ string(3) "bar"
+ }
+ ["businessInfo"]=>
+ object(SimpleXMLElement)#%s (1) {
+ ["@attributes"]=>
+ array(1) {
+ ["businessKey"]=>
+ string(3) "bla"
+ }
+ }
+ }
+}
+object(SimpleXMLElement)#%s (2) {
+ ["@attributes"]=>
+ array(1) {
+ ["foo"]=>
+ string(3) "bar"
+ }
+ ["businessInfo"]=>
+ object(SimpleXMLElement)#%s (1) {
+ ["@attributes"]=>
+ array(1) {
+ ["businessKey"]=>
+ string(3) "bla"
+ }
+ }
+}
+===DONE===
diff --git a/ext/simplexml/tests/profile13.phpt b/ext/simplexml/tests/profile13.phpt
new file mode 100755
index 000000000..2ae89e744
--- /dev/null
+++ b/ext/simplexml/tests/profile13.phpt
@@ -0,0 +1,75 @@
+--TEST--
+SimpleXML [profile]: Accessing by namespace prefix
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php
+
+$xml =<<<EOF
+<?xml version="1.0" encoding="utf-8"?>
+<soap:Envelope
+xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+>
+<soap:Body>
+<businessList foo="bar">
+<businessInfo businessKey="bla"/>
+</businessList>
+</soap:Body>
+</soap:Envelope>
+EOF;
+
+$sxe = simplexml_load_string($xml);
+var_dump($sxe->children('soap', 1));
+
+$sxe = simplexml_load_string($xml, NULL, 0, 'soap', 1);
+var_dump($sxe->Body);
+var_dump($sxe->Body->children(''));
+var_dump($sxe->Body->children('')->businessList);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+object(SimpleXMLElement)#%d (1) {
+ ["Body"]=>
+ object(SimpleXMLElement)#%d (0) {
+ }
+}
+object(SimpleXMLElement)#%d (0) {
+}
+object(SimpleXMLElement)#%d (1) {
+ ["businessList"]=>
+ object(SimpleXMLElement)#%d (2) {
+ ["@attributes"]=>
+ array(1) {
+ ["foo"]=>
+ string(3) "bar"
+ }
+ ["businessInfo"]=>
+ object(SimpleXMLElement)#%d (1) {
+ ["@attributes"]=>
+ array(1) {
+ ["businessKey"]=>
+ string(3) "bla"
+ }
+ }
+ }
+}
+object(SimpleXMLElement)#%d (2) {
+ ["@attributes"]=>
+ array(1) {
+ ["foo"]=>
+ string(3) "bar"
+ }
+ ["businessInfo"]=>
+ object(SimpleXMLElement)#%d (1) {
+ ["@attributes"]=>
+ array(1) {
+ ["businessKey"]=>
+ string(3) "bla"
+ }
+ }
+}
+===DONE===
diff --git a/ext/simplexml/tests/simplexml_import_dom.phpt b/ext/simplexml/tests/simplexml_import_dom.phpt
index 76e7f041d..e108e0554 100755
--- a/ext/simplexml/tests/simplexml_import_dom.phpt
+++ b/ext/simplexml/tests/simplexml_import_dom.phpt
@@ -1,8 +1,8 @@
--TEST--
SimpleXML [interop]: simplexml_import_dom
--SKIPIF--
-<?php if (!extension_loaded("simplexml")) print "skip"; ?>
-<?php if (!extension_loaded("dom")) print "skip. dom extension not loaded"; ?>
+<?php if (!extension_loaded("simplexml")) die("skip"); ?>
+<?php if (!extension_loaded("dom")) die("skip dom extension not loaded"); ?>
--FILE--
<?php
$dom = new domDocument;
diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c
index a5cf506f6..ae07e5373 100644
--- a/ext/skeleton/skeleton.c
+++ b/ext/skeleton/skeleton.c
@@ -77,7 +77,6 @@ static void php_extname_init_globals(zend_extname_globals *extname_globals)
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;
diff --git a/ext/snmp/php_snmp.h b/ext/snmp/php_snmp.h
index f362c2fdb..0d35b3fff 100644
--- a/ext/snmp/php_snmp.h
+++ b/ext/snmp/php_snmp.h
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_snmp.h,v 1.25.2.1 2006/01/01 12:50:13 sniper Exp $ */
+/* $Id: php_snmp.h,v 1.25.2.1.2.1 2006/07/27 05:17:34 sniper Exp $ */
#ifndef PHP_SNMP_H
#define PHP_SNMP_H
@@ -49,7 +49,7 @@ 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(snmp_set_oid_output_format);
PHP_FUNCTION(snmpset);
PHP_FUNCTION(snmp2_get);
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 63c32d8ca..c39464fb6 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: snmp.c,v 1.106.2.2 2006/01/01 12:50:13 sniper Exp $ */
+/* $Id: snmp.c,v 1.106.2.2.2.3 2006/07/27 05:17:34 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -107,6 +107,7 @@
#define SNMP_VALUE_OBJECT 2
ZEND_DECLARE_MODULE_GLOBALS(snmp)
+static PHP_GINIT_FUNCTION(snmp);
/* constant - can be shared among threads */
static oid objid_mib[] = {1, 3, 6, 1, 2, 1};
@@ -123,7 +124,8 @@ zend_function_entry snmp_functions[] = {
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)
+ PHP_FE(snmp_set_oid_output_format, NULL)
+ PHP_FALIAS(snmp_set_oid_numeric_print, snmp_set_oid_output_format, NULL)
#endif
PHP_FE(snmpset, NULL)
@@ -164,7 +166,11 @@ zend_module_entry snmp_module_entry = {
NULL,
PHP_MINFO(snmp),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(snmp),
+ PHP_GINIT(snmp),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
@@ -174,9 +180,9 @@ ZEND_GET_MODULE(snmp)
/* THREAD_LS snmp_module php_snmp_module; - may need one of these at some point */
-/* {{{ php_snmp_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
-static void php_snmp_init_globals(zend_snmp_globals *snmp_globals)
+static PHP_GINIT_FUNCTION(snmp)
{
snmp_globals->valueretrieval = 0;
}
@@ -193,7 +199,10 @@ PHP_MINIT_FUNCTION(snmp)
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);
+#ifdef HAVE_NET_SNMP
+ REGISTER_LONG_CONSTANT("SNMP_OID_OUTPUT_FULL", NETSNMP_OID_OUTPUT_FULL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SNMP_OID_OUTPUT_NUMERIC", NETSNMP_OID_OUTPUT_NUMERIC, CONST_CS | CONST_PERSISTENT);
+#endif
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);
@@ -429,13 +438,13 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
RETURN_FALSE;
}
} else if (st >= SNMP_CMD_WALK) {
- if (session->version == SNMP_VERSION_1) {
+ 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);
}
@@ -519,6 +528,9 @@ retry:
}
}
snmp_close(ss);
+ if (st == SNMP_CMD_WALK || st == SNMP_CMD_REALWALK) {
+ zval_dtor(return_value);
+ }
RETURN_FALSE;
}
}
@@ -728,9 +740,9 @@ PHP_FUNCTION(snmp_set_enum_print)
}
/* }}} */
-/* {{{ 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)
+/* {{{ proto void snmp_set_oid_output_format(int oid_format)
+ Set the OID output format. */
+PHP_FUNCTION(snmp_set_oid_output_format)
{
int argc = ZEND_NUM_ARGS();
long a1;
@@ -738,11 +750,20 @@ PHP_FUNCTION(snmp_set_oid_numeric_print)
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);
+
+ switch ((int) a1) {
+ case 0:
+ case NETSNMP_OID_OUTPUT_FULL:
+ a1 = NETSNMP_OID_OUTPUT_FULL;
+ break;
+
+ default:
+ case NETSNMP_OID_OUTPUT_NUMERIC:
+ a1 = NETSNMP_OID_OUTPUT_NUMERIC;
+ break;
}
+
+ netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT, a1);
}
/* }}} */
#endif
@@ -831,10 +852,14 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T
*
* 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.
+*
+* However, in 5.2 the type of usmAES128PrivProtocol is a pointer, not an
+* array, so we cannot use the OIDSIZE macro because it uses sizeof().
+*
*/
|| !strcasecmp(prot, "AES")) {
s->securityPrivProto = usmAES128PrivProtocol;
- s->securityPrivProtoLen = OIDSIZE(usmAES128PrivProtocol);
+ s->securityPrivProtoLen = USM_PRIV_PROTO_AES128_LEN;
return (0);
#else
) {
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index a86a11acf..8553dd0c1 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_encoding.c,v 1.103.2.21 2006/04/17 16:08:08 andrei Exp $ */
+/* $Id: php_encoding.c,v 1.103.2.21.2.13 2006/10/24 05:20:50 dmitry Exp $ */
#include <time.h>
@@ -88,6 +88,10 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *out_typ
static xmlNodePtr check_and_resolve_href(xmlNodePtr data);
+static void set_ns_prop(xmlNodePtr node, char *ns, char *name, char *val);
+static void set_xsi_nil(xmlNodePtr node);
+static void set_xsi_type(xmlNodePtr node, char *type);
+
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);
@@ -113,7 +117,7 @@ static void set_ns_and_type(xmlNodePtr node, encodeTypePtr type);
{ \
if (!zval || Z_TYPE_P(zval) == IS_NULL) { \
if (style == SOAP_ENCODED) {\
- xmlSetProp(xml, "xsi:nil", "true"); \
+ set_xsi_nil(xml); \
} \
return xml; \
} \
@@ -214,7 +218,7 @@ encode defaultEncoding[] = {
int numDefaultEncodings = sizeof(defaultEncoding)/sizeof(encode);
-void whiteSpace_replace(char* str)
+void whiteSpace_replace(xmlChar* str)
{
while (*str != '\0') {
if (*str == '\x9' || *str == '\xA' || *str == '\xD') {
@@ -224,10 +228,10 @@ void whiteSpace_replace(char* str)
}
}
-void whiteSpace_collapse(char* str)
+void whiteSpace_collapse(xmlChar* str)
{
- char *pos;
- char old;
+ xmlChar *pos;
+ xmlChar old;
pos = str;
whiteSpace_replace(str);
@@ -283,13 +287,27 @@ xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr par
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_ex(SOAP_GLOBAL(sdl), Z_STRVAL_PP(zstype), Z_STRLEN_PP(zstype));
+ 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 {
+ zns = NULL;
+ enc = get_encoder_ex(SOAP_GLOBAL(sdl), Z_STRVAL_PP(zstype), Z_STRLEN_PP(zstype));
+ }
+ if (enc == NULL && SOAP_GLOBAL(typemap)) {
+ encodePtr *new_enc;
+ smart_str nscat = {0};
+
+ if (zns != NULL) {
+ smart_str_appendl(&nscat, Z_STRVAL_PP(zns), Z_STRLEN_PP(zns));
+ smart_str_appendc(&nscat, ':');
+ }
+ smart_str_appendl(&nscat, Z_STRVAL_PP(zstype), Z_STRLEN_PP(zstype));
+ smart_str_0(&nscat);
+ if (zend_hash_find(SOAP_GLOBAL(typemap), nscat.c, nscat.len + 1, (void**)&new_enc) == SUCCESS) {
+ enc = *new_enc;
}
+ smart_str_free(&nscat);
}
}
if (enc == NULL) {
@@ -307,9 +325,6 @@ xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr par
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 {
@@ -319,7 +334,7 @@ xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr par
}
if (zend_hash_find(ht, "enc_name", sizeof("enc_name"), (void **)&zname) == SUCCESS) {
- xmlNodeSetName(node, Z_STRVAL_PP(zname));
+ xmlNodeSetName(node, BAD_CAST(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));
@@ -362,15 +377,24 @@ xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr par
if (encode == NULL) {
encode = get_conversion(UNKNOWN_TYPE);
}
- if (encode->to_xml_before) {
- data = encode->to_xml_before(&encode->details, data);
+ if (SOAP_GLOBAL(typemap) && encode->details.type_str) {
+ smart_str nscat = {0};
+ encodePtr *new_enc;
+
+ if (encode->details.ns) {
+ smart_str_appends(&nscat, encode->details.ns);
+ smart_str_appendc(&nscat, ':');
+ }
+ smart_str_appends(&nscat, encode->details.type_str);
+ smart_str_0(&nscat);
+ if (zend_hash_find(SOAP_GLOBAL(typemap), nscat.c, nscat.len + 1, (void**)&new_enc) == SUCCESS) {
+ encode = *new_enc;
+ }
+ smart_str_free(&nscat);
}
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;
}
@@ -378,16 +402,52 @@ xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr par
static zval *master_to_zval_int(encodePtr encode, xmlNodePtr data)
{
zval *ret = NULL;
+ TSRMLS_FETCH();
+
+ if (SOAP_GLOBAL(typemap)) {
+ if (encode->details.type_str) {
+ smart_str nscat = {0};
+ encodePtr *new_enc;
- if (encode->to_zval_before) {
- data = encode->to_zval_before(&encode->details, data, 0);
+ if (encode->details.ns) {
+ smart_str_appends(&nscat, encode->details.ns);
+ smart_str_appendc(&nscat, ':');
+ }
+ smart_str_appends(&nscat, encode->details.type_str);
+ smart_str_0(&nscat);
+ if (zend_hash_find(SOAP_GLOBAL(typemap), nscat.c, nscat.len + 1, (void**)&new_enc) == SUCCESS) {
+ encode = *new_enc;
+ }
+ smart_str_free(&nscat);
+ } else {
+ xmlAttrPtr type_attr = get_attribute_ex(data->properties,"type", XSI_NAMESPACE);
+
+ if (type_attr != NULL) {
+ encodePtr *new_enc;
+ xmlNsPtr nsptr;
+ char *ns, *cptype;
+ smart_str nscat = {0};
+
+ parse_namespace(type_attr->children->content, &cptype, &ns);
+ nsptr = xmlSearchNs(data->doc, data, BAD_CAST(ns));
+ if (nsptr != NULL) {
+ smart_str_appends(&nscat, (char*)nsptr->href);
+ smart_str_appendc(&nscat, ':');
+ }
+ smart_str_appends(&nscat, cptype);
+ smart_str_0(&nscat);
+ efree(cptype);
+ if (ns) {efree(ns);}
+ if (zend_hash_find(SOAP_GLOBAL(typemap), nscat.c, nscat.len + 1, (void**)&new_enc) == SUCCESS) {
+ encode = *new_enc;
+ }
+ smart_str_free(&nscat);
+ }
+ }
}
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;
}
@@ -399,7 +459,7 @@ zval *master_to_zval(encodePtr encode, xmlNodePtr data)
if (encode == NULL) {
encode = get_conversion(UNKNOWN_TYPE);
} else {
- /* Use xsi:type if it is defined */
+ /* Use xsi:type if it is defined */
xmlAttrPtr type_attr = get_attribute_ex(data->properties,"type", XSI_NAMESPACE);
if (type_attr != NULL) {
@@ -426,125 +486,67 @@ zval *master_to_zval(encodePtr encode, xmlNodePtr data)
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;
+ xmlNodePtr ret = NULL;
+ zval *return_value;
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 (type && type->map && type->map->to_xml) {
+ MAKE_STD_ZVAL(return_value);
- if (Z_TYPE_P(ret) != IS_OBJECT) {
- soap_error0(E_ERROR, "Encoding: Error serializing object from to_xml_user");
+ if (call_user_function(EG(function_table), NULL, type->map->to_xml, return_value, 1, &data TSRMLS_CC) == FAILURE) {
+ soap_error0(E_ERROR, "Encoding: Error calling to_xml callback");
}
-
- 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);
+ if (Z_TYPE_P(return_value) == IS_STRING) {
+ xmlDocPtr doc = soap_xmlParseMemory(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value));
+ if (doc && doc->children) {
+ ret = xmlDocCopyNode(doc->children, parent->doc, 1);
+ }
+ xmlFreeDoc(doc);
}
- 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, &param 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(&param);
+ zval_ptr_dtor(&return_value);
}
- 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, &param 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(&param);
+ if (!ret) {
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
}
- 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, &param TSRMLS_CC) == FAILURE) {
- soap_error0(E_ERROR, "Encoding: Error calling to_zval");
- }
- zval_ptr_dtor(&param);
- efree(param);
+ xmlAddChild(parent, ret);
+ if (style == SOAP_ENCODED) {
+ set_ns_and_type(ret, type);
}
return ret;
}
-zval *to_zval_after_user(encodeTypePtr type, zval *data)
+zval *to_zval_user(encodeTypePtr type, xmlNodePtr node)
{
+ zval *return_value;
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");
- }
+ if (type && type->map && type->map->to_zval) {
+ xmlBufferPtr buf;
+ zval *data;
+ xmlNodePtr copy;
+
+ copy = xmlCopyNode(node, 1);
+ buf = xmlBufferCreate();
+ xmlNodeDump(buf, NULL, copy, 0, 0);
+ MAKE_STD_ZVAL(data);
+ ZVAL_STRING(data, (char*)xmlBufferContent(buf), 1);
+ xmlBufferFree(buf);
+ xmlFreeNode(copy);
+
+ ALLOC_INIT_ZVAL(return_value);
+
+ if (call_user_function(EG(function_table), NULL, type->map->to_zval, return_value, 1, &data TSRMLS_CC) == FAILURE) {
+ soap_error0(E_ERROR, "Encoding: Error calling from_xml callback");
+ }
+ zval_ptr_dtor(&data);
+ } else {
+ ALLOC_INIT_ZVAL(return_value);
}
- return data;
+ return return_value;
}
-#endif
/* TODO: get rid of "bogus".. ither by passing in the already created xmlnode or passing in the node name */
/* String encode/decode */
@@ -558,22 +560,22 @@ static zval *to_zval_string(encodeTypePtr type, xmlNodePtr data)
TSRMLS_FETCH();
if (SOAP_GLOBAL(encoding) != NULL) {
- xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, strlen(data->children->content));
+ xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, xmlStrlen(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);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
}
xmlBufferFree(out);
xmlBufferFree(in);
} else {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
}
} else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
@@ -594,22 +596,22 @@ static zval *to_zval_stringr(encodeTypePtr type, xmlNodePtr data)
whiteSpace_replace(data->children->content);
if (SOAP_GLOBAL(encoding) != NULL) {
- xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, strlen(data->children->content));
+ xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, xmlStrlen(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);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
}
xmlBufferFree(out);
xmlBufferFree(in);
} else {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
}
} else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
@@ -630,22 +632,22 @@ static zval *to_zval_stringc(encodeTypePtr type, xmlNodePtr data)
whiteSpace_collapse(data->children->content);
if (SOAP_GLOBAL(encoding) != NULL) {
- xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, strlen(data->children->content));
+ xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, xmlStrlen(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);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
}
xmlBufferFree(out);
xmlBufferFree(in);
} else {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
}
} else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
@@ -665,7 +667,7 @@ static zval *to_zval_base64(encodeTypePtr type, xmlNodePtr data)
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);
+ whiteSpace_collapse(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) {
@@ -691,7 +693,7 @@ static zval *to_zval_hexbin(encodeTypePtr type, xmlNodePtr data)
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);
+ whiteSpace_collapse(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;
@@ -726,23 +728,25 @@ static zval *to_zval_hexbin(encodeTypePtr type, xmlNodePtr data)
static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- xmlNodePtr ret;
+ xmlNodePtr ret, text;
char *str;
int new_len;
TSRMLS_FETCH();
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("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);
+ str = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data));
+ new_len = Z_STRLEN_P(data);
} 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);
+ str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
+ new_len = Z_STRLEN(tmp);
zval_dtor(&tmp);
}
@@ -753,18 +757,19 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNo
if (n >= 0) {
efree(str);
- str = estrdup(xmlBufferContent(out));
+ str = estrdup((char*)xmlBufferContent(out));
new_len = n;
- } else if (!php_libxml_xmlCheckUTF8(str)) {
+ } else if (!php_libxml_xmlCheckUTF8(BAD_CAST(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)) {
+ } else if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) {
soap_error1(E_ERROR, "Encoding: string '%s' is not a valid utf-8 string", str);
}
- xmlNodeSetContentLen(ret, str, new_len);
+ text = xmlNewTextLen(BAD_CAST(str), new_len);
+ xmlAddChild(ret, text);
efree(str);
if (style == SOAP_ENCODED) {
@@ -775,17 +780,18 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNo
static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- xmlNodePtr ret;
+ xmlNodePtr ret, text;
unsigned char *str;
int str_len;
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("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);
+ text = xmlNewTextLen(str, str_len);
+ xmlAddChild(ret, text);
efree(str);
} else {
zval tmp = *data;
@@ -793,7 +799,8 @@ static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNo
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);
+ text = xmlNewTextLen(str, str_len);
+ xmlAddChild(ret, text);
efree(str);
zval_dtor(&tmp);
}
@@ -807,12 +814,12 @@ static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNo
static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
static char hexconvtab[] = "0123456789ABCDEF";
- xmlNodePtr ret;
+ xmlNodePtr ret, text;
unsigned char *str;
zval tmp;
int i, j;
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
@@ -830,7 +837,8 @@ static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNo
}
str[j] = '\0';
- xmlNodeSetContentLen(ret, str, Z_STRLEN_P(data) * 2 * sizeof(char));
+ text = xmlNewTextLen(str, Z_STRLEN_P(data) * 2 * sizeof(char));
+ xmlAddChild(ret, text);
efree(str);
if (data == &tmp) {
zval_dtor(&tmp);
@@ -851,7 +859,7 @@ static zval *to_zval_double(encodeTypePtr type, xmlNodePtr data)
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));
+ ZVAL_DOUBLE(ret, atof((char*)data->children->content));
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
@@ -871,9 +879,9 @@ static zval *to_zval_long(encodeTypePtr type, xmlNodePtr data)
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);
+ ret->value.lval = strtol((char*)data->children->content, NULL, 0);
if (errno == ERANGE) { /* overflow */
- ret->value.dval = zend_strtod(data->children->content, NULL);
+ ret->value.dval = zend_strtod((char*)data->children->content, NULL);
ret->type = IS_DOUBLE;
} else {
ret->type = IS_LONG;
@@ -891,7 +899,7 @@ static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNode
{
xmlNodePtr ret;
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
@@ -899,7 +907,7 @@ static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNode
char s[256];
sprintf(s, "%0.0f",floor(Z_DVAL_P(data)));
- xmlNodeSetContent(ret, s);
+ xmlNodeSetContent(ret, BAD_CAST(s));
} else {
zval tmp = *data;
@@ -908,7 +916,7 @@ static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNode
convert_to_long(&tmp);
}
convert_to_string(&tmp);
- xmlNodeSetContentLen(ret, Z_STRVAL(tmp), Z_STRLEN(tmp));
+ xmlNodeSetContentLen(ret, BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp));
zval_dtor(&tmp);
}
@@ -923,7 +931,7 @@ static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNo
xmlNodePtr ret;
zval tmp;
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
@@ -933,7 +941,7 @@ static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNo
convert_to_double(&tmp);
}
convert_to_string(&tmp);
- xmlNodeSetContentLen(ret, Z_STRVAL(tmp), Z_STRLEN(tmp));
+ xmlNodeSetContentLen(ret, BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp));
zval_dtor(&tmp);
if (style == SOAP_ENCODED) {
@@ -951,12 +959,17 @@ static zval *to_zval_bool(encodeTypePtr type, xmlNodePtr data)
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) {
+ if (stricmp((char*)data->children->content, "true") == 0 ||
+ stricmp((char*)data->children->content, "t") == 0 ||
+ strcmp((char*)data->children->content, "1") == 0) {
ZVAL_BOOL(ret, 1);
- } else {
+ } else if (stricmp((char*)data->children->content, "false") == 0 ||
+ stricmp((char*)data->children->content, "f") == 0 ||
+ strcmp((char*)data->children->content, "0") == 0) {
ZVAL_BOOL(ret, 0);
+ } else {
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
+ convert_to_boolean(ret);
}
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
@@ -970,27 +983,15 @@ static zval *to_zval_bool(encodeTypePtr type, xmlNodePtr data)
static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret;
- zval tmp;
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("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");
+ if (zend_is_true(data)) {
+ xmlNodeSetContent(ret, BAD_CAST("true"));
} else {
- xmlNodeSetContent(ret, "false");
- }
-
- if (data == &tmp) {
- zval_dtor(&tmp);
+ xmlNodeSetContent(ret, BAD_CAST("false"));
}
if (style == SOAP_ENCODED) {
@@ -1012,10 +1013,10 @@ static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNode
{
xmlNodePtr ret;
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
if (style == SOAP_ENCODED) {
- xmlSetProp(ret, "xsi:nil", "true");
+ set_xsi_nil(ret);
}
return ret;
}
@@ -1139,18 +1140,18 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
node = check_and_resolve_href(node);
if (node && node->children && node->children->content) {
- if (model->u.element->fixed && strcmp(model->u.element->fixed,node->children->content) != 0) {
+ if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)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);
+ xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlNodeSetContent(dummy, BAD_CAST(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);
+ xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlNodeSetContent(dummy, BAD_CAST(model->u.element->def));
val = master_to_zval(model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else {
@@ -1164,18 +1165,18 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
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) {
+ if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)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);
+ xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlNodeSetContent(dummy, BAD_CAST(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);
+ xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlNodeSetContent(dummy, BAD_CAST(model->u.element->def));
val = master_to_zval(model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else {
@@ -1333,11 +1334,11 @@ static zval *to_zval_object_ex(encodeTypePtr type, xmlNodePtr data, zend_class_e
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;
+ char *str_val = NULL;
if (val && val->children && val->children->content) {
- str_val = val->children->content;
- if ((*attr)->fixed && strcmp((*attr)->fixed,str_val) != 0) {
+ str_val = (char*)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) {
@@ -1346,11 +1347,12 @@ static zval *to_zval_object_ex(encodeTypePtr type, xmlNodePtr data, zend_class_e
str_val = (*attr)->def;
}
if (str_val) {
- xmlNodePtr dummy;
+ xmlNodePtr dummy, text;
zval *data;
- dummy = xmlNewNode(NULL, "BOGUS");
- xmlNodeSetContent(dummy, str_val);
+ dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ text = xmlNewText(BAD_CAST(str_val));
+ xmlAddChild(dummy, text);
data = master_to_zval((*attr)->encode, dummy);
xmlFreeNode(dummy);
set_zval_property(ret, (*attr)->name, data TSRMLS_CC);
@@ -1426,22 +1428,17 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
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");
+ property = xmlNewNode(NULL, BAD_CAST("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");
- }
+ set_xsi_nil(property);
} 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) {
+ model->u.element->fixed && strcmp(model->u.element->fixed, (char*)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);
+ xmlNodeSetName(property, BAD_CAST(model->u.element->name));
if (style == SOAP_LITERAL &&
model->u.element->namens &&
model->u.element->form == XSD_FORM_QUALIFIED) {
@@ -1452,22 +1449,17 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
}
} else {
if (Z_TYPE_P(data) == IS_NULL && model->u.element->nillable) {
- property = xmlNewNode(NULL,"BOGUS");
+ property = xmlNewNode(NULL, BAD_CAST("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");
- }
+ set_xsi_nil(property);
} 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) {
+ model->u.element->fixed && strcmp(model->u.element->fixed, (char*)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);
+ xmlNodeSetName(property, BAD_CAST(model->u.element->name));
if (style == SOAP_LITERAL &&
model->u.element->namens &&
model->u.element->form == XSD_FORM_QUALIFIED) {
@@ -1477,14 +1469,9 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
}
return 1;
} else if (strict && model->u.element->nillable && model->min_occurs > 0) {
- property = xmlNewNode(NULL,model->u.element->name);
+ property = xmlNewNode(NULL, BAD_CAST(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");
- }
+ set_xsi_nil(property);
if (style == SOAP_LITERAL &&
model->u.element->namens &&
model->u.element->form == XSD_FORM_QUALIFIED) {
@@ -1616,10 +1603,10 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
TSRMLS_FETCH();
if (!data || Z_TYPE_P(data) == IS_NULL) {
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
if (style == SOAP_ENCODED) {
- xmlSetProp(xmlParam, "xsi:nil", "true");
+ set_xsi_nil(xmlParam);
}
return xmlParam;
}
@@ -1649,11 +1636,11 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
} else if (prop == NULL) {
xmlParam = master_to_xml(enc, data, style, parent);
} else {
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
}
} else {
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
}
} else if (sdlType->kind == XSD_TYPEKIND_EXTENSION &&
@@ -1674,12 +1661,12 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
} else if (prop == NULL) {
xmlParam = master_to_xml(sdlType->encode, data, style, parent);
} else {
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
}
}
} else {
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
}
@@ -1697,18 +1684,13 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
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");
+ property = xmlNewNode(NULL, BAD_CAST("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");
- }
+ set_xsi_nil(property);
} else {
property = master_to_xml(array_el->encode, *val, style, xmlParam);
}
- xmlNodeSetName(property, array_el->name);
+ xmlNodeSetName(property, BAD_CAST(array_el->name));
if (style == SOAP_LITERAL &&
array_el->namens &&
array_el->form == XSD_FORM_QUALIFIED) {
@@ -1734,7 +1716,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
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) {
+ if ((*attr)->fixed && strcmp((*attr)->fixed, (char*)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
@@ -1745,9 +1727,9 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
(*attr)->form == XSD_FORM_QUALIFIED)) {
xmlNsPtr nsp = encode_add_ns(xmlParam, (*attr)->namens);
- xmlSetNsProp(xmlParam, nsp, (*attr)->name, dummy->children->content);
+ xmlSetNsProp(xmlParam, nsp, BAD_CAST((*attr)->name), dummy->children->content);
} else {
- xmlSetProp(xmlParam, (*attr)->name, dummy->children->content);
+ xmlSetProp(xmlParam, BAD_CAST((*attr)->name), dummy->children->content);
}
}
xmlUnlinkNode(dummy);
@@ -1762,7 +1744,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
set_ns_and_type(xmlParam, type);
}
} else {
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
if (prop != NULL) {
@@ -1774,7 +1756,8 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
zval **zprop;
char *str_key;
ulong index;
- int key_type, str_key_len;
+ int key_type;
+ unsigned int str_key_len;
key_type = zend_hash_get_current_key_ex(prop, &str_key, &str_key_len, &index, FALSE, NULL);
zend_hash_get_current_data(prop, (void **)&zprop);
@@ -1787,12 +1770,12 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
if (Z_TYPE_P(data) == IS_OBJECT) {
char *class_name;
- zend_unmangle_property_name_ex(str_key, str_key_len, &class_name, &prop_name);
+ zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name);
} else {
prop_name = str_key;
}
if (prop_name) {
- xmlNodeSetName(property, prop_name);
+ xmlNodeSetName(property, BAD_CAST(prop_name));
}
}
zend_hash_move_forward(prop);
@@ -1946,17 +1929,17 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
xparam = master_to_xml(enc, (*zdata), style, xmlParam);
}
} else {
- xparam = xmlNewNode(NULL,"BOGUS");
+ xparam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(xmlParam, xparam);
}
if (type) {
- xmlNodeSetName(xparam, type->name);
+ xmlNodeSetName(xparam, BAD_CAST(type->name));
} else if (style == SOAP_LITERAL && enc && enc->details.type_str) {
- xmlNodeSetName(xparam, enc->details.type_str);
+ xmlNodeSetName(xparam, BAD_CAST(enc->details.type_str));
xmlSetNs(xparam, ns);
} else {
- xmlNodeSetName(xparam, "item");
+ xmlNodeSetName(xparam, BAD_CAST("item"));
}
} else {
if (zdata) {
@@ -1972,15 +1955,15 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
if (dimension == 1) {
xmlNodePtr xparam;
- xparam = xmlNewNode(NULL,"BOGUS");
+ xparam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(xmlParam, xparam);
if (type) {
- xmlNodeSetName(xparam, type->name);
+ xmlNodeSetName(xparam, BAD_CAST(type->name));
} else if (style == SOAP_LITERAL && enc && enc->details.type_str) {
- xmlNodeSetName(xparam, enc->details.type_str);
+ xmlNodeSetName(xparam, BAD_CAST(enc->details.type_str));
xmlSetNs(xparam, ns);
} else {
- xmlNodeSetName(xparam, "item");
+ xmlNodeSetName(xparam, BAD_CAST("item"));
}
} else {
add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style);
@@ -2013,7 +1996,7 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
soap_version = SOAP_GLOBAL(soap_version);
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
FIND_ZVAL_NULL(data, xmlParam, style);
@@ -2165,7 +2148,7 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
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);
+ set_ns_prop(xmlParam, SOAP_1_1_ENC_NAMESPACE, "arrayType", array_type.c);
} else {
int i = 0;
while (i < array_size.len) {
@@ -2174,8 +2157,8 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
}
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);
+ set_ns_prop(xmlParam, SOAP_1_2_ENC_NAMESPACE, "itemType", array_type.c);
+ set_ns_prop(xmlParam, SOAP_1_2_ENC_NAMESPACE, "arraySize", array_size.c);
}
}
smart_str_free(&array_type);
@@ -2217,7 +2200,7 @@ static zval *to_zval_array(encodeTypePtr type, xmlNodePtr data)
xmlNsPtr nsptr;
parse_namespace(attr->children->content, &type, &ns);
- nsptr = xmlSearchNs(attr->doc, attr->parent, ns);
+ nsptr = xmlSearchNs(attr->doc, attr->parent, BAD_CAST(ns));
end = strrchr(type,'[');
if (end) {
@@ -2226,7 +2209,7 @@ static zval *to_zval_array(encodeTypePtr type, xmlNodePtr data)
dims = get_position(dimension, end+1);
}
if (nsptr != NULL) {
- enc = get_encoder(SOAP_GLOBAL(sdl), nsptr->href, type);
+ enc = get_encoder(SOAP_GLOBAL(sdl), (char*)nsptr->href, type);
}
efree(type);
if (ns) {efree(ns);}
@@ -2238,17 +2221,17 @@ static zval *to_zval_array(encodeTypePtr type, xmlNodePtr data)
xmlNsPtr nsptr;
parse_namespace(attr->children->content, &type, &ns);
- nsptr = xmlSearchNs(attr->doc, attr->parent, ns);
+ nsptr = xmlSearchNs(attr->doc, attr->parent, BAD_CAST(ns));
if (nsptr != NULL) {
- enc = get_encoder(SOAP_GLOBAL(sdl), nsptr->href, type);
+ enc = get_encoder(SOAP_GLOBAL(sdl), (char*)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);
+ dimension = calc_dimension_12((char*)attr->children->content);
+ dims = get_position_12(dimension, (char*)attr->children->content);
} else {
dims = emalloc(sizeof(int));
*dims = 0;
@@ -2257,8 +2240,8 @@ static zval *to_zval_array(encodeTypePtr type, xmlNodePtr data)
} 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);
+ dimension = calc_dimension_12((char*)attr->children->content);
+ dims = get_position_12(dimension, (char*)attr->children->content);
} else if (type->sdl_type != NULL &&
type->sdl_type->attributes != NULL &&
@@ -2337,10 +2320,10 @@ static zval *to_zval_array(encodeTypePtr type, xmlNodePtr data)
if (data &&
(attr = get_attribute(data->properties,"offset")) &&
attr->children && attr->children->content) {
- char* tmp = strrchr(attr->children->content,'[');
+ char* tmp = strrchr((char*)attr->children->content,'[');
if (tmp == NULL) {
- tmp = attr->children->content;
+ tmp = (char*)attr->children->content;
}
get_position_ex(dimension, tmp, &pos);
}
@@ -2355,9 +2338,9 @@ static zval *to_zval_array(encodeTypePtr type, xmlNodePtr data)
tmpVal = master_to_zval(enc, trav);
if (position != NULL && position->children && position->children->content) {
- char* tmp = strrchr(position->children->content,'[');
+ char* tmp = strrchr((char*)position->children->content, '[');
if (tmp == NULL) {
- tmp = position->children->content;
+ tmp = (char*)position->children->content;
}
get_position_ex(dimension, tmp, &pos);
}
@@ -2409,7 +2392,7 @@ static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodeP
xmlNodePtr xmlParam;
int i;
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
FIND_ZVAL_NULL(data, xmlParam, style);
@@ -2421,35 +2404,35 @@ static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodeP
xmlNodePtr key;
zval **temp_data;
char *key_val;
- int int_val;
+ ulong 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");
+ item = xmlNewNode(NULL, BAD_CAST("item"));
xmlAddChild(xmlParam, item);
- key = xmlNewNode(NULL,"key");
+ key = xmlNewNode(NULL, BAD_CAST("key"));
xmlAddChild(item,key);
- if (zend_hash_get_current_key(data->value.ht, &key_val, (long *)&int_val, FALSE) == HASH_KEY_IS_STRING) {
+ if (zend_hash_get_current_key(data->value.ht, &key_val, &int_val, FALSE) == HASH_KEY_IS_STRING) {
if (style == SOAP_ENCODED) {
- xmlSetProp(key, "xsi:type", "xsd:string");
+ set_xsi_type(key, "xsd:string");
}
- xmlNodeSetContent(key, key_val);
+ xmlNodeSetContent(key, BAD_CAST(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");
+ set_xsi_type(key, "xsd:int");
}
- xmlNodeSetContentLen(key, tmp.c, tmp.len);
+ xmlNodeSetContentLen(key, BAD_CAST(tmp.c), tmp.len);
smart_str_free(&tmp);
}
xparam = master_to_xml(get_conversion((*temp_data)->type), (*temp_data), style, item);
- xmlNodeSetName(xparam, "value");
+ xmlNodeSetName(xparam, BAD_CAST("value"));
}
zend_hash_move_forward(data->value.ht);
}
@@ -2518,7 +2501,6 @@ static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, x
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);
}
*/
@@ -2529,7 +2511,7 @@ static zval *guess_zval_convert(encodeTypePtr type, xmlNodePtr data)
{
encodePtr enc = NULL;
xmlAttrPtr tmpattr;
- char *type_name = NULL;
+ xmlChar *type_name = NULL;
zval *ret;
TSRMLS_FETCH();
@@ -2598,7 +2580,7 @@ static zval *guess_zval_convert(encodeTypePtr type, xmlNodePtr data)
#endif
add_property_zval(soapvar, "enc_value", ret);
parse_namespace(type_name, &cptype, &ns);
- nsptr = xmlSearchNs(data->doc, data, ns);
+ nsptr = xmlSearchNs(data->doc, data, BAD_CAST(ns));
add_property_string(soapvar, "enc_stype", cptype, 1);
if (nsptr) {
add_property_string(soapvar, "enc_ns", (char*)nsptr->href, 1);
@@ -2623,7 +2605,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
xmlNodePtr xmlParam;
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
FIND_ZVAL_NULL(data, xmlParam, style);
@@ -2660,10 +2642,10 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
}
strcat(buf, tzbuf);
- xmlNodeSetContent(xmlParam, buf);
+ xmlNodeSetContent(xmlParam, BAD_CAST(buf));
efree(buf);
} else if (Z_TYPE_P(data) == IS_STRING) {
- xmlNodeSetContentLen(xmlParam, Z_STRVAL_P(data), Z_STRLEN_P(data));
+ xmlNodeSetContentLen(xmlParam, BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data));
}
if (style == SOAP_ENCODED) {
@@ -2737,7 +2719,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
}
}
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
if (Z_TYPE_P(data) == IS_ARRAY) {
@@ -2752,7 +2734,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
if (list.len != 0) {
smart_str_appendc(&list, ' ');
}
- smart_str_appends(&list, dummy->children->content);
+ smart_str_appends(&list, (char*)dummy->children->content);
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
@@ -2761,7 +2743,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
zend_hash_move_forward(ht);
}
smart_str_0(&list);
- xmlNodeSetContentLen(ret, list.c, list.len);
+ xmlNodeSetContentLen(ret, BAD_CAST(list.c), list.len);
smart_str_free(&list);
} else {
zval tmp = *data;
@@ -2774,7 +2756,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
data = &tmp;
}
str = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data));
- whiteSpace_collapse(str);
+ whiteSpace_collapse(BAD_CAST(str));
start = str;
while (start != NULL && *start != '\0') {
xmlNodePtr dummy;
@@ -2791,7 +2773,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
if (list.len != 0) {
smart_str_appendc(&list, ' ');
}
- smart_str_appends(&list, dummy->children->content);
+ smart_str_appends(&list, (char*)dummy->children->content);
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
@@ -2801,7 +2783,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
start = next;
}
smart_str_0(&list);
- xmlNodeSetContentLen(ret, list.c, list.len);
+ xmlNodeSetContentLen(ret, BAD_CAST(list.c), list.len);
smart_str_free(&list);
efree(str);
if (data == &tmp) {zval_dtor(&tmp);}
@@ -2842,17 +2824,16 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP
xmlNodePtr ret;
if (Z_TYPE_P(data) == IS_STRING) {
- ret = xmlNewTextLen(Z_STRVAL_P(data), Z_STRLEN_P(data));
- ret->name = xmlStringTextNoenc;
+ ret = xmlNewTextLen(BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data));
} else {
zval tmp = *data;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
- ret = xmlNewTextLen(Z_STRVAL(tmp), Z_STRLEN(tmp));
+ ret = xmlNewTextLen(BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp));
zval_dtor(&tmp);
- ret->name = xmlStringTextNoenc;
}
+ ret->name = xmlStringTextNoenc;
xmlAddChild(parent, ret);
return ret;
@@ -3008,7 +2989,7 @@ static xmlNodePtr check_and_resolve_href(xmlNodePtr data)
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]);
+ xmlNodePtr ret = get_node_with_attribute_recursive(data->doc->children, NULL, "id", (char*)&href->children->content[1]);
if (!ret) {
soap_error1(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content);
}
@@ -3021,7 +3002,7 @@ static xmlNodePtr check_and_resolve_href(xmlNodePtr data)
/* SOAP 1.2 enc:id enc:ref */
href = get_attribute_ex(data->properties, "ref", SOAP_1_2_ENC_NAMESPACE);
if (href) {
- char* id;
+ xmlChar* id;
xmlNodePtr ret;
if (href->children->content[0] == '#') {
@@ -3029,7 +3010,7 @@ static xmlNodePtr check_and_resolve_href(xmlNodePtr data)
} else {
id = href->children->content;
}
- ret = get_node_with_attribute_recursive_ex(data->doc->children, NULL, NULL, "id", id, SOAP_1_2_ENC_NAMESPACE);
+ ret = get_node_with_attribute_recursive_ex(data->doc->children, NULL, NULL, "id", (char*)id, SOAP_1_2_ENC_NAMESPACE);
if (!ret) {
soap_error1(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content);
} else if (ret == data) {
@@ -3050,10 +3031,47 @@ 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);
+ set_xsi_type(node, nstype.c);
smart_str_free(&nstype);
}
+static xmlNsPtr xmlSearchNsPrefixByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href)
+{
+ xmlNsPtr cur;
+ xmlNodePtr orig = node;
+
+ while (node) {
+ if (node->type == XML_ENTITY_REF_NODE ||
+ node->type == XML_ENTITY_NODE ||
+ node->type == XML_ENTITY_DECL) {
+ return NULL;
+ }
+ if (node->type == XML_ELEMENT_NODE) {
+ cur = node->nsDef;
+ while (cur != NULL) {
+ if (cur->prefix && cur->href && xmlStrEqual(cur->href, href)) {
+ if (xmlSearchNs(doc, node, cur->prefix) == cur) {
+ return cur;
+ }
+ }
+ cur = cur->next;
+ }
+ if (orig != node) {
+ cur = node->ns;
+ if (cur != NULL) {
+ if (cur->prefix && cur->href && xmlStrEqual(cur->href, href)) {
+ if (xmlSearchNs(doc, node, cur->prefix) == cur) {
+ return cur;
+ }
+ }
+ }
+ }
+ }
+ node = node->parent;
+ }
+ return NULL;
+}
+
xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns)
{
xmlNsPtr xmlns;
@@ -3062,27 +3080,55 @@ xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns)
return NULL;
}
- xmlns = xmlSearchNsByHref(node->doc,node,ns);
+ xmlns = xmlSearchNsByHref(node->doc, node, BAD_CAST(ns));
+ if (xmlns != NULL && xmlns->prefix == NULL) {
+ xmlns = xmlSearchNsPrefixByHref(node->doc, node, BAD_CAST(ns));
+ }
if (xmlns == NULL) {
- char* prefix;
+ xmlChar* 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);
+ xmlns = xmlNewNs(node->doc->children, BAD_CAST(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);
+ while (1) {
+ smart_str_appendl(&prefix, "ns", 2);
+ smart_str_append_long(&prefix, num);
+ smart_str_0(&prefix);
+ if (xmlSearchNs(node->doc, node, BAD_CAST(prefix.c)) == NULL) {
+ break;
+ }
+ smart_str_free(&prefix);
+ prefix.c = NULL;
+ prefix.len = 0;
+ num = ++SOAP_GLOBAL(cur_uniq_ns);
+ }
+
+ xmlns = xmlNewNs(node->doc->children, BAD_CAST(ns), BAD_CAST(prefix.c));
smart_str_free(&prefix);
}
}
return xmlns;
}
+static void set_ns_prop(xmlNodePtr node, char *ns, char *name, char *val)
+{
+ xmlSetNsProp(node, encode_add_ns(node, ns), BAD_CAST(name), BAD_CAST(val));
+}
+
+static void set_xsi_nil(xmlNodePtr node)
+{
+ set_ns_prop(node, XSI_NAMESPACE, "nil", "true");
+}
+
+static void set_xsi_type(xmlNodePtr node, char *type)
+{
+ set_ns_prop(node, XSI_NAMESPACE, "type", type);
+}
+
void encode_reset_ns()
{
TSRMLS_FETCH();
@@ -3095,26 +3141,8 @@ encodePtr get_conversion(int encode)
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;
- }
+ soap_error0(E_ERROR, "Encoding: Cannot find encoding");
+ return NULL;
} else {
return *enc;
}
@@ -3142,7 +3170,7 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type TS
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);
+ smart_str_appendl(type, "xsd:anyType", sizeof("xsd:anyType")-1);
return get_conversion(XSD_ANYTYPE);
}
@@ -3204,7 +3232,7 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type TS
}
if (different || count == 0) {
- smart_str_appendl(type, "xsd:anyType", 11);
+ smart_str_appendl(type, "xsd:anyType", sizeof("xsd:anyType")-1);
return get_conversion(XSD_ANYTYPE);
} else {
encodePtr enc;
@@ -3215,7 +3243,7 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type TS
if (cur_ns) {
xmlNsPtr ns = encode_add_ns(node,cur_ns);
- smart_str_appends(type, ns->prefix);
+ smart_str_appends(type, (char*)ns->prefix);
smart_str_appendc(type, ':');
smart_str_appends(&array_type, cur_ns);
smart_str_appendc(&array_type, ':');
@@ -3250,7 +3278,7 @@ static void get_type_str(xmlNodePtr node, const char* ns, const char* type, smar
ns = SOAP_1_1_ENC_NAMESPACE;
}
xmlns = encode_add_ns(node,ns);
- smart_str_appends(ret, xmlns->prefix);
+ smart_str_appends(ret, (char*)xmlns->prefix);
smart_str_appendc(ret, ':');
}
smart_str_appendl(ret, type, strlen(type));
@@ -3261,32 +3289,11 @@ static void delete_mapping(void *data)
{
soapMappingPtr map = (soapMappingPtr)data;
- if (map->ns) {
- efree(map->ns);
- }
- if (map->ctype) {
- efree(map->ctype);
+ if (map->to_xml) {
+ zval_ptr_dtor(&map->to_xml);
}
-
- 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);
- }
+ if (map->to_zval) {
+ zval_ptr_dtor(&map->to_zval);
}
efree(map);
}
diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h
index 8c339133e..aa27705ed 100644
--- a/ext/soap/php_encoding.h
+++ b/ext/soap/php_encoding.h
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_encoding.h,v 1.38.2.3 2006/04/17 16:08:08 andrei Exp $ */
+/* $Id: php_encoding.h,v 1.38.2.3.2.2 2006/09/20 13:42:50 dmitry Exp $ */
#ifndef PHP_ENCODING_H
#define PHP_ENCODING_H
@@ -185,30 +185,18 @@ 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);
+void whiteSpace_replace(xmlChar* str);
+void whiteSpace_collapse(xmlChar* str);
xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval* data, int style, xmlNodePtr parent);
zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data);
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index ab953c7cb..aef629f73 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_http.c,v 1.77.2.11 2006/04/13 08:18:36 dmitry Exp $ */
+/* $Id: php_http.c,v 1.77.2.11.2.3 2006/09/06 11:03:45 dmitry Exp $ */
#include "php_soap.h"
#include "ext/standard/base64.h"
@@ -60,7 +60,7 @@ 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;
+ unsigned char* buf;
int len;
smart_str auth = {0};
@@ -70,9 +70,9 @@ void proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC)
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);
+ buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len);
smart_str_append_const(soap_headers, "Proxy-Authorization: Basic ");
- smart_str_appendl(soap_headers, buf, len);
+ smart_str_appendl(soap_headers, (char*)buf, len);
smart_str_append_const(soap_headers, "\r\n");
efree(buf);
smart_str_free(&auth);
@@ -86,7 +86,7 @@ void basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC)
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;
+ unsigned char* buf;
int len;
smart_str auth = {0};
@@ -96,9 +96,9 @@ void basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC)
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);
+ buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len);
smart_str_append_const(soap_headers, "Authorization: Basic ");
- smart_str_appendl(soap_headers, buf, len);
+ smart_str_appendl(soap_headers, (char*)buf, len);
smart_str_append_const(soap_headers, "\r\n");
efree(buf);
smart_str_free(&auth);
@@ -237,6 +237,7 @@ int make_http_soap_request(zval *this_ptr,
int http_status;
int content_type_xml = 0;
char *content_encoding;
+ char *http_msg = NULL;
zend_bool old_allow_url_fopen;
if (this_ptr == NULL || Z_TYPE_P(this_ptr) != IS_OBJECT) {
@@ -400,6 +401,8 @@ try_again:
}
if (phpurl->path) {
smart_str_appends(&soap_headers, phpurl->path);
+ } else {
+ smart_str_appendc(&soap_headers, '/');
}
if (phpurl->query) {
smart_str_appendc(&soap_headers, '?');
@@ -469,7 +472,7 @@ try_again:
PHP_MD5Init(&md5ctx);
sprintf(cnonce, "%d", rand());
- PHP_MD5Update(&md5ctx, cnonce, strlen(cnonce));
+ PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, strlen(cnonce));
PHP_MD5Final(hash, &md5ctx);
make_digest(cnonce, hash);
@@ -483,16 +486,16 @@ try_again:
}
PHP_MD5Init(&md5ctx);
- PHP_MD5Update(&md5ctx, Z_STRVAL_PP(login), Z_STRLEN_PP(login));
- PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(login), Z_STRLEN_PP(login));
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 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, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
}
- PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 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_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(password), Z_STRLEN_PP(password));
}
PHP_MD5Final(hash, &md5ctx);
make_digest(HA1, hash);
@@ -501,26 +504,28 @@ try_again:
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);
+ PHP_MD5Update(&md5ctx, (unsigned char*)HA1, 32);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 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, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
}
- PHP_MD5Update(&md5ctx, ":", 1);
- PHP_MD5Update(&md5ctx, cnonce, 8);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, 8);
PHP_MD5Final(hash, &md5ctx);
make_digest(HA1, hash);
}
PHP_MD5Init(&md5ctx);
- PHP_MD5Update(&md5ctx, "POST:", sizeof("POST:")-1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)"POST:", sizeof("POST:")-1);
if (phpurl->path) {
- PHP_MD5Update(&md5ctx, phpurl->path, strlen(phpurl->path));
+ PHP_MD5Update(&md5ctx, (unsigned char*)phpurl->path, strlen(phpurl->path));
+ } else {
+ PHP_MD5Update(&md5ctx, (unsigned char*)"/", 1);
}
if (phpurl->query) {
- PHP_MD5Update(&md5ctx, "?", 1);
- PHP_MD5Update(&md5ctx, phpurl->query, strlen(phpurl->query));
+ PHP_MD5Update(&md5ctx, (unsigned char*)"?", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)phpurl->query, strlen(phpurl->query));
}
/* TODO: Support for qop="auth-int" */
@@ -537,24 +542,24 @@ try_again:
make_digest(HA2, hash);
PHP_MD5Init(&md5ctx);
- PHP_MD5Update(&md5ctx, HA1, 32);
- PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)HA1, 32);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 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, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
}
- PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 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);
+ PHP_MD5Update(&md5ctx, (unsigned char*)nc, 8);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, 8);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
/* TODO: Support for qop="auth-int" */
- PHP_MD5Update(&md5ctx, "auth", sizeof("auth")-1);
- PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)"auth", sizeof("auth")-1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
}
- PHP_MD5Update(&md5ctx, HA2, 32);
+ PHP_MD5Update(&md5ctx, (unsigned char*)HA2, 32);
PHP_MD5Final(hash, &md5ctx);
make_digest(response, hash);
@@ -573,7 +578,9 @@ try_again:
smart_str_append_const(&soap_headers, "\", uri=\"");
if (phpurl->path) {
smart_str_appends(&soap_headers, phpurl->path);
- }
+ } else {
+ smart_str_appendc(&soap_headers, '/');
+ }
if (phpurl->query) {
smart_str_appendc(&soap_headers, '?');
smart_str_appends(&soap_headers, phpurl->query);
@@ -601,7 +608,7 @@ try_again:
smart_str_append_const(&soap_headers, "\"\r\n");
}
} else {
- char* buf;
+ unsigned char* buf;
int len;
smart_str auth = {0};
@@ -612,9 +619,9 @@ try_again:
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);
+ buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len);
smart_str_append_const(&soap_headers, "Authorization: Basic ");
- smart_str_appendl(&soap_headers, buf, len);
+ smart_str_appendl(&soap_headers, (char*)buf, len);
smart_str_append_const(&soap_headers, "\r\n");
efree(buf);
smart_str_free(&auth);
@@ -729,6 +736,14 @@ try_again:
tmp++;
http_status = atoi(tmp);
}
+ tmp = strstr(tmp," ");
+ if (tmp != NULL) {
+ tmp++;
+ if (http_msg) {
+ efree(http_msg);
+ }
+ http_msg = estrdup(tmp);
+ }
efree(http_version);
/* Try and get headers again */
@@ -842,6 +857,9 @@ try_again:
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);
+ if (http_msg) {
+ efree(http_msg);
+ }
return FALSE;
}
@@ -1044,6 +1062,9 @@ try_again:
efree(content_encoding);
efree(http_headers);
efree(http_body);
+ if (http_msg) {
+ efree(http_msg);
+ }
add_soap_fault(this_ptr, "HTTP", "Unknown Content-Encoding", NULL, NULL TSRMLS_CC);
return FALSE;
}
@@ -1057,6 +1078,9 @@ try_again:
efree(http_headers);
efree(http_body);
add_soap_fault(this_ptr, "HTTP", "Can't uncompress compressed response", NULL, NULL TSRMLS_CC);
+ if (http_msg) {
+ efree(http_msg);
+ }
return FALSE;
}
efree(content_encoding);
@@ -1087,27 +1111,16 @@ try_again:
if (error) {
efree(*buffer);
- if (http_status == 400) {
- add_soap_fault(this_ptr, "HTTP", "Bad Request", NULL, NULL TSRMLS_CC);
- } else if (http_status == 401) {
- add_soap_fault(this_ptr, "HTTP", "Unauthorized Request", NULL, NULL TSRMLS_CC);
- } else if (http_status == 405) {
- add_soap_fault(this_ptr, "HTTP", "Method not allowed", NULL, NULL TSRMLS_CC);
- } else if (http_status == 415) {
- add_soap_fault(this_ptr, "HTTP", "Unsupported Media Type", NULL, NULL TSRMLS_CC);
- } else if (http_status >= 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);
- }
+ add_soap_fault(this_ptr, "HTTP", http_msg, NULL, NULL TSRMLS_CC);
+ efree(http_msg);
return FALSE;
}
}
+ if (http_msg) {
+ efree(http_msg);
+ }
+
return TRUE;
}
diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c
index 847726647..33fd37839 100644
--- a/ext/soap/php_packet_soap.c
+++ b/ext/soap/php_packet_soap.c
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_packet_soap.c,v 1.42.2.1 2006/01/01 12:50:13 sniper Exp $ */
+/* $Id: php_packet_soap.c,v 1.42.2.1.2.2 2006/07/11 14:24:18 dmitry Exp $ */
#include "php_soap.h"
@@ -90,7 +90,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
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) {
+ } else if (strcmp((char*)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;
@@ -140,7 +140,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
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) {
+ } else if (strcmp((char*)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;
@@ -166,7 +166,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
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) {
+ } else if (strcmp((char*)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;
@@ -184,31 +184,35 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
xmlNodePtr tmp;
if (soap_version == SOAP_1_1) {
- tmp = get_node(fault->children,"faultcode");
+ tmp = get_node(fault->children, "faultcode");
if (tmp != NULL && tmp->children != NULL) {
- faultcode = tmp->children->content;
+ faultcode = (char*)tmp->children->content;
}
- tmp = get_node(fault->children,"faultstring");
+ tmp = get_node(fault->children, "faultstring");
if (tmp != NULL && tmp->children != NULL) {
- faultstring = tmp->children->content;
+ zval *zv = master_to_zval(get_conversion(IS_STRING), tmp);
+ faultstring = Z_STRVAL_P(zv);
+ FREE_ZVAL(zv);
}
- tmp = get_node(fault->children,"faultactor");
+ tmp = get_node(fault->children, "faultactor");
if (tmp != NULL && tmp->children != NULL) {
- faultactor = tmp->children->content;
+ zval *zv = master_to_zval(get_conversion(IS_STRING), tmp);
+ faultactor = Z_STRVAL_P(zv);
+ FREE_ZVAL(zv);
}
- tmp = get_node(fault->children,"detail");
+ tmp = get_node(fault->children, "detail");
if (tmp != NULL) {
details = master_to_zval(NULL, tmp);
}
} else {
- tmp = get_node(fault->children,"Code");
+ tmp = get_node(fault->children, "Code");
if (tmp != NULL && tmp->children != NULL) {
- tmp = get_node(tmp->children,"Value");
+ tmp = get_node(tmp->children, "Value");
if (tmp != NULL && tmp->children != NULL) {
- faultcode = tmp->children->content;
+ faultcode = (char*)tmp->children->content;
}
}
@@ -217,7 +221,9 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
/* TODO: lang attribute */
tmp = get_node(tmp->children,"Text");
if (tmp != NULL && tmp->children != NULL) {
- faultstring = tmp->children->content;
+ zval *zv = master_to_zval(get_conversion(IS_STRING), tmp);
+ faultstring = Z_STRVAL_P(zv);
+ FREE_ZVAL(zv);
}
}
@@ -227,6 +233,12 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
}
}
add_soap_fault(this_ptr, faultcode, faultstring, faultactor, details TSRMLS_CC);
+ if (faultstring) {
+ efree(faultstring);
+ }
+ if (faultactor) {
+ efree(faultactor);
+ }
#ifdef ZEND_ENGINE_2
if (details) {
details->refcount--;
@@ -382,10 +394,10 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
sdlSoapBindingFunctionHeaderPtr *hdr;
if (trav->ns) {
- smart_str_appends(&key,trav->ns->href);
+ smart_str_appends(&key, (char*)trav->ns->href);
smart_str_appendc(&key,':');
}
- smart_str_appends(&key,trav->name);
+ smart_str_appends(&key, (char*)trav->name);
smart_str_0(&key);
if (zend_hash_find(hdrs, key.c, key.len+1, (void**)&hdr) == SUCCESS) {
enc = (*hdr)->encode;
diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c
index 903c2cf3d..11553ea76 100644
--- a/ext/soap/php_schema.c
+++ b/ext/soap/php_schema.c
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_schema.c,v 1.58.2.6 2006/04/09 23:35:51 andrei Exp $ */
+/* $Id: php_schema.c,v 1.58.2.6.2.3 2006/10/03 19:51:01 iliaa Exp $ */
#include "php_soap.h"
#include "libxml/uri.h"
@@ -46,7 +46,7 @@ static int schema_restriction_var_char(xmlNodePtr val, sdlRestrictionCharPtr *va
static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type);
-static encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type)
+static encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const xmlChar *ns, const xmlChar *type)
{
smart_str nscat = {0};
encodePtr enc, *enc_ptr;
@@ -55,9 +55,9 @@ static encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns,
sdl->encoders = emalloc(sizeof(HashTable));
zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0);
}
- smart_str_appends(&nscat, ns);
+ smart_str_appends(&nscat, (char*)ns);
smart_str_appendc(&nscat, ':');
- smart_str_appends(&nscat, type);
+ smart_str_appends(&nscat, (char*)type);
smart_str_0(&nscat);
if (zend_hash_find(sdl->encoders, nscat.c, nscat.len + 1, (void**)&enc_ptr) == SUCCESS) {
enc = *enc_ptr;
@@ -73,8 +73,8 @@ static encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns,
}
memset(enc, 0, sizeof(encode));
- enc->details.ns = estrdup(ns);
- enc->details.type_str = estrdup(type);
+ enc->details.ns = estrdup((char*)ns);
+ enc->details.type_str = estrdup((char*)type);
enc->details.sdl_type = cur_type;
enc->to_xml = sdl_guess_convert_xml;
enc->to_zval = sdl_guess_convert_zval;
@@ -86,9 +86,9 @@ static encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns,
return enc;
}
-static encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type)
+static encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const xmlChar *ns, const xmlChar *type)
{
- encodePtr enc = get_encoder(sdl, ns, type);
+ encodePtr enc = get_encoder(sdl, (char*)ns, (char*)type);
if (enc == NULL) {
enc = create_encoder(sdl, cur_type, ns, type);
}
@@ -97,12 +97,12 @@ static encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char
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)) {
+ !zend_hash_exists(&ctx->docs, (char*)location, xmlStrlen(location)+1)) {
xmlDocPtr doc;
xmlNodePtr schema;
xmlAttrPtr new_tns;
- doc = soap_xmlParseFile(location TSRMLS_CC);
+ doc = soap_xmlParseFile((char*)location TSRMLS_CC);
if (doc == NULL) {
soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s'", location);
}
@@ -113,9 +113,9 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA
}
new_tns = get_attribute(schema->properties, "targetNamespace");
if (import) {
- if (ns != NULL && (new_tns == NULL || strcmp(ns->children->content,new_tns->children->content) != 0)) {
+ if (ns != NULL && (new_tns == NULL || xmlStrcmp(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);
+ soap_error2(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s'", location, ns->children->content);
}
if (ns == NULL && new_tns != NULL) {
xmlFreeDoc(doc);
@@ -125,14 +125,14 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA
new_tns = get_attribute(schema->properties, "targetNamespace");
if (new_tns == NULL) {
if (tns != NULL) {
- xmlSetProp(schema, "targetNamespace", tns->children->content);
+ xmlSetProp(schema, BAD_CAST("targetNamespace"), tns->children->content);
}
- } else if (tns != NULL && strcmp(tns->children->content,new_tns->children->content) != 0) {
+ } else if (tns != NULL && xmlStrcmp(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);
+ zend_hash_add(&ctx->docs, (char*)location, xmlStrlen(location)+1, (void**)&doc, sizeof(xmlDocPtr), NULL);
load_schema(ctx, schema TSRMLS_CC);
}
}
@@ -177,8 +177,8 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC)
tns = get_attribute(schema->properties, "targetNamespace");
if (tns == NULL) {
- tns = xmlSetProp(schema, "targetNamespace", "");
- xmlNewNs(schema, "", NULL);
+ tns = xmlSetProp(schema, BAD_CAST("targetNamespace"), BAD_CAST(""));
+ xmlNewNs(schema, BAD_CAST(""), NULL);
}
trav = schema->children;
@@ -231,7 +231,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC)
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) {
+ if (ns != NULL && tns != NULL && xmlStrcmp(ns->children->content, tns->children->content) == 0) {
if (location) {
soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s', namespace must not match the enclosing schema 'targetNamespace'", location->children->content);
} else {
@@ -318,8 +318,8 @@ static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpleType,
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);
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
} else {
newType->name = estrdup(cur_type->name);
newType->namens = estrdup(cur_type->namens);
@@ -348,8 +348,8 @@ static int schema_simpleType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr simpleType,
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);
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
if (cur_type == NULL) {
zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr);
@@ -416,7 +416,7 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypeP
xmlNsPtr nsptr;
parse_namespace(itemType->children->content, &type, &ns);
- nsptr = xmlSearchNs(listType->doc, listType, ns);
+ nsptr = xmlSearchNs(listType->doc, listType, BAD_CAST(ns));
if (nsptr != NULL) {
sdlTypePtr newType, *tmp;
@@ -424,9 +424,9 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypeP
memset(newType, 0, sizeof(sdlType));
newType->name = estrdup(type);
- newType->namens = estrdup(nsptr->href);
+ newType->namens = estrdup((char*)nsptr->href);
- newType->encode = get_create_encoder(sdl, newType, (char *)nsptr->href, type);
+ newType->encode = get_create_encoder(sdl, newType, nsptr->href, BAD_CAST(type));
if (cur_type->elements == NULL) {
cur_type->elements = emalloc(sizeof(HashTable));
@@ -454,7 +454,7 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypeP
memset(newType, 0, sizeof(sdlType));
newType->name = estrdup("anonymous");
- newType->namens = estrdup(tns->children->content);
+ newType->namens = estrdup((char*)tns->children->content);
if (cur_type->elements == NULL) {
cur_type->elements = emalloc(sizeof(HashTable));
@@ -490,8 +490,8 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTyp
char *type, *ns;
xmlNsPtr nsptr;
- str = estrdup(memberTypes->children->content);
- whiteSpace_collapse(str);
+ str = estrdup((char*)memberTypes->children->content);
+ whiteSpace_collapse(BAD_CAST(str));
start = str;
while (start != NULL && *start != '\0') {
end = strchr(start,' ');
@@ -502,8 +502,8 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTyp
next = end+1;
}
- parse_namespace(start, &type, &ns);
- nsptr = xmlSearchNs(unionType->doc, unionType, ns);
+ parse_namespace(BAD_CAST(start), &type, &ns);
+ nsptr = xmlSearchNs(unionType->doc, unionType, BAD_CAST(ns));
if (nsptr != NULL) {
sdlTypePtr newType, *tmp;
@@ -511,9 +511,9 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTyp
memset(newType, 0, sizeof(sdlType));
newType->name = estrdup(type);
- newType->namens = estrdup(nsptr->href);
+ newType->namens = estrdup((char*)nsptr->href);
- newType->encode = get_create_encoder(sdl, newType, (char *)nsptr->href, type);
+ newType->encode = get_create_encoder(sdl, newType, nsptr->href, BAD_CAST(type));
if (cur_type->elements == NULL) {
cur_type->elements = emalloc(sizeof(HashTable));
@@ -542,7 +542,7 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTyp
memset(newType, 0, sizeof(sdlType));
newType->name = estrdup("anonymous");
- newType->namens = estrdup(tns->children->content);
+ newType->namens = estrdup((char*)tns->children->content);
if (cur_type->elements == NULL) {
cur_type->elements = emalloc(sizeof(HashTable));
@@ -626,9 +626,9 @@ static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodeP
xmlNsPtr nsptr;
parse_namespace(base->children->content, &type, &ns);
- nsptr = xmlSearchNs(restType->doc, restType, ns);
+ nsptr = xmlSearchNs(restType->doc, restType, BAD_CAST(ns));
if (nsptr != NULL) {
- cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, type);
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(type));
}
if (type) {efree(type);}
if (ns) {efree(ns);}
@@ -729,9 +729,9 @@ static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNode
xmlNsPtr nsptr;
parse_namespace(base->children->content, &type, &ns);
- nsptr = xmlSearchNs(restType->doc, restType, ns);
+ nsptr = xmlSearchNs(restType->doc, restType, BAD_CAST(ns));
if (nsptr != NULL) {
- cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, type);
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(type));
}
if (type) {efree(type);}
if (ns) {efree(ns);}
@@ -792,8 +792,8 @@ static int schema_restriction_var_int(xmlNodePtr val, sdlRestrictionIntPtr *valp
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")))
+ if (!strncmp((char*)fixed->children->content, "true", sizeof("true")) ||
+ !strncmp((char*)fixed->children->content, "1", sizeof("1")))
(*valptr)->fixed = TRUE;
}
@@ -802,7 +802,7 @@ static int schema_restriction_var_int(xmlNodePtr val, sdlRestrictionIntPtr *valp
soap_error0(E_ERROR, "Parsing Schema: missing restriction value");
}
- (*valptr)->value = atoi(value->children->content);
+ (*valptr)->value = atoi((char*)value->children->content);
return TRUE;
}
@@ -819,8 +819,8 @@ static int schema_restriction_var_char(xmlNodePtr val, sdlRestrictionCharPtr *va
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"))) {
+ if (!strncmp((char*)fixed->children->content, "true", sizeof("true")) ||
+ !strncmp((char*)fixed->children->content, "1", sizeof("1"))) {
(*valptr)->fixed = TRUE;
}
}
@@ -830,7 +830,7 @@ static int schema_restriction_var_char(xmlNodePtr val, sdlRestrictionCharPtr *va
soap_error0(E_ERROR, "Parsing Schema: missing restriction value");
}
- (*valptr)->value = estrdup(value->children->content);
+ (*valptr)->value = estrdup((char*)value->children->content);
return TRUE;
}
@@ -854,9 +854,9 @@ static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr
xmlNsPtr nsptr;
parse_namespace(base->children->content, &type, &ns);
- nsptr = xmlSearchNs(extType->doc, extType, ns);
+ nsptr = xmlSearchNs(extType->doc, extType, BAD_CAST(ns));
if (nsptr != NULL) {
- cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, type);
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(type));
}
if (type) {efree(type);}
if (ns) {efree(ns);}
@@ -909,9 +909,9 @@ static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePt
xmlNsPtr nsptr;
parse_namespace(base->children->content, &type, &ns);
- nsptr = xmlSearchNs(extType->doc, extType, ns);
+ nsptr = xmlSearchNs(extType->doc, extType, BAD_CAST(ns));
if (nsptr != NULL) {
- cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, type);
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(type));
}
if (type) {efree(type);}
if (ns) {efree(ns);}
@@ -959,6 +959,28 @@ static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePt
return TRUE;
}
+void schema_min_max(xmlNodePtr node, sdlContentModelPtr model)
+{
+ xmlAttrPtr attr = get_attribute(node->properties, "minOccurs");
+
+ if (attr) {
+ model->min_occurs = atoi((char*)attr->children->content);
+ } else {
+ model->min_occurs = 1;
+ }
+
+ attr = get_attribute(node->properties, "maxOccurs");
+ if (attr) {
+ if (!strncmp((char*)attr->children->content, "unbounded", sizeof("unbounded"))) {
+ model->max_occurs = -1;
+ } else {
+ model->max_occurs = atoi((char*)attr->children->content);
+ }
+ } else {
+ model->max_occurs = 1;
+ }
+}
+
/*
<all
id = ID
@@ -971,7 +993,6 @@ static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePt
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));
@@ -984,22 +1005,7 @@ static int schema_all(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr all, sdlTypePtr cur
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);
- }
- }
+ schema_min_max(all, newModel);
trav = all->children;
if (trav != NULL && node_is_equal(trav,"annotation")) {
@@ -1031,7 +1037,6 @@ static int schema_all(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr all, sdlTypePtr cur
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;
@@ -1053,9 +1058,9 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp
xmlNsPtr nsptr;
parse_namespace(ref->children->content, &type, &ns);
- nsptr = xmlSearchNs(groupType->doc, groupType, ns);
+ nsptr = xmlSearchNs(groupType->doc, groupType, BAD_CAST(ns));
if (nsptr != NULL) {
- smart_str_appends(&key, nsptr->href);
+ smart_str_appends(&key, (char*)nsptr->href);
smart_str_appendc(&key, ':');
}
smart_str_appends(&key, type);
@@ -1073,9 +1078,9 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp
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_appends(&key, (char*)ns->children->content);
smart_str_appendc(&key, ':');
- smart_str_appends(&key, name->children->content);
+ smart_str_appends(&key, (char*)name->children->content);
smart_str_0(&key);
}
@@ -1106,22 +1111,7 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp
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);
- }
- }
+ schema_min_max(groupType, newModel);
trav = groupType->children;
if (trav != NULL && node_is_equal(trav,"annotation")) {
@@ -1171,7 +1161,6 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp
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));
@@ -1184,22 +1173,7 @@ static int schema_choice(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr choiceType, sdlT
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);
- }
- }
+ schema_min_max(choiceType, newModel);
trav = choiceType->children;
if (trav != NULL && node_is_equal(trav,"annotation")) {
@@ -1237,7 +1211,6 @@ static int schema_choice(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr choiceType, sdlT
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));
@@ -1250,22 +1223,7 @@ static int schema_sequence(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr seqType, sdlTy
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);
- }
- }
+ schema_min_max(seqType, newModel);
trav = seqType->children;
if (trav != NULL && node_is_equal(trav,"annotation")) {
@@ -1306,26 +1264,11 @@ static int schema_any(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr anyType, sdlTypePtr
{
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);
- }
- }
+ schema_min_max(anyType, newModel);
zend_hash_next_index_insert(model->u.content, &newModel, sizeof(sdlContentModelPtr), NULL);
}
@@ -1403,8 +1346,8 @@ static int schema_complexType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compType, s
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);
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
} else {
newType->name = estrdup(cur_type->name);
newType->namens = estrdup(cur_type->namens);
@@ -1433,8 +1376,8 @@ static int schema_complexType(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr compType, s
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);
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr);
@@ -1542,11 +1485,11 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
xmlNsPtr nsptr;
parse_namespace(ref->children->content, &type, &ns);
- nsptr = xmlSearchNs(element->doc, element, ns);
+ nsptr = xmlSearchNs(element->doc, element, BAD_CAST(ns));
if (nsptr != NULL) {
- smart_str_appends(&nscat, nsptr->href);
+ smart_str_appends(&nscat, (char*)nsptr->href);
smart_str_appendc(&nscat, ':');
- newType->namens = estrdup(nsptr->href);
+ newType->namens = estrdup((char*)nsptr->href);
}
smart_str_appends(&nscat, type);
newType->name = estrdup(type);
@@ -1556,8 +1499,8 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
newType->ref = estrdup(nscat.c);
smart_str_free(&nscat);
} else {
- newType->name = estrdup(name->children->content);
- newType->namens = estrdup(ns->children->content);
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
}
newType->nillable = FALSE;
@@ -1595,22 +1538,9 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
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);
- }
- }
+ schema_min_max(element, newModel);
- 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);
}
@@ -1626,8 +1556,8 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
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")) {
+ if (!stricmp((char*)attr->children->content, "true") ||
+ !stricmp((char*)attr->children->content, "1")) {
cur_type->nillable = TRUE;
} else {
cur_type->nillable = FALSE;
@@ -1641,7 +1571,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
if (ref != NULL) {
soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes");
}
- cur_type->fixed = estrdup(attr->children->content);
+ cur_type->fixed = estrdup((char*)attr->children->content);
}
attr = get_attribute(attrs, "default");
@@ -1651,15 +1581,15 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
} else if (ref != NULL) {
soap_error0(E_ERROR, "Parsing Schema: element has both 'default' and 'fixed' attributes");
}
- cur_type->def = estrdup(attr->children->content);
+ cur_type->def = estrdup((char*)attr->children->content);
}
/* form */
attr = get_attribute(attrs, "form");
if (attr) {
- if (strncmp(attr->children->content,"qualified",sizeof("qualified")) == 0) {
+ if (strncmp((char*)attr->children->content, "qualified", sizeof("qualified")) == 0) {
cur_type->form = XSD_FORM_QUALIFIED;
- } else if (strncmp(attr->children->content,"unqualified",sizeof("unqualified")) == 0) {
+ } else if (strncmp((char*)attr->children->content, "unqualified", sizeof("unqualified")) == 0) {
cur_type->form = XSD_FORM_UNQUALIFIED;
} else {
cur_type->form = XSD_FORM_DEFAULT;
@@ -1673,7 +1603,7 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
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"))) {
+ if(def == NULL || strncmp((char*)def->children->content, "qualified", sizeof("qualified"))) {
cur_type->form = XSD_FORM_UNQUALIFIED;
} else {
cur_type->form = XSD_FORM_QUALIFIED;
@@ -1697,9 +1627,9 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
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);
+ nsptr = xmlSearchNs(element->doc, element, BAD_CAST(str_ns));
if (nsptr != NULL) {
- cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, (char *)cptype);
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(cptype));
}
if (str_ns) {efree(str_ns);}
if (cptype) {efree(cptype);}
@@ -1781,11 +1711,11 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
xmlNsPtr nsptr;
parse_namespace(ref->children->content, &attr_name, &ns);
- nsptr = xmlSearchNs(attrType->doc, attrType, ns);
+ nsptr = xmlSearchNs(attrType->doc, attrType, BAD_CAST(ns));
if (nsptr != NULL) {
- smart_str_appends(&key, nsptr->href);
+ smart_str_appends(&key, (char*)nsptr->href);
smart_str_appendc(&key, ':');
- newAttr->namens = estrdup(nsptr->href);
+ newAttr->namens = estrdup((char*)nsptr->href);
}
smart_str_appends(&key, attr_name);
smart_str_0(&key);
@@ -1800,11 +1730,11 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
ns = tns;
}
if (ns != NULL) {
- smart_str_appends(&key, ns->children->content);
+ smart_str_appends(&key, (char*)ns->children->content);
smart_str_appendc(&key, ':');
- newAttr->namens = estrdup(ns->children->content);
+ newAttr->namens = estrdup((char*)ns->children->content);
}
- smart_str_appends(&key, name->children->content);
+ smart_str_appends(&key, (char*)name->children->content);
smart_str_0(&key);
}
@@ -1836,9 +1766,9 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
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);
+ nsptr = xmlSearchNs(attrType->doc, attrType, BAD_CAST(str_ns));
if (nsptr != NULL) {
- newAttr->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, (char *)cptype);
+ newAttr->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(cptype));
}
if (str_ns) {efree(str_ns);}
if (cptype) {efree(cptype);}
@@ -1847,13 +1777,13 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
attr = attrType->properties;
while (attr != NULL) {
if (attr_is_equal_ex(attr, "default", SCHEMA_NAMESPACE)) {
- newAttr->def = estrdup(attr->children->content);
+ newAttr->def = estrdup((char*)attr->children->content);
} else if (attr_is_equal_ex(attr, "fixed", SCHEMA_NAMESPACE)) {
- newAttr->fixed = estrdup(attr->children->content);
+ newAttr->fixed = estrdup((char*)attr->children->content);
} else if (attr_is_equal_ex(attr, "form", SCHEMA_NAMESPACE)) {
- if (strncmp(attr->children->content,"qualified",sizeof("qualified")) == 0) {
+ if (strncmp((char*)attr->children->content, "qualified", sizeof("qualified")) == 0) {
newAttr->form = XSD_FORM_QUALIFIED;
- } else if (strncmp(attr->children->content,"unqualified",sizeof("unqualified")) == 0) {
+ } else if (strncmp((char*)attr->children->content, "unqualified", sizeof("unqualified")) == 0) {
newAttr->form = XSD_FORM_UNQUALIFIED;
} else {
newAttr->form = XSD_FORM_DEFAULT;
@@ -1861,17 +1791,17 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
} 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);
+ newAttr->name = estrdup((char*)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) {
+ if (strncmp((char*)attr->children->content, "prohibited", sizeof("prohibited")) == 0) {
newAttr->use = XSD_USE_PROHIBITED;
- } else if (strncmp(attr->children->content,"required",sizeof("required")) == 0) {
+ } else if (strncmp((char*)attr->children->content, "required", sizeof("required")) == 0) {
newAttr->use = XSD_USE_REQUIRED;
- } else if (strncmp(attr->children->content,"optional",sizeof("optional")) == 0) {
+ } else if (strncmp((char*)attr->children->content, "optional", sizeof("optional")) == 0) {
newAttr->use = XSD_USE_OPTIONAL;
} else {
newAttr->use = XSD_USE_DEFAULT;
@@ -1879,7 +1809,7 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
} else {
xmlNsPtr nsPtr = attr_find_ns(attr);
- if (strncmp(nsPtr->href, SCHEMA_NAMESPACE, sizeof(SCHEMA_NAMESPACE))) {
+ if (strncmp((char*)nsPtr->href, SCHEMA_NAMESPACE, sizeof(SCHEMA_NAMESPACE))) {
smart_str key2 = {0};
sdlExtraAttributePtr ext;
xmlNsPtr nsptr;
@@ -1888,12 +1818,12 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
ext = emalloc(sizeof(sdlExtraAttribute));
memset(ext, 0, sizeof(sdlExtraAttribute));
parse_namespace(attr->children->content, &value, &ns);
- nsptr = xmlSearchNs(attr->doc, attr->parent, ns);
+ nsptr = xmlSearchNs(attr->doc, attr->parent, BAD_CAST(ns));
if (nsptr) {
- ext->ns = estrdup(nsptr->href);
+ ext->ns = estrdup((char*)nsptr->href);
ext->val = estrdup(value);
} else {
- ext->val = estrdup(attr->children->content);
+ ext->val = estrdup((char*)attr->children->content);
}
if (ns) {efree(ns);}
efree(value);
@@ -1903,9 +1833,9 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
zend_hash_init(newAttr->extraAttributes, 0, NULL, delete_extra_attribute, 0);
}
- smart_str_appends(&key2, nsPtr->href);
+ smart_str_appends(&key2, (char*)nsPtr->href);
smart_str_appendc(&key2, ':');
- smart_str_appends(&key2, attr->name);
+ smart_str_appends(&key2, (char*)attr->name);
smart_str_0(&key2);
zend_hash_add(newAttr->extraAttributes, key2.c, key2.len + 1, &ext, sizeof(sdlExtraAttributePtr), NULL);
smart_str_free(&key2);
@@ -1919,7 +1849,7 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
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"))) {
+ if(def == NULL || strncmp((char*)def->children->content, "qualified", sizeof("qualified"))) {
newAttr->form = XSD_FORM_UNQUALIFIED;
} else {
newAttr->form = XSD_FORM_QUALIFIED;
@@ -1948,7 +1878,7 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
dummy_type = emalloc(sizeof(sdlType));
memset(dummy_type, 0, sizeof(sdlType));
dummy_type->name = estrdup("anonymous");
- dummy_type->namens = estrdup(tns->children->content);
+ dummy_type->namens = estrdup((char*)tns->children->content);
schema_simpleType(sdl, tns, trav, dummy_type);
newAttr->encode = dummy_type->encode;
delete_type(&dummy_type);
@@ -1983,8 +1913,8 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou
}
newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
- newType->name = estrdup(name->children->content);
- newType->namens = estrdup(ns->children->content);
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
smart_str_appends(&key, newType->namens);
smart_str_appendc(&key, ':');
@@ -2010,9 +1940,9 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou
memset(newAttr, 0, sizeof(sdlAttribute));
parse_namespace(ref->children->content, &group_name, &ns);
- nsptr = xmlSearchNs(attrGroup->doc, attrGroup, ns);
+ nsptr = xmlSearchNs(attrGroup->doc, attrGroup, BAD_CAST(ns));
if (nsptr != NULL) {
- smart_str_appends(&key, nsptr->href);
+ smart_str_appends(&key, (char*)nsptr->href);
smart_str_appendc(&key, ':');
}
smart_str_appends(&key, group_name);
@@ -2109,7 +2039,7 @@ static void schema_attribute_fixup(sdlCtx *ctx, sdlAttributePtr attr)
xmlNodePtr node;
attr->extraAttributes = emalloc(sizeof(HashTable));
- zend_hash_init(attr->extraAttributes, 0, NULL, delete_extra_attribute, 0);
+ zend_hash_init(attr->extraAttributes, zend_hash_num_elements((*tmp)->extraAttributes), NULL, delete_extra_attribute, 0);
zend_hash_copy(attr->extraAttributes, (*tmp)->extraAttributes, copy_extra_attribute, &node, sizeof(xmlNodePtr));
}
attr->encode = (*tmp)->encode;
@@ -2155,7 +2085,7 @@ static void schema_attributegroup_fixup(sdlCtx *ctx, sdlAttributePtr attr, HashT
if (newAttr->extraAttributes) {
xmlNodePtr node;
HashTable *ht = emalloc(sizeof(HashTable));
- zend_hash_init(ht, 0, NULL, delete_extra_attribute, 0);
+ zend_hash_init(ht, zend_hash_num_elements(newAttr->extraAttributes), NULL, delete_extra_attribute, 0);
zend_hash_copy(ht, newAttr->extraAttributes, copy_extra_attribute, &node, sizeof(xmlNodePtr));
newAttr->extraAttributes = ht;
}
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index b0185c890..12c4da661 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_sdl.c,v 1.88.2.12 2006/04/19 10:48:54 dmitry Exp $ */
+/* $Id: php_sdl.c,v 1.88.2.12.2.3 2006/09/20 13:42:50 dmitry Exp $ */
#include "php_soap.h"
#include "ext/libxml/php_libxml.h"
@@ -46,28 +46,28 @@ static void delete_header(void *header);
static void delete_header_persistent(void *header);
static void delete_document(void *doc_ptr);
-encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr node, const char *type)
+encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr node, const xmlChar *type)
{
encodePtr enc = NULL;
xmlNsPtr nsptr;
char *ns, *cptype;
parse_namespace(type, &cptype, &ns);
- nsptr = xmlSearchNs(node->doc, node, ns);
+ nsptr = xmlSearchNs(node->doc, node, BAD_CAST(ns));
if (nsptr != NULL) {
- enc = get_encoder(sdl, nsptr->href, cptype);
+ enc = get_encoder(sdl, (char*)nsptr->href, cptype);
if (enc == NULL) {
enc = get_encoder_ex(sdl, cptype, strlen(cptype));
}
} else {
- enc = get_encoder_ex(sdl, type, strlen(type));
+ enc = get_encoder_ex(sdl, (char*)type, xmlStrlen(type));
}
efree(cptype);
if (ns) {efree(ns);}
return enc;
}
-static sdlTypePtr get_element(sdlPtr sdl, xmlNodePtr node, const char *type)
+static sdlTypePtr get_element(sdlPtr sdl, xmlNodePtr node, const xmlChar *type)
{
sdlTypePtr ret = NULL;
@@ -77,9 +77,9 @@ static sdlTypePtr get_element(sdlPtr sdl, xmlNodePtr node, const char *type)
sdlTypePtr *sdl_type;
parse_namespace(type, &cptype, &ns);
- nsptr = xmlSearchNs(node->doc, node, ns);
+ nsptr = xmlSearchNs(node->doc, node, BAD_CAST(ns));
if (nsptr != NULL) {
- int ns_len = strlen(nsptr->href);
+ int ns_len = xmlStrlen(nsptr->href);
int type_len = strlen(cptype);
int len = ns_len + type_len + 1;
char *nscat = emalloc(len + 1);
@@ -96,7 +96,7 @@ static sdlTypePtr get_element(sdlPtr sdl, xmlNodePtr node, const char *type)
}
efree(nscat);
} else {
- if (zend_hash_find(sdl->elements, (char*)type, strlen(type) + 1, (void **)&sdl_type) == SUCCESS) {
+ if (zend_hash_find(sdl->elements, (char*)type, xmlStrlen(type) + 1, (void **)&sdl_type) == SUCCESS) {
ret = *sdl_type;
}
}
@@ -213,12 +213,12 @@ sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns)
static int is_wsdl_element(xmlNodePtr node)
{
- if (node->ns && strcmp(node->ns->href,WSDL_NAMESPACE) != 0) {
+ if (node->ns && strcmp((char*)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)) {
+ (strcmp((char*)attr->children->content, "1") == 0 ||
+ strcmp((char*)attr->children->content, "true") == 0)) {
soap_error1(E_ERROR, "Parsing WSDL: Unknown required WSDL extension '%s'", node->ns->href);
}
return 0;
@@ -261,7 +261,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
if (!include) {
targetNamespace = get_attribute(definitions->properties, "targetNamespace");
if (targetNamespace) {
- tmpsdl->target_ns = estrdup(targetNamespace->children->content);
+ tmpsdl->target_ns = estrdup((char*)targetNamespace->children->content);
}
}
@@ -296,14 +296,14 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
uri = xmlBuildURI(tmp->children->content, base);
xmlFree(base);
}
- load_wsdl_ex(this_ptr, uri, ctx, 1 TSRMLS_CC);
+ load_wsdl_ex(this_ptr, (char*)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) {
+ if (zend_hash_add(&ctx->messages, (char*)name->children->content, xmlStrlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
soap_error1(E_ERROR, "Parsing WSDL: <message> '%s' already defined", name->children->content);
}
} else {
@@ -313,7 +313,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
} 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) {
+ if (zend_hash_add(&ctx->portTypes, (char*)name->children->content, xmlStrlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
soap_error1(E_ERROR, "Parsing WSDL: <portType> '%s' already defined", name->children->content);
}
} else {
@@ -323,7 +323,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
} 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) {
+ if (zend_hash_add(&ctx->bindings, (char*)name->children->content, xmlStrlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
soap_error1(E_ERROR, "Parsing WSDL: <binding> '%s' already defined", name->children->content);
}
} else {
@@ -333,7 +333,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
} 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) {
+ if (zend_hash_add(&ctx->services, (char*)name->children->content, xmlStrlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
soap_error1(E_ERROR, "Parsing WSDL: <service> '%s' already defined", name->children->content);
}
} else {
@@ -358,9 +358,9 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml
soap_error0(E_ERROR, "Parsing WSDL: Missing message attribute for <header>");
}
- ctype = strrchr(tmp->children->content,':');
+ ctype = strrchr((char*)tmp->children->content,':');
if (ctype == NULL) {
- ctype = tmp->children->content;
+ ctype = (char*)tmp->children->content;
} else {
++ctype;
}
@@ -372,17 +372,17 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml
if (!tmp) {
soap_error0(E_ERROR, "Parsing WSDL: Missing part attribute for <header>");
}
- part = get_node_with_attribute_ex((*message)->children, "part", WSDL_NAMESPACE, "name", tmp->children->content, NULL);
+ part = get_node_with_attribute_ex((*message)->children, "part", WSDL_NAMESPACE, "name", (char*)tmp->children->content, NULL);
if (!part) {
soap_error1(E_ERROR, "Parsing WSDL: Missing part '%s' in <message>", tmp->children->content);
}
h = emalloc(sizeof(sdlSoapBindingFunctionHeader));
memset(h, 0, sizeof(sdlSoapBindingFunctionHeader));
- h->name = estrdup(tmp->children->content);
+ h->name = estrdup((char*)tmp->children->content);
tmp = get_attribute(header->properties, "use");
- if (tmp && !strncmp(tmp->children->content, "encoded", sizeof("encoded"))) {
+ if (tmp && !strncmp((char*)tmp->children->content, "encoded", sizeof("encoded"))) {
h->use = SOAP_ENCODED;
} else {
h->use = SOAP_LITERAL;
@@ -390,15 +390,15 @@ static sdlSoapBindingFunctionHeaderPtr wsdl_soap_binding_header(sdlCtx* ctx, xml
tmp = get_attribute(header->properties, "namespace");
if (tmp) {
- h->ns = estrdup(tmp->children->content);
+ h->ns = estrdup((char*)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) {
+ if (strncmp((char*)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) {
+ } else if (strncmp((char*)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);
@@ -469,7 +469,7 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap
body = trav;
tmp = get_attribute(body->properties, "use");
- if (tmp && !strncmp(tmp->children->content, "literal", sizeof("literal"))) {
+ if (tmp && !strncmp((char*)tmp->children->content, "literal", sizeof("literal"))) {
binding->use = SOAP_LITERAL;
} else {
binding->use = SOAP_ENCODED;
@@ -477,13 +477,13 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap
tmp = get_attribute(body->properties, "namespace");
if (tmp) {
- binding->ns = estrdup(tmp->children->content);
+ binding->ns = estrdup((char*)tmp->children->content);
}
tmp = get_attribute(body->properties, "parts");
if (tmp) {
HashTable ht;
- char *parts = tmp->children->content;
+ char *parts = (char*)tmp->children->content;
/* Delete all parts those are not in the "parts" attribute */
zend_hash_init(&ht, 0, NULL, delete_parameter, 0);
@@ -524,9 +524,9 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap
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) {
+ if (strncmp((char*)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) {
+ } else if (strncmp((char*)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);
@@ -561,15 +561,15 @@ static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap
}
}
-static HashTable* wsdl_message(sdlCtx *ctx, char* message_name)
+static HashTable* wsdl_message(sdlCtx *ctx, xmlChar* message_name)
{
xmlNodePtr trav, part, message = NULL, *tmp;
HashTable* parameters = NULL;
char *ctype;
- ctype = strrchr(message_name,':');
+ ctype = strrchr((char*)message_name,':');
if (ctype == NULL) {
- ctype = message_name;
+ ctype = (char*)message_name;
} else {
++ctype;
}
@@ -586,7 +586,7 @@ static HashTable* wsdl_message(sdlCtx *ctx, char* message_name)
xmlAttrPtr element, type, name;
sdlParamPtr param;
- if (trav->ns != NULL && strcmp(trav->ns->href,WSDL_NAMESPACE) != 0) {
+ if (trav->ns != NULL && strcmp((char*)trav->ns->href, WSDL_NAMESPACE) != 0) {
soap_error1(E_ERROR, "Parsing WSDL: Unexpected extensibility element <%s>", trav->name);
}
if (node_is_equal(trav,"documentation")) {
@@ -606,7 +606,7 @@ static HashTable* wsdl_message(sdlCtx *ctx, char* message_name)
soap_error1(E_ERROR, "Parsing WSDL: No name associated with <part> '%s'", message->name);
}
- param->paramName = estrdup(name->children->content);
+ param->paramName = estrdup((char*)name->children->content);
type = get_attribute(part->properties, "type");
if (type != NULL) {
@@ -690,22 +690,22 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
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))) {
+ if (!strncmp((char*)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))) {
+ } else if (!strncmp((char*)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))) {
+ } else if (!strncmp((char*)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))) {
+ } else if (!strncmp((char*)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))) {
+ } else if (!strncmp((char*)trav2->ns->href, WSDL_HTTP12_NAMESPACE, sizeof(WSDL_HTTP12_NAMESPACE))) {
address = trav2;
tmpbinding->bindingType = BINDING_HTTP;
}
@@ -724,11 +724,11 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
soap_error0(E_ERROR, "Parsing WSDL: No location associated with <port>");
}
- tmpbinding->location = estrdup(location->children->content);
+ tmpbinding->location = estrdup((char*)location->children->content);
- ctype = strrchr(bindingAttr->children->content,':');
+ ctype = strrchr((char*)bindingAttr->children->content,':');
if (ctype == NULL) {
- ctype = bindingAttr->children->content;
+ ctype = (char*)bindingAttr->children->content;
} else {
++ctype;
}
@@ -749,13 +749,13 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
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"))) {
+ if (tmp && !strncmp((char*)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) {
+ if (strncmp((char*)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);
@@ -769,16 +769,16 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
if (name == NULL) {
soap_error0(E_ERROR, "Parsing WSDL: Missing 'name' attribute for <binding>");
}
- tmpbinding->name = estrdup(name->children->content);
+ tmpbinding->name = estrdup((char*)name->children->content);
type = get_attribute(binding->properties, "type");
if (type == NULL) {
soap_error0(E_ERROR, "Parsing WSDL: Missing 'type' attribute for <binding>");
}
- ctype = strrchr(type->children->content,':');
+ ctype = strrchr((char*)type->children->content,':');
if (ctype == NULL) {
- ctype = type->children->content;
+ ctype = (char*)type->children->content;
} else {
++ctype;
}
@@ -825,14 +825,14 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
trav3 = trav3->next;
}
- portTypeOperation = get_node_with_attribute_ex(portType->children, "operation", WSDL_NAMESPACE, "name", op_name->children->content, NULL);
+ portTypeOperation = get_node_with_attribute_ex(portType->children, "operation", WSDL_NAMESPACE, "name", (char*)op_name->children->content, NULL);
if (portTypeOperation == NULL) {
soap_error1(E_ERROR, "Parsing WSDL: Missing <portType>/<operation> with name '%s'", op_name->children->content);
}
function = emalloc(sizeof(sdlFunction));
memset(function, 0, sizeof(sdlFunction));
- function->functionName = estrdup(op_name->children->content);
+ function->functionName = estrdup((char*)op_name->children->content);
if (tmpbinding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr soapFunctionBinding;
@@ -849,12 +849,12 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
if (soapOperation) {
tmp = get_attribute(soapOperation->properties, "soapAction");
if (tmp) {
- soapFunctionBinding->soapAction = estrdup(tmp->children->content);
+ soapFunctionBinding->soapAction = estrdup((char*)tmp->children->content);
}
tmp = get_attribute(soapOperation->properties, "style");
if (tmp) {
- if (!strncmp(tmp->children->content, "rpc", sizeof("rpc"))) {
+ if (!strncmp((char*)tmp->children->content, "rpc", sizeof("rpc"))) {
soapFunctionBinding->style = SOAP_RPC;
} else {
soapFunctionBinding->style = SOAP_DOCUMENT;
@@ -953,7 +953,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
f = emalloc(sizeof(sdlFault));
memset(f, 0, sizeof(sdlFault));
- f->name = estrdup(name->children->content);
+ f->name = estrdup((char*)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);
@@ -972,7 +972,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
memset(f->bindingAttributes, 0, sizeof(sdlSoapBindingFunctionFault));
tmp = get_attribute(trav->properties, "use");
- if (tmp && !strncmp(tmp->children->content, "encoded", sizeof("encoded"))) {
+ if (tmp && !strncmp((char*)tmp->children->content, "encoded", sizeof("encoded"))) {
binding->use = SOAP_ENCODED;
} else {
binding->use = SOAP_LITERAL;
@@ -980,15 +980,15 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
tmp = get_attribute(trav->properties, "namespace");
if (tmp) {
- binding->ns = estrdup(tmp->children->content);
+ binding->ns = estrdup((char*)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) {
+ if (strncmp((char*)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) {
+ } else if (strncmp((char*)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);
@@ -1326,10 +1326,6 @@ static void sdl_deserialize_encoder(encodePtr enc, sdlTypePtr *types, char **in)
if (real_enc) {
enc->to_zval = real_enc->to_zval;
enc->to_xml = real_enc->to_xml;
- enc->to_zval_before = real_enc->to_zval_before;
- enc->to_xml_before = real_enc->to_xml_before;
- enc->to_zval_after = real_enc->to_zval_after;
- enc->to_xml_after = real_enc->to_xml_after;
}
}
}
@@ -2193,7 +2189,7 @@ static void add_sdl_to_cache(const char *fn, const char *uri, time_t t, sdlPtr s
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 (*binding_num >= 0) {
if ((*tmp)->binding->bindingType == BINDING_SOAP && (*tmp)->bindingAttributes != NULL) {
sdlSoapBindingFunctionPtr binding = (sdlSoapBindingFunctionPtr)(*tmp)->bindingAttributes;
WSDL_CACHE_PUT_1(binding->style, out);
@@ -3116,7 +3112,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
md5str[0] = '\0';
PHP_MD5Init(&context);
- PHP_MD5Update(&context, uri, uri_len);
+ PHP_MD5Update(&context, (unsigned char*)uri, uri_len);
PHP_MD5Final(digest, &context);
make_digest(md5str, digest);
key = emalloc(len+sizeof("/wsdl-")-1+sizeof(md5str));
diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h
index 2d615e7cf..a10bbed3e 100644
--- a/ext/soap/php_sdl.h
+++ b/ext/soap/php_sdl.h
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_sdl.h,v 1.37.2.3 2006/04/19 10:48:54 dmitry Exp $ */
+/* $Id: php_sdl.h,v 1.37.2.3.2.1 2006/07/11 14:24:18 dmitry Exp $ */
#ifndef PHP_SDL_H
#define PHP_SDL_H
@@ -254,7 +254,7 @@ struct _sdlAttribute {
sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC);
-encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const char *type);
+encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const xmlChar *type);
encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len);
diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h
index f652ef094..56841218f 100644
--- a/ext/soap/php_soap.h
+++ b/ext/soap/php_soap.h
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_soap.h,v 1.38.2.6 2006/04/19 10:48:54 dmitry Exp $ */
+/* $Id: php_soap.h,v 1.38.2.6.2.2 2006/09/20 13:42:50 dmitry Exp $ */
#ifndef PHP_SOAP_H
#define PHP_SOAP_H
@@ -35,10 +35,6 @@
#include <libxml/parser.h>
#include <libxml/xpath.h>
-#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
@@ -78,23 +74,8 @@ typedef struct _soapService soapService, *soapServicePtr;
#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;
+ zval *to_xml;
+ zval *to_zval;
};
struct _soapHeader;
@@ -114,7 +95,9 @@ struct _soapService {
int persistance;
} soap_class;
- HashTable *mapping;
+ zval *soap_object;
+
+ HashTable *typemap;
int version;
int type;
char *actor;
@@ -127,6 +110,7 @@ struct _soapService {
#define SOAP_CLASS 1
#define SOAP_FUNCTIONS 2
+#define SOAP_OBJECT 3
#define SOAP_FUNCTIONS_ALL 999
#define SOAP_MAP_FUNCTION 1
@@ -167,7 +151,7 @@ ZEND_BEGIN_MODULE_GLOBALS(soap)
HashTable defEncNs; /* mapping of default namespaces to prefixes */
HashTable defEnc;
HashTable defEncIndex;
- HashTable *overrides;
+ HashTable *typemap;
int cur_uniq_ns;
int soap_version;
sdlPtr sdl;
diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c
index 354c9507e..db3159151 100644
--- a/ext/soap/php_xml.c
+++ b/ext/soap/php_xml.c
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_xml.c,v 1.25.2.1 2006/01/01 12:50:13 sniper Exp $ */
+/* $Id: php_xml.c,v 1.25.2.1.2.1 2006/07/11 14:24:18 dmitry Exp $ */
#include "php_soap.h"
#include "libxml/parser.h"
@@ -26,7 +26,7 @@
/* 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)
+static int is_blank(const xmlChar* str)
{
while (*str != '\0') {
if (*str != ' ' && *str != 0x9 && *str != 0xa && *str != 0xd) {
@@ -101,7 +101,7 @@ xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC)
if (ctxt->wellFormed) {
ret = ctxt->myDoc;
if (ret->URL == NULL && ctxt->directory != NULL) {
- ret->URL = xmlStrdup(ctxt->directory);
+ ret->URL = xmlCharStrdup(ctxt->directory);
}
} else {
ret = NULL;
@@ -142,7 +142,7 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
if (ctxt->wellFormed) {
ret = ctxt->myDoc;
if (ret->URL == NULL && ctxt->directory != NULL) {
- ret->URL = xmlStrdup(ctxt->directory);
+ ret->URL = xmlCharStrdup(ctxt->directory);
}
} else {
ret = NULL;
@@ -214,11 +214,11 @@ xmlNsPtr node_find_ns(xmlNodePtr node)
int attr_is_equal_ex(xmlAttrPtr node, char *name, char *ns)
{
- if (name == NULL || strcmp(node->name, name) == 0) {
+ if (name == NULL || strcmp((char*)node->name, name) == 0) {
if (ns) {
xmlNsPtr nsPtr = attr_find_ns(node);
if (nsPtr) {
- return (strcmp(nsPtr->href, ns) == 0);
+ return (strcmp((char*)nsPtr->href, ns) == 0);
} else {
return FALSE;
}
@@ -230,11 +230,11 @@ int attr_is_equal_ex(xmlAttrPtr node, char *name, char *ns)
int node_is_equal_ex(xmlNodePtr node, char *name, char *ns)
{
- if (name == NULL || strcmp(node->name, name) == 0) {
+ if (name == NULL || strcmp((char*)node->name, name) == 0) {
if (ns) {
xmlNsPtr nsPtr = node_find_ns(node);
if (nsPtr) {
- return (strcmp(nsPtr->href, ns) == 0);
+ return (strcmp((char*)nsPtr->href, ns) == 0);
} else {
return FALSE;
}
@@ -296,7 +296,7 @@ xmlNodePtr get_node_with_attribute_ex(xmlNodePtr node, char *name, char *name_ns
}
attr = get_attribute_ex(node->properties, attribute, attr_ns);
- if (attr != NULL && strcmp(attr->children->content, value) == 0) {
+ if (attr != NULL && strcmp((char*)attr->children->content, value) == 0) {
return node;
}
node = node->next;
@@ -309,7 +309,7 @@ xmlNodePtr get_node_with_attribute_recursive_ex(xmlNodePtr node, char *name, cha
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) {
+ if (attr != NULL && strcmp((char*)attr->children->content, value) == 0) {
return node;
}
}
@@ -324,15 +324,15 @@ xmlNodePtr get_node_with_attribute_recursive_ex(xmlNodePtr node, char *name, cha
return NULL;
}
-int parse_namespace(const char *inval, char **value, char **namespace)
+int parse_namespace(const xmlChar *inval, char **value, char **namespace)
{
- char *found = strrchr(inval, ':');
+ char *found = strrchr((char*)inval, ':');
- if (found != NULL && found != inval) {
- (*namespace) = estrndup(inval, found - inval);
+ if (found != NULL && found != (char*)inval) {
+ (*namespace) = estrndup((char*)inval, found - (char*)inval);
(*value) = estrdup(++found);
} else {
- (*value) = estrdup(inval);
+ (*value) = estrdup((char*)inval);
(*namespace) = NULL;
}
diff --git a/ext/soap/php_xml.h b/ext/soap/php_xml.h
index c30d3ec02..b43a219dd 100644
--- a/ext/soap/php_xml.h
+++ b/ext/soap/php_xml.h
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_xml.h,v 1.17.2.1 2006/01/01 12:50:13 sniper Exp $ */
+/* $Id: php_xml.h,v 1.17.2.1.2.1 2006/07/11 14:24:18 dmitry Exp $ */
#ifndef PHP_SOAP_XML_H
#define PHP_SOAP_XML_H
@@ -42,7 +42,7 @@ 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);
+int parse_namespace(const xmlChar *inval,char **value,char **namespace);
#ifndef ZEND_ENGINE_2
int php_stream_xmlIO_match_wrapper(const char *filename);
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 1cae27a54..22007f07a 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: soap.c,v 1.156.2.29 2006/05/25 08:14:50 dmitry Exp $ */
+/* $Id: soap.c,v 1.156.2.28.2.16 2006/10/03 19:51:01 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -33,6 +33,7 @@
static int le_sdl = 0;
int le_url = 0;
static int le_service = 0;
+static int le_typemap = 0;
typedef struct _soapHeader {
sdlFunctionPtr function;
@@ -66,6 +67,7 @@ static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName,
static void delete_service(void *service);
static void delete_url(void *handle);
+static void delete_hashtable(void *hashtable);
#ifndef ZEND_ENGINE_2
static void soap_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);
@@ -157,6 +159,9 @@ static void soap_error_handler(int error_num, const char *error_filename, const
#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 FIND_TYPEMAP_PROPERTY(ss,tmp) zend_hash_find(Z_OBJPROP_P(ss), "typemap", sizeof("typemap"), (void **)&tmp)
+#define FETCH_TYPEMAP_RES(ss,tmp) ss = (HashTable*) zend_fetch_resource(tmp TSRMLS_CC, -1, "typemap", NULL, 1, le_typemap)
+
#define FETCH_THIS_SERVICE(ss) \
{ \
zval **tmp; \
@@ -239,15 +244,13 @@ PHP_FUNCTION(is_soap_fault);
/* Server Functions */
PHP_METHOD(SoapServer, SoapServer);
PHP_METHOD(SoapServer, setClass);
+PHP_METHOD(SoapServer, setObject);
PHP_METHOD(SoapServer, addFunction);
PHP_METHOD(SoapServer, getFunctions);
PHP_METHOD(SoapServer, handle);
PHP_METHOD(SoapServer, setPersistence);
PHP_METHOD(SoapServer, fault);
PHP_METHOD(SoapServer, addSoapHeader);
-#ifdef HAVE_PHP_DOMXML
-PHP_METHOD(PHP_SOAP_SERVER_CLASS, map);
-#endif
/* Client Functions */
PHP_METHOD(SoapClient, SoapClient);
@@ -278,17 +281,9 @@ 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}
@@ -306,14 +301,12 @@ 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, setObject, 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)
PHP_ME(SoapServer, addSoapHeader, NULL, 0)
-#ifdef HAVE_PHP_DOMXML
- PHP_ME(SoapServer, map, NULL, 0)
-#endif
{NULL, NULL, NULL}
};
@@ -322,7 +315,7 @@ 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_BEGIN_ARG_INFO_EX(__soap_call_args, 0, 0, 2)
ZEND_ARG_PASS_INFO(0)
ZEND_ARG_PASS_INFO(0)
ZEND_ARG_PASS_INFO(0)
@@ -337,11 +330,7 @@ unsigned char __soap_call_args[] = { 5, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYRE
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
+ ZEND_NAMED_ME(__soapCall, ZEND_MN(SoapClient___call), __soap_call_args, 0)
PHP_ME(SoapClient, __getLastRequest, NULL, 0)
PHP_ME(SoapClient, __getLastResponse, NULL, 0)
PHP_ME(SoapClient, __getLastRequestHeaders, NULL, 0)
@@ -484,7 +473,7 @@ 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->typemap = NULL;
soap_globals->use_soap_error_handler = 0;
soap_globals->error_code = NULL;
soap_globals->error_object = NULL;
@@ -509,7 +498,7 @@ PHP_MSHUTDOWN_FUNCTION(soap)
PHP_RINIT_FUNCTION(soap)
{
- SOAP_GLOBAL(overrides) = NULL;
+ SOAP_GLOBAL(typemap) = NULL;
SOAP_GLOBAL(use_soap_error_handler) = 0;
SOAP_GLOBAL(error_code) = NULL;
SOAP_GLOBAL(error_object) = NULL;
@@ -546,7 +535,7 @@ PHP_MINIT_FUNCTION(soap)
zend_internal_function fe;
fe.type = ZEND_INTERNAL_FUNCTION;
- fe.handler = ZEND_FN(SoapClient___call);
+ fe.handler = ZEND_MN(SoapClient___call);
fe.function_name = NULL;
fe.scope = NULL;
fe.fn_flags = 0;
@@ -575,7 +564,7 @@ PHP_MINIT_FUNCTION(soap)
/* 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(), NULL TSRMLS_CC);
+ 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
@@ -590,6 +579,7 @@ PHP_MINIT_FUNCTION(soap)
le_sdl = register_list_destructors(delete_sdl, NULL);
le_url = register_list_destructors(delete_url, NULL);
le_service = register_list_destructors(delete_service, NULL);
+ le_typemap = register_list_destructors(delete_hashtable, 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);
@@ -695,42 +685,6 @@ PHP_MINFO_FUNCTION(soap)
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 */
@@ -938,6 +892,122 @@ PHP_METHOD(SoapVar, SoapVar)
/* }}} */
+static HashTable* soap_create_typemap(sdlPtr sdl, HashTable *ht TSRMLS_DC)
+{
+ zval **tmp;
+ HashTable *ht2;
+ HashPosition pos1, pos2;
+ HashTable *typemap = NULL;
+
+ zend_hash_internal_pointer_reset_ex(ht, &pos1);
+ while (zend_hash_get_current_data_ex(ht, (void**)&tmp, &pos1) == SUCCESS) {
+ char *type_name = NULL;
+ char *type_ns = NULL;
+ zval *to_xml = NULL;
+ zval *to_zval = NULL;
+ encodePtr enc, new_enc;
+
+ if (Z_TYPE_PP(tmp) != IS_ARRAY) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Wrong 'typemap' option");
+ }
+ ht2 = Z_ARRVAL_PP(tmp);
+
+ zend_hash_internal_pointer_reset_ex(ht2, &pos2);
+ while (zend_hash_get_current_data_ex(ht2, (void**)&tmp, &pos2) == SUCCESS) {
+ char *name = NULL;
+ unsigned int name_len;
+ ulong index;
+
+ zend_hash_get_current_key_ex(ht2, &name, &name_len, &index, 0, &pos2);
+ if (name) {
+ if (name_len == sizeof("type_name") &&
+ strncmp(name, "type_name", sizeof("type_name")-1) == 0) {
+ if (Z_TYPE_PP(tmp) == IS_STRING) {
+ type_name = Z_STRVAL_PP(tmp);
+ } else if (Z_TYPE_PP(tmp) != IS_NULL) {
+ }
+ } else if (name_len == sizeof("type_ns") &&
+ strncmp(name, "type_ns", sizeof("type_ns")-1) == 0) {
+ if (Z_TYPE_PP(tmp) == IS_STRING) {
+ type_ns = Z_STRVAL_PP(tmp);
+ } else if (Z_TYPE_PP(tmp) != IS_NULL) {
+ }
+ } else if (name_len == sizeof("to_xml") &&
+ strncmp(name, "to_xml", sizeof("to_xml")-1) == 0) {
+ to_xml = *tmp;
+ } else if (name_len == sizeof("from_xml") &&
+ strncmp(name, "from_xml", sizeof("from_xml")-1) == 0) {
+ to_zval = *tmp;
+ }
+ }
+ zend_hash_move_forward_ex(ht2, &pos2);
+ }
+
+ if (type_name) {
+ smart_str nscat = {0};
+
+ if (type_ns) {
+ enc = get_encoder(sdl, type_ns, type_name);
+ } else {
+ enc = get_encoder_ex(sdl, type_name, strlen(type_name));
+ }
+
+ new_enc = emalloc(sizeof(encode));
+ memset(new_enc, 0, sizeof(encode));
+
+ if (enc) {
+ 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;
+ } else {
+ enc = get_conversion(UNKNOWN_TYPE);
+ new_enc->details.type = enc->details.type;
+ if (type_ns) {
+ new_enc->details.ns = estrdup(type_ns);
+ }
+ new_enc->details.type_str = estrdup(type_name);
+ }
+ new_enc->to_xml = enc->to_xml;
+ new_enc->to_zval = enc->to_zval;
+ new_enc->details.map = emalloc(sizeof(soapMapping));
+ memset(new_enc->details.map, 0, sizeof(soapMapping));
+ if (to_xml) {
+ zval_add_ref(&to_xml);
+ new_enc->details.map->to_xml = to_xml;
+ new_enc->to_xml = to_xml_user;
+ } else if (enc->details.map && enc->details.map->to_xml) {
+ zval_add_ref(&enc->details.map->to_xml);
+ new_enc->details.map->to_xml = enc->details.map->to_xml;
+ }
+ if (to_zval) {
+ zval_add_ref(&to_zval);
+ new_enc->details.map->to_zval = to_zval;
+ new_enc->to_zval = to_zval_user;
+ } else if (enc->details.map && enc->details.map->to_zval) {
+ zval_add_ref(&enc->details.map->to_zval);
+ new_enc->details.map->to_zval = enc->details.map->to_zval;
+ }
+ if (!typemap) {
+ typemap = emalloc(sizeof(HashTable));
+ zend_hash_init(typemap, 0, NULL, delete_encoder, 0);
+ }
+
+ if (type_ns) {
+ smart_str_appends(&nscat, type_ns);
+ smart_str_appendc(&nscat, ':');
+ }
+ smart_str_appends(&nscat, type_name);
+ smart_str_0(&nscat);
+ zend_hash_update(typemap, nscat.c, nscat.len + 1, &new_enc, sizeof(encodePtr), NULL);
+ smart_str_free(&nscat);
+ }
+ zend_hash_move_forward_ex(ht, &pos1);
+ }
+ return typemap;
+}
+
+
/* {{{ proto object SoapServer::SoapServer ( mixed wsdl [, array options])
SoapServer constructor */
PHP_METHOD(SoapServer, SoapServer)
@@ -947,6 +1017,7 @@ PHP_METHOD(SoapServer, SoapServer)
int ret;
int version = SOAP_1_1;
long cache_wsdl;
+ HashTable *typemap_ht = NULL;
SOAP_SERVER_BEGIN_CODE();
@@ -1007,10 +1078,16 @@ PHP_METHOD(SoapServer, SoapServer)
zval *ztmp;
ALLOC_HASHTABLE(service->class_map);
- zend_hash_init(service->class_map, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(service->class_map, zend_hash_num_elements((*tmp)->value.ht), 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 *));
}
+ if (zend_hash_find(ht, "typemap", sizeof("typemap"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_ARRAY &&
+ zend_hash_num_elements(Z_ARRVAL_PP(tmp)) > 0) {
+ typemap_ht = Z_ARRVAL_PP(tmp);
+ }
+
if (zend_hash_find(ht, "features", sizeof("features"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG) {
service->features = Z_LVAL_PP(tmp);
@@ -1042,6 +1119,10 @@ PHP_METHOD(SoapServer, SoapServer)
}
}
}
+
+ if (typemap_ht) {
+ service->typemap = soap_create_typemap(service->sdl, typemap_ht TSRMLS_CC);
+ }
ret = zend_list_insert(service, le_service);
add_property_resource(this_ptr, "service", ret);
@@ -1051,127 +1132,6 @@ PHP_METHOD(SoapServer, SoapServer)
/* }}} */
-#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::setPersistence ( int mode )
Sets persistence mode of SoapServer */
PHP_METHOD(SoapServer, setPersistence)
@@ -1265,6 +1225,33 @@ PHP_METHOD(SoapServer, setClass)
/* }}} */
+/* {{{ proto void SoapServer::setObject(object)
+ Sets object which will handle SOAP requests */
+PHP_METHOD(SoapServer, setObject)
+{
+ soapServicePtr service;
+ zval *obj;
+
+ SOAP_SERVER_BEGIN_CODE();
+
+ FETCH_THIS_SERVICE(service);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+ }
+
+ service->type = SOAP_OBJECT;
+
+ MAKE_STD_ZVAL(service->soap_object);
+ *service->soap_object = *obj;
+ zval_copy_ctor(service->soap_object);
+ INIT_PZVAL(service->soap_object);
+
+ SOAP_SERVER_END_CODE();
+}
+/* }}} */
+
+
/* {{{ proto array SoapServer::getFunctions(void)
Returns list of defined functions */
PHP_METHOD(SoapServer, getFunctions)
@@ -1278,7 +1265,9 @@ PHP_METHOD(SoapServer, getFunctions)
FETCH_THIS_SERVICE(service);
array_init(return_value);
- if (service->type == SOAP_CLASS) {
+ if (service->type == SOAP_OBJECT) {
+ ft = &(Z_OBJCE_P(service->soap_object)->function_table);
+ } else if (service->type == SOAP_CLASS) {
ft = &service->soap_class.ce->function_table;
} else if (service->soap_functions.functions_all == TRUE) {
ft = EG(function_table);
@@ -1297,7 +1286,7 @@ PHP_METHOD(SoapServer, getFunctions)
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)) {
+ if ((service->type != SOAP_OBJECT && 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);
@@ -1334,7 +1323,7 @@ PHP_METHOD(SoapServer, addFunction)
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_init(service->soap_functions.ft, zend_hash_num_elements(Z_ARRVAL_P(function_name)), NULL, ZVAL_PTR_DTOR, 0);
}
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(function_name), &pos);
@@ -1421,7 +1410,7 @@ PHP_METHOD(SoapServer, handle)
char *arg = NULL;
int arg_len;
xmlCharEncodingHandlerPtr old_encoding;
- HashTable *old_class_map;
+ HashTable *old_class_map, *old_typemap;
int old_features;
SOAP_SERVER_BEGIN_CODE();
@@ -1546,9 +1535,9 @@ PHP_METHOD(SoapServer, handle)
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) {
+ if (strcmp((char*)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) {
+ } else if (strcmp((char*)env->ns->href,SOAP_1_2_ENV_NAMESPACE) == 0) {
SOAP_GLOBAL(soap_version) = SOAP_1_2;
}
}
@@ -1562,16 +1551,32 @@ PHP_METHOD(SoapServer, handle)
SOAP_GLOBAL(encoding) = service->encoding;
old_class_map = SOAP_GLOBAL(class_map);
SOAP_GLOBAL(class_map) = service->class_map;
+ old_typemap = SOAP_GLOBAL(typemap);
+ SOAP_GLOBAL(typemap) = service->typemap;
old_features = SOAP_GLOBAL(features);
SOAP_GLOBAL(features) = service->features;
old_soap_version = SOAP_GLOBAL(soap_version);
function = deserialize_function_call(service->sdl, doc_request, service->actor, &function_name, &num_params, &params, &soap_version, &soap_headers TSRMLS_CC);
xmlFreeDoc(doc_request);
+#ifdef ZEND_ENGINE_2
+ if (EG(exception)) {
+ php_end_ob_buffer(0, 0 TSRMLS_CC);
+ 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);
+ }
+ goto fail;
+ }
+#endif
+
service->soap_headers_ptr = &soap_headers;
soap_obj = NULL;
- if (service->type == SOAP_CLASS) {
+ if (service->type == SOAP_OBJECT) {
+ soap_obj = service->soap_object;
+ function_table = &((Z_OBJCE_P(soap_obj))->function_table);
+ } else if (service->type == SOAP_CLASS) {
#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) {
@@ -1674,7 +1679,6 @@ PHP_METHOD(SoapServer, handle)
#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) {
@@ -1703,9 +1707,9 @@ PHP_METHOD(SoapServer, handle)
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) ||
- (service->type == SOAP_CLASS &&
+ ((service->type == SOAP_CLASS || service->type == SOAP_OBJECT) &&
zend_hash_exists(function_table, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)))) {
- if (service->type == SOAP_CLASS) {
+ if (service->type == SOAP_CLASS || service->type == SOAP_OBJECT) {
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);
@@ -1724,7 +1728,7 @@ PHP_METHOD(SoapServer, handle)
php_end_ob_buffer(0, 0 TSRMLS_CC);
soap_server_fault_ex(function, &h->retval, h TSRMLS_CC);
efree(fn_name);
- if (soap_obj) {zval_ptr_dtor(&soap_obj);}
+ if (service->type == SOAP_CLASS && soap_obj) {zval_ptr_dtor(&soap_obj);}
goto fail;
#ifdef ZEND_ENGINE_2
} else if (EG(exception)) {
@@ -1740,7 +1744,7 @@ PHP_METHOD(SoapServer, handle)
soap_server_fault_ex(function, EG(exception), h TSRMLS_CC);
}
efree(fn_name);
- if (soap_obj) {zval_ptr_dtor(&soap_obj);}
+ if (service->type == SOAP_CLASS && soap_obj) {zval_ptr_dtor(&soap_obj);}
goto fail;
#endif
}
@@ -1753,17 +1757,21 @@ PHP_METHOD(SoapServer, handle)
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 &&
+ ((service->type == SOAP_CLASS || service->type == SOAP_OBJECT) &&
zend_hash_exists(function_table, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)))) {
- if (service->type == SOAP_CLASS) {
+ if (service->type == SOAP_CLASS || service->type == SOAP_OBJECT) {
call_status = call_user_function(NULL, &soap_obj, &function_name, &retval, num_params, params TSRMLS_CC);
+ if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
- if (service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
- zval_ptr_dtor(&soap_obj);
- }
+ if (service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
+ zval_ptr_dtor(&soap_obj);
+ soap_obj = NULL;
+ }
#else
- zval_ptr_dtor(&soap_obj);
+ zval_ptr_dtor(&soap_obj);
+ soap_obj = NULL;
#endif
+ }
} else {
call_status = call_user_function(EG(function_table), NULL, &function_name, &retval, num_params, params TSRMLS_CC);
}
@@ -1779,12 +1787,14 @@ PHP_METHOD(SoapServer, handle)
instanceof_function(Z_OBJCE_P(EG(exception)), soap_fault_class_entry TSRMLS_CC)) {
soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC);
}
+ if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
- if (soap_obj && service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
+ if (soap_obj && service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
#else
- if (soap_obj) {
+ if (soap_obj) {
#endif
- zval_ptr_dtor(&soap_obj);
+ zval_ptr_dtor(&soap_obj);
+ }
}
goto fail;
}
@@ -1806,14 +1816,32 @@ PHP_METHOD(SoapServer, handle)
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));
}
+#ifdef ZEND_ENGINE_2
+ if (EG(exception)) {
+ php_end_ob_buffer(0, 0 TSRMLS_CC);
+ 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);
+ }
+ if (service->type == SOAP_CLASS) {
+#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
+ if (soap_obj && service->soap_class.persistance != SOAP_PERSISTENCE_SESSION) {
+#else
+ if (soap_obj) {
+#endif
+ zval_ptr_dtor(&soap_obj);
+ }
+ }
+ goto fail;
+ }
+#endif
+
/* Flush buffer */
php_end_ob_buffer(0, 0 TSRMLS_CC);
@@ -1846,6 +1874,7 @@ fail:
SOAP_GLOBAL(encoding) = old_encoding;
SOAP_GLOBAL(sdl) = old_sdl;
SOAP_GLOBAL(class_map) = old_class_map;
+ SOAP_GLOBAL(typemap) = old_typemap;
SOAP_GLOBAL(features) = old_features;
/* Free soap headers */
@@ -1937,7 +1966,8 @@ PHP_METHOD(SoapServer, addSoapHeader)
static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader *hdr TSRMLS_DC)
{
int soap_version;
- xmlChar *buf, cont_len[30];
+ xmlChar *buf;
+ char cont_len[30];
int size;
xmlDocPtr doc_return;
@@ -2011,7 +2041,9 @@ static void soap_error_handler(int error_num, const char *error_filename, const
char buffer[1024];
int buffer_len;
zval outbuf, outbuflen;
+#ifdef va_copy
va_list argcopy;
+#endif
int old = PG(display_errors);
INIT_ZVAL(outbuf);
@@ -2058,7 +2090,9 @@ static void soap_error_handler(int error_num, const char *error_filename, const
int old = PG(display_errors);
int fault = 0;
zval fault_obj;
+#ifdef va_copy
va_list argcopy;
+#endif
if (error_num == E_USER_ERROR ||
error_num == E_COMPILE_ERROR ||
@@ -2152,6 +2186,8 @@ PHP_METHOD(SoapClient, SoapClient)
int soap_version = SOAP_1_1;
php_stream_context *context = NULL;
long cache_wsdl;
+ sdlPtr sdl = NULL;
+ HashTable *typemap_ht = NULL;
SOAP_CLIENT_BEGIN_CODE();
@@ -2303,6 +2339,12 @@ PHP_METHOD(SoapClient, SoapClient)
add_property_zval(this_ptr, "_classmap", class_map);
}
+ if (zend_hash_find(ht, "typemap", sizeof("typemap"), (void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_ARRAY &&
+ zend_hash_num_elements(Z_ARRVAL_PP(tmp)) > 0) {
+ typemap_ht = Z_ARRVAL_PP(tmp);
+ }
+
if (zend_hash_find(ht, "features", sizeof("features"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG) {
add_property_long(this_ptr, "_features", Z_LVAL_PP(tmp));
@@ -2336,7 +2378,6 @@ PHP_METHOD(SoapClient, SoapClient)
if (wsdl) {
int old_soap_version, ret;
- sdlPtr sdl;
old_soap_version = SOAP_GLOBAL(soap_version);
SOAP_GLOBAL(soap_version) = soap_version;
@@ -2349,6 +2390,15 @@ PHP_METHOD(SoapClient, SoapClient)
SOAP_GLOBAL(soap_version) = old_soap_version;
}
+ if (typemap_ht) {
+ HashTable *typemap = soap_create_typemap(sdl, typemap_ht TSRMLS_CC);
+ if (typemap) {
+ int ret;
+
+ ret = zend_list_insert(typemap, le_typemap);
+ add_property_resource(this_ptr, "typemap", ret);
+ }
+ }
SOAP_CLIENT_END_CODE();
}
/* }}} */
@@ -2447,6 +2497,7 @@ static void do_soap_call(zval* this_ptr,
xmlCharEncodingHandlerPtr old_encoding;
HashTable *old_class_map;
int old_features;
+ HashTable *old_typemap, *typemap = NULL;
SOAP_CLIENT_BEGIN_CODE();
@@ -2472,6 +2523,9 @@ static void do_soap_call(zval* this_ptr,
if (FIND_SDL_PROPERTY(this_ptr,tmp) != FAILURE) {
FETCH_SDL_RES(sdl,tmp);
}
+ if (FIND_TYPEMAP_PROPERTY(this_ptr,tmp) != FAILURE) {
+ FETCH_TYPEMAP_RES(typemap,tmp);
+ }
clear_soap_fault(this_ptr TSRMLS_CC);
@@ -2492,6 +2546,8 @@ static void do_soap_call(zval* this_ptr,
} else {
SOAP_GLOBAL(class_map) = NULL;
}
+ old_typemap = SOAP_GLOBAL(typemap);
+ SOAP_GLOBAL(typemap) = typemap;
old_features = SOAP_GLOBAL(features);
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_features", sizeof("_features"), (void **) &tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_LONG) {
@@ -2594,7 +2650,8 @@ static void do_soap_call(zval* this_ptr,
}
}
#ifdef ZEND_ENGINE_2
- if (Z_TYPE_P(return_value) == IS_OBJECT &&
+ if (!EG(exception) &&
+ 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)) {
@@ -2611,6 +2668,7 @@ static void do_soap_call(zval* this_ptr,
xmlCharEncCloseFunc(SOAP_GLOBAL(encoding));
}
SOAP_GLOBAL(features) = old_features;
+ SOAP_GLOBAL(typemap) = old_typemap;
SOAP_GLOBAL(class_map) = old_class_map;
SOAP_GLOBAL(encoding) = old_encoding;
SOAP_GLOBAL(sdl) = old_sdl;
@@ -2632,7 +2690,7 @@ static void verify_soap_headers_array(HashTable *ht TSRMLS_DC)
}
-/* {{{ proto mixed SoapClient::__call ( string function_name [, array arguments [, array options [, array input_headers [, array output_headers]]]])
+/* {{{ 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)
{
@@ -2873,8 +2931,10 @@ PHP_METHOD(SoapClient, __doRequest)
if (SOAP_GLOBAL(features) & SOAP_WAIT_ONE_WAY_CALLS) {
one_way = 0;
}
- if (one_way && make_http_soap_request(this_ptr, buf, buf_size, location, action, version, NULL, NULL TSRMLS_CC)) {
- RETURN_EMPTY_STRING();
+ if (one_way) {
+ if (make_http_soap_request(this_ptr, buf, buf_size, location, action, version, NULL, NULL TSRMLS_CC)) {
+ RETURN_EMPTY_STRING();
+ }
} else 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;
@@ -2930,7 +2990,7 @@ PHP_METHOD(SoapClient, __setCookie)
If no value is specified, all of the headers are removed. */
PHP_METHOD(SoapClient, __setSoapHeaders)
{
- zval *headers;
+ zval *headers = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &headers) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
@@ -2951,7 +3011,9 @@ PHP_METHOD(SoapClient, __setSoapHeaders)
zval *default_headers;
ALLOC_INIT_ZVAL(default_headers);
array_init(default_headers);
+ headers->refcount++;
add_next_index_zval(default_headers, headers);
+ default_headers->refcount--;
add_property_zval(this_ptr, "__default_headers", default_headers);
} else{
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid SOAP header");
@@ -3055,7 +3117,7 @@ static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, cha
if (fault_string != NULL) {
add_property_string(obj, "faultstring", fault_string, 1);
#ifdef ZEND_ENGINE_2
- zend_update_property_string(zend_exception_get_default(), obj, "message", sizeof("message")-1, fault_string TSRMLS_CC);
+ zend_update_property_string(zend_exception_get_default(TSRMLS_C), obj, "message", sizeof("message")-1, fault_string TSRMLS_CC);
#endif
}
if (fault_code != NULL) {
@@ -3192,7 +3254,7 @@ static sdlFunctionPtr find_function(sdlPtr sdl, xmlNodePtr func, zval* function_
{
sdlFunctionPtr function;
- function = get_function(sdl, func->name);
+ function = get_function(sdl, (char*)func->name);
if (function && function->binding && function->binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
if (fnb->style == SOAP_DOCUMENT) {
@@ -3252,7 +3314,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
} 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) {
+ } else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
}
}
@@ -3294,7 +3356,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
} 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) {
+ } else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
}
}
@@ -3330,12 +3392,12 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
} 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) {
+ if (attr && strcmp((char*)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) {
+ if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
}
}
@@ -3360,7 +3422,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
} 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) {
+ } else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
}
}
@@ -3375,37 +3437,37 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
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) {
+ if (attr && strcmp((char*)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)) {
+ if (strcmp((char*)attr->children->content,SOAP_1_1_ACTOR_NEXT) != 0 &&
+ (actor == NULL || strcmp((char*)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) {
+ if (attr && strcmp((char*)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)) {
+ if (strcmp((char*)attr->children->content,SOAP_1_2_ACTOR_UNLIMATERECEIVER) != 0 &&
+ strcmp((char*)attr->children->content,SOAP_1_2_ACTOR_NEXT) != 0 &&
+ (actor == NULL || strcmp((char*)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) {
+ if (strcmp((char*)attr->children->content,"1") == 0 ||
+ strcmp((char*)attr->children->content,"true") == 0) {
mustUnderstand = 1;
- } else if (strcmp(attr->children->content,"0") == 0 ||
- strcmp(attr->children->content,"false") == 0) {
+ } else if (strcmp((char*)attr->children->content,"0") == 0 ||
+ strcmp((char*)attr->children->content,"false") == 0) {
mustUnderstand = 0;
} else {
soap_server_fault("Client","mustUnderstand value is not boolean", NULL, NULL, NULL TSRMLS_CC);
@@ -3422,7 +3484,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
smart_str key = {0};
if (hdr_func->ns) {
- smart_str_appends(&key, hdr_func->ns->href);
+ smart_str_appends(&key, (char*)hdr_func->ns->href);
smart_str_appendc(&key, ':');
}
smart_str_appendl(&key, Z_STRVAL(h->function_name), Z_STRLEN(h->function_name));
@@ -3487,9 +3549,9 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
if (style == SOAP_RPC) {
ns = encode_add_ns(body, fnb->output.ns);
if (function->responseName) {
- method = xmlNewChild(body, ns, function->responseName, NULL);
+ method = xmlNewChild(body, ns, BAD_CAST(function->responseName), NULL);
} else if (function->responseParameters) {
- method = xmlNewChild(body, ns, function->functionName, NULL);
+ method = xmlNewChild(body, ns, BAD_CAST(function->functionName), NULL);
}
}
} else {
@@ -3497,7 +3559,7 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
use = main?SOAP_ENCODED:SOAP_LITERAL;
if (style == SOAP_RPC) {
ns = encode_add_ns(body, uri);
- method = xmlNewChild(body, ns, function_name, NULL);
+ method = xmlNewChild(body, ns, BAD_CAST(function_name), NULL);
}
}
@@ -3517,8 +3579,8 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
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);
+ xmlNs *rpc_ns = xmlNewNs(body, BAD_CAST(RPC_SOAP12_NAMESPACE), BAD_CAST(RPC_SOAP12_NS_PREFIX));
+ rpc_result = xmlNewChild(method, rpc_ns, BAD_CAST("result"), NULL);
param = serialize_parameter(parameter, ret, 0, "return", use, method TSRMLS_CC);
xmlNodeSetContent(rpc_result,param->name);
} else {
@@ -3529,12 +3591,12 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
- xmlNodeSetName(param, parameter->element->name);
+ xmlNodeSetName(param, BAD_CAST(parameter->element->name));
xmlSetNs(param, ns);
}
- } else if (strcmp(param->name,"return") == 0) {
+ } else if (strcmp((char*)param->name,"return") == 0) {
ns = encode_add_ns(param, uri);
- xmlNodeSetName(param, function_name);
+ xmlNodeSetName(param, BAD_CAST(function_name));
xmlSetNs(param, ns);
}
}
@@ -3546,8 +3608,8 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
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;
+ unsigned int param_name_len;
+ ulong param_index = i;
zend_hash_get_current_key_ex(Z_ARRVAL_P(ret), &param_name, &param_name_len, &param_index, 0, &pos);
parameter = get_param(function, param_name, param_index, TRUE);
@@ -3558,7 +3620,7 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
- xmlNodeSetName(param, parameter->element->name);
+ xmlNodeSetName(param, BAD_CAST(parameter->element->name));
xmlSetNs(param, ns);
}
}
@@ -3569,7 +3631,7 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
}
}
if (use == SOAP_ENCODED && version == SOAP_1_2 && method != NULL) {
- xmlSetNsProp(method, body->ns, "encodingStyle", SOAP_1_2_ENC_NAMESPACE);
+ xmlSetNsProp(method, body->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE));
}
return use;
}
@@ -3584,17 +3646,17 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
encode_reset_ns();
- doc = xmlNewDoc("1.0");
+ doc = xmlNewDoc(BAD_CAST("1.0"));
doc->charset = XML_CHAR_ENCODING_UTF8;
- doc->encoding = xmlStrdup((xmlChar*)"UTF-8");
+ doc->encoding = xmlCharStrdup("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);
+ envelope = xmlNewDocNode(doc, NULL, BAD_CAST("Envelope"), NULL);
+ ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_1_ENV_NAMESPACE), BAD_CAST(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);
+ envelope = xmlNewDocNode(doc, NULL, BAD_CAST("Envelope"), NULL);
+ ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENV_NAMESPACE), BAD_CAST(SOAP_1_2_ENV_NS_PREFIX));
xmlSetNs(envelope,ns);
} else {
soap_server_fault("Server", "Unknown SOAP version", NULL, NULL, NULL TSRMLS_CC);
@@ -3620,7 +3682,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
char *hdr_ns = headers->hdr?headers->hdr->ns:NULL;
char *hdr_name = Z_STRVAL(headers->function_name);
- head = xmlNewChild(envelope, ns, "Header", NULL);
+ head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL);
if (Z_TYPE_P(hdr_ret) == IS_OBJECT &&
instanceof_function(Z_OBJCE_P(hdr_ret), soap_header_class_entry TSRMLS_CC)) {
HashTable* ht = Z_OBJPROP_P(hdr_ret);
@@ -3660,17 +3722,17 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
} else {
xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head);
if (hdr_name) {
- xmlNodeSetName(xmlHdr,hdr_name);
+ xmlNodeSetName(xmlHdr, BAD_CAST(hdr_name));
}
if (hdr_ns) {
- xmlNsPtr nsptr = encode_add_ns(xmlHdr,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);
+ body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL);
+ param = xmlNewChild(body, ns, BAD_CAST("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);
@@ -3725,55 +3787,49 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
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);
+ xmlNodePtr node = xmlNewNode(NULL, BAD_CAST("faultcode"));
+ char *str = php_escape_html_entities((unsigned char*)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));
+ xmlChar *code = xmlBuildQName(BAD_CAST(str), nsptr->prefix, NULL, 0);
+ xmlNodeSetContent(node, code);
+ xmlFree(code);
} else {
- xmlNodeSetContentLen(node, str, new_len);
+ xmlNodeSetContentLen(node, BAD_CAST(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);
+ xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), *tmp, SOAP_LITERAL, param);
+ xmlNodeSetName(node, BAD_CAST("faultstring"));
}
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);
+ xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), *tmp, SOAP_LITERAL, param);
+ xmlNodeSetName(node, BAD_CAST("faultactor"));
}
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);
+ xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Code"), NULL);
+ char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC);
+ node = xmlNewChild(node, ns, BAD_CAST("Value"), NULL);
if (fault_ns) {
xmlNsPtr nsptr = encode_add_ns(node, fault_ns);
- xmlNodeSetContent(node, xmlBuildQName(str, nsptr->prefix, NULL, 0));
+ xmlChar *code = xmlBuildQName(BAD_CAST(str), nsptr->prefix, NULL, 0);
+ xmlNodeSetContent(node, code);
+ xmlFree(code);
} else {
- xmlNodeSetContentLen(node, str, new_len);
+ xmlNodeSetContentLen(node, BAD_CAST(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);
+ xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Reason"), NULL);
+ node = master_to_xml(get_conversion(IS_STRING), *tmp, SOAP_LITERAL, node);
+ xmlNodeSetName(node, BAD_CAST("Text"));
+ xmlSetNs(node, ns);
}
detail_name = SOAP_1_2_ENV_NS_PREFIX":Detail";
}
@@ -3787,7 +3843,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
Z_TYPE_PP(tmp) != IS_NULL) {
detail = *tmp;
}
- node = xmlNewNode(NULL, detail_name);
+ node = xmlNewNode(NULL, BAD_CAST(detail_name));
xmlAddChild(param, node);
zend_hash_internal_pointer_reset(fault->details);
@@ -3820,13 +3876,13 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
} else {
if (sparam->element) {
xmlNsPtr ns = encode_add_ns(x, sparam->element->namens);
- xmlNodeSetName(x, sparam->element->name);
+ xmlNodeSetName(x, BAD_CAST(sparam->element->name));
xmlSetNs(x, ns);
}
}
}
if (use == SOAP_ENCODED && version == SOAP_1_2) {
- xmlSetNsProp(x, envelope->ns, "encodingStyle", SOAP_1_2_ENC_NAMESPACE);
+ xmlSetNsProp(x, envelope->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE));
}
} else if (zend_hash_find(prop, "detail", sizeof("detail"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) != IS_NULL) {
@@ -3837,7 +3893,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
if (headers) {
soapHeader *h;
- head = xmlNewChild(envelope, ns, "Header", NULL);
+ head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL);
h = headers;
while (h != NULL) {
if (Z_TYPE(h->retval) != IS_NULL) {
@@ -3891,7 +3947,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
} else {
xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head);
if (hdr_name) {
- xmlNodeSetName(xmlHdr,hdr_name);
+ xmlNodeSetName(xmlHdr, BAD_CAST(hdr_name));
}
if (hdr_ns) {
xmlNsPtr nsptr = encode_add_ns(xmlHdr,hdr_ns);
@@ -3908,7 +3964,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
}
}
- body = xmlNewChild(envelope, ns, "Body", NULL);
+ body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL);
if (serialize_response_call2(body, function, function_name, uri, ret, version, 1 TSRMLS_CC) == SOAP_ENCODED) {
use = SOAP_ENCODED;
@@ -3917,13 +3973,12 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
}
if (use == SOAP_ENCODED) {
- xmlNewNs(envelope, XSD_NAMESPACE, XSD_NS_PREFIX);
- xmlNewNs(envelope, XSI_NAMESPACE, XSI_NS_PREFIX);
+ xmlNewNs(envelope, BAD_CAST(XSD_NAMESPACE), BAD_CAST(XSD_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);
+ xmlNewNs(envelope, BAD_CAST(SOAP_1_1_ENC_NAMESPACE), BAD_CAST(SOAP_1_1_ENC_NS_PREFIX));
+ xmlSetNsProp(envelope, envelope->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_1_ENC_NAMESPACE));
} else if (version == SOAP_1_2) {
- xmlNewNs(envelope, SOAP_1_2_ENC_NAMESPACE, SOAP_1_2_ENC_NS_PREFIX);
+ xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENC_NAMESPACE), BAD_CAST(SOAP_1_2_ENC_NS_PREFIX));
}
}
@@ -3946,27 +4001,27 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
encode_reset_ns();
- doc = xmlNewDoc("1.0");
- doc->encoding = xmlStrdup((xmlChar*)"UTF-8");
+ doc = xmlNewDoc(BAD_CAST("1.0"));
+ doc->encoding = xmlCharStrdup("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);
+ envelope = xmlNewDocNode(doc, NULL, BAD_CAST("Envelope"), NULL);
+ ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_1_ENV_NAMESPACE), BAD_CAST(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);
+ envelope = xmlNewDocNode(doc, NULL, BAD_CAST("Envelope"), NULL);
+ ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENV_NAMESPACE), BAD_CAST(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);
+ head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL);
}
- body = xmlNewChild(envelope, ns, "Body", NULL);
+ body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL);
if (function && function->binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
@@ -3979,9 +4034,9 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
if (style == SOAP_RPC) {
ns = encode_add_ns(body, fnb->input.ns);
if (function->requestName) {
- method = xmlNewChild(body, ns, function->requestName, NULL);
+ method = xmlNewChild(body, ns, BAD_CAST(function->requestName), NULL);
} else {
- method = xmlNewChild(body, ns, function->functionName, NULL);
+ method = xmlNewChild(body, ns, BAD_CAST(function->functionName), NULL);
}
}
} else {
@@ -3994,7 +4049,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
/*style = SOAP_RPC;*/
if (style == SOAP_RPC) {
ns = encode_add_ns(body, uri);
- method = xmlNewChild(body, ns, function_name, NULL);
+ method = xmlNewChild(body, ns, BAD_CAST(function_name), NULL);
}
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "use", sizeof("use"), (void **)&zuse) == SUCCESS &&
@@ -4016,7 +4071,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
- xmlNodeSetName(param, parameter->element->name);
+ xmlNodeSetName(param, BAD_CAST(parameter->element->name));
xmlSetNs(param, ns);
}
}
@@ -4038,7 +4093,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
- xmlNodeSetName(param, parameter->element->name);
+ xmlNodeSetName(param, BAD_CAST(parameter->element->name));
xmlSetNs(param, ns);
}
}
@@ -4084,41 +4139,41 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
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));
+ xmlNodeSetName(h, BAD_CAST(Z_STRVAL_PP(name)));
} else {
- h = xmlNewNode(NULL, Z_STRVAL_PP(name));
- xmlAddChild(head,h);
+ h = xmlNewNode(NULL, BAD_CAST(Z_STRVAL_PP(name)));
+ xmlAddChild(head, h);
}
- nsptr = encode_add_ns(h,Z_STRVAL_PP(ns));
+ 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");
+ xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("1"));
} else {
- xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":mustUnderstand","true");
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("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));
+ xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(Z_STRVAL_PP(tmp)));
} else {
- xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",Z_STRVAL_PP(tmp));
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(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);
+ xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(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);
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(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);
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(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);
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_UNLIMATERECEIVER));
}
}
}
@@ -4129,15 +4184,14 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
}
if (use == SOAP_ENCODED) {
- xmlNewNs(envelope, XSD_NAMESPACE, XSD_NS_PREFIX);
- xmlNewNs(envelope, XSI_NAMESPACE, XSI_NS_PREFIX);
+ xmlNewNs(envelope, BAD_CAST(XSD_NAMESPACE), BAD_CAST(XSD_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);
+ xmlNewNs(envelope, BAD_CAST(SOAP_1_1_ENC_NAMESPACE), BAD_CAST(SOAP_1_1_ENC_NS_PREFIX));
+ xmlSetNsProp(envelope, envelope->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_1_ENC_NAMESPACE));
} else if (version == SOAP_1_2) {
- xmlNewNs(envelope, SOAP_1_2_ENC_NAMESPACE, SOAP_1_2_ENC_NS_PREFIX);
+ xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENC_NAMESPACE), BAD_CAST(SOAP_1_2_ENC_NS_PREFIX));
if (method) {
- xmlSetNsProp(method, envelope->ns, "encodingStyle", SOAP_1_2_ENC_NAMESPACE);
+ xmlSetNsProp(method, envelope->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE));
}
}
}
@@ -4203,8 +4257,8 @@ static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName,
enc = NULL;
}
xmlParam = master_to_xml(enc, val, style, parent);
- if (!strcmp(xmlParam->name, "BOGUS")) {
- xmlNodeSetName(xmlParam, paramName);
+ if (!strcmp((char*)xmlParam->name, "BOGUS")) {
+ xmlNodeSetName(xmlParam, BAD_CAST(paramName));
}
return xmlParam;
}
@@ -4294,12 +4348,12 @@ static sdlFunctionPtr get_doc_function(sdlPtr sdl, xmlNodePtr params)
zend_hash_internal_pointer_reset((*tmp)->requestParameters);
while (zend_hash_get_current_data((*tmp)->requestParameters, (void**)&param) == SUCCESS) {
if ((*param)->element) {
- if (strcmp((*param)->element->name,node->name) != 0) {
+ if (strcmp((*param)->element->name, (char*)node->name) != 0) {
ok = 0;
break;
}
if ((*param)->element->namens != NULL && node->ns != NULL) {
- if (strcmp((*param)->element->namens,node->ns->href) != 0) {
+ if (strcmp((*param)->element->namens, (char*)node->ns->href) != 0) {
ok = 0;
break;
}
@@ -4307,7 +4361,7 @@ static sdlFunctionPtr get_doc_function(sdlPtr sdl, xmlNodePtr params)
ok = 0;
break;
}
- } else if (strcmp((*param)->paramName,node->name) != 0) {
+ } else if (strcmp((*param)->paramName, (char*)node->name) != 0) {
ok = 0;
break;
}
@@ -4521,6 +4575,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level)
type->kind == XSD_TYPEKIND_EXTENSION) && type->encode) {
encodePtr enc = type->encode;
while (enc && enc->details.sdl_type &&
+ enc != enc->details.sdl_type->encode &&
enc->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE &&
enc->details.sdl_type->kind != XSD_TYPEKIND_LIST &&
enc->details.sdl_type->kind != XSD_TYPEKIND_UNION) {
@@ -4579,9 +4634,9 @@ static void delete_service(void *data)
efree(service->soap_functions.ft);
}
- if (service->mapping) {
- zend_hash_destroy(service->mapping);
- efree(service->mapping);
+ if (service->typemap) {
+ zend_hash_destroy(service->typemap);
+ efree(service->typemap);
}
if (service->soap_class.argc) {
@@ -4608,5 +4663,15 @@ static void delete_service(void *data)
zend_hash_destroy(service->class_map);
FREE_HASHTABLE(service->class_map);
}
+ if (service->soap_object) {
+ zval_ptr_dtor(&service->soap_object);
+ }
efree(service);
}
+
+static void delete_hashtable(void *data)
+{
+ HashTable *ht = (HashTable*)data;
+ zend_hash_destroy(ht);
+ efree(ht);
+}
diff --git a/ext/soap/tests/bugs/bug30799.phpt b/ext/soap/tests/bugs/bug30799.phpt
index 12d734769..3e902bfb2 100644
--- a/ext/soap/tests/bugs/bug30799.phpt
+++ b/ext/soap/tests/bugs/bug30799.phpt
@@ -21,5 +21,5 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><param0 xsi:type="SOAP-ENC:Struct"><a xsi:type="xsd:string">a</a><b xsi:type="xsd:string">b</b><c xsi:type="xsd:string">c</c></param0></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><param0 xsi:type="SOAP-ENC:Struct"><a xsi:type="xsd:string">a</a><b xsi:type="xsd:string">b</b><c xsi:type="xsd:string">c</c></param0></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
diff --git a/ext/soap/tests/bugs/bug31755.phpt b/ext/soap/tests/bugs/bug31755.phpt
index 2baf5b7ef..7901d6e0b 100644
--- a/ext/soap/tests/bugs/bug31755.phpt
+++ b/ext/soap/tests/bugs/bug31755.phpt
@@ -14,4 +14,4 @@ $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
+Fatal error: SoapHeader::SoapHeader(): Invalid parameters. Invalid namespace. in %s on line %d
diff --git a/ext/soap/tests/bugs/bug34449.phpt b/ext/soap/tests/bugs/bug34449.phpt
index b753efccf..44b3ff852 100755
--- a/ext/soap/tests/bugs/bug34449.phpt
+++ b/ext/soap/tests/bugs/bug34449.phpt
@@ -17,4 +17,4 @@ $client->AnyFunction(new SoapVar($my_xml, XSD_ANYXML));
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:AnyFunction><array><item/><item/><item/></array></ns1:AnyFunction></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:AnyFunction><array><item/><item/><item/></array></ns1:AnyFunction></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug35273.phpt b/ext/soap/tests/bugs/bug35273.phpt
index 12a555c5c..9c33d891c 100755
--- a/ext/soap/tests/bugs/bug35273.phpt
+++ b/ext/soap/tests/bugs/bug35273.phpt
@@ -18,4 +18,4 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://service" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:service.EchoService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoPerson><p xsi:type="ns2:Person"><name xsi:type="SOAP-ENC:string">Name</name><surname xsi:type="SOAP-ENC:string">Surname</surname></p></ns1:echoPerson></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://service" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:service.EchoService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoPerson><p xsi:type="ns2:Person"><name xsi:type="SOAP-ENC:string">Name</name><surname xsi:type="SOAP-ENC:string">Surname</surname></p></ns1:echoPerson></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug36575.phpt b/ext/soap/tests/bugs/bug36575.phpt
index d205f8805..b70073ae4 100755
--- a/ext/soap/tests/bugs/bug36575.phpt
+++ b/ext/soap/tests/bugs/bug36575.phpt
@@ -46,7 +46,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:test.soap#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="urn:test.soap.types#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><a1 xsi:type="ns2:A2"><var1 xsi:type="xsd:string">one</var1><var2 xsi:type="xsd:string">two</var2></a1></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:test.soap#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:test.soap.types#" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><a1 xsi:type="ns2:A2"><var1 xsi:type="xsd:string">one</var1><var2 xsi:type="xsd:string">two</var2></a1></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:test.soap#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="urn:test.soap.types#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><result xsi:type="ns2:A3"><var1 xsi:type="xsd:string">one</var1><var2 xsi:type="xsd:string">var two</var2><var3 xsi:type="xsd:string">var three</var3></result></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:test.soap#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:test.soap.types#" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><result xsi:type="ns2:A3"><var1 xsi:type="xsd:string">one</var1><var2 xsi:type="xsd:string">var two</var2><var3 xsi:type="xsd:string">var three</var3></result></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
diff --git a/ext/soap/tests/bugs/bug37278.phpt b/ext/soap/tests/bugs/bug37278.phpt
index eb96f2f3a..5d133e944 100755
--- a/ext/soap/tests/bugs/bug37278.phpt
+++ b/ext/soap/tests/bugs/bug37278.phpt
@@ -21,4 +21,4 @@ try {
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://bricolage.sourceforge.net/Bric/SOAP/Story" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:list_ids/></SOAP-ENV:Body></SOAP-ENV:Envelope> \ No newline at end of file
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://bricolage.sourceforge.net/Bric/SOAP/Story" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:list_ids/></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug38004.phpt b/ext/soap/tests/bugs/bug38004.phpt
new file mode 100755
index 000000000..508ccf19d
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38004.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Bug #38004 (Parameters in SoapServer are decoded twice)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function Test($param) {
+ global $g;
+ $g = $param->strA."\n".$param->strB."\n";
+ return $g;
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl) {
+ parent::__construct($wsdl);
+ $this->server = new SoapServer($wsdl);
+ $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;
+ }
+}
+
+$client = new TestSoapClient(dirname(__FILE__).'/bug38004.wsdl');
+$strA = 'test &amp; test';
+$strB = 'test & test';
+$res = $client->Test(array('strA'=>$strA, 'strB'=>$strB));
+print_r($res);
+print_r($g);
+?>
+--EXPECT--
+test &amp; test
+test & test
+test &amp; test
+test & test
diff --git a/ext/soap/tests/bugs/bug38004.wsdl b/ext/soap/tests/bugs/bug38004.wsdl
new file mode 100755
index 000000000..c28813596
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38004.wsdl
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:s="http://www.w3.org/2001/XMLSchema"
+ xmlns:s0="http://test.pl"
+ targetNamespace="http://test.pl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+>
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://test.pl">
+ <s:complexType name="Test">
+ <s:attribute use="required" name="strA" type="s:string"/>
+ <s:attribute use="required" name="strB" type="s:string"/>
+ </s:complexType>
+ <s:element type="s0:Test" name="Test"/>
+ <s:element type="s:string" name="Ret"/>
+ </s:schema>
+ </types>
+
+ <message name="TestSoapIn">
+ <part name="parameters" element="s0:Test"/>
+ </message>
+ <message name="TestSoapOut">
+ <part name="parameters" element="s0:Ret"/>
+ </message>
+ <portType name="TestSoap">
+ <operation name="Test">
+ <input message="s0:TestSoapIn"/>
+ <output message="s0:TestSoapOut"/>
+ </operation>
+ </portType>
+ <binding name="TestSoap" type="s0:TestSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+style="document"/>
+ <operation name="Test">
+ <soap:operation soapAction="http:/Test/Test" style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Test">
+ <port name="TestSoapPort" binding="s0:TestSoap">
+ <soap:address location="http://localhost:8080/~dmitry/bug38004/server.php"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/bugs/bug38005.phpt b/ext/soap/tests/bugs/bug38005.phpt
new file mode 100755
index 000000000..5e9e8b81c
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38005.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Bug #38005 (SoapFault faultstring doesn't follow encoding rules)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function Test($param) {
+ return new SoapFault('Test', 'This is our fault: Ä');
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl, $opt) {
+ parent::__construct($wsdl, $opt);
+ $this->server = new SoapServer($wsdl, $opt);
+ $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;
+ }
+}
+
+$client = new TestSoapClient(NULL, array(
+ 'encoding' => 'ISO-8859-1',
+ 'uri' => "test://",
+ 'location' => "test://",
+ 'soap_version'=>SOAP_1_2,
+ 'trace'=>1,
+ 'exceptions'=>0));
+$res = $client->Test();
+echo($res->faultstring."\n");
+echo($client->__getLastResponse());
+?>
+--EXPECT--
+This is our fault: Ä
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>Test</env:Value></env:Code><env:Reason><env:Text>This is our fault: Ä</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
diff --git a/ext/soap/tests/bugs/bug38055.phpt b/ext/soap/tests/bugs/bug38055.phpt
new file mode 100755
index 000000000..cec990c86
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38055.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Bug #38055 (Wrong interpretation of boolean parameters)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function Test($param) {
+ global $g1, $g2;
+ $g1 = $param->boolA;
+ $g2 = $param->boolB;
+ return 1;
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl) {
+ parent::__construct($wsdl);
+ $this->server = new SoapServer($wsdl);
+ $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;
+ }
+}
+
+$client = new TestSoapClient(dirname(__FILE__).'/bug38055.wsdl');
+$boolA = 1;
+$boolB = '1';
+$res = $client->Test(array('boolA'=>$boolA, 'boolB'=>$boolB));
+var_dump($g1);
+var_dump($g2);
+?>
+--EXPECT--
+bool(true)
+bool(true)
diff --git a/ext/soap/tests/bugs/bug38055.wsdl b/ext/soap/tests/bugs/bug38055.wsdl
new file mode 100755
index 000000000..f8935477f
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38055.wsdl
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:s="http://www.w3.org/2001/XMLSchema"
+ xmlns:s0="http://test.pl"
+ targetNamespace="http://test.pl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://test.pl">
+ <s:complexType name="Test">
+ <s:attribute use="required" name="boolA" type="s:boolean"/>
+ <s:attribute use="required" name="boolB" type="s:boolean"/>
+ </s:complexType>
+ <s:element type="s0:Test" name="Test"/>
+ <s:element type="s:int" name="Ret"/>
+ </s:schema>
+ </types>
+
+ <message name="TestSoapIn">
+ <part name="parameters" element="s0:Test"/>
+ </message>
+ <message name="TestSoapOut">
+ <part name="parameters" element="s0:Ret"/>
+ </message>
+ <portType name="TestSoap">
+ <operation name="Test">
+ <input message="s0:TestSoapIn"/>
+ <output message="s0:TestSoapOut"/>
+ </operation>
+ </portType>
+ <binding name="TestSoap" type="s0:TestSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="Test">
+ <soap:operation soapAction="http:/Test/Test" style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Test">
+ <port name="TestSoapPort" binding="s0:TestSoap">
+ <soap:address location="http://localhost/server.php"/>
+ </port>
+ </service>
+</definitions> \ No newline at end of file
diff --git a/ext/soap/tests/bugs/bug38067.phpt b/ext/soap/tests/bugs/bug38067.phpt
new file mode 100755
index 000000000..accea047f
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38067.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Bug #38067 (Parameters are not decoded from utf-8 when using encoding option)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function Test($param) {
+ global $g;
+ $g = $param->str;
+ return $g;
+}
+
+class TestSoapClient extends SoapClient {
+ function __construct($wsdl, $opt) {
+ parent::__construct($wsdl, $opt);
+ $this->server = new SoapServer($wsdl, $opt);
+ $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;
+ }
+}
+
+$client = new TestSoapClient(dirname(__FILE__).'/bug38067.wsdl',
+ array('encoding' => 'ISO-8859-1'));
+$str = 'test: Ä';
+$res = $client->Test(array('str'=>$str));
+echo $str."\n";
+echo $res."\n";
+echo $g."\n";
+?>
+--EXPECT--
+test: Ä
+test: Ä
+test: Ä
diff --git a/ext/soap/tests/bugs/bug38067.wsdl b/ext/soap/tests/bugs/bug38067.wsdl
new file mode 100755
index 000000000..beb9fc214
--- /dev/null
+++ b/ext/soap/tests/bugs/bug38067.wsdl
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:s="http://www.w3.org/2001/XMLSchema"
+ xmlns:s0="http://test.pl"
+ targetNamespace="http://test.pl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://test.pl">
+ <s:complexType name="Test">
+ <s:attribute use="required" name="str" type="s:string"/>
+ </s:complexType>
+ <s:element type="s0:Test" name="Test"/>
+ <s:element type="s:string" name="Ret"/>
+ </s:schema>
+ </types>
+
+ <message name="TestSoapIn">
+ <part name="parameters" element="s0:Test"/>
+ </message>
+ <message name="TestSoapOut">
+ <part name="parameters" element="s0:Ret"/>
+ </message>
+ <portType name="TestSoap">
+ <operation name="Test">
+ <input message="s0:TestSoapIn"/>
+ <output message="s0:TestSoapOut"/>
+ </operation>
+ </portType>
+ <binding name="TestSoap" type="s0:TestSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="Test">
+ <soap:operation soapAction="http:/Test/Test" style="document"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Test">
+ <port name="TestSoapPort" binding="s0:TestSoap">
+ <soap:address location="http://localhost/server.php"/>
+ </port>
+ </service>
+</definitions>
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt
index 1ee25584b..2432bcb4d 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_003p.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><param0 xsi:nil="true"/></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><param0 xsi:nil="true"/></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:nil="true"/></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:nil="true"/></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 2fd1dd0be..449329479 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_003s.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_003s.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:nil="true"/></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:nil="true"/></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:nil="true"/></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:nil="true"/></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 0104ffc08..cf1592ab5 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_003w.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_003w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:nil="true"/></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoString><inputString xsi:nil="true"/></ns1:echoString></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:nil="true"/></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringResponse><outputString xsi:nil="true"/></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok \ No newline at end of file
diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt
index 58c4e5fc6..627bf0c85 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_006p.phpt
@@ -15,5 +15,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 SOAP-ENC:arrayType="xsd:string[2]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></param0></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 9238f943c..77bb4a910 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_006s.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_006s.phpt
@@ -17,7 +17,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></inputStringArray></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></inputStringArray></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index b5ff5a63d..e93325a53 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_006w.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_006w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></inputStringArray></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></inputStringArray></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[2]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item><item xsi:type="xsd:string">bad</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 9daeca1bb..8b5a775cb 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_007p.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_007p.phpt
@@ -15,5 +15,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 SOAP-ENC:arrayType="xsd:string[1]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">good</item></param0></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index fe91d5a1c..9c3cb1b5a 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_007s.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_007s.phpt
@@ -16,7 +16,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></inputStringArray></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></inputStringArray></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index ae9c9b5dd..db79df02d 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_007w.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_007w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></inputStringArray></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></inputStringArray></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[1]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">good</item></outputStringArray></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 377d0b049..23981bd28 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_008p.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_008p.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 SOAP-ENC:arrayType="xsd:ur-type[0]" xsi:type="SOAP-ENC:Array"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 SOAP-ENC:arrayType="xsd:ur-type[0]" xsi:type="SOAP-ENC:Array"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 6ab530146..3adcce4c4 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_008s.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_008s.phpt
@@ -15,7 +15,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:ur-type[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:ur-type[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index b4d4e0414..d545ec1ab 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_008w.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_008w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray SOAP-ENC:arrayType="xsd:string[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray SOAP-ENC:arrayType="xsd:string[0]" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 8fe6cee94..afd90fa06 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_009p.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_009p.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 xsi:nil="true"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 xsi:nil="true"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index b29f52f7d..3a2890c99 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt
@@ -14,7 +14,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 0f779a032..bfe211438 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_009w.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_009w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray xsi:nil="true" xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 5c1cbcb85..c1add4512 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_011p.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_011p.phpt
@@ -15,5 +15,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArray><param0 SOAP-ENC:arrayType="xsd:int[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></param0></ns1:echoIntegerArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArrayResponse><outputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></outputIntegerArray></ns1:echoIntegerArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArrayResponse><outputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></outputIntegerArray></ns1:echoIntegerArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 8c6808409..08a1f2fbb 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_011s.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_011s.phpt
@@ -18,7 +18,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArray><inputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></inputIntegerArray></ns1:echoIntegerArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArray><inputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></inputIntegerArray></ns1:echoIntegerArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArrayResponse><outputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></outputIntegerArray></ns1:echoIntegerArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArrayResponse><outputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></outputIntegerArray></ns1:echoIntegerArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index e0c18bd1d..2596182ff 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_011w.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_011w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArray><inputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></inputIntegerArray></ns1:echoIntegerArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArray><inputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></inputIntegerArray></ns1:echoIntegerArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArrayResponse><outputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></outputIntegerArray></ns1:echoIntegerArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntegerArrayResponse><outputIntegerArray SOAP-ENC:arrayType="xsd:int[3]" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">1</item><item xsi:type="xsd:int">234324324</item><item xsi:type="xsd:int">2</item></outputIntegerArray></ns1:echoIntegerArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index db8e432cd..940a3ddbd 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_013p.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_013p.phpt
@@ -15,5 +15,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArray><param0 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></param0></ns1:echoFloatArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArrayResponse><outputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></outputFloatArray></ns1:echoFloatArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArrayResponse><outputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></outputFloatArray></ns1:echoFloatArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index fcdf47630..67dbe28cc 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_013s.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_013s.phpt
@@ -18,7 +18,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArray><inputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></inputFloatArray></ns1:echoFloatArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArray><inputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></inputFloatArray></ns1:echoFloatArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArrayResponse><outputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></outputFloatArray></ns1:echoFloatArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArrayResponse><outputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></outputFloatArray></ns1:echoFloatArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 9af95192a..428860414 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_013w.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_013w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArray><inputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></inputFloatArray></ns1:echoFloatArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArray><inputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></inputFloatArray></ns1:echoFloatArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArrayResponse><outputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></outputFloatArray></ns1:echoFloatArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoFloatArrayResponse><outputFloatArray SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">1.3223</item><item xsi:type="xsd:float">34.2</item><item xsi:type="xsd:float">325.325</item></outputFloatArray></ns1:echoFloatArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 5995225da..986d7e40b 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt
@@ -21,7 +21,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><param0 xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></param0></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><param0 xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></param0></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><outputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></outputStruct></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><outputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></outputStruct></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 8ef6882d5..7e3ac0f65 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_014s.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_014s.phpt
@@ -18,7 +18,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></inputStruct></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></inputStruct></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><outputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></outputStruct></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><outputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></outputStruct></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index a08550ebe..a601c9fa6 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt
@@ -21,7 +21,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></inputStruct></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></inputStruct></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><outputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></outputStruct></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><outputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></outputStruct></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 6c9ac42eb..b88162cfe 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt
@@ -24,5 +24,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArray><param0 SOAP-ENC:arrayType="SOAP-ENC:Struct[2]" xsi:type="SOAP-ENC:Array"><item xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></param0></ns1:echoStructArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArrayResponse><outputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></outputStructArray></ns1:echoStructArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArrayResponse><outputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></outputStructArray></ns1:echoStructArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index c97ca7bb1..424d7950d 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt
@@ -32,7 +32,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArray><inputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></inputStructArray></ns1:echoStructArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArray><inputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></inputStructArray></ns1:echoStructArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArrayResponse><outputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></outputStructArray></ns1:echoStructArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArrayResponse><outputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></outputStructArray></ns1:echoStructArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 028bb6ced..31803f846 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt
@@ -22,7 +22,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArray><inputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></inputStructArray></ns1:echoStructArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArray><inputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></inputStructArray></ns1:echoStructArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArrayResponse><outputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></outputStructArray></ns1:echoStructArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArrayResponse><outputStructArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></outputStructArray></ns1:echoStructArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 4f791aa5f..5f83e373e 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_016p.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_016p.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 4a4751669..4215bac91 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_016s.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_016s.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 0642b3cf3..9b7f95e35 100644
--- a/ext/soap/tests/interop/Round2/Base/r2_base_016w.phpt
+++ b/ext/soap/tests/interop/Round2/Base/r2_base_016w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
diff --git a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt
index d15b16907..756b7eb52 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001p.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypes><param0 xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></param0></ns1:echoStructAsSimpleTypes></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypes><param0 xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></param0></ns1:echoStructAsSimpleTypes></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypesResponse><outputString xsi:type="xsd:string">arg</outputString><outputInteger xsi:type="xsd:int">34</outputInteger><outputFloat xsi:type="xsd:float">34.345</outputFloat></ns1:echoStructAsSimpleTypesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 431ab88b4..e036bf4ca 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001s.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001s.phpt
@@ -18,7 +18,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypes><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></inputStruct></ns1:echoStructAsSimpleTypes></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypes><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></inputStruct></ns1:echoStructAsSimpleTypes></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypesResponse><outputString xsi:type="xsd:string">arg</outputString><outputInteger xsi:type="xsd:int">34</outputInteger><outputFloat xsi:type="xsd:float">34.345</outputFloat></ns1:echoStructAsSimpleTypesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index ae589b6fa..3e74c451c 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001w.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_001w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypes><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></inputStruct></ns1:echoStructAsSimpleTypes></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypes><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></inputStruct></ns1:echoStructAsSimpleTypes></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructAsSimpleTypesResponse><outputString xsi:type="xsd:string">arg</outputString><outputInteger xsi:type="xsd:int">34</outputInteger><outputFloat xsi:type="xsd:float">34.345</outputFloat></ns1:echoStructAsSimpleTypesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 9feba58f1..e5c994394 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002p.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002p.phpt
@@ -15,5 +15,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStruct><param0 xsi:type="xsd:string">arg</param0><param1 xsi:type="xsd:int">34</param1><param2 xsi:type="xsd:float">34.345</param2></ns1:echoSimpleTypesAsStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStructResponse><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></return></ns1:echoSimpleTypesAsStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStructResponse><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></return></ns1:echoSimpleTypesAsStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index cf1caa4b6..6ad0d5b86 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002s.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002s.phpt
@@ -18,5 +18,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStruct><inputString xsi:type="xsd:string">arg</inputString><inputInteger xsi:type="xsd:int">34</inputInteger><inputFloat xsi:type="xsd:float">34.345</inputFloat></ns1:echoSimpleTypesAsStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStructResponse><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></return></ns1:echoSimpleTypesAsStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStructResponse><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></return></ns1:echoSimpleTypesAsStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 08369f8ed..54d2a5302 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002w.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_002w.phpt
@@ -15,5 +15,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStruct><inputString xsi:type="xsd:string">arg</inputString><inputInteger xsi:type="xsd:int">34</inputInteger><inputFloat xsi:type="xsd:float">34.345</inputFloat></ns1:echoSimpleTypesAsStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStructResponse><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></return></ns1:echoSimpleTypesAsStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSimpleTypesAsStructResponse><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">34.345</varFloat></return></ns1:echoSimpleTypesAsStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 6a5c1f04e..c8d842057 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003p.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003p.phpt
@@ -18,5 +18,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArray><param0 SOAP-ENC:arrayType="SOAP-ENC:Array[2]" xsi:type="SOAP-ENC:Array"><item SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item></item><item SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></item></param0></ns1:echo2DStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArrayResponse><return SOAP-ENC:arrayType="xsd:string[2,3]" xsi:type="ns2:ArrayOfString2D"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></return></ns1:echo2DStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArrayResponse><return SOAP-ENC:arrayType="xsd:string[2,3]" xsi:type="ns2:ArrayOfString2D"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></return></ns1:echo2DStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index cfcb8bb2f..beb8ff9e0 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003s.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003s.phpt
@@ -25,7 +25,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArray><input2DStringArray SOAP-ENC:arrayType="SOAP-ENC:Array[2]" xsi:type="ns2:ArrayOfString2D"><item SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item></item><item SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></item></input2DStringArray></ns1:echo2DStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArray><input2DStringArray SOAP-ENC:arrayType="SOAP-ENC:Array[2]" xsi:type="ns2:ArrayOfString2D"><item SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item></item><item SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></item></input2DStringArray></ns1:echo2DStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArrayResponse><return SOAP-ENC:arrayType="xsd:string[2,3]" xsi:type="ns2:ArrayOfString2D"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></return></ns1:echo2DStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArrayResponse><return SOAP-ENC:arrayType="xsd:string[2,3]" xsi:type="ns2:ArrayOfString2D"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></return></ns1:echo2DStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 685458691..a0c1b21ee 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003w.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_003w.phpt
@@ -16,7 +16,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArray><input2DStringArray SOAP-ENC:arrayType="xsd:string[2,3]" xsi:type="ns2:ArrayOfString2D"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></input2DStringArray></ns1:echo2DStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArray><input2DStringArray SOAP-ENC:arrayType="xsd:string[2,3]" xsi:type="ns2:ArrayOfString2D"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></input2DStringArray></ns1:echo2DStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArrayResponse><return SOAP-ENC:arrayType="xsd:string[2,3]" xsi:type="ns2:ArrayOfString2D"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></return></ns1:echo2DStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echo2DStringArrayResponse><return SOAP-ENC:arrayType="xsd:string[2,3]" xsi:type="ns2:ArrayOfString2D"><item xsi:type="xsd:string">row0col0</item><item xsi:type="xsd:string">row0col1</item><item xsi:type="xsd:string">row0col2</item><item xsi:type="xsd:string">row1col0</item><item xsi:type="xsd:string">row1col1</item><item xsi:type="xsd:string">row1col2</item></return></ns1:echo2DStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 32fff9896..0649e85cf 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004p.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004p.phpt
@@ -23,7 +23,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStruct><param0 xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></param0></ns1:echoNestedStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStruct><param0 xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></param0></ns1:echoNestedStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStructResponse><return xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></return></ns1:echoNestedStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStructResponse><return xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></return></ns1:echoNestedStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index cf1c950ae..48c3bda9d 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004s.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004s.phpt
@@ -23,7 +23,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStruct><inputStruct xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></inputStruct></ns1:echoNestedStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStruct><inputStruct xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></inputStruct></ns1:echoNestedStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStructResponse><return xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></return></ns1:echoNestedStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStructResponse><return xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></return></ns1:echoNestedStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 33112492a..26c75fdec 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004w.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_004w.phpt
@@ -23,7 +23,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStruct><inputStruct xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></inputStruct></ns1:echoNestedStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStruct><inputStruct xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></inputStruct></ns1:echoNestedStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStructResponse><return xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></return></ns1:echoNestedStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedStructResponse><return xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">123.45</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg2</varString><varInt xsi:type="xsd:int">342</varInt><varFloat xsi:type="xsd:float">123.452</varFloat></varStruct></return></ns1:echoNestedStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 1b5c7bd81..6848d8592 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005p.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005p.phpt
@@ -18,7 +18,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArray><param0 xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></param0></ns1:echoNestedArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArray><param0 xsi:type="SOAP-ENC:Struct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></param0></ns1:echoNestedArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArrayResponse><return xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></return></ns1:echoNestedArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArrayResponse><return xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></return></ns1:echoNestedArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index ec03a8550..e08f2602d 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005s.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005s.phpt
@@ -23,7 +23,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArray><inputStruct xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></inputStruct></ns1:echoNestedArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArray><inputStruct xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></inputStruct></ns1:echoNestedArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArrayResponse><return xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></return></ns1:echoNestedArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArrayResponse><return xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></return></ns1:echoNestedArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 305ca4a4b..53475102b 100644
--- a/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005w.phpt
+++ b/ext/soap/tests/interop/Round2/GroupB/r2_groupB_005w.phpt
@@ -18,7 +18,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArray><inputStruct xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></inputStruct></ns1:echoNestedArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArray><inputStruct xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></inputStruct></ns1:echoNestedArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArrayResponse><return xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></return></ns1:echoNestedArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoNestedArrayResponse><return xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat><varArray SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></return></ns1:echoNestedArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index bed81e9e2..4795eb157 100644
--- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt
@@ -21,7 +21,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></inputStruct></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></inputStruct></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><Result xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></Result></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><Result xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></Result></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index b9e483bf2..a142cf1f0 100644
--- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt
@@ -21,7 +21,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></inputStruct></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><inputStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></inputStruct></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><Result xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></Result></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><Result xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></Result></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 230ac1881..9f9603607 100644
--- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt
@@ -21,7 +21,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns3="http://soapinterop.org/xsd2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArray><inputArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns3:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></inputArray></ns1:echoStructArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://soapinterop.org/xsd2" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArray><inputArray SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns3:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></inputArray></ns1:echoStructArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns3="http://soapinterop.org/xsd2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArrayResponse><Result SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns3:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></Result></ns1:echoStructArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop/" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://soapinterop.org/xsd2" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructArrayResponse><Result SOAP-ENC:arrayType="ns2:SOAPStruct[2]" xsi:type="ns3:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></item></Result></ns1:echoStructArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index e9bb31952..5a97eb2fd 100644
--- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_002w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_002w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param0></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArray><param0 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param0></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><return SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></return></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringArrayResponse><return SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></return></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 820b1d25e..a3c2bc049 100644
--- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt
@@ -21,7 +21,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><param0 xsi:type="ns2:SOAPStruct"><varFloat xsi:type="xsd:float">325.325</varFloat><varInt xsi:type="xsd:int">34</varInt><varString xsi:type="xsd:string">arg</varString></param0></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStruct><param0 xsi:type="ns2:SOAPStruct"><varFloat xsi:type="xsd:float">325.325</varFloat><varInt xsi:type="xsd:int">34</varInt><varString xsi:type="xsd:string">arg</varString></param0></ns1:echoStruct></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><return xsi:type="ns2:SOAPStruct"><varFloat xsi:type="xsd:float">325.325</varFloat><varInt xsi:type="xsd:int">34</varInt><varString xsi:type="xsd:string">arg</varString></return></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStructResponse><return xsi:type="ns2:SOAPStruct"><varFloat xsi:type="xsd:float">325.325</varFloat><varInt xsi:type="xsd:int">34</varInt><varString xsi:type="xsd:string">arg</varString></return></ns1:echoStructResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index fc6bb07ab..47849f9e0 100644
--- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_004w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_004w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoid/></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVoidResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 2fdf58070..caa7a9f83 100644
--- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt
@@ -21,9 +21,9 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:nil="true" xsi:type="ns2:List"/></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:nil="true" xsi:type="ns2:List"/></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:nil="true" xsi:type="ns2:List"/></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:nil="true" xsi:type="ns2:List"/></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#5 (3) {
["varInt"]=>
int(1)
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
index f8f73212c..850052cc1 100644
--- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt
@@ -21,9 +21,9 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:nil="true" xsi:type="ns2:List"/></child></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:nil="true" xsi:type="ns2:List"/></child></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:nil="true" xsi:type="ns2:List"/></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:nil="true" xsi:type="ns2:List"/></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#6 (3) {
["varInt"]=>
int(1)
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
index 857f7930f..db874c48d 100644
--- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt
@@ -21,9 +21,9 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child xsi:nil="true" xsi:type="ns2:List"/></child></child></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child xsi:nil="true" xsi:type="ns2:List"/></child></child></param0></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child xsi:nil="true" xsi:type="ns2:List"/></child></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:type="ns2:List"><varInt xsi:type="xsd:int">1</varInt><varString xsi:type="xsd:string">arg1</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">2</varInt><varString xsi:type="xsd:string">arg2</varString><child xsi:type="ns2:List"><varInt xsi:type="xsd:int">3</varInt><varString xsi:type="xsd:string">arg3</varString><child xsi:nil="true" xsi:type="ns2:List"/></child></child></return></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#7 (3) {
["varInt"]=>
int(1)
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
index 3c34ef1dd..100492275 100644
--- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt
+++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt
@@ -21,8 +21,8 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:nil="true" xsi:type="ns2:List"/></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedList><param0 xsi:nil="true" xsi:type="ns2:List"/></ns1:echoLinkedList></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:nil="true" xsi:type="ns2:List"/></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/WSDLInteropTestRpcEnc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoLinkedListResponse><return xsi:nil="true" xsi:type="ns2:List"/></ns1:echoLinkedListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
NULL
ok
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
index a0601aaac..b8a550410 100644
--- 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
@@ -21,7 +21,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSOAPStructFault><param xsi:type="ns2:SOAPStructFault"><soapStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></soapStruct></param></ns1:echoSOAPStructFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoSOAPStructFault><param xsi:type="ns2:SOAPStructFault"><soapStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></soapStruct></param></ns1:echoSOAPStructFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoSOAPStructFault'.</faultstring><detail><ns2:part1 xsi:type="ns1:SOAPStructFault"><soapStruct xsi:type="ns1:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></soapStruct></ns2:part1></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoSOAPStructFault'.</faultstring><detail><ns2:part1 xsi:type="ns1:SOAPStructFault"><soapStruct xsi:type="ns1:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></soapStruct></ns2:part1></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 9d80f80e1..e8d555246 100644
--- 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
@@ -20,7 +20,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBaseStructFault><param xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></param></ns1:echoBaseStructFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoBaseStructFault><param xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></param></ns1:echoBaseStructFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoBaseStructFault'.</faultstring><detail><ns2:part2 xsi:type="ns1:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></ns2:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoBaseStructFault'.</faultstring><detail><ns2:part2 xsi:type="ns1:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></ns2:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index ff787f9a7..c0212a558 100644
--- 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
@@ -28,7 +28,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoExtendedStructFault><param xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param></ns1:echoExtendedStructFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoExtendedStructFault><param xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param></ns1:echoExtendedStructFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoExtendedStructFault'.</faultstring><detail><ns2:part3 xsi:type="ns1:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></ns2:part3></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoExtendedStructFault'.</faultstring><detail><ns2:part3 xsi:type="ns1:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></ns2:part3></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index b68e464ac..9d1eb61cd 100644
--- 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
@@ -28,7 +28,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></param1><param2 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></param1><param2 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part1 xsi:type="ns1:SOAPStructFault"><soapStruct xsi:type="ns1:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></soapStruct></ns2:part1></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part1 xsi:type="ns1:SOAPStructFault"><soapStruct xsi:type="ns1:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></soapStruct></ns2:part1></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index eef797fa5..9ca53bbd7 100644
--- 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
@@ -28,7 +28,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></param1><param2 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></param1><param2 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part2 xsi:type="ns1:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></ns2:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part2 xsi:type="ns1:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></ns2:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index adf675701..61d9a6b7c 100644
--- 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
@@ -28,7 +28,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></param1><param2 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></param1><param2 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">12</shortMessage></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part1 xsi:type="ns1:SOAPStructFault"><soapStruct xsi:type="ns1:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></soapStruct></ns2:part1></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part1 xsi:type="ns1:SOAPStructFault"><soapStruct xsi:type="ns1:SOAPStruct"><varString xsi:type="xsd:string">arg</varString><varInt xsi:type="xsd:int">34</varInt><varFloat xsi:type="xsd:float">325.325</varFloat></soapStruct></ns2:part1></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index a1a345d5e..d76711dd2 100644
--- 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
@@ -36,7 +36,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></param1><param2 xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param2><param3 xsi:type="ns2:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></param1><param2 xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param2><param3 xsi:type="ns2:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part2 xsi:type="ns1:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></ns2:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part2 xsi:type="ns1:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></ns2:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index fc7d74709..e409ef7b7 100644
--- 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
@@ -36,7 +36,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></param1><param2 xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param2><param3 xsi:type="ns2:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></param1><param2 xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param2><param3 xsi:type="ns2:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part3 xsi:type="ns1:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></ns2:part3></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part3 xsi:type="ns1:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></ns2:part3></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 7f4bde62d..1c9ccafa4 100644
--- 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
@@ -36,7 +36,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></param1><param2 xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param2><param3 xsi:type="ns2:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></param1><param2 xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param2><param3 xsi:type="ns2:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part4 xsi:type="ns1:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></ns2:part4></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part4 xsi:type="ns1:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></ns2:part4></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 5adca12d9..f0acdbdc0 100644
--- 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
@@ -36,7 +36,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">4</whichFault><param1 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></param1><param2 xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param2><param3 xsi:type="ns2:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">4</whichFault><param1 xsi:type="ns2:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></param1><param2 xsi:type="ns2:ExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">2</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage></param2><param3 xsi:type="ns2:MoreExtendedStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">3</shortMessage><stringMessage xsi:type="xsd:string">arg</stringMessage><intMessage xsi:type="xsd:int">-3</intMessage><anotherIntMessage xsi:type="xsd:int">5</anotherIntMessage><booleanMessage xsi:type="xsd:boolean">true</booleanMessage></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part2 xsi:type="ns1:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></ns2:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part2 xsi:type="ns1:BaseStruct"><floatMessage xsi:type="xsd:float">12.345</floatMessage><shortMessage xsi:type="xsd:short">1</shortMessage></ns2:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index d5421dcde..8b9a7d0c3 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoEmptyFault/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoEmptyFault/></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoEmptyFault'.</faultstring><detail><ns2:part1 xsi:nil="true" xsi:type="ns1:EmptyFault"/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoEmptyFault'.</faultstring><detail><ns2:part1 xsi:nil="true" xsi:type="ns1:EmptyFault"/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 80957682f..922c7cc9c 100644
--- 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
@@ -15,5 +15,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoStringFault><param xsi:type="xsd:string">Hello World</param></ns1:echoStringFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoStringFault'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">Hello World</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoStringFault'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">Hello World</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 19a00e47f..87dd01fa8 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntArrayFault><param SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns2:ArrayOfInt"><item xsi:type="xsd:int">34</item><item xsi:type="xsd:int">12</item></param></ns1:echoIntArrayFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoIntArrayFault><param SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns2:ArrayOfInt"><item xsi:type="xsd:int">34</item><item xsi:type="xsd:int">12</item></param></ns1:echoIntArrayFault></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoIntArrayFault'.</faultstring><detail><ns2:part5 SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:ArrayOfInt"><item xsi:type="xsd:int">34</item><item xsi:type="xsd:int">12</item></ns2:part5></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoIntArrayFault'.</faultstring><detail><ns2:part5 SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:ArrayOfInt"><item xsi:type="xsd:int">34</item><item xsi:type="xsd:int">12</item></ns2:part5></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 7a237647e..b8907d562 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="xsd:string">Hello world</param1><param2 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="xsd:string">Hello world</param1><param2 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part1 xsi:nil="true" xsi:type="ns1:EmptyFault"/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part1 xsi:nil="true" xsi:type="ns1:EmptyFault"/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index de07294de..5822e7a72 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="xsd:string">Hello world</param1><param2 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="xsd:string">Hello world</param1><param2 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">Hello world</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">Hello world</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 8a95c9a46..ee75cbdfe 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="xsd:string">Hello world</param1><param2 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="xsd:string">Hello world</param1><param2 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part7 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns1:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></ns2:part7></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part7 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns1:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></ns2:part7></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 153ba5050..704257f7e 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">4</whichFault><param1 xsi:type="xsd:string">Hello world</param1><param2 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults1><whichFault xsi:type="xsd:int">4</whichFault><param1 xsi:type="xsd:string">Hello world</param1><param2 SOAP-ENC:arrayType="xsd:float[3]" xsi:type="ns2:ArrayOfFloat"><item xsi:type="xsd:float">12.345</item><item xsi:type="xsd:float">45</item><item xsi:type="xsd:float">678</item></param2></ns1:echoMultipleFaults1></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part1 xsi:nil="true" xsi:type="ns1:EmptyFault"/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults1'.</faultstring><detail><ns2:part1 xsi:nil="true" xsi:type="ns1:EmptyFault"/></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index e5a95d18f..e85a6480e 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="xsd:string">Hello World</param1><param2 xsi:type="xsd:float">12.345</param2><param3 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="xsd:string">Hello World</param1><param2 xsi:type="xsd:float">12.345</param2><param3 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:part4 xsi:type="xsd:float">12.345</ns1:part4></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:part4 xsi:type="xsd:float">12.345</ns1:part4></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index c3cb033ac..999cd2892 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="xsd:string">Hello World</param1><param2 xsi:type="xsd:float">12.345</param2><param3 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="xsd:string">Hello World</param1><param2 xsi:type="xsd:float">12.345</param2><param3 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">Hello World</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">Hello World</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index dce4032f4..ae7ffa76f 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="xsd:string">Hello World</param1><param2 xsi:type="xsd:float">12.345</param2><param3 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="xsd:string">Hello World</param1><param2 xsi:type="xsd:float">12.345</param2><param3 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part6 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns1:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></ns2:part6></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns2:part6 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns1:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></ns2:part6></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index c1fa3000b..7278d6758 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">4</whichFault><param1 xsi:type="xsd:string">Hello World</param1><param2 xsi:type="xsd:float">12.345</param2><param3 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://soapinterop.org/types" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults2><whichFault xsi:type="xsd:int">4</whichFault><param1 xsi:type="xsd:string">Hello World</param1><param2 xsi:type="xsd:float">12.345</param2><param3 SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns2:ArrayOfString"><item xsi:type="xsd:string">one</item><item xsi:type="xsd:string">two</item><item xsi:type="xsd:string">three</item></param3></ns1:echoMultipleFaults2></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:part4 xsi:type="xsd:float">12.345</ns1:part4></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults2'.</faultstring><detail><ns1:part4 xsi:type="xsd:float">12.345</ns1:part4></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 965bb816e..5a229348f 100644
--- 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
@@ -15,5 +15,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults3><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="xsd:string">arg1</param1><param2 xsi:type="xsd:string">arg2</param2></ns1:echoMultipleFaults3></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/wsdl/fault1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">arg1</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl/fault1" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">arg1</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index c4eb6c1dc..77b87e64f 100644
--- 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
@@ -15,5 +15,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults3><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="xsd:string">arg1</param1><param2 xsi:type="xsd:string">arg2</param2></ns1:echoMultipleFaults3></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/wsdl/fault2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">arg2</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl/fault2" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">arg2</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 733f5ca48..12e1491ab 100644
--- 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
@@ -15,5 +15,5 @@ echo "ok\n";
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults3><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="xsd:string">arg1</param1><param2 xsi:type="xsd:string">arg2</param2></ns1:echoMultipleFaults3></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/wsdl/fault1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">arg1</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl/fault1" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults3'.</faultstring><detail><ns1:part2 xsi:type="xsd:string">arg1</ns1:part2></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 46b3ff065..5b79e1d0a 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults4><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="xsd:int">162</param1><param2 xsi:type="ns2:Enum">1</param2></ns1:echoMultipleFaults4></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults4><whichFault xsi:type="xsd:int">1</whichFault><param1 xsi:type="xsd:int">162</param1><param2 xsi:type="ns2:Enum">1</param2></ns1:echoMultipleFaults4></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns1:part3 xsi:type="xsd:int">162</ns1:part3></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns1:part3 xsi:type="xsd:int">162</ns1:part3></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 40c3db6fb..0d8a9520d 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults4><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="xsd:int">162</param1><param2 xsi:type="ns2:Enum">1</param2></ns1:echoMultipleFaults4></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults4><whichFault xsi:type="xsd:int">2</whichFault><param1 xsi:type="xsd:int">162</param1><param2 xsi:type="ns2:Enum">1</param2></ns1:echoMultipleFaults4></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns2:part9 xsi:type="ns1:Enum">1</ns2:part9></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/types" xmlns:ns2="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns2:part9 xsi:type="ns1:Enum">1</ns2:part9></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 622d17d6a..69471fdde 100644
--- 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
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults4><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="xsd:int">162</param1><param2 xsi:type="ns2:Enum">1</param2></ns1:echoMultipleFaults4></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://soapinterop.org/types" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoMultipleFaults4><whichFault xsi:type="xsd:int">3</whichFault><param1 xsi:type="xsd:int">162</param1><param2 xsi:type="ns2:Enum">1</param2></ns1:echoMultipleFaults4></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns1:part3 xsi:type="xsd:int">162</ns1:part3></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Fault in response to 'echoMultipleFaults4'.</faultstring><detail><ns1:part3 xsi:type="xsd:int">162</ns1:part3></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
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
index 44e79cc0b..b89bdec4e 100644
--- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_001w.phpt
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_001w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVersionMismatchFault/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVersionMismatchFault/></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVersionMismatchFaultResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:echoVersionMismatchFaultResponse/></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index 3ef248962..697b514d9 100644
--- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_002w.phpt
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_002w.phpt
@@ -13,7 +13,7 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body><ns1:echoVersionMismatchFault env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body><ns1:echoVersionMismatchFault env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></env:Body></env:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body><ns1:echoVersionMismatchFaultResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body><ns1:echoVersionMismatchFaultResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></env:Body></env:Envelope>
ok
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
index 8e6b91136..bf8f4f243 100644
--- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_004w.phpt
+++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_soapfault_004w.phpt
@@ -14,6 +14,6 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:UnknownHeaderRequest SOAP-ENV:mustUnderstand="1">Hello World</ns1:UnknownHeaderRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVersionMismatchFault/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:UnknownHeaderRequest SOAP-ENV:mustUnderstand="1">Hello World</ns1:UnknownHeaderRequest></SOAP-ENV:Header><SOAP-ENV:Body><ns1:echoVersionMismatchFault/></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:MustUnderstand</faultcode><faultstring>Header not understood</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/schema/schema009.phpt b/ext/soap/tests/schema/schema009.phpt
index 5198debd9..f7d10242c 100644
--- a/ext/soap/tests/schema/schema009.phpt
+++ b/ext/soap/tests/schema/schema009.phpt
@@ -15,6 +15,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">one two</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">one two</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(7) "one two"
ok
diff --git a/ext/soap/tests/schema/schema010.phpt b/ext/soap/tests/schema/schema010.phpt
index 6cea56ee4..49136b9fe 100644
--- a/ext/soap/tests/schema/schema010.phpt
+++ b/ext/soap/tests/schema/schema010.phpt
@@ -15,6 +15,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">one two</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">one two</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(7) "one two"
ok
diff --git a/ext/soap/tests/schema/schema011.phpt b/ext/soap/tests/schema/schema011.phpt
index c66f0f7a1..8296311a4 100644
--- a/ext/soap/tests/schema/schema011.phpt
+++ b/ext/soap/tests/schema/schema011.phpt
@@ -19,6 +19,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123 456</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123 456</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(7) "123 456"
ok
diff --git a/ext/soap/tests/schema/schema012.phpt b/ext/soap/tests/schema/schema012.phpt
index 7ba25f963..1d542d81d 100644
--- a/ext/soap/tests/schema/schema012.phpt
+++ b/ext/soap/tests/schema/schema012.phpt
@@ -19,6 +19,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123 456</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123 456</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(7) "123 456"
ok
diff --git a/ext/soap/tests/schema/schema013.phpt b/ext/soap/tests/schema/schema013.phpt
index ee2e114bd..4794d2d0f 100644
--- a/ext/soap/tests/schema/schema013.phpt
+++ b/ext/soap/tests/schema/schema013.phpt
@@ -15,6 +15,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">str</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">str</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(3) "str"
ok
diff --git a/ext/soap/tests/schema/schema014.phpt b/ext/soap/tests/schema/schema014.phpt
index 87edb3ad3..0ffff86e6 100644
--- a/ext/soap/tests/schema/schema014.phpt
+++ b/ext/soap/tests/schema/schema014.phpt
@@ -15,6 +15,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(5) "123.5"
ok
diff --git a/ext/soap/tests/schema/schema015.phpt b/ext/soap/tests/schema/schema015.phpt
index dc9a02d58..fe9b96b8c 100644
--- a/ext/soap/tests/schema/schema015.phpt
+++ b/ext/soap/tests/schema/schema015.phpt
@@ -25,6 +25,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">str</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">str</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(3) "str"
ok
diff --git a/ext/soap/tests/schema/schema016.phpt b/ext/soap/tests/schema/schema016.phpt
index 714fb5974..462fc7140 100644
--- a/ext/soap/tests/schema/schema016.phpt
+++ b/ext/soap/tests/schema/schema016.phpt
@@ -25,6 +25,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(5) "123.5"
ok
diff --git a/ext/soap/tests/schema/schema017.phpt b/ext/soap/tests/schema/schema017.phpt
index 8b2048378..e7674cfc4 100644
--- a/ext/soap/tests/schema/schema017.phpt
+++ b/ext/soap/tests/schema/schema017.phpt
@@ -22,6 +22,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(5) "123.5"
ok
diff --git a/ext/soap/tests/schema/schema018.phpt b/ext/soap/tests/schema/schema018.phpt
index f41e277aa..0f3e8b84a 100644
--- a/ext/soap/tests/schema/schema018.phpt
+++ b/ext/soap/tests/schema/schema018.phpt
@@ -22,6 +22,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(5) "123.5"
ok
diff --git a/ext/soap/tests/schema/schema019.phpt b/ext/soap/tests/schema/schema019.phpt
index 73938772b..0d2d75376 100644
--- a/ext/soap/tests/schema/schema019.phpt
+++ b/ext/soap/tests/schema/schema019.phpt
@@ -22,6 +22,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5 456.7</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5 456.7</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(11) "123.5 456.7"
ok
diff --git a/ext/soap/tests/schema/schema020.phpt b/ext/soap/tests/schema/schema020.phpt
index 899b77375..3ceb3de62 100644
--- a/ext/soap/tests/schema/schema020.phpt
+++ b/ext/soap/tests/schema/schema020.phpt
@@ -22,6 +22,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5 456.7</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123.5 456.7</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(11) "123.5 456.7"
ok
diff --git a/ext/soap/tests/schema/schema021.phpt b/ext/soap/tests/schema/schema021.phpt
index 1400107f8..0628c6b3b 100644
--- a/ext/soap/tests/schema/schema021.phpt
+++ b/ext/soap/tests/schema/schema021.phpt
@@ -19,6 +19,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123 123.5 456.7 str</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123 123.5 456.7 str</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
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
index bfbb05c77..fd598f624 100644
--- a/ext/soap/tests/schema/schema022.phpt
+++ b/ext/soap/tests/schema/schema022.phpt
@@ -19,6 +19,6 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123 123.5 str</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns1:testType">123 123.5 str</testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
string(13) "123 123.5 str"
ok
diff --git a/ext/soap/tests/schema/schema023.phpt b/ext/soap/tests/schema/schema023.phpt
index 162a46e7f..550bacfe8 100644
--- a/ext/soap/tests/schema/schema023.phpt
+++ b/ext/soap/tests/schema/schema023.phpt
@@ -19,7 +19,7 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:testType"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:testType"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
array(2) {
[0]=>
int(123)
diff --git a/ext/soap/tests/schema/schema024.phpt b/ext/soap/tests/schema/schema024.phpt
index 628dfd73f..af836d1ff 100644
--- a/ext/soap/tests/schema/schema024.phpt
+++ b/ext/soap/tests/schema/schema024.phpt
@@ -21,7 +21,7 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:testType"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:testType"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
array(2) {
[0]=>
int(123)
diff --git a/ext/soap/tests/schema/schema025.phpt b/ext/soap/tests/schema/schema025.phpt
index f9c7af758..748e45804 100644
--- a/ext/soap/tests/schema/schema025.phpt
+++ b/ext/soap/tests/schema/schema025.phpt
@@ -20,7 +20,7 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:testType"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:testType"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
array(2) {
[0]=>
int(123)
diff --git a/ext/soap/tests/schema/schema026.phpt b/ext/soap/tests/schema/schema026.phpt
index a80215ed4..e17b5ac60 100644
--- a/ext/soap/tests/schema/schema026.phpt
+++ b/ext/soap/tests/schema/schema026.phpt
@@ -21,7 +21,7 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:testType"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2]" xsi:type="ns1:testType"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
array(2) {
[0]=>
int(123)
diff --git a/ext/soap/tests/schema/schema027.phpt b/ext/soap/tests/schema/schema027.phpt
index 968b8562d..e3b382ebe 100644
--- a/ext/soap/tests/schema/schema027.phpt
+++ b/ext/soap/tests/schema/schema027.phpt
@@ -19,7 +19,7 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2,1]" xsi:type="ns1:testType"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2,1]" xsi:type="ns1:testType"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
array(2) {
[0]=>
array(1) {
diff --git a/ext/soap/tests/schema/schema028.phpt b/ext/soap/tests/schema/schema028.phpt
index f86a87584..7cc4ba568 100644
--- a/ext/soap/tests/schema/schema028.phpt
+++ b/ext/soap/tests/schema/schema028.phpt
@@ -20,7 +20,7 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2,1]" xsi:type="ns1:testType"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2,1]" xsi:type="ns1:testType"><item xsi:type="xsd:int">123</item><item xsi:type="xsd:int">123</item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
array(2) {
[0]=>
array(1) {
diff --git a/ext/soap/tests/schema/schema029.phpt b/ext/soap/tests/schema/schema029.phpt
index 8ae0a3b12..2081affc6 100644
--- a/ext/soap/tests/schema/schema029.phpt
+++ b/ext/soap/tests/schema/schema029.phpt
@@ -22,7 +22,7 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2,1]" xsi:type="ns1:testType"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam SOAP-ENC:arrayType="xsd:int[2,1]" xsi:type="ns1:testType"><x_item xsi:type="xsd:int">123</x_item><x_item xsi:type="xsd:int">123</x_item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
array(2) {
[0]=>
array(1) {
diff --git a/ext/soap/tests/schema/schema054.phpt b/ext/soap/tests/schema/schema054.phpt
index fc5cb0576..b1ff74e41 100644
--- a/ext/soap/tests/schema/schema054.phpt
+++ b/ext/soap/tests/schema/schema054.phpt
@@ -11,7 +11,7 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns2:Map"><item><key xsi:type="xsd:string">a</key><value xsi:type="xsd:int">123</value></item><item><key xsi:type="xsd:string">b</key><value xsi:type="xsd:float">123.5</value></item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns2:Map"><item><key xsi:type="xsd:string">a</key><value xsi:type="xsd:int">123</value></item><item><key xsi:type="xsd:string">b</key><value xsi:type="xsd:float">123.5</value></item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
array(2) {
["a"]=>
int(123)
diff --git a/ext/soap/tests/schema/schema055.phpt b/ext/soap/tests/schema/schema055.phpt
index 013cd92fd..f6ead2f13 100644
--- a/ext/soap/tests/schema/schema055.phpt
+++ b/ext/soap/tests/schema/schema055.phpt
@@ -18,7 +18,7 @@ echo "ok";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns2:Map"><item><key xsi:type="xsd:string">a</key><value xsi:type="xsd:int">123</value></item><item><key xsi:type="xsd:string">b</key><value xsi:type="xsd:float">123.5</value></item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:type="ns2:Map"><item><key xsi:type="xsd:string">a</key><value xsi:type="xsd:int">123</value></item><item><key xsi:type="xsd:string">b</key><value xsi:type="xsd:float">123.5</value></item></testParam></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
array(2) {
["a"]=>
int(123)
diff --git a/ext/soap/tests/schema/schema062.phpt b/ext/soap/tests/schema/schema062.phpt
index 1dc51ef76..60b06568e 100644
--- a/ext/soap/tests/schema/schema062.phpt
+++ b/ext/soap/tests/schema/schema062.phpt
@@ -19,7 +19,7 @@ echo "ok";
?>
--EXPECTF--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:nil="true" int="123" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam xsi:nil="true" int="123" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#%d (2) {
["_"]=>
NULL
diff --git a/ext/soap/tests/schema/schema065.phpt b/ext/soap/tests/schema/schema065.phpt
index e3f0d646d..3199a6bc8 100644
--- a/ext/soap/tests/schema/schema065.phpt
+++ b/ext/soap/tests/schema/schema065.phpt
@@ -16,7 +16,7 @@ echo "ok";
?>
--EXPECTF--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#%d (2) {
["str"]=>
string(3) "str"
diff --git a/ext/soap/tests/schema/schema066.phpt b/ext/soap/tests/schema/schema066.phpt
index b28127196..7fe47bbd2 100644
--- a/ext/soap/tests/schema/schema066.phpt
+++ b/ext/soap/tests/schema/schema066.phpt
@@ -16,7 +16,7 @@ echo "ok";
?>
--EXPECTF--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#%d (2) {
["str"]=>
string(3) "str"
diff --git a/ext/soap/tests/schema/schema067.phpt b/ext/soap/tests/schema/schema067.phpt
index 0e4000957..5ee0036eb 100644
--- a/ext/soap/tests/schema/schema067.phpt
+++ b/ext/soap/tests/schema/schema067.phpt
@@ -16,7 +16,7 @@ echo "ok";
?>
--EXPECTF--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" int="5" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" int="5" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#%d (2) {
["str"]=>
string(3) "str"
diff --git a/ext/soap/tests/schema/schema069.phpt b/ext/soap/tests/schema/schema069.phpt
index e4f733a1c..ccaa34240 100644
--- a/ext/soap/tests/schema/schema069.phpt
+++ b/ext/soap/tests/schema/schema069.phpt
@@ -17,7 +17,7 @@ echo "ok";
?>
--EXPECTF--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#%d (2) {
["str"]=>
string(3) "str"
diff --git a/ext/soap/tests/schema/schema070.phpt b/ext/soap/tests/schema/schema070.phpt
index af9abdc10..0c1e24939 100644
--- a/ext/soap/tests/schema/schema070.phpt
+++ b/ext/soap/tests/schema/schema070.phpt
@@ -19,7 +19,7 @@ echo "ok";
?>
--EXPECTF--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam str="str" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#%d (2) {
["str"]=>
string(3) "str"
diff --git a/ext/soap/tests/schema/schema075.phpt b/ext/soap/tests/schema/schema075.phpt
index 0f430f59d..5867e55a7 100644
--- a/ext/soap/tests/schema/schema075.phpt
+++ b/ext/soap/tests/schema/schema075.phpt
@@ -18,7 +18,7 @@ echo "ok";
?>
--EXPECTF--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam ns1:int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam ns1:int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#%d (3) {
["int1"]=>
int(1)
diff --git a/ext/soap/tests/schema/schema076.phpt b/ext/soap/tests/schema/schema076.phpt
index 6e6444a5d..3ad2eae33 100644
--- a/ext/soap/tests/schema/schema076.phpt
+++ b/ext/soap/tests/schema/schema076.phpt
@@ -18,7 +18,7 @@ echo "ok";
?>
--EXPECTF--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#%d (3) {
["int1"]=>
int(1)
diff --git a/ext/soap/tests/schema/schema077.phpt b/ext/soap/tests/schema/schema077.phpt
index 779503cb4..16057cfcf 100644
--- a/ext/soap/tests/schema/schema077.phpt
+++ b/ext/soap/tests/schema/schema077.phpt
@@ -18,7 +18,7 @@ echo "ok";
?>
--EXPECTF--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test><testParam int1="1" ns1:int2="2" int3="3" xsi:type="ns1:testType"/></ns1:test></SOAP-ENV:Body></SOAP-ENV:Envelope>
object(stdClass)#%d (3) {
["int1"]=>
int(1)
diff --git a/ext/soap/tests/server025.phpt b/ext/soap/tests/server025.phpt
index 0a98b4108..eb5d647eb 100755
--- a/ext/soap/tests/server025.phpt
+++ b/ext/soap/tests/server025.phpt
@@ -42,5 +42,5 @@ echo "ok\n";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://testuri.org"><SOAP-ENV:Header><ns1:Test1 xsi:type="xsd:string">Hello Header!</ns1:Test1><ns1:Test2 xsi:type="xsd:string">Hello Header!</ns1:Test2></SOAP-ENV:Header><SOAP-ENV:Body><ns1:testResponse><result>Hello Body!</result></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://testuri.org"><SOAP-ENV:Header><ns1:Test1 xsi:type="xsd:string">Hello Header!</ns1:Test1><ns1:Test2 xsi:type="xsd:string">Hello Header!</ns1:Test2></SOAP-ENV:Header><SOAP-ENV:Body><ns1:testResponse><result>Hello Body!</result></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
ok
diff --git a/ext/soap/tests/server026.phpt b/ext/soap/tests/server026.phpt
new file mode 100755
index 000000000..a473a8540
--- /dev/null
+++ b/ext/soap/tests/server026.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SOAP Server 26: setObject
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class Foo {
+ function test() {
+ return "Hello World";
+ }
+}
+
+$foo = new Foo();
+$server = new soapserver(null,array('uri'=>"http://testuri.org"));
+$server->setObject($foo);
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/server027.phpt b/ext/soap/tests/server027.phpt
new file mode 100755
index 000000000..9fee4a608
--- /dev/null
+++ b/ext/soap/tests/server027.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SOAP Server 27: setObject and getFunctions
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class Foo {
+
+ function Foo() {
+ }
+
+ function test() {
+ return $this->str;
+ }
+}
+
+$foo = new Foo();
+$server = new SoapServer(null,array('uri'=>"http://testuri.org"));
+$server->setObject($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/server028.phpt b/ext/soap/tests/server028.phpt
new file mode 100755
index 000000000..17194b9e3
--- /dev/null
+++ b/ext/soap/tests/server028.phpt
@@ -0,0 +1,41 @@
+--TEST--
+SOAP Server 28: SoapServer::setObject and __call()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class Foo {
+ function __call($name, $args) {
+ if ($name == "test") {
+ return "Hello World";
+ } else {
+ return SoapFault("Server","Function $name doesn't exist");
+ }
+ }
+}
+
+$foo = new Foo();
+$server = new SoapServer(null,array('uri'=>"http://testuri.org"));
+$server->setObject($foo);
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:si="http://soapinterop.org/xsd">
+ <SOAP-ENV:Body>
+ <ns1:test xmlns:ns1="http://testuri.org" />
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><return xsi:type="xsd:string">Hello World</return></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/setheaders.phpt b/ext/soap/tests/setheaders.phpt
new file mode 100755
index 000000000..7b3684bdd
--- /dev/null
+++ b/ext/soap/tests/setheaders.phpt
@@ -0,0 +1,38 @@
+--TEST--
+SOAP: SoapClient::__setHeaders
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$client = new SoapClient(NULL, array("location"=>"test://","uri"=>"test://",
+ "exceptions"=>0,"trace"=>1));
+$client->test();
+echo $client->__getLastRequest();
+$client->__setSoapHeaders(new SoapHeader("test://","HDR1"));
+$client->test();
+echo $client->__getLastRequest();
+$client->test();
+echo $client->__getLastRequest();
+$client->__setSoapHeaders();
+$client->test();
+echo $client->__getLastRequest();
+$client->__setSoapHeaders(array(new SoapHeader("test://","HDR1"),new SoapHeader("test://","HDR2")));
+$client->test();
+echo $client->__getLastRequest();
+$h = array(new SoapHeader("test://","HDR0"));
+$client->__soapCall("test", array(), null, $h);
+echo $client->__getLastRequest();
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:HDR1/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:HDR1/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:HDR1/><ns1:HDR2/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:HDR0/><ns1:HDR1/><ns1:HDR2/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/soap12/T31.phpt b/ext/soap/tests/soap12/T31.phpt
index 9d1b0de1c..1533657c5 100644
--- a/ext/soap/tests/soap12/T31.phpt
+++ b/ext/soap/tests/soap12/T31.phpt
@@ -17,6 +17,6 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body><ns1:returnVoidResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body><ns1:returnVoidResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"/></env:Body></env:Envelope>
ok
diff --git a/ext/soap/tests/soap12/T41.phpt b/ext/soap/tests/soap12/T41.phpt
index 3ffa9155a..4f5527072 100644
--- a/ext/soap/tests/soap12/T41.phpt
+++ b/ext/soap/tests/soap12/T41.phpt
@@ -26,5 +26,5 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStructResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat></return></ns1:echoStructResponse></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStructResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat></return></ns1:echoStructResponse></env:Body></env:Envelope>
ok
diff --git a/ext/soap/tests/soap12/T42.phpt b/ext/soap/tests/soap12/T42.phpt
index 9e942428b..c9cca6d30 100644
--- a/ext/soap/tests/soap12/T42.phpt
+++ b/ext/soap/tests/soap12/T42.phpt
@@ -35,5 +35,5 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStructArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="ns2:SOAPStruct" enc:arraySize="2" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">bye world</varString><varInt xsi:type="xsd:int">43</varInt><varFloat xsi:type="xsd:float">0.123</varFloat></item></return></ns1:echoStructArrayResponse></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStructArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="ns2:SOAPStruct" enc:arraySize="2" xsi:type="ns2:ArrayOfSOAPStruct"><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat></item><item xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">bye world</varString><varInt xsi:type="xsd:int">43</varInt><varFloat xsi:type="xsd:float">0.123</varFloat></item></return></ns1:echoStructArrayResponse></env:Body></env:Envelope>
ok
diff --git a/ext/soap/tests/soap12/T44.phpt b/ext/soap/tests/soap12/T44.phpt
index 0cebf02f3..a53b85adc 100644
--- a/ext/soap/tests/soap12/T44.phpt
+++ b/ext/soap/tests/soap12/T44.phpt
@@ -23,5 +23,5 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoSimpleTypesAsStructResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat></return></ns1:echoSimpleTypesAsStructResponse></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoSimpleTypesAsStructResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat></return></ns1:echoSimpleTypesAsStructResponse></env:Body></env:Envelope>
ok
diff --git a/ext/soap/tests/soap12/T45.phpt b/ext/soap/tests/soap12/T45.phpt
index c11a80490..a1e3a7867 100644
--- a/ext/soap/tests/soap12/T45.phpt
+++ b/ext/soap/tests/soap12/T45.phpt
@@ -31,5 +31,5 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoNestedStructResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">nested struct</varString><varInt xsi:type="xsd:int">99</varInt><varFloat xsi:type="xsd:float">5.5</varFloat></varStruct></return></ns1:echoNestedStructResponse></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoNestedStructResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="ns2:SOAPStructStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat><varStruct xsi:type="ns2:SOAPStruct"><varString xsi:type="xsd:string">nested struct</varString><varInt xsi:type="xsd:int">99</varInt><varFloat xsi:type="xsd:float">5.5</varFloat></varStruct></return></ns1:echoNestedStructResponse></env:Body></env:Envelope>
ok
diff --git a/ext/soap/tests/soap12/T46.phpt b/ext/soap/tests/soap12/T46.phpt
index 2136f96b6..9298a55b3 100644
--- a/ext/soap/tests/soap12/T46.phpt
+++ b/ext/soap/tests/soap12/T46.phpt
@@ -32,5 +32,5 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoNestedArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat><varArray enc:itemType="xsd:string" enc:arraySize="3" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></return></ns1:echoNestedArrayResponse></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:ns2="http://example.org/ts-tests/xsd"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoNestedArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return xsi:type="ns2:SOAPArrayStruct"><varString xsi:type="xsd:string">hello world</varString><varInt xsi:type="xsd:int">42</varInt><varFloat xsi:type="xsd:float">0.005</varFloat><varArray enc:itemType="xsd:string" enc:arraySize="3" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">red</item><item xsi:type="xsd:string">blue</item><item xsi:type="xsd:string">green</item></varArray></return></ns1:echoNestedArrayResponse></env:Body></env:Envelope>
ok
diff --git a/ext/soap/tests/soap12/T47.phpt b/ext/soap/tests/soap12/T47.phpt
index 6799c9178..f53a5b59f 100644
--- a/ext/soap/tests/soap12/T47.phpt
+++ b/ext/soap/tests/soap12/T47.phpt
@@ -25,5 +25,5 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoFloatArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="xsd:float" enc:arraySize="2" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">5.5</item><item xsi:type="xsd:float">12999.9</item></return></ns1:echoFloatArrayResponse></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoFloatArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="xsd:float" enc:arraySize="2" xsi:type="ns2:ArrayOffloat"><item xsi:type="xsd:float">5.5</item><item xsi:type="xsd:float">12999.9</item></return></ns1:echoFloatArrayResponse></env:Body></env:Envelope>
ok
diff --git a/ext/soap/tests/soap12/T48.phpt b/ext/soap/tests/soap12/T48.phpt
index 19ef72fce..f82ac6cda 100644
--- a/ext/soap/tests/soap12/T48.phpt
+++ b/ext/soap/tests/soap12/T48.phpt
@@ -25,5 +25,5 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStringArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="xsd:string" enc:arraySize="2" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">hello</item><item xsi:type="xsd:string">world</item></return></ns1:echoStringArrayResponse></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStringArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="xsd:string" enc:arraySize="2" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">hello</item><item xsi:type="xsd:string">world</item></return></ns1:echoStringArrayResponse></env:Body></env:Envelope>
ok
diff --git a/ext/soap/tests/soap12/T49.phpt b/ext/soap/tests/soap12/T49.phpt
index 25734a8b4..2923a9e11 100644
--- a/ext/soap/tests/soap12/T49.phpt
+++ b/ext/soap/tests/soap12/T49.phpt
@@ -25,5 +25,5 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStringArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="xsd:string" enc:arraySize="2" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">hello</item><item xsi:type="xsd:string">world</item></return></ns1:echoStringArrayResponse></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoStringArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="xsd:string" enc:arraySize="2" xsi:type="ns2:ArrayOfstring"><item xsi:type="xsd:string">hello</item><item xsi:type="xsd:string">world</item></return></ns1:echoStringArrayResponse></env:Body></env:Envelope>
ok
diff --git a/ext/soap/tests/soap12/T50.phpt b/ext/soap/tests/soap12/T50.phpt
index 49e4f6f98..91a2a52b9 100644
--- a/ext/soap/tests/soap12/T50.phpt
+++ b/ext/soap/tests/soap12/T50.phpt
@@ -25,5 +25,5 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://example.org/ts-tests/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc="http://www.w3.org/2003/05/soap-encoding"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoIntegerArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="xsd:int" enc:arraySize="2" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">100</item><item xsi:type="xsd:int">200</item></return></ns1:echoIntegerArrayResponse></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://example.org/ts-tests/xsd"><env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc"><ns1:echoIntegerArrayResponse env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><rpc:result>return</rpc:result><return enc:itemType="xsd:int" enc:arraySize="2" xsi:type="ns2:ArrayOfint"><item xsi:type="xsd:int">100</item><item xsi:type="xsd:int">200</item></return></ns1:echoIntegerArrayResponse></env:Body></env:Envelope>
ok
diff --git a/ext/soap/tests/typemap001.phpt b/ext/soap/tests/typemap001.phpt
new file mode 100755
index 000000000..d76170a74
--- /dev/null
+++ b/ext/soap/tests/typemap001.phpt
@@ -0,0 +1,60 @@
+--TEST--
+SOAP typemap 1: SoapServer support for typemap's from_xml()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+ <ns1:dotest>
+ <book xsi:type=\"ns1:book\">
+ <a xsi:type=\"xsd:string\">foo</a>
+ <b xsi:type=\"xsd:string\">bar</b>
+</book>
+</ns1:dotest>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_from_xml($xml) {
+ $sxe = simplexml_load_string($xml);
+ $obj = new book;
+ $obj->a = (string)$sxe->a;
+ $obj->b = (string)$sxe->b;
+ return $obj;
+}
+
+class test{
+ function dotest($book){
+ $classname=get_class($book);
+ return "Object: ".$classname. "(".$book->a.",".$book->b.")";
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "from_xml" => "book_from_xml"))
+ );
+
+$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options);
+$server->setClass("test");
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotestResponse><res xsi:type="xsd:string">Object: book(foo,bar)</res></ns1:dotestResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/typemap002.phpt b/ext/soap/tests/typemap002.phpt
new file mode 100755
index 000000000..ee80c5981
--- /dev/null
+++ b/ext/soap/tests/typemap002.phpt
@@ -0,0 +1,56 @@
+--TEST--
+SOAP typemap 2: SoapServer support for typemap's to_xml()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+<ns1:dotest2>
+<dotest2 xsi:type=\"xsd:string\">???</dotest2>
+</ns1:dotest2>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_to_xml($book) {
+ return '<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><a xsi:type="xsd:string">'.$book->a.'!</a><b xsi:type="xsd:string">'.$book->b.'!</b></book>';
+}
+
+class test{
+ function dotest2($str){
+ $book = new book;
+ $book->a = "foo";
+ $book->b = "bar";
+ return $book;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options);
+$server->setClass("test");
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotest2Response><book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:book"><a xsi:type="xsd:string">foo!</a><b xsi:type="xsd:string">bar!</b></book></ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/typemap003.phpt b/ext/soap/tests/typemap003.phpt
new file mode 100755
index 000000000..17bd6c16e
--- /dev/null
+++ b/ext/soap/tests/typemap003.phpt
@@ -0,0 +1,54 @@
+--TEST--
+SOAP Typemap 3: SoapClient support for typemap's from_xml()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body>
+<ns1:dotest2Response><res xsi:type="ns1:book">
+ <a xsi:type="xsd:string">foo</a>
+ <b xsi:type="xsd:string">bar</b>
+</res>
+</ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+function book_from_xml($xml) {
+ $sxe = simplexml_load_string($xml);
+ $obj = new book;
+ $obj->a = (string)$sxe->a;
+ $obj->b = (string)$sxe->b;
+ return $obj;
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "from_xml" => "book_from_xml"))
+ );
+
+$client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options);
+$ret = $client->dotest2("???");
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECTF--
+object(book)#%d (2) {
+ ["a"]=>
+ string(3) "foo"
+ ["b"]=>
+ string(3) "bar"
+}
+ok
diff --git a/ext/soap/tests/typemap004.phpt b/ext/soap/tests/typemap004.phpt
new file mode 100755
index 000000000..f94af4990
--- /dev/null
+++ b/ext/soap/tests/typemap004.phpt
@@ -0,0 +1,41 @@
+--TEST--
+SOAP Typemap 4: SoapClient support for typemap's to_xml()
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version) {
+ echo $request;
+ exit;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+function book_to_xml($book) {
+ return '<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><a xsi:type="xsd:string">'.$book->a.'!</a><b xsi:type="xsd:string">'.$book->b.'!</b></book>';
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options);
+$book = new book();
+$book->a = "foo";
+$book->b = "bar";
+$ret = $client->dotest($book);
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotest><book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:book"><a xsi:type="xsd:string">foo!</a><b xsi:type="xsd:string">bar!</b></book></ns1:dotest></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/typemap005.phpt b/ext/soap/tests/typemap005.phpt
new file mode 100755
index 000000000..b016519a7
--- /dev/null
+++ b/ext/soap/tests/typemap005.phpt
@@ -0,0 +1,61 @@
+--TEST--
+SOAP typemap 5: SoapServer support for typemap's from_xml() (without WSDL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+ <ns1:dotest>
+ <book xsi:type=\"ns1:book\">
+ <a xsi:type=\"xsd:string\">foo</a>
+ <b xsi:type=\"xsd:string\">bar</b>
+</book>
+</ns1:dotest>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_from_xml($xml) {
+ $sxe = simplexml_load_string($xml);
+ $obj = new book;
+ $obj->a = (string)$sxe->a;
+ $obj->b = (string)$sxe->b;
+ return $obj;
+}
+
+class test{
+ function dotest($book){
+ $classname=get_class($book);
+ return "Object: ".$classname. "(".$book->a.",".$book->b.")";
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+$options=Array(
+ 'uri' => "http://schemas.nothing.com",
+ 'actor' => 'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "from_xml" => "book_from_xml"))
+ );
+
+$server = new SoapServer(NULL,$options);
+$server->setClass("test");
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotestResponse><return xsi:type="xsd:string">Object: book(foo,bar)</return></ns1:dotestResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/typemap006.phpt b/ext/soap/tests/typemap006.phpt
new file mode 100755
index 000000000..1e3609a8b
--- /dev/null
+++ b/ext/soap/tests/typemap006.phpt
@@ -0,0 +1,57 @@
+--TEST--
+SOAP typemap 6: SoapServer support for typemap's to_xml() (without WSDL, using SoapVar)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+<ns1:dotest2>
+<dotest2 xsi:type=\"xsd:string\">???</dotest2>
+</ns1:dotest2>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_to_xml($book) {
+ return '<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><a xsi:type="xsd:string">'.$book->a.'!</a><b xsi:type="xsd:string">'.$book->b.'!</b></book>';
+}
+
+class test{
+ function dotest2($str){
+ $book = new book;
+ $book->a = "foo";
+ $book->b = "bar";
+ return new SoapVar($book, null, "book", "http://schemas.nothing.com");
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+$options=Array(
+ 'uri' => "http://schemas.nothing.com",
+ 'actor' => 'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$server = new SoapServer(NULL,$options);
+$server->setClass("test");
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotest2Response><book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:book"><a xsi:type="xsd:string">foo!</a><b xsi:type="xsd:string">bar!</b></book></ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/typemap007.phpt b/ext/soap/tests/typemap007.phpt
new file mode 100755
index 000000000..8e2880b58
--- /dev/null
+++ b/ext/soap/tests/typemap007.phpt
@@ -0,0 +1,56 @@
+--TEST--
+SOAP Typemap 7: SoapClient support for typemap's from_xml() (without WSDL)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body>
+<ns1:dotest2Response><res xsi:type="ns1:book">
+ <a xsi:type="xsd:string">foo</a>
+ <b xsi:type="xsd:string">bar</b>
+</res>
+</ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+function book_from_xml($xml) {
+ $sxe = simplexml_load_string($xml);
+ $obj = new book;
+ $obj->a = (string)$sxe->a;
+ $obj->b = (string)$sxe->b;
+ return $obj;
+}
+
+$options=Array(
+ 'uri' => 'http://schemas.nothing.com',
+ 'location' => 'test://',
+ 'actor' => 'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "from_xml" => "book_from_xml"))
+ );
+
+$client = new TestSoapClient(NULL, $options);
+$ret = $client->dotest2("???");
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECTF--
+object(book)#%d (2) {
+ ["a"]=>
+ string(3) "foo"
+ ["b"]=>
+ string(3) "bar"
+}
+ok
diff --git a/ext/soap/tests/typemap008.phpt b/ext/soap/tests/typemap008.phpt
new file mode 100755
index 000000000..aaaa715d6
--- /dev/null
+++ b/ext/soap/tests/typemap008.phpt
@@ -0,0 +1,43 @@
+--TEST--
+SOAP Typemap 8: SoapClient support for typemap's to_xml() (without WSDL, using SoapVar)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version) {
+ echo $request;
+ exit;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+function book_to_xml($book) {
+ return '<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><a xsi:type="xsd:string">'.$book->a.'!</a><b xsi:type="xsd:string">'.$book->b.'!</b></book>';
+}
+
+$options=Array(
+ 'uri' => 'http://schemas.nothing.com',
+ 'location' => 'test://',
+ 'actor' => 'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$client = new TestSoapClient(NULL, $options);
+$book = new book();
+$book->a = "foo";
+$book->b = "bar";
+$ret = $client->dotest(new SoapVar($book, null, "book", "http://schemas.nothing.com"));
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotest><book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:book"><a xsi:type="xsd:string">foo!</a><b xsi:type="xsd:string">bar!</b></book></ns1:dotest></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/typemap009.phpt b/ext/soap/tests/typemap009.phpt
new file mode 100755
index 000000000..337aea65c
--- /dev/null
+++ b/ext/soap/tests/typemap009.phpt
@@ -0,0 +1,56 @@
+--TEST--
+SOAP typemap 9: SoapServer support for typemap's from_xml() (SoapFault)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+ <ns1:dotest>
+ <book xsi:type=\"ns1:book\">
+ <a xsi:type=\"xsd:string\">foo</a>
+ <b xsi:type=\"xsd:string\">bar</b>
+</book>
+</ns1:dotest>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_from_xml($xml) {
+ throw new SoapFault("Server", "Conversion Failed");
+}
+
+class test{
+ function dotest($book){
+ $classname=get_class($book);
+ return "Object: ".$classname. "(".$book->a.",".$book->b.")";
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "from_xml" => "book_from_xml"))
+ );
+
+$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options);
+$server->setClass("test");
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Conversion Failed</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/typemap010.phpt b/ext/soap/tests/typemap010.phpt
new file mode 100755
index 000000000..44d2746bd
--- /dev/null
+++ b/ext/soap/tests/typemap010.phpt
@@ -0,0 +1,56 @@
+--TEST--
+SOAP typemap 10: SoapServer support for typemap's to_xml() (SoapFault)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+<ns1:dotest2>
+<dotest2 xsi:type=\"xsd:string\">???</dotest2>
+</ns1:dotest2>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_to_xml($book) {
+ throw new SoapFault("Server", "Conversion Fault");
+}
+
+class test{
+ function dotest2($str){
+ $book = new book;
+ $book->a = "foo";
+ $book->b = "bar";
+ return $book;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options);
+$server->setClass("test");
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Conversion Fault</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/soap/tests/typemap011.phpt b/ext/soap/tests/typemap011.phpt
new file mode 100755
index 000000000..52acde28d
--- /dev/null
+++ b/ext/soap/tests/typemap011.phpt
@@ -0,0 +1,49 @@
+--TEST--
+SOAP Typemap 11: SoapClient support for typemap's from_xml() (SoapFault)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version) {
+ return <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body>
+<ns1:dotest2Response><res xsi:type="ns1:book">
+ <a xsi:type="xsd:string">foo</a>
+ <b xsi:type="xsd:string">bar</b>
+</res>
+</ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+EOF;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+function book_from_xml($xml) {
+ throw new SoapFault("Client", "Conversion Error");
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "from_xml" => "book_from_xml"))
+ );
+
+$client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options);
+try {
+ $ret = $client->dotest2("???");
+} catch (SoapFault $e) {
+ $ret = "SoapFault = " . $e->faultcode . " - " . $e->faultstring;
+}
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECT--
+string(37) "SoapFault = Client - Conversion Error"
+ok
diff --git a/ext/soap/tests/typemap012.phpt b/ext/soap/tests/typemap012.phpt
new file mode 100755
index 000000000..aa06215fe
--- /dev/null
+++ b/ext/soap/tests/typemap012.phpt
@@ -0,0 +1,45 @@
+--TEST--
+SOAP Typemap 12: SoapClient support for typemap's to_xml() (SoapFault)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class TestSoapClient extends SoapClient{
+ function __doRequest($request, $location, $action, $version) {
+ echo $request;
+ exit;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+function book_to_xml($book) {
+ throw new SoapFault("Client", "Conversion Error");
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options);
+$book = new book();
+$book->a = "foo";
+$book->b = "bar";
+try {
+ $ret = $client->dotest($book);
+} catch (SoapFault $e) {
+ $ret = "SoapFault = " . $e->faultcode . " - " . $e->faultstring;
+}
+var_dump($ret);
+echo "ok\n";
+?>
+--EXPECT--
+string(37) "SoapFault = Client - Conversion Error"
+ok
diff --git a/ext/soap/tests/typemap013.phpt b/ext/soap/tests/typemap013.phpt
new file mode 100755
index 000000000..99003c8dc
--- /dev/null
+++ b/ext/soap/tests/typemap013.phpt
@@ -0,0 +1,56 @@
+--TEST--
+SOAP typemap 13: SoapServer support for typemap's to_xml() with default ns
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$GLOBALS['HTTP_RAW_POST_DATA']="
+<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
+ xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
+ xmlns:ns1=\"http://schemas.nothing.com\"
+>
+ <env:Body>
+<ns1:dotest2>
+<dotest2 xsi:type=\"xsd:string\">???</dotest2>
+</ns1:dotest2>
+ </env:Body>
+<env:Header/>
+</env:Envelope>";
+
+function book_to_xml($book) {
+ return '<book xmlns="http://schemas.nothing.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><a xsi:type="xsd:string">'.$book->a.'!</a><b xsi:type="xsd:string">'.$book->b.'!</b></book>';
+}
+
+class test{
+ function dotest2($str){
+ $book = new book;
+ $book->a = "foo";
+ $book->b = "bar";
+ return $book;
+ }
+}
+
+class book{
+ public $a="a";
+ public $b="c";
+
+}
+
+$options=Array(
+ 'actor' =>'http://schemas.nothing.com',
+ 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
+ "type_name" => "book",
+ "to_xml" => "book_to_xml"))
+ );
+
+$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options);
+$server->setClass("test");
+$server->handle();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:dotest2Response><book xmlns="http://schemas.nothing.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:book"><a xsi:type="xsd:string">foo!</a><b xsi:type="xsd:string">bar!</b></book></ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 691c176f3..24775f8ad 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sockets.c,v 1.171.2.9 2006/04/07 14:04:36 pajoye Exp $ */
+/* $Id: sockets.c,v 1.171.2.9.2.4 2006/10/03 19:51:01 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -57,6 +57,7 @@
#endif
ZEND_DECLARE_MODULE_GLOBALS(sockets)
+static PHP_GINIT_FUNCTION(sockets);
#ifndef MSG_WAITALL
#ifdef LINUX
@@ -159,7 +160,11 @@ zend_module_entry sockets_module_entry = {
PHP_RSHUTDOWN(sockets),
PHP_MINFO(sockets),
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(sockets),
+ PHP_GINIT(sockets),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
@@ -432,7 +437,7 @@ static int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *
return 1;
}
-static void php_sockets_init_globals(zend_sockets_globals *sockets_globals TSRMLS_DC)
+static PHP_GINIT_FUNCTION(sockets)
{
sockets_globals->last_error = 0;
sockets_globals->strerror_buf = NULL;
@@ -444,8 +449,6 @@ 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);
@@ -533,6 +536,7 @@ static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *m
{
zval **element;
php_socket *php_sock;
+ int num = 0;
if (Z_TYPE_P(sock_array) != IS_ARRAY) return 0;
@@ -547,9 +551,10 @@ static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *m
if (php_sock->bsd_socket > *max_fd) {
*max_fd = php_sock->bsd_socket;
}
+ num++;
}
- return 1;
+ return num ? 1 : 0;
}
static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC)
@@ -558,11 +563,12 @@ static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC)
zval **dest_element;
php_socket *php_sock;
HashTable *new_hash;
+ int num = 0;
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);
+ zend_hash_init(new_hash, zend_hash_num_elements(Z_ARRVAL_P(sock_array)), 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))) {
@@ -575,6 +581,7 @@ static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC)
zend_hash_next_index_insert(new_hash, (void *)element, sizeof(zval *), (void **)&dest_element);
if (dest_element) zval_add_ref(dest_element);
}
+ num++;
}
/* Destroy old array, add new one */
@@ -584,7 +591,7 @@ static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC)
zend_hash_internal_pointer_reset(new_hash);
Z_ARRVAL_P(sock_array) = new_hash;
- return 1;
+ return num ? 1 : 0;
}
/* {{{ proto int socket_select(array &read_fds, array &write_fds, &array except_fds, int tv_sec[, int tv_usec])
@@ -1591,7 +1598,7 @@ PHP_FUNCTION(socket_get_option)
Sets socket options for the socket */
PHP_FUNCTION(socket_set_option)
{
- zval *arg1, *arg4;
+ zval *arg1, **arg4;
struct linger lv;
struct timeval tv;
php_socket *php_sock;
@@ -1612,7 +1619,7 @@ PHP_FUNCTION(socket_set_option)
char *sec_key = "sec";
char *usec_key = "usec";
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllz", &arg1, &level, &optname, &arg4) == FAILURE)
+ 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);
@@ -1621,8 +1628,8 @@ PHP_FUNCTION(socket_set_option)
switch (optname) {
case SO_LINGER:
- convert_to_array_ex(&arg4);
- opt_ht = HASH_OF(arg4);
+ 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);
@@ -1644,8 +1651,8 @@ PHP_FUNCTION(socket_set_option)
break;
case SO_RCVTIMEO:
case SO_SNDTIMEO:
- convert_to_array_ex(&arg4);
- opt_ht = HASH_OF(arg4);
+ 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);
@@ -1670,8 +1677,8 @@ PHP_FUNCTION(socket_set_option)
#endif
break;
default:
- convert_to_long_ex(&arg4);
- ov = Z_LVAL_P(arg4);
+ convert_to_long_ex(arg4);
+ ov = Z_LVAL_PP(arg4);
optlen = sizeof(ov);
opt_ptr = &ov;
diff --git a/ext/spl/config.m4 b/ext/spl/config.m4
index 470b89d8e..30f4f7806 100755
--- a/ext/spl/config.m4
+++ b/ext/spl/config.m4
@@ -1,13 +1,10 @@
-dnl $Id: config.m4,v 1.13.2.4 2006/01/06 14:03:37 sniper Exp $
+dnl $Id: config.m4,v 1.13.2.4.2.1 2006/08/23 09:47:21 tony2001 Exp $
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_MSG_CHECKING(whether zend_object_value is packed)
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$INCLUDES -I$abs_srcdir $CPPFLAGS"
@@ -29,5 +26,5 @@ int main(int argc, char **argv) {
CPPFLAGS=$old_CPPFLAGS
AC_DEFINE_UNQUOTED(HAVE_PACKED_OBJECT_VALUE, $ac_result, [Whether struct _zend_object_value is packed])
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)
+ 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, no)
fi
diff --git a/ext/spl/doxygen.cfg b/ext/spl/doxygen.cfg
index d58017a6a..4b7178723 100755
--- a/ext/spl/doxygen.cfg
+++ b/ext/spl/doxygen.cfg
@@ -194,10 +194,10 @@ PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = NO
+HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
-UML_LOOK = NO
+UML_LOOK = YES
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
diff --git a/ext/spl/examples/dualiterator.inc b/ext/spl/examples/dualiterator.inc
new file mode 100755
index 000000000..544034856
--- /dev/null
+++ b/ext/spl/examples/dualiterator.inc
@@ -0,0 +1,212 @@
+<?php
+
+/** @file dualiterator.inc
+ * @ingroup Examples
+ * @brief class DualIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2006
+ *
+ * SPL - Standard PHP Library
+ */
+
+/** @ingroup Examples
+ * @brief Synchronous iteration over two iterators
+ * @author Marcus Boerger
+ * @version 1.1
+ */
+class DualIterator implements Iterator
+{
+ const CURRENT_LHS = 0x01;
+ const CURRENT_RHS = 0x02;
+ const CURRENT_ARRAY = 0x03;
+ const CURRENT_0 = 0x00;
+
+ const KEY_LHS = 0x10;
+ const KEY_RHS = 0x20;
+ const KEY_ARRAY = 0x30;
+ const KEY_0 = 0x00;
+
+ const DEFAULT_FLAGS = 0x33;
+
+ private $lhs;
+ private $rhs;
+ private $flags;
+
+ /** construct iterator from two iterators
+ *
+ * @param lhs Left Hand Side Iterator
+ * @param rhs Right Hand Side Iterator
+ * @param flags iteration flags
+ */
+ function __construct(Iterator $lhs, Iterator $rhs,
+ $flags = 0x33 /*DualIterator::DEFAULT_FLAGS*/)
+ {
+ $this->lhs = $lhs;
+ $this->rhs = $rhs;
+ $this->flags = $flags;
+ }
+
+ /** @return Left Hand Side Iterator
+ */
+ function getLHS()
+ {
+ return $this->lhs;
+ }
+
+ /** @return Right Hand Side Iterator
+ */
+ function getRHS()
+ {
+ return $this->rhs;
+ }
+
+ /** @param flags new flags
+ */
+ function setFlags($flags)
+ {
+ $this->flags = $flags;
+ }
+
+ /** @return current flags
+ */
+ function getFlags()
+ {
+ return $this->flags;
+ }
+
+ /** rewind both inner iterators
+ */
+ function rewind()
+ {
+ $this->lhs->rewind();
+ $this->rhs->rewind();
+ }
+
+ /** @return whether both inner iterators are valid
+ */
+ function valid()
+ {
+ return $this->lhs->valid() && $this->rhs->valid();
+ }
+
+ /** @return current value depending on CURRENT_* flags
+ */
+ function current()
+ {
+ switch($this->flags & 0x0F)
+ {
+ default:
+ case self::CURRENT_ARRAY:
+ return array($this->lhs->current(), $this->rhs->current());
+ case self::CURRENT_LHS:
+ return $this->lhs->current();
+ case self::CURRENT_RHS:
+ return $this->rhs->current();
+ case self::CURRENT_0:
+ return NULL;
+ }
+ }
+
+ /** @return current value depending on KEY_* flags
+ */
+ function key()
+ {
+ switch($this->flags & 0xF0)
+ {
+ default:
+ case self::CURRENT_ARRAY:
+ return array($this->lhs->key(), $this->rhs->key());
+ case self::CURRENT_LHS:
+ return $this->lhs->key();
+ case self::CURRENT_RHS:
+ return $this->rhs->key();
+ case self::CURRENT_0:
+ return NULL;
+ }
+ }
+
+ /** move both inner iterators forward
+ */
+ function next()
+ {
+ $this->lhs->next();
+ $this->rhs->next();
+ }
+
+ /** @return whether both inner iterators are valid and have identical
+ * current and key values or both are non valid.
+ */
+ function areIdentical()
+ {
+ return $this->valid()
+ ? $this->lhs->current() === $this->rhs->current()
+ && $this->lhs->key() === $this->rhs->key()
+ : $this->lhs->valid() == $this->rhs->valid();
+ }
+
+ /** @return whether both inner iterators are valid and have equal current
+ * and key values or both are non valid.
+ */
+ function areEqual()
+ {
+ return $this->valid()
+ ? $this->lhs->current() == $this->rhs->current()
+ && $this->lhs->key() == $this->rhs->key()
+ : $this->lhs->valid() == $this->rhs->valid();
+ }
+
+ /** Compare two iterators
+ *
+ * @param lhs Left Hand Side Iterator
+ * @param rhs Right Hand Side Iterator
+ * @param identical whether to use areEqual() or areIdentical()
+ * @return whether both iterators are equal/identical
+ *
+ * @note If one implements RecursiveIterator the other must do as well.
+ * And if both do then a recursive comparison is being used.
+ */
+ static function compareIterators(Iterator $lhs, Iterator $rhs,
+ $identical = false)
+ {
+ if ($lhs instanceof RecursiveIterator)
+ {
+ if ($rhs instanceof RecursiveIterator)
+ {
+ $it = new RecursiveDualIterator($lhs, $rhs,
+ self::CURRENT_0 | self::KEY_0);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ $it = new DualIterator($lhs, $rhs, self::CURRENT_0 | self::KEY_0);
+ }
+
+ if ($identical)
+ {
+ foreach(new RecursiveIteratorIterator($it) as $n)
+ {
+ if (!$it->areIdentical())
+ {
+ return false;
+ }
+ }
+ }
+ else
+ {
+ foreach($it as $n)
+ {
+ if (!$it->areEqual())
+ {
+ return false;
+ }
+ }
+ }
+ return $identical ? $it->areIdentical() : $it->areEqual();
+ }
+}
+
+?>
diff --git a/ext/spl/examples/recursivedualiterator.inc b/ext/spl/examples/recursivedualiterator.inc
new file mode 100755
index 000000000..702e0cd74
--- /dev/null
+++ b/ext/spl/examples/recursivedualiterator.inc
@@ -0,0 +1,72 @@
+<?php
+
+/** @file recursivedualiterator.inc
+ * @ingroup Examples
+ * @brief class RecursiveDualIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2006
+ *
+ * SPL - Standard PHP Library
+ */
+
+/** @ingroup Examples
+ * @brief Synchronous iteration over two recursive iterators
+ * @author Marcus Boerger
+ * @version 1.0
+ */
+class RecursiveDualIterator extends DualIterator implements RecursiveIterator
+{
+ private $ref;
+
+ /** construct iterator from two iterators
+ *
+ * @param lhs Left Hand Side Iterator
+ * @param rhs Right Hand Side Iterator
+ * @param flags iteration flags
+ */
+ function __construct(RecursiveIterator $lhs, RecursiveIterator $rhs,
+ $flags = 0x33 /*DualIterator::DEFAULT_FLAGS*/)
+ {
+ parent::__construct($lhs, $rhs, $flags);
+ }
+
+ /** @return whether both LHS and RHS have children
+ */
+ function hasChildren()
+ {
+ return $this->getLHS()->hasChildren() && $this->getRHS()->hasChildren();
+ }
+
+ /** @return new RecursiveDualIterator (late binding) for the two inner
+ * iterators current children.
+ */
+ function getChildren()
+ {
+ if (empty($this->ref))
+ {
+ $this->ref = new ReflectionClass($this);
+ }
+ return $this->ref->newInstance(
+ $this->getLHS()->getChildren(), $this->getRHS()->getChildren(), $this->getFlags());
+ }
+
+ /** @return whether both inner iterators are valid, have same hasChildren()
+ * state and identical current and key values or both are non valid.
+ */
+ function areIdentical()
+ {
+ return $this->getLHS()->hasChildren() === $this->getRHS()->hasChildren()
+ && parent::areIdentical();
+ }
+
+ /** @return whether both inner iterators are valid, have same hasChildren()
+ * state and equal current and key values or both are invalid.
+ */
+ function areEqual()
+ {
+ return $this->getLHS()->hasChildren() === $this->getRHS()->hasChildren()
+ && parent::areEqual();
+ }
+}
+
+?>
diff --git a/ext/spl/examples/tests/dualiterator_001.phpt b/ext/spl/examples/tests/dualiterator_001.phpt
new file mode 100755
index 000000000..5577c4dc1
--- /dev/null
+++ b/ext/spl/examples/tests/dualiterator_001.phpt
@@ -0,0 +1,47 @@
+--TEST--
+SPL: DualIterator
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+function spl_examples_autoload($classname)
+{
+ include(dirname(__FILE__) . '/../' . strtolower($classname) . '.inc');
+}
+
+spl_autoload_register('spl_examples_autoload');
+
+function test($a, $b, $identical = false)
+{
+ var_dump(DualIterator::compareIterators(
+ new RecursiveArrayIterator($a),
+ new RecursiveArrayIterator($b),
+ $identical));
+}
+
+test(array(1,2,3), array(1,2,3));
+test(array(1,2,3), array(1,2));
+test(array(1,array(21,22),3), array(1,array(21,22),3));
+test(array(1,array(21,22),3), array(1,array(21,22,23),3));
+test(array(1,array(21,22),3), array(1,array(21,22,3)));
+test(array(1,array(21,22),3), array(1,array(21),array(22),3));
+test(array(1,2,3), array(1,"2",3), false);
+test(array(1,2,3), array(1,"2",3), true);
+test(array(1,array(21,22),3), array(1,array(21,"22"),3), false);
+test(array(1,array(21,22),3), array(1,array(21,"22"),3), true);
+
+?>
+===DONE===
+--EXPECT--
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+===DONE===
diff --git a/ext/spl/internal/filteriterator.inc b/ext/spl/internal/filteriterator.inc
index ddf161355..c0b5681d2 100755
--- a/ext/spl/internal/filteriterator.inc
+++ b/ext/spl/internal/filteriterator.inc
@@ -4,13 +4,13 @@
* @ingroup SPL
* @brief class FilterIterator
* @author Marcus Boerger
- * @date 2003 - 2005
+ * @date 2003 - 2006
*
* SPL - Standard PHP Library
*/
/**
- * @brief Regular expression filter for string iterators
+ * @brief Abstract filter for iterators
* @author Marcus Boerger
* @version 1.1
* @since PHP 5.0
@@ -28,11 +28,9 @@ abstract class FilterIterator implements OuterIterator
private $it;
/**
- * Constructs a filter around an iterator whose elemnts are strings.
- * If the given iterator is of type spl_sequence then its rewind()
- * method is called.
+ * Constructs a filter around another iterator.
*
- * @param it Object that implements at least spl_forward
+ * @param it Iterator to filter
*/
function __construct(Iterator $it) {
$this->it = $it;
diff --git a/ext/spl/internal/recursiveregexiterator.inc b/ext/spl/internal/recursiveregexiterator.inc
new file mode 100755
index 000000000..df47d6197
--- /dev/null
+++ b/ext/spl/internal/recursiveregexiterator.inc
@@ -0,0 +1,61 @@
+<?php
+
+/** @file recursiveregexiterator.inc
+ * @ingroup SPL
+ * @brief class RegexIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2006
+ *
+ * SPL - Standard PHP Library
+ */
+
+/**
+ * @brief Recursive regular expression filter for iterators
+ * @author Marcus Boerger
+ * @version 1.0
+ * @since PHP 5.1
+ *
+ * This filter iterator assumes that the inner iterator
+ */
+class RecursiveRegexIterator extends RegexIterator implements RecursiveIterator
+{
+ /**
+ * Constructs a regular expression filter around an iterator whose
+ * elemnts or keys are strings.
+ *
+ * @param it inner iterator
+ * @param regex the regular expression to match
+ * @param mode operation mode (one of self::MATCH, self::GET_MATCH,
+ * self::ALL_MATCHES, self::SPLIT)
+ * @param flags special flags (self::USE_KEY)
+ * @param preg_flags global PREG_* flags, see preg_match(),
+ * preg_match_all(), preg_split()
+ */
+ function __construct(RecursiveIterator $it, $regex, $mode = 0, $flags = 0, $preg_flags = 0) {
+ parent::__construct($it, $regex, $mode, $flags, $preg_flags);
+ }
+
+ /** @return whether the current element has children
+ */
+ function hasChildren()
+ {
+ return $this->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/regexiterator.inc b/ext/spl/internal/regexiterator.inc
new file mode 100755
index 000000000..05eb4b1d9
--- /dev/null
+++ b/ext/spl/internal/regexiterator.inc
@@ -0,0 +1,163 @@
+<?php
+
+/** @file regexiterator.inc
+ * @ingroup SPL
+ * @brief class RegexIterator
+ * @author Marcus Boerger
+ * @date 2003 - 2006
+ *
+ * SPL - Standard PHP Library
+ */
+
+/**
+ * @brief Regular expression filter for iterators
+ * @author Marcus Boerger
+ * @version 1.0
+ * @since PHP 5.1
+ *
+ * This filter iterator assumes that the inner iterator
+ */
+class RegexIterator implements FilterIterator
+{
+ const USE_KEY = 0x00000001; /**< If present in $flags the the key is
+ used rather then the current value. */
+
+ const MATCH = 0; /**< Mode: Executed a plain match only */
+ const GET_MATCH = 1; /**< Mode: Return the first matche (if any) */
+ const ALL_MATCHES = 2; /**< Mode: Return all matches (if any) */
+ const SPLIT = 3; /**< Mode: Return the split values (if any) */
+ const REPLACE = 4; /**< Mode: Replace the input key or current */
+
+ private $regex; /**< the regular expression to match against */
+ private $mode; /**< operation mode (one of self::MATCH,
+ self::GET_MATCH, self::ALL_MATCHES, self::SPLIT) */
+ private $flags; /**< special flags (self::USE_KEY) */
+ private $preg_flags;/**< PREG_* flags, see preg_match(), preg_match_all(),
+ preg_split() */
+ private $key; /**< the value used for key() */
+ private $current; /**< the value used for current() */
+
+ /**
+ * Constructs a regular expression filter around an iterator whose
+ * elemnts or keys are strings.
+ *
+ * @param it inner iterator
+ * @param regex the regular expression to match
+ * @param mode operation mode (one of self::MATCH, self::GET_MATCH,
+ * self::ALL_MATCHES, self::SPLIT)
+ * @param flags special flags (self::USE_KEY)
+ * @param preg_flags global PREG_* flags, see preg_match(),
+ * preg_match_all(), preg_split()
+ */
+ function __construct(Iterator $it, $regex, $mode = 0, $flags = 0, $preg_flags = 0) {
+ parent::__construct($it);
+ $this->regex = $regex;
+ $this->flags = $flags;
+ $this->mode = $mode;
+ $this->preg_flags = $preg_flags;
+ }
+
+ /**
+ * Match current or key against regular expression using mode, flags and
+ * preg_flags.
+ *
+ * @return whether this is a match
+ *
+ * @warning never call this twice for the same state
+ */
+ function accept()
+ {
+ $matches = array();
+ $this->key = parent::key();
+ $this->current = parent::current();
+ /* note that we use $this->current, rather than calling parent::current() */
+ $subject = ($this->flags & self::USE_KEY) ? $this->key : $this->current;
+ switch($this->mode)
+ {
+ case self::MATCH:
+ return preg_match($this->regex, $subject, $matches, $this->preg_flags);
+
+ case self::GET_MATCH:
+ $this->current = array();
+ return preg_match($this->regex, $subject, $this->current, $this->preg_flags) > 0;
+
+ case self::ALL_MATCHES:
+ $this->current = array();
+ return preg_match_all($this->regex, $subject, $this->current, $this->preg_flags) > 0;
+
+ case self::SPLIT:
+ $this->current = array();
+ preg_split($this->regex, $subject, $this->current, $this->preg_flags) > 1;
+
+ case self::REPLACE:
+ $this->current = array();
+ $result = preg_replace($this->regex, $this->replacement, $subject);
+ if ($this->flags & self::USE_KEY)
+ {
+ $this->key = $result;
+ }
+ else
+ {
+ $this->current = $result;
+ }
+ }
+ }
+
+ /** @return the key after accept has been called
+ */
+ function key()
+ {
+ return $this->key;
+ }
+
+ /** @return the current value after accept has been called
+ */
+ function current()
+ {
+ return $this->current;
+ }
+
+ /** @return current operation mode
+ */
+ function getMode()
+ {
+ return $this->mode;
+ }
+
+ /** @param mode new operaion mode
+ */
+ function setMode($mode)
+ {
+ $this->mode = $mode;
+ }
+
+ /** @return current operation flags
+ */
+ function getFlags()
+ {
+ return $this->flags;
+ }
+
+ /** @param flags new operaion flags
+ */
+ function setFlags($flags)
+ {
+ $this->flags = $flags;
+ }
+
+ /** @return current PREG flags
+ */
+ function getPregFlags()
+ {
+ return $this->preg_flags;
+ }
+
+ /** @param preg_flags new PREG flags
+ */
+ function setPregFlags($preg_flags)
+ {
+ $this->preg_flags = $preg_flags;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/ext/spl/internal/splfileobject.inc b/ext/spl/internal/splfileobject.inc
index bb1a23929..5f746ea2d 100755
--- a/ext/spl/internal/splfileobject.inc
+++ b/ext/spl/internal/splfileobject.inc
@@ -4,7 +4,7 @@
* @ingroup SPL
* @brief class FileObject
* @author Marcus Boerger
- * @date 2003 - 2005
+ * @date 2003 - 2006
*
* SPL - Standard PHP Library
*/
@@ -12,10 +12,10 @@
/** @ingroup SPL
* @brief Object representation for any stream
* @author Marcus Boerger
- * @version 1.0
+ * @version 1.1
* @since PHP 5.1
*/
-class SplFileObject implements RecursiveIterator, SeekableIterator
+class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIterator
{
/** Flag: wheter to suppress new lines */
const DROP_NEW_LINE = 0x00000001;
@@ -26,6 +26,8 @@ class SplFileObject implements RecursiveIterator, SeekableIterator
private $lnum = 0;
private $max_len = 0;
private $flags = 0;
+ private $delimiter= ',';
+ private $enclosure= '"';
/**
* Constructs a new file object
@@ -80,14 +82,44 @@ class SplFileObject implements RecursiveIterator, SeekableIterator
* @param enclosure end of
* @return array containing read data
*/
- function fgetcsv($delimiter = ';', $enclosure = '')
+ function fgetcsv($delimiter = NULL, $enclosure = NULL)
{
$this->freeLine();
$this->lnum++;
+ switch(fun_num_args())
+ {
+ case 0:
+ $delimiter = $this->delimiter;
+ case 1:
+ $enclosure = $this->enclosure;
+ default:
+ case 2:
+ break;
+ }
return fgetcsv($this->fp, $this->max_len, $delimiter, $enclosure);
}
/**
+ * Set the delimiter and enclosure character used in fgetcsv
+ *
+ * @param delimiter new delimiter, defaults to ','
+ * @param enclosure new enclosure, defaults to '"'
+ */
+ function setCsvControl($delimiter = ';', $enclosure = '"')
+ {
+ $this->delimiter = $delimiter;
+ $this->enclosure = $enclosure;
+ }
+
+ /**
+ * @return array(delimiter, enclosure) as used in fgetcsv
+ */
+ function getCsvControl($delimiter = ',', $enclosure = '"')
+ {
+ return array($this->delimiter, $this->enclosure);
+ }
+
+ /**
* @param operation lock operation (LOCK_SH, LOCK_EX, LOCK_UN, LOCK_NB)
* @retval $wouldblock whether the operation would block
*/
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 2ac1cef67..7991e4c76 100755
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_spl.c,v 1.52.2.28 2006/03/23 19:55:16 helly Exp $ */
+/* $Id: php_spl.c,v 1.52.2.28.2.6 2006/08/07 09:49:53 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -36,6 +36,7 @@
#include "spl_observer.h"
#include "zend_exceptions.h"
#include "zend_interfaces.h"
+#include "ext/standard/md5.h"
#ifdef COMPILE_DL_SPL
ZEND_GET_MODULE(spl)
@@ -50,9 +51,9 @@ zend_function_entry spl_functions_none[] = {
};
/* }}} */
-/* {{{ spl_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
-static void spl_init_globals(zend_spl_globals *spl_globals)
+static PHP_GINIT_FUNCTION(spl)
{
spl_globals->autoload_extensions = NULL;
spl_globals->autoload_functions = NULL;
@@ -180,6 +181,8 @@ PHP_FUNCTION(class_implements)
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); \
@@ -210,10 +213,25 @@ int spl_autoload(const char *class_name, const char * lc_name, int class_name_le
zend_file_handle file_handle;
zend_op_array *new_op_array;
zval *result = NULL;
+ zval err_mode;
+ int ret;
class_file_len = spprintf(&class_file, 0, "%s%s", lc_name, file_extension);
- if (zend_stream_open(class_file, &file_handle TSRMLS_CC) == SUCCESS) {
+ ZVAL_LONG(&err_mode, EG(error_reporting));
+ if (Z_LVAL(err_mode)) {
+ php_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
+ }
+
+ ret = zend_stream_open(class_file, &file_handle TSRMLS_CC);
+
+ 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);
+ }
+
+ if (ret == SUCCESS) {
if (!file_handle.opened_path) {
file_handle.opened_path = estrndup(class_file, class_file_len);
}
@@ -227,7 +245,7 @@ int spl_autoload(const char *class_name, const char * lc_name, int class_name_le
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);
@@ -257,15 +275,11 @@ PHP_FUNCTION(spl_autoload)
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)) {
@@ -286,12 +300,6 @@ PHP_FUNCTION(spl_autoload)
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;
@@ -564,6 +572,32 @@ PHP_FUNCTION(spl_autoload_functions)
add_next_index_string(return_value, EG(autoload_func)->common.function_name, 1);
} /* }}} */
+/* {{{ proto string spl_object_hash(object obj)
+ Return hash id for given object */
+PHP_FUNCTION(spl_object_hash)
+{
+ zval *obj;
+ int len;
+ char *hash;
+ char md5str[33];
+ PHP_MD5_CTX context;
+ unsigned char digest[16];
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ return;
+ }
+
+ len = spprintf(&hash, 0, "%p:%d", Z_OBJ_HT_P(obj), Z_OBJ_HANDLE_P(obj));
+
+ md5str[0] = '\0';
+ PHP_MD5Init(&context);
+ PHP_MD5Update(&context, (unsigned char*)hash, len);
+ PHP_MD5Final(digest, &context);
+ make_digest(md5str, digest);
+ RETVAL_STRING(md5str, 1);
+ efree(hash);
+}
+
int spl_build_class_list_string(zval **entry, char **list TSRMLS_DC) /* {{{ */
{
char *res;
@@ -608,7 +642,14 @@ PHP_MINFO_FUNCTION(spl)
static
ZEND_BEGIN_ARG_INFO(arginfo_iterator, 0)
- ZEND_ARG_INFO(0, iterator)
+ ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iterator_apply, 0, 0, 2)
+ ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0)
+ ZEND_ARG_INFO(0, function)
+ ZEND_ARG_ARRAY_INFO(0, args, 1)
ZEND_END_ARG_INFO();
/* {{{ spl_functions
@@ -623,9 +664,11 @@ zend_function_entry spl_functions[] = {
PHP_FE(spl_autoload_call, NULL)
PHP_FE(class_parents, NULL)
PHP_FE(class_implements, NULL)
+ PHP_FE(spl_object_hash, NULL)
#ifdef SPL_ITERATORS_H
PHP_FE(iterator_to_array, arginfo_iterator)
PHP_FE(iterator_count, arginfo_iterator)
+ PHP_FE(iterator_apply, arginfo_iterator_apply)
#endif /* SPL_ITERATORS_H */
{NULL, NULL, NULL}
};
@@ -635,8 +678,6 @@ zend_function_entry spl_functions[] = {
*/
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);
@@ -694,7 +735,11 @@ zend_module_entry spl_module_entry = {
PHP_RSHUTDOWN(spl),
PHP_MINFO(spl),
"0.2",
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(spl),
+ PHP_GINIT(spl),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
diff --git a/ext/spl/spl.php b/ext/spl/spl.php
index f704e044b..2987024f2 100755
--- a/ext/spl/spl.php
+++ b/ext/spl/spl.php
@@ -6,7 +6,7 @@
*
* SPL - Standard PHP Library
*
- * (c) Marcus Boerger, 2003 - 2005
+ * (c) Marcus Boerger, 2003 - 2006
*/
/** @mainpage SPL - Standard PHP Library
@@ -46,6 +46,8 @@
* - class EmptyIterator implements Iterator
* - class InfiniteIterator extends IteratorIterator
* - class AppendIterator implements OuterIterator
+ * - class RegexIterator extends FilterIterator
+ * - class RecursiveRegexIterator extends RegexIterator implements RecursiveIterator
*
* 2) Directories and Files
*
@@ -66,8 +68,8 @@
*
* SPL offers advanced Array overloading:
*
- * - class ArrayObject implements IteratorAggregate
- * - class ArrayIterator implements Iterator
+ * - class ArrayObject implements IteratorAggregate, ArrayAccess, Countable
+ * - class ArrayIterator implements Iterator, ArrayAccess, Countable, SeekableIterator
* - class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator
*
* As the above suggest an ArrayObject creates an ArrayIterator when it comes to
@@ -110,6 +112,7 @@
* c-code.
*
* 9) Some articles about SPL:
+ * - <a href="http://www.phpro.org/tutorials/Introduction-to-SPL.html">Introduction to Standard PHP Library (SPL)</a>
* - <a href="http://www.sitepoint.com/article/php5-standard-library/1">Introducing PHP 5's Standard Library</a>
* - <a href="http://www.ramikayyali.com/archives/2005/02/25/iterators">Iterators in PHP5</a>
* - <a href="http://www.phpriot.com/d/articles/php/oop/oop-with-spl-php-5-1/index.html">Advanced OOP with SPL in PHP 5</a>
@@ -128,7 +131,7 @@
* You can download this documentation as a chm file
* <a href="http://php.net/~helly/php/ext/spl/spl.chm">here</a>.
*
- * (c) Marcus Boerger, 2003 - 2005
+ * (c) Marcus Boerger, 2003 - 2006
*/
/** @defgroup ZendEngine Zend engine classes
@@ -157,7 +160,7 @@
* @param class_name name of class to load
* @param file_extensions file extensions (use defaults if NULL)
*/
-function spl_autoload(string $class_name, string $file_extensions = NULL);
+function spl_autoload(string $class_name, string $file_extensions = NULL) {/**/};
/** @ingroup SPL
* @brief Manual invocation of all registerd autoload functions
@@ -165,7 +168,7 @@ function spl_autoload(string $class_name, string $file_extensions = NULL);
*
* @param class_name name of class to load
*/
-function spl_autoload_call(string $class_name);
+function spl_autoload_call(string $class_name) {/**/};
/** @ingroup SPL
* @brief Register and return default file extensions for spl_autoload
@@ -176,7 +179,7 @@ function spl_autoload_call(string $class_name);
* @return comma separated list of file extensions to use in default autoload
* function.
*/
-function spl_autoload_extensions($file_extensions);
+function spl_autoload_extensions($file_extensions) {/**/};
/** @ingroup SPL
* @brief Return all registered autoload functionns
@@ -184,7 +187,7 @@ function spl_autoload_extensions($file_extensions);
*
* @return array of all registered autoload functions or false
*/
-function spl_autoload_functions();
+function spl_autoload_functions() {/**/};
/** @ingroup SPL
* @brief Register given function as autoload implementation
@@ -194,7 +197,7 @@ function spl_autoload_functions();
* function name to register as autoload function.
* @param throw whether to throw or issue an error on failure.
*/
-function spl_autoload_register(string $autoload_function = "spl_autoload", $throw = true);
+function spl_autoload_register(string $autoload_function = "spl_autoload", $throw = true) {/**/};
/** @ingroup SPL
* @brief Unregister given function as autoload implementation
@@ -203,7 +206,7 @@ function spl_autoload_register(string $autoload_function = "spl_autoload", $thro
* @param autoload_function name of function or array of object/class and
* function name to unregister as autoload function.
*/
-function spl_autoload_unregister(string $autoload_function = "spl_autoload");
+function spl_autoload_unregister(string $autoload_function = "spl_autoload") {/**/};
/** @ingroup SPL
* @brief Return an array of classes and interfaces in SPL
@@ -211,7 +214,7 @@ function spl_autoload_unregister(string $autoload_function = "spl_autoload");
* @return array containing the names of all clsses and interfaces defined in
* extension SPL
*/
-function spl_classes();
+function spl_classes() {/**/};
/** @ingroup SPL
* @brief Count the elements in an iterator
@@ -219,7 +222,7 @@ function spl_classes();
*
* @return number of elements in an iterator
*/
-function iterator_count(Traversable $it);
+function iterator_count(Traversable $it) {/**/};
/** @ingroup SPL
* @brief Copy iterator elements into an array
@@ -228,7 +231,7 @@ function iterator_count(Traversable $it);
* @param it iterator to copy
* @return array with elements copied from the iterator
*/
-function iterator_to_array(Traversable $it);
+function iterator_to_array(Traversable $it) {/**/};
/** @ingroup ZendEngine
* @brief Basic Exception class.
@@ -611,7 +614,7 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Countable
* @param $flags see setFlags().
* @param $iterator_class class used in getIterator()
*/
- function __construct($array, $flags = 0, $iterator_class = "ArrayIterator");
+ function __construct($array, $flags = 0, $iterator_class = "ArrayIterator") {/**/}
/** Set behavior flags.
*
@@ -620,72 +623,94 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Countable
* when accessed as list (var_dump, foreach, etc.)
* 1 set: array indices can be accessed as properties in read/write
*/
- function setFlags($flags);
+ function setFlags($flags) {/**/}
- /**
- * @ return current flags
+ /** @return current flags
*/
- function getFlags();
+ function getFlags() {/**/}
- /**
- * @param $array new array or object
+ /** Sort the entries by values.
+ */
+ function asort() {/**/}
+
+ /** Sort the entries by key.
*/
- function exchangeArray($array);
+ 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();
+ function getIterator() {/**/}
/** @param $index offset to inspect
* @return whetehr offset $index esists
*/
- function offsetExists($index);
+ function offsetExists($index) {/**/}
/** @param $index offset to return value for
* @return value at offset $index
*/
- function offsetGet($index);
+ function offsetGet($index) {/**/}
/** @param $index index to set
* @param $newval new value to store at offset $index
*/
- function offsetSet($index, $newval);
+ function offsetSet($index, $newval) {/**/}
/** @param $index offset to unset
*/
- function offsetUnset($index);
+ 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);
+ 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();
+ function getArrayCopy() {/**/}
/** @return the number of elements in the array or the number of public
* properties in the object.
*/
- function count();
+ function count() {/**/}
/* @param $iterator_class new class used in getIterator()
*/
- function setIteratorClass($itertor_class);
+ function setIteratorClass($itertor_class) {/**/}
/* @return class used in getIterator()
*/
- function getIteratorClass();
+ function getIteratorClass() {/**/}
}
/** @ingroup SPL
* @brief An Array iterator
* @since PHP 5.0
- * @version 1.1
+ * @version 1.2
*
* This iterator allows to unset and modify values and keys while iterating
* over Arrays and Objects.
@@ -709,7 +734,7 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Countable
* @param $array the array to use.
* @param $flags see setFlags().
*/
- function __construct($array, $flags = 0);
+ function __construct($array, $flags = 0) {/**/}
/** Set behavior flags.
*
@@ -718,53 +743,92 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Countable
* when accessed as list (var_dump, foreach, etc.)
* 1 set: array indices can be accessed as properties in read/write
*/
- function setFlags($flags);
+ function setFlags($flags) {/**/}
/**
- * @ return current flags
+ * @return current flags
*/
- function getFlags();
+ 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);
+ function offsetExists($index) {/**/}
/** @param $index offset to return value for
* @return value at offset $index
*/
- function offsetGet($index);
+ function offsetGet($index) {/**/}
/** @param $index index to set
* @param $newval new value to store at offset $index
*/
- function offsetSet($index, $newval);
+ function offsetSet($index, $newval) {/**/}
/** @param $index offset to unset
*/
- function offsetUnset($index);
+ 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);
+ 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();
+ function getArrayCopy() {/**/}
/** @param $position offset to seek to
* @throw OutOfBoundsException if $position is invalid
*/
- function seek($position);
+ function seek($position) {/**/}
/** @return the number of elements in the array or the number of public
* properties in the object.
*/
- function count();
+ function count() {/**/}
+
+ /** @copydoc Iterator::rewind */
+ function rewind() {/**/}
+
+ /** @copydoc Iterator::valid */
+ function valid() {/**/}
+
+ /** @copydoc Iterator::current */
+ function current() {/**/}
+
+ /** @copydoc Iterator::key */
+ function key() {/**/}
+
+ /** @copydoc Iterator::next */
+ function next() {/**/}
}
/** @ingroup SPL
@@ -777,95 +841,95 @@ class SplFileInfo
*
* @param $file_name path or file name
*/
- function __construct($file_name);
+ function __construct($file_name) {/**/}
/** @return the path part only.
*/
- function getPath();
+ function getPath() {/**/}
/** @return the filename only.
*/
- function getFilename();
+ function getFilename() {/**/}
/** @return SplFileInfo created for the file
* @param class_name name of class to instantiate
* @see SplFileInfo::setInfoClass()
*/
- function getFileInfo(string class_name = NULL);
+ function getFileInfo(string class_name = NULL) {/**/}
/** @return The current entries path and file name.
*/
- function getPathname();
+ function getPathname() {/**/}
/** @return SplFileInfo created for the path
* @param class_name name of class to instantiate
* @see SplFileInfo::setInfoClass()
*/
- function getPathInfo(string class_name = NULL);
+ function getPathInfo(string class_name = NULL) {/**/}
/** @return The current entry's permissions.
*/
- function getPerms();
+ function getPerms() {/**/}
/** @return The current entry's inode.
*/
- function getInode();
+ function getInode() {/**/}
/** @return The current entry's size in bytes .
*/
- function getSize();
+ function getSize() {/**/}
/** @return The current entry's owner name.
*/
- function getOwner();
+ function getOwner() {/**/}
/** @return The current entry's group name.
*/
- function getGroup();
+ function getGroup() {/**/}
/** @return The current entry's last access time.
*/
- function getATime();
+ function getATime() {/**/}
/** @return The current entry's last modification time.
*/
- function getMTime();
+ function getMTime() {/**/}
/** @return The current entry's last change time.
*/
- function getCTime();
+ function getCTime() {/**/}
/** @return The current entry's size in bytes .
*/
- function getType();
+ function getType() {/**/}
/** @return Whether the current entry is writeable.
*/
- function isWritable();
+ function isWritable() {/**/}
/** @return Whether the current entry is readable.
*/
- function isReadable();
+ function isReadable() {/**/}
/** @return Whether the current entry is executable.
*/
- function isExecutable();
+ function isExecutable() {/**/}
/** @return Whether the current entry is .
*/
- function isFile();
+ function isFile() {/**/}
/** @return Whether the current entry is a directory.
*/
- function isDir();
+ function isDir() {/**/}
/** @return whether the current entry is a link.
*/
- function isLink();
+ function isLink() {/**/}
/** @return getPathname()
*/
- function __toString();
+ function __toString() {/**/}
/** Open the current file as a SplFileObject instance
*
@@ -880,17 +944,17 @@ class SplFileInfo
* @see SplFileInfo::setFileClass()
* @see file()
*/
- function openFile($mode = 'r', $use_include_path = false, $context = NULL);
+ function openFile($mode = 'r', $use_include_path = false, $context = NULL) {/**/}
/** @param class_name name of class used with openFile(). Must be derived
* from SPLFileObject.
*/
- function setFileClass(string class_name = "SplFileObject");
+ function setFileClass(string class_name = "SplFileObject") {/**/}
/** @param class_name name of class used with getFileInfo(), getPathInfo().
- * Must be derived from SplFileInfo.
+ * Must be derived from SplFileInfo.
*/
- function setInfoClass(string class_name = "SplFileInfo");
+ function setInfoClass(string class_name = "SplFileInfo") {/**/}
}
/** @ingroup SPL
@@ -904,27 +968,36 @@ class DirectoryIterator extends SplFileInfo implements Iterator
*
* @param $path directory to iterate.
*/
- function __construct($path);
+ function __construct($path) {/**/}
+ /** @copydoc Iterator::rewind */
+ function rewind() {/**/}
+
+ /** @copydoc Iterator::valid */
+ function valid() {/**/}
+
/** @return index of entry
*/
- function key();
+ function key() {/**/}
/** @return $this
*/
- function current();
+ function current() {/**/}
+
+ /** @copydoc Iterator::next */
+ function next() {/**/}
/** @return Whether the current entry is either '.' or '..'.
*/
- function isDot();
+ function isDot() {/**/}
/** @return whether the current entry is a link.
*/
- function isLink();
+ function isLink() {/**/}
/** @return getFilename()
*/
- function __toString();
+ function __toString() {/**/}
}
/** @ingroup SPL
@@ -946,31 +1019,31 @@ class RecursiveDirectoryIterator extends DirectoryIterator implements RecursiveI
* - KEY_AS_FILENAME
* - NEW_CURRENT_AND_KEY
*/
- function __construct($path, $flags = 0);
+ function __construct($path, $flags = 0) {/**/}
/** @return getPathname() or getFilename() depending on flags
*/
- function key();
+ function key() {/**/}
/** @return getFilename() or getFileInfo() depending on flags
*/
- function current();
+ function current() {/**/}
/** @return whether the current is a directory (not '.' or '..').
*/
- function hasChildren();
+ function hasChildren() {/**/}
/** @return a RecursiveDirectoryIterator for the current entry.
*/
- function getChildren();
+ function getChildren() {/**/}
/** @return sub path only (without main path)
*/
- function getSubPath();
+ function getSubPath() {/**/}
/** @return the current sub path
*/
- function getSubPathname();
+ function getSubPathname() {/**/}
}
/** @ingroup SPL
@@ -984,15 +1057,34 @@ class RecursiveDirectoryIterator extends DirectoryIterator implements RecursiveI
* 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
+class SimpleXMLIterator extends SimpleXMLElement implements RecursiveIterator, Countable
{
/** @return whether the current node has sub nodes.
*/
- function hasChildren();
+ function hasChildren() {/**/}
/** @return a SimpleXMLIterator for the current node.
*/
- function getChildren();
+ function getChildren() {/**/}
+
+ /** @return number of elements/attributes seen with foreach()
+ */
+ function count() {/**/}
+
+ /** @copydoc Iterator::rewind */
+ function rewind() {/**/}
+
+ /** @copydoc Iterator::valid */
+ function valid() {/**/}
+
+ /** @copydoc Iterator::current */
+ function current() {/**/}
+
+ /** @copydoc Iterator::key */
+ function key() {/**/}
+
+ /** @copydoc Iterator::next */
+ function next() {/**/}
}
/** @ingroup SPL
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 34804315a..d025f3ffd 100755
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_array.c,v 1.71.2.17 2006/04/07 22:53:23 tony2001 Exp $ */
+/* $Id: spl_array.c,v 1.71.2.17.2.4 2006/10/20 02:11:19 pollita Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -46,10 +46,15 @@ PHPAPI zend_class_entry *spl_ce_Countable;
#define SPL_ARRAY_STD_PROP_LIST 0x00000001
#define SPL_ARRAY_ARRAY_AS_PROPS 0x00000002
+#define SPL_ARRAY_OVERLOADED_REWIND 0x00010000
+#define SPL_ARRAY_OVERLOADED_VALID 0x00020000
+#define SPL_ARRAY_OVERLOADED_KEY 0x00040000
+#define SPL_ARRAY_OVERLOADED_CURRENT 0x00080000
+#define SPL_ARRAY_OVERLOADED_NEXT 0x00100000
#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_INT_MASK 0xFFFF0000
#define SPL_ARRAY_CLONE_MASK 0x03000007
typedef struct _spl_array_object {
@@ -114,7 +119,7 @@ static void spl_array_object_free_storage(void *object TSRMLS_DC)
}
/* }}} */
-zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC);
+zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
/* {{{ spl_array_object_new */
static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, spl_array_object **obj, zval *orig, int clone_orig TSRMLS_DC)
@@ -166,6 +171,7 @@ static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, s
while (parent) {
if (parent == spl_ce_ArrayIterator || parent == spl_ce_RecursiveArrayIterator) {
retval.handlers = &spl_handler_ArrayIterator;
+ class_type->get_iterator = spl_array_get_iterator;
break;
} else if (parent == spl_ce_ArrayObject) {
retval.handlers = &spl_handler_ArrayObject;
@@ -195,7 +201,25 @@ static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, s
intern->fptr_offset_del = NULL;
}
}
- intern->ce_get_iterator = spl_ce_ArrayIterator;
+ /* Cache iterator functions if ArrayIterator or derived. Check current's */
+ /* cache since only current is always required */
+ if (retval.handlers == &spl_handler_ArrayIterator) {
+ if (!class_type->iterator_funcs.zf_current) {
+ zend_hash_find(&class_type->function_table, "rewind", sizeof("rewind"), (void **) &class_type->iterator_funcs.zf_rewind);
+ zend_hash_find(&class_type->function_table, "valid", sizeof("valid"), (void **) &class_type->iterator_funcs.zf_valid);
+ zend_hash_find(&class_type->function_table, "key", sizeof("key"), (void **) &class_type->iterator_funcs.zf_key);
+ zend_hash_find(&class_type->function_table, "current", sizeof("current"), (void **) &class_type->iterator_funcs.zf_current);
+ zend_hash_find(&class_type->function_table, "next", sizeof("next"), (void **) &class_type->iterator_funcs.zf_next);
+ }
+ if (inherited) {
+ if (class_type->iterator_funcs.zf_rewind->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_REWIND;
+ if (class_type->iterator_funcs.zf_valid->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_VALID;
+ if (class_type->iterator_funcs.zf_key->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_KEY;
+ if (class_type->iterator_funcs.zf_current->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_CURRENT;
+ if (class_type->iterator_funcs.zf_next->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_NEXT;
+ }
+ }
+
zend_hash_internal_pointer_reset_ex(spl_array_get_hash_table(intern, 0 TSRMLS_CC), &intern->pos);
return retval;
}
@@ -275,6 +299,8 @@ static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object,
static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */
{
+ zval **ret;
+
if (check_inherited) {
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
if (intern->fptr_offset_get) {
@@ -291,7 +317,30 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval
return EG(uninitialized_zval_ptr);
}
}
- return *spl_array_get_dimension_ptr_ptr(check_inherited, object, offset, type TSRMLS_CC);
+ ret = spl_array_get_dimension_ptr_ptr(check_inherited, object, offset, type TSRMLS_CC);
+
+ /* When in a write context,
+ * ZE has to be fooled into thinking this is in a reference set
+ * by separating (if necessary) and returning as an is_ref=1 zval (even if refcount == 1) */
+ if ((type == BP_VAR_W || type == BP_VAR_RW) && !(*ret)->is_ref) {
+ if ((*ret)->refcount > 1) {
+ zval *newval;
+
+ /* Separate */
+ MAKE_STD_ZVAL(newval);
+ *newval = **ret;
+ zval_copy_ctor(newval);
+ newval->refcount = 1;
+
+ /* Replace */
+ (*ret)->refcount--;
+ *ret = newval;
+ }
+
+ (*ret)->is_ref = 1;
+ }
+
+ return *ret;
} /* }}} */
static zval *spl_array_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */
@@ -461,8 +510,8 @@ SPL_METHOD(Array, offsetExists)
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)
+/* {{{ proto mixed ArrayObject::offsetGet(mixed $index)
+ proto mixed ArrayIterator::offsetGet(mixed $index)
Returns the value at the specified $index. */
SPL_METHOD(Array, offsetGet)
{
@@ -498,7 +547,7 @@ void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC) /* {{
}
if (Z_TYPE_P(intern->array) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot append properties to objects, use %s::offsetSet() instead", Z_OBJCE_P(object)->name);
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Cannot append properties to objects, use %s::offsetSet() instead", Z_OBJCE_P(object)->name);
return;
}
@@ -659,7 +708,7 @@ static int spl_array_next(spl_array_object *intern TSRMLS_DC) /* {{{ */
/* define an overloaded iterator structure */
typedef struct {
- zend_object_iterator intern;
+ zend_user_iterator intern;
spl_array_object *object;
} spl_array_it;
@@ -667,7 +716,8 @@ 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);
+ zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zval_ptr_dtor((zval**)&iterator->intern.it.data);
efree(iterator);
}
@@ -679,16 +729,20 @@ static int spl_array_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
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;
+ if (object->ar_flags & SPL_ARRAY_OVERLOADED_VALID) {
+ return zend_user_it_valid(iter TSRMLS_CC);
} else {
- return zend_hash_has_more_elements_ex(aht, &object->pos);
+ 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);
+ }
}
}
/* }}} */
@@ -698,9 +752,13 @@ static void spl_array_it_get_current_data(zend_object_iterator *iter, zval ***da
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;
+
+ if (object->ar_flags & SPL_ARRAY_OVERLOADED_CURRENT) {
+ zend_user_it_get_current_data(iter, data TSRMLS_CC);
+ } else {
+ if (zend_hash_get_current_data_ex(aht, (void**)data, &object->pos) == FAILURE) {
+ *data = NULL;
+ }
}
}
/* }}} */
@@ -711,17 +769,21 @@ static int spl_array_it_get_current_key(zend_object_iterator *iter, char **str_k
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;
+ if (object->ar_flags & SPL_ARRAY_OVERLOADED_KEY) {
+ return zend_user_it_get_current_key(iter, str_key, str_key_len, int_key TSRMLS_CC);
+ } else {
+ 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);
}
-
- return zend_hash_get_current_key_ex(aht, str_key, str_key_len, int_key, 1, &object->pos);
}
/* }}} */
@@ -731,15 +793,20 @@ static void spl_array_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {
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");
+ if (object->ar_flags & SPL_ARRAY_OVERLOADED_NEXT) {
+ zend_user_it_move_forward(iter TSRMLS_CC);
} else {
- spl_array_next(object TSRMLS_CC);
+ zend_user_it_invalidate_current(iter 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);
+ }
}
}
/* }}} */
@@ -763,7 +830,12 @@ 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);
+ if (object->ar_flags & SPL_ARRAY_OVERLOADED_REWIND) {
+ zend_user_it_rewind(iter TSRMLS_CC);
+ } else {
+ zend_user_it_invalidate_current(iter TSRMLS_CC);
+ spl_array_rewind(object TSRMLS_CC);
+ }
}
/* }}} */
@@ -777,14 +849,22 @@ zend_object_iterator_funcs spl_array_it_funcs = {
spl_array_it_rewind
};
-zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) /* {{{ */
+zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
{
- spl_array_it *iterator = emalloc(sizeof(spl_array_it));
+ spl_array_it *iterator;
spl_array_object *array_object = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+ if (by_ref && (array_object->ar_flags & SPL_ARRAY_OVERLOADED_CURRENT)) {
+ zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
+ }
+
+ iterator = emalloc(sizeof(spl_array_it));
+
object->refcount++;
- iterator->intern.data = (void*)object;
- iterator->intern.funcs = &spl_array_it_funcs;
+ iterator->intern.it.data = (void*)object;
+ iterator->intern.it.funcs = &spl_array_it_funcs;
+ iterator->intern.ce = ce;
+ iterator->intern.value = NULL;
iterator->object = array_object;
return (zend_object_iterator*)iterator;
@@ -1077,6 +1157,63 @@ SPL_METHOD(Array, count)
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_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ zend_throw_exception(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)
@@ -1107,7 +1244,11 @@ SPL_METHOD(Array, current)
Return current array key */
SPL_METHOD(Array, key)
{
- zval *object = getThis();
+ spl_array_iterator_key(getThis(), return_value TSRMLS_CC);
+}
+
+void spl_array_iterator_key(zval *object, zval *return_value TSRMLS_DC) /* {{{ */
+{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
char *string_key;
uint string_length;
@@ -1273,17 +1414,28 @@ 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, __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)
@@ -1293,23 +1445,29 @@ static zend_function_entry spl_funcs_ArrayObject[] = {
};
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, __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)
+ 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}
};
@@ -1355,6 +1513,7 @@ PHP_MINIT_FUNCTION(spl_array)
REGISTER_SPL_SUB_CLASS_EX(RecursiveArrayIterator, ArrayIterator, spl_array_object_new, spl_funcs_RecursiveArrayIterator);
REGISTER_SPL_IMPLEMENTS(RecursiveArrayIterator, RecursiveIterator);
+ spl_ce_RecursiveArrayIterator->get_iterator = spl_array_get_iterator;
REGISTER_SPL_INTERFACE(Countable);
diff --git a/ext/spl/spl_array.h b/ext/spl/spl_array.h
index 554964420..2e8519557 100755
--- a/ext/spl/spl_array.h
+++ b/ext/spl/spl_array.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_array.h,v 1.13.2.2 2006/01/01 12:50:13 sniper Exp $ */
+/* $Id: spl_array.h,v 1.13.2.2.2.1 2006/05/10 00:03:38 helly Exp $ */
#ifndef SPL_ARRAY_H
#define SPL_ARRAY_H
@@ -32,6 +32,7 @@ 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);
+extern void spl_array_iterator_key(zval *object, zval *return_value TSRMLS_DC);
#endif /* SPL_ARRAY_H */
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 1f949eaf3..a5b9a11cf 100755
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_directory.c,v 1.45.2.27 2006/04/06 19:01:56 tony2001 Exp $ */
+/* $Id: spl_directory.c,v 1.45.2.27.2.8 2006/09/29 13:11:28 bjori Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -205,9 +205,9 @@ static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_inclu
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 (!intern->file_name_len || !intern->u.file.stream) {
if (!EG(exception)) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot open file %s", intern->file_name);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot open file '%s'", intern->file_name_len ? intern->file_name : "");
}
intern->file_name = NULL; /* until here it is not a copy */
intern->u.file.open_mode = NULL;
@@ -218,12 +218,23 @@ static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_inclu
zend_list_addref(Z_RESVAL_P(intern->u.file.zcontext));
}
+ if (intern->file_name[intern->file_name_len-1] == '/'
+#if defined(PHP_WIN32) || defined(NETWARE)
+ ||intern->file_name[intern->file_name_len-1] == '\\'
+#endif
+ ) {
+ intern->file_name_len--;
+ }
+
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;
+
+ intern->u.file.delimiter = ',';
+ intern->u.file.enclosure = '"';
zend_hash_find(&intern->std.ce->function_table, "getcurrentline", sizeof("getcurrentline"), (void **) &intern->u.file.func_getCurr);
@@ -254,8 +265,8 @@ static zend_object_value spl_filesystem_object_clone(zval *zobject TSRMLS_DC)
switch (source->type) {
case SPL_FS_INFO:
- source->path_len = source->path_len;
- source->path = estrndup(source->path, source->path_len);
+ intern->path_len = source->path_len;
+ intern->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;
@@ -990,10 +1001,16 @@ zend_object_iterator_funcs spl_filesystem_dir_it_funcs = {
};
/* {{{ spl_ce_dir_get_iterator */
-zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC)
+zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval *object, int by_ref 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);
+ spl_filesystem_dir_it *iterator;
+ spl_filesystem_object *dir_object;
+
+ if (by_ref) {
+ zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
+ }
+ iterator = emalloc(sizeof(spl_filesystem_dir_it));
+ dir_object = (spl_filesystem_object*)zend_object_store_get_object(object TSRMLS_CC);
object->refcount += 2;;
iterator->intern.data = (void*)object;
@@ -1195,10 +1212,16 @@ zend_object_iterator_funcs spl_filesystem_tree_it_funcs = {
};
/* {{{ spl_ce_dir_get_iterator */
-zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC)
+zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zval *object, int by_ref 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);
+ spl_filesystem_dir_it *iterator;
+ spl_filesystem_object *dir_object;
+
+ if (by_ref) {
+ zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
+ }
+ iterator = emalloc(sizeof(spl_filesystem_dir_it));
+ dir_object = (spl_filesystem_object*)zend_object_store_get_object(object TSRMLS_CC);
object->refcount++;
iterator->intern.data = (void*)object;
@@ -1211,14 +1234,10 @@ zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zva
/* }}} */
/* {{{ spl_filesystem_object_cast */
-static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC)
+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 (should_free) {
- zval_dtor(readobj);
- }
-
if (type == IS_STRING) {
switch (intern->type) {
case SPL_FS_INFO:
@@ -1374,19 +1393,104 @@ static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent TS
return SUCCESS;
} /* }}} */
-static int spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function *func_ptr, int pass_num_args, zval *return_value, zval *arg2 TSRMLS_DC) /* {{{ */
+{
+ zend_fcall_info fci;
+ zend_fcall_info_cache fcic;
+ zval z_fname;
+ zval * zresource_ptr = &intern->u.file.zresource, *retval;
+ int result;
+ int num_args = pass_num_args + (arg2 ? 2 : 1);
+
+ zval ***params = (zval***)safe_emalloc(num_args, sizeof(zval**), 0);
+
+ params[0] = &zresource_ptr;
+
+ if (arg2) {
+ params[1] = &arg2;
+ }
+
+ zend_get_parameters_array_ex(pass_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 = num_args;
+ 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, pass_num_args, arg2) \
+{ \
+ zend_function *func_ptr; \
+ zend_hash_find(EG(function_table), #func_name, sizeof(#func_name), (void **) &func_ptr); \
+ spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value, arg2 TSRMLS_CC); \
+}
+
+static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char delimiter, char enclosure, zval *return_value TSRMLS_DC) /* {{{ */
+{
+ int ret = SUCCESS;
+
+ do {
+ ret = spl_filesystem_file_read(intern, 1 TSRMLS_CC);
+ } while (ret == SUCCESS && !intern->u.file.current_line_len && (intern->flags & SPL_FILE_OBJECT_SKIP_EMPTY));
+
+ if (ret == SUCCESS) {
+ size_t buf_len = intern->u.file.current_line_len;
+ char *buf = estrndup(intern->u.file.current_line, buf_len);
+
+ if (intern->u.file.current_zval) {
+ zval_ptr_dtor(&intern->u.file.current_zval);
+ }
+ ALLOC_INIT_ZVAL(intern->u.file.current_zval);
+
+ php_fgetcsv(intern->u.file.stream, delimiter, enclosure, buf_len, buf, intern->u.file.current_zval TSRMLS_CC);
+ if (return_value) {
+ if (Z_TYPE_P(return_value) != IS_NULL) {
+ zval_dtor(return_value);
+ ZVAL_NULL(return_value);
+ }
+ ZVAL_ZVAL(return_value, intern->u.file.current_zval, 1, 0);
+ }
+ }
+ return ret;
+}
+/* }}} */
+
+static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */
{
zval *retval = NULL;
- /* if overloaded call the function, otherwise do it directly */
- if (intern->u.file.func_getCurr->common.scope != spl_ce_SplFileObject) {
+ /* 1) use fgetcsv? 2) overloaded call the function, 3) do it directly */
+ if (intern->flags & SPL_FILE_OBJECT_READ_CSV || intern->u.file.func_getCurr->common.scope != spl_ce_SplFileObject) {
if (php_stream_eof(intern->u.file.stream)) {
if (!silent) {
zend_throw_exception_ex(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 (intern->flags & SPL_FILE_OBJECT_READ_CSV) {
+ return spl_filesystem_file_read_csv(intern, intern->u.file.delimiter, intern->u.file.enclosure, NULL TSRMLS_CC);
+ } else {
+ zend_call_method_with_0_params(&this_ptr, 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++;
@@ -1409,7 +1513,47 @@ static int spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object
}
} /* }}} */
-static void spl_filesystem_file_rewind(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_is_empty_line(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
+{
+ if (intern->u.file.current_line) {
+ return intern->u.file.current_line_len == 0;
+ } else if (intern->u.file.current_zval) {
+ switch(Z_TYPE_P(intern->u.file.current_zval)) {
+ case IS_STRING:
+ return Z_STRLEN_P(intern->u.file.current_zval) == 0;
+ case IS_ARRAY:
+ if ((intern->flags & SPL_FILE_OBJECT_READ_CSV)
+ && zend_hash_num_elements(Z_ARRVAL_P(intern->u.file.current_zval)) == 1) {
+ zval ** first = Z_ARRVAL_P(intern->u.file.current_zval)->pListHead->pData;
+
+ return Z_TYPE_PP(first) == IS_STRING && Z_STRLEN_PP(first) == 0;
+ }
+ return zend_hash_num_elements(Z_ARRVAL_P(intern->u.file.current_zval)) == 0;
+ case IS_NULL:
+ return 1;
+ default:
+ return 0;
+ }
+ } else {
+ return 1;
+ }
+}
+/* }}} */
+
+static int spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */
+{
+ int ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent TSRMLS_CC);
+
+ while ((intern->flags & SPL_FILE_OBJECT_SKIP_EMPTY) && ret == SUCCESS && spl_filesystem_file_is_empty_line(intern TSRMLS_CC)) {
+ spl_filesystem_file_free_line(intern TSRMLS_CC);
+ ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent TSRMLS_CC);
+ }
+
+ return ret;
+}
+/* }}} */
+
+static void spl_filesystem_file_rewind(zval * this_ptr, spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
{
if (-1 == php_stream_rewind(intern->u.file.stream)) {
zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot rewind file %s", intern->file_name);
@@ -1417,6 +1561,9 @@ static void spl_filesystem_file_rewind(spl_filesystem_object *intern TSRMLS_DC)
spl_filesystem_file_free_line(intern TSRMLS_CC);
intern->u.file.current_line_num = 0;
}
+ if (intern->flags & SPL_FILE_OBJECT_READ_AHEAD) {
+ spl_filesystem_file_read_line(this_ptr, intern, 1 TSRMLS_CC);
+ }
} /* }}} */
/* {{{ proto void SplFileObject::__construct(string filename [, string mode = 'r' [, bool use_include_path [, resource context]]]])
@@ -1458,7 +1605,7 @@ SPL_METHOD(SplFileObject, __construct)
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
} /* }}} */
-/* {{{ proto void SplFileObject::__construct([int max_memory])
+/* {{{ proto void SplTempFileObject::__construct([int max_memory])
Construct a new temp file object */
SPL_METHOD(SplTempFileObject, __construct)
{
@@ -1501,7 +1648,7 @@ 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);
+ spl_filesystem_file_rewind(getThis(), intern TSRMLS_CC);
} /* }}} */
/* {{{ proto string SplFileObject::getFilename()
@@ -1528,7 +1675,11 @@ 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));
+ if (intern->flags & SPL_FILE_OBJECT_READ_AHEAD) {
+ RETURN_BOOL(intern->u.file.current_line || intern->u.file.current_zval);
+ } else {
+ RETVAL_BOOL(!php_stream_eof(intern->u.file.stream));
+ }
} /* }}} */
/* {{{ proto string SplFileObject::fgets()
@@ -1549,10 +1700,10 @@ 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) {
+ if (!intern->u.file.current_line && !intern->u.file.current_zval) {
spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC);
}
- if (intern->u.file.current_line) {
+ if (intern->u.file.current_line && (!(intern->flags & SPL_FILE_OBJECT_READ_CSV) || !intern->u.file.current_zval)) {
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);
@@ -1580,6 +1731,9 @@ 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);
+ if (intern->flags & SPL_FILE_OBJECT_READ_AHEAD) {
+ spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC);
+ }
intern->u.file.current_line_num++;
} /* }}} */
@@ -1644,62 +1798,12 @@ 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); \
+ FileFunctionCall(func_name, ZEND_NUM_ARGS(), NULL); \
}
/* }}} */
@@ -1708,16 +1812,86 @@ SPL_METHOD(SplFileObject, func_name) \
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);
+ char delimiter = intern->u.file.delimiter, enclosure = intern->u.file.enclosure;
+ char *delim, *enclo;
+ int d_len, e_len;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ss", &delim, &d_len, &enclo, &e_len) == SUCCESS) {
+ switch(ZEND_NUM_ARGS())
+ {
+ case 2:
+ if (e_len != 1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
+ RETURN_FALSE;
+ }
+ enclosure = enclo[0];
+ /* no break */
+ case 1:
+ if (d_len != 1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
+ RETURN_FALSE;
+ }
+ delimiter = delim[0];
+ /* no break */
+ case 0:
+ break;
+ }
+ spl_filesystem_file_read_csv(intern, delimiter, enclosure, return_value TSRMLS_CC);
+ }
+}
+/* }}} */
- spl_filesystem_file_free_line(intern TSRMLS_CC);
- intern->u.file.current_line_num++;
+/* {{{ proto void SplFileObject::setCsvControl([string delimiter = ',' [, string enclosure = '"']])
+ Set the delimiter and enclosure character used in fgetcsv */
+SPL_METHOD(SplFileObject, setCsvControl)
+{
+ spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ char delimiter = ',', enclosure = '"';
+ char *delim, *enclo;
+ int d_len, e_len;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ss", &delim, &d_len, &enclo, &e_len) == SUCCESS) {
+ switch(ZEND_NUM_ARGS())
+ {
+ case 2:
+ if (e_len != 1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
+ RETURN_FALSE;
+ }
+ enclosure = enclo[0];
+ /* no break */
+ case 1:
+ if (d_len != 1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
+ RETURN_FALSE;
+ }
+ delimiter = delim[0];
+ /* no break */
+ case 0:
+ break;
+ }
+ intern->u.file.delimiter = delimiter;
+ intern->u.file.enclosure = enclosure;
+ }
+}
+/* }}} */
- FileFunctionCall(fgetcsv, arg2);
+/* {{{ proto array SplFileObject::getCsvControl()
+ Get the delimiter and enclosure character used in fgetcsv */
+SPL_METHOD(SplFileObject, getCsvControl)
+{
+ spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ char delimiter[2], enclosure[2];
- zval_ptr_dtor(&arg2);
+ array_init(return_value);
+
+ delimiter[0] = intern->u.file.delimiter;
+ delimiter[1] = '\0';
+ enclosure[0] = intern->u.file.enclosure;
+ enclosure[1] = '\0';
+
+ add_next_index_string(return_value, delimiter, 1);
+ add_next_index_string(return_value, enclosure, 1);
}
/* }}} */
@@ -1802,7 +1976,7 @@ SPL_METHOD(SplFileObject, fgetss)
spl_filesystem_file_free_line(intern TSRMLS_CC);
intern->u.file.current_line_num++;
- FileFunctionCall(fgetss, arg2);
+ FileFunctionCall(fgetss, ZEND_NUM_ARGS(), arg2);
zval_ptr_dtor(&arg2);
} /* }}} */
@@ -1825,7 +1999,7 @@ SPL_METHOD(SplFileObject, fscanf)
spl_filesystem_file_free_line(intern TSRMLS_CC);
intern->u.file.current_line_num++;
- FileFunctionCall(fscanf, NULL);
+ FileFunctionCall(fscanf, ZEND_NUM_ARGS(), NULL);
}
/* }}} */
@@ -1900,7 +2074,7 @@ SPL_METHOD(SplFileObject, seek)
RETURN_FALSE;
}
- spl_filesystem_file_rewind(intern TSRMLS_CC);
+ spl_filesystem_file_rewind(getThis(), intern TSRMLS_CC);
while(intern->u.file.current_line_num < line_pos) {
spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC);
@@ -1978,6 +2152,8 @@ static zend_function_entry spl_SplFileObject_functions[] = {
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, setCsvControl, arginfo_file_object_fgetcsv, ZEND_ACC_PUBLIC)
+ SPL_ME(SplFileObject, getCsvControl, NULL, 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)
@@ -2006,7 +2182,7 @@ static zend_function_entry spl_SplFileObject_functions[] = {
};
static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_temp_file_object___construct, 0, 0, 1)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_temp_file_object___construct, 0, 0, 0)
ZEND_ARG_INFO(0, max_memory)
ZEND_END_ARG_INFO()
@@ -2048,10 +2224,12 @@ PHP_MINIT_FUNCTION(spl_directory)
REGISTER_SPL_IMPLEMENTS(SplFileObject, RecursiveIterator);
REGISTER_SPL_IMPLEMENTS(SplFileObject, SeekableIterator);
- REGISTER_SPL_SUB_CLASS_EX(SplTempFileObject, SplFileObject, spl_filesystem_object_new, spl_SplTempFileObject_functions);
-
REGISTER_SPL_CLASS_CONST_LONG(SplFileObject, "DROP_NEW_LINE", SPL_FILE_OBJECT_DROP_NEW_LINE);
-
+ REGISTER_SPL_CLASS_CONST_LONG(SplFileObject, "READ_AHEAD", SPL_FILE_OBJECT_READ_AHEAD);
+ REGISTER_SPL_CLASS_CONST_LONG(SplFileObject, "SKIP_EMPTY", SPL_FILE_OBJECT_SKIP_EMPTY);
+ REGISTER_SPL_CLASS_CONST_LONG(SplFileObject, "READ_CSV", SPL_FILE_OBJECT_READ_CSV);
+
+ REGISTER_SPL_SUB_CLASS_EX(SplTempFileObject, SplFileObject, spl_filesystem_object_new, spl_SplTempFileObject_functions);
return SUCCESS;
}
/* }}} */
diff --git a/ext/spl/spl_directory.h b/ext/spl/spl_directory.h
index 513fa7eb8..9a29c9b82 100755
--- a/ext/spl/spl_directory.h
+++ b/ext/spl/spl_directory.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_directory.h,v 1.12.2.5 2006/03/08 21:54:48 helly Exp $ */
+/* $Id: spl_directory.h,v 1.12.2.5.2.2 2006/07/15 15:08:41 helly Exp $ */
#ifndef SPL_DIRECTORY_H
#define SPL_DIRECTORY_H
@@ -82,11 +82,16 @@ struct _spl_filesystem_object {
long current_line_num;
zval zresource;
zend_function *func_getCurr;
+ char delimiter;
+ char enclosure;
} file;
} u;
};
#define SPL_FILE_OBJECT_DROP_NEW_LINE 0x00000001 /* drop new lines */
+#define SPL_FILE_OBJECT_READ_AHEAD 0x00000002 /* read on rewind/next */
+#define SPL_FILE_OBJECT_SKIP_EMPTY 0x00000006 /* skip empty lines */
+#define SPL_FILE_OBJECT_READ_CSV 0x00000008 /* read via fgetcsv */
#define SPL_FILE_DIR_CURRENT_AS_FILEINFO 0x00000010 /* make RecursiveDirectoryTree::current() return SplFileInfo */
#define SPL_FILE_DIR_CURRENT_AS_PATHNAME 0x00000020 /* make RecursiveDirectoryTree::current() return getPathname() */
diff --git a/ext/spl/spl_exceptions.c b/ext/spl/spl_exceptions.c
index 8a7b70b30..0688fbc34 100755
--- a/ext/spl/spl_exceptions.c
+++ b/ext/spl/spl_exceptions.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_exceptions.c,v 1.6.2.1 2006/01/01 12:50:13 sniper Exp $ */
+/* $Id: spl_exceptions.c,v 1.6.2.1.2.1 2006/05/10 00:03:38 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -47,7 +47,7 @@ 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()
+#define spl_ce_Exception zend_exception_get_default(TSRMLS_C)
/* {{{ PHP_MINIT_FUNCTION(spl_exceptions) */
PHP_MINIT_FUNCTION(spl_exceptions)
diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c
index 52f92f692..b0936ea09 100755
--- a/ext/spl/spl_functions.c
+++ b/ext/spl/spl_functions.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_functions.c,v 1.28.2.3 2006/03/09 11:43:45 sebastian Exp $ */
+/* $Id: spl_functions.c,v 1.28.2.3.2.2 2006/07/20 22:54:21 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -36,16 +36,13 @@ void spl_destroy_class(zend_class_entry ** ppce)
/* }}} */
/* {{{ spl_register_interface */
-void spl_register_interface(zend_class_entry ** ppce, char * class_name, zend_function_entry *functions TSRMLS_DC)
+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;
+ *ppce = zend_register_internal_interface(&ce TSRMLS_CC);
}
/* }}} */
@@ -98,14 +95,9 @@ void spl_register_functions(zend_class_entry * class_entry, zend_function_entry
/* }}} */
/* {{{ spl_register_property */
-void spl_register_property( zend_class_entry * class_entry, char *prop_name, zval *prop_val, int prop_flags TSRMLS_DC)
+void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, 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);
+ zend_declare_property_null(class_entry, prop_name, prop_name_len, prop_flags TSRMLS_CC);
}
/* }}} */
diff --git a/ext/spl/spl_functions.h b/ext/spl/spl_functions.h
index d175ef64f..557215719 100755
--- a/ext/spl/spl_functions.h
+++ b/ext/spl/spl_functions.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_functions.h,v 1.19.2.3 2006/01/01 12:50:13 sniper Exp $ */
+/* $Id: spl_functions.h,v 1.19.2.3.2.1 2006/07/20 22:54:21 helly Exp $ */
#ifndef PHP_FUNCTIONS_H
#define PHP_FUNCTIONS_H
@@ -49,8 +49,8 @@ typedef zend_object_value (*create_object_func_t)(zend_class_entry *class_type T
#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_PROPERTY(class_name, prop_name, prop_flags) \
+ spl_register_property(spl_ce_ ## class_name, prop_name, sizeof(prop_name)-1, 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);
@@ -64,7 +64,7 @@ void spl_register_interface(zend_class_entry ** ppce, char * class_name, zend_fu
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, zend_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);
+void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags TSRMLS_DC);
/* sub: whether to allow subclasses/interfaces
allow = 0: allow all classes and interfaces
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 0ba01180b..58853c6f5 100755
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_iterators.c,v 1.73.2.33 2006/07/17 21:13:32 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.73.2.30.2.17 2006/07/21 21:26:11 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -55,6 +55,8 @@ 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;
zend_function_entry spl_funcs_RecursiveIterator[] = {
SPL_ABSTRACT_ME(RecursiveIterator, hasChildren, NULL)
@@ -191,6 +193,13 @@ next_step:
switch (object->iterators[object->level].state) {
case RS_NEXT:
iterator->funcs->move_forward(iterator TSRMLS_CC);
+ if (EG(exception)) {
+ if (!(object->flags & RIT_CATCH_GET_CHILD)) {
+ return;
+ } else {
+ zend_clear_exception(TSRMLS_C);
+ }
+ }
case RS_START:
if (iterator->funcs->valid(iterator TSRMLS_CC) == FAILURE) {
break;
@@ -205,6 +214,14 @@ next_step:
} else {
zend_call_method_with_0_params(&zobject, ce, NULL, "haschildren", &retval);
}
+ if (EG(exception)) {
+ if (!(object->flags & RIT_CATCH_GET_CHILD)) {
+ object->iterators[object->level].state = RS_NEXT;
+ return;
+ } else {
+ zend_clear_exception(TSRMLS_C);
+ }
+ }
if (retval) {
has_children = zend_is_true(retval);
zval_ptr_dtor(&retval);
@@ -233,6 +250,13 @@ next_step:
zend_call_method_with_0_params(&zthis, object->ce, &object->nextElement, "nextelement", NULL);
}
object->iterators[object->level].state = RS_NEXT;
+ if (EG(exception)) {
+ if (!(object->flags & RIT_CATCH_GET_CHILD)) {
+ return;
+ } else {
+ zend_clear_exception(TSRMLS_C);
+ }
+ }
return /* self */;
case RS_SELF:
if (object->nextElement && (object->mode == RIT_SELF_FIRST || object->mode == RIT_CHILD_FIRST)) {
@@ -280,7 +304,7 @@ next_step:
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);
+ sub_iter = ce->get_iterator(ce, child, 0 TSRMLS_CC);
object->iterators[object->level].iterator = sub_iter;
object->iterators[object->level].zobject = child;
object->iterators[object->level].ce = ce;
@@ -290,6 +314,13 @@ next_step:
}
if (object->beginChildren) {
zend_call_method_with_0_params(&zthis, object->ce, &object->beginChildren, "beginchildren", NULL);
+ if (EG(exception)) {
+ if (!(object->flags & RIT_CATCH_GET_CHILD)) {
+ return;
+ } else {
+ zend_clear_exception(TSRMLS_C);
+ }
+ }
}
goto next_step;
}
@@ -297,6 +328,13 @@ next_step:
if (object->level > 0) {
if (object->endChildren) {
zend_call_method_with_0_params(&zthis, object->ce, &object->endChildren, "endchildren", NULL);
+ if (EG(exception)) {
+ if (!(object->flags & RIT_CATCH_GET_CHILD)) {
+ return;
+ } else {
+ zend_clear_exception(TSRMLS_C);
+ }
+ }
}
iterator->funcs->dtor(iterator TSRMLS_CC);
zval_ptr_dtor(&object->iterators[object->level].zobject);
@@ -315,7 +353,7 @@ static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zt
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 != spl_ce_RecursiveIteratorIterator) {
+ if (!EG(exception) && (!object->endChildren || object->endChildren->common.scope != spl_ce_RecursiveIteratorIterator)) {
zend_call_method_with_0_params(&zthis, object->ce, &object->endChildren, "endchildren", NULL);
}
}
@@ -325,7 +363,7 @@ static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zt
if (sub_iter->funcs->rewind) {
sub_iter->funcs->rewind(sub_iter TSRMLS_CC);
}
- if (object->beginIteration && !object->in_iteration) {
+ if (!EG(exception) && object->beginIteration && !object->in_iteration) {
zend_call_method_with_0_params(&zthis, object->ce, &object->beginIteration, "beginIteration", NULL);
}
object->in_iteration = 1;
@@ -342,10 +380,16 @@ 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)
+static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce, zval *zobject, int by_ref 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);
+ spl_recursive_it_iterator *iterator;
+ spl_recursive_it_object *object;
+
+ if (by_ref) {
+ zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
+ }
+ iterator = emalloc(sizeof(spl_recursive_it_iterator));
+ object = (spl_recursive_it_object*)zend_object_store_get_object(zobject TSRMLS_CC);
zobject->refcount++;
iterator->intern.data = (void*)object;
@@ -432,7 +476,7 @@ SPL_METHOD(RecursiveIteratorIterator, __construct)
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);
+ intern->iterators[0].iterator = ce_iterator->get_iterator(ce_iterator, iterator, 0 TSRMLS_CC);
if (inc_refcount) {
iterator->refcount++;
}
@@ -565,7 +609,11 @@ SPL_METHOD(RecursiveIteratorIterator, callHasChildren)
RETURN_FALSE;
} else {
zend_call_method_with_0_params(&zobject, ce, NULL, "haschildren", &retval);
- RETURN_ZVAL(retval, 0, 1);
+ if (retval) {
+ RETURN_ZVAL(retval, 0, 1);
+ } else {
+ RETURN_FALSE;
+ }
}
} /* }}} */
@@ -827,6 +875,18 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC);
+static inline int spl_cit_check_flags(int flags)
+{
+ int cnt = 0;
+
+ cnt += (flags & CIT_CALL_TOSTRING) ? 1 : 0;
+ cnt += (flags & CIT_TOSTRING_USE_KEY) ? 1 : 0;
+ cnt += (flags & CIT_TOSTRING_USE_CURRENT) ? 1 : 0;
+ cnt += (flags & CIT_TOSTRING_USE_INNER) ? 1 : 0;
+
+ return cnt <= 1 ? SUCCESS : FAILURE;
+}
+
static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_base, zend_class_entry *ce_inner, dual_it_type dit_type)
{
zval *zobject, *retval;
@@ -871,13 +931,14 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
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))) {
+ if (spl_cit_check_flags(flags) != SUCCESS) {
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
- zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CATCH_GET_CHILD, CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, 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: {
@@ -904,6 +965,13 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
}
if (instanceof_function(ce, zend_ce_aggregate TSRMLS_CC)) {
zend_call_method_with_0_params(&zobject, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval);
+ if (EG(exception)) {
+ if (retval) {
+ zval_ptr_dtor(&retval);
+ }
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ return NULL;
+ }
if (!retval || Z_TYPE_P(retval) != IS_OBJECT || !instanceof_function(Z_OBJCE_P(retval), zend_ce_traversable TSRMLS_CC)) {
zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "%s::getIterator() must return an object that implememnts Traversable", ce->name);
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
@@ -919,9 +987,35 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
case DIT_AppendIterator:
spl_instantiate(spl_ce_ArrayIterator, &intern->u.append.zarrayit, 1 TSRMLS_CC);
zend_call_method_with_0_params(&intern->u.append.zarrayit, spl_ce_ArrayIterator, &spl_ce_ArrayIterator->constructor, "__construct", NULL);
- intern->u.append.iterator = spl_ce_ArrayIterator->get_iterator(spl_ce_ArrayIterator, intern->u.append.zarrayit TSRMLS_CC);
+ intern->u.append.iterator = spl_ce_ArrayIterator->get_iterator(spl_ce_ArrayIterator, intern->u.append.zarrayit, 0 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 regex_len;
+ long mode = REGIT_MODE_MATCH;
+
+ intern->u.regex.use_flags = ZEND_NUM_ARGS() >= 5;
+ intern->u.regex.flags = 0;
+ intern->u.regex.preg_flags = 0;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|lll", &zobject, ce_inner, &regex, &regex_len, &mode, &intern->u.regex.flags, &intern->u.regex.preg_flags) == FAILURE) {
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ return NULL;
+ }
+ if (mode < 0 || mode >= REGIT_MODE_MAX) {
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Illegal mode %ld", mode);
+ php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
+ return NULL;
+ }
+ intern->u.regex.mode = mode;
+ intern->u.regex.regex = estrndup(regex, regex_len);
+ intern->u.regex.pce = pcre_get_compiled_regex_cache(regex, regex_len 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);
@@ -930,7 +1024,7 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
break;
}
- php_set_error_handling(EH_THROW, zend_exception_get_default() TSRMLS_CC);
+ php_set_error_handling(EH_THROW, zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
if (inc_refcount) {
zobject->refcount++;
@@ -938,7 +1032,7 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
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);
+ intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, zobject, 0 TSRMLS_CC);
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
return intern;
@@ -1146,7 +1240,9 @@ static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern T
}
zval_ptr_dtor(&retval);
}
-
+ if (EG(exception)) {
+ return;
+ }
intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC);
}
spl_dual_it_free(intern TSRMLS_CC);
@@ -1201,7 +1297,11 @@ SPL_METHOD(RecursiveFilterIterator, hasChildren)
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);
+ if (retval) {
+ RETURN_ZVAL(retval, 0, 1);
+ } else {
+ RETURN_FALSE;
+ }
} /* }}} */
/* {{{ proto RecursiveFilterIterator RecursiveFilterIterator::getChildren()
@@ -1214,8 +1314,12 @@ SPL_METHOD(RecursiveFilterIterator, getChildren)
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 (!EG(exception) && retval) {
+ spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), &return_value, 0, retval TSRMLS_CC);
+ }
+ if (retval) {
+ zval_ptr_dtor(&retval);
+ }
} /* }}} */
/* {{{ proto void ParentIterator::__construct(RecursiveIterator it)
@@ -1235,7 +1339,11 @@ SPL_METHOD(ParentIterator, hasChildren)
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);
+ if (retval) {
+ RETURN_ZVAL(retval, 0, 1);
+ } else {
+ RETURN_FALSE;
+ }
} /* }}} */
/* {{{ proto ParentIterator ParentIterator::getChildren()
@@ -1248,10 +1356,218 @@ SPL_METHOD(ParentIterator, getChildren)
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 (!EG(exception) && retval) {
+ spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), &return_value, 0, retval TSRMLS_CC);
+ }
+ if (retval) {
+ zval_ptr_dtor(&retval);
+ }
+} /* }}} */
+
+#if HAVE_PCRE || HAVE_BUNDLED_PCRE
+/* {{{ proto void RegexIterator::__construct(Iterator it, string regex [, int mode [, int flags [, int preg_flags]]])
+ Create an RegexIterator from another iterator and a regular expression */
+SPL_METHOD(RegexIterator, __construct)
+{
+ spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RegexIterator, zend_ce_iterator, DIT_RegexIterator);
+} /* }}} */
+
+/* {{{ proto bool RegexIterator::accept()
+ Match (string)current() against regular expression */
+SPL_METHOD(RegexIterator, accept)
+{
+ spl_dual_it_object *intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ char *subject, tmp[32], *result;
+ int subject_len, use_copy, count, result_len;
+ zval subject_copy, zcount, *replacement;
+
+ 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];
+ use_copy = 0;
+ } else {
+ subject_len = intern->current.str_key_len - 1;
+ subject = estrndup(intern->current.str_key, subject_len);
+ use_copy = 1;
+ }
+ } 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);
+ }
+ }
+
+ switch (intern->u.regex.mode)
+ {
+ case REGIT_MODE_MAX: /* won't happen but makes compiler happy */
+ case REGIT_MODE_MATCH:
+ count = pcre_exec(intern->u.regex.pce->re, intern->u.regex.pce->extra, subject, subject_len, 0, 0, NULL, 0);
+ RETVAL_BOOL(count >= 0);
+ break;
+
+ case REGIT_MODE_ALL_MATCHES:
+ case REGIT_MODE_GET_MATCH:
+ if (!use_copy) {
+ subject = estrndup(subject, subject_len);
+ use_copy = 1;
+ }
+ zval_ptr_dtor(&intern->current.data);
+ ALLOC_INIT_ZVAL(intern->current.data);
+ php_pcre_match_impl(intern->u.regex.pce, subject, subject_len, &zcount,
+ intern->current.data, intern->u.regex.mode == REGIT_MODE_ALL_MATCHES, intern->u.regex.use_flags, intern->u.regex.preg_flags, 0 TSRMLS_CC);
+ count = zend_hash_num_elements(Z_ARRVAL_P(intern->current.data));
+ RETVAL_BOOL(count > 0);
+ break;
+
+ case REGIT_MODE_SPLIT:
+ if (!use_copy) {
+ subject = estrndup(subject, subject_len);
+ use_copy = 1;
+ }
+ zval_ptr_dtor(&intern->current.data);
+ ALLOC_INIT_ZVAL(intern->current.data);
+ php_pcre_split_impl(intern->u.regex.pce, subject, subject_len, intern->current.data, -1, intern->u.regex.preg_flags TSRMLS_CC);
+ count = zend_hash_num_elements(Z_ARRVAL_P(intern->current.data));
+ RETVAL_BOOL(count > 1);
+ break;
+
+ case REGIT_MODE_REPLACE:
+ replacement = zend_read_property(intern->std.ce, getThis(), "replacement", sizeof("replacement")-1, 1 TSRMLS_CC);
+ result = php_pcre_replace_impl(intern->u.regex.pce, subject, subject_len, replacement, 0, &result_len, 0, NULL TSRMLS_CC);
+
+ if (intern->u.regex.flags & REGIT_USE_KEY) {
+ if (intern->current.key_type != HASH_KEY_IS_LONG) {
+ efree(intern->current.str_key);
+ }
+ intern->current.key_type = HASH_KEY_IS_STRING;
+ intern->current.str_key = result;
+ intern->current.str_key_len = result_len + 1;
+ } else {
+ zval_ptr_dtor(&intern->current.data);
+ MAKE_STD_ZVAL(intern->current.data);
+ ZVAL_STRINGL(intern->current.data, result, result_len, 0);
+ }
+ }
+
+ if (use_copy) {
+ efree(subject);
+ }
+} /* }}} */
+
+/* {{{ proto bool RegexIterator::getMode()
+ Returns current operation mode */
+SPL_METHOD(RegexIterator, getMode)
+{
+ spl_dual_it_object *intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETURN_LONG(intern->u.regex.mode);
+} /* }}} */
+
+/* {{{ proto bool RegexIterator::setMode(int new_mode)
+ Set new operation mode */
+SPL_METHOD(RegexIterator, setMode)
+{
+ spl_dual_it_object *intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ long mode;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &mode) == FAILURE) {
+ return;
+ }
+
+ if (mode < 0 || mode >= REGIT_MODE_MAX) {
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Illegal mode %ld", mode);
+ return;// NULL
+ }
+
+ intern->u.regex.mode = mode;
+} /* }}} */
+
+/* {{{ proto bool RegexIterator::getFlags()
+ Returns current operation flags */
+SPL_METHOD(RegexIterator, getFlags)
+{
+ spl_dual_it_object *intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ RETURN_LONG(intern->u.regex.flags);
+} /* }}} */
+
+/* {{{ proto bool RegexIterator::setFlags(int new_flags)
+ Set operation flags */
+SPL_METHOD(RegexIterator, setFlags)
+{
+ spl_dual_it_object *intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ long flags;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {
+ return;
+ }
+
+ intern->u.regex.flags = flags;
+} /* }}} */
+
+/* {{{ proto bool RegexIterator::getFlags()
+ Returns current PREG flags (if in use or NULL) */
+SPL_METHOD(RegexIterator, getPregFlags)
+{
+ spl_dual_it_object *intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ if (intern->u.regex.use_flags) {
+ RETURN_LONG(intern->u.regex.preg_flags);
+ } else {
+ return;
+ }
+} /* }}} */
+
+/* {{{ proto bool RegexIterator::setFlags(int new_flags)
+ Set PREG flags */
+SPL_METHOD(RegexIterator, setPregFlags)
+{
+ spl_dual_it_object *intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+ long preg_flags;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &preg_flags) == FAILURE) {
+ return;
+ }
+
+ intern->u.regex.preg_flags = preg_flags;
+ intern->u.regex.use_flags = 1;
+} /* }}} */
+
+/* {{{ proto void RecursiveRegexIterator::__construct(RecursiveIterator it, string regex [, int mode [, int flags [, int preg_flags]]])
+ Create an RecursiveRegexIterator from another recursive iterator and a regular expression */
+SPL_METHOD(RecursiveRegexIterator, __construct)
+{
+ spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_RecursiveRegexIterator, spl_ce_RecursiveIterator, DIT_RecursiveRegexIterator);
+} /* }}} */
+
+/* {{{ proto RecursiveRegexIterator RecursiveRegexIterator::getChildren()
+ Return the inner iterator's children contained in a RecursiveRegexIterator */
+SPL_METHOD(RecursiveRegexIterator, getChildren)
+{
+ spl_dual_it_object *intern;
+ zval *retval, *regex;
+
+ 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);
+ if (!EG(exception)) {
+ MAKE_STD_ZVAL(regex);
+ ZVAL_STRING(regex, intern->u.regex.regex, 1);
+ spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), &return_value, 0, retval, regex TSRMLS_CC);
+ zval_ptr_dtor(&regex);
+ }
+ if (retval) {
+ zval_ptr_dtor(&retval);
+ }
} /* }}} */
+#endif
+
/* {{{ spl_dual_it_free_storage */
static void spl_dual_it_free_storage(void *_object TSRMLS_DC)
{
@@ -1269,9 +1585,29 @@ static void spl_dual_it_free_storage(void *_object TSRMLS_DC)
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->u.append.zarrayit) {
+ 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--;
+ }
+ if (object->u.regex.regex) {
+ efree(object->u.regex.regex);
+ }
+ }
+#endif
+
zend_object_std_dtor(&object->std TSRMLS_CC);
efree(object);
@@ -1337,6 +1673,60 @@ static zend_function_entry spl_funcs_ParentIterator[] = {
{NULL, NULL, NULL}
};
+#if HAVE_PCRE || HAVE_BUNDLED_PCRE
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_regex_it___construct, 0, 0, 2)
+ ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0)
+ ZEND_ARG_INFO(0, regex)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, flags)
+ ZEND_ARG_INFO(0, preg_flags)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_regex_it_set_mode, 0, 0, 1)
+ ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_regex_it_set_flags, 0, 0, 1)
+ ZEND_ARG_INFO(0, flags)
+ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_regex_it_set_preg_flags, 0, 0, 1)
+ ZEND_ARG_INFO(0, preg_flags)
+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)
+ SPL_ME(RegexIterator, getMode, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RegexIterator, setMode, arginfo_regex_it_set_mode, ZEND_ACC_PUBLIC)
+ SPL_ME(RegexIterator, getFlags, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RegexIterator, setFlags, arginfo_regex_it_set_flags, ZEND_ACC_PUBLIC)
+ SPL_ME(RegexIterator, getPregFlags, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RegexIterator, setPregFlags, arginfo_regex_it_set_preg_flags, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_rec_regex_it___construct, 0, 0, 2)
+ ZEND_ARG_OBJ_INFO(0, iterator, RecursiveIterator, 0)
+ ZEND_ARG_INFO(0, regex)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, flags)
+ ZEND_ARG_INFO(0, preg_flags)
+ZEND_END_ARG_INFO();
+
+static zend_function_entry spl_funcs_RecursiveRegexIterator[] = {
+ SPL_ME(RecursiveRegexIterator, __construct, arginfo_rec_regex_it___construct, ZEND_ACC_PUBLIC)
+ SPL_ME(ParentIterator, hasChildren, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveRegexIterator, 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 */
@@ -1366,9 +1756,11 @@ static inline void spl_limit_it_seek(spl_dual_it_object *intern, long pos TSRMLS
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);
+ if (!EG(exception)) {
+ 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 */
@@ -1503,66 +1895,79 @@ 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_symtable_update(HASH_OF(intern->u.caching.zcache), 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) {
+ if (EG(exception)) {
+ if (retval) {
+ zval_ptr_dtor(&retval);
+ }
+ if (intern->u.caching.flags & CIT_CATCH_GET_CHILD) {
zend_clear_exception(TSRMLS_C);
- if (zchildren) {
+ } else {
+ return;
+ }
+ } else {
+ if (zend_is_true(retval)) {
+ zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &zchildren);
+ if (EG(exception)) {
+ if (zchildren) {
+ zval_ptr_dtor(&zchildren);
+ }
+ if (intern->u.caching.flags & CIT_CATCH_GET_CHILD) {
+ zend_clear_exception(TSRMLS_C);
+ } else {
+ zval_ptr_dtor(&retval);
+ return;
+ }
+ } else {
+ INIT_PZVAL(&zflags);
+ ZVAL_LONG(&zflags, intern->u.caching.flags & CIT_PUBLIC);
+ spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &intern->u.caching.zchildren, 1, zchildren, &zflags TSRMLS_CC);
zval_ptr_dtor(&zchildren);
}
- } else {
- INIT_PZVAL(&zflags);
- ZVAL_LONG(&zflags, intern->u.caching.flags & CIT_PUBLIC);
- spl_instantiate_arg_ex2(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) {
- if (Z_TYPE_P(intern->current.data) == IS_OBJECT) {
- zval expr_copy;
- if (intern->current.data->value.obj.handlers->cast_object &&
- intern->current.data->value.obj.handlers->cast_object(intern->current.data, &expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS)
- {
- ALLOC_ZVAL(intern->u.caching.zstr);
- *intern->u.caching.zstr = expr_copy;
- INIT_PZVAL(intern->u.caching.zstr);
- zval_copy_ctor(intern->u.caching.zstr);
- zval_dtor(&expr_copy);
- } else {
- zend_class_entry *ce_data = spl_get_class_entry(intern->current.data TSRMLS_CC);
- if (ce_data && zend_hash_exists(&ce_data->function_table, "__tostring", sizeof("__tostring"))) {
- zend_call_method_with_0_params(&intern->current.data, ce_data, NULL, "__tostring", &intern->u.caching.zstr);
+ zval_ptr_dtor(&retval);
+ if (EG(exception)) {
+ if (intern->u.caching.flags & CIT_CATCH_GET_CHILD) {
+ zend_clear_exception(TSRMLS_C);
} else {
- ALLOC_ZVAL(intern->u.caching.zstr);
- *intern->u.caching.zstr = *intern->current.data;
- zval_copy_ctor(intern->u.caching.zstr);
- INIT_PZVAL(intern->u.caching.zstr);
- convert_to_string(intern->u.caching.zstr);
+ return;
}
}
+ }
+ }
+ if (intern->u.caching.flags & (CIT_TOSTRING_USE_INNER|CIT_CALL_TOSTRING)) {
+ int use_copy;
+ zval expr_copy;
+ ALLOC_ZVAL(intern->u.caching.zstr);
+ if (intern->u.caching.flags & CIT_TOSTRING_USE_INNER) {
+ *intern->u.caching.zstr = *intern->inner.zobject;
} else {
- /* This version requires zend_make_printable_zval() being able to
- * 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);
- }
+ }
+ 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);
@@ -1574,6 +1979,7 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
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);
}
@@ -1636,7 +2042,7 @@ SPL_METHOD(CachingIterator, __toString)
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))) {
+ if (!(intern->u.caching.flags & (CIT_CALL_TOSTRING|CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT|CIT_TOSTRING_USE_INNER))) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not fetch string value (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
}
if (intern->u.caching.flags & CIT_TOSTRING_USE_KEY) {
@@ -1648,8 +2054,10 @@ SPL_METHOD(CachingIterator, __toString)
return;
}
} else if (intern->u.caching.flags & CIT_TOSTRING_USE_CURRENT) {
- RETVAL_ZVAL(intern->current.data, 1, 0);
-
+ *return_value = *intern->current.data;
+ zval_copy_ctor(return_value);
+ convert_to_string(return_value);
+ INIT_PZVAL(return_value);
return;
}
if (intern->u.caching.zstr) {
@@ -1659,12 +2067,186 @@ SPL_METHOD(CachingIterator, __toString)
}
} /* }}} */
+/* {{{ proto void CachingIterator::offsetSet(mixed index, mixed newval)
+ Set given index in cache */
+SPL_METHOD(CachingIterator, offsetSet)
+{
+ spl_dual_it_object *intern;
+ char *arKey;
+ uint nKeyLength;
+ 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(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
+ }
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &arKey, &nKeyLength, &value) == FAILURE) {
+ return;
+ }
+
+ value->refcount++;
+ zend_symtable_update(HASH_OF(intern->u.caching.zcache), 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;
+ char *arKey;
+ uint nKeyLength;
+ 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(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
+ }
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arKey, &nKeyLength) == FAILURE) {
+ return;
+ }
+
+ if (zend_symtable_find(HASH_OF(intern->u.caching.zcache), arKey, nKeyLength+1, (void**)&value) == FAILURE) {
+ zend_error(E_NOTICE, "Undefined index: %s", 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;
+ char *arKey;
+ uint nKeyLength;
+
+ 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(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
+ }
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arKey, &nKeyLength) == FAILURE) {
+ return;
+ }
+
+ zend_symtable_del(HASH_OF(intern->u.caching.zcache), arKey, nKeyLength+1);
+}
+/* }}} */
+
+/* {{{ proto bool CachingIterator::offsetExists(mixed index)
+ Return whether the requested index exists */
+SPL_METHOD(CachingIterator, offsetExists)
+{
+ spl_dual_it_object *intern;
+ char *arKey;
+ uint nKeyLength;
+
+ 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(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
+ }
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arKey, &nKeyLength) == FAILURE) {
+ return;
+ }
+
+ RETURN_BOOL(zend_symtable_exists(HASH_OF(intern->u.caching.zcache), arKey, nKeyLength+1));
+}
+/* }}} */
+
+/* {{{ proto bool CachingIterator::getCache()
+ Return the cache */
+SPL_METHOD(CachingIterator, getCache)
+{
+ spl_dual_it_object *intern;
+
+ 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(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name);
+ return;
+ }
+
+ RETURN_ZVAL(intern->u.caching.zcache, 1, 0);
+}
+/* }}} */
+
+/* {{{ 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 (spl_cit_check_flags(flags) != SUCCESS) {
+ zend_throw_exception(spl_ce_InvalidArgumentException , "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0 TSRMLS_CC);
+ return;
+ }
+ if ((intern->u.caching.flags & CIT_CALL_TOSTRING) != 0 && (flags & CIT_CALL_TOSTRING) == 0) {
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag CALL_TO_STRING is not possible", 0 TSRMLS_CC);
+ return;
+ }
+ if ((intern->u.caching.flags & CIT_TOSTRING_USE_INNER) != 0 && (flags & CIT_TOSTRING_USE_INNER) == 0) {
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag TOSTRING_USE_INNER 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)
@@ -1675,6 +2257,13 @@ static zend_function_entry spl_funcs_CachingIterator[] = {
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)
+ SPL_ME(CachingIterator, getCache, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
@@ -1927,7 +2516,7 @@ int spl_append_it_next_iterator(spl_dual_it_object *intern TSRMLS_DC) /* {{{*/
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);
+ intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, *it, 0 TSRMLS_CC);
spl_dual_it_rewind(intern TSRMLS_CC);
return SUCCESS;
} else {
@@ -1972,7 +2561,7 @@ SPL_METHOD(AppendIterator, append)
APPENDIT_CHECK_CTOR(intern);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &it, zend_ce_iterator) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "O", &it, zend_ce_iterator) == FAILURE) {
return;
}
spl_array_iterator_append(intern->u.append.zarrayit, it TSRMLS_CC);
@@ -2024,6 +2613,30 @@ SPL_METHOD(AppendIterator, next)
spl_append_it_next(intern TSRMLS_CC);
} /* }}} */
+/* {{{ proto int AppendIterator::getIteratorIndex()
+ Get index of iterator */
+SPL_METHOD(AppendIterator, getIteratorIndex)
+{
+ spl_dual_it_object *intern;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ APPENDIT_CHECK_CTOR(intern);
+ spl_array_iterator_key(intern->u.append.zarrayit, return_value TSRMLS_CC);
+} /* }}} */
+
+/* {{{ proto ArrayIterator AppendIterator::getArrayIterator()
+ Get access to inner ArrayIterator */
+SPL_METHOD(AppendIterator, getArrayIterator)
+{
+ spl_dual_it_object *intern;
+
+ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
+
+ APPENDIT_CHECK_CTOR(intern);
+ RETURN_ZVAL(intern->u.append.zarrayit, 1, 0);
+} /* }}} */
+
static
ZEND_BEGIN_ARG_INFO(arginfo_append_it_append, 0)
ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0)
@@ -2038,66 +2651,105 @@ static zend_function_entry spl_funcs_AppendIterator[] = {
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)
+ SPL_ME(AppendIterator, getIteratorIndex, NULL, ZEND_ACC_PUBLIC)
+ SPL_ME(AppendIterator, getArrayIterator, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
-/* {{{ proto array iterator_to_array(Traversable it)
- Copy the iterator into an array */
-PHP_FUNCTION(iterator_to_array)
+PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser TSRMLS_DC)
{
- zval *obj, **data;
zend_object_iterator *iter;
- char *str_key;
- uint str_key_len;
- ulong int_key;
- int key_type;
+ zend_class_entry *ce = Z_OBJCE_P(obj);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, zend_ce_traversable) == FAILURE) {
- RETURN_FALSE;
+ iter = ce->get_iterator(ce, obj, 0 TSRMLS_CC);
+
+ if (EG(exception)) {
+ goto done;
}
-
- array_init(return_value);
-
- iter = Z_OBJCE_P(obj)->get_iterator(Z_OBJCE_P(obj), obj TSRMLS_CC);
if (iter->funcs->rewind) {
iter->funcs->rewind(iter TSRMLS_CC);
+ if (EG(exception)) {
+ goto done;
+ }
}
- if (EG(exception)) {
- return;
- }
+
while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) {
- iter->funcs->get_current_data(iter, &data TSRMLS_CC);
if (EG(exception)) {
- return;
+ goto done;
}
- (*data)->refcount++;
- 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)) {
- return;
- }
- 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_LONG:
- add_index_zval(return_value, int_key, *data);
- break;
- }
- } else {
- add_next_index_zval(return_value, *data);
+ if (apply_func(iter, puser TSRMLS_CC) == ZEND_HASH_APPLY_STOP || EG(exception)) {
+ goto done;
}
iter->funcs->move_forward(iter TSRMLS_CC);
if (EG(exception)) {
- return;
+ goto done;
}
}
+
+done:
iter->funcs->dtor(iter TSRMLS_CC);
+ return EG(exception) ? FAILURE : SUCCESS;
+}
+/* }}} */
+
+static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+{
+ zval **data, *return_value = (zval*)puser;
+ char *str_key;
+ uint str_key_len;
+ ulong int_key;
+ int key_type;
+
+ iter->funcs->get_current_data(iter, &data TSRMLS_CC);
if (EG(exception)) {
- return;
+ return ZEND_HASH_APPLY_STOP;
+ }
+ 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)) {
+ return ZEND_HASH_APPLY_STOP;
+ }
+ (*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_LONG:
+ add_index_zval(return_value, int_key, *data);
+ break;
+ }
+ } else {
+ (*data)->refcount++;
+ add_next_index_zval(return_value, *data);
}
+ return ZEND_HASH_APPLY_KEEP;
+}
+/* }}} */
+
+/* {{{ proto array iterator_to_array(Traversable it)
+ Copy the iterator into an array */
+PHP_FUNCTION(iterator_to_array)
+{
+ zval *obj;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, zend_ce_traversable) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ array_init(return_value);
+
+ if (spl_iterator_apply(obj, spl_iterator_to_array_apply, (void*)return_value TSRMLS_CC) != SUCCESS) {
+ zval_dtor(return_value);
+ RETURN_NULL();
+ }
+}
+
+static int spl_iterator_count_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+{
+ (*(long*)puser)++;
+ return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
@@ -2105,38 +2757,64 @@ PHP_FUNCTION(iterator_to_array)
Count the elements in an iterator */
PHP_FUNCTION(iterator_count)
{
- zval *obj;
- zend_object_iterator *iter;
- long count = 0;
+ zval *obj;
+ long count = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, zend_ce_traversable) == FAILURE) {
RETURN_FALSE;
}
- iter = Z_OBJCE_P(obj)->get_iterator(Z_OBJCE_P(obj), obj TSRMLS_CC);
+ if (spl_iterator_apply(obj, spl_iterator_count_apply, (void*)&count TSRMLS_CC) == SUCCESS) {
+ RETURN_LONG(count);
+ }
+}
+/* }}} */
- if (iter->funcs->rewind) {
- iter->funcs->rewind(iter TSRMLS_CC);
+typedef struct {
+ zval *obj;
+ zval *args;
+ long count;
+ zend_fcall_info fci;
+ zend_fcall_info_cache fcc;
+} spl_iterator_apply_info;
+
+static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+{
+ zval *retval;
+ spl_iterator_apply_info *apply_info = (spl_iterator_apply_info*)puser;
+ int result;
+
+ apply_info->count++;
+ zend_fcall_info_call(&apply_info->fci, &apply_info->fcc, &retval, NULL TSRMLS_CC);
+ if (retval) {
+ result = zend_is_true(retval) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP;
+ zval_ptr_dtor(&retval);
+ } else {
+ result = ZEND_HASH_APPLY_STOP;
}
- if (EG(exception)) {
+ return result;
+}
+/* }}} */
+
+/* {{{ proto int iterator_apply(Traversable it, mixed function [, mixed params])
+ Calls a function for every element in an iterator */
+PHP_FUNCTION(iterator_apply)
+{
+ spl_iterator_apply_info apply_info;
+
+ apply_info.args = NULL;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Of|a!", &apply_info.obj, zend_ce_traversable, &apply_info.fci, &apply_info.fcc, &apply_info.args) == FAILURE) {
return;
}
- while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) {
- if (EG(exception)) {
- return;
- }
- count++;
- iter->funcs->move_forward(iter TSRMLS_CC);
- if (EG(exception)) {
- return;
- }
- }
- iter->funcs->dtor(iter TSRMLS_CC);
- if (EG(exception)) {
- return;
+
+ apply_info.count = 0;
+ zend_fcall_info_args(&apply_info.fci, apply_info.args TSRMLS_CC);
+ if (spl_iterator_apply(apply_info.obj, spl_iterator_func_apply, (void*)&apply_info TSRMLS_CC) == SUCCESS) {
+ RETVAL_LONG(apply_info.count);
+ } else {
+ RETVAL_FALSE;
}
-
- RETURN_LONG(count);
+ zend_fcall_info_args(&apply_info.fci, NULL TSRMLS_CC);
}
/* }}} */
@@ -2177,6 +2855,7 @@ PHP_MINIT_FUNCTION(spl_iterators)
REGISTER_SPL_STD_CLASS_EX(IteratorIterator, spl_dual_it_new, spl_funcs_IteratorIterator);
REGISTER_SPL_ITERATOR(IteratorIterator);
+ REGISTER_SPL_IMPLEMENTS(IteratorIterator, OuterIterator);
REGISTER_SPL_SUB_CLASS_EX(FilterIterator, IteratorIterator, spl_dual_it_new, spl_funcs_FilterIterator);
spl_ce_FilterIterator->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
@@ -2192,11 +2871,14 @@ PHP_MINIT_FUNCTION(spl_iterators)
REGISTER_SPL_SUB_CLASS_EX(LimitIterator, IteratorIterator, spl_dual_it_new, spl_funcs_LimitIterator);
REGISTER_SPL_SUB_CLASS_EX(CachingIterator, IteratorIterator, spl_dual_it_new, spl_funcs_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, "TOSTRING_USE_INNER", CIT_TOSTRING_USE_INNER);
+ 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);
@@ -2206,8 +2888,24 @@ PHP_MINIT_FUNCTION(spl_iterators)
REGISTER_SPL_SUB_CLASS_EX(AppendIterator, IteratorIterator, spl_dual_it_new, spl_funcs_AppendIterator);
REGISTER_SPL_IMPLEMENTS(RecursiveIteratorIterator, 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_CLASS_CONST_LONG(RegexIterator, "MATCH", REGIT_MODE_MATCH);
+ REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "GET_MATCH", REGIT_MODE_GET_MATCH);
+ REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "ALL_MATCHES", REGIT_MODE_ALL_MATCHES);
+ REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "SPLIT", REGIT_MODE_SPLIT);
+ REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "REPLACE", REGIT_MODE_REPLACE);
+ REGISTER_SPL_PROPERTY(RegexIterator, "replacement", 0);
+ 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);
diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h
index 3b39b03cd..c434f4264 100755
--- a/ext/spl/spl_iterators.h
+++ b/ext/spl/spl_iterators.h
@@ -16,13 +16,16 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_iterators.h,v 1.18.2.7 2006/03/05 17:39:49 helly Exp $ */
+/* $Id: spl_iterators.h,v 1.18.2.7.2.9 2006/09/28 22:33:06 tony2001 Exp $ */
#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
@@ -45,11 +48,14 @@ 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);
+PHP_FUNCTION(iterator_apply);
typedef enum {
DIT_Default = 0,
@@ -63,21 +69,41 @@ typedef enum {
DIT_NoRewindIterator,
DIT_InfiniteIterator,
DIT_AppendIterator,
+#if HAVE_PCRE || HAVE_BUNDLED_PCRE
+ DIT_RegexIterator,
+ DIT_RecursiveRegexIterator,
+#endif
DIT_Unknown = ~0
} 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_TOSTRING_USE_KEY = 0x00000002,
+ CIT_TOSTRING_USE_CURRENT = 0x00000004,
+ CIT_TOSTRING_USE_INNER = 0x00000008,
+ CIT_CATCH_GET_CHILD = 0x00000010,
+ CIT_FULL_CACHE = 0x00000100,
CIT_PUBLIC = 0x0000FFFF,
/* private */
CIT_VALID = 0x00010000,
CIT_HAS_CHILDREN = 0x00020000
};
+enum {
+ /* public */
+ REGIT_USE_KEY = 0x00000001,
+};
+
+typedef enum {
+ REGIT_MODE_MATCH,
+ REGIT_MODE_GET_MATCH,
+ REGIT_MODE_ALL_MATCHES,
+ REGIT_MODE_SPLIT,
+ REGIT_MODE_REPLACE,
+ REGIT_MODE_MAX,
+} regex_mode;
+
typedef struct _spl_dual_it_object {
zend_object std;
struct {
@@ -101,17 +127,32 @@ typedef struct _spl_dual_it_object {
long count;
} limit;
struct {
- int flags; /* CIT_* */
+ long 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 use_flags;
+ long flags;
+ regex_mode mode;
+ long preg_flags;
+ pcre_cache_entry *pce;
+ char *regex;
+ } regex;
+#endif
} u;
} spl_dual_it_object;
+typedef int (*spl_iterator_apply_func_t)(zend_object_iterator *iter, void *puser TSRMLS_DC);
+
+PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser TSRMLS_DC);
+
#endif /* SPL_ITERATORS_H */
/*
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index fc7259e1e..c13d3620a 100755
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_observer.c,v 1.2.2.6 2006/03/29 14:28:42 tony2001 Exp $ */
+/* $Id: spl_observer.c,v 1.2.2.6.2.1 2006/08/23 09:32:24 bjori Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -261,7 +261,7 @@ SPL_METHOD(SplObjectStorage, next)
static
ZEND_BEGIN_ARG_INFO(arginfo_Object, 0)
- ZEND_ARG_INFO(0, object 0)
+ ZEND_ARG_INFO(0, object)
ZEND_END_ARG_INFO();
static zend_function_entry spl_funcs_SplObjectStorage[] = {
diff --git a/ext/spl/tests/array_013.phpt b/ext/spl/tests/array_013.phpt
index 6d74bcb41..905b8339c 100755
--- a/ext/spl/tests/array_013.phpt
+++ b/ext/spl/tests/array_013.phpt
@@ -78,4 +78,4 @@ one=>1
two=>2
===Append===
-Fatal error: ArrayIterator::append(): Cannot append properties to objects, use ArrayIterator::offsetSet() instead in %sarray_013.php on line %d
+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_019.phpt b/ext/spl/tests/array_019.phpt
index 1416d8407..43d53b127 100755
--- a/ext/spl/tests/array_019.phpt
+++ b/ext/spl/tests/array_019.phpt
@@ -28,5 +28,5 @@ int(1)
int(2)
int(3)
int(4)
-int(5)
-===DONE===
+
+Fatal error: An iterator cannot be used with foreach by reference in %sarray_019.php on line %d
diff --git a/ext/spl/tests/array_021.phpt b/ext/spl/tests/array_021.phpt
index f2ae0c87e..b38cedf0c 100755
--- a/ext/spl/tests/array_021.phpt
+++ b/ext/spl/tests/array_021.phpt
@@ -1,5 +1,7 @@
--TEST--
SPL: ArrayObject::seek() and exceptions
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
--FILE--
<?php
diff --git a/ext/spl/tests/array_022.phpt b/ext/spl/tests/array_022.phpt
index d1eafd677..9cb2193f1 100755
--- a/ext/spl/tests/array_022.phpt
+++ b/ext/spl/tests/array_022.phpt
@@ -1,5 +1,7 @@
--TEST--
SPL: ArrayObject/Iterator and reference to self
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
--FILE--
==ArrayObject===
<?php
@@ -68,27 +70,3 @@ object(MyArrayIterator)#%d (2) {
string(3) "Foo"
}
===DONE===
---UEXPECTF--
-==ArrayObject===
-object(MyArrayObject)#%d (1) {
- [u"bar"]=>
- unicode(3) "baz"
-}
-object(MyArrayObject)#%d (2) {
- [u"bar"]=>
- unicode(3) "baz"
- [u"baz"]=>
- unicode(3) "Foo"
-}
-==ArrayIterator===
-object(MyArrayIterator)#%d (1) {
- [u"bar"]=>
- unicode(3) "baz"
-}
-object(MyArrayIterator)#%d (2) {
- [u"bar"]=>
- unicode(3) "baz"
- [u"baz"]=>
- unicode(3) "Foo"
-}
-===DONE===
diff --git a/ext/spl/tests/bug36941.phpt b/ext/spl/tests/bug36941.phpt
index 528ba4a46..2ae03b448 100755
--- a/ext/spl/tests/bug36941.phpt
+++ b/ext/spl/tests/bug36941.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #36941 (ArrayIterator does not clone itself)
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
--FILE--
===ArrayObject===
<?php
diff --git a/ext/spl/tests/bug37457.phpt b/ext/spl/tests/bug37457.phpt
new file mode 100755
index 000000000..4395287bc
--- /dev/null
+++ b/ext/spl/tests/bug37457.phpt
@@ -0,0 +1,82 @@
+--TEST--
+Bug #37457 (Crash when an exception is thrown in accept() method of FilterIterator)
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class Collection implements Iterator
+{
+ protected $array, $valid = false;
+
+ public function __construct(array $a)
+ {
+ echo __METHOD__ . "\n";
+ $this->array = $a;
+ }
+
+ public function current()
+ {
+ echo __METHOD__ . "\n";
+ return current($this->array);
+ }
+
+ public function key()
+ {
+ echo __METHOD__ . "\n";
+ return key($this->array);
+ }
+
+ public function next()
+ {
+ echo __METHOD__ . "\n";
+ $this->valid = (false !== next($this->array));
+ }
+
+ public function valid()
+ {
+ echo __METHOD__ . "\n";
+ return $this->valid;
+ }
+
+ public function rewind()
+ {
+ echo __METHOD__ . "\n";
+ $this->valid = (false !== reset($this->array));
+ }
+}
+
+class TestFilter extends FilterIterator
+{
+ public function accept()
+ {
+ echo __METHOD__ . "\n";
+ throw new Exception("Failure in Accept");
+ }
+}
+
+$test = new TestFilter(new Collection(array(0)));
+
+try
+{
+ foreach ($test as $item)
+ {
+ echo $item;
+ }
+}
+catch (Exception $e)
+{
+ var_dump($e->getMessage());
+}
+
+?>
+===DONE===
+--EXPECTF--
+Collection::__construct
+Collection::rewind
+Collection::valid
+Collection::current
+Collection::key
+TestFilter::accept
+string(17) "Failure in Accept"
+===DONE===
diff --git a/ext/spl/tests/fileobject_003.phpt b/ext/spl/tests/fileobject_003.phpt
new file mode 100755
index 000000000..74f2002d0
--- /dev/null
+++ b/ext/spl/tests/fileobject_003.phpt
@@ -0,0 +1,89 @@
+--TEST--
+SPL: SplFileInfo cloning
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+function test($name, $lc, $lp)
+{
+ static $i = 0;
+ echo "===$i===\n";
+ $i++;
+
+ $o = new SplFileInfo($name);
+
+ var_dump($o);
+ $c = clone $o;
+ var_dump($c);
+ var_dump($o === $c);
+ var_dump($o == $c);
+ var_dump($o->getPathname() == $c->getPathname());
+
+ $f = new SplFileObject($name);
+ var_dump($name);
+ var_dump($f->getPathName());
+ $l = substr($f->getPathName(), -1);
+ var_dump($l != '/' && $l != '\\' && $l == $lc);
+ var_dump($f->getFileName());
+ $l = substr($f->getFileName(), -1);
+ var_dump($l != '/' && $l != '\\' && $l == $lc);
+ var_dump($f->getPath());
+ $l = substr($f->getPath(), -1);
+ var_dump($l != '/' && $l != '\\' && $l == $lp);
+}
+
+test(dirname(__FILE__) . '/' . 'fileobject_001a.txt', 't', substr(dirname(__FILE__),-1));
+test(dirname(__FILE__) . '/', substr(dirname(__FILE__),-1), 'l');
+test(dirname(__FILE__), substr(dirname(__FILE__),-1), 'l');
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+===0===
+object(SplFileInfo)#%d (0) {
+}
+object(SplFileInfo)#%d (0) {
+}
+bool(false)
+bool(true)
+bool(true)
+string(%d) "%sfileobject_001a.txt"
+string(%d) "%sfileobject_001a.txt"
+bool(true)
+string(%d) "%sfileobject_001a.txt"
+bool(true)
+string(%d) "%stests"
+bool(true)
+===1===
+object(SplFileInfo)#%d (0) {
+}
+object(SplFileInfo)#%d (0) {
+}
+bool(false)
+bool(true)
+bool(true)
+string(%d) "%stests/"
+string(%d) "%stests"
+bool(true)
+string(%d) "%stests"
+bool(true)
+string(%d) "%sspl"
+bool(true)
+===2===
+object(SplFileInfo)#1 (0) {
+}
+object(SplFileInfo)#2 (0) {
+}
+bool(false)
+bool(true)
+bool(true)
+string(%d) "%stests"
+string(%d) "%stests"
+bool(true)
+string(%d) "%stests"
+bool(true)
+string(%d) "%sspl"
+bool(true)
+===DONE===
diff --git a/ext/spl/tests/iterator_027.phpt b/ext/spl/tests/iterator_027.phpt
new file mode 100755
index 000000000..601515e8f
--- /dev/null
+++ b/ext/spl/tests/iterator_027.phpt
@@ -0,0 +1,85 @@
+--TEST--
+SPL: CachingIterator::FULL_CACHE
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+$ar = array(1, 2, array(31, 32, array(331)), 4);
+
+$it = new RecursiveArrayIterator($ar);
+$it = new RecursiveIteratorIterator($it);
+$it = new CachingIterator($it, CachingIterator::FULL_CACHE);
+
+foreach($it as $k=>$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===
+<?php exit(0); ?>
+--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===
diff --git a/ext/spl/tests/iterator_029.phpt b/ext/spl/tests/iterator_029.phpt
new file mode 100755
index 000000000..3e836adef
--- /dev/null
+++ b/ext/spl/tests/iterator_029.phpt
@@ -0,0 +1,40 @@
+--TEST--
+SPL: RegexIterator
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+$ar = array(0, "123", 123, 22 => "abc", "a2b", 22, "a2d" => 7, 42);
+
+foreach(new RegexIterator(new ArrayIterator($ar), "/2/") as $k => $v)
+{
+ echo "$k=>$v\n";
+}
+
+?>
+===KEY===
+<?php
+
+foreach(new RegexIterator(new ArrayIterator($ar), "/2/", 0, RegexIterator::USE_KEY) as $k => $v)
+{
+ echo "$k=>$v\n";
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--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/iterator_035.phpt b/ext/spl/tests/iterator_035.phpt
index eebc7f22a..9dfe35d5f 100644
--- a/ext/spl/tests/iterator_035.phpt
+++ b/ext/spl/tests/iterator_035.phpt
@@ -14,4 +14,4 @@ $a[] = &$tmp;
echo "Done\n";
?>
--EXPECTF--
-Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in %s on line %d
+Fatal error: Cannot assign by reference to overloaded object in %s on line %d
diff --git a/ext/spl/tests/iterator_036.phpt b/ext/spl/tests/iterator_036.phpt
new file mode 100755
index 000000000..3eb0eefa6
--- /dev/null
+++ b/ext/spl/tests/iterator_036.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SPL: CachingIterator and __toString and flags = 0
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+function test($it)
+{
+ foreach($it as $v)
+ {
+ var_dump((string)$it);
+ }
+}
+
+$ar = new ArrayIterator(array(1, 2, 3));
+
+test(new CachingIterator($ar, 0));
+
+?>
+===DONE===
+--EXPECTF--
+
+Fatal error: Method CachingIterator::__toString() must not throw an exception in %siterator_036.php on line %d
diff --git a/ext/spl/tests/iterator_037.phpt b/ext/spl/tests/iterator_037.phpt
new file mode 100755
index 000000000..be79468f3
--- /dev/null
+++ b/ext/spl/tests/iterator_037.phpt
@@ -0,0 +1,133 @@
+--TEST--
+SPL: CachingIterator and __toString
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+function test($ar, $flags)
+{
+ echo "===$flags===\n";
+ $it = new CachingIterator($ar, 0);
+ try
+ {
+ $it->setFlags($flags);
+ }
+ catch (Exception $e)
+ {
+ echo 'Exception: ' . $e->getMessage() . "\n";
+ var_dump($it->getFlags());
+ return;
+ }
+ var_dump($it->getFlags());
+ try
+ {
+ foreach($it as $v)
+ {
+ var_dump((string)$it);
+ }
+ }
+ catch (Exception $e)
+ {
+ echo 'Exception: ' . $e->getMessage() . "\n";
+ }
+}
+
+class MyItem
+{
+ function __construct($value)
+ {
+ $this->value = $value;
+ }
+
+ function __toString()
+ {
+ return (string)$this->value;
+ }
+}
+
+class MyArrayIterator extends ArrayIterator
+{
+ function __toString()
+ {
+ return $this->key() . ':' . $this->current();
+ }
+}
+
+$ar = new MyArrayIterator(array(1, 2, 3));
+
+test($ar, CachingIterator::CALL_TOSTRING);
+test($ar, CachingIterator::TOSTRING_USE_KEY);
+test($ar, CachingIterator::TOSTRING_USE_CURRENT);
+
+$ar = new MyArrayIterator(array(new MyItem(1), new MyItem(2), new MyItem(3)));
+
+test($ar, CachingIterator::TOSTRING_USE_INNER);
+test($ar, CachingIterator::CALL_TOSTRING | CachingIterator::TOSTRING_USE_KEY);
+test($ar, CachingIterator::CALL_TOSTRING | CachingIterator::TOSTRING_USE_CURRENT);
+test($ar, CachingIterator::CALL_TOSTRING | CachingIterator::TOSTRING_USE_INNER);
+test($ar, CachingIterator::TOSTRING_USE_KEY | CachingIterator::TOSTRING_USE_CURRENT);
+test($ar, CachingIterator::TOSTRING_USE_KEY | CachingIterator::TOSTRING_USE_INNER);
+
+echo "===X===\n";
+try
+{
+ $it = new CachingIterator($ar, CachingIterator::CALL_TOSTRING);
+ $it->setFlags(0);
+}
+catch (Exception $e)
+{
+ echo 'Exception: ' . $e->getMessage() . "\n";
+}
+try
+{
+ $it = new CachingIterator($ar, CachingIterator::TOSTRING_USE_INNER);
+ $it->setFlags(0);
+}
+catch (Exception $e)
+{
+ echo 'Exception: ' . $e->getMessage() . "\n";
+}
+
+?>
+===DONE===
+--EXPECTF--
+===1===
+int(1)
+string(1) "1"
+string(1) "2"
+string(1) "3"
+===2===
+int(2)
+string(1) "0"
+string(1) "1"
+string(1) "2"
+===4===
+int(4)
+string(1) "1"
+string(1) "2"
+string(1) "3"
+===8===
+int(8)
+string(3) "0:1"
+string(3) "1:2"
+string(3) "2:3"
+===3===
+Exception: Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER
+int(0)
+===5===
+Exception: Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER
+int(0)
+===9===
+Exception: Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER
+int(0)
+===6===
+Exception: Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER
+int(0)
+===10===
+Exception: Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER
+int(0)
+===X===
+Exception: Unsetting flag CALL_TO_STRING is not possible
+Exception: Unsetting flag TOSTRING_USE_INNER is not possible
+===DONE===
diff --git a/ext/spl/tests/iterator_038.phpt b/ext/spl/tests/iterator_038.phpt
new file mode 100755
index 000000000..71f911c57
--- /dev/null
+++ b/ext/spl/tests/iterator_038.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SPL: RoRewindIterator and string keys
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+foreach(new NoRewindIterator(new ArrayIterator(array('Hello'=>0, 'World'=>1))) as $k => $v)
+{
+ var_dump($v);
+ var_dump($k);
+}
+
+?>
+===DONE===
+--EXPECT--
+int(0)
+string(5) "Hello"
+int(1)
+string(5) "World"
+===DONE===
diff --git a/ext/spl/tests/iterator_039.phpt b/ext/spl/tests/iterator_039.phpt
new file mode 100755
index 000000000..5dcaaa226
--- /dev/null
+++ b/ext/spl/tests/iterator_039.phpt
@@ -0,0 +1,123 @@
+--TEST--
+SPL: LimitIterator and backward seeking
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class NumericArrayIterator implements Iterator
+{
+ protected $a;
+ protected $i = 0;
+
+ public function __construct($a)
+ {
+ echo __METHOD__ . "\n";
+ $this->a = $a;
+ }
+
+ public function valid()
+ {
+ echo __METHOD__ . "\n";
+ return $this->i < count($this->a);
+ }
+
+ public function rewind()
+ {
+ echo __METHOD__ . "\n";
+ $this->i = 0;
+ }
+
+ 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++;
+ }
+}
+
+$it = new LimitIterator(new NumericArrayIterator(array(12, 25, 42, 56)));
+
+foreach($it as $k => $v)
+{
+ var_dump($k);
+ var_dump($v);
+}
+
+echo "===SEEK===\n";
+
+$it->seek(2);
+
+echo "===LOOP===\n";
+
+foreach(new NoRewindIterator($it) as $k => $v)
+{
+ var_dump($k);
+ var_dump($v);
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+NumericArrayIterator::__construct
+NumericArrayIterator::rewind
+NumericArrayIterator::valid
+NumericArrayIterator::valid
+NumericArrayIterator::current
+NumericArrayIterator::key
+int(0)
+int(12)
+NumericArrayIterator::next
+NumericArrayIterator::valid
+NumericArrayIterator::current
+NumericArrayIterator::key
+int(1)
+int(25)
+NumericArrayIterator::next
+NumericArrayIterator::valid
+NumericArrayIterator::current
+NumericArrayIterator::key
+int(2)
+int(42)
+NumericArrayIterator::next
+NumericArrayIterator::valid
+NumericArrayIterator::current
+NumericArrayIterator::key
+int(3)
+int(56)
+NumericArrayIterator::next
+NumericArrayIterator::valid
+===SEEK===
+NumericArrayIterator::rewind
+NumericArrayIterator::valid
+NumericArrayIterator::next
+NumericArrayIterator::valid
+NumericArrayIterator::next
+NumericArrayIterator::valid
+NumericArrayIterator::valid
+NumericArrayIterator::current
+NumericArrayIterator::key
+===LOOP===
+int(2)
+int(42)
+NumericArrayIterator::next
+NumericArrayIterator::valid
+NumericArrayIterator::current
+NumericArrayIterator::key
+int(3)
+int(56)
+NumericArrayIterator::next
+NumericArrayIterator::valid
+===DONE===
diff --git a/ext/spl/tests/iterator_040.phpt b/ext/spl/tests/iterator_040.phpt
new file mode 100755
index 000000000..a162cac68
--- /dev/null
+++ b/ext/spl/tests/iterator_040.phpt
@@ -0,0 +1,49 @@
+--TEST--
+SPL: RecursiveFilterIterator
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyRecursiveFilterIterator extends RecursiveFilterIterator
+{
+ function accept()
+ {
+ return true;
+ }
+}
+
+$ar = array(1, array(21, 22), 3);
+$it = new RecursiveArrayIterator($ar);
+$it = new MyRecursiveFilterIterator($it);
+$it = new RecursiveIteratorIterator($it);
+
+foreach($it as $k => $v)
+{
+ echo "===\n";
+ var_dump($it->getDepth());
+ var_dump($k);
+ var_dump($v);
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+===
+int(0)
+int(0)
+int(1)
+===
+int(1)
+int(0)
+int(21)
+===
+int(1)
+int(1)
+int(22)
+===
+int(0)
+int(2)
+int(3)
+===DONE===
diff --git a/ext/spl/tests/iterator_041.phpt b/ext/spl/tests/iterator_041.phpt
new file mode 100755
index 000000000..af42b1cde
--- /dev/null
+++ b/ext/spl/tests/iterator_041.phpt
@@ -0,0 +1,119 @@
+--TEST--
+SPL: iterator_to_array() and exceptions
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyArrayIterator extends ArrayIterator
+{
+ static protected $fail = 0;
+ public $state;
+
+ static function fail($state, $method)
+ {
+ if (self::$fail == $state)
+ {
+ throw new Exception("State $state: $method()");
+ }
+ }
+
+ function __construct()
+ {
+ $this->state = MyArrayIterator::$fail;
+ self::fail(0, __FUNCTION__);
+ parent::__construct(array(1, 2));
+ self::fail(1, __FUNCTION__);
+ }
+
+ function rewind()
+ {
+ self::fail(2, __FUNCTION__);
+ return parent::rewind();
+ }
+
+ function valid()
+ {
+ self::fail(3, __FUNCTION__);
+ return parent::valid();
+ }
+
+ function current()
+ {
+ self::fail(4, __FUNCTION__);
+ return parent::current();
+ }
+
+ function key()
+ {
+ self::fail(5, __FUNCTION__);
+ return parent::key();
+ }
+
+ function next()
+ {
+ self::fail(6, __FUNCTION__);
+ return parent::next();
+ }
+
+ function __destruct()
+ {
+// self::fail(7, __FUNCTION__);
+ }
+
+ static function test($func, $skip = null)
+ {
+ echo "===$func===\n";
+ self::$fail = 0;
+ while(self::$fail < 10)
+ {
+ try
+ {
+ var_dump($func(new MyArrayIterator()));
+ break;
+ }
+ catch (Exception $e)
+ {
+ echo $e->getMessage() . "\n";
+ }
+ if (isset($skip[self::$fail]))
+ {
+ self::$fail = $skip[self::$fail];
+ }
+ else
+ {
+ self::$fail++;
+ }
+ }
+ }
+}
+
+MyArrayIterator::test('iterator_to_array');
+MyArrayIterator::test('iterator_count', array(3 => 6));
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+===iterator_to_array===
+State 0: __construct()
+State 1: __construct()
+State 2: rewind()
+State 3: valid()
+State 4: current()
+State 5: key()
+State 6: next()
+array(2) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+}
+===iterator_count===
+State 0: __construct()
+State 1: __construct()
+State 2: rewind()
+State 3: valid()
+State 6: next()
+int(2)
+===DONE===
diff --git a/ext/spl/tests/iterator_041a.phpt b/ext/spl/tests/iterator_041a.phpt
new file mode 100755
index 000000000..d03cbba9d
--- /dev/null
+++ b/ext/spl/tests/iterator_041a.phpt
@@ -0,0 +1,109 @@
+--TEST--
+SPL: iterator_to_array() and exceptions from destruct
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyArrayIterator extends ArrayIterator
+{
+ static protected $fail = 0;
+ public $state;
+
+ static function fail($state, $method)
+ {
+ if (self::$fail == $state)
+ {
+ throw new Exception("State $state: $method()");
+ }
+ }
+
+ function __construct()
+ {
+ $this->state = MyArrayIterator::$fail;
+ self::fail(0, __FUNCTION__);
+ parent::__construct(array(1, 2));
+ self::fail(1, __FUNCTION__);
+ }
+
+ function rewind()
+ {
+ self::fail(2, __FUNCTION__);
+ return parent::rewind();
+ }
+
+ function valid()
+ {
+ self::fail(3, __FUNCTION__);
+ return parent::valid();
+ }
+
+ function current()
+ {
+ self::fail(4, __FUNCTION__);
+ return parent::current();
+ }
+
+ function key()
+ {
+ self::fail(5, __FUNCTION__);
+ return parent::key();
+ }
+
+ function next()
+ {
+ self::fail(6, __FUNCTION__);
+ return parent::next();
+ }
+
+ function __destruct()
+ {
+ self::fail(7, __FUNCTION__);
+ }
+
+ static function test($func, $skip = null)
+ {
+ echo "===$func===\n";
+ self::$fail = 7;
+ while(self::$fail < 10)
+ {
+ try
+ {
+ var_dump($func(new MyArrayIterator()));
+ break;
+ }
+ catch (Exception $e)
+ {
+ echo $e->getMessage() . "\n";
+ }
+ if (isset($skip[self::$fail]))
+ {
+ self::$fail = $skip[self::$fail];
+ }
+ else
+ {
+ self::$fail++;
+ }
+ }
+ }
+}
+
+MyArrayIterator::test('iterator_to_array');
+MyArrayIterator::test('iterator_count', array(3 => 6));
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+===iterator_to_array===
+State 7: __destruct()
+array(2) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+}
+===iterator_count===
+State 7: __destruct()
+int(2)
+===DONE===
diff --git a/ext/spl/tests/iterator_041b.phpt b/ext/spl/tests/iterator_041b.phpt
new file mode 100755
index 000000000..9afb93526
--- /dev/null
+++ b/ext/spl/tests/iterator_041b.phpt
@@ -0,0 +1,107 @@
+--TEST--
+SPL: iterator_to_array() and exceptions from delayed destruct
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyArrayIterator extends ArrayIterator
+{
+ static protected $fail = 0;
+ public $state;
+
+ static function fail($state, $method)
+ {
+ if (self::$fail == $state)
+ {
+ throw new Exception("State $state: $method()");
+ }
+ }
+
+ function __construct()
+ {
+ $this->state = MyArrayIterator::$fail;
+ self::fail(0, __FUNCTION__);
+ parent::__construct(array(1, 2));
+ self::fail(1, __FUNCTION__);
+ }
+
+ function rewind()
+ {
+ self::fail(2, __FUNCTION__);
+ return parent::rewind();
+ }
+
+ function valid()
+ {
+ self::fail(3, __FUNCTION__);
+ return parent::valid();
+ }
+
+ function current()
+ {
+ self::fail(4, __FUNCTION__);
+ return parent::current();
+ }
+
+ function key()
+ {
+ self::fail(5, __FUNCTION__);
+ return parent::key();
+ }
+
+ function next()
+ {
+ self::fail(6, __FUNCTION__);
+ return parent::next();
+ }
+
+ function __destruct()
+ {
+ self::fail(7, __FUNCTION__);
+ }
+
+ static function test($func, $skip = null)
+ {
+ echo "===$func===\n";
+ self::$fail = 0;
+ while(self::$fail < 10)
+ {
+ try
+ {
+ var_dump($func(new MyArrayIterator()));
+ break;
+ }
+ catch (Exception $e)
+ {
+ echo $e->getMessage() . "\n";
+ }
+ if (isset($skip[self::$fail]))
+ {
+ self::$fail = $skip[self::$fail];
+ }
+ else
+ {
+ self::$fail++;
+ }
+ }
+ }
+}
+
+MyArrayIterator::test('iterator_to_array');
+MyArrayIterator::test('iterator_count', array(3 => 6));
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+===iterator_to_array===
+State 0: __construct()
+State 1: __construct()
+State 2: rewind()
+State 3: valid()
+State 4: current()
+State 5: key()
+State 6: next()
+
+Fatal error: Ignoring exception from MyArrayIterator::__destruct() while an exception is already active (Uncaught Exception in %s on line %d) in %siterator_041b.php on line %d
diff --git a/ext/spl/tests/iterator_042.phpt b/ext/spl/tests/iterator_042.phpt
new file mode 100755
index 000000000..861545065
--- /dev/null
+++ b/ext/spl/tests/iterator_042.phpt
@@ -0,0 +1,104 @@
+--TEST--
+SPL: AppendIterator and its ArrayIterator
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+function test_error_handler($errno, $msg, $filename, $linenum, $vars)
+{
+ echo "Error $msg in $filename on line $linenum\n";
+ return true;
+}
+
+set_error_handler('test_error_handler');
+
+$it = new AppendIterator;
+
+$it->append(array());
+$it->append(new ArrayIterator(array(1)));
+$it->append(new ArrayIterator(array(21, 22)));
+
+var_dump($it->getArrayIterator());
+
+$it->append(new ArrayIterator(array(31, 32, 33)));
+
+var_dump($it->getArrayIterator());
+
+$idx = 0;
+
+foreach($it as $k => $v)
+{
+ echo '===' . $idx++ . "===\n";
+ var_dump($it->getIteratorIndex());
+ var_dump($k);
+ var_dump($v);
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Error Argument 1 passed to AppendIterator::append() must implement interface Iterator, array given in %siterator_042.php on line %d
+object(ArrayIterator)#%d (2) {
+ [0]=>
+ object(ArrayIterator)#%d (1) {
+ [0]=>
+ int(1)
+ }
+ [1]=>
+ object(ArrayIterator)#%d (2) {
+ [0]=>
+ int(21)
+ [1]=>
+ int(22)
+ }
+}
+object(ArrayIterator)#%d (3) {
+ [0]=>
+ object(ArrayIterator)#%d (1) {
+ [0]=>
+ int(1)
+ }
+ [1]=>
+ object(ArrayIterator)#%d (2) {
+ [0]=>
+ int(21)
+ [1]=>
+ int(22)
+ }
+ [2]=>
+ object(ArrayIterator)#5 (3) {
+ [0]=>
+ int(31)
+ [1]=>
+ int(32)
+ [2]=>
+ int(33)
+ }
+}
+===0===
+int(0)
+int(0)
+int(1)
+===1===
+int(1)
+int(0)
+int(21)
+===2===
+int(1)
+int(1)
+int(22)
+===3===
+int(2)
+int(0)
+int(31)
+===4===
+int(2)
+int(1)
+int(32)
+===5===
+int(2)
+int(2)
+int(33)
+===DONE===
diff --git a/ext/spl/tests/iterator_043.phpt b/ext/spl/tests/iterator_043.phpt
new file mode 100755
index 000000000..c49e33473
--- /dev/null
+++ b/ext/spl/tests/iterator_043.phpt
@@ -0,0 +1,20 @@
+--TEST--
+SPL: RecursiveCachingIterator and uninitialized getChildren()
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+$it = new RecursiveCachingIterator(new RecursiveArrayIterator(array(1,2)));
+
+var_dump($it->getChildren());
+$it->rewind();
+var_dump($it->getChildren());
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+NULL
+NULL
+===DONE===
diff --git a/ext/spl/tests/iterator_044.phpt b/ext/spl/tests/iterator_044.phpt
new file mode 100755
index 000000000..e25e0d1dd
--- /dev/null
+++ b/ext/spl/tests/iterator_044.phpt
@@ -0,0 +1,169 @@
+--TEST--
+SPL: CachingIterator and offsetGet/Exists using flag FULL_CACHE
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyFoo
+{
+ function __toString()
+ {
+ return 'foo';
+ }
+}
+
+class MyCachingIterator extends CachingIterator
+{
+ function __construct(Iterator $it, $flags = 0)
+ {
+ parent::__construct($it, $flags);
+ }
+
+ function test($ar)
+ {
+ foreach($ar as $k => $v)
+ {
+ echo "===$k===\n";
+ var_dump($v);
+ var_dump($this->offsetExists($v));
+ var_dump($this->offsetGet($v));
+ }
+ }
+}
+
+$it = new MyCachingIterator(new ArrayIterator(array(0, 'foo'=>1, 2, 'bar'=>3, 4)));
+
+try
+{
+ var_dump($it->offsetExists(0));
+}
+catch(Exception $e)
+{
+ echo "Exception: " . $e->getMessage() . "\n";
+}
+
+try
+{
+ var_dump($it->offsetGet(0));
+}
+catch(Exception $e)
+{
+ echo "Exception: " . $e->getMessage() . "\n";
+}
+
+$it = new MyCachingIterator(new ArrayIterator(array(0, 'foo'=>1, 2, 'bar'=>3, 4)), CachingIterator::FULL_CACHE);
+
+var_dump($it->offsetExists());
+var_dump($it->offsetGet());
+
+$checks = array(0, new stdClass, new MyFoo, NULL, 2, 'foo', 3);
+
+$it->test($checks);
+
+echo "===FILL===\n";
+
+foreach($it as $v); // read all into cache
+
+$it->test($checks);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct)
+
+Notice: Undefined index: 0 in %siterator_044.php on line %d
+Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct)
+
+Warning: CachingIterator::offsetExists() expects exactly 1 parameter, 0 given in %s/iterator_044.php on line %d
+NULL
+
+Warning: CachingIterator::offsetGet() expects exactly 1 parameter, 0 given in %s/iterator_044.php on line %d
+NULL
+===0===
+int(0)
+bool(false)
+
+Notice: Undefined index: 0 in %siterator_044.php on line %d
+NULL
+===1===
+object(stdClass)#%d (0) {
+}
+
+Warning: CachingIterator::offsetExists() expects parameter 1 to be string, object given in %siterator_044.php on line %d
+NULL
+
+Warning: CachingIterator::offsetGet() expects parameter 1 to be string, object given in %siterator_044.php on line %d
+NULL
+===2===
+object(MyFoo)#%d (0) {
+}
+bool(false)
+
+Notice: Undefined index: foo in %siterator_044.php on line %d
+NULL
+===3===
+NULL
+bool(false)
+
+Notice: Undefined index: in %siterator_044.php on line %d
+NULL
+===4===
+int(2)
+bool(false)
+
+Notice: Undefined index: 2 in %siterator_044.php on line %d
+NULL
+===5===
+string(3) "foo"
+bool(false)
+
+Notice: Undefined index: foo in %siterator_044.php on line %d
+NULL
+===6===
+int(3)
+bool(false)
+
+Notice: Undefined index: 3 in %siterator_044.php on line %d
+NULL
+===FILL===
+===0===
+int(0)
+bool(true)
+int(0)
+===1===
+object(stdClass)#1 (0) {
+}
+
+Warning: CachingIterator::offsetExists() expects parameter 1 to be string, object given in %siterator_044.php on line %d
+NULL
+
+Warning: CachingIterator::offsetGet() expects parameter 1 to be string, object given in %siterator_044.php on line %d
+NULL
+===2===
+object(MyFoo)#2 (0) {
+}
+bool(true)
+int(1)
+===3===
+NULL
+bool(false)
+
+Notice: Undefined index: in %siterator_044.php on line %d
+NULL
+===4===
+int(2)
+bool(true)
+int(4)
+===5===
+string(3) "foo"
+bool(true)
+int(1)
+===6===
+int(3)
+bool(false)
+
+Notice: Undefined index: 3 in %siterator_044.php on line %d
+NULL
+===DONE===
diff --git a/ext/spl/tests/iterator_045.phpt b/ext/spl/tests/iterator_045.phpt
new file mode 100755
index 000000000..ce29349cf
--- /dev/null
+++ b/ext/spl/tests/iterator_045.phpt
@@ -0,0 +1,171 @@
+--TEST--
+SPL: CachingIterator and offsetSet/Unset, getCache using flag FULL_CACHE
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyFoo
+{
+ function __toString()
+ {
+ return 'foo';
+ }
+}
+
+class MyCachingIterator extends CachingIterator
+{
+ function __construct(Iterator $it, $flags = 0)
+ {
+ parent::__construct($it, $flags);
+ }
+
+ function testSet($ar)
+ {
+ echo __METHOD__ . "()\n";
+ foreach($ar as $k => $v)
+ {
+ echo "set($k,$v)\n";
+ $this->offsetSet($k, $v);
+ }
+ }
+
+ function testUnset($ar)
+ {
+ echo __METHOD__ . "()\n";
+ foreach($ar as $k => $v)
+ {
+ echo "unset($v)\n";
+ $this->offsetUnset($v);
+ }
+ }
+
+ function fill()
+ {
+ echo __METHOD__ . "()\n";
+ foreach($this as $v) ;
+ }
+
+ function show()
+ {
+ echo __METHOD__ . "()\n";
+ var_dump($this->getCache());
+ }
+}
+
+$it = new MyCachingIterator(new ArrayIterator(array(0, 'foo'=>1, 2, 'bar'=>3, 4)));
+
+try
+{
+ var_dump($it->offsetSet(0, 0));
+}
+catch(Exception $e)
+{
+ echo "Exception: " . $e->getMessage() . "\n";
+}
+
+try
+{
+ var_dump($it->offsetUnset(0));
+}
+catch(Exception $e)
+{
+ echo "Exception: " . $e->getMessage() . "\n";
+}
+
+$it = new MyCachingIterator(new ArrayIterator(array(0, 1, 2, 3)), CachingIterator::FULL_CACHE);
+
+var_dump($it->offsetSet());
+var_dump($it->offsetSet(0));
+var_dump($it->offsetUnset());
+
+$checks = array(0 => 25, 1 => 42, 3 => 'FooBar');
+$unsets = array(0, 2);
+
+$it->testSet($checks);
+$it->show();
+$it->testUnset($unsets);
+$it->show();
+$it->fill();
+$it->show();
+$it->testSet($checks);
+$it->show();
+$it->testUnset($unsets);
+$it->show();
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct)
+Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct)
+
+Warning: CachingIterator::offsetSet() expects exactly 2 parameters, 0 given in %siterator_045.php on line %d
+NULL
+
+Warning: CachingIterator::offsetSet() expects exactly 2 parameters, 1 given in %siterator_045.php on line %d
+NULL
+
+Warning: CachingIterator::offsetUnset() expects exactly 1 parameter, 0 given in %siterator_045.php on line %d
+NULL
+MyCachingIterator::testSet()
+set(0,25)
+set(1,42)
+set(3,FooBar)
+MyCachingIterator::show()
+array(3) {
+ [0]=>
+ int(25)
+ [1]=>
+ int(42)
+ [3]=>
+ string(6) "FooBar"
+}
+MyCachingIterator::testUnset()
+unset(0)
+unset(2)
+MyCachingIterator::show()
+array(2) {
+ [1]=>
+ int(42)
+ [3]=>
+ string(6) "FooBar"
+}
+MyCachingIterator::fill()
+MyCachingIterator::show()
+array(4) {
+ [0]=>
+ int(0)
+ [1]=>
+ int(1)
+ [2]=>
+ int(2)
+ [3]=>
+ int(3)
+}
+MyCachingIterator::testSet()
+set(0,25)
+set(1,42)
+set(3,FooBar)
+MyCachingIterator::show()
+array(4) {
+ [0]=>
+ int(25)
+ [1]=>
+ int(42)
+ [2]=>
+ int(2)
+ [3]=>
+ string(6) "FooBar"
+}
+MyCachingIterator::testUnset()
+unset(0)
+unset(2)
+MyCachingIterator::show()
+array(2) {
+ [1]=>
+ int(42)
+ [3]=>
+ string(6) "FooBar"
+}
+===DONE===
diff --git a/ext/spl/tests/iterator_046.phpt b/ext/spl/tests/iterator_046.phpt
new file mode 100755
index 000000000..34d9c027b
--- /dev/null
+++ b/ext/spl/tests/iterator_046.phpt
@@ -0,0 +1,53 @@
+--TEST--
+SPL: CachingIterator and __toString using bypassed string keys
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyFoo
+{
+ function __toString()
+ {
+ return 'foo';
+ }
+}
+
+class MyCachingIterator extends CachingIterator
+{
+ function __construct(Iterator $it, $flags = 0)
+ {
+ parent::__construct($it, $flags);
+ }
+
+ function fill()
+ {
+ echo __METHOD__ . "()\n";
+ foreach($this as $v) ;
+ }
+
+ function show()
+ {
+ echo __METHOD__ . "()\n";
+ foreach($this as $v)
+ {
+ var_dump((string)$this);
+ }
+ }
+}
+
+$it = new MyCachingIterator(new ArrayIterator(array(0, 'foo'=>1, 'bar'=>2)), CachingIterator::TOSTRING_USE_KEY);
+
+$it->fill();
+$it->show();
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+MyCachingIterator::fill()
+MyCachingIterator::show()
+string(1) "0"
+string(3) "foo"
+string(3) "bar"
+===DONE===
diff --git a/ext/spl/tests/iterator_047.phpt b/ext/spl/tests/iterator_047.phpt
new file mode 100755
index 000000000..b313df301
--- /dev/null
+++ b/ext/spl/tests/iterator_047.phpt
@@ -0,0 +1,119 @@
+--TEST--
+SPL: RecursiveCachingIterator and exception in has/getChildren
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyRecursiveArrayIterator extends RecursiveArrayIterator
+{
+ static public $fail = 0;
+
+ static function fail($state, $method)
+ {
+ if (self::$fail == $state)
+ {
+ throw new Exception("State $state: $method()");
+ }
+ }
+
+ function hasChildren()
+ {
+ echo __METHOD__ . "()\n";
+ self::fail(1, __METHOD__);
+ return parent::hasChildren();
+ }
+
+ function getChildren()
+ {
+ echo __METHOD__ . "()\n";
+ self::fail(2, __METHOD__);
+ return parent::getChildren();
+ }
+}
+
+class MyRecursiveCachingIterator extends RecursiveCachingIterator
+{
+ function show()
+ {
+ MyRecursiveArrayIterator::$fail = 0;
+ while(MyRecursiveArrayIterator::$fail < 4)
+ {
+ echo "===" . MyRecursiveArrayIterator::$fail . "===\n";
+ try
+ {
+ foreach(new RecursiveIteratorIterator($this) as $k => $v)
+ {
+ var_dump($k);
+ var_dump($v);
+ }
+ }
+ catch (Exception $e)
+ {
+ echo "Exception: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . "\n";
+ }
+ MyRecursiveArrayIterator::$fail++;
+ }
+ }
+}
+
+$it = new MyRecursiveArrayIterator(array(0, array(10), 2, array(30), 4));
+$it = new MyRecursiveCachingIterator($it);
+
+$it->show();
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+===0===
+MyRecursiveArrayIterator::hasChildren()
+int(0)
+int(0)
+MyRecursiveArrayIterator::hasChildren()
+MyRecursiveArrayIterator::getChildren()
+MyRecursiveArrayIterator::hasChildren()
+int(0)
+int(10)
+MyRecursiveArrayIterator::hasChildren()
+int(2)
+int(2)
+MyRecursiveArrayIterator::hasChildren()
+MyRecursiveArrayIterator::getChildren()
+MyRecursiveArrayIterator::hasChildren()
+int(0)
+int(30)
+MyRecursiveArrayIterator::hasChildren()
+int(4)
+int(4)
+===1===
+MyRecursiveArrayIterator::hasChildren()
+Exception: State 1: MyRecursiveArrayIterator::hasChildren() in %siterator_047.php on line %d
+===2===
+MyRecursiveArrayIterator::hasChildren()
+int(0)
+int(0)
+MyRecursiveArrayIterator::hasChildren()
+MyRecursiveArrayIterator::getChildren()
+Exception: State 2: MyRecursiveArrayIterator::getChildren() in %siterator_047.php on line %d
+===3===
+MyRecursiveArrayIterator::hasChildren()
+int(0)
+int(0)
+MyRecursiveArrayIterator::hasChildren()
+MyRecursiveArrayIterator::getChildren()
+MyRecursiveArrayIterator::hasChildren()
+int(0)
+int(10)
+MyRecursiveArrayIterator::hasChildren()
+int(2)
+int(2)
+MyRecursiveArrayIterator::hasChildren()
+MyRecursiveArrayIterator::getChildren()
+MyRecursiveArrayIterator::hasChildren()
+int(0)
+int(30)
+MyRecursiveArrayIterator::hasChildren()
+int(4)
+int(4)
+===DONE===
diff --git a/ext/spl/tests/iterator_048.phpt b/ext/spl/tests/iterator_048.phpt
new file mode 100755
index 000000000..5e141d9c7
--- /dev/null
+++ b/ext/spl/tests/iterator_048.phpt
@@ -0,0 +1,38 @@
+--TEST--
+SPL: RecursiveRegexIterator and exception in has/getChildren
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyRecursiveRegexIterator extends RecursiveRegexIterator
+{
+ function show()
+ {
+ foreach(new RecursiveIteratorIterator($this) as $k => $v)
+ {
+ var_dump($k);
+ var_dump($v);
+ }
+ }
+
+ function accept()
+ {
+ return $this->hasChildren() || parent::accept();
+ }
+}
+
+$ar = new RecursiveArrayIterator(array('Foo', array('Bar'), 'FooBar', array('Baz'), 'Biz'));
+$it = new MyRecursiveRegexIterator($ar, '/Bar/');
+
+$it->show();
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+int(0)
+string(3) "Bar"
+int(2)
+string(6) "FooBar"
+===DONE===
diff --git a/ext/spl/tests/iterator_049.phpt b/ext/spl/tests/iterator_049.phpt
new file mode 100755
index 000000000..8e2564380
--- /dev/null
+++ b/ext/spl/tests/iterator_049.phpt
@@ -0,0 +1,24 @@
+--TEST--
+SPL: ArrayIterator with NULL key
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+$ar = new ArrayIterator(array(NULL=>NULL));
+@var_dump($ar);
+var_dump($ar->getArrayCopy());
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+object(ArrayIterator)#%d (1) {
+ [""]=>
+ NULL
+}
+array(1) {
+ [""]=>
+ NULL
+}
+===DONE===
diff --git a/ext/spl/tests/iterator_049b.phpt b/ext/spl/tests/iterator_049b.phpt
new file mode 100755
index 000000000..9b894cd1c
--- /dev/null
+++ b/ext/spl/tests/iterator_049b.phpt
Binary files differ
diff --git a/ext/spl/tests/iterator_050.phpt b/ext/spl/tests/iterator_050.phpt
new file mode 100755
index 000000000..6bd84a3a8
--- /dev/null
+++ b/ext/spl/tests/iterator_050.phpt
@@ -0,0 +1,93 @@
+--TEST--
+SPL: RegexIterator::GET_MATCH
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyRegexIterator extends RegexIterator
+{
+ function show()
+ {
+ foreach($this as $k => $v)
+ {
+ var_dump($k);
+ var_dump($v);
+ }
+ }
+}
+
+$ar = new ArrayIterator(array('1','1,2','1,2,3','',NULL,array(),'FooBar',',',',,'));
+$it = new MyRegexIterator($ar, '/(\d),(\d)/', RegexIterator::GET_MATCH);
+$it->show();
+
+$it = new MyRegexIterator($ar, '/(\d)/', RegexIterator::GET_MATCH);
+$it->show();
+
+var_dump($ar);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+int(1)
+array(3) {
+ [0]=>
+ string(3) "1,2"
+ [1]=>
+ string(1) "1"
+ [2]=>
+ string(1) "2"
+}
+int(2)
+array(3) {
+ [0]=>
+ string(3) "1,2"
+ [1]=>
+ string(1) "1"
+ [2]=>
+ string(1) "2"
+}
+int(0)
+array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "1"
+}
+int(1)
+array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "1"
+}
+int(2)
+array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "1"
+}
+object(ArrayIterator)#%d (9) {
+ [0]=>
+ %s(1) "1"
+ [1]=>
+ %s(3) "1,2"
+ [2]=>
+ %s(5) "1,2,3"
+ [3]=>
+ %s(0) ""
+ [4]=>
+ NULL
+ [5]=>
+ array(0) {
+ }
+ [6]=>
+ %s(6) "FooBar"
+ [7]=>
+ %s(1) ","
+ [8]=>
+ %s(2) ",,"
+}
+===DONE===
diff --git a/ext/spl/tests/iterator_051.phpt b/ext/spl/tests/iterator_051.phpt
new file mode 100755
index 000000000..626d27474
--- /dev/null
+++ b/ext/spl/tests/iterator_051.phpt
@@ -0,0 +1,95 @@
+--TEST--
+SPL: RegexIterator::GET_MATCH, USE_KEY
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyRegexIterator extends RegexIterator
+{
+ function show()
+ {
+ foreach($this as $k => $v)
+ {
+ var_dump($k);
+ var_dump($v);
+ }
+ }
+}
+
+$ar = new ArrayIterator(array('1'=>0,'1,2'=>1,'1,2,3'=>2,0=>3,'FooBar'=>4,','=>5,',,'=>6));
+$it = new MyRegexIterator($ar, '/(\d),(\d)/', RegexIterator::GET_MATCH, RegexIterator::USE_KEY);
+$it->show();
+
+$it = new MyRegexIterator($ar, '/(\d)/', RegexIterator::GET_MATCH, RegexIterator::USE_KEY);
+$it->show();
+
+var_dump($ar);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(3) "1,2"
+array(3) {
+ [0]=>
+ string(3) "1,2"
+ [1]=>
+ string(1) "1"
+ [2]=>
+ string(1) "2"
+}
+string(5) "1,2,3"
+array(3) {
+ [0]=>
+ string(3) "1,2"
+ [1]=>
+ string(1) "1"
+ [2]=>
+ string(1) "2"
+}
+int(1)
+array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "1"
+}
+string(3) "1,2"
+array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "1"
+}
+string(5) "1,2,3"
+array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "1"
+}
+int(0)
+array(2) {
+ [0]=>
+ string(1) "0"
+ [1]=>
+ string(1) "0"
+}
+object(ArrayIterator)#%d (7) {
+ [1]=>
+ int(0)
+ ["1,2"]=>
+ int(1)
+ ["1,2,3"]=>
+ int(2)
+ [0]=>
+ int(3)
+ ["FooBar"]=>
+ int(4)
+ [","]=>
+ int(5)
+ [",,"]=>
+ int(6)
+}
+===DONE===
diff --git a/ext/spl/tests/iterator_052.phpt b/ext/spl/tests/iterator_052.phpt
new file mode 100755
index 000000000..9bd7d899e
--- /dev/null
+++ b/ext/spl/tests/iterator_052.phpt
@@ -0,0 +1,314 @@
+--TEST--
+SPL: RegexIterator::ALL_MATCHES
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyRegexIterator extends RegexIterator
+{
+ public $uk, $re;
+
+ function __construct($it, $re, $mode, $flags = 0)
+ {
+ $this->uk = $flags & self::USE_KEY;
+ $this->re = $re;
+ parent::__construct($it, $re, $mode, $flags);
+ }
+
+ function show()
+ {
+ foreach($this as $k => $v)
+ {
+ var_dump($k);
+ var_dump($v);
+ }
+ }
+
+ function accept()
+ {
+ @preg_match_all($this->re, (string)($this->uk ? $this->key() : $this->current()), $sub);
+ $ret = parent::accept();
+ var_dump($sub == $this->current());
+ return $ret;
+ }
+}
+
+$ar = new ArrayIterator(array('1','1,2','1,2,3','',NULL,array(),'FooBar',',',',,'));
+$it = new MyRegexIterator($ar, '/(\d),(\d)/', RegexIterator::ALL_MATCHES);
+$it->show();
+
+$it = new MyRegexIterator($ar, '/(\d)/', RegexIterator::ALL_MATCHES);
+$it->show();
+
+var_dump($ar);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+bool(true)
+int(0)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(1)
+array(3) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(3) "1,2"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "1"
+ }
+ [2]=>
+ array(1) {
+ [0]=>
+ string(1) "2"
+ }
+}
+bool(true)
+int(2)
+array(3) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(3) "1,2"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "1"
+ }
+ [2]=>
+ array(1) {
+ [0]=>
+ string(1) "2"
+ }
+}
+bool(true)
+int(3)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(4)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(5)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(6)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(7)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(8)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(0)
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "1"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "1"
+ }
+}
+bool(true)
+int(1)
+array(2) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "2"
+ }
+ [1]=>
+ array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "2"
+ }
+}
+bool(true)
+int(2)
+array(2) {
+ [0]=>
+ array(3) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "2"
+ [2]=>
+ string(1) "3"
+ }
+ [1]=>
+ array(3) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "2"
+ [2]=>
+ string(1) "3"
+ }
+}
+bool(true)
+int(3)
+array(2) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+}
+bool(true)
+int(4)
+array(2) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+}
+bool(true)
+int(5)
+array(2) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+}
+bool(true)
+int(6)
+array(2) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+}
+bool(true)
+int(7)
+array(2) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+}
+bool(true)
+int(8)
+array(2) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+}
+object(ArrayIterator)#%d (9) {
+ [0]=>
+ %s(1) "1"
+ [1]=>
+ %s(3) "1,2"
+ [2]=>
+ %s(5) "1,2,3"
+ [3]=>
+ %s(0) ""
+ [4]=>
+ NULL
+ [5]=>
+ array(0) {
+ }
+ [6]=>
+ %s(6) "FooBar"
+ [7]=>
+ %s(1) ","
+ [8]=>
+ %s(2) ",,"
+}
+===DONE===
diff --git a/ext/spl/tests/iterator_053.phpt b/ext/spl/tests/iterator_053.phpt
new file mode 100755
index 000000000..4d68b0113
--- /dev/null
+++ b/ext/spl/tests/iterator_053.phpt
@@ -0,0 +1,314 @@
+--TEST--
+SPL: RegexIterator::ALL_MATCHES
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyRegexIterator extends RegexIterator
+{
+ public $uk, $re;
+
+ function __construct($it, $re, $mode, $flags = 0)
+ {
+ $this->uk = $flags & self::USE_KEY;
+ $this->re = $re;
+ parent::__construct($it, $re, $mode, $flags);
+ }
+
+ function show()
+ {
+ foreach($this as $k => $v)
+ {
+ var_dump($k);
+ var_dump($v);
+ }
+ }
+
+ function accept()
+ {
+ @preg_match_all($this->re, (string)($this->uk ? $this->key() : $this->current()), $sub);
+ $ret = parent::accept();
+ var_dump($sub == $this->current());
+ return $ret;
+ }
+}
+
+$ar = new ArrayIterator(array('1','1,2','1,2,3','',NULL,array(),'FooBar',',',',,'));
+$it = new MyRegexIterator($ar, '/(\d),(\d)/', RegexIterator::ALL_MATCHES, RegexIterator::USE_KEY);
+$it->show();
+
+$it = new MyRegexIterator($ar, '/(\d)/', RegexIterator::ALL_MATCHES, RegexIterator::USE_KEY);
+$it->show();
+
+var_dump($ar);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+bool(true)
+int(0)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(1)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(2)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(3)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(4)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(5)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(6)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(7)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(8)
+array(3) {
+ [0]=>
+ array(0) {
+ }
+ [1]=>
+ array(0) {
+ }
+ [2]=>
+ array(0) {
+ }
+}
+bool(true)
+int(0)
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "0"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "0"
+ }
+}
+bool(true)
+int(1)
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "1"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "1"
+ }
+}
+bool(true)
+int(2)
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "2"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "2"
+ }
+}
+bool(true)
+int(3)
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "3"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "3"
+ }
+}
+bool(true)
+int(4)
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "4"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "4"
+ }
+}
+bool(true)
+int(5)
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "5"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "5"
+ }
+}
+bool(true)
+int(6)
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "6"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "6"
+ }
+}
+bool(true)
+int(7)
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "7"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "7"
+ }
+}
+bool(true)
+int(8)
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "8"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "8"
+ }
+}
+object(ArrayIterator)#%d (9) {
+ [0]=>
+ %s(1) "1"
+ [1]=>
+ %s(3) "1,2"
+ [2]=>
+ %s(5) "1,2,3"
+ [3]=>
+ %s(0) ""
+ [4]=>
+ NULL
+ [5]=>
+ array(0) {
+ }
+ [6]=>
+ %s(6) "FooBar"
+ [7]=>
+ %s(1) ","
+ [8]=>
+ %s(2) ",,"
+}
+===DONE===
diff --git a/ext/spl/tests/iterator_054.phpt b/ext/spl/tests/iterator_054.phpt
new file mode 100755
index 000000000..3f724697a
--- /dev/null
+++ b/ext/spl/tests/iterator_054.phpt
@@ -0,0 +1,84 @@
+--TEST--
+SPL: RegexIterator::SPLIT
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyRegexIterator extends RegexIterator
+{
+ function show()
+ {
+ foreach($this as $k => $v)
+ {
+ var_dump($k);
+ var_dump($v);
+ }
+ }
+}
+
+$ar = new ArrayIterator(array('1','1,2','1,2,3','',NULL,array(),'FooBar',',',',,'));
+$it = new MyRegexIterator($ar, '/,/', RegexIterator::SPLIT);
+
+$it->show();
+
+var_dump($ar);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+int(1)
+array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "2"
+}
+int(2)
+array(3) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "2"
+ [2]=>
+ string(1) "3"
+}
+int(7)
+array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(0) ""
+}
+int(8)
+array(3) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(0) ""
+ [2]=>
+ string(0) ""
+}
+object(ArrayIterator)#%d (9) {
+ [0]=>
+ %s(1) "1"
+ [1]=>
+ %s(3) "1,2"
+ [2]=>
+ %s(5) "1,2,3"
+ [3]=>
+ %s(0) ""
+ [4]=>
+ NULL
+ [5]=>
+ array(0) {
+ }
+ [6]=>
+ %s(6) "FooBar"
+ [7]=>
+ %s(1) ","
+ [8]=>
+ %s(2) ",,"
+}
+===DONE===
diff --git a/ext/spl/tests/iterator_055.phpt b/ext/spl/tests/iterator_055.phpt
new file mode 100755
index 000000000..35a050c39
--- /dev/null
+++ b/ext/spl/tests/iterator_055.phpt
@@ -0,0 +1,61 @@
+--TEST--
+SPL: RegexIterator::SPLIT, USE_KEY
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class MyRegexIterator extends RegexIterator
+{
+ function show()
+ {
+ foreach($this as $k => $v)
+ {
+ var_dump($k);
+ var_dump($v);
+ }
+ }
+}
+
+$ar = new ArrayIterator(array('1'=>0,'1,2'=>1,'1,2,3'=>2,0=>3,'FooBar'=>4,','=>5,',,'=>6));
+$it = new MyRegexIterator($ar, '/(\d),(\d)/', RegexIterator::SPLIT, RegexIterator::USE_KEY);
+
+$it->show();
+
+var_dump($ar);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(3) "1,2"
+array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(0) ""
+}
+string(5) "1,2,3"
+array(2) {
+ [0]=>
+ string(0) ""
+ [1]=>
+ string(2) ",3"
+}
+object(ArrayIterator)#%d (7) {
+ [1]=>
+ int(0)
+ ["1,2"]=>
+ int(1)
+ ["1,2,3"]=>
+ int(2)
+ [0]=>
+ int(3)
+ ["FooBar"]=>
+ int(4)
+ [","]=>
+ int(5)
+ [",,"]=>
+ int(6)
+}
+===DONE===
diff --git a/ext/spl/tests/spl_004.phpt b/ext/spl/tests/spl_004.phpt
new file mode 100755
index 000000000..60da28042
--- /dev/null
+++ b/ext/spl/tests/spl_004.phpt
@@ -0,0 +1,86 @@
+--TEST--
+SPL: iterator_apply()
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+function my_error_handler($errno, $errstr, $errfile, $errline) {
+ echo "Error: $errstr\n";
+}
+
+set_error_handler('my_error_handler');
+
+function test_arg($arg)
+{
+ if ($arg instanceof Iterator)
+ {
+ var_dump($arg->key());
+ var_dump($arg->current());
+ }
+ else
+ {
+ var_dump($arg);
+ }
+ return true;
+}
+
+function test()
+{
+ static $arg = 0;
+ var_dump($arg++);
+ return true;
+}
+
+$it = new RecursiveArrayIterator(array(1, array(21, 22), 3));
+
+var_dump(iterator_apply($it, 'test', NULL));
+
+echo "===ARGS===\n";
+var_dump(iterator_apply($it, 'test_arg', array($it)));
+
+echo "===RECURSIVE===\n";
+$it = new RecursiveIteratorIterator($it);
+var_dump(iterator_apply($it, 'test'));
+
+echo "===ERRORS===\n";
+var_dump(iterator_apply($it, 'test', 1));
+var_dump(iterator_apply($it, 'non_existing_functon'));
+var_dump(iterator_apply($it, 'non_existing_functon', NULL, 2));
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+int(0)
+int(1)
+int(2)
+int(3)
+===ARGS===
+int(0)
+int(1)
+int(1)
+array(2) {
+ [0]=>
+ int(21)
+ [1]=>
+ int(22)
+}
+int(2)
+int(3)
+int(3)
+===RECURSIVE===
+int(3)
+int(4)
+int(5)
+int(6)
+int(4)
+===ERRORS===
+Error: Argument 3 passed to iterator_apply() must be an array, integer given
+Error: iterator_apply() expects parameter 3 to be array, integer given
+NULL
+Error: iterator_apply() expects parameter 2 to be function,%sstring given
+NULL
+Error: iterator_apply() expects at most 3 parameters, 4 given
+NULL
+===DONE===
diff --git a/ext/spl/tests/spl_005.phpt b/ext/spl/tests/spl_005.phpt
new file mode 100755
index 000000000..bb297bb6b
--- /dev/null
+++ b/ext/spl/tests/spl_005.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SPL: spl_object_hash()
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(spl_object_hash(new stdClass));
+var_dump(spl_object_hash(42));
+var_dump(spl_object_hash());
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(32) "%s"
+
+Warning: spl_object_hash() expects parameter 1 to be object, integer given in %sspl_005.php on line %d
+NULL
+
+Warning: spl_object_hash() expects exactly 1 parameter, 0 given in %sspl_005.php on line %d
+NULL
+===DONE===
diff --git a/ext/sqlite/libsqlite/src/vdbe.c b/ext/sqlite/libsqlite/src/vdbe.c
index 66aaccfc9..b540bdd22 100644
--- a/ext/sqlite/libsqlite/src/vdbe.c
+++ b/ext/sqlite/libsqlite/src/vdbe.c
@@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
-** $Id: vdbe.c,v 1.7.4.1 2005/09/07 15:11:33 iliaa Exp $
+** $Id: vdbe.c,v 1.7.4.1.2.1 2006/09/09 10:59:05 tony2001 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -114,7 +114,7 @@ int sqlite_step(
sqlite *db;
int rc;
- if( p->magic!=VDBE_MAGIC_RUN ){
+ if( !p || p->magic!=VDBE_MAGIC_RUN ){
return SQLITE_MISUSE;
}
db = p->db;
diff --git a/ext/sqlite/pdo_sqlite2.c b/ext/sqlite/pdo_sqlite2.c
index 07a8e1d3f..ac5d10ebd 100644
--- a/ext/sqlite/pdo_sqlite2.c
+++ b/ext/sqlite/pdo_sqlite2.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_sqlite2.c,v 1.6.2.3 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: pdo_sqlite2.c,v 1.6.2.3.2.1 2006/09/16 18:10:32 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -518,6 +518,10 @@ 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 (!fullpath) {
+ return NULL;
+ }
+
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
efree(fullpath);
return NULL;
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index 0686199ae..f5731ded8 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -17,7 +17,7 @@
| Marcus Boerger <helly@php.net> |
+----------------------------------------------------------------------+
- $Id: sqlite.c,v 1.166.2.13 2006/04/18 14:30:15 iliaa Exp $
+ $Id: sqlite.c,v 1.166.2.13.2.5 2006/10/20 21:28:31 tony2001 Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -62,6 +62,7 @@ extern pdo_driver_t pdo_sqlite2_driver;
#endif
ZEND_DECLARE_MODULE_GLOBALS(sqlite)
+static PHP_GINIT_FUNCTION(sqlite);
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
extern ps_module ps_mod_sqlite;
@@ -207,61 +208,61 @@ zend_function_entry sqlite_functions[] = {
};
zend_function_entry sqlite_funcs_db[] = {
- PHP_ME_MAPPING(__construct, sqlite_open, third_arg_force_ref)
-/* PHP_ME_MAPPING(close, sqlite_close, NULL)*/
- PHP_ME_MAPPING(query, sqlite_query, third_arg_force_ref)
- PHP_ME_MAPPING(queryExec, sqlite_exec, second_arg_force_ref)
- PHP_ME_MAPPING(arrayQuery, sqlite_array_query, NULL)
- PHP_ME_MAPPING(singleQuery, sqlite_single_query, NULL)
- PHP_ME_MAPPING(unbufferedQuery, sqlite_unbuffered_query, third_arg_force_ref)
- PHP_ME_MAPPING(lastInsertRowid, sqlite_last_insert_rowid, NULL)
- PHP_ME_MAPPING(changes, sqlite_changes, NULL)
- PHP_ME_MAPPING(createAggregate, sqlite_create_aggregate, NULL)
- PHP_ME_MAPPING(createFunction, sqlite_create_function, NULL)
- PHP_ME_MAPPING(busyTimeout, sqlite_busy_timeout, NULL)
- PHP_ME_MAPPING(lastError, sqlite_last_error, NULL)
- PHP_ME_MAPPING(fetchColumnTypes, sqlite_fetch_column_types, NULL)
-/* PHP_ME_MAPPING(error_string, sqlite_error_string, NULL) static */
-/* PHP_ME_MAPPING(escape_string, sqlite_escape_string, NULL) static */
+ PHP_ME_MAPPING(__construct, sqlite_open, third_arg_force_ref, 0)
+/* PHP_ME_MAPPING(close, sqlite_close, NULL, 0)*/
+ PHP_ME_MAPPING(query, sqlite_query, third_arg_force_ref, 0)
+ PHP_ME_MAPPING(queryExec, sqlite_exec, second_arg_force_ref, 0)
+ PHP_ME_MAPPING(arrayQuery, sqlite_array_query, NULL, 0)
+ PHP_ME_MAPPING(singleQuery, sqlite_single_query, NULL, 0)
+ PHP_ME_MAPPING(unbufferedQuery, sqlite_unbuffered_query, third_arg_force_ref, 0)
+ PHP_ME_MAPPING(lastInsertRowid, sqlite_last_insert_rowid, NULL, 0)
+ PHP_ME_MAPPING(changes, sqlite_changes, NULL, 0)
+ PHP_ME_MAPPING(createAggregate, sqlite_create_aggregate, NULL, 0)
+ PHP_ME_MAPPING(createFunction, sqlite_create_function, NULL, 0)
+ PHP_ME_MAPPING(busyTimeout, sqlite_busy_timeout, NULL, 0)
+ PHP_ME_MAPPING(lastError, sqlite_last_error, NULL, 0)
+ PHP_ME_MAPPING(fetchColumnTypes, sqlite_fetch_column_types, NULL, 0)
+/* PHP_ME_MAPPING(error_string, sqlite_error_string, NULL, 0) static */
+/* PHP_ME_MAPPING(escape_string, sqlite_escape_string, NULL, 0) static */
{NULL, NULL, NULL}
};
zend_function_entry sqlite_funcs_query[] = {
- PHP_ME_MAPPING(fetch, sqlite_fetch_array, NULL)
- PHP_ME_MAPPING(fetchObject, sqlite_fetch_object, NULL)
- PHP_ME_MAPPING(fetchSingle, sqlite_fetch_single, NULL)
- PHP_ME_MAPPING(fetchAll, sqlite_fetch_all, NULL)
- PHP_ME_MAPPING(column, sqlite_column, NULL)
- PHP_ME_MAPPING(numFields, sqlite_num_fields, NULL)
- PHP_ME_MAPPING(fieldName, sqlite_field_name, NULL)
+ PHP_ME_MAPPING(fetch, sqlite_fetch_array, NULL, 0)
+ PHP_ME_MAPPING(fetchObject, sqlite_fetch_object, NULL, 0)
+ PHP_ME_MAPPING(fetchSingle, sqlite_fetch_single, NULL, 0)
+ PHP_ME_MAPPING(fetchAll, sqlite_fetch_all, NULL, 0)
+ PHP_ME_MAPPING(column, sqlite_column, NULL, 0)
+ PHP_ME_MAPPING(numFields, sqlite_num_fields, NULL, 0)
+ PHP_ME_MAPPING(fieldName, sqlite_field_name, NULL, 0)
/* iterator */
- PHP_ME_MAPPING(current, sqlite_current, NULL)
- PHP_ME_MAPPING(key, sqlite_key, NULL)
- PHP_ME_MAPPING(next, sqlite_next, NULL)
- PHP_ME_MAPPING(valid, sqlite_valid, NULL)
- PHP_ME_MAPPING(rewind, sqlite_rewind, NULL)
+ PHP_ME_MAPPING(current, sqlite_current, NULL, 0)
+ PHP_ME_MAPPING(key, sqlite_key, NULL, 0)
+ PHP_ME_MAPPING(next, sqlite_next, NULL, 0)
+ PHP_ME_MAPPING(valid, sqlite_valid, NULL, 0)
+ PHP_ME_MAPPING(rewind, sqlite_rewind, NULL, 0)
/* countable */
- PHP_ME_MAPPING(count, sqlite_num_rows, NULL)
+ PHP_ME_MAPPING(count, sqlite_num_rows, NULL, 0)
/* additional */
- PHP_ME_MAPPING(prev, sqlite_prev, NULL)
- PHP_ME_MAPPING(hasPrev, sqlite_has_prev, NULL)
- PHP_ME_MAPPING(numRows, sqlite_num_rows, NULL)
- PHP_ME_MAPPING(seek, sqlite_seek, NULL)
+ PHP_ME_MAPPING(prev, sqlite_prev, NULL, 0)
+ PHP_ME_MAPPING(hasPrev, sqlite_has_prev, NULL, 0)
+ PHP_ME_MAPPING(numRows, sqlite_num_rows, NULL, 0)
+ PHP_ME_MAPPING(seek, sqlite_seek, NULL, 0)
{NULL, NULL, NULL}
};
zend_function_entry sqlite_funcs_ub_query[] = {
- PHP_ME_MAPPING(fetch, sqlite_fetch_array, NULL)
- PHP_ME_MAPPING(fetchObject, sqlite_fetch_object, NULL)
- PHP_ME_MAPPING(fetchSingle, sqlite_fetch_single, NULL)
- PHP_ME_MAPPING(fetchAll, sqlite_fetch_all, NULL)
- PHP_ME_MAPPING(column, sqlite_column, NULL)
- PHP_ME_MAPPING(numFields, sqlite_num_fields, NULL)
- PHP_ME_MAPPING(fieldName, sqlite_field_name, NULL)
+ PHP_ME_MAPPING(fetch, sqlite_fetch_array, NULL, 0)
+ PHP_ME_MAPPING(fetchObject, sqlite_fetch_object, NULL, 0)
+ PHP_ME_MAPPING(fetchSingle, sqlite_fetch_single, NULL, 0)
+ PHP_ME_MAPPING(fetchAll, sqlite_fetch_all, NULL, 0)
+ PHP_ME_MAPPING(column, sqlite_column, NULL, 0)
+ PHP_ME_MAPPING(numFields, sqlite_num_fields, NULL, 0)
+ PHP_ME_MAPPING(fieldName, sqlite_field_name, NULL, 0)
/* iterator */
- PHP_ME_MAPPING(current, sqlite_current, NULL)
- PHP_ME_MAPPING(next, sqlite_next, NULL)
- PHP_ME_MAPPING(valid, sqlite_valid, NULL)
+ PHP_ME_MAPPING(current, sqlite_current, NULL, 0)
+ PHP_ME_MAPPING(next, sqlite_next, NULL, 0)
+ PHP_ME_MAPPING(valid, sqlite_valid, NULL, 0)
{NULL, NULL, NULL}
};
@@ -300,7 +301,15 @@ zend_module_entry sqlite_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
PHP_SQLITE_MODULE_VERSION,
#endif
+#if ZEND_MODULE_API_NO >= 20060613
+ PHP_MODULE_GLOBALS(sqlite),
+ PHP_GINIT(sqlite),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
+#else
STANDARD_MODULE_PROPERTIES
+#endif
};
@@ -998,12 +1007,15 @@ zend_object_iterator_funcs sqlite_query_iterator_funcs = {
sqlite_iterator_rewind
};
-zend_object_iterator *sqlite_get_iterator(zend_class_entry *ce, zval *object TSRMLS_DC)
+zend_object_iterator *sqlite_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
{
sqlite_object_iterator *iterator = emalloc(sizeof(sqlite_object_iterator));
sqlite_object *obj = (sqlite_object*) zend_object_store_get_object(object TSRMLS_CC);
+ if (by_ref) {
+ zend_error(E_RECOVERABLE_ERROR, "An iterator cannot be used with foreach by reference");
+ }
object->refcount++;
iterator->it.data = (void*)object;
iterator->it.funcs = ce->iterator_funcs.funcs;
@@ -1013,10 +1025,9 @@ zend_object_iterator *sqlite_get_iterator(zend_class_entry *ce, zval *object TSR
}
/* }}} */
-static int init_sqlite_globals(zend_sqlite_globals *g)
+static PHP_GINIT_FUNCTION(sqlite)
{
- g->assoc_case = 0;
- return SUCCESS;
+ sqlite_globals->assoc_case = 0;
}
PHP_MINIT_FUNCTION(sqlite)
@@ -1027,7 +1038,7 @@ PHP_MINIT_FUNCTION(sqlite)
#if defined(HAVE_SPL) && ((PHP_MAJOR_VERSION > 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1))
REGISTER_SQLITE_CLASS(Exception, exception, spl_ce_RuntimeException);
#else
- REGISTER_SQLITE_CLASS(Exception, exception, zend_exception_get_default());
+ REGISTER_SQLITE_CLASS(Exception, exception, zend_exception_get_default(TSRMLS_C));
#endif
sqlite_ce_db->ce_flags &= ~ZEND_ACC_FINAL_CLASS;
@@ -1048,8 +1059,6 @@ PHP_MINIT_FUNCTION(sqlite)
sqlite_ce_query->get_iterator = sqlite_get_iterator;
sqlite_ce_query->iterator_funcs.funcs = &sqlite_query_iterator_funcs;
- ZEND_INIT_MODULE_GLOBALS(sqlite, init_sqlite_globals, NULL);
-
REGISTER_INI_ENTRIES();
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
@@ -1124,7 +1133,7 @@ PHP_MINFO_FUNCTION(sqlite)
{
php_info_print_table_start();
php_info_print_table_header(2, "SQLite support", "enabled");
- php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13 2006/04/18 14:30:15 iliaa Exp $");
+ php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.166.2.13.2.5 2006/10/20 21:28:31 tony2001 Exp $");
php_info_print_table_row(2, "SQLite Library", sqlite_libversion());
php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding());
php_info_print_table_end();
@@ -1228,13 +1237,13 @@ PHP_FUNCTION(sqlite_popen)
if (strncmp(filename, ":memory:", sizeof(":memory:") - 1)) {
/* resolve the fully-qualified path name to use as the hash key */
- fullpath = expand_filepath(filename, NULL TSRMLS_CC);
-
- if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) {
RETURN_FALSE;
}
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) ||
+ php_check_open_basedir(fullpath TSRMLS_CC)) {
+ efree(fullpath);
RETURN_FALSE;
}
} else {
@@ -1304,11 +1313,8 @@ PHP_FUNCTION(sqlite_open)
if (strncmp(filename, ":memory:", sizeof(":memory:") - 1)) {
/* resolve the fully-qualified path name to use as the hash key */
- fullpath = expand_filepath(filename, NULL TSRMLS_CC);
-
- if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) {
php_std_error_handling();
- efree(fullpath);
if (object) {
RETURN_NULL();
} else {
@@ -1316,7 +1322,8 @@ PHP_FUNCTION(sqlite_open)
}
}
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) ||
+ php_check_open_basedir(fullpath TSRMLS_CC)) {
php_std_error_handling();
efree(fullpath);
if (object) {
@@ -1325,7 +1332,6 @@ PHP_FUNCTION(sqlite_open)
RETURN_FALSE;
}
}
-
}
php_sqlite_open(fullpath ? fullpath : filename, (int)mode, NULL, return_value, errmsg, object TSRMLS_CC);
@@ -1359,15 +1365,13 @@ PHP_FUNCTION(sqlite_factory)
if (strncmp(filename, ":memory:", sizeof(":memory:") - 1)) {
/* resolve the fully-qualified path name to use as the hash key */
- fullpath = expand_filepath(filename, NULL TSRMLS_CC);
-
- if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
- efree(fullpath);
+ if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) {
php_std_error_handling();
RETURN_NULL();
}
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ if ((PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) ||
+ php_check_open_basedir(fullpath TSRMLS_CC)) {
efree(fullpath);
php_std_error_handling();
RETURN_NULL();
diff --git a/ext/sqlite/tests/bug38759.phpt b/ext/sqlite/tests/bug38759.phpt
new file mode 100644
index 000000000..ae5959d4b
--- /dev/null
+++ b/ext/sqlite/tests/bug38759.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #38759 (sqlite2 empty query causes segfault)
+--SKIPIF--
+<?php
+if (!extension_loaded("pdo")) print "skip";
+if (!extension_loaded("sqlite")) print "skip";
+?>
+--FILE--
+<?php
+
+$dbh = new PDO('sqlite2::memory:');
+var_dump($dbh->query(" "));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(false)
+Done
diff --git a/ext/standard/array.c b/ext/standard/array.c
index fc698fd2d..843327dc2 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.308.2.22 2006/06/03 18:59:55 andrei Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.14 2006/10/03 17:41:47 iliaa Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -224,7 +224,7 @@ static int array_reverse_key_compare(const void *a, const void *b TSRMLS_DC)
return array_key_compare(a, b TSRMLS_CC) * -1;
}
-/* {{{ proto bool krsort(array array_arg [, int sort_flags])
+/* {{{ proto bool krsort(array &array_arg [, int sort_flags])
Sort an array by key value in reverse order */
PHP_FUNCTION(krsort)
{
@@ -246,7 +246,7 @@ PHP_FUNCTION(krsort)
}
/* }}} */
-/* {{{ proto bool ksort(array array_arg [, int sort_flags])
+/* {{{ proto bool ksort(array &array_arg [, int sort_flags])
Sort an array by key */
PHP_FUNCTION(ksort)
{
@@ -459,7 +459,7 @@ static void php_natsort(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
}
-/* {{{ proto void natsort(array array_arg)
+/* {{{ proto void natsort(array &array_arg)
Sort an array using natural sort */
PHP_FUNCTION(natsort)
{
@@ -468,7 +468,7 @@ PHP_FUNCTION(natsort)
/* }}} */
-/* {{{ proto void natcasesort(array array_arg)
+/* {{{ proto void natcasesort(array &array_arg)
Sort an array using case-insensitive natural sort */
PHP_FUNCTION(natcasesort)
{
@@ -477,7 +477,7 @@ PHP_FUNCTION(natcasesort)
/* }}} */
-/* {{{ proto bool asort(array array_arg [, int sort_flags])
+/* {{{ proto bool asort(array &array_arg [, int sort_flags])
Sort an array and maintain index association */
PHP_FUNCTION(asort)
{
@@ -499,7 +499,7 @@ PHP_FUNCTION(asort)
}
/* }}} */
-/* {{{ proto bool arsort(array array_arg [, int sort_flags])
+/* {{{ proto bool arsort(array &array_arg [, int sort_flags])
Sort an array in reverse order and maintain index association */
PHP_FUNCTION(arsort)
{
@@ -521,7 +521,7 @@ PHP_FUNCTION(arsort)
}
/* }}} */
-/* {{{ proto bool sort(array array_arg [, int sort_flags])
+/* {{{ proto bool sort(array &array_arg [, int sort_flags])
Sort an array */
PHP_FUNCTION(sort)
{
@@ -543,7 +543,7 @@ PHP_FUNCTION(sort)
}
/* }}} */
-/* {{{ proto bool rsort(array array_arg [, int sort_flags])
+/* {{{ proto bool rsort(array &array_arg [, int sort_flags])
Sort an array in reverse order */
PHP_FUNCTION(rsort)
{
@@ -1131,32 +1131,28 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive
Apply a user function to every member of an array */
PHP_FUNCTION(array_walk)
{
- int argc;
- zval **array,
- **userdata = NULL,
+ zval *array,
+ *userdata = NULL,
+ *tmp,
**old_walk_func_name;
HashTable *target_hash;
- argc = ZEND_NUM_ARGS();
old_walk_func_name = BG(array_walk_func_name);
- if (argc < 2 || argc > 3 ||
- zend_get_parameters_ex(argc, &array, &BG(array_walk_func_name), &userdata) == FAILURE) {
- BG(array_walk_func_name) = old_walk_func_name;
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z", &array, &tmp, &userdata) == FAILURE) {
+ return;
}
- target_hash = HASH_OF(*array);
+ target_hash = HASH_OF(array);
if (!target_hash) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array");
- BG(array_walk_func_name) = old_walk_func_name;
RETURN_FALSE;
}
- if (Z_TYPE_PP(BG(array_walk_func_name)) != IS_ARRAY &&
- Z_TYPE_PP(BG(array_walk_func_name)) != IS_STRING) {
+ if (Z_TYPE_P(tmp) != IS_ARRAY && Z_TYPE_P(tmp) != IS_STRING) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong syntax for function name");
- BG(array_walk_func_name) = old_walk_func_name;
RETURN_FALSE;
+ } else {
+ BG(array_walk_func_name) = &tmp;
}
- php_array_walk(target_hash, userdata, 0 TSRMLS_CC);
+ php_array_walk(target_hash, userdata ? &userdata: NULL, 0 TSRMLS_CC);
BG(array_walk_func_name) = old_walk_func_name;
RETURN_TRUE;
}
@@ -1166,32 +1162,28 @@ PHP_FUNCTION(array_walk)
Apply a user function recursively to every member of an array */
PHP_FUNCTION(array_walk_recursive)
{
- int argc;
- zval **array,
- **userdata = NULL,
+ zval *array,
+ *userdata = NULL,
+ *tmp,
**old_walk_func_name;
HashTable *target_hash;
- argc = ZEND_NUM_ARGS();
old_walk_func_name = BG(array_walk_func_name);
-
- if (argc < 2 || argc > 3 ||
- zend_get_parameters_ex(argc, &array, &BG(array_walk_func_name), &userdata) == FAILURE) {
- BG(array_walk_func_name) = old_walk_func_name;
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z", &array, &tmp, &userdata) == FAILURE) {
+ return;
}
- target_hash = HASH_OF(*array);
+ target_hash = HASH_OF(array);
if (!target_hash) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array");
- BG(array_walk_func_name) = old_walk_func_name;
RETURN_FALSE;
}
- if (Z_TYPE_PP(BG(array_walk_func_name)) != IS_ARRAY && Z_TYPE_PP(BG(array_walk_func_name)) != IS_STRING) {
+ if (Z_TYPE_P(tmp) != IS_ARRAY && Z_TYPE_P(tmp) != IS_STRING) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong syntax for function name");
- BG(array_walk_func_name) = old_walk_func_name;
RETURN_FALSE;
+ } else {
+ BG(array_walk_func_name) = &tmp;
}
- php_array_walk(target_hash, userdata, 1 TSRMLS_CC);
+ php_array_walk(target_hash, userdata ? &userdata : NULL, 1 TSRMLS_CC);
BG(array_walk_func_name) = old_walk_func_name;
RETURN_TRUE;
}
@@ -1515,6 +1507,9 @@ PHP_FUNCTION(compact)
zval ***args; /* function arguments array */
int i;
+ if (ZEND_NUM_ARGS() < 1) {
+ WRONG_PARAM_COUNT;
+ }
args = (zval ***)safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval **), 0);
if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
@@ -1579,6 +1574,49 @@ PHP_FUNCTION(array_fill)
}
/* }}} */
+/* {{{ proto array array_fill_keys(array keys, mixed val)
+ Create an array using the elements of the first parameter as keys each initialized to val */
+PHP_FUNCTION(array_fill_keys)
+{
+ zval *keys, *val, **entry;
+ HashPosition pos;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "az", &keys, &val) == FAILURE) {
+ return;
+ }
+
+ /* Initialize return array */
+ array_init(return_value);
+
+ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(keys), &pos);
+ while (zend_hash_get_current_data_ex(Z_ARRVAL_P(keys), (void **)&entry, &pos) == SUCCESS) {
+
+ if (Z_TYPE_PP(entry) == IS_LONG) {
+ zval_add_ref(&val);
+ zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_PP(entry), &val, sizeof(zval *), NULL);
+ } else {
+ zval key, *key_ptr = *entry;
+
+ if (Z_TYPE_PP(entry) != IS_STRING) {
+ key = **entry;
+ zval_copy_ctor(&key);
+ convert_to_string(&key);
+ key_ptr = &key;
+ }
+
+ zval_add_ref(&val);
+ zend_symtable_update(Z_ARRVAL_P(return_value), Z_STRVAL_P(key_ptr), Z_STRLEN_P(key_ptr) + 1, &val, sizeof(zval *), NULL);
+
+ if (key_ptr != *entry) {
+ zval_dtor(&key);
+ }
+ }
+
+ zend_hash_move_forward_ex(Z_ARRVAL_P(keys), &pos);
+ }
+}
+/* }}} */
+
/* {{{ proto array range(mixed low, mixed high[, int step])
Create an array containing the range of integers or characters from low to high (inclusive) */
PHP_FUNCTION(range)
@@ -1720,7 +1758,6 @@ err:
}
/* }}} */
-
static void array_data_shuffle(zval *array TSRMLS_DC)
{
Bucket **elems, *temp;
@@ -2151,7 +2188,7 @@ PHP_FUNCTION(array_splice)
/* }}} */
-/* {{{ proto array array_slice(array input, int offset [, int length])
+/* {{{ proto array array_slice(array input, int offset [, int length [, bool preserve_keys]])
Returns elements specified by offset and length */
PHP_FUNCTION(array_slice)
{
@@ -2286,7 +2323,7 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src, int recursive TSRMLS
} else {
(*src_entry)->refcount++;
- zend_hash_update(dest, string_key, strlen(string_key)+1,
+ zend_hash_update(dest, string_key, string_key_len,
src_entry, sizeof(zval *), NULL);
}
break;
@@ -2506,46 +2543,17 @@ PHP_FUNCTION(array_count_values)
(void**)&tmp) == FAILURE) {
zval *data;
MAKE_STD_ZVAL(data);
- Z_TYPE_P(data) = IS_LONG;
- Z_LVAL_P(data) = 1;
+ ZVAL_LONG(data, 1);
zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_PP(entry), &data, sizeof(data), NULL);
} else {
Z_LVAL_PP(tmp)++;
}
} else if (Z_TYPE_PP(entry) == IS_STRING) {
- /* make sure our array does not end up with numeric string keys
- * but don't touch those strings that start with 0 */
- if (!(Z_STRLEN_PP(entry) > 1 && Z_STRVAL_PP(entry)[0] == '0') && is_numeric_string(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, NULL, 0) == IS_LONG) {
- zval tmp_entry;
-
- tmp_entry = **entry;
- zval_copy_ctor(&tmp_entry);
-
- convert_to_long(&tmp_entry);
-
- if (zend_hash_index_find(Z_ARRVAL_P(return_value),
- Z_LVAL(tmp_entry),
- (void**)&tmp) == FAILURE) {
- zval *data;
- MAKE_STD_ZVAL(data);
- Z_TYPE_P(data) = IS_LONG;
- Z_LVAL_P(data) = 1;
- zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL(tmp_entry), &data, sizeof(data), NULL);
- } else {
- Z_LVAL_PP(tmp)++;
- }
-
- zval_dtor(&tmp_entry);
- zend_hash_move_forward_ex(myht, &pos);
- continue;
- }
-
- if (zend_hash_find(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry)+1, (void**)&tmp) == FAILURE) {
+ if (zend_symtable_find(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, (void**)&tmp) == FAILURE) {
zval *data;
MAKE_STD_ZVAL(data);
- Z_TYPE_P(data) = IS_LONG;
- Z_LVAL_P(data) = 1;
- zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &data, sizeof(data), NULL);
+ ZVAL_LONG(data, 1);
+ zend_symtable_update(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &data, sizeof(data), NULL);
} else {
Z_LVAL_PP(tmp)++;
}
@@ -3047,7 +3055,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
zval *tmp;
ALLOC_HASHTABLE(ht);
- zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(ht, zend_hash_num_elements(return_value->value.ht), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(ht, return_value->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
return_value->value.ht = ht;
}
@@ -3179,6 +3187,7 @@ PHP_FUNCTION(array_intersect_key)
php_array_intersect(INTERNAL_FUNCTION_PARAM_PASSTHRU, INTERSECT_KEY,
INTERSECT_COMP_DATA_INTERNAL, INTERSECT_COMP_KEY_INTERNAL);
}
+/* }}} */
/* {{{ proto array array_intersect_ukey(array arr1, array arr2 [, array ...], callback key_compare_func)
Returns the entries of arr1 that have keys which are present in all the other arguments. Kind of equivalent to array_diff(array_keys($arr1), array_keys($arr2)[,array_keys(...)]). The comparison of the keys is performed by a user supplied function. Equivalent of array_intersect_uassoc() but does not do compare of the data. */
@@ -3187,7 +3196,7 @@ PHP_FUNCTION(array_intersect_ukey)
php_array_intersect(INTERNAL_FUNCTION_PARAM_PASSTHRU, INTERSECT_KEY,
INTERSECT_COMP_DATA_INTERNAL, INTERSECT_COMP_KEY_USER);
}
-
+/* }}} */
/* {{{ proto array array_intersect(array arr1, array arr2 [, array ...])
Returns the entries of arr1 that have values which are present in all the other arguments */
@@ -3432,7 +3441,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
zval *tmp;
ALLOC_HASHTABLE(ht);
- zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(ht, zend_hash_num_elements(return_value->value.ht), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(ht, return_value->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
return_value->value.ht = ht;
}
@@ -4479,7 +4488,7 @@ PHP_FUNCTION(array_chunk)
/* }}} */
/* {{{ proto array array_combine(array keys, array values)
- Creates an array by using the elements of the first parameter as keys and the elements of the second as correspoding keys */
+ Creates an array by using the elements of the first parameter as keys and the elements of the second as the corresponding values */
PHP_FUNCTION(array_combine)
{
zval *values, *keys;
@@ -4491,7 +4500,7 @@ PHP_FUNCTION(array_combine)
}
if (zend_hash_num_elements(Z_ARRVAL_P(keys)) != zend_hash_num_elements(Z_ARRVAL_P(values))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Both parameters should have equal number of elements");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Both parameters should have an equal number of elements");
RETURN_FALSE;
}
@@ -4508,7 +4517,7 @@ PHP_FUNCTION(array_combine)
zend_hash_get_current_data_ex(Z_ARRVAL_P(values), (void **)&entry_values, &pos_values) == SUCCESS) {
if (Z_TYPE_PP(entry_keys) == IS_STRING) {
zval_add_ref(entry_values);
- add_assoc_zval(return_value, Z_STRVAL_PP(entry_keys), *entry_values);
+ add_assoc_zval_ex(return_value, Z_STRVAL_PP(entry_keys), Z_STRLEN_PP(entry_keys)+1, *entry_values);
} else if (Z_TYPE_PP(entry_keys) == IS_LONG) {
zval_add_ref(entry_values);
add_index_zval(return_value, Z_LVAL_PP(entry_keys), *entry_values);
@@ -4520,7 +4529,7 @@ PHP_FUNCTION(array_combine)
convert_to_string(&key);
zval_add_ref(entry_values);
- add_assoc_zval(return_value, Z_STRVAL(key), *entry_values);
+ add_assoc_zval_ex(return_value, Z_STRVAL(key), Z_STRLEN(key)+1, *entry_values);
zval_dtor(&key);
}
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index 2ac7e7595..06089f89c 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: assert.c,v 1.60.2.3 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: assert.c,v 1.60.2.3.2.2 2006/07/01 12:21:07 nlopess Exp $ */
/* {{{ includes/startup/misc */
@@ -151,8 +151,11 @@ PHP_FUNCTION(assert)
compiled_string_description = zend_make_compiled_string_description("assert code" TSRMLS_CC);
if (zend_eval_string(myeval, &retval, compiled_string_description TSRMLS_CC) == FAILURE) {
efree(compiled_string_description);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
- /* php_error_docref() does not return in this case. */
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
+ if (ASSERTG(bail)) {
+ zend_bailout();
+ }
+ RETURN_FALSE;
}
efree(compiled_string_description);
diff --git a/ext/standard/base64.c b/ext/standard/base64.c
index 7f8f2fbaa..4aed7bc4e 100644
--- a/ext/standard/base64.c
+++ b/ext/standard/base64.c
@@ -15,7 +15,7 @@
| Author: Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: base64.c,v 1.43.2.2 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: base64.c,v 1.43.2.2.2.1 2006/05/06 22:47:14 iliaa Exp $ */
#include <string.h>
@@ -34,22 +34,22 @@ static const char base64_table[] =
static const char base64_pad = '=';
static const short base64_reverse_table[256] = {
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
- -1, 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, -1, -1, -1, -1, -1,
- -1, 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, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -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, -1, -1, -2, -2, -1, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 62, -2, -2, -2, 63,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -2, -2, -2, -2, -2, -2,
+ -2, 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, -2, -2, -2, -2, -2,
+ -2, 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, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2
};
/* }}} */
@@ -135,9 +135,14 @@ void php_base64_init()
*/
/* }}} */
+PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, int *ret_length)
+{
+ return php_base64_decode_ex(str, length, ret_length, 0);
+}
+
/* {{{ php_base64_decode */
/* as above, but backwards. :) */
-PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, int *ret_length)
+PHPAPI unsigned char *php_base64_decode_ex(const unsigned char *str, int length, int *ret_length, zend_bool strict)
{
const unsigned char *current = str;
int ch, i = 0, j = 0, k;
@@ -145,16 +150,18 @@ PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, in
unsigned char *result;
result = (unsigned char *)emalloc(length + 1);
- if (result == NULL) {
- return NULL;
- }
/* run through the whole string, converting as we go */
while ((ch = *current++) != '\0' && length-- > 0) {
if (ch == base64_pad) break;
ch = base64_reverse_table[ch];
- if (ch < 0) continue;
+ if ((!strict && ch < 0) || ch == -1) { /* a space or some other separator character, we simply skip over */
+ continue;
+ } else if (ch == -2) {
+ efree(result);
+ return NULL;
+ }
switch(i % 4) {
case 0:
@@ -217,18 +224,19 @@ PHP_FUNCTION(base64_encode)
/* }}} */
-/* {{{ proto string base64_decode(string str)
+/* {{{ proto string base64_decode(string str[, bool strict])
Decodes string using MIME base64 algorithm */
PHP_FUNCTION(base64_decode)
{
char *str;
unsigned char *result;
+ zend_bool strict = 0;
int str_len, ret_length;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &str, &str_len, &strict) == FAILURE) {
return;
}
- result = php_base64_decode(str, str_len, &ret_length);
+ result = php_base64_decode_ex(str, str_len, &ret_length, strict);
if (result != NULL) {
RETVAL_STRINGL(result, ret_length, 0);
} else {
diff --git a/ext/standard/base64.h b/ext/standard/base64.h
index 6e1762593..a18c5e2f4 100644
--- a/ext/standard/base64.h
+++ b/ext/standard/base64.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: base64.h,v 1.14.2.1 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: base64.h,v 1.14.2.1.2.1 2006/05/06 22:47:14 iliaa Exp $ */
#ifndef BASE64_H
#define BASE64_H
@@ -25,6 +25,7 @@ PHP_FUNCTION(base64_decode);
PHP_FUNCTION(base64_encode);
PHPAPI extern unsigned char *php_base64_encode(const unsigned char *, int, int *);
+PHPAPI extern unsigned char *php_base64_decode_ex(const unsigned char *, int, int *, zend_bool);
PHPAPI extern unsigned char *php_base64_decode(const unsigned char *, int, int *);
#endif /* BASE64_H */
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 79adf1ca2..653119660 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.725.2.32 2006/06/28 22:08:59 iliaa Exp $ */
+/* $Id: basic_functions.c,v 1.725.2.31.2.28 2006/10/13 01:42:19 iliaa Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -78,6 +78,10 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
# include <sys/mman.h>
#endif
+#if HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+#endif
+
#ifdef HARTMUT_0
#include <getopt.h>
#endif
@@ -109,45 +113,6 @@ PHPAPI php_basic_globals basic_globals;
static zend_class_entry *incomplete_class_entry = NULL;
-static
- ZEND_BEGIN_ARG_INFO(first_and_second__args_force_ref, 0)
- 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(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()
-
-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()
-
-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(all_args_prefer_ref, ZEND_SEND_PREFER_REF)
- ZEND_END_ARG_INFO()
-
typedef struct _php_shutdown_function_entry {
zval **arguments;
int arg_count;
@@ -165,685 +130,3637 @@ static void user_tick_function_dtor(user_tick_function_entry *tick_function_entr
#undef sprintf
+/* {{{ arginfo */
+/* {{{ main/main.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_set_time_limit, 0)
+ ZEND_ARG_INFO(0, seconds)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ main/output.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_start, 0, 0, 0)
+ ZEND_ARG_INFO(0, user_function)
+ ZEND_ARG_INFO(0, chunk_size)
+ ZEND_ARG_INFO(0, flags)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ob_flush, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ob_clean, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ob_end_flush, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ob_end_clean, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ob_get_flush, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ob_get_clean, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ob_get_contents, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ob_get_level, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ob_get_length, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ob_list_handlers, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_get_status, 0, 0, 0)
+ ZEND_ARG_INFO(0, full_status)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_implicit_flush, 0, 0, 0)
+ ZEND_ARG_INFO(0, flag)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_output_reset_rewrite_vars, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_output_add_rewrite_var, 0)
+ ZEND_ARG_INFO(0, name)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ main/streams/userspace.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_register, 0)
+ ZEND_ARG_INFO(0, protocol)
+ ZEND_ARG_INFO(0, classname)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_unregister, 0)
+ ZEND_ARG_INFO(0, protocol)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_restore, 0)
+ ZEND_ARG_INFO(0, protocol)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ array.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_krsort, 0, 0, 1)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, sort_flags)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ksort, 0, 0, 1)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, sort_flags)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_count, 0, 0, 1)
+ ZEND_ARG_INFO(0, var)
+ ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_natsort, 0)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_natcasesort, 0)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_asort, 0, 0, 1)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, sort_flags)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_arsort, 0, 0, 1)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, sort_flags)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_sort, 0, 0, 1)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, sort_flags)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_rsort, 0, 0, 1)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, sort_flags)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_usort, 0)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, cmp_function)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_uasort, 0)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, cmp_function)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_uksort, 0)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, cmp_function)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_end, 0)
+ ZEND_ARG_INFO(1, arg)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_prev, 0)
+ ZEND_ARG_INFO(1, arg)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_next, 0)
+ ZEND_ARG_INFO(1, arg)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_reset, 0)
+ ZEND_ARG_INFO(1, arg)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_current, ZEND_SEND_PREFER_REF)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_key, ZEND_SEND_PREFER_REF)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_min, 0, 0, 1)
+ ZEND_ARG_INFO(0, arg1)
+ ZEND_ARG_INFO(0, arg2)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_max, 0, 0, 1)
+ ZEND_ARG_INFO(0, arg1)
+ ZEND_ARG_INFO(0, arg2)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk, 0, 0, 2)
+ ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, funcname)
+ ZEND_ARG_INFO(0, userdata)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk_recursive, 0, 0, 2)
+ ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, funcname)
+ ZEND_ARG_INFO(0, userdata)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_in_array, 0, 0, 2)
+ ZEND_ARG_INFO(0, needle)
+ ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */
+ ZEND_ARG_INFO(0, strict)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_search, 0, 0, 2)
+ ZEND_ARG_INFO(0, needle)
+ ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */
+ ZEND_ARG_INFO(0, strict)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_extract, 0, 0, 1)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, extract_type)
+ ZEND_ARG_INFO(0, prefix)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_compact, 0, 0, 1)
+ ZEND_ARG_INFO(0, var_names)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_fill, 0)
+ ZEND_ARG_INFO(0, start_key)
+ ZEND_ARG_INFO(0, num)
+ ZEND_ARG_INFO(0, val)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_fill_keys, 0)
+ ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */
+ ZEND_ARG_INFO(0, val)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_range, 0, 0, 2)
+ ZEND_ARG_INFO(0, low)
+ ZEND_ARG_INFO(0, high)
+ ZEND_ARG_INFO(0, step)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_shuffle, 0)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_push, 0, 0, 2)
+ ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
+ ZEND_ARG_INFO(0, var)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_pop, 0)
+ ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_shift, 0)
+ ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_unshift, 0, 0, 2)
+ ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
+ ZEND_ARG_INFO(0, var)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_splice, 0, 0, 2)
+ ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, offset)
+ ZEND_ARG_INFO(0, length)
+ ZEND_ARG_INFO(0, replacement) /* ARRAY_INFO(0, arg, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_slice, 0, 0, 2)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(1, arg, 0) */
+ ZEND_ARG_INFO(0, offset)
+ ZEND_ARG_INFO(0, length)
+ ZEND_ARG_INFO(0, preserve_keys)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge, 0, 0, 2)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge_recursive, 0, 0, 2)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, arg, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_keys, 0, 0, 1)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, search_value)
+ ZEND_ARG_INFO(0, strict)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_values, 0)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_count_values, 0)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reverse, 0, 0, 1)
+ ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, preserve_keys)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_pad, 0)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, pad_size)
+ ZEND_ARG_INFO(0, pad_value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_flip, 0)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_change_key_case, 0, 0, 1)
+ ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, case)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_unique, 0)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect_key, 0, 0, 2)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_ukey, 0)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, callback_key_compare_func)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect, 0, 0, 2)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect, 0)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, callback_data_compare_func)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect_assoc, 0, 0, 2)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_assoc, 0)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, callback_data_compare_func)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_uassoc, 0)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, callback_key_compare_func)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_uassoc, 0)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, callback_data_compare_func)
+ ZEND_ARG_INFO(0, callback_key_compare_func)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff_key, 0, 0, 2)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_diff_ukey, 0)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, callback_key_comp_func)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff, 0, 0, 2)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_udiff, 0)
+ ZEND_ARG_INFO(0, arr1)
+ ZEND_ARG_INFO(0, arr2)
+ ZEND_ARG_INFO(0, callback_data_comp_func)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff_assoc, 0, 0, 2)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_diff_uassoc, 0)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, callback_data_comp_func)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_assoc, 0)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, callback_key_comp_func)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_uassoc, 0)
+ ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, callback_data_comp_func)
+ ZEND_ARG_INFO(0, callback_key_comp_func)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, ZEND_SEND_PREFER_REF, 0, 1)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr2)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC)
+ ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_rand, 0, 0, 1)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, num_req)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_sum, 0)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_product, 0)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reduce, 0, 0, 2)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, callback)
+ ZEND_ARG_INFO(0, initial)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_filter, 0, 0, 1)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, callback)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_map, 0, 0, 3)
+ ZEND_ARG_INFO(0, callback)
+ ZEND_ARG_INFO(0, arg1) /* ARRAY_INFO(0, arg1, 0) */
+ ZEND_ARG_INFO(0, arg2) /* ARRAY_INFO(0, arg2, 0) */
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_key_exists, 0)
+ ZEND_ARG_INFO(0, key)
+ ZEND_ARG_INFO(0, search)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_chunk, 0, 0, 2)
+ ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
+ ZEND_ARG_INFO(0, size)
+ ZEND_ARG_INFO(0, preserve_keys)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array_combine, 0)
+ ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */
+ ZEND_ARG_INFO(0, values) /* ARRAY_INFO(0, values, 0) */
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ basic_functions.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_constant, 0)
+ ZEND_ARG_INFO(0, const_name)
+ZEND_END_ARG_INFO()
+
+#ifdef HAVE_INET_NTOP
+static
+ZEND_BEGIN_ARG_INFO(arginfo_inet_ntop, 0)
+ ZEND_ARG_INFO(0, in_addr)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_INET_PTON
+static
+ZEND_BEGIN_ARG_INFO(arginfo_inet_pton, 0)
+ ZEND_ARG_INFO(0, ip_address)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ip2long, 0)
+ ZEND_ARG_INFO(0, ip_address)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_long2ip, 0)
+ ZEND_ARG_INFO(0, proper_address)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_getenv, 0)
+ ZEND_ARG_INFO(0, varname)
+ZEND_END_ARG_INFO()
+
+#ifdef HAVE_PUTENV
+static
+ZEND_BEGIN_ARG_INFO(arginfo_putenv, 0)
+ ZEND_ARG_INFO(0, setting)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GETOPT
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_getopt, 0, 0, 1)
+ ZEND_ARG_INFO(0, options)
+ ZEND_ARG_INFO(0, opts) /* ARRAY_INFO(0, opts, 1) */
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_flush, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_sleep, 0)
+ ZEND_ARG_INFO(0, seconds)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_usleep, 0)
+ ZEND_ARG_INFO(0, micro_seconds)
+ZEND_END_ARG_INFO()
+
+#if HAVE_NANOSLEEP
+static
+ZEND_BEGIN_ARG_INFO(arginfo_time_nanosleep, 0)
+ ZEND_ARG_INFO(0, seconds)
+ ZEND_ARG_INFO(0, nanoseconds)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_time_sleep_until, 0)
+ ZEND_ARG_INFO(0, timestamp)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_get_current_user, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_get_cfg_var, 0)
+ ZEND_ARG_INFO(0, option_name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_error_log, 0, 0, 1)
+ ZEND_ARG_INFO(0, message)
+ ZEND_ARG_INFO(0, message_type)
+ ZEND_ARG_INFO(0, destination)
+ ZEND_ARG_INFO(0, extra_headers)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_error_get_last, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func, 0, 0, 1)
+ ZEND_ARG_INFO(0, function_name)
+ ZEND_ARG_INFO(0, parmeter)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_call_user_func_array, 0)
+ ZEND_ARG_INFO(0, function_name)
+ ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_method, 0, 0, 2)
+ ZEND_ARG_INFO(0, method_name)
+ ZEND_ARG_INFO(1, object)
+ ZEND_ARG_INFO(0, parameter)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_call_user_method_array, 0)
+ ZEND_ARG_INFO(0, method_name)
+ ZEND_ARG_INFO(1, object)
+ ZEND_ARG_INFO(0, params) /* ARRAY_INFO(0, params, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_register_shutdown_function, 0)
+ ZEND_ARG_INFO(0, function_name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_file, 0, 0, 1)
+ ZEND_ARG_INFO(0, file_name)
+ ZEND_ARG_INFO(0, return)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_php_strip_whitespace, 0)
+ ZEND_ARG_INFO(0, file_name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_string, 0, 0, 1)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(0, return)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ini_get, 0)
+ ZEND_ARG_INFO(0, varname)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ini_get_all, 0, 0, 0)
+ ZEND_ARG_INFO(0, extension)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ini_set, 0)
+ ZEND_ARG_INFO(0, varname)
+ ZEND_ARG_INFO(0, newvalue)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ini_restore, 0)
+ ZEND_ARG_INFO(0, varname)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_set_include_path, 0)
+ ZEND_ARG_INFO(0, new_include_path)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_get_include_path, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_restore_include_path, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_print_r, 0, 0, 1)
+ ZEND_ARG_INFO(0, var)
+ ZEND_ARG_INFO(0, return)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_connection_aborted, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_connection_status, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ignore_user_abort, 0, 0, 0)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+#if HAVE_GETSERVBYNAME
+static
+ZEND_BEGIN_ARG_INFO(arginfo_getservbyname, 0)
+ ZEND_ARG_INFO(0, service)
+ ZEND_ARG_INFO(0, protocol)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_GETSERVBYPORT
+static
+ZEND_BEGIN_ARG_INFO(arginfo_getservbyport, 0)
+ ZEND_ARG_INFO(0, port)
+ ZEND_ARG_INFO(0, protocol)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_GETPROTOBYNAME
+static
+ZEND_BEGIN_ARG_INFO(arginfo_getprotobyname, 0)
+ ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_GETPROTOBYNUMBER
+static
+ZEND_BEGIN_ARG_INFO(arginfo_getprotobynumber, 0)
+ ZEND_ARG_INFO(0, proto)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_register_tick_function, 0, 0, 1)
+ ZEND_ARG_INFO(0, function_name)
+ ZEND_ARG_INFO(0, arg)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_unregister_tick_function, 0)
+ ZEND_ARG_INFO(0, function_name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_uploaded_file, 0)
+ ZEND_ARG_INFO(0, path)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_move_uploaded_file, 0)
+ ZEND_ARG_INFO(0, path)
+ ZEND_ARG_INFO(0, new_path)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_ini_file, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, process_sections)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_import_request_variables, 0, 0, 1)
+ ZEND_ARG_INFO(0, types)
+ ZEND_ARG_INFO(0, prefix)
+ZEND_END_ARG_INFO()
+
+#ifdef HAVE_GETLOADAVG
+static
+ZEND_BEGIN_ARG_INFO(arginfo_sys_getloadavg, 0)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ assert.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_assert, 0)
+ ZEND_ARG_INFO(0, assertion)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_assert_options, 0, 0, 1)
+ ZEND_ARG_INFO(0, what)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ base64.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_base64_encode, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_base64_decode, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, strict)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+/* {{{ browscap.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_get_browser, 0, 0, 0)
+ ZEND_ARG_INFO(0, browser_name)
+ ZEND_ARG_INFO(0, return_array)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ crc32.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_crc32, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+/* {{{ crypt.c */
+#if HAVE_CRYPT
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_crypt, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, salt)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ cyr_convert.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_convert_cyr_string, 0)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, from)
+ ZEND_ARG_INFO(0, to)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+/* {{{ datetime.c */
+#if HAVE_STRPTIME
+static
+ZEND_BEGIN_ARG_INFO(arginfo_strptime, 0)
+ ZEND_ARG_INFO(0, timestamp)
+ ZEND_ARG_INFO(0, format)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ dir.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_opendir, 0, 0, 1)
+ ZEND_ARG_INFO(0, path)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_dir, 0, 0, 1)
+ ZEND_ARG_INFO(0, directory)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_closedir, 0, 0, 0)
+ ZEND_ARG_INFO(0, dir_handle)
+ZEND_END_ARG_INFO()
+
+#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
+static
+ZEND_BEGIN_ARG_INFO(arginfo_chroot, 0)
+ ZEND_ARG_INFO(0, directory)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_chdir, 0)
+ ZEND_ARG_INFO(0, directory)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_getcwd, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_rewinddir, 0, 0, 0)
+ ZEND_ARG_INFO(0, dir_handle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_readdir, 0, 0, 0)
+ ZEND_ARG_INFO(0, dir_handle)
+ZEND_END_ARG_INFO()
+
+#ifdef HAVE_GLOB
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_glob, 0, 0, 1)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, flags)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_scandir, 0, 0, 1)
+ ZEND_ARG_INFO(0, dir)
+ ZEND_ARG_INFO(0, sorting_order)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ arginfo ext/standard/dl.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dl, 0)
+ ZEND_ARG_INFO(0, extension_filename)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ dns.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gethostbyaddr, 0)
+ ZEND_ARG_INFO(0, ip_address)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gethostbyname, 0)
+ ZEND_ARG_INFO(0, hostname)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gethostbynamel, 0)
+ ZEND_ARG_INFO(0, hostname)
+ZEND_END_ARG_INFO()
+
+#if HAVE_RES_SEARCH && !(defined(__BEOS__)||defined(PHP_WIN32) || defined(NETWARE))
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1)
+ ZEND_ARG_INFO(0, host)
+ ZEND_ARG_INFO(0, type)
+ZEND_END_ARG_INFO()
+
+# if HAVE_DNS_FUNCS
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_record, 1, 0, 1)
+ ZEND_ARG_INFO(0, hostname)
+ ZEND_ARG_INFO(0, type)
+ ZEND_ARG_INFO(1, authns) /* ARRAY_INFO(1, authns, 1) */
+ ZEND_ARG_INFO(1, addtl) /* ARRAY_INFO(1, addtl, 1) */
+ZEND_END_ARG_INFO()
+# endif
+
+# if HAVE_DN_SKIPNAME && HAVE_DN_EXPAND
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_mx, 0, 0, 2)
+ ZEND_ARG_INFO(0, hostname)
+ ZEND_ARG_INFO(1, mxhosts) /* ARRAY_INFO(1, mxhosts, 1) */
+ ZEND_ARG_INFO(1, weight) /* ARRAY_INFO(1, weight, 1) */
+ZEND_END_ARG_INFO()
+# endif
+#endif /* HAVE_RES_SEARCH && !(defined(__BEOS__)||defined(PHP_WIN32) || defined(NETWARE)) */
+/* }}} */
+/* {{{ exec.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_exec, 0, 0, 1)
+ ZEND_ARG_INFO(0, command)
+ ZEND_ARG_INFO(1, output) /* ARRAY_INFO(1, output, 1) */
+ ZEND_ARG_INFO(1, return_value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_system, 0, 0, 1)
+ ZEND_ARG_INFO(0, command)
+ ZEND_ARG_INFO(1, return_value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_passthru, 0, 0, 1)
+ ZEND_ARG_INFO(0, command)
+ ZEND_ARG_INFO(1, return_value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_escapeshellcmd, 0)
+ ZEND_ARG_INFO(0, command)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_escapeshellarg, 0)
+ ZEND_ARG_INFO(0, arg)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_shell_exec, 0)
+ ZEND_ARG_INFO(0, cmd)
+ZEND_END_ARG_INFO()
+
+#ifdef HAVE_NICE
+static
+ZEND_BEGIN_ARG_INFO(arginfo_proc_nice, 0)
+ ZEND_ARG_INFO(0, priority)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ file.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_flock, 0, 0, 2)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, operation)
+ ZEND_ARG_INFO(1, wouldblock)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_get_meta_tags, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, use_include_path)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_get_contents, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, flags)
+ ZEND_ARG_INFO(0, context)
+ ZEND_ARG_INFO(0, offset)
+ ZEND_ARG_INFO(0, maxlen)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file_put_contents, 0, 0, 2)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, data)
+ ZEND_ARG_INFO(0, flags)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_file, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, flags)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_tempnam, 0)
+ ZEND_ARG_INFO(0, dir)
+ ZEND_ARG_INFO(0, prefix)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_tmpfile, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fopen, 0, 0, 2)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, use_include_path)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fclose, 0)
+ ZEND_ARG_INFO(0, fp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_popen, 0)
+ ZEND_ARG_INFO(0, command)
+ ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_pclose, 0)
+ ZEND_ARG_INFO(0, fp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_feof, 0)
+ ZEND_ARG_INFO(0, fp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fgets, 0, 0, 1)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fgetc, 0)
+ ZEND_ARG_INFO(0, fp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetss, 0, 0, 1)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, length)
+ ZEND_ARG_INFO(0, allowable_tags)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fscanf, 1, 0, 2)
+ ZEND_ARG_INFO(0, stream)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(1, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fwrite, 0, 0, 2)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fflush, 0)
+ ZEND_ARG_INFO(0, fp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_rewind, 0)
+ ZEND_ARG_INFO(0, fp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftell, 0)
+ ZEND_ARG_INFO(0, fp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fseek, 0, 0, 2)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, offset)
+ ZEND_ARG_INFO(0, whence)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mkdir, 0, 0, 1)
+ ZEND_ARG_INFO(0, pathname)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, recursive)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_rmdir, 0, 0, 1)
+ ZEND_ARG_INFO(0, dirname)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_readfile, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, flags)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_umask, 0, 0, 0)
+ ZEND_ARG_INFO(0, mask)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fpassthru, 0)
+ ZEND_ARG_INFO(0, fp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_rename, 0, 0, 2)
+ ZEND_ARG_INFO(0, old_name)
+ ZEND_ARG_INFO(0, new_name)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_unlink, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftruncate, 0)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, size)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fstat, 0)
+ ZEND_ARG_INFO(0, fp)
+ZEND_END_ARG_INFO()
+static
+ZEND_BEGIN_ARG_INFO(arginfo_copy, 0)
+ ZEND_ARG_INFO(0, source_file)
+ ZEND_ARG_INFO(0, destination_file)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fread, 0)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fputcsv, 0, 0, 2)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, fields) /* ARRAY_INFO(0, fields, 1) */
+ ZEND_ARG_INFO(0, delimiter)
+ ZEND_ARG_INFO(0, enclosure)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetcsv, 0, 0, 1)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, length)
+ ZEND_ARG_INFO(0, delimiter)
+ ZEND_ARG_INFO(0, enclosure)
+ZEND_END_ARG_INFO()
+
+#if (!defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS)
+static
+ZEND_BEGIN_ARG_INFO(arginfo_realpath, 0)
+ ZEND_ARG_INFO(0, path)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_FNMATCH
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fnmatch, 0, 0, 2)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, flags)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ filestat.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_disk_total_space, 0)
+ ZEND_ARG_INFO(0, path)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_disk_free_space, 0)
+ ZEND_ARG_INFO(0, path)
+ZEND_END_ARG_INFO()
+
+#ifndef NETWARE
+static
+ZEND_BEGIN_ARG_INFO(arginfo_chgrp, 0)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, group)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_chown, 0)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, user)
+ZEND_END_ARG_INFO()
+#endif
+
+#if HAVE_LCHOWN
+static
+ZEND_BEGIN_ARG_INFO(arginfo_lchgrp, 0)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, group)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_lchown, 0)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, user)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_chmod, 0)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+#if HAVE_UTIME
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_touch, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, time)
+ ZEND_ARG_INFO(0, atime)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_clearstatcache, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fileperms, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fileinode, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_filesize, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fileowner, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_filegroup, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fileatime, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_filemtime, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_filectime, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_filetype, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_writable, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_readable, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_executable, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_file, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_dir, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_link, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_file_exists, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_lstat, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stat, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ formatted_print.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_sprintf, 0, 0, 2)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, arg1)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_vsprintf, 0)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_printf, 0, 0, 1)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, arg1)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_vprintf, 0)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fprintf, 0, 0, 2)
+ ZEND_ARG_INFO(0, stream)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, arg1)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_vfprintf, 0)
+ ZEND_ARG_INFO(0, stream)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ fsock.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_fsockopen, 0, 0, 2)
+ ZEND_ARG_INFO(0, hostname)
+ ZEND_ARG_INFO(0, port)
+ ZEND_ARG_INFO(1, errno)
+ ZEND_ARG_INFO(1, errstr)
+ ZEND_ARG_INFO(0, timeout)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pfsockopen, 0, 0, 2)
+ ZEND_ARG_INFO(0, hostname)
+ ZEND_ARG_INFO(0, port)
+ ZEND_ARG_INFO(1, errno)
+ ZEND_ARG_INFO(1, errstr)
+ ZEND_ARG_INFO(0, timeout)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ ftok.c */
+#if HAVE_FTOK
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ftok, 0)
+ ZEND_ARG_INFO(0, pathname)
+ ZEND_ARG_INFO(0, proj)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ head.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_header, 0, 0, 1)
+ ZEND_ARG_INFO(0, header)
+ ZEND_ARG_INFO(0, replace)
+ ZEND_ARG_INFO(0, http_response_code)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_setcookie, 0, 0, 1)
+ ZEND_ARG_INFO(0, name)
+ ZEND_ARG_INFO(0, value)
+ ZEND_ARG_INFO(0, expires)
+ ZEND_ARG_INFO(0, path)
+ ZEND_ARG_INFO(0, domain)
+ ZEND_ARG_INFO(0, secure)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_setrawcookie, 0, 0, 1)
+ ZEND_ARG_INFO(0, name)
+ ZEND_ARG_INFO(0, value)
+ ZEND_ARG_INFO(0, expires)
+ ZEND_ARG_INFO(0, path)
+ ZEND_ARG_INFO(0, domain)
+ ZEND_ARG_INFO(0, secure)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_headers_sent, 0, 0, 0)
+ ZEND_ARG_INFO(1, file)
+ ZEND_ARG_INFO(1, line)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_headers_list, 0)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ html.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars, 0, 0, 1)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(0, quote_style)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars_decode, 0, 0, 1)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(0, quote_style)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_html_entity_decode, 0, 0, 1)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(0, quote_style)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlentities, 0, 0, 1)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(0, quote_style)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_get_html_translation_table, 0, 0, 0)
+ ZEND_ARG_INFO(0, table)
+ ZEND_ARG_INFO(0, quote_style)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+/* {{{ http.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_http_build_query, 0, 0, 1)
+ ZEND_ARG_INFO(0, formdata)
+ ZEND_ARG_INFO(0, prefix)
+ ZEND_ARG_INFO(0, arg_separator)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ image.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_image_type_to_mime_type, 0)
+ ZEND_ARG_INFO(0, imagetype)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_image_type_to_extension, 0, 0, 1)
+ ZEND_ARG_INFO(0, imagetype)
+ ZEND_ARG_INFO(0, include_dot)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_getimagesize, 0, 0, 1)
+ ZEND_ARG_INFO(0, imagefile)
+ ZEND_ARG_INFO(1, info) /* ARRAY_INFO(1, info, 1) */
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ info.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_phpinfo, 0, 0, 0)
+ ZEND_ARG_INFO(0, what)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_phpversion, 0, 0, 0)
+ ZEND_ARG_INFO(0, extension)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_phpcredits, 0, 0, 0)
+ ZEND_ARG_INFO(0, flag)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_php_logo_guid, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_php_real_logo_guid, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_php_egg_logo_guid, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_zend_logo_guid, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_php_sapi_name, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_php_uname, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_php_ini_scanned_files, 0)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ iptc.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iptcembed, 0, 0, 2)
+ ZEND_ARG_INFO(0, iptcdata)
+ ZEND_ARG_INFO(0, jpeg_file_name)
+ ZEND_ARG_INFO(0, spool)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_iptcparse, 0)
+ ZEND_ARG_INFO(0, iptcdata)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ lcg.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_lcg_value, 0)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ levenshtein.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_levenshtein, 0)
+ ZEND_ARG_INFO(0, str1)
+ ZEND_ARG_INFO(0, str2)
+ ZEND_ARG_INFO(0, cost_ins)
+ ZEND_ARG_INFO(0, cost_rep)
+ ZEND_ARG_INFO(0, cost_del)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ link.c */
+#ifdef HAVE_SYMLINK
+static
+ZEND_BEGIN_ARG_INFO(arginfo_readlink, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_linkinfo, 0)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_symlink, 0)
+ ZEND_ARG_INFO(0, target)
+ ZEND_ARG_INFO(0, link)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_link, 0)
+ ZEND_ARG_INFO(0, target)
+ ZEND_ARG_INFO(0, link)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ mail.c */
+#ifdef HAVE_SENDMAIL
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ezmlm_hash, 0)
+ ZEND_ARG_INFO(0, addr)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mail, 0, 0, 3)
+ ZEND_ARG_INFO(0, to)
+ ZEND_ARG_INFO(0, subject)
+ ZEND_ARG_INFO(0, message)
+ ZEND_ARG_INFO(0, additional_headers)
+ ZEND_ARG_INFO(0, additional_parameters)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ math.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_abs, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ceil, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_floor, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_round, 0, 0, 1)
+ ZEND_ARG_INFO(0, number)
+ ZEND_ARG_INFO(0, precision)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_sin, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_cos, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_tan, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_asin, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_acos, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_atan, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_atan2, 0)
+ ZEND_ARG_INFO(0, y)
+ ZEND_ARG_INFO(0, x)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_sinh, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_cosh, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_tanh, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+#ifdef HAVE_ASINH
+static
+ZEND_BEGIN_ARG_INFO(arginfo_asinh, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_ACOSH
+static
+ZEND_BEGIN_ARG_INFO(arginfo_acosh, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_ATANH
+static
+ZEND_BEGIN_ARG_INFO(arginfo_atanh, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_pi, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_finite, 0)
+ ZEND_ARG_INFO(0, val)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_infinite, 0)
+ ZEND_ARG_INFO(0, val)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_nan, 0)
+ ZEND_ARG_INFO(0, val)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_pow, 0)
+ ZEND_ARG_INFO(0, base)
+ ZEND_ARG_INFO(0, exponent)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_exp, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+#if !defined(PHP_WIN32) && !defined(NETWARE)
+static
+ZEND_BEGIN_ARG_INFO(arginfo_expm1, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+# ifdef HAVE_LOG1P
+static
+ZEND_BEGIN_ARG_INFO(arginfo_log1p, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+# endif
+#endif /* !defined(PHP_WIN32) && !defined(NETWARE) */
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_log, 0, 0, 1)
+ ZEND_ARG_INFO(0, number)
+ ZEND_ARG_INFO(0, base)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_log10, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_sqrt, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_hypot, 0)
+ ZEND_ARG_INFO(0, num1)
+ ZEND_ARG_INFO(0, num2)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_deg2rad, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_rad2deg, 0)
+ ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_bindec, 0)
+ ZEND_ARG_INFO(0, binary_number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_hexdec, 0)
+ ZEND_ARG_INFO(0, hexadecimal_number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_octdec, 0)
+ ZEND_ARG_INFO(0, octal_number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_decbin, 0)
+ ZEND_ARG_INFO(0, decimal_number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_decoct, 0)
+ ZEND_ARG_INFO(0, decimal_number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dechex, 0)
+ ZEND_ARG_INFO(0, decimal_number)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_base_convert, 0)
+ ZEND_ARG_INFO(0, number)
+ ZEND_ARG_INFO(0, frombase)
+ ZEND_ARG_INFO(0, tobase)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_number_format, 0, 0, 1)
+ ZEND_ARG_INFO(0, number)
+ ZEND_ARG_INFO(0, num_decimal_places)
+ ZEND_ARG_INFO(0, dec_seperator)
+ ZEND_ARG_INFO(0, thousands_seperator)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_fmod, 0)
+ ZEND_ARG_INFO(0, x)
+ ZEND_ARG_INFO(0, y)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ md5.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_md5, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_md5_file, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ metaphone.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_metaphone, 0, 0, 1)
+ ZEND_ARG_INFO(0, text)
+ ZEND_ARG_INFO(0, phones)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ microtime.c */
+#ifdef HAVE_GETTIMEOFDAY
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_microtime, 0, 0, 0)
+ ZEND_ARG_INFO(0, get_as_float)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gettimeofday, 0, 0, 0)
+ ZEND_ARG_INFO(0, get_as_float)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_GETRUSAGE
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_getrusage, 0, 0, 0)
+ ZEND_ARG_INFO(0, who)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ pack.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pack, 0, 0, 2)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, arg1)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_unpack, 0)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, input)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ pageinfo.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_getmyuid, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_getmygid, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_getmypid, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_getmyinode, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_getlastmod, 0)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ proc_open.c */
+#ifdef PHP_CAN_SUPPORT_PROC_OPEN
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_terminate, 0, 0, 1)
+ ZEND_ARG_INFO(0, process)
+ ZEND_ARG_INFO(0, signal)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_proc_close, 0)
+ ZEND_ARG_INFO(0, process)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_proc_get_status, 0)
+ ZEND_ARG_INFO(0, process)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_open, 0, 0, 3)
+ ZEND_ARG_INFO(0, command)
+ ZEND_ARG_INFO(0, descriptorspec) /* ARRAY_INFO(0, descriptorspec, 1) */
+ ZEND_ARG_INFO(1, pipes) /* ARRAY_INFO(1, pipes, 1) */
+ ZEND_ARG_INFO(0, cwd)
+ ZEND_ARG_INFO(0, env) /* ARRAY_INFO(0, env, 1) */
+ ZEND_ARG_INFO(0, other_options) /* ARRAY_INFO(0, other_options, 1) */
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ quot_print.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_quoted_printable_decode, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ rand.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_srand, 0, 0, 0)
+ ZEND_ARG_INFO(0, seed)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_srand, 0, 0, 0)
+ ZEND_ARG_INFO(0, seed)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_rand, 0, 0, 0)
+ ZEND_ARG_INFO(0, min)
+ ZEND_ARG_INFO(0, max)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_rand, 0, 0, 0)
+ ZEND_ARG_INFO(0, min)
+ ZEND_ARG_INFO(0, max)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_getrandmax, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ reg.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ereg, 0, 0, 2)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(1, registers) /* ARRAY_INFO(1, registers, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_eregi, 0, 0, 2)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(1, registers) /* ARRAY_INFO(1, registers, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ereg_replace, 0)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, replacement)
+ ZEND_ARG_INFO(0, string)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_eregi_replace, 0)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, replacement)
+ ZEND_ARG_INFO(0, string)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_split, 0, 0, 2)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(0, limit)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_spliti, 0, 0, 2)
+ ZEND_ARG_INFO(0, pattern)
+ ZEND_ARG_INFO(0, string)
+ ZEND_ARG_INFO(0, limit)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_sql_regcase, 0)
+ ZEND_ARG_INFO(0, string)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ sha1.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1_file, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ ZEND_ARG_INFO(0, raw_output)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ soundex.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_soundex, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ streamsfuncs.c */
+#if HAVE_SOCKETPAIR
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_pair, 0)
+ ZEND_ARG_INFO(0, domain)
+ ZEND_ARG_INFO(0, type)
+ ZEND_ARG_INFO(0, protocol)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_client, 0, 0, 1)
+ ZEND_ARG_INFO(0, remoteaddress)
+ ZEND_ARG_INFO(1, errcode)
+ ZEND_ARG_INFO(1, errstring)
+ ZEND_ARG_INFO(0, timeout)
+ ZEND_ARG_INFO(0, flags)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_server, 0, 0, 1)
+ ZEND_ARG_INFO(0, localaddress)
+ ZEND_ARG_INFO(1, errcode)
+ ZEND_ARG_INFO(1, errstring)
+ ZEND_ARG_INFO(0, flags)
+ ZEND_ARG_INFO(0, context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_accept, 0, 0, 1)
+ ZEND_ARG_INFO(0, serverstream)
+ ZEND_ARG_INFO(0, timeout)
+ ZEND_ARG_INFO(1, peername)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_get_name, 0)
+ ZEND_ARG_INFO(0, stream)
+ ZEND_ARG_INFO(0, want_peer)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_sendto, 0, 0, 2)
+ ZEND_ARG_INFO(0, stream)
+ ZEND_ARG_INFO(0, data)
+ ZEND_ARG_INFO(0, flags)
+ ZEND_ARG_INFO(0, target_addr)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_recvfrom, 0, 0, 2)
+ ZEND_ARG_INFO(0, stream)
+ ZEND_ARG_INFO(0, amount)
+ ZEND_ARG_INFO(0, flags)
+ ZEND_ARG_INFO(1, remote_addr)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_get_contents, 0, 0, 1)
+ ZEND_ARG_INFO(0, source)
+ ZEND_ARG_INFO(0, maxlen)
+ ZEND_ARG_INFO(0, offset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_copy_to_stream, 0, 0, 2)
+ ZEND_ARG_INFO(0, source)
+ ZEND_ARG_INFO(0, dest)
+ ZEND_ARG_INFO(0, maxlen)
+ ZEND_ARG_INFO(0, pos)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_get_meta_data, 0)
+ ZEND_ARG_INFO(0, fp)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_get_transports, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_get_wrappers, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_select, 0, 0, 4)
+ ZEND_ARG_INFO(1, read_streams) /* ARRAY_INFO(1, read_streams, 1) */
+ ZEND_ARG_INFO(1, write_streams) /* ARRAY_INFO(1, write_streams, 1) */
+ ZEND_ARG_INFO(1, except_streams) /* ARRAY_INFO(1, except_streams, 1) */
+ ZEND_ARG_INFO(0, tv_sec)
+ ZEND_ARG_INFO(0, tv_usec)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_context_get_options, 0)
+ ZEND_ARG_INFO(0, stream_or_context)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_option, 0)
+ ZEND_ARG_INFO(0, stream_or_context)
+ ZEND_ARG_INFO(0, wrappername)
+ ZEND_ARG_INFO(0, optionname)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_params, 0)
+ ZEND_ARG_INFO(0, stream_or_context)
+ ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_get_default, 0, 0, 0)
+ ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_create, 0, 0, 0)
+ ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_prepend, 0, 0, 2)
+ ZEND_ARG_INFO(0, stream)
+ ZEND_ARG_INFO(0, filtername)
+ ZEND_ARG_INFO(0, read_write)
+ ZEND_ARG_INFO(0, filterparams)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_append, 0, 0, 2)
+ ZEND_ARG_INFO(0, stream)
+ ZEND_ARG_INFO(0, filtername)
+ ZEND_ARG_INFO(0, read_write)
+ ZEND_ARG_INFO(0, filterparams)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_filter_remove, 0)
+ ZEND_ARG_INFO(0, stream_filter)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_get_line, 0, 0, 2)
+ ZEND_ARG_INFO(0, stream)
+ ZEND_ARG_INFO(0, maxlen)
+ ZEND_ARG_INFO(0, ending)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_set_blocking, 0)
+ ZEND_ARG_INFO(0, socket)
+ ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+#if HAVE_SYS_TIME_H || defined(PHP_WIN32)
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_set_timeout, 0)
+ ZEND_ARG_INFO(0, stream)
+ ZEND_ARG_INFO(0, seconds)
+ ZEND_ARG_INFO(0, microseconds)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_set_write_buffer, 0)
+ ZEND_ARG_INFO(0, fp)
+ ZEND_ARG_INFO(0, buffer)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_enable_crypto, 0, 0, 2)
+ ZEND_ARG_INFO(0, stream)
+ ZEND_ARG_INFO(0, enable)
+ ZEND_ARG_INFO(0, cryptokind)
+ ZEND_ARG_INFO(0, sessionstream)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ string.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_bin2hex, 0)
+ ZEND_ARG_INFO(0, data)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_strspn, 0, 0, 2)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, mask)
+ ZEND_ARG_INFO(0, start)
+ ZEND_ARG_INFO(0, len)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_strcspn, 0, 0, 2)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, mask)
+ ZEND_ARG_INFO(0, start)
+ ZEND_ARG_INFO(0, len)
+ZEND_END_ARG_INFO()
+
+#if HAVE_NL_LANGINFO
+static
+ZEND_BEGIN_ARG_INFO(arginfo_nl_langinfo, 0)
+ ZEND_ARG_INFO(0, item)
+ZEND_END_ARG_INFO()
+#endif
+
+#ifdef HAVE_STRCOLL
+static
+ZEND_BEGIN_ARG_INFO(arginfo_strcoll, 0)
+ ZEND_ARG_INFO(0, str1)
+ ZEND_ARG_INFO(0, str2)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_trim, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, character_mask)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_rtrim, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, character_mask)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ltrim, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, character_mask)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_wordwrap, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, width)
+ ZEND_ARG_INFO(0, break)
+ ZEND_ARG_INFO(0, cut)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_explode, 0, 0, 2)
+ ZEND_ARG_INFO(0, separator)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, limit)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_implode, 0)
+ ZEND_ARG_INFO(0, glue)
+ ZEND_ARG_INFO(0, pieces)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_strtok, 0)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, token)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_strtoupper, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_strtolower, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_basename, 0, 0, 1)
+ ZEND_ARG_INFO(0, path)
+ ZEND_ARG_INFO(0, suffix)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dirname, 0)
+ ZEND_ARG_INFO(0, path)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pathinfo, 0, 0, 1)
+ ZEND_ARG_INFO(0, path)
+ ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stristr, 0)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_strstr, 0)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_strpos, 0, 0, 2)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ ZEND_ARG_INFO(0, offset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_stripos, 0, 0, 2)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ ZEND_ARG_INFO(0, offset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_strrpos, 0, 0, 2)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ ZEND_ARG_INFO(0, offset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_strripos, 0, 0, 2)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ ZEND_ARG_INFO(0, offset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_strrchr, 0)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_chunk_split, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, chunklen)
+ ZEND_ARG_INFO(0, ending)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_substr, 0, 0, 2)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, start)
+ ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_replace, 0, 0, 3)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, replace)
+ ZEND_ARG_INFO(0, start)
+ ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_quotemeta, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ord, 0)
+ ZEND_ARG_INFO(0, character)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_chr, 0)
+ ZEND_ARG_INFO(0, codepoint)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ucfirst, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ucwords, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_strtr, 0, 0, 2)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, from)
+ ZEND_ARG_INFO(0, to)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_strrev, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_similar_text, 0, 0, 2)
+ ZEND_ARG_INFO(0, str1)
+ ZEND_ARG_INFO(0, str2)
+ ZEND_ARG_INFO(1, percent)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_addcslashes, 0)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, charlist)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_addslashes, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stripcslashes, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stripslashes, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_str_replace, 0, 0, 3)
+ ZEND_ARG_INFO(0, search)
+ ZEND_ARG_INFO(0, replace)
+ ZEND_ARG_INFO(0, subject)
+ ZEND_ARG_INFO(1, replace_count)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_str_ireplace, 0, 0, 3)
+ ZEND_ARG_INFO(0, search)
+ ZEND_ARG_INFO(0, replace)
+ ZEND_ARG_INFO(0, subject)
+ ZEND_ARG_INFO(1, replace_count)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hebrev, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, max_chars_per_line)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_hebrevc, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, max_chars_per_line)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_nl2br, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_strip_tags, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, allowable_tags)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_setlocale, 0, 0, 2)
+ ZEND_ARG_INFO(0, category)
+ ZEND_ARG_INFO(0, locale)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_str, 0, 0, 1)
+ ZEND_ARG_INFO(0, encoded_string)
+ ZEND_ARG_INFO(1, result)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_str_repeat, 0)
+ ZEND_ARG_INFO(0, input)
+ ZEND_ARG_INFO(0, mult)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_count_chars, 0, 0, 1)
+ ZEND_ARG_INFO(0, input)
+ ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_strnatcmp, 0)
+ ZEND_ARG_INFO(0, s1)
+ ZEND_ARG_INFO(0, s2)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_localeconv, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_strnatcasecmp, 0)
+ ZEND_ARG_INFO(0, s1)
+ ZEND_ARG_INFO(0, s2)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_count, 0, 0, 2)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ ZEND_ARG_INFO(0, offset)
+ ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_str_pad, 0, 0, 2)
+ ZEND_ARG_INFO(0, input)
+ ZEND_ARG_INFO(0, pad_length)
+ ZEND_ARG_INFO(0, pad_string)
+ ZEND_ARG_INFO(0, pad_type)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_sscanf, 1, 0, 2)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(1, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_str_rot13, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_str_shuffle, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_str_word_count, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, charlist)
+ZEND_END_ARG_INFO()
+
+#ifdef HAVE_STRFMON
+static
+ZEND_BEGIN_ARG_INFO(arginfo_money_format, 0)
+ ZEND_ARG_INFO(0, format)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_str_split, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, split_length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_strpbrk, 0, 0, 1)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, char_list)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_compare, 0, 0, 3)
+ ZEND_ARG_INFO(0, main_str)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, offset)
+ ZEND_ARG_INFO(0, length)
+ ZEND_ARG_INFO(0, case_sensitivity)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ syslog.c */
+#ifdef HAVE_SYSLOG_H
+static
+ZEND_BEGIN_ARG_INFO(arginfo_define_syslog_variables, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_openlog, 0)
+ ZEND_ARG_INFO(0, ident)
+ ZEND_ARG_INFO(0, option)
+ ZEND_ARG_INFO(0, facility)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_closelog, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_syslog, 0)
+ ZEND_ARG_INFO(0, priority)
+ ZEND_ARG_INFO(0, message)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ type.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_gettype, 0)
+ ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_settype, 0)
+ ZEND_ARG_INFO(1, var)
+ ZEND_ARG_INFO(0, type)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_intval, 0, 0, 1)
+ ZEND_ARG_INFO(0, var)
+ ZEND_ARG_INFO(0, base)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_floatval, 0)
+ ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_strval, 0)
+ ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_null, 0)
+ ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_resource, 0)
+ ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_bool, 0)
+ ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_long, 0)
+ ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_float, 0)
+ ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_string, 0)
+ ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_array, 0)
+ ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_object, 0)
+ ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_numeric, 0)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_is_scalar, 0)
+ ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_is_callable, 0, 0, 1)
+ ZEND_ARG_INFO(0, var)
+ ZEND_ARG_INFO(0, syntax_only)
+ ZEND_ARG_INFO(1, callable_name)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ uniqid.c */
+#ifdef HAVE_GETTIMEOFDAY
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_uniqid, 0, 0, 0)
+ ZEND_ARG_INFO(0, prefix)
+ ZEND_ARG_INFO(0, more_entropy)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} *//* {{{ url.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_url, 0, 0, 1)
+ ZEND_ARG_INFO(0, url)
+ ZEND_ARG_INFO(0, component)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_urlencode, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_urldecode, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_rawurlencode, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_rawurldecode, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_get_headers, 0, 0, 1)
+ ZEND_ARG_INFO(0, url)
+ ZEND_ARG_INFO(0, format)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ user_filters.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_make_writeable, 0)
+ ZEND_ARG_INFO(0, brigade)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_prepend, 0)
+ ZEND_ARG_INFO(0, brigade)
+ ZEND_ARG_INFO(0, bucket)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_append, 0)
+ ZEND_ARG_INFO(0, brigade)
+ ZEND_ARG_INFO(0, bucket)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_new, 0)
+ ZEND_ARG_INFO(0, stream)
+ ZEND_ARG_INFO(0, buffer)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_get_filters, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_filter_register, 0)
+ ZEND_ARG_INFO(0, filtername)
+ ZEND_ARG_INFO(0, classname)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ uuencode.c */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_convert_uuencode, 0)
+ ZEND_ARG_INFO(0, data)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_convert_uudecode, 0)
+ ZEND_ARG_INFO(0, data)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* {{{ var.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_var_dump, 0, 0, 1)
+ ZEND_ARG_INFO(0, var)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_debug_zval_dump, 0, 0, 1)
+ ZEND_ARG_INFO(0, var)
+ ZEND_ARG_INFO(0, ...)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_var_export, 0, 0, 1)
+ ZEND_ARG_INFO(0, var)
+ ZEND_ARG_INFO(0, return)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_serialize, 0)
+ ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_unserialize, 0)
+ ZEND_ARG_INFO(0, variable_representation)
+ZEND_END_ARG_INFO()
+
+#if MEMORY_LIMIT
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_usage, 0, 0, 0)
+ ZEND_ARG_INFO(0, real_usage)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_peak_usage, 0, 0, 0)
+ ZEND_ARG_INFO(0, real_usage)
+ZEND_END_ARG_INFO()
+#endif
+/* }}} */
+/* {{{ versioning.c */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_version_compare, 0, 0, 2)
+ ZEND_ARG_INFO(0, ver1)
+ ZEND_ARG_INFO(0, ver2)
+ ZEND_ARG_INFO(0, oper)
+ZEND_END_ARG_INFO()
+/* }}} */
+/* }}} */
+
zend_function_entry basic_functions[] = {
- PHP_FE(constant, NULL)
- PHP_FE(bin2hex, NULL)
- PHP_FE(sleep, NULL)
- PHP_FE(usleep, NULL)
+ PHP_FE(constant, arginfo_constant)
+ PHP_FE(bin2hex, arginfo_bin2hex)
+ PHP_FE(sleep, arginfo_sleep)
+ PHP_FE(usleep, arginfo_usleep)
#if HAVE_NANOSLEEP
- PHP_FE(time_nanosleep, NULL)
- PHP_FE(time_sleep_until, NULL)
+ PHP_FE(time_nanosleep, arginfo_time_nanosleep)
+ PHP_FE(time_sleep_until, arginfo_time_sleep_until)
#endif
#if HAVE_STRPTIME
- PHP_FE(strptime, NULL)
-#endif
-
- PHP_FE(flush, NULL)
- PHP_FE(wordwrap, NULL)
- PHP_FE(htmlspecialchars, NULL)
- PHP_FE(htmlentities, NULL)
- PHP_FE(html_entity_decode, NULL)
- PHP_FE(htmlspecialchars_decode, NULL)
- PHP_FE(get_html_translation_table, NULL)
- PHP_FE(sha1, NULL)
- PHP_FE(sha1_file, NULL)
- PHP_NAMED_FE(md5,php_if_md5, NULL)
- PHP_NAMED_FE(md5_file,php_if_md5_file, NULL)
- PHP_NAMED_FE(crc32,php_if_crc32, NULL)
-
- PHP_FE(iptcparse, NULL)
- PHP_FE(iptcembed, NULL)
- PHP_FE(getimagesize, second_arg_force_ref)
- PHP_FE(image_type_to_mime_type, NULL)
-
- PHP_FE(phpinfo, NULL)
- PHP_FE(phpversion, NULL)
- PHP_FE(phpcredits, NULL)
- PHP_FE(php_logo_guid, NULL)
- PHP_FE(php_real_logo_guid, NULL)
- PHP_FE(php_egg_logo_guid, NULL)
- PHP_FE(zend_logo_guid, NULL)
- PHP_FE(php_sapi_name, NULL)
- PHP_FE(php_uname, NULL)
- PHP_FE(php_ini_scanned_files, NULL)
-
- PHP_FE(strnatcmp, NULL)
- PHP_FE(strnatcasecmp, NULL)
- PHP_FE(substr_count, NULL)
- PHP_FE(strspn, NULL)
- PHP_FE(strcspn, NULL)
- PHP_FE(strtok, NULL)
- PHP_FE(strtoupper, NULL)
- PHP_FE(strtolower, NULL)
- PHP_FE(strpos, NULL)
- PHP_FE(stripos, NULL)
- PHP_FE(strrpos, NULL)
- PHP_FE(strripos, NULL)
- PHP_FE(strrev, NULL)
- PHP_FE(hebrev, NULL)
- PHP_FE(hebrevc, NULL)
- PHP_FE(nl2br, NULL)
- PHP_FE(basename, NULL)
- PHP_FE(dirname, NULL)
- PHP_FE(pathinfo, NULL)
- PHP_FE(stripslashes, NULL)
- PHP_FE(stripcslashes, NULL)
- PHP_FE(strstr, NULL)
- PHP_FE(stristr, NULL)
- PHP_FE(strrchr, NULL)
- PHP_FE(str_shuffle, NULL)
- PHP_FE(str_word_count, NULL)
- PHP_FE(str_split, NULL)
- PHP_FE(strpbrk, NULL)
- PHP_FE(substr_compare, NULL)
+ PHP_FE(strptime, arginfo_strptime)
+#endif
+
+ PHP_FE(flush, arginfo_flush)
+ PHP_FE(wordwrap, arginfo_wordwrap)
+ PHP_FE(htmlspecialchars, arginfo_htmlspecialchars)
+ PHP_FE(htmlentities, arginfo_htmlentities)
+ PHP_FE(html_entity_decode, arginfo_html_entity_decode)
+ PHP_FE(htmlspecialchars_decode, arginfo_htmlspecialchars_decode)
+ PHP_FE(get_html_translation_table, arginfo_get_html_translation_table)
+ PHP_FE(sha1, arginfo_sha1)
+ PHP_FE(sha1_file, arginfo_sha1_file)
+ PHP_NAMED_FE(md5,php_if_md5, arginfo_md5)
+ PHP_NAMED_FE(md5_file,php_if_md5_file, arginfo_md5_file)
+ PHP_NAMED_FE(crc32,php_if_crc32, arginfo_crc32)
+
+ PHP_FE(iptcparse, arginfo_iptcparse)
+ PHP_FE(iptcembed, arginfo_iptcembed)
+ PHP_FE(getimagesize, arginfo_getimagesize)
+ PHP_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type)
+ PHP_FE(image_type_to_extension, arginfo_image_type_to_extension)
+
+ PHP_FE(phpinfo, arginfo_phpinfo)
+ PHP_FE(phpversion, arginfo_phpversion)
+ PHP_FE(phpcredits, arginfo_phpcredits)
+ PHP_FE(php_logo_guid, arginfo_php_logo_guid)
+ PHP_FE(php_real_logo_guid, arginfo_php_real_logo_guid)
+ PHP_FE(php_egg_logo_guid, arginfo_php_egg_logo_guid)
+ PHP_FE(zend_logo_guid, arginfo_zend_logo_guid)
+ PHP_FE(php_sapi_name, arginfo_php_sapi_name)
+ PHP_FE(php_uname, arginfo_php_uname)
+ PHP_FE(php_ini_scanned_files, arginfo_php_ini_scanned_files)
+
+ PHP_FE(strnatcmp, arginfo_strnatcmp)
+ PHP_FE(strnatcasecmp, arginfo_strnatcasecmp)
+ PHP_FE(substr_count, arginfo_substr_count)
+ PHP_FE(strspn, arginfo_strspn)
+ PHP_FE(strcspn, arginfo_strcspn)
+ PHP_FE(strtok, arginfo_strtok)
+ PHP_FE(strtoupper, arginfo_strtoupper)
+ PHP_FE(strtolower, arginfo_strtolower)
+ PHP_FE(strpos, arginfo_strpos)
+ PHP_FE(stripos, arginfo_stripos)
+ PHP_FE(strrpos, arginfo_strrpos)
+ PHP_FE(strripos, arginfo_strripos)
+ PHP_FE(strrev, arginfo_strrev)
+ PHP_FE(hebrev, arginfo_hebrev)
+ PHP_FE(hebrevc, arginfo_hebrevc)
+ PHP_FE(nl2br, arginfo_nl2br)
+ PHP_FE(basename, arginfo_basename)
+ PHP_FE(dirname, arginfo_dirname)
+ PHP_FE(pathinfo, arginfo_pathinfo)
+ PHP_FE(stripslashes, arginfo_stripslashes)
+ PHP_FE(stripcslashes, arginfo_stripcslashes)
+ PHP_FE(strstr, arginfo_strstr)
+ PHP_FE(stristr, arginfo_stristr)
+ PHP_FE(strrchr, arginfo_strrchr)
+ PHP_FE(str_shuffle, arginfo_str_shuffle)
+ PHP_FE(str_word_count, arginfo_str_word_count)
+ PHP_FE(str_split, arginfo_str_split)
+ PHP_FE(strpbrk, arginfo_strpbrk)
+ PHP_FE(substr_compare, arginfo_substr_compare)
#ifdef HAVE_STRCOLL
- PHP_FE(strcoll, NULL)
+ PHP_FE(strcoll, arginfo_strcoll)
#endif
#ifdef HAVE_STRFMON
- PHP_FE(money_format, NULL)
-#endif
-
- PHP_FE(substr, NULL)
- PHP_FE(substr_replace, NULL)
- PHP_FE(quotemeta, NULL)
- PHP_FE(ucfirst, NULL)
- PHP_FE(ucwords, NULL)
- PHP_FE(strtr, NULL)
- PHP_FE(addslashes, NULL)
- PHP_FE(addcslashes, NULL)
- PHP_FE(rtrim, NULL)
- PHP_FE(str_replace, fourth_arg_force_ref)
- PHP_FE(str_ireplace, fourth_arg_force_ref)
- PHP_FE(str_repeat, NULL)
- PHP_FE(count_chars, NULL)
- PHP_FE(chunk_split, NULL)
- PHP_FE(trim, NULL)
- PHP_FE(ltrim, NULL)
- PHP_FE(strip_tags, NULL)
- PHP_FE(similar_text, third_arg_force_ref)
- PHP_FE(explode, NULL)
- PHP_FE(implode, NULL)
- PHP_FE(setlocale, NULL)
- PHP_FE(localeconv, NULL)
+ PHP_FE(money_format, arginfo_money_format)
+#endif
+
+ PHP_FE(substr, arginfo_substr)
+ PHP_FE(substr_replace, arginfo_substr_replace)
+ PHP_FE(quotemeta, arginfo_quotemeta)
+ PHP_FE(ucfirst, arginfo_ucfirst)
+ PHP_FE(ucwords, arginfo_ucwords)
+ PHP_FE(strtr, arginfo_strtr)
+ PHP_FE(addslashes, arginfo_addslashes)
+ PHP_FE(addcslashes, arginfo_addcslashes)
+ PHP_FE(rtrim, arginfo_rtrim)
+ PHP_FE(str_replace, arginfo_str_replace)
+ PHP_FE(str_ireplace, arginfo_str_ireplace)
+ PHP_FE(str_repeat, arginfo_str_repeat)
+ PHP_FE(count_chars, arginfo_count_chars)
+ PHP_FE(chunk_split, arginfo_chunk_split)
+ PHP_FE(trim, arginfo_trim)
+ PHP_FE(ltrim, arginfo_ltrim)
+ PHP_FE(strip_tags, arginfo_strip_tags)
+ PHP_FE(similar_text, arginfo_similar_text)
+ PHP_FE(explode, arginfo_explode)
+ PHP_FE(implode, arginfo_implode)
+ PHP_FE(setlocale, arginfo_setlocale)
+ PHP_FE(localeconv, arginfo_localeconv)
#if HAVE_NL_LANGINFO
- PHP_FE(nl_langinfo, NULL)
-#endif
-
- PHP_FE(soundex, NULL)
- PHP_FE(levenshtein, NULL)
- PHP_FE(chr, NULL)
- PHP_FE(ord, NULL)
- PHP_FE(parse_str, second_arg_force_ref)
- PHP_FE(str_pad, NULL)
- PHP_FALIAS(chop, rtrim, NULL)
- PHP_FALIAS(strchr, strstr, NULL)
- PHP_NAMED_FE(sprintf, PHP_FN(user_sprintf), NULL)
- PHP_NAMED_FE(printf, PHP_FN(user_printf), NULL)
- PHP_FE(vprintf, NULL)
- PHP_FE(vsprintf, NULL)
- PHP_FE(fprintf, NULL)
- PHP_FE(vfprintf, NULL)
- PHP_FE(sscanf, third_and_rest_force_ref)
- PHP_FE(fscanf, third_and_rest_force_ref)
- PHP_FE(parse_url, NULL)
- PHP_FE(urlencode, NULL)
- PHP_FE(urldecode, NULL)
- PHP_FE(rawurlencode, NULL)
- PHP_FE(rawurldecode, NULL)
- PHP_FE(http_build_query, NULL)
+ PHP_FE(nl_langinfo, arginfo_nl_langinfo)
+#endif
+
+ PHP_FE(soundex, arginfo_soundex)
+ PHP_FE(levenshtein, arginfo_levenshtein)
+ PHP_FE(chr, arginfo_chr)
+ PHP_FE(ord, arginfo_ord)
+ PHP_FE(parse_str, arginfo_parse_str)
+ PHP_FE(str_pad, arginfo_str_pad)
+ PHP_FALIAS(chop, rtrim, arginfo_rtrim)
+ PHP_FALIAS(strchr, strstr, arginfo_strstr)
+ PHP_NAMED_FE(sprintf, PHP_FN(user_sprintf), arginfo_sprintf)
+ PHP_NAMED_FE(printf, PHP_FN(user_printf), arginfo_printf)
+ PHP_FE(vprintf, arginfo_vprintf)
+ PHP_FE(vsprintf, arginfo_vsprintf)
+ PHP_FE(fprintf, arginfo_fprintf)
+ PHP_FE(vfprintf, arginfo_vfprintf)
+ PHP_FE(sscanf, arginfo_sscanf)
+ PHP_FE(fscanf, arginfo_fscanf)
+ PHP_FE(parse_url, arginfo_parse_url)
+ PHP_FE(urlencode, arginfo_urlencode)
+ PHP_FE(urldecode, arginfo_urldecode)
+ PHP_FE(rawurlencode, arginfo_rawurlencode)
+ PHP_FE(rawurldecode, arginfo_rawurldecode)
+ PHP_FE(http_build_query, arginfo_http_build_query)
#ifdef HAVE_SYMLINK
- PHP_FE(readlink, NULL)
- PHP_FE(linkinfo, NULL)
- PHP_FE(symlink, NULL)
- PHP_FE(link, NULL)
-#endif
-
- PHP_FE(unlink, NULL)
- PHP_FE(exec, second_and_third_args_force_ref)
- PHP_FE(system, second_arg_force_ref)
- PHP_FE(escapeshellcmd, NULL)
- PHP_FE(escapeshellarg, NULL)
- PHP_FE(passthru, second_arg_force_ref)
- PHP_FE(shell_exec, NULL)
+ PHP_FE(readlink, arginfo_readlink)
+ PHP_FE(linkinfo, arginfo_linkinfo)
+ PHP_FE(symlink, arginfo_symlink)
+ PHP_FE(link, arginfo_link)
+#endif
+
+ PHP_FE(unlink, arginfo_unlink)
+ PHP_FE(exec, arginfo_exec)
+ PHP_FE(system, arginfo_system)
+ PHP_FE(escapeshellcmd, arginfo_escapeshellcmd)
+ PHP_FE(escapeshellarg, arginfo_escapeshellarg)
+ PHP_FE(passthru, arginfo_passthru)
+ PHP_FE(shell_exec, arginfo_shell_exec)
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
- PHP_FE(proc_open, third_arg_force_ref)
- PHP_FE(proc_close, NULL)
- PHP_FE(proc_terminate, NULL)
- PHP_FE(proc_get_status, NULL)
+ PHP_FE(proc_open, arginfo_proc_open)
+ PHP_FE(proc_close, arginfo_proc_close)
+ PHP_FE(proc_terminate, arginfo_proc_terminate)
+ PHP_FE(proc_get_status, arginfo_proc_get_status)
#endif
#ifdef HAVE_NICE
- PHP_FE(proc_nice, NULL)
+ PHP_FE(proc_nice, arginfo_proc_nice)
#endif
- PHP_FE(rand, NULL)
- PHP_FE(srand, NULL)
- PHP_FE(getrandmax, NULL)
- PHP_FE(mt_rand, NULL)
- PHP_FE(mt_srand, NULL)
- PHP_FE(mt_getrandmax, NULL)
+ PHP_FE(rand, arginfo_rand)
+ PHP_FE(srand, arginfo_srand)
+ PHP_FE(getrandmax, arginfo_getrandmax)
+ PHP_FE(mt_rand, arginfo_mt_rand)
+ PHP_FE(mt_srand, arginfo_mt_srand)
+ PHP_FE(mt_getrandmax, arginfo_mt_getrandmax)
#if HAVE_GETSERVBYNAME
- PHP_FE(getservbyname, NULL)
+ PHP_FE(getservbyname, arginfo_getservbyname)
#endif
#if HAVE_GETSERVBYPORT
- PHP_FE(getservbyport, NULL)
+ PHP_FE(getservbyport, arginfo_getservbyport)
#endif
#if HAVE_GETPROTOBYNAME
- PHP_FE(getprotobyname, NULL)
+ PHP_FE(getprotobyname, arginfo_getprotobyname)
#endif
#if HAVE_GETPROTOBYNUMBER
- PHP_FE(getprotobynumber, NULL)
-#endif
-
- PHP_FE(getmyuid, NULL)
- PHP_FE(getmygid, NULL)
- PHP_FE(getmypid, NULL)
- PHP_FE(getmyinode, NULL)
- PHP_FE(getlastmod, NULL)
-
- PHP_FE(base64_decode, NULL)
- PHP_FE(base64_encode, NULL)
-
- PHP_FE(convert_uuencode, NULL)
- PHP_FE(convert_uudecode, NULL)
-
- PHP_FE(abs, NULL)
- PHP_FE(ceil, NULL)
- PHP_FE(floor, NULL)
- PHP_FE(round, NULL)
- PHP_FE(sin, NULL)
- PHP_FE(cos, NULL)
- PHP_FE(tan, NULL)
- PHP_FE(asin, NULL)
- PHP_FE(acos, NULL)
- PHP_FE(atan, NULL)
- PHP_FE(atan2, NULL)
- PHP_FE(sinh, NULL)
- PHP_FE(cosh, NULL)
- PHP_FE(tanh, NULL)
+ PHP_FE(getprotobynumber, arginfo_getprotobynumber)
+#endif
+
+ PHP_FE(getmyuid, arginfo_getmyuid)
+ PHP_FE(getmygid, arginfo_getmygid)
+ PHP_FE(getmypid, arginfo_getmypid)
+ PHP_FE(getmyinode, arginfo_getmyinode)
+ PHP_FE(getlastmod, arginfo_getlastmod)
+
+ PHP_FE(base64_decode, arginfo_base64_decode)
+ PHP_FE(base64_encode, arginfo_base64_encode)
+
+ PHP_FE(convert_uuencode, arginfo_convert_uuencode)
+ PHP_FE(convert_uudecode, arginfo_convert_uudecode)
+
+ PHP_FE(abs, arginfo_abs)
+ PHP_FE(ceil, arginfo_ceil)
+ PHP_FE(floor, arginfo_floor)
+ PHP_FE(round, arginfo_round)
+ PHP_FE(sin, arginfo_sin)
+ PHP_FE(cos, arginfo_cos)
+ PHP_FE(tan, arginfo_tan)
+ PHP_FE(asin, arginfo_asin)
+ PHP_FE(acos, arginfo_acos)
+ PHP_FE(atan, arginfo_atan)
+ PHP_FE(atan2, arginfo_atan2)
+ PHP_FE(sinh, arginfo_sinh)
+ PHP_FE(cosh, arginfo_cosh)
+ PHP_FE(tanh, arginfo_tanh)
#ifdef HAVE_ASINH
- PHP_FE(asinh, NULL)
+ PHP_FE(asinh, arginfo_asinh)
#endif
#ifdef HAVE_ACOSH
- PHP_FE(acosh, NULL)
+ PHP_FE(acosh, arginfo_acosh)
#endif
#ifdef HAVE_ATANH
- PHP_FE(atanh, NULL)
+ PHP_FE(atanh, arginfo_atanh)
#endif
#if !defined(PHP_WIN32) && !defined(NETWARE)
- PHP_FE(expm1, NULL)
+ PHP_FE(expm1, arginfo_expm1)
# ifdef HAVE_LOG1P
- PHP_FE(log1p, NULL)
+ PHP_FE(log1p, arginfo_log1p)
# endif
#endif
- PHP_FE(pi, NULL)
- PHP_FE(is_finite, NULL)
- PHP_FE(is_nan, NULL)
- PHP_FE(is_infinite, NULL)
- PHP_FE(pow, NULL)
- PHP_FE(exp, NULL)
- PHP_FE(log, NULL)
- PHP_FE(log10, NULL)
- PHP_FE(sqrt, NULL)
- PHP_FE(hypot, NULL)
- PHP_FE(deg2rad, NULL)
- PHP_FE(rad2deg, NULL)
- PHP_FE(bindec, NULL)
- PHP_FE(hexdec, NULL)
- PHP_FE(octdec, NULL)
- PHP_FE(decbin, NULL)
- PHP_FE(decoct, NULL)
- PHP_FE(dechex, NULL)
- PHP_FE(base_convert, NULL)
- PHP_FE(number_format, NULL)
- PHP_FE(fmod, NULL)
+ PHP_FE(pi, arginfo_pi)
+ PHP_FE(is_finite, arginfo_is_finite)
+ PHP_FE(is_nan, arginfo_is_nan)
+ PHP_FE(is_infinite, arginfo_is_infinite)
+ PHP_FE(pow, arginfo_pow)
+ PHP_FE(exp, arginfo_exp)
+ PHP_FE(log, arginfo_log)
+ PHP_FE(log10, arginfo_log10)
+ PHP_FE(sqrt, arginfo_sqrt)
+ PHP_FE(hypot, arginfo_hypot)
+ PHP_FE(deg2rad, arginfo_deg2rad)
+ PHP_FE(rad2deg, arginfo_rad2deg)
+ PHP_FE(bindec, arginfo_bindec)
+ PHP_FE(hexdec, arginfo_hexdec)
+ PHP_FE(octdec, arginfo_octdec)
+ PHP_FE(decbin, arginfo_decbin)
+ PHP_FE(decoct, arginfo_decoct)
+ PHP_FE(dechex, arginfo_dechex)
+ PHP_FE(base_convert, arginfo_base_convert)
+ PHP_FE(number_format, arginfo_number_format)
+ PHP_FE(fmod, arginfo_fmod)
#ifdef HAVE_INET_NTOP
- PHP_NAMED_FE(inet_ntop, php_inet_ntop, NULL)
+ PHP_NAMED_FE(inet_ntop, php_inet_ntop, arginfo_inet_ntop)
#endif
#ifdef HAVE_INET_PTON
- PHP_NAMED_FE(inet_pton, php_inet_pton, NULL)
+ PHP_NAMED_FE(inet_pton, php_inet_pton, arginfo_inet_pton)
#endif
- PHP_FE(ip2long, NULL)
- PHP_FE(long2ip, NULL)
+ PHP_FE(ip2long, arginfo_ip2long)
+ PHP_FE(long2ip, arginfo_long2ip)
- PHP_FE(getenv, NULL)
+ PHP_FE(getenv, arginfo_getenv)
#ifdef HAVE_PUTENV
- PHP_FE(putenv, NULL)
+ PHP_FE(putenv, arginfo_putenv)
#endif
#ifdef HAVE_GETOPT
- PHP_FE(getopt, NULL)
+ PHP_FE(getopt, arginfo_getopt)
#endif
#ifdef HAVE_GETLOADAVG
- PHP_FE(sys_getloadavg, NULL)
+ PHP_FE(sys_getloadavg, arginfo_sys_getloadavg)
#endif
#ifdef HAVE_GETTIMEOFDAY
- PHP_FE(microtime, NULL)
- PHP_FE(gettimeofday, NULL)
+ PHP_FE(microtime, arginfo_microtime)
+ PHP_FE(gettimeofday, arginfo_gettimeofday)
#endif
#ifdef HAVE_GETRUSAGE
- PHP_FE(getrusage, NULL)
+ PHP_FE(getrusage, arginfo_getrusage)
#endif
#ifdef HAVE_GETTIMEOFDAY
- PHP_FE(uniqid, NULL)
-#endif
-
- PHP_FE(quoted_printable_decode, NULL)
- PHP_FE(convert_cyr_string, NULL)
- PHP_FE(get_current_user, NULL)
- PHP_FE(set_time_limit, NULL)
- PHP_FE(get_cfg_var, NULL)
- PHP_FALIAS(magic_quotes_runtime, set_magic_quotes_runtime, NULL)
- PHP_FE(set_magic_quotes_runtime, NULL)
- PHP_FE(get_magic_quotes_gpc, NULL)
- PHP_FE(get_magic_quotes_runtime, NULL)
-
- PHP_FE(import_request_variables, NULL)
- PHP_FE(error_log, NULL)
- PHP_FE(call_user_func, NULL)
- PHP_FE(call_user_func_array, NULL)
- PHP_FE(call_user_method, second_arg_force_ref)
- PHP_FE(call_user_method_array, second_arg_force_ref)
- PHP_FE(serialize, NULL)
- PHP_FE(unserialize, NULL)
-
- PHP_FE(var_dump, NULL)
- PHP_FE(var_export, NULL)
- PHP_FE(debug_zval_dump, NULL)
- PHP_FE(print_r, NULL)
+ PHP_FE(uniqid, arginfo_uniqid)
+#endif
+
+ PHP_FE(quoted_printable_decode, arginfo_quoted_printable_decode)
+ PHP_FE(convert_cyr_string, arginfo_convert_cyr_string)
+ PHP_FE(get_current_user, arginfo_get_current_user)
+ PHP_FE(set_time_limit, arginfo_set_time_limit)
+ PHP_FE(get_cfg_var, arginfo_get_cfg_var)
+ PHP_FALIAS(magic_quotes_runtime, set_magic_quotes_runtime, NULL)
+ PHP_FE(set_magic_quotes_runtime, NULL)
+ PHP_FE(get_magic_quotes_gpc, NULL)
+ PHP_FE(get_magic_quotes_runtime, NULL)
+
+ PHP_FE(import_request_variables, arginfo_import_request_variables)
+ PHP_FE(error_log, arginfo_error_log)
+ PHP_FE(error_get_last, arginfo_error_get_last)
+ PHP_FE(call_user_func, arginfo_call_user_func)
+ PHP_FE(call_user_func_array, arginfo_call_user_func_array)
+ PHP_DEP_FE(call_user_method, arginfo_call_user_method)
+ PHP_DEP_FE(call_user_method_array, arginfo_call_user_method_array)
+ PHP_FE(serialize, arginfo_serialize)
+ PHP_FE(unserialize, arginfo_unserialize)
+
+ PHP_FE(var_dump, arginfo_var_dump)
+ PHP_FE(var_export, arginfo_var_export)
+ PHP_FE(debug_zval_dump, arginfo_debug_zval_dump)
+ PHP_FE(print_r, arginfo_print_r)
#if MEMORY_LIMIT
- PHP_FE(memory_get_usage, NULL)
-#endif
-
- PHP_FE(register_shutdown_function, NULL)
- PHP_FE(register_tick_function, NULL)
- PHP_FE(unregister_tick_function, NULL)
-
- PHP_FE(highlight_file, NULL)
- PHP_FALIAS(show_source, highlight_file, NULL)
- PHP_FE(highlight_string, NULL)
- PHP_FE(php_strip_whitespace, NULL)
-
- PHP_FE(ini_get, NULL)
- PHP_FE(ini_get_all, NULL)
- PHP_FE(ini_set, NULL)
- PHP_FALIAS(ini_alter, ini_set, NULL)
- PHP_FE(ini_restore, NULL)
- PHP_FE(get_include_path, NULL)
- PHP_FE(set_include_path, NULL)
- PHP_FE(restore_include_path, NULL)
-
- PHP_FE(setcookie, NULL)
- PHP_FE(setrawcookie, NULL)
- PHP_FE(header, NULL)
- PHP_FE(headers_sent, first_and_second__args_force_ref)
- PHP_FE(headers_list, NULL)
-
- PHP_FE(connection_aborted, NULL)
- PHP_FE(connection_status, NULL)
- PHP_FE(ignore_user_abort, NULL)
- PHP_FE(parse_ini_file, NULL)
- PHP_FE(is_uploaded_file, NULL)
- PHP_FE(move_uploaded_file, NULL)
+ PHP_FE(memory_get_usage, arginfo_memory_get_usage)
+ PHP_FE(memory_get_peak_usage, arginfo_memory_get_peak_usage)
+#endif
+
+ PHP_FE(register_shutdown_function, arginfo_register_shutdown_function)
+ PHP_FE(register_tick_function, arginfo_register_tick_function)
+ PHP_FE(unregister_tick_function, arginfo_unregister_tick_function)
+
+ PHP_FE(highlight_file, arginfo_highlight_file)
+ PHP_FALIAS(show_source, highlight_file, arginfo_highlight_file)
+ PHP_FE(highlight_string, arginfo_highlight_string)
+ PHP_FE(php_strip_whitespace, arginfo_php_strip_whitespace)
+
+ PHP_FE(ini_get, arginfo_ini_get)
+ PHP_FE(ini_get_all, arginfo_ini_get_all)
+ PHP_FE(ini_set, arginfo_ini_set)
+ PHP_FALIAS(ini_alter, ini_set, arginfo_ini_set)
+ PHP_FE(ini_restore, arginfo_ini_restore)
+ PHP_FE(get_include_path, arginfo_get_include_path)
+ PHP_FE(set_include_path, arginfo_set_include_path)
+ PHP_FE(restore_include_path, arginfo_restore_include_path)
+
+ PHP_FE(setcookie, arginfo_setcookie)
+ PHP_FE(setrawcookie, arginfo_setrawcookie)
+ PHP_FE(header, arginfo_header)
+ PHP_FE(headers_sent, arginfo_headers_sent)
+ PHP_FE(headers_list, arginfo_headers_list)
+
+ PHP_FE(connection_aborted, arginfo_connection_aborted)
+ PHP_FE(connection_status, arginfo_connection_status)
+ PHP_FE(ignore_user_abort, arginfo_ignore_user_abort)
+ PHP_FE(parse_ini_file, arginfo_parse_ini_file)
+ PHP_FE(is_uploaded_file, arginfo_is_uploaded_file)
+ PHP_FE(move_uploaded_file, arginfo_move_uploaded_file)
/* functions from dns.c */
- PHP_FE(gethostbyaddr, NULL)
- PHP_FE(gethostbyname, NULL)
- PHP_FE(gethostbynamel, NULL)
+ PHP_FE(gethostbyaddr, arginfo_gethostbyaddr)
+ PHP_FE(gethostbyname, arginfo_gethostbyname)
+ PHP_FE(gethostbynamel, arginfo_gethostbynamel)
#if HAVE_RES_SEARCH && !(defined(__BEOS__) || defined(PHP_WIN32) || defined(NETWARE))
- PHP_FE(dns_check_record, NULL)
- PHP_FALIAS(checkdnsrr, dns_check_record, NULL)
+ PHP_FE(dns_check_record, arginfo_dns_check_record)
+ PHP_FALIAS(checkdnsrr, dns_check_record, arginfo_dns_check_record)
# if HAVE_DN_SKIPNAME && HAVE_DN_EXPAND
- PHP_FE(dns_get_mx, second_and_third_args_force_ref)
- PHP_FALIAS(getmxrr, dns_get_mx, second_and_third_args_force_ref)
+ PHP_FE(dns_get_mx, arginfo_dns_get_mx)
+ PHP_FALIAS(getmxrr, dns_get_mx, arginfo_dns_get_mx)
# endif
# if HAVE_DNS_FUNCS
- PHP_FE(dns_get_record, third_and_rest_force_ref)
+ PHP_FE(dns_get_record, arginfo_dns_get_record)
# endif
#endif
/* functions from type.c */
- PHP_FE(intval, NULL)
- PHP_FE(floatval, NULL)
- PHP_FALIAS(doubleval, floatval, NULL)
- PHP_FE(strval, NULL)
- PHP_FE(gettype, NULL)
- PHP_FE(settype, first_arg_force_ref)
- PHP_FE(is_null, NULL)
- PHP_FE(is_resource, NULL)
- PHP_FE(is_bool, NULL)
- PHP_FE(is_long, NULL)
- PHP_FE(is_float, NULL)
- PHP_FALIAS(is_int, is_long, NULL)
- PHP_FALIAS(is_integer, is_long, NULL)
- PHP_FALIAS(is_double, is_float, NULL)
- PHP_FALIAS(is_real, is_float, NULL)
- PHP_FE(is_numeric, NULL)
- PHP_FE(is_string, NULL)
- PHP_FE(is_array, NULL)
- PHP_FE(is_object, NULL)
- PHP_FE(is_scalar, NULL)
- PHP_FE(is_callable, third_arg_force_ref)
+ PHP_FE(intval, arginfo_intval)
+ PHP_FE(floatval, arginfo_floatval)
+ PHP_FALIAS(doubleval, floatval, arginfo_floatval)
+ PHP_FE(strval, arginfo_strval)
+ PHP_FE(gettype, arginfo_gettype)
+ PHP_FE(settype, arginfo_settype)
+ PHP_FE(is_null, arginfo_is_null)
+ PHP_FE(is_resource, arginfo_is_resource)
+ PHP_FE(is_bool, arginfo_is_bool)
+ PHP_FE(is_long, arginfo_is_long)
+ PHP_FE(is_float, arginfo_is_float)
+ PHP_FALIAS(is_int, is_long, arginfo_is_long)
+ PHP_FALIAS(is_integer, is_long, arginfo_is_long)
+ PHP_FALIAS(is_double, is_float, arginfo_is_float)
+ PHP_FALIAS(is_real, is_float, arginfo_is_float)
+ PHP_FE(is_numeric, arginfo_is_numeric)
+ PHP_FE(is_string, arginfo_is_string)
+ PHP_FE(is_array, arginfo_is_array)
+ PHP_FE(is_object, arginfo_is_object)
+ PHP_FE(is_scalar, arginfo_is_scalar)
+ PHP_FE(is_callable, arginfo_is_callable)
/* functions from reg.c */
- PHP_FE(ereg, third_arg_force_ref)
- PHP_FE(ereg_replace, NULL)
- PHP_FE(eregi, third_arg_force_ref)
- PHP_FE(eregi_replace, NULL)
- PHP_FE(split, NULL)
- PHP_FE(spliti, NULL)
- PHP_FALIAS(join, implode, NULL)
- PHP_FE(sql_regcase, NULL)
+ PHP_FE(ereg, arginfo_ereg)
+ PHP_FE(ereg_replace, arginfo_ereg_replace)
+ PHP_FE(eregi, arginfo_eregi)
+ PHP_FE(eregi_replace, arginfo_eregi_replace)
+ PHP_FE(split, arginfo_split)
+ PHP_FE(spliti, arginfo_spliti)
+ PHP_FALIAS(join, implode, arginfo_implode)
+ PHP_FE(sql_regcase, arginfo_sql_regcase)
/* functions from dl.c */
- PHP_FE(dl, NULL)
+ PHP_FE(dl, arginfo_dl)
/* functions from file.c */
- PHP_FE(pclose, NULL)
- PHP_FE(popen, NULL)
- PHP_FE(readfile, NULL)
- PHP_FE(rewind, NULL)
- PHP_FE(rmdir, NULL)
- PHP_FE(umask, NULL)
- PHP_FE(fclose, NULL)
- PHP_FE(feof, NULL)
- PHP_FE(fgetc, NULL)
- PHP_FE(fgets, NULL)
- PHP_FE(fgetss, NULL)
- PHP_FE(fread, NULL)
- PHP_NAMED_FE(fopen, php_if_fopen, NULL)
- PHP_FE(fpassthru, NULL)
- PHP_NAMED_FE(ftruncate, php_if_ftruncate, NULL)
- PHP_NAMED_FE(fstat, php_if_fstat, NULL)
- PHP_FE(fseek, NULL)
- PHP_FE(ftell, NULL)
- PHP_FE(fflush, NULL)
- PHP_FE(fwrite, NULL)
- PHP_FALIAS(fputs, fwrite, NULL)
- PHP_FE(mkdir, NULL)
- PHP_FE(rename, NULL)
- PHP_FE(copy, NULL)
- PHP_FE(tempnam, NULL)
- PHP_NAMED_FE(tmpfile, php_if_tmpfile, NULL)
- PHP_FE(file, NULL)
- PHP_FE(file_get_contents, NULL)
- PHP_FE(file_put_contents, NULL)
- PHP_FE(stream_select, first_through_third_args_force_ref)
- PHP_FE(stream_context_create, NULL)
- PHP_FE(stream_context_set_params, NULL)
- PHP_FE(stream_context_set_option, NULL)
- PHP_FE(stream_context_get_options, NULL)
- PHP_FE(stream_context_get_default, NULL)
- PHP_FE(stream_filter_prepend, NULL)
- PHP_FE(stream_filter_append, NULL)
- PHP_FE(stream_filter_remove, NULL)
- PHP_FE(stream_socket_client, second_and_third_args_force_ref)
- PHP_FE(stream_socket_server, second_and_third_args_force_ref)
- PHP_FE(stream_socket_accept, third_arg_force_ref)
- PHP_FE(stream_socket_get_name, NULL)
- PHP_FE(stream_socket_recvfrom, fourth_arg_force_ref)
- PHP_FE(stream_socket_sendto, NULL)
- PHP_FE(stream_socket_enable_crypto, NULL)
+ PHP_FE(pclose, arginfo_pclose)
+ PHP_FE(popen, arginfo_popen)
+ PHP_FE(readfile, arginfo_readfile)
+ PHP_FE(rewind, arginfo_rewind)
+ PHP_FE(rmdir, arginfo_rmdir)
+ PHP_FE(umask, arginfo_umask)
+ PHP_FE(fclose, arginfo_fclose)
+ PHP_FE(feof, arginfo_feof)
+ PHP_FE(fgetc, arginfo_fgetc)
+ PHP_FE(fgets, arginfo_fgets)
+ PHP_FE(fgetss, arginfo_fgetss)
+ PHP_FE(fread, arginfo_fread)
+ PHP_NAMED_FE(fopen, php_if_fopen, arginfo_fopen)
+ PHP_FE(fpassthru, arginfo_fpassthru)
+ PHP_NAMED_FE(ftruncate, php_if_ftruncate, arginfo_ftruncate)
+ PHP_NAMED_FE(fstat, php_if_fstat, arginfo_fstat)
+ PHP_FE(fseek, arginfo_fseek)
+ PHP_FE(ftell, arginfo_ftell)
+ PHP_FE(fflush, arginfo_fflush)
+ PHP_FE(fwrite, arginfo_fwrite)
+ PHP_FALIAS(fputs, fwrite, arginfo_fwrite)
+ PHP_FE(mkdir, arginfo_mkdir)
+ PHP_FE(rename, arginfo_rename)
+ PHP_FE(copy, arginfo_copy)
+ PHP_FE(tempnam, arginfo_tempnam)
+ PHP_NAMED_FE(tmpfile, php_if_tmpfile, arginfo_tmpfile)
+ PHP_FE(file, arginfo_file)
+ PHP_FE(file_get_contents, arginfo_file_get_contents)
+ PHP_FE(file_put_contents, arginfo_file_put_contents)
+ PHP_FE(stream_select, arginfo_stream_select)
+ PHP_FE(stream_context_create, arginfo_stream_context_create)
+ PHP_FE(stream_context_set_params, arginfo_stream_context_set_params)
+ PHP_FE(stream_context_set_option, arginfo_stream_context_set_option)
+ PHP_FE(stream_context_get_options, arginfo_stream_context_get_options)
+ PHP_FE(stream_context_get_default, arginfo_stream_context_get_default)
+ PHP_FE(stream_filter_prepend, arginfo_stream_filter_prepend)
+ PHP_FE(stream_filter_append, arginfo_stream_filter_append)
+ PHP_FE(stream_filter_remove, arginfo_stream_filter_remove)
+ PHP_FE(stream_socket_client, arginfo_stream_socket_client)
+ PHP_FE(stream_socket_server, arginfo_stream_socket_server)
+ PHP_FE(stream_socket_accept, arginfo_stream_socket_accept)
+ PHP_FE(stream_socket_get_name, arginfo_stream_socket_get_name)
+ PHP_FE(stream_socket_recvfrom, arginfo_stream_socket_recvfrom)
+ PHP_FE(stream_socket_sendto, arginfo_stream_socket_sendto)
+ PHP_FE(stream_socket_enable_crypto, arginfo_stream_socket_enable_crypto)
#if HAVE_SOCKETPAIR
- PHP_FE(stream_socket_pair, NULL)
-#endif
- PHP_FE(stream_copy_to_stream, NULL)
- PHP_FE(stream_get_contents, NULL)
- PHP_FE(fgetcsv, NULL)
- PHP_FE(fputcsv, NULL)
- PHP_FE(flock, third_arg_force_ref)
- PHP_FE(get_meta_tags, NULL)
- PHP_FE(stream_set_write_buffer, NULL)
- PHP_FALIAS(set_file_buffer, stream_set_write_buffer, NULL)
-
- PHP_FE(set_socket_blocking, NULL)
- PHP_FE(stream_set_blocking, NULL)
- PHP_FALIAS(socket_set_blocking, stream_set_blocking, NULL)
-
- PHP_FE(stream_get_meta_data, NULL)
- PHP_FE(stream_get_line, NULL)
- PHP_FE(stream_wrapper_register, NULL)
- PHP_FALIAS(stream_register_wrapper, stream_wrapper_register, NULL)
- PHP_FE(stream_wrapper_unregister, NULL)
- PHP_FE(stream_wrapper_restore, NULL)
- PHP_FE(stream_get_wrappers, NULL)
- PHP_FE(stream_get_transports, NULL)
- PHP_FE(get_headers, NULL)
+ PHP_FE(stream_socket_pair, arginfo_stream_socket_pair)
+#endif
+ PHP_FE(stream_copy_to_stream, arginfo_stream_copy_to_stream)
+ PHP_FE(stream_get_contents, arginfo_stream_get_contents)
+ PHP_FE(fgetcsv, arginfo_fgetcsv)
+ PHP_FE(fputcsv, arginfo_fputcsv)
+ PHP_FE(flock, arginfo_flock)
+ PHP_FE(get_meta_tags, arginfo_get_meta_tags)
+ PHP_FE(stream_set_write_buffer, arginfo_stream_set_write_buffer)
+ PHP_FALIAS(set_file_buffer, stream_set_write_buffer, arginfo_stream_set_write_buffer)
+
+ PHP_DEP_FALIAS(set_socket_blocking, stream_set_blocking, arginfo_stream_set_blocking)
+ PHP_FE(stream_set_blocking, arginfo_stream_set_blocking)
+ PHP_FALIAS(socket_set_blocking, stream_set_blocking, arginfo_stream_set_blocking)
+
+ PHP_FE(stream_get_meta_data, arginfo_stream_get_meta_data)
+ PHP_FE(stream_get_line, arginfo_stream_get_line)
+ PHP_FE(stream_wrapper_register, arginfo_stream_wrapper_register)
+ PHP_FALIAS(stream_register_wrapper, stream_wrapper_register, arginfo_stream_wrapper_register)
+ PHP_FE(stream_wrapper_unregister, arginfo_stream_wrapper_unregister)
+ PHP_FE(stream_wrapper_restore, arginfo_stream_wrapper_restore)
+ PHP_FE(stream_get_wrappers, arginfo_stream_get_wrappers)
+ PHP_FE(stream_get_transports, arginfo_stream_get_transports)
+ PHP_FE(get_headers, arginfo_get_headers)
#if HAVE_SYS_TIME_H || defined(PHP_WIN32)
- PHP_FE(stream_set_timeout, NULL)
- PHP_FALIAS(socket_set_timeout, stream_set_timeout, NULL)
+ PHP_FE(stream_set_timeout, arginfo_stream_set_timeout)
+ PHP_FALIAS(socket_set_timeout, stream_set_timeout, arginfo_stream_set_timeout)
#endif
- PHP_FALIAS(socket_get_status, stream_get_meta_data, NULL)
+ PHP_FALIAS(socket_get_status, stream_get_meta_data, arginfo_stream_get_meta_data)
#if (!defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS)
- PHP_FE(realpath, NULL)
+ PHP_FE(realpath, arginfo_realpath)
#endif
#ifdef HAVE_FNMATCH
- PHP_FE(fnmatch, NULL)
+ PHP_FE(fnmatch, arginfo_fnmatch)
#endif
/* functions from fsock.c */
- PHP_FE(fsockopen, third_and_fourth_args_force_ref)
- PHP_FE(pfsockopen, third_and_fourth_args_force_ref)
+ PHP_FE(fsockopen, arginfo_fsockopen)
+ PHP_FE(pfsockopen, arginfo_pfsockopen)
/* functions from pack.c */
- PHP_FE(pack, NULL)
- PHP_FE(unpack, NULL)
+ PHP_FE(pack, arginfo_pack)
+ PHP_FE(unpack, arginfo_unpack)
/* functions from browscap.c */
- PHP_FE(get_browser, NULL)
+ PHP_FE(get_browser, arginfo_get_browser)
#if HAVE_CRYPT
/* functions from crypt.c */
- PHP_FE(crypt, NULL)
+ PHP_FE(crypt, arginfo_crypt)
#endif
/* functions from dir.c */
- PHP_FE(opendir, NULL)
- PHP_FE(closedir, NULL)
- PHP_FE(chdir, NULL)
+ PHP_FE(opendir, arginfo_opendir)
+ PHP_FE(closedir, arginfo_closedir)
+ PHP_FE(chdir, arginfo_chdir)
#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
- PHP_FE(chroot, NULL)
+ PHP_FE(chroot, arginfo_chroot)
#endif
- PHP_FE(getcwd, NULL)
- PHP_FE(rewinddir, NULL)
- PHP_NAMED_FE(readdir, php_if_readdir, NULL)
- PHP_FALIAS(dir, getdir, NULL)
- PHP_FE(scandir, NULL)
+ PHP_FE(getcwd, arginfo_getcwd)
+ PHP_FE(rewinddir, arginfo_rewinddir)
+ PHP_NAMED_FE(readdir, php_if_readdir, arginfo_readdir)
+ PHP_FALIAS(dir, getdir, arginfo_dir)
+ PHP_FE(scandir, arginfo_scandir)
#ifdef HAVE_GLOB
- PHP_FE(glob, NULL)
+ PHP_FE(glob, arginfo_glob)
#endif
/* functions from filestat.c */
- PHP_FE(fileatime, NULL)
- PHP_FE(filectime, NULL)
- PHP_FE(filegroup, NULL)
- PHP_FE(fileinode, NULL)
- PHP_FE(filemtime, NULL)
- PHP_FE(fileowner, NULL)
- PHP_FE(fileperms, NULL)
- PHP_FE(filesize, NULL)
- PHP_FE(filetype, NULL)
- PHP_FE(file_exists, NULL)
- PHP_FE(is_writable, NULL)
- PHP_FALIAS(is_writeable, is_writable, NULL)
- PHP_FE(is_readable, NULL)
- PHP_FE(is_executable, NULL)
- PHP_FE(is_file, NULL)
- PHP_FE(is_dir, NULL)
- PHP_FE(is_link, NULL)
- PHP_NAMED_FE(stat, php_if_stat, NULL)
- PHP_NAMED_FE(lstat, php_if_lstat, NULL)
+ PHP_FE(fileatime, arginfo_fileatime)
+ PHP_FE(filectime, arginfo_filectime)
+ PHP_FE(filegroup, arginfo_filegroup)
+ PHP_FE(fileinode, arginfo_fileinode)
+ PHP_FE(filemtime, arginfo_filemtime)
+ PHP_FE(fileowner, arginfo_fileowner)
+ PHP_FE(fileperms, arginfo_fileperms)
+ PHP_FE(filesize, arginfo_filesize)
+ PHP_FE(filetype, arginfo_filetype)
+ PHP_FE(file_exists, arginfo_file_exists)
+ PHP_FE(is_writable, arginfo_is_writable)
+ PHP_FALIAS(is_writeable, is_writable, arginfo_is_writable)
+ PHP_FE(is_readable, arginfo_is_readable)
+ PHP_FE(is_executable, arginfo_is_executable)
+ PHP_FE(is_file, arginfo_is_file)
+ PHP_FE(is_dir, arginfo_is_dir)
+ PHP_FE(is_link, arginfo_is_link)
+ PHP_NAMED_FE(stat, php_if_stat, arginfo_stat)
+ PHP_NAMED_FE(lstat, php_if_lstat, arginfo_lstat)
#ifndef NETWARE
- PHP_FE(chown, NULL)
- PHP_FE(chgrp, NULL)
+ PHP_FE(chown, arginfo_chown)
+ PHP_FE(chgrp, arginfo_chgrp)
#endif
#if HAVE_LCHOWN
- PHP_FE(lchown, NULL)
- PHP_FE(lchgrp, NULL)
+ PHP_FE(lchown, arginfo_lchown)
+ PHP_FE(lchgrp, arginfo_lchgrp)
#endif
- PHP_FE(chmod, NULL)
+ PHP_FE(chmod, arginfo_chmod)
#if HAVE_UTIME
- PHP_FE(touch, NULL)
+ PHP_FE(touch, arginfo_touch)
#endif
- PHP_FE(clearstatcache, NULL)
- PHP_FE(disk_total_space, NULL)
- PHP_FE(disk_free_space, NULL)
- PHP_FALIAS(diskfreespace, disk_free_space, NULL)
+ PHP_FE(clearstatcache, arginfo_clearstatcache)
+ PHP_FE(disk_total_space, arginfo_disk_total_space)
+ PHP_FE(disk_free_space, arginfo_disk_free_space)
+ PHP_FALIAS(diskfreespace, disk_free_space, arginfo_disk_free_space)
/* functions from mail.c */
#ifdef HAVE_SENDMAIL
- PHP_FE(mail, NULL)
- PHP_FE(ezmlm_hash, NULL)
+ PHP_FE(mail, arginfo_mail)
+ PHP_FE(ezmlm_hash, arginfo_ezmlm_hash)
#endif
/* functions from syslog.c */
#ifdef HAVE_SYSLOG_H
- PHP_FE(openlog, NULL)
- PHP_FE(syslog, NULL)
- PHP_FE(closelog, NULL)
- PHP_FE(define_syslog_variables, NULL)
+ PHP_FE(openlog, arginfo_openlog)
+ PHP_FE(syslog, arginfo_syslog)
+ PHP_FE(closelog, arginfo_closelog)
+ PHP_FE(define_syslog_variables, arginfo_define_syslog_variables)
#endif
/* functions from lcg.c */
- PHP_FE(lcg_value, NULL)
+ PHP_FE(lcg_value, arginfo_lcg_value)
/* functions from metaphone.c */
- PHP_FE(metaphone, NULL)
+ PHP_FE(metaphone, arginfo_metaphone)
/* functions from output.c */
- PHP_FE(ob_start, NULL)
- PHP_FE(ob_flush, NULL)
- PHP_FE(ob_clean, NULL)
- PHP_FE(ob_end_flush, NULL)
- PHP_FE(ob_end_clean, NULL)
- PHP_FE(ob_get_flush, NULL)
- PHP_FE(ob_get_clean, NULL)
- PHP_FE(ob_get_length, NULL)
- PHP_FE(ob_get_level, NULL)
- PHP_FE(ob_get_status, NULL)
- PHP_FE(ob_get_contents, NULL)
- PHP_FE(ob_implicit_flush, NULL)
- PHP_FE(ob_list_handlers, NULL)
+ PHP_FE(ob_start, arginfo_ob_start)
+ PHP_FE(ob_flush, arginfo_ob_flush)
+ PHP_FE(ob_clean, arginfo_ob_clean)
+ PHP_FE(ob_end_flush, arginfo_ob_end_flush)
+ PHP_FE(ob_end_clean, arginfo_ob_end_clean)
+ PHP_FE(ob_get_flush, arginfo_ob_get_flush)
+ PHP_FE(ob_get_clean, arginfo_ob_get_clean)
+ PHP_FE(ob_get_length, arginfo_ob_get_length)
+ PHP_FE(ob_get_level, arginfo_ob_get_level)
+ PHP_FE(ob_get_status, arginfo_ob_get_status)
+ PHP_FE(ob_get_contents, arginfo_ob_get_contents)
+ PHP_FE(ob_implicit_flush, arginfo_ob_implicit_flush)
+ PHP_FE(ob_list_handlers, arginfo_ob_list_handlers)
/* functions from array.c */
- PHP_FE(ksort, first_arg_force_ref)
- PHP_FE(krsort, first_arg_force_ref)
- PHP_FE(natsort, first_arg_force_ref)
- PHP_FE(natcasesort, first_arg_force_ref)
- PHP_FE(asort, first_arg_force_ref)
- PHP_FE(arsort, first_arg_force_ref)
- PHP_FE(sort, first_arg_force_ref)
- PHP_FE(rsort, first_arg_force_ref)
- PHP_FE(usort, first_arg_force_ref)
- PHP_FE(uasort, first_arg_force_ref)
- PHP_FE(uksort, first_arg_force_ref)
- PHP_FE(shuffle, first_arg_force_ref)
- PHP_FE(array_walk, first_arg_force_ref)
- PHP_FE(array_walk_recursive, first_arg_force_ref)
- PHP_FE(count, NULL)
- PHP_FE(end, first_arg_force_ref)
- PHP_FE(prev, first_arg_force_ref)
- PHP_FE(next, first_arg_force_ref)
- PHP_FE(reset, first_arg_force_ref)
- PHP_FE(current, all_args_prefer_ref)
- PHP_FE(key, all_args_prefer_ref)
- PHP_FE(min, NULL)
- PHP_FE(max, NULL)
- PHP_FE(in_array, NULL)
- PHP_FE(array_search, NULL)
- PHP_FE(extract, NULL)
- PHP_FE(compact, NULL)
- PHP_FE(array_fill, NULL)
- PHP_FE(range, NULL)
- PHP_FE(array_multisort, all_args_prefer_ref)
- PHP_FE(array_push, first_arg_force_ref)
- PHP_FE(array_pop, first_arg_force_ref)
- PHP_FE(array_shift, first_arg_force_ref)
- PHP_FE(array_unshift, first_arg_force_ref)
- PHP_FE(array_splice, first_arg_force_ref)
- PHP_FE(array_slice, NULL)
- PHP_FE(array_merge, NULL)
- PHP_FE(array_merge_recursive, NULL)
- PHP_FE(array_keys, NULL)
- PHP_FE(array_values, NULL)
- PHP_FE(array_count_values, NULL)
- PHP_FE(array_reverse, NULL)
- PHP_FE(array_reduce, NULL)
- PHP_FE(array_pad, NULL)
- PHP_FE(array_flip, NULL)
- PHP_FE(array_change_key_case, NULL)
- PHP_FE(array_rand, NULL)
- PHP_FE(array_unique, NULL)
- PHP_FE(array_intersect, NULL)
- PHP_FE(array_intersect_key, NULL)
- PHP_FE(array_intersect_ukey, NULL)
- PHP_FE(array_uintersect, NULL)
- PHP_FE(array_intersect_assoc, NULL)
- PHP_FE(array_uintersect_assoc, NULL)
- PHP_FE(array_intersect_uassoc, NULL)
- PHP_FE(array_uintersect_uassoc, NULL)
- PHP_FE(array_diff, NULL)
- PHP_FE(array_diff_key, NULL)
- PHP_FE(array_diff_ukey, NULL)
- PHP_FE(array_udiff, NULL)
- PHP_FE(array_diff_assoc, NULL)
- PHP_FE(array_udiff_assoc, NULL)
- PHP_FE(array_diff_uassoc, NULL)
- PHP_FE(array_udiff_uassoc, NULL)
- PHP_FE(array_sum, NULL)
- PHP_FE(array_product, NULL)
- PHP_FE(array_filter, NULL)
- PHP_FE(array_map, NULL)
- PHP_FE(array_chunk, NULL)
- PHP_FE(array_combine, NULL)
- PHP_FE(array_key_exists, NULL)
+ PHP_FE(ksort, arginfo_ksort)
+ PHP_FE(krsort, arginfo_krsort)
+ PHP_FE(natsort, arginfo_natsort)
+ PHP_FE(natcasesort, arginfo_natcasesort)
+ PHP_FE(asort, arginfo_asort)
+ PHP_FE(arsort, arginfo_arsort)
+ PHP_FE(sort, arginfo_sort)
+ PHP_FE(rsort, arginfo_rsort)
+ PHP_FE(usort, arginfo_usort)
+ PHP_FE(uasort, arginfo_uasort)
+ PHP_FE(uksort, arginfo_uksort)
+ PHP_FE(shuffle, arginfo_shuffle)
+ PHP_FE(array_walk, arginfo_array_walk)
+ PHP_FE(array_walk_recursive, arginfo_array_walk_recursive)
+ PHP_FE(count, arginfo_count)
+ PHP_FE(end, arginfo_end)
+ PHP_FE(prev, arginfo_prev)
+ PHP_FE(next, arginfo_next)
+ PHP_FE(reset, arginfo_reset)
+ PHP_FE(current, arginfo_current)
+ PHP_FE(key, arginfo_key)
+ PHP_FE(min, arginfo_min)
+ PHP_FE(max, arginfo_max)
+ PHP_FE(in_array, arginfo_in_array)
+ PHP_FE(array_search, arginfo_array_search)
+ PHP_FE(extract, arginfo_extract)
+ PHP_FE(compact, arginfo_compact)
+ PHP_FE(array_fill, arginfo_array_fill)
+ PHP_FE(array_fill_keys, arginfo_array_fill_keys)
+ PHP_FE(range, arginfo_range)
+ PHP_FE(array_multisort, arginfo_array_multisort)
+ PHP_FE(array_push, arginfo_array_push)
+ PHP_FE(array_pop, arginfo_array_pop)
+ PHP_FE(array_shift, arginfo_array_shift)
+ PHP_FE(array_unshift, arginfo_array_unshift)
+ PHP_FE(array_splice, arginfo_array_splice)
+ PHP_FE(array_slice, arginfo_array_slice)
+ PHP_FE(array_merge, arginfo_array_merge)
+ PHP_FE(array_merge_recursive, arginfo_array_merge_recursive)
+ PHP_FE(array_keys, arginfo_array_keys)
+ PHP_FE(array_values, arginfo_array_values)
+ PHP_FE(array_count_values, arginfo_array_count_values)
+ PHP_FE(array_reverse, arginfo_array_reverse)
+ PHP_FE(array_reduce, arginfo_array_reduce)
+ PHP_FE(array_pad, arginfo_array_pad)
+ PHP_FE(array_flip, arginfo_array_flip)
+ PHP_FE(array_change_key_case, arginfo_array_change_key_case)
+ PHP_FE(array_rand, arginfo_array_rand)
+ PHP_FE(array_unique, arginfo_array_unique)
+ PHP_FE(array_intersect, arginfo_array_intersect)
+ PHP_FE(array_intersect_key, arginfo_array_intersect_key)
+ PHP_FE(array_intersect_ukey, arginfo_array_intersect_ukey)
+ PHP_FE(array_uintersect, arginfo_array_uintersect)
+ PHP_FE(array_intersect_assoc, arginfo_array_intersect_assoc)
+ PHP_FE(array_uintersect_assoc, arginfo_array_uintersect_assoc)
+ PHP_FE(array_intersect_uassoc, arginfo_array_intersect_uassoc)
+ PHP_FE(array_uintersect_uassoc, arginfo_array_uintersect_uassoc)
+ PHP_FE(array_diff, arginfo_array_diff)
+ PHP_FE(array_diff_key, arginfo_array_diff_key)
+ PHP_FE(array_diff_ukey, arginfo_array_diff_ukey)
+ PHP_FE(array_udiff, arginfo_array_udiff)
+ PHP_FE(array_diff_assoc, arginfo_array_diff_assoc)
+ PHP_FE(array_udiff_assoc, arginfo_array_udiff_assoc)
+ PHP_FE(array_diff_uassoc, arginfo_array_diff_uassoc)
+ PHP_FE(array_udiff_uassoc, arginfo_array_udiff_uassoc)
+ PHP_FE(array_sum, arginfo_array_sum)
+ PHP_FE(array_product, arginfo_array_product)
+ PHP_FE(array_filter, arginfo_array_filter)
+ PHP_FE(array_map, arginfo_array_map)
+ PHP_FE(array_chunk, arginfo_array_chunk)
+ PHP_FE(array_combine, arginfo_array_combine)
+ PHP_FE(array_key_exists, arginfo_array_key_exists)
/* aliases from array.c */
- PHP_FALIAS(pos, current, first_arg_force_ref)
- PHP_FALIAS(sizeof, count, NULL)
- PHP_FALIAS(key_exists, array_key_exists, NULL)
+ PHP_FALIAS(pos, current, arginfo_current)
+ PHP_FALIAS(sizeof, count, arginfo_count)
+ PHP_FALIAS(key_exists, array_key_exists, arginfo_array_key_exists)
/* functions from assert.c */
- PHP_FE(assert, NULL)
- PHP_FE(assert_options, NULL)
+ PHP_FE(assert, arginfo_assert)
+ PHP_FE(assert_options, arginfo_assert_options)
/* functions from versioning.c */
- PHP_FE(version_compare, NULL)
+ PHP_FE(version_compare, arginfo_version_compare)
/* functions from ftok.c*/
#if HAVE_FTOK
- PHP_FE(ftok, NULL)
+ PHP_FE(ftok, arginfo_ftok)
#endif
- PHP_FE(str_rot13, NULL)
- PHP_FE(stream_get_filters, NULL)
- PHP_FE(stream_filter_register, NULL)
- PHP_FE(stream_bucket_make_writeable, NULL)
- PHP_FE(stream_bucket_prepend, NULL)
- PHP_FE(stream_bucket_append, NULL)
- PHP_FE(stream_bucket_new, NULL)
+ PHP_FE(str_rot13, arginfo_str_rot13)
+ PHP_FE(stream_get_filters, arginfo_stream_get_filters)
+ PHP_FE(stream_filter_register, arginfo_stream_filter_register)
+ PHP_FE(stream_bucket_make_writeable, arginfo_stream_bucket_make_writeable)
+ PHP_FE(stream_bucket_prepend, arginfo_stream_bucket_prepend)
+ PHP_FE(stream_bucket_append, arginfo_stream_bucket_append)
+ PHP_FE(stream_bucket_new, arginfo_stream_bucket_new)
- PHP_FE(output_add_rewrite_var, NULL)
- PHP_FE(output_reset_rewrite_vars, NULL)
+ PHP_FE(output_add_rewrite_var, arginfo_output_add_rewrite_var)
+ PHP_FE(output_reset_rewrite_vars, arginfo_output_reset_rewrite_vars)
{NULL, NULL, NULL}
};
@@ -883,9 +3800,15 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY_EX("safe_mode_allowed_env_vars", SAFE_MODE_ALLOWED_ENV_VARS, PHP_INI_SYSTEM, OnUpdateSafeModeAllowedEnvVars, NULL)
PHP_INI_END()
+static zend_module_dep standard_deps[] = {
+ ZEND_MOD_OPTIONAL("session")
+ {NULL, NULL, NULL}
+};
zend_module_entry basic_functions_module = {
- STANDARD_MODULE_HEADER,
+ STANDARD_MODULE_HEADER_EX,
+ NULL,
+ standard_deps,
"standard", /* extension name */
basic_functions, /* function list */
PHP_MINIT(basic), /* process startup */
@@ -944,6 +3867,7 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC)
{
BG(rand_is_seeded) = 0;
BG(mt_rand_is_seeded) = 0;
+ BG(umask) = -1;
BG(next) = NULL;
BG(left) = -1;
@@ -1056,9 +3980,13 @@ PHP_MINIT_FUNCTION(basic)
REGISTER_MATH_CONSTANT(M_PI_4);
REGISTER_MATH_CONSTANT(M_1_PI);
REGISTER_MATH_CONSTANT(M_2_PI);
+ REGISTER_MATH_CONSTANT(M_SQRTPI);
REGISTER_MATH_CONSTANT(M_2_SQRTPI);
+ REGISTER_MATH_CONSTANT(M_LNPI);
+ REGISTER_MATH_CONSTANT(M_EULER);
REGISTER_MATH_CONSTANT(M_SQRT2);
REGISTER_MATH_CONSTANT(M_SQRT1_2);
+ REGISTER_MATH_CONSTANT(M_SQRT3);
REGISTER_DOUBLE_CONSTANT("INF", php_get_inf(), CONST_CS | CONST_PERSISTENT);
REGISTER_DOUBLE_CONSTANT("NAN", php_get_nan(), CONST_CS | CONST_PERSISTENT);
@@ -1109,6 +4037,7 @@ PHP_MINIT_FUNCTION(basic)
php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC);
php_register_url_stream_wrapper("file", &php_plain_files_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper TSRMLS_CC);
#ifndef PHP_CURL_URL_WRAPPERS
php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC);
php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper TSRMLS_CC);
@@ -1216,6 +4145,10 @@ PHP_RSHUTDOWN_FUNCTION(basic)
zend_hash_destroy(&BG(putenv_ht));
#endif
+ if (BG(umask) != -1) {
+ umask(BG(umask));
+ }
+
/* Check if locale was changed and change it back
to the value in startup environment */
if (BG(locale_string) != NULL) {
@@ -1223,6 +4156,7 @@ PHP_RSHUTDOWN_FUNCTION(basic)
setlocale(LC_CTYPE, "");
}
STR_FREE(BG(locale_string));
+ BG(locale_string) = NULL;
/*
FG(stream_wrappers) and FG(stream_filters) are destroyed
@@ -1419,12 +4353,9 @@ PHP_FUNCTION(getenv)
RETURN_FALSE;
}
ptr = sapi_getenv(str, str_len TSRMLS_CC);
- if (! ptr) {
- ptr = getenv(str);
- }
- if (ptr) {
- RETURN_STRING(ptr, 1);
- }
+ if(ptr) RETURN_STRING(ptr, 0);
+ ptr = getenv(str);
+ if(ptr) RETURN_STRING(ptr, 1);
RETURN_FALSE;
}
/* }}} */
@@ -2048,6 +4979,23 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T
return SUCCESS;
}
+/* {{{ proto array error_get_last()
+ Get the last occurred error as associative array. Returns NULL if there hasn't been an error yet. */
+PHP_FUNCTION(error_get_last)
+{
+ if (ZEND_NUM_ARGS()) {
+ WRONG_PARAM_COUNT;
+ }
+ if (PG(last_error_message)) {
+ array_init(return_value);
+ add_assoc_long_ex(return_value, "type", sizeof("type"), PG(last_error_type));
+ add_assoc_string_ex(return_value, "message", sizeof("message"), PG(last_error_message), 1);
+ add_assoc_string_ex(return_value, "file", sizeof("file"), PG(last_error_file)?PG(last_error_file):"-", 1 );
+ add_assoc_long_ex(return_value, "line", sizeof("line"), PG(last_error_lineno));
+ }
+}
+/* }}} */
+
/* {{{ proto mixed call_user_func(string function_name [, mixed parmeter] [, mixed ...])
Call a user function which is the first parameter */
PHP_FUNCTION(call_user_func)
@@ -2170,8 +5118,6 @@ PHP_FUNCTION(call_user_func_array)
}
/* }}} */
-#define _CUM_DEPREC "This function is deprecated, use the call_user_func variety with the array(&$obj, \"method\") syntax instead"
-
/* {{{ proto mixed call_user_method(string method_name, mixed object [, mixed parameter] [, mixed ...])
Call a user method on a specific object or class */
PHP_FUNCTION(call_user_method)
@@ -2180,8 +5126,6 @@ PHP_FUNCTION(call_user_method)
zval *retval_ptr;
int arg_count = ZEND_NUM_ARGS();
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", _CUM_DEPREC);
-
if (arg_count < 2) {
WRONG_PARAM_COUNT;
}
@@ -2217,8 +5161,6 @@ PHP_FUNCTION(call_user_method_array)
HashTable *params_ar;
int num_elems, element = 0;
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", _CUM_DEPREC);
-
if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &method_name, &obj, &params) == FAILURE) {
WRONG_PARAM_COUNT;
}
@@ -2282,18 +5224,20 @@ static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_fun
if (!zend_is_callable(shutdown_function_entry->arguments[0], 0, &function_name)) {
php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", function_name);
- } else if (call_user_function(EG(function_table), NULL,
- shutdown_function_entry->arguments[0],
- &retval,
- shutdown_function_entry->arg_count - 1,
- shutdown_function_entry->arguments + 1
- TSRMLS_CC ) == SUCCESS)
+ efree(function_name);
+ return 0;
+ }
+ efree(function_name);
+
+ if (call_user_function(EG(function_table), NULL,
+ shutdown_function_entry->arguments[0],
+ &retval,
+ shutdown_function_entry->arg_count - 1,
+ shutdown_function_entry->arguments + 1
+ TSRMLS_CC ) == SUCCESS)
{
zval_dtor(&retval);
}
- if (function_name) {
- efree(function_name);
- }
return 0;
}
@@ -2360,13 +5304,13 @@ static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_
void php_call_shutdown_functions(TSRMLS_D)
{
- if (BG(user_shutdown_function_names))
+ if (BG(user_shutdown_function_names)) {
zend_try {
zend_hash_apply(BG(user_shutdown_function_names), (apply_func_t) user_shutdown_function_call TSRMLS_CC);
- memcpy(&EG(bailout), &orig_bailout, sizeof(jmp_buf));
- php_free_shutdown_functions(TSRMLS_C);
}
zend_end_try();
+ php_free_shutdown_functions(TSRMLS_C);
+ }
}
void php_free_shutdown_functions(TSRMLS_D)
@@ -2437,20 +5381,20 @@ ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highl
Syntax highlight a source file */
PHP_FUNCTION(highlight_file)
{
- zval *filename;
+ char *filename;
+ int filename_len;
zend_syntax_highlighter_ini syntax_highlighter_ini;
zend_bool i = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &filename, &i) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &filename, &filename_len, &i) == FAILURE) {
RETURN_FALSE;
}
- convert_to_string(filename);
- if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_P(filename), NULL, CHECKUID_ALLOW_ONLY_FILE))) {
+ if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
RETURN_FALSE;
}
- if (php_check_open_basedir(Z_STRVAL_P(filename) TSRMLS_CC)) {
+ if (php_check_open_basedir(filename TSRMLS_CC)) {
RETURN_FALSE;
}
@@ -2460,7 +5404,7 @@ PHP_FUNCTION(highlight_file)
php_get_highlight_struct(&syntax_highlighter_ini);
- if (highlight_file(Z_STRVAL_P(filename), &syntax_highlighter_ini TSRMLS_CC) == FAILURE) {
+ if (highlight_file(filename, &syntax_highlighter_ini TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
@@ -2513,16 +5457,16 @@ PHP_FUNCTION(php_strip_whitespace)
Syntax highlight a string or optionally return it */
PHP_FUNCTION(highlight_string)
{
- zval *expr;
+ zval **expr;
zend_syntax_highlighter_ini syntax_highlighter_ini;
char *hicompiled_string_description;
zend_bool i = 0;
int old_error_reporting = EG(error_reporting);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &expr, &i) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|b", &expr, &i) == FAILURE) {
RETURN_FALSE;
}
- convert_to_string(expr);
+ convert_to_string_ex(expr);
if (i) {
php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
@@ -2534,7 +5478,7 @@ PHP_FUNCTION(highlight_string)
hicompiled_string_description = zend_make_compiled_string_description("highlighted code" TSRMLS_CC);
- if (highlight_string(expr, &syntax_highlighter_ini, hicompiled_string_description TSRMLS_CC) == FAILURE) {
+ if (highlight_string(*expr, &syntax_highlighter_ini, hicompiled_string_description TSRMLS_CC) == FAILURE) {
efree(hicompiled_string_description);
RETURN_FALSE;
}
@@ -2678,7 +5622,6 @@ PHP_FUNCTION(ini_set)
_CHECK_PATH(varname, "java.class.path") ||
_CHECK_PATH(varname, "java.home") ||
_CHECK_PATH(varname, "java.library.path") ||
- _CHECK_PATH(varname, "session.save_path") ||
_CHECK_PATH(varname, "vpopmail.directory")) {
if (PG(safe_mode) &&(!php_checkuid(Z_STRVAL_PP(new_value), NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
zval_dtor(return_value);
@@ -3089,8 +6032,7 @@ PHP_FUNCTION(move_uploaded_file)
VCWD_UNLINK(Z_STRVAL_PP(new_path));
if (rename(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path)) == 0) {
successful = 1;
- } else
- if (php_copy_file(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path) TSRMLS_CC) == SUCCESS) {
+ } else if (php_copy_file_ex(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path), STREAM_DISABLE_OPEN_BASEDIR TSRMLS_CC) == SUCCESS) {
VCWD_UNLINK(Z_STRVAL_PP(path));
successful = 1;
}
@@ -3352,6 +6294,8 @@ PHP_FUNCTION(import_request_variables)
/* }}} */
#ifdef HAVE_GETLOADAVG
+/* {{{ proto array sys_getloadavg()
+ */
PHP_FUNCTION(sys_getloadavg)
{
double load[3];
@@ -3365,6 +6309,7 @@ PHP_FUNCTION(sys_getloadavg)
add_index_double(return_value, 2, load[2]);
}
}
+/* }}} */
#endif
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index 9f0bf7c93..df1401ae9 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.h,v 1.139.2.4 2006/02/18 05:41:59 rasmus Exp $ */
+/* $Id: basic_functions.h,v 1.139.2.4.2.2 2006/07/19 12:25:46 mike Exp $ */
#ifndef BASIC_FUNCTIONS_H
#define BASIC_FUNCTIONS_H
@@ -79,6 +79,7 @@ PHP_FUNCTION(get_magic_quotes_gpc);
PHP_FUNCTION(import_request_variables);
PHP_FUNCTION(error_log);
+PHP_FUNCTION(error_get_last);
PHP_FUNCTION(call_user_func);
PHP_FUNCTION(call_user_func_array);
@@ -215,6 +216,8 @@ typedef struct _php_basic_globals {
#if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
mbstate_t mblen_state;
#endif
+
+ int umask;
} php_basic_globals;
#ifdef ZTS
diff --git a/ext/standard/config.m4 b/ext/standard/config.m4
index 28b079d0b..42e809ca9 100644
--- a/ext/standard/config.m4
+++ b/ext/standard/config.m4
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.80.2.3 2006/01/04 21:31:29 derick Exp $ -*- autoconf -*-
+dnl $Id: config.m4,v 1.80.2.3.2.1 2006/08/24 11:06:02 tony2001 Exp $ -*- autoconf -*-
divert(3)dnl
@@ -477,6 +477,26 @@ if test "$ac_cv_huge_val_nan" = "yes"; then
AC_DEFINE([HAVE_HUGE_VAL_NAN], 1, [whether HUGE_VAL + -HUGEVAL == NAN])
fi
+AC_CACHE_CHECK(whether strptime() declaration fails, ac_cv_strptime_decl_fails,[
+ AC_TRY_COMPILE([
+#include <time.h>
+ ],[
+#ifndef HAVE_STRPTIME
+#error no strptime() on this platform
+#else
+/* use invalid strptime() declaration to see if it fails to compile */
+int strptime(const char *s, const char *format, struct tm *tm);
+#endif
+ ],[
+ ac_cv_strptime_decl_fails=no
+ ],[
+ ac_cv_strptime_decl_fails=yes
+ ])
+])
+if test "$ac_cv_strptime_decl_fails" = "yes"; then
+ AC_DEFINE([HAVE_STRPTIME_DECL_FAILS], 1, [whether strptime() declaration fails])
+fi
+
PHP_CHECK_I18N_FUNCS
PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \
diff --git a/ext/standard/credits.c b/ext/standard/credits.c
index 2cf356ea9..0d689ac4b 100644
--- a/ext/standard/credits.c
+++ b/ext/standard/credits.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: credits.c,v 1.36.2.4 2006/03/23 18:36:46 iliaa Exp $ */
+/* $Id: credits.c,v 1.36.2.4.2.1 2006/09/03 11:27:50 johannes Exp $ */
#include "php.h"
#include "info.h"
@@ -105,7 +105,7 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC)
if (flag & PHP_CREDITS_QA) {
php_info_print_table_start();
- php_info_print_table_header(1, "PHP 5.1 Quality Assurance Team");
+ php_info_print_table_header(1, "PHP Quality Assurance Team");
php_info_print_table_row(1, "Ilia Alshanetsky, Joerg Behrens, Antony Dovgal, Stefan Esser, Moriyoshi Koizumi, Magnus Maatta, Sebastian Nohn, Derick Rethans, Melvyn Sopacua, Jani Taskinen");
php_info_print_table_end();
}
diff --git a/ext/standard/credits_ext.h b/ext/standard/credits_ext.h
index 6b3f53648..889d10d4a 100644
--- a/ext/standard/credits_ext.h
+++ b/ext/standard/credits_ext.h
@@ -18,36 +18,36 @@ CREDIT_LINE("COM and .Net", "Wez Furlong");
CREDIT_LINE("ctype", "Hartmut Holzgraefe");
CREDIT_LINE("cURL", "Sterling Hughes");
CREDIT_LINE("Date/Time Support", "Derick Rethans");
-CREDIT_LINE("DB-LIB (MS SQL, Sybase)", "Wez Furlong, Frank M. Kromann");
CREDIT_LINE("DBA", "Sascha Schumann, Marcus Boerger");
CREDIT_LINE("dBase", "Jim Winstead");
+CREDIT_LINE("DB-LIB (MS SQL, Sybase)", "Wez Furlong, Frank M. Kromann");
CREDIT_LINE("DOM", "Christian Stocker, Rob Richards, Marcus Boerger");
CREDIT_LINE("EXIF", "Rasmus Lerdorf, Marcus Boerger");
CREDIT_LINE("FBSQL", "Frank M. Kromann");
CREDIT_LINE("FDF", "Uwe Steinmann");
-CREDIT_LINE("FilePro", "Chad Robinson");
CREDIT_LINE("Firebird/InterBase driver for PDO", "Ard Biesheuvel");
CREDIT_LINE("FTP", "Stefan Esser, Andrew Skalski");
CREDIT_LINE("GD imaging", "Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger");
CREDIT_LINE("GetText", "Alex Plotnick");
CREDIT_LINE("GNU GMP support", "Stanislav Malyshev");
-CREDIT_LINE("HwAPI", "Uwe Steinmann");
CREDIT_LINE("Iconv", "Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi ");
CREDIT_LINE("IMAP", "Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky");
CREDIT_LINE("Informix", "Danny Heijl, Christian Cartus, Corne' Cornelius");
+CREDIT_LINE("Input Filter", "Rasmus Lerdorf, Derick Rethans, Pierre-Alain Joye, Ilia Alshanetsky");
CREDIT_LINE("InterBase", "Jouni Ahto, Andrew Avdeev, Ard Biesheuvel");
+CREDIT_LINE("JSON", "Omar Kilani");
CREDIT_LINE("LDAP", "Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson, Stig Venaas");
CREDIT_LINE("LIBXML", "Christian Stocker, Rob Richards, Marcus Boerger, Wez Furlong, Shane Caraveo");
CREDIT_LINE("mcrypt", "Sascha Schumann, Derick Rethans");
CREDIT_LINE("mhash", "Sascha Schumann");
CREDIT_LINE("mime_magic", "Hartmut Holzgraefe");
CREDIT_LINE("MING", "Dave Hayden, Frank M. Kromann");
-CREDIT_LINE("MS SQL", "Frank M. Kromann");
CREDIT_LINE("mSQL", "Zeev Suraski");
+CREDIT_LINE("MS SQL", "Frank M. Kromann");
CREDIT_LINE("Multibyte String Functions", "Tsukada Takuya, Rui Hirokawa");
CREDIT_LINE("mySQL driver for PDO", "George Schlossnagle, Wez Furlong, Ilia Alshanetsky");
-CREDIT_LINE("MySQL", "Zeev Suraski, Zak Greant, Georg Richter");
CREDIT_LINE("MySQLi", "Zak Greant, Georg Richter");
+CREDIT_LINE("MySQL", "Zeev Suraski, Zak Greant, Georg Richter");
CREDIT_LINE("ncurses", "Ilia Alshanetsky, Wez Furlong, Hartmut Holzgraefe, Georg Richter");
CREDIT_LINE("OCI8", "Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson, Maxim Maletsky, Harald Radi, Antony Dovgal, Andi Gutmans, Wez Furlong");
CREDIT_LINE("ODBC driver for PDO", "Wez Furlong");
@@ -82,9 +82,10 @@ CREDIT_LINE("System V Shared Memory", "Christian Cartus");
CREDIT_LINE("tidy", "John Coggeshall, Ilia Alshanetsky");
CREDIT_LINE("tokenizer", "Andrei Zmievski");
CREDIT_LINE("WDDX", "Andrei Zmievski");
-CREDIT_LINE("XML", "Stig Bakken, Thies C. Arntzen, Sterling Hughes");
CREDIT_LINE("XMLReader", "Rob Richards");
CREDIT_LINE("xmlrpc", "Dan Libby");
+CREDIT_LINE("XML", "Stig Bakken, Thies C. Arntzen, Sterling Hughes");
CREDIT_LINE("XMLWriter", "Rob Richards, Pierre-Alain Joye");
CREDIT_LINE("XSL", "Christian Stocker, Rob Richards");
+CREDIT_LINE("Zip", "Pierre-Alain Joye");
CREDIT_LINE("Zlib", "Rasmus Lerdorf, Stefan Roehrich, Zeev Suraski, Jade Nicoletti");
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index eaf5ae7f9..bb4e402b5 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -18,11 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: datetime.c,v 1.134.2.2 2006/01/01 12:50:14 sniper Exp $ */
-
-#if HAVE_STRPTIME
-#define _XOPEN_SOURCE
-#endif
+/* $Id: datetime.c,v 1.134.2.2.2.2 2006/08/24 11:06:02 tony2001 Exp $ */
#include "php.h"
#include "zend_operators.h"
@@ -85,6 +81,10 @@ PHPAPI char *php_std_date(time_t t TSRMLS_DC)
#if HAVE_STRPTIME
+#ifndef HAVE_STRPTIME_DECL_FAILS
+char *strptime(const char *s, const char *format, struct tm *tm);
+#endif
+
/* {{{ proto string strptime(string timestamp, string format)
Parse a time/date generated with strftime() */
PHP_FUNCTION(strptime)
@@ -101,6 +101,8 @@ PHP_FUNCTION(strptime)
return;
}
+ memset(&parsed_time, 0, sizeof(parsed_time));
+
unparsed_part = strptime(ts, format, &parsed_time);
if (unparsed_part == NULL) {
RETURN_FALSE;
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index dbdde4507..435f099c5 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dir.c,v 1.147.2.3 2006/02/26 10:49:50 helly Exp $ */
+/* $Id: dir.c,v 1.147.2.3.2.1 2006/10/04 23:19:25 iliaa Exp $ */
/* {{{ includes/startup/misc */
@@ -286,7 +286,7 @@ PHP_FUNCTION(chdir)
RETURN_FALSE;
}
- if (PG(safe_mode) && !php_checkuid(str, NULL, CHECKUID_CHECK_FILE_AND_DIR)) {
+ if ((PG(safe_mode) && !php_checkuid(str, NULL, CHECKUID_CHECK_FILE_AND_DIR)) || php_check_open_basedir(str TSRMLS_CC)) {
RETURN_FALSE;
}
ret = VCWD_CHDIR(str);
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 6e09bac53..9927cdfc2 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.409.2.6 2006/04/06 02:39:55 iliaa Exp $ */
+/* $Id: file.c,v 1.409.2.6.2.7 2006/10/13 01:42:19 iliaa Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -535,7 +535,7 @@ PHP_FUNCTION(file_get_contents)
}
if (offset > 0 && php_stream_seek(stream, offset, SEEK_SET) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to %ld position in the stream.", offset);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %ld in the stream.", offset);
RETURN_FALSE;
}
@@ -571,12 +571,17 @@ PHP_FUNCTION(file_put_contents)
long flags = 0;
zval *zcontext = NULL;
php_stream_context *context = NULL;
+ php_stream *srcstream = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|lr!", &filename, &filename_len,
&data, &flags, &zcontext) == FAILURE) {
return;
}
+ if (Z_TYPE_P(data) == IS_RESOURCE) {
+ php_stream_from_zval(srcstream, &data);
+ }
+
context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT);
stream = php_stream_open_wrapper_ex(filename, (flags & PHP_FILE_APPEND) ? "ab" : "wb",
@@ -591,14 +596,8 @@ PHP_FUNCTION(file_put_contents)
switch (Z_TYPE_P(data)) {
case IS_RESOURCE:
- {
- php_stream *srcstream;
- php_stream_from_zval(srcstream, &data);
-
numbytes = php_stream_copy_to_stream(srcstream, stream, PHP_STREAM_COPY_ALL);
-
break;
- }
case IS_NULL:
case IS_LONG:
case IS_DOUBLE:
@@ -1464,6 +1463,10 @@ PHP_FUNCTION(umask)
oldumask = umask(077);
+ if (BG(umask) != -1) {
+ BG(umask) = oldumask;
+ }
+
if (arg_count == 0) {
umask(oldumask);
} else {
@@ -1474,8 +1477,6 @@ PHP_FUNCTION(umask)
umask(Z_LVAL_PP(arg1));
}
- /* XXX we should maybe reset the umask after each request! */
-
RETURN_LONG(oldumask);
}
@@ -1710,9 +1711,14 @@ PHP_FUNCTION(copy)
}
/* }}} */
+PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
+{
+ return php_copy_file_ex(src, dest, ENFORCE_SAFE_MODE TSRMLS_CC);
+}
+
/* {{{ php_copy_file
*/
-PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
+PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC)
{
php_stream *srcstream = NULL, *deststream = NULL;
int ret = FAILURE;
@@ -1767,7 +1773,7 @@ no_stat:
}
safe_to_copy:
- srcstream = php_stream_open_wrapper(src, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
+ srcstream = php_stream_open_wrapper(src, "rb", src_chk | REPORT_ERRORS, NULL);
if (!srcstream) {
return ret;
@@ -1975,17 +1981,14 @@ PHP_FUNCTION(fputcsv)
Get line from file pointer and parse for CSV fields */
PHP_FUNCTION(fgetcsv)
{
- char *temp, *tptr, *bptr, *line_end, *limit;
char delimiter = ','; /* allow this to be set as parameter */
char enclosure = '"'; /* allow this to be set as parameter */
- const char escape_char = '\\';
/* first section exactly as php_fgetss */
long len = 0;
- size_t buf_len, temp_len, line_end_len;
+ size_t buf_len;
char *buf;
php_stream *stream;
- int inc_len;
{
zval *fd, **len_zv = NULL;
@@ -2005,6 +2008,8 @@ PHP_FUNCTION(fgetcsv)
if (delimiter_str_len < 1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
+ } else if (delimiter_str_len > 1) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "delimiter must be a single character");
}
/* use first character from string */
@@ -2015,7 +2020,10 @@ PHP_FUNCTION(fgetcsv)
if (enclosure_str_len < 1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
+ } else if (enclosure_str_len > 1) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "enclosure must be a single character");
}
+
/* use first character from string */
enclosure = enclosure_str[0];
}
@@ -2047,6 +2055,23 @@ PHP_FUNCTION(fgetcsv)
RETURN_FALSE;
}
}
+
+ php_fgetcsv(stream, delimiter, enclosure, buf_len, buf, return_value TSRMLS_CC);
+}
+/* }}} */
+
+
+PHPAPI void php_fgetcsv(php_stream *stream, /* {{{ */
+ char delimiter, char enclosure,
+ size_t buf_len, char *buf,
+ zval *return_value TSRMLS_DC)
+{
+ char *temp, *tptr, *bptr, *line_end, *limit;
+ const char escape_char = '\\';
+
+ size_t temp_len, line_end_len;
+ int inc_len;
+
/* initialize internal state */
php_mblen(NULL, 0);
diff --git a/ext/standard/file.h b/ext/standard/file.h
index c7a1406fb..65eaf464f 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.h,v 1.94.2.2 2006/01/13 04:05:59 pajoye Exp $ */
+/* $Id: file.h,v 1.94.2.2.2.2 2006/10/13 09:34:34 bjori Exp $ */
/* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */
@@ -72,8 +72,10 @@ PHP_MINIT_FUNCTION(user_streams);
PHPAPI int php_le_stream_context(void);
PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC);
PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC);
+PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC);
PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC);
PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC);
+PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, size_t buf_len, char *buf, zval *return_value TSRMLS_DC);
#define META_DEF_BUFSIZE 8192
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 3b81dbb07..458fe267c 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filestat.c,v 1.136.2.9 2006/08/10 21:30:23 iliaa Exp $ */
+/* $Id: filestat.c,v 1.136.2.8.2.3 2006/07/02 13:51:40 iliaa Exp $ */
#include "php.h"
#include "safe_mode.h"
@@ -79,6 +79,10 @@
# endif
#endif
+#ifdef PHP_WIN32
+#include "win32/winutil.h"
+#endif
+
#include "basic_functions.h"
#include "php_filestat.h"
@@ -170,7 +174,10 @@ PHP_FUNCTION(disk_total_space)
if (func(Z_STRVAL_PP(path),
&FreeBytesAvailableToCaller,
&TotalNumberOfBytes,
- &TotalNumberOfFreeBytes) == 0) RETURN_FALSE;
+ &TotalNumberOfFreeBytes) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ RETURN_FALSE;
+ }
/* i know - this is ugly, but i works <thies@thieso.net> */
bytestotal = TotalNumberOfBytes.HighPart *
@@ -181,7 +188,10 @@ PHP_FUNCTION(disk_total_space)
else {
if (GetDiskFreeSpace(Z_STRVAL_PP(path),
&SectorsPerCluster, &BytesPerSector,
- &NumberOfFreeClusters, &TotalNumberOfClusters) == 0) RETURN_FALSE;
+ &NumberOfFreeClusters, &TotalNumberOfClusters) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ RETURN_FALSE;
+ }
bytestotal = (double)TotalNumberOfClusters * (double)SectorsPerCluster * (double)BytesPerSector;
}
}
@@ -200,7 +210,10 @@ PHP_FUNCTION(disk_total_space)
}
#else /* WINDOWS, OS/2 */
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
- if (statvfs(Z_STRVAL_PP(path), &buf)) RETURN_FALSE;
+ if (statvfs(Z_STRVAL_PP(path), &buf)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ RETURN_FALSE;
+ }
if (buf.f_frsize) {
bytestotal = (((double)buf.f_blocks) * ((double)buf.f_frsize));
} else {
@@ -208,7 +221,10 @@ PHP_FUNCTION(disk_total_space)
}
#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
- if (statfs(Z_STRVAL_PP(path), &buf)) RETURN_FALSE;
+ if (statfs(Z_STRVAL_PP(path), &buf)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ RETURN_FALSE;
+ }
bytestotal = (((double)buf.f_bsize) * ((double)buf.f_blocks));
#endif
#endif /* WINDOWS */
@@ -273,7 +289,10 @@ PHP_FUNCTION(disk_free_space)
if (func(Z_STRVAL_PP(path),
&FreeBytesAvailableToCaller,
&TotalNumberOfBytes,
- &TotalNumberOfFreeBytes) == 0) RETURN_FALSE;
+ &TotalNumberOfFreeBytes) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ RETURN_FALSE;
+ }
/* i know - this is ugly, but i works <thies@thieso.net> */
bytesfree = FreeBytesAvailableToCaller.HighPart *
@@ -284,7 +303,10 @@ PHP_FUNCTION(disk_free_space)
else {
if (GetDiskFreeSpace(Z_STRVAL_PP(path),
&SectorsPerCluster, &BytesPerSector,
- &NumberOfFreeClusters, &TotalNumberOfClusters) == 0) RETURN_FALSE;
+ &NumberOfFreeClusters, &TotalNumberOfClusters) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ RETURN_FALSE;
+ }
bytesfree = (double)NumberOfFreeClusters * (double)SectorsPerCluster * (double)BytesPerSector;
}
}
@@ -303,14 +325,20 @@ PHP_FUNCTION(disk_free_space)
}
#else /* WINDOWS, OS/2 */
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
- if (statvfs(Z_STRVAL_PP(path), &buf)) RETURN_FALSE;
+ if (statvfs(Z_STRVAL_PP(path), &buf)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ RETURN_FALSE;
+ }
if (buf.f_frsize) {
bytesfree = (((double)buf.f_bavail) * ((double)buf.f_frsize));
} else {
bytesfree = (((double)buf.f_bavail) * ((double)buf.f_bsize));
}
#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
- if (statfs(Z_STRVAL_PP(path), &buf)) RETURN_FALSE;
+ if (statfs(Z_STRVAL_PP(path), &buf)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ RETURN_FALSE;
+ }
#ifdef NETWARE
bytesfree = (((double)buf.f_bsize) * ((double)buf.f_bfree));
#else
@@ -538,7 +566,6 @@ PHP_FUNCTION(touch)
{
zval **filename, **filetime, **fileatime;
int ret;
- struct stat sb;
FILE *file;
struct utimbuf newtimebuf;
struct utimbuf *newtime = NULL;
@@ -575,8 +602,7 @@ PHP_FUNCTION(touch)
}
/* create the file if it doesn't exist already */
- ret = VCWD_STAT(Z_STRVAL_PP(filename), &sb);
- if (ret == -1) {
+ if (VCWD_ACCESS(Z_STRVAL_PP(filename), F_OK) != 0) {
file = VCWD_FOPEN(Z_STRVAL_PP(filename), "w");
if (file == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create file %s because %s", Z_STRVAL_PP(filename), strerror(errno));
diff --git a/ext/standard/filters.c b/ext/standard/filters.c
index 12aeabecd..2c87e88ec 100644
--- a/ext/standard/filters.c
+++ b/ext/standard/filters.c
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filters.c,v 1.44.2.6 2006/04/17 19:26:04 pollita Exp $ */
+/* $Id: filters.c,v 1.44.2.6.2.3 2006/09/04 19:14:59 nlopess Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -470,7 +470,6 @@ static php_conv_err_t php_conv_base64_encode_convert(php_conv_base64_encode *ins
register size_t ocnt, icnt;
register unsigned char *ps, *pd;
register unsigned int line_ccnt;
- size_t nbytes_written;
if (in_pp == NULL || in_left_p == NULL) {
return php_conv_base64_encode_flush(inst, in_pp, in_left_p, out_pp, out_left_p);
@@ -481,7 +480,6 @@ static php_conv_err_t php_conv_base64_encode_convert(php_conv_base64_encode *ins
ps = (unsigned char *)(*in_pp);
icnt = *in_left_p;
line_ccnt = inst->line_ccnt;
- nbytes_written = 0;
/* consume the remainder first */
switch (inst->erem_len) {
@@ -1882,7 +1880,7 @@ static php_stream_filter *consumed_filter_create(const char *filtername, zval *f
/* Create this filter */
data = pecalloc(1, sizeof(php_consumed_filter_data), persistent);
if (!data) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %d bytes.", sizeof(php_consumed_filter_data));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes.", sizeof(php_consumed_filter_data));
return NULL;
}
data->persistent = persistent;
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c
index 0f84ec215..dce8c936b 100644
--- a/ext/standard/formatted_print.c
+++ b/ext/standard/formatted_print.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: formatted_print.c,v 1.82.2.1 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: formatted_print.c,v 1.82.2.1.2.1 2006/06/26 18:48:56 bjori Exp $ */
#include <math.h> /* modf() */
#include "php.h"
@@ -853,6 +853,7 @@ PHP_FUNCTION(fprintf)
RETURN_LONG(len);
}
+/* }}} */
/* {{{ proto int vfprintf(resource stream, string format, array args)
Output a formatted string into a stream */
@@ -883,7 +884,7 @@ PHP_FUNCTION(vfprintf)
RETURN_LONG(len);
}
-
+/* }}} */
/*
diff --git a/ext/standard/head.c b/ext/standard/head.c
index fa43319e9..c1b0c263c 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
-/* $Id: head.c,v 1.84.2.1 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: head.c,v 1.84.2.1.2.2 2006/10/16 19:27:57 tony2001 Exp $ */
#include <stdio.h>
#include "php.h"
@@ -60,7 +60,7 @@ PHPAPI int php_header(TSRMLS_D)
}
-PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode TSRMLS_DC)
+PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode, int httponly TSRMLS_DC)
{
char *cookie, *encoded_value = NULL;
int len=sizeof("Set-Cookie: ");
@@ -131,6 +131,9 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
if (secure) {
strcat(cookie, "; secure");
}
+ if (httponly) {
+ strcat(cookie, "; httponly");
+ }
ctr.line = cookie;
ctr.line_len = strlen(cookie);
@@ -142,22 +145,22 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
/* php_set_cookie(name, value, expires, path, domain, secure) */
-/* {{{ proto bool setcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure]]]]])
+/* {{{ proto bool setcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure[, bool httponly]]]]]])
Send a cookie */
PHP_FUNCTION(setcookie)
{
char *name, *value = NULL, *path = NULL, *domain = NULL;
long expires = 0;
- zend_bool secure = 0;
- int name_len, value_len, path_len, domain_len;
+ zend_bool secure = 0, httponly = 0;
+ int name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
&name_len, &value, &value_len, &expires, &path,
- &path_len, &domain, &domain_len, &secure) == FAILURE) {
+ &path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
}
- if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 1 TSRMLS_CC) == SUCCESS) {
+ if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 1, httponly TSRMLS_CC) == SUCCESS) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
@@ -165,22 +168,22 @@ PHP_FUNCTION(setcookie)
}
/* }}} */
-/* {{{ proto bool setrawcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure]]]]])
+/* {{{ proto bool setrawcookie(string name [, string value [, int expires [, string path [, string domain [, bool secure[, bool httponly]]]]]])
Send a cookie with no url encoding of the value */
PHP_FUNCTION(setrawcookie)
{
char *name, *value = NULL, *path = NULL, *domain = NULL;
long expires = 0;
- zend_bool secure = 0;
- int name_len, value_len, path_len, domain_len;
+ zend_bool secure = 0, httponly = 0;
+ int name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
&name_len, &value, &value_len, &expires, &path,
- &path_len, &domain, &domain_len, &secure) == FAILURE) {
+ &path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
}
- if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 0 TSRMLS_CC) == SUCCESS) {
+ if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 0, httponly TSRMLS_CC) == SUCCESS) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
diff --git a/ext/standard/head.h b/ext/standard/head.h
index bc4785857..d009a8954 100644
--- a/ext/standard/head.h
+++ b/ext/standard/head.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: head.h,v 1.28.2.1 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: head.h,v 1.28.2.1.2.1 2006/08/10 13:50:56 iliaa Exp $ */
#ifndef HEAD_H
#define HEAD_H
@@ -29,6 +29,6 @@ PHP_FUNCTION(headers_sent);
PHP_FUNCTION(headers_list);
PHPAPI int php_header(TSRMLS_D);
-PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode TSRMLS_DC);
+PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode, int httponly TSRMLS_DC);
#endif
diff --git a/ext/standard/html.c b/ext/standard/html.c
index 08e791192..d70172c94 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: html.c,v 1.111.2.2 2006/02/25 21:32:11 rasmus Exp $ */
+/* $Id: html.c,v 1.111.2.2.2.3 2006/11/01 01:55:11 iliaa Exp $ */
/*
* HTML entity resources:
@@ -756,6 +756,15 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC)
charset_hint = Z_STRVAL_P(uf_result);
len = Z_STRLEN_P(uf_result);
+ if (len == 4) { /* sizeof(none|auto|pass)-1 */
+ if (!memcmp("pass", charset_hint, sizeof("pass") - 1) ||
+ !memcmp("auto", charset_hint, sizeof("auto") - 1) ||
+ !memcmp("none", charset_hint, sizeof("none") - 1)) {
+
+ charset_hint = NULL;
+ len = 0;
+ }
+ }
goto det_charset;
}
}
@@ -1096,7 +1105,7 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
matches_map = 0;
- if (len + 9 > maxlen)
+ if (len + 16 > maxlen)
replaced = erealloc (replaced, maxlen += 128);
if (all) {
@@ -1121,9 +1130,15 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
}
if (matches_map) {
+ int l = strlen(rep);
+ /* increase the buffer size */
+ if (len + 2 + l >= maxlen) {
+ replaced = erealloc(replaced, maxlen += 128);
+ }
+
replaced[len++] = '&';
strcpy(replaced + len, rep);
- len += strlen(rep);
+ len += l;
replaced[len++] = ';';
}
}
@@ -1212,7 +1227,7 @@ PHP_FUNCTION(htmlspecialchars)
}
/* }}} */
-/* {{{ proto string htmlspecialchars(string string [, int quote_style])
+/* {{{ proto string htmlspecialchars_decode(string string [, int quote_style])
Convert special HTML entities back to characters */
PHP_FUNCTION(htmlspecialchars_decode)
{
diff --git a/ext/standard/http.c b/ext/standard/http.c
index af6ec8292..b57f43bf5 100644
--- a/ext/standard/http.c
+++ b/ext/standard/http.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: http.c,v 1.14.2.4 2006/03/08 22:00:21 mike Exp $ */
+/* $Id: http.c,v 1.14.2.4.2.1 2006/07/24 18:03:45 helly Exp $ */
#include "php_http.h"
#include "php_ini.h"
@@ -67,11 +67,11 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
char *tmp;
zend_object *zobj = zend_objects_get_address(type TSRMLS_CC);
- if (zend_check_property_access(zobj, key TSRMLS_CC) != SUCCESS) {
+ if (zend_check_property_access(zobj, key, key_len-1 TSRMLS_CC) != SUCCESS) {
/* private or protected property access outside of the class */
continue;
}
- zend_unmangle_property_name_ex(key, key_len, &tmp, &key);
+ zend_unmangle_property_name(key, key_len-1, &tmp, &key);
key_len = strlen(key);
}
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index ba39b714a..14f5d0015 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -19,7 +19,7 @@
| Sara Golemon <pollita@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: http_fopen_wrapper.c,v 1.99.2.12 2006/04/16 17:40:33 iliaa Exp $ */
+/* $Id: http_fopen_wrapper.c,v 1.99.2.12.2.1 2006/06/29 14:40:49 bjori Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -619,7 +619,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
php_url_free(resource);
/* check for invalid redirection URLs */
if ((resource = php_url_parse(new_path)) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect url! %s", new_path);
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path);
goto out;
}
@@ -631,7 +631,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
s = val; e = s + l; \
while (s < e) { \
if (iscntrl(*s)) { \
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect url! %s", new_path); \
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path); \
goto out; \
} \
s++; \
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 390680b0a..6fca6a28f 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: image.c,v 1.114.2.2 2006/01/01 12:50:14 sniper Exp $ */
+/* $Id: image.c,v 1.114.2.2.2.2 2006/06/25 21:08:28 bjori Exp $ */
#include "php.h"
#include <stdio.h>
@@ -1165,6 +1165,10 @@ PHP_FUNCTION(image_type_to_extension)
RETURN_STRING(".jpc" + !inc_dot, 1);
case IMAGE_FILETYPE_JP2:
RETURN_STRING(".jp2" + !inc_dot, 1);
+ case IMAGE_FILETYPE_JPX:
+ RETURN_STRING(".jpx" + !inc_dot, 1);
+ case IMAGE_FILETYPE_JB2:
+ RETURN_STRING(".jb2" + !inc_dot, 1);
case IMAGE_FILETYPE_XBM:
RETURN_STRING(".xbm" + !inc_dot, 1);
}
diff --git a/ext/standard/info.c b/ext/standard/info.c
index fa2afe07d..eb3389713 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: info.c,v 1.249.2.10 2006/03/31 11:11:12 tony2001 Exp $ */
+/* $Id: info.c,v 1.249.2.10.2.6 2006/09/14 08:01:48 dmitry Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -66,7 +66,7 @@ static int php_info_write_wrapper(const char *str, uint str_length)
TSRMLS_FETCH();
- elem_esc = php_escape_html_entities((char *)str, str_length, &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
+ elem_esc = php_escape_html_entities((unsigned char *)str, str_length, &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
written = php_body_write(elem_esc, new_len TSRMLS_CC);
@@ -114,7 +114,6 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
char *string_key;
uint string_len;
ulong num_key;
- char *elem_esc = NULL;
zend_is_auto_global(name, name_length TSRMLS_CC);
@@ -134,11 +133,9 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
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);
+ php_info_html_esc_write(string_key, string_len - 1 TSRMLS_CC);
} else {
- PUTS(string_key);
+ PHPWRITE(string_key, string_len - 1);
}
break;
case HASH_KEY_IS_LONG:
@@ -154,7 +151,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
if (Z_TYPE_PP(tmp) == IS_ARRAY) {
if (!sapi_module.phpinfo_as_text) {
PUTS("<pre>");
- zend_print_zval_ex((zend_write_func_t) php_info_write_wrapper, *tmp, 0);
+ zend_print_zval_r_ex((zend_write_func_t) php_info_write_wrapper, *tmp, 0 TSRMLS_CC);
PUTS("</pre>");
} else {
zend_print_zval_r(*tmp, 0 TSRMLS_CC);
@@ -167,12 +164,10 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
if (Z_STRLEN(tmp2) == 0) {
PUTS("<i>no value</i>");
} else {
- elem_esc = php_info_html_esc(Z_STRVAL(tmp2) TSRMLS_CC);
- PUTS(elem_esc);
- efree(elem_esc);
+ php_info_html_esc_write(Z_STRVAL(tmp2), Z_STRLEN(tmp2) TSRMLS_CC);
}
} else {
- PUTS(Z_STRVAL(tmp2));
+ PHPWRITE(Z_STRVAL(tmp2), Z_STRLEN(tmp2));
}
zval_dtor(&tmp2);
} else {
@@ -180,12 +175,10 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
if (Z_STRLEN_PP(tmp) == 0) {
PUTS("<i>no value</i>");
} else {
- elem_esc = php_info_html_esc(Z_STRVAL_PP(tmp) TSRMLS_CC);
- PUTS(elem_esc);
- efree(elem_esc);
+ php_info_html_esc_write(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp) TSRMLS_CC);
}
} else {
- PUTS(Z_STRVAL_PP(tmp));
+ PHPWRITE(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
}
}
if (!sapi_module.phpinfo_as_text) {
@@ -209,13 +202,24 @@ void php_info_print_style(TSRMLS_D)
}
/* }}} */
+/* {{{ php_info_html_esc_write
+ */
+PHPAPI void php_info_html_esc_write(char *string, int str_len TSRMLS_DC)
+{
+ int new_len;
+ char *ret = php_escape_html_entities((unsigned char *)string, str_len, &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
+
+ PHPWRITE(ret, new_len);
+ efree(ret);
+}
+/* }}} */
/* {{{ 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);
+ return php_escape_html_entities((unsigned char *)string, strlen(string), &new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
}
/* }}} */
@@ -486,11 +490,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
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
+ php_info_print_table_row(2, "Zend Memory Manager", is_zend_mm(TSRMLS_C) ? "enabled" : "disabled" );
#if HAVE_IPV6
php_info_print_table_row(2, "IPv6 Support", "enabled" );
@@ -505,7 +505,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
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_get_current_key_ex(url_stream_wrappers_hash, &stream_protocol, (uint *)&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);
@@ -536,7 +536,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
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_get_current_key_ex(stream_xport_hash, &xport_name, (uint *)&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) {
@@ -577,7 +577,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
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_get_current_key_ex(stream_filter_hash, &filter_name, (uint *)&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) {
diff --git a/ext/standard/info.h b/ext/standard/info.h
index 7d417247b..191623c72 100644
--- a/ext/standard/info.h
+++ b/ext/standard/info.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: info.h,v 1.38.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: info.h,v 1.38.2.1.2.2 2006/09/29 21:40:16 iliaa Exp $ */
#ifndef INFO_H
#define INFO_H
@@ -67,6 +67,7 @@ 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_info_html_esc_write(char *string, int str_len 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);
@@ -81,6 +82,7 @@ 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);
+PHPAPI char *php_get_uname(char mode);
void register_phpinfo_constants(INIT_FUNC_ARGS);
END_EXTERN_C()
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index b4957fc61..fdf33bb81 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: iptc.c,v 1.50.2.2 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: iptc.c,v 1.50.2.2.2.1 2006/08/30 16:30:14 tony2001 Exp $ */
/*
* Functions to parse & compse IPTC data.
@@ -231,11 +231,17 @@ PHP_FUNCTION(iptcembed)
if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xFF) {
fclose(fp);
+ if (poi) {
+ efree(poi);
+ }
RETURN_FALSE;
}
if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xD8) {
fclose(fp);
+ if (poi) {
+ efree(poi);
+ }
RETURN_FALSE;
}
diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c
index a6c48239a..8caa58e49 100644
--- a/ext/standard/levenshtein.c
+++ b/ext/standard/levenshtein.c
@@ -15,7 +15,7 @@
| Author: Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: levenshtein.c,v 1.34.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: levenshtein.c,v 1.34.2.1.2.1 2006/06/26 18:48:56 bjori Exp $ */
#include "php.h"
#include <stdlib.h>
@@ -79,7 +79,7 @@ static int custom_levdist(char *str1, char *str2, char *callback_name TSRMLS_DC)
}
/* }}} */
-/* {{{ proto int levenshtein(string str1, string str2)
+/* {{{ proto int levenshtein(string str1, string str2[, int cost_ins, int cost_rep, int cost_del])
Calculate Levenshtein distance between two strings */
PHP_FUNCTION(levenshtein)
{
diff --git a/ext/standard/link.c b/ext/standard/link.c
index 832494932..8bc554fb6 100644
--- a/ext/standard/link.c
+++ b/ext/standard/link.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: link.c,v 1.52.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: link.c,v 1.52.2.1.2.1 2006/09/16 18:30:03 iliaa Exp $ */
#include "php.h"
#include "php_filestat.h"
@@ -122,14 +122,15 @@ PHP_FUNCTION(symlink)
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 (!expand_filepath(Z_STRVAL_PP(frompath), source_p TSRMLS_CC) || !expand_filepath(Z_STRVAL_PP(topath), dest_p TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
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;
+ RETURN_FALSE;
}
if (PG(safe_mode) && !php_checkuid(dest_p, NULL, CHECKUID_CHECK_FILE_AND_DIR)) {
@@ -177,14 +178,15 @@ PHP_FUNCTION(link)
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 (!expand_filepath(Z_STRVAL_PP(frompath), source_p TSRMLS_CC) || !expand_filepath(Z_STRVAL_PP(topath), dest_p TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
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;
+ RETURN_FALSE;
}
if (PG(safe_mode) && !php_checkuid(dest_p, NULL, CHECKUID_CHECK_FILE_AND_DIR)) {
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 2f5ee7ba0..875f9fc1e 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: math.c,v 1.131.2.2 2006/02/06 11:28:41 tony2001 Exp $ */
+/* $Id: math.c,v 1.131.2.2.2.2 2006/08/27 19:14:43 bjori Exp $ */
#include "php.h"
#include "php_math.h"
@@ -29,10 +29,6 @@
#include <float.h>
#include <stdlib.h>
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
#ifndef PHP_ROUND_FUZZ
# ifndef PHP_WIN32
# define PHP_ROUND_FUZZ 0.50000000001
@@ -976,13 +972,8 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
is_negative = 1;
d = -d;
}
- if (!dec_point && dec > 0) {
- d *= pow(10, dec);
- dec = 0;
- } else {
- dec = MAX(0, dec);
- }
+ dec = MAX(0, dec);
PHP_ROUND_WITH_FUZZ(d, dec);
tmplen = spprintf(&tmpbuf, 0, "%.*f", dec, d);
@@ -991,8 +982,10 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
return tmpbuf;
}
+ /* find decimal point, if expected */
+ dp = dec ? strchr(tmpbuf, '.') : NULL;
+
/* calculate the length of the return buffer */
- dp = strchr(tmpbuf, '.');
if (dp) {
integral = dp - tmpbuf;
} else {
@@ -1008,7 +1001,11 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
reslen = integral;
if (dec) {
- reslen += 1 + dec;
+ reslen += dec;
+
+ if (dec_point) {
+ reslen++;
+ }
}
/* add a byte for minus sign */
@@ -1025,29 +1022,29 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
* 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;
+ int declen = dp ? s - dp : 0;
+ int topad = dec > declen ? 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);
-
+ s -= declen + 1; /* +1 to skip the point */
t -= declen;
- s -= declen;
+
+ /* now copy the chars after the point */
+ memcpy(t + 1, dp + 1, declen);
}
/* add decimal point */
- *t-- = dec_point;
- s--;
+ if (dec_point) {
+ *t-- = dec_point;
+ }
}
- /* copy the numbers before the decimal place, adding thousand
+ /* copy the numbers before the decimal point, adding thousand
* separator every three digits */
while(s >= tmpbuf) {
*t-- = *s--;
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c
index de9fff83a..206b555ed 100644
--- a/ext/standard/metaphone.c
+++ b/ext/standard/metaphone.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: metaphone.c,v 1.28.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: metaphone.c,v 1.28.2.1.2.3 2006/09/27 08:32:24 tony2001 Exp $ */
/*
Based on CPANs "Text-Metaphone-1.96" by Michael G Schwern <schwern@pobox.com>
@@ -25,11 +25,9 @@
#include "php.h"
#include "php_metaphone.h"
-static int metaphone(char *word, int word_len, int max_phonemes, char **phoned_word, int traditional);
+static int metaphone(unsigned char *word, int word_len, long max_phonemes, char **phoned_word, int traditional);
-PHP_FUNCTION(metaphone);
-
-/* {{{ proto string metaphone(string text, int phones)
+/* {{{ proto string metaphone(string text[, int phones])
Break english phrases down into their phonemes */
PHP_FUNCTION(metaphone)
{
@@ -43,7 +41,7 @@ PHP_FUNCTION(metaphone)
return;
}
- if (metaphone(str, str_len, phones, &result, 1) == 0) {
+ if (metaphone((unsigned char *)str, str_len, phones, &result, 1) == 0) {
RETVAL_STRING(result, 0);
} else {
if (result) {
@@ -161,7 +159,7 @@ static char Lookahead(char *word, int how_far)
/* {{{ metaphone
*/
-static int metaphone(char *word, int word_len, int max_phonemes, char **phoned_word, int traditional)
+static int metaphone(unsigned char *word, int word_len, long 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 */
diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h
index b4e6923b4..1b48eb998 100644
--- a/ext/standard/php_array.h
+++ b/ext/standard/php_array.h
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_array.h,v 1.50.2.3 2006/06/03 18:59:55 andrei Exp $ */
+/* $Id: php_array.h,v 1.50.2.2.2.2 2006/07/15 10:21:09 helly Exp $ */
#ifndef PHP_ARRAY_H
#define PHP_ARRAY_H
@@ -54,6 +54,7 @@ PHP_FUNCTION(array_search);
PHP_FUNCTION(extract);
PHP_FUNCTION(compact);
PHP_FUNCTION(array_fill);
+PHP_FUNCTION(array_fill_keys);
PHP_FUNCTION(range);
PHP_FUNCTION(shuffle);
PHP_FUNCTION(array_multisort);
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index db2157396..bc792edd3 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -17,7 +17,7 @@
| Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_fopen_wrapper.c,v 1.45.2.4 2006/05/01 16:02:07 helly Exp $ */
+/* $Id: php_fopen_wrapper.c,v 1.45.2.4.2.2 2006/07/05 17:38:14 iliaa Exp $ */
#include <stdio.h>
#include <stdlib.h>
@@ -171,7 +171,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
path += 11;
max_memory = strtol(path, NULL, 10);
if (max_memory < 0) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Max memory must be >= 0");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Max memory must be >= 0");
return NULL;
}
}
@@ -207,7 +207,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
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.");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "No URL resource specified.");
efree(pathdup);
return NULL;
}
diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h
index 4c1403c29..d4f38d217 100644
--- a/ext/standard/php_string.h
+++ b/ext/standard/php_string.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_string.h,v 1.87.2.2 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: php_string.h,v 1.87.2.2.2.1 2006/08/28 23:33:37 iliaa Exp $ */
/* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */
@@ -134,7 +134,7 @@ PHPAPI char *php_trim(char *c, int len, char *what, int what_len, zval *return_v
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, zval *result, int case_sensitivity, int *replace_count);
PHPAPI int php_char_to_str(char *str, uint len, char from, char *to, int to_len, zval *result);
-PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value);
+PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC);
PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, int limit);
PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end);
diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h
index 827685ec8..332aa4f86 100644
--- a/ext/standard/php_var.h
+++ b/ext/standard/php_var.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_var.h,v 1.30.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: php_var.h,v 1.30.2.1.2.1 2006/05/30 14:51:20 iliaa Exp $ */
#ifndef PHP_VAR_H
#define PHP_VAR_H
@@ -30,6 +30,7 @@ PHP_FUNCTION(serialize);
PHP_FUNCTION(unserialize);
#if MEMORY_LIMIT
PHP_FUNCTION(memory_get_usage);
+PHP_FUNCTION(memory_get_peak_usage);
#endif
PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC);
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 6ce2323e0..8d7bc669f 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -15,7 +15,7 @@
| Author: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: proc_open.c,v 1.36.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: proc_open.c,v 1.36.2.1.2.1 2006/06/01 14:03:49 tony2001 Exp $ */
#if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__))
# define _BSD_SOURCE /* linux wants this when XOPEN mode is on */
@@ -501,7 +501,9 @@ PHP_FUNCTION(proc_open)
php_process_id_t child;
struct php_process_handle *proc;
int is_persistent = 0; /* TODO: ensure that persistent procs will work */
+#ifdef PHP_WIN32
int suppress_errors = 0;
+#endif
#if PHP_CAN_DO_PTS
php_file_descriptor_t dev_ptmx = -1; /* master */
php_file_descriptor_t slave_pty = -1;
@@ -517,6 +519,7 @@ PHP_FUNCTION(proc_open)
RETURN_FALSE;
}
+#ifdef PHP_WIN32
if (other_options) {
zval **item;
if (SUCCESS == zend_hash_find(Z_ARRVAL_P(other_options), "suppress_errors", sizeof("suppress_errors"), (void**)&item)) {
@@ -525,6 +528,7 @@ PHP_FUNCTION(proc_open)
}
}
}
+#endif
command_len = strlen(command);
diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c
index c40a29a63..7659cce40 100644
--- a/ext/standard/scanf.c
+++ b/ext/standard/scanf.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: scanf.c,v 1.31.2.3 2006/08/04 20:34:31 tony2001 Exp $ */
+/* $Id: scanf.c,v 1.31.2.2.2.1 2006/08/04 11:50:15 tony2001 Exp $ */
/*
scanf.c --
diff --git a/ext/standard/sha1.h b/ext/standard/sha1.h
index 2ddb2a364..c55207955 100644
--- a/ext/standard/sha1.h
+++ b/ext/standard/sha1.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sha1.h,v 1.5.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: sha1.h,v 1.5.2.1.2.1 2006/09/29 22:35:47 iliaa Exp $ */
#ifndef SHA1_H
#define SHA1_H
@@ -33,6 +33,7 @@ typedef struct {
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 *);
+PHPAPI void make_sha1_digest(char *sha1str, unsigned char *digest);
PHP_FUNCTION(sha1);
PHP_FUNCTION(sha1_file);
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 05d1efdcd..9a1564cb9 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streamsfuncs.c,v 1.58.2.6 2006/04/19 08:43:29 tony2001 Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.9 2006/10/11 23:22:45 pollita Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -33,8 +33,10 @@
#ifndef PHP_WIN32
#define php_select(m, r, w, e, t) select(m, r, w, e, t)
+typedef unsigned long long php_timeout_ull;
#else
#include "win32/select.h"
+typedef unsigned __int64 php_timeout_ull;
#endif
static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC);
@@ -81,7 +83,7 @@ PHP_FUNCTION(stream_socket_client)
int host_len;
zval *zerrno = NULL, *zerrstr = NULL, *zcontext = NULL;
double timeout = FG(default_socket_timeout);
- unsigned long conv;
+ php_timeout_ull conv;
struct timeval tv;
char *hashkey = NULL;
php_stream *stream = NULL;
@@ -103,7 +105,7 @@ PHP_FUNCTION(stream_socket_client)
}
/* prepare the timeout value for use */
- conv = (unsigned long) (timeout * 1000000.0);
+ conv = (php_timeout_ull) (timeout * 1000000.0);
tv.tv_sec = conv / 1000000;
tv.tv_usec = conv % 1000000;
@@ -231,7 +233,7 @@ PHP_FUNCTION(stream_socket_accept)
{
double timeout = FG(default_socket_timeout);
zval *peername = NULL;
- unsigned long conv;
+ php_timeout_ull conv;
struct timeval tv;
php_stream *stream = NULL, *clistream = NULL;
zval *zstream;
@@ -245,7 +247,7 @@ PHP_FUNCTION(stream_socket_accept)
php_stream_from_zval(stream, &zstream);
/* prepare the timeout value for use */
- conv = (unsigned long) (timeout * 1000000.0);
+ conv = (php_timeout_ull) (timeout * 1000000.0);
tv.tv_sec = conv / 1000000;
tv.tv_usec = conv % 1000000;
@@ -309,7 +311,7 @@ PHP_FUNCTION(stream_socket_sendto)
php_stream *stream;
zval *zstream;
long flags = 0;
- char *data, *target_addr;
+ char *data, *target_addr = NULL;
int datalen, target_addr_len = 0;
php_sockaddr_storage sa;
socklen_t sl = 0;
@@ -404,7 +406,7 @@ PHP_FUNCTION(stream_get_contents)
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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %ld in the stream.", pos);
RETURN_FALSE;
}
@@ -440,7 +442,7 @@ PHP_FUNCTION(stream_copy_to_stream)
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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %ld in the stream.", pos);
RETURN_FALSE;
}
@@ -448,7 +450,7 @@ PHP_FUNCTION(stream_copy_to_stream)
}
/* }}} */
-/* {{{ proto resource stream_get_meta_data(resource fp)
+/* {{{ proto array stream_get_meta_data(resource fp)
Retrieves header/meta data from streams/file pointers */
PHP_FUNCTION(stream_get_meta_data)
{
@@ -612,7 +614,7 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
return 0;
}
ALLOC_HASHTABLE(new_hash);
- zend_hash_init(new_hash, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(new_hash, zend_hash_num_elements(Z_ARRVAL_P(stream_array)), 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;
@@ -660,7 +662,7 @@ static int stream_array_emulate_read_fd_set(zval *stream_array TSRMLS_DC)
return 0;
}
ALLOC_HASHTABLE(new_hash);
- zend_hash_init(new_hash, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(new_hash, zend_hash_num_elements(Z_ARRVAL_P(stream_array)), 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;
@@ -706,7 +708,7 @@ static int stream_array_emulate_read_fd_set(zval *stream_array TSRMLS_DC)
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;
+ zval *r_array, *w_array, *e_array, **sec = NULL;
struct timeval tv;
struct timeval *tv_p = NULL;
fd_set rfds, wfds, efds;
@@ -715,7 +717,7 @@ PHP_FUNCTION(stream_select)
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)
+ 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);
@@ -752,9 +754,9 @@ PHP_FUNCTION(stream_select)
/* If seconds is not set to null, build the timeval, else we wait indefinitely */
if (sec != NULL) {
- convert_to_long(sec);
+ convert_to_long_ex(sec);
- if (Z_LVAL_P(sec) < 0) {
+ if (Z_LVAL_PP(sec) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The seconds parameter must be greater than 0.");
RETURN_FALSE;
} else if (usec < 0) {
@@ -764,10 +766,10 @@ PHP_FUNCTION(stream_select)
/* 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_sec = Z_LVAL_PP(sec) + (usec / 1000000);
tv.tv_usec = usec % 1000000;
} else {
- tv.tv_sec = Z_LVAL_P(sec);
+ tv.tv_sec = Z_LVAL_PP(sec);
tv.tv_usec = usec;
}
@@ -1117,6 +1119,7 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS)
RETURN_FALSE;
}
}
+/* }}} */
/* {{{ proto resource stream_filter_prepend(resource stream, string filtername[, int read_write[, string filterparams]])
Prepend a filter to a stream */
@@ -1171,7 +1174,7 @@ PHP_FUNCTION(stream_filter_remove)
PHP_FUNCTION(stream_get_line)
{
char *str = NULL;
- int str_len;
+ int str_len = 0;
long max_length;
zval *zstream;
char *buf;
@@ -1225,15 +1228,6 @@ PHP_FUNCTION(stream_set_blocking)
/* }}} */
-/* {{{ 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)
diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h
index c72575b78..338f606ed 100644
--- a/ext/standard/streamsfuncs.h
+++ b/ext/standard/streamsfuncs.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streamsfuncs.h,v 1.13.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: streamsfuncs.h,v 1.13.2.1.2.1 2006/06/26 16:33:39 bjori Exp $ */
/* Flags for stream_socket_client */
#define PHP_STREAM_CLIENT_PERSISTENT 1
@@ -33,7 +33,6 @@ 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);
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 67d6b1cf4..0b1b19d75 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.445.2.16 2006/08/10 17:46:43 iliaa Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.27 2006/10/11 14:19:55 iliaa Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -59,7 +59,8 @@
#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 PHP_PATHINFO_FILENAME 8
+#define PHP_PATHINFO_ALL (PHP_PATHINFO_DIRNAME | PHP_PATHINFO_BASENAME | PHP_PATHINFO_EXTENSION | PHP_PATHINFO_FILENAME)
#define STR_STRSPN 0
#define STR_STRCSPN 1
@@ -74,6 +75,7 @@ void register_string_constants(INIT_FUNC_ARGS)
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);
+ REGISTER_LONG_CONSTANT("PATHINFO_FILENAME", PHP_PATHINFO_FILENAME, CONST_CS | CONST_PERSISTENT);
#ifdef HAVE_LOCALECONV
/* If last members of struct lconv equal CHAR_MAX, no grouping is done */
@@ -668,7 +670,7 @@ PHP_FUNCTION(wordwrap)
lastspace = current;
} else if (current - laststart >= linelength && laststart != lastspace) {
newtext[lastspace] = breakchar[0];
- laststart = lastspace;
+ laststart = lastspace + 1;
}
}
@@ -878,12 +880,14 @@ PHP_FUNCTION(explode)
/* {{{ php_implode
*/
-PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value)
+PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC)
{
zval **tmp;
HashPosition pos;
smart_str implstr = {0};
int numelems, i = 0;
+ zval tmp_val;
+ int str_len;
numelems = zend_hash_num_elements(Z_ARRVAL_P(arr));
@@ -894,12 +898,56 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value)
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 ((*tmp)->type != IS_STRING) {
- SEPARATE_ZVAL(tmp);
- convert_to_string(*tmp);
- }
-
- smart_str_appendl(&implstr, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ switch ((*tmp)->type) {
+ case IS_STRING:
+ smart_str_appendl(&implstr, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ break;
+
+ case IS_LONG: {
+ char stmp[MAX_LENGTH_OF_LONG + 1];
+ str_len = sprintf(stmp, "%ld", Z_LVAL_PP(tmp));
+ smart_str_appendl(&implstr, stmp, str_len);
+ }
+ break;
+
+ case IS_BOOL:
+ if (Z_LVAL_PP(tmp) == 1) {
+ smart_str_appendl(&implstr, "1", sizeof("1")-1);
+ }
+ break;
+
+ case IS_NULL:
+ break;
+
+ case IS_DOUBLE: {
+ char *stmp;
+ str_len = spprintf(&stmp, 0, "%.*G", (int) EG(precision), Z_DVAL_PP(tmp));
+ smart_str_appendl(&implstr, stmp, str_len);
+ efree(stmp);
+ }
+ break;
+
+ case IS_OBJECT: {
+ int copy;
+ zval expr;
+ zend_make_printable_zval(*tmp, &expr, &copy);
+ smart_str_appendl(&implstr, Z_STRVAL(expr), Z_STRLEN(expr));
+ if (copy) {
+ zval_dtor(&expr);
+ }
+ }
+ break;
+
+ default:
+ tmp_val = **tmp;
+ zval_copy_ctor(&tmp_val);
+ convert_to_string(&tmp_val);
+ smart_str_appendl(&implstr, Z_STRVAL(tmp_val), Z_STRLEN(tmp_val));
+ zval_dtor(&tmp_val);
+ break;
+
+ }
+
if (++i != numelems) {
smart_str_appendl(&implstr, Z_STRVAL_P(delim), Z_STRLEN_P(delim));
}
@@ -917,6 +965,7 @@ PHP_FUNCTION(implode)
{
zval **arg1 = NULL, **arg2 = NULL, *delim, *arr;
int argc = ZEND_NUM_ARGS();
+ HashPosition pos;
if (argc < 1 || argc > 2 ||
zend_get_parameters_ex(argc, &arg1, &arg2) == FAILURE) {
@@ -937,12 +986,10 @@ PHP_FUNCTION(implode)
arr = *arg1;
} else {
if (Z_TYPE_PP(arg1) == IS_ARRAY) {
- SEPARATE_ZVAL(arg1);
arr = *arg1;
convert_to_string_ex(arg2);
delim = *arg2;
} else if (Z_TYPE_PP(arg2) == IS_ARRAY) {
- SEPARATE_ZVAL(arg2);
arr = *arg2;
convert_to_string_ex(arg1);
delim = *arg1;
@@ -952,7 +999,11 @@ PHP_FUNCTION(implode)
}
}
- php_implode(delim, arr, return_value);
+ pos = Z_ARRVAL_P(arr)->pInternalPointer;
+
+ php_implode(delim, arr, return_value TSRMLS_CC);
+
+ Z_ARRVAL_P(arr)->pInternalPointer = pos;
if (argc == 1) {
FREE_ZVAL(delim);
@@ -1157,7 +1208,12 @@ PHPAPI void php_basename(char *s, size_t len, char *suffix, size_t sufflen, char
state = 1;
}
}
+ break;
default:
+ if (state == 0) {
+ comp = c;
+ state = 1;
+ }
break;
}
c += inc_len;
@@ -1319,13 +1375,13 @@ PHP_FUNCTION(dirname)
}
/* }}} */
-/* {{{ proto array pathinfo(string path)
+/* {{{ proto array pathinfo(string path[, int options])
Returns information about a certain string */
PHP_FUNCTION(pathinfo)
{
zval *tmp;
char *path, *ret = NULL;
- int path_len;
+ int path_len, have_basename;
size_t ret_len;
long opt = PHP_PATHINFO_ALL;
@@ -1333,6 +1389,8 @@ PHP_FUNCTION(pathinfo)
return;
}
+ have_basename = ((opt & PHP_PATHINFO_BASENAME) == PHP_PATHINFO_BASENAME);
+
MAKE_STD_ZVAL(tmp);
array_init(tmp);
@@ -1343,33 +1401,47 @@ PHP_FUNCTION(pathinfo)
add_assoc_string(tmp, "dirname", ret, 1);
}
efree(ret);
+ ret = NULL;
}
- if ((opt & PHP_PATHINFO_BASENAME) == PHP_PATHINFO_BASENAME) {
+ if (have_basename) {
php_basename(path, path_len, NULL, 0, &ret, &ret_len TSRMLS_CC);
add_assoc_stringl(tmp, "basename", ret, ret_len, 0);
- }
+ }
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, '.');
+ p = zend_memrchr(ret, '.', ret_len);
if (p) {
idx = p - ret;
add_assoc_stringl(tmp, "extension", ret + idx + 1, ret_len - idx - 1, 1);
}
+ }
+
+ if ((opt & PHP_PATHINFO_FILENAME) == PHP_PATHINFO_FILENAME) {
+ char *p;
+ int idx;
- if (!have_basename) {
- efree(ret);
+ /* Have we alrady looked up the basename? */
+ if (!have_basename && !ret) {
+ php_basename(path, path_len, NULL, 0, &ret, &ret_len TSRMLS_CC);
}
+
+ p = zend_memrchr(ret, '.', ret_len);
+
+ idx = p ? (p - ret) : ret_len;
+ add_assoc_stringl(tmp, "filename", ret, idx, 1);
+ }
+
+ if (!have_basename && ret) {
+ efree(ret);
}
if (opt == PHP_PATHINFO_ALL) {
@@ -1428,7 +1500,7 @@ PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end)
if (*spanp == c || p == s1_end) {
return p - s1;
}
- } while (spanp++ < s2_end);
+ } while (spanp++ < (s2_end - 1));
c = *++p;
}
/* NOTREACHED */
@@ -1613,8 +1685,8 @@ PHP_FUNCTION(stripos)
RETURN_FALSE;
}
- if (haystack_len == 0) {
- RETURN_FALSE;
+ if (haystack_len == 0) {
+ RETURN_FALSE;
}
haystack_dup = estrndup(haystack, haystack_len);
@@ -1622,9 +1694,10 @@ PHP_FUNCTION(stripos)
if (Z_TYPE_P(needle) == IS_STRING) {
if (Z_STRLEN_P(needle) == 0 || Z_STRLEN_P(needle) > haystack_len) {
- efree(haystack_dup);
- RETURN_FALSE;
- }
+ efree(haystack_dup);
+ RETURN_FALSE;
+ }
+
needle_dup = estrndup(Z_STRVAL_P(needle), Z_STRLEN_P(needle));
php_strtolower(needle_dup, Z_STRLEN_P(needle));
found = php_memnstr(haystack_dup + offset, needle_dup, Z_STRLEN_P(needle), haystack_dup + haystack_len);
@@ -1668,22 +1741,22 @@ PHP_FUNCTION(stripos)
Finds position of last occurrence of a string within another string */
PHP_FUNCTION(strrpos)
{
- zval *zneedle;
+ zval **zneedle;
char *needle, *haystack;
int needle_len, haystack_len;
long offset = 0;
char *p, *e, ord_needle[2];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l", &haystack, &haystack_len, &zneedle, &offset) == FAILURE) {
+ 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);
+ if (Z_TYPE_PP(zneedle) == IS_STRING) {
+ needle = Z_STRVAL_PP(zneedle);
+ needle_len = Z_STRLEN_PP(zneedle);
} else {
- convert_to_long(zneedle);
- ord_needle[0] = (char)(Z_LVAL_P(zneedle) & 0xFF);
+ convert_to_long_ex(zneedle);
+ ord_needle[0] = (char)(Z_LVAL_PP(zneedle) & 0xFF);
ord_needle[1] = '\0';
needle = ord_needle;
needle_len = 1;
@@ -1694,13 +1767,20 @@ PHP_FUNCTION(strrpos)
}
if (offset >= 0) {
+ if (offset > haystack_len) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
+ RETURN_FALSE;
+ }
p = haystack + offset;
e = haystack + haystack_len - needle_len;
} else {
- p = haystack;
if (-offset > haystack_len) {
- e = haystack - needle_len;
- } else if (needle_len > -offset) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
+ RETURN_FALSE;
+ }
+
+ p = haystack;
+ if (needle_len > -offset) {
e = haystack + haystack_len - needle_len;
} else {
e = haystack + haystack_len + offset;
@@ -1733,23 +1813,23 @@ PHP_FUNCTION(strrpos)
Finds position of last occurrence of a string within another string */
PHP_FUNCTION(strripos)
{
- zval *zneedle;
+ 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) {
+ 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);
+ if (Z_TYPE_PP(zneedle) == IS_STRING) {
+ needle = Z_STRVAL_PP(zneedle);
+ needle_len = Z_STRLEN_PP(zneedle);
} else {
- convert_to_long(zneedle);
- ord_needle[0] = (char)(Z_LVAL_P(zneedle) & 0xFF);
+ convert_to_long_ex(zneedle);
+ ord_needle[0] = (char)(Z_LVAL_PP(zneedle) & 0xFF);
ord_needle[1] = '\0';
needle = ord_needle;
needle_len = 1;
@@ -1763,12 +1843,17 @@ PHP_FUNCTION(strripos)
/* Single character search can shortcut memcmps
Can also avoid tolower emallocs */
if (offset >= 0) {
+ if (offset > haystack_len) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
+ RETURN_FALSE;
+ }
p = haystack + offset;
e = haystack + haystack_len - 1;
} else {
p = haystack;
if (-offset > haystack_len) {
- e = haystack + haystack_len - 1;
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
+ RETURN_FALSE;
} else {
e = haystack + haystack_len + offset;
}
@@ -1790,13 +1875,19 @@ PHP_FUNCTION(strripos)
php_strtolower(haystack_dup, haystack_len);
if (offset >= 0) {
+ if (offset > haystack_len) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
+ RETURN_FALSE;
+ }
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) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string");
+ RETURN_FALSE;
+ }
+ p = haystack_dup;
+ if (needle_len > -offset) {
e = haystack_dup + haystack_len - needle_len;
} else {
e = haystack_dup + haystack_len + offset;
@@ -1833,10 +1924,10 @@ PHP_FUNCTION(strrchr)
convert_to_string_ex(haystack);
if (Z_TYPE_PP(needle) == IS_STRING) {
- found = strrchr(Z_STRVAL_PP(haystack), *Z_STRVAL_PP(needle));
+ found = zend_memrchr(Z_STRVAL_PP(haystack), *Z_STRVAL_PP(needle), Z_STRLEN_PP(haystack));
} else {
convert_to_long_ex(needle);
- found = strrchr(Z_STRVAL_PP(haystack), (char) Z_LVAL_PP(needle));
+ found = zend_memrchr(Z_STRVAL_PP(haystack), (char) Z_LVAL_PP(needle), Z_STRLEN_PP(haystack));
}
if (found) {
@@ -2405,7 +2496,7 @@ static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *
smart_str result = {0};
HashTable tmp_hash;
- zend_hash_init(&tmp_hash, 0, NULL, NULL, 0);
+ zend_hash_init(&tmp_hash, zend_hash_num_elements(hash), 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)) {
@@ -2497,7 +2588,7 @@ static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *
}
/* }}} */
-/* {{{ proto string strtr(string str, string from, string to)
+/* {{{ proto string strtr(string str, string from[, string to])
Translates characters in str using given translation tables */
PHP_FUNCTION(strtr)
{
@@ -3031,10 +3122,18 @@ PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int to_l
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))) {
+
+ if (case_sensitivity) {
+ char *p = str, *e = p + len;
+ while ((p = memchr(p, from, (e - p)))) {
char_count++;
+ p++;
+ }
+ } else {
+ for (source = str; source < source_end; source++) {
+ if (tolower(*source) == tolower(from)) {
+ char_count++;
+ }
}
}
@@ -3046,20 +3145,39 @@ PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int to_l
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 (case_sensitivity) {
+ char *p = str, *e = p + len, *s = str;
+ while ((p = memchr(p, from, (e - p)))) {
+ memcpy(target, s, (p - s));
+ target += p - s;
+ memcpy(target, to, to_len);
+ target += to_len;
+ p++;
+ s = p;
if (replace_count) {
*replace_count += 1;
}
- for (tmp = to, tmp_end = tmp+to_len; tmp < tmp_end; tmp++) {
- *target = *tmp;
+ }
+ if (s < e) {
+ memcpy(target, s, (e - s));
+ target += e - s;
+ }
+ } else {
+ for (source = str; source < source_end; source++) {
+ if (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++;
}
- } else {
- *target = *source;
- target++;
}
}
*target = 0;
@@ -4730,7 +4848,26 @@ PHP_FUNCTION(str_word_count)
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;
+ return;
+ }
+
+ switch(type) {
+ case 1:
+ case 2:
+ array_init(return_value);
+ if (!str_len) {
+ return;
+ }
+ break;
+ case 0:
+ if (!str_len) {
+ RETURN_LONG(0);
+ }
+ /* nothing to be done */
+ break;
+ default:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid format value %ld", type);
+ RETURN_FALSE;
}
if (char_list) {
@@ -4739,10 +4876,6 @@ PHP_FUNCTION(str_word_count)
p = str;
e = str + str_len;
-
- if (type == 1 || type == 2) {
- array_init(return_value);
- }
/* first character cannot be ' or -, unless explicitly allowed by the user */
if ((*p == '\'' && (!char_list || !ch['\''])) || (*p == '-' && (!char_list || !ch['-']))) {
diff --git a/ext/standard/tests/array/007.phpt b/ext/standard/tests/array/007.phpt
index 0e5c32af2..45cc9b6c2 100644
--- a/ext/standard/tests/array/007.phpt
+++ b/ext/standard/tests/array/007.phpt
@@ -61,6 +61,10 @@ class cr {
if ($a->priv_member === $b->priv_member) return 0;
return ($a->priv_member > $b->priv_member)? 1:-1;
}
+
+ function __toString() {
+ return "Object";
+ }
}
function comp_func($a, $b) {
@@ -309,21 +313,21 @@ $b=array (
var_dump(array_udiff_uassoc($a, $b, "comp_func_cr", "comp_func"));
array(3) {
["0.1"]=>
- object(cr)#1 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(9)
["public_member"]=>
int(9)
}
["0.5"]=>
- object(cr)#2 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
- object(cr)#3 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(23)
["public_member"]=>
@@ -387,21 +391,21 @@ $b=array (
var_dump(array_udiff_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func"));
array(3) {
["0.1"]=>
- object(cr)#1 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(9)
["public_member"]=>
int(9)
}
["0.5"]=>
- object(cr)#2 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
- object(cr)#3 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(23)
["public_member"]=>
@@ -463,42 +467,14 @@ $b=array (
)),
);
var_dump(array_diff_assoc($a, $b));
-array(5) {
+array(1) {
["0.1"]=>
- object(cr)#1 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(9)
["public_member"]=>
int(9)
}
- ["0.5"]=>
- object(cr)#2 (2) {
- ["priv_member:private"]=>
- int(12)
- ["public_member"]=>
- int(12)
- }
- [0]=>
- object(cr)#3 (2) {
- ["priv_member:private"]=>
- int(23)
- ["public_member"]=>
- int(23)
- }
- [1]=>
- object(cr)#4 (2) {
- ["priv_member:private"]=>
- int(4)
- ["public_member"]=>
- int(4)
- }
- [2]=>
- object(cr)#5 (2) {
- ["priv_member:private"]=>
- int(-15)
- ["public_member"]=>
- int(-15)
- }
}
$a=array (
'0.1' =>
@@ -557,14 +533,14 @@ $b=array (
var_dump(array_udiff($a, $b, "comp_func_cr"));
array(2) {
["0.5"]=>
- object(cr)#2 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
- object(cr)#3 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(23)
["public_member"]=>
@@ -628,21 +604,21 @@ $b=array (
var_dump(array_udiff_assoc($a, $b, "comp_func_cr"));
array(3) {
["0.1"]=>
- object(cr)#1 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(9)
["public_member"]=>
int(9)
}
["0.5"]=>
- object(cr)#2 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
- object(cr)#3 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(23)
["public_member"]=>
diff --git a/ext/standard/tests/array/array_fill.phpt b/ext/standard/tests/array/array_fill.phpt
new file mode 100644
index 000000000..8220ef4ce
--- /dev/null
+++ b/ext/standard/tests/array/array_fill.phpt
@@ -0,0 +1,366 @@
+--TEST--
+basic array_fill test
+--FILE--
+<?php
+$array1 = array(0.0, 1, 2.5);
+$array2 = array(TRUE, FALSE, NULL, "d", "e", "f");
+foreach($array1 as $start)
+{
+ foreach($array1 as $num)
+ {
+ foreach($array2 as $value)
+ {
+ echo '==========================='."\n";
+ echo 'start: '.$start.' num: '.$num.' value: '.$value."\n";
+ $output = array_fill($start, $num, $value);
+ var_dump($output);
+ }
+ }
+}
+echo '== Done ==';
+?>
+===============Done====================
+--EXPECTF--
+===========================
+start: 0 num: 0 value: 1
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 0 num: 0 value:
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 0 num: 0 value:
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 0 num: 0 value: d
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 0 num: 0 value: e
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 0 num: 0 value: f
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 0 num: 1 value: 1
+array(1) {
+ [0]=>
+ bool(true)
+}
+===========================
+start: 0 num: 1 value:
+array(1) {
+ [0]=>
+ bool(false)
+}
+===========================
+start: 0 num: 1 value:
+array(1) {
+ [0]=>
+ NULL
+}
+===========================
+start: 0 num: 1 value: d
+array(1) {
+ [0]=>
+ string(1) "d"
+}
+===========================
+start: 0 num: 1 value: e
+array(1) {
+ [0]=>
+ string(1) "e"
+}
+===========================
+start: 0 num: 1 value: f
+array(1) {
+ [0]=>
+ string(1) "f"
+}
+===========================
+start: 0 num: 2.5 value: 1
+array(2) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(true)
+}
+===========================
+start: 0 num: 2.5 value:
+array(2) {
+ [0]=>
+ bool(false)
+ [1]=>
+ bool(false)
+}
+===========================
+start: 0 num: 2.5 value:
+array(2) {
+ [0]=>
+ NULL
+ [1]=>
+ NULL
+}
+===========================
+start: 0 num: 2.5 value: d
+array(2) {
+ [0]=>
+ string(1) "d"
+ [1]=>
+ string(1) "d"
+}
+===========================
+start: 0 num: 2.5 value: e
+array(2) {
+ [0]=>
+ string(1) "e"
+ [1]=>
+ string(1) "e"
+}
+===========================
+start: 0 num: 2.5 value: f
+array(2) {
+ [0]=>
+ string(1) "f"
+ [1]=>
+ string(1) "f"
+}
+===========================
+start: 1 num: 0 value: 1
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 1 num: 0 value:
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 1 num: 0 value:
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 1 num: 0 value: d
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 1 num: 0 value: e
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 1 num: 0 value: f
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 1 num: 1 value: 1
+array(1) {
+ [1]=>
+ bool(true)
+}
+===========================
+start: 1 num: 1 value:
+array(1) {
+ [1]=>
+ bool(false)
+}
+===========================
+start: 1 num: 1 value:
+array(1) {
+ [1]=>
+ NULL
+}
+===========================
+start: 1 num: 1 value: d
+array(1) {
+ [1]=>
+ string(1) "d"
+}
+===========================
+start: 1 num: 1 value: e
+array(1) {
+ [1]=>
+ string(1) "e"
+}
+===========================
+start: 1 num: 1 value: f
+array(1) {
+ [1]=>
+ string(1) "f"
+}
+===========================
+start: 1 num: 2.5 value: 1
+array(2) {
+ [1]=>
+ bool(true)
+ [2]=>
+ bool(true)
+}
+===========================
+start: 1 num: 2.5 value:
+array(2) {
+ [1]=>
+ bool(false)
+ [2]=>
+ bool(false)
+}
+===========================
+start: 1 num: 2.5 value:
+array(2) {
+ [1]=>
+ NULL
+ [2]=>
+ NULL
+}
+===========================
+start: 1 num: 2.5 value: d
+array(2) {
+ [1]=>
+ string(1) "d"
+ [2]=>
+ string(1) "d"
+}
+===========================
+start: 1 num: 2.5 value: e
+array(2) {
+ [1]=>
+ string(1) "e"
+ [2]=>
+ string(1) "e"
+}
+===========================
+start: 1 num: 2.5 value: f
+array(2) {
+ [1]=>
+ string(1) "f"
+ [2]=>
+ string(1) "f"
+}
+===========================
+start: 2.5 num: 0 value: 1
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 2.5 num: 0 value:
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 2.5 num: 0 value:
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 2.5 num: 0 value: d
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 2.5 num: 0 value: e
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 2.5 num: 0 value: f
+
+Warning: array_fill(): Number of elements must be positive in %s on line %d
+bool(false)
+===========================
+start: 2.5 num: 1 value: 1
+array(1) {
+ [2]=>
+ bool(true)
+}
+===========================
+start: 2.5 num: 1 value:
+array(1) {
+ [2]=>
+ bool(false)
+}
+===========================
+start: 2.5 num: 1 value:
+array(1) {
+ [2]=>
+ NULL
+}
+===========================
+start: 2.5 num: 1 value: d
+array(1) {
+ [2]=>
+ string(1) "d"
+}
+===========================
+start: 2.5 num: 1 value: e
+array(1) {
+ [2]=>
+ string(1) "e"
+}
+===========================
+start: 2.5 num: 1 value: f
+array(1) {
+ [2]=>
+ string(1) "f"
+}
+===========================
+start: 2.5 num: 2.5 value: 1
+array(2) {
+ [2]=>
+ bool(true)
+ [3]=>
+ bool(true)
+}
+===========================
+start: 2.5 num: 2.5 value:
+array(2) {
+ [2]=>
+ bool(false)
+ [3]=>
+ bool(false)
+}
+===========================
+start: 2.5 num: 2.5 value:
+array(2) {
+ [2]=>
+ NULL
+ [3]=>
+ NULL
+}
+===========================
+start: 2.5 num: 2.5 value: d
+array(2) {
+ [2]=>
+ string(1) "d"
+ [3]=>
+ string(1) "d"
+}
+===========================
+start: 2.5 num: 2.5 value: e
+array(2) {
+ [2]=>
+ string(1) "e"
+ [3]=>
+ string(1) "e"
+}
+===========================
+start: 2.5 num: 2.5 value: f
+array(2) {
+ [2]=>
+ string(1) "f"
+ [3]=>
+ string(1) "f"
+}
+== Done =================Done====================
diff --git a/ext/standard/tests/array/array_fill_keys.phpt b/ext/standard/tests/array/array_fill_keys.phpt
new file mode 100755
index 000000000..65c38234c
--- /dev/null
+++ b/ext/standard/tests/array/array_fill_keys.phpt
@@ -0,0 +1,42 @@
+--TEST--
+basic array_fill_keys test
+--FILE--
+<?php
+ var_dump(array_fill_keys('test', 1));
+ var_dump(array_fill_keys(array(), 1));
+ var_dump(array_fill_keys(array('foo', 'bar'), NULL));
+ var_dump(array_fill_keys(array('5', 'foo', 10, 1.23), 123));
+ var_dump(array_fill_keys(array('test', TRUE, 10, 100), ''));
+?>
+--EXPECTF--
+
+Warning: array_fill_keys() expects parameter 1 to be array, string given in %s on line %d
+NULL
+array(0) {
+}
+array(2) {
+ ["foo"]=>
+ NULL
+ ["bar"]=>
+ NULL
+}
+array(4) {
+ [5]=>
+ int(123)
+ ["foo"]=>
+ int(123)
+ [10]=>
+ int(123)
+ ["1.23"]=>
+ int(123)
+}
+array(4) {
+ ["test"]=>
+ string(0) ""
+ [1]=>
+ string(0) ""
+ [10]=>
+ string(0) ""
+ [100]=>
+ string(0) ""
+}
diff --git a/ext/standard/tests/array/array_filter.phpt b/ext/standard/tests/array/array_filter.phpt
new file mode 100644
index 000000000..c470c26c9
--- /dev/null
+++ b/ext/standard/tests/array/array_filter.phpt
@@ -0,0 +1,93 @@
+--TEST--
+basic array_filter test
+--FILE--
+<?php
+function odd($var)
+{
+ return($var & 1);
+}
+
+function even($var)
+{
+ return(!($var & 1));
+}
+
+$array1 = array("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5);
+$array2 = array(6, 7, 8, 9, 10, 11, 12, 0);
+$array3 = array(TRUE, FALSE, NULL);
+
+echo "Odd :\n";
+var_dump(array_filter($array1, "odd"));
+var_dump(array_filter($array2, "odd"));
+var_dump(array_filter($array3, "odd"));
+echo "Even:\n";
+var_dump(array_filter($array1, "even"));
+var_dump(array_filter($array2, "even"));
+var_dump(array_filter($array3, "even"));
+
+var_dump(array_filter(array()));
+var_dump(array_filter(array(), array()));
+var_dump(array_filter("", null));
+var_dump(array_filter($array1, 1));
+
+echo '== DONE ==';
+?>
+--EXPECTF--
+Odd :
+array(3) {
+ ["a"]=>
+ int(1)
+ ["c"]=>
+ int(3)
+ ["e"]=>
+ int(5)
+}
+array(3) {
+ [1]=>
+ int(7)
+ [3]=>
+ int(9)
+ [5]=>
+ int(11)
+}
+array(1) {
+ [0]=>
+ bool(true)
+}
+Even:
+array(2) {
+ ["b"]=>
+ int(2)
+ ["d"]=>
+ int(4)
+}
+array(5) {
+ [0]=>
+ int(6)
+ [2]=>
+ int(8)
+ [4]=>
+ int(10)
+ [6]=>
+ int(12)
+ [7]=>
+ int(0)
+}
+array(2) {
+ [1]=>
+ bool(false)
+ [2]=>
+ NULL
+}
+array(0) {
+}
+
+Warning: array_filter(): The second argument, 'Array', should be a valid callback in %s on line %d
+NULL
+
+Warning: array_filter(): The first argument should be an array in %s on line %d
+NULL
+
+Warning: array_filter(): The second argument, '1', should be a valid callback in %s on line %d
+NULL
+== DONE ==
diff --git a/ext/standard/tests/array/array_flip.phpt b/ext/standard/tests/array/array_flip.phpt
new file mode 100644
index 000000000..27b14fdd9
--- /dev/null
+++ b/ext/standard/tests/array/array_flip.phpt
@@ -0,0 +1,37 @@
+--TEST--
+basic array_flip test
+--FILE--
+<?php
+$trans = array("a" => 1,
+ "b" => 1,
+ "c" => 2,
+ "z" => 0,
+ "d" => TRUE,
+ "E" => FALSE,
+ "F" => NULL,
+ 0 => "G",
+ 1 => "h",
+ 2 => "i");
+$trans = array_flip($trans);
+var_dump($trans);
+?>
+--EXPECTF--
+Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
+
+Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
+
+Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
+array(6) {
+ [1]=>
+ string(1) "b"
+ [2]=>
+ string(1) "c"
+ [0]=>
+ string(1) "z"
+ ["G"]=>
+ int(0)
+ ["h"]=>
+ int(1)
+ ["i"]=>
+ int(2)
+}
diff --git a/ext/standard/tests/array/array_intersect_1.phpt b/ext/standard/tests/array/array_intersect_1.phpt
index 74c4828c2..39df5cd1b 100644
--- a/ext/standard/tests/array/array_intersect_1.phpt
+++ b/ext/standard/tests/array/array_intersect_1.phpt
@@ -2,7 +2,7 @@
Test of the *intersect* bunch of functions (both assoc and non-assoc)
--FILE--
<?php
-error_reporting(E_ALL);
+error_reporting(E_ALL|E_STRICT);
class cr {
private $priv_member;
public $public_member;
@@ -14,6 +14,10 @@ class cr {
if ($a->priv_member === $b->priv_member) return 0;
return ($a->priv_member > $b->priv_member)? 1:-1;
}
+
+ function __toString() {
+ return "Object";
+ }
}
function comp_func($a, $b) {
@@ -35,7 +39,7 @@ 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));
+var_dump(array_intersect($a, $b));
echo "end ------------ array_intersect() ----------------------------\n";
/* array_uintersect() */
@@ -51,7 +55,7 @@ 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));
+var_dump(array_intersect_assoc($a, $b));
echo "end ------------ array_intersect_assoc() ----------------------\n";
/* array_uintersect_assoc() */
@@ -67,7 +71,7 @@ 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"));
+var_dump(array_intersect_uassoc($a, $b, "comp_func"));
echo "end ------------ array_intersect_uassoc() ---------------------\n";
/* array_uintersect_uassoc() - with ordinary function */
@@ -143,7 +147,42 @@ $b=array (
)),
);
var_dump(array_intersect($a, $b);
-array(0) {
+array(5) {
+ ["0.1"]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(9)
+ ["public_member"]=>
+ int(9)
+ }
+ ["0.5"]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(12)
+ ["public_member"]=>
+ int(12)
+ }
+ [0]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(23)
+ ["public_member"]=>
+ int(23)
+ }
+ [1]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(4)
+ ["public_member"]=>
+ int(4)
+ }
+ [2]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(-15)
+ ["public_member"]=>
+ int(-15)
+ }
}
end ------------ array_intersect() ----------------------------
begin ------------ array_uintersect() ---------------------------
@@ -204,21 +243,21 @@ $b=array (
var_dump(array_uintersect($a, $b, "comp_func_cr"));
array(3) {
["0.1"]=>
- object(cr)#1 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(9)
["public_member"]=>
int(9)
}
[1]=>
- object(cr)#4 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
- object(cr)#5 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(-15)
["public_member"]=>
@@ -282,7 +321,35 @@ $b=array (
)),
);
var_dump(array_intersect_assoc($a, $b));
-array(0) {
+array(4) {
+ ["0.5"]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(12)
+ ["public_member"]=>
+ int(12)
+ }
+ [0]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(23)
+ ["public_member"]=>
+ int(23)
+ }
+ [1]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(4)
+ ["public_member"]=>
+ int(4)
+ }
+ [2]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(-15)
+ ["public_member"]=>
+ int(-15)
+ }
}
end ------------ array_intersect_assoc() ----------------------
begin ------------ array_uintersect_assoc() ---------------------
@@ -343,14 +410,14 @@ $b=array (
var_dump(array_uintersect_assoc($a, $b, "comp_func_cr"));
array(2) {
[1]=>
- object(cr)#4 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
- object(cr)#5 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(-15)
["public_member"]=>
@@ -414,7 +481,35 @@ $b=array (
)),
);
var_dump(array_intersect_uassoc($a, $b, "comp_func"));
-array(0) {
+array(4) {
+ ["0.5"]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(12)
+ ["public_member"]=>
+ int(12)
+ }
+ [0]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(23)
+ ["public_member"]=>
+ int(23)
+ }
+ [1]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(4)
+ ["public_member"]=>
+ int(4)
+ }
+ [2]=>
+ object(cr)#%d (2) {
+ ["priv_member:private"]=>
+ int(-15)
+ ["public_member"]=>
+ int(-15)
+ }
}
end ------------ array_intersect_uassoc() ---------------------
begin ------------ array_uintersect_uassoc() with ordinary func -
@@ -475,14 +570,14 @@ $b=array (
var_dump(array_uintersect_uassoc($a, $b, "comp_func_cr", "comp_func"));
array(2) {
[1]=>
- object(cr)#4 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
- object(cr)#5 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(-15)
["public_member"]=>
@@ -548,14 +643,14 @@ $b=array (
var_dump(array_uintersect_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func"));
array(2) {
[1]=>
- object(cr)#4 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
- object(cr)#5 (2) {
+ object(cr)#%d (2) {
["priv_member:private"]=>
int(-15)
["public_member"]=>
diff --git a/ext/standard/tests/array/array_search1.phpt b/ext/standard/tests/array/array_search1.phpt
new file mode 100644
index 000000000..961c771eb
--- /dev/null
+++ b/ext/standard/tests/array/array_search1.phpt
@@ -0,0 +1,35 @@
+--TEST--
+array_search() tests
+--FILE--
+<?php
+
+$a = array(1=>0, 2=>1, 4=>3, "a"=>"b", "c"=>"d");
+
+var_dump(array_search(1));
+var_dump(array_search(1,1));
+var_dump(array_search("a",$a));
+var_dump(array_search("0",$a, true));
+var_dump(array_search("0",$a));
+var_dump(array_search(0,$a));
+var_dump(array_search(1,$a));
+var_dump(array_search("d",$a, true));
+var_dump(array_search("d",$a));
+var_dump(array_search(-1,$a, true));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for array_search() in %s on line %d
+NULL
+
+Warning: array_search(): Wrong datatype for second argument in %s on line %d
+bool(false)
+int(1)
+bool(false)
+int(1)
+int(1)
+int(2)
+string(1) "c"
+int(1)
+bool(false)
+Done
diff --git a/ext/standard/tests/array/array_walk.phpt b/ext/standard/tests/array/array_walk.phpt
new file mode 100644
index 000000000..a0e209831
--- /dev/null
+++ b/ext/standard/tests/array/array_walk.phpt
@@ -0,0 +1,48 @@
+--TEST--
+array_walk() tests
+--FILE--
+<?php
+
+var_dump(array_walk());
+$var = 1;
+var_dump(array_walk($var,1));
+$var = array();
+var_dump(array_walk($var,""));
+
+function foo($v1, $v2, $v3) {
+ var_dump($v1);
+ var_dump($v2);
+ var_dump($v3);
+}
+
+$var = array(1,2);
+var_dump(array_walk($var, "foo", "data"));
+
+function foo2($v1, $v2, $v3) {
+ throw new Exception($v3);
+}
+
+try {
+ var_dump(array_walk($var,"foo2", "data"));
+} catch (Exception $e) {
+ var_dump($e->getMessage());
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: array_walk() expects at least 2 parameters, 0 given in %s on line %d
+NULL
+
+Warning: array_walk(): The argument should be an array in %s on line %d
+bool(false)
+bool(true)
+int(1)
+int(0)
+string(4) "data"
+int(2)
+int(1)
+string(4) "data"
+bool(true)
+string(4) "data"
+Done
diff --git a/ext/standard/tests/array/array_walk_objects.phpt b/ext/standard/tests/array/array_walk_objects.phpt
new file mode 100644
index 000000000..0e838ef25
--- /dev/null
+++ b/ext/standard/tests/array/array_walk_objects.phpt
Binary files differ
diff --git a/ext/standard/tests/array/array_walk_rec_objects.phpt b/ext/standard/tests/array/array_walk_rec_objects.phpt
new file mode 100644
index 000000000..e1c5dd610
--- /dev/null
+++ b/ext/standard/tests/array/array_walk_rec_objects.phpt
Binary files differ
diff --git a/ext/standard/tests/array/array_walk_recursive1.phpt b/ext/standard/tests/array/array_walk_recursive1.phpt
new file mode 100644
index 000000000..8505b70e9
--- /dev/null
+++ b/ext/standard/tests/array/array_walk_recursive1.phpt
@@ -0,0 +1,54 @@
+--TEST--
+array_walk_recursive() tests
+--FILE--
+<?php
+
+var_dump(array_walk_recursive());
+$var = 1;
+var_dump(array_walk_recursive($var,1));
+$var = array();
+var_dump(array_walk_recursive($var,""));
+
+function foo($v1, $v2, $v3) {
+ var_dump($v1);
+ var_dump($v2);
+ var_dump($v3);
+}
+
+$var = array(1,2, array(2,3));
+var_dump(array_walk_recursive($var, "foo", "data"));
+
+function foo2($v1, $v2, $v3) {
+ throw new Exception($v3);
+}
+
+try {
+ var_dump(array_walk_recursive($var,"foo2", "data"));
+} catch (Exception $e) {
+ var_dump($e->getMessage());
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: array_walk_recursive() expects at least 2 parameters, 0 given in %s on line %d
+NULL
+
+Warning: array_walk_recursive(): The argument should be an array in %s on line %d
+bool(false)
+bool(true)
+int(1)
+int(0)
+string(4) "data"
+int(2)
+int(1)
+string(4) "data"
+int(2)
+int(0)
+string(4) "data"
+int(3)
+int(1)
+string(4) "data"
+bool(true)
+string(4) "data"
+Done
diff --git a/ext/standard/tests/array/bug30833.phpt b/ext/standard/tests/array/bug30833.phpt
index ecf5f1f52..728a659d8 100644
--- a/ext/standard/tests/array/bug30833.phpt
+++ b/ext/standard/tests/array/bug30833.phpt
@@ -1,5 +1,5 @@
--TEST--
-bug #30833 (array_count_values() modifying input array)
+Bug #30833 (array_count_values() modifies input array)
--FILE--
<?php
diff --git a/ext/standard/tests/array/bug34066.phpt b/ext/standard/tests/array/bug34066.phpt
new file mode 100644
index 000000000..31f6b4c1d
--- /dev/null
+++ b/ext/standard/tests/array/bug34066.phpt
@@ -0,0 +1,804 @@
+--TEST--
+Bug #34066 (recursive array_walk causes segfault)
+--FILE--
+<?php
+
+ $order = array(
+ "DocID" => "1",
+ "DocDate" => "19.09.06",
+ "ReSubmissionDate" => "",
+ "DocTyp" => "Stapelauftrag",
+ "CustID" => "00000",
+ "CustomerAddress" => array(
+ array(
+ "Name1" => 'name1',
+ "Name2" => 'name2',
+ "Name3" => "",
+ "City" => 'city',
+ "Street" => 'street',
+ "Postal" => 'postcode',
+ "IATA" => "90",
+ "Country" => "Deutschland",
+ "ShortName" => 'short',
+ "ContactKey" => "",
+ "EMail" => 'email@example.com',
+ )
+ ),
+ "Text1" => "",
+ "Text2" => "",
+ "Wildcard1" => "",
+ "Wildcard2" => "",
+ "Dispatch" => "Paketdienst",
+ "Weight" => "0,0",
+ "BillingCustID" => "4300200000",
+ "ExtDocNr" => "00000000003",
+ "AnalysisLock" => "",
+ "PrintFlag" => "",
+ "FormType" => "0",
+ "Curr" => "EUR",
+ "ExChangeRate" => "1,0000",
+ "WIRRate" => "0",
+ "OneTimeCustomer" => array(
+ array(
+ "BankCode" => "",
+ "BankAccount" => ""
+ )
+ ),
+ "Language" => "0",
+ "PriceGroup" => "1",
+ "PrFlag" => "0",
+ "SalesTaxKey" => "1",
+ "ProceedKey" => "0",
+ "CustDiscountGroup" => "0",
+ "Discount" => array(
+ array(
+ "FinDisc1" => "0,00",
+ "Disc1Base" => "145,72",
+ "Disc1Value" => "0,00",
+ "FinDisc2" => "0,00",
+ "Disc2Base" => "145,72",
+ "Disc2Value" => "0,00",
+ "FinDisc3" => "0,00",
+ "Disc3Base" => "145,72",
+ "Disc3Value" => "0,00",
+ "ValueSummary" => "0,00"
+ )
+ ),
+ "Contact" => array(
+ array(
+ "Repr" => "999",
+ "Region" => "99",
+ "Commission" => "0,00",
+ "Agent" => "000000"
+ )
+ ),
+ "Booking" => array(
+ array(
+ "CostUnit" => "0000000000",
+ "CostCentre" => "0000000000",
+ "AccountingArea"=> "01"
+ )
+ ),
+ "InvoiceCycleKey" => "0",
+ "AnalysisKey" => "",
+ "OrderNumber" => "",
+ "OrderDate" => "",
+ "OrderCode" => "",
+ "DocItems" => array(
+ "DocItem" => array(
+ "PosType" => "1",
+ "ItemRef" => "1002",
+ "CRef" => "",
+ "Desc1" => "Pr�sentation Niederlande per",
+ "Desc2" => "",
+ "ArticleGroup" => "102",
+ "PosTypeVersion" => "E",
+ "Delivery" => array(
+ array(
+ "DelWeek" => "",
+ "DelDay" => "",
+ "DelTime" => ""
+ )
+ ),
+ "PricePu" => "145,72",
+ "PriceUnit" => "0",
+ "PriceCalculation" => "0",
+ "ItemVal" => "145,72",
+ "InputKey" => "0",
+ "AveragePurchasePrice" => "0",
+ "Tax" => array(
+ array(
+ "TaxCode" => "00",
+ "TaxBra" => "000",
+ "TaxBraAccess" => "0",
+ "TaxSumIndex" => "0"
+ )
+ ),
+ "DiscountArticle" => array(
+ array(
+ "DiscPC" => "0,00",
+ "DiscKey" => "1"
+ )
+ ),
+ "ProceedKeyArticle" => "01",
+ "ActionKey" => "00",
+ "ContactCommissionArticle"=> "0,00",
+ "QuantDependantPriceKey"=> "",
+ "Quant" => "1",
+ "QuantUnit" => "",
+ "Meas" => array(
+ array(
+ "Count" => "1",
+ "Length" => "0,000",
+ "Width" => "0,000",
+ "Height" => "0,000"
+ )
+ ),
+ "DecimalPlace" => "0",
+ "MultiplierQuant" => "1,000000",
+ "DifferingQuantUnit" => "",
+ "DecimalPlaceConversion"=> "0",
+ "WeightArticle" => array(
+ array(
+ "Amount" => "0",
+ "Unit" => "0"
+ )
+ ),
+ "Wreath" => "0,000",
+ "Stock" => "1",
+ "CostUnitArticle" => "",
+ "SerialNbKey" => "0",
+ "TextComplementKey" => "0",
+ "PartsListPrintKey" => "",
+ "Prod" => "0000000000"
+ )
+ ),
+ "Payment" => array(
+ "PaymentKey" => "0",
+ "ReminderKey" => "00",
+ "PayTerms" => array(
+ array(
+ "PayTerm" => "1",
+ "PayDays" => "000",
+ "CashDiscDays1" => "000",
+ "CashDiscDays2" => "000",
+ "CashDiscPer1" => "0,00",
+ "CashDiscPer2" => "0,00"
+ ),
+ array(
+ "PayTerm" => "2",
+ "PayDays" => "000",
+ "CashDiscDays1" => "000",
+ "CashDiscDays2" => "000",
+ "CashDiscPer1" => "0,00",
+ "CashDiscPer2" => "0,00"
+ )
+ )
+ ),
+ "NetAmountByTurnOverTax" => array(
+ array(
+ "TurnOverTaxFree" => "145,72",
+ "TurnOverTax1" => "0,00",
+ "TurnOverTax2" => "0,00",
+ "TurnOverTax3" => "0,00",
+ "TurnOverTax4" => "0,00",
+ "TurnOverTax5" => "0,00",
+ "TurnOverTax6" => "0,00",
+ "TurnOverTax7" => "0,00",
+ "TurnOverTax8" => "0,00"
+ ),
+ ),
+ "GrossAmount" => "145,72",
+ "ProceedAmount" => "145,72",
+ "NetAmountByPayTerm2" => array(
+ array(
+ "Sum0" => "0,00",
+ "Sum1" => "0,00",
+ "Sum2" => "0,00",
+ "Sum3" => "0,00",
+ "Sum4" => "0,00",
+ "Sum5" => "0,00",
+ "Sum6" => "0,00",
+ "Sum7" => "0,00",
+ "Sum8" => "0,00"
+ ),
+ ),
+ "TaxCodes" => array(
+ array(
+ "TaxCode1" => "0",
+ "TaxCode2" => "0",
+ "TaxCode3" => "0",
+ "TaxCode4" => "0",
+ "TaxCode5" => "0",
+ "TaxCode6" => "0",
+ "TaxCode7" => "0",
+ "TaxCode8" => "0"
+ )
+ )
+ );
+ $docs = array(
+ array(
+ "Version" => "1.0",
+ "ProducerName" => "xxxxxxxx",
+ "ProductName" => "Classic Line",
+ "xmlns" => "x-schema:CL310_DezABFSchema.XML"
+ ),
+ "Company" => array(
+ array(
+ "MandateNumber" => "111",
+ "MandateName" => "xxx xxxxxxx-xxxxx xxxxxxx",
+ "MandateCurr" => "EUR"
+ ),
+ ),
+ "Doc" => $order
+ );
+
+ dump2xml($docs);
+
+
+function dump2xml($array) {
+ // output of this goes through 2xml
+ array_walk($array, "gen_xml", "/Docs/");
+}
+function gen_xml($val, $key, $prefix)
+{
+ global $xml_fd;
+ print "gen_xml(prefix=$prefix)\n";
+ if (is_array($val)) {
+ if (preg_match('/^\d+$/', $key)) {
+ if ($key == 1) {
+ print substr($prefix, 0, -1) . "\n";
+ }
+ array_walk($val, "gen_xml", "$prefix@");
+ }
+ else {
+ array_walk($val, "gen_xml", "$prefix$key/");
+ }
+ }
+ else {
+ if (strlen($val) > 0)
+ print "$prefix$key=$val\n";
+ else
+ print "$prefix$key\n";
+ }
+ print "gen_xml(prefix=$prefix) end\n";
+}
+echo "Done\n";
+?>
+--EXPECTF--
+gen_xml(prefix=/Docs/)
+gen_xml(prefix=/Docs/@)
+/Docs/@Version=1.0
+gen_xml(prefix=/Docs/@) end
+gen_xml(prefix=/Docs/@)
+/Docs/@ProducerName=xxxxxxxx
+gen_xml(prefix=/Docs/@) end
+gen_xml(prefix=/Docs/@)
+/Docs/@ProductName=Classic Line
+gen_xml(prefix=/Docs/@) end
+gen_xml(prefix=/Docs/@)
+/Docs/@xmlns=x-schema:CL310_DezABFSchema.XML
+gen_xml(prefix=/Docs/@) end
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+gen_xml(prefix=/Docs/Company/)
+gen_xml(prefix=/Docs/Company/@)
+/Docs/Company/@MandateNumber=111
+gen_xml(prefix=/Docs/Company/@) end
+gen_xml(prefix=/Docs/Company/@)
+/Docs/Company/@MandateName=xxx xxxxxxx-xxxxx xxxxxxx
+gen_xml(prefix=/Docs/Company/@) end
+gen_xml(prefix=/Docs/Company/@)
+/Docs/Company/@MandateCurr=EUR
+gen_xml(prefix=/Docs/Company/@) end
+gen_xml(prefix=/Docs/Company/) end
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/DocID=1
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/DocDate=19.09.06
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/ReSubmissionDate
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/DocTyp=Stapelauftrag
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/CustID=00000
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/CustomerAddress/)
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@Name1=name1
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@Name2=name2
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@Name3
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@City=city
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@Street=street
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@Postal=postcode
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@IATA=90
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@Country=Deutschland
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@ShortName=short
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@ContactKey
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@)
+/Docs/Doc/CustomerAddress/@EMail=email@example.com
+gen_xml(prefix=/Docs/Doc/CustomerAddress/@) end
+gen_xml(prefix=/Docs/Doc/CustomerAddress/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Text1
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Text2
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Wildcard1
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Wildcard2
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Dispatch=Paketdienst
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Weight=0,0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/BillingCustID=4300200000
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/ExtDocNr=00000000003
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/AnalysisLock
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/PrintFlag
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/FormType=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Curr=EUR
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/ExChangeRate=1,0000
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/WIRRate=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/OneTimeCustomer/)
+gen_xml(prefix=/Docs/Doc/OneTimeCustomer/@)
+/Docs/Doc/OneTimeCustomer/@BankCode
+gen_xml(prefix=/Docs/Doc/OneTimeCustomer/@) end
+gen_xml(prefix=/Docs/Doc/OneTimeCustomer/@)
+/Docs/Doc/OneTimeCustomer/@BankAccount
+gen_xml(prefix=/Docs/Doc/OneTimeCustomer/@) end
+gen_xml(prefix=/Docs/Doc/OneTimeCustomer/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/Language=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/PriceGroup=1
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/PrFlag=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/SalesTaxKey=1
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/ProceedKey=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/CustDiscountGroup=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/Discount/)
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@FinDisc1=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@Disc1Base=145,72
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@Disc1Value=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@FinDisc2=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@Disc2Base=145,72
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@Disc2Value=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@FinDisc3=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@Disc3Base=145,72
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@Disc3Value=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/@)
+/Docs/Doc/Discount/@ValueSummary=0,00
+gen_xml(prefix=/Docs/Doc/Discount/@) end
+gen_xml(prefix=/Docs/Doc/Discount/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/Contact/)
+gen_xml(prefix=/Docs/Doc/Contact/@)
+/Docs/Doc/Contact/@Repr=999
+gen_xml(prefix=/Docs/Doc/Contact/@) end
+gen_xml(prefix=/Docs/Doc/Contact/@)
+/Docs/Doc/Contact/@Region=99
+gen_xml(prefix=/Docs/Doc/Contact/@) end
+gen_xml(prefix=/Docs/Doc/Contact/@)
+/Docs/Doc/Contact/@Commission=0,00
+gen_xml(prefix=/Docs/Doc/Contact/@) end
+gen_xml(prefix=/Docs/Doc/Contact/@)
+/Docs/Doc/Contact/@Agent=000000
+gen_xml(prefix=/Docs/Doc/Contact/@) end
+gen_xml(prefix=/Docs/Doc/Contact/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/Booking/)
+gen_xml(prefix=/Docs/Doc/Booking/@)
+/Docs/Doc/Booking/@CostUnit=0000000000
+gen_xml(prefix=/Docs/Doc/Booking/@) end
+gen_xml(prefix=/Docs/Doc/Booking/@)
+/Docs/Doc/Booking/@CostCentre=0000000000
+gen_xml(prefix=/Docs/Doc/Booking/@) end
+gen_xml(prefix=/Docs/Doc/Booking/@)
+/Docs/Doc/Booking/@AccountingArea=01
+gen_xml(prefix=/Docs/Doc/Booking/@) end
+gen_xml(prefix=/Docs/Doc/Booking/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/InvoiceCycleKey=0
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/AnalysisKey
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/OrderNumber
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/OrderDate
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/OrderCode
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/DocItems/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/PosType=1
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/ItemRef=1002
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/CRef
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/Desc1=Pr�sentation Niederlande per
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/Desc2
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/ArticleGroup=102
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/PosTypeVersion=E
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/@)
+/Docs/Doc/DocItems/DocItem/Delivery/@DelWeek
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/@)
+/Docs/Doc/DocItems/DocItem/Delivery/@DelDay
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/@)
+/Docs/Doc/DocItems/DocItem/Delivery/@DelTime
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Delivery/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/PricePu=145,72
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/PriceUnit=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/PriceCalculation=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/ItemVal=145,72
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/InputKey=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/AveragePurchasePrice=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@)
+/Docs/Doc/DocItems/DocItem/Tax/@TaxCode=00
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@)
+/Docs/Doc/DocItems/DocItem/Tax/@TaxBra=000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@)
+/Docs/Doc/DocItems/DocItem/Tax/@TaxBraAccess=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@)
+/Docs/Doc/DocItems/DocItem/Tax/@TaxSumIndex=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Tax/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/DiscountArticle/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/DiscountArticle/@)
+/Docs/Doc/DocItems/DocItem/DiscountArticle/@DiscPC=0,00
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/DiscountArticle/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/DiscountArticle/@)
+/Docs/Doc/DocItems/DocItem/DiscountArticle/@DiscKey=1
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/DiscountArticle/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/DiscountArticle/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/ProceedKeyArticle=01
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/ActionKey=00
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/ContactCommissionArticle=0,00
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/QuantDependantPriceKey
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/Quant=1
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/QuantUnit
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@)
+/Docs/Doc/DocItems/DocItem/Meas/@Count=1
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@)
+/Docs/Doc/DocItems/DocItem/Meas/@Length=0,000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@)
+/Docs/Doc/DocItems/DocItem/Meas/@Width=0,000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@)
+/Docs/Doc/DocItems/DocItem/Meas/@Height=0,000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/Meas/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/DecimalPlace=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/MultiplierQuant=1,000000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/DifferingQuantUnit
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/DecimalPlaceConversion=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/WeightArticle/)
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/WeightArticle/@)
+/Docs/Doc/DocItems/DocItem/WeightArticle/@Amount=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/WeightArticle/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/WeightArticle/@)
+/Docs/Doc/DocItems/DocItem/WeightArticle/@Unit=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/WeightArticle/@) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/WeightArticle/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/Wreath=0,000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/Stock=1
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/CostUnitArticle
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/SerialNbKey=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/TextComplementKey=0
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/PartsListPrintKey
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/)
+/Docs/Doc/DocItems/DocItem/Prod=0000000000
+gen_xml(prefix=/Docs/Doc/DocItems/DocItem/) end
+gen_xml(prefix=/Docs/Doc/DocItems/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/Payment/)
+/Docs/Doc/Payment/PaymentKey=0
+gen_xml(prefix=/Docs/Doc/Payment/) end
+gen_xml(prefix=/Docs/Doc/Payment/)
+/Docs/Doc/Payment/ReminderKey=00
+gen_xml(prefix=/Docs/Doc/Payment/) end
+gen_xml(prefix=/Docs/Doc/Payment/)
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/)
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@PayTerm=1
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@PayDays=000
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscDays1=000
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscDays2=000
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscPer1=0,00
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscPer2=0,00
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/)
+/Docs/Doc/Payment/PayTerms
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@PayTerm=2
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@PayDays=000
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscDays1=000
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscDays2=000
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscPer1=0,00
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@)
+/Docs/Doc/Payment/PayTerms/@CashDiscPer2=0,00
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/@) end
+gen_xml(prefix=/Docs/Doc/Payment/PayTerms/) end
+gen_xml(prefix=/Docs/Doc/Payment/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/)
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTaxFree=145,72
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax1=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax2=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax3=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax4=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax5=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax6=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax7=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@)
+/Docs/Doc/NetAmountByTurnOverTax/@TurnOverTax8=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByTurnOverTax/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/GrossAmount=145,72
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+/Docs/Doc/ProceedAmount=145,72
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/)
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum0=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum1=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum2=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum3=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum4=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum5=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum6=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum7=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@)
+/Docs/Doc/NetAmountByPayTerm2/@Sum8=0,00
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/@) end
+gen_xml(prefix=/Docs/Doc/NetAmountByPayTerm2/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/Doc/)
+gen_xml(prefix=/Docs/Doc/TaxCodes/)
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode1=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode2=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode3=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode4=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode5=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode6=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode7=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/@)
+/Docs/Doc/TaxCodes/@TaxCode8=0
+gen_xml(prefix=/Docs/Doc/TaxCodes/@) end
+gen_xml(prefix=/Docs/Doc/TaxCodes/) end
+gen_xml(prefix=/Docs/Doc/) end
+gen_xml(prefix=/Docs/) end
+Done
diff --git a/ext/standard/tests/array/bug34066_1.phpt b/ext/standard/tests/array/bug34066_1.phpt
new file mode 100644
index 000000000..edc16efd0
--- /dev/null
+++ b/ext/standard/tests/array/bug34066_1.phpt
@@ -0,0 +1,731 @@
+--TEST--
+Bug #34066 (recursive array_walk causes segfault)
+--FILE--
+<?php
+
+ $order = array(
+ "DocID" => "1",
+ "DocDate" => "19.09.06",
+ "ReSubmissionDate" => "",
+ "DocTyp" => "Stapelauftrag",
+ "CustID" => "00000",
+ "CustomerAddress" => array(
+ array(
+ "Name1" => 'name1',
+ "Name2" => 'name2',
+ "Name3" => "",
+ "City" => 'city',
+ "Street" => 'street',
+ "Postal" => 'postcode',
+ "IATA" => "90",
+ "Country" => "Deutschland",
+ "ShortName" => 'short',
+ "ContactKey" => "",
+ "EMail" => 'email@example.com',
+ )
+ ),
+ "Text1" => "",
+ "Text2" => "",
+ "Wildcard1" => "",
+ "Wildcard2" => "",
+ "Dispatch" => "Paketdienst",
+ "Weight" => "0,0",
+ "BillingCustID" => "4300200000",
+ "ExtDocNr" => "00000000003",
+ "AnalysisLock" => "",
+ "PrintFlag" => "",
+ "FormType" => "0",
+ "Curr" => "EUR",
+ "ExChangeRate" => "1,0000",
+ "WIRRate" => "0",
+ "OneTimeCustomer" => array(
+ array(
+ "BankCode" => "",
+ "BankAccount" => ""
+ )
+ ),
+ "Language" => "0",
+ "PriceGroup" => "1",
+ "PrFlag" => "0",
+ "SalesTaxKey" => "1",
+ "ProceedKey" => "0",
+ "CustDiscountGroup" => "0",
+ "Discount" => array(
+ array(
+ "FinDisc1" => "0,00",
+ "Disc1Base" => "145,72",
+ "Disc1Value" => "0,00",
+ "FinDisc2" => "0,00",
+ "Disc2Base" => "145,72",
+ "Disc2Value" => "0,00",
+ "FinDisc3" => "0,00",
+ "Disc3Base" => "145,72",
+ "Disc3Value" => "0,00",
+ "ValueSummary" => "0,00"
+ )
+ ),
+ "Contact" => array(
+ array(
+ "Repr" => "999",
+ "Region" => "99",
+ "Commission" => "0,00",
+ "Agent" => "000000"
+ )
+ ),
+ "Booking" => array(
+ array(
+ "CostUnit" => "0000000000",
+ "CostCentre" => "0000000000",
+ "AccountingArea"=> "01"
+ )
+ ),
+ "InvoiceCycleKey" => "0",
+ "AnalysisKey" => "",
+ "OrderNumber" => "",
+ "OrderDate" => "",
+ "OrderCode" => "",
+ "DocItems" => array(
+ "DocItem" => array(
+ "PosType" => "1",
+ "ItemRef" => "1002",
+ "CRef" => "",
+ "Desc1" => "Pr�sentation Niederlande per",
+ "Desc2" => "",
+ "ArticleGroup" => "102",
+ "PosTypeVersion" => "E",
+ "Delivery" => array(
+ array(
+ "DelWeek" => "",
+ "DelDay" => "",
+ "DelTime" => ""
+ )
+ ),
+ "PricePu" => "145,72",
+ "PriceUnit" => "0",
+ "PriceCalculation" => "0",
+ "ItemVal" => "145,72",
+ "InputKey" => "0",
+ "AveragePurchasePrice" => "0",
+ "Tax" => array(
+ array(
+ "TaxCode" => "00",
+ "TaxBra" => "000",
+ "TaxBraAccess" => "0",
+ "TaxSumIndex" => "0"
+ )
+ ),
+ "DiscountArticle" => array(
+ array(
+ "DiscPC" => "0,00",
+ "DiscKey" => "1"
+ )
+ ),
+ "ProceedKeyArticle" => "01",
+ "ActionKey" => "00",
+ "ContactCommissionArticle"=> "0,00",
+ "QuantDependantPriceKey"=> "",
+ "Quant" => "1",
+ "QuantUnit" => "",
+ "Meas" => array(
+ array(
+ "Count" => "1",
+ "Length" => "0,000",
+ "Width" => "0,000",
+ "Height" => "0,000"
+ )
+ ),
+ "DecimalPlace" => "0",
+ "MultiplierQuant" => "1,000000",
+ "DifferingQuantUnit" => "",
+ "DecimalPlaceConversion"=> "0",
+ "WeightArticle" => array(
+ array(
+ "Amount" => "0",
+ "Unit" => "0"
+ )
+ ),
+ "Wreath" => "0,000",
+ "Stock" => "1",
+ "CostUnitArticle" => "",
+ "SerialNbKey" => "0",
+ "TextComplementKey" => "0",
+ "PartsListPrintKey" => "",
+ "Prod" => "0000000000"
+ )
+ ),
+ "Payment" => array(
+ "PaymentKey" => "0",
+ "ReminderKey" => "00",
+ "PayTerms" => array(
+ array(
+ "PayTerm" => "1",
+ "PayDays" => "000",
+ "CashDiscDays1" => "000",
+ "CashDiscDays2" => "000",
+ "CashDiscPer1" => "0,00",
+ "CashDiscPer2" => "0,00"
+ ),
+ array(
+ "PayTerm" => "2",
+ "PayDays" => "000",
+ "CashDiscDays1" => "000",
+ "CashDiscDays2" => "000",
+ "CashDiscPer1" => "0,00",
+ "CashDiscPer2" => "0,00"
+ )
+ )
+ ),
+ "NetAmountByTurnOverTax" => array(
+ array(
+ "TurnOverTaxFree" => "145,72",
+ "TurnOverTax1" => "0,00",
+ "TurnOverTax2" => "0,00",
+ "TurnOverTax3" => "0,00",
+ "TurnOverTax4" => "0,00",
+ "TurnOverTax5" => "0,00",
+ "TurnOverTax6" => "0,00",
+ "TurnOverTax7" => "0,00",
+ "TurnOverTax8" => "0,00"
+ ),
+ ),
+ "GrossAmount" => "145,72",
+ "ProceedAmount" => "145,72",
+ "NetAmountByPayTerm2" => array(
+ array(
+ "Sum0" => "0,00",
+ "Sum1" => "0,00",
+ "Sum2" => "0,00",
+ "Sum3" => "0,00",
+ "Sum4" => "0,00",
+ "Sum5" => "0,00",
+ "Sum6" => "0,00",
+ "Sum7" => "0,00",
+ "Sum8" => "0,00"
+ ),
+ ),
+ "TaxCodes" => array(
+ array(
+ "TaxCode1" => "0",
+ "TaxCode2" => "0",
+ "TaxCode3" => "0",
+ "TaxCode4" => "0",
+ "TaxCode5" => "0",
+ "TaxCode6" => "0",
+ "TaxCode7" => "0",
+ "TaxCode8" => "0"
+ )
+ )
+ );
+ $docs = array(
+ array(
+ "Version" => "1.0",
+ "ProducerName" => "xxxxxxxx",
+ "ProductName" => "Classic Line",
+ "xmlns" => "x-schema:CL310_DezABFSchema.XML"
+ ),
+ "Company" => array(
+ array(
+ "MandateNumber" => "111",
+ "MandateName" => "xxx xxxxxxx-xxxxx xxxxxxx",
+ "MandateCurr" => "EUR"
+ ),
+ ),
+ "Doc" => $order
+ );
+
+ dump2xml($docs);
+
+
+function dump2xml($array) {
+ // output of this goes through 2xml
+ array_walk_recursive($array, "gen_xml", "/Docs/");
+}
+function gen_xml($val, $key, $prefix)
+{
+ global $xml_fd;
+ print "gen_xml(prefix=$prefix)\n";
+ if (is_array($val)) {
+ if (preg_match('/^\d+$/', $key)) {
+ if ($key == 1) {
+ print substr($prefix, 0, -1) . "\n";
+ }
+ array_walk_recursive($val, "gen_xml", "$prefix@");
+ }
+ else {
+ array_walk_recursive($val, "gen_xml", "$prefix$key/");
+ }
+ }
+ else {
+ if (strlen($val) > 0)
+ print "$prefix$key=$val\n";
+ else
+ print "$prefix$key\n";
+ }
+ print "gen_xml(prefix=$prefix) end\n";
+}
+echo "Done\n";
+?>
+--EXPECTF--
+gen_xml(prefix=/Docs/)
+/Docs/Version=1.0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ProducerName=xxxxxxxx
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ProductName=Classic Line
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/xmlns=x-schema:CL310_DezABFSchema.XML
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/MandateNumber=111
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/MandateName=xxx xxxxxxx-xxxxx xxxxxxx
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/MandateCurr=EUR
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DocID=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DocDate=19.09.06
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ReSubmissionDate
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DocTyp=Stapelauftrag
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CustID=00000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Name1=name1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Name2=name2
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Name3
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/City=city
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Street=street
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Postal=postcode
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/IATA=90
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Country=Deutschland
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ShortName=short
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ContactKey
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/EMail=email@example.com
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Text1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Text2
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Wildcard1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Wildcard2
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Dispatch=Paketdienst
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Weight=0,0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/BillingCustID=4300200000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ExtDocNr=00000000003
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/AnalysisLock
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PrintFlag
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/FormType=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Curr=EUR
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ExChangeRate=1,0000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/WIRRate=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/BankCode
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/BankAccount
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Language=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PriceGroup=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PrFlag=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/SalesTaxKey=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ProceedKey=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CustDiscountGroup=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/FinDisc1=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Disc1Base=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Disc1Value=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/FinDisc2=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Disc2Base=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Disc2Value=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/FinDisc3=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Disc3Base=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Disc3Value=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ValueSummary=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Repr=999
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Region=99
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Commission=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Agent=000000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CostUnit=0000000000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CostCentre=0000000000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/AccountingArea=01
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/InvoiceCycleKey=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/AnalysisKey
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/OrderNumber
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/OrderDate
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/OrderCode
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PosType=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ItemRef=1002
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CRef
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Desc1=Pr�sentation Niederlande per
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Desc2
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ArticleGroup=102
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PosTypeVersion=E
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DelWeek
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DelDay
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DelTime
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PricePu=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PriceUnit=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PriceCalculation=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ItemVal=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/InputKey=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/AveragePurchasePrice=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode=00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxBra=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxBraAccess=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxSumIndex=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DiscPC=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DiscKey=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ProceedKeyArticle=01
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ActionKey=00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ContactCommissionArticle=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/QuantDependantPriceKey
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Quant=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/QuantUnit
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Count=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Length=0,000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Width=0,000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Height=0,000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DecimalPlace=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/MultiplierQuant=1,000000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DifferingQuantUnit
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/DecimalPlaceConversion=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Amount=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Unit=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Wreath=0,000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Stock=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CostUnitArticle
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/SerialNbKey=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TextComplementKey=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PartsListPrintKey
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Prod=0000000000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PaymentKey=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ReminderKey=00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PayTerm=1
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PayDays=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscDays1=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscDays2=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscPer1=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscPer2=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PayTerm=2
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/PayDays=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscDays1=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscDays2=000
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscPer1=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/CashDiscPer2=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTaxFree=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax1=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax2=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax3=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax4=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax5=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax6=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax7=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TurnOverTax8=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/GrossAmount=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/ProceedAmount=145,72
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum0=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum1=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum2=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum3=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum4=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum5=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum6=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum7=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/Sum8=0,00
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode1=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode2=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode3=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode4=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode5=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode6=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode7=0
+gen_xml(prefix=/Docs/) end
+gen_xml(prefix=/Docs/)
+/Docs/TaxCode8=0
+gen_xml(prefix=/Docs/) end
+Done
diff --git a/ext/standard/tests/array/bug38464.phpt b/ext/standard/tests/array/bug38464.phpt
new file mode 100644
index 000000000..42f7a6ab5
--- /dev/null
+++ b/ext/standard/tests/array/bug38464.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #38464 (array_count_values() mishandles numeric strings)
+--FILE--
+<?php
+$array = array('-000', ' 001', 1, ' 123', '+123');
+var_dump(array_count_values($array));
+?>
+--EXPECT--
+array(5) {
+ ["-000"]=>
+ int(1)
+ [" 001"]=>
+ int(1)
+ [1]=>
+ int(1)
+ [" 123"]=>
+ int(1)
+ ["+123"]=>
+ int(1)
+}
diff --git a/ext/standard/tests/array/max.phpt b/ext/standard/tests/array/max.phpt
new file mode 100644
index 000000000..7edcab755
--- /dev/null
+++ b/ext/standard/tests/array/max.phpt
@@ -0,0 +1,39 @@
+--TEST--
+max() tests
+--FILE--
+<?php
+
+var_dump(max());
+var_dump(max(1));
+var_dump(max(array()));
+var_dump(max(new stdclass));
+var_dump(max(2,1,2));
+var_dump(max(2.1,2.11,2.09));
+var_dump(max("", "t", "b"));
+var_dump(max(false, true, false));
+var_dump(max(true, false, true));
+var_dump(max(1, true, false, true));
+var_dump(max(0, true, false, true));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: max(): Atleast one value should be passed in %s on line %d
+NULL
+
+Warning: Wrong parameter count for max() in %s on line %d
+NULL
+
+Warning: max(): Array must contain atleast one element in %s on line %d
+bool(false)
+
+Warning: Wrong parameter count for max() in %s on line %d
+NULL
+int(2)
+float(2.11)
+string(1) "t"
+bool(true)
+bool(true)
+int(1)
+bool(true)
+Done
diff --git a/ext/standard/tests/array/min.phpt b/ext/standard/tests/array/min.phpt
new file mode 100644
index 000000000..70e3555f1
--- /dev/null
+++ b/ext/standard/tests/array/min.phpt
@@ -0,0 +1,39 @@
+--TEST--
+min() tests
+--FILE--
+<?php
+
+var_dump(min());
+var_dump(min(1));
+var_dump(min(array()));
+var_dump(min(new stdclass));
+var_dump(min(2,1,2));
+var_dump(min(2.1,2.11,2.09));
+var_dump(min("", "t", "b"));
+var_dump(min(false, true, false));
+var_dump(min(true, false, true));
+var_dump(min(1, true, false, true));
+var_dump(min(0, true, false, true));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: min(): Atleast one value should be passed in %s on line %d
+NULL
+
+Warning: Wrong parameter count for min() in %s on line %d
+NULL
+
+Warning: min(): Array must contain atleast one element in %s on line %d
+bool(false)
+
+Warning: Wrong parameter count for min() in %s on line %d
+NULL
+int(1)
+float(2.09)
+string(0) ""
+bool(false)
+bool(false)
+bool(false)
+int(0)
+Done
diff --git a/ext/standard/tests/assert/assert02.phpt b/ext/standard/tests/assert/assert02.phpt
new file mode 100644
index 000000000..88a1e1242
--- /dev/null
+++ b/ext/standard/tests/assert/assert02.phpt
@@ -0,0 +1,42 @@
+--TEST--
+catch assert() errors
+--FILE--
+<?php
+function handler($errno, $errstr) {
+ echo "in handler()\n";
+ assert(E_RECOVERABLE_ERROR === $errno);
+ var_dump($errstr);
+}
+
+set_error_handler('handler', E_RECOVERABLE_ERROR);
+
+assert(1);
+assert('1');
+assert('$a');
+
+assert('aa=sd+as+safsafasfaçsafçsafç');
+
+assert('0');
+
+assert_options(ASSERT_BAIL, 1);
+assert('aa=sd+as+safsafasfaçsafçsafç');
+
+echo "done\n";
+
+?>
+--EXPECTF--
+Notice: Undefined variable: a in %sassert02.php(12) : assert code on line 1
+
+Warning: assert(): Assertion "$a" failed in %sassert02.php on line %d
+
+Parse error: %s error%sassert02.php(%d) : assert code on line 1
+in handler()
+string(64) "assert(): Failure evaluating code:
+aa=sd+as+safsafasfaçsafçsafç"
+
+Warning: assert(): Assertion "0" failed in %sassert02.php on line %d
+
+Parse error: %s error%sassert02.php(%d) : assert code on line 1
+in handler()
+string(64) "assert(): Failure evaluating code:
+aa=sd+as+safsafasfaçsafçsafç"
diff --git a/ext/standard/tests/file/bug22414.phpt b/ext/standard/tests/file/bug22414.phpt
index f4f097d66..0775fc8a7 100644
--- a/ext/standard/tests/file/bug22414.phpt
+++ b/ext/standard/tests/file/bug22414.phpt
@@ -15,7 +15,6 @@ output_handler=
echo "\n";
/* Binary Data Test */
- @unlink($pwd . '/passthru_test');
$cmd = $php . ' -n -r \"readfile(@getenv(\'TEST_PHP_EXECUTABLE\')); \"';
$cmd = $php . ' -n -r \' passthru("'.$cmd.'"); \' > '.$tmpfile ;
diff --git a/ext/standard/tests/file/bug24313.phpt b/ext/standard/tests/file/bug24313.phpt
index 4b84bcac4..04057c58a 100644
--- a/ext/standard/tests/file/bug24313.phpt
+++ b/ext/standard/tests/file/bug24313.phpt
@@ -1,10 +1,10 @@
--TEST--
-Bug #24313 (file_exists() warning on non-existant files when is open_basedir enabled)
+Bug #24313 (file_exists() throws a warning on nonexistent files when is open_basedir enabled)
--INI--
-open_basedir=/tmp
+open_basedir=/dev
--FILE--
<?php
- var_dump(file_exists("/tmp/bogus_file_no_such_thing"));
+ var_dump(file_exists("/dev/bogus_file_no_such_thing"));
?>
--EXPECT--
bool(false)
diff --git a/ext/standard/tests/file/bug37864.phpt b/ext/standard/tests/file/bug37864.phpt
new file mode 100644
index 000000000..d74647cc7
--- /dev/null
+++ b/ext/standard/tests/file/bug37864.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #37864 (file_get_contents() leaks on empty file)
+--FILE--
+<?php
+ $tmpfname = tempnam("/tmp", "emptyfile");
+ var_dump(file_get_contents($tmpfname));
+ echo "done.\n";
+ unlink($tmpfname);
+?>
+--EXPECT--
+string(0) ""
+done.
diff --git a/ext/standard/tests/file/bug38086.phpt b/ext/standard/tests/file/bug38086.phpt
new file mode 100644
index 000000000..ed8af75a4
--- /dev/null
+++ b/ext/standard/tests/file/bug38086.phpt
@@ -0,0 +1,46 @@
+--TEST--
+Bug #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger than the actual length)
+--FILE--
+<?php
+
+$initial_file = dirname(__FILE__).'/bug38086.txt';
+$new_file = dirname(__FILE__).'/bug38086_1.txt';
+
+$src = fopen($initial_file, 'r');
+stream_filter_append($src, "string.rot13", STREAM_FILTER_READ);
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+$src = fopen($initial_file, 'r');
+stream_filter_append($src, "string.rot13", STREAM_FILTER_READ);
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest, 10000));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(134)
+string(134) "Nabgure qnl
+Jura gur cnvaf bs yvsr jba'g one zl jnl
+V'yy oernx gurfr punvaf
+Gung ubyq zr qbja
+V'yy grne lbh qbja vagb zl cevingr uryy
+"
+int(134)
+string(134) "Nabgure qnl
+Jura gur cnvaf bs yvsr jba'g one zl jnl
+V'yy oernx gurfr punvaf
+Gung ubyq zr qbja
+V'yy grne lbh qbja vagb zl cevingr uryy
+"
+Done
diff --git a/ext/standard/tests/file/bug38086.txt b/ext/standard/tests/file/bug38086.txt
new file mode 100644
index 000000000..8e324724c
--- /dev/null
+++ b/ext/standard/tests/file/bug38086.txt
@@ -0,0 +1,5 @@
+Another day
+When the pains of life won't bar my way
+I'll break these chains
+That hold me down
+I'll tear you down into my private hell
diff --git a/ext/standard/tests/file/bug38450.phpt b/ext/standard/tests/file/bug38450.phpt
new file mode 100644
index 000000000..6fcdab871
--- /dev/null
+++ b/ext/standard/tests/file/bug38450.phpt
@@ -0,0 +1,114 @@
+--TEST--
+Bug #38450 (constructor is not called for classes used in userspace stream wrappers)
+--FILE--
+<?php
+
+class VariableStream {
+ var $position;
+ var $varname;
+
+ function VariableStream($var) {
+ var_dump("constructor!");
+ }
+
+ function stream_open($path, $mode, $options, &$opened_path)
+ {
+ $url = parse_url($path);
+ $this->varname = $url["host"];
+ $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_write($data)
+ {
+ $left = substr($GLOBALS[$this->varname], 0, $this->position);
+ $right = substr($GLOBALS[$this->varname], $this->position + strlen($data));
+ $GLOBALS[$this->varname] = $left . $data . $right;
+ $this->position += strlen($data);
+ return strlen($data);
+ }
+
+ 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;
+ }
+ }
+}
+
+stream_wrapper_register("var", "VariableStream")
+ or die("Failed to register protocol");
+
+$myvar = "";
+
+$fp = fopen("var://myvar", "r+");
+
+fwrite($fp, "line1\n");
+fwrite($fp, "line2\n");
+fwrite($fp, "line3\n");
+
+rewind($fp);
+while (!feof($fp)) {
+ echo fgets($fp);
+}
+fclose($fp);
+var_dump($myvar);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Missing argument 1 for VariableStream::VariableStream() in %s on line %d
+string(12) "constructor!"
+line1
+line2
+line3
+string(18) "line1
+line2
+line3
+"
+Done
diff --git a/ext/standard/tests/file/bug38450_1.phpt b/ext/standard/tests/file/bug38450_1.phpt
new file mode 100644
index 000000000..094755e47
--- /dev/null
+++ b/ext/standard/tests/file/bug38450_1.phpt
@@ -0,0 +1,114 @@
+--TEST--
+Bug #38450 (constructor is not called for classes used in userspace stream wrappers)
+--FILE--
+<?php
+
+class VariableStream {
+ var $position;
+ var $varname;
+
+ function __construct($var) {
+ var_dump("constructor!");
+ }
+
+ function stream_open($path, $mode, $options, &$opened_path)
+ {
+ $url = parse_url($path);
+ $this->varname = $url["host"];
+ $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_write($data)
+ {
+ $left = substr($GLOBALS[$this->varname], 0, $this->position);
+ $right = substr($GLOBALS[$this->varname], $this->position + strlen($data));
+ $GLOBALS[$this->varname] = $left . $data . $right;
+ $this->position += strlen($data);
+ return strlen($data);
+ }
+
+ 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;
+ }
+ }
+}
+
+stream_wrapper_register("var", "VariableStream")
+ or die("Failed to register protocol");
+
+$myvar = "";
+
+$fp = fopen("var://myvar", "r+");
+
+fwrite($fp, "line1\n");
+fwrite($fp, "line2\n");
+fwrite($fp, "line3\n");
+
+rewind($fp);
+while (!feof($fp)) {
+ echo fgets($fp);
+}
+fclose($fp);
+var_dump($myvar);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Missing argument 1 for VariableStream::__construct() in %s on line %d
+string(12) "constructor!"
+line1
+line2
+line3
+string(18) "line1
+line2
+line3
+"
+Done
diff --git a/ext/standard/tests/file/bug38450_2.phpt b/ext/standard/tests/file/bug38450_2.phpt
new file mode 100644
index 000000000..625fd7c5c
--- /dev/null
+++ b/ext/standard/tests/file/bug38450_2.phpt
@@ -0,0 +1,114 @@
+--TEST--
+Bug #38450 (constructor is not called for classes used in userspace stream wrappers)
+--FILE--
+<?php
+
+class VariableStream {
+ var $position;
+ var $varname;
+
+ function __construct($var) {
+ throw new Exception("constructor");
+ }
+
+ function stream_open($path, $mode, $options, &$opened_path)
+ {
+ $url = parse_url($path);
+ $this->varname = $url["host"];
+ $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_write($data)
+ {
+ $left = substr($GLOBALS[$this->varname], 0, $this->position);
+ $right = substr($GLOBALS[$this->varname], $this->position + strlen($data));
+ $GLOBALS[$this->varname] = $left . $data . $right;
+ $this->position += strlen($data);
+ return strlen($data);
+ }
+
+ 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;
+ }
+ }
+}
+
+stream_wrapper_register("var", "VariableStream")
+ or die("Failed to register protocol");
+
+$myvar = "";
+
+$fp = fopen("var://myvar", "r+");
+
+fwrite($fp, "line1\n");
+fwrite($fp, "line2\n");
+fwrite($fp, "line3\n");
+
+rewind($fp);
+while (!feof($fp)) {
+ echo fgets($fp);
+}
+fclose($fp);
+var_dump($myvar);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Missing argument 1 for VariableStream::__construct() in %s on line %d
+
+Warning: fopen(var://myvar): failed to open stream: "VariableStream::stream_open" call failed in %s on line %d
+
+Fatal error: Uncaught exception 'Exception' with message 'constructor' in %s:%d
+Stack trace:
+#0 [internal function]: VariableStream->__construct()
+#1 %s(%d): fopen('var://myvar', 'r+')
+#2 {main}
+ thrown in %s on line %d
diff --git a/ext/standard/tests/file/bug38450_3.phpt b/ext/standard/tests/file/bug38450_3.phpt
new file mode 100644
index 000000000..d11ebd91e
--- /dev/null
+++ b/ext/standard/tests/file/bug38450_3.phpt
@@ -0,0 +1,105 @@
+--TEST--
+Bug #38450 (constructor is not called for classes used in userspace stream wrappers)
+--FILE--
+<?php
+
+class VariableStream {
+ var $position;
+ var $varname;
+
+ function __construct(array $var) {
+ var_dump("constructor!");
+ }
+
+ function stream_open($path, $mode, $options, &$opened_path)
+ {
+ $url = parse_url($path);
+ $this->varname = $url["host"];
+ $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_write($data)
+ {
+ $left = substr($GLOBALS[$this->varname], 0, $this->position);
+ $right = substr($GLOBALS[$this->varname], $this->position + strlen($data));
+ $GLOBALS[$this->varname] = $left . $data . $right;
+ $this->position += strlen($data);
+ return strlen($data);
+ }
+
+ 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;
+ }
+ }
+}
+
+stream_wrapper_register("var", "VariableStream")
+ or die("Failed to register protocol");
+
+$myvar = "";
+
+$fp = fopen("var://myvar", "r+");
+
+fwrite($fp, "line1\n");
+fwrite($fp, "line2\n");
+fwrite($fp, "line3\n");
+
+rewind($fp);
+while (!feof($fp)) {
+ echo fgets($fp);
+}
+fclose($fp);
+var_dump($myvar);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Catchable fatal error: Argument 1 passed to VariableStream::__construct() must be an array, none given in %s on line %d
diff --git a/ext/standard/tests/file/file_put_contents.phpt b/ext/standard/tests/file/file_put_contents.phpt
new file mode 100644
index 000000000..de08141b8
--- /dev/null
+++ b/ext/standard/tests/file/file_put_contents.phpt
@@ -0,0 +1,28 @@
+--TEST--
+file_put_contents() and invalid parameters
+--FILE--
+<?php
+
+$file = dirname(__FILE__)."/file_put_contents.txt";
+
+$context = stream_context_create();
+
+var_dump(file_put_contents($file, $context));
+var_dump(file_put_contents($file, new stdClass));
+$fp = fopen($file, "r");
+var_dump(file_put_contents($file, "string", 0, $fp));
+
+@unlink($file);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: file_put_contents(): supplied resource is not a valid stream resource in %s on line %d
+bool(false)
+
+Warning: file_put_contents(): The 2nd parameter should be either a string or an array in %s on line %d
+bool(false)
+
+Warning: file_put_contents(): supplied resource is not a valid Stream-Context resource in %s on line %d
+int(6)
+Done
diff --git a/ext/standard/tests/file/mkdir-001.phpt b/ext/standard/tests/file/mkdir-001.phpt
new file mode 100644
index 000000000..be653da29
--- /dev/null
+++ b/ext/standard/tests/file/mkdir-001.phpt
@@ -0,0 +1,36 @@
+--TEST--
+mkdir() tests
+--FILE--
+<?php
+
+var_dump(mkdir("testdir"));
+var_dump(mkdir("testdir/subdir"));
+var_dump(rmdir("testdir/subdir"));
+var_dump(rmdir("testdir"));
+
+var_dump(mkdir("./testdir"));
+var_dump(mkdir("./testdir/subdir"));
+var_dump(rmdir("./testdir/subdir"));
+var_dump(rmdir("./testdir"));
+
+var_dump(mkdir(dirname(__FILE__)."/testdir"));
+var_dump(mkdir(dirname(__FILE__)."/testdir/subdir"));
+var_dump(rmdir(dirname(__FILE__)."/testdir/subdir"));
+var_dump(rmdir(dirname(__FILE__)."/testdir"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+Done
diff --git a/ext/standard/tests/file/mkdir-002.phpt b/ext/standard/tests/file/mkdir-002.phpt
new file mode 100644
index 000000000..bc4f19aca
--- /dev/null
+++ b/ext/standard/tests/file/mkdir-002.phpt
@@ -0,0 +1,49 @@
+--TEST--
+mkdir(dir, 0777) tests
+--FILE--
+<?php
+
+var_dump(mkdir("testdir", 0777));
+var_dump(mkdir("testdir/subdir", 0777));
+var_dump(`ls -l testdir`);
+var_dump(rmdir("testdir/subdir"));
+var_dump(rmdir("testdir"));
+
+var_dump(mkdir("./testdir", 0777));
+var_dump(mkdir("./testdir/subdir", 0777));
+var_dump(`ls -l ./testdir`);
+var_dump(rmdir("./testdir/subdir"));
+var_dump(rmdir("./testdir"));
+
+var_dump(mkdir(dirname(__FILE__)."/testdir", 0777));
+var_dump(mkdir(dirname(__FILE__)."/testdir/subdir", 0777));
+$dirname = dirname(__FILE__)."/testdir";
+var_dump(`ls -l $dirname`);
+var_dump(rmdir(dirname(__FILE__)."/testdir/subdir"));
+var_dump(rmdir(dirname(__FILE__)."/testdir"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+string(%d) "%s
+d%s subdir
+"
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+string(%d) "%s
+d%s subdir
+"
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+string(%d) "%s
+d%s subdir
+"
+bool(true)
+bool(true)
+Done
diff --git a/ext/standard/tests/file/mkdir-003.phpt b/ext/standard/tests/file/mkdir-003.phpt
new file mode 100644
index 000000000..50ad5e6c4
--- /dev/null
+++ b/ext/standard/tests/file/mkdir-003.phpt
@@ -0,0 +1,30 @@
+--TEST--
+recursive mkdir() tests
+--FILE--
+<?php
+
+var_dump(mkdir("testdir/subdir", 0777, true));
+var_dump(rmdir("testdir/subdir"));
+var_dump(rmdir("testdir"));
+
+var_dump(mkdir("./testdir/subdir", 0777, true));
+var_dump(rmdir("./testdir/subdir"));
+var_dump(rmdir("./testdir"));
+
+var_dump(mkdir(dirname(__FILE__)."/testdir/subdir", 0777, true));
+var_dump(rmdir(dirname(__FILE__)."/testdir/subdir"));
+var_dump(rmdir(dirname(__FILE__)."/testdir"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+Done
diff --git a/ext/standard/tests/file/mkdir-004.phpt b/ext/standard/tests/file/mkdir-004.phpt
new file mode 100644
index 000000000..45c275106
--- /dev/null
+++ b/ext/standard/tests/file/mkdir-004.phpt
@@ -0,0 +1,24 @@
+--TEST--
+recursive mkdir() tests
+--SKIPIF--
+<?php
+chdir("/");
+if (!@mkdir("testtmpskipifdir")) {
+ die("skip for root only");
+}
+rmdir("testtmpskipifdir");
+?>
+--FILE--
+<?php
+
+var_dump(mkdir("/testdir/subdir", 0777, true));
+var_dump(rmdir("/testdir/subdir"));
+var_dump(rmdir("/testdir"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+Done
diff --git a/ext/standard/tests/file/mkdir-005.phpt b/ext/standard/tests/file/mkdir-005.phpt
new file mode 100644
index 000000000..af2387ca7
--- /dev/null
+++ b/ext/standard/tests/file/mkdir-005.phpt
@@ -0,0 +1,25 @@
+--TEST--
+recursive mkdir() tests
+--SKIPIF--
+<?php
+chdir("/");
+if (!@mkdir("testtmpskipifdir")) {
+ die("skip for root only");
+}
+rmdir("testtmpskipifdir");
+?>
+--FILE--
+<?php
+
+chdir("/");
+var_dump(mkdir("./testdir/subdir", 0777, true));
+var_dump(rmdir("./testdir/subdir"));
+var_dump(rmdir("./testdir"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+Done
diff --git a/ext/standard/tests/file/mkdir-006.phpt b/ext/standard/tests/file/mkdir-006.phpt
new file mode 100644
index 000000000..5bfa8e814
--- /dev/null
+++ b/ext/standard/tests/file/mkdir-006.phpt
@@ -0,0 +1,26 @@
+--TEST--
+recursive mkdir() with unclean paths
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die('skip only for Windows');
+}
+?>
+--FILE--
+<?php
+chdir(dirname(__FILE__));
+$dirpath = "./tmp/foo//bar/logs";
+mkdir($dirpath, 0777, true);
+
+if (is_dir($dirpath)) {
+ echo "Ok.\n";
+} else {
+ echo "Failed.\n";
+}
+rmdir("./tmp/foo/bar/logs");
+rmdir("./tmp/foo/bar/");
+rmdir("./tmp/foo/");
+rmdir("./tmp/");
+?>
+--EXPECT--
+Ok.
diff --git a/ext/standard/tests/file/stream_001.phpt b/ext/standard/tests/file/stream_001.phpt
new file mode 100644
index 000000000..8a3f03409
--- /dev/null
+++ b/ext/standard/tests/file/stream_001.phpt
@@ -0,0 +1,24 @@
+--TEST--
+stream_wrapper_unregister() & stream_wrapper_restore()
+--FILE--
+<?php
+
+var_dump(stream_wrapper_unregister('file'));
+var_dump(fopen("file://".__FILE__, "r"));
+var_dump(stream_wrapper_restore('file'));
+var_dump(fopen("file://".__FILE__, "r"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+
+Notice: fopen(): Unable to find the wrapper "file" - did you forget to enable it when you configured PHP? in %s on line %d
+
+Warning: fopen(): Plainfiles wrapper disabled in %s on line %d
+
+Warning: fopen(file:///%s): failed to open stream: no suitable wrapper could be found in %s on line %d
+bool(false)
+bool(true)
+resource(%d) of type (stream)
+Done
diff --git a/ext/standard/tests/file/stream_002.phpt b/ext/standard/tests/file/stream_002.phpt
new file mode 100644
index 000000000..ae10abf2d
--- /dev/null
+++ b/ext/standard/tests/file/stream_002.phpt
@@ -0,0 +1,53 @@
+--TEST--
+stream_socket_client() and invalid arguments
+--FILE--
+<?php
+
+$a = NULL;
+$b = NULL;
+var_dump(stream_socket_client("", $a, $b));
+var_dump($a, $b);
+var_dump(stream_socket_client("[", $a, $b));
+var_dump($a, $b);
+var_dump(stream_socket_client("[ ", $a, $b));
+var_dump($a, $b);
+var_dump(stream_socket_client(".", $a, $b));
+var_dump($a, $b);
+var_dump(stream_socket_client(1, $a, $b));
+var_dump($a, $b);
+var_dump(stream_socket_client(array(), $a, $b));
+var_dump($a, $b);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: stream_socket_client(): unable to connect to (Failed to parse address "") in %s on line %d
+bool(false)
+int(0)
+string(26) "Failed to parse address """
+
+Warning: stream_socket_client(): unable to connect to [ (Failed to parse address "[") in %s on line %d
+bool(false)
+int(0)
+string(27) "Failed to parse address "[""
+
+Warning: stream_socket_client(): unable to connect to [ (Failed to parse IPv6 address "[ ") in %s on line %d
+bool(false)
+int(0)
+string(33) "Failed to parse IPv6 address "[ ""
+
+Warning: stream_socket_client(): unable to connect to . (Failed to parse address ".") in %s on line %d
+bool(false)
+int(0)
+string(27) "Failed to parse address ".""
+
+Warning: stream_socket_client(): unable to connect to 1 (Failed to parse address "1") in %s on line %d
+bool(false)
+int(0)
+string(27) "Failed to parse address "1""
+
+Warning: stream_socket_client() expects parameter 1 to be string, array given in %s on line %d
+bool(false)
+int(0)
+string(27) "Failed to parse address "1""
+Done
diff --git a/ext/standard/tests/file/stream_copy_to_stream.phpt b/ext/standard/tests/file/stream_copy_to_stream.phpt
new file mode 100644
index 000000000..3f46eec0c
--- /dev/null
+++ b/ext/standard/tests/file/stream_copy_to_stream.phpt
@@ -0,0 +1,129 @@
+--TEST--
+stream_copy_to_stream() tests
+--FILE--
+<?php
+
+$initial_file = dirname(__FILE__).'/bug38086.txt';
+$new_file = dirname(__FILE__).'/bug38086_1.txt';
+
+$src = fopen($initial_file, 'r');
+stream_filter_append($src, "string.rot13", STREAM_FILTER_READ);
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest, 0));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+/* --- */
+
+$src = fopen($initial_file, 'r');
+stream_filter_append($src, "string.rot13", STREAM_FILTER_READ);
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest, -1));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+/* --- */
+
+$src = fopen($initial_file, 'r');
+stream_filter_append($src, "string.rot13", STREAM_FILTER_READ);
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+/* --- */
+
+$src = fopen($initial_file, 'r');
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+/* --- */
+
+$src = fopen($initial_file, 'r');
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest, 1000000));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+/* --- */
+
+$src = fopen($initial_file, 'r');
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest, 10));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+/* --- */
+
+$src = fopen($initial_file, 'r');
+
+$dest = fopen($new_file, 'w');
+var_dump(stream_copy_to_stream($src, $dest, -1));
+fclose($src); fclose($dest);
+
+var_dump(file_get_contents($new_file));
+unlink($new_file);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(0)
+string(0) ""
+int(134)
+string(134) "Nabgure qnl
+Jura gur cnvaf bs yvsr jba'g one zl jnl
+V'yy oernx gurfr punvaf
+Gung ubyq zr qbja
+V'yy grne lbh qbja vagb zl cevingr uryy
+"
+int(134)
+string(134) "Nabgure qnl
+Jura gur cnvaf bs yvsr jba'g one zl jnl
+V'yy oernx gurfr punvaf
+Gung ubyq zr qbja
+V'yy grne lbh qbja vagb zl cevingr uryy
+"
+int(134)
+string(134) "Another day
+When the pains of life won't bar my way
+I'll break these chains
+That hold me down
+I'll tear you down into my private hell
+"
+int(134)
+string(134) "Another day
+When the pains of life won't bar my way
+I'll break these chains
+That hold me down
+I'll tear you down into my private hell
+"
+int(10)
+string(10) "Another da"
+int(134)
+string(134) "Another day
+When the pains of life won't bar my way
+I'll break these chains
+That hold me down
+I'll tear you down into my private hell
+"
+Done
diff --git a/ext/standard/tests/file/stream_rfc2397_001.phpt b/ext/standard/tests/file/stream_rfc2397_001.phpt
new file mode 100755
index 000000000..23a573092
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_001.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Stream: RFC2397
+--FILE--
+<?php
+
+$data = 'data://,hello world';
+
+var_dump(file_get_contents($data));
+
+$file = fopen($data, 'r');
+unset($data);
+
+var_dump(stream_get_contents($file));
+
+?>
+===DONE===
+--EXPECT--
+string(11) "hello world"
+string(11) "hello world"
+===DONE=== \ No newline at end of file
diff --git a/ext/standard/tests/file/stream_rfc2397_002.phpt b/ext/standard/tests/file/stream_rfc2397_002.phpt
new file mode 100755
index 000000000..0a0a14a8e
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_002.phpt
@@ -0,0 +1,180 @@
+--TEST--
+Stream: RFC2397 getting meta data
+--FILE--
+<?php
+
+$streams = array(
+ 'data://,',
+ 'data://',
+ 'data://;base64,',
+ 'data://;base64',
+ 'data://foo,',
+ 'data://foo=bar,',
+ 'data://text/plain,',
+ 'data://text/plain;foo,',
+ 'data://text/plain;foo=bar,',
+ 'data://text/plain;foo=bar;bla,',
+ 'data://text/plain;foo=bar;base64,',
+ 'data://text/plain;foo=bar;bar=baz',
+ 'data://text/plain;foo=bar;bar=baz,',
+ );
+
+foreach($streams as $stream)
+{
+ $stream = fopen($stream, 'r');
+ $meta = @stream_get_meta_data($stream);
+ var_dump($meta);
+ var_dump(isset($meta['foo']) ? $meta['foo'] : null);
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+array(7) {
+ ["wrapper_type"]=>
+ string(7) "RFC2397"
+ ["stream_type"]=>
+ string(7) "RFC2397"
+ ["mode"]=>
+ string(1) "r"
+ ["unread_bytes"]=>
+ int(0)
+ ["seekable"]=>
+ bool(true)
+ ["uri"]=>
+ string(8) "data://,"
+ ["base64"]=>
+ bool(false)
+}
+NULL
+
+Warning: fopen(data://): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+array(7) {
+ ["wrapper_type"]=>
+ string(7) "RFC2397"
+ ["stream_type"]=>
+ string(7) "RFC2397"
+ ["mode"]=>
+ string(1) "r"
+ ["unread_bytes"]=>
+ int(0)
+ ["seekable"]=>
+ bool(true)
+ ["uri"]=>
+ string(15) "data://;base64,"
+ ["base64"]=>
+ bool(true)
+}
+NULL
+
+Warning: fopen(data://;base64): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+
+Warning: fopen(data://foo,): failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+
+Warning: fopen(data://foo=bar,): failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+array(8) {
+ ["wrapper_type"]=>
+ string(7) "RFC2397"
+ ["stream_type"]=>
+ string(7) "RFC2397"
+ ["mode"]=>
+ string(1) "r"
+ ["unread_bytes"]=>
+ int(0)
+ ["seekable"]=>
+ bool(true)
+ ["uri"]=>
+ string(18) "data://text/plain,"
+ ["mediatype"]=>
+ string(10) "text/plain"
+ ["base64"]=>
+ bool(false)
+}
+NULL
+
+Warning: fopen(data://text/plain;foo,): failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+array(9) {
+ ["wrapper_type"]=>
+ string(7) "RFC2397"
+ ["stream_type"]=>
+ string(7) "RFC2397"
+ ["mode"]=>
+ string(1) "r"
+ ["unread_bytes"]=>
+ int(0)
+ ["seekable"]=>
+ bool(true)
+ ["uri"]=>
+ string(26) "data://text/plain;foo=bar,"
+ ["mediatype"]=>
+ string(10) "text/plain"
+ ["foo"]=>
+ string(3) "bar"
+ ["base64"]=>
+ bool(false)
+}
+string(3) "bar"
+
+Warning: fopen(data://text/plain;foo=bar;bla,): failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+array(9) {
+ ["wrapper_type"]=>
+ string(7) "RFC2397"
+ ["stream_type"]=>
+ string(7) "RFC2397"
+ ["mode"]=>
+ string(1) "r"
+ ["unread_bytes"]=>
+ int(0)
+ ["seekable"]=>
+ bool(true)
+ ["uri"]=>
+ string(33) "data://text/plain;foo=bar;base64,"
+ ["mediatype"]=>
+ string(10) "text/plain"
+ ["foo"]=>
+ string(3) "bar"
+ ["base64"]=>
+ bool(true)
+}
+string(3) "bar"
+
+Warning: fopen(data://text/plain;foo=bar;bar=baz): failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d
+bool(false)
+NULL
+array(10) {
+ ["wrapper_type"]=>
+ string(7) "RFC2397"
+ ["stream_type"]=>
+ string(7) "RFC2397"
+ ["mode"]=>
+ string(1) "r"
+ ["unread_bytes"]=>
+ int(0)
+ ["seekable"]=>
+ bool(true)
+ ["uri"]=>
+ string(34) "data://text/plain;foo=bar;bar=baz,"
+ ["mediatype"]=>
+ string(10) "text/plain"
+ ["foo"]=>
+ string(3) "bar"
+ ["bar"]=>
+ string(3) "baz"
+ ["base64"]=>
+ bool(false)
+}
+string(3) "bar"
+===DONE===
diff --git a/ext/standard/tests/file/stream_rfc2397_003.gif b/ext/standard/tests/file/stream_rfc2397_003.gif
new file mode 100755
index 000000000..3dc4fc65f
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_003.gif
Binary files differ
diff --git a/ext/standard/tests/file/stream_rfc2397_003.phpt b/ext/standard/tests/file/stream_rfc2397_003.phpt
new file mode 100755
index 000000000..a4d019d18
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_003.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Stream: RFC2397 decoding data
+--FILE--
+<?php
+
+$streams = array(
+ 'data://,A%20brief%20note',
+ 'data://application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local',
+ 'data://;base64,Zm9vYmFyIGZvb2Jhcg==',
+ 'stream_rfc2397_003.gif' => 'data://image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw
+AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz
+ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp
+a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl
+ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis
+F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH
+hhx4dbgYKAAA7',
+ );
+
+foreach($streams as $original => $stream)
+{
+ if (is_string($original)) {
+ var_dump(file_get_contents(dirname(__FILE__) . '/' . $original) == file_get_contents($stream));
+ } else {
+ var_dump(file_get_contents($stream));
+ }
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(12) "A brief note"
+string(40) "select_vcount,fcol_from_fieldtable/local"
+string(13) "foobar foobar"
+bool(true)
+===DONE===
diff --git a/ext/standard/tests/file/stream_rfc2397_004.phpt b/ext/standard/tests/file/stream_rfc2397_004.phpt
new file mode 100755
index 000000000..ac7156476
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_004.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Stream: RFC2397 Mozilla tests
+--FILE--
+<?php
+
+$streams = array(
+ 'data://,;test',
+ 'data://text/plain,test',
+ 'data://text/plain;charset=US-ASCII,test',
+ 'data://;charset=UTF-8,Hello',
+ 'data://text/plain;charset=UTF-8,Hello',
+ 'data://,a,b',
+ );
+
+foreach($streams as $stream)
+{
+ var_dump(@file_get_contents($stream));
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(5) ";test"
+string(4) "test"
+string(4) "test"
+bool(false)
+string(5) "Hello"
+string(3) "a,b"
+===DONE=== \ No newline at end of file
diff --git a/ext/standard/tests/file/stream_rfc2397_005.phpt b/ext/standard/tests/file/stream_rfc2397_005.phpt
new file mode 100755
index 000000000..892af432b
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_005.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Stream: RFC2397 without //
+--FILE--
+<?php
+
+$streams = array(
+ 'data:,A%20brief%20note',
+ 'data:application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local',
+ 'data:;base64,Zm9vYmFyIGZvb2Jhcg==',
+ 'data:,;test',
+ 'data:text/plain,test',
+ 'data:text/plain;charset=US-ASCII,test',
+ 'data:;charset=UTF-8,Hello',
+ 'data:text/plain;charset=UTF-8,Hello',
+ 'data:,a,b',
+ );
+
+foreach($streams as $stream)
+{
+ var_dump(@file_get_contents($stream));
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(12) "A brief note"
+string(40) "select_vcount,fcol_from_fieldtable/local"
+string(13) "foobar foobar"
+string(5) ";test"
+string(4) "test"
+string(4) "test"
+bool(false)
+string(5) "Hello"
+string(3) "a,b"
+===DONE=== \ No newline at end of file
diff --git a/ext/standard/tests/file/stream_rfc2397_006.phpt b/ext/standard/tests/file/stream_rfc2397_006.phpt
new file mode 100755
index 000000000..06734fba3
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_006.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Stream: RFC2397 with corrupt? payload
+--FILE--
+<?php
+
+$streams = array(
+ "data:;base64,\0Zm9vYmFyIGZvb2Jhcg==",
+ "data:;base64,Zm9vYmFy\0IGZvb2Jhcg==",
+ 'data:;base64,#Zm9vYmFyIGZvb2Jhcg==',
+ 'data:;base64,#Zm9vYmFyIGZvb2Jhc=',
+ );
+
+foreach($streams as $stream)
+{
+ var_dump(file_get_contents($stream));
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(0) ""
+string(6) "foobar"
+string(13) "foobar foobar"
+
+Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhc=): failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d
+bool(false)
+===DONE===
diff --git a/ext/standard/tests/file/stream_rfc2397_007.phpt b/ext/standard/tests/file/stream_rfc2397_007.phpt
new file mode 100755
index 000000000..e4341526d
--- /dev/null
+++ b/ext/standard/tests/file/stream_rfc2397_007.phpt
@@ -0,0 +1,141 @@
+--TEST--
+Stream: RFC2397 and seeking
+--FILE--
+<?php
+
+$streams = array(
+ "data:,012345",
+ );
+
+foreach($streams as $stream)
+{
+ echo "===$stream===\n";
+
+ $fp = fopen($stream, 'rb');
+
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:4,S===\n";
+ var_dump(fseek($fp, 4));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===GETC===\n";
+ var_dump(fgetc($fp));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===GETC===\n";
+ var_dump(fgetc($fp));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===REWIND===\n";
+ var_dump(rewind($fp));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===GETC===\n";
+ var_dump(fgetc($fp));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:3,S===\n";
+ var_dump(fseek($fp, 3, SEEK_SET));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:1,C===\n";
+ var_dump(fseek($fp, 1, SEEK_CUR));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:-2,C===\n";
+ var_dump(fseek($fp, -2, SEEK_CUR));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:-10,C===\n";
+ var_dump(fseek($fp, -10, SEEK_CUR));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:3,S===\n";
+ var_dump(fseek($fp, 3, SEEK_SET));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:10,C===\n";
+ var_dump(fseek($fp, 10, SEEK_CUR));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:-1,E===\n";
+ var_dump(fseek($fp, -1, SEEK_END));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:0,E===\n";
+ var_dump(fseek($fp, 0, SEEK_END));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+ echo "===S:1,E===\n";
+ var_dump(fseek($fp, 1, SEEK_END));
+ var_dump(ftell($fp));
+ var_dump(feof($fp));
+
+ fclose($fp);
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+===data:,012345===
+int(0)
+bool(false)
+===S:4,S===
+int(0)
+int(4)
+bool(false)
+===GETC===
+string(1) "4"
+int(5)
+bool(false)
+===GETC===
+string(1) "5"
+int(6)
+bool(true)
+===REWIND===
+bool(true)
+int(0)
+bool(false)
+===GETC===
+string(1) "0"
+int(1)
+bool(false)
+===S:3,S===
+int(0)
+int(3)
+bool(false)
+===S:1,C===
+int(0)
+int(4)
+bool(false)
+===S:-2,C===
+int(0)
+int(2)
+bool(false)
+===S:-10,C===
+int(-1)
+bool(false)
+bool(false)
+===S:3,S===
+int(0)
+int(3)
+bool(false)
+===S:10,C===
+int(-1)
+bool(false)
+bool(false)
+===S:-1,E===
+int(0)
+int(5)
+bool(false)
+===S:0,E===
+int(0)
+int(6)
+bool(false)
+===S:1,E===
+int(-1)
+bool(false)
+bool(false)
+===DONE===
diff --git a/ext/standard/tests/filters/001.phpt b/ext/standard/tests/filters/001.phpt
new file mode 100644
index 000000000..afbcdcfdd
--- /dev/null
+++ b/ext/standard/tests/filters/001.phpt
@@ -0,0 +1,31 @@
+--TEST--
+stream_filter_register() and invalid arguments
+--FILE--
+<?php
+
+var_dump(stream_filter_register("", ""));
+var_dump(stream_filter_register("test", ""));
+var_dump(stream_filter_register("", "test"));
+var_dump(stream_filter_register("------", "nonexistentclass"));
+var_dump(stream_filter_register(array(), "aa"));
+var_dump(stream_filter_register("", array()));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: stream_filter_register(): Filter name cannot be empty in %s on line %d
+bool(false)
+
+Warning: stream_filter_register(): Class name cannot be empty in %s on line %d
+bool(false)
+
+Warning: stream_filter_register(): Filter name cannot be empty in %s on line %d
+bool(false)
+bool(true)
+
+Warning: stream_filter_register() expects parameter 1 to be string, array given in %s on line %d
+bool(false)
+
+Warning: stream_filter_register() expects parameter 2 to be string, array given in %s on line %d
+bool(false)
+Done
diff --git a/ext/standard/tests/filters/php_user_filter_01.phpt b/ext/standard/tests/filters/php_user_filter_01.phpt
new file mode 100644
index 000000000..534b9abf3
--- /dev/null
+++ b/ext/standard/tests/filters/php_user_filter_01.phpt
@@ -0,0 +1,17 @@
+--TEST--
+class php_user_filter#1
+--FILE--
+<?php
+class foo extends php_user_filter {
+ function filter($in, $out, &$consumed, $closing) {}
+ function onCreate() {}
+ function onClose() {}
+}
+class bar extends php_user_filter {
+ function filter($in, $out, &$consumed) {}
+ function onCreate() {}
+ function onClose() {}
+}
+?>
+--EXPECTF--
+Strict Standards: Declaration of bar::filter() should be compatible with that of php_user_filter::filter() in %s on line %d
diff --git a/ext/standard/tests/filters/php_user_filter_02.phpt b/ext/standard/tests/filters/php_user_filter_02.phpt
new file mode 100644
index 000000000..73a1f0267
--- /dev/null
+++ b/ext/standard/tests/filters/php_user_filter_02.phpt
@@ -0,0 +1,12 @@
+--TEST--
+class php_user_filter#2
+--FILE--
+<?php
+class foo extends php_user_filter {
+ function filter($in, $out, $consumed, $closing) {}
+ function onCreate() {}
+ function onClose() {}
+}
+?>
+--EXPECTF--
+Strict Standards: Declaration of foo::filter() should be compatible with that of php_user_filter::filter() in %s on line %d
diff --git a/ext/standard/tests/filters/php_user_filter_03.phpt b/ext/standard/tests/filters/php_user_filter_03.phpt
new file mode 100644
index 000000000..5962951ee
--- /dev/null
+++ b/ext/standard/tests/filters/php_user_filter_03.phpt
@@ -0,0 +1,12 @@
+--TEST--
+class php_user_filter#3
+--FILE--
+<?php
+class foo extends php_user_filter {
+ function filter($in, $out, &$consumed, $closing) {}
+ function onCreate($var) {}
+ function onClose() {}
+}
+?>
+--EXPECTF--
+Strict Standards: Declaration of foo::onCreate() should be compatible with that of php_user_filter::onCreate() in %s on line %d
diff --git a/ext/standard/tests/general_functions/010.phpt b/ext/standard/tests/general_functions/010.phpt
new file mode 100644
index 000000000..8d1075f84
--- /dev/null
+++ b/ext/standard/tests/general_functions/010.phpt
@@ -0,0 +1,25 @@
+--TEST--
+register_shutdown_function() & __call
+--FILE--
+<?php
+class test {
+ function _foo() {
+ throw new Exception('test');
+ }
+ function __call($name=null, $args=null) {
+ return test::_foo();
+ }
+}
+
+var_dump(register_shutdown_function(array("test","__call")));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Non-static method test::__call() cannot be called statically in %s on line %d
+NULL
+Done
+
+Strict Standards: Non-static method test::__call() cannot be called statically in Unknown on line 0
+
+Fatal error: Non-static method test::__call() cannot be called statically in Unknown on line 0
diff --git a/ext/standard/tests/general_functions/sunfuncts.phpt b/ext/standard/tests/general_functions/sunfuncts.phpt
index 8d32e7171..4d95c59ec 100644
--- a/ext/standard/tests/general_functions/sunfuncts.phpt
+++ b/ext/standard/tests/general_functions/sunfuncts.phpt
@@ -17,28 +17,28 @@ for($a=1;$a<=12;$a++){
echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_DOUBLE,31.76670,35.23330,90.83,2)."\n";
}
?>
---EXPECT--
-1041395864 06:37 6.629013145891
-1041432452 16:47 16.79245111439
-1044073855 06:30 6.515408927982
-1044112463 17:14 17.23987028904
-1046491495 06:04 6.082214503336
-1046533075 17:37 17.63201103534
-1049167581 05:26 5.439443811173
-1049212774 17:59 17.99303572948
-1051757532 04:52 4.870193412616
-1051806007 18:20 18.33539050867
-1054434776 04:32 4.548982718277
-1054485647 18:40 18.67981294906
-1057026949 04:35 4.597195637274
-1057078197 18:49 18.83256339675
-1059706409 04:53 4.891657508917
-1059755837 18:37 18.62144070428
-1062385999 05:13 5.222095112101
-1062432291 18:04 18.08095716848
-1064979098 05:31 5.527319921542
-1065021952 17:25 17.43133913592
-1067658845 05:54 5.901629287095
-1067698274 16:51 16.85390245352
-1070252387 06:19 6.329924268936
-1070289382 16:36 16.60631260094
+--EXPECTF--
+1041395864 06:37 6.6290131458%d
+1041432452 16:47 16.792451114%d
+1044073855 06:30 6.5154089279%d
+1044112463 17:14 17.239870289%d
+1046491495 06:04 6.0822145033%d
+1046533075 17:37 17.632011035%d
+1049167581 05:26 5.4394438111%d
+1049212774 17:59 17.993035729%d
+1051757532 04:52 4.8701934126%d
+1051806007 18:20 18.335390508%d
+1054434776 04:32 4.5489827182%d
+1054485647 18:40 18.679812949%d
+1057026949 04:35 4.5971956372%d
+1057078197 18:49 18.832563396%d
+1059706409 04:53 4.8916575089%d
+1059755837 18:37 18.621440704%d
+1062385999 05:13 5.2220951121%d
+1062432291 18:04 18.080957168%d
+1064979098 05:31 5.5273199215%d
+1065021952 17:25 17.431339135%d
+1067658845 05:54 5.9016292870%d
+1067698274 16:51 16.853902453%d
+1070252387 06:19 6.3299242689%d
+1070289382 16:36 16.606312600%d
diff --git a/ext/standard/tests/image/image_type_to_extension.phpt b/ext/standard/tests/image/image_type_to_extension.phpt
new file mode 100644
index 000000000..31bcfd612
--- /dev/null
+++ b/ext/standard/tests/image/image_type_to_extension.phpt
@@ -0,0 +1,103 @@
+--TEST--
+image_type_to_extension()
+--SKIPIF--
+<?php
+ if (!function_exists('image_type_to_extension')) die('skip image_type_to_extension() not available');
+ require_once('skipif_imagetype.inc');
+?>
+--FILE--
+<?php
+ $constants = array(
+ "IMAGETYPE_GIF" => IMAGETYPE_GIF,
+ "IMAGETYPE_JPEG" => IMAGETYPE_JPEG,
+ "IMAGETYPE_PNG" => IMAGETYPE_PNG,
+ "IMAGETYPE_SWF" => IMAGETYPE_SWF,
+ "IMAGETYPE_PSD" => IMAGETYPE_PSD,
+ "IMAGETYPE_BMP" => IMAGETYPE_BMP,
+ "IMAGETYPE_TIFF_II" => IMAGETYPE_TIFF_II,
+ "IMAGETYPE_TIFF_MM" => IMAGETYPE_TIFF_MM,
+ "IMAGETYPE_JPC" => IMAGETYPE_JPC,
+ "IMAGETYPE_JP2" => IMAGETYPE_JP2,
+ "IMAGETYPE_JPX" => IMAGETYPE_JPX,
+ "IMAGETYPE_JB2" => IMAGETYPE_JB2,
+ "IMAGETYPE_IFF" => IMAGETYPE_IFF,
+ "IMAGETYPE_WBMP" => IMAGETYPE_WBMP,
+ "IMAGETYPE_JPEG2000" => IMAGETYPE_JPEG2000,
+ "IMAGETYPE_XBM" => IMAGETYPE_XBM
+ );
+ foreach($constants as $name => $constant) {
+ printf("Constant: %s\n\tWith dot: %s\n\tWithout dot: %s\n", $name, image_type_to_extension($constant), image_type_to_extension($constant, false));
+ }
+
+ var_dump(image_type_to_extension(-1, array()));
+ var_dump(image_type_to_extension(new stdclass));
+ var_dump(image_type_to_extension(1000000, NULL));
+ var_dump(image_type_to_extension());
+ var_dump(image_type_to_extension(0));
+ var_dump(image_type_to_extension(0, 0, 0));
+?>
+Done
+--EXPECTF--
+Constant: IMAGETYPE_GIF
+ With dot: .gif
+ Without dot: gif
+Constant: IMAGETYPE_JPEG
+ With dot: .jpeg
+ Without dot: jpeg
+Constant: IMAGETYPE_PNG
+ With dot: .png
+ Without dot: png
+Constant: IMAGETYPE_SWF
+ With dot: .swf
+ Without dot: swf
+Constant: IMAGETYPE_PSD
+ With dot: .psd
+ Without dot: psd
+Constant: IMAGETYPE_BMP
+ With dot: .bmp
+ Without dot: bmp
+Constant: IMAGETYPE_TIFF_II
+ With dot: .tiff
+ Without dot: tiff
+Constant: IMAGETYPE_TIFF_MM
+ With dot: .tiff
+ Without dot: tiff
+Constant: IMAGETYPE_JPC
+ With dot: .jpc
+ Without dot: jpc
+Constant: IMAGETYPE_JP2
+ With dot: .jp2
+ Without dot: jp2
+Constant: IMAGETYPE_JPX
+ With dot: .jpx
+ Without dot: jpx
+Constant: IMAGETYPE_JB2
+ With dot: .jb2
+ Without dot: jb2
+Constant: IMAGETYPE_IFF
+ With dot: .iff
+ Without dot: iff
+Constant: IMAGETYPE_WBMP
+ With dot: .bmp
+ Without dot: bmp
+Constant: IMAGETYPE_JPEG2000
+ With dot: .jpc
+ Without dot: jpc
+Constant: IMAGETYPE_XBM
+ With dot: .xbm
+ Without dot: xbm
+
+Warning: image_type_to_extension() expects parameter 2 to be boolean, array given in %s on line %d
+bool(false)
+
+Warning: image_type_to_extension() expects parameter 1 to be long, object given in %s on line %d
+bool(false)
+bool(false)
+
+Warning: image_type_to_extension() expects at least 1 parameter, 0 given in %s on line %d
+bool(false)
+bool(false)
+
+Warning: image_type_to_extension() expects at most 2 parameters, 3 given in %s on line %d
+bool(false)
+Done
diff --git a/ext/standard/tests/math/constants.phpt b/ext/standard/tests/math/constants.phpt
new file mode 100644
index 000000000..7b5110f53
--- /dev/null
+++ b/ext/standard/tests/math/constants.phpt
@@ -0,0 +1,46 @@
+--TEST--
+Math constants
+--FILE--
+<?php
+$constants = array(
+ "M_E",
+ "M_LOG2E",
+ "M_LOG10E",
+ "M_LN2",
+ "M_LN10",
+ "M_PI",
+ "M_PI_2",
+ "M_PI_4",
+ "M_1_PI",
+ "M_2_PI",
+ "M_SQRTPI",
+ "M_2_SQRTPI",
+ "M_LNPI",
+ "M_EULER",
+ "M_SQRT2",
+ "M_SQRT1_2",
+ "M_SQRT3"
+);
+foreach($constants as $constant) {
+ printf("%-10s: %s\n", $constant, constant($constant));
+}
+?>
+--EXPECTREGEX--
+M_E : 2.718281[0-9]*
+M_LOG2E : 1.442695[0-9]*
+M_LOG10E : 0.434294[0-9]*
+M_LN2 : 0.693147[0-9]*
+M_LN10 : 2.302585[0-9]*
+M_PI : 3.141592[0-9]*
+M_PI_2 : 1.570796[0-9]*
+M_PI_4 : 0.785398[0-9]*
+M_1_PI : 0.318309[0-9]*
+M_2_PI : 0.636619[0-9]*
+M_SQRTPI : 1.772453[0-9]*
+M_2_SQRTPI: 1.128379[0-9]*
+M_LNPI : 1.144729[0-9]*
+M_EULER : 0.577215[0-9]*
+M_SQRT2 : 1.414213[0-9]*
+M_SQRT1_2 : 0.707106[0-9]*
+M_SQRT3 : 1.732050[0-9]*
+
diff --git a/ext/standard/tests/serialize/bug37947.phpt b/ext/standard/tests/serialize/bug37947.phpt
new file mode 100755
index 000000000..89641635c
--- /dev/null
+++ b/ext/standard/tests/serialize/bug37947.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #37947 (zend_ptr_stack reallocation problem)
+--INI--
+error_reporting=0
+--FILE--
+<?php
+class test {
+ function extend_zend_ptr_stack($count,$a,$b,$c,$d,$e) {
+ if ($count>0) $this->extend_zend_ptr_stack($count -
+1,$a,$b,$c,$d,$e);
+ }
+
+ function __wakeup() {
+ $this->extend_zend_ptr_stack(10,'a','b','c','d','e');
+ }
+}
+
+$str='a:2:{i:0;O:4:"test":0:{}junk';
+var_dump(unserialize($str));
+--EXPECT--
+bool(false)
diff --git a/ext/standard/tests/strings/bug22224.phpt b/ext/standard/tests/strings/bug22224.phpt
index d64fc0acf..c30f222f3 100644
--- a/ext/standard/tests/strings/bug22224.phpt
+++ b/ext/standard/tests/strings/bug22224.phpt
@@ -4,7 +4,12 @@ Bug #22224 (implode changes object references in array)
error_reporting=0
--FILE--
<?php
-class foo {
+class foo
+{
+ function __toString()
+ {
+ return "Object";
+ }
}
diff --git a/ext/standard/tests/strings/bug24098.phpt b/ext/standard/tests/strings/bug24098.phpt
index 9ff51a420..1998d9ed0 100644
--- a/ext/standard/tests/strings/bug24098.phpt
+++ b/ext/standard/tests/strings/bug24098.phpt
@@ -7,11 +7,13 @@ Bug #24098 (pathinfo() crash)
var_dump(pathinfo("/dsds.asa"));
?>
--EXPECT--
-array(3) {
+array(4) {
["dirname"]=>
string(1) "/"
["basename"]=>
string(8) "dsds.asa"
["extension"]=>
string(3) "asa"
+ ["filename"]=>
+ string(4) "dsds"
}
diff --git a/ext/standard/tests/strings/bug29538.phpt b/ext/standard/tests/strings/bug29538.phpt
new file mode 100644
index 000000000..6af25fb89
--- /dev/null
+++ b/ext/standard/tests/strings/bug29538.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #29538 (number_format and problem with 0)
+--FILE--
+<?php
+ echo number_format(0.25, 2, '', ''), "\n";
+ echo number_format(1234, 2, '', ',');
+?>
+--EXPECT--
+025
+1,23400
diff --git a/ext/standard/tests/strings/bug37244.phpt b/ext/standard/tests/strings/bug37244.phpt
new file mode 100644
index 000000000..0718c8a4d
--- /dev/null
+++ b/ext/standard/tests/strings/bug37244.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #37244 (base64_decode violates RFC 3548)
+--FILE--
+<?php
+$strings = array(
+ 'SW1wbGVtZW50YXRpb25zIE1VU1QgcmVqZWN0IHRoZSBlbmNvZGluZyBpZiBpdCBjb250YWlucyBjaGFyYWN0ZXJzIG91dHNpZGUgdGhlIGJhc2UgYWxwaGFiZXQu',
+ 'SW1wbGVtZW$0YXRpb25zIE1VU1QgcmVqZWN0IHRoZSBlbmNvZGluZyBpZiBpdCBjb250YWlucyBjaGFyYWN0ZXJzIG91dHNpZGUgdGhlIGJhc2UgYWxwaGFiZXQu',
+ 'SW1wbGVtZW0YXRpb25zIE1VU1QgcmVqZWN0IHRoZSBlbmNvZGluZyBpZiBpdCBjb250YWlucyBjaGFyYWN0ZXJzIG91dHNpZGUgdGhlIGJhc2UgYWxwaGFiZXQu'
+);
+foreach($strings as $string) {
+ var_dump(base64_decode($string, true));
+}
+?>
+--EXPECT--
+string(93) "Implementations MUST reject the encoding if it contains characters outside the base alphabet."
+bool(false)
+string(92) "Implemem][ÛœÈUTÕ™Z™XÝH[˜ÛÙ[™ÈYˆ]ÛÛZ[œÈÚ\˜XÝ\œÈÝ]ÚYHH˜\ÙH[X™] "
+
diff --git a/ext/standard/tests/strings/bug37262.phpt b/ext/standard/tests/strings/bug37262.phpt
new file mode 100644
index 000000000..474251a81
--- /dev/null
+++ b/ext/standard/tests/strings/bug37262.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Bug #37262 (var_export() does not escape \0 character)
+--FILE--
+<?php
+$func = create_function('$a', 'return $a;');
+var_export($func);
+?>
+--EXPECT--
+'\000lambda_1'
diff --git a/ext/standard/tests/strings/bug38322.phpt b/ext/standard/tests/strings/bug38322.phpt
new file mode 100644
index 000000000..37f5a93f6
--- /dev/null
+++ b/ext/standard/tests/strings/bug38322.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #38322 (reading past array in sscanf() leads to segfault/arbitary code execution)
+--FILE--
+<?php
+
+$str = "a b c d e";
+var_dump(sscanf("a ",'%1$s',$str));
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(1)
+Done
diff --git a/ext/standard/tests/strings/bug39032.phpt b/ext/standard/tests/strings/bug39032.phpt
new file mode 100644
index 000000000..dbd39ec9d
--- /dev/null
+++ b/ext/standard/tests/strings/bug39032.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #39032 (strcspn() stops on null character)
+--FILE--
+<?php
+
+var_dump(strcspn(chr(0),"x"));
+var_dump(strcspn(chr(0),""));
+var_dump(strcspn(chr(0),"qweqwe"));
+var_dump(strcspn(chr(1),"qweqwe"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(1)
+int(0)
+int(1)
+int(1)
+Done
diff --git a/ext/standard/tests/strings/explode.phpt b/ext/standard/tests/strings/explode.phpt
index 1198a09a9..defb79c22 100644
--- a/ext/standard/tests/strings/explode.phpt
+++ b/ext/standard/tests/strings/explode.phpt
@@ -29,7 +29,7 @@ var_dump(explode(":^:","a lazy dog:^:jumps::over:^:",-1));
var_dump(explode(":^:","a lazy dog:^:jumps::over:^:",-2));
?>
--EXPECTF--
-26d4e18734cb2582df5055e2175223df
+6e5d59d5afd6693547a733219d079658
bool(false)
bool(false)
bool(false)
diff --git a/ext/standard/tests/strings/htmlentities15.phpt b/ext/standard/tests/strings/htmlentities15.phpt
index a0e534aba..2dc36e6f7 100644
--- a/ext/standard/tests/strings/htmlentities15.phpt
+++ b/ext/standard/tests/strings/htmlentities15.phpt
@@ -6,14 +6,14 @@ default_charset=
mbstring.internal_encoding=none
--SKIPIF--
<?php
-$result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r");
+$result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R");
if (!$result || preg_match('/koi8/i', setlocale(LC_CTYPE, 0)) == 0) {
die("skip setlocale() failed\n");
}
?>
--FILE--
<?php
-setlocale(LC_CTYPE, "ru_RU.koi8r");
+setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R");
$str = "ÒÏÓËÏÛÎÙÊ";
var_dump($str, htmlentities($str, ENT_QUOTES, ''));
?>
diff --git a/ext/standard/tests/strings/implode1.phpt b/ext/standard/tests/strings/implode1.phpt
new file mode 100644
index 000000000..1582c2516
--- /dev/null
+++ b/ext/standard/tests/strings/implode1.phpt
@@ -0,0 +1,59 @@
+--TEST--
+implode() and various args
+--FILE--
+<?php
+
+$a = array(
+ array(1,2),
+ array(1.1,2.2),
+ array(array(2),array(1)),
+ array(false,true),
+ );
+
+foreach ($a as $val) {
+ var_dump(implode(', ', $val));
+ var_dump($val);
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(4) "1, 2"
+array(2) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+}
+string(8) "1.1, 2.2"
+array(2) {
+ [0]=>
+ float(1.1)
+ [1]=>
+ float(2.2)
+}
+
+Notice: Array to string conversion in %s on line %d
+
+Notice: Array to string conversion in %s on line %d
+string(12) "Array, Array"
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ int(1)
+ }
+}
+string(3) ", 1"
+array(2) {
+ [0]=>
+ bool(false)
+ [1]=>
+ bool(true)
+}
+Done
diff --git a/ext/standard/tests/strings/pathinfo.phpt b/ext/standard/tests/strings/pathinfo.phpt
new file mode 100644
index 000000000..c1d58f05b
--- /dev/null
+++ b/ext/standard/tests/strings/pathinfo.phpt
@@ -0,0 +1,108 @@
+--TEST--
+pathinfo() tests
+--FILE--
+<?php
+
+var_dump(pathinfo());
+var_dump(pathinfo(""));
+var_dump(pathinfo("."));
+var_dump(pathinfo(".."));
+var_dump(pathinfo("/"));
+var_dump(pathinfo("./"));
+var_dump(pathinfo("/."));
+var_dump(pathinfo(".cvsignore"));
+var_dump(pathinfo(__FILE__, PATHINFO_BASENAME));
+var_dump(pathinfo(__FILE__, PATHINFO_FILENAME));
+var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION));
+var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME));
+var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME));
+var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_BASENAME));
+var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME));
+var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_BASENAME));
+var_dump(pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_DIRNAME));
+var_dump(pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_BASENAME));
+var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_EXTENSION));
+var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_BASENAME));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: pathinfo() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+array(2) {
+ ["basename"]=>
+ string(0) ""
+ ["filename"]=>
+ string(0) ""
+}
+array(4) {
+ ["dirname"]=>
+ string(1) "."
+ ["basename"]=>
+ string(1) "."
+ ["extension"]=>
+ string(0) ""
+ ["filename"]=>
+ string(0) ""
+}
+array(4) {
+ ["dirname"]=>
+ string(1) "."
+ ["basename"]=>
+ string(2) ".."
+ ["extension"]=>
+ string(0) ""
+ ["filename"]=>
+ string(1) "."
+}
+array(3) {
+ ["dirname"]=>
+ string(1) "/"
+ ["basename"]=>
+ string(0) ""
+ ["filename"]=>
+ string(0) ""
+}
+array(4) {
+ ["dirname"]=>
+ string(1) "."
+ ["basename"]=>
+ string(1) "."
+ ["extension"]=>
+ string(0) ""
+ ["filename"]=>
+ string(0) ""
+}
+array(4) {
+ ["dirname"]=>
+ string(1) "/"
+ ["basename"]=>
+ string(1) "."
+ ["extension"]=>
+ string(0) ""
+ ["filename"]=>
+ string(0) ""
+}
+array(4) {
+ ["dirname"]=>
+ string(1) "."
+ ["basename"]=>
+ string(10) ".cvsignore"
+ ["extension"]=>
+ string(9) "cvsignore"
+ ["filename"]=>
+ string(0) ""
+}
+string(12) "pathinfo.php"
+string(8) "pathinfo"
+string(3) "php"
+string(%d) "%s/strings"
+string(%d) "%s/strings"
+string(12) "pathinfo.php"
+string(3) "php"
+string(12) "pathinfo.php"
+string(%d) "%s/strings"
+string(12) "pathinfo.php"
+string(%d) "%s/strings"
+string(%d) "%s/strings"
+Done
diff --git a/ext/standard/tests/strings/str_replace.phpt b/ext/standard/tests/strings/str_replace.phpt
new file mode 100644
index 000000000..46d732a69
--- /dev/null
+++ b/ext/standard/tests/strings/str_replace.phpt
@@ -0,0 +1,108 @@
+--TEST--
+str_replace() tests
+--FILE--
+<?php
+
+var_dump(str_replace("", "", ""));
+
+var_dump(str_replace("e", "b", "test"));
+
+var_dump(str_replace("", "", "", $count));
+var_dump($count);
+
+var_dump(str_replace("q", "q", "q", $count));
+var_dump($count);
+
+var_dump(str_replace("long string here", "", "", $count));
+var_dump($count);
+
+var_dump(str_replace(chr(0), "a", "", $count));
+var_dump($count);
+
+var_dump(str_replace(chr(0), "a", chr(0), $count));
+var_dump($count);
+
+var_dump(str_replace("multi", "a", "aaa", $count));
+var_dump($count);
+
+var_dump(str_replace("a", "multi", "aaa", $count));
+var_dump($count);
+
+var_dump(str_replace(array("a", "a", "b"), "multi", "aaa", $count));
+var_dump($count);
+
+var_dump(str_replace(array("a", "a", "b"), array("q", "q", "c"), "aaa", $count));
+var_dump($count);
+
+var_dump(str_replace(array("a", "a", "b"), array("q", "q", "c"), array("aaa", "bbb"), $count));
+var_dump($count);
+
+var_dump(str_replace("a", array("q", "q", "c"), array("aaa", "bbb"), $count));
+var_dump($count);
+
+var_dump(str_replace("a", 1, array("aaa", "bbb"), $count));
+var_dump($count);
+
+var_dump(str_replace(1, 3, array("aaa1", "2bbb"), $count));
+var_dump($count);
+
+$fp = fopen(__FILE__, "r");
+var_dump(str_replace($fp, $fp, $fp, $fp));
+var_dump($fp);
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(0) ""
+string(4) "tbst"
+string(0) ""
+int(0)
+string(1) "q"
+int(1)
+string(0) ""
+int(0)
+string(0) ""
+int(0)
+string(1) "a"
+int(1)
+string(3) "aaa"
+int(0)
+string(15) "multimultimulti"
+int(3)
+string(15) "multimultimulti"
+int(3)
+string(3) "qqq"
+int(3)
+array(2) {
+ [0]=>
+ string(3) "qqq"
+ [1]=>
+ string(3) "ccc"
+}
+int(6)
+
+Notice: Array to string conversion in %s on line %d
+array(2) {
+ [0]=>
+ string(15) "ArrayArrayArray"
+ [1]=>
+ string(3) "bbb"
+}
+int(3)
+array(2) {
+ [0]=>
+ string(3) "111"
+ [1]=>
+ string(3) "bbb"
+}
+int(3)
+array(2) {
+ [0]=>
+ string(4) "aaa3"
+ [1]=>
+ string(4) "2bbb"
+}
+int(1)
+string(%d) "Resource id #%d"
+int(1)
+Done
diff --git a/ext/standard/tests/strings/str_word_count.phpt b/ext/standard/tests/strings/str_word_count.phpt
index 9d41fc147..11e1bb65e 100644
--- a/ext/standard/tests/strings/str_word_count.phpt
+++ b/ext/standard/tests/strings/str_word_count.phpt
@@ -12,7 +12,7 @@ var_dump(str_word_count($str));
var_dump(str_word_count($str, 3));
var_dump(str_word_count($str, 123));
var_dump(str_word_count($str, -1));
-var_dump(str_word_count($str, 99999999999999999));
+var_dump(str_word_count($str, 999999999));
var_dump(str_word_count($str, array()));
var_dump(str_word_count($str, $b));
var_dump($str);
@@ -41,6 +41,8 @@ var_dump(str_word_count("'foo'", 2));
var_dump(str_word_count("'foo'", 2, "'"));
var_dump(str_word_count("-foo-", 2));
var_dump(str_word_count("-foo-", 2, "-"));
+
+echo "Done\n";
?>
--EXPECTF--
array(6) {
@@ -72,19 +74,23 @@ array(6) {
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: str_word_count(): Invalid format value 3 in %s on line %d
+bool(false)
-Warning: Wrong parameter count for str_word_count() in %s on line 13
-NULL
+Warning: str_word_count(): Invalid format value 123 in %s on line %d
+bool(false)
-Warning: str_word_count() expects parameter 2 to be long, string given in %s on line 14
+Warning: str_word_count(): Invalid format value -1 in %s on line %d
+bool(false)
-Warning: Wrong parameter count for str_word_count() in %s on line 14
+Warning: str_word_count(): Invalid format value 999999999 in %s on line %d
+bool(false)
+
+Warning: str_word_count() expects parameter 2 to be long, array given in %s on line %d
+NULL
+
+Warning: str_word_count() expects parameter 2 to be long, string given in %s on line %d
NULL
string(55) "Hello friend, you're
looking good today!"
@@ -92,14 +98,10 @@ int(5)
int(6)
int(5)
-Warning: str_word_count() expects parameter 3 to be string, array given in %s on line 21
-
-Warning: Wrong parameter count for str_word_count() in %s on line 21
+Warning: str_word_count() expects parameter 3 to be string, array given in %s on line %d
NULL
-Warning: str_word_count() expects parameter 3 to be string, object given in %s on line 22
-
-Warning: Wrong parameter count for str_word_count() in %s on line 22
+Warning: str_word_count() expects parameter 3 to be string, object given in %s on line %d
NULL
int(7)
array(5) {
@@ -141,14 +143,10 @@ array(5) {
string(3) "foo"
}
-Warning: str_word_count() expects parameter 3 to be string, array given in %s on line 27
-
-Warning: Wrong parameter count for str_word_count() in %s on line 27
+Warning: str_word_count() expects parameter 3 to be string, array given in %s on line %d
NULL
-Warning: str_word_count() expects parameter 3 to be string, object given in %s on line 28
-
-Warning: Wrong parameter count for str_word_count() in %s on line 28
+Warning: str_word_count() expects parameter 3 to be string, object given in %s on line %d
NULL
array(7) {
[0]=>
@@ -205,14 +203,10 @@ array(5) {
string(3) "foo"
}
-Warning: str_word_count() expects parameter 3 to be string, array given in %s on line 33
-
-Warning: Wrong parameter count for str_word_count() in %s on line 33
+Warning: str_word_count() expects parameter 3 to be string, array given in %s on line %d
NULL
-Warning: str_word_count() expects parameter 3 to be string, object given in %s on line 34
-
-Warning: Wrong parameter count for str_word_count() in %s on line 34
+Warning: str_word_count() expects parameter 3 to be string, object given in %s on line %d
NULL
array(7) {
[0]=>
@@ -252,3 +246,4 @@ array(1) {
[0]=>
string(5) "-foo-"
}
+Done
diff --git a/ext/standard/tests/strings/str_word_count1.phpt b/ext/standard/tests/strings/str_word_count1.phpt
new file mode 100644
index 000000000..5f49fcfbf
--- /dev/null
+++ b/ext/standard/tests/strings/str_word_count1.phpt
@@ -0,0 +1,26 @@
+--TEST--
+str_word_count() and invalid arguments
+--FILE--
+<?php
+
+var_dump(str_word_count(""));
+var_dump(str_word_count("", -1));
+var_dump(str_word_count("", -1, $a));
+var_dump($a);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(0)
+
+Warning: str_word_count(): Invalid format value -1 in %s on line %d
+bool(false)
+
+Notice: Undefined variable: a in %s on line %d
+
+Warning: str_word_count(): Invalid format value -1 in %s on line %d
+bool(false)
+
+Notice: Undefined variable: a in %s on line %d
+NULL
+Done
diff --git a/ext/standard/tests/strings/strings001.phpt b/ext/standard/tests/strings/strings001.phpt
index 87f8489b8..70b709295 100644
--- a/ext/standard/tests/strings/strings001.phpt
+++ b/ext/standard/tests/strings/strings001.phpt
@@ -9,4 +9,4 @@ var_dump(strrchr($s," nic"));
?>
--EXPECTREGEX--
string\(18\) \"nica\x00turska panica\"
-string\(19\) \" nica\x00turska panica\"
+string\(7\) \" panica\"
diff --git a/ext/standard/tests/strings/stripos.phpt b/ext/standard/tests/strings/stripos.phpt
new file mode 100644
index 000000000..ef0efe5b2
--- /dev/null
+++ b/ext/standard/tests/strings/stripos.phpt
@@ -0,0 +1,55 @@
+--TEST--
+stripos() function test
+--FILE--
+<?php
+ var_dump(stripos("test string", "TEST"));
+ var_dump(stripos("test string", "strIng"));
+ var_dump(stripos("test string", "stRin"));
+ var_dump(stripos("test string", "t S"));
+ var_dump(stripos("test string", "G"));
+ var_dump(stripos("te".chr(0)."st", chr(0)));
+ var_dump(stripos("tEst", "test"));
+ var_dump(stripos("teSt", "test"));
+ var_dump(stripos("", ""));
+ var_dump(stripos("a", ""));
+ var_dump(stripos("", "a"));
+ var_dump(stripos("a", " "));
+ var_dump(stripos("a", "a"));
+ var_dump(stripos("", 1));
+ var_dump(stripos("", false));
+ var_dump(stripos("", true));
+ var_dump(stripos("a", 1));
+ var_dump(stripos("a", false));
+ var_dump(stripos("a", true));
+ var_dump(stripos("1", 1));
+ var_dump(stripos("0", false));
+ var_dump(stripos("1", true));
+ var_dump(stripos("\\\\a", "\\a"));
+
+ echo "Done\n";
+?>
+--EXPECT--
+int(0)
+int(5)
+int(5)
+int(3)
+int(10)
+int(2)
+int(0)
+int(0)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+int(0)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+int(1)
+Done
diff --git a/ext/standard/tests/strings/strrchr.phpt b/ext/standard/tests/strings/strrchr.phpt
new file mode 100644
index 000000000..5a1fe12a8
--- /dev/null
+++ b/ext/standard/tests/strings/strrchr.phpt
@@ -0,0 +1,22 @@
+--TEST--
+strrchr() tests
+--FILE--
+<?php
+
+var_dump(strrchr("", ""));
+var_dump(strrchr("abc", ""));
+var_dump(strrchr("", "abc"));
+var_dump(strrchr("abc", "abc"));
+var_dump(strrchr("test ".chr(0)." test", " "));
+var_dump(strrchr("test".chr(0)."string", "t"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(false)
+bool(false)
+bool(false)
+string(3) "abc"
+string(5) " test"
+string(5) "tring"
+Done
diff --git a/ext/standard/tests/strings/url_t.phpt b/ext/standard/tests/strings/url_t.phpt
index 2d18fa5c0..e0e541103 100644
--- a/ext/standard/tests/strings/url_t.phpt
+++ b/ext/standard/tests/strings/url_t.phpt
@@ -71,6 +71,7 @@ $sample_urls = array (
'scheme:',
'foo+bar://baz@bang/bla',
'gg:9130731',
+'http://user:@pass@host/path?argument?value#etc',
);
foreach ($sample_urls as $url) {
@@ -525,11 +526,11 @@ array(7) {
["scheme"]=>
string(4) "http"
["host"]=>
- string(19) "hideout@www.php.net"
+ string(11) "www.php.net"
["port"]=>
int(80)
["user"]=>
- string(6) "secret"
+ string(14) "secret@hideout"
["path"]=>
string(10) "/index.php"
["query"]=>
@@ -685,6 +686,22 @@ array(2) {
["path"]=>
string(7) "9130731"
}
+array(7) {
+ ["scheme"]=>
+ string(4) "http"
+ ["host"]=>
+ string(4) "host"
+ ["user"]=>
+ string(4) "user"
+ ["pass"]=>
+ string(5) "@pass"
+ ["path"]=>
+ string(5) "/path"
+ ["query"]=>
+ string(14) "argument?value"
+ ["fragment"]=>
+ string(3) "etc"
+}
string(4) "http"
string(11) "www.php.net"
int(80)
diff --git a/ext/standard/tests/time/bug38524.phpt b/ext/standard/tests/time/bug38524.phpt
new file mode 100755
index 000000000..e9ccaaf38
--- /dev/null
+++ b/ext/standard/tests/time/bug38524.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #38524 (strptime() does not initialize the internal date storage structure)
+--FILE--
+<?php
+ var_dump(strptime('2006-08-20', '%Y-%m-%d'));
+?>
+===DONE===
+--EXPECTF--
+array(9) {
+ ["tm_sec"]=>
+ int(0)
+ ["tm_min"]=>
+ int(0)
+ ["tm_hour"]=>
+ int(0)
+ ["tm_mday"]=>
+ int(20)
+ ["tm_mon"]=>
+ int(7)
+ ["tm_year"]=>
+ int(106)
+ ["tm_wday"]=>
+ int(0)
+ ["tm_yday"]=>
+ int(%d)
+ ["unparsed"]=>
+ string(0) ""
+}
+===DONE===
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 09da50aef..26662b2cb 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -15,7 +15,7 @@
| Author: Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: url.c,v 1.86.2.5 2006/02/12 16:39:44 iliaa Exp $ */
+/* $Id: url.c,v 1.86.2.5.2.6 2006/09/28 14:52:30 iliaa Exp $ */
#include <stdlib.h>
#include <string.h>
@@ -211,7 +211,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
}
/* check for login and password */
- if ((p = memchr(s, '@', (e-s)))) {
+ if ((p = zend_memrchr(s, '@', (e-s)))) {
if ((pp = memchr(s, ':', (p-s)))) {
if ((pp-s) > 0) {
ret->user = estrndup(s, (pp-s));
@@ -344,7 +344,7 @@ PHP_FUNCTION(parse_url)
resource = php_url_parse_ex(str, str_len);
if (resource == NULL) {
- php_error_docref1(NULL TSRMLS_CC, str, E_WARNING, "Unable to parse url");
+ php_error_docref1(NULL TSRMLS_CC, str, E_WARNING, "Unable to parse URL");
RETURN_FALSE;
}
@@ -375,7 +375,7 @@ PHP_FUNCTION(parse_url)
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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL component identifier %ld.", key);
RETVAL_FALSE;
}
goto done;
@@ -653,7 +653,7 @@ PHPAPI int php_raw_url_decode(char *str, int len)
}
/* }}} */
-/* {{{ proto array get_headers(string url)
+/* {{{ proto array get_headers(string url[, int format])
fetches all the headers sent by the server in response to a HTTP request */
PHP_FUNCTION(get_headers)
{
@@ -661,8 +661,9 @@ PHP_FUNCTION(get_headers)
int url_len;
php_stream_context *context;
php_stream *stream;
- zval **prev_val, **hdr = NULL;
+ zval **prev_val, **hdr = NULL, **h;
HashPosition pos;
+ HashTable *hashT;
long format = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) {
@@ -674,10 +675,31 @@ PHP_FUNCTION(get_headers)
RETURN_FALSE;
}
+ if (!stream->wrapperdata || Z_TYPE_P(stream->wrapperdata) != IS_ARRAY) {
+ php_stream_close(stream);
+ 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) {
+ /* check for curl-wrappers that provide headers via a special "headers" element */
+ if (zend_hash_find(HASH_OF(stream->wrapperdata), "headers", sizeof("headers"), (void **)&h) != FAILURE && Z_TYPE_PP(h) == IS_ARRAY) {
+ /* curl-wrappers don't load data until the 1st read */
+ if (!Z_ARRVAL_PP(h)->nNumOfElements) {
+ php_stream_getc(stream);
+ }
+ zend_hash_find(HASH_OF(stream->wrapperdata), "headers", sizeof("headers"), (void **)&h);
+ hashT = Z_ARRVAL_PP(h);
+ } else {
+ hashT = HASH_OF(stream->wrapperdata);
+ }
+
+ zend_hash_internal_pointer_reset_ex(hashT, &pos);
+ while (zend_hash_get_current_data_ex(hashT, (void**)&hdr, &pos) != FAILURE) {
+ if (!hdr || Z_TYPE_PP(hdr) != IS_STRING) {
+ zend_hash_move_forward_ex(hashT, &pos);
+ continue;
+ }
if (!format) {
no_name_header:
add_next_index_stringl(return_value, Z_STRVAL_PP(hdr), Z_STRLEN_PP(hdr), 1);
@@ -705,7 +727,7 @@ no_name_header:
goto no_name_header;
}
}
- zend_hash_move_forward_ex(HASH_OF(stream->wrapperdata), &pos);
+ zend_hash_move_forward_ex(hashT, &pos);
}
php_stream_close(stream);
diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c
index cffc28dda..8304168c9 100644
--- a/ext/standard/user_filters.c
+++ b/ext/standard/user_filters.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: user_filters.c,v 1.31.2.4 2006/03/30 21:10:23 tony2001 Exp $ */
+/* $Id: user_filters.c,v 1.31.2.4.2.2 2006/10/11 14:46:40 tony2001 Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -54,11 +54,26 @@ static int le_bucket;
PHP_FUNCTION(user_filter_nop)
{
}
+static
+ZEND_BEGIN_ARG_INFO(arginfo_php_user_filter_filter, 0)
+ ZEND_ARG_INFO(0, in)
+ ZEND_ARG_INFO(0, out)
+ ZEND_ARG_INFO(1, consumed)
+ ZEND_ARG_INFO(0, closing)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_php_user_filter_onCreate, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_php_user_filter_onClose, 0)
+ZEND_END_ARG_INFO()
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)
+ PHP_NAMED_FE(filter, PHP_FN(user_filter_nop), arginfo_php_user_filter_filter)
+ PHP_NAMED_FE(onCreate, PHP_FN(user_filter_nop), arginfo_php_user_filter_onCreate)
+ PHP_NAMED_FE(onClose, PHP_FN(user_filter_nop), arginfo_php_user_filter_onClose)
{ NULL, NULL, NULL }
};
@@ -75,11 +90,14 @@ static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
PHP_MINIT_FUNCTION(user_filters)
{
+ zend_class_entry *php_user_filter;
/* 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)) {
+ if ((php_user_filter = zend_register_internal_class(&user_filter_class_entry TSRMLS_CC)) == NULL) {
return FAILURE;
}
+ zend_declare_property_string(php_user_filter, "filtername", sizeof("filtername")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_string(php_user_filter, "params", sizeof("params")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
/* init the filter resource; it has no dtor, as streams will always clean it up
* at the correct time */
@@ -531,6 +549,16 @@ PHP_FUNCTION(stream_filter_register)
RETVAL_FALSE;
+ if (!filtername_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter name cannot be empty");
+ return;
+ }
+
+ if (!classname_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class name cannot be empty");
+ return;
+ }
+
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);
diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c
index ac56d0bf5..12db49c7c 100644
--- a/ext/standard/uuencode.c
+++ b/ext/standard/uuencode.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: uuencode.c,v 1.5.2.1 2006/01/01 12:50:15 sniper Exp $ */
+/* $Id: uuencode.c,v 1.5.2.1.2.1 2006/06/26 18:48:56 bjori Exp $ */
/*
* Portions of this code are based on Berkeley's uuencode/uudecode
@@ -183,7 +183,7 @@ err:
return -1;
}
-/* {{{ proto string uuencode(string data)
+/* {{{ proto string convert_uuencode(string data)
uuencode a string */
PHP_FUNCTION(convert_uuencode)
{
@@ -200,7 +200,7 @@ PHP_FUNCTION(convert_uuencode)
}
/* }}} */
-/* {{{ proto string uudecode(string data)
+/* {{{ proto string convert_uudecode(string data)
decode a uuencoded string */
PHP_FUNCTION(convert_uudecode)
{
diff --git a/ext/standard/var.c b/ext/standard/var.c
index a1311a198..8369b6ea7 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var.c,v 1.203.2.7 2006/04/05 02:28:06 iliaa Exp $ */
+/* $Id: var.c,v 1.203.2.7.2.8 2006/10/09 18:08:34 iliaa Exp $ */
@@ -76,8 +76,8 @@ static int php_object_property_dump(zval **zv, int num_args, va_list args, zend_
if (hash_key->nKeyLength ==0 ) { /* numeric key */
php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h);
} else { /* string key */
- zend_unmangle_property_name_ex(hash_key->arKey, hash_key->nKeyLength, &class_name, &prop_name);
- if (class_name) {
+ int unmangle = zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength-1, &class_name, &prop_name);
+ if (class_name && unmangle == SUCCESS) {
php_printf("%*c[\"%s", level + 1, ' ', prop_name);
if (class_name[0]=='*') {
ZEND_PUTS(":protected");
@@ -85,7 +85,8 @@ static int php_object_property_dump(zval **zv, int num_args, va_list args, zend_
ZEND_PUTS(":private");
}
} else {
- php_printf("%*c[\"%s", level + 1, ' ', hash_key->arKey);
+ php_printf("%*c[\"", level + 1, ' ');
+ PHPWRITE(hash_key->arKey, hash_key->nKeyLength - 1);
#ifdef ANDREY_0
ZEND_PUTS(":public");
#endif
@@ -232,7 +233,7 @@ static int zval_object_property_dump(zval **zv, int num_args, va_list args, zend
if (hash_key->nKeyLength ==0 ) { /* numeric key */
php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h);
} else { /* string key */
- zend_unmangle_property_name_ex(hash_key->arKey, hash_key->nKeyLength, &class_name, &prop_name);
+ zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength-1, &class_name, &prop_name);
if (class_name) {
php_printf("%*c[\"%s", level + 1, ' ', prop_name);
if (class_name[0]=='*') {
@@ -385,7 +386,7 @@ static int php_object_element_export(zval **zv, int num_args, va_list args, zend
if (hash_key->nKeyLength != 0) {
php_printf("%*c", level + 1, ' ');
- zend_unmangle_property_name_ex(hash_key->arKey, hash_key->nKeyLength, &class_name, &prop_name);
+ zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength-1, &class_name, &prop_name);
php_printf(" '%s' => ", prop_name);
php_var_export(zv, level + 2 TSRMLS_CC);
PUTS (",\n");
@@ -415,7 +416,7 @@ PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC)
php_printf("%.*G", (int) EG(precision), Z_DVAL_PP(struc));
break;
case IS_STRING:
- tmp_str = php_addcslashes(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &tmp_len, 0, "'\\", 2 TSRMLS_CC);
+ tmp_str = php_addcslashes(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &tmp_len, 0, "'\\\0", 3 TSRMLS_CC);
PUTS ("'");
PHPWRITE(tmp_str, tmp_len);
PUTS ("'");
@@ -881,41 +882,55 @@ PHP_FUNCTION(serialize)
PHP_FUNCTION(unserialize)
{
- zval **buf;
+ char *buf;
+ int buf_len;
+ const unsigned char *p;
php_unserialize_data_t var_hash;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &buf) == FAILURE) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
+ RETURN_FALSE;
}
- 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;
- }
+ if (buf_len == 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;
- }
+ p = (const unsigned char*)buf;
+ PHP_VAR_UNSERIALIZE_INIT(var_hash);
+ if (!php_var_unserialize(&return_value, &p, p + buf_len, &var_hash TSRMLS_CC)) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
- } else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Argument is not a string");
+ zval_dtor(return_value);
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %ld of %d bytes", (long)((char*)p - buf), buf_len);
RETURN_FALSE;
}
+ PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
}
/* }}} */
#if MEMORY_LIMIT
-/* {{{ proto int memory_get_usage()
+/* {{{ proto int memory_get_usage([real_usage])
Returns the allocated by PHP memory */
PHP_FUNCTION(memory_get_usage) {
- RETURN_LONG(AG(allocated_memory));
+ zend_bool real_usage = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &real_usage) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ RETURN_LONG(zend_memory_usage(real_usage TSRMLS_CC));
+}
+/* }}} */
+/* {{{ proto int memory_get_peak_usage([real_usage])
+ Returns the peak allocated by PHP memory */
+PHP_FUNCTION(memory_get_peak_usage) {
+ zend_bool real_usage = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &real_usage) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ RETURN_LONG(zend_memory_peak_usage(real_usage TSRMLS_CC));
}
/* }}} */
#endif
diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c
index 8ab7cf393..2ebaedb66 100644
--- a/ext/standard/versioning.c
+++ b/ext/standard/versioning.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: versioning.c,v 1.19.2.1 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: versioning.c,v 1.19.2.1.2.1 2006/06/26 18:48:56 bjori Exp $ */
#include <stdio.h>
#include <sys/types.h>
@@ -204,8 +204,6 @@ php_version_compare(const char *orig_ver1, const char *orig_ver2)
}
/* }}} */
-/* {{{ do_version_compare() */
-
/* {{{ proto int version_compare(string ver1, string ver2 [, string oper])
Compares two "PHP-standardized" version number strings */
diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c
index c6d260c5e..9b922129e 100644
--- a/ext/sybase_ct/php_sybase_ct.c
+++ b/ext/sybase_ct/php_sybase_ct.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_sybase_ct.c,v 1.103.2.5 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: php_sybase_ct.c,v 1.103.2.5.2.6 2006/07/25 09:20:32 thetaphi Exp $ */
#ifdef HAVE_CONFIG_H
@@ -37,6 +37,10 @@ static int le_link, le_plink, le_result;
#if HAVE_SYBASE_CT
+ZEND_DECLARE_MODULE_GLOBALS(sybase)
+static PHP_GINIT_FUNCTION(sybase);
+static PHP_GSHUTDOWN_FUNCTION(sybase);
+
zend_function_entry sybase_functions[] = {
PHP_FE(sybase_connect, NULL)
PHP_FE(sybase_pconnect, NULL)
@@ -93,10 +97,21 @@ zend_function_entry sybase_functions[] = {
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
+ "sybase_ct",
+ sybase_functions,
+ PHP_MINIT(sybase),
+ PHP_MSHUTDOWN(sybase),
+ PHP_RINIT(sybase),
+ PHP_RSHUTDOWN(sybase),
+ PHP_MINFO(sybase),
+ NO_VERSION_YET,
+ PHP_MODULE_GLOBALS(sybase),
+ PHP_GINIT(sybase),
+ PHP_GSHUTDOWN(sybase),
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
-ZEND_DECLARE_MODULE_GLOBALS(sybase)
/* static CS_CONTEXT *context; */
#ifdef COMPILE_DL_SYBASE_CT
@@ -146,7 +161,7 @@ static void _free_sybase_result(sybase_result *result)
}
/* Forward declaration */
-static int php_sybase_finish_results (sybase_result *result);
+static int php_sybase_finish_results (sybase_result *result TSRMLS_DC);
static void php_free_sybase_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
@@ -157,7 +172,7 @@ static void php_free_sybase_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
if (result->sybase_ptr->cmd) {
ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL);
}
- php_sybase_finish_results(result);
+ php_sybase_finish_results(result TSRMLS_CC);
}
_free_sybase_result(result);
@@ -356,10 +371,9 @@ PHP_INI_BEGIN()
PHP_INI_END()
-static void php_sybase_init_globals(zend_sybase_globals *sybase_globals)
+static PHP_GINIT_FUNCTION(sybase)
{
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;
@@ -407,7 +421,7 @@ static void php_sybase_init_globals(zend_sybase_globals *sybase_globals)
}
-static void php_sybase_destroy_globals(zend_sybase_globals *sybase_globals)
+static PHP_GSHUTDOWN_FUNCTION(sybase)
{
ct_exit(sybase_globals->context, CS_UNUSED);
cs_ctx_drop(sybase_globals->context);
@@ -415,8 +429,6 @@ static void php_sybase_destroy_globals(zend_sybase_globals *sybase_globals)
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);
@@ -464,11 +476,10 @@ PHP_RSHUTDOWN_FUNCTION(sybase)
}
-static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char *user, char *passwd, char *charset, char *appname)
+static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char *user, char *passwd, char *charset, char *appname TSRMLS_DC)
{
CS_LOCALE *tmp_locale;
long packetsize;
- TSRMLS_FETCH();
/* set a CS_CONNECTION record */
if (ct_con_alloc(SybCtG(context), &sybase->connection)!=CS_SUCCEED) {
@@ -695,7 +706,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
sybase_ptr = (sybase_link *) malloc(sizeof(sybase_link));
- if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname)) {
+ if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) {
free(sybase_ptr);
efree(hashed_details);
RETURN_FALSE;
@@ -749,7 +760,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
* 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)) {
+ if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) {
memcpy(sybase_ptr, &sybase, sizeof(sybase_link));
efree(hashed_details);
RETURN_FALSE;
@@ -793,7 +804,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
sybase_ptr = (sybase_link *) emalloc(sizeof(sybase_link));
- if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname)) {
+ if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) {
efree(sybase_ptr);
efree(hashed_details);
RETURN_FALSE;
@@ -1009,12 +1020,11 @@ PHP_FUNCTION(sybase_select_db)
/* }}} */
-static int php_sybase_finish_results (sybase_result *result)
+static int php_sybase_finish_results(sybase_result *result TSRMLS_DC)
{
int i, fail;
CS_RETCODE retcode;
CS_INT restype;
- TSRMLS_FETCH();
efree(result->datafmt);
efree(result->lengths);
@@ -1196,7 +1206,7 @@ static int php_sybase_fetch_result_row (sybase_result *result, int numrows)
result->last_retcode= retcode;
switch (retcode) {
case CS_END_DATA:
- retcode = php_sybase_finish_results(result);
+ retcode = php_sybase_finish_results(result TSRMLS_CC);
break;
case CS_ROW_FAIL:
@@ -1421,7 +1431,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
*/
#if O_TIMM
if (result) {
- php_sybase_finish_results(result);
+ php_sybase_finish_results(result TSRMLS_CC);
}
#endif
@@ -1656,7 +1666,7 @@ PHP_FUNCTION(sybase_free_result)
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);
+ php_sybase_finish_results(result TSRMLS_CC);
}
zend_list_delete(Z_LVAL_PP(sybase_result_index));
diff --git a/ext/sysvmsg/config.m4 b/ext/sysvmsg/config.m4
index f6f6651cc..be5b28675 100644
--- a/ext/sysvmsg/config.m4
+++ b/ext/sysvmsg/config.m4
@@ -1,9 +1,14 @@
-dnl $Id: config.m4,v 1.5 2002/10/27 11:56:06 msopacua Exp $
+dnl $Id: config.m4,v 1.5.20.1 2006/08/24 13:18:24 tony2001 Exp $
PHP_ARG_ENABLE(sysvmsg,whether to enable System V IPC support,
[ --enable-sysvmsg Enable sysvmsg support])
if test "$PHP_SYSVMSG" != "no"; then
+ AC_CHECK_HEADER([sys/msg.h],
+ [],
+ [AC_MSG_ERROR([Cannot enable System V IPC support, sys/msg.h is missing])
+ ])
+
AC_DEFINE(HAVE_SYSVMSG, 1, [ ])
PHP_NEW_EXTENSION(sysvmsg, sysvmsg.c, $ext_shared)
fi
diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c
index 7f7a5de34..ff78c1761 100644
--- a/ext/sysvmsg/sysvmsg.c
+++ b/ext/sysvmsg/sysvmsg.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sysvmsg.c,v 1.20.2.3 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: sysvmsg.c,v 1.20.2.3.2.1 2006/06/05 22:52:11 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -122,6 +122,8 @@ 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_EAGAIN", EAGAIN, CONST_PERSISTENT|CONST_CS);
+ REGISTER_LONG_CONSTANT("MSG_ENOMSG", ENOMSG, 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;
@@ -142,7 +144,7 @@ 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: 1.20.2.3 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.20.2.3.2.1 $");
php_info_print_table_end();
}
/* }}} */
diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c
index 1581b7640..da1ad6857 100644
--- a/ext/sysvshm/sysvshm.c
+++ b/ext/sysvshm/sysvshm.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sysvshm.c,v 1.70.2.2 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: sysvshm.c,v 1.70.2.2.2.1 2006/06/29 09:03:27 tony2001 Exp $ */
/* This has been built and tested on Linux 2.2.14
*
@@ -408,6 +408,10 @@ static long php_check_shm_data(sysvshm_chunk_head *ptr, long key)
return pos;
}
pos += shm_var->next;
+
+ if (shm_var->next <= 0 || pos < ptr->start) {
+ return -1;
+ }
}
return -1;
}
diff --git a/ext/sysvshm/tests/001.phpt b/ext/sysvshm/tests/001.phpt
new file mode 100644
index 000000000..5228265d2
--- /dev/null
+++ b/ext/sysvshm/tests/001.phpt
@@ -0,0 +1,42 @@
+--TEST--
+ftok() tests
+--FILE--
+<?php
+
+var_dump(ftok());
+var_dump(ftok(1));
+var_dump(ftok(1,1,1));
+
+var_dump(ftok("",""));
+var_dump(ftok(-1, -1));
+var_dump(ftok("qwertyu","qwertyu"));
+
+var_dump(ftok("nonexistentfile","q"));
+
+var_dump(ftok(__FILE__,"q"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for ftok() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for ftok() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for ftok() in %s on line %d
+NULL
+
+Warning: ftok(): Pathname is invalid in %s on line %d
+int(-1)
+
+Warning: ftok(): Project identifier is invalid in %s on line %d
+int(-1)
+
+Warning: ftok(): Project identifier is invalid in %s on line %d
+int(-1)
+
+Warning: ftok(): ftok() failed - No such file or directory in %s on line %d
+int(-1)
+int(%d)
+Done
diff --git a/ext/sysvshm/tests/002.phpt b/ext/sysvshm/tests/002.phpt
new file mode 100644
index 000000000..81bb0cd49
--- /dev/null
+++ b/ext/sysvshm/tests/002.phpt
@@ -0,0 +1,67 @@
+--TEST--
+shm_attach() tests
+--SKIPIF--
+<?php if (!extension_loaded("sysvshm")) print "skip"; ?>
+--FILE--
+<?php
+
+$key = ftok(__FILE__, 't');
+
+var_dump(shm_attach());
+var_dump(shm_attach(1,2,3,4));
+
+var_dump(shm_attach(-1, 0));
+var_dump(shm_attach(0, -1));
+var_dump(shm_attach(123, -1));
+var_dump($s = shm_attach($key, -1));
+shm_remove($s);
+var_dump($s = shm_attach($key, 0));
+shm_remove($s);
+
+var_dump($s = shm_attach($key, 1024));
+shm_remove($key);
+var_dump($s = shm_attach($key, 1024));
+shm_remove($s);
+var_dump(shm_attach($key, 1024, 0666));
+shm_remove($s);
+
+var_dump($s = shm_attach($key, 1024));
+shm_remove($s);
+var_dump($s = shm_attach($key));
+shm_remove($s);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for shm_attach() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for shm_attach() in %s on line %d
+NULL
+
+Warning: shm_attach(): failed for key 0xffffffff: memorysize too small in %s on line %d
+bool(false)
+
+Warning: shm_attach(): failed for key 0x0: Invalid argument in %s on line %d
+bool(false)
+
+Warning: shm_attach(): failed for key 0x7b: Invalid argument in %s on line %d
+bool(false)
+
+Warning: shm_attach(): failed for key %s: Invalid argument in %s on line %d
+bool(false)
+
+Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d
+
+Warning: shm_attach(): failed for key %s: memorysize too small in %s on line %d
+bool(false)
+
+Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d
+int(%d)
+
+Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+Done
diff --git a/ext/sysvshm/tests/003.phpt b/ext/sysvshm/tests/003.phpt
new file mode 100644
index 000000000..467e46a07
--- /dev/null
+++ b/ext/sysvshm/tests/003.phpt
@@ -0,0 +1,46 @@
+--TEST--
+shm_detach() tests
+--SKIPIF--
+<?php if (!extension_loaded("sysvshm")) print "skip"; ?>
+--FILE--
+<?php
+
+$key = ftok(__FILE__, 'q');
+
+var_dump(shm_detach());
+var_dump(shm_detach(1,1));
+
+$s = shm_attach($key);
+
+var_dump(shm_detach($s));
+var_dump(shm_detach($s));
+shm_remove($s);
+
+var_dump(shm_detach(0));
+var_dump(shm_detach(1));
+var_dump(shm_detach(-1));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for shm_detach() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for shm_detach() in %s on line %d
+NULL
+bool(true)
+
+Warning: shm_detach(): The parameter is not a valid shm_identifier in %s on line %d
+bool(false)
+
+Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d
+
+Warning: shm_detach(): The parameter is not a valid shm_identifier in %s on line %d
+bool(false)
+
+Warning: shm_detach(): The parameter is not a valid shm_identifier in %s on line %d
+bool(false)
+
+Warning: shm_detach(): The parameter is not a valid shm_identifier in %s on line %d
+bool(false)
+Done
diff --git a/ext/sysvshm/tests/004.phpt b/ext/sysvshm/tests/004.phpt
new file mode 100644
index 000000000..ea4d7500a
--- /dev/null
+++ b/ext/sysvshm/tests/004.phpt
@@ -0,0 +1,40 @@
+--TEST--
+shm_put_var() tests
+--SKIPIF--
+<?php if (!extension_loaded("sysvshm")) print "skip"; ?>
+--FILE--
+<?php
+
+$key = ftok(__FILE__, 't');
+$s = shm_attach($key, 1024);
+
+var_dump(shm_put_var());
+var_dump(shm_put_var(-1, -1, -1));
+var_dump(shm_put_var(-1, 10, "qwerty"));
+var_dump(shm_put_var($s, -1, "qwerty"));
+var_dump(shm_put_var($s, 10, "qwerty"));
+var_dump(shm_put_var($s, 10, "qwerty"));
+
+$string = str_repeat("test", 512);
+var_dump(shm_put_var($s, 11, $string));
+
+shm_remove($s);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for shm_put_var() in %s on line %d
+NULL
+
+Warning: shm_put_var(): -1 is not a SysV shared memory index in %s on line %d
+bool(false)
+
+Warning: shm_put_var(): -1 is not a SysV shared memory index in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: shm_put_var(): not enough shared memory left in %s on line %d
+bool(false)
+Done
diff --git a/ext/sysvshm/tests/005.phpt b/ext/sysvshm/tests/005.phpt
new file mode 100644
index 000000000..49d158c7b
--- /dev/null
+++ b/ext/sysvshm/tests/005.phpt
@@ -0,0 +1,68 @@
+--TEST--
+shm_get_var() tests
+--SKIPIF--
+<?php if (!extension_loaded("sysvshm")) print "skip"; ?>
+--FILE--
+<?php
+
+$key = ftok(__FILE__, 't');
+$s = shm_attach($key, 1024);
+
+shm_put_var($s, -1, "test string");
+shm_put_var($s, 0, new stdclass);
+shm_put_var($s, 1, array(1,2,3));
+shm_put_var($s, 2, false);
+shm_put_var($s, 3, null);
+
+var_dump(shm_get_var());
+
+var_dump(shm_get_var(-1, -1));
+
+var_dump(shm_get_var($s, 1000));
+var_dump(shm_get_var($s, -10000));
+
+var_dump(shm_get_var($s, array()));
+var_dump(shm_get_var($s, -1));
+var_dump(shm_get_var($s, 0));
+var_dump(shm_get_var($s, 1));
+var_dump(shm_get_var($s, 2));
+var_dump(shm_get_var($s, 3));
+
+shm_put_var($s, 3, "test");
+shm_put_var($s, 3, 1);
+shm_put_var($s, 3, null);
+
+var_dump(shm_get_var($s, 3));
+shm_remove($s);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for shm_get_var() in %s on line %d
+NULL
+
+Warning: shm_get_var(): -1 is not a SysV shared memory index in %s on line %d
+bool(false)
+
+Warning: shm_get_var(): variable key 1000 doesn't exist in %s on line %d
+bool(false)
+
+Warning: shm_get_var(): variable key -10000 doesn't exist in %s on line %d
+bool(false)
+object(stdClass)#%d (0) {
+}
+string(11) "test string"
+object(stdClass)#%d (0) {
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+bool(false)
+NULL
+NULL
+Done
diff --git a/ext/sysvshm/tests/006.phpt b/ext/sysvshm/tests/006.phpt
new file mode 100644
index 000000000..ae0eef445
--- /dev/null
+++ b/ext/sysvshm/tests/006.phpt
@@ -0,0 +1,48 @@
+--TEST--
+shm_remove_var() tests
+--SKIPIF--
+<?php if (!extension_loaded("sysvshm")) print "skip"; ?>
+--FILE--
+<?php
+
+$key = ftok(__FILE__, 't');
+$s = shm_attach($key, 1024);
+
+shm_put_var($s, 1, "test string");
+
+var_dump(shm_remove_var());
+var_dump(shm_remove_var(-1, -1));
+var_dump(shm_remove_var($s, -10));
+
+var_dump(shm_get_var($s, 1));
+
+var_dump(shm_remove_var($s, 1));
+var_dump(shm_get_var($s, 1));
+
+var_dump(shm_remove_var($s, 1));
+var_dump(shm_get_var($s, 1));
+
+shm_remove($s);
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for shm_remove_var() in %s on line %d
+NULL
+
+Warning: shm_remove_var(): -1 is not a SysV shared memory index in %s on line %d
+bool(false)
+
+Warning: shm_remove_var(): variable key -10 doesn't exist in %s on line %d
+bool(false)
+string(11) "test string"
+bool(true)
+
+Warning: shm_get_var(): variable key 1 doesn't exist in %s on line %d
+bool(false)
+
+Warning: shm_remove_var(): variable key 1 doesn't exist in %s on line %d
+bool(false)
+
+Warning: shm_get_var(): variable key 1 doesn't exist in %s on line %d
+bool(false)
+Done
diff --git a/ext/sysvshm/tests/007.phpt b/ext/sysvshm/tests/007.phpt
new file mode 100644
index 000000000..05ef7ea18
--- /dev/null
+++ b/ext/sysvshm/tests/007.phpt
@@ -0,0 +1,41 @@
+--TEST--
+shm_remove() tests
+--SKIPIF--
+<?php if (!extension_loaded("sysvshm")) print "skip"; ?>
+--FILE--
+<?php
+
+$key = ftok(__FILE__, 't');
+$s = shm_attach($key, 1024);
+
+var_dump(shm_remove());
+var_dump(shm_remove(-1));
+var_dump(shm_remove(0));
+var_dump(shm_remove(""));
+
+var_dump(shm_remove($s));
+var_dump(shm_remove($s));
+
+shm_detach($s);
+var_dump(shm_remove($s));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: Wrong parameter count for shm_remove() in %s on line %d
+NULL
+
+Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d
+bool(false)
+
+Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d
+bool(false)
+
+Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+
+Warning: shm_remove(): The parameter is not a valid shm_identifier in %s on line %d
+bool(false)
+Done
diff --git a/ext/tidy/README b/ext/tidy/README
index 19f6b9ff6..0fb6c0f03 100644
--- a/ext/tidy/README
+++ b/ext/tidy/README
@@ -5,12 +5,3 @@ README FOR ext/tidy by John Coggeshall <john@php.net>
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/libtidy.txt b/ext/tidy/libtidy.txt
deleted file mode 100644
index 53185d9fc..000000000
--- 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/php_tidy.h b/ext/tidy/php_tidy.h
index 6e3728984..f5dde8fa4 100644
--- a/ext/tidy/php_tidy.h
+++ b/ext/tidy/php_tidy.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_tidy.h,v 1.26.2.1 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: php_tidy.h,v 1.26.2.1.2.4 2006/09/15 14:33:34 nlopess Exp $ */
#ifndef PHP_TIDY_H
#define PHP_TIDY_H
@@ -24,12 +24,6 @@
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)
@@ -39,60 +33,8 @@ extern zend_module_entry tidy_module_entry;
#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
@@ -103,7 +45,6 @@ ZEND_END_MODULE_GLOBALS(tidy)
#endif
-
/*
* Local variables:
* tab-width: 4
diff --git a/ext/tidy/tests/007.phpt b/ext/tidy/tests/007.phpt
index 26867ff3f..f6bb13d55 100644
--- a/ext/tidy/tests/007.phpt
+++ b/ext/tidy/tests/007.phpt
@@ -13,9 +13,17 @@ tidy.default_config=
var_dump($a->getopt("error-file"));
echo "Current Value of 'tab-size': ";
var_dump($a->getopt("tab-size"));
-
+
+ var_dump($a->getopt('bogus-opt'));
+ var_dump(tidy_getopt($a, 'non-ASCII string àáç'));
?>
---EXPECT--
+--EXPECTF--
Current Value of 'tidy-mark': bool(false)
Current Value of 'error-file': string(0) ""
Current Value of 'tab-size': int(8)
+
+Warning: tidy::getOpt(): Unknown Tidy Configuration Option 'bogus-opt' in %s007.php on line 10
+bool(false)
+
+Warning: tidy_getopt(): Unknown Tidy Configuration Option 'non-ASCII string àáç' in %s007.php on line 11
+bool(false)
diff --git a/ext/tidy/tests/019.phpt b/ext/tidy/tests/019.phpt
new file mode 100644
index 000000000..9d2c693cd
--- /dev/null
+++ b/ext/tidy/tests/019.phpt
@@ -0,0 +1,38 @@
+--TEST--
+tidy_repair_*() and invalid parameters
+--SKIPIF--
+<?php if (!extension_loaded("tidy")) print "skip"; ?>
+--FILE--
+<?php
+
+$l = 1;
+$s = "";
+$a = array();
+
+tidy_repair_string($s, $l, $l, $l);
+tidy_repair_string($s, $s, $s, $s);
+tidy_repair_string($l, $l, $l ,$l);
+tidy_repair_string($a, $a, $a, $a);
+
+tidy_repair_file($s, $l, $l, $l);
+tidy_repair_file($s, $s, $s, $s);
+tidy_repair_file($l, $l, $l ,$l);
+tidy_repair_file($a, $a, $a, $a);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d
+
+Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d
+
+Warning: tidy_repair_string(): Could not load configuration file '' in %s on line %d
+
+Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d
+
+Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d
+
+Warning: tidy_repair_string() expects parameter 1 to be string, array given in %s on line %d
+
+Warning: tidy_repair_file() expects parameter 1 to be string, array given in %s on line %d
+Done
diff --git a/ext/tidy/tests/020.phpt b/ext/tidy/tests/020.phpt
new file mode 100644
index 000000000..dbfda9637
--- /dev/null
+++ b/ext/tidy/tests/020.phpt
@@ -0,0 +1,36 @@
+--TEST--
+OO API
+--SKIPIF--
+<?php if (!extension_loaded("tidy")) print "skip"; ?>
+--FILE--
+<?php
+
+$tidy = new tidy();
+$str = <<<EOF
+<p>Isto é um texto em Português<br>
+para testes.</p>
+EOF;
+
+$tidy->parseString($str, array('output-xhtml'=>1), 'latin1');
+$tidy->cleanRepair();
+$tidy->diagnose();
+var_dump(tidy_warning_count($tidy) > 0);
+var_dump(strlen($tidy->errorBuffer) > 50);
+
+echo $tidy;
+?>
+--EXPECT--
+bool(true)
+bool(true)
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title></title>
+</head>
+<body>
+<p>Isto é um texto em Português<br />
+para testes.</p>
+</body>
+</html>
diff --git a/ext/tidy/tests/021.phpt b/ext/tidy/tests/021.phpt
new file mode 100644
index 000000000..bdf954617
--- /dev/null
+++ b/ext/tidy/tests/021.phpt
@@ -0,0 +1,18 @@
+--TEST--
+tidy_get_opt_doc()
+--SKIPIF--
+<?php if (!extension_loaded("tidy") || !function_exists('tidy_get_opt_doc')) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(tidy_get_opt_doc(new tidy, 'some_bogus_cfg'));
+
+$t = new tidy;
+var_dump($t->getOptDoc('ncr'));
+var_dump(strlen(tidy_get_opt_doc($t, 'wrap')) > 99);
+?>
+--EXPECTF--
+Warning: tidy_get_opt_doc(): Unknown Tidy Configuration Option 'some_bogus_cfg' in %s021.php on line 3
+bool(false)
+string(73) "This option specifies if Tidy should allow numeric character references. "
+bool(true)
diff --git a/ext/tidy/tests/022.phpt b/ext/tidy/tests/022.phpt
new file mode 100644
index 000000000..9d2c693cd
--- /dev/null
+++ b/ext/tidy/tests/022.phpt
@@ -0,0 +1,38 @@
+--TEST--
+tidy_repair_*() and invalid parameters
+--SKIPIF--
+<?php if (!extension_loaded("tidy")) print "skip"; ?>
+--FILE--
+<?php
+
+$l = 1;
+$s = "";
+$a = array();
+
+tidy_repair_string($s, $l, $l, $l);
+tidy_repair_string($s, $s, $s, $s);
+tidy_repair_string($l, $l, $l ,$l);
+tidy_repair_string($a, $a, $a, $a);
+
+tidy_repair_file($s, $l, $l, $l);
+tidy_repair_file($s, $s, $s, $s);
+tidy_repair_file($l, $l, $l ,$l);
+tidy_repair_file($a, $a, $a, $a);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d
+
+Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d
+
+Warning: tidy_repair_string(): Could not load configuration file '' in %s on line %d
+
+Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d
+
+Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d
+
+Warning: tidy_repair_string() expects parameter 1 to be string, array given in %s on line %d
+
+Warning: tidy_repair_file() expects parameter 1 to be string, array given in %s on line %d
+Done
diff --git a/ext/tidy/tests/023.phpt b/ext/tidy/tests/023.phpt
new file mode 100644
index 000000000..e7ee4b3c0
--- /dev/null
+++ b/ext/tidy/tests/023.phpt
@@ -0,0 +1,49 @@
+--TEST--
+tidy and tidyNode OO
+--SKIPIF--
+<?php if (!extension_loaded('tidy')) echo 'skip'; ?>
+--FILE--
+<?php
+
+//test leaks here:
+new tidyNode();
+var_dump(new tidyNode());
+new tidy();
+var_dump(new tidy());
+
+echo "-------\n";
+
+$x = new tidyNode();
+var_dump($x->isHtml());
+
+$tidy = new tidy();
+$tidy->parseString('<html><?php echo "xpto;" ?></html>');
+
+var_dump(tidy_get_root($tidy)->child[0]->isHtml());
+var_dump(tidy_get_root($tidy)->child[0]->child[0]->isPHP());
+var_dump(tidy_get_root($tidy)->child[0]->child[0]->isAsp());
+var_dump(tidy_get_root($tidy)->child[0]->child[0]->isJste());
+var_dump(tidy_get_root($tidy)->child[0]->child[0]->type === TIDY_NODETYPE_PHP);
+
+var_dump(tidy_get_root($tidy)->child[0]->hasChildren());
+var_dump(tidy_get_root($tidy)->child[0]->child[0]->hasChildren());
+
+?>
+--EXPECT--
+object(tidyNode)#1 (0) {
+}
+object(tidy)#1 (2) {
+ ["errorBuffer"]=>
+ NULL
+ ["value"]=>
+ NULL
+}
+-------
+bool(false)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+bool(true)
+bool(false)
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
index 2e0cdbffa..31a42b488 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tidy.c,v 1.66.2.8 2006/04/19 21:47:20 nlopess Exp $ */
+/* $Id: tidy.c,v 1.66.2.8.2.15 2006/10/02 07:58:13 bjori Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -31,9 +31,6 @@
#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"
@@ -46,19 +43,9 @@
/* {{{ 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)
-
+ zval *object = getThis();
+
#define TIDY_FETCH_OBJECT \
PHPTidyObj *obj; \
TIDY_SET_CONTEXT; \
@@ -81,19 +68,20 @@
} \
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); \
+ if(Z_TYPE_PP(_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; \
+ convert_to_string_ex(_val); \
+ TIDY_SAFE_MODE_CHECK(Z_STRVAL_PP(_val)); \
+ switch (tidyLoadConfig(_doc, Z_STRVAL_PP(_val))) { \
+ case -1: \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load configuration file '%s'", Z_STRVAL_PP(_val)); \
+ break; \
+ case 1: \
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There were errors while parsing the configuration file '%s'", Z_STRVAL_PP(_val)); \
+ break; \
} \
} \
}
@@ -188,8 +176,7 @@ typedef struct _PHPTidyObj PHPTidyObj;
typedef enum {
is_node,
- is_doc,
- is_exception
+ is_doc
} tidy_obj_type;
typedef enum {
@@ -219,12 +206,11 @@ 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, int TSRMLS_DC);
-static int tidy_node_cast_handler(zval *, zval *, int, int 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);
@@ -233,6 +219,54 @@ 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);
+
+static PHP_MINIT_FUNCTION(tidy);
+static PHP_MSHUTDOWN_FUNCTION(tidy);
+static PHP_RINIT_FUNCTION(tidy);
+static PHP_MINFO_FUNCTION(tidy);
+
+static PHP_FUNCTION(tidy_getopt);
+static PHP_FUNCTION(tidy_parse_string);
+static PHP_FUNCTION(tidy_parse_file);
+static PHP_FUNCTION(tidy_clean_repair);
+static PHP_FUNCTION(tidy_repair_string);
+static PHP_FUNCTION(tidy_repair_file);
+static PHP_FUNCTION(tidy_diagnose);
+static PHP_FUNCTION(tidy_get_output);
+static PHP_FUNCTION(tidy_get_error_buffer);
+static PHP_FUNCTION(tidy_get_release);
+static PHP_FUNCTION(tidy_get_config);
+static PHP_FUNCTION(tidy_get_status);
+static PHP_FUNCTION(tidy_get_html_ver);
+#if HAVE_TIDYOPTGETDOC
+static PHP_FUNCTION(tidy_get_opt_doc);
+#endif
+static PHP_FUNCTION(tidy_is_xhtml);
+static PHP_FUNCTION(tidy_is_xml);
+static PHP_FUNCTION(tidy_error_count);
+static PHP_FUNCTION(tidy_warning_count);
+static PHP_FUNCTION(tidy_access_count);
+static PHP_FUNCTION(tidy_config_count);
+
+static PHP_FUNCTION(ob_tidyhandler);
+
+static PHP_FUNCTION(tidy_get_root);
+static PHP_FUNCTION(tidy_get_html);
+static PHP_FUNCTION(tidy_get_head);
+static PHP_FUNCTION(tidy_get_body);
+
+static TIDY_DOC_METHOD(__construct);
+static TIDY_DOC_METHOD(parseFile);
+static TIDY_DOC_METHOD(parseString);
+
+static TIDY_NODE_METHOD(hasChildren);
+static TIDY_NODE_METHOD(hasSiblings);
+static TIDY_NODE_METHOD(isComment);
+static TIDY_NODE_METHOD(isHtml);
+static TIDY_NODE_METHOD(isText);
+static TIDY_NODE_METHOD(isJste);
+static TIDY_NODE_METHOD(isAsp);
+static TIDY_NODE_METHOD(isPhp);
/* }}} */
ZEND_DECLARE_MODULE_GLOBALS(tidy)
@@ -242,7 +276,7 @@ STD_PHP_INI_ENTRY("tidy.default_config", "", PHP_INI_SYSTEM, OnUpdateString, d
PHP_INI_ENTRY("tidy.clean_output", "0", PHP_INI_PERDIR, NULL)
PHP_INI_END()
-zend_function_entry tidy_functions[] = {
+static zend_function_entry tidy_functions[] = {
PHP_FE(tidy_getopt, NULL)
PHP_FE(tidy_parse_string, NULL)
PHP_FE(tidy_parse_file, NULL)
@@ -273,7 +307,7 @@ zend_function_entry tidy_functions[] = {
{NULL, NULL, NULL}
};
-zend_function_entry tidy_funcs_doc[] = {
+static zend_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)
@@ -298,8 +332,7 @@ zend_function_entry tidy_funcs_doc[] = {
{NULL, NULL, NULL}
};
-zend_function_entry tidy_funcs_node[] = {
- TIDY_NODE_ME(__construct, NULL)
+static zend_function_entry tidy_funcs_node[] = {
TIDY_NODE_ME(hasChildren, NULL)
TIDY_NODE_ME(hasSiblings, NULL)
TIDY_NODE_ME(isComment, NULL)
@@ -311,49 +344,48 @@ zend_function_entry tidy_funcs_node[] = {
{NULL, NULL, NULL}
};
-zend_function_entry tidy_funcs_exception[] = {
- {NULL, NULL, NULL}
-};
-
-zend_class_entry *tidy_ce_doc, *tidy_ce_node, *tidy_ce_exception;
+static zend_class_entry *tidy_ce_doc, *tidy_ce_node;
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_MSHUTDOWN(tidy),
PHP_RINIT(tidy),
NULL,
PHP_MINFO(tidy),
PHP_TIDY_MODULE_VERSION,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(tidy),
+ NULL,
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
#ifdef COMPILE_DL_TIDY
ZEND_GET_MODULE(tidy)
#endif
-void* TIDY_CALL php_tidy_malloc(size_t len)
+static void* TIDY_CALL php_tidy_malloc(size_t len)
{
return emalloc(len);
}
-void* TIDY_CALL php_tidy_realloc(void *buf, size_t len)
+static void* TIDY_CALL php_tidy_realloc(void *buf, size_t len)
{
return erealloc(buf, len);
}
-void TIDY_CALL php_tidy_free(void *buf)
+static void TIDY_CALL php_tidy_free(void *buf)
{
efree(buf);
}
-void TIDY_CALL php_tidy_panic(ctmbstr msg)
+static void TIDY_CALL 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);
@@ -426,11 +458,9 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
zend_bool use_include_path = 0;
TidyDoc doc;
TidyBuffer *errbuf;
- zval *config;
-
- TIDY_SET_CONTEXT;
+ zval **config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zsb", &arg1, &arg1_len, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &arg1, &arg1_len, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
@@ -459,19 +489,8 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
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;
- }
- }
+ TIDY_APPLY_CONFIG_ZVAL(doc, config);
}
if(enc_len) {
@@ -535,19 +554,7 @@ static void tidy_object_free_storage(void *object TSRMLS_DC)
{
PHPTidyObj *intern = (PHPTidyObj *)object;
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1 && PHP_RELEASE_VERSION > 2) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
zend_object_std_dtor(&intern->std TSRMLS_CC);
-#else
- if (intern->std.guards) {
- zend_hash_destroy(intern->std.guards);
- FREE_HASHTABLE(intern->std.guards);
- }
-
- if (intern->std.properties) {
- zend_hash_destroy(intern->std.properties);
- FREE_HASHTABLE(intern->std.properties);
- }
-#endif
if (intern->ptdoc) {
intern->ptdoc->ref_count--;
@@ -571,15 +578,7 @@ static void tidy_object_new(zend_class_entry *class_type, zend_object_handlers *
intern = emalloc(sizeof(PHPTidyObj));
memset(intern, 0, sizeof(PHPTidyObj));
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1 && PHP_RELEASE_VERSION > 2) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
-#else
- ALLOC_HASHTABLE(intern->std.properties);
- zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-
- intern->std.ce = class_type;
- intern->std.guards = NULL;
-#endif
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
@@ -638,13 +637,6 @@ static zend_object_value tidy_object_new_doc(zend_class_entry *class_type TSRMLS
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;
@@ -668,7 +660,7 @@ static zval * tidy_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC)
return object;
}
-static int tidy_doc_cast_handler(zval *in, zval *out, int type, int free TSRMLS_DC)
+static int tidy_doc_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
{
TidyBuffer output = {0};
PHPTidyObj *obj;
@@ -700,7 +692,7 @@ static int tidy_doc_cast_handler(zval *in, zval *out, int type, int free TSRMLS_
return SUCCESS;
}
-static int tidy_node_cast_handler(zval *in, zval *out, int type, int free TSRMLS_DC)
+static int tidy_node_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
{
TidyBuffer buf = {0};
PHPTidyObj *obj;
@@ -776,8 +768,8 @@ static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRM
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));
+ 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:
@@ -841,7 +833,6 @@ static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRM
ADD_PROPERTY_NULL(obj->std.properties, value);
break;
- case is_exception:
default:
break;
}
@@ -957,26 +948,12 @@ static int php_tidy_parse_string(PHPTidyObj *obj, char *string, int len, char *e
return SUCCESS;
}
-static void tidy_globals_ctor(void *global TSRMLS_DC)
-{
-
-}
-
-static void tidy_globals_dtor(void *global TSRMLS_DC)
-{
-
-}
-
-PHP_MINIT_FUNCTION(tidy)
+static 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());
- */
+
tidy_object_handlers_doc.get_class_entry = tidy_get_ce_doc;
tidy_object_handlers_node.get_class_entry = tidy_get_ce_node;
@@ -989,7 +966,7 @@ PHP_MINIT_FUNCTION(tidy)
return SUCCESS;
}
-PHP_RINIT_FUNCTION(tidy)
+static PHP_RINIT_FUNCTION(tidy)
{
if (INI_BOOL("tidy.clean_output") == TRUE) {
if (php_start_ob_buffer_named("ob_tidyhandler", 0, 1 TSRMLS_CC) == FAILURE) {
@@ -1000,18 +977,24 @@ PHP_RINIT_FUNCTION(tidy)
return SUCCESS;
}
-PHP_MINFO_FUNCTION(tidy)
+static PHP_MSHUTDOWN_FUNCTION(tidy)
+{
+ UNREGISTER_INI_ENTRIES();
+ return SUCCESS;
+}
+
+static 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: tidy.c,v 1.66.2.8 2006/04/19 21:47:20 nlopess Exp $)");
+ php_info_print_table_row(2, "Extension Version", PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.15 2006/10/02 07:58:13 bjori Exp $)");
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
}
-PHP_FUNCTION(ob_tidyhandler)
+static PHP_FUNCTION(ob_tidyhandler)
{
char *input;
int input_len;
@@ -1068,17 +1051,15 @@ PHP_FUNCTION(ob_tidyhandler)
/* {{{ proto bool tidy_parse_string(string input [, mixed config_options [, string encoding]])
Parse a document stored in a string */
-PHP_FUNCTION(tidy_parse_string)
+static PHP_FUNCTION(tidy_parse_string)
{
char *input, *enc = NULL;
int input_len, enc_len = 0;
- zval *options = NULL;
+ 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) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zs", &input, &input_len, &options, &enc, &enc_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1098,7 +1079,7 @@ PHP_FUNCTION(tidy_parse_string)
/* {{{ proto string tidy_get_error_buffer([boolean detailed])
Return warnings and errors which occured parsing the specified document*/
-PHP_FUNCTION(tidy_get_error_buffer)
+static PHP_FUNCTION(tidy_get_error_buffer)
{
TIDY_FETCH_OBJECT;
@@ -1112,7 +1093,7 @@ PHP_FUNCTION(tidy_get_error_buffer)
/* {{{ proto string tidy_get_output()
Return a string representing the parsed tidy markup */
-PHP_FUNCTION(tidy_get_output)
+static PHP_FUNCTION(tidy_get_output)
{
TidyBuffer output = {0};
TIDY_FETCH_OBJECT;
@@ -1127,18 +1108,17 @@ PHP_FUNCTION(tidy_get_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)
+static 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;
+ zval **options = NULL;
PHPTidyObj *obj;
- TIDY_SET_CONTEXT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zsb", &inputfile, &input_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &inputfile, &input_len,
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
@@ -1165,7 +1145,7 @@ PHP_FUNCTION(tidy_parse_file)
/* {{{ proto boolean tidy_clean_repair()
Execute configured cleanup and repair operations on parsed markup */
-PHP_FUNCTION(tidy_clean_repair)
+static PHP_FUNCTION(tidy_clean_repair)
{
TIDY_FETCH_OBJECT;
@@ -1180,25 +1160,23 @@ PHP_FUNCTION(tidy_clean_repair)
/* {{{ 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)
+static 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)
+static 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)
+static PHP_FUNCTION(tidy_diagnose)
{
TIDY_FETCH_OBJECT;
@@ -1213,10 +1191,8 @@ PHP_FUNCTION(tidy_diagnose)
/* {{{ proto string tidy_get_release()
Get release date (version) for Tidy library */
-PHP_FUNCTION(tidy_get_release)
+static PHP_FUNCTION(tidy_get_release)
{
- TIDY_SET_CONTEXT;
-
if (ZEND_NUM_ARGS()) {
WRONG_PARAM_COUNT;
}
@@ -1229,13 +1205,13 @@ PHP_FUNCTION(tidy_get_release)
#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)
+static PHP_FUNCTION(tidy_get_opt_doc)
{
PHPTidyObj *obj;
char *optname, *optval;
int optname_len;
TidyOption opt;
-
+
TIDY_SET_CONTEXT;
if (object) {
@@ -1269,7 +1245,7 @@ PHP_FUNCTION(tidy_get_opt_doc)
/* {{{ proto array tidy_get_config()
Get current Tidy configuarion */
-PHP_FUNCTION(tidy_get_config)
+static PHP_FUNCTION(tidy_get_config)
{
TidyIterator itOpt;
char *opt_name;
@@ -1308,7 +1284,7 @@ PHP_FUNCTION(tidy_get_config)
/* {{{ proto int tidy_get_status()
Get status of specfied document. */
-PHP_FUNCTION(tidy_get_status)
+static PHP_FUNCTION(tidy_get_status)
{
TIDY_FETCH_OBJECT;
@@ -1318,7 +1294,7 @@ PHP_FUNCTION(tidy_get_status)
/* {{{ proto int tidy_get_html_ver()
Get the Detected HTML version for the specified document. */
-PHP_FUNCTION(tidy_get_html_ver)
+static PHP_FUNCTION(tidy_get_html_ver)
{
TIDY_FETCH_OBJECT;
@@ -1328,7 +1304,7 @@ PHP_FUNCTION(tidy_get_html_ver)
/* {{{ proto boolean tidy_is_xhtml()
Indicates if the document is a XHTML document. */
-PHP_FUNCTION(tidy_is_xhtml)
+static PHP_FUNCTION(tidy_is_xhtml)
{
TIDY_FETCH_OBJECT;
@@ -1336,9 +1312,9 @@ PHP_FUNCTION(tidy_is_xhtml)
}
/* }}} */
-/* {{{ proto boolean tidy_is_xhtml()
+/* {{{ proto boolean tidy_is_xml()
Indicates if the document is a generic (non HTML/XHTML) XML document. */
-PHP_FUNCTION(tidy_is_xml)
+static PHP_FUNCTION(tidy_is_xml)
{
TIDY_FETCH_OBJECT;
@@ -1348,7 +1324,7 @@ PHP_FUNCTION(tidy_is_xml)
/* {{{ proto int tidy_error_count()
Returns the Number of Tidy errors encountered for specified document. */
-PHP_FUNCTION(tidy_error_count)
+static PHP_FUNCTION(tidy_error_count)
{
TIDY_FETCH_OBJECT;
@@ -1358,7 +1334,7 @@ PHP_FUNCTION(tidy_error_count)
/* {{{ proto int tidy_warning_count()
Returns the Number of Tidy warnings encountered for specified document. */
-PHP_FUNCTION(tidy_warning_count)
+static PHP_FUNCTION(tidy_warning_count)
{
TIDY_FETCH_OBJECT;
@@ -1368,7 +1344,7 @@ PHP_FUNCTION(tidy_warning_count)
/* {{{ proto int tidy_access_count()
Returns the Number of Tidy accessibility warnings encountered for specified document. */
-PHP_FUNCTION(tidy_access_count)
+static PHP_FUNCTION(tidy_access_count)
{
TIDY_FETCH_OBJECT;
@@ -1378,7 +1354,7 @@ PHP_FUNCTION(tidy_access_count)
/* {{{ proto int tidy_config_count()
Returns the Number of Tidy configuration errors encountered for specified document. */
-PHP_FUNCTION(tidy_config_count)
+static PHP_FUNCTION(tidy_config_count)
{
TIDY_FETCH_OBJECT;
@@ -1388,7 +1364,7 @@ PHP_FUNCTION(tidy_config_count)
/* {{{ proto mixed tidy_getopt(string option)
Returns the value of the specified configuration option for the tidy document. */
-PHP_FUNCTION(tidy_getopt)
+static PHP_FUNCTION(tidy_getopt)
{
PHPTidyObj *obj;
char *optname;
@@ -1445,18 +1421,18 @@ PHP_FUNCTION(tidy_getopt)
}
/* }}} */
-TIDY_DOC_METHOD(__construct)
+static 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;
+ zval **options = NULL;
PHPTidyObj *obj;
TIDY_SET_CONTEXT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|szsb", &inputfile, &input_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sZsb", &inputfile, &input_len,
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
@@ -1477,20 +1453,20 @@ TIDY_DOC_METHOD(__construct)
}
}
-TIDY_DOC_METHOD(parseFile)
+static 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;
+ 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,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &inputfile, &input_len,
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
@@ -1511,16 +1487,16 @@ TIDY_DOC_METHOD(parseFile)
efree(contents);
}
-TIDY_DOC_METHOD(parseString)
+static TIDY_DOC_METHOD(parseString)
{
char *input, *enc = NULL;
int input_len, enc_len = 0;
- zval *options = NULL;
+ 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) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zs", &input, &input_len, &options, &enc, &enc_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1538,50 +1514,39 @@ TIDY_DOC_METHOD(parseString)
/* {{{ proto TidyNode tidy_get_root()
Returns a TidyNode Object representing the root of the tidy parse tree */
-PHP_FUNCTION(tidy_get_root)
+static 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 <HTML> tag of the tidy parse tree */
-PHP_FUNCTION(tidy_get_html)
+static 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 <HEAD> tag of the tidy parse tree */
-PHP_FUNCTION(tidy_get_head)
+static 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 <BODY> tag of the tidy parse tree */
-PHP_FUNCTION(tidy_get_body)
+static 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)
+static TIDY_NODE_METHOD(hasChildren)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1595,7 +1560,7 @@ TIDY_NODE_METHOD(hasChildren)
/* {{{ proto boolean tidyNode::hasSiblings()
Returns true if this node has siblings */
-TIDY_NODE_METHOD(hasSiblings)
+static TIDY_NODE_METHOD(hasSiblings)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1609,7 +1574,7 @@ TIDY_NODE_METHOD(hasSiblings)
/* {{{ proto boolean tidyNode::isComment()
Returns true if this node represents a comment */
-TIDY_NODE_METHOD(isComment)
+static TIDY_NODE_METHOD(isComment)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1623,7 +1588,7 @@ TIDY_NODE_METHOD(isComment)
/* {{{ proto boolean tidyNode::isHtml()
Returns true if this node is part of a HTML document */
-TIDY_NODE_METHOD(isHtml)
+static TIDY_NODE_METHOD(isHtml)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1635,37 +1600,9 @@ TIDY_NODE_METHOD(isHtml)
}
/* }}} */
-/* {{{ 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)
+static TIDY_NODE_METHOD(isText)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1679,7 +1616,7 @@ TIDY_NODE_METHOD(isText)
/* {{{ proto boolean tidyNode::isJste()
Returns true if this node is JSTE */
-TIDY_NODE_METHOD(isJste)
+static TIDY_NODE_METHOD(isJste)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1693,7 +1630,7 @@ TIDY_NODE_METHOD(isJste)
/* {{{ proto boolean tidyNode::isAsp()
Returns true if this node is ASP */
-TIDY_NODE_METHOD(isAsp)
+static TIDY_NODE_METHOD(isAsp)
{
TIDY_FETCH_ONLY_OBJECT;
@@ -1707,7 +1644,7 @@ TIDY_NODE_METHOD(isAsp)
/* {{{ proto boolean tidyNode::isPhp()
Returns true if this node is PHP */
-TIDY_NODE_METHOD(isPhp)
+static TIDY_NODE_METHOD(isPhp)
{
TIDY_FETCH_ONLY_OBJECT;
diff --git a/ext/tokenizer/php_tokenizer.h b/ext/tokenizer/php_tokenizer.h
index 3964c91b9..3cc5ee704 100644
--- a/ext/tokenizer/php_tokenizer.h
+++ b/ext/tokenizer/php_tokenizer.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_tokenizer.h,v 1.9.2.1 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: php_tokenizer.h,v 1.9.2.1.2.1 2006/06/20 22:39:15 iliaa Exp $ */
#ifndef PHP_TOKENIZER_H
#define PHP_TOKENIZER_H
@@ -35,9 +35,6 @@ extern zend_module_entry tokenizer_module_entry;
#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. */
diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c
index 67b8c1a52..4d450c0d1 100644
--- a/ext/tokenizer/tokenizer.c
+++ b/ext/tokenizer/tokenizer.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tokenizer.c,v 1.31.2.5 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: tokenizer.c,v 1.31.2.5.2.2 2006/06/20 22:39:15 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -119,9 +119,9 @@ zend_module_entry tokenizer_module_entry = {
"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 */
+ NULL,
+ NULL,
+ NULL,
PHP_MINFO(tokenizer),
#if ZEND_MODULE_API_NO >= 20010901
"0.1", /* Replace with version number for your extension */
@@ -144,10 +144,10 @@ PHP_INI_END()
*/
/* }}} */
-/* {{{ php_tokenizer_init_globals
+/* {{{ PHP_GINIT_FUNCTION
*/
/* Uncomment this function if you have INI entries
-static void php_tokenizer_init_globals(zend_tokenizer_globals *tokenizer_globals)
+static PHP_GINIT_FUNCTION(tokenizer)
{
tokenizer_globals->global_value = 0;
tokenizer_globals->global_string = NULL;
@@ -160,7 +160,6 @@ static void php_tokenizer_init_globals(zend_tokenizer_globals *tokenizer_globals
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();
*/
@@ -288,35 +287,6 @@ PHP_MINIT_FUNCTION(tokenizer)
}
/* }}} */
-/* {{{ 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)
diff --git a/ext/wddx/config.m4 b/ext/wddx/config.m4
index 2d0e4eff2..2eff124b2 100644
--- a/ext/wddx/config.m4
+++ b/ext/wddx/config.m4
@@ -1,15 +1,60 @@
dnl
-dnl $Id: config.m4,v 1.11.2.1 2005/12/21 14:22:26 sniper Exp $
+dnl $Id: config.m4,v 1.11.2.1.2.1 2006/07/27 01:18:55 sniper Exp $
dnl
PHP_ARG_ENABLE(wddx,whether to enable WDDX support,
[ --enable-wddx Enable WDDX support])
+if test -z "$PHP_LIBXML_DIR"; then
+ PHP_ARG_WITH(libxml-dir, libxml2 install dir,
+ [ --with-libxml-dir=DIR WDDX: libxml2 install prefix], no, no)
+fi
+
+PHP_ARG_WITH(libexpat-dir, libexpat dir for WDDX,
+[ --with-libexpat-dir=DIR WDDX: libexpat dir for XMLRPC-EPI (deprecated)],no,no)
+
if test "$PHP_WDDX" != "no"; then
- if test "$ext_shared" != "yes" && (test "$enable_xml" = "no" || test "${enable_xml+set}" != "set"); then
- AC_MSG_WARN(Activating XML)
- enable_xml=yes
+
+ 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([WDDX extension requires LIBXML extension, add --enable-libxml])
+ fi
+
+ PHP_SETUP_LIBXML(WDDX_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=<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 /usr /usr/local; 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, WDDX_SHARED_LIBADD)
+ AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
+ fi
+
AC_DEFINE(HAVE_WDDX, 1, [ ])
PHP_NEW_EXTENSION(wddx, wddx.c, $ext_shared)
+ PHP_ADD_EXTENSION_DEP(wddx, libxml)
+ PHP_SUBST(XMLRPC_SHARED_LIBADD)
fi
diff --git a/ext/wddx/tests/bug37569.phpt b/ext/wddx/tests/bug37569.phpt
new file mode 100755
index 000000000..f7422c9ec
--- /dev/null
+++ b/ext/wddx/tests/bug37569.phpt
@@ -0,0 +1,778 @@
+--TEST--
+Bug #37569 (WDDX incorrectly encodes high-ascii characters)
+--SKIPIF--
+<?php if (!extension_loaded("wddx")) print "skip"; ?>
+--FILE--
+<?php
+for ($i = 65; $i < 256; $i++) {
+ $v = chr($i);
+ $ret = wddx_serialize_value($v);
+ echo $ret . "\n";
+ var_dump(ord($v), ord(wddx_deserialize($ret)), $v == wddx_deserialize($ret));
+}
+?>
+--EXPECT--
+<wddxPacket version='1.0'><header/><data><string>A</string></data></wddxPacket>
+int(65)
+int(65)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>B</string></data></wddxPacket>
+int(66)
+int(66)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>C</string></data></wddxPacket>
+int(67)
+int(67)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>D</string></data></wddxPacket>
+int(68)
+int(68)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>E</string></data></wddxPacket>
+int(69)
+int(69)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>F</string></data></wddxPacket>
+int(70)
+int(70)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>G</string></data></wddxPacket>
+int(71)
+int(71)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>H</string></data></wddxPacket>
+int(72)
+int(72)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>I</string></data></wddxPacket>
+int(73)
+int(73)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>J</string></data></wddxPacket>
+int(74)
+int(74)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>K</string></data></wddxPacket>
+int(75)
+int(75)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>L</string></data></wddxPacket>
+int(76)
+int(76)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>M</string></data></wddxPacket>
+int(77)
+int(77)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>N</string></data></wddxPacket>
+int(78)
+int(78)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>O</string></data></wddxPacket>
+int(79)
+int(79)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>P</string></data></wddxPacket>
+int(80)
+int(80)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Q</string></data></wddxPacket>
+int(81)
+int(81)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>R</string></data></wddxPacket>
+int(82)
+int(82)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>S</string></data></wddxPacket>
+int(83)
+int(83)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>T</string></data></wddxPacket>
+int(84)
+int(84)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>U</string></data></wddxPacket>
+int(85)
+int(85)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>V</string></data></wddxPacket>
+int(86)
+int(86)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>W</string></data></wddxPacket>
+int(87)
+int(87)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>X</string></data></wddxPacket>
+int(88)
+int(88)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Y</string></data></wddxPacket>
+int(89)
+int(89)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Z</string></data></wddxPacket>
+int(90)
+int(90)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>[</string></data></wddxPacket>
+int(91)
+int(91)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>\</string></data></wddxPacket>
+int(92)
+int(92)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>]</string></data></wddxPacket>
+int(93)
+int(93)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>^</string></data></wddxPacket>
+int(94)
+int(94)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>_</string></data></wddxPacket>
+int(95)
+int(95)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>`</string></data></wddxPacket>
+int(96)
+int(96)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>a</string></data></wddxPacket>
+int(97)
+int(97)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>b</string></data></wddxPacket>
+int(98)
+int(98)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>c</string></data></wddxPacket>
+int(99)
+int(99)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>d</string></data></wddxPacket>
+int(100)
+int(100)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>e</string></data></wddxPacket>
+int(101)
+int(101)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>f</string></data></wddxPacket>
+int(102)
+int(102)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>g</string></data></wddxPacket>
+int(103)
+int(103)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>h</string></data></wddxPacket>
+int(104)
+int(104)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>i</string></data></wddxPacket>
+int(105)
+int(105)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>j</string></data></wddxPacket>
+int(106)
+int(106)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>k</string></data></wddxPacket>
+int(107)
+int(107)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>l</string></data></wddxPacket>
+int(108)
+int(108)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>m</string></data></wddxPacket>
+int(109)
+int(109)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>n</string></data></wddxPacket>
+int(110)
+int(110)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>o</string></data></wddxPacket>
+int(111)
+int(111)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>p</string></data></wddxPacket>
+int(112)
+int(112)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>q</string></data></wddxPacket>
+int(113)
+int(113)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>r</string></data></wddxPacket>
+int(114)
+int(114)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>s</string></data></wddxPacket>
+int(115)
+int(115)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>t</string></data></wddxPacket>
+int(116)
+int(116)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>u</string></data></wddxPacket>
+int(117)
+int(117)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>v</string></data></wddxPacket>
+int(118)
+int(118)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>w</string></data></wddxPacket>
+int(119)
+int(119)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>x</string></data></wddxPacket>
+int(120)
+int(120)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>y</string></data></wddxPacket>
+int(121)
+int(121)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>z</string></data></wddxPacket>
+int(122)
+int(122)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>{</string></data></wddxPacket>
+int(123)
+int(123)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>|</string></data></wddxPacket>
+int(124)
+int(124)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>}</string></data></wddxPacket>
+int(125)
+int(125)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>~</string></data></wddxPacket>
+int(126)
+int(126)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string></string></data></wddxPacket>
+int(127)
+int(127)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>€</string></data></wddxPacket>
+int(128)
+int(128)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Â</string></data></wddxPacket>
+int(129)
+int(129)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>‚</string></data></wddxPacket>
+int(130)
+int(130)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ƒ</string></data></wddxPacket>
+int(131)
+int(131)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>„</string></data></wddxPacket>
+int(132)
+int(132)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Â…</string></data></wddxPacket>
+int(133)
+int(133)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>†</string></data></wddxPacket>
+int(134)
+int(134)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>‡</string></data></wddxPacket>
+int(135)
+int(135)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ˆ</string></data></wddxPacket>
+int(136)
+int(136)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>‰</string></data></wddxPacket>
+int(137)
+int(137)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Š</string></data></wddxPacket>
+int(138)
+int(138)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>‹</string></data></wddxPacket>
+int(139)
+int(139)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Œ</string></data></wddxPacket>
+int(140)
+int(140)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Â</string></data></wddxPacket>
+int(141)
+int(141)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ÂŽ</string></data></wddxPacket>
+int(142)
+int(142)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Â</string></data></wddxPacket>
+int(143)
+int(143)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Â</string></data></wddxPacket>
+int(144)
+int(144)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>‘</string></data></wddxPacket>
+int(145)
+int(145)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Â’</string></data></wddxPacket>
+int(146)
+int(146)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>“</string></data></wddxPacket>
+int(147)
+int(147)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>”</string></data></wddxPacket>
+int(148)
+int(148)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>•</string></data></wddxPacket>
+int(149)
+int(149)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>–</string></data></wddxPacket>
+int(150)
+int(150)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>—</string></data></wddxPacket>
+int(151)
+int(151)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>˜</string></data></wddxPacket>
+int(152)
+int(152)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>™</string></data></wddxPacket>
+int(153)
+int(153)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>š</string></data></wddxPacket>
+int(154)
+int(154)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>›</string></data></wddxPacket>
+int(155)
+int(155)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>œ</string></data></wddxPacket>
+int(156)
+int(156)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Â</string></data></wddxPacket>
+int(157)
+int(157)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ž</string></data></wddxPacket>
+int(158)
+int(158)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ÿ</string></data></wddxPacket>
+int(159)
+int(159)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string> </string></data></wddxPacket>
+int(160)
+int(160)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¡</string></data></wddxPacket>
+int(161)
+int(161)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¢</string></data></wddxPacket>
+int(162)
+int(162)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>£</string></data></wddxPacket>
+int(163)
+int(163)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¤</string></data></wddxPacket>
+int(164)
+int(164)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Â¥</string></data></wddxPacket>
+int(165)
+int(165)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¦</string></data></wddxPacket>
+int(166)
+int(166)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>§</string></data></wddxPacket>
+int(167)
+int(167)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¨</string></data></wddxPacket>
+int(168)
+int(168)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>©</string></data></wddxPacket>
+int(169)
+int(169)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ª</string></data></wddxPacket>
+int(170)
+int(170)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>«</string></data></wddxPacket>
+int(171)
+int(171)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¬</string></data></wddxPacket>
+int(172)
+int(172)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>­</string></data></wddxPacket>
+int(173)
+int(173)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>®</string></data></wddxPacket>
+int(174)
+int(174)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¯</string></data></wddxPacket>
+int(175)
+int(175)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>°</string></data></wddxPacket>
+int(176)
+int(176)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>±</string></data></wddxPacket>
+int(177)
+int(177)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>²</string></data></wddxPacket>
+int(178)
+int(178)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>³</string></data></wddxPacket>
+int(179)
+int(179)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>´</string></data></wddxPacket>
+int(180)
+int(180)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>µ</string></data></wddxPacket>
+int(181)
+int(181)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¶</string></data></wddxPacket>
+int(182)
+int(182)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>·</string></data></wddxPacket>
+int(183)
+int(183)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¸</string></data></wddxPacket>
+int(184)
+int(184)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¹</string></data></wddxPacket>
+int(185)
+int(185)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>º</string></data></wddxPacket>
+int(186)
+int(186)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>»</string></data></wddxPacket>
+int(187)
+int(187)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¼</string></data></wddxPacket>
+int(188)
+int(188)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>½</string></data></wddxPacket>
+int(189)
+int(189)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¾</string></data></wddxPacket>
+int(190)
+int(190)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>¿</string></data></wddxPacket>
+int(191)
+int(191)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>À</string></data></wddxPacket>
+int(192)
+int(192)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ã</string></data></wddxPacket>
+int(193)
+int(193)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Â</string></data></wddxPacket>
+int(194)
+int(194)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ã</string></data></wddxPacket>
+int(195)
+int(195)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ä</string></data></wddxPacket>
+int(196)
+int(196)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ã…</string></data></wddxPacket>
+int(197)
+int(197)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Æ</string></data></wddxPacket>
+int(198)
+int(198)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ç</string></data></wddxPacket>
+int(199)
+int(199)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>È</string></data></wddxPacket>
+int(200)
+int(200)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>É</string></data></wddxPacket>
+int(201)
+int(201)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ê</string></data></wddxPacket>
+int(202)
+int(202)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ë</string></data></wddxPacket>
+int(203)
+int(203)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ì</string></data></wddxPacket>
+int(204)
+int(204)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ã</string></data></wddxPacket>
+int(205)
+int(205)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ÃŽ</string></data></wddxPacket>
+int(206)
+int(206)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ã</string></data></wddxPacket>
+int(207)
+int(207)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ã</string></data></wddxPacket>
+int(208)
+int(208)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ñ</string></data></wddxPacket>
+int(209)
+int(209)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ã’</string></data></wddxPacket>
+int(210)
+int(210)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ó</string></data></wddxPacket>
+int(211)
+int(211)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ô</string></data></wddxPacket>
+int(212)
+int(212)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Õ</string></data></wddxPacket>
+int(213)
+int(213)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ö</string></data></wddxPacket>
+int(214)
+int(214)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>×</string></data></wddxPacket>
+int(215)
+int(215)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ø</string></data></wddxPacket>
+int(216)
+int(216)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ù</string></data></wddxPacket>
+int(217)
+int(217)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ú</string></data></wddxPacket>
+int(218)
+int(218)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Û</string></data></wddxPacket>
+int(219)
+int(219)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ü</string></data></wddxPacket>
+int(220)
+int(220)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ã</string></data></wddxPacket>
+int(221)
+int(221)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Þ</string></data></wddxPacket>
+int(222)
+int(222)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ß</string></data></wddxPacket>
+int(223)
+int(223)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>à</string></data></wddxPacket>
+int(224)
+int(224)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>á</string></data></wddxPacket>
+int(225)
+int(225)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>â</string></data></wddxPacket>
+int(226)
+int(226)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ã</string></data></wddxPacket>
+int(227)
+int(227)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ä</string></data></wddxPacket>
+int(228)
+int(228)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>Ã¥</string></data></wddxPacket>
+int(229)
+int(229)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>æ</string></data></wddxPacket>
+int(230)
+int(230)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ç</string></data></wddxPacket>
+int(231)
+int(231)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>è</string></data></wddxPacket>
+int(232)
+int(232)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>é</string></data></wddxPacket>
+int(233)
+int(233)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ê</string></data></wddxPacket>
+int(234)
+int(234)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ë</string></data></wddxPacket>
+int(235)
+int(235)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ì</string></data></wddxPacket>
+int(236)
+int(236)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>í</string></data></wddxPacket>
+int(237)
+int(237)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>î</string></data></wddxPacket>
+int(238)
+int(238)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ï</string></data></wddxPacket>
+int(239)
+int(239)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ð</string></data></wddxPacket>
+int(240)
+int(240)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ñ</string></data></wddxPacket>
+int(241)
+int(241)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ò</string></data></wddxPacket>
+int(242)
+int(242)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ó</string></data></wddxPacket>
+int(243)
+int(243)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ô</string></data></wddxPacket>
+int(244)
+int(244)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>õ</string></data></wddxPacket>
+int(245)
+int(245)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ö</string></data></wddxPacket>
+int(246)
+int(246)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>÷</string></data></wddxPacket>
+int(247)
+int(247)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ø</string></data></wddxPacket>
+int(248)
+int(248)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ù</string></data></wddxPacket>
+int(249)
+int(249)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ú</string></data></wddxPacket>
+int(250)
+int(250)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>û</string></data></wddxPacket>
+int(251)
+int(251)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ü</string></data></wddxPacket>
+int(252)
+int(252)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ý</string></data></wddxPacket>
+int(253)
+int(253)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>þ</string></data></wddxPacket>
+int(254)
+int(254)
+bool(true)
+<wddxPacket version='1.0'><header/><data><string>ÿ</string></data></wddxPacket>
+int(255)
+int(255)
+bool(true) \ No newline at end of file
diff --git a/ext/wddx/tests/bug37587.phpt b/ext/wddx/tests/bug37587.phpt
new file mode 100755
index 000000000..5361d38da
--- /dev/null
+++ b/ext/wddx/tests/bug37587.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #37587 (var without attribute causes segfault)
+--SKIPIF--
+<?php if (!extension_loaded("wddx")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(wddx_deserialize(file_get_contents(<<<EOF
+data:,<wddxPacket version='1.0'>
+<header/>
+<data>
+ <array length='1'>
+ <var>
+ <struct>
+ <var name='test'><string>Hello World</string></var>
+ </struct>
+ </var>
+ </array>
+</data>
+</wddxPacket>
+EOF
+)));
+
+?>
+===DONE===
+--EXPECT--
+array(1) {
+ [0]=>
+ array(1) {
+ ["test"]=>
+ string(11) "Hello World"
+ }
+}
+===DONE===
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index ebc13866d..fffaa6aeb 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: wddx.c,v 1.119.2.11 2006/05/25 10:01:30 helly Exp $ */
+/* $Id: wddx.c,v 1.119.2.10.2.6 2006/08/02 22:03:47 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -366,53 +366,22 @@ void php_wddx_packet_end(wddx_packet *packet)
/* {{{ php_wddx_serialize_string
*/
-static void php_wddx_serialize_string(wddx_packet *packet, zval *var)
+static void php_wddx_serialize_string(wddx_packet *packet, zval *var TSRMLS_DC)
{
- 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, "&lt;");
- break;
-
- case '&':
- FLUSH_BUF();
- php_wddx_add_chunk_static(packet, "&amp;");
- break;
-
- case '>':
- FLUSH_BUF();
- php_wddx_add_chunk_static(packet, "&gt;");
- 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;
- }
- }
+ char *buf, *enc;
+ int buf_len, enc_len;
+
+ buf = php_escape_html_entities(Z_STRVAL_P(var), Z_STRLEN_P(var), &buf_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
+ enc = xml_utf8_encode(buf, buf_len, &enc_len, "ISO-8859-1");
+
+ php_wddx_add_chunk_ex(packet, enc, enc_len);
- FLUSH_BUF();
efree(buf);
+ efree(enc);
}
-
php_wddx_add_chunk_static(packet, WDDX_STRING_E);
}
/* }}} */
@@ -529,7 +498,7 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
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_ex(key, key_len, &class_name, &prop_name);
+ zend_unmangle_property_name(key, key_len-1, &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);
@@ -638,7 +607,7 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name
switch(Z_TYPE_P(var)) {
case IS_STRING:
- php_wddx_serialize_string(packet, var);
+ php_wddx_serialize_string(packet, var TSRMLS_CC);
break;
case IS_LONG:
@@ -657,7 +626,7 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name
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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "WDDX doesn't support circular references");
return;
}
ht->nApplyCount++;
@@ -668,7 +637,7 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, char *name, int name
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");
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "WDDX doesn't support circular references");
return;
}
ht->nApplyCount++;
@@ -723,7 +692,7 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
if (!strcmp(name, EL_PACKET)) {
int i;
- for (i=0; atts[i]; i++) {
+ if (atts) for (i=0; atts[i]; i++) {
if (!strcmp(atts[i], EL_VERSION)) {
/* nothing for now */
}
diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h
index cb6dc0735..2168c5e4b 100644
--- a/ext/xml/php_xml.h
+++ b/ext/xml/php_xml.h
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_xml.h,v 1.28.2.2 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: php_xml.h,v 1.28.2.2.2.2 2006/08/02 15:21:54 iliaa Exp $ */
#ifndef PHP_XML_H
#define PHP_XML_H
@@ -45,9 +45,9 @@ extern zend_module_entry xml_module_entry;
#error "UTF-16 Unicode support not implemented!"
#endif
-typedef struct {
+ZEND_BEGIN_MODULE_GLOBALS(xml)
XML_Char *default_encoding;
-} php_xml_globals;
+ZEND_END_MODULE_GLOBALS(xml)
typedef struct {
int index;
@@ -141,13 +141,14 @@ 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 *);
+PHPAPI char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_Char *encoding);
#endif /* HAVE_LIBEXPAT */
#define phpext_xml_ptr xml_module_ptr
#ifdef ZTS
-#define XML(v) TSRMG(xml_globals_id, php_xml_globals *, v)
+#define XML(v) TSRMG(xml_globals_id, zend_xml_globals *, v)
#else
#define XML(v) (xml_globals.v)
#endif
diff --git a/ext/xml/tests/bug32001.phpt b/ext/xml/tests/bug32001.phpt
index e9780016c..0853b3ab1 100644
--- a/ext/xml/tests/bug32001.phpt
+++ b/ext/xml/tests/bug32001.phpt
@@ -151,9 +151,7 @@ $suite = array(
);
if (XML_SAX_IMPL == 'libxml') {
- $php = getenv('TEST_PHP_EXECUTABLE');
- preg_match("/^libxml2 Version.*\$/im", `$php -i`, $match);
- echo $match[0], "\n";
+ echo "libxml2 Version => " . LIBXML_DOTTED_VERSION. "\n";
} else {
echo "libxml2 Version => NONE\n";
}
diff --git a/ext/xml/tests/xml011.phpt b/ext/xml/tests/xml011.phpt
new file mode 100644
index 000000000..9c4cfca8f
--- /dev/null
+++ b/ext/xml/tests/xml011.phpt
@@ -0,0 +1,71 @@
+--TEST--
+XML Parser test: concat character data and set empty handlers
+--SKIPIF--
+<?php
+require_once("skipif.inc");
+?>
+--FILE--
+<?php
+function start_elem($parser,$name,$attribs) {
+ echo "<$name>";
+}
+function end_elem()
+{
+ echo "</$name>";
+}
+
+$xml = '<text>start<b /> This &amp; that</text>';
+
+$parser = xml_parser_create();
+xml_parse_into_struct($parser, $xml, $vals, $index);
+print_r($vals);
+xml_parser_free($parser);
+
+echo "\nChange to empty end handler\n";
+$parser = xml_parser_create();
+xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
+xml_set_element_handler($parser,'start_elem','end_elem');
+xml_set_element_handler($parser,'start_elem',NULL);
+xml_parse($parser, $xml, TRUE);
+
+xml_parser_free($parser);
+echo "\nDone\n";
+?>
+--EXPECT--
+Array
+(
+ [0] => Array
+ (
+ [tag] => TEXT
+ [type] => open
+ [level] => 1
+ [value] => start
+ )
+
+ [1] => Array
+ (
+ [tag] => B
+ [type] => complete
+ [level] => 2
+ )
+
+ [2] => Array
+ (
+ [tag] => TEXT
+ [value] => This & that
+ [type] => cdata
+ [level] => 1
+ )
+
+ [3] => Array
+ (
+ [tag] => TEXT
+ [type] => close
+ [level] => 1
+ )
+
+)
+
+Change to empty end handler
+<text><b>
+Done
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index d62052bb7..9434a39eb 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xml.c,v 1.157.2.4 2006/02/02 21:43:09 tony2001 Exp $ */
+/* $Id: xml.c,v 1.157.2.4.2.3 2006/08/15 22:47:10 rrichards Exp $ */
#define IS_EXT_MODULE
@@ -57,11 +57,7 @@
* - Weird things happen with <![CDATA[]]> sections.
*/
-#ifdef ZTS
-int xml_globals_id;
-#else
-PHP_XML_API php_xml_globals xml_globals;
-#endif
+ZEND_DECLARE_MODULE_GLOBALS(xml)
/* {{{ dynamically loadable module stuff */
#ifdef COMPILE_DL_XML
@@ -75,6 +71,7 @@ ZEND_GET_MODULE(xml)
/* {{{ function prototypes */
PHP_MINIT_FUNCTION(xml);
PHP_MINFO_FUNCTION(xml);
+static PHP_GINIT_FUNCTION(xml);
static void xml_parser_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC);
static void xml_set_handler(zval **, zval **);
@@ -82,7 +79,6 @@ 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 *);
@@ -161,7 +157,11 @@ zend_module_entry xml_module_entry = {
NULL, /* per-request shutdown function */
PHP_MINFO(xml), /* information function */
NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(xml), /* globals descriptor */
+ PHP_GINIT(xml), /* globals ctor */
+ NULL, /* globals dtor */
+ NULL, /* post deactivate */
+ STANDARD_MODULE_PROPERTIES_EX
};
/* All the encoding functions are set to NULL right now, since all
@@ -182,12 +182,10 @@ 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)
+static PHP_GINIT_FUNCTION(xml)
{
- XML(default_encoding) = "UTF-8";
+ xml_globals->default_encoding = "UTF-8";
}
-#endif
static void *php_xml_malloc_wrapper(size_t sz)
{
@@ -210,12 +208,6 @@ 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);
@@ -388,7 +380,12 @@ static void xml_set_handler(zval **handler, zval **data)
/* IS_ARRAY might indicate that we're using array($obj, 'method') syntax */
if (Z_TYPE_PP(data) != IS_ARRAY) {
+
convert_to_string_ex(data);
+ if (Z_STRLEN_PP(data) == 0) {
+ *handler = NULL;
+ return;
+ }
}
zval_add_ref(data);
@@ -504,7 +501,7 @@ static xml_encoding *xml_get_encoding(const XML_Char *name)
/* }}} */
/* {{{ xml_utf8_encode */
-static XML_Char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_Char *encoding)
+PHPAPI char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_Char *encoding)
{
int pos = len;
char *newbuf;
@@ -865,6 +862,25 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
} else {
zval *tag;
+ zval **curtag, **mytype, **myval;
+ HashPosition hpos=NULL;
+
+ zend_hash_internal_pointer_end_ex(Z_ARRVAL_P(parser->data), &hpos);
+
+ if (hpos && (zend_hash_get_current_data_ex(Z_ARRVAL_P(parser->data), (void **) &curtag, &hpos) == SUCCESS)) {
+ if (zend_hash_find(Z_ARRVAL_PP(curtag),"type",sizeof("type"),(void **) &mytype) == SUCCESS) {
+ if (!strcmp(Z_STRVAL_PP(mytype), "cdata")) {
+ if (zend_hash_find(Z_ARRVAL_PP(curtag),"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);
+ return;
+ }
+ }
+ }
+ }
MAKE_STD_ZVAL(tag);
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c
index 1f764b49d..7aa3022d3 100644
--- a/ext/xmlreader/php_xmlreader.c
+++ b/ext/xmlreader/php_xmlreader.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_xmlreader.c,v 1.13.2.14 2006/04/03 14:59:30 tony2001 Exp $ */
+/* $Id: php_xmlreader.c,v 1.13.2.14.2.5 2006/10/04 13:30:53 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -35,26 +35,29 @@
zend_class_entry *xmlreader_class_entry;
static zend_object_handlers xmlreader_object_handlers;
+static zend_object_handlers xmlreader_object_handlers_ze1;
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_char_t read_char_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
+
/* {{{ xmlreader_register_prop_handler */
-static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name, xmlreader_read_int_t read_int_func, xmlreader_read_char_t read_char_func, int rettype TSRMLS_DC)
+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;
@@ -68,7 +71,7 @@ static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name,
/* {{{ xmlreader_property_reader */
static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handler *hnd, zval **retval TSRMLS_DC)
{
- char *retchar = NULL;
+ const xmlChar *retchar = NULL;
int retint = 0;
if (obj->ptr != NULL) {
@@ -90,8 +93,7 @@ static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handl
switch (hnd->type) {
case IS_STRING:
if (retchar) {
- ZVAL_STRING(*retval, retchar, 1);
- xmlFree(retchar);
+ ZVAL_STRING(*retval, (xmlChar *) retchar, 1);
} else {
ZVAL_EMPTY_STRING(*retval);
}
@@ -258,9 +260,9 @@ char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int reso
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);
+ if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) {
+ xmlFreeURI(uri);
+ return NULL;
}
file_dest = resolved_path;
}
@@ -350,6 +352,14 @@ void xmlreader_objects_clone(void *object, void **object_clone TSRMLS_DC)
}
/* }}} */
+/* {{{ xmlreader_objects_ze1_clone_obj */
+zend_object_value xmlreader_objects_ze1_clone_obj(zval *object TSRMLS_DC)
+{
+ php_error(E_ERROR, "Cannot clone object of class %s due to 'zend.ze1_compatibility_mode'", Z_OBJCE_P(object)->name);
+ return object->value.obj;
+}
+/* }}} */
+
/* {{{ xmlreader_free_resources */
static void xmlreader_free_resources(xmlreader_object *intern) {
if (intern) {
@@ -377,20 +387,8 @@ void xmlreader_objects_free_storage(void *object TSRMLS_DC)
{
xmlreader_object *intern = (xmlreader_object *)object;
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1 && PHP_RELEASE_VERSION > 2) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
zend_object_std_dtor(&intern->std TSRMLS_CC);
-#else
- if (intern->std.guards) {
- zend_hash_destroy(intern->std.guards);
- FREE_HASHTABLE(intern->std.guards);
- }
-
- if (intern->std.properties) {
- zend_hash_destroy(intern->std.properties);
- FREE_HASHTABLE(intern->std.properties);
- }
-#endif
-
+
xmlreader_free_resources(intern);
efree(object);
@@ -405,25 +403,17 @@ zend_object_value xmlreader_objects_new(zend_class_entry *class_type TSRMLS_DC)
zval *tmp;
intern = emalloc(sizeof(xmlreader_object));
+ memset(&intern->std, 0, sizeof(zend_object));
intern->ptr = NULL;
intern->input = NULL;
intern->schema = NULL;
intern->prop_handler = &xmlreader_prop_handlers;
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1 && PHP_RELEASE_VERSION > 2) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
-#else
- ALLOC_HASHTABLE(intern->std.properties);
- zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-
- intern->std.ce = class_type;
- intern->std.guards = NULL;
-#endif
-
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) xmlreader_objects_free_storage, xmlreader_objects_clone TSRMLS_CC);
intern->handle = retval.handle;
- retval.handlers = &xmlreader_object_handlers;
+ retval.handlers = EG(ze1_compatibility_mode) ? &xmlreader_object_handlers_ze1 : &xmlreader_object_handlers;
return retval;
}
/* }}} */
@@ -481,7 +471,8 @@ static void php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_in
}
/* }}} */
-/* This function not yet needed until some additional functions are implemented in libxml
+#if LIBXML_VERSION >= 20620
+/* {{{ php_xmlreader_no_arg_string */
static void php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_char_t internal_function) {
zval *id;
char *retchar = NULL;
@@ -491,7 +482,7 @@ static void php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAMETERS, xmlreader_
intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern && intern->ptr) {
- retchar = xmlTextReaderReadString(intern->ptr);
+ retchar = internal_function(intern->ptr);
}
if (retchar) {
RETVAL_STRING(retchar, 1);
@@ -501,7 +492,8 @@ static void php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAMETERS, xmlreader_
RETVAL_EMPTY_STRING();
}
}
-*/
+/* }}} */
+#endif
/* {{{ php_xmlreader_set_relaxng_schema */
static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int type) {
@@ -876,18 +868,20 @@ PHP_METHOD(xmlreader, next)
}
/* }}} */
-/* {{{ proto boolean XMLReader::open(string URI)
+/* {{{ proto boolean XMLReader::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;
+ int source_len = 0, encoding_len = 0;
+ long options = 0;
xmlreader_object *intern = NULL;
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", &source, &source_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
return;
}
@@ -909,7 +903,7 @@ PHP_METHOD(xmlreader, open)
valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
if (valid_file) {
- reader = xmlNewTextReaderFilename(valid_file);
+ reader = xmlReaderForFile(valid_file, encoding, options);
}
if (reader == NULL) {
@@ -932,26 +926,78 @@ PHP_METHOD(xmlreader, open)
/* }}} */
/* Not Yet Implemented in libxml - functions exist just not coded
+PHP_METHOD(xmlreader, resetState)
+{
+
+}
+*/
+
+#if LIBXML_VERSION >= 20620
+/* {{{ proto boolean XMLReader::readInnerXml()
+Reads the contents of the current node, including child nodes and markup. */
PHP_METHOD(xmlreader, readInnerXml)
{
php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadInnerXml);
}
+/* }}} */
+/* {{{ proto boolean XMLReader::readOuterXml()
+Reads the contents of the current node, including child nodes and markup. */
PHP_METHOD(xmlreader, readOuterXml)
{
- php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadInnerXml);
+ php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadOuterXml);
}
+/* }}} */
+/* {{{ proto boolean XMLReader::readString()
+Reads the contents of an element or a text node as a string. */
PHP_METHOD(xmlreader, readString)
{
php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadString);
}
+/* }}} */
-PHP_METHOD(xmlreader, resetState)
+/* {{{ proto boolean XMLReader::setSchema(string filename)
+Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). */
+PHP_METHOD(xmlreader, setSchema)
{
+#ifdef LIBXML_SCHEMAS_ENABLED
+ zval *id;
+ int source_len = 0, retval = -1;
+ xmlreader_object *intern;
+ 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 required");
+ RETURN_FALSE;
+ }
+
+ id = getThis();
+
+ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+ if (intern && intern->ptr) {
+ retval = xmlTextReaderSchemaValidate(intern->ptr, source);
+
+ if (retval == 0) {
+ 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
}
-*/
+/* }}} */
+#endif
/* {{{ proto boolean XMLReader::setParserProperty(int property, boolean value)
Sets parser property (one of the parser option constants).
@@ -959,7 +1005,8 @@ Properties must be set after open() or XML() and before the first read() is call
PHP_METHOD(xmlreader, setParserProperty)
{
zval *id;
- int property, retval = -1;
+ long property;
+ int retval = -1;
zend_bool value;
xmlreader_object *intern;
@@ -982,7 +1029,7 @@ PHP_METHOD(xmlreader, setParserProperty)
}
/* }}} */
-/* {{{ proto boolean XMLReader::setRelaxNGSchemaSource(string filename)
+/* {{{ proto boolean XMLReader::setRelaxNGSchema(string filename)
Sets the string that the the XMLReader will parse. */
PHP_METHOD(xmlreader, setRelaxNGSchema)
{
@@ -998,20 +1045,27 @@ PHP_METHOD(xmlreader, setRelaxNGSchemaSource)
}
/* }}} */
-/* {{{ proto boolean XMLReader::XML(string source)
+/* TODO
+XMLPUBFUN int XMLCALL
+ xmlTextReaderSetSchema (xmlTextReaderPtr reader,
+ xmlSchemaPtr schema);
+*/
+
+/* {{{ proto boolean XMLReader::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;
+ int source_len = 0, encoding_len = 0;
+ long options = 0;
xmlreader_object *intern = NULL;
- char *source, *uri = NULL;
+ char *source, *uri = NULL, *encoding = NULL;
int resolved_path_len;
char *directory=NULL, resolved_path[MAXPATHLEN];
xmlParserInputBufferPtr inputbfr;
xmlTextReaderPtr reader;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &source_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
return;
}
@@ -1054,15 +1108,12 @@ PHP_METHOD(xmlreader, XML)
if (id == NULL) {
object_init_ex(return_value, xmlreader_class_entry);
intern = (xmlreader_object *)zend_objects_get_address(return_value TSRMLS_CC);
- intern->input = inputbfr;
- intern->ptr = reader;
- return;
} else {
- intern->input = inputbfr;
- intern->ptr = reader;
- RETURN_TRUE;
-
+ RETVAL_TRUE;
}
+ intern->input = inputbfr;
+ intern->ptr = reader;
+ return;
}
}
@@ -1095,7 +1146,12 @@ PHP_METHOD(xmlreader, expand)
RETURN_FALSE;
} else {
nodec = xmlCopyNode(node, 1);
- DOM_RET_OBJ(rv, nodec, &ret, NULL);
+ if (nodec == NULL) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot expand this node type");
+ RETURN_FALSE;
+ } else {
+ DOM_RET_OBJ(rv, nodec, &ret, NULL);
+ }
}
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to expand");
@@ -1125,10 +1181,13 @@ static zend_function_entry xmlreader_functions[] = {
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)
-/* Not Yet Implemented though defined in libxml as of 2.6.9dev
+#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)
+ PHP_ME(xmlreader, setSchema, 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)
@@ -1151,25 +1210,31 @@ PHP_MINIT_FUNCTION(xmlreader)
xmlreader_object_handlers.write_property = xmlreader_write_property;
xmlreader_object_handlers.get_property_ptr_ptr = xmlreader_get_property_ptr_ptr;
+ memcpy(&xmlreader_object_handlers_ze1, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ xmlreader_object_handlers_ze1.read_property = xmlreader_read_property;
+ xmlreader_object_handlers_ze1.write_property = xmlreader_write_property;
+ xmlreader_object_handlers_ze1.get_property_ptr_ptr = xmlreader_get_property_ptr_ptr;
+ xmlreader_object_handlers_ze1.clone_obj = xmlreader_objects_ze1_clone_obj;
+
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, xmlTextReaderBaseUri, IS_STRING 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, xmlTextReaderLocalName, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "name", NULL, xmlTextReaderName, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "namespaceURI", NULL, xmlTextReaderNamespaceUri, IS_STRING 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, xmlTextReaderPrefix, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "value", NULL, xmlTextReaderValue, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "xmlLang", NULL, xmlTextReaderXmlLang, IS_STRING 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 */
diff --git a/ext/xmlreader/php_xmlreader.h b/ext/xmlreader/php_xmlreader.h
index bf406e1b8..68045906f 100644
--- a/ext/xmlreader/php_xmlreader.h
+++ b/ext/xmlreader/php_xmlreader.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_xmlreader.h,v 1.3.2.2 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: php_xmlreader.h,v 1.3.2.2.2.1 2006/05/10 12:04:46 rrichards Exp $ */
#ifndef PHP_XMLREADER_H
#define PHP_XMLREADER_H
@@ -40,9 +40,7 @@ extern zend_module_entry xmlreader_module_entry;
typedef struct _xmlreader_object {
zend_object std;
xmlTextReaderPtr ptr;
- /* input is used to allow strings to be loaded under libxml 2.5.x
- must manually allocate and de-allocate these - can be refactored when
- libxml 2.6.x becomes minimum version */
+ /* strings must be set in input buffer as copy is required */
xmlParserInputBufferPtr input;
void *schema;
HashTable *prop_handler;
diff --git a/ext/xmlreader/tests/013.phpt b/ext/xmlreader/tests/013.phpt
new file mode 100755
index 000000000..673aa9ca9
--- /dev/null
+++ b/ext/xmlreader/tests/013.phpt
@@ -0,0 +1,52 @@
+--TEST--
+XMLReader: Schema validation
+--SKIPIF--
+<?php if (!extension_loaded('xmlreader')) die('skip');?>
+<?php if (!method_exists('XMLReader','setSchema')) die('skip XMLReader::setSchema() not supported');?>
+--FILE--
+<?php
+/* $Id: 013.phpt,v 1.1.2.2 2006/05/10 12:04:46 rrichards Exp $ */
+
+$xml =<<<EOF
+<?xml version="1.0" encoding="UTF-8" ?>
+<items>
+ <item>123</item>
+ <item>456</item>
+</items>
+EOF;
+
+$reader = new XMLReader();
+$reader->XML($xml);
+$reader->setSchema(dirname(__FILE__) . '/013.xsd');
+while($reader->read()) {
+ if ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'item') {
+ $reader->read();
+ var_dump($reader->value);
+ }
+}
+$reader->close();
+
+?>
+===FAIL===
+<?php
+
+$xml =<<<EOF
+<?xml version="1.0" encoding="UTF-8" ?>
+<foo/>
+EOF;
+
+$reader = new XMLReader();
+$reader->XML($xml);
+$reader->setSchema(dirname(__FILE__) . '/013.xsd');
+while($reader->read() && $reader->nodeType != XMLReader::ELEMENT);
+$reader->close();
+
+?>
+===DONE===
+--EXPECTF--
+string(3) "123"
+string(3) "456"
+===FAIL===
+
+Warning: XMLReader::read(): Element 'foo': %s
+===DONE===
diff --git a/ext/xmlreader/tests/013.xsd b/ext/xmlreader/tests/013.xsd
new file mode 100755
index 000000000..50b000b6f
--- /dev/null
+++ b/ext/xmlreader/tests/013.xsd
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="items">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="item" type="xsd:integer" minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+</xsd:schema>
diff --git a/ext/xmlreader/tests/bug36743.phpt b/ext/xmlreader/tests/bug36743.phpt
index 45747d49f..374941b0c 100644
--- a/ext/xmlreader/tests/bug36743.phpt
+++ b/ext/xmlreader/tests/bug36743.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #36743 (In a class extending XMLReader array properties are not writable)
+--SKIPIF--
+<?php if (!extension_loaded("xmlreader")) print "skip"; ?>
--FILE--
<?php
diff --git a/ext/xmlrpc/libxmlrpc/xml_element.c b/ext/xmlrpc/libxmlrpc/xml_element.c
index 073105638..15fc3bf0b 100644
--- a/ext/xmlrpc/libxmlrpc/xml_element.c
+++ b/ext/xmlrpc/libxmlrpc/xml_element.c
@@ -31,7 +31,7 @@
*/
-static const char rcsid[] = "#(@) $Id: xml_element.c,v 1.9 2005/04/22 11:06:53 jorton Exp $";
+static const char rcsid[] = "#(@) $Id: xml_element.c,v 1.9.4.1 2006/07/30 11:34:02 tony2001 Exp $";
@@ -44,6 +44,9 @@ static const char rcsid[] = "#(@) $Id: xml_element.c,v 1.9 2005/04/22 11:06:53 j
* 06/2000
* HISTORY
* $Log: xml_element.c,v $
+ * Revision 1.9.4.1 2006/07/30 11:34:02 tony2001
+ * MFH: fix compile warnings (#38257)
+ *
* Revision 1.9 2005/04/22 11:06:53 jorton
* Fixed bug #32797 (invalid C code in xmlrpc extension).
*
@@ -697,8 +700,8 @@ xml_element* xml_elem_parse_buf(const char* in_buf, int len, XML_ELEM_INPUT_OPTI
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);
+ XML_SetElementHandler(parser, (XML_StartElementHandler)_xmlrpc_startElement, (XML_EndElementHandler)_xmlrpc_endElement);
+ XML_SetCharacterDataHandler(parser, (XML_CharacterDataHandler)_xmlrpc_charHandler);
/* pass the xml_elem_data struct along */
XML_SetUserData(parser, (void*)&mydata);
diff --git a/ext/xmlrpc/tests/001.phpt b/ext/xmlrpc/tests/001.phpt
new file mode 100644
index 000000000..99fd958d2
--- /dev/null
+++ b/ext/xmlrpc/tests/001.phpt
@@ -0,0 +1,66 @@
+--TEST--
+xmlrpc_encode_request() with wrong arguments
+--SKIPIF--
+<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(xmlrpc_encode_request(-1, 1));
+var_dump(xmlrpc_encode_request("", 1));
+var_dump(xmlrpc_encode_request(array(), 1));
+var_dump(xmlrpc_encode_request(3.4, 1));
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(174) "<?xml version="1.0" encoding="iso-8859-1"?>
+<methodCall>
+<methodName>-1</methodName>
+<params>
+ <param>
+ <value>
+ <int>1</int>
+ </value>
+ </param>
+</params>
+</methodCall>
+"
+string(160) "<?xml version="1.0" encoding="iso-8859-1"?>
+<methodCall>
+<methodName/>
+<params>
+ <param>
+ <value>
+ <int>1</int>
+ </value>
+ </param>
+</params>
+</methodCall>
+"
+
+Notice: Array to string conversion in %s on line %d
+string(177) "<?xml version="1.0" encoding="iso-8859-1"?>
+<methodCall>
+<methodName>Array</methodName>
+<params>
+ <param>
+ <value>
+ <int>1</int>
+ </value>
+ </param>
+</params>
+</methodCall>
+"
+string(175) "<?xml version="1.0" encoding="iso-8859-1"?>
+<methodCall>
+<methodName>3.4</methodName>
+<params>
+ <param>
+ <value>
+ <int>1</int>
+ </value>
+ </param>
+</params>
+</methodCall>
+"
+Done
diff --git a/ext/xmlrpc/tests/002.phpt b/ext/xmlrpc/tests/002.phpt
new file mode 100644
index 000000000..c8d722b80
--- /dev/null
+++ b/ext/xmlrpc/tests/002.phpt
@@ -0,0 +1,56 @@
+--TEST--
+xmlrpc_encode_request() and various arguments
+--SKIPIF--
+<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
+--FILE--
+<?php
+
+$r = xmlrpc_encode_request("method", array());
+var_dump(xmlrpc_decode_request($r, $method));
+var_dump($method);
+
+$r = xmlrpc_encode_request("method", 1);
+var_dump(xmlrpc_decode_request($r, $method));
+var_dump($method);
+
+$r = xmlrpc_encode_request("method", 'param');
+var_dump(xmlrpc_decode_request($r, $method));
+var_dump($method);
+
+$r = xmlrpc_encode_request(-1, "");
+var_dump(xmlrpc_decode_request($r, $method));
+var_dump($method);
+
+$r = xmlrpc_encode_request(array(), 1);
+var_dump(xmlrpc_decode_request($r, $method));
+var_dump($method);
+
+echo "Done\n";
+?>
+--EXPECTF--
+array(0) {
+}
+string(6) "method"
+array(1) {
+ [0]=>
+ int(1)
+}
+string(6) "method"
+array(1) {
+ [0]=>
+ string(5) "param"
+}
+string(6) "method"
+array(1) {
+ [0]=>
+ string(0) ""
+}
+string(2) "-1"
+
+Notice: Array to string conversion in %s on line %d
+array(1) {
+ [0]=>
+ int(1)
+}
+string(5) "Array"
+Done
diff --git a/ext/xmlrpc/tests/bug37057.phpt b/ext/xmlrpc/tests/bug37057.phpt
index 0764d8af6..013cc9192 100644
--- a/ext/xmlrpc/tests/bug37057.phpt
+++ b/ext/xmlrpc/tests/bug37057.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #37057 (xmlrpc_decode() may produce arrays with numeric string keys which are unaccessible)
+--SKIPIF--
+<?php if (!extension_loaded("xmlrpc")) print "skip"; ?>
--FILE--
<?php
$response='<?xml version="1.0"?>
diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c
index 9a043e59e..d52486006 100644
--- a/ext/xmlrpc/xmlrpc-epi-php.c
+++ b/ext/xmlrpc/xmlrpc-epi-php.c
@@ -51,7 +51,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xmlrpc-epi-php.c,v 1.39.2.7 2006/08/11 19:16:29 tony2001 Exp $ */
+/* $Id: xmlrpc-epi-php.c,v 1.39.2.5.2.2 2006/08/14 08:18:01 tony2001 Exp $ */
/**********************************************************************
* BUGS: *
@@ -671,6 +671,7 @@ PHP_FUNCTION(xmlrpc_encode_request)
if (Z_TYPE_PP(method) == IS_NULL) {
XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_response);
} else {
+ convert_to_string_ex(method);
XMLRPC_RequestSetMethodName(xRequest, Z_STRVAL_PP(method));
XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call);
}
@@ -740,7 +741,7 @@ zval* decode_request_worker (zval* xml_in, zval* encoding_in, zval* method_name_
if(XMLRPC_RequestGetRequestType(response) == xmlrpc_request_call) {
if(method_name_out) {
- convert_to_string(method_name_out);
+ zval_dtor(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));
@@ -1468,7 +1469,7 @@ PHP_FUNCTION(xmlrpc_get_type)
type = get_zval_xmlrpc_type(*arg, 0);
if (type == xmlrpc_vector) {
- vtype = determine_vector_type(Z_ARRVAL_PP(arg));
+ vtype = determine_vector_type((Z_TYPE_PP(arg) == IS_OBJECT) ? Z_OBJPROP_PP(arg) : Z_ARRVAL_PP(arg));
}
RETURN_STRING((char*) xmlrpc_type_as_str(type, vtype), 1);
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
index 72c035bd9..0daa00e4a 100644
--- a/ext/xmlwriter/php_xmlwriter.c
+++ b/ext/xmlwriter/php_xmlwriter.c
@@ -7,7 +7,7 @@
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
+ | http://www.php.net/license/3_01.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_xmlwriter.c,v 1.20.2.12 2006/04/03 14:59:30 tony2001 Exp $ */
+/* $Id: php_xmlwriter.c,v 1.20.2.12.2.5 2006/09/16 18:18:55 nlopess Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -34,6 +34,9 @@ zend_class_entry *xmlwriter_class_entry;
static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC);
static void xmlwriter_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC);
+typedef int (*xmlwriter_read_one_char_t)(xmlTextWriterPtr writer, const xmlChar *content);
+typedef int (*xmlwriter_read_int_t)(xmlTextWriterPtr writer);
+
/* {{{ xmlwriter_object_free_storage */
static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC)
{
@@ -77,21 +80,8 @@ static void xmlwriter_object_free_storage(void *object TSRMLS_DC)
xmlwriter_free_resource_ptr(intern->xmlwriter_ptr TSRMLS_CC);
}
intern->xmlwriter_ptr = NULL;
-
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1 && PHP_RELEASE_VERSION > 2) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
zend_object_std_dtor(&intern->zo TSRMLS_CC);
-#else
- if (intern->zo.guards) {
- zend_hash_destroy(intern->zo.guards);
- FREE_HASHTABLE(intern->zo.guards);
- }
-
- if (intern->zo.properties) {
- zend_hash_destroy(intern->zo.properties);
- FREE_HASHTABLE(intern->zo.properties);
- }
-#endif
-
+
efree(intern);
}
/* }}} */
@@ -107,17 +97,8 @@ PHP_XMLWRITER_API zend_object_value xmlwriter_object_new(zend_class_entry *class
intern = emalloc(sizeof(ze_xmlwriter_object));
memset(&intern->zo, 0, sizeof(zend_object));
intern->xmlwriter_ptr = NULL;
-
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1 && PHP_RELEASE_VERSION > 2) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
+
zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
-#else
- ALLOC_HASHTABLE(intern->zo.properties);
- zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-
- intern->zo.ce = class_type;
- intern->zo.guards = NULL;
-#endif
-
zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,
(void *) &tmp, sizeof(zval *));
@@ -135,7 +116,7 @@ PHP_XMLWRITER_API zend_object_value xmlwriter_object_new(zend_class_entry *class
#define XMLW_NAME_CHK(__err) \
if (xmlValidateName((xmlChar *) name, 0) != 0) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, #__err); \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, __err); \
RETURN_FALSE; \
} \
@@ -160,6 +141,7 @@ static zend_function_entry xmlwriter_functions[] = {
#endif
PHP_FE(xmlwriter_start_element, NULL)
PHP_FE(xmlwriter_end_element, NULL)
+ PHP_FE(xmlwriter_full_end_element, NULL)
PHP_FE(xmlwriter_start_element_ns, NULL)
PHP_FE(xmlwriter_write_element, NULL)
PHP_FE(xmlwriter_write_element_ns, NULL)
@@ -170,6 +152,7 @@ static zend_function_entry xmlwriter_functions[] = {
PHP_FE(xmlwriter_end_cdata, NULL)
PHP_FE(xmlwriter_write_cdata, NULL)
PHP_FE(xmlwriter_text, NULL)
+ PHP_FE(xmlwriter_write_raw, NULL)
PHP_FE(xmlwriter_start_document, NULL)
PHP_FE(xmlwriter_end_document, NULL)
PHP_FE(xmlwriter_write_comment, NULL)
@@ -193,51 +176,53 @@ static zend_function_entry xmlwriter_functions[] = {
#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)
+ PHP_ME_MAPPING(openUri, xmlwriter_open_uri, NULL, 0)
+ PHP_ME_MAPPING(openMemory, xmlwriter_open_memory, NULL, 0)
#if LIBXML_VERSION >= 20605
- PHP_ME_MAPPING(setIndent, xmlwriter_set_indent, NULL)
- PHP_ME_MAPPING(setIndentString, xmlwriter_set_indent_string, NULL)
+ PHP_ME_MAPPING(setIndent, xmlwriter_set_indent, NULL, 0)
+ PHP_ME_MAPPING(setIndentString, xmlwriter_set_indent_string, NULL, 0)
#endif
#if LIBXML_VERSION >= 20607
- PHP_ME_MAPPING(startComment, xmlwriter_start_comment, NULL)
- PHP_ME_MAPPING(endComment, xmlwriter_end_comment, NULL)
+ PHP_ME_MAPPING(startComment, xmlwriter_start_comment, NULL, 0)
+ PHP_ME_MAPPING(endComment, xmlwriter_end_comment, NULL, 0)
#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)
+ PHP_ME_MAPPING(startAttribute, xmlwriter_start_attribute, NULL, 0)
+ PHP_ME_MAPPING(endAttribute, xmlwriter_end_attribute, NULL, 0)
+ PHP_ME_MAPPING(writeAttribute, xmlwriter_write_attribute, NULL, 0)
#if LIBXML_VERSION > 20617
- PHP_ME_MAPPING(startAttributeNs, xmlwriter_start_attribute_ns,NULL)
- PHP_ME_MAPPING(writeAttributeNs, xmlwriter_write_attribute_ns,NULL)
+ PHP_ME_MAPPING(startAttributeNs, xmlwriter_start_attribute_ns,NULL, 0)
+ PHP_ME_MAPPING(writeAttributeNs, xmlwriter_write_attribute_ns,NULL, 0)
#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(writeDtdElement, xmlwriter_write_dtd_element, NULL)
+ PHP_ME_MAPPING(startElement, xmlwriter_start_element, NULL, 0)
+ PHP_ME_MAPPING(endElement, xmlwriter_end_element, NULL, 0)
+ PHP_ME_MAPPING(fullEndElement, xmlwriter_full_end_element, NULL, 0)
+ PHP_ME_MAPPING(startElementNs, xmlwriter_start_element_ns, NULL, 0)
+ PHP_ME_MAPPING(writeElement, xmlwriter_write_element, NULL, 0)
+ PHP_ME_MAPPING(writeElementNs, xmlwriter_write_element_ns, NULL, 0)
+ PHP_ME_MAPPING(startPi, xmlwriter_start_pi, NULL, 0)
+ PHP_ME_MAPPING(endPi, xmlwriter_end_pi, NULL, 0)
+ PHP_ME_MAPPING(writePi, xmlwriter_write_pi, NULL, 0)
+ PHP_ME_MAPPING(startCdata, xmlwriter_start_cdata, NULL, 0)
+ PHP_ME_MAPPING(endCdata, xmlwriter_end_cdata, NULL, 0)
+ PHP_ME_MAPPING(writeCdata, xmlwriter_write_cdata, NULL, 0)
+ PHP_ME_MAPPING(text, xmlwriter_text, NULL, 0)
+ PHP_ME_MAPPING(writeRaw, xmlwriter_write_raw, NULL, 0)
+ PHP_ME_MAPPING(startDocument, xmlwriter_start_document, NULL, 0)
+ PHP_ME_MAPPING(endDocument, xmlwriter_end_document, NULL, 0)
+ PHP_ME_MAPPING(writeComment, xmlwriter_write_comment, NULL, 0)
+ PHP_ME_MAPPING(startDtd, xmlwriter_start_dtd, NULL, 0)
+ PHP_ME_MAPPING(endDtd, xmlwriter_end_dtd, NULL, 0)
+ PHP_ME_MAPPING(writeDtd, xmlwriter_write_dtd, NULL, 0)
+ PHP_ME_MAPPING(startDtdElement, xmlwriter_start_dtd_element, NULL, 0)
+ PHP_ME_MAPPING(endDtdElement, xmlwriter_end_dtd_element, NULL, 0)
+ PHP_ME_MAPPING(writeDtdElement, xmlwriter_write_dtd_element, NULL, 0)
#if LIBXML_VERSION > 20608
- PHP_ME_MAPPING(startDtdAttlist, xmlwriter_start_dtd_attlist, NULL)
- PHP_ME_MAPPING(endDtdAttlist, xmlwriter_end_dtd_attlist, NULL)
- PHP_ME_MAPPING(writeDtdAttlist, xmlwriter_write_dtd_attlist, NULL)
+ PHP_ME_MAPPING(startDtdAttlist, xmlwriter_start_dtd_attlist, NULL, 0)
+ PHP_ME_MAPPING(endDtdAttlist, xmlwriter_end_dtd_attlist, NULL, 0)
+ PHP_ME_MAPPING(writeDtdAttlist, xmlwriter_write_dtd_attlist, NULL, 0)
#endif
- PHP_ME_MAPPING(outputMemory, xmlwriter_output_memory, NULL)
- PHP_ME_MAPPING(flush, xmlwriter_flush, NULL)
+ PHP_ME_MAPPING(outputMemory, xmlwriter_output_memory, NULL, 0)
+ PHP_ME_MAPPING(flush, xmlwriter_flush, NULL, 0)
{NULL, NULL, NULL}
};
/* }}} */
@@ -261,8 +246,8 @@ char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, int reso
int isFileUri = 0;
uri = xmlCreateURI();
- escsource = xmlURIEscapeStr(source, ":");
- xmlParseURIReference(uri, escsource);
+ escsource = xmlURIEscapeStr((xmlChar *)source, (xmlChar *) ":");
+ xmlParseURIReference(uri, (char *)escsource);
xmlFree(escsource);
if (uri->scheme != NULL) {
@@ -287,9 +272,9 @@ char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, int reso
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);
+ if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) {
+ xmlFreeURI(uri);
+ return NULL;
}
file_dest = resolved_path;
}
@@ -368,205 +353,144 @@ static void xmlwriter_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
}
/* }}} */
-#if LIBXML_VERSION >= 20605
-/* {{{ proto bool xmlwriter_set_indent(resource xmlwriter, bool indent)
-Toggle indentation on/off - returns FALSE on error */
-PHP_FUNCTION(xmlwriter_set_indent)
+static void php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_read_one_char_t internal_function, char *err_string)
{
zval *pind;
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
- int retval;
- zend_bool indent;
+ char *name;
+ int name_len, retval;
#ifdef ZEND_ENGINE_2
zval *this = getThis();
if (this) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &indent) == FAILURE) {
+ 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, "rb", &pind, &indent) == FAILURE) {
+ 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);
}
+ if (err_string != NULL) {
+ XMLW_NAME_CHK(err_string);
+ }
ptr = intern->ptr;
+
if (ptr) {
- retval = xmlTextWriterSetIndent(ptr, indent);
- if (retval == 0) {
+ retval = internal_function(ptr, (xmlChar *) name);
+ if (retval != -1) {
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)
+static void php_xmlwriter_end(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_read_int_t internal_function)
{
zval *pind;
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
- char *indent;
- int indent_len, retval;
-
+ int 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
+ } else
#endif
{
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, &indent, &indent_len) == FAILURE) {
+ 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 = xmlTextWriterSetIndentString(ptr, indent);
- if (retval == 0) {
+ retval = internal_function(ptr);
+ if (retval != -1) {
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)
+#if LIBXML_VERSION >= 20605
+/* {{{ proto bool xmlwriter_set_indent(resource xmlwriter, bool indent)
+Toggle indentation on/off - returns FALSE on error */
+PHP_FUNCTION(xmlwriter_set_indent)
{
zval *pind;
xmlwriter_object *intern;
xmlTextWriterPtr ptr;
- char *name;
- int name_len, retval;
+ int retval;
+ zend_bool indent;
+
#ifdef ZEND_ENGINE_2
zval *this = getThis();
if (this) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &indent) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, this);
} else
#endif
{
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, &name, &name_len) == FAILURE) {
+ 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);
}
- XMLW_NAME_CHK("Invalid Element Name");
-
ptr = intern->ptr;
-
if (ptr) {
- retval = xmlTextWriterStartAttribute(ptr, name);
- if (retval != -1) {
+ retval = xmlTextWriterSetIndent(ptr, indent);
+ if (retval == 0) {
RETURN_TRUE;
}
}
-
+
RETURN_FALSE;
}
/* }}} */
-static void php_xmlwriter_end(INTERNAL_FUNCTION_PARAMETERS, int type)
+/* {{{ 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;
- 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);
- }
+ php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterSetIndentString, NULL);
+}
+/* }}} */
- ptr = intern->ptr;
+#endif
- 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_start_attribute(resource xmlwriter, string name)
+Create start attribute - returns FALSE on error */
+PHP_FUNCTION(xmlwriter_start_attribute)
+{
+ php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartAttribute, "Invalid Attribute Name");
}
-
+/* }}} */
/* {{{ 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);
+ php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndAttribute);
}
/* }}} */
@@ -604,7 +528,7 @@ PHP_FUNCTION(xmlwriter_start_attribute_ns)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterStartAttributeNS(ptr, prefix, name, uri);
+ retval = xmlTextWriterStartAttributeNS(ptr, (xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri);
if (retval != -1) {
RETURN_TRUE;
}
@@ -649,7 +573,7 @@ PHP_FUNCTION(xmlwriter_write_attribute)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterWriteAttribute(ptr, name, content);
+ retval = xmlTextWriterWriteAttribute(ptr, (xmlChar *)name, (xmlChar *)content);
if (retval != -1) {
RETURN_TRUE;
}
@@ -694,7 +618,7 @@ PHP_FUNCTION(xmlwriter_write_attribute_ns)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterWriteAttributeNS(ptr, prefix, name, uri, content);
+ retval = xmlTextWriterWriteAttributeNS(ptr, (xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri, (xmlChar *)content);
if (retval != -1) {
RETURN_TRUE;
}
@@ -709,40 +633,7 @@ PHP_FUNCTION(xmlwriter_write_attribute_ns)
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;
+ php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartElement, "Invalid Element Name");
}
/* }}} */
@@ -780,7 +671,7 @@ PHP_FUNCTION(xmlwriter_start_element_ns)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterStartElementNS(ptr, prefix, name, uri);
+ retval = xmlTextWriterStartElementNS(ptr, (xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri);
if (retval != -1) {
RETURN_TRUE;
}
@@ -795,7 +686,15 @@ PHP_FUNCTION(xmlwriter_start_element_ns)
End current element - returns FALSE on error */
PHP_FUNCTION(xmlwriter_end_element)
{
- php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+ php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndElement);
+}
+/* }}} */
+
+/* {{{ proto bool xmlwriter_full_end_element(resource xmlwriter)
+End current element - returns FALSE on error */
+PHP_FUNCTION(xmlwriter_full_end_element)
+{
+ php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterFullEndElement);
}
/* }}} */
@@ -832,7 +731,7 @@ PHP_FUNCTION(xmlwriter_write_element)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterWriteElement(ptr, name, content);
+ retval = xmlTextWriterWriteElement(ptr, (xmlChar *)name, (xmlChar *)content);
if (retval != -1) {
RETURN_TRUE;
}
@@ -876,7 +775,7 @@ PHP_FUNCTION(xmlwriter_write_element_ns)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterWriteElementNS(ptr, prefix, name, uri, content);
+ retval = xmlTextWriterWriteElementNS(ptr, (xmlChar *)prefix, (xmlChar *)name, (xmlChar *)uri, (xmlChar *)content);
if (retval != -1) {
RETURN_TRUE;
}
@@ -890,41 +789,7 @@ PHP_FUNCTION(xmlwriter_write_element_ns)
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;
+ php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartPI, "Invalid PI Target");
}
/* }}} */
@@ -932,7 +797,7 @@ PHP_FUNCTION(xmlwriter_start_pi)
End current PI - returns FALSE on error */
PHP_FUNCTION(xmlwriter_end_pi)
{
- php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2);
+ php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndPI);
}
/* }}} */
@@ -970,7 +835,7 @@ PHP_FUNCTION(xmlwriter_write_pi)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterWritePI(ptr, name, content);
+ retval = xmlTextWriterWritePI(ptr, (xmlChar *)name, (xmlChar *)content);
if (retval != -1) {
RETURN_TRUE;
}
@@ -1019,7 +884,7 @@ PHP_FUNCTION(xmlwriter_start_cdata)
End current CDATA - returns FALSE on error */
PHP_FUNCTION(xmlwriter_end_cdata)
{
- php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3);
+ php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndCDATA);
}
/* }}} */
@@ -1027,40 +892,15 @@ PHP_FUNCTION(xmlwriter_end_cdata)
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;
+ php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterWriteCDATA, NULL);
+}
+/* }}} */
- if (ptr) {
- retval = xmlTextWriterWriteCDATA(ptr, content);
- if (retval != -1) {
- RETURN_TRUE;
- }
- }
-
- RETURN_FALSE;
+/* {{{ proto bool xmlwriter_write_raw(resource xmlwriter, string content)
+Write text - returns FALSE on error */
+PHP_FUNCTION(xmlwriter_write_raw)
+{
+ php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterWriteRaw, NULL);
}
/* }}} */
@@ -1068,40 +908,7 @@ PHP_FUNCTION(xmlwriter_write_cdata)
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;
+ php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterWriteString, NULL);
}
/* }}} */
@@ -1145,7 +952,7 @@ PHP_FUNCTION(xmlwriter_start_comment)
Create end comment - returns FALSE on error */
PHP_FUNCTION(xmlwriter_end_comment)
{
- php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 4);
+ php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndComment);
}
/* }}} */
#endif /* LIBXML_VERSION >= 20607 */
@@ -1155,42 +962,7 @@ PHP_FUNCTION(xmlwriter_end_comment)
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;
+ php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterWriteComment, NULL);
}
/* }}} */
@@ -1238,7 +1010,7 @@ PHP_FUNCTION(xmlwriter_start_document)
End current document - returns FALSE on error */
PHP_FUNCTION(xmlwriter_end_document)
{
- php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 5);
+ php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndDocument);
}
/* }}} */
@@ -1273,7 +1045,7 @@ PHP_FUNCTION(xmlwriter_start_dtd)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterStartDTD(ptr, name, pubid, sysid);
+ retval = xmlTextWriterStartDTD(ptr, (xmlChar *)name, (xmlChar *)pubid, (xmlChar *)sysid);
if (retval != -1) {
RETURN_TRUE;
}
@@ -1287,7 +1059,7 @@ PHP_FUNCTION(xmlwriter_start_dtd)
End current DTD - returns FALSE on error */
PHP_FUNCTION(xmlwriter_end_dtd)
{
- php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 6);
+ php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndDTD);
}
/* }}} */
@@ -1323,7 +1095,7 @@ PHP_FUNCTION(xmlwriter_write_dtd)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterWriteDTD(ptr, name, pubid, sysid, subset);
+ retval = xmlTextWriterWriteDTD(ptr, (xmlChar *)name, (xmlChar *)pubid, (xmlChar *)sysid, (xmlChar *)subset);
if (retval != -1) {
RETURN_TRUE;
}
@@ -1337,41 +1109,7 @@ PHP_FUNCTION(xmlwriter_write_dtd)
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;
+ php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartDTDElement, "Invalid Element Name");
}
/* }}} */
@@ -1379,7 +1117,7 @@ PHP_FUNCTION(xmlwriter_start_dtd_element)
End current DTD element - returns FALSE on error */
PHP_FUNCTION(xmlwriter_end_dtd_element)
{
- php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 7);
+ php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndDTDElement);
}
/* }}} */
@@ -1416,7 +1154,7 @@ PHP_FUNCTION(xmlwriter_write_dtd_element)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterWriteDTDElement(ptr, name, content);
+ retval = xmlTextWriterWriteDTDElement(ptr, (xmlChar *)name, (xmlChar *)content);
if (retval != -1) {
RETURN_TRUE;
}
@@ -1431,41 +1169,7 @@ PHP_FUNCTION(xmlwriter_write_dtd_element)
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;
+ php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterStartDTDAttlist, "Invalid Element Name");
}
/* }}} */
@@ -1473,7 +1177,7 @@ PHP_FUNCTION(xmlwriter_start_dtd_attlist)
End current DTD AttList - returns FALSE on error */
PHP_FUNCTION(xmlwriter_end_dtd_attlist)
{
- php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 8);
+ php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndDTDAttlist);
}
/* }}} */
@@ -1512,7 +1216,7 @@ PHP_FUNCTION(xmlwriter_write_dtd_attlist)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterWriteDTDAttlist(ptr, name, content);
+ retval = xmlTextWriterWriteDTDAttlist(ptr, (xmlChar *)name, (xmlChar *)content);
if (retval != -1) {
RETURN_TRUE;
}
@@ -1556,7 +1260,7 @@ PHP_FUNCTION(xmlwriter_start_dtd_entity)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterStartDTDEntity(ptr, isparm, name);
+ retval = xmlTextWriterStartDTDEntity(ptr, isparm, (xmlChar *)name);
if (retval != -1) {
RETURN_TRUE;
}
@@ -1570,7 +1274,7 @@ PHP_FUNCTION(xmlwriter_start_dtd_entity)
End current DTD Entity - returns FALSE on error */
PHP_FUNCTION(xmlwriter_end_dtd_entity)
{
- php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, 9);
+ php_xmlwriter_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextWriterEndDTDEntity);
}
/* }}} */
@@ -1608,7 +1312,7 @@ PHP_FUNCTION(xmlwriter_write_dtd_entity)
ptr = intern->ptr;
if (ptr) {
- retval = xmlTextWriterWriteDTDAttlist(ptr, name, content);
+ retval = xmlTextWriterWriteDTDAttlist(ptr, (xmlChar *)name, (xmlChar *)content);
if (retval != -1) {
RETURN_TRUE;
}
@@ -1788,7 +1492,7 @@ static void php_xmlwriter_flush(INTERNAL_FUNCTION_PARAMETERS, int force_string)
}
output_bytes = xmlTextWriterFlush(ptr);
if (buffer) {
- RETVAL_STRING(buffer->content, 1);
+ RETVAL_STRING((char *) buffer->content, 1);
if (empty) {
xmlBufferEmpty(buffer);
}
diff --git a/ext/xmlwriter/php_xmlwriter.h b/ext/xmlwriter/php_xmlwriter.h
index 5fe173268..1cc624fa6 100644
--- a/ext/xmlwriter/php_xmlwriter.h
+++ b/ext/xmlwriter/php_xmlwriter.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_xmlwriter.h,v 1.10.2.5 2006/01/01 12:50:16 sniper Exp $ */
+/* $Id: php_xmlwriter.h,v 1.10.2.5.2.1 2006/05/10 19:38:35 rrichards Exp $ */
#ifndef PHP_XMLWRITER_H
#define PHP_XMLWRITER_H
@@ -70,6 +70,7 @@ PHP_FUNCTION(xmlwriter_write_attribute_ns);
#endif
PHP_FUNCTION(xmlwriter_start_element);
PHP_FUNCTION(xmlwriter_end_element);
+PHP_FUNCTION(xmlwriter_full_end_element);
PHP_FUNCTION(xmlwriter_start_element_ns);
PHP_FUNCTION(xmlwriter_write_element);
PHP_FUNCTION(xmlwriter_write_element_ns);
@@ -80,6 +81,7 @@ PHP_FUNCTION(xmlwriter_start_cdata);
PHP_FUNCTION(xmlwriter_end_cdata);
PHP_FUNCTION(xmlwriter_write_cdata);
PHP_FUNCTION(xmlwriter_text);
+PHP_FUNCTION(xmlwriter_write_raw);
PHP_FUNCTION(xmlwriter_start_document);
PHP_FUNCTION(xmlwriter_end_document);
#if LIBXML_VERSION >= 20607
diff --git a/ext/xmlwriter/tests/009.phpt b/ext/xmlwriter/tests/009.phpt
index f9b6600ca..021f2399c 100644
--- a/ext/xmlwriter/tests/009.phpt
+++ b/ext/xmlwriter/tests/009.phpt
@@ -7,8 +7,10 @@ if (!function_exists("xmlwriter_start_comment")) die("skip: libxml2 2.6.7+ requi
?>
--FILE--
<?php
-/* $Id: 009.phpt,v 1.1.2.3 2005/12/09 20:52:15 rrichards Exp $ */
-
+/* $Id: 009.phpt,v 1.1.2.3.2.1 2006/07/19 18:50:51 pajoye Exp $ */
+/*
+Libxml 2.6.24 and up adds a new line after a processing instruction (PI)
+*/
$xw = xmlwriter_open_memory();
xmlwriter_set_indent($xw, TRUE);
xmlwriter_start_document($xw, NULL, "UTF-8");
@@ -32,12 +34,12 @@ xmlwriter_end_document($xw);
$output = xmlwriter_flush($xw, true);
print $output;
?>
---EXPECT--
+--EXPECTF--
<?xml version="1.0" encoding="UTF-8"?>
<root id="elem1">
<elem1 attr1="first">
<!--start PI-->
- <pi><?php echo "hello world"; ?></pi>
+ <pi><?php echo "hello world"; ?>%w</pi>
<cdata><![CDATA[<>&"]]></cdata>
</elem1>
</root>
diff --git a/ext/xmlwriter/tests/010.phpt b/ext/xmlwriter/tests/010.phpt
new file mode 100644
index 000000000..89439dc22
--- /dev/null
+++ b/ext/xmlwriter/tests/010.phpt
@@ -0,0 +1,41 @@
+--TEST--
+xmlwriter_start/end_attribute()
+--FILE--
+<?php
+
+$file = dirname(__FILE__).'/010.tmp';
+
+$xw = xmlwriter_open_uri($file);
+
+var_dump(xmlwriter_start_element($xw, "tag"));
+var_dump(xmlwriter_start_attribute($xw, "attr"));
+var_dump(xmlwriter_end_attribute($xw));
+var_dump(xmlwriter_start_attribute($xw, "-1"));
+var_dump(xmlwriter_end_attribute($xw));
+var_dump(xmlwriter_start_attribute($xw, "\""));
+var_dump(xmlwriter_end_attribute($xw));
+var_dump(xmlwriter_end_element($xw));
+
+unset($xw);
+
+var_dump(file_get_contents($file));
+
+@unlink($file);
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+
+Warning: xmlwriter_start_attribute(): Invalid Attribute Name in %s on line %d
+bool(false)
+bool(false)
+
+Warning: xmlwriter_start_attribute(): Invalid Attribute Name in %s on line %d
+bool(false)
+bool(false)
+bool(true)
+string(14) "<tag attr=""/>"
+Done
diff --git a/ext/xmlwriter/tests/OO_009.phpt b/ext/xmlwriter/tests/OO_009.phpt
index 5324dc7a4..7fc918ab1 100644
--- a/ext/xmlwriter/tests/OO_009.phpt
+++ b/ext/xmlwriter/tests/OO_009.phpt
@@ -6,8 +6,10 @@ if (!extension_loaded("xmlwriter")) die("skip");
?>
--FILE--
<?php
-/* $Id: OO_009.phpt,v 1.1.2.4 2005/12/12 21:21:11 tony2001 Exp $ */
-
+/* $Id: OO_009.phpt,v 1.1.2.4.2.1 2006/07/19 18:50:51 pajoye Exp $ */
+/*
+Libxml 2.6.24 and up adds a new line after a processing instruction (PI)
+*/
$xw = new XMLWriter();
$xw->openMemory();
$xw->setIndent(TRUE);
@@ -32,12 +34,12 @@ $xw->endDocument();
$output = $xw->flush(true);
print $output;
?>
---EXPECT--
+--EXPECTF--
<?xml version="1.0" encoding="UTF-8"?>
<root id="elem1">
<elem1 attr1="first">
<!--start PI-->
- <pi><?php echo "hello world"; ?></pi>
+ <pi><?php echo "hello world"; ?>%w</pi>
<cdata><![CDATA[<>&"]]></cdata>
</elem1>
</root>
diff --git a/ext/xsl/config.m4 b/ext/xsl/config.m4
index 2db7a8c87..8dacfa00a 100644
--- a/ext/xsl/config.m4
+++ b/ext/xsl/config.m4
@@ -1,9 +1,9 @@
dnl
-dnl $Id: config.m4,v 1.11 2005/05/29 23:16:45 sniper Exp $
+dnl $Id: config.m4,v 1.11.4.1 2006/09/08 16:41:01 bjori Exp $
dnl
PHP_ARG_WITH(xsl, for XSL support,
-[ --with-xsl[=DIR] Include new XSL support (requires libxslt >= 1.0.18).
+[ --with-xsl[=DIR] Include new XSL support (requires libxslt >= 1.1.0).
DIR is the libxslt install directory])
if test "$PHP_XSL" != "no"; then
@@ -24,7 +24,7 @@ if test "$PHP_XSL" != "no"; then
done
if test -z "$XSLT_CONFIG"; then
- AC_MSG_ERROR([xslt-config not found. Please reinstall the libxslt >= 1.0.18 distribution])
+ AC_MSG_ERROR([xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution])
else
libxslt_full_version=`$XSLT_CONFIG --version`
ac_IFS=$IFS
@@ -32,7 +32,7 @@ if test "$PHP_XSL" != "no"; then
set $libxslt_full_version
IFS=$ac_IFS
LIBXSLT_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
- if test "$LIBXSLT_VERSION" -ge "1000018"; then
+ if test "$LIBXSLT_VERSION" -ge "1001000"; then
XSL_LIBS=`$XSLT_CONFIG --libs`
XSL_INCS=`$XSLT_CONFIG --cflags`
PHP_EVAL_LIBLINE($XSL_LIBS, XSL_SHARED_LIBADD)
@@ -54,7 +54,7 @@ if test "$PHP_XSL" != "no"; then
AC_DEFINE(HAVE_XSL_EXSLT,1,[ ])
fi
else
- AC_MSG_ERROR([libxslt version 1.0.18 or greater required.])
+ AC_MSG_ERROR([libxslt version 1.1.0 or greater required.])
fi
diff --git a/ext/xsl/tests/xslt010.phpt b/ext/xsl/tests/xslt010.phpt
index 7c46d030f..1ac1a493c 100644
--- a/ext/xsl/tests/xslt010.phpt
+++ b/ext/xsl/tests/xslt010.phpt
@@ -3,7 +3,9 @@ Test 10: EXSLT Support
--SKIPIF--
<?php require_once('skipif.inc');
$proc = new xsltprocessor;
-if (!$proc->hasExsltSupport()) die('skip EXSLT support not available');?>
+if (!$proc->hasExsltSupport()) die('skip EXSLT support not available');
+if (LIBXSLT_VERSION < 10117) die('skip too old libxsl');
+?>
--FILE--
<?php
echo "Test 10: EXSLT Support";
@@ -63,7 +65,7 @@ Test 10: EXSLT Support
month-in-year : 2
month-name : February
month-abbreviation : Feb
- week-in-year : 8
+ week-in-year : 9
day-in-year : 60
day-in-month : 29
day-of-week-in-month : 5
@@ -99,7 +101,7 @@ Test 10: EXSLT Support
month-in-year : 2
month-name : February
month-abbreviation : Feb
- week-in-year : 9
+ week-in-year : 10
day-in-year : 60
day-in-month : 29
day-of-week-in-month : 5
@@ -110,3 +112,4 @@ Test 10: EXSLT Support
hour-in-day : NaN
minute-in-hour : NaN
second-in-minute : NaN
+
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index 58a903868..c67cac9dd 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xsltprocessor.c,v 1.39.2.3 2006/06/14 09:43:22 chregu Exp $ */
+/* $Id: xsltprocessor.c,v 1.39.2.2.2.4 2006/07/31 13:05:35 chregu Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -351,7 +351,7 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
}
if (doc == NULL) {
php_error(E_WARNING, "Invalid Document");
- RETURN_NULL();
+ RETURN_FALSE;
}
/* libxslt uses _private, so we must copy the imported
@@ -395,7 +395,7 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
} else {
intern->hasKeys = clone_docu;
}
-
+
if ((oldsheetp = (xsltStylesheetPtr)intern->ptr)) {
/* free wrapper */
if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) {
@@ -406,11 +406,12 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
}
php_xsl_set_object(id, sheetp TSRMLS_CC);
+ RETVAL_TRUE;
}
/* }}} end xsl_xsltprocessor_import_stylesheet */
-static xmlDocPtr php_xsl_apply_stylesheet(xsl_object *intern, xsltStylesheetPtr style, zval *docp TSRMLS_DC)
+static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStylesheetPtr style, zval *docp TSRMLS_DC)
{
xmlDocPtr newdocp;
xmlDocPtr doc = NULL;
@@ -419,6 +420,8 @@ static xmlDocPtr php_xsl_apply_stylesheet(xsl_object *intern, xsltStylesheetPtr
php_libxml_node_object *object;
char **params = NULL;
int clone;
+ zval *doXInclude, *member;
+ zend_object_handlers *std_hnd;
node = php_libxml_import_node(docp TSRMLS_CC);
@@ -452,7 +455,18 @@ static xmlDocPtr php_xsl_apply_stylesheet(xsl_object *intern, xsltStylesheetPtr
ctxt = xsltNewTransformContext(style, doc);
ctxt->_private = (void *) intern;
-
+
+ std_hnd = zend_get_std_object_handlers();
+
+ MAKE_STD_ZVAL(member);
+ ZVAL_STRING(member, "doXInclude", 0);
+ doXInclude = std_hnd->read_property(id, member, BP_VAR_IS TSRMLS_CC);
+ if (Z_TYPE_P(doXInclude) != IS_NULL) {
+ convert_to_long(doXInclude);
+ ctxt->xinclude = Z_LVAL_P(doXInclude);
+ }
+ efree(member);
+
newdocp = xsltApplyStylesheetUser(style, doc, (const char**) params, NULL, NULL, ctxt);
xsltFreeTransformContext(ctxt);
@@ -500,7 +514,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
RETURN_FALSE;
}
- newdocp = php_xsl_apply_stylesheet(intern, sheetp, docp TSRMLS_CC);
+ newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp TSRMLS_CC);
if (newdocp) {
DOM_RET_OBJ(rv, (xmlNodePtr) newdocp, &ret, NULL);
@@ -531,7 +545,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
RETURN_FALSE;
}
- newdocp = php_xsl_apply_stylesheet(intern, sheetp, docp TSRMLS_CC);
+ newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp TSRMLS_CC);
ret = -1;
if (newdocp) {
@@ -564,7 +578,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml)
RETURN_FALSE;
}
- newdocp = php_xsl_apply_stylesheet(intern, sheetp, docp TSRMLS_CC);
+ newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp TSRMLS_CC);
ret = -1;
if (newdocp) {
diff --git a/ext/zip/CREDITS b/ext/zip/CREDITS
new file mode 100644
index 000000000..6c7e42d41
--- /dev/null
+++ b/ext/zip/CREDITS
@@ -0,0 +1,2 @@
+Zip
+Pierre-Alain Joye
diff --git a/ext/zip/TODO b/ext/zip/TODO
new file mode 100644
index 000000000..cb540ce7a
--- /dev/null
+++ b/ext/zip/TODO
@@ -0,0 +1,5 @@
+- fix _zip_replace (add two entries with the same name segfaults)
+- add pattern support to extract or add files
+- stream to add or modify entries
+- crypt support for zip (read and write)
+- Iterators
diff --git a/ext/zip/config.m4 b/ext/zip/config.m4
new file mode 100644
index 000000000..1ff064c97
--- /dev/null
+++ b/ext/zip/config.m4
@@ -0,0 +1,68 @@
+dnl
+dnl $Id: config.m4,v 1.8 2006/07/24 16:58:58 pajoye Exp $
+dnl
+
+PHP_ARG_ENABLE(zip, for zip archive read/writesupport,
+[ --enable-zip Include Zip read/write support.])
+
+if test -z "$PHP_ZLIB_DIR"; then
+PHP_ARG_WITH(zlib-dir, for the location of libz,
+[ --with-zlib-dir[=DIR] zip: Set the path to libz install prefix.], no, no)
+fi
+
+if test "$PHP_ZIP" != "no"; then
+
+ if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then
+ if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then
+ PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
+ PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib"
+ elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then
+ PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
+ PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include"
+ else
+ AC_MSG_ERROR([Can't find zlib headers under "$PHP_ZLIB_DIR"])
+ fi
+ else
+ for i in /usr/local /usr; do
+ if test -f "$i/include/zlib/zlib.h"; then
+ PHP_ZLIB_DIR="$i"
+ PHP_ZLIB_INCDIR="$i/include/zlib"
+ elif test -f "$i/include/zlib.h"; then
+ PHP_ZLIB_DIR="$i"
+ PHP_ZLIB_INCDIR="$i/include"
+ fi
+ done
+ fi
+
+ dnl # zlib
+ AC_MSG_CHECKING([for the location of zlib])
+ if test "$PHP_ZLIB_DIR" = "no"; then
+ AC_MSG_ERROR([zip support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located])
+ else
+ AC_MSG_RESULT([$PHP_ZLIB_DIR])
+ PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, ZIP_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR)
+ fi
+
+ PHP_ZIP_SOURCES="$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \
+ lib/zip_fread.c lib/zip_open.c lib/zip_source_filep.c \
+ lib/zip_strerror.c lib/zip_close.c lib/zip_error_get.c \
+ lib/zip_file_error_get.c lib/zip_free.c lib/zip_rename.c \
+ lib/zip_source_free.c lib/zip_unchange_all.c lib/zip_delete.c \
+ lib/zip_error_get_sys_type.c lib/zip_file_get_offset.c \
+ lib/zip_get_name.c lib/zip_replace.c lib/zip_source_function.c \
+ lib/zip_unchange.c lib/zip_dirent.c lib/zip_error_strerror.c \
+ lib/zip_file_strerror.c lib/zip_get_num_files.c \
+ lib/zip_set_name.c lib/zip_source_zip.c lib/zip_unchange_data.c \
+ lib/zip_entry_free.c lib/zip_error_to_str.c lib/zip_fopen.c \
+ lib/zip_name_locate.c lib/zip_source_buffer.c lib/zip_stat.c \
+ lib/zip_entry_new.c lib/zip_err_str.c lib/zip_fopen_index.c \
+ lib/zip_new.c lib/zip_source_file.c lib/zip_stat_index.c lib/zip_get_archive_comment.c \
+ lib/zip_get_file_comment.c lib/zip_set_archive_comment.c lib/zip_set_file_comment.c \
+ lib/zip_unchange_archive.c lib/zip_memdup.c"
+
+ AC_DEFINE(HAVE_ZIP,1,[ ])
+ PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared)
+ PHP_ADD_BUILD_DIR($ext_builddir/lib, 1)
+ PHP_SUBST(ZIP_SHARED_LIBADD)
+fi
diff --git a/ext/zip/config.w32 b/ext/zip/config.w32
new file mode 100644
index 000000000..2047ec0f6
--- /dev/null
+++ b/ext/zip/config.w32
@@ -0,0 +1,37 @@
+// $Id: config.w32,v 1.1 2006/07/24 16:58:58 pajoye Exp $
+// vim:ft=javascript
+
+ARG_ENABLE("zip", "ZIP support", "no");
+
+if (PHP_ZIP != "no") {
+
+ if (CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS_ZIP", "..\\zlib;" + php_usual_include_suspects + ";" + PHP_ZIP)) {
+ if (PHP_ZLIB_SHARED) {
+ CHECK_LIB("zlib.lib", "zip", PHP_ZIP);
+ }
+ EXTENSION('zip', 'php_zip.c zip_stream.c');
+ ADD_SOURCES(configure_module_dirname + "/lib", "zip_add.c zip_error.c zip_fclose.c \
+ zip_fread.c zip_open.c zip_source_filep.c \
+ zip_strerror.c zip_close.c zip_error_get.c \
+ zip_file_error_get.c zip_free.c zip_rename.c \
+ zip_source_free.c zip_unchange_all.c zip_delete.c \
+ zip_error_get_sys_type.c zip_file_get_offset.c \
+ zip_get_name.c zip_replace.c zip_source_function.c \
+ zip_unchange.c zip_dirent.c zip_error_strerror.c \
+ zip_file_strerror.c zip_get_num_files.c \
+ zip_set_name.c zip_source_zip.c zip_unchange_data.c \
+ zip_entry_free.c zip_error_to_str.c zip_fopen.c \
+ zip_name_locate.c zip_source_buffer.c zip_stat.c \
+ zip_entry_new.c zip_err_str.c zip_fopen_index.c \
+ zip_new.c zip_source_file.c zip_stat_index.c \
+ zip_get_archive_comment.c zip_get_file_comment.c \
+ zip_set_archive_comment.c zip_set_file_comment.c \
+ zip_unchange_archive.c zip_memdup.c", "zip");
+
+ AC_DEFINE('HAVE_ZLIB', 1);
+ AC_DEFINE('HAVE_ZIP', 1);
+ } else {
+ WARNING("zip not enabled; libraries and headers not found");
+ }
+}
+
diff --git a/ext/zip/examples/comment.php b/ext/zip/examples/comment.php
new file mode 100644
index 000000000..90b37d379
--- /dev/null
+++ b/ext/zip/examples/comment.php
@@ -0,0 +1,6 @@
+<?php
+$z = new ZipArchive;
+$z->open('test_with_comment.zip');
+// Add "Foo Comment" as comment for the foo entry
+$z->setCommentName('foo', 'Too Comment ' . time());
+$z->close();
diff --git a/ext/zip/examples/create.php b/ext/zip/examples/create.php
new file mode 100644
index 000000000..cffacee93
--- /dev/null
+++ b/ext/zip/examples/create.php
@@ -0,0 +1,20 @@
+<?php
+error_reporting(E_ALL);
+$thisdir = dirname(__FILE__);
+unlink("./test112.zip");
+$zip = new ZipArchive();
+$filename = "./test112.zip";
+
+if (!$zip->open($filename, ZIPARCHIVE::CREATE)) {
+ exit("cannot open <$filename>\n");
+} else {
+ echo "file <$filename> OK\n";
+}
+
+$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string added as testfilephp.txt.\n");
+$zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test string added as testfilephp2.txt.\n");
+$zip->addFile($thisdir . "/too.php","/testfromfile.php");
+echo "numfiles: " . $zip->numFiles . "\n";
+echo "status:" . $zip->status . "\n";
+$zip->close();
+unset($zip);
diff --git a/ext/zip/examples/dir.php b/ext/zip/examples/dir.php
new file mode 100644
index 000000000..00e4b4058
--- /dev/null
+++ b/ext/zip/examples/dir.php
@@ -0,0 +1,17 @@
+<?php
+$za = new ZipArchive();
+
+$za->open('test_with_comment.zip');
+print_r($za);
+var_dump($za);
+echo "numFiles: " . $za->numFiles . "\n";
+echo "status: " . $za->status . "\n";
+echo "statusSys: " . $za->statusSys . "\n";
+echo "filename: " . $za->filename . "\n";
+echo "comment: " . $za->comment . "\n";
+
+for ($i=0; $i<$za->numFiles;$i++) {
+ echo "index: $i\n";
+ print_r($za->statIndex($i));
+}
+echo "numFile:" . $za->numFiles . "\n";
diff --git a/ext/zip/examples/extract.php b/ext/zip/examples/extract.php
new file mode 100644
index 000000000..696502ba1
--- /dev/null
+++ b/ext/zip/examples/extract.php
@@ -0,0 +1,24 @@
+<?php
+$zip = new ZipArchive();
+
+echo $zip->filename . "\n";
+$zip->open("test.zip");
+/*
+$zip->addFile("./modules/");
+$zip->addFile("./testempty");
+*/
+echo $zip->status . "\n";
+echo $zip->statusSys . "\n";
+
+echo $zip->numFiles . "\n";
+echo $zip->filename . "\n";
+var_dump($zip);
+$files = array('test', 'testdir/test2');
+if (!$zip->extractTo("./testext/path/to", $files)) {
+ echo "error!\n";
+ echo $zip->status . "\n";
+ echo $zip->statusSys . "\n";
+
+}
+
+$zip->close();
diff --git a/ext/zip/examples/extractAll.php b/ext/zip/examples/extractAll.php
new file mode 100644
index 000000000..d318a453d
--- /dev/null
+++ b/ext/zip/examples/extractAll.php
@@ -0,0 +1,24 @@
+<?php
+$zip = new ZipArchive();
+
+echo $zip->filename . "\n";
+$zip->open("test.zip");
+/*
+$zip->addFile("./modules/");
+$zip->addFile("./testempty");
+*/
+echo $zip->status . "\n";
+echo $zip->statusSys . "\n";
+
+echo $zip->numFiles . "\n";
+echo $zip->filename . "\n";
+var_dump($zip);
+$files = array('test', 'testdir/test2');
+if (!$zip->extractTo("./testext/path/to")) {
+ echo "error!\n";
+ echo $zip->status . "\n";
+ echo $zip->statusSys . "\n";
+
+}
+
+$zip->close();
diff --git a/ext/zip/examples/fopen.php b/ext/zip/examples/fopen.php
new file mode 100644
index 000000000..5af37b1ab
--- /dev/null
+++ b/ext/zip/examples/fopen.php
@@ -0,0 +1,31 @@
+<?php
+
+$fp = fopen('zip://' . dirname(__FILE__) . '/test.zip#test', 'r');
+if (!$fp) {
+ exit("cannot open\n");
+}
+while (!feof($fp)) {
+ $contents .= fread($fp, 2);
+ echo "$contents\n";
+}
+
+fclose($fp);
+echo "done.\n";
+
+
+$content = '';
+$z = new ZipArchive();
+$z->open(dirname(__FILE__) . '/test.zip');
+$fp = $z->getStream('test');
+
+var_dump($fp);
+if(!$fp) exit("\n");
+while (!feof($fp)) {
+ $contents .= fread($fp, 2);
+}
+
+fclose($fp);
+file_put_contents('t',$contents);
+echo "done.\n";
+
+
diff --git a/ext/zip/examples/get_set_comments.php b/ext/zip/examples/get_set_comments.php
new file mode 100644
index 000000000..5bd302e6d
--- /dev/null
+++ b/ext/zip/examples/get_set_comments.php
@@ -0,0 +1,38 @@
+<?php
+error_reporting(E_ALL|E_STRICT);
+
+copy('test_with_comment.zip', 't.zip');
+$z = new ZipArchive;
+$z->open('t.zip');
+
+print_r($z);
+
+for ($i=0; $i<$z->numFiles; $i++) {
+ echo "index: $i\n";
+ print_r($z->getCommentIndex($i));
+ echo "\n\n";
+}
+echo "foobar/ " . $z->getCommentName('foobar/') . "\n";
+
+echo "Archive comment: " . $z->getArchiveComment() . "\n";
+
+
+$z->setCommentIndex(1, 'new comment idx 1');
+$z->setCommentName('foobar/', 'new comment foobar/');
+
+$z->setArchiveComment( 'new archive comment');
+
+for ($i=0; $i<$z->numFiles; $i++) {
+ echo "index: $i\n";
+ print_r($z->getCommentIndex($i));
+ echo "\n\n";
+}
+
+echo $z->getCommentName('foobar/') . "\n";
+
+// Get the original comment
+echo $z->getCommentName('foobar/', ZIPARCHIVE::FL_UNCHANGED) . "\n";
+
+echo "Archive comment: " . $z->getArchiveComment() . "\n";
+echo "Archive comment (original): " . $z->getArchiveComment(ZIPARCHIVE::FL_UNCHANGED) . "\n";
+
diff --git a/ext/zip/examples/im.php b/ext/zip/examples/im.php
new file mode 100644
index 000000000..bef96f28b
--- /dev/null
+++ b/ext/zip/examples/im.php
@@ -0,0 +1,11 @@
+<?php
+/* $Id: im.php,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+$im = imagecreatefromgif('zip://' . dirname(__FILE__) . '/test_im.zip#pear_item.gif');
+imagepng($im, 'a.png');
+
+$z = new ZipArchive();
+$z->open(dirname(__FILE__) . '/test_im.zip');
+$im_string = $z->getFromName("pear_item.gif");
+$im = imagecreatefromstring($im_string);
+imagepng($im, 'b.png');
+
diff --git a/ext/zip/examples/odt.php b/ext/zip/examples/odt.php
new file mode 100644
index 000000000..faacdd694
--- /dev/null
+++ b/ext/zip/examples/odt.php
@@ -0,0 +1,20 @@
+<?php
+/* $Id: odt.php,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+$reader = new XMLReader();
+
+$reader->open('zip://' . dirname(__FILE__) . '/test.odt#meta.xml');
+$odt_meta = array();
+while ($reader->read()) {
+ if ($reader->nodeType == XMLREADER::ELEMENT) {
+ $elm = $reader->name;
+ } else {
+ if ($reader->nodeType == XMLREADER::END_ELEMENT && $reader->name == 'office:meta') {
+ break;
+ }
+ if (!trim($reader->value)) {
+ continue;
+ }
+ $odt_meta[$elm] = $reader->value;
+ }
+}
+print_r($odt_meta);
diff --git a/ext/zip/examples/oldapi.php b/ext/zip/examples/oldapi.php
new file mode 100644
index 000000000..2f17f43eb
--- /dev/null
+++ b/ext/zip/examples/oldapi.php
@@ -0,0 +1,17 @@
+<?php
+
+$zip = zip_open('examples/test1.zip');
+var_dump($zip);
+
+if ($zip) {
+ $i = 0;
+ while ($zip_entry = zip_read($zip)) {
+ var_dump($zip_entry);
+ $txt = zip_entry_read($zip_entry, 10);
+ echo $i . ": " . $txt . "size: " . zip_entry_filesize($zip_entry) .
+ "comp_method: " . zip_entry_compressionmethod($zip_entry) .
+ "\n";
+ $i++;
+ }
+ var_dump($zip_entry);
+}
diff --git a/ext/zip/examples/test.odt b/ext/zip/examples/test.odt
new file mode 100644
index 000000000..6a816ad74
--- /dev/null
+++ b/ext/zip/examples/test.odt
Binary files differ
diff --git a/ext/zip/examples/test.zip b/ext/zip/examples/test.zip
new file mode 100644
index 000000000..6b9869480
--- /dev/null
+++ b/ext/zip/examples/test.zip
Binary files differ
diff --git a/ext/zip/examples/test1.zip b/ext/zip/examples/test1.zip
new file mode 100644
index 000000000..a4deb13c6
--- /dev/null
+++ b/ext/zip/examples/test1.zip
Binary files differ
diff --git a/ext/zip/examples/test_im.zip b/ext/zip/examples/test_im.zip
new file mode 100644
index 000000000..6385ee925
--- /dev/null
+++ b/ext/zip/examples/test_im.zip
Binary files differ
diff --git a/ext/zip/examples/test_with_comment.zip b/ext/zip/examples/test_with_comment.zip
new file mode 100644
index 000000000..cc65375fb
--- /dev/null
+++ b/ext/zip/examples/test_with_comment.zip
Binary files differ
diff --git a/ext/zip/examples/too.php b/ext/zip/examples/too.php
new file mode 100644
index 000000000..6d2100811
--- /dev/null
+++ b/ext/zip/examples/too.php
@@ -0,0 +1,2 @@
+<?php
+echo "too";
diff --git a/ext/zip/lib/mkstemp.c b/ext/zip/lib/mkstemp.c
new file mode 100644
index 000000000..3ac587eaf
--- /dev/null
+++ b/ext/zip/lib/mkstemp.c
@@ -0,0 +1,136 @@
+/* $NiH: mkstemp.c,v 1.3 2006/04/23 14:51:45 wiz Exp $ */
+
+/* Adapted from NetBSB libc by Dieter Baron */
+
+/* NetBSD: gettemp.c,v 1.13 2003/12/05 00:57:36 uebayasi Exp */
+
+/*
+ * Copyright (c) 1987, 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. 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 <sys/types.h>
+#include <sys/stat.h>
+
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+
+int
+_zip_mkstemp(char *path)
+{
+ int fd;
+ char *start, *trv;
+ struct stat sbuf;
+ pid_t pid;
+
+ /* To guarantee multiple calls generate unique names even if
+ the file is not created. 676 different possibilities with 7
+ or more X's, 26 with 6 or less. */
+ static char xtra[2] = "aa";
+ int xcnt = 0;
+
+ pid = getpid();
+
+ /* Move to end of path and count trailing X's. */
+ for (trv = path; *trv; ++trv)
+ if (*trv == 'X')
+ xcnt++;
+ else
+ xcnt = 0;
+
+ /* Use at least one from xtra. Use 2 if more than 6 X's. */
+ if (*(trv - 1) == 'X')
+ *--trv = xtra[0];
+ if (xcnt > 6 && *(trv - 1) == 'X')
+ *--trv = xtra[1];
+
+ /* Set remaining X's to pid digits with 0's to the left. */
+ while (*--trv == 'X') {
+ *trv = (pid % 10) + '0';
+ pid /= 10;
+ }
+
+ /* update xtra for next call. */
+ if (xtra[0] != 'z')
+ xtra[0]++;
+ else {
+ xtra[0] = 'a';
+ if (xtra[1] != 'z')
+ xtra[1]++;
+ else
+ xtra[1] = 'a';
+ }
+
+ /*
+ * check the target directory; if you have six X's and it
+ * doesn't exist this runs for a *very* long time.
+ */
+ for (start = trv + 1;; --trv) {
+ if (trv <= path)
+ break;
+ if (*trv == '/') {
+ *trv = '\0';
+ if (stat(path, &sbuf))
+ return (0);
+ if (!S_ISDIR(sbuf.st_mode)) {
+ errno = ENOTDIR;
+ return (0);
+ }
+ *trv = '/';
+ break;
+ }
+ }
+
+ for (;;) {
+ if ((fd = open(path, O_CREAT | O_EXCL | O_RDWR, 0600)) >= 0)
+ return (1);
+ if (errno != EEXIST)
+ return (0);
+
+ /* tricky little algorithm for backward compatibility */
+ for (trv = start;;) {
+ if (!*trv)
+ return (0);
+ if (*trv == 'z')
+ *trv++ = 'a';
+ else {
+ if (isdigit((unsigned char)*trv))
+ *trv = 'a';
+ else
+ ++*trv;
+ break;
+ }
+ }
+ }
+ /*NOTREACHED*/
+}
diff --git a/ext/zip/lib/unistd.h b/ext/zip/lib/unistd.h
new file mode 100644
index 000000000..2ef435c01
--- /dev/null
+++ b/ext/zip/lib/unistd.h
@@ -0,0 +1,3 @@
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
diff --git a/ext/zip/lib/zip.h b/ext/zip/lib/zip.h
new file mode 100644
index 000000000..8cf690cad
--- /dev/null
+++ b/ext/zip/lib/zip.h
@@ -0,0 +1,206 @@
+#ifndef _HAD_ZIP_H
+#define _HAD_ZIP_H
+
+/*
+ $NiH: zip.h,v 1.57 2006/04/24 14:04:19 dillo Exp $
+
+ zip.h -- exported declarations.
+ Copyright (C) 1999-2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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.
+*/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <time.h>
+
+#include "zip_win32.h"
+
+/* flags for zip_open */
+
+#define ZIP_CREATE 1
+#define ZIP_EXCL 2
+#define ZIP_CHECKCONS 4
+#define ZIP_OVERWRITE 8
+
+
+/* flags for zip_name_locate, zip_fopen, zip_stat, ... */
+
+#define ZIP_FL_NOCASE 1 /* ignore case on name lookup */
+#define ZIP_FL_NODIR 2 /* ignore directory component */
+#define ZIP_FL_COMPRESSED 4 /* read compressed data */
+#define ZIP_FL_UNCHANGED 8 /* use original data, ignoring changes */
+
+/* libzip error codes */
+
+#define ZIP_ER_OK 0 /* N No error */
+#define ZIP_ER_MULTIDISK 1 /* N Multi-disk zip archives not supported */
+#define ZIP_ER_RENAME 2 /* S Renaming temporary file failed */
+#define ZIP_ER_CLOSE 3 /* S Closing zip archive failed */
+#define ZIP_ER_SEEK 4 /* S Seek error */
+#define ZIP_ER_READ 5 /* S Read error */
+#define ZIP_ER_WRITE 6 /* S Write error */
+#define ZIP_ER_CRC 7 /* N CRC error */
+#define ZIP_ER_ZIPCLOSED 8 /* N Containing zip archive was closed */
+#define ZIP_ER_NOENT 9 /* N No such file */
+#define ZIP_ER_EXISTS 10 /* N File already exists */
+#define ZIP_ER_OPEN 11 /* S Can't open file */
+#define ZIP_ER_TMPOPEN 12 /* S Failure to create temporary file */
+#define ZIP_ER_ZLIB 13 /* Z Zlib error */
+#define ZIP_ER_MEMORY 14 /* N Malloc failure */
+#define ZIP_ER_CHANGED 15 /* N Entry has been changed */
+#define ZIP_ER_COMPNOTSUPP 16 /* N Compression method not supported */
+#define ZIP_ER_EOF 17 /* N Premature EOF */
+#define ZIP_ER_INVAL 18 /* N Invalid argument */
+#define ZIP_ER_NOZIP 19 /* N Not a zip archive */
+#define ZIP_ER_INTERNAL 20 /* N Internal error */
+#define ZIP_ER_INCONS 21 /* N Zip archive inconsistent */
+#define ZIP_ER_REMOVE 22 /* S Can't remove file */
+#define ZIP_ER_DELETED 23 /* N Entry has been deleted */
+
+
+/* type of system error value */
+
+#define ZIP_ET_NONE 0 /* sys_err unused */
+#define ZIP_ET_SYS 1 /* sys_err is errno */
+#define ZIP_ET_ZLIB 2 /* sys_err is zlib error code */
+
+/* compression methods */
+
+#define ZIP_CM_DEFAULT -1 /* better of deflate or store */
+#define ZIP_CM_STORE 0 /* stored (uncompressed) */
+#define ZIP_CM_SHRINK 1 /* shrunk */
+#define ZIP_CM_REDUCE_1 2 /* reduced with factor 1 */
+#define ZIP_CM_REDUCE_2 3 /* reduced with factor 2 */
+#define ZIP_CM_REDUCE_3 4 /* reduced with factor 3 */
+#define ZIP_CM_REDUCE_4 5 /* reduced with factor 4 */
+#define ZIP_CM_IMPLODE 6 /* imploded */
+/* 7 - Reserved for Tokenizing compression algorithm */
+#define ZIP_CM_DEFLATE 8 /* deflated */
+#define ZIP_CM_DEFLATE64 9 /* deflate64 */
+#define ZIP_CM_PKWARE_IMPLODE 10 /* PKWARE imploding */
+/* 11 - Reserved by PKWARE */
+#define ZIP_CM_BZIP2 12 /* compressed using BZIP2 algorithm */
+
+/* encryption methods */
+
+#define ZIP_EM_NONE 0 /* not encrypted */
+#define ZIP_EM_TRAD_PKWARE 1 /* traditional PKWARE encryption */
+#if 0 /* Strong Encryption Header not parsed yet */
+#define ZIP_EM_DES 0x6601 /* strong encryption: DES */
+#define ZIP_EM_RC2_OLD 0x6602 /* strong encryption: RC2, version < 5.2 */
+#define ZIP_EM_3DES_168 0x6603
+#define ZIP_EM_3DES_112 0x6609
+#define ZIP_EM_AES_128 0x660e
+#define ZIP_EM_AES_192 0x660f
+#define ZIP_EM_AES_256 0x6610
+#define ZIP_EM_RC2 0x6702 /* strong encryption: RC2, version >= 5.2 */
+#define ZIP_EM_RC4 0x6801
+#endif
+#define ZIP_EM_UNKNOWN 0xffff /* unknown algorithm */
+
+
+
+enum zip_source_cmd {
+ ZIP_SOURCE_OPEN, /* prepare for reading */
+ ZIP_SOURCE_READ, /* read data */
+ ZIP_SOURCE_CLOSE, /* reading is done */
+ ZIP_SOURCE_STAT, /* get meta information */
+ ZIP_SOURCE_ERROR, /* get error information */
+ ZIP_SOURCE_FREE /* cleanup and free resources */
+};
+
+typedef ssize_t (*zip_source_callback)(void *state, void *data,
+ size_t len, enum zip_source_cmd cmd);
+
+struct zip_stat {
+ const char *name; /* name of the file */
+ int index; /* index within archive */
+ unsigned int crc; /* crc of file data */
+ time_t mtime; /* modification time */
+ off_t size; /* size of file (uncompressed) */
+ off_t comp_size; /* size of file (compressed) */
+ unsigned short comp_method; /* compression method used */
+ unsigned short encryption_method; /* encryption method used */
+};
+
+struct zip;
+struct zip_file;
+struct zip_source;
+
+
+
+int zip_add(struct zip *, const char *, struct zip_source *);
+int zip_close(struct zip *);
+int zip_delete(struct zip *, int);
+void zip_error_get(struct zip *, int *, int *);
+int zip_error_get_sys_type(int);
+int zip_error_to_str(char *, size_t, int, int);
+int zip_fclose(struct zip_file *);
+void zip_file_error_get(struct zip_file *, int *, int *);
+const char *zip_file_strerror(struct zip_file *);
+struct zip_file *zip_fopen(struct zip *, const char *, int);
+struct zip_file *zip_fopen_index(struct zip *, int, int);
+ssize_t zip_fread(struct zip_file *, void *, size_t);
+const char *zip_get_archive_comment(struct zip *, int *, int);
+const char *zip_get_file_comment(struct zip *, int, int *, int);
+const char *zip_get_name(struct zip *, int, int);
+int zip_get_num_files(struct zip *);
+int zip_name_locate(struct zip *, const char *, int);
+struct zip *zip_open(const char *, int, int *);
+int zip_rename(struct zip *, int, const char *);
+int zip_replace(struct zip *, int, struct zip_source *);
+int zip_set_archive_comment(struct zip *, const char *, int);
+int zip_set_file_comment(struct zip *, int, const char *, int);
+struct zip_source *zip_source_buffer(struct zip *, const void *, off_t, int);
+struct zip_source *zip_source_file(struct zip *, const char *, off_t, off_t);
+struct zip_source *zip_source_filep(struct zip *, FILE *, off_t, off_t);
+void zip_source_free(struct zip_source *);
+struct zip_source *zip_source_function(struct zip *,
+ zip_source_callback, void *);
+struct zip_source *zip_source_zip(struct zip *, struct zip *, int, int,
+ off_t, off_t);
+int zip_stat(struct zip *, const char *, int, struct zip_stat *);
+int zip_stat_index(struct zip *, int, int, struct zip_stat *);
+const char *zip_strerror(struct zip *);
+int zip_unchange(struct zip *, int);
+int zip_unchange_all(struct zip *);
+int zip_unchange_archive(struct zip *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HAD_ZIP_H */
diff --git a/ext/zip/lib/zip_add.c b/ext/zip/lib/zip_add.c
new file mode 100644
index 000000000..535d6e468
--- /dev/null
+++ b/ext/zip/lib/zip_add.c
@@ -0,0 +1,51 @@
+/*
+ $NiH: zip_add.c,v 1.14 2004/11/18 15:04:04 wiz Exp $
+
+ zip_add.c -- add file via callback function
+ Copyright (C) 1999, 2003, 2004 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_add(struct zip *za, const char *name, struct zip_source *source)
+{
+ if (name == NULL || source == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return -1;
+ }
+ return _zip_replace(za, -1, name, source);
+}
diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c
new file mode 100644
index 000000000..3cb324d9c
--- /dev/null
+++ b/ext/zip/lib/zip_close.c
@@ -0,0 +1,554 @@
+/*
+ $NiH: zip_close.c,v 1.60 2006/05/09 17:21:47 wiz Exp $
+
+ zip_close.c -- close zip archive and update changes
+ Copyright (C) 1999, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+static int add_data(struct zip *, int, struct zip_dirent *, FILE *);
+static int add_data_comp(zip_source_callback, void *, struct zip_stat *,
+ FILE *, struct zip_error *);
+static int add_data_uncomp(zip_source_callback, void *, struct zip_stat *,
+ FILE *, struct zip_error *);
+static void ch_set_error(struct zip_error *, zip_source_callback, void *);
+static int copy_data(FILE *, off_t, FILE *, struct zip_error *);
+static int _zip_cdir_set_comment(struct zip_cdir *, struct zip *);
+static int _zip_changed(struct zip *, int *);
+static char *_zip_create_temp_output(struct zip *, FILE **);
+
+int
+zip_close(struct zip *za)
+{
+ int survivors;
+ int i, j, error;
+ char *temp;
+ FILE *out;
+ mode_t mask;
+ struct zip_cdir *cd;
+ struct zip_dirent de;
+ int rename_error = 0;
+
+ if (!_zip_changed(za, &survivors)) {
+ _zip_free(za);
+ return 0;
+ }
+
+ /* don't create zip files with no entries */
+ if (survivors == 0) {
+ if (za->zn) {
+ if (remove(za->zn) != 0) {
+ _zip_error_set(&za->error, ZIP_ER_REMOVE, errno);
+ return -1;
+ }
+ }
+ _zip_free(za);
+ return 0;
+ }
+
+ if ((cd=_zip_cdir_new(survivors, &za->error)) == NULL)
+ return -1;
+
+ for (i=0; i<survivors; i++)
+ _zip_dirent_init(&cd->entry[i]);
+
+ if (_zip_cdir_set_comment(cd, za) == -1) {
+ _zip_cdir_free(cd);
+ return -1;
+ }
+
+ if ((temp=_zip_create_temp_output(za, &out)) == NULL) {
+ _zip_cdir_free(cd);
+ return -1;
+ }
+
+ error = 0;
+ for (i=j=0; i<za->nentry; i++) {
+ if (za->entry[i].state == ZIP_ST_DELETED)
+ continue;
+
+ /* create new local directory entry */
+ if (ZIP_ENTRY_DATA_CHANGED(za->entry+i)) {
+ _zip_dirent_init(&de);
+ /* use it as central directory entry */
+ memcpy(cd->entry+j, &de, sizeof(cd->entry[j]));
+
+ /* set/update file name */
+ if (za->entry[i].ch_filename == NULL) {
+ if (za->entry[i].state == ZIP_ST_REPLACED) {
+ de.filename = strdup(za->cdir->entry[i].filename);
+ de.filename_len = strlen(de.filename);
+ cd->entry[j].filename = za->cdir->entry[i].filename;
+ cd->entry[j].filename_len = de.filename_len;
+ }
+ else {
+ de.filename = strdup("-");
+ de.filename_len = 1;
+ cd->entry[j].filename = "-";
+ cd->entry[j].filename_len = de.filename_len;
+ }
+ }
+ }
+ else {
+ /* copy existing directory entries */
+ if (fseek(za->zp, za->cdir->entry[i].offset, SEEK_SET) != 0) {
+ _zip_error_set(&za->error, ZIP_ER_SEEK, errno);
+ error = 1;
+ break;
+ }
+ if (_zip_dirent_read(&de, za->zp, NULL, 0, 1, &za->error) != 0) {
+ error = 1;
+ break;
+ }
+
+ if (de.bitflags & ZIP_GPBF_USE_DATA_DESCRIPTOR) {
+ de.crc = (za->cdir->entry+i)->crc;
+ de.comp_size = (za->cdir->entry+i)->comp_size;
+ de.uncomp_size = (za->cdir->entry+i)->uncomp_size;
+ }
+ memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j]));
+ }
+
+ if (za->entry[i].ch_filename) {
+ free(de.filename);
+ if ((de.filename=strdup(za->entry[i].ch_filename)) == NULL) {
+ error = 1;
+ break;
+ }
+ de.filename_len = strlen(de.filename);
+ cd->entry[j].filename = za->entry[i].ch_filename;
+ cd->entry[j].filename_len = de.filename_len;
+ }
+
+ if (za->entry[i].ch_comment_len != -1) {
+ /* as the rest of cd entries, its malloc/free is done by za */
+ cd->entry[j].comment = za->entry[i].ch_comment;
+ cd->entry[j].comment_len = za->entry[i].ch_comment_len;
+ }
+
+ cd->entry[j].offset = ftell(out);
+
+ if (ZIP_ENTRY_DATA_CHANGED(za->entry+i)) {
+ if (add_data(za, i, &de, out) < 0) {
+ error = 1;
+ break;
+ }
+
+ cd->entry[j].last_mod = de.last_mod;
+ cd->entry[j].comp_method = de.comp_method;
+ cd->entry[j].comp_size = de.comp_size;
+ cd->entry[j].uncomp_size = de.uncomp_size;
+ cd->entry[j].crc = de.crc;
+ }
+ else {
+ if (_zip_dirent_write(&de, out, 1, &za->error) < 0) {
+ error = 1;
+ break;
+ }
+ /* we just read the local dirent, file is at correct position */
+ if (copy_data(za->zp, de.comp_size, out, &za->error) < 0) {
+ error = 1;
+ break;
+ }
+ }
+
+ j++;
+
+ _zip_dirent_finalize(&de);
+ }
+
+ if (!error) {
+ if (_zip_cdir_write(cd, out, &za->error) < 0)
+ error = 1;
+ }
+
+ /* pointers in cd entries are owned by za */
+ cd->nentry = 0;
+ _zip_cdir_free(cd);
+
+ if (error) {
+ _zip_dirent_finalize(&de);
+ fclose(out);
+ remove(temp);
+ free(temp);
+ return -1;
+ }
+
+ if (fclose(out) != 0) {
+ _zip_error_set(&za->error, ZIP_ER_CLOSE, errno);
+ remove(temp);
+ free(temp);
+ return -1;
+ }
+
+ if (za->zp) {
+ fclose(za->zp);
+ za->zp = NULL;
+ }
+
+#ifdef PHP_WIN32
+ if (!MoveFileEx(temp, za->zn, MOVEFILE_REPLACE_EXISTING)) {
+ rename_error = -1;
+ }
+#else
+ if (rename(temp, za->zn) != 0) {
+ rename_error = -1;
+ }
+#endif
+
+ if (rename_error < 0) {
+ _zip_error_set(&za->error, ZIP_ER_RENAME, errno);
+ remove(temp);
+ free(temp);
+ return -1;
+ }
+
+ mask = umask(0);
+ umask(mask);
+ chmod(za->zn, 0666&~mask);
+
+ _zip_free(za);
+
+ return 0;
+}
+
+
+
+static int
+add_data(struct zip *za, int idx, struct zip_dirent *de, FILE *ft)
+{
+ off_t offstart, offend;
+ zip_source_callback cb;
+ void *ud;
+ struct zip_stat st;
+
+ cb = za->entry[idx].source->f;
+ ud = za->entry[idx].source->ud;
+
+ if (cb(ud, &st, sizeof(st), ZIP_SOURCE_STAT) < (ssize_t)sizeof(st)) {
+ ch_set_error(&za->error, cb, ud);
+ return -1;
+ }
+
+ if (cb(ud, NULL, 0, ZIP_SOURCE_OPEN) < 0) {
+ ch_set_error(&za->error, cb, ud);
+ return -1;
+ }
+
+ offstart = ftell(ft);
+
+ if (_zip_dirent_write(de, ft, 1, &za->error) < 0)
+ return -1;
+
+ if (st.comp_method != ZIP_CM_STORE) {
+ if (add_data_comp(cb, ud, &st, ft, &za->error) < 0)
+ return -1;
+ }
+ else {
+ if (add_data_uncomp(cb, ud, &st, ft, &za->error) < 0)
+ return -1;
+ }
+
+ if (cb(ud, NULL, 0, ZIP_SOURCE_CLOSE) < 0) {
+ ch_set_error(&za->error, cb, ud);
+ return -1;
+ }
+
+ offend = ftell(ft);
+
+ if (fseek(ft, offstart, SEEK_SET) < 0) {
+ _zip_error_set(&za->error, ZIP_ER_SEEK, errno);
+ return -1;
+ }
+
+ de->comp_method = st.comp_method;
+ de->last_mod = st.mtime;
+ de->crc = st.crc;
+ de->uncomp_size = st.size;
+ de->comp_size = st.comp_size;
+
+ if (_zip_dirent_write(de, ft, 1, &za->error) < 0)
+ return -1;
+
+ if (fseek(ft, offend, SEEK_SET) < 0) {
+ _zip_error_set(&za->error, ZIP_ER_SEEK, errno);
+ return -1;
+ }
+
+ return 0;
+}
+
+
+
+static int
+add_data_comp(zip_source_callback cb, void *ud, struct zip_stat *st,FILE *ft,
+ struct zip_error *error)
+{
+ char buf[BUFSIZE];
+ ssize_t n;
+
+ st->comp_size = 0;
+ while ((n=cb(ud, buf, sizeof(buf), ZIP_SOURCE_READ)) > 0) {
+ if (fwrite(buf, 1, n, ft) != (size_t)n) {
+ _zip_error_set(error, ZIP_ER_WRITE, errno);
+ return -1;
+ }
+
+ st->comp_size += n;
+ }
+ if (n < 0) {
+ ch_set_error(error, cb, ud);
+ return -1;
+ }
+
+ return 0;
+}
+
+
+
+static int
+add_data_uncomp(zip_source_callback cb, void *ud, struct zip_stat *st,
+ FILE *ft, struct zip_error *error)
+{
+ char b1[BUFSIZE], b2[BUFSIZE];
+ int end, flush, ret;
+ ssize_t n;
+ size_t n2;
+ z_stream zstr;
+
+ st->comp_method = ZIP_CM_DEFLATE;
+ st->comp_size = st->size = 0;
+ st->crc = crc32(0, NULL, 0);
+
+ zstr.zalloc = Z_NULL;
+ zstr.zfree = Z_NULL;
+ zstr.opaque = NULL;
+ zstr.avail_in = 0;
+ zstr.avail_out = 0;
+
+ /* -15: undocumented feature of zlib to _not_ write a zlib header */
+ deflateInit2(&zstr, Z_BEST_COMPRESSION, Z_DEFLATED, -15, 9,
+ Z_DEFAULT_STRATEGY);
+
+ zstr.next_out = (Bytef *)b2;
+ zstr.avail_out = sizeof(b2);
+ zstr.avail_in = 0;
+
+ flush = 0;
+ end = 0;
+ while (!end) {
+ if (zstr.avail_in == 0 && !flush) {
+ if ((n=cb(ud, b1, sizeof(b1), ZIP_SOURCE_READ)) < 0) {
+ ch_set_error(error, cb, ud);
+ deflateEnd(&zstr);
+ return -1;
+ }
+ if (n > 0) {
+ zstr.avail_in = n;
+ zstr.next_in = (Bytef *)b1;
+ st->size += n;
+ st->crc = crc32(st->crc, (Bytef *)b1, n);
+ }
+ else
+ flush = Z_FINISH;
+ }
+
+ ret = deflate(&zstr, flush);
+ if (ret != Z_OK && ret != Z_STREAM_END) {
+ _zip_error_set(error, ZIP_ER_ZLIB, ret);
+ return -1;
+ }
+
+ if (zstr.avail_out != sizeof(b2)) {
+ n2 = sizeof(b2) - zstr.avail_out;
+
+ if (fwrite(b2, 1, n2, ft) != n2) {
+ _zip_error_set(error, ZIP_ER_WRITE, errno);
+ return -1;
+ }
+
+ zstr.next_out = (Bytef *)b2;
+ zstr.avail_out = sizeof(b2);
+ st->comp_size += n2;
+ }
+
+ if (ret == Z_STREAM_END) {
+ deflateEnd(&zstr);
+ end = 1;
+ }
+ }
+
+ return 0;
+}
+
+
+
+static void
+ch_set_error(struct zip_error *error, zip_source_callback cb, void *ud)
+{
+ int e[2];
+
+ if ((cb(ud, e, sizeof(e), ZIP_SOURCE_ERROR)) < (ssize_t)sizeof(e)) {
+ error->zip_err = ZIP_ER_INTERNAL;
+ error->sys_err = 0;
+ }
+ else {
+ error->zip_err = e[0];
+ error->sys_err = e[1];
+ }
+}
+
+
+
+static int
+copy_data(FILE *fs, off_t len, FILE *ft, struct zip_error *error)
+{
+ char buf[BUFSIZE];
+ int n, nn;
+
+ if (len == 0)
+ return 0;
+
+ while (len > 0) {
+ nn = len > sizeof(buf) ? sizeof(buf) : len;
+ if ((n=fread(buf, 1, nn, fs)) < 0) {
+ _zip_error_set(error, ZIP_ER_READ, errno);
+ return -1;
+ }
+ else if (n == 0) {
+ _zip_error_set(error, ZIP_ER_EOF, 0);
+ return -1;
+ }
+
+ if (fwrite(buf, 1, n, ft) != (size_t)n) {
+ _zip_error_set(error, ZIP_ER_WRITE, errno);
+ return -1;
+ }
+
+ len -= n;
+ }
+
+ return 0;
+}
+
+
+
+static int
+_zip_cdir_set_comment(struct zip_cdir *dest, struct zip *src)
+{
+ if (src->ch_comment_len != -1) {
+ dest->comment = _zip_memdup(src->ch_comment,
+ src->ch_comment_len, &src->error);
+ if (dest->comment == NULL)
+ return -1;
+ dest->comment_len = src->ch_comment_len;
+ } else {
+ if (src->cdir && src->cdir->comment) {
+ dest->comment = _zip_memdup(src->cdir->comment,
+ src->cdir->comment_len, &src->error);
+ if (dest->comment == NULL)
+ return -1;
+ dest->comment_len = src->cdir->comment_len;
+ }
+ }
+
+ return 0;
+}
+
+
+
+static int
+_zip_changed(struct zip *za, int *survivorsp)
+{
+ int changed, i, survivors;
+
+ changed = survivors = 0;
+
+ if (za->ch_comment_len != -1)
+ changed = 1;
+
+ for (i=0; i<za->nentry; i++) {
+ if ((za->entry[i].state != ZIP_ST_UNCHANGED)
+ || (za->entry[i].ch_comment_len != -1))
+ changed = 1;
+ if (za->entry[i].state != ZIP_ST_DELETED)
+ survivors++;
+ }
+
+ *survivorsp = survivors;
+
+ return changed;
+}
+
+
+
+static char *
+_zip_create_temp_output(struct zip *za, FILE **outp)
+{
+ char *temp;
+ int tfd;
+ FILE *tfp;
+
+ if ((temp=(char *)malloc(strlen(za->zn)+8)) == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+
+ sprintf(temp, "%s.XXXXXX", za->zn);
+
+ if ((tfd=mkstemp(temp)) == -1) {
+ _zip_error_set(&za->error, ZIP_ER_TMPOPEN, errno);
+ free(temp);
+ return NULL;
+ }
+
+ if ((tfp=fdopen(tfd, "r+b")) == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_TMPOPEN, errno);
+ close(tfd);
+ remove(temp);
+ free(temp);
+ return NULL;
+ }
+
+ *outp = tfp;
+ return temp;
+}
diff --git a/ext/zip/lib/zip_delete.c b/ext/zip/lib/zip_delete.c
new file mode 100644
index 000000000..7244e612f
--- /dev/null
+++ b/ext/zip/lib/zip_delete.c
@@ -0,0 +1,61 @@
+/*
+ $NiH: zip_delete.c,v 1.17 2005/06/09 19:57:09 dillo Exp $
+
+ zip_delete.c -- delete file from zip archive
+ Copyright (C) 1999, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_delete(struct zip *za, int idx)
+{
+ if (idx < 0 || idx >= za->nentry) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return -1;
+ }
+
+ /* allow duplicate file names, because the file will
+ * be removed directly afterwards */
+ if (_zip_unchange(za, idx, 1) != 0)
+ return -1;
+
+ za->entry[idx].state = ZIP_ST_DELETED;
+
+ return 0;
+}
+
+
diff --git a/ext/zip/lib/zip_dirent.c b/ext/zip/lib/zip_dirent.c
new file mode 100644
index 000000000..f0c988bc7
--- /dev/null
+++ b/ext/zip/lib/zip_dirent.c
@@ -0,0 +1,532 @@
+/*
+ $NiH: zip_dirent.c,v 1.9 2006/04/23 14:51:45 wiz Exp $
+
+ zip_dirent.c -- read directory entry (local or central), clean dirent
+ Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+static time_t _zip_d2u_time(int, int);
+static char *_zip_readfpstr(FILE *, unsigned int, int, struct zip_error *);
+static char *_zip_readstr(unsigned char **, int, int, struct zip_error *);
+static void _zip_u2d_time(time_t, unsigned short *, unsigned short *);
+static void _zip_write2(unsigned short, FILE *);
+static void _zip_write4(unsigned int, FILE *);
+
+
+
+void
+_zip_cdir_free(struct zip_cdir *cd)
+{
+ int i;
+
+ if (!cd)
+ return;
+
+ for (i=0; i<cd->nentry; i++)
+ _zip_dirent_finalize(cd->entry+i);
+ free(cd->comment);
+ free(cd->entry);
+ free(cd);
+}
+
+
+
+struct zip_cdir *
+_zip_cdir_new(int nentry, struct zip_error *error)
+{
+ struct zip_cdir *cd;
+
+ if ((cd=(struct zip_cdir *)malloc(sizeof(*cd))) == NULL) {
+ _zip_error_set(error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+
+ if ((cd->entry=(struct zip_dirent *)malloc(sizeof(*(cd->entry))*nentry))
+ == NULL) {
+ _zip_error_set(error, ZIP_ER_MEMORY, 0);
+ free(cd);
+ return NULL;
+ }
+
+ /* entries must be initialized by caller */
+
+ cd->nentry = nentry;
+ cd->size = cd->offset = 0;
+ cd->comment = NULL;
+ cd->comment_len = 0;
+
+ return cd;
+}
+
+
+
+int
+_zip_cdir_write(struct zip_cdir *cd, FILE *fp, struct zip_error *error)
+{
+ int i;
+
+ cd->offset = ftell(fp);
+
+ for (i=0; i<cd->nentry; i++) {
+ if (_zip_dirent_write(cd->entry+i, fp, 0, error) != 0)
+ return -1;
+ }
+
+ cd->size = ftell(fp) - cd->offset;
+
+ /* clearerr(fp); */
+ fwrite(EOCD_MAGIC, 1, 4, fp);
+ _zip_write4(0, fp);
+ _zip_write2((unsigned short)cd->nentry, fp);
+ _zip_write2((unsigned short)cd->nentry, fp);
+ _zip_write4(cd->size, fp);
+ _zip_write4(cd->offset, fp);
+ _zip_write2(cd->comment_len, fp);
+ fwrite(cd->comment, 1, cd->comment_len, fp);
+
+ if (ferror(fp)) {
+ _zip_error_set(error, ZIP_ER_WRITE, errno);
+ return -1;
+ }
+
+ return 0;
+}
+
+
+
+void
+_zip_dirent_finalize(struct zip_dirent *zde)
+{
+ free(zde->filename);
+ zde->filename = NULL;
+ free(zde->extrafield);
+ zde->extrafield = NULL;
+ free(zde->comment);
+ zde->comment = NULL;
+}
+
+
+
+void
+_zip_dirent_init(struct zip_dirent *de)
+{
+ de->version_madeby = 0;
+ de->version_needed = 20; /* 2.0 */
+ de->bitflags = 0;
+ de->comp_method = 0;
+ de->last_mod = 0;
+ de->crc = 0;
+ de->comp_size = 0;
+ de->uncomp_size = 0;
+ de->filename = NULL;
+ de->filename_len = 0;
+ de->extrafield = NULL;
+ de->extrafield_len = 0;
+ de->comment = NULL;
+ de->comment_len = 0;
+ de->disk_number = 0;
+ de->int_attrib = 0;
+ de->ext_attrib = 0;
+ de->offset = 0;
+}
+
+
+
+/* _zip_dirent_read(zde, fp, bufp, left, localp, error):
+ Fills the zip directory entry zde.
+
+ If bufp is non-NULL, data is taken from there and bufp is advanced
+ by the amount of data used; no more than left bytes are used.
+ Otherwise data is read from fp as needed.
+
+ If localp != 0, it reads a local header instead of a central
+ directory entry.
+
+ Returns 0 if successful. On error, error is filled in and -1 is
+ returned.
+*/
+
+int
+_zip_dirent_read(struct zip_dirent *zde, FILE *fp,
+ unsigned char **bufp, unsigned int left, int localp,
+ struct zip_error *error)
+{
+ unsigned char buf[CDENTRYSIZE];
+ unsigned char *cur;
+ unsigned short dostime, dosdate;
+ unsigned int size;
+
+ if (localp)
+ size = LENTRYSIZE;
+ else
+ size = CDENTRYSIZE;
+
+ if (bufp) {
+ /* use data from buffer */
+ cur = *bufp;
+ if (left < size) {
+ _zip_error_set(error, ZIP_ER_NOZIP, 0);
+ return -1;
+ }
+ }
+ else {
+ /* read entry from disk */
+ if ((fread(buf, 1, size, fp)<size)) {
+ _zip_error_set(error, ZIP_ER_READ, errno);
+ return -1;
+ }
+ left = size;
+ cur = buf;
+ }
+
+ if (memcmp(cur, (localp ? LOCAL_MAGIC : CENTRAL_MAGIC), 4) != 0) {
+ _zip_error_set(error, ZIP_ER_NOZIP, 0);
+ return -1;
+ }
+ cur += 4;
+
+
+ /* convert buffercontents to zip_dirent */
+
+ if (!localp)
+ zde->version_madeby = _zip_read2(&cur);
+ else
+ zde->version_madeby = 0;
+ zde->version_needed = _zip_read2(&cur);
+ zde->bitflags = _zip_read2(&cur);
+ zde->comp_method = _zip_read2(&cur);
+
+ /* convert to time_t */
+ dostime = _zip_read2(&cur);
+ dosdate = _zip_read2(&cur);
+ zde->last_mod = _zip_d2u_time(dostime, dosdate);
+
+ zde->crc = _zip_read4(&cur);
+ zde->comp_size = _zip_read4(&cur);
+ zde->uncomp_size = _zip_read4(&cur);
+
+ zde->filename_len = _zip_read2(&cur);
+ zde->extrafield_len = _zip_read2(&cur);
+
+ if (localp) {
+ zde->comment_len = 0;
+ zde->disk_number = 0;
+ zde->int_attrib = 0;
+ zde->ext_attrib = 0;
+ zde->offset = 0;
+ } else {
+ zde->comment_len = _zip_read2(&cur);
+ zde->disk_number = _zip_read2(&cur);
+ zde->int_attrib = _zip_read2(&cur);
+ zde->ext_attrib = _zip_read4(&cur);
+ zde->offset = _zip_read4(&cur);
+ }
+
+ zde->filename = NULL;
+ zde->extrafield = NULL;
+ zde->comment = NULL;
+
+ if (bufp) {
+ if (left < CDENTRYSIZE + (zde->filename_len+zde->extrafield_len
+ +zde->comment_len)) {
+ _zip_error_set(error, ZIP_ER_NOZIP, 0);
+ return -1;
+ }
+
+ if (zde->filename_len) {
+ zde->filename = _zip_readstr(&cur, zde->filename_len, 1, error);
+ if (!zde->filename)
+ return -1;
+ }
+
+ if (zde->extrafield_len) {
+ zde->extrafield = _zip_readstr(&cur, zde->extrafield_len, 0,
+ error);
+ if (!zde->extrafield)
+ return -1;
+ }
+
+ if (zde->comment_len) {
+ zde->comment = _zip_readstr(&cur, zde->comment_len, 0, error);
+ if (!zde->comment)
+ return -1;
+ }
+ }
+ else {
+ if (zde->filename_len) {
+ zde->filename = _zip_readfpstr(fp, zde->filename_len, 1, error);
+ if (!zde->filename)
+ return -1;
+ }
+
+ if (zde->extrafield_len) {
+ zde->extrafield = _zip_readfpstr(fp, zde->extrafield_len, 0,
+ error);
+ if (!zde->extrafield)
+ return -1;
+ }
+
+ if (zde->comment_len) {
+ zde->comment = _zip_readfpstr(fp, zde->comment_len, 0, error);
+ if (!zde->comment)
+ return -1;
+ }
+ }
+
+ if (bufp)
+ *bufp = cur;
+
+ return 0;
+}
+
+
+
+/* _zip_dirent_write(zde, fp, localp, error):
+ Writes zip directory entry zde to file fp.
+
+ If localp != 0, it writes a local header instead of a central
+ directory entry.
+
+ Returns 0 if successful. On error, error is filled in and -1 is
+ returned.
+*/
+
+int
+_zip_dirent_write(struct zip_dirent *zde, FILE *fp, int localp,
+ struct zip_error *error)
+{
+ unsigned short dostime, dosdate;
+
+ fwrite(localp ? LOCAL_MAGIC : CENTRAL_MAGIC, 1, 4, fp);
+
+ if (!localp)
+ _zip_write2(zde->version_madeby, fp);
+ _zip_write2(zde->version_needed, fp);
+ _zip_write2(zde->bitflags, fp);
+ _zip_write2(zde->comp_method, fp);
+
+ _zip_u2d_time(zde->last_mod, &dostime, &dosdate);
+ _zip_write2(dostime, fp);
+ _zip_write2(dosdate, fp);
+
+ _zip_write4(zde->crc, fp);
+ _zip_write4(zde->comp_size, fp);
+ _zip_write4(zde->uncomp_size, fp);
+
+ _zip_write2(zde->filename_len, fp);
+ _zip_write2(zde->extrafield_len, fp);
+
+ if (!localp) {
+ _zip_write2(zde->comment_len, fp);
+ _zip_write2(zde->disk_number, fp);
+ _zip_write2(zde->int_attrib, fp);
+ _zip_write4(zde->ext_attrib, fp);
+ _zip_write4(zde->offset, fp);
+ }
+
+ if (zde->filename_len)
+ fwrite(zde->filename, 1, zde->filename_len, fp);
+
+ if (zde->extrafield_len)
+ fwrite(zde->extrafield, 1, zde->extrafield_len, fp);
+
+ if (!localp) {
+ if (zde->comment_len)
+ fwrite(zde->comment, 1, zde->comment_len, fp);
+ }
+
+ if (ferror(fp)) {
+ _zip_error_set(error, ZIP_ER_WRITE, errno);
+ return -1;
+ }
+
+ return 0;
+}
+
+
+
+static time_t
+_zip_d2u_time(int dtime, int ddate)
+{
+ struct tm *tm;
+ time_t now;
+
+ now = time(NULL);
+ tm = localtime(&now);
+
+ tm->tm_year = ((ddate>>9)&127) + 1980 - 1900;
+ tm->tm_mon = ((ddate>>5)&15) - 1;
+ tm->tm_mday = ddate&31;
+
+ tm->tm_hour = (dtime>>11)&31;
+ tm->tm_min = (dtime>>5)&63;
+ tm->tm_sec = (dtime<<1)&62;
+
+ return mktime(tm);
+}
+
+
+
+unsigned short
+_zip_read2(unsigned char **a)
+{
+ unsigned short ret;
+
+ ret = (*a)[0]+((*a)[1]<<8);
+ *a += 2;
+
+ return ret;
+}
+
+
+
+unsigned int
+_zip_read4(unsigned char **a)
+{
+ unsigned int ret;
+
+ ret = ((((((*a)[3]<<8)+(*a)[2])<<8)+(*a)[1])<<8)+(*a)[0];
+ *a += 4;
+
+ return ret;
+}
+
+
+
+static char *
+_zip_readfpstr(FILE *fp, unsigned int len, int nulp, struct zip_error *error)
+{
+ char *r, *o;
+
+ r = (char *)malloc(nulp ? len+1 : len);
+ if (!r) {
+ _zip_error_set(error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+
+ if (fread(r, 1, len, fp)<len) {
+ free(r);
+ _zip_error_set(error, ZIP_ER_READ, errno);
+ return NULL;
+ }
+
+ if (nulp) {
+ /* replace any in-string NUL characters with spaces */
+ r[len] = 0;
+ for (o=r; o<r+len; o++)
+ if (*o == '\0')
+ *o = ' ';
+ }
+
+ return r;
+}
+
+
+
+static char *
+_zip_readstr(unsigned char **buf, int len, int nulp, struct zip_error *error)
+{
+ char *r, *o;
+
+ r = (char *)malloc(nulp ? len+1 : len);
+ if (!r) {
+ _zip_error_set(error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+
+ memcpy(r, *buf, len);
+ *buf += len;
+
+ if (nulp) {
+ /* replace any in-string NUL characters with spaces */
+ r[len] = 0;
+ for (o=r; o<r+len; o++)
+ if (*o == '\0')
+ *o = ' ';
+ }
+
+ return r;
+}
+
+
+
+static void
+_zip_write2(unsigned short i, FILE *fp)
+{
+ putc(i&0xff, fp);
+ putc((i>>8)&0xff, fp);
+
+ return;
+}
+
+
+
+static void
+_zip_write4(unsigned int i, FILE *fp)
+{
+ putc(i&0xff, fp);
+ putc((i>>8)&0xff, fp);
+ putc((i>>16)&0xff, fp);
+ putc((i>>24)&0xff, fp);
+
+ return;
+}
+
+
+
+static void
+_zip_u2d_time(time_t time, unsigned short *dtime, unsigned short *ddate)
+{
+ struct tm *tm;
+
+ tm = localtime(&time);
+ *ddate = ((tm->tm_year+1900-1980)<<9) + ((tm->tm_mon+1)<<5)
+ + tm->tm_mday;
+ *dtime = ((tm->tm_hour)<<11) + ((tm->tm_min)<<5)
+ + ((tm->tm_sec)>>1);
+
+ return;
+}
diff --git a/ext/zip/lib/zip_entry_free.c b/ext/zip/lib/zip_entry_free.c
new file mode 100644
index 000000000..48443cefd
--- /dev/null
+++ b/ext/zip/lib/zip_entry_free.c
@@ -0,0 +1,55 @@
+/*
+ $NiH: zip_entry_free.c,v 1.2 2006/04/09 19:05:47 wiz Exp $
+
+ zip_entry_free.c -- free struct zip_entry
+ Copyright (C) 1999, 2003, 2004, 2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+void
+_zip_entry_free(struct zip_entry *ze)
+{
+ free(ze->ch_filename);
+ ze->ch_filename = NULL;
+ free(ze->ch_comment);
+ ze->ch_comment = NULL;
+ ze->ch_comment_len = -1;
+
+ _zip_unchange_data(ze);
+}
diff --git a/ext/zip/lib/zip_entry_new.c b/ext/zip/lib/zip_entry_new.c
new file mode 100644
index 000000000..390b72ad7
--- /dev/null
+++ b/ext/zip/lib/zip_entry_new.c
@@ -0,0 +1,81 @@
+/*
+ $NiH: zip_entry_new.c,v 1.2 2006/04/09 19:05:47 wiz Exp $
+
+ zip_entry_new.c -- create and init struct zip_entry
+ Copyright (C) 1999, 2003, 2004, 2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+struct zip_entry *
+_zip_entry_new(struct zip *za)
+{
+ struct zip_entry *ze;
+ if (!za) {
+ ze = (struct zip_entry *)malloc(sizeof(struct zip_entry));
+ if (!ze) {
+ _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+ }
+ else {
+ if (za->nentry >= za->nentry_alloc-1) {
+ za->nentry_alloc += 16;
+ za->entry = (struct zip_entry *)realloc(za->entry,
+ sizeof(struct zip_entry)
+ * za->nentry_alloc);
+ if (!za->entry) {
+ _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+ }
+ ze = za->entry+za->nentry;
+ }
+
+ ze->state = ZIP_ST_UNCHANGED;
+
+ ze->ch_filename = NULL;
+ ze->ch_comment = NULL;
+ ze->ch_comment_len = -1;
+ ze->source = NULL;
+
+ if (za)
+ za->nentry++;
+
+ return ze;
+}
diff --git a/ext/zip/lib/zip_err_str.c b/ext/zip/lib/zip_err_str.c
new file mode 100644
index 000000000..c74538d64
--- /dev/null
+++ b/ext/zip/lib/zip_err_str.c
@@ -0,0 +1,72 @@
+/*
+ This file was generated automatically by ./make_zip_err_str.sh
+ from ./zip.h; make changes there.
+
+ NiH: make_zip_err_str.sh,v 1.8 2004/11/17 21:55:09 wiz Exp
+ NiH: zip.h,v 1.57 2006/04/24 14:04:19 dillo Exp
+ */
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+const char * const _zip_err_str[] = {
+ "No error",
+ "Multi-disk zip archives not supported",
+ "Renaming temporary file failed",
+ "Closing zip archive failed",
+ "Seek error",
+ "Read error",
+ "Write error",
+ "CRC error",
+ "Containing zip archive was closed",
+ "No such file",
+ "File already exists",
+ "Can't open file",
+ "Failure to create temporary file",
+ "Zlib error",
+ "Malloc failure",
+ "Entry has been changed",
+ "Compression method not supported",
+ "Premature EOF",
+ "Invalid argument",
+ "Not a zip archive",
+ "Internal error",
+ "Zip archive inconsistent",
+ "Can't remove file",
+ "Entry has been deleted",
+};
+
+const int _zip_nerr_str = sizeof(_zip_err_str)/sizeof(_zip_err_str[0]);
+
+#define N ZIP_ET_NONE
+#define S ZIP_ET_SYS
+#define Z ZIP_ET_ZLIB
+
+const int _zip_err_type[] = {
+ N,
+ N,
+ S,
+ S,
+ S,
+ S,
+ S,
+ N,
+ N,
+ N,
+ N,
+ S,
+ S,
+ Z,
+ N,
+ N,
+ N,
+ N,
+ N,
+ N,
+ N,
+ N,
+ S,
+ N,
+};
diff --git a/ext/zip/lib/zip_error.c b/ext/zip/lib/zip_error.c
new file mode 100644
index 000000000..33a8f3374
--- /dev/null
+++ b/ext/zip/lib/zip_error.c
@@ -0,0 +1,95 @@
+/*
+ $NiH: zip_error.c,v 1.7 2005/06/09 19:57:09 dillo Exp $
+
+ zip_error.c -- struct zip_error helper functions
+ Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+void
+_zip_error_copy(struct zip_error *dst, struct zip_error *src)
+{
+ dst->zip_err = src->zip_err;
+ dst->sys_err = src->sys_err;
+}
+
+
+
+void
+_zip_error_fini(struct zip_error *err)
+{
+ free(err->str);
+ err->str = NULL;
+}
+
+
+
+void
+_zip_error_get(struct zip_error *err, int *zep, int *sep)
+{
+ if (zep)
+ *zep = err->zip_err;
+ if (sep) {
+ if (zip_error_get_sys_type(err->zip_err) != ZIP_ET_NONE)
+ *sep = err->sys_err;
+ else
+ *sep = 0;
+ }
+}
+
+
+
+void
+_zip_error_init(struct zip_error *err)
+{
+ err->zip_err = 0;
+ err->sys_err = 0;
+ err->str = NULL;
+}
+
+
+
+void
+_zip_error_set(struct zip_error *err, int ze, int se)
+{
+ if (err) {
+ err->zip_err = ze;
+ err->sys_err = se;
+ }
+}
diff --git a/ext/zip/lib/zip_error_get.c b/ext/zip/lib/zip_error_get.c
new file mode 100644
index 000000000..712575a86
--- /dev/null
+++ b/ext/zip/lib/zip_error_get.c
@@ -0,0 +1,47 @@
+/*
+ $NiH: zip_error_get.c,v 1.1 2004/11/18 15:06:20 wiz Exp $
+
+ zip_error_get.c -- get zip error
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+void
+zip_error_get(struct zip *za, int *zep, int *sep)
+{
+ _zip_error_get(&za->error, zep, sep);
+}
diff --git a/ext/zip/lib/zip_error_get_sys_type.c b/ext/zip/lib/zip_error_get_sys_type.c
new file mode 100644
index 000000000..613ec9432
--- /dev/null
+++ b/ext/zip/lib/zip_error_get_sys_type.c
@@ -0,0 +1,50 @@
+/*
+ $NiH: zip_error_get_sys_type.c,v 1.1 2004/12/22 15:49:18 wiz Exp $
+
+ zip_error_get_sys_type.c -- return type of system error code
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_error_get_sys_type(int ze)
+{
+ if (ze < 0 || ze >= _zip_nerr_str)
+ return 0;
+
+ return _zip_err_type[ze];
+}
diff --git a/ext/zip/lib/zip_error_strerror.c b/ext/zip/lib/zip_error_strerror.c
new file mode 100644
index 000000000..f14f7190e
--- /dev/null
+++ b/ext/zip/lib/zip_error_strerror.c
@@ -0,0 +1,93 @@
+/*
+ $NiH: zip_error_strerror.c,v 1.4 2006/02/21 09:41:00 dillo Exp $
+
+ zip_error_sterror.c -- get string representation of struct zip_error
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+const char *
+_zip_error_strerror(struct zip_error *err)
+{
+ const char *zs, *ss;
+ char buf[128], *s;
+
+ _zip_error_fini(err);
+
+ if (err->zip_err < 0 || err->zip_err >= _zip_nerr_str) {
+ sprintf(buf, "Unknown error %d", err->zip_err);
+ zs = NULL;
+ ss = buf;
+ }
+ else {
+ zs = _zip_err_str[err->zip_err];
+
+ switch (_zip_err_type[err->zip_err]) {
+ case ZIP_ET_SYS:
+ ss = strerror(err->sys_err);
+ break;
+
+ case ZIP_ET_ZLIB:
+ ss = zError(err->sys_err);
+ break;
+
+ default:
+ ss = NULL;
+ }
+ }
+
+ if (ss == NULL)
+ return zs;
+ else {
+ if ((s=(char *)malloc(strlen(ss)
+ + (zs ? strlen(zs)+2 : 0) + 1)) == NULL)
+ return _zip_err_str[ZIP_ER_MEMORY];
+
+ sprintf(s, "%s%s%s",
+ (zs ? zs : ""),
+ (zs ? ": " : ""),
+ ss);
+ err->str = s;
+
+ return ss;
+ }
+}
diff --git a/ext/zip/lib/zip_error_to_str.c b/ext/zip/lib/zip_error_to_str.c
new file mode 100644
index 000000000..e56619225
--- /dev/null
+++ b/ext/zip/lib/zip_error_to_str.c
@@ -0,0 +1,73 @@
+/*
+ $NiH: zip_error_to_str.c,v 1.1 2004/11/18 15:06:20 wiz Exp $
+
+ zip_error_to_str.c -- get string representation of zip error code
+ Copyright (C) 1999, 2003, 2004 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_error_to_str(char *buf, size_t len, int ze, int se)
+{
+ const char *zs, *ss;
+
+ if (ze < 0 || ze >= _zip_nerr_str)
+ return snprintf(buf, len, "Unknown error %d", ze);
+
+ zs = _zip_err_str[ze];
+
+ switch (_zip_err_type[ze]) {
+ case ZIP_ET_SYS:
+ ss = strerror(se);
+ break;
+
+ case ZIP_ET_ZLIB:
+ ss = zError(se);
+ break;
+
+ default:
+ ss = NULL;
+ }
+
+ return snprintf(buf, len, "%s%s%s",
+ zs, (ss ? ": " : ""), (ss ? ss : ""));
+}
diff --git a/ext/zip/lib/zip_fclose.c b/ext/zip/lib/zip_fclose.c
new file mode 100644
index 000000000..cf4f35c71
--- /dev/null
+++ b/ext/zip/lib/zip_fclose.c
@@ -0,0 +1,74 @@
+/*
+ $NiH: zip_fclose.c,v 1.14 2005/06/09 19:57:09 dillo Exp $
+
+ zip_fclose.c -- close file in zip archive
+ Copyright (C) 1999, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_fclose(struct zip_file *zf)
+{
+ int i, ret;
+
+ if (zf->zstr)
+ inflateEnd(zf->zstr);
+ free(zf->buffer);
+ free(zf->zstr);
+
+ for (i=0; i<zf->za->nfile; i++) {
+ if (zf->za->file[i] == zf) {
+ zf->za->file[i] = zf->za->file[zf->za->nfile-1];
+ zf->za->nfile--;
+ break;
+ }
+ }
+
+ ret = 0;
+ if (zf->error.zip_err)
+ ret = zf->error.zip_err;
+ else if ((zf->flags & ZIP_ZF_CRC) && (zf->flags & ZIP_ZF_EOF)) {
+ /* if EOF, compare CRC */
+ if (zf->crc_orig != zf->crc)
+ ret = ZIP_ER_CRC;
+ }
+
+ free(zf);
+ return ret;
+}
diff --git a/ext/zip/lib/zip_file_error_get.c b/ext/zip/lib/zip_file_error_get.c
new file mode 100644
index 000000000..2ab3a73a4
--- /dev/null
+++ b/ext/zip/lib/zip_file_error_get.c
@@ -0,0 +1,47 @@
+/*
+ $NiH: zip_file_error_get.c,v 1.1 2004/11/18 15:06:21 wiz Exp $
+
+ zip_file_error_get.c -- get zip file error
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+void
+zip_file_error_get(struct zip_file *zf, int *zep, int *sep)
+{
+ _zip_error_get(&zf->error, zep, sep);
+}
diff --git a/ext/zip/lib/zip_file_get_offset.c b/ext/zip/lib/zip_file_get_offset.c
new file mode 100644
index 000000000..8bcc64934
--- /dev/null
+++ b/ext/zip/lib/zip_file_get_offset.c
@@ -0,0 +1,80 @@
+/*
+ $NiH: zip_file_get_offset.c,v 1.4 2006/04/23 14:51:45 wiz Exp $
+
+ zip_file_get_offset.c -- get offset of file data in archive.
+ Copyright (C) 1999, 2003, 2004 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+/* _zip_file_get_offset(za, ze):
+ Returns the offset of the file data for entry ze.
+
+ On error, fills in za->error and returns 0.
+*/
+
+unsigned int
+_zip_file_get_offset(struct zip *za, int idx)
+{
+ struct zip_dirent de;
+ unsigned int offset;
+
+ offset = za->cdir->entry[idx].offset;
+
+ if (fseek(za->zp, offset, SEEK_SET) != 0) {
+ _zip_error_set(&za->error, ZIP_ER_SEEK, errno);
+ return 0;
+ }
+
+ if (_zip_dirent_read(&de, za->zp, NULL, 0, 1, &za->error) != 0)
+ return 0;
+
+ offset += LENTRYSIZE + de.filename_len + de.extrafield_len;
+
+ _zip_dirent_finalize(&de);
+
+ return offset;
+}
diff --git a/ext/zip/lib/zip_file_strerror.c b/ext/zip/lib/zip_file_strerror.c
new file mode 100644
index 000000000..aaff18999
--- /dev/null
+++ b/ext/zip/lib/zip_file_strerror.c
@@ -0,0 +1,47 @@
+/*
+ $NiH: zip_file_strerror.c,v 1.1 2003/10/05 16:05:22 dillo Exp $
+
+ zip_file_sterror.c -- get string representation of zip file error
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+const char *
+zip_file_strerror(struct zip_file *zf)
+{
+ return _zip_error_strerror(&zf->error);
+}
diff --git a/ext/zip/lib/zip_fopen.c b/ext/zip/lib/zip_fopen.c
new file mode 100644
index 000000000..850a8d835
--- /dev/null
+++ b/ext/zip/lib/zip_fopen.c
@@ -0,0 +1,52 @@
+/*
+ $NiH: zip_fopen.c,v 1.12 2005/06/09 19:57:09 dillo Exp $
+
+ zip_fopen.c -- open file in zip archive for reading
+ Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+struct zip_file *
+zip_fopen(struct zip *za, const char *fname, int flags)
+{
+ int idx;
+
+ if ((idx=zip_name_locate(za, fname, flags)) < 0)
+ return NULL;
+
+ return zip_fopen_index(za, idx, flags);
+}
diff --git a/ext/zip/lib/zip_fopen_index.c b/ext/zip/lib/zip_fopen_index.c
new file mode 100644
index 000000000..5da9230b2
--- /dev/null
+++ b/ext/zip/lib/zip_fopen_index.c
@@ -0,0 +1,219 @@
+/*
+ $NiH: zip_fopen_index.c,v 1.24 2005/05/20 21:54:53 wiz Exp $
+
+ zip_fopen_index.c -- open file in zip archive for reading by index
+ Copyright (C) 1999, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+static struct zip_file *_zip_file_new(struct zip *za);
+
+
+
+struct zip_file *
+zip_fopen_index(struct zip *za, int fileno, int flags)
+{
+ int len, ret;
+ int zfflags;
+ struct zip_file *zf;
+
+ if ((fileno < 0) || (fileno >= za->nentry)) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return NULL;
+ }
+
+ if ((flags & ZIP_FL_UNCHANGED) == 0
+ && ZIP_ENTRY_DATA_CHANGED(za->entry+fileno)) {
+ _zip_error_set(&za->error, ZIP_ER_CHANGED, 0);
+ return NULL;
+ }
+
+ if (fileno >= za->cdir->nentry) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return NULL;
+ }
+
+ zfflags = 0;
+ switch (za->cdir->entry[fileno].comp_method) {
+ case ZIP_CM_STORE:
+ zfflags |= ZIP_ZF_CRC;
+ break;
+
+ case ZIP_CM_DEFLATE:
+ if ((flags & ZIP_FL_COMPRESSED) == 0)
+ zfflags |= ZIP_ZF_CRC | ZIP_ZF_DECOMP;
+ break;
+ default:
+ if ((flags & ZIP_FL_COMPRESSED) == 0) {
+ _zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0);
+ return NULL;
+ }
+ break;
+ }
+
+ zf = _zip_file_new(za);
+
+ zf->flags = zfflags;
+ /* zf->name = za->cdir->entry[fileno].filename; */
+ zf->method = za->cdir->entry[fileno].comp_method;
+ zf->bytes_left = za->cdir->entry[fileno].uncomp_size;
+ zf->cbytes_left = za->cdir->entry[fileno].comp_size;
+ zf->crc_orig = za->cdir->entry[fileno].crc;
+
+ if ((zf->fpos=_zip_file_get_offset(za, fileno)) == 0) {
+ zip_fclose(zf);
+ return NULL;
+ }
+
+ if ((zf->flags & ZIP_ZF_DECOMP) == 0)
+ zf->bytes_left = zf->cbytes_left;
+ else {
+ if ((zf->buffer=(char *)malloc(BUFSIZE)) == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+ zip_fclose(zf);
+ return NULL;
+ }
+
+ len = _zip_file_fillbuf(zf->buffer, BUFSIZE, zf);
+ if (len <= 0) {
+ _zip_error_copy(&za->error, &zf->error);
+ zip_fclose(zf);
+ return NULL;
+ }
+
+ if ((zf->zstr = (z_stream *)malloc(sizeof(z_stream))) == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+ zip_fclose(zf);
+ return NULL;
+ }
+ zf->zstr->zalloc = Z_NULL;
+ zf->zstr->zfree = Z_NULL;
+ zf->zstr->opaque = NULL;
+ zf->zstr->next_in = (Bytef *)zf->buffer;
+ zf->zstr->avail_in = len;
+
+ /* negative value to tell zlib that there is no header */
+ if ((ret=inflateInit2(zf->zstr, -MAX_WBITS)) != Z_OK) {
+ _zip_error_set(&za->error, ZIP_ER_ZLIB, ret);
+ zip_fclose(zf);
+ return NULL;
+ }
+ }
+
+ return zf;
+}
+
+
+
+int
+_zip_file_fillbuf(void *buf, size_t buflen, struct zip_file *zf)
+{
+ int i, j;
+
+ if (zf->error.zip_err != ZIP_ER_OK)
+ return -1;
+
+ if ((zf->flags & ZIP_ZF_EOF) || zf->cbytes_left <= 0 || buflen <= 0)
+ return 0;
+
+ if (fseek(zf->za->zp, zf->fpos, SEEK_SET) < 0) {
+ _zip_error_set(&zf->error, ZIP_ER_SEEK, errno);
+ return -1;
+ }
+ if (buflen < zf->cbytes_left)
+ i = buflen;
+ else
+ i = zf->cbytes_left;
+
+ j = fread(buf, 1, i, zf->za->zp);
+ if (j == 0) {
+ _zip_error_set(&zf->error, ZIP_ER_EOF, 0);
+ j = -1;
+ }
+ else if (j < 0)
+ _zip_error_set(&zf->error, ZIP_ER_READ, errno);
+ else {
+ zf->fpos += j;
+ zf->cbytes_left -= j;
+ }
+
+ return j;
+}
+
+
+
+static struct zip_file *
+_zip_file_new(struct zip *za)
+{
+ struct zip_file *zf, **file;
+ int n;
+
+ if ((zf=(struct zip_file *)malloc(sizeof(struct zip_file))) == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+
+ if (za->nfile >= za->nfile_alloc-1) {
+ n = za->nfile_alloc + 10;
+ file = (struct zip_file **)realloc(za->file,
+ n*sizeof(struct zip_file *));
+ if (file == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+ free(zf);
+ return NULL;
+ }
+ za->nfile_alloc = n;
+ za->file = file;
+ }
+
+ za->file[za->nfile++] = zf;
+
+ zf->za = za;
+ _zip_error_init(&zf->error);
+ zf->flags = 0;
+ zf->crc = crc32(0L, Z_NULL, 0);
+ zf->crc_orig = 0;
+ zf->method = -1;
+ zf->bytes_left = zf->cbytes_left = 0;
+ zf->fpos = 0;
+ zf->buffer = NULL;
+ zf->zstr = NULL;
+
+ return zf;
+}
diff --git a/ext/zip/lib/zip_fread.c b/ext/zip/lib/zip_fread.c
new file mode 100644
index 000000000..aeb64c90f
--- /dev/null
+++ b/ext/zip/lib/zip_fread.c
@@ -0,0 +1,125 @@
+/*
+ $NiH: zip_fread.c,v 1.21 2006/04/23 14:49:50 wiz Exp $
+
+ zip_fread.c -- read from file
+ Copyright (C) 1999, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+ssize_t
+zip_fread(struct zip_file *zf, void *outbuf, size_t toread)
+{
+ int ret;
+ size_t out_before, len;
+ int i;
+
+ if (!zf)
+ return -1;
+
+ if (zf->error.zip_err != 0)
+ return -1;
+
+ if ((zf->flags & ZIP_ZF_EOF) || (toread == 0))
+ return 0;
+
+ if (zf->bytes_left == 0) {
+ zf->flags |= ZIP_ZF_EOF;
+ if (zf->flags & ZIP_ZF_CRC) {
+ if (zf->crc != zf->crc_orig) {
+ _zip_error_set(&zf->error, ZIP_ER_CRC, 0);
+ return -1;
+ }
+ }
+ return 0;
+ }
+
+ if ((zf->flags & ZIP_ZF_DECOMP) == 0) {
+ ret = _zip_file_fillbuf(outbuf, toread, zf);
+ if (ret > 0) {
+ if (zf->flags & ZIP_ZF_CRC)
+ zf->crc = crc32(zf->crc, (Bytef *)outbuf, ret);
+ zf->bytes_left -= ret;
+ }
+ return ret;
+ }
+
+ zf->zstr->next_out = (Bytef *)outbuf;
+ zf->zstr->avail_out = toread;
+ out_before = zf->zstr->total_out;
+
+ /* endless loop until something has been accomplished */
+ for (;;) {
+ ret = inflate(zf->zstr, Z_SYNC_FLUSH);
+
+ switch (ret) {
+ case Z_OK:
+ case Z_STREAM_END:
+ /* all ok */
+ /* Z_STREAM_END probably won't happen, since we didn't
+ have a header */
+ len = zf->zstr->total_out - out_before;
+ if (len >= zf->bytes_left || len >= toread) {
+ if (zf->flags & ZIP_ZF_CRC)
+ zf->crc = crc32(zf->crc, (Bytef *)outbuf, len);
+ zf->bytes_left -= len;
+ return len;
+ }
+ break;
+
+ case Z_BUF_ERROR:
+ if (zf->zstr->avail_in == 0) {
+ i = _zip_file_fillbuf(zf->buffer, BUFSIZE, zf);
+ if (i == 0) {
+ _zip_error_set(&zf->error, ZIP_ER_INCONS, 0);
+ return -1;
+ }
+ else if (i < 0)
+ return -1;
+ zf->zstr->next_in = (Bytef *)zf->buffer;
+ zf->zstr->avail_in = i;
+ continue;
+ }
+ /* fallthrough */
+ case Z_NEED_DICT:
+ case Z_DATA_ERROR:
+ case Z_STREAM_ERROR:
+ case Z_MEM_ERROR:
+ _zip_error_set(&zf->error, ZIP_ER_ZLIB, ret);
+ return -1;
+ }
+ }
+}
diff --git a/ext/zip/lib/zip_free.c b/ext/zip/lib/zip_free.c
new file mode 100644
index 000000000..cbead2a6b
--- /dev/null
+++ b/ext/zip/lib/zip_free.c
@@ -0,0 +1,83 @@
+/*
+ $NiH: zip_free.c,v 1.17 2005/06/09 19:57:10 dillo Exp $
+
+ zip_free.c -- free struct zip
+ Copyright (C) 1999, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+#include "zip.h"
+#include "zipint.h"
+
+
+
+/* _zip_free:
+ frees the space allocated to a zipfile struct, and closes the
+ corresponding file. */
+
+void
+_zip_free(struct zip *za)
+{
+ int i;
+
+ if (za == NULL)
+ return;
+
+ if (za->zn)
+ free(za->zn);
+
+ if (za->zp)
+ fclose(za->zp);
+
+ _zip_cdir_free(za->cdir);
+
+ if (za->entry) {
+ for (i=0; i<za->nentry; i++) {
+ _zip_entry_free(za->entry+i);
+ }
+ free(za->entry);
+ }
+
+ for (i=0; i<za->nfile; i++) {
+ if (za->file[i]->error.zip_err == ZIP_ER_OK) {
+ _zip_error_set(&za->file[i]->error, ZIP_ER_ZIPCLOSED, 0);
+ za->file[i]->za = NULL;
+ }
+ }
+
+ free(za->file);
+
+ free(za);
+
+ return;
+}
diff --git a/ext/zip/lib/zip_get_archive_comment.c b/ext/zip/lib/zip_get_archive_comment.c
new file mode 100644
index 000000000..40feb4eba
--- /dev/null
+++ b/ext/zip/lib/zip_get_archive_comment.c
@@ -0,0 +1,58 @@
+/*
+ $NiH: zip_get_archive_comment.c,v 1.4 2006/04/23 16:11:33 wiz Exp $
+
+ zip_get_archive_comment.c -- get archive comment
+ Copyright (C) 2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+const char *
+zip_get_archive_comment(struct zip *za, int *lenp, int flags)
+{
+ if ((flags & ZIP_FL_UNCHANGED)
+ || (za->ch_comment_len == -1)) {
+ if (za->cdir) {
+ if (lenp != NULL)
+ *lenp = za->cdir->comment_len;
+ return za->cdir->comment;
+ }
+ }
+
+ if (lenp != NULL)
+ *lenp = za->ch_comment_len;
+ return za->ch_comment;
+}
diff --git a/ext/zip/lib/zip_get_file_comment.c b/ext/zip/lib/zip_get_file_comment.c
new file mode 100644
index 000000000..79a5c236b
--- /dev/null
+++ b/ext/zip/lib/zip_get_file_comment.c
@@ -0,0 +1,61 @@
+/*
+ $NiH: zip_get_file_comment.c,v 1.2 2006/04/23 13:06:28 wiz Exp $
+
+ zip_get_file_comment.c -- get file comment
+ Copyright (C) 2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+const char *
+zip_get_file_comment(struct zip *za, int idx, int *lenp, int flags)
+{
+ if (idx < 0 || idx >= za->nentry) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return NULL;
+ }
+
+ if ((flags & ZIP_FL_UNCHANGED)
+ || (za->entry[idx].ch_comment_len == -1)) {
+ if (lenp != NULL)
+ *lenp = za->cdir->entry[idx].comment_len;
+ return za->cdir->entry[idx].comment;
+ }
+
+ if (lenp != NULL)
+ *lenp = za->entry[idx].ch_comment_len;
+ return za->entry[idx].ch_comment;
+}
diff --git a/ext/zip/lib/zip_get_name.c b/ext/zip/lib/zip_get_name.c
new file mode 100644
index 000000000..c45dd0333
--- /dev/null
+++ b/ext/zip/lib/zip_get_name.c
@@ -0,0 +1,74 @@
+/*
+ $NiH: zip_get_name.c,v 1.13 2005/01/20 21:00:54 dillo Exp $
+
+ zip_get_name.c -- get filename for a file in zip file
+ Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+const char *
+zip_get_name(struct zip *za, int idx, int flags)
+{
+ return _zip_get_name(za, idx, flags, &za->error);
+}
+
+
+
+const char *
+_zip_get_name(struct zip *za, int idx, int flags, struct zip_error *error)
+{
+ if (idx < 0 || idx >= za->nentry) {
+ _zip_error_set(error, ZIP_ER_INVAL, 0);
+ return NULL;
+ }
+
+ if ((flags & ZIP_FL_UNCHANGED) == 0) {
+ if (za->entry[idx].state == ZIP_ST_DELETED) {
+ _zip_error_set(error, ZIP_ER_DELETED, 0);
+ return NULL;
+ }
+ if (za->entry[idx].ch_filename)
+ return za->entry[idx].ch_filename;
+ }
+
+ if (za->cdir == NULL || idx >= za->cdir->nentry) {
+ _zip_error_set(error, ZIP_ER_INVAL, 0);
+ return NULL;
+ }
+
+ return za->cdir->entry[idx].filename;
+}
diff --git a/ext/zip/lib/zip_get_num_files.c b/ext/zip/lib/zip_get_num_files.c
new file mode 100644
index 000000000..0cc81edb0
--- /dev/null
+++ b/ext/zip/lib/zip_get_num_files.c
@@ -0,0 +1,50 @@
+/*
+ $NiH: zip_get_num_files.c,v 1.2 2003/12/27 22:53:15 wiz Exp $
+
+ zip_get_num_files.c -- get number of files in archive
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_get_num_files(struct zip *za)
+{
+ if (za == NULL)
+ return -1;
+
+ return za->nentry;
+}
diff --git a/ext/zip/lib/zip_memdup.c b/ext/zip/lib/zip_memdup.c
new file mode 100644
index 000000000..c4ecf4a69
--- /dev/null
+++ b/ext/zip/lib/zip_memdup.c
@@ -0,0 +1,58 @@
+/*
+ $NiH: zip_memdup.c,v 1.2 2006/04/24 10:34:39 dillo Exp $
+
+ zip_memdup.c -- internal zip function, "strdup" with len
+ Copyright (C) 1999, 2003, 2004, 2005, 2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+#include <string.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+void *
+_zip_memdup(const void *mem, size_t len, struct zip_error *error)
+{
+ void *ret;
+
+ ret = malloc(len);
+ if (!ret) {
+ _zip_error_set(error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+
+ memcpy(ret, mem, len);
+
+ return ret;
+}
diff --git a/ext/zip/lib/zip_name_locate.c b/ext/zip/lib/zip_name_locate.c
new file mode 100644
index 000000000..a2fce2d03
--- /dev/null
+++ b/ext/zip/lib/zip_name_locate.c
@@ -0,0 +1,91 @@
+/*
+ $NiH: zip_name_locate.c,v 1.19 2005/06/09 19:57:10 dillo Exp $
+
+ zip_name_locate.c -- get index by name
+ Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <string.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_name_locate(struct zip *za, const char *fname, int flags)
+{
+ return _zip_name_locate(za, fname, flags, &za->error);
+}
+
+
+
+int
+_zip_name_locate(struct zip *za, const char *fname, int flags,
+ struct zip_error *error)
+{
+ int (*cmp)(const char *, const char *);
+ const char *fn, *p;
+ int i, n;
+
+ if (fname == NULL) {
+ _zip_error_set(error, ZIP_ER_INVAL, 0);
+ return -1;
+ }
+
+ cmp = (flags & ZIP_FL_NOCASE) ? strcasecmp : strcmp;
+
+ n = (flags & ZIP_FL_UNCHANGED) ? za->cdir->nentry : za->nentry;
+ for (i=0; i<n; i++) {
+ if (flags & ZIP_FL_UNCHANGED)
+ fn = za->cdir->entry[i].filename;
+ else
+ fn = _zip_get_name(za, i, flags, error);
+
+ /* newly added (partially filled) entry */
+ if (fn == NULL)
+ continue;
+
+ if (flags & ZIP_FL_NODIR) {
+ p = strrchr(fn, '/');
+ if (p)
+ fn = p+1;
+ }
+
+ if (cmp(fname, fn) == 0)
+ return i;
+ }
+
+ _zip_error_set(error, ZIP_ER_NOENT, 0);
+ return -1;
+}
diff --git a/ext/zip/lib/zip_new.c b/ext/zip/lib/zip_new.c
new file mode 100644
index 000000000..660183a15
--- /dev/null
+++ b/ext/zip/lib/zip_new.c
@@ -0,0 +1,71 @@
+/*
+ $NiH: zip_new.c,v 1.12 2006/04/23 00:40:47 wiz Exp $
+
+ zip_new.c -- create and init struct zip
+ Copyright (C) 1999, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+#include "zip.h"
+#include "zipint.h"
+
+
+
+/* _zip_new:
+ creates a new zipfile struct, and sets the contents to zero; returns
+ the new struct. */
+
+struct zip *
+_zip_new(struct zip_error *error)
+{
+ struct zip *za;
+
+ za = (struct zip *)malloc(sizeof(struct zip));
+ if (!za) {
+ _zip_error_set(error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+
+ za->zn = NULL;
+ za->zp = NULL;
+ _zip_error_init(&za->error);
+ za->cdir = NULL;
+ za->ch_comment = NULL;
+ za->ch_comment_len = -1;
+ za->nentry = za->nentry_alloc = 0;
+ za->entry = NULL;
+ za->nfile = za->nfile_alloc = 0;
+ za->file = NULL;
+
+ return za;
+}
diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c
new file mode 100644
index 000000000..0a14abda5
--- /dev/null
+++ b/ext/zip/lib/zip_open.c
@@ -0,0 +1,465 @@
+/*
+ $NiH: zip_open.c,v 1.38 2006/05/04 00:01:26 dillo Exp $
+
+ zip_open.c -- open zip archive
+ Copyright (C) 1999-2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <sys/stat.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#include "zip.h"
+#include "zipint.h"
+
+static void set_error(int *, struct zip_error *, int);
+static int _zip_checkcons(FILE *, struct zip_cdir *, struct zip_error *);
+static int _zip_headercomp(struct zip_dirent *, int,
+ struct zip_dirent *, int);
+static unsigned char *_zip_memmem(const unsigned char *, int,
+ const unsigned char *, int);
+static struct zip_cdir *_zip_readcdir(FILE *, unsigned char *, unsigned char *,
+ int, int, struct zip_error *);
+
+
+
+struct zip *
+zip_open(const char *fn, int flags, int *zep)
+{
+ FILE *fp;
+ unsigned char *buf, *match;
+ int a, i, buflen, best;
+ struct zip *za;
+ struct zip_cdir *cdir, *cdirnew;
+ long len;
+ struct stat st;
+ struct zip_error error, err2;
+
+ if (fn == NULL) {
+ set_error(zep, NULL, ZIP_ER_INVAL);
+ return NULL;
+ }
+
+ if (flags & ZIP_OVERWRITE || stat(fn, &st) != 0) {
+ if ((flags & ZIP_CREATE) || (flags & ZIP_OVERWRITE)) {
+ if ((za=_zip_new(&error)) == NULL) {
+ set_error(zep, &error, 0);
+ return NULL;
+ }
+
+ za->zn = strdup(fn);
+ if (!za->zn) {
+ _zip_free(za);
+ set_error(zep, NULL, ZIP_ER_MEMORY);
+ return NULL;
+ }
+ return za;
+ }
+ else {
+ set_error(zep, NULL, ZIP_ER_OPEN);
+ return NULL;
+ }
+ }
+ else if ((flags & ZIP_EXCL)) {
+ set_error(zep, NULL, ZIP_ER_EXISTS);
+ return NULL;
+ }
+
+
+ /* ZIP_CREATE gets ignored if file exists and not ZIP_EXCL,
+ just like open() */
+ if ((fp=fopen(fn, "rb")) == NULL) {
+ set_error(zep, NULL, ZIP_ER_OPEN);
+ return NULL;
+ }
+
+ clearerr(fp);
+ fseek(fp, 0, SEEK_END);
+ len = ftell(fp);
+ i = fseek(fp, -(len < CDBUFSIZE ? len : CDBUFSIZE), SEEK_END);
+ if (i == -1 && errno != EFBIG) {
+ /* seek before start of file on my machine */
+ set_error(zep, NULL, ZIP_ER_SEEK);
+ fclose(fp);
+ return NULL;
+ }
+
+ /* 64k is too much for stack */
+ if ((buf=(unsigned char *)malloc(CDBUFSIZE)) == NULL) {
+ set_error(zep, NULL, ZIP_ER_MEMORY);
+ fclose(fp);
+ return NULL;
+ }
+
+ clearerr(fp);
+ buflen = fread(buf, 1, CDBUFSIZE, fp);
+
+ if (ferror(fp)) {
+ set_error(zep, NULL, ZIP_ER_READ);
+ free(buf);
+ fclose(fp);
+ return NULL;
+ }
+
+ best = -2;
+ cdir = NULL;
+ match = buf;
+ while ((match=_zip_memmem(match, buflen-(match-buf)-18,
+ (const unsigned char *)EOCD_MAGIC, 4))!=NULL) {
+ /* found match -- check, if good */
+ /* to avoid finding the same match all over again */
+ match++;
+ if ((cdirnew=_zip_readcdir(fp, buf, match-1, buflen, flags,
+ &err2)) == NULL) {
+ if (best == -2) {
+ set_error(zep, &err2, 0);
+ best = -1;
+ }
+ continue;
+ }
+
+ if (cdir) {
+ if (best <= 0)
+ best = _zip_checkcons(fp, cdir, &err2);
+ a = _zip_checkcons(fp, cdirnew, &err2);
+ if (best < a) {
+ _zip_cdir_free(cdir);
+ cdir = cdirnew;
+ best = a;
+ }
+ else
+ _zip_cdir_free(cdirnew);
+ }
+ else {
+ cdir = cdirnew;
+ if (flags & ZIP_CHECKCONS)
+ best = _zip_checkcons(fp, cdir, &err2);
+ else
+ best = 0;
+ }
+ cdirnew = NULL;
+ }
+
+ free(buf);
+
+ if (best < 0) {
+ /* no consistent eocd found */
+ if (best == -2) {
+ /* no eocd found at all */
+ set_error(zep, NULL, ZIP_ER_NOZIP);
+ }
+ _zip_cdir_free(cdir);
+ fclose(fp);
+ return NULL;
+ }
+
+ if ((za=_zip_new(&error)) == NULL) {
+ set_error(zep, &error, 0);
+ _zip_cdir_free(cdir);
+ fclose(fp);
+ return NULL;
+ }
+
+ za->zp = fp;
+ za->cdir = cdir;
+
+ if ((za->zn=strdup(fn)) == NULL) {
+ set_error(zep, NULL, ZIP_ER_MEMORY);
+ _zip_free(za);
+ return NULL;
+ }
+
+ if ((za->entry=(struct zip_entry *)malloc(sizeof(*(za->entry))
+ * cdir->nentry)) == NULL) {
+ set_error(zep, NULL, ZIP_ER_MEMORY);
+ _zip_free(za);
+ return NULL;
+ }
+ for (i=0; i<cdir->nentry; i++)
+ _zip_entry_new(za);
+
+ return za;
+}
+
+
+
+static void
+set_error(int *zep, struct zip_error *err, int ze)
+{
+ int se;
+
+ if (err) {
+ _zip_error_get(err, &ze, &se);
+ if (zip_error_get_sys_type(ze) == ZIP_ET_SYS)
+ errno = se;
+ }
+
+ if (zep)
+ *zep = ze;
+}
+
+
+
+/* _zip_readcdir:
+ tries to find a valid end-of-central-directory at the beginning of
+ buf, and then the corresponding central directory entries.
+ Returns a struct zip_cdir which contains the central directory
+ entries, or NULL if unsuccessful. */
+
+static struct zip_cdir *
+_zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen,
+ int flags, struct zip_error *error)
+{
+ struct zip_cdir *cd;
+ unsigned char *cdp, **bufp;
+ int i, comlen, nentry;
+
+ comlen = buf + buflen - eocd - EOCDLEN;
+ if (comlen < 0) {
+ /* not enough bytes left for comment */
+ _zip_error_set(error, ZIP_ER_NOZIP, 0);
+ return NULL;
+ }
+
+ /* check for end-of-central-dir magic */
+ if (memcmp(eocd, EOCD_MAGIC, 4) != 0) {
+ _zip_error_set(error, ZIP_ER_NOZIP, 0);
+ return NULL;
+ }
+
+ if (memcmp(eocd+4, "\0\0\0\0", 4) != 0) {
+ _zip_error_set(error, ZIP_ER_MULTIDISK, 0);
+ return NULL;
+ }
+
+ cdp = eocd + 8;
+ /* number of cdir-entries on this disk */
+ i = _zip_read2(&cdp);
+ /* number of cdir-entries */
+ nentry = _zip_read2(&cdp);
+
+ if ((cd=_zip_cdir_new(nentry, error)) == NULL)
+ return NULL;
+
+ cd->size = _zip_read4(&cdp);
+ cd->offset = _zip_read4(&cdp);
+ cd->comment = NULL;
+ cd->comment_len = _zip_read2(&cdp);
+
+ if ((comlen < cd->comment_len) || (cd->nentry != i)) {
+ _zip_error_set(error, ZIP_ER_NOZIP, 0);
+ free(cd);
+ return NULL;
+ }
+ if ((flags & ZIP_CHECKCONS) && comlen != cd->comment_len) {
+ _zip_error_set(error, ZIP_ER_INCONS, 0);
+ free(cd);
+ return NULL;
+ }
+
+ if (cd->comment_len)
+ if ((cd->comment=(char *)_zip_memdup(eocd+EOCDLEN,
+ cd->comment_len, error))
+ == NULL) {
+ free(cd);
+ return NULL;
+ }
+
+ cdp = eocd;
+ if (cd->size < (unsigned int)(eocd-buf)) {
+ /* if buffer already read in, use it */
+ cdp = eocd - cd->size;
+ bufp = &cdp;
+ }
+ else {
+ /* go to start of cdir and read it entry by entry */
+ bufp = NULL;
+ clearerr(fp);
+ fseek(fp, -(cd->size+cd->comment_len+EOCDLEN), SEEK_END);
+ if (ferror(fp) || ((unsigned int)ftell(fp) != cd->offset)) {
+ /* seek error or offset of cdir wrong */
+ if (ferror(fp))
+ _zip_error_set(error, ZIP_ER_SEEK, errno);
+ else
+ _zip_error_set(error, ZIP_ER_NOZIP, 0);
+ free(cd);
+ return NULL;
+ }
+ }
+
+ for (i=0; i<cd->nentry; i++) {
+ if ((_zip_dirent_read(cd->entry+i, fp, bufp, eocd-cdp, 0,
+ error)) < 0) {
+ cd->nentry = i;
+ _zip_cdir_free(cd);
+ return NULL;
+ }
+ }
+
+ return cd;
+}
+
+
+
+/* _zip_checkcons:
+ Checks the consistency of the central directory by comparing central
+ directory entries with local headers and checking for plausible
+ file and header offsets. Returns -1 if not plausible, else the
+ difference between the lowest and the highest fileposition reached */
+
+static int
+_zip_checkcons(FILE *fp, struct zip_cdir *cd, struct zip_error *error)
+{
+ int i;
+ unsigned int min, max, j;
+ struct zip_dirent temp;
+
+ if (cd->nentry) {
+ max = cd->entry[0].offset;
+ min = cd->entry[0].offset;
+ }
+ else
+ min = max = 0;
+
+ for (i=0; i<cd->nentry; i++) {
+ if (cd->entry[i].offset < min)
+ min = cd->entry[i].offset;
+ if (min > cd->offset) {
+ _zip_error_set(error, ZIP_ER_NOZIP, 0);
+ return -1;
+ }
+
+ j = cd->entry[i].offset + cd->entry[i].comp_size
+ + cd->entry[i].filename_len + LENTRYSIZE;
+ if (j > max)
+ max = j;
+ if (max > cd->offset) {
+ _zip_error_set(error, ZIP_ER_NOZIP, 0);
+ return -1;
+ }
+
+ if (fseek(fp, cd->entry[i].offset, SEEK_SET) != 0) {
+ _zip_error_set(error, ZIP_ER_SEEK, 0);
+ return -1;
+ }
+
+ if (_zip_dirent_read(&temp, fp, NULL, 0, 1, error) == -1)
+ return -1;
+
+ if (_zip_headercomp(cd->entry+i, 0, &temp, 1) != 0) {
+ _zip_error_set(error, ZIP_ER_NOZIP, 0);
+ _zip_dirent_finalize(&temp);
+ return -1;
+ }
+ _zip_dirent_finalize(&temp);
+ }
+
+ return max - min;
+}
+
+
+
+/* _zip_headercomp:
+ compares two headers h1 and h2; if they are local headers, set
+ local1p or local2p respectively to 1, else 0. Return 0 if they
+ are identical, -1 if not. */
+
+static int
+_zip_headercomp(struct zip_dirent *h1, int local1p, struct zip_dirent *h2,
+ int local2p)
+{
+ if ((h1->version_needed != h2->version_needed)
+#if 0
+ /* some zip-files have different values in local
+ and global headers for the bitflags */
+ || (h1->bitflags != h2->bitflags)
+#endif
+ || (h1->comp_method != h2->comp_method)
+ || (h1->last_mod != h2->last_mod)
+ || (h1->crc != h2->crc)
+ || (h1->comp_size != h2->comp_size)
+ || (h1->uncomp_size != h2->uncomp_size)
+ || (h1->filename_len != h2->filename_len)
+ || !h1->filename || !h2->filename
+ || strcmp(h1->filename, h2->filename))
+ return -1;
+
+ if ((local1p == local2p)
+ && ((h1->extrafield_len != h2->extrafield_len)
+ || (h1->extrafield_len && h2->extrafield
+ && memcmp(h1->extrafield, h2->extrafield,
+ h1->extrafield_len))))
+ return -1;
+
+ /* if either is local, nothing more to check */
+ if (local1p || local2p)
+ return 0;
+
+ if ((h1->version_madeby != h2->version_madeby)
+ || (h1->disk_number != h2->disk_number)
+ || (h1->int_attrib != h2->int_attrib)
+ || (h1->ext_attrib != h2->ext_attrib)
+ || (h1->offset != h2->offset)
+ || (h1->comment_len != h2->comment_len)
+ || (h1->comment_len && h2->comment
+ && memcmp(h1->comment, h2->comment, h1->comment_len)))
+ return -1;
+
+ return 0;
+}
+
+
+
+static unsigned char *
+_zip_memmem(const unsigned char *big, int biglen, const unsigned char *little,
+ int littlelen)
+{
+ const unsigned char *p;
+
+ if ((biglen < littlelen) || (littlelen == 0))
+ return NULL;
+ p = big-1;
+ while ((p=(const unsigned char *)
+ memchr(p+1, little[0], (size_t)(big-(p+1)+biglen-littlelen+1)))
+ != NULL) {
+ if (memcmp(p+1, little+1, littlelen-1)==0)
+ return (unsigned char *)p;
+ }
+
+ return NULL;
+}
diff --git a/ext/zip/lib/zip_rename.c b/ext/zip/lib/zip_rename.c
new file mode 100644
index 000000000..f35291893
--- /dev/null
+++ b/ext/zip/lib/zip_rename.c
@@ -0,0 +1,52 @@
+/*
+ $NiH: zip_rename.c,v 1.15 2004/11/30 22:19:38 wiz Exp $
+
+ zip_rename.c -- rename file in zip archive
+ Copyright (C) 1999, 2003, 2004 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_rename(struct zip *za, int idx, const char *name)
+{
+ if (idx >= za->nentry || idx < 0) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return -1;
+ }
+
+ return _zip_set_name(za, idx, name);
+}
diff --git a/ext/zip/lib/zip_replace.c b/ext/zip/lib/zip_replace.c
new file mode 100644
index 000000000..ae78e62b8
--- /dev/null
+++ b/ext/zip/lib/zip_replace.c
@@ -0,0 +1,82 @@
+/*
+ $NiH: zip_replace.c,v 1.20 2006/04/09 14:52:02 wiz Exp $
+
+ zip_replace.c -- replace file via callback function
+ Copyright (C) 1999, 2003, 2004, 2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_replace(struct zip *za, int idx, struct zip_source *source)
+{
+ if (idx < 0 || idx >= za->nentry || source == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return -1;
+ }
+
+ if (_zip_replace(za, idx, NULL, source) == -1)
+ return -1;
+
+ return 0;
+}
+
+
+
+
+int
+_zip_replace(struct zip *za, int idx, const char *name,
+ struct zip_source *source)
+{
+ if (idx == -1) {
+ if (_zip_entry_new(za) == NULL)
+ return -1;
+ idx = za->nentry - 1;
+ }
+
+
+ _zip_unchange_data(za->entry+idx);
+
+ if (name && _zip_set_name(za, idx, name) != 0)
+ return -1;
+
+
+ za->entry[idx].state = ((za->cdir == NULL || idx >= za->cdir->nentry)
+ ? ZIP_ST_ADDED : ZIP_ST_REPLACED);
+ za->entry[idx].source = source;
+
+ return idx;
+}
diff --git a/ext/zip/lib/zip_set_archive_comment.c b/ext/zip/lib/zip_set_archive_comment.c
new file mode 100644
index 000000000..51a8416da
--- /dev/null
+++ b/ext/zip/lib/zip_set_archive_comment.c
@@ -0,0 +1,68 @@
+/*
+ $NiH: zip_set_archive_comment.c,v 1.3 2006/04/24 10:34:39 dillo Exp $
+
+ zip_set_archive_comment.c -- set archive comment
+ Copyright (C) 2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_set_archive_comment(struct zip *za, const char *comment, int len)
+{
+ char *tmpcom;
+
+ if (len < 0 || len > MAXCOMLEN
+ || (len > 0 && comment == NULL)) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return -1;
+ }
+
+ if (len > 0) {
+ if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL)
+ return -1;
+ }
+ else
+ tmpcom = NULL;
+
+ free(za->ch_comment);
+ za->ch_comment = tmpcom;
+ za->ch_comment_len = len;
+
+ return 0;
+}
diff --git a/ext/zip/lib/zip_set_file_comment.c b/ext/zip/lib/zip_set_file_comment.c
new file mode 100644
index 000000000..cbf71db5c
--- /dev/null
+++ b/ext/zip/lib/zip_set_file_comment.c
@@ -0,0 +1,69 @@
+/*
+ $NiH: zip_set_file_comment.c,v 1.4 2006/04/24 10:34:39 dillo Exp $
+
+ zip_set_file_comment.c -- set comment for file in archive
+ Copyright (C) 2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_set_file_comment(struct zip *za, int idx, const char *comment, int len)
+{
+ char *tmpcom;
+
+ if (idx < 0 || idx >= za->nentry
+ || len < 0 || len > MAXCOMLEN
+ || (len > 0 && comment == NULL)) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return -1;
+ }
+
+ if (len > 0) {
+ if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL)
+ return -1;
+ }
+ else
+ tmpcom = NULL;
+
+ free(za->entry[idx].ch_comment);
+ za->entry[idx].ch_comment = tmpcom;
+ za->entry[idx].ch_comment_len = len;
+
+ return 0;
+}
diff --git a/ext/zip/lib/zip_set_name.c b/ext/zip/lib/zip_set_name.c
new file mode 100644
index 000000000..46dca5646
--- /dev/null
+++ b/ext/zip/lib/zip_set_name.c
@@ -0,0 +1,77 @@
+/*
+ $NiH: zip_set_name.c,v 1.16 2004/11/30 23:02:47 wiz Exp $
+
+ zip_set_name.c -- rename helper function
+ Copyright (C) 1999, 2003, 2004 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+#include <string.h>
+#include "zip.h"
+#include "zipint.h"
+
+
+
+int
+_zip_set_name(struct zip *za, int idx, const char *name)
+{
+ char *s;
+ int i;
+
+ if (idx < 0 || idx >= za->nentry || name == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return -1;
+ }
+
+ if ((i=_zip_name_locate(za, name, 0, NULL)) != -1 && i != idx) {
+ _zip_error_set(&za->error, ZIP_ER_EXISTS, 0);
+ return -1;
+ }
+
+ /* no effective name change */
+ if (i == idx)
+ return 0;
+
+ if ((s=strdup(name)) == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+ return -1;
+ }
+
+ if (za->entry[idx].state == ZIP_ST_UNCHANGED)
+ za->entry[idx].state = ZIP_ST_RENAMED;
+
+ free(za->entry[idx].ch_filename);
+ za->entry[idx].ch_filename = s;
+
+ return 0;
+}
diff --git a/ext/zip/lib/zip_source_buffer.c b/ext/zip/lib/zip_source_buffer.c
new file mode 100644
index 000000000..ada9ae85f
--- /dev/null
+++ b/ext/zip/lib/zip_source_buffer.c
@@ -0,0 +1,162 @@
+/*
+ $NiH: zip_source_buffer.c,v 1.8 2006/04/23 14:50:49 wiz Exp $
+
+ zip_source_buffer.c -- create zip data source from buffer
+ Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+#include <string.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+struct read_data {
+ const char *buf, *data, *end;
+ time_t mtime;
+ int freep;
+};
+
+static ssize_t read_data(void *state, void *data, size_t len,
+ enum zip_source_cmd cmd);
+
+
+
+struct zip_source *
+zip_source_buffer(struct zip *za, const void *data, off_t len, int freep)
+{
+ struct read_data *f;
+ struct zip_source *zs;
+
+ if (za == NULL)
+ return NULL;
+
+ if (len < 0 || (data == NULL && len > 0)) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return NULL;
+ }
+
+ if ((f=(struct read_data *)malloc(sizeof(*f))) == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+
+ f->data = (const char *)data;
+ f->end = ((const char *)data)+len;
+ f->freep = freep;
+ f->mtime = time(NULL);
+
+ if ((zs=zip_source_function(za, read_data, f)) == NULL) {
+ free(f);
+ return NULL;
+ }
+
+ return zs;
+}
+
+static ssize_t
+read_data(void *state, void *data, size_t len, enum zip_source_cmd cmd)
+{
+ struct read_data *z;
+ char *buf;
+ size_t n;
+
+ z = (struct read_data *)state;
+ buf = (char *)data;
+
+ switch (cmd) {
+ case ZIP_SOURCE_OPEN:
+ z->buf = z->data;
+ return 0;
+
+ case ZIP_SOURCE_READ:
+ n = z->end - z->buf;
+ if (n > len)
+ n = len;
+ if (n < 0)
+ n = 0;
+
+ if (n) {
+ memcpy(buf, z->buf, n);
+ z->buf += n;
+ }
+
+ return n;
+
+ case ZIP_SOURCE_CLOSE:
+ return 0;
+
+ case ZIP_SOURCE_STAT:
+ {
+ struct zip_stat *st;
+
+ if (len < sizeof(*st))
+ return -1;
+
+ st = (struct zip_stat *)data;
+
+ st->mtime = z->mtime;
+ st->crc = 0;
+ st->size = z->end - z->data;
+ st->comp_size = -1;
+ st->comp_method = ZIP_CM_STORE;
+
+ return sizeof(*st);
+ }
+
+ case ZIP_SOURCE_ERROR:
+ {
+ int *e;
+
+ if (len < sizeof(int)*2)
+ return -1;
+
+ e = (int *)data;
+ e[0] = e[1] = 0;
+ }
+ return sizeof(int)*2;
+
+ case ZIP_SOURCE_FREE:
+ if (z->freep) {
+ free((void *)z->data);
+ z->data = NULL;
+ }
+ free(z);
+ return 0;
+
+ default:
+ ;
+ }
+
+ return -1;
+}
diff --git a/ext/zip/lib/zip_source_file.c b/ext/zip/lib/zip_source_file.c
new file mode 100644
index 000000000..f06b32fec
--- /dev/null
+++ b/ext/zip/lib/zip_source_file.c
@@ -0,0 +1,71 @@
+/*
+ $NiH: zip_source_file.c,v 1.2 2004/11/18 16:28:13 wiz Exp $
+
+ zip_source_file.c -- create data source from file
+ Copyright (C) 1999, 2003, 2004 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <errno.h>
+#include <stdio.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+struct zip_source *
+zip_source_file(struct zip *za, const char *fname, off_t start, off_t len)
+{
+ struct zip_source *zs;
+ FILE *fp;
+
+ if (za == NULL)
+ return NULL;
+
+ if (fname == NULL || start < 0 || len < -1) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return NULL;
+ }
+
+ if ((fp=fopen(fname, "rb")) == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_OPEN, errno);
+ return NULL;
+ }
+
+ if ((zs=zip_source_filep(za, fp, start, len)) == NULL) {
+ fclose(fp);
+ return NULL;
+ }
+
+ return zs;
+}
diff --git a/ext/zip/lib/zip_source_filep.c b/ext/zip/lib/zip_source_filep.c
new file mode 100644
index 000000000..9c7383cf2
--- /dev/null
+++ b/ext/zip/lib/zip_source_filep.c
@@ -0,0 +1,180 @@
+/*
+ $NiH: zip_source_filep.c,v 1.6 2005/06/09 19:57:10 dillo Exp $
+
+ zip_source_filep.c -- create data source from FILE *
+ Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <sys/stat.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+struct read_file {
+ FILE *f; /* file to copy from */
+ off_t off; /* start offset of */
+ off_t len; /* lengt of data to copy */
+ off_t remain; /* bytes remaining to be copied */
+ int e[2]; /* error codes */
+};
+
+static ssize_t read_file(void *state, void *data, size_t len,
+ enum zip_source_cmd cmd);
+
+
+
+struct zip_source *
+zip_source_filep(struct zip *za, FILE *file, off_t start, off_t len)
+{
+ struct read_file *f;
+ struct zip_source *zs;
+
+ if (za == NULL)
+ return NULL;
+
+ if (file == NULL || start < 0 || len < -1) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return NULL;
+ }
+
+ if ((f=(struct read_file *)malloc(sizeof(struct read_file))) == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+
+ f->f = file;
+ f->off = start;
+ f->len = (len ? len : -1);
+
+ if ((zs=zip_source_function(za, read_file, f)) == NULL) {
+ free(f);
+ return NULL;
+ }
+
+ return zs;
+}
+
+
+
+static ssize_t
+read_file(void *state, void *data, size_t len, enum zip_source_cmd cmd)
+{
+ struct read_file *z;
+ char *buf;
+ int i, n;
+
+ z = (struct read_file *)state;
+ buf = (char *)data;
+
+ switch (cmd) {
+ case ZIP_SOURCE_OPEN:
+ if (fseeko(z->f, z->off, SEEK_SET) < 0) {
+ z->e[0] = ZIP_ER_SEEK;
+ z->e[1] = errno;
+ return -1;
+ }
+ z->remain = z->len;
+ return 0;
+
+ case ZIP_SOURCE_READ:
+ if (z->remain != -1)
+ n = len > z->remain ? z->remain : len;
+ else
+ n = len;
+
+ if ((i=fread(buf, 1, n, z->f)) < 0) {
+ z->e[0] = ZIP_ER_READ;
+ z->e[1] = errno;
+ return -1;
+ }
+
+ if (z->remain != -1)
+ z->remain -= i;
+
+ return i;
+
+ case ZIP_SOURCE_CLOSE:
+ return 0;
+
+ case ZIP_SOURCE_STAT:
+ {
+ struct zip_stat *st;
+ struct stat fst;
+
+ if (len < sizeof(*st))
+ return -1;
+
+ st = (struct zip_stat *)data;
+
+ if (fstat(fileno(z->f), &fst) != 0) {
+ z->e[0] = ZIP_ER_READ; /* best match */
+ z->e[1] = errno;
+ return -1;
+ }
+
+ st->mtime = fst.st_mtime;
+ st->crc = 0;
+ if (z->len != -1)
+ st->size = z->len;
+ else if ((fst.st_mode&S_IFMT) == S_IFREG)
+ st->size = fst.st_size;
+ else
+ st->size = -1;
+ st->comp_size = -1;
+ st->comp_method = ZIP_CM_STORE;
+
+ return sizeof(*st);
+ }
+
+ case ZIP_SOURCE_ERROR:
+ if (len < sizeof(int)*2)
+ return -1;
+
+ memcpy(data, z->e, sizeof(int)*2);
+ return sizeof(int)*2;
+
+ case ZIP_SOURCE_FREE:
+ fclose(z->f);
+ free(z);
+ return 0;
+
+ default:
+ ;
+ }
+
+ return -1;
+}
diff --git a/ext/zip/lib/zip_source_free.c b/ext/zip/lib/zip_source_free.c
new file mode 100644
index 000000000..33e36eaf4
--- /dev/null
+++ b/ext/zip/lib/zip_source_free.c
@@ -0,0 +1,54 @@
+/*
+ $NiH: zip_source_free.c,v 1.2 2004/12/22 16:32:00 dillo Exp $
+
+ zip_source_free.c -- free zip data source
+ Copyright (C) 1999, 2003, 2004 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+void
+zip_source_free(struct zip_source *source)
+{
+ if (source == NULL)
+ return;
+
+ (void)source->f(source->ud, NULL, 0, ZIP_SOURCE_FREE);
+
+ free(source);
+}
diff --git a/ext/zip/lib/zip_source_function.c b/ext/zip/lib/zip_source_function.c
new file mode 100644
index 000000000..4f01a43c5
--- /dev/null
+++ b/ext/zip/lib/zip_source_function.c
@@ -0,0 +1,62 @@
+/*
+ $NiH: zip_source_function.c,v 1.4 2006/02/21 09:41:00 dillo Exp $
+
+ zip_source_function.c -- create zip data source from callback function
+ Copyright (C) 1999, 2003, 2004 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+
+
+struct zip_source *
+zip_source_function(struct zip *za, zip_source_callback zcb, void *ud)
+{
+ struct zip_source *zs;
+
+ if (za == NULL)
+ return NULL;
+
+ if ((zs=(struct zip_source *)malloc(sizeof(*zs))) == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+
+ zs->f = zcb;
+ zs->ud = ud;
+
+ return zs;
+}
diff --git a/ext/zip/lib/zip_source_zip.c b/ext/zip/lib/zip_source_zip.c
new file mode 100644
index 000000000..a31fd2787
--- /dev/null
+++ b/ext/zip/lib/zip_source_zip.c
@@ -0,0 +1,189 @@
+/*
+ $NiH: zip_source_zip.c,v 1.7 2006/02/21 09:41:00 dillo Exp $
+
+ zip_source_zip.c -- create data source from zip file
+ Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+#include <string.h>
+
+#include "zip.h"
+#include "zipint.h"
+
+struct read_zip {
+ struct zip_file *zf;
+ struct zip_stat st;
+ off_t off, len;
+};
+
+static ssize_t read_zip(void *st, void *data, size_t len,
+ enum zip_source_cmd cmd);
+
+
+
+struct zip_source *
+zip_source_zip(struct zip *za, struct zip *srcza, int srcidx, int flags,
+ off_t start, off_t len)
+{
+ struct zip_error error;
+ struct zip_source *zs;
+ struct read_zip *p;
+
+ if (za == NULL)
+ return NULL;
+
+ if (srcza == NULL || start < 0 || len < -1 || srcidx < 0 || srcidx >= srcza->nentry) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return NULL;
+ }
+
+ if ((flags & ZIP_FL_UNCHANGED) == 0
+ && ZIP_ENTRY_DATA_CHANGED(srcza->entry+srcidx)) {
+ _zip_error_set(&za->error, ZIP_ER_CHANGED, 0);
+ return NULL;
+ }
+
+ if (len == 0)
+ len = -1;
+
+ if (start == 0 && len == -1)
+ flags |= ZIP_FL_COMPRESSED;
+ else
+ flags &= ~ZIP_FL_COMPRESSED;
+
+ if ((p=(struct read_zip *)malloc(sizeof(*p))) == NULL) {
+ _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+ return NULL;
+ }
+
+ _zip_error_copy(&error, &srcza->error);
+
+ if (zip_stat_index(srcza, srcidx, flags, &p->st) < 0
+ || (p->zf=zip_fopen_index(srcza, srcidx, flags)) == NULL) {
+ free(p);
+ _zip_error_copy(&za->error, &srcza->error);
+ _zip_error_copy(&srcza->error, &error);
+
+ return NULL;
+ }
+ p->off = start;
+ p->len = len;
+
+ if ((flags & ZIP_FL_COMPRESSED) == 0) {
+ p->st.size = p->st.comp_size = len;
+ p->st.comp_method = ZIP_CM_STORE;
+ p->st.crc = 0;
+ }
+
+ if ((zs=zip_source_function(za, read_zip, p)) == NULL) {
+ free(p);
+ return NULL;
+ }
+
+ return zs;
+}
+
+
+
+static ssize_t
+read_zip(void *state, void *data, size_t len, enum zip_source_cmd cmd)
+{
+ struct read_zip *z;
+ char b[8192], *buf;
+ int i, n;
+
+ z = (struct read_zip *)state;
+ buf = (char *)data;
+
+ switch (cmd) {
+ case ZIP_SOURCE_OPEN:
+ for (n=0; n<z->off; n+= i) {
+ i = (z->off-n > sizeof(b) ? sizeof(b) : z->off-n);
+ if ((i=zip_fread(z->zf, b, i)) < 0) {
+ zip_fclose(z->zf);
+ z->zf = NULL;
+ return -1;
+ }
+ }
+ return 0;
+
+ case ZIP_SOURCE_READ:
+ if (z->len != -1)
+ n = len > z->len ? z->len : len;
+ else
+ n = len;
+
+
+ if ((i=zip_fread(z->zf, buf, n)) < 0)
+ return -1;
+
+ if (z->len != -1)
+ z->len -= i;
+
+ return i;
+
+ case ZIP_SOURCE_CLOSE:
+ return 0;
+
+ case ZIP_SOURCE_STAT:
+ if (len < sizeof(z->st))
+ return -1;
+ len = sizeof(z->st);
+
+ memcpy(data, &z->st, len);
+ return len;
+
+ case ZIP_SOURCE_ERROR:
+ {
+ int *e;
+
+ if (len < sizeof(int)*2)
+ return -1;
+
+ e = (int *)data;
+ zip_file_error_get(z->zf, e, e+1);
+ }
+ return sizeof(int)*2;
+
+ case ZIP_SOURCE_FREE:
+ zip_fclose(z->zf);
+ free(z);
+ return 0;
+
+ default:
+ ;
+ }
+
+ return -1;
+}
diff --git a/ext/zip/lib/zip_stat.c b/ext/zip/lib/zip_stat.c
new file mode 100644
index 000000000..bea153d15
--- /dev/null
+++ b/ext/zip/lib/zip_stat.c
@@ -0,0 +1,52 @@
+/*
+ $NiH: zip_stat.c,v 1.3 2004/04/16 09:40:30 dillo Exp $
+
+ zip_stat.c -- get information about file by name
+ Copyright (C) 1999, 2003, 2004 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_stat(struct zip *za, const char *fname, int flags, struct zip_stat *st)
+{
+ int idx;
+
+ if ((idx=zip_name_locate(za, fname, flags)) < 0)
+ return -1;
+
+ return zip_stat_index(za, idx, flags, st);
+}
diff --git a/ext/zip/lib/zip_stat_index.c b/ext/zip/lib/zip_stat_index.c
new file mode 100644
index 000000000..837d63907
--- /dev/null
+++ b/ext/zip/lib/zip_stat_index.c
@@ -0,0 +1,93 @@
+/*
+ $NiH: zip_stat_index.c,v 1.10 2006/04/24 14:04:19 dillo Exp $
+
+ zip_stat_index.c -- get information about file by index
+ Copyright (C) 1999, 2003, 2004 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st)
+{
+ const char *name;
+
+ if (index < 0 || index >= za->nentry) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return -1;
+ }
+
+ if ((name=zip_get_name(za, index, flags)) == NULL)
+ return -1;
+
+
+ if ((flags & ZIP_FL_UNCHANGED) == 0
+ && ZIP_ENTRY_DATA_CHANGED(za->entry+index)) {
+ if (za->entry[index].source->f(za->entry[index].source->ud,
+ st, sizeof(*st), ZIP_SOURCE_STAT) < 0) {
+ _zip_error_set(&za->error, ZIP_ER_CHANGED, 0);
+ return -1;
+ }
+ }
+ else {
+ if (za->cdir == NULL || index >= za->cdir->nentry) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return -1;
+ }
+
+ st->index = index;
+ st->crc = za->cdir->entry[index].crc;
+ st->size = za->cdir->entry[index].uncomp_size;
+ st->mtime = za->cdir->entry[index].last_mod;
+ st->comp_size = za->cdir->entry[index].comp_size;
+ st->comp_method = za->cdir->entry[index].comp_method;
+ if (za->cdir->entry[index].bitflags & ZIP_GPBF_ENCRYPTED) {
+ if (za->cdir->entry[index].bitflags & ZIP_GPBF_STRONG_ENCRYPTION) {
+ /* XXX */
+ st->encryption_method = ZIP_EM_UNKNOWN;
+ }
+ else
+ st->encryption_method = ZIP_EM_TRAD_PKWARE;
+ }
+ else
+ st->encryption_method = ZIP_EM_NONE;
+ /* st->bitflags = za->cdir->entry[index].bitflags; */
+ }
+
+ st->name = name;
+
+ return 0;
+}
diff --git a/ext/zip/lib/zip_strerror.c b/ext/zip/lib/zip_strerror.c
new file mode 100644
index 000000000..83e298506
--- /dev/null
+++ b/ext/zip/lib/zip_strerror.c
@@ -0,0 +1,47 @@
+/*
+ $NiH: zip_strerror.c,v 1.1 2003/10/05 16:05:22 dillo Exp $
+
+ zip_sterror.c -- get string representation of zip error
+ Copyright (C) 1999, 2003 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 "zip.h"
+#include "zipint.h"
+
+
+
+const char *
+zip_strerror(struct zip *za)
+{
+ return _zip_error_strerror(&za->error);
+}
diff --git a/ext/zip/lib/zip_unchange.c b/ext/zip/lib/zip_unchange.c
new file mode 100644
index 000000000..34e7f2d36
--- /dev/null
+++ b/ext/zip/lib/zip_unchange.c
@@ -0,0 +1,84 @@
+/*
+ $NiH: zip_unchange.c,v 1.19 2006/04/23 13:21:18 wiz Exp $
+
+ zip_unchange.c -- undo changes to file in zip archive
+ Copyright (C) 1999, 2004, 2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+#include "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_unchange(struct zip *za, int idx)
+{
+ return _zip_unchange(za, idx, 0);
+}
+
+
+
+int
+_zip_unchange(struct zip *za, int idx, int allow_duplicates)
+{
+ int i;
+
+ if (idx < 0 || idx >= za->nentry) {
+ _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+ return -1;
+ }
+
+ if (za->entry[idx].ch_filename) {
+ if (!allow_duplicates) {
+ i = _zip_name_locate(za,
+ _zip_get_name(za, idx, ZIP_FL_UNCHANGED, NULL),
+ 0, NULL);
+ if (i != -1 && i != idx) {
+ _zip_error_set(&za->error, ZIP_ER_EXISTS, 0);
+ return -1;
+ }
+ }
+
+ free(za->entry[idx].ch_filename);
+ za->entry[idx].ch_filename = NULL;
+ }
+
+ free(za->entry[idx].ch_comment);
+ za->entry[idx].ch_comment = NULL;
+ za->entry[idx].ch_comment_len = -1;
+
+ _zip_unchange_data(za->entry+idx);
+
+ return 0;
+}
diff --git a/ext/zip/lib/zip_unchange_all.c b/ext/zip/lib/zip_unchange_all.c
new file mode 100644
index 000000000..f1e27da04
--- /dev/null
+++ b/ext/zip/lib/zip_unchange_all.c
@@ -0,0 +1,56 @@
+/*
+ $NiH: zip_unchange_all.c,v 1.10 2006/04/23 13:14:46 wiz Exp $
+
+ zip_unchange.c -- undo changes to all files in zip archive
+ Copyright (C) 1999, 2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+#include "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_unchange_all(struct zip *za)
+{
+ int ret, i;
+
+ ret = 0;
+ for (i=0; i<za->nentry; i++)
+ ret |= _zip_unchange(za, i, 1);
+
+ ret |= zip_unchange_archive(za);
+
+ return ret;
+}
diff --git a/ext/zip/lib/zip_unchange_archive.c b/ext/zip/lib/zip_unchange_archive.c
new file mode 100644
index 000000000..7418aaf6a
--- /dev/null
+++ b/ext/zip/lib/zip_unchange_archive.c
@@ -0,0 +1,52 @@
+/*
+ $NiH: zip_unchange_archive.c,v 1.1 2006/04/23 13:14:46 wiz Exp $
+
+ zip_unchange_archive.c -- undo global changes to ZIP archive
+ Copyright (C) 2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+#include "zip.h"
+#include "zipint.h"
+
+
+
+int
+zip_unchange_archive(struct zip *za)
+{
+ free(za->ch_comment);
+ za->ch_comment = NULL;
+ za->ch_comment_len = -1;
+
+ return 0;
+}
diff --git a/ext/zip/lib/zip_unchange_data.c b/ext/zip/lib/zip_unchange_data.c
new file mode 100644
index 000000000..252676926
--- /dev/null
+++ b/ext/zip/lib/zip_unchange_data.c
@@ -0,0 +1,53 @@
+/*
+ $NiH: zip_unchange_data.c,v 1.15 2004/12/22 16:32:00 dillo Exp $
+
+ zip_unchange_data.c -- undo helper function
+ Copyright (C) 1999, 2004 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <stdlib.h>
+
+#include "zipint.h"
+
+void
+_zip_unchange_data(struct zip_entry *ze)
+{
+ if (ze->source) {
+ (void)ze->source->f(ze->source->ud, NULL, 0, ZIP_SOURCE_FREE);
+ free(ze->source);
+ ze->source = NULL;
+ }
+
+ ze->state = ze->ch_filename ? ZIP_ST_RENAMED : ZIP_ST_UNCHANGED;
+}
+
diff --git a/ext/zip/lib/zip_win32.h b/ext/zip/lib/zip_win32.h
new file mode 100644
index 000000000..a33347ba0
--- /dev/null
+++ b/ext/zip/lib/zip_win32.h
@@ -0,0 +1,29 @@
+
+#ifdef _MSC_VER
+
+#define _POSIX_
+#include <windows.h>
+#include <io.h>
+#include <fcntl.h>
+
+#ifndef ssize_t
+# define ssize_t SSIZE_T
+#endif
+#ifndef mode_t
+# define mode_t int
+#endif
+#ifndef strcasecmp
+# define strcasecmp stricmp
+#endif
+#ifndef snprintf
+# define snprintf _snprintf
+#endif
+#ifndef mkstemp
+# define mkstemp(t) _creat(_mktemp(t), _S_IREAD|_S_IWRITE)
+#endif
+/*
+#ifndef fseeko
+# define fseeko fseek
+#endif
+*/
+#endif
diff --git a/ext/zip/lib/zipint.h b/ext/zip/lib/zipint.h
new file mode 100644
index 000000000..9efaf06a3
--- /dev/null
+++ b/ext/zip/lib/zipint.h
@@ -0,0 +1,225 @@
+#ifndef _HAD_ZIPINT_H
+#define _HAD_ZIPINT_H
+
+/*
+ $NiH: zipint.h,v 1.48 2006/04/24 14:04:19 dillo Exp $
+
+ zipint.h -- internal declarations.
+ Copyright (C) 1999, 2003, 2004, 2005, 2006 Dieter Baron and Thomas Klausner
+
+ This file is part of libzip, a library to manipulate ZIP archives.
+ The authors can be contacted at <nih@giga.or.at>
+
+ 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 names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 <zlib.h>
+
+#include "zip.h"
+#ifndef HAVE_FSEEKO
+#define fseeko(s, o, w) (fseek((s), (long int)(o), (w)))
+#endif
+
+#define CENTRAL_MAGIC "PK\1\2"
+#define LOCAL_MAGIC "PK\3\4"
+#define EOCD_MAGIC "PK\5\6"
+#define DATADES_MAGIC "PK\7\8"
+#define CDENTRYSIZE 46u
+#define LENTRYSIZE 30
+#define MAXCOMLEN 65536
+#define EOCDLEN 22
+#define CDBUFSIZE (MAXCOMLEN+EOCDLEN)
+#define BUFSIZE 8192
+
+
+
+/* state of change of a file in zip archive */
+
+enum zip_state { ZIP_ST_UNCHANGED, ZIP_ST_DELETED, ZIP_ST_REPLACED,
+ ZIP_ST_ADDED, ZIP_ST_RENAMED };
+
+/* constants for struct zip_file's member flags */
+
+#define ZIP_ZF_EOF 1 /* EOF reached */
+#define ZIP_ZF_DECOMP 2 /* decompress data */
+#define ZIP_ZF_CRC 4 /* compute and compare CRC */
+
+/* directory entry: general purpose bit flags */
+
+#define ZIP_GPBF_ENCRYPTED 0x0001 /* is encrypted */
+#define ZIP_GPBF_STRONG_ENCRYPTION 0x0040 /* uses strong encryption */
+#define ZIP_GPBF_USE_DATA_DESCRIPTOR 0x0008 /* uses crc and size from data header */
+
+/* error information */
+
+struct zip_error {
+ int zip_err; /* libzip error code (ZIP_ER_*) */
+ int sys_err; /* copy of errno (E*) or zlib error code */
+ char *str; /* string representation or NULL */
+};
+
+/* zip archive, part of API */
+
+struct zip {
+ char *zn; /* file name */
+ FILE *zp; /* file */
+ struct zip_error error; /* error information */
+
+ struct zip_cdir *cdir; /* central directory */
+ char *ch_comment; /* changed archive comment */
+ int ch_comment_len; /* length of changed zip archive
+ * comment, -1 if unchanged */
+ int nentry; /* number of entries */
+ int nentry_alloc; /* number of entries allocated */
+ struct zip_entry *entry; /* entries */
+ int nfile; /* number of opened files within archive */
+ int nfile_alloc; /* number of files allocated */
+ struct zip_file **file; /* opened files within archive */
+};
+
+/* file in zip archive, part of API */
+
+struct zip_file {
+ struct zip *za; /* zip archive containing this file */
+ struct zip_error error; /* error information */
+ int flags; /* -1: eof, >0: error */
+
+ int method; /* compression method */
+ long fpos; /* position within zip file (fread/fwrite) */
+ unsigned long bytes_left; /* number of bytes left to read */
+ unsigned long cbytes_left; /* number of bytes of compressed data left */
+
+ unsigned long crc; /* CRC so far */
+ unsigned long crc_orig; /* CRC recorded in archive */
+
+ char *buffer;
+ z_stream *zstr;
+};
+
+/* zip archive directory entry (central or local) */
+
+struct zip_dirent {
+ unsigned short version_madeby; /* (c) version of creator */
+ unsigned short version_needed; /* (cl) version needed to extract */
+ unsigned short bitflags; /* (cl) general purpose bit flag */
+ unsigned short comp_method; /* (cl) compression method used */
+ time_t last_mod; /* (cl) time of last modification */
+ unsigned int crc; /* (cl) CRC-32 of uncompressed data */
+ unsigned int comp_size; /* (cl) size of commpressed data */
+ unsigned int uncomp_size; /* (cl) size of uncommpressed data */
+ char *filename; /* (cl) file name (NUL-terminated) */
+ unsigned short filename_len; /* (cl) length of filename (w/o NUL) */
+ char *extrafield; /* (cl) extra field */
+ unsigned short extrafield_len; /* (cl) length of extra field */
+ char *comment; /* (c) file comment */
+ unsigned short comment_len; /* (c) length of file comment */
+ unsigned short disk_number; /* (c) disk number start */
+ unsigned short int_attrib; /* (c) internal file attributes */
+ unsigned int ext_attrib; /* (c) external file attributes */
+ unsigned int offset; /* (c) offset of local header */
+};
+
+/* zip archive central directory */
+
+struct zip_cdir {
+ struct zip_dirent *entry; /* directory entries */
+ int nentry; /* number of entries */
+
+ unsigned int size; /* size of central direcotry */
+ unsigned int offset; /* offset of central directory in file */
+ char *comment; /* zip archive comment */
+ unsigned short comment_len; /* length of zip archive comment */
+};
+
+
+
+struct zip_source {
+ zip_source_callback f;
+ void *ud;
+};
+
+/* entry in zip archive directory */
+
+struct zip_entry {
+ enum zip_state state;
+ struct zip_source *source;
+ char *ch_filename;
+ char *ch_comment;
+ int ch_comment_len;
+};
+
+
+
+extern const char * const _zip_err_str[];
+extern const int _zip_nerr_str;
+extern const int _zip_err_type[];
+
+
+
+#define ZIP_ENTRY_DATA_CHANGED(x) \
+ ((x)->state == ZIP_ST_REPLACED \
+ || (x)->state == ZIP_ST_ADDED)
+
+
+
+void _zip_cdir_free(struct zip_cdir *);
+struct zip_cdir *_zip_cdir_new(int, struct zip_error *);
+int _zip_cdir_write(struct zip_cdir *, FILE *, struct zip_error *);
+
+void _zip_dirent_finalize(struct zip_dirent *);
+void _zip_dirent_init(struct zip_dirent *);
+int _zip_dirent_read(struct zip_dirent *, FILE *,
+ unsigned char **, unsigned int, int, struct zip_error *);
+int _zip_dirent_write(struct zip_dirent *, FILE *, int, struct zip_error *);
+
+void _zip_entry_free(struct zip_entry *);
+void _zip_entry_init(struct zip *, int);
+struct zip_entry *_zip_entry_new(struct zip *);
+
+void _zip_error_copy(struct zip_error *, struct zip_error *);
+void _zip_error_fini(struct zip_error *);
+void _zip_error_get(struct zip_error *, int *, int *);
+void _zip_error_init(struct zip_error *);
+void _zip_error_set(struct zip_error *, int, int);
+const char *_zip_error_strerror(struct zip_error *);
+
+int _zip_file_fillbuf(void *, size_t, struct zip_file *);
+unsigned int _zip_file_get_offset(struct zip *, int);
+
+void _zip_free(struct zip *);
+const char *_zip_get_name(struct zip *, int, int, struct zip_error *);
+int _zip_local_header_read(struct zip *, int);
+void *_zip_memdup(const void *, size_t, struct zip_error *);
+int _zip_name_locate(struct zip *, const char *, int, struct zip_error *);
+struct zip *_zip_new(struct zip_error *);
+unsigned short _zip_read2(unsigned char **);
+unsigned int _zip_read4(unsigned char **);
+int _zip_replace(struct zip *, int, const char *, struct zip_source *);
+int _zip_set_name(struct zip *, int, const char *);
+int _zip_unchange(struct zip *, int, int);
+void _zip_unchange_data(struct zip_entry *);
+
+#endif /* zipint.h */
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
new file mode 100644
index 000000000..45ecdb951
--- /dev/null
+++ b/ext/zip/php_zip.c
@@ -0,0 +1,2002 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2006 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Piere-Alain Joye <pierre@php.net |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_zip.c,v 1.1.2.15 2006/09/24 22:27:57 pajoye Exp $ */
+
+#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 "php_zip.h"
+#include "lib/zip.h"
+#include "lib/zipint.h"
+
+/* {{{ Resource le */
+static int le_zip_dir;
+#define le_zip_dir_name "Zip Directory"
+static int le_zip_entry;
+#define le_zip_entry_name "Zip Entry"
+/* }}} */
+
+/* {{{ SAFEMODE_CHECKFILE(filename) */
+#define SAFEMODE_CHECKFILE(filename) \
+ (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)
+/* }}} */
+
+/* {{{ PHP_ZIP_STAT_INDEX(za, index, flags, sb) */
+#define PHP_ZIP_STAT_INDEX(za, index, flags, sb) \
+ if (zip_stat_index(za, index, flags, &sb) != 0) { \
+ RETURN_FALSE; \
+ }
+/* }}} */
+
+/* {{{ PHP_ZIP_STAT_PATH(za, path, path_len, flags, sb) */
+#define PHP_ZIP_STAT_PATH(za, path, path_len, flags, sb) \
+ if (path_len < 1) { \
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name"); \
+ RETURN_FALSE; \
+ } \
+ if (zip_stat(za, path, flags, &sb)) { \
+ RETURN_FALSE; \
+ }
+/* }}} */
+
+/* {{{ PHP_ZIP_SET_FILE_COMMENT(za, index, comment, comment_len) */
+#define PHP_ZIP_SET_FILE_COMMENT(za, index, comment, comment_len) \
+ if (comment_len == 0) { \
+ /* Passing NULL remove the existing comment */ \
+ if (zip_set_file_comment(intern, index, NULL, 0) < 0) { \
+ RETURN_FALSE; \
+ } \
+ } else if (zip_set_file_comment(intern, index, comment, comment_len) < 0) { \
+ RETURN_FALSE; \
+ }
+
+/* }}} */
+
+#ifdef ZEND_ENGINE_2_1
+/* {{{ php_zip_extract_file */
+/* TODO: Simplify it */
+static int php_zip_extract_file(struct zip * za, char *dest, char *file TSRMLS_DC)
+{
+ php_stream_statbuf ssb;
+ struct zip_file *zf;
+ struct zip_stat sb;
+ char b[8192];
+
+ int n, len, ret, file_len;
+
+ php_stream *stream;
+
+ char *fullpath;
+ char *file_dirname_fullpath;
+ char file_dirname[MAXPATHLEN + 1];
+ size_t dir_len;
+
+ char *file_basename;
+ size_t file_basename_len;
+
+ if (zip_stat(za, file, 0, &sb)) {
+ return 0;
+ }
+
+ file_len = strlen(file);
+ memcpy(file_dirname, file, file_len);
+
+ dir_len = php_dirname(file_dirname, file_len);
+
+ if (dir_len > 0) {
+ len = spprintf(&file_dirname_fullpath, 0, "%s/%s", dest, file_dirname);
+ } else {
+ len = spprintf(&file_dirname_fullpath, 0, "%s", dest);
+ }
+
+ php_basename(file, file_len, NULL, 0, &file_basename, &file_basename_len TSRMLS_CC);
+
+ if (SAFEMODE_CHECKFILE(file_dirname_fullpath)) {
+ efree(file_dirname_fullpath);
+ efree(file_basename);
+ return 0;
+ }
+
+ /* let see if the path already exists */
+ if (php_stream_stat_path(file_dirname_fullpath, &ssb) < 0) {
+ ret = php_stream_mkdir(file_dirname_fullpath, 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL);
+ if (!ret) {
+ efree(file_dirname_fullpath);
+ efree(file_basename);
+ return 0;
+ }
+ }
+
+ /* it is a standalone directory, job done */
+ if (file[file_len - 1] == '/') {
+ efree(file_dirname_fullpath);
+ efree(file_basename);
+ return 1;
+ }
+
+ len = spprintf(&fullpath, 0, "%s/%s/%s", dest, file_dirname, file_basename);
+ if (!len) {
+ efree(file_dirname_fullpath);
+ efree(file_basename);
+ return 0;
+ }
+
+ /* check again the full path, not sure if it
+ * is required, does a file can have a different
+ * safemode status as its parent folder?
+ */
+ if (SAFEMODE_CHECKFILE(fullpath)) {
+ efree(file_dirname_fullpath);
+ efree(file_basename);
+ return 0;
+ }
+
+ zf = zip_fopen(za, file, 0);
+ if (zf == NULL) {
+ efree(fullpath);
+ efree(file_dirname_fullpath);
+ efree(file_basename);
+ return 0;
+ }
+
+ stream = php_stream_open_wrapper(fullpath, "w+b", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
+ n = 0;
+ if (stream) {
+ while ((n=zip_fread(zf, b, sizeof(b))) > 0) php_stream_write(stream, b, n);
+ php_stream_close(stream);
+ }
+ n = zip_fclose(zf);
+
+ efree(fullpath);
+ efree(file_basename);
+ efree(file_dirname_fullpath);
+
+ if (n<0) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+/* }}} */
+
+/* {{{ REGISTER_ZIP_CLASS_CONST_LONG */
+#define REGISTER_ZIP_CLASS_CONST_LONG(const_name, value) \
+ zend_declare_class_constant_long(zip_class_entry, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC);
+/* }}} */
+
+/* {{{ ZIP_FROM_OBJECT */
+#define ZIP_FROM_OBJECT(intern, object) \
+ { \
+ ze_zip_object *obj = (ze_zip_object*) zend_object_store_get_object(object TSRMLS_CC); \
+ intern = obj->za; \
+ if (!intern) { \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid or unitialized Zip object"); \
+ RETURN_FALSE; \
+ } \
+ }
+/* }}} */
+
+/* {{{ RETURN_SB(sb) */
+#define RETURN_SB(sb) \
+ { \
+ array_init(return_value); \
+ add_assoc_string(return_value, "name", estrdup((sb)->name), 0); \
+ add_assoc_long(return_value, "index", (long) (sb)->index); \
+ add_assoc_long(return_value, "crc", (long) (sb)->crc); \
+ add_assoc_long(return_value, "size", (long) (sb)->size); \
+ add_assoc_long(return_value, "mtime", (long) (sb)->mtime); \
+ add_assoc_long(return_value, "comp_size", (long) (sb)->comp_size); \
+ add_assoc_long(return_value, "comp_method", (long) (sb)->comp_method); \
+ }
+/* }}} */
+
+static int php_zip_status(struct zip *za TSRMLS_DC) /* {{{ */
+{
+ int zep, syp;
+
+ zip_error_get(za, &zep, &syp);
+ return zep;
+}
+/* }}} */
+
+static int php_zip_status_sys(struct zip *za TSRMLS_DC) /* {{{ */
+{
+ int zep, syp;
+
+ zip_error_get(za, &zep, &syp);
+ return syp;
+}
+/* }}} */
+
+static int php_zip_get_num_files(struct zip *za TSRMLS_DC) /* {{{ */
+{
+ return zip_get_num_files(za);
+}
+/* }}} */
+
+static char * php_zipobj_get_filename(ze_zip_object *obj TSRMLS_DC) /* {{{ */
+{
+ if (!obj) {
+ return NULL;
+ }
+
+ if (obj->filename) {
+ return obj->filename;
+ }
+ return NULL;
+}
+/* }}} */
+
+static char * php_zipobj_get_zip_comment(struct zip *za, int *len TSRMLS_DC) /* {{{ */
+{
+ if (za) {
+ return (char *)zip_get_archive_comment(za, len, 0);
+ }
+ return NULL;
+}
+/* }}} */
+
+#endif
+
+/* {{{ zend_function_entry */
+static zend_function_entry zip_functions[] = {
+ PHP_FE(zip_open, NULL)
+ PHP_FE(zip_close, NULL)
+ PHP_FE(zip_read, NULL)
+ PHP_FE(zip_entry_open, NULL)
+ PHP_FE(zip_entry_close, NULL)
+ PHP_FE(zip_entry_read, NULL)
+ PHP_FE(zip_entry_filesize, NULL)
+ PHP_FE(zip_entry_name, NULL)
+ PHP_FE(zip_entry_compressedsize, NULL)
+ PHP_FE(zip_entry_compressionmethod, NULL)
+
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
+/* {{{ ZE2 OO definitions */
+#ifdef ZEND_ENGINE_2_1
+zend_class_entry *zip_class_entry;
+static zend_object_handlers zip_object_handlers;
+
+static HashTable zip_prop_handlers;
+
+typedef int (*zip_read_int_t)(struct zip *za TSRMLS_DC);
+typedef char *(*zip_read_const_char_t)(struct zip *za, int *len TSRMLS_DC);
+typedef char *(*zip_read_const_char_from_ze_t)(ze_zip_object *obj TSRMLS_DC);
+
+typedef struct _zip_prop_handler {
+ zip_read_int_t read_int_func;
+ zip_read_const_char_t read_const_char_func;
+ zip_read_const_char_from_ze_t read_const_char_from_obj_func;
+
+ int type;
+} zip_prop_handler;
+#endif
+/* }}} */
+
+#ifdef ZEND_ENGINE_2_1
+static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, zip_read_int_t read_int_func, zip_read_const_char_t read_char_func, zip_read_const_char_from_ze_t read_char_from_obj_func, int rettype TSRMLS_DC) /* {{{ */
+{
+ zip_prop_handler hnd;
+
+ hnd.read_const_char_func = read_char_func;
+ hnd.read_int_func = read_int_func;
+ hnd.read_const_char_from_obj_func = read_char_from_obj_func;
+ hnd.type = rettype;
+ zend_hash_add(prop_handler, name, strlen(name)+1, &hnd, sizeof(zip_prop_handler), NULL);
+}
+/* }}} */
+
+static int php_zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd, zval **retval, int newzval TSRMLS_DC) /* {{{ */
+{
+ const char *retchar = NULL;
+ int retint = 0;
+ int len = 0;
+
+ if (obj && obj->za != NULL) {
+ if (hnd->read_const_char_func) {
+ retchar = hnd->read_const_char_func(obj->za, &len TSRMLS_CC);
+ } else {
+ if (hnd->read_int_func) {
+ retint = hnd->read_int_func(obj->za TSRMLS_CC);
+ if (retint == -1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal zip error returned");
+ return FAILURE;
+ }
+ } else {
+ if (hnd->read_const_char_from_obj_func) {
+ retchar = hnd->read_const_char_from_obj_func(obj TSRMLS_CC);
+ }
+ }
+ }
+ }
+
+ if (newzval) {
+ ALLOC_ZVAL(*retval);
+ }
+
+ switch (hnd->type) {
+ case IS_STRING:
+ if (retchar) {
+ ZVAL_STRINGL(*retval, (char *) retchar, len, 1);
+ } else {
+ ZVAL_EMPTY_STRING(*retval);
+ }
+ break;
+ case IS_BOOL:
+ ZVAL_BOOL(*retval, (long)retint);
+ break;
+ case IS_LONG:
+ ZVAL_LONG(*retval, (long)retint);
+ break;
+ default:
+ ZVAL_NULL(*retval);
+ }
+
+ return SUCCESS;
+}
+/* }}} */
+
+zval **php_zip_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) /* {{{ */
+{
+ ze_zip_object *obj;
+ zval tmp_member;
+ zval **retval = NULL;
+
+ zip_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 = (ze_zip_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 == 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;
+}
+/* }}} */
+
+zval* php_zip_read_property(zval *object, zval *member, int type TSRMLS_DC) /* {{{ */
+{
+ ze_zip_object *obj;
+ zval tmp_member;
+ zval *retval;
+ zip_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 = (ze_zip_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 = php_zip_property_reader(obj, hnd, &retval, 1 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;
+}
+/* }}} */
+
+static HashTable *php_zip_get_properties(zval *object TSRMLS_DC)/* {{{ */
+{
+ ze_zip_object *obj;
+ zip_prop_handler *hnd;
+ HashTable *props;
+ zval *val;
+ int ret;
+ char *key;
+ uint key_len;
+ HashPosition pos;
+ ulong num_key;
+
+ obj = (ze_zip_object *)zend_objects_get_address(object TSRMLS_CC);
+ props = obj->zo.properties;
+
+ if (obj->prop_handler == NULL) {
+ return NULL;
+ }
+ zend_hash_internal_pointer_reset_ex(obj->prop_handler, &pos);
+
+ while (zend_hash_get_current_data_ex(obj->prop_handler, (void**)&hnd, &pos) == SUCCESS) {
+ zend_hash_get_current_key_ex(obj->prop_handler, &key, &key_len, &num_key, 0, &pos);
+ MAKE_STD_ZVAL(val);
+ ret = php_zip_property_reader(obj, hnd, &val, 0 TSRMLS_CC);
+ if (ret != SUCCESS) {
+ val = EG(uninitialized_zval_ptr);
+ }
+ zend_hash_update(props, key, key_len, (void *)&val, sizeof(zval *), NULL);
+ zend_hash_move_forward_ex(obj->prop_handler, &pos);
+ }
+ return obj->zo.properties;
+}
+/* }}} */
+
+static void php_zip_object_free_storage(void *object TSRMLS_DC) /* {{{ */
+{
+ ze_zip_object * intern = (ze_zip_object *) object;
+ int i;
+
+ if (!intern) {
+ return;
+ }
+ if (intern->za) {
+ zip_close(intern->za);
+ intern->za = NULL;
+ }
+
+ if (intern->buffers_cnt>0) {
+ for (i=0; i<intern->buffers_cnt; i++) {
+ efree(intern->buffers[i]);
+ }
+ efree(intern->buffers);
+ }
+
+ intern->za = NULL;
+
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1 && PHP_RELEASE_VERSION > 2) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5)
+ zend_object_std_dtor(&intern->zo TSRMLS_CC);
+#else
+ if (intern->zo.guards) {
+ zend_hash_destroy(intern->zo.guards);
+ FREE_HASHTABLE(intern->zo.guards);
+ }
+
+ if (intern->zo.properties) {
+ zend_hash_destroy(intern->zo.properties);
+ FREE_HASHTABLE(intern->zo.properties);
+ }
+#endif
+
+ if (intern->filename) {
+ efree(intern->filename);
+ }
+ efree(intern);
+}
+/* }}} */
+
+PHP_ZIP_API zend_object_value php_zip_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+{
+ ze_zip_object *intern;
+ zval *tmp;
+ zend_object_value retval;
+
+ intern = emalloc(sizeof(ze_zip_object));
+ memset(&intern->zo, 0, sizeof(zend_object));
+
+ intern->za = NULL;
+ intern->buffers = NULL;
+ intern->filename = NULL;
+ intern->buffers_cnt = 0;
+ intern->prop_handler = &zip_prop_handlers;
+
+ zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ 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) php_zip_object_free_storage,
+ NULL TSRMLS_CC);
+
+ retval.handlers = (zend_object_handlers *) & zip_object_handlers;
+
+ return retval;
+}
+/* }}} */
+#endif
+
+/* {{{ Resource dtors */
+
+/* {{{ php_zip_free_dir */
+static void php_zip_free_dir(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+{
+ zip_rsrc * zip_int = (zip_rsrc *) rsrc->ptr;
+
+ if (zip_int) {
+ if (zip_int->za) {
+ zip_close(zip_int->za);
+ }
+
+ efree(rsrc->ptr);
+
+ rsrc->ptr = NULL;
+ }
+}
+/* }}} */
+
+/* {{{ php_zip_free_entry */
+static void php_zip_free_entry(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+{
+ zip_read_rsrc *zr_rsrc = (zip_read_rsrc *) rsrc->ptr;
+
+ efree(zr_rsrc);
+ rsrc->ptr = NULL;
+}
+/* }}} */
+
+/* }}}*/
+
+/* {{{ function prototypes */
+PHP_MINIT_FUNCTION(zip);
+PHP_MSHUTDOWN_FUNCTION(zip);
+PHP_MINFO_FUNCTION(zip);
+/* }}} */
+
+/* {{{ zip_module_entry
+ */
+zend_module_entry zip_module_entry = {
+ STANDARD_MODULE_HEADER,
+ "zip",
+ zip_functions,
+ PHP_MINIT(zip),
+ PHP_MSHUTDOWN(zip),
+ NULL,
+ NULL,
+ PHP_MINFO(zip),
+ "1.4.0",
+ STANDARD_MODULE_PROPERTIES
+};
+/* }}} */
+
+#ifdef COMPILE_DL_ZIP
+ZEND_GET_MODULE(zip)
+#endif
+
+/* {{{ proto resource zip_open(string filename)
+Create new zip using source uri for output */
+PHP_FUNCTION(zip_open)
+{
+ char *filename;
+ int filename_len;
+ zip_rsrc *rsrc_int;
+ int err = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ return;
+ }
+ if (SAFEMODE_CHECKFILE(filename)) {
+ RETURN_FALSE;
+ }
+
+ rsrc_int = (zip_rsrc *)emalloc(sizeof(zip_rsrc));
+
+ rsrc_int->za = zip_open(filename, 0, &err);
+ if (rsrc_int->za == NULL) {
+ efree(rsrc_int);
+ RETURN_LONG((long)err);
+ }
+
+ rsrc_int->index_current = 0;
+ rsrc_int->num_files = zip_get_num_files(rsrc_int->za);
+
+ ZEND_REGISTER_RESOURCE(return_value, rsrc_int, le_zip_dir);
+}
+/* }}} */
+
+/* {{{ proto void zip_close(resource zip)
+ Close a Zip archive */
+PHP_FUNCTION(zip_close)
+{
+ zval * zip;
+ zip_rsrc *z_rsrc = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip) == FAILURE) {
+ return;
+ }
+ ZEND_FETCH_RESOURCE(z_rsrc, zip_rsrc *, &zip, -1, le_zip_dir_name, le_zip_dir);
+
+ /* really close the zip will break BC :-D */
+ zend_list_delete(Z_LVAL_P(zip));
+}
+/* }}} */
+
+/* {{{ proto resource zip_read(resource zip)
+ Returns the next file in the archive */
+PHP_FUNCTION(zip_read)
+{
+ zval *zip_dp;
+ zip_read_rsrc *zr_rsrc;
+ int ret;
+ zip_rsrc *rsrc_int;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip_dp) == FAILURE) {
+ return;
+ }
+ ZEND_FETCH_RESOURCE(rsrc_int, zip_rsrc *, &zip_dp, -1, le_zip_dir_name, le_zip_dir);
+
+ if (rsrc_int && rsrc_int->za) {
+ if (rsrc_int->index_current >= rsrc_int->num_files) {
+ RETURN_FALSE;
+ }
+
+ zr_rsrc = emalloc(sizeof(zip_read_rsrc));
+
+ ret = zip_stat_index(rsrc_int->za, rsrc_int->index_current, 0, &zr_rsrc->sb);
+
+ if (ret != 0) {
+ efree(zr_rsrc);
+ RETURN_LONG((long)ret);
+ }
+
+ zr_rsrc->zf = zip_fopen_index(rsrc_int->za, rsrc_int->index_current, 0);
+ if (zr_rsrc->zf) {
+ rsrc_int->index_current++;
+ ZEND_REGISTER_RESOURCE(return_value, zr_rsrc, le_zip_entry);
+ } else {
+ RETURN_FALSE;
+ }
+
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto bool zip_entry_open(resource zip_dp, resource zip_entry [, string mode])
+ Open a Zip File, pointed by the resource entry */
+/* Dummy function to follow the old API */
+PHP_FUNCTION(zip_entry_open)
+{
+ zval * zip;
+ zval * zip_entry;
+ char *mode;
+ int mode_len;
+ zip_read_rsrc * zr_rsrc;
+ zip_rsrc *z_rsrc;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|s", &zip, &zip_entry, &mode, &mode_len) == FAILURE) {
+ return;
+ }
+
+ ZEND_FETCH_RESOURCE(zr_rsrc, zip_read_rsrc *, &zip_entry, -1, le_zip_entry_name, le_zip_entry);
+ ZEND_FETCH_RESOURCE(z_rsrc, zip_rsrc *, &zip, -1, le_zip_dir_name, le_zip_dir);
+
+ if (zr_rsrc->zf != NULL) {
+ RETURN_TRUE;
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto void zip_entry_close(resource zip_ent)
+ Close a zip entry */
+/* another dummy function to fit in the old api*/
+PHP_FUNCTION(zip_entry_close)
+{
+ zval * zip_entry;
+ zip_read_rsrc * zr_rsrc;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip_entry) == FAILURE) {
+ return;
+ }
+
+ ZEND_FETCH_RESOURCE(zr_rsrc, zip_read_rsrc *, &zip_entry, -1, le_zip_entry_name, le_zip_entry);
+ /* we got a zip_entry resource, be happy */
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto mixed zip_entry_read(resource zip_entry [, int len])
+ Read from an open directory entry */
+PHP_FUNCTION(zip_entry_read)
+{
+ zval * zip_entry;
+ long len = 0;
+ zip_read_rsrc * zr_rsrc;
+ char *buffer;
+ int n = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zip_entry, &len) == FAILURE) {
+ return;
+ }
+
+ ZEND_FETCH_RESOURCE(zr_rsrc, zip_read_rsrc *, &zip_entry, -1, le_zip_entry_name, le_zip_entry);
+
+ if (len <= 0) {
+ len = 1024;
+ }
+
+ if (zr_rsrc->zf) {
+ buffer = safe_emalloc(len, 1, 1);
+ n = zip_fread(zr_rsrc->zf, buffer, len);
+ if (n > 0) {
+ buffer[n] = 0;
+ RETURN_STRINGL(buffer, n, 0);
+ } else {
+ RETURN_EMPTY_STRING()
+ }
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+static void php_zip_entry_get_info(INTERNAL_FUNCTION_PARAMETERS, int opt) /* {{{ */
+{
+ zval * zip_entry;
+ zip_read_rsrc * zr_rsrc;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip_entry) == FAILURE) {
+ return;
+ }
+
+ ZEND_FETCH_RESOURCE(zr_rsrc, zip_read_rsrc *, &zip_entry, -1, le_zip_entry_name, le_zip_entry);
+
+ if (!zr_rsrc->zf) {
+ RETURN_FALSE;
+ }
+
+ switch (opt) {
+ case 0:
+ RETURN_STRING((char *)zr_rsrc->sb.name, 1);
+ break;
+ case 1:
+ RETURN_LONG((long) (zr_rsrc->sb.comp_size));
+ break;
+ case 2:
+ RETURN_LONG((long) (zr_rsrc->sb.size));
+ break;
+ case 3:
+ switch (zr_rsrc->sb.comp_method) {
+ case 0:
+ RETURN_STRING("stored", 1);
+ break;
+ case 1:
+ RETURN_STRING("shrunk", 1);
+ break;
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ RETURN_STRING("reduced", 1);
+ break;
+ case 6:
+ RETURN_STRING("imploded", 1);
+ break;
+ case 7:
+ RETURN_STRING("tokenized", 1);
+ break;
+ case 8:
+ RETURN_STRING("deflated", 1);
+ break;
+ case 9:
+ RETURN_STRING("deflatedX", 1);
+ break;
+ case 10:
+ RETURN_STRING("implodedX", 1);
+ break;
+ default:
+ RETURN_FALSE;
+ }
+ RETURN_LONG((long) (zr_rsrc->sb.comp_method));
+ break;
+ }
+
+}
+/* }}} */
+
+/* {{{ proto string zip_entry_name(resource zip_entry)
+ Return the name given a ZZip entry */
+PHP_FUNCTION(zip_entry_name)
+{
+ php_zip_entry_get_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+/* }}} */
+
+/* {{{ proto int zip_entry_compressedsize(resource zip_entry)
+ Return the compressed size of a ZZip entry */
+PHP_FUNCTION(zip_entry_compressedsize)
+{
+ php_zip_entry_get_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+}
+/* }}} */
+
+/* {{{ proto int zip_entry_filesize(resource zip_entry)
+ Return the actual filesize of a ZZip entry */
+PHP_FUNCTION(zip_entry_filesize)
+{
+ php_zip_entry_get_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2);
+}
+/* }}} */
+
+/* {{{ proto string zip_entry_compressionmethod(resource zip_entry)
+ Return a string containing the compression method used on a particular entry */
+PHP_FUNCTION(zip_entry_compressionmethod)
+{
+ php_zip_entry_get_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3);
+}
+/* }}} */
+
+#ifdef ZEND_ENGINE_2_1
+/* {{{ proto mixed open(string source [, int flags])
+Create new zip using source uri for output, return TRUE on success or the error code */
+ZIPARCHIVE_METHOD(open)
+{
+ struct zip *intern;
+ char *filename;
+ int filename_len;
+ int err = 0;
+ long flags = 0;
+ char resolved_path[MAXPATHLEN + 1];
+
+ zval *this = getThis();
+ ze_zip_object *ze_obj = NULL;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &flags) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ if (this) {
+ /* We do not use ZIP_FROM_OBJECT, zip init function here */
+ ze_obj = (ze_zip_object*) zend_object_store_get_object(this TSRMLS_CC);
+ }
+
+ if (filename_len == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source");
+ RETURN_FALSE;
+ }
+
+ if (!expand_filepath(filename, resolved_path TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
+
+ if (ze_obj->za) {
+ /* we already have an opened zip, free it */
+ zip_close(ze_obj->za);
+ }
+ if (ze_obj->filename) {
+ efree(ze_obj->filename);
+ }
+ intern = zip_open(resolved_path, flags, &err);
+ if (!intern || err) {
+ RETURN_LONG((long)err);
+ }
+ ze_obj->filename = estrndup(resolved_path, strlen(resolved_path));
+ ze_obj->filename_len = filename_len;
+ ze_obj->za = intern;
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto resource close()
+close the zip archive */
+ZIPARCHIVE_METHOD(close)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ ze_zip_object *ze_obj;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ ze_obj = (ze_zip_object*) zend_object_store_get_object(this TSRMLS_CC);
+
+ if (zip_close(intern)) {
+ RETURN_FALSE;
+ }
+
+ efree(ze_obj->filename);
+ ze_obj->filename = NULL;
+ ze_obj->filename_len = 0;
+ ze_obj->za = NULL;
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto bool addFile(string filepath[, string entryname[, int start [, int length]]])
+Add a file in a Zip archive using its path and the name to use. */
+ZIPARCHIVE_METHOD(addFile)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ char *filename;
+ int filename_len;
+ char *entry_name = NULL;
+ int entry_name_len = 0;
+ struct zip_source *zs;
+ long offset_start = 0, offset_len = 0;
+ int cur_idx;
+ char resolved_path[MAXPATHLEN + 1];
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sll",
+ &filename, &filename_len, &entry_name, &entry_name_len, &offset_start, &offset_len) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ if (filename_len == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as filename");
+ RETURN_FALSE;
+ }
+
+ if (entry_name_len == 0) {
+ entry_name = filename;
+ entry_name_len = filename_len;
+ }
+
+ if (SAFEMODE_CHECKFILE(filename)) {
+ RETURN_FALSE;
+ }
+
+ if (!expand_filepath(filename, resolved_path TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
+
+ zs = zip_source_file(intern, resolved_path, 0, 0);
+ if (!zs) {
+ RETURN_FALSE;
+ }
+
+ cur_idx = zip_name_locate(intern, (const char *)entry_name, 0);
+ /* TODO: fix _zip_replace */
+ if (cur_idx<0) {
+ /* reset the error */
+ if (intern->error.str) {
+ _zip_error_fini(&intern->error);
+ }
+ _zip_error_init(&intern->error);
+
+ } else {
+ if (zip_delete(intern, cur_idx) == -1) {
+ RETURN_FALSE;
+ }
+ }
+
+ if (zip_add(intern, entry_name, zs) == -1) {
+ RETURN_FALSE;
+ } else {
+ RETURN_TRUE;
+ }
+}
+/* }}} */
+
+/* {{{ proto resource addFromString(string name, string content)
+Add a file using content and the entry name */
+ZIPARCHIVE_METHOD(addFromString)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ char *buffer, *name;
+ int buffer_len, name_len;
+ ze_zip_object *ze_obj;
+ struct zip_source *zs;
+ int pos = 0;
+ int cur_idx;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ &name, &name_len, &buffer, &buffer_len) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ ze_obj = (ze_zip_object*) zend_object_store_get_object(this TSRMLS_CC);
+ if (ze_obj->buffers_cnt) {
+ ze_obj->buffers = (char **)erealloc(ze_obj->buffers, sizeof(char *) * (ze_obj->buffers_cnt+1));
+ pos = ze_obj->buffers_cnt++;
+ } else {
+ ze_obj->buffers = (char **)emalloc(sizeof(char *));
+ ze_obj->buffers_cnt++;
+ pos = 0;
+ }
+ ze_obj->buffers[pos] = (char *)emalloc(buffer_len);
+ memcpy(ze_obj->buffers[pos], buffer, buffer_len);
+
+ zs = zip_source_buffer(intern, ze_obj->buffers[pos], buffer_len, 0);
+
+ if (zs == NULL) {
+ RETURN_FALSE;
+ }
+
+ cur_idx = zip_name_locate(intern, (const char *)name, 0);
+ /* TODO: fix _zip_replace */
+ if (cur_idx<0) {
+ /* reset the error */
+ if (intern->error.str) {
+ _zip_error_fini(&intern->error);
+ }
+ _zip_error_init(&intern->error);
+
+ } else {
+ if (zip_delete(intern, cur_idx) == -1) {
+ RETURN_FALSE;
+ }
+ }
+
+ if (zip_add(intern, name, zs) == -1) {
+ RETURN_FALSE;
+ } else {
+ RETURN_TRUE;
+ }
+}
+/* }}} */
+
+/* {{{ proto resource statName(string filename[, int flags])
+Returns the information about a the zip entry filename */
+ZIPARCHIVE_METHOD(statName)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ char *name;
+ int name_len;
+ long flags = 0;
+ struct zip_stat sb;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ &name, &name_len, &flags) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ PHP_ZIP_STAT_PATH(intern, name, name_len, flags, sb);
+
+ RETURN_SB(&sb);
+}
+/* }}} */
+
+/* {{{ proto resource statIndex(int index[, int flags])
+Returns the zip entry informations using its index */
+ZIPARCHIVE_METHOD(statIndex)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ long index, flags = 0;
+
+ struct zip_stat sb;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
+ &index, &flags) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ if (zip_stat_index(intern, index, flags, &sb) != 0) {
+ RETURN_FALSE;
+ }
+ RETURN_SB(&sb);
+}
+/* }}} */
+
+/* {{{ proto resource locateName(string filename[, int flags])
+Returns the index of the entry named filename in the archive */
+ZIPARCHIVE_METHOD(locateName)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ char *name;
+ int name_len;
+ long flags = 0;
+ long idx = -1;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ &name, &name_len, &flags) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+ if (name_len<1) {
+ RETURN_FALSE;
+ }
+
+ idx = (long)zip_name_locate(intern, (const char *)name, flags);
+
+ if (idx<0) {
+ /* reset the error */
+ if (intern->error.str) {
+ _zip_error_fini(&intern->error);
+ }
+ _zip_error_init(&intern->error);
+ RETURN_FALSE;
+ } else {
+ RETURN_LONG(idx);
+ }
+}
+/* }}} */
+
+/* {{{ proto resource getNameIndex(int index [, int flags])
+Returns the name of the file at position index */
+ZIPARCHIVE_METHOD(getNameIndex)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ const char *name;
+ long flags = 0, index = 0;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
+ &index, &flags) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ name = zip_get_name(intern, (int) index, flags);
+
+ if (name) {
+ RETVAL_STRING((char *)name, 1);
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto resource setArchiveComment(string name, string comment)
+Set or remove (NULL/'') the comment of the archive */
+ZIPARCHIVE_METHOD(setArchiveComment)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ int comment_len;
+ char * comment;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &comment, &comment_len) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+ if (zip_set_archive_comment(intern, (const char *)comment, (int)comment_len)) {
+ RETURN_FALSE;
+ } else {
+ RETURN_TRUE;
+ }
+}
+/* }}} */
+
+/* {{{ proto resource getArchiveComment()
+Returns the comment of an entry using its index */
+ZIPARCHIVE_METHOD(getArchiveComment)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ long flags = 0;
+ const char * comment;
+ int comment_len = 0;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ comment = zip_get_archive_comment(intern, &comment_len, (int)flags);
+ RETURN_STRINGL((char *)comment, comment_len, 1);
+}
+/* }}} */
+
+/* {{{ proto resource setCommentName(string name, string comment)
+Set or remove (NULL/'') the comment of an entry using its Name */
+ZIPARCHIVE_METHOD(setCommentName)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ int comment_len, name_len;
+ char * comment, *name;
+ struct zip_stat sb;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ &name, &name_len, &comment, &comment_len) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+
+ PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb);
+ PHP_ZIP_SET_FILE_COMMENT(intern, sb.index, comment, comment_len);
+}
+/* }}} */
+
+/* {{{ proto resource setCommentIndex(int index, string comment)
+Set or remove (NULL/'') the comment of an entry using its index */
+ZIPARCHIVE_METHOD(setCommentIndex)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ long index;
+ int comment_len;
+ char * comment;
+ struct zip_stat sb;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls",
+ &index, &comment, &comment_len) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ PHP_ZIP_STAT_INDEX(intern, index, 0, sb);
+ PHP_ZIP_SET_FILE_COMMENT(intern, index, comment, comment_len);
+}
+/* }}} */
+
+/* {{{ proto resource getCommentName(string name)
+Returns the comment of an entry using its name */
+ZIPARCHIVE_METHOD(getCommentName)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ int name_len;
+ long flags = 0;
+ int comment_len = 0;
+ const char * comment;
+ char *name;
+ struct zip_stat sb;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ &name, &name_len, &flags) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb);
+ comment = zip_get_file_comment(intern, sb.index, &comment_len, (int)flags);
+ RETURN_STRINGL((char *)comment, comment_len, 1);
+}
+/* }}} */
+
+/* {{{ proto resource getCommentIndex(int index)
+Returns the comment of an entry using its index */
+ZIPARCHIVE_METHOD(getCommentIndex)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ long index, flags = 0;
+ const char * comment;
+ int comment_len = 0;
+ struct zip_stat sb;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
+ &index, &flags) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ PHP_ZIP_STAT_INDEX(intern, index, 0, sb);
+ comment = zip_get_file_comment(intern, index, &comment_len, (int)flags);
+ RETURN_STRINGL((char *)comment, comment_len, 1);
+}
+/* }}} */
+
+/* {{{ proto resource deleteIndex(int index)
+Delete a file using its index */
+ZIPARCHIVE_METHOD(deleteIndex)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ long index;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ if (index < 0) {
+ RETURN_FALSE;
+ }
+
+ if (zip_delete(intern, index) < 0) {
+ RETURN_FALSE;
+ }
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto resource deleteName(string name)
+Delete a file using its index */
+ZIPARCHIVE_METHOD(deleteName)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ int name_len;
+ char *name;
+ struct zip_stat sb;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+ if (name_len < 1) {
+ RETURN_FALSE;
+ }
+
+ PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb);
+ if (zip_delete(intern, sb.index)) {
+ RETURN_FALSE;
+ }
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto resource renameIndex(int index, string new_name)
+Rename an entry selected by its index to new_name */
+ZIPARCHIVE_METHOD(renameIndex)
+{
+ struct zip *intern;
+ zval *this = getThis();
+
+ char *new_name;
+ int new_name_len;
+ long index;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &index, &new_name, &new_name_len) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ if (index < 0) {
+ RETURN_FALSE;
+ }
+
+ if (new_name_len < 1) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as new entry name");
+ RETURN_FALSE;
+ }
+ if (zip_rename(intern, index, (const char *)new_name) != 0) {
+ RETURN_FALSE;
+ }
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto resource renameName(string name, string new_name)
+Rename an entry selected by its name to new_name */
+ZIPARCHIVE_METHOD(renameName)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ struct zip_stat sb;
+ char *name, *new_name;
+ int name_len, new_name_len;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &new_name, &new_name_len) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ if (new_name_len < 1) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as new entry name");
+ RETURN_FALSE;
+ }
+
+ PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb);
+
+ if (zip_rename(intern, sb.index, (const char *)new_name)) {
+ RETURN_FALSE;
+ }
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto resource unchangeIndex(int index)
+Changes to the file at position index are reverted */
+ZIPARCHIVE_METHOD(unchangeIndex)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ long index;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ if (index < 0) {
+ RETURN_FALSE;
+ }
+
+ if (zip_unchange(intern, index) != 0) {
+ RETURN_FALSE;
+ } else {
+ RETURN_TRUE;
+ }
+}
+/* }}} */
+
+/* {{{ proto resource unchangeName(string name)
+Changes to the file named 'name' are reverted */
+ZIPARCHIVE_METHOD(unchangeName)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ struct zip_stat sb;
+ char *name;
+ int name_len;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ if (name_len < 1) {
+ RETURN_FALSE;
+ }
+
+ PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb);
+
+ if (zip_unchange(intern, sb.index) != 0) {
+ RETURN_FALSE;
+ } else {
+ RETURN_TRUE;
+ }
+}
+/* }}} */
+
+/* {{{ proto resource unchangeAll()
+All changes to files and global information in archive are reverted */
+ZIPARCHIVE_METHOD(unchangeAll)
+{
+ struct zip *intern;
+ zval *this = getThis();
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zip_unchange_all(intern) != 0) {
+ RETURN_FALSE;
+ } else {
+ RETURN_TRUE;
+ }
+}
+/* }}} */
+
+/* {{{ proto resource unchangeAll()
+Revert all global changes to the archive archive. For now, this only reverts archive comment changes. */
+ZIPARCHIVE_METHOD(unchangeArchive)
+{
+ struct zip *intern;
+ zval *this = getThis();
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zip_unchange_archive(intern) != 0) {
+ RETURN_FALSE;
+ } else {
+ RETURN_TRUE;
+ }
+}
+/* }}} */
+
+/* {{{ array resource extractTo(string pathto[, mixed files])
+Extract one or more file from a zip archive */
+/* TODO:
+ * - allow index or array of indeces
+ * - replace path
+ * - patterns
+ */
+ZIPARCHIVE_METHOD(extractTo)
+{
+ struct zip *intern;
+
+ zval *this = getThis();
+ zval *zval_files = NULL;
+ zval **zval_file = NULL;
+ php_stream_statbuf ssb;
+ char *pathto;
+ char *file;
+ int pathto_len;
+ int ret, i;
+
+ int nelems;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &pathto, &pathto_len, &zval_files) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ if (pathto_len<1) {
+ RETURN_FALSE;
+ }
+
+ if (php_stream_stat_path(pathto, &ssb) < 0) {
+ ret = php_stream_mkdir(pathto, 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL);
+ if (!ret) {
+ efree(pathto);
+ RETURN_FALSE;
+ }
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+ if (zval_files) {
+ switch (Z_TYPE_P(zval_files)) {
+ case IS_STRING:
+ file = Z_STRVAL_P(zval_files);
+ if (!php_zip_extract_file(intern, pathto, file TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
+ break;
+ case IS_ARRAY:
+ nelems = zend_hash_num_elements(Z_ARRVAL_P(zval_files));
+ if (nelems == 0 ) {
+ RETURN_FALSE;
+ }
+ for (i = 0; i < nelems; i++) {
+ if (zend_hash_index_find(Z_ARRVAL_P(zval_files), i, (void **) &zval_file) == SUCCESS) {
+ switch (Z_TYPE_PP(zval_file)) {
+ case IS_LONG:
+ break;
+ case IS_STRING:
+ file = Z_STRVAL_PP(zval_file);
+ if (!php_zip_extract_file(intern, pathto, file TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
+ break;
+ }
+ }
+ }
+ break;
+ case IS_LONG:
+ default:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument, expect string or array of strings");
+ break;
+ }
+ } else {
+ /* Extract all files */
+ int filecount = zip_get_num_files(intern);
+
+ if (filecount == -1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal archive");
+ RETURN_FALSE;
+ }
+
+ for (i = 0; i < filecount; i++) {
+ file = (char*)zip_get_name(intern, i, ZIP_FL_UNCHANGED);
+ if (!php_zip_extract_file(intern, pathto, file TSRMLS_CC)) {
+ RETURN_FALSE;
+ }
+ }
+ }
+
+ RETURN_TRUE;
+}
+/* }}} */
+
+static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
+{
+ struct zip *intern;
+ zval *this = getThis();
+
+ struct zip_stat sb;
+ struct zip_file *zf;
+
+ char *filename;
+ int filename_len;
+ long index = -1;
+ long flags = 0;
+ long len = 0;
+
+ char *buffer;
+ int n = 0;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (type == 1) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &filename, &filename_len, &len, &flags) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+ PHP_ZIP_STAT_PATH(intern, filename, filename_len, flags, sb);
+ } else {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ll", &index, &len, &flags) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+ PHP_ZIP_STAT_INDEX(intern, index, 0, sb);
+ }
+
+ if (sb.size < 1) {
+ RETURN_EMPTY_STRING();
+ }
+
+ if (len < 1) {
+ len = sb.size;
+ }
+ if (index >= 0) {
+ zf = zip_fopen_index(intern, index, flags);
+ } else {
+ zf = zip_fopen(intern, filename, flags);
+ }
+
+ if (zf == NULL) {
+ RETURN_FALSE;
+ }
+
+ buffer = safe_emalloc(len + 1, 1, 1);
+ n = zip_fread(zf, buffer, len);
+ if (n < 1) {
+ RETURN_EMPTY_STRING();
+ }
+
+ zip_fclose(zf);
+ buffer[n] = 0;
+ RETURN_STRINGL(buffer, n, 0);
+}
+/* }}} */
+
+/* {{{ proto resource getFromName(string entryname[, int len [, int flags]])
+get the contents of an entry using its name */
+ZIPARCHIVE_METHOD(getFromName)
+{
+ php_zip_get_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+}
+/* }}} */
+
+/* {{{ proto resource getFromIndex(string entryname[, int len [, int flags]])
+get the contents of an entry using its index */
+ZIPARCHIVE_METHOD(getFromIndex)
+{
+ php_zip_get_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+/* }}} */
+
+/* {{{ proto resource getStream(string entryname)
+get a stream for an entry using its name */
+ZIPARCHIVE_METHOD(getStream)
+{
+ struct zip *intern;
+ zval *this = getThis();
+ struct zip_stat sb;
+ char *filename;
+ int filename_len;
+ char *mode = "rb";
+ php_stream *stream;
+ ze_zip_object *obj;
+
+ if (!this) {
+ RETURN_FALSE;
+ }
+
+ ZIP_FROM_OBJECT(intern, this);
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ return;
+ }
+
+ if (zip_stat(intern, filename, 0, &sb)) {
+ RETURN_FALSE;
+ }
+
+ obj = (ze_zip_object*) zend_object_store_get_object(this TSRMLS_CC);
+
+ stream = php_stream_zip_open(obj->filename, filename, mode STREAMS_CC TSRMLS_CC);
+ if (stream) {
+ php_stream_to_zval(stream, return_value);
+ }
+}
+/* }}} */
+
+/* {{{ ze_zip_object_class_functions */
+static zend_function_entry zip_class_functions[] = {
+ ZIPARCHIVE_ME(open, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(close, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(addFromString, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(addFile, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(renameIndex, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(renameName, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(setArchiveComment, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(getArchiveComment, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(setCommentIndex, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(setCommentName, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(getCommentIndex, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(getCommentName, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(deleteIndex, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(deleteName, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(statName, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(statIndex, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(locateName, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(getNameIndex, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(unchangeArchive, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(unchangeAll, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(unchangeIndex, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(unchangeName, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(extractTo, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(getFromName, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(getFromIndex, NULL, ZEND_ACC_PUBLIC)
+ ZIPARCHIVE_ME(getStream, NULL, ZEND_ACC_PUBLIC)
+ {NULL, NULL, NULL}
+};
+/* }}} */
+#endif
+
+/* {{{ PHP_MINIT_FUNCTION */
+PHP_MINIT_FUNCTION(zip)
+{
+#ifdef ZEND_ENGINE_2_1
+ zend_class_entry ce;
+
+ memcpy(&zip_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ zip_object_handlers.clone_obj = NULL;
+ zip_object_handlers.get_property_ptr_ptr = php_zip_get_property_ptr_ptr;
+
+ zip_object_handlers.get_properties = php_zip_get_properties;
+ zip_object_handlers.read_property = php_zip_read_property;
+
+ INIT_CLASS_ENTRY(ce, "ZipArchive", zip_class_functions);
+ ce.create_object = php_zip_object_new;
+ zip_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+
+ zend_hash_init(&zip_prop_handlers, 0, NULL, NULL, 1);
+ php_zip_register_prop_handler(&zip_prop_handlers, "status", php_zip_status, NULL, NULL, IS_LONG TSRMLS_CC);
+ php_zip_register_prop_handler(&zip_prop_handlers, "statusSys", php_zip_status_sys, NULL, NULL, IS_LONG TSRMLS_CC);
+ php_zip_register_prop_handler(&zip_prop_handlers, "numFiles", php_zip_get_num_files, NULL, NULL, IS_LONG TSRMLS_CC);
+ php_zip_register_prop_handler(&zip_prop_handlers, "filename", NULL, NULL, php_zipobj_get_filename, IS_STRING TSRMLS_CC);
+ php_zip_register_prop_handler(&zip_prop_handlers, "comment", NULL, php_zipobj_get_zip_comment, NULL, IS_STRING TSRMLS_CC);
+
+ REGISTER_ZIP_CLASS_CONST_LONG("CREATE", ZIP_CREATE);
+ REGISTER_ZIP_CLASS_CONST_LONG("EXCL", ZIP_EXCL);
+ REGISTER_ZIP_CLASS_CONST_LONG("CHECKCONS", ZIP_CHECKCONS);
+ REGISTER_ZIP_CLASS_CONST_LONG("OVERWRITE", ZIP_OVERWRITE);
+
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_NOCASE", ZIP_FL_NOCASE);
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_NODIR", ZIP_FL_NODIR);
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_COMPRESSED", ZIP_FL_COMPRESSED);
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_UNCHANGED", ZIP_FL_UNCHANGED);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFAULT", ZIP_CM_DEFAULT);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_STORE", ZIP_CM_STORE);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_SHRINK", ZIP_CM_SHRINK);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_REDUCE_1", ZIP_CM_REDUCE_1);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_REDUCE_2", ZIP_CM_REDUCE_2);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_REDUCE_3", ZIP_CM_REDUCE_3);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_REDUCE_4", ZIP_CM_REDUCE_4);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_IMPLODE", ZIP_CM_IMPLODE);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFLATE", ZIP_CM_DEFLATE);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFLATE64", ZIP_CM_DEFLATE64);
+ REGISTER_ZIP_CLASS_CONST_LONG("CM_PKWARE_IMPLODE", ZIP_CM_PKWARE_IMPLODE);
+
+ /* Error code */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_OK", ZIP_ER_OK); /* N No error */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_MULTIDISK", ZIP_ER_MULTIDISK); /* N Multi-disk zip archives not supported */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_RENAME", ZIP_ER_RENAME); /* S Renaming temporary file failed */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_CLOSE", ZIP_ER_CLOSE); /* S Closing zip archive failed */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_SEEK", ZIP_ER_SEEK); /* S Seek error */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_READ", ZIP_ER_READ); /* S Read error */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_WRITE", ZIP_ER_WRITE); /* S Write error */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_CRC", ZIP_ER_CRC); /* N CRC error */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_ZIPCLOSED", ZIP_ER_ZIPCLOSED); /* N Containing zip archive was closed */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_NOENT", ZIP_ER_NOENT); /* N No such file */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_EXISTS", ZIP_ER_EXISTS); /* N File already exists */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_OPEN", ZIP_ER_OPEN); /* S Can't open file */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_TMPOPEN", ZIP_ER_TMPOPEN); /* S Failure to create temporary file */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_ZLIB", ZIP_ER_ZLIB); /* Z Zlib error */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_MEMORY", ZIP_ER_MEMORY); /* N Malloc failure */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_CHANGED", ZIP_ER_CHANGED); /* N Entry has been changed */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_COMPNOTSUPP", ZIP_ER_COMPNOTSUPP);/* N Compression method not supported */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_EOF", ZIP_ER_EOF); /* N Premature EOF */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_INVAL", ZIP_ER_INVAL); /* N Invalid argument */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_NOZIP", ZIP_ER_NOZIP); /* N Not a zip archive */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_INTERNAL", ZIP_ER_INTERNAL); /* N Internal error */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_INCONS", ZIP_ER_INCONS); /* N Zip archive inconsistent */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_REMOVE", ZIP_ER_REMOVE); /* S Can't remove file */
+ REGISTER_ZIP_CLASS_CONST_LONG("ER_DELETED", ZIP_ER_DELETED); /* N Entry has been deleted */
+
+ php_register_url_stream_wrapper("zip", &php_stream_zip_wrapper TSRMLS_CC);
+#endif
+
+ le_zip_dir = zend_register_list_destructors_ex(php_zip_free_dir, NULL, le_zip_dir_name, module_number);
+ le_zip_entry = zend_register_list_destructors_ex(php_zip_free_entry, NULL, le_zip_entry_name, module_number);
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
+PHP_MSHUTDOWN_FUNCTION(zip)
+{
+#ifdef ZEND_ENGINE_2_1
+ zend_hash_destroy(&zip_prop_handlers);
+ php_unregister_url_stream_wrapper("zip" TSRMLS_CC);
+#endif
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ PHP_MINFO_FUNCTION
+ */
+PHP_MINFO_FUNCTION(zip)
+{
+ php_info_print_table_start();
+
+ php_info_print_table_row(2, "Zip", "enabled");
+ php_info_print_table_row(2, "Extension Version","$Id: php_zip.c,v 1.1.2.15 2006/09/24 22:27:57 pajoye Exp $");
+ php_info_print_table_row(2, "Zip version", "2.0.0");
+ php_info_print_table_row(2, "Libzip version", "0.7.1");
+
+ 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/zip/php_zip.h b/ext/zip/php_zip.h
new file mode 100644
index 000000000..5bac110b4
--- /dev/null
+++ b/ext/zip/php_zip.h
@@ -0,0 +1,101 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2006 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | 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 <pajoye@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_zip.h,v 1.10 2006/07/24 16:58:58 pajoye Exp $ */
+
+#ifndef PHP_ZIP_H
+#define PHP_ZIP_H
+
+extern zend_module_entry zip_module_entry;
+#define phpext_zip_ptr &zip_module_entry
+
+#ifdef PHP_WIN32
+#define PHP_ZIP_API __declspec(dllexport)
+#else
+#define PHP_ZIP_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+#include "lib/zip.h"
+
+#ifndef ZEND_ENGINE_2_1
+# if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 0)
+# define ZEND_ENGINE_2_1
+# endif
+#endif
+
+typedef struct _ze_zip_rsrc {
+ struct zip *za;
+ int index_current;
+ int num_files;
+} zip_rsrc;
+
+typedef zip_rsrc * zip_rsrc_ptr;
+
+typedef struct _ze_zip_read_rsrc {
+ struct zip_file *zf;
+ struct zip_stat sb;
+} zip_read_rsrc;
+
+#ifdef ZEND_ENGINE_2_1
+#define ZIPARCHIVE_ME(name, arg_info, flags) ZEND_FENTRY(name, c_ziparchive_ ##name, arg_info, flags)
+#define ZIPARCHIVE_METHOD(name) ZEND_NAMED_FUNCTION(c_ziparchive_##name)
+
+/* Extends zend object */
+typedef struct _ze_zip_object {
+ zend_object zo;
+ struct zip *za;
+ int buffers_cnt;
+ char **buffers;
+ HashTable *prop_handler;
+ char *filename;
+ int filename_len;
+} ze_zip_object;
+
+zend_class_entry *zip_class_entry_ce;
+
+php_stream *php_stream_zip_opener(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_zip_open(char *filename, char *path, char *mode STREAMS_DC TSRMLS_DC);
+
+extern php_stream_wrapper php_stream_zip_wrapper;
+#endif
+
+PHP_FUNCTION(zip_open);
+PHP_FUNCTION(zip_read);
+PHP_FUNCTION(zip_close);
+PHP_FUNCTION(zip_entry_read);
+PHP_FUNCTION(zip_entry_filesize);
+PHP_FUNCTION(zip_entry_name);
+PHP_FUNCTION(zip_entry_compressedsize);
+PHP_FUNCTION(zip_entry_compressionmethod);
+PHP_FUNCTION(zip_entry_open);
+PHP_FUNCTION(zip_entry_close);
+
+#endif /* PHP_ZIP_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/zip/tests/001.phpt b/ext/zip/tests/001.phpt
new file mode 100644
index 000000000..37dccc055
--- /dev/null
+++ b/ext/zip/tests/001.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Check for zip presence
+--SKIPIF--
+<?php if (!extension_loaded("zip")) print "skip"; ?>
+--POST--
+--GET--
+--FILE--
+<?php
+echo "zip extension is available";
+?>
+--EXPECT--
+zip extension is available
diff --git a/ext/zip/tests/binarynull.zip b/ext/zip/tests/binarynull.zip
new file mode 100644
index 000000000..9da004efe
--- /dev/null
+++ b/ext/zip/tests/binarynull.zip
Binary files differ
diff --git a/ext/zip/tests/bug38943.phpt b/ext/zip/tests/bug38943.phpt
new file mode 100644
index 000000000..486c16950
--- /dev/null
+++ b/ext/zip/tests/bug38943.phpt
@@ -0,0 +1,50 @@
+--TEST--
+#38943, properties in extended class cannot be set
+--SKIPIF--
+<?php
+/* $Id: bug38943.phpt,v 1.1.2.2 2006/10/09 16:02:34 bjori Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+class myZip extends ZipArchive {
+ private $test = 0;
+ public $testp = 1;
+ private $testarray = array();
+
+ public function __construct() {
+ $this->testarray[] = 1;
+ var_dump($this->testarray);
+ }
+}
+
+$z = new myZip;
+$z->testp = "foobar";
+var_dump($z);
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ int(1)
+}
+object(myZip)#1 (%d) {
+ ["test:private"]=>
+ int(0)
+ ["testp"]=>
+ string(6) "foobar"
+ ["testarray:private"]=>
+ array(1) {
+ [0]=>
+ int(1)
+ }
+ ["status"]=>
+ int(0)
+ ["statusSys"]=>
+ int(0)
+ ["numFiles"]=>
+ int(0)
+ ["filename"]=>
+ string(0) ""
+ ["comment"]=>
+ string(0) ""
+}
diff --git a/ext/zip/tests/bug38944.phpt b/ext/zip/tests/bug38944.phpt
new file mode 100644
index 000000000..ee12fad2b
--- /dev/null
+++ b/ext/zip/tests/bug38944.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Bug #38944 (newly created ZipArchive segfaults when accessing comment property)
+--SKIPIF--
+<?php if (!extension_loaded("zip")) print "skip"; ?>
+--FILE--
+<?php
+
+$arc_name = dirname(__FILE__)."/bug38944.zip";
+$foo = new ZipArchive;
+$foo->open($arc_name, ZIPARCHIVE::CREATE);;
+
+var_dump($foo->status);
+var_dump($foo->statusSys);
+var_dump($foo->numFiles);
+var_dump($foo->filename);
+var_dump($foo->comment);
+
+var_dump($foo);
+
+echo "Done\n";
+?>
+--EXPECTF--
+int(0)
+int(0)
+int(0)
+string(0) ""
+string(0) ""
+object(ZipArchive)#%d (5) {
+ ["status"]=>
+ int(0)
+ ["statusSys"]=>
+ int(0)
+ ["numFiles"]=>
+ int(0)
+ ["filename"]=>
+ string(0) ""
+ ["comment"]=>
+ string(0) ""
+}
+Done
diff --git a/ext/zip/tests/bug7214.phpt b/ext/zip/tests/bug7214.phpt
new file mode 100644
index 000000000..6f728f5aa
--- /dev/null
+++ b/ext/zip/tests/bug7214.phpt
@@ -0,0 +1,23 @@
+--TEST--
+bug #7214, zip_entry_read() binary safe
+--SKIPIF--
+<?php
+/* $Id: bug7214.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+ ?>
+--FILE--
+<?php
+$zip = zip_open(dirname(__FILE__)."/binarynull.zip");
+if (!is_resource($zip)) die("Failure");
+$entries = 0;
+$entry = zip_read($zip);
+$contents = zip_entry_read($entry, zip_entry_filesize($entry));
+if (strlen($contents) == zip_entry_filesize($entry)) {
+ echo "Ok";
+} else {
+ echo "failed";
+}
+
+?>
+--EXPECT--
+Ok \ No newline at end of file
diff --git a/ext/zip/tests/bug7658.odt b/ext/zip/tests/bug7658.odt
new file mode 100644
index 000000000..527e09fef
--- /dev/null
+++ b/ext/zip/tests/bug7658.odt
Binary files differ
diff --git a/ext/zip/tests/bug7658.phpt b/ext/zip/tests/bug7658.phpt
new file mode 100644
index 000000000..1c9fb37ee
--- /dev/null
+++ b/ext/zip/tests/bug7658.phpt
@@ -0,0 +1,60 @@
+--TEST--
+bug #7658, modify archive with general bit flag 3 set
+--SKIPIF--
+<?php
+/* $Id: bug7658.phpt,v 1.1.2.1 2006/10/02 14:31:04 tony2001 Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$dirname = dirname(__FILE__) . '/';
+include $dirname . 'utils.inc';
+$file = $dirname . '__tmp_bug7658.odt';
+$zip = new ZipArchive();
+copy($dirname . 'bug7658.odt', $file);
+if(!$zip->open($file)) {
+ echo 'failed';
+}
+
+dump_entries_name($zip);
+
+$zip->deleteName('content.xml');
+$zip->addFile($dirname . "bug7658.xml","content.xml");
+$zip->close();
+echo "\n";
+$zip->open($file);
+dump_entries_name($zip);
+@unlink($file);
+?>
+--EXPECT--
+0 mimetype
+1 Configurations2/statusbar/
+2 Configurations2/accelerator/current.xml
+3 Configurations2/floater/
+4 Configurations2/popupmenu/
+5 Configurations2/progressbar/
+6 Configurations2/menubar/
+7 Configurations2/toolbar/
+8 Configurations2/images/Bitmaps/
+9 content.xml
+10 styles.xml
+11 meta.xml
+12 Thumbnails/thumbnail.png
+13 settings.xml
+14 META-INF/manifest.xml
+
+0 mimetype
+1 Configurations2/statusbar/
+2 Configurations2/accelerator/current.xml
+3 Configurations2/floater/
+4 Configurations2/popupmenu/
+5 Configurations2/progressbar/
+6 Configurations2/menubar/
+7 Configurations2/toolbar/
+8 Configurations2/images/Bitmaps/
+9 styles.xml
+10 meta.xml
+11 Thumbnails/thumbnail.png
+12 settings.xml
+13 META-INF/manifest.xml
+14 content.xml
diff --git a/ext/zip/tests/bug7658.xml b/ext/zip/tests/bug7658.xml
new file mode 100644
index 000000000..98076f198
--- /dev/null
+++ b/ext/zip/tests/bug7658.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.0"><office:scripts/><office:font-face-decls><style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/><style:font-face style:name="Arial Unicode MS" svg:font-family="&apos;Arial Unicode MS&apos;" style:font-pitch="variable"/><style:font-face style:name="Estrangelo Edessa" svg:font-family="&apos;Estrangelo Edessa&apos;" style:font-pitch="variable"/><style:font-face style:name="MS Mincho" svg:font-family="&apos;MS Mincho&apos;" style:font-pitch="variable"/><style:font-face style:name="Miriam CLM" svg:font-family="&apos;Miriam CLM&apos;" style:font-pitch="variable"/><style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-pitch="variable"/><style:font-face style:name="Times New Roman" svg:font-family="&apos;Times New Roman&apos;" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/></office:font-face-decls><office:automatic-styles><style:style style:name="Tabella1" style:family="table"><style:table-properties style:width="6.6924in" table:align="margins"/></style:style><style:style style:name="Tabella1.A" style:family="table-column"><style:table-column-properties style:column-width="4.8556in" style:rel-column-width="47546*"/></style:style><style:style style:name="Tabella1.B" style:family="table-column"><style:table-column-properties style:column-width="1.8368in" style:rel-column-width="17989*"/></style:style><style:style style:name="Tabella1.A1" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.0007in solid #000000" fo:border-right="none" fo:border-top="0.0007in solid #000000" fo:border-bottom="0.0007in solid #000000"/></style:style><style:style style:name="Tabella1.B1" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border="0.0007in solid #000000"/></style:style><style:style style:name="Tabella1.A2" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.0007in solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.0007in solid #000000"/></style:style><style:style style:name="Tabella1.B2" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.0007in solid #000000" fo:border-right="0.0007in solid #000000" fo:border-top="none" fo:border-bottom="0.0007in solid #000000"/></style:style><style:style style:name="Tabella2" style:family="table"><style:table-properties style:width="6.6924in" table:align="margins"/></style:style><style:style style:name="Tabella2.A" style:family="table-column"><style:table-column-properties style:column-width="2.584in" style:rel-column-width="25303*"/></style:style><style:style style:name="Tabella2.C" style:family="table-column"><style:table-column-properties style:column-width="1.5243in" style:rel-column-width="14929*"/></style:style><style:style style:name="Tabella2.A1" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.0007in solid #000000" fo:border-right="none" fo:border-top="0.0007in solid #000000" fo:border-bottom="0.0007in solid #000000"/></style:style><style:style style:name="Tabella2.C1" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border="0.0007in solid #000000"/></style:style><style:style style:name="Tabella2.A2" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.0007in solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.0007in solid #000000"/></style:style><style:style style:name="Tabella2.C2" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.0007in solid #000000" fo:border-right="0.0007in solid #000000" fo:border-top="none" fo:border-bottom="0.0007in solid #000000"/></style:style><style:style style:name="P1" style:family="paragraph" style:parent-style-name="Table_20_Heading"><style:text-properties style:font-name="Estrangelo Edessa" fo:font-style="italic" fo:font-weight="bold" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-style-complex="italic" style:font-weight-complex="bold"/></style:style><style:style style:name="P2" style:family="paragraph" style:parent-style-name="Table_20_Heading"><style:paragraph-properties fo:padding="0.0193in" fo:border="0.0008in solid #000000" style:shadow="none"/><style:text-properties style:font-name="Estrangelo Edessa" fo:font-style="italic" fo:font-weight="bold" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-style-complex="italic" style:font-weight-complex="bold"/></style:style><style:style style:name="P3" style:family="paragraph" style:parent-style-name="Table_20_Contents"><style:text-properties fo:color="#ff0000" style:font-name="Miriam CLM" fo:font-style="italic" fo:font-weight="bold" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-style-complex="italic" style:font-weight-complex="bold"/></style:style></office:automatic-styles><office:body><office:text><office:forms form:automatic-focus="false" form:apply-design-mode="false"/><text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls><text:p text:style-name="Standard"/><text:p text:style-name="Standard"/><text:p text:style-name="Standard">Other text Silvio Berlusconi, le ricordo che ha in prestito i seguenti libri</text:p><text:p text:style-name="Standard"/><table:table table:name="Tabella1" table:style-name="Tabella1"><table:table-column table:style-name="Tabella1.A"/><table:table-column table:style-name="Tabella1.B"/><table:table-header-rows><table:table-row><table:table-cell table:style-name="Tabella1.A1" office:value-type="string"><text:p text:style-name="P1">Titolo</text:p></table:table-cell><table:table-cell table:style-name="Tabella1.B1" office:value-type="string"><text:p text:style-name="P1">Inventario</text:p></table:table-cell></table:table-row></table:table-header-rows><table:table-row><table:table-cell table:style-name="Tabella1.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">Codice Da Vinci</text:p></table:table-cell><table:table-cell table:style-name="Tabella1.B2" office:value-type="string"><text:p text:style-name="Table_20_Contents">112345678</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella1.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">Lo Zen e il tiro con l&apos;arco</text:p></table:table-cell><table:table-cell table:style-name="Tabella1.B2" office:value-type="string"><text:p text:style-name="Table_20_Contents">1020304</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella1.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">Lo Zen e l&apos;arte della manutenzione della motocicletta</text:p></table:table-cell><table:table-cell table:style-name="Tabella1.B2" office:value-type="string"><text:p text:style-name="Table_20_Contents">1020305</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella1.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">101 Storie Zen</text:p></table:table-cell><table:table-cell table:style-name="Tabella1.B2" office:value-type="string"><text:p text:style-name="Table_20_Contents">1020306</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella1.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">Antani di Blinda come fosse di Cappotto</text:p></table:table-cell><table:table-cell table:style-name="Tabella1.B2" office:value-type="string"><text:p text:style-name="Table_20_Contents">4112345</text:p></table:table-cell></table:table-row></table:table><text:p text:style-name="Standard"/><text:p text:style-name="Standard">peraltro, sottolineiamo la perentorietà della restituzione anche dei vieppiù interessanti testi:</text:p><text:p text:style-name="Standard"/><table:table table:name="Tabella2" table:style-name="Tabella2"><table:table-column table:style-name="Tabella2.A" table:number-columns-repeated="2"/><table:table-column table:style-name="Tabella2.C"/><table:table-header-rows><table:table-row><table:table-cell table:style-name="Tabella2.A1" office:value-type="string"><text:p text:style-name="P2">Titolo</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.A1" office:value-type="string"><text:p text:style-name="P2">Autore</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.C1" office:value-type="string"><text:p text:style-name="P2">Inventario</text:p></table:table-cell></table:table-row></table:table-header-rows><table:table-row><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">Angeli e Demoni</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="P3">Dan Brown</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.C2" office:value-type="string"><text:p text:style-name="Table_20_Contents">12131415</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">La versione di Barney</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="P3">Mordecai Richler</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.C2" office:value-type="string"><text:p text:style-name="Table_20_Contents">2010322</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">Manuale PHP</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="P3">Varii</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.C2" office:value-type="string"><text:p text:style-name="Table_20_Contents">32413543</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">La prematurata supercazzola negli anni a venire</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="P3">Ugo Tognazzi</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.C2" office:value-type="string"><text:p text:style-name="Table_20_Contents">31213243</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="Table_20_Contents">La sbiriguda in vicesindaco</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.A2" office:value-type="string"><text:p text:style-name="P3">Ugo Tognazzi</text:p></table:table-cell><table:table-cell table:style-name="Tabella2.C2" office:value-type="string"><text:p text:style-name="Table_20_Contents">1324354654</text:p></table:table-cell></table:table-row></table:table><text:p text:style-name="Standard"/><text:p text:style-name="Standard"/><text:p text:style-name="Standard">Gentili saluti, la sua biblioteca</text:p></office:text></office:body></office:document-content>
diff --git a/ext/zip/tests/bug8009.phpt b/ext/zip/tests/bug8009.phpt
new file mode 100644
index 000000000..dd396ebb9
--- /dev/null
+++ b/ext/zip/tests/bug8009.phpt
@@ -0,0 +1,27 @@
+--TEST--
+bug #8009, cannot add again same entry to an archive
+--SKIPIF--
+<?php
+/* $Id: bug8009.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$thisdir = dirname(__FILE__);
+$src = $thisdir . "/bug8009.zip";
+$filename = $thisdir . "/tmp8009.zip";
+copy($src, $filename);
+
+$zip = new ZipArchive();
+
+if (!$zip->open($filename)) {
+ exit("cannot open $filename\n");
+}
+$zip->addFromString("2.txt", "=)");
+$zip->close();
+unlink($filename);
+echo "status: " . $zip->status . "\n";
+echo "\n";
+
+--EXPECT--
+status: 0
diff --git a/ext/zip/tests/bug8009.zip b/ext/zip/tests/bug8009.zip
new file mode 100644
index 000000000..45bedcbe8
--- /dev/null
+++ b/ext/zip/tests/bug8009.zip
Binary files differ
diff --git a/ext/zip/tests/bug8700.phpt b/ext/zip/tests/bug8700.phpt
new file mode 100644
index 000000000..2749404ce
--- /dev/null
+++ b/ext/zip/tests/bug8700.phpt
@@ -0,0 +1,30 @@
+--TEST--
+bug #8700, getFromIndex(0) fails
+--SKIPIF--
+<?php
+/* $Id: bug8700.phpt,v 1.1.2.2 2006/09/15 12:12:25 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$thisdir = dirname(__FILE__);
+$filename = $thisdir . "/bug8009.zip";
+
+$zip = new ZipArchive();
+
+if ($zip->open($filename) === FALSE) {
+ exit("cannot open $filename\n");
+}
+$contents_from_idx = $zip->getFromIndex(0);
+$contents_from_name = $zip->getFromName('1.txt');
+if ($contents_from_idx != $contents_from_name) {
+ echo "failed:";
+ var_dump($content_from_idx, $content_from_name);
+}
+
+$zip->close();
+echo "status: " . $zip->status . "\n";
+echo "\n";
+
+--EXPECT--
+status: 0
diff --git a/ext/zip/tests/oo_addfile.phpt b/ext/zip/tests/oo_addfile.phpt
new file mode 100644
index 000000000..aee615416
--- /dev/null
+++ b/ext/zip/tests/oo_addfile.phpt
@@ -0,0 +1,37 @@
+--TEST--
+ziparchive::addFile() function
+--SKIPIF--
+<?php
+/* $Id: oo_addfile.phpt,v 1.1.2.1 2006/10/02 14:31:04 tony2001 Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+
+$dirname = dirname(__FILE__) . '/';
+include $dirname . 'utils.inc';
+$file = $dirname . '__tmp_oo_addfile.zip';
+
+copy($dirname . 'test.zip', $file);
+
+$zip = new ZipArchive;
+if (!$zip->open($file)) {
+ exit('failed');
+}
+if (!$zip->addFile($dirname . 'utils.inc', 'test.php')) {
+ echo "failed\n";
+}
+if ($zip->status == ZIPARCHIVE::ER_OK) {
+ dump_entries_name($zip);
+ $zip->close();
+} else {
+ echo "failed\n";
+}
+@unlink($file);
+?>
+--EXPECTF--
+0 bar
+1 foobar/
+2 foobar/baz
+3 entry1.txt
+4 test.php
diff --git a/ext/zip/tests/oo_close.phpt b/ext/zip/tests/oo_close.phpt
new file mode 100644
index 000000000..42b755610
--- /dev/null
+++ b/ext/zip/tests/oo_close.phpt
@@ -0,0 +1,25 @@
+--TEST--
+zip::close() function
+--SKIPIF--
+<?php
+/* $Id: oo_close.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+
+$dirname = dirname(__FILE__) . '/';
+$zip = new ZipArchive;
+if (!$zip->open($dirname . 'test.zip')) {
+ exit('failed');
+}
+
+if ($zip->status == ZIPARCHIVE::ER_OK) {
+ $zip->close();
+ echo "ok\n";
+} else {
+ echo "failed\n";
+}
+?>
+--EXPECTF--
+ok
diff --git a/ext/zip/tests/oo_delete.phpt b/ext/zip/tests/oo_delete.phpt
new file mode 100644
index 000000000..902fad244
--- /dev/null
+++ b/ext/zip/tests/oo_delete.phpt
@@ -0,0 +1,76 @@
+--TEST--
+Delete entries
+--SKIPIF--
+<?php
+/* $Id: oo_delete.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$dirname = dirname(__FILE__) . '/';
+$file = $dirname . '__tmp_oo_delete.zip';
+if (file_exists($file)) {
+ unlink($file);
+}
+
+$zip = new ZipArchive;
+if (!$zip->open($file, ZIPARCHIVE::CREATE)) {
+ exit('failed');
+}
+$zip->addFromString('entry1.txt', 'entry #1');
+$zip->addFromString('entry2.txt', 'entry #2');
+$zip->addFromString('dir/entry2.txt', 'entry #2');
+
+if ($zip->status == ZIPARCHIVE::ER_OK) {
+ $zip->close();
+ echo "ok\n";
+} else {
+ var_dump($zip);
+ echo "failed\n";
+}
+
+if (!$zip->open($file, ZIPARCHIVE::CREATE)) {
+ exit('failed');
+}
+
+if ($zip->deleteIndex(0)) {
+ echo "ok\n";
+}
+
+if ($zip->deleteName('entry2.txt')) {
+ echo "ok\n";
+} else {
+ echo "failed 3\n";
+}
+
+if ($zip->deleteName('dir/entry2.txt')) {
+ echo "ok\n";
+} else {
+ echo "failed 3\n";
+}
+
+if (!$zip->deleteIndex(123)) {
+ echo "ok\n";
+} else {
+ print_r($zip);
+ echo "failed\n";
+}
+
+
+$sb = $zip->statIndex(0);
+var_dump($sb);
+$sb = $zip->statIndex(1);
+var_dump($sb);
+$sb = $zip->statIndex(2);
+var_dump($sb);
+@unlink($file);
+?>
+--EXPECTF--
+ok
+ok
+ok
+ok
+ok
+bool(false)
+bool(false)
+bool(false)
diff --git a/ext/zip/tests/oo_ext_zip.phpt b/ext/zip/tests/oo_ext_zip.phpt
new file mode 100644
index 000000000..e911ce8f3
--- /dev/null
+++ b/ext/zip/tests/oo_ext_zip.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Extending Zip class and array property
+--SKIPIF--
+<?php
+/* $Id: oo_ext_zip.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+class myZip extends ZipArchive {
+ private $test = 0;
+ public $testp = 1;
+ private $testarray = array();
+
+ public function __construct() {
+ $this->testarray[] = 1;
+ var_dump($this->testarray);
+ }
+}
+
+$z = new myZip;
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ int(1)
+}
diff --git a/ext/zip/tests/oo_namelocate.phpt b/ext/zip/tests/oo_namelocate.phpt
new file mode 100644
index 000000000..72ac6318a
--- /dev/null
+++ b/ext/zip/tests/oo_namelocate.phpt
@@ -0,0 +1,46 @@
+--TEST--
+Locate entries by name
+--SKIPIF--
+<?php
+/* $Id: oo_namelocate.phpt,v 1.1.2.2 2006/10/02 14:31:04 tony2001 Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$dirname = dirname(__FILE__) . '/';
+include $dirname . 'utils.inc';
+$file = $dirname . '__tmp_oo_rename.zip';
+
+@unlink($file);
+
+$zip = new ZipArchive;
+if (!$zip->open($file, ZIPARCHIVE::CREATE)) {
+ exit('failed');
+}
+
+$zip->addFromString('entry1.txt', 'entry #1');
+$zip->addFromString('entry2.txt', 'entry #2');
+$zip->addFromString('dir/entry2d.txt', 'entry #2');
+
+if (!$zip->status == ZIPARCHIVE::ER_OK) {
+ echo "failed to write zip\n";
+}
+$zip->close();
+
+if (!$zip->open($file)) {
+ exit('failed');
+}
+
+
+var_dump($zip->locateName('entry1.txt'));
+var_dump($zip->locateName('eNtry2.txt'));
+var_dump($zip->locateName('eNtry2.txt', ZIPARCHIVE::FL_NOCASE));
+var_dump($zip->locateName('enTRy2d.txt', ZIPARCHIVE::FL_NOCASE|ZIPARCHIVE::FL_NODIR));
+$zip->close();
+
+?>
+--EXPECTF--
+int(0)
+bool(false)
+int(1)
+int(2)
diff --git a/ext/zip/tests/oo_open.phpt b/ext/zip/tests/oo_open.phpt
new file mode 100644
index 000000000..9934016fa
--- /dev/null
+++ b/ext/zip/tests/oo_open.phpt
@@ -0,0 +1,46 @@
+--TEST--
+zip::open() function
+--SKIPIF--
+<?php
+/* $Id: oo_open.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+
+$dirname = dirname(__FILE__) . '/';
+$zip = new ZipArchive;
+$r = $zip->open($dirname . 'nofile');
+if ($r !== TRUE) {
+ echo "ER_OPEN: ok\n";
+} else {
+ echo "ER_OPEN: FAILED\n";
+}
+
+$r = $zip->open($dirname . 'nofile', ZIPARCHIVE::CREATE);
+if (!$r) {
+ echo "create: failed\n";
+} else {
+ echo "create: ok\n";
+}
+@unlink($dirname . 'nofile');
+
+$zip = new ZipArchive;
+$zip->open('');
+
+if (!$zip->open($dirname . 'test.zip')) {
+ exit("failed 1\n");
+}
+
+if ($zip->status == ZIPARCHIVE::ER_OK) {
+ echo "OK\n";
+} else {
+ echo "failed\n";
+}
+?>
+--EXPECTF--
+ER_OPEN: ok
+create: ok
+
+Warning: ZipArchive::open(): Empty string as source in %s on line %d
+OK
diff --git a/ext/zip/tests/oo_rename.phpt b/ext/zip/tests/oo_rename.phpt
new file mode 100644
index 000000000..ac44146fc
--- /dev/null
+++ b/ext/zip/tests/oo_rename.phpt
@@ -0,0 +1,58 @@
+--TEST--
+Rename entries
+--SKIPIF--
+<?php
+/* $Id: oo_rename.phpt,v 1.1.2.1 2006/10/02 14:31:04 tony2001 Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$dirname = dirname(__FILE__) . '/';
+include $dirname . 'utils.inc';
+$file = $dirname . '__tmp_oo_rename.zip';
+
+@unlink($file);
+
+$zip = new ZipArchive;
+if (!$zip->open($file, ZIPARCHIVE::CREATE)) {
+ exit('failed');
+}
+
+$zip->addFromString('entry1.txt', 'entry #1');
+$zip->addFromString('entry2.txt', 'entry #2');
+$zip->addFromString('dir/entry2.txt', 'entry #2');
+
+if (!$zip->status == ZIPARCHIVE::ER_OK) {
+ var_dump($zip);
+ echo "failed\n";
+}
+
+$zip->close();
+
+if (!$zip->open($file)) {
+ exit('failed');
+}
+
+dump_entries_name($zip);
+echo "\n";
+
+if (!$zip->renameIndex(0, 'ren_entry1.txt')) {
+ echo "failed index 0\n";
+}
+
+if (!$zip->renameName('dir/entry2.txt', 'dir3/ren_entry2.txt')) {
+ echo "failed name dir/entry2.txt\n";
+}
+dump_entries_name($zip);
+$zip->close();
+
+@unlink($file);
+?>
+--EXPECTF--
+0 entry1.txt
+1 entry2.txt
+2 dir/entry2.txt
+
+0 ren_entry1.txt
+1 entry2.txt
+2 dir3/ren_entry2.txt
diff --git a/ext/zip/tests/test.zip b/ext/zip/tests/test.zip
new file mode 100644
index 000000000..35bd5eecd
--- /dev/null
+++ b/ext/zip/tests/test.zip
Binary files differ
diff --git a/ext/zip/tests/test_procedural.zip b/ext/zip/tests/test_procedural.zip
new file mode 100644
index 000000000..6b9869480
--- /dev/null
+++ b/ext/zip/tests/test_procedural.zip
Binary files differ
diff --git a/ext/zip/tests/utils.inc b/ext/zip/tests/utils.inc
new file mode 100644
index 000000000..7a8b5a122
--- /dev/null
+++ b/ext/zip/tests/utils.inc
@@ -0,0 +1,8 @@
+<?php
+/* $Id: utils.inc,v 1.1.2.2 2006/10/02 14:17:47 bjori Exp $ */
+function dump_entries_name($z) {
+ for($i=0; $i<$z->numFiles; $i++) {
+ $sb = $z->statIndex($i);
+ echo $i . ' ' . $sb['name'] . "\n";
+ }
+}
diff --git a/ext/zip/tests/zip_close.phpt b/ext/zip/tests/zip_close.phpt
new file mode 100644
index 000000000..d7259b3da
--- /dev/null
+++ b/ext/zip/tests/zip_close.phpt
@@ -0,0 +1,17 @@
+--TEST--
+zip_close() function
+--SKIPIF--
+<?php
+/* $Id: zip_close.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+if (!is_resource($zip)) die("Failure");
+zip_close($zip);
+echo "OK";
+
+?>
+--EXPECT--
+OK
diff --git a/ext/zip/tests/zip_entry_compressedsize.phpt b/ext/zip/tests/zip_entry_compressedsize.phpt
new file mode 100644
index 000000000..5e0fd9c45
--- /dev/null
+++ b/ext/zip/tests/zip_entry_compressedsize.phpt
@@ -0,0 +1,23 @@
+--TEST--
+zip_entry_compressedsize() function
+--SKIPIF--
+<?php
+/* $Id: zip_entry_compressedsize.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+if (!is_resource($zip)) die("Failure");
+$entries = 0;
+while ($entry = zip_read($zip)) {
+ echo zip_entry_compressedsize($entry)."\n";
+}
+zip_close($zip);
+
+?>
+--EXPECT--
+5
+4
+0
+24
diff --git a/ext/zip/tests/zip_entry_compressionmethod.phpt b/ext/zip/tests/zip_entry_compressionmethod.phpt
new file mode 100644
index 000000000..d505a633b
--- /dev/null
+++ b/ext/zip/tests/zip_entry_compressionmethod.phpt
@@ -0,0 +1,24 @@
+--TEST--
+zip_entry_compressionmethod() function
+--SKIPIF--
+<?php
+/* $Id: zip_entry_compressionmethod.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+if (!is_resource($zip)) die("Failure");
+$entries = 0;
+while ($entry = zip_read($zip)) {
+ echo zip_entry_compressionmethod($entry)."\n";
+}
+zip_close($zip);
+
+?>
+--EXPECT--
+stored
+stored
+stored
+deflated
+
diff --git a/ext/zip/tests/zip_entry_filesize.phpt b/ext/zip/tests/zip_entry_filesize.phpt
new file mode 100644
index 000000000..d87506271
--- /dev/null
+++ b/ext/zip/tests/zip_entry_filesize.phpt
@@ -0,0 +1,23 @@
+--TEST--
+zip_entry_filesize() function
+--SKIPIF--
+<?php
+/* $Id: zip_entry_filesize.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+if (!is_resource($zip)) die("Failure");
+$entries = 0;
+while ($entry = zip_read($zip)) {
+ echo zip_entry_filesize($entry)."\n";
+}
+zip_close($zip);
+
+?>
+--EXPECT--
+5
+4
+0
+27
diff --git a/ext/zip/tests/zip_entry_name.phpt b/ext/zip/tests/zip_entry_name.phpt
new file mode 100644
index 000000000..b47c89fdb
--- /dev/null
+++ b/ext/zip/tests/zip_entry_name.phpt
@@ -0,0 +1,23 @@
+--TEST--
+zip_entry_name() function
+--SKIPIF--
+<?php
+/* $Id: zip_entry_name.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+if (!is_resource($zip)) die("Failure");
+$entries = 0;
+while ($entry = zip_read($zip)) {
+ echo zip_entry_name($entry)."\n";
+}
+zip_close($zip);
+
+?>
+--EXPECT--
+foo
+bar
+foobar/
+foobar/baz
diff --git a/ext/zip/tests/zip_entry_open.phpt b/ext/zip/tests/zip_entry_open.phpt
new file mode 100644
index 000000000..4e0100357
--- /dev/null
+++ b/ext/zip/tests/zip_entry_open.phpt
@@ -0,0 +1,17 @@
+--TEST--
+zip_entry_open() function
+--SKIPIF--
+<?php
+/* $Id: zip_entry_open.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+$entry = zip_read($zip);
+echo zip_entry_open($zip, $entry, "r") ? "OK" : "Failure";
+zip_close($zip);
+
+?>
+--EXPECT--
+OK
diff --git a/ext/zip/tests/zip_entry_read.phpt b/ext/zip/tests/zip_entry_read.phpt
new file mode 100644
index 000000000..f72b5e2cb
--- /dev/null
+++ b/ext/zip/tests/zip_entry_read.phpt
@@ -0,0 +1,18 @@
+--TEST--
+zip_entry_read() function
+--SKIPIF--
+<?php
+/* $Id: zip_entry_read.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+$entry = zip_read($zip);
+if (!zip_entry_open($zip, $entry, "r")) die("Failure");
+echo zip_entry_read($entry);
+zip_close($zip);
+
+?>
+--EXPECT--
+foo
diff --git a/ext/zip/tests/zip_open.phpt b/ext/zip/tests/zip_open.phpt
new file mode 100644
index 000000000..6306543bc
--- /dev/null
+++ b/ext/zip/tests/zip_open.phpt
@@ -0,0 +1,16 @@
+--TEST--
+zip_open() function
+--SKIPIF--
+<?php
+/* $Id: zip_open.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+
+echo is_resource($zip) ? "OK" : "Failure";
+
+?>
+--EXPECT--
+OK
diff --git a/ext/zip/tests/zip_read.phpt b/ext/zip/tests/zip_read.phpt
new file mode 100644
index 000000000..126fc8bda
--- /dev/null
+++ b/ext/zip/tests/zip_read.phpt
@@ -0,0 +1,21 @@
+--TEST--
+zip_read() function
+--SKIPIF--
+<?php
+/* $Id: zip_read.phpt,v 1.1 2006/07/24 16:58:58 pajoye Exp $ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$zip = zip_open(dirname(__FILE__)."/test_procedural.zip");
+if (!is_resource($zip)) die("Failure");
+$entries = 0;
+while ($entry = zip_read($zip)) {
+ $entries++;
+}
+zip_close($zip);
+echo "$entries entries";
+
+?>
+--EXPECT--
+4 entries
diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c
new file mode 100644
index 000000000..60f43595e
--- /dev/null
+++ b/ext/zip/zip_stream.c
@@ -0,0 +1,235 @@
+/* $Id: zip_stream.c,v 1.1.2.1 2006/07/27 00:36:55 iliaa Exp $ */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "php.h"
+#if HAVE_ZIP
+#ifdef ZEND_ENGINE_2
+
+#include "lib/zip.h"
+
+#include "php_streams.h"
+#include "ext/standard/file.h"
+#include "ext/standard/php_string.h"
+#include "fopen_wrappers.h"
+
+#include "ext/standard/url.h"
+
+struct php_zip_stream_data_t {
+ struct zip *za;
+ struct zip_file *zf;
+ size_t cursor;
+ php_stream *stream;
+};
+
+#define STREAM_DATA_FROM_STREAM() \
+ struct php_zip_stream_data_t *self = (struct php_zip_stream_data_t *) stream->abstract;
+
+
+/* {{{ php_zip_ops_read */
+static size_t php_zip_ops_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+{
+ int n = 0;
+ STREAM_DATA_FROM_STREAM();
+
+ if (self->za && self->zf) {
+ n = (size_t)zip_fread(self->zf, buf, (int)count);
+
+ if (n == 0) {
+ stream->eof = 1;
+ } else {
+ self->cursor += n;
+ }
+ }
+ return n<1 ? 0 : n;
+}
+/* }}} */
+
+/* {{{ php_zip_ops_write */
+static size_t php_zip_ops_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+{
+ if (!stream) {
+ return 0;
+ }
+
+ return count;
+}
+/* }}} */
+
+/* {{{ php_zip_ops_close */
+static int php_zip_ops_close(php_stream *stream, int close_handle TSRMLS_DC)
+{
+ STREAM_DATA_FROM_STREAM();
+ if (close_handle && self->za) {
+ zip_close(self->za);
+ self->za = NULL;
+ }
+ efree(self);
+ stream->abstract = NULL;
+ return EOF;
+}
+/* }}} */
+
+/* {{{ php_zip_ops_flush */
+static int php_zip_ops_flush(php_stream *stream TSRMLS_DC)
+{
+ if (!stream) {
+ return 0;
+ }
+
+ return 0;
+}
+/* }}} */
+
+php_stream_ops php_stream_zipio_ops = {
+ php_zip_ops_write, php_zip_ops_read,
+ php_zip_ops_close, php_zip_ops_flush,
+ "zip",
+ NULL, /* seek */
+ NULL, /* cast */
+ NULL, /* stat */
+ NULL /* set_option */
+};
+
+/* {{{ php_stream_zip_open */
+php_stream *php_stream_zip_open(char *filename, char *path, char *mode STREAMS_DC TSRMLS_DC)
+{
+ struct zip_file *zf = NULL;
+ int err = 0;
+
+ php_stream *stream = NULL;
+ struct php_zip_stream_data_t *self;
+ struct zip *stream_za;
+
+ if (strncmp(mode,"r", strlen("r")) != 0) {
+ return NULL;
+ }
+
+ if (filename) {
+ /* duplicate to make the stream za independent (esp. for MSHUTDOWN) */
+ stream_za = zip_open(filename, ZIP_CREATE, &err);
+ if (!stream_za) {
+ return NULL;
+ }
+
+ zf = zip_fopen(stream_za, path, 0);
+ if (zf) {
+ self = emalloc(sizeof(*self));
+
+ self->za = stream_za;
+ self->zf = zf;
+ self->stream = NULL;
+ self->cursor = 0;
+ stream = php_stream_alloc(&php_stream_zipio_ops, self, NULL, mode);
+ } else {
+ zip_close(stream_za);
+ }
+ }
+
+ if (!stream) {
+ return NULL;
+ } else {
+ return stream;
+ }
+
+}
+/* }}} */
+
+/* {{{ php_stream_zip_opener */
+php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper,
+ char *path,
+ char *mode,
+ int options,
+ char **opened_path,
+ php_stream_context *context STREAMS_DC TSRMLS_DC)
+{
+ int path_len;
+
+ char *file_basename;
+ size_t file_basename_len;
+ char file_dirname[MAXPATHLEN+1];
+
+ struct zip *za;
+ struct zip_file *zf = NULL;
+ char *fragment;
+ int fragment_len;
+ int err;
+
+ php_stream *stream = NULL;
+ struct php_zip_stream_data_t *self;
+
+ fragment = strchr(path, '#');
+ if (!fragment) {
+ return NULL;
+ }
+
+ if (strncasecmp("zip://", path, 6) == 0) {
+ path += 6;
+ }
+
+ fragment_len = strlen(fragment);
+
+ if (fragment_len < 1) {
+ return NULL;
+ }
+ path_len = strlen(path);
+
+ memcpy(file_dirname, path, path_len - fragment_len);
+ file_dirname[path_len - fragment_len] = '\0';
+
+ php_basename(path, path_len - fragment_len, NULL, 0, &file_basename, &file_basename_len TSRMLS_CC);
+ fragment++;
+ if (mode[0] != 'r') {
+ return NULL;
+ }
+
+ za = zip_open(file_dirname, ZIP_CREATE, &err);
+ if (za) {
+ zf = zip_fopen(za, fragment, 0);
+ if (zf) {
+ self = emalloc(sizeof(*self));
+
+ self->za = za;
+ self->zf = zf;
+ self->stream = NULL;
+ self->cursor = 0;
+ stream = php_stream_alloc(&php_stream_zipio_ops, self, NULL, mode);
+
+ if (opened_path) {
+ *opened_path = estrdup(path);
+ }
+ } else {
+ zip_close(za);
+ }
+ }
+
+ efree(file_basename);
+
+ if (!stream) {
+ return NULL;
+ } else {
+ return stream;
+ }
+}
+/* }}} */
+
+static php_stream_wrapper_ops zip_stream_wops = {
+ php_stream_zip_opener,
+ NULL, /* close */
+ NULL, /* fstat */
+ NULL, /* stat */
+ NULL, /* opendir */
+ "zip wrapper",
+ NULL, /* unlink */
+ NULL, /* rename */
+ NULL, /* mkdir */
+ NULL /* rmdir */
+};
+
+php_stream_wrapper php_stream_zip_wrapper = {
+ &zip_stream_wops,
+ NULL,
+ 0 /* is_url */
+};
+#endif /* ZEND_ENGINE_2 */
+#endif /* HAVE_ZIP */
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index 2cd11fc1e..dc0bc727d 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_zlib.h,v 1.42.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: php_zlib.h,v 1.42.2.1.2.1 2006/08/14 20:08:18 nlopess Exp $ */
#ifndef PHP_ZLIB_H
#define PHP_ZLIB_H
@@ -39,26 +39,9 @@ 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
diff --git a/ext/zlib/tests/004.phpt b/ext/zlib/tests/004.phpt
new file mode 100644
index 000000000..a758b8c7b
--- /dev/null
+++ b/ext/zlib/tests/004.phpt
@@ -0,0 +1,89 @@
+--TEST--
+gzfile() with various invalid params
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gzfile());
+var_dump(gzfile("nonexistent_file_gzfile",1));
+var_dump(gzfile(1,1,1));
+
+var_dump(gzfile(dirname(__FILE__)."/004.txt.gz"));
+var_dump(gzfile(dirname(__FILE__)."/004.txt.gz", 1));
+
+ini_set("magic_quotes_runtime", 1);
+var_dump(gzfile(dirname(__FILE__)."/004.txt.gz", -1));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: gzfile() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: gzfile(nonexistent_file_gzfile): failed to open stream: No such file or directory in %s on line %d
+bool(false)
+
+Warning: gzfile() expects at most 2 parameters, 3 given in %s on line %d
+NULL
+array(6) {
+ [0]=>
+ string(36) "When you're taught through feelings
+"
+ [1]=>
+ string(26) "Destiny flying high above
+"
+ [2]=>
+ string(38) "all I know is that you can realize it
+"
+ [3]=>
+ string(18) "Destiny who cares
+"
+ [4]=>
+ string(19) "as it turns around
+"
+ [5]=>
+ string(39) "and I know that it descends down on me
+"
+}
+array(6) {
+ [0]=>
+ string(36) "When you're taught through feelings
+"
+ [1]=>
+ string(26) "Destiny flying high above
+"
+ [2]=>
+ string(38) "all I know is that you can realize it
+"
+ [3]=>
+ string(18) "Destiny who cares
+"
+ [4]=>
+ string(19) "as it turns around
+"
+ [5]=>
+ string(39) "and I know that it descends down on me
+"
+}
+array(6) {
+ [0]=>
+ string(37) "When you\'re taught through feelings
+"
+ [1]=>
+ string(26) "Destiny flying high above
+"
+ [2]=>
+ string(38) "all I know is that you can realize it
+"
+ [3]=>
+ string(18) "Destiny who cares
+"
+ [4]=>
+ string(19) "as it turns around
+"
+ [5]=>
+ string(39) "and I know that it descends down on me
+"
+}
+Done
diff --git a/ext/zlib/tests/004.txt.gz b/ext/zlib/tests/004.txt.gz
new file mode 100644
index 000000000..07805db75
--- /dev/null
+++ b/ext/zlib/tests/004.txt.gz
Binary files differ
diff --git a/ext/zlib/tests/005.phpt b/ext/zlib/tests/005.phpt
new file mode 100644
index 000000000..79834b2d3
--- /dev/null
+++ b/ext/zlib/tests/005.phpt
@@ -0,0 +1,72 @@
+--TEST--
+gzcompress()/gzuncompress() and invalid params
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gzcompress());
+var_dump(gzcompress("", 1000));
+var_dump(gzcompress("", -1));
+
+var_dump(gzcompress(""));
+var_dump(gzcompress("", 9));
+
+$string = "Answer me, it can't be so hard
+Cry to relieve what's in your heart
+Desolation, grief and agony";
+
+var_dump($data1 = gzcompress($string));
+var_dump($data2 = gzcompress($string, 9));
+
+var_dump(gzuncompress());
+var_dump(gzuncompress("", 1000));
+var_dump(gzuncompress("", -1));
+
+var_dump(gzuncompress(""));
+var_dump(gzuncompress("", 9));
+
+var_dump(gzuncompress($data1));
+var_dump(gzuncompress($data2));
+$data2{4} = 0;
+var_dump(gzuncompress($data2));
+
+echo "Done\n";
+?>
+--EXPECTF--
+
+Warning: gzcompress() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: gzcompress(): compression level (1000) must be within -1..9 in %s on line %d
+bool(false)
+string(%d) "%s"
+string(%d) "%s"
+string(%d) "%s"
+string(%d) "%s"
+string(%d) "%s"
+
+Warning: gzuncompress() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: gzuncompress(): %s error in %s on line %d
+bool(false)
+
+Warning: gzuncompress(): length (-1) must be greater or equal zero in %s on line %d
+bool(false)
+
+Warning: gzuncompress(): %s error in %s on line %d
+bool(false)
+
+Warning: gzuncompress(): %s error in %s on line %d
+bool(false)
+string(94) "Answer me, it can't be so hard
+Cry to relieve what's in your heart
+Desolation, grief and agony"
+string(94) "Answer me, it can't be so hard
+Cry to relieve what's in your heart
+Desolation, grief and agony"
+
+Warning: gzuncompress(): %s error in %s on line %d
+bool(false)
+Done
diff --git a/ext/zlib/tests/006.phpt b/ext/zlib/tests/006.phpt
new file mode 100644
index 000000000..1ddb56378
--- /dev/null
+++ b/ext/zlib/tests/006.phpt
@@ -0,0 +1,73 @@
+--TEST--
+gzdeflate()/gzinflate() and invalid params
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gzdeflate());
+var_dump(gzdeflate("", 1000));
+var_dump(gzdeflate("", -1));
+
+var_dump(gzdeflate(""));
+var_dump(gzdeflate("", 9));
+
+$string = "Answer me, it can't be so hard
+Cry to relieve what's in your heart
+Desolation, grief and agony";
+
+var_dump($data1 = gzdeflate($string));
+var_dump($data2 = gzdeflate($string, 9));
+
+var_dump(gzinflate());
+var_dump(gzinflate(""));
+var_dump(gzinflate("asfwe", 1000));
+var_dump(gzinflate("asdf", -1));
+
+var_dump(gzinflate("asdf"));
+var_dump(gzinflate("asdf", 9));
+
+var_dump(gzinflate($data1));
+var_dump(gzinflate($data2));
+$data2{4} = 0;
+var_dump(gzinflate($data2));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: gzdeflate() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: gzdeflate(): compression level (1000) must be within -1..9 in %s on line %d
+bool(false)
+string(%d) "%s"
+string(%d) "%s"
+string(%d) "%s"
+string(%d) "%s"
+string(%d) "%s"
+
+Warning: gzinflate() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+bool(false)
+
+Warning: gzinflate(): data error in %s on line %d
+bool(false)
+
+Warning: gzinflate(): length (-1) must be greater or equal zero in %s on line %d
+bool(false)
+
+Warning: gzinflate(): data error in %s on line %d
+bool(false)
+
+Warning: gzinflate(): data error in %s on line %d
+bool(false)
+string(94) "Answer me, it can't be so hard
+Cry to relieve what's in your heart
+Desolation, grief and agony"
+string(94) "Answer me, it can't be so hard
+Cry to relieve what's in your heart
+Desolation, grief and agony"
+
+Warning: gzinflate(): data error in %s on line %d
+bool(false)
+Done
diff --git a/ext/zlib/tests/007.phpt b/ext/zlib/tests/007.phpt
new file mode 100644
index 000000000..ec37b99de
--- /dev/null
+++ b/ext/zlib/tests/007.phpt
@@ -0,0 +1,51 @@
+--TEST--
+gzencode() and invalid params
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gzencode());
+var_dump(gzencode(1,1,1,1));
+var_dump(gzencode("", -10));
+var_dump(gzencode("", 100));
+var_dump(gzencode("", 1, 100));
+
+var_dump(gzencode("", -1, 1));
+var_dump(gzencode("", 9, 2));
+
+$string = "Light of my sun
+Light in this temple
+Light in my truth
+Lies in the darkness";
+
+var_dump(gzencode($string, 9, 3));
+
+var_dump(gzencode($string, -1, 1));
+var_dump(gzencode($string, 9, 2));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: gzencode() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: gzencode() expects at most 3 parameters, 4 given in %s on line %d
+NULL
+
+Warning: gzencode(): compression level(-10) must be within -1..9 in %s on line %d
+bool(false)
+
+Warning: gzencode(): compression level(100) must be within -1..9 in %s on line %d
+bool(false)
+
+Warning: gzencode(): encoding mode must be FORCE_GZIP or FORCE_DEFLATE in %s on line %d
+bool(false)
+string(%d) "%s"
+string(%d) "%s"
+
+Warning: gzencode(): encoding mode must be FORCE_GZIP or FORCE_DEFLATE in %s on line %d
+bool(false)
+string(%d) "%s"
+string(%d) "%s"
+Done
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index ffd6b0ed6..46918a0f8 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zlib.c,v 1.183.2.6 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: zlib.c,v 1.183.2.6.2.4 2006/08/14 20:08:18 nlopess Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -82,11 +82,28 @@
#define GZIP_FOOTER_LENGTH 8
/* True globals, no need for thread safety */
-static int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
+static const int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
+
+static int php_enable_output_compression(int buffer_size TSRMLS_DC);
+
+static PHP_MINIT_FUNCTION(zlib);
+static PHP_MSHUTDOWN_FUNCTION(zlib);
+static PHP_RINIT_FUNCTION(zlib);
+static PHP_MINFO_FUNCTION(zlib);
+static PHP_FUNCTION(gzopen);
+static PHP_FUNCTION(readgzfile);
+static PHP_FUNCTION(gzfile);
+static PHP_FUNCTION(gzcompress);
+static PHP_FUNCTION(gzuncompress);
+static PHP_FUNCTION(gzdeflate);
+static PHP_FUNCTION(gzinflate);
+static PHP_FUNCTION(gzencode);
+static PHP_FUNCTION(ob_gzhandler);
+static PHP_FUNCTION(zlib_get_coding_type);
/* {{{ php_zlib_functions[]
*/
-zend_function_entry php_zlib_functions[] = {
+static zend_function_entry php_zlib_functions[] = {
PHP_FE(readgzfile, NULL)
PHP_FALIAS(gzrewind, rewind, NULL)
PHP_FALIAS(gzclose, fclose, NULL)
@@ -113,6 +130,8 @@ zend_function_entry php_zlib_functions[] = {
};
/* }}} */
+ZEND_DECLARE_MODULE_GLOBALS(zlib)
+
/* {{{ php_zlib_module_entry
*/
zend_module_entry php_zlib_module_entry = {
@@ -125,12 +144,14 @@ zend_module_entry php_zlib_module_entry = {
NULL,
PHP_MINFO(zlib),
"1.1",
- STANDARD_MODULE_PROPERTIES
+ PHP_MODULE_GLOBALS(zlib),
+ NULL,
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
-ZEND_DECLARE_MODULE_GLOBALS(zlib)
-
#ifdef COMPILE_DL_ZLIB
ZEND_GET_MODULE(php_zlib)
#endif
@@ -199,22 +220,10 @@ PHP_INI_BEGIN()
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)
+static 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);
@@ -229,7 +238,7 @@ PHP_MINIT_FUNCTION(zlib)
/* {{{ PHP_RINIT_FUNCTION
*/
-PHP_RINIT_FUNCTION(zlib)
+static PHP_RINIT_FUNCTION(zlib)
{
uint chunk_size = ZLIBG(output_compression);
@@ -248,7 +257,7 @@ PHP_RINIT_FUNCTION(zlib)
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
-PHP_MSHUTDOWN_FUNCTION(zlib)
+static PHP_MSHUTDOWN_FUNCTION(zlib)
{
php_unregister_url_stream_wrapper("zlib" TSRMLS_CC);
php_stream_filter_unregister_factory("zlib.*" TSRMLS_CC);
@@ -261,7 +270,7 @@ PHP_MSHUTDOWN_FUNCTION(zlib)
/* {{{ PHP_MINFO_FUNCTION
*/
-PHP_MINFO_FUNCTION(zlib)
+static PHP_MINFO_FUNCTION(zlib)
{
php_info_print_table_start();
php_info_print_table_row(2, "ZLib Support", "enabled");
@@ -277,7 +286,7 @@ PHP_MINFO_FUNCTION(zlib)
/* {{{ proto array gzfile(string filename [, int use_include_path])
Read und uncompress entire .gz-file into an array */
-PHP_FUNCTION(gzfile)
+static PHP_FUNCTION(gzfile)
{
char *filename;
int filename_len;
@@ -322,7 +331,7 @@ PHP_FUNCTION(gzfile)
/* {{{ proto resource gzopen(string filename, string mode [, int use_include_path])
Open a .gz-file and return a .gz-file pointer */
-PHP_FUNCTION(gzopen)
+static PHP_FUNCTION(gzopen)
{
char *filename, *mode;
int filename_len, mode_len;
@@ -350,7 +359,7 @@ PHP_FUNCTION(gzopen)
*/
/* {{{ proto int readgzfile(string filename [, int use_include_path])
Output a .gz-file */
-PHP_FUNCTION(readgzfile)
+static PHP_FUNCTION(readgzfile)
{
char *filename;
int filename_len;
@@ -377,7 +386,7 @@ PHP_FUNCTION(readgzfile)
/* {{{ proto string gzcompress(string data [, int level])
Gzip-compress a string */
-PHP_FUNCTION(gzcompress)
+static PHP_FUNCTION(gzcompress)
{
int data_len, status;
long level = Z_DEFAULT_COMPRESSION;
@@ -419,7 +428,7 @@ PHP_FUNCTION(gzcompress)
/* {{{ proto string gzuncompress(string data [, int length])
Unzip a gzip-compressed string */
-PHP_FUNCTION(gzuncompress)
+static PHP_FUNCTION(gzuncompress)
{
int data_len, status;
unsigned int factor=1, maxfactor=16;
@@ -465,7 +474,7 @@ PHP_FUNCTION(gzuncompress)
/* {{{ proto string gzdeflate(string data [, int level])
Gzip-compress a string */
-PHP_FUNCTION(gzdeflate)
+static PHP_FUNCTION(gzdeflate)
{
int data_len,status;
long level = Z_DEFAULT_COMPRESSION;
@@ -526,7 +535,7 @@ PHP_FUNCTION(gzdeflate)
/* {{{ proto string gzinflate(string data [, int length])
Unzip a gzip-compressed string */
-PHP_FUNCTION(gzinflate)
+static PHP_FUNCTION(gzinflate)
{
int data_len, status;
unsigned int factor=1, maxfactor=16;
@@ -539,6 +548,10 @@ PHP_FUNCTION(gzinflate)
return;
}
+ if (!data_len) {
+ RETURN_FALSE;
+ }
+
if (limit < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%ld) must be greater or equal zero", limit);
RETURN_FALSE;
@@ -602,7 +615,7 @@ PHP_FUNCTION(gzinflate)
/* {{{ proto string zlib_get_coding_type(void)
Returns the coding type used for output compression */
-PHP_FUNCTION(zlib_get_coding_type)
+static PHP_FUNCTION(zlib_get_coding_type)
{
switch (ZLIBG(compression_coding)) {
case CODING_GZIP:
@@ -736,7 +749,7 @@ static int php_deflate_string(const char *str, uint str_length, char **newstr, u
/* {{{ proto string gzencode(string data [, int level [, int encoding_mode]])
GZ encode a string */
-PHP_FUNCTION(gzencode)
+static PHP_FUNCTION(gzencode)
{
char *data, *s2;
int data_len;
@@ -824,6 +837,8 @@ PHP_FUNCTION(gzencode)
trailer[6] = (char) (stream.total_in >> 16) & 0xFF;
trailer[7] = (char) (stream.total_in >> 24) & 0xFF;
trailer[8] = '\0';
+ } else {
+ s2[stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0)] = '\0';
}
RETURN_STRINGL(s2, stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0), 0);
} else {
@@ -864,7 +879,7 @@ int php_ob_gzhandler_check(TSRMLS_D)
/* {{{ 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)
+static PHP_FUNCTION(ob_gzhandler)
{
char *string;
int string_len;
@@ -965,7 +980,7 @@ static void php_gzip_output_handler(char *output, uint output_len, char **handle
/* {{{ php_enable_output_compression
*/
-int php_enable_output_compression(int buffer_size TSRMLS_DC)
+static int php_enable_output_compression(int buffer_size TSRMLS_DC)
{
zval **a_encoding;
diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c
index ef31ad22a..cd80babfb 100644
--- a/ext/zlib/zlib_filter.c
+++ b/ext/zlib/zlib_filter.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zlib_filter.c,v 1.6.2.2 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: zlib_filter.c,v 1.6.2.2.2.2 2006/10/16 15:39:39 iliaa Exp $ */
#include "php.h"
#include "php_zlib.h"
@@ -275,7 +275,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
/* 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));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes.", sizeof(php_zlib_filter_data));
return NULL;
}
@@ -287,14 +287,14 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd 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);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes.", data->outbuf_len);
pefree(data->inbuf, persistent);
pefree(data, persistent);
return NULL;
diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c
index ee61292c4..5d811679b 100644
--- a/ext/zlib/zlib_fopen_wrapper.c
+++ b/ext/zlib/zlib_fopen_wrapper.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zlib_fopen_wrapper.c,v 1.46.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: zlib_fopen_wrapper.c,v 1.46.2.1.2.1 2006/08/14 20:08:18 nlopess Exp $ */
#define _GNU_SOURCE
@@ -92,7 +92,7 @@ static int php_gziop_flush(php_stream *stream TSRMLS_DC)
return gzflush(self->gz_file, Z_SYNC_FLUSH);
}
-php_stream_ops php_stream_gzio_ops = {
+static php_stream_ops php_stream_gzio_ops = {
php_gziop_write, php_gziop_read,
php_gziop_close, php_gziop_flush,
"ZLIB",
diff --git a/generated_lists b/generated_lists
index f3d34ffc9..5b7c38ae9 100644
--- a/generated_lists
+++ b/generated_lists
@@ -1,3 +1,3 @@
makefile_am_files = Zend/Makefile.am TSRM/Makefile.am
config_h_files = Zend/acconfig.h TSRM/acconfig.h
-config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 Zend/acinclude.m4 ext/bcmath/config.m4 ext/bz2/config.m4 ext/calendar/config.m4 ext/ctype/config.m4 ext/curl/config.m4 ext/date/config.m4 ext/dba/config.m4 ext/dbase/config.m4 ext/dom/config.m4 ext/exif/config.m4 ext/fbsql/config.m4 ext/fdf/config.m4 ext/filepro/config.m4 ext/ftp/config.m4 ext/gd/config.m4 ext/gettext/config.m4 ext/gmp/config.m4 ext/hash/config.m4 ext/hwapi/config.m4 ext/iconv/config.m4 ext/imap/config.m4 ext/informix/config.m4 ext/interbase/config.m4 ext/ldap/config.m4 ext/libxml/config0.m4 ext/mbstring/config.m4 ext/mcrypt/config.m4 ext/mhash/config.m4 ext/mime_magic/config.m4 ext/ming/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/openssl/config0.m4 ext/pcntl/config.m4 ext/pcre/config0.m4 ext/pdo/config.m4 ext/pdo_dblib/config.m4 ext/pdo_firebird/config.m4 ext/pdo_mysql/config.m4 ext/pdo_oci/config.m4 ext/pdo_odbc/config.m4 ext/pdo_pgsql/config.m4 ext/pdo_sqlite/config.m4 ext/pgsql/config.m4 ext/posix/config.m4 ext/pspell/config.m4 ext/readline/config.m4 ext/recode/config.m4 ext/recode/config9.m4 ext/reflection/config.m4 ext/session/config.m4 ext/shmop/config.m4 ext/simplexml/config.m4 ext/snmp/config.m4 ext/soap/config.m4 ext/sockets/config.m4 ext/spl/config.m4 ext/sqlite/config.m4 ext/standard/config.m4 ext/sybase/config.m4 ext/sybase_ct/config.m4 ext/sysvmsg/config.m4 ext/sysvsem/config.m4 ext/sysvshm/config.m4 ext/tidy/config.m4 ext/tokenizer/config.m4 ext/wddx/config.m4 ext/xml/config.m4 ext/xmlreader/config.m4 ext/xmlrpc/config.m4 ext/xmlwriter/config.m4 ext/xsl/config.m4 ext/zlib/config0.m4 sapi/aolserver/config.m4 sapi/apache/config.m4 sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 sapi/apache_hooks/config.m4 sapi/caudium/config.m4 sapi/cli/config.m4 sapi/continuity/config.m4 sapi/embed/config.m4 sapi/isapi/config.m4 sapi/milter/config.m4 sapi/nsapi/config.m4 sapi/phttpd/config.m4 sapi/pi3web/config.m4 sapi/roxen/config.m4 sapi/thttpd/config.m4 sapi/tux/config.m4 sapi/webjames/config.m4
+config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 Zend/acinclude.m4 ext/bcmath/config.m4 ext/bz2/config.m4 ext/calendar/config.m4 ext/ctype/config.m4 ext/curl/config.m4 ext/date/config.m4 ext/dba/config.m4 ext/dbase/config.m4 ext/dom/config.m4 ext/exif/config.m4 ext/fbsql/config.m4 ext/fdf/config.m4 ext/filter/config.m4 ext/ftp/config.m4 ext/gd/config.m4 ext/gettext/config.m4 ext/gmp/config.m4 ext/hash/config.m4 ext/iconv/config.m4 ext/imap/config.m4 ext/informix/config.m4 ext/interbase/config.m4 ext/json/config.m4 ext/ldap/config.m4 ext/libxml/config0.m4 ext/mbstring/config.m4 ext/mcrypt/config.m4 ext/mhash/config.m4 ext/mime_magic/config.m4 ext/ming/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/openssl/config0.m4 ext/pcntl/config.m4 ext/pcre/config0.m4 ext/pdo/config.m4 ext/pdo_dblib/config.m4 ext/pdo_firebird/config.m4 ext/pdo_mysql/config.m4 ext/pdo_oci/config.m4 ext/pdo_odbc/config.m4 ext/pdo_pgsql/config.m4 ext/pdo_sqlite/config.m4 ext/pgsql/config.m4 ext/posix/config.m4 ext/pspell/config.m4 ext/readline/config.m4 ext/recode/config.m4 ext/recode/config9.m4 ext/reflection/config.m4 ext/session/config.m4 ext/shmop/config.m4 ext/simplexml/config.m4 ext/snmp/config.m4 ext/soap/config.m4 ext/sockets/config.m4 ext/spl/config.m4 ext/sqlite/config.m4 ext/standard/config.m4 ext/sybase/config.m4 ext/sybase_ct/config.m4 ext/sysvmsg/config.m4 ext/sysvsem/config.m4 ext/sysvshm/config.m4 ext/tidy/config.m4 ext/tokenizer/config.m4 ext/wddx/config.m4 ext/xml/config.m4 ext/xmlreader/config.m4 ext/xmlrpc/config.m4 ext/xmlwriter/config.m4 ext/xsl/config.m4 ext/zip/config.m4 ext/zlib/config0.m4 sapi/aolserver/config.m4 sapi/apache/config.m4 sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 sapi/apache_hooks/config.m4 sapi/caudium/config.m4 sapi/cli/config.m4 sapi/continuity/config.m4 sapi/embed/config.m4 sapi/isapi/config.m4 sapi/milter/config.m4 sapi/nsapi/config.m4 sapi/phttpd/config.m4 sapi/pi3web/config.m4 sapi/roxen/config.m4 sapi/thttpd/config.m4 sapi/tux/config.m4 sapi/webjames/config.m4
diff --git a/main/SAPI.c b/main/SAPI.c
index 6b2e93288..0dda75c65 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -18,13 +18,14 @@
+----------------------------------------------------------------------+
*/
-/* $Id: SAPI.c,v 1.202.2.7 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: SAPI.c,v 1.202.2.7.2.2 2006/09/19 20:33:11 dmitry Exp $ */
#include <ctype.h>
#include <sys/stat.h>
#include "php.h"
#include "SAPI.h"
+#include "php_variables.h"
#include "php_ini.h"
#include "ext/standard/php_string.h"
#include "ext/standard/pageinfo.h"
@@ -75,6 +76,7 @@ SAPI_API sapi_module_struct sapi_module;
SAPI_API void sapi_startup(sapi_module_struct *sf)
{
+ sf->ini_entries = NULL;
sapi_module = *sf;
#ifdef ZTS
@@ -914,11 +916,15 @@ SAPI_API struct stat *sapi_get_stat(TSRMLS_D)
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);
+ if (sapi_module.getenv) {
+ char *value, *tmp = sapi_module.getenv(name, name_len TSRMLS_CC);
+ if(tmp) value = estrdup(tmp);
+ else return NULL;
+ sapi_module.input_filter(PARSE_ENV, name, &value, strlen(value), NULL TSRMLS_CC);
+ return value;
} else {
- return NULL;
- }
+ return NULL;
+ }
}
SAPI_API int sapi_get_fd(int *fd TSRMLS_DC)
diff --git a/main/SAPI.h b/main/SAPI.h
index bb226b277..479376ad7 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: SAPI.h,v 1.114.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: SAPI.h,v 1.114.2.1.2.1 2006/09/19 20:33:11 dmitry Exp $ */
#ifndef SAPI_H
#define SAPI_H
@@ -257,6 +257,8 @@ struct _sapi_module_struct {
void (*ini_defaults)(HashTable *configuration_hash);
int phpinfo_as_text;
+
+ char *ini_entries;
};
diff --git a/main/config.w32.h b/main/config.w32.h
index f9e6d1f75..3998092c3 100644
--- a/main/config.w32.h
+++ b/main/config.w32.h
@@ -2,7 +2,7 @@
Build Configuration for Win32.
This has only been tested with MS VisualC++ 6 (and later).
- $Id: config.w32.h,v 1.85.4.2 2006/06/05 08:30:54 stas Exp $
+ $Id: config.w32.h,v 1.85.4.1.2.1 2006/06/05 09:00:15 stas Exp $
*/
/* Default PHP / PEAR directories */
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index e248fa1c7..6df4ada7e 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fopen_wrappers.c,v 1.175.2.3 2006/03/17 10:42:31 dmitry Exp $ */
+/* $Id: fopen_wrappers.c,v 1.175.2.3.2.1 2006/07/01 11:35:34 nlopess Exp $ */
/* {{{ includes
*/
@@ -189,7 +189,7 @@ PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)
/* {{{ php_check_safe_mode_include_dir
*/
-PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC)
+PHPAPI int php_check_safe_mode_include_dir(const char *path TSRMLS_DC)
{
if (PG(safe_mode)) {
if (PG(safe_mode_include_dir) && *PG(safe_mode_include_dir)) {
@@ -239,7 +239,7 @@ PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC)
/* {{{ php_fopen_and_set_opened_path
*/
-static FILE *php_fopen_and_set_opened_path(const char *path, char *mode, char **opened_path TSRMLS_DC)
+static FILE *php_fopen_and_set_opened_path(const char *path, const char *mode, char **opened_path TSRMLS_DC)
{
FILE *fp;
@@ -356,7 +356,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC)
* 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)
+PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC)
{
char *pathbuf, *ptr, *end;
char *exec_fname;
diff --git a/main/fopen_wrappers.h b/main/fopen_wrappers.h
index 4e5a0ac4c..1aaba481f 100644
--- a/main/fopen_wrappers.h
+++ b/main/fopen_wrappers.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fopen_wrappers.h,v 1.44.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: fopen_wrappers.h,v 1.44.2.1.2.1 2006/07/01 11:35:34 nlopess Exp $ */
#ifndef FOPEN_WRAPPERS_H
#define FOPEN_WRAPPERS_H
@@ -31,9 +31,9 @@ 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 int php_check_safe_mode_include_dir(const char *path TSRMLS_DC);
-PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC);
+PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC);
PHPAPI int php_is_url(char *path);
PHPAPI char *php_strip_url_passwd(char *path);
diff --git a/main/internal_functions.c.in b/main/internal_functions.c.in
index bb3cc3359..4d55ccb9b 100644
--- a/main/internal_functions.c.in
+++ b/main/internal_functions.c.in
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: internal_functions.c.in,v 1.30.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: internal_functions.c.in,v 1.30.2.1.2.1 2006/08/12 19:33:54 nlopess Exp $ */
#include "php.h"
#include "php_main.h"
@@ -29,7 +29,7 @@
@EXT_INCLUDE_CODE@
-zend_module_entry *php_builtin_extensions[] = {
+static zend_module_entry *php_builtin_extensions[] = {
@EXT_MODULE_PTRS@
};
diff --git a/main/internal_functions_nw.c b/main/internal_functions_nw.c
index da8f54abe..d4756f382 100644
--- a/main/internal_functions_nw.c
+++ b/main/internal_functions_nw.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: internal_functions_nw.c,v 1.9.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: internal_functions_nw.c,v 1.9.2.1.2.1 2006/08/12 19:33:54 nlopess Exp $ */
/* {{{ includes
*/
@@ -62,7 +62,7 @@
/* {{{ php_builtin_extensions[]
*/
-zend_module_entry *php_builtin_extensions[] = {
+static zend_module_entry *php_builtin_extensions[] = {
phpext_standard_ptr,
#if HAVE_BCMATH
phpext_bcmath_ptr,
diff --git a/main/internal_functions_win32.c b/main/internal_functions_win32.c
index 496fe288e..b5e867810 100644
--- a/main/internal_functions_win32.c
+++ b/main/internal_functions_win32.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: internal_functions_win32.c,v 1.87.2.3 2006/06/05 08:45:50 stas Exp $ */
+/* $Id: internal_functions_win32.c,v 1.87.2.1.2.2 2006/08/12 19:33:54 nlopess Exp $ */
/* {{{ includes
*/
@@ -118,7 +118,7 @@
/* {{{ php_builtin_extensions[]
*/
-zend_module_entry *php_builtin_extensions[] = {
+static zend_module_entry *php_builtin_extensions[] = {
phpext_standard_ptr
#if HAVE_BCMATH
,phpext_bcmath_ptr
diff --git a/main/logos.h b/main/logos.h
index 782f9cb1a..2ff6701b7 100644
--- a/main/logos.h
+++ b/main/logos.h
@@ -16,11 +16,11 @@
+----------------------------------------------------------------------+
*/
-/* $Id: logos.h,v 1.14.2.3 2006/04/02 17:58:17 iliaa Exp $ */
+/* $Id: logos.h,v 1.14.2.3.2.1 2006/07/07 23:32:14 nlopess Exp $ */
#define CONTEXT_TYPE_IMAGE_GIF "Content-Type: image/gif"
-unsigned char zend_logo[] = {
+static const 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,
@@ -237,7 +237,7 @@ unsigned char zend_logo[] = {
46, 143, 167, 96, 131, 23, 221, 120, 200, 72,
214, 74, 16, 0, 0, 59 };
-unsigned char php_logo[] = {
+static const unsigned char php_logo[] = {
71, 73, 70, 56, 57, 97, 120, 0, 67, 0,
230, 106, 0, 127, 130, 184, 57, 55, 71, 40,
37, 42, 204, 205, 226, 161, 164, 203, 211, 213,
@@ -492,7 +492,7 @@ unsigned char php_logo[] = {
21, 116, 187, 251, 221, 240, 142, 119, 188, 3,
1, 0, 59, 0 };
-unsigned char php_egg_logo[] = {
+static const unsigned char php_egg_logo[] = {
71, 73, 70, 56, 57, 97, 120, 0, 67, 0,
247, 0, 0, 0, 255, 0, 107, 114, 178, 0,
0, 0, 31, 31, 31, 255, 255, 255, 106, 113,
diff --git a/main/main.c b/main/main.c
index df64e5d88..66553ef68 100644
--- a/main/main.c
+++ b/main/main.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.640.2.25 2006/08/10 21:49:56 iliaa Exp $ */
+/* $Id: main.c,v 1.640.2.23.2.16 2006/09/25 14:48:33 iliaa Exp $ */
/* {{{ includes
*/
@@ -30,6 +30,7 @@
#ifdef PHP_WIN32
#include "win32/time.h"
#include "win32/signal.h"
+#include "win32/php_win32_globals.h"
#include <process.h>
#elif defined(NETWARE)
#include <sys/timeval.h>
@@ -311,7 +312,7 @@ PHP_INI_BEGIN()
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)
+ PHP_INI_ENTRY("memory_limit", "16M", PHP_INI_ALL, OnChangeMemoryLimit)
#endif
PHP_INI_ENTRY("precision", "14", PHP_INI_ALL, OnSetPrecision)
PHP_INI_ENTRY("sendmail_from", NULL, PHP_INI_ALL, NULL)
@@ -321,6 +322,7 @@ PHP_INI_BEGIN()
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("allow_url_include", "0", PHP_INI_SYSTEM, OnUpdateBool, allow_url_include, 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)
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)
@@ -569,16 +571,18 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
if (docref_buf) {
efree(docref_buf);
}
- php_error(type, "%s", message);
- efree(message);
- if (PG(track_errors) && module_initialized && EG(active_symbol_table)) {
+ if (PG(track_errors) && module_initialized && EG(active_symbol_table) &&
+ (!EG(user_error_handler) || !(EG(user_error_handler_error_reporting) & type))) {
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(zval *), NULL);
}
efree(buffer);
+
+ php_error(type, "%s", message);
+ efree(message);
}
/* }}} */
@@ -681,6 +685,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
if (PG(last_error_file)) {
free(PG(last_error_file));
}
+ PG(last_error_type) = type;
PG(last_error_message) = strdup(buffer);
PG(last_error_file) = strdup(error_filename);
PG(last_error_lineno) = error_lineno;
@@ -689,8 +694,10 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
/* according to error handling mode, suppress error, throw exception or show it */
if (PG(error_handling) != EH_NORMAL) {
switch (type) {
+ case E_ERROR:
case E_CORE_ERROR:
case E_COMPILE_ERROR:
+ case E_USER_ERROR:
case E_PARSE:
/* fatal errors are real errors and cannot be made exceptions */
break;
@@ -725,6 +732,9 @@ static void php_error_cb(int type, const char *error_filename, const uint 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:
@@ -814,6 +824,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
}
/* 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:
@@ -821,7 +832,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
if (module_initialized) {
#if MEMORY_LIMIT
/* restore memory limit */
- AG(memory_limit) = PG(memory_limit);
+ zend_set_memory_limit(PG(memory_limit));
#endif
efree(buffer);
zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC);
@@ -836,16 +847,14 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
efree(buffer);
return;
}
+
if (PG(track_errors) && module_initialized && EG(active_symbol_table)) {
zval *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;
+ 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(zval *), NULL);
}
+
efree(buffer);
}
/* }}} */
@@ -956,10 +965,9 @@ static void php_message_handler_for_zend(long message, void *data)
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);
+ zend_leak_info *t = (zend_leak_info *) data;
- 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));
+ snprintf(memory_leak_buf, 512, "%s(%d) : Freeing 0x%.8lX (%d bytes), script=%s\n", t->filename, t->lineno, (unsigned long)t->addr, t->size, SAFE_FILENAME(SG(request_info).path_translated));
if (t->orig_filename) {
char relay_buf[512];
@@ -1342,6 +1350,25 @@ static void core_globals_ctor(php_core_globals *core_globals TSRMLS_DC)
/* }}} */
#endif
+/* {{{ core_globals_dtor
+ */
+static void core_globals_dtor(php_core_globals *core_globals TSRMLS_DC)
+{
+ if (core_globals->last_error_message) {
+ free(core_globals->last_error_message);
+ }
+ if (core_globals->last_error_file) {
+ free(core_globals->last_error_file);
+ }
+ if (core_globals->disable_functions) {
+ free(core_globals->disable_functions);
+ }
+ if (core_globals->disable_classes) {
+ free(core_globals->disable_classes);
+ }
+}
+/* }}} */
+
/* {{{ php_register_extensions
*/
int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC)
@@ -1428,10 +1455,13 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
#ifdef ZTS
executor_globals = ts_resource(executor_globals_id);
- ts_allocate_id(&core_globals_id, sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, NULL);
+ ts_allocate_id(&core_globals_id, sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, (ts_allocate_dtor) core_globals_dtor);
core_globals = ts_resource(core_globals_id);
+#ifdef PHP_WIN32
+ ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor) php_win32_core_globals_ctor, NULL);
#endif
- EG(bailout_set) = 0;
+#endif
+ EG(bailout) = NULL;
EG(error_reporting) = E_ALL & ~E_NOTICE;
PG(header_is_being_sent) = 0;
@@ -1571,6 +1601,8 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
sapi_deactivate(TSRMLS_C);
module_startup = 0;
+ shutdown_memory_manager(1, 0 TSRMLS_CC);
+
/* we're done */
return SUCCESS;
}
@@ -1628,23 +1660,13 @@ void php_module_shutdown(TSRMLS_D)
#ifndef ZTS
zend_ini_shutdown(TSRMLS_C);
shutdown_memory_manager(CG(unclean_shutdown), 1 TSRMLS_CC);
+ core_globals_dtor(&core_globals TSRMLS_CC);
#else
zend_ini_global_shutdown(TSRMLS_C);
+ ts_free_id(core_globals_id);
#endif
module_initialized = 0;
- if (PG(last_error_message)) {
- free(PG(last_error_message));
- }
- if (PG(last_error_file)) {
- free(PG(last_error_file));
- }
- if (PG(disable_functions)) {
- free(PG(disable_functions));
- }
- if (PG(disable_classes)) {
- free(PG(disable_classes));
- }
}
/* }}} */
@@ -1682,8 +1704,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
PG(during_request_startup) = 0;
- if (primary_file->type == ZEND_HANDLE_FILENAME
- && primary_file->filename) {
+ if ((primary_file->type == ZEND_HANDLE_FILENAME || primary_file->type == ZEND_HANDLE_STREAM) && primary_file->filename) {
#if HAVE_BROKEN_GETCWD
/* this looks nasty to me */
old_cwd_fd = open(".", 0);
diff --git a/main/network.c b/main/network.c
index d29342b9e..674b7c727 100644
--- a/main/network.c
+++ b/main/network.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: network.c,v 1.118.2.2 2006/03/19 22:33:10 tony2001 Exp $ */
+/* $Id: network.c,v 1.118.2.2.2.2 2006/09/11 19:18:07 pollita Exp $ */
/*#define DEBUG_MAIN_NETWORK 1*/
@@ -103,7 +103,7 @@ int inet_aton(const char *, struct in_addr *);
# define PHP_GAI_STRERROR(x) (php_gai_strerror(x))
/* {{{ php_gai_strerror
*/
-static char *php_gai_strerror(int code)
+static const char *php_gai_strerror(int code)
{
static struct {
int code;
@@ -787,37 +787,46 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
/* make a connection attempt */
if (bindto) {
- struct sockaddr local_address;
+ struct sockaddr *local_address = NULL;
+ int local_address_len = 0;
if (sa->sa_family == AF_INET) {
- struct sockaddr_in *in4 = (struct sockaddr_in*)&local_address;
+ struct sockaddr_in *in4 = emalloc(sizeof(struct sockaddr_in));
+
+ local_address = (struct sockaddr*)in4;
+ local_address_len = sizeof(struct sockaddr_in);
in4->sin_family = sa->sa_family;
in4->sin_port = htons(bindport);
if (!inet_aton(bindto, &in4->sin_addr)) {
- goto bad_ip;
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid IP Address: %s", bindto);
+ goto skip_bind;
}
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;
+ struct sockaddr_in6 *in6 = emalloc(sizeof(struct sockaddr_in6));
+
+ local_address = (struct sockaddr*)in6;
+ local_address_len = sizeof(struct sockaddr_in6);
in6->sin6_family = sa->sa_family;
in6->sin6_port = htons(bindport);
if (inet_pton(AF_INET6, bindto, &in6->sin6_addr) < 1) {
- goto bad_ip;
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid IP Address: %s", bindto);
+ goto skip_bind;
}
}
#endif
- if (bind(sock, &local_address, sizeof(struct sockaddr))) {
+ if (!local_address || bind(sock, local_address, local_address_len)) {
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);
+skip_bind:
+ if (local_address) {
+ efree(local_address);
+ }
}
-bind_done:
/* free error string recieved during previous iteration (if any) */
if (error_string && *error_string) {
efree(*error_string);
diff --git a/main/php.h b/main/php.h
index edfa6e073..efaeef88b 100644
--- a/main/php.h
+++ b/main/php.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php.h,v 1.221.2.4 2006/03/07 22:37:53 alexwaugh Exp $ */
+/* $Id: php.h,v 1.221.2.4.2.3 2006/09/04 08:18:15 dmitry Exp $ */
#ifndef PHP_H
#define PHP_H
@@ -334,6 +334,7 @@ END_EXTERN_C()
/* PHP-named Zend macro wrappers */
#define PHP_FN ZEND_FN
+#define PHP_MN ZEND_MN
#define PHP_NAMED_FUNCTION ZEND_NAMED_FUNCTION
#define PHP_FUNCTION ZEND_FUNCTION
#define PHP_METHOD ZEND_METHOD
@@ -366,12 +367,18 @@ END_EXTERN_C()
#define PHP_RINIT ZEND_MODULE_ACTIVATE_N
#define PHP_RSHUTDOWN ZEND_MODULE_DEACTIVATE_N
#define PHP_MINFO ZEND_MODULE_INFO_N
+#define PHP_GINIT ZEND_GINIT
+#define PHP_GSHUTDOWN ZEND_GSHUTDOWN
#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
+#define PHP_GINIT_FUNCTION ZEND_GINIT_FUNCTION
+#define PHP_GSHUTDOWN_FUNCTION ZEND_GSHUTDOWN_FUNCTION
+
+#define PHP_MODULE_GLOBALS ZEND_MODULE_GLOBALS
/* Output support */
@@ -391,10 +398,6 @@ END_EXTERN_C()
#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"
diff --git a/main/php_compat.h b/main/php_compat.h
index 403ef82d0..edea45ff1 100644
--- a/main/php_compat.h
+++ b/main/php_compat.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_compat.h,v 1.25.2.3 2006/04/10 11:55:14 sniper Exp $ */
+/* $Id: php_compat.h,v 1.25.2.3.2.2 2006/08/23 20:39:11 andrei Exp $ */
#ifndef PHP_COMPAT_H
#define PHP_COMPAT_H
@@ -29,6 +29,7 @@
#if defined(HAVE_BUNDLED_PCRE) || !defined(PHP_VERSION)
#define pcre_compile php_pcre_compile
+#define pcre_compile2 php_pcre_compile2
#define pcre_copy_substring php_pcre_copy_substring
#define pcre_exec php_pcre_exec
#define pcre_get_substring php_pcre_substring
@@ -40,6 +41,20 @@
#define pcre_fullinfo php_pcre_fullinfo
#define pcre_free php_pcre_free
#define pcre_malloc php_pcre_malloc
+#define pcre_config php_pcre_config
+#define pcre_copy_named_substring php_pcre_copy_named_substring
+#define pcre_dfa_exec php_pcre_dfa_exec
+#define pcre_free_substring php_pcre_free_substring
+#define pcre_free_substring_list php_pcre_free_substring_list
+#define pcre_get_named_substring php_pcre_get_named_substring
+#define pcre_get_stringnumber php_pcre_get_stringnumber
+#define pcre_refcount php_pcre_refcount
+#define _pcre_ord2utf8 php__pcre_ord2utf8
+#define _pcre_try_flipped php__pcre_try_flipped
+#define _pcre_ucp_findprop php__pcre_ucp_findprop
+#define _pcre_ucp_othercase php__pcre_ucp_othercase
+#define _pcre_valid_utf8 php__pcre_valid_utf8
+#define _pcre_xclass php__pcre_xclass
#endif
#define lookup php_lookup
diff --git a/main/php_config.h.in b/main/php_config.h.in
index 0fbd6af3a..19f4189b5 100644
--- a/main/php_config.h.in
+++ b/main/php_config.h.in
@@ -296,6 +296,9 @@
/* Define if you have the inet_pton function. */
#undef HAVE_INET_PTON
+/* Define if you have the initgroups function. */
+#undef HAVE_INITGROUPS
+
/* Define if you have the isascii function. */
#undef HAVE_ISASCII
@@ -371,6 +374,9 @@
/* Define if you have the mmap function. */
#undef HAVE_MMAP
+/* Define if you have the mremap function. */
+#undef HAVE_MREMAP
+
/* Define if you have the mysql_commit function. */
#undef HAVE_MYSQL_COMMIT
@@ -428,6 +434,9 @@
/* Define if you have the setegid function. */
#undef HAVE_SETEGID
+/* Define if you have the setenv function. */
+#undef HAVE_SETENV
+
/* Define if you have the seteuid function. */
#undef HAVE_SETEUID
@@ -683,6 +692,9 @@
/* Define if you have the <sys/ipc.h> header file. */
#undef HAVE_SYS_IPC_H
+/* Define if you have the <sys/loadavg.h> header file. */
+#undef HAVE_SYS_LOADAVG_H
+
/* Define if you have the <sys/mkdev.h> header file. */
#undef HAVE_SYS_MKDEV_H
@@ -779,12 +791,6 @@
/* Define if you have the m library (-lm). */
#undef HAVE_LIBM
-/* Define if you have the nsl library (-lnsl). */
-#undef HAVE_LIBNSL
-
-/* Define if you have the socket library (-lsocket). */
-#undef HAVE_LIBSOCKET
-
/* Enabling BIND8 compatibility for Panther */
#undef BIND_8_COMPAT
@@ -896,7 +902,7 @@
/* */
#undef WITH_ZEUS
-/* Whether you have a Netscape/iPlanet/SunONE Server */
+/* Whether you have a Netscape/iPlanet/Sun Webserver */
#undef HAVE_NSAPI
/* Whether you have phttpd */
@@ -929,28 +935,6 @@
/* */
#undef PHP_FCGI_STATIC
-/* Define to the necessary symbol if this constant
- uses a non-standard name on your system. */
-#undef PTHREAD_CREATE_JOINABLE
-
-/* Define if sockaddr_un in sys/un.h contains a sun_len component */
-#undef HAVE_SOCKADDR_UN_SUN_LEN
-
-/* Define if the fpos_t typedef is in stdio.h */
-#undef HAVE_FPOS
-
-/* Define if there's a fileno() prototype in stdio.h */
-#undef HAVE_FILENO_PROTO
-
-/* Define if the socklen_t typedef is in sys/socket.h */
-#undef HAVE_SOCKLEN
-
-/* Define if cross-process locking is required by accept() */
-#undef USE_LOCKING
-
-/* Define if va_arg(arg, long double) crashes the compiler */
-#undef HAVE_VA_ARG_LONG_DOUBLE_BUG
-
/* whether you have sendmail */
#undef HAVE_SENDMAIL
@@ -1267,6 +1251,12 @@
#undef HAVE_CURL_VERSION_INFO
/* */
+#undef HAVE_CURL_EASY_STRERROR
+
+/* */
+#undef HAVE_CURL_MULTI_STRERROR
+
+/* */
#undef PHP_CURL_URL_WRAPPERS
/* Whether to build curl as dynamic module */
@@ -1422,11 +1412,8 @@
/* */
#undef HAVE_FDFLIB
-/* */
-#undef HAVE_FILEPRO
-
-/* Whether to build filepro as dynamic module */
-#undef COMPILE_DL_FILEPRO
+/* Whether to build filter as dynamic module */
+#undef COMPILE_DL_FILTER
/* Whether you want FTP support */
#undef HAVE_FTP
@@ -1651,12 +1638,6 @@
#undef COMPILE_DL_HASH
/* */
-#undef HAVE_HWAPI
-
-/* Whether to build hwapi as dynamic module */
-#undef COMPILE_DL_HWAPI
-
-/* */
#undef HAVE_LIBICONV
/* */
@@ -1726,6 +1707,9 @@
#undef HAVE_IMAP2004
/* */
+#undef HAVE_NEW_MIME2TEXT
+
+/* */
#undef HAVE_IMAP2001
/* */
@@ -1761,6 +1745,12 @@
/* Whether to build interbase as dynamic module */
#undef COMPILE_DL_INTERBASE
+/* whether to enable JavaScript Object Serialization support */
+#undef HAVE_JSON
+
+/* Whether to build json as dynamic module */
+#undef COMPILE_DL_JSON
+
/* Whether to build ldap as dynamic module */
#undef COMPILE_DL_LDAP
@@ -1806,6 +1796,9 @@
/* whether to have multibyte regex support */
#undef HAVE_MBREGEX
+/* whether to check multibyte regex backtrack */
+#undef USE_COMBINATION_EXPLOSION_CHECK
+
/* Whether to build mbstring as dynamic module */
#undef COMPILE_DL_MBSTRING
@@ -2241,6 +2234,12 @@
/* PostgreSQL 7.2.0 or later */
#undef HAVE_PQESCAPE
+/* PostgreSQL 8.1.4 or later */
+#undef HAVE_PQESCAPE_CONN
+
+/* PostgreSQL 8.1.4 or later */
+#undef HAVE_PQESCAPE_BYTEA_CONN
+
/* PostgreSQL 7.0.x or later */
#undef HAVE_PQSETNONBLOCKING
@@ -2364,6 +2363,15 @@
/* PostgreSQL 7.4 or later */
#undef HAVE_PQSETERRORVERBOSITY
+/* PostgreSQL 7.4 or later */
+#undef HAVE_PQFTABLE
+
+/* PostgreSQL 8.1.4 or later */
+#undef HAVE_PQESCAPE_CONN
+
+/* PostgreSQL 8.1.4 or later */
+#undef HAVE_PQESCAPE_BYTEA_CONN
+
/* Whether libpq is compiled with --enable-multibyte */
#undef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT
@@ -2625,6 +2633,9 @@
/* whether HUGE_VAL + -HUGEVAL == NAN */
#undef HAVE_HUGE_VAL_NAN
+/* whether strptime() declaration fails */
+#undef HAVE_STRPTIME_DECL_FAILS
+
/* Define if your system has mbstate_t in wchar.h */
#undef HAVE_MBSTATE_T
@@ -2692,6 +2703,12 @@
#undef COMPILE_DL_TOKENIZER
/* */
+#undef HAVE_LIBXML
+
+/* */
+#undef HAVE_LIBEXPAT
+
+/* */
#undef HAVE_WDDX
/* Whether to build wddx as dynamic module */
@@ -2766,6 +2783,12 @@
/* Whether to build xsl as dynamic module */
#undef COMPILE_DL_XSL
+/* */
+#undef HAVE_ZIP
+
+/* Whether to build zip as dynamic module */
+#undef COMPILE_DL_ZIP
+
/* Define if int32_t type is present. */
#undef HAVE_INT32_T
@@ -2796,12 +2819,6 @@
/* */
#undef ZEND_DEBUG
-/* Use Zend memory manager */
-#undef USE_ZEND_ALLOC
-
-/* Use Zend memory manager */
-#undef USE_ZEND_ALLOC
-
/* */
#undef ZTS
@@ -2823,6 +2840,12 @@
/* */
#undef ZEND_MM_ALIGNMENT_LOG2
+/* Define if the target system has support for memory allocation using mmap(MAP_ANON) */
+#undef HAVE_MEM_MMAP_ANON
+
+/* Define if the target system has support for memory allocation using mmap(/dev/zero) */
+#undef HAVE_MEM_MMAP_ZERO
+
/* */
#undef ZTS
diff --git a/main/php_globals.h b/main/php_globals.h
index aebb7915d..820bacfca 100644
--- a/main/php_globals.h
+++ b/main/php_globals.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_globals.h,v 1.98.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: php_globals.h,v 1.98.2.1.2.2 2006/07/19 12:25:46 mike Exp $ */
#ifndef PHP_GLOBALS_H
#define PHP_GLOBALS_H
@@ -142,6 +142,7 @@ struct _php_core_globals {
zend_bool always_populate_raw_post_data;
zend_bool report_zend_debug;
+ int last_error_type;
char *last_error_message;
char *last_error_file;
int last_error_lineno;
@@ -150,6 +151,7 @@ struct _php_core_globals {
char *disable_functions;
char *disable_classes;
+ zend_bool allow_url_include;
};
diff --git a/main/php_ini.c b/main/php_ini.c
index fbd0df569..88b0cf8d3 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ini.c,v 1.136.2.4 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: php_ini.c,v 1.136.2.4.2.4 2006/09/19 20:33:11 dmitry Exp $ */
#include "php.h"
#include "ext/standard/info.h"
@@ -258,6 +258,7 @@ static void pvalue_config_destructor(zval *pvalue)
*/
int php_init_config(TSRMLS_D)
{
+ char *php_ini_file_name = NULL;
char *php_ini_search_path = NULL;
int safe_mode_state;
char *open_basedir;
@@ -286,6 +287,7 @@ int php_init_config(TSRMLS_D)
open_basedir = PG(open_basedir);
if (sapi_module.php_ini_path_override) {
+ php_ini_file_name = 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) {
@@ -310,6 +312,15 @@ int php_init_config(TSRMLS_D)
free_ini_search_path = 1;
php_ini_search_path[0] = 0;
+ /* 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);
+ php_ini_file_name = env_location;
+ }
+
#ifdef PHP_WIN32
/* Add registry location */
reg_location = GetIniPathFromRegistry();
@@ -322,16 +333,8 @@ int php_init_config(TSRMLS_D)
}
#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) {
+ /* Add cwd (not with CLI) */
+ if (strcmp(sapi_module.name, "cli") != 0) {
if (*php_ini_search_path) {
strcat(php_ini_search_path, paths_separator);
}
@@ -421,13 +424,15 @@ int php_init_config(TSRMLS_D)
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]) {
+ if (php_ini_file_name && php_ini_file_name[0]) {
struct stat statbuf;
- if (!VCWD_STAT(sapi_module.php_ini_path_override, &statbuf)) {
+ if (!VCWD_STAT(php_ini_file_name, &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;
+ fh.handle.fp = VCWD_FOPEN(php_ini_file_name, "r");
+ if (fh.handle.fp) {
+ fh.filename = php_ini_opened_path = expand_filepath(php_ini_file_name, NULL TSRMLS_CC);
+ }
}
}
}
@@ -524,6 +529,11 @@ int php_init_config(TSRMLS_D)
zend_llist_destroy(&scanned_ini_list);
}
}
+
+ if (sapi_module.ini_entries) {
+ zend_parse_ini_string(sapi_module.ini_entries, 1, php_config_ini_parser_cb, &extension_lists);
+ }
+
return SUCCESS;
}
/* }}} */
diff --git a/main/php_logos.c b/main/php_logos.c
index d62b304a2..476f8fe0d 100644
--- a/main/php_logos.c
+++ b/main/php_logos.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_logos.c,v 1.19.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: php_logos.c,v 1.19.2.1.2.2 2006/08/12 19:33:54 nlopess Exp $ */
#include "php.h"
#include "logos.h"
@@ -25,15 +25,15 @@
#include "SAPI.h"
typedef struct _php_info_logo {
- char *mimetype;
+ const char *mimetype;
int mimelen;
- unsigned char *data;
+ const 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)
+PHPAPI int php_register_info_logo(char *logo_string, const char *mimetype, const unsigned char *data, int size)
{
php_info_logo info_logo;
diff --git a/main/php_logos.h b/main/php_logos.h
index 01833d3c1..77b62abfd 100644
--- a/main/php_logos.h
+++ b/main/php_logos.h
@@ -16,14 +16,14 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_logos.h,v 1.9.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: php_logos.h,v 1.9.2.1.2.2 2006/08/12 19:33:54 nlopess Exp $ */
#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_register_info_logo(char *logo_string, const char *mimetype, const unsigned char *data, int size);
PHPAPI int php_unregister_info_logo(char *logo_string);
END_EXTERN_C()
diff --git a/main/php_memory_streams.h b/main/php_memory_streams.h
index a9fddf59c..961dea115 100644
--- a/main/php_memory_streams.h
+++ b/main/php_memory_streams.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_memory_streams.h,v 1.13.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: php_memory_streams.h,v 1.13.2.1.2.1 2006/05/13 17:58:58 helly Exp $ */
#ifndef PHP_MEMORY_STREAM_H
#define PHP_MEMORY_STREAM_H
@@ -50,6 +50,8 @@ END_EXTERN_C()
extern php_stream_ops php_stream_memory_ops;
extern php_stream_ops php_stream_temp_ops;
+extern php_stream_ops php_stream_rfc2397_ops;
+extern php_stream_wrapper php_stream_rfc2397_wrapper;
#define PHP_STREAM_IS_MEMORY &php_stream_memory_ops
#define PHP_STREAM_IS_TEMP &php_stream_temp_ops
diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c
index 17fdae7de..0a5c28828 100644
--- a/main/php_open_temporary_file.c
+++ b/main/php_open_temporary_file.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_open_temporary_file.c,v 1.34.2.2 2006/05/23 23:22:26 iliaa Exp $ */
+/* $Id: php_open_temporary_file.c,v 1.34.2.1.2.4 2006/10/13 01:11:30 iliaa Exp $ */
#include "php.h"
@@ -206,6 +206,7 @@ PHPAPI const char* php_get_temporary_directory(void)
PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC)
{
int fd;
+ const char *temp_dir;
if (!pfx) {
pfx = "tmp.";
@@ -214,11 +215,22 @@ PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened
*opened_path_p = NULL;
}
+ if (!dir || *dir == '\0') {
+def_tmp:
+ temp_dir = php_get_temporary_directory();
+
+ if (temp_dir && *temp_dir != '\0' && !php_check_open_basedir(temp_dir TSRMLS_CC)) {
+ return php_do_open_temporary_file(temp_dir, pfx, opened_path_p TSRMLS_CC);
+ } else {
+ return -1;
+ }
+ }
+
/* 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);
+ goto def_tmp;
}
return fd;
}
diff --git a/main/php_variables.c b/main/php_variables.c
index bf08d05d4..42bc8f2d4 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_variables.c,v 1.104.2.10 2006/05/03 11:24:29 dmitry Exp $ */
+/* $Id: php_variables.c,v 1.104.2.10.2.1 2006/07/27 15:37:56 iliaa Exp $ */
#include <stdio.h>
#include "php.h"
@@ -216,31 +216,37 @@ plain_var:
SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler)
{
- char *var, *val;
- char *strtok_buf = NULL;
+ char *var, *val, *e, *s, *p;
zval *array_ptr = (zval *) arg;
if (SG(request_info).post_data == NULL) {
return;
}
- var = php_strtok_r(SG(request_info).post_data, "&", &strtok_buf);
+ s = SG(request_info).post_data;
+ e = s + SG(request_info).post_data_length;
- while (var) {
- val = strchr(var, '=');
- if (val) { /* have a value */
+ while (s < e && (p = memchr(s, '&', (e - s)))) {
+last_value:
+ if ((val = memchr(s, '=', (p - s)))) { /* have a value */
unsigned int val_len, new_val_len;
- *val++ = '\0';
- php_url_decode(var, strlen(var));
- val_len = php_url_decode(val, strlen(val));
+ var = s;
+
+ php_url_decode(var, (val - s));
+ val++;
+ val_len = php_url_decode(val, (p - 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);
+ s = p + 1;
+ }
+ if (s < e) {
+ p = e;
+ goto last_value;
}
}
diff --git a/main/php_variables.h b/main/php_variables.h
index 0d5e5ea78..9178065b7 100644
--- a/main/php_variables.h
+++ b/main/php_variables.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_variables.h,v 1.22.2.3 2006/03/08 08:43:25 mike Exp $ */
+/* $Id: php_variables.h,v 1.22.2.3.2.1 2006/05/10 21:10:45 rasmus Exp $ */
#ifndef PHP_VARIABLES_H
#define PHP_VARIABLES_H
@@ -29,6 +29,9 @@
#define PARSE_GET 1
#define PARSE_COOKIE 2
#define PARSE_STRING 3
+#define PARSE_ENV 4
+#define PARSE_SERVER 5
+#define PARSE_SESSION 6
BEGIN_EXTERN_C()
void php_startup_auto_globals(TSRMLS_D);
diff --git a/main/php_version.h b/main/php_version.h
index 30d715658..73c11eac6 100644
--- a/main/php_version.h
+++ b/main/php_version.h
@@ -1,7 +1,8 @@
/* automatically generated by configure */
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 5
-#define PHP_MINOR_VERSION 1
-#define PHP_RELEASE_VERSION 6
+#define PHP_MINOR_VERSION 2
+#define PHP_RELEASE_VERSION 0
#define PHP_EXTRA_VERSION ""
-#define PHP_VERSION "5.1.6"
+#define PHP_VERSION "5.2.0"
+#define PHP_VERSION_ID 50200
diff --git a/main/rfc1867.c b/main/rfc1867.c
index a49005e69..edca8f97b 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: rfc1867.c,v 1.173.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: rfc1867.c,v 1.173.2.1.2.5 2006/09/29 10:05:34 sesser Exp $ */
/*
* This product includes software developed by the Apache Group
@@ -35,10 +35,12 @@
#define DEBUG_FILE_UPLOAD ZEND_DEBUG
+PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC) = NULL;
+
#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);
+static void safe_php_register_variable(char *var, char *strval, int val_len, 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); \
@@ -62,7 +64,7 @@ void php_mb_flush_gpc_variables(int num_vars, char **val_list, int *len_list, zv
php_mb_gpc_encoding_converter(val_list, len_list, num_vars, NULL, NULL TSRMLS_CC);
}
for (i=0; i<num_vars; i+=2){
- safe_php_register_variable(val_list[i], val_list[i+1], array_ptr, 0 TSRMLS_CC);
+ safe_php_register_variable(val_list[i], val_list[i+1], len_list[i+1], array_ptr, 0 TSRMLS_CC);
efree(val_list[i]);
efree(val_list[i+1]);
}
@@ -132,6 +134,7 @@ void php_mb_gpc_stack_variable(char *param, char *value, char ***pval_list, int
#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 */
+#define UPLOAD_ERROR_X 8 /* File upload stopped by extension */
void php_rfc1867_register_constants(TSRMLS_D)
{
@@ -142,6 +145,7 @@ void php_rfc1867_register_constants(TSRMLS_D)
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);
+ REGISTER_MAIN_LONG_CONSTANT("UPLOAD_ERR_EXTENSION", UPLOAD_ERROR_X, CONST_CS | CONST_PERSISTENT);
}
static void normalize_protected_variable(char *varname TSRMLS_DC)
@@ -219,10 +223,10 @@ static zend_bool is_protected_variable(char *varname TSRMLS_DC)
}
-static void safe_php_register_variable(char *var, char *strval, zval *track_vars_array, zend_bool override_protection TSRMLS_DC)
+static void safe_php_register_variable(char *var, char *strval, int val_len, 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);
+ php_register_variable_safe(var, strval, val_len, track_vars_array TSRMLS_CC);
}
}
@@ -240,7 +244,7 @@ static void register_http_post_files_variable(char *strvar, char *val, zval *htt
int register_globals = PG(register_globals);
PG(register_globals) = 0;
- safe_php_register_variable(strvar, val, http_post_files, override_protection TSRMLS_CC);
+ safe_php_register_variable(strvar, val, strlen(val), http_post_files, override_protection TSRMLS_CC);
PG(register_globals) = register_globals;
}
@@ -753,7 +757,7 @@ static int multipart_buffer_read(multipart_buffer *self, char *buf, int bytes, i
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)
+static char *multipart_buffer_read_body(multipart_buffer *self, unsigned int *len TSRMLS_DC)
{
char buf[FILLUNIT], *out=NULL;
int total_bytes=0, read_bytes=0;
@@ -765,6 +769,7 @@ static char *multipart_buffer_read_body(multipart_buffer *self TSRMLS_DC)
}
if (out) out[total_bytes] = '\0';
+ *len = total_bytes;
return out;
}
@@ -791,6 +796,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
zval *array_ptr = (zval *) arg;
int fd=-1;
zend_llist header;
+ void *event_extra_data = NULL;
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));
@@ -849,16 +855,26 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
#endif
zend_llist_init(&header, sizeof(mime_header_entry), (llist_dtor_func_t) php_free_hdr_entry, 0);
+ if (php_rfc1867_callback != NULL) {
+ multipart_event_start event_start;
+
+ event_start.content_length = SG(request_info).content_length;
+ if (php_rfc1867_callback(MULTIPART_EVENT_START, &event_start, &event_extra_data TSRMLS_CC) == FAILURE) {
+ goto fileupload_done;
+ }
+ }
+
while (!multipart_buffer_eof(mbuff TSRMLS_CC))
{
char buff[FILLUNIT];
char *cd=NULL,*param=NULL,*filename=NULL, *tmp=NULL;
- int blen=0, wlen=0;
+ size_t blen=0, wlen=0;
+ off_t offset;
zend_llist_clean(&header);
if (!multipart_buffer_headers(mbuff, &header TSRMLS_CC)) {
- SAFE_RETURN;
+ goto fileupload_done;
}
if ((cd = php_mime_get_hdr_value(header, "Content-Disposition"))) {
@@ -900,26 +916,53 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
/* Normal form variable, safe to read all data into memory */
if (!filename && param) {
-
- char *value = multipart_buffer_read_body(mbuff TSRMLS_CC);
+ unsigned int value_len;
+ char *value = multipart_buffer_read_body(mbuff, &value_len 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 (sapi_module.input_filter(PARSE_POST, param, &value, value_len, &new_val_len TSRMLS_CC)) {
+ if (php_rfc1867_callback != NULL) {
+ multipart_event_formdata event_formdata;
+ size_t newlength = 0;
+
+ event_formdata.post_bytes_processed = SG(read_post_bytes);
+ event_formdata.name = param;
+ event_formdata.value = &value;
+ event_formdata.length = new_val_len;
+ event_formdata.newlength = &newlength;
+ if (php_rfc1867_callback(MULTIPART_EVENT_FORMDATA, &event_formdata, &event_extra_data TSRMLS_CC) == FAILURE) {
+ efree(param);
+ efree(value);
+ continue;
+ }
+ new_val_len = newlength;
+ }
+
#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);
+ safe_php_register_variable(param, value, new_val_len, array_ptr, 0 TSRMLS_CC);
}
#else
- safe_php_register_variable(param, value, array_ptr, 0 TSRMLS_CC);
+ safe_php_register_variable(param, value, new_val_len, array_ptr, 0 TSRMLS_CC);
#endif
+ } else if (php_rfc1867_callback != NULL) {
+ multipart_event_formdata event_formdata;
+
+ event_formdata.post_bytes_processed = SG(read_post_bytes);
+ event_formdata.name = param;
+ event_formdata.value = &value;
+ event_formdata.length = value_len;
+ event_formdata.newlength = NULL;
+ php_rfc1867_callback(MULTIPART_EVENT_FORMDATA, &event_formdata, &event_extra_data TSRMLS_CC);
}
+
if (!strcasecmp(param, "MAX_FILE_SIZE")) {
max_file_size = atol(value);
}
@@ -937,7 +980,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
/* 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;
+ goto fileupload_done;
}
if (!param) {
@@ -981,11 +1024,34 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
cancel_upload = UPLOAD_ERROR_E;
}
}
+
+ if (!skip_upload && php_rfc1867_callback != NULL) {
+ multipart_event_file_start event_file_start;
+
+ event_file_start.post_bytes_processed = SG(read_post_bytes);
+ event_file_start.name = param;
+ event_file_start.filename = &filename;
+ if (php_rfc1867_callback(MULTIPART_EVENT_FILE_START, &event_file_start, &event_extra_data TSRMLS_CC) == FAILURE) {
+ if (temp_filename) {
+ if (cancel_upload != UPLOAD_ERROR_E) { /* file creation failed */
+ close(fd);
+ unlink(temp_filename);
+ }
+ efree(temp_filename);
+ }
+ temp_filename="";
+ efree(param);
+ efree(filename);
+ continue;
+ }
+ }
+
+
if (skip_upload) {
efree(param);
efree(filename);
continue;
- }
+ }
if(strlen(filename) == 0) {
#if DEBUG_FILE_UPLOAD
@@ -994,9 +1060,25 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
cancel_upload = UPLOAD_ERROR_D;
}
+ offset = 0;
end = 0;
while (!cancel_upload && (blen = multipart_buffer_read(mbuff, buff, sizeof(buff), &end TSRMLS_CC)))
{
+ if (php_rfc1867_callback != NULL) {
+ multipart_event_file_data event_file_data;
+
+ event_file_data.post_bytes_processed = SG(read_post_bytes);
+ event_file_data.offset = offset;
+ event_file_data.data = buff;
+ event_file_data.length = blen;
+ event_file_data.newlength = &blen;
+ if (php_rfc1867_callback(MULTIPART_EVENT_FILE_DATA, &event_file_data, &event_extra_data TSRMLS_CC) == FAILURE) {
+ cancel_upload = UPLOAD_ERROR_X;
+ continue;
+ }
+ }
+
+
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);
@@ -1008,6 +1090,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
#endif
cancel_upload = UPLOAD_ERROR_B;
} else if (blen > 0) {
+
wlen = write(fd, buff, blen);
if (wlen < blen) {
@@ -1018,6 +1101,8 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
} else {
total_bytes += wlen;
}
+
+ offset += wlen;
}
}
if (fd!=-1) { /* may not be initialized if file could not be created */
@@ -1036,6 +1121,17 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
}
#endif
+ if (php_rfc1867_callback != NULL) {
+ multipart_event_file_end event_file_end;
+
+ event_file_end.post_bytes_processed = SG(read_post_bytes);
+ event_file_end.temp_filename = temp_filename;
+ event_file_end.cancel_upload = cancel_upload;
+ if (php_rfc1867_callback(MULTIPART_EVENT_FILE_END, &event_file_end, &event_extra_data TSRMLS_CC) == FAILURE) {
+ cancel_upload = UPLOAD_ERROR_X;
+ }
+ }
+
if (cancel_upload) {
if (temp_filename) {
if (cancel_upload != UPLOAD_ERROR_E) { /* file creation failed */
@@ -1123,9 +1219,9 @@ filedone:
if (!is_anonymous) {
if (s && s > filename) {
- safe_php_register_variable(lbuf, s+1, NULL, 0 TSRMLS_CC);
+ safe_php_register_variable(lbuf, s+1, strlen(s+1), NULL, 0 TSRMLS_CC);
} else {
- safe_php_register_variable(lbuf, filename, NULL, 0 TSRMLS_CC);
+ safe_php_register_variable(lbuf, filename, strlen(filename), NULL, 0 TSRMLS_CC);
}
}
@@ -1161,7 +1257,7 @@ filedone:
sprintf(lbuf, "%s_type", param);
}
if (!is_anonymous) {
- safe_php_register_variable(lbuf, cd, NULL, 0 TSRMLS_CC);
+ safe_php_register_variable(lbuf, cd, strlen(cd), NULL, 0 TSRMLS_CC);
}
/* Add $foo[type] */
@@ -1185,7 +1281,7 @@ filedone:
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);
+ safe_php_register_variable(param, temp_filename, strlen(temp_filename), NULL, 1 TSRMLS_CC);
}
/* Add $foo[tmp_name] */
@@ -1242,7 +1338,14 @@ filedone:
efree(param);
}
}
-
+fileupload_done:
+ if (php_rfc1867_callback != NULL) {
+ multipart_event_end event_end;
+
+ event_end.post_bytes_processed = SG(read_post_bytes);
+ php_rfc1867_callback(MULTIPART_EVENT_END, &event_end, &event_extra_data TSRMLS_CC);
+ }
+
SAFE_RETURN;
}
diff --git a/main/rfc1867.h b/main/rfc1867.h
index 0ab0585a0..180079977 100644
--- a/main/rfc1867.h
+++ b/main/rfc1867.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: rfc1867.h,v 1.13.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: rfc1867.h,v 1.13.2.1.2.2 2006/07/26 13:22:06 tony2001 Exp $ */
#ifndef RFC1867_H
#define RFC1867_H
@@ -24,10 +24,53 @@
#include "SAPI.h"
#define MULTIPART_CONTENT_TYPE "multipart/form-data"
+#define MULTIPART_EVENT_START 0
+#define MULTIPART_EVENT_FORMDATA 1
+#define MULTIPART_EVENT_FILE_START 2
+#define MULTIPART_EVENT_FILE_DATA 3
+#define MULTIPART_EVENT_FILE_END 4
+#define MULTIPART_EVENT_END 5
+
+typedef struct _multipart_event_start {
+ size_t content_length;
+} multipart_event_start;
+
+typedef struct _multipart_event_formdata {
+ size_t post_bytes_processed;
+ char *name;
+ char **value;
+ size_t length;
+ size_t *newlength;
+} multipart_event_formdata;
+
+typedef struct _multipart_event_file_start {
+ size_t post_bytes_processed;
+ char *name;
+ char **filename;
+} multipart_event_file_start;
+
+typedef struct _multipart_event_file_data {
+ size_t post_bytes_processed;
+ off_t offset;
+ char *data;
+ size_t length;
+ size_t *newlength;
+} multipart_event_file_data;
+
+typedef struct _multipart_event_file_end {
+ size_t post_bytes_processed;
+ char *temp_filename;
+ int cancel_upload;
+} multipart_event_file_end;
+
+typedef struct _multipart_event_end {
+ size_t post_bytes_processed;
+} multipart_event_end;
SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler);
void destroy_uploaded_files_hash(TSRMLS_D);
void php_rfc1867_register_constants(TSRMLS_D);
+extern PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC);
#endif /* RFC1867_H */
diff --git a/main/safe_mode.c b/main/safe_mode.c
index 0caaeb960..8b9886374 100644
--- a/main/safe_mode.c
+++ b/main/safe_mode.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: safe_mode.c,v 1.62.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: safe_mode.c,v 1.62.2.1.2.2 2006/07/01 11:35:34 nlopess Exp $ */
#include "php.h"
@@ -45,7 +45,7 @@
* 5 - only check file
*/
-PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int flags)
+PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mode, int flags)
{
struct stat sb;
int ret, nofile=0;
@@ -153,8 +153,6 @@ PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int
} 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;
@@ -188,7 +186,7 @@ PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int
return 0;
}
-PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode) {
+PHPAPI int php_checkuid(const char *filename, const char *fopen_mode, int mode) {
#ifdef NETWARE
/* NetWare don't have uid*/
return 1;
diff --git a/main/safe_mode.h b/main/safe_mode.h
index fc9ee391c..9e38b07cf 100644
--- a/main/safe_mode.h
+++ b/main/safe_mode.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: safe_mode.h,v 1.13.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: safe_mode.h,v 1.13.2.1.2.1 2006/07/01 11:35:34 nlopess Exp $ */
#ifndef SAFE_MODE_H
#define SAFE_MODE_H
@@ -33,8 +33,8 @@
#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 int php_checkuid(const char *filename, const char *fopen_mode, int mode);
+PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mode, int flags);
PHPAPI char *php_get_current_user(void);
END_EXTERN_C()
diff --git a/main/snprintf.c b/main/snprintf.c
index 41dce94f7..ee834d3f1 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: snprintf.c,v 1.37.2.4 2006/01/24 20:59:46 helly Exp $ */
+/* $Id: snprintf.c,v 1.37.2.4.2.1 2006/05/07 12:40:17 helly Exp $ */
/* ====================================================================
* Copyright (c) 1995-1998 The Apache Group. All rights reserved.
@@ -897,6 +897,7 @@ static int format_converter(register buffy * odp, const char *fmt,
case 's':
+ case 'v':
s = va_arg(ap, char *);
if (s != NULL) {
s_len = strlen(s);
diff --git a/main/spprintf.c b/main/spprintf.c
index 240da1789..64543fe89 100644
--- a/main/spprintf.c
+++ b/main/spprintf.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spprintf.c,v 1.25.2.2 2006/01/24 20:59:46 helly Exp $ */
+/* $Id: spprintf.c,v 1.25.2.2.2.1 2006/05/07 12:40:17 helly Exp $ */
/* This is the spprintf implementation.
* It has emerged from apache snprintf. See original header:
@@ -513,6 +513,7 @@ static void xbuf_format_converter(smart_str *xbuf, const char *fmt, va_list ap)
case 's':
+ case 'v':
s = va_arg(ap, char *);
if (s != NULL) {
s_len = strlen(s);
diff --git a/main/streams/filter.c b/main/streams/filter.c
index f601fa8c5..0bb19c202 100644
--- a/main/streams/filter.c
+++ b/main/streams/filter.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filter.c,v 1.17.2.4 2006/05/19 10:24:19 tony2001 Exp $ */
+/* $Id: filter.c,v 1.17.2.3.2.3 2006/10/11 23:11:26 pollita Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -61,7 +61,7 @@ PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern
php_stream_filter_factory tmpfactory;
ALLOC_HASHTABLE(FG(stream_filters));
- zend_hash_init(FG(stream_filters), 0, NULL, NULL, 1);
+ zend_hash_init(FG(stream_filters), zend_hash_num_elements(&stream_filters_hash), NULL, NULL, 1);
zend_hash_copy(FG(stream_filters), &stream_filters_hash, NULL, &tmpfactory, sizeof(php_stream_filter_factory));
}
@@ -224,12 +224,12 @@ PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket TSRMLS_DC)
{
if (bucket->prev) {
bucket->prev->next = bucket->next;
- } else {
+ } else if (bucket->brigade) {
bucket->brigade->head = bucket->next;
}
if (bucket->next) {
bucket->next->prev = bucket->prev;
- } else {
+ } else if (bucket->brigade) {
bucket->brigade->tail = bucket->prev;
}
bucket->brigade = NULL;
diff --git a/main/streams/memory.c b/main/streams/memory.c
index 30b1caad6..818e5a813 100644
--- a/main/streams/memory.c
+++ b/main/streams/memory.c
@@ -16,11 +16,14 @@
+----------------------------------------------------------------------+
*/
-/* $Id: memory.c,v 1.8.2.6 2006/03/18 19:57:00 helly Exp $ */
+/* $Id: memory.c,v 1.8.2.6.2.8 2006/06/29 14:40:49 bjori Exp $ */
#define _GNU_SOURCE
#include "php.h"
+PHPAPI int php_url_decode(char *str, int len);
+PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, int *ret_length);
+
/* 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.
@@ -46,10 +49,7 @@ typedef struct {
/* {{{ */
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;
+ php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
assert(ms != NULL);
if (ms->mode & TEMP_STREAM_READONLY) {
@@ -85,22 +85,18 @@ static size_t php_stream_memory_write(php_stream *stream, const char *buf, size_
/* {{{ */
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;
+ php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
assert(ms != NULL);
- if (ms->fpos + count > ms->fsize) {
+ if (ms->fpos + count >= ms->fsize) {
count = ms->fsize - ms->fpos;
+ stream->eof = 1;
}
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;
}
@@ -110,10 +106,7 @@ static size_t php_stream_memory_read(php_stream *stream, char *buf, size_t 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;
+ php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
assert(ms != NULL);
if (ms->data && close_handle && ms->mode != TEMP_STREAM_READONLY) {
@@ -140,10 +133,7 @@ static int php_stream_memory_flush(php_stream *stream TSRMLS_DC)
/* {{{ */
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;
+ php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
assert(ms != NULL);
switch(whence) {
@@ -156,6 +146,7 @@ static int php_stream_memory_seek(php_stream *stream, off_t offset, int whence,
} else {
ms->fpos = ms->fpos + offset;
*newoffs = ms->fpos;
+ stream->eof = 0;
return 0;
}
} else {
@@ -166,6 +157,7 @@ static int php_stream_memory_seek(php_stream *stream, off_t offset, int whence,
} else {
ms->fpos = ms->fpos + offset;
*newoffs = ms->fpos;
+ stream->eof = 0;
return 0;
}
}
@@ -177,6 +169,7 @@ static int php_stream_memory_seek(php_stream *stream, off_t offset, int whence,
} else {
ms->fpos = offset;
*newoffs = ms->fpos;
+ stream->eof = 0;
return 0;
}
case SEEK_END:
@@ -191,6 +184,7 @@ static int php_stream_memory_seek(php_stream *stream, off_t offset, int whence,
} else {
ms->fpos = ms->fsize + offset;
*newoffs = ms->fpos;
+ stream->eof = 0;
return 0;
}
default:
@@ -207,6 +201,45 @@ static int php_stream_memory_cast(php_stream *stream, int castas, void **ret TSR
}
/* }}} */
+static int php_stream_memory_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
+{
+ time_t timestamp = 0;
+ php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
+ assert(ms != NULL);
+
+ memset(ssb, 0, sizeof(php_stream_statbuf));
+ /* read-only across the board */
+
+ ssb->sb.st_mode = ms->mode & TEMP_STREAM_READONLY ? 0444 : 0666;
+
+ ssb->sb.st_size = ms->fsize;
+ ssb->sb.st_mode |= S_IFREG; /* regular file */
+
+#ifdef NETWARE
+ ssb->sb.st_mtime.tv_sec = timestamp;
+ ssb->sb.st_atime.tv_sec = timestamp;
+ ssb->sb.st_ctime.tv_sec = timestamp;
+#else
+ ssb->sb.st_mtime = timestamp;
+ ssb->sb.st_atime = timestamp;
+ ssb->sb.st_ctime = timestamp;
+#endif
+
+ ssb->sb.st_nlink = 1;
+ ssb->sb.st_rdev = -1;
+ /* this is only for APC, so use /dev/null device - no chance of conflict there! */
+ ssb->sb.st_dev = 0xC;
+ /* generate unique inode number for alias/filename, so no phars will conflict */
+ ssb->sb.st_ino = 0;
+
+#ifndef PHP_WIN32
+ ssb->sb.st_blksize = -1;
+ ssb->sb.st_blocks = -1;
+#endif
+
+ return 0;
+}
+/* }}} */
php_stream_ops php_stream_memory_ops = {
php_stream_memory_write, php_stream_memory_read,
@@ -214,7 +247,7 @@ php_stream_ops php_stream_memory_ops = {
"MEMORY",
php_stream_memory_seek,
php_stream_memory_cast,
- NULL, /* stat */
+ php_stream_memory_stat,
NULL /* set_option */
};
@@ -229,7 +262,7 @@ PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC)
self->data = NULL;
self->fpos = 0;
self->fsize = 0;
- self->smax = -1;
+ self->smax = ~0u;
self->mode = mode;
self->owner_ptr = NULL;
@@ -247,7 +280,7 @@ PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length ST
php_stream_memory_data *ms;
if ((stream = php_stream_memory_create_rel(mode)) != NULL) {
- ms = stream->abstract;
+ ms = (php_stream_memory_data*)stream->abstract;
if (mode == TEMP_STREAM_READONLY || mode == TEMP_STREAM_TAKE_BUFFER) {
/* use the buffer directly */
@@ -268,10 +301,8 @@ PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length ST
/* {{{ */
PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC TSRMLS_DC)
{
- php_stream_memory_data *ms;
+ php_stream_memory_data *ms = (php_stream_memory_data*)stream->abstract;
- assert(stream != NULL);
- ms = stream->abstract;
assert(ms != NULL);
assert(length != 0);
@@ -288,16 +319,14 @@ typedef struct {
php_stream *innerstream;
size_t smax;
int mode;
+ zval* meta;
} 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;
+ php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
assert(ts != NULL);
if (!ts->innerstream) {
@@ -322,11 +351,9 @@ static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t
/* {{{ */
static size_t php_stream_temp_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
{
- php_stream_temp_data *ts;
+ php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
size_t got;
- assert(stream != NULL);
- ts = stream->abstract;
assert(ts != NULL);
if (!ts->innerstream) {
@@ -335,9 +362,7 @@ static size_t php_stream_temp_read(php_stream *stream, char *buf, size_t count T
got = php_stream_read(ts->innerstream, buf, count);
- if (!got) {
- stream->eof |= ts->innerstream->eof;
- }
+ stream->eof = ts->innerstream->eof;
return got;
}
@@ -347,11 +372,9 @@ static size_t php_stream_temp_read(php_stream *stream, char *buf, size_t count T
/* {{{ */
static int php_stream_temp_close(php_stream *stream, int close_handle TSRMLS_DC)
{
- php_stream_temp_data *ts;
+ php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
int ret;
- assert(stream != NULL);
- ts = stream->abstract;
assert(ts != NULL);
if (ts->innerstream) {
@@ -359,6 +382,10 @@ static int php_stream_temp_close(php_stream *stream, int close_handle TSRMLS_DC)
} else {
ret = 0;
}
+
+ if (ts->meta) {
+ zval_ptr_dtor(&ts->meta);
+ }
efree(ts);
@@ -370,10 +397,7 @@ static int php_stream_temp_close(php_stream *stream, int close_handle TSRMLS_DC)
/* {{{ */
static int php_stream_temp_flush(php_stream *stream TSRMLS_DC)
{
- php_stream_temp_data *ts;
-
- assert(stream != NULL);
- ts = stream->abstract;
+ php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
assert(ts != NULL);
return ts->innerstream ? php_stream_flush(ts->innerstream) : -1;
@@ -384,11 +408,9 @@ static int php_stream_temp_flush(php_stream *stream TSRMLS_DC)
/* {{{ */
static int php_stream_temp_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC)
{
- php_stream_temp_data *ts;
+ php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
int ret;
- assert(stream != NULL);
- ts = stream->abstract;
assert(ts != NULL);
if (!ts->innerstream) {
@@ -397,6 +419,7 @@ static int php_stream_temp_seek(php_stream *stream, off_t offset, int whence, of
}
ret = php_stream_seek(ts->innerstream, offset, whence);
*newoffs = php_stream_tell(ts->innerstream);
+ stream->eof = ts->innerstream->eof;
return ret;
}
@@ -405,14 +428,12 @@ static int php_stream_temp_seek(php_stream *stream, off_t offset, int whence, of
/* {{{ */
static int php_stream_temp_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
{
- php_stream_temp_data *ts;
+ php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
php_stream *file;
size_t memsize;
char *membuf;
off_t pos;
- assert(stream != NULL);
- ts = stream->abstract;
assert(ts != NULL);
if (!ts->innerstream) {
@@ -450,14 +471,41 @@ static int php_stream_temp_cast(php_stream *stream, int castas, void **ret TSRML
}
/* }}} */
+static int php_stream_temp_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
+{
+ php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
+
+ if (!ts || !ts->innerstream) {
+ return -1;
+ }
+ return php_stream_stat(ts->innerstream, ssb);
+}
+/* }}} */
+
+static int php_stream_temp_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) /* {{{ */
+{
+ php_stream_temp_data *ts = (php_stream_temp_data*)stream->abstract;
+
+ switch(option) {
+ case PHP_STREAM_OPTION_META_DATA_API:
+ if (ts->meta) {
+ zend_hash_copy(Z_ARRVAL_P((zval*)ptrparam), Z_ARRVAL_P(ts->meta), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval*));
+ }
+ return PHP_STREAM_OPTION_RETURN_OK;
+ default:
+ return PHP_STREAM_OPTION_RETURN_NOTIMPL;
+ }
+}
+/* }}} */
+
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_stat,
+ php_stream_temp_set_option
};
/* }}} */
@@ -471,6 +519,7 @@ PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STR
self = ecalloc(1, sizeof(*self));
self->smax = max_memory_usage;
self->mode = mode;
+ self->meta = NULL;
stream = php_stream_alloc(&php_stream_temp_ops, self, 0, mode & TEMP_STREAM_READONLY ? "r+b" : "w+b");
stream->flags |= PHP_STREAM_FLAG_NO_BUFFER;
self->innerstream = php_stream_memory_create(mode);
@@ -485,21 +534,182 @@ PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STR
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;
+ php_stream_temp_data *ts;
+ off_t newoffs;
if ((stream = php_stream_temp_create_rel(mode, max_memory_usage)) != NULL) {
if (length) {
assert(buf != NULL);
php_stream_temp_write(stream, buf, length TSRMLS_CC);
+ php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs TSRMLS_CC);
}
- ms = stream->abstract;
- assert(ms != NULL);
- ms->mode = mode;
+ ts = (php_stream_temp_data*)stream->abstract;
+ assert(ts != NULL);
+ ts->mode = mode;
}
return stream;
}
/* }}} */
+php_stream_ops php_stream_rfc2397_ops = {
+ php_stream_temp_write, php_stream_temp_read,
+ php_stream_temp_close, php_stream_temp_flush,
+ "RFC2397",
+ php_stream_temp_seek,
+ php_stream_temp_cast,
+ php_stream_temp_stat,
+ php_stream_temp_set_option
+};
+
+static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+{
+ php_stream *stream;
+ php_stream_temp_data *ts;
+ char *comma, *semi, *sep, *key;
+ size_t mlen, dlen, plen, vlen;
+ off_t newoffs;
+ zval *meta = NULL;
+ int base64 = 0, ilen;
+
+ if (memcmp(path, "data:", 5)) {
+ return NULL;
+ }
+
+ path += 5;
+ dlen = strlen(path);
+
+ if (dlen >= 2 && path[0] == '/' && path[1] == '/') {
+ dlen -= 2;
+ path += 2;
+ }
+
+ if ((comma = memchr(path, ',', dlen)) == NULL) {
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: no comma in URL");
+ return NULL;
+ }
+
+ if (comma != path) {
+ /* meta info */
+ mlen = comma - path;
+ dlen -= mlen;
+ semi = memchr(path, ';', mlen);
+ sep = memchr(path, '/', mlen);
+
+ if (!semi && !sep) {
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal media type");
+ return NULL;
+ }
+
+ MAKE_STD_ZVAL(meta);
+ array_init(meta);
+ if (!semi) { /* there is only a mime type */
+ add_assoc_stringl(meta, "mediatype", path, mlen, 1);
+ mlen = 0;
+ } else if (sep && sep < semi) { /* there is a mime type */
+ plen = semi - path;
+ add_assoc_stringl(meta, "mediatype", path, plen, 1);
+ mlen -= plen;
+ path += plen;
+ } else if (semi != path || mlen != sizeof(";base64")-1 || memcmp(path, ";base64", sizeof(";base64")-1)) { /* must be error since parameters are only allowed after mediatype */
+ zval_ptr_dtor(&meta);
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal media type");
+ return NULL;
+ }
+ /* get parameters and potentially ';base64' */
+ while(semi && (semi == path)) {
+ path++;
+ mlen--;
+ sep = memchr(path, '=', mlen);
+ semi = memchr(path, ';', mlen);
+ if (!sep || (semi && semi < sep)) { /* must be ';base64' or failure */
+ if (mlen != sizeof("base64")-1 || memcmp(path, "base64", sizeof("base64")-1)) {
+ /* must be error since parameters are only allowed after mediatype and we have no '=' sign */
+ zval_ptr_dtor(&meta);
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal parameter");
+ return NULL;
+ }
+ base64 = 1;
+ mlen -= sizeof("base64") - 1;
+ path += sizeof("base64") - 1;
+ break;
+ }
+ /* found parameter ... the heart of cs ppl lies in +1/-1 or was it +2 this time? */
+ plen = sep - path;
+ vlen = (semi ? semi - sep : mlen - plen) - 1 /* '=' */;
+ key = estrndup(path, plen);
+ add_assoc_stringl_ex(meta, key, plen + 1, sep + 1, vlen, 1);
+ efree(key);
+ plen += vlen + 1;
+ mlen -= plen;
+ path += plen;
+ }
+ if (mlen) {
+ zval_ptr_dtor(&meta);
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: illegal URL");
+ return NULL;
+ }
+ } else {
+ MAKE_STD_ZVAL(meta);
+ array_init(meta);
+ }
+ add_assoc_bool(meta, "base64", base64);
+
+ /* skip ',' */
+ comma++;
+ dlen--;
+
+ if (base64) {
+ comma = (char*)php_base64_decode((const unsigned char *)comma, dlen, &ilen);
+ if (!comma) {
+ zval_ptr_dtor(&meta);
+ php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "rfc2397: unable to decode");
+ return NULL;
+ }
+ } else {
+ comma = estrndup(comma, dlen);
+ ilen = dlen = php_url_decode(comma, dlen);
+ }
+
+ if ((stream = php_stream_temp_create_rel(0, ~0u)) != NULL) {
+ /* store data */
+ php_stream_temp_write(stream, comma, ilen TSRMLS_CC);
+ efree(comma);
+ php_stream_temp_seek(stream, 0, SEEK_SET, &newoffs TSRMLS_CC);
+ /* set special stream stuff (enforce exact mode) */
+ vlen = strlen(mode);
+ if (vlen >= sizeof(stream->mode)) {
+ vlen = sizeof(stream->mode) - 1;
+ }
+ memcpy(stream->mode, mode, vlen);
+ stream->mode[vlen] = '\0';
+ stream->ops = &php_stream_rfc2397_ops;
+ ts = (php_stream_temp_data*)stream->abstract;
+ assert(ts != NULL);
+ ts->mode = mode && mode[0] == 'r' ? TEMP_STREAM_READONLY : 0;
+ ts->meta = meta;
+ }
+
+ return stream;
+}
+
+static php_stream_wrapper_ops php_stream_rfc2397_wops = {
+ php_stream_url_wrap_rfc2397,
+ NULL, /* close */
+ NULL, /* fstat */
+ NULL, /* stat */
+ NULL, /* opendir */
+ "RFC2397",
+ NULL, /* unlink */
+ NULL, /* rename */
+ NULL, /* mkdir */
+ NULL /* rmdir */
+};
+
+php_stream_wrapper php_stream_rfc2397_wrapper = {
+ &php_stream_rfc2397_wops,
+ NULL,
+ 0, /* is_url */
+};
/*
* Local variables:
diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h
index 4091235a3..1c037457a 100644
--- a/main/streams/php_streams_int.h
+++ b/main/streams/php_streams_int.h
@@ -16,25 +16,20 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_streams_int.h,v 1.7.2.2 2006/04/22 17:17:40 wez Exp $ */
+/* $Id: php_streams_int.h,v 1.7.2.2.2.1 2006/09/14 09:58:27 dmitry Exp $ */
#if ZEND_DEBUG
-#if USE_ZEND_ALLOC
-# define emalloc_rel_orig(size) \
+#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) \
+#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)))
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 98a7bd636..6a62f021f 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: plain_wrapper.c,v 1.52.2.7 2006/08/22 06:16:19 dmitry Exp $ */
+/* $Id: plain_wrapper.c,v 1.52.2.6.2.8 2006/10/19 09:49:44 dmitry Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -242,10 +242,9 @@ PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STRE
#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);
+ self->is_pipe = GetFileType((HANDLE)handle) == FILE_TYPE_PIPE;
}
}
#endif
@@ -373,7 +372,7 @@ static int php_stdiop_close(php_stream *stream, int close_handle TSRMLS_DC)
data->file = NULL;
}
} else if (data->fd != -1) {
-#ifdef PHP_DEBUG
+#if 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;
@@ -705,7 +704,7 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void
delta = range->offset - loffs;
}
- data->last_mapped_addr = MapViewOfFile(data->file_mapping, acc, 0, loffs, range->length);
+ data->last_mapped_addr = MapViewOfFile(data->file_mapping, acc, 0, loffs, range->length + delta);
if (data->last_mapped_addr) {
/* give them back the address of the start offset they requested */
@@ -1088,7 +1087,18 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, char *dir, int mod
int offset = 0;
buf = estrndup(dir, dir_len);
+
+#ifdef PHP_WIN32
+ e = buf;
+ while (*e) {
+ if (*e == '/') {
+ *e = DEFAULT_SLASH;
+ }
+ e++;
+ }
+#else
e = buf + dir_len;
+#endif
if ((p = memchr(buf, DEFAULT_SLASH, dir_len))) {
offset = p - buf + 1;
@@ -1099,10 +1109,22 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, char *dir, int mod
}
else {
/* find a top level directory we need to create */
- while ( (p = strrchr(buf + offset, DEFAULT_SLASH)) || (p = strrchr(buf, DEFAULT_SLASH)) ) {
+ while ( (p = strrchr(buf + offset, DEFAULT_SLASH)) || ( offset !=1 && (p = strrchr(buf, DEFAULT_SLASH))) ) {
+ int n = 0;
+
*p = '\0';
+ while (p > buf && *(p-1) == DEFAULT_SLASH) {
+ ++n;
+ --p;
+ *p = '\0';
+ }
if (VCWD_STAT(buf, &sb) == 0) {
- *p = DEFAULT_SLASH;
+ while (1) {
+ *p = DEFAULT_SLASH;
+ if (!n) break;
+ --n;
+ ++p;
+ }
break;
}
}
@@ -1116,9 +1138,10 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, char *dir, int mod
}
/* create any needed directories if the creation of the 1st directory worked */
while (++p != e) {
- if (*p == '\0' && *(p + 1) != '\0') {
+ if (*p == '\0') {
*p = DEFAULT_SLASH;
- if ((ret = VCWD_MKDIR(buf, (mode_t)mode)) < 0) {
+ if ((*(p+1) != '\0') &&
+ (ret = VCWD_MKDIR(buf, (mode_t)mode)) < 0) {
if (options & REPORT_ERRORS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
}
@@ -1271,11 +1294,6 @@ not_relative_path:
#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;
}
@@ -1315,11 +1333,13 @@ not_relative_path:
*end = '\0';
end++;
}
+ if (*ptr == '\0') {
+ goto stream_skip;
+ }
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;
+ goto stream_skip;
}
if (PG(safe_mode)) {
@@ -1332,8 +1352,7 @@ not_relative_path:
goto stream_done;
}
}
- ptr = end;
- continue;
+ goto stream_skip;
}
stream = php_stream_fopen_rel(trypath, mode, opened_path, options);
if (stream) {
@@ -1341,6 +1360,7 @@ stream_done:
efree(pathbuf);
return stream;
}
+stream_skip:
ptr = end;
} /* end provided path */
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 745b4c0aa..bd8901388 100755
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.82.2.6 2006/04/22 17:17:40 wez Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.8 2006/10/03 19:51:01 iliaa Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -1198,10 +1198,6 @@ PHPAPI size_t _php_stream_copy_to_mem(php_stream *src, char **buf, size_t maxlen
int min_room = CHUNK_SIZE / 4;
php_stream_statbuf ssbuf;
- if (buf) {
- *buf = NULL;
- }
-
if (maxlen == 0) {
return 0;
}
@@ -1216,7 +1212,7 @@ PHPAPI size_t _php_stream_copy_to_mem(php_stream *src, char **buf, size_t maxlen
p = php_stream_mmap_range(src, php_stream_tell(src), maxlen, PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped);
- if (p) {
+ if (p && mapped) {
*buf = pemalloc_rel_orig(mapped + 1, persistent);
if (*buf) {
@@ -1348,11 +1344,7 @@ PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size
writeptr += didwrite;
}
} else {
- if (maxlen == 0) {
- return haveread;
- } else {
- return 0; /* error */
- }
+ return haveread;
}
if (maxlen - haveread == 0) {
@@ -1470,7 +1462,7 @@ static void clone_wrapper_hash(TSRMLS_D)
php_stream_wrapper *tmp;
ALLOC_HASHTABLE(FG(stream_wrappers));
- zend_hash_init(FG(stream_wrappers), 0, NULL, NULL, 1);
+ zend_hash_init(FG(stream_wrappers), zend_hash_num_elements(&url_stream_wrappers_hash), NULL, NULL, 1);
zend_hash_copy(FG(stream_wrappers), &url_stream_wrappers_hash, NULL, &tmp, sizeof(tmp));
}
@@ -1520,9 +1512,9 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char
n++;
}
- if ((*p == ':') && (n > 1) && !strncmp("://", p, 3)) {
+ if ((*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || !memcmp("data", path, 4))) {
protocol = path;
- } else if (strncasecmp(path, "zlib:", 5) == 0) {
+ } else if (n == 5 && strncasecmp(path, "zlib:", 5) == 0) {
/* BC with older php scripts and zlib wrapper */
protocol = "compress.zlib";
n = 13;
@@ -1530,18 +1522,23 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char
}
if (protocol) {
- if (FAILURE == zend_hash_find(wrapper_hash, (char*)protocol, n, (void**)&wrapperpp)) {
- char wrapper_name[32];
-
- if (n >= sizeof(wrapper_name))
- n = sizeof(wrapper_name) - 1;
- PHP_STRLCPY(wrapper_name, protocol, sizeof(wrapper_name), n);
+ if (FAILURE == zend_hash_find(wrapper_hash, (char*)protocol, n, (void**)&wrapperpp)) {
+ char *tmp = estrndup(protocol, n);
+ php_strtolower(tmp, n);
+ if (FAILURE == zend_hash_find(wrapper_hash, (char*)tmp, n, (void**)&wrapperpp)) {
+ 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);
+ 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);
- wrapperpp = NULL;
- protocol = NULL;
+ wrapperpp = NULL;
+ protocol = NULL;
+ }
+ efree(tmp);
}
}
/* TODO: curl based streams probably support file:// properly */
@@ -1605,7 +1602,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char
return &php_plain_files_wrapper;
}
- if (wrapperpp && (*wrapperpp)->is_url && !PG(allow_url_fopen)) {
+ if ((wrapperpp && (*wrapperpp)->is_url) && (!PG(allow_url_fopen) || ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include))) ) {
if (options & REPORT_ERRORS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
}
diff --git a/main/streams/userspace.c b/main/streams/userspace.c
index e9447a05a..dc99c5c66 100644
--- a/main/streams/userspace.c
+++ b/main/streams/userspace.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: userspace.c,v 1.31.2.3 2006/04/22 17:17:40 wez Exp $ */
+/* $Id: userspace.c,v 1.31.2.3.2.1 2006/08/14 15:01:29 tony2001 Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -231,6 +231,40 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filena
object_init_ex(us->object, uwrap->ce);
ZVAL_REFCOUNT(us->object) = 1;
PZVAL_IS_REF(us->object) = 1;
+
+ if (uwrap->ce->constructor) {
+ zend_fcall_info fci;
+ zend_fcall_info_cache fcc;
+ zval *retval_ptr;
+
+ fci.size = sizeof(fci);
+ fci.function_table = &uwrap->ce->function_table;
+ fci.function_name = NULL;
+ fci.symbol_table = NULL;
+ fci.object_pp = &us->object;
+ fci.retval_ptr_ptr = &retval_ptr;
+ fci.param_count = 0;
+ fci.params = NULL;
+ fci.no_separation = 1;
+
+ fcc.initialized = 1;
+ fcc.function_handler = uwrap->ce->constructor;
+ fcc.calling_scope = EG(scope);
+ fcc.object_pp = &us->object;
+
+ if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute %s::%s()", uwrap->ce->name, uwrap->ce->constructor->common.function_name);
+ zval_dtor(us->object);
+ FREE_ZVAL(us->object);
+ efree(us);
+ FG(user_stream_current_filename) = NULL;
+ return NULL;
+ } else {
+ if (retval_ptr) {
+ zval_ptr_dtor(&retval_ptr);
+ }
+ }
+ }
if (context) {
MAKE_STD_ZVAL(zcontext);
diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c
index 5b7e32917..60084545d 100644
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xp_socket.c,v 1.33.2.2 2006/02/02 18:16:43 pollita Exp $ */
+/* $Id: xp_socket.c,v 1.33.2.2.2.1 2006/10/11 12:53:56 tony2001 Exp $ */
#include "php.h"
#include "ext/standard/file.h"
@@ -495,7 +495,7 @@ static inline char *parse_ip_address_ex(const char *str, int str_len, int *portn
#ifdef HAVE_IPV6
char *p;
- if (*(str) == '[') {
+ if (*(str) == '[' && str_len > 1) {
/* IPV6 notation to specify raw address with port (i.e. [fe80::1]:80) */
p = memchr(str + 1, ']', str_len - 2);
if (!p || *(p + 1) != ':') {
@@ -508,8 +508,11 @@ static inline char *parse_ip_address_ex(const char *str, int str_len, int *portn
return estrndup(str + 1, p - str - 1);
}
#endif
-
- colon = memchr(str, ':', str_len - 1);
+ if (str_len) {
+ colon = memchr(str, ':', str_len - 1);
+ } else {
+ colon = NULL;
+ }
if (colon) {
*portno = atoi(colon + 1);
host = estrndup(str, colon - str);
diff --git a/main/win95nt.h b/main/win95nt.h
index a93e54c51..ec30b428c 100644
--- a/main/win95nt.h
+++ b/main/win95nt.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: win95nt.h,v 1.20.2.2 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: win95nt.h,v 1.20.2.2.2.1 2006/10/19 09:49:44 dmitry Exp $ */
/* Defines and types for Windows 95/NT */
#define HAVE_DECLARED_TIMEZONE
@@ -41,7 +41,7 @@ typedef char * caddr_t;
#ifndef S_ISREG
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
-#define chdir(path) SetCurrentDirectory(path)
+#define chdir(path) _chdir(path)
#define mkdir(a, b) _mkdir(a)
#define rmdir(a) _rmdir(a)
#define getpid _getpid
diff --git a/makedist b/makedist
index 3ab92f129..3f67a498a 100755
--- a/makedist
+++ b/makedist
@@ -24,7 +24,7 @@
#
# Written by Stig Bakken <ssb@guardian.no> 1997-05-28.
#
-# $Id: makedist,v 1.31.4.1 2006/05/12 14:53:58 iliaa Exp $
+# $Id: makedist,v 1.31.6.1 2006/05/12 14:54:10 iliaa Exp $
#
if test "$#" != "2"; then
diff --git a/pear/Makefile.frag b/pear/Makefile.frag
index 7c63801ca..eb8e289cb 100644
--- a/pear/Makefile.frag
+++ b/pear/Makefile.frag
@@ -3,7 +3,7 @@
peardir=$(PEAR_INSTALLDIR)
# Skip all php.ini files altogether
-PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dsafe_mode=0 -derror_reporting=E_ALL -dmemory_limit=-1 -ddetect_unicode=0
+PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dsafe_mode=0 -dopen_basedir= -derror_reporting=E_ALL -dmemory_limit=-1 -ddetect_unicode=0
install-pear-installer: $(SAPI_CLI_PATH)
@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) $(builddir)/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)"
diff --git a/pear/install-pear-nozlib.phar b/pear/install-pear-nozlib.phar
index c30900dc9..e5f43794b 100644
--- a/pear/install-pear-nozlib.phar
+++ b/pear/install-pear-nozlib.phar
@@ -1,649 +1,667 @@
-<?php #PHP_ARCHIVE_HEADER-0.8.0
-error_reporting(E_ALL);
-if (function_exists('mb_internal_encoding')) {
- mb_internal_encoding('ASCII');
-}
-if (!class_exists('PHP_Archive')) {/**
- * PHP_Archive Class (implements .phar)
- *
- * @package PHP_Archive
- * @category PHP
- */
-/**
- * Flag for GZ compression
- */
-define('PHP_ARCHIVE_COMPRESSED', 1);
-/**
- * PHP_Archive Class (implements .phar)
- *
- * PHAR files a singular archive from which an entire application can run.
- * To use it, simply package it using {@see PHP_Archive_Creator} and use phar://
- * URIs to your includes. i.e. require_once 'phar://config.php' will include config.php
- * from the root of the PHAR file.
- *
- * Gz code borrowed from the excellent File_Archive package by Vincent Lascaux.
- *
- * @copyright Copyright David Shafik and Synaptic Media 2004. All rights reserved.
- * @author Davey Shafik <davey@synapticmedia.net>
- * @author Greg Beaver <cellog@php.net>
- * @link http://www.synapticmedia.net Synaptic Media
- * @version Id: Archive.php,v 1.28 2006/03/03 21:35:29 cellog Exp $
- * @package PHP_Archive
- * @category PHP
- */
-
-class PHP_Archive
-{
- /**
- * Whether this archive is compressed with zlib
- *
- * @var bool
- */
- private $_compressed;
- /**
- * @var string Real path to the .phar archive
- */
- private $_archiveName = null;
- /**
- * Current file name in the phar
- * @var string
- */
- protected $currentFilename = null;
- /**
- * Length of current file in the phar
- * @var string
- */
- protected $internalFileLength = null;
- /**
- * Current file statistics (size, creation date, etc.)
- * @var string
- */
- protected $currentStat = null;
- /**
- * @var resource|null Pointer to open .phar
- */
- protected $fp = null;
- /**
- * @var int Current Position of the pointer
- */
- protected $position = 0;
-
- /**
- * Map actual realpath of phars to meta-data about the phar
- *
- * Data is indexed by the alias that is used by internal files. In other
- * words, if a file is included via:
- * <code>
- * require_once 'phar://PEAR.phar/PEAR/Installer.php';
- * </code>
- * then the alias is "PEAR.phar"
- *
- * Information stored is the actual file name, a boolean indicating whether
- * this .phar is compressed with zlib, and the precise offset of internal files
- * within the .phar, used with the {@link $_manifest} to load actual file contents
- * @var array
- */
- private static $_pharMapping = array();
- /**
- * File listing for the .phar
- *
- * The manifest is indexed per phar.
- *
- * Files within the .phar are indexed by their relative path within the
- * .phar. Each file has this information in its internal array
- *
- * - 0 = uncompressed file size
- * - 1 = timestamp of when file was added to phar
- * - 2 = offset of file within phar relative to internal file's start
- * - 3 = compressed file size (actual size in the phar)
- * @var array
- */
- private static $_manifest = array();
- /**
- * Absolute offset of internal files within the .phar, indexed by absolute
- * path to the .phar
- *
- * @var array
- */
- private static $_fileStart = array();
- /**
- * file name of the phar
- *
- * @var string
- */
- private $_basename;
-
- /**
- * Map a full real file path to an alias used to refer to the .phar
- *
- * This function can only be called from the initialization of the .phar itself.
- * Any attempt to call from outside the .phar or to re-alias the .phar will fail
- * as a security measure.
- * @param string $file full realpath() filepath, like /path/to/go-pear.phar
- * @param string $alias alias used in opening a file within the phar
- * like phar://go-pear.phar/file
- * @param bool $compressed determines whether to attempt zlib uncompression
- * on accessing internal files
- * @param int $dataoffset the value of __COMPILER_HALT_OFFSET__
- */
- public static final function mapPhar($file, $dataoffset)
- {
- $file = realpath($file);
- // this ensures that this is safe
- if (!in_array($file, get_included_files())) {
- die('SECURITY ERROR: PHP_Archive::mapPhar can only be called from within ' .
- 'the phar that initiates it');
- }
- if (!is_array(self::$_pharMapping)) {
- self::$_pharMapping = array();
- }
- if (!isset(self::$_manifest[$file])) {
- $fp = fopen($file, 'rb');
- // seek to __HALT_COMPILER_OFFSET__
- fseek($fp, $dataoffset);
- $manifest_length = unpack('Vlen', fread($fp, 4));
- $info = self::_unserializeManifest(fread($fp, $manifest_length['len']));
- if (!$info) {
- die; // error declared in unserializeManifest
- }
- $alias = $info['alias'];
- self::$_manifest[$file] = $info['manifest'];
- $compressed = $info['compressed'];
- self::$_fileStart[$file] = ftell($fp);
- fclose($fp);
- }
- if ($compressed) {
- if (!function_exists('gzinflate')) {
- die('Error: zlib extension is not enabled - gzinflate() function needed' .
- ' for compressed .phars');
- }
- }
- if (isset(self::$_pharMapping[$alias])) {
- die('ERROR: PHP_Archive::mapPhar has already been called for alias "' .
- $alias . '" cannot re-alias to "' . $file . '"');
- }
- self::$_pharMapping[$alias] = array($file, $compressed, $dataoffset);
- }
-
- /**
- * @param string
- */
- private static function processFile($path)
- {
- if ($path == '.') {
- return '';
- }
- $std = str_replace("\\", "/", $path);
- while ($std != ($std = ereg_replace("[^\/:?]+/\.\./", "", $std))) ;
- $std = str_replace("/./", "", $std);
- if (strlen($std) > 1 && $std[0] == '/') {
- $std = substr($std, 1);
- }
- if (strncmp($std, "./", 2) == 0) {
- return substr($std, 2);
- } else {
- return $std;
- }
- }
-
- /**
- * Seek in the master archive to a matching file or directory
- * @param string
- */
- protected function selectFile($path, $allowdirs = true)
- {
- $std = self::processFile($path);
- if (isset(self::$_manifest[$this->_archiveName][$path])) {
- $this->_setCurrentFile($path);
- return true;
- }
- if (!$allowdirs) {
- return 'Error: "' . $path . '" is not a file in phar "' . $this->_basename . '"';
- }
- foreach (self::$_manifest[$this->_archiveName] as $file => $info) {
- if (empty($std) ||
- //$std is a directory
- strncmp($std.'/', $path, strlen($std)+1) == 0) {
- $this->currentFilename = $this->internalFileLength = $this->currentStat = null;
- return true;
- }
- }
- return 'Error: "' . $path . '" not found in phar "' . $this->_basename . '"';
- }
-
- private function _setCurrentFile($path)
- {
- $this->currentStat = array(
- 2 => 0100444, // file mode, readable by all, writeable by none
- 4 => 0, // uid
- 5 => 0, // gid
- 7 => self::$_manifest[$this->_archiveName][$path][0], // size
- 9 => self::$_manifest[$this->_archiveName][$path][1], // creation time
- );
- $this->currentFilename = $path;
- $this->internalFileLength = self::$_manifest[$this->_archiveName][$path][2];
- // seek to offset of file header within the .phar
- if (is_resource(@$this->fp)) {
- fseek($this->fp, self::$_fileStart[$this->_archiveName] + self::$_manifest[$this->_archiveName][$path][5]);
- }
- }
-
- /**
- * Seek to a file within the master archive, and extract its contents
- * @param string
- * @return array|string an array containing an error message string is returned
- * upon error, otherwise the file contents are returned
- */
- public function extractFile($path)
- {
- $this->fp = @fopen($this->_archiveName, "rb");
- if (!$this->fp) {
- return array('Error: cannot open phar "' . $this->_archiveName . '"');
- }
- if (($e = $this->selectFile($path, false)) === true) {
- $data = '';
- $count = $this->internalFileLength;
- while ($count) {
- if ($count < 8192) {
- $data .= @fread($this->fp, $count);
- $count = 0;
- } else {
- $count -= 8192;
- $data .= @fread($this->fp, 8192);
- }
- }
- @fclose($this->fp);
- if (self::$_manifest[$this->_archiveName][$path][4] & PHP_ARCHIVE_COMPRESSED) {
- $data = gzinflate($data);
- }
- if (!isset(self::$_manifest[$this->_archiveName][$path]['ok'])) {
- if (strlen($data) != $this->currentStat[7]) {
- return array("Not valid internal .phar file (size error {$size} != " .
- $this->currentStat[7] . ")");
- }
- if (self::$_manifest[$this->_archiveName][$path][3] != crc32($data)) {
- return array("Not valid internal .phar file (checksum error)");
- }
- self::$_manifest[$this->_archiveName][$path]['ok'] = true;
- }
- return $data;
- } else {
- @fclose($this->fp);
- return array($e);
- }
- }
-
- /**
- * Locate the .phar archive in the include_path and detect the file to open within
- * the archive.
- *
- * Possible parameters are phar://filename_within_phar.ext or
- * phar://pharname.phar/filename_within_phar.ext
- *
- * phar://filename_within_phar.ext will simply use the last .phar opened.
- * @param string a file within the archive
- * @return string the filename within the .phar to retrieve
- */
- public function initializeStream($file)
- {
- $info = parse_url($file);
- if (!isset($info['host']) || !count(self::$_pharMapping)) {
- // malformed internal file
- return false;
- }
- if (!isset($info['path'])) {
- // last opened phar is requested
- $info['path'] = $info['host'];
- $info['host'] = '';
- } elseif (strlen($info['path']) > 1) {
- $info['path'] = substr($info['path'], 1);
- }
- if (isset(self::$_pharMapping[$info['host']])) {
- $this->_basename = $info['host'];
- $this->_archiveName = self::$_pharMapping[$info['host']][0];
- $this->_compressed = self::$_pharMapping[$info['host']][1];
- } else {
- // no such phar has been included, or last opened phar is requested
- $pharinfo = end(self::$_pharMapping);
- $this->_basename = key(self::$_pharMapping);
- $this->_archiveName = $pharinfo[0];
- $this->_compressed = $pharinfo[1];
- }
- $file = $info['path'];
- return $file;
- }
-
- /**
- * extract the manifest into an internal array
- *
- * @param string $manifest
- * @return false|array
- */
- private static function _unserializeManifest($manifest)
- {
- // retrieve the number of files in the manifest
- $info = unpack('V', substr($manifest, 0, 4));
- $apiver = substr($manifest, 4, 2);
- $apiver = bin2hex($apiver);
- $apiver_dots = hexdec($apiver[0]) . '.' . hexdec($apiver[1]) . '.' . hexdec($apiver[2]);
- $majorcompat = hexdec($apiver[0]);
- $calcapi = explode('.', '0.8.0');
- if ($calcapi[0] != $majorcompat) {
- trigger_error('Phar is incompatible API version ' . $apiver_dots . ', but ' .
- 'PHP_Archive is API version 0.8.0');
- return false;
- }
- if ($calcapi[0] === '0') {
- if ('0.8.0' != $apiver_dots) {
- trigger_error('Phar is API version ' . $apiver_dots .
- ', but PHP_Archive is API version 0.8.0', E_USER_ERROR);
- return false;
- }
- }
- $ret = array('compressed' => $apiver[3]);
- $aliaslen = unpack('V', substr($manifest, 6, 4));
- $ret['alias'] = substr($manifest, 10, $aliaslen[1]);
- $manifest = substr($manifest, 10 + $aliaslen[1]);
- $offset = 0;
- $start = 0;
- for ($i = 0; $i < $info[1]; $i++) {
- // length of the file name
- $len = unpack('V', substr($manifest, $start, 4));
- $start += 4;
- // file name
- $savepath = substr($manifest, $start, $len[1]);
- $start += $len[1];
- // retrieve manifest data:
- // 0 = uncompressed file size
- // 1 = timestamp of when file was added to phar
- // 2 = compressed filesize
- // 3 = crc32
- // 4 = flags
- $ret['manifest'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ce', substr($manifest, $start, 17)));
- $ret['manifest'][$savepath][5] = $offset;
- $offset += $ret['manifest'][$savepath][2];
- $start += 17;
- }
- return $ret;
- }
-
- /**
- * Open the requested file - PHP streams API
- *
- * @param string $file String provided by the Stream wrapper
- * @access private
- */
- public function stream_open($file)
- {
- return $this->_streamOpen($file);
- }
-
- /**
- * @param string filename to opne, or directory name
- * @param bool if true, a directory will be matched, otherwise only files
- * will be matched
- * @uses trigger_error()
- * @return bool success of opening
- * @access private
- */
- private function _streamOpen($file, $searchForDir = false)
- {
- $path = $this->initializeStream($file);
- if (!$path) {
- trigger_error('Error: Unknown phar in "' . $file . '"', E_USER_ERROR);
- }
- if (is_array($this->file = $this->extractFile($path))) {
- trigger_error($this->file[0], E_USER_ERROR);
- return false;
- }
- if ($path != $this->currentFilename) {
- if (!$searchForDir) {
- trigger_error("Cannot open '$file', is a directory", E_USER_ERROR);
- return false;
- } else {
- $this->file = '';
- return true;
- }
- }
-
- if (!is_null($this->file) && $this->file !== false) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Read the data - PHP streams API
- *
- * @param int
- * @access private
- */
- public function stream_read($count)
- {
- $ret = substr($this->file, $this->position, $count);
- $this->position += strlen($ret);
- return $ret;
- }
-
- /**
- * Whether we've hit the end of the file - PHP streams API
- * @access private
- */
- function stream_eof()
- {
- return $this->position >= $this->currentStat[7];
- }
-
- /**
- * For seeking the stream - PHP streams API
- * @param int
- * @param SEEK_SET|SEEK_CUR|SEEK_END
- * @access private
- */
- public function stream_seek($pos, $whence)
- {
- switch ($whence) {
- case SEEK_SET:
- if ($pos < 0) {
- return false;
- }
- $this->position = $pos;
- break;
- case SEEK_CUR:
- if ($pos + $this->currentStat[7] < 0) {
- return false;
- }
- $this->position += $pos;
- break;
- case SEEK_END:
- if ($pos + $this->currentStat[7] < 0) {
- return false;
- }
- $this->position = $pos + $this->currentStat[7];
- default:
- return false;
- }
- return true;
- }
-
- /**
- * The current position in the stream - PHP streams API
- * @access private
- */
- public function stream_tell()
- {
- return $this->position;
- }
-
- /**
- * The result of an fstat call, returns mod time from creation, and file size -
- * PHP streams API
- * @uses _stream_stat()
- * @access private
- */
- public function stream_stat()
- {
- return $this->_stream_stat();
- }
-
- /**
- * Retrieve statistics on a file or directory within the .phar
- * @param string file/directory to stat
- * @access private
- */
- public function _stream_stat($file = null)
- {
- $std = $file ? self::processFile($file) : $this->currentFilename;
- if ($file) {
- if (isset(self::$_manifest[$this->_archiveName][$file])) {
- $this->_setCurrentFile($file);
- $isdir = false;
- } else {
- $isdir = true;
- }
- } else {
- $isdir = false; // open streams must be files
- }
- $mode = $isdir ? 0040444 : 0100444;
- // 040000 = dir, 010000 = file
- // everything is readable, nothing is writeable
- return array(
- 0, 0, $mode, 0, 0, 0, 0, 0, 0, 0, 0, 0, // non-associative indices
- 'dev' => 0, 'ino' => 0,
- 'mode' => $mode,
- 'nlink' => 0, 'uid' => 0, 'gid' => 0, 'rdev' => 0, 'blksize' => 0, 'blocks' => 0,
- 'size' => $this->currentStat[7],
- 'atime' => $this->currentStat[9],
- 'mtime' => $this->currentStat[9],
- 'ctime' => $this->currentStat[9],
- );
- }
-
- /**
- * Stat a closed file or directory - PHP streams API
- * @param string
- * @param int
- * @access private
- */
- public function url_stat($url, $flags)
- {
- $path = $this->initializeStream($url);
- return $this->_stream_stat($path);
- }
-
- /**
- * Open a directory in the .phar for reading - PHP streams API
- * @param string directory name
- * @access private
- */
- public function dir_opendir($path)
- {
- $info = parse_url($path);
- $path = !empty($info['path']) ?
- $info['host'] . $info['path'] : $info['host'] . '/';
- $path = $this->initializeStream('phar://' . $path);
- if (isset(self::$_manifest[$this->_archiveName][$path])) {
- trigger_error('Error: "' . $path . '" is a file, and cannot be opened with opendir',
- E_USER_ERROR);
- return false;
- }
- if ($path == false) {
- trigger_error('Error: Unknown phar in "' . $file . '"', E_USER_ERROR);
- return false;
- }
- $this->fp = @fopen($this->_archiveName, "rb");
- if (!$this->fp) {
- trigger_error('Error: cannot open phar "' . $this->_archiveName . '"');
- return false;
- }
- $this->_dirFiles = array();
- foreach (self::$_manifest[$this->_archiveName] as $file => $info) {
- if ($path == '/') {
- if (strpos($file, '/')) {
- $this->_dirFiles[array_shift($a = explode('/', $file))] = true;
- } else {
- $this->_dirFiles[$file] = true;
- }
- } elseif (strpos($file, $path) === 0) {
- $fname = substr($file, strlen($path) + 1);
- if (strpos($fname, '/')) {
- $this->_dirFiles[array_unshift($a = explode('/', $fname))] = true;
- } else {
- $this->_dirFiles[$fname] = true;
- }
- }
- }
- @fclose($this->fp);
- @uksort($this->_dirFiles, 'strnatcmp');
- return true;
- }
-
- /**
- * Read the next directory entry - PHP streams API
- * @access private
- */
- public function dir_readdir()
- {
- $ret = key($this->_dirFiles);
- @next($this->_dirFiles);
- if (!$ret) {
- return false;
- }
- return $ret;
- }
-
- /**
- * Close a directory handle opened with opendir() - PHP streams API
- * @access private
- */
- public function dir_closedir()
- {
- $this->_dirFiles = array();
- reset($this->_dirFiles);
- return true;
- }
-
- /**
- * Rewind to the first directory entry - PHP streams API
- * @access private
- */
- public function dir_rewinddir()
- {
- reset($this->_dirFiles);
- return true;
- }
-
- /**
- * API version of this class
- * @return string
- */
- public final function APIVersion()
- {
- return '0.8.0';
- }
-}}
-if (!class_exists('Phar')) {
- if (!in_array('phar', stream_get_wrappers())) {
- stream_wrapper_register('phar', 'PHP_Archive');
- }
- PHP_Archive::mapPhar(__FILE__, __COMPILER_HALT_OFFSET__);
-} else {
- Phar::mapPhar();
-}
-if (class_exists('PHP_Archive') && !in_array('phar', stream_get_wrappers())) {
- stream_wrapper_register('phar', 'PHP_Archive');
-}
-@ini_set('memory_limit', -1);
-
-require_once 'phar://install-pear-nozlib.phar/index.php';
-__HALT_COMPILER(); 
-
-
-
-
-
-
+<?php #PHP_ARCHIVE_HEADER-0.8.0
+error_reporting(E_ALL);
+if (function_exists('mb_internal_encoding')) {
+ mb_internal_encoding('ASCII');
+}
+if (!class_exists('PHP_Archive')) {/**
+ * PHP_Archive Class (implements .phar)
+ *
+ * @package PHP_Archive
+ * @category PHP
+ */
+/**
+ * Flag for GZ compression
+ */
+define('PHP_ARCHIVE_COMPRESSED', 1);
+/**
+ * PHP_Archive Class (implements .phar)
+ *
+ * PHAR files a singular archive from which an entire application can run.
+ * To use it, simply package it using {@see PHP_Archive_Creator} and use phar://
+ * URIs to your includes. i.e. require_once 'phar://config.php' will include config.php
+ * from the root of the PHAR file.
+ *
+ * Gz code borrowed from the excellent File_Archive package by Vincent Lascaux.
+ *
+ * @copyright Copyright David Shafik and Synaptic Media 2004. All rights reserved.
+ * @author Davey Shafik <davey@synapticmedia.net>
+ * @author Greg Beaver <cellog@php.net>
+ * @link http://www.synapticmedia.net Synaptic Media
+ * @version Id: Archive.php,v 1.33 2006/07/18 23:31:47 cellog Exp $
+ * @package PHP_Archive
+ * @category PHP
+ */
+
+class PHP_Archive
+{
+ /**
+ * Whether this archive is compressed with zlib
+ *
+ * @var bool
+ */
+ private $_compressed;
+ /**
+ * @var string Real path to the .phar archive
+ */
+ private $_archiveName = null;
+ /**
+ * Current file name in the phar
+ * @var string
+ */
+ protected $currentFilename = null;
+ /**
+ * Length of current file in the phar
+ * @var string
+ */
+ protected $internalFileLength = null;
+ /**
+ * Current file statistics (size, creation date, etc.)
+ * @var string
+ */
+ protected $currentStat = null;
+ /**
+ * @var resource|null Pointer to open .phar
+ */
+ protected $fp = null;
+ /**
+ * @var int Current Position of the pointer
+ */
+ protected $position = 0;
+
+ /**
+ * Map actual realpath of phars to meta-data about the phar
+ *
+ * Data is indexed by the alias that is used by internal files. In other
+ * words, if a file is included via:
+ * <code>
+ * require_once 'phar://PEAR.phar/PEAR/Installer.php';
+ * </code>
+ * then the alias is "PEAR.phar"
+ *
+ * Information stored is the actual file name, a boolean indicating whether
+ * this .phar is compressed with zlib, and the precise offset of internal files
+ * within the .phar, used with the {@link $_manifest} to load actual file contents
+ * @var array
+ */
+ private static $_pharMapping = array();
+ /**
+ * File listing for the .phar
+ *
+ * The manifest is indexed per phar.
+ *
+ * Files within the .phar are indexed by their relative path within the
+ * .phar. Each file has this information in its internal array
+ *
+ * - 0 = uncompressed file size
+ * - 1 = timestamp of when file was added to phar
+ * - 2 = offset of file within phar relative to internal file's start
+ * - 3 = compressed file size (actual size in the phar)
+ * @var array
+ */
+ private static $_manifest = array();
+ /**
+ * Absolute offset of internal files within the .phar, indexed by absolute
+ * path to the .phar
+ *
+ * @var array
+ */
+ private static $_fileStart = array();
+ /**
+ * file name of the phar
+ *
+ * @var string
+ */
+ private $_basename;
+
+ /**
+ * Map a full real file path to an alias used to refer to the .phar
+ *
+ * This function can only be called from the initialization of the .phar itself.
+ * Any attempt to call from outside the .phar or to re-alias the .phar will fail
+ * as a security measure.
+ * @param string $file full realpath() filepath, like /path/to/go-pear.phar
+ * @param string $alias alias used in opening a file within the phar
+ * like phar://go-pear.phar/file
+ * @param bool $compressed determines whether to attempt zlib uncompression
+ * on accessing internal files
+ * @param int $dataoffset the value of __COMPILER_HALT_OFFSET__
+ */
+ public static final function mapPhar($file, $dataoffset)
+ {
+ $file = realpath($file);
+ // this ensures that this is safe
+ if (!in_array($file, get_included_files())) {
+ die('SECURITY ERROR: PHP_Archive::mapPhar can only be called from within ' .
+ 'the phar that initiates it');
+ }
+ if (!is_array(self::$_pharMapping)) {
+ self::$_pharMapping = array();
+ }
+ if (!isset(self::$_manifest[$file])) {
+ $fp = fopen($file, 'rb');
+ // seek to __HALT_COMPILER_OFFSET__
+ fseek($fp, $dataoffset);
+ $manifest_length = unpack('Vlen', fread($fp, 4));
+ $manifest = '';
+ $last = '1';
+ while (strlen($last) && strlen($manifest) < $manifest_length['len']) {
+ $read = 8192;
+ if ($manifest_length['len'] - strlen($manifest) < 8192) {
+ $read = $manifest_length['len'] - strlen($manifest);
+ }
+ $last = fread($fp, $read);
+ $manifest .= $last;
+ }
+ if (strlen($manifest) < $manifest_length['len']) {
+ die('ERROR: manifest length read was "' . strlen($manifest) .'" should be "' .
+ $manifest_length['len'] . '"');
+ }
+ $info = self::_unserializeManifest($manifest);
+ if (!$info) {
+ die; // error declared in unserializeManifest
+ }
+ $alias = $info['alias'];
+ self::$_manifest[$file] = $info['manifest'];
+ $compressed = $info['compressed'];
+ self::$_fileStart[$file] = ftell($fp);
+ fclose($fp);
+ }
+ if ($compressed) {
+ if (!function_exists('gzinflate')) {
+ die('Error: zlib extension is not enabled - gzinflate() function needed' .
+ ' for compressed .phars');
+ }
+ }
+ if (isset(self::$_pharMapping[$alias])) {
+ die('ERROR: PHP_Archive::mapPhar has already been called for alias "' .
+ $alias . '" cannot re-alias to "' . $file . '"');
+ }
+ self::$_pharMapping[$alias] = array($file, $compressed, $dataoffset);
+ }
+
+ /**
+ * @param string
+ */
+ private static function processFile($path)
+ {
+ if ($path == '.') {
+ return '';
+ }
+ $std = str_replace("\\", "/", $path);
+ while ($std != ($std = ereg_replace("[^\/:?]+/\.\./", "", $std))) ;
+ $std = str_replace("/./", "", $std);
+ if (strlen($std) > 1 && $std[0] == '/') {
+ $std = substr($std, 1);
+ }
+ if (strncmp($std, "./", 2) == 0) {
+ return substr($std, 2);
+ } else {
+ return $std;
+ }
+ }
+
+ /**
+ * Seek in the master archive to a matching file or directory
+ * @param string
+ */
+ protected function selectFile($path, $allowdirs = true)
+ {
+ $std = self::processFile($path);
+ if (isset(self::$_manifest[$this->_archiveName][$path])) {
+ $this->_setCurrentFile($path);
+ return true;
+ }
+ if (!$allowdirs) {
+ return 'Error: "' . $path . '" is not a file in phar "' . $this->_basename . '"';
+ }
+ foreach (self::$_manifest[$this->_archiveName] as $file => $info) {
+ if (empty($std) ||
+ //$std is a directory
+ strncmp($std.'/', $path, strlen($std)+1) == 0) {
+ $this->currentFilename = $this->internalFileLength = $this->currentStat = null;
+ return true;
+ }
+ }
+ return 'Error: "' . $path . '" not found in phar "' . $this->_basename . '"';
+ }
+
+ private function _setCurrentFile($path)
+ {
+ $this->currentStat = array(
+ 2 => 0100444, // file mode, readable by all, writeable by none
+ 4 => 0, // uid
+ 5 => 0, // gid
+ 7 => self::$_manifest[$this->_archiveName][$path][0], // size
+ 9 => self::$_manifest[$this->_archiveName][$path][1], // creation time
+ );
+ $this->currentFilename = $path;
+ $this->internalFileLength = self::$_manifest[$this->_archiveName][$path][2];
+ // seek to offset of file header within the .phar
+ if (is_resource(@$this->fp)) {
+ fseek($this->fp, self::$_fileStart[$this->_archiveName] + self::$_manifest[$this->_archiveName][$path][5]);
+ }
+ }
+
+ /**
+ * Seek to a file within the master archive, and extract its contents
+ * @param string
+ * @return array|string an array containing an error message string is returned
+ * upon error, otherwise the file contents are returned
+ */
+ public function extractFile($path)
+ {
+ $this->fp = @fopen($this->_archiveName, "rb");
+ if (!$this->fp) {
+ return array('Error: cannot open phar "' . $this->_archiveName . '"');
+ }
+ if (($e = $this->selectFile($path, false)) === true) {
+ $data = '';
+ $count = $this->internalFileLength;
+ while ($count) {
+ if ($count < 8192) {
+ $data .= @fread($this->fp, $count);
+ $count = 0;
+ } else {
+ $count -= 8192;
+ $data .= @fread($this->fp, 8192);
+ }
+ }
+ @fclose($this->fp);
+ if (self::$_manifest[$this->_archiveName][$path][4] & PHP_ARCHIVE_COMPRESSED) {
+ $data = gzinflate($data);
+ }
+ if (!isset(self::$_manifest[$this->_archiveName][$path]['ok'])) {
+ if (strlen($data) != $this->currentStat[7]) {
+ return array("Not valid internal .phar file (size error {$size} != " .
+ $this->currentStat[7] . ")");
+ }
+ if (self::$_manifest[$this->_archiveName][$path][3] != crc32($data)) {
+ return array("Not valid internal .phar file (checksum error)");
+ }
+ self::$_manifest[$this->_archiveName][$path]['ok'] = true;
+ }
+ return $data;
+ } else {
+ @fclose($this->fp);
+ return array($e);
+ }
+ }
+
+ /**
+ * Locate the .phar archive in the include_path and detect the file to open within
+ * the archive.
+ *
+ * Possible parameters are phar://filename_within_phar.ext or
+ * phar://pharname.phar/filename_within_phar.ext
+ *
+ * phar://filename_within_phar.ext will simply use the last .phar opened.
+ * @param string a file within the archive
+ * @return string the filename within the .phar to retrieve
+ */
+ public function initializeStream($file)
+ {
+ $info = parse_url($file);
+ if (!isset($info['host']) || !count(self::$_pharMapping)) {
+ // malformed internal file
+ return false;
+ }
+ if (!isset($info['path'])) {
+ // last opened phar is requested
+ $info['path'] = $info['host'];
+ $info['host'] = '';
+ } elseif (strlen($info['path']) > 1) {
+ $info['path'] = substr($info['path'], 1);
+ }
+ if (isset(self::$_pharMapping[$info['host']])) {
+ $this->_basename = $info['host'];
+ $this->_archiveName = self::$_pharMapping[$info['host']][0];
+ $this->_compressed = self::$_pharMapping[$info['host']][1];
+ } else {
+ // no such phar has been included, or last opened phar is requested
+ $pharinfo = end(self::$_pharMapping);
+ $this->_basename = key(self::$_pharMapping);
+ $this->_archiveName = $pharinfo[0];
+ $this->_compressed = $pharinfo[1];
+ }
+ $file = $info['path'];
+ return $file;
+ }
+
+ /**
+ * extract the manifest into an internal array
+ *
+ * @param string $manifest
+ * @return false|array
+ */
+ private static function _unserializeManifest($manifest)
+ {
+ // retrieve the number of files in the manifest
+ $info = unpack('V', substr($manifest, 0, 4));
+ $apiver = substr($manifest, 4, 2);
+ $apiver = bin2hex($apiver);
+ $apiver_dots = hexdec($apiver[0]) . '.' . hexdec($apiver[1]) . '.' . hexdec($apiver[2]);
+ $majorcompat = hexdec($apiver[0]);
+ $calcapi = explode('.', '0.8.0');
+ if ($calcapi[0] != $majorcompat) {
+ trigger_error('Phar is incompatible API version ' . $apiver_dots . ', but ' .
+ 'PHP_Archive is API version 0.8.0');
+ return false;
+ }
+ if ($calcapi[0] === '0') {
+ if ('0.8.0' != $apiver_dots) {
+ trigger_error('Phar is API version ' . $apiver_dots .
+ ', but PHP_Archive is API version 0.8.0', E_USER_ERROR);
+ return false;
+ }
+ }
+ $ret = array('compressed' => $apiver[3]);
+ $aliaslen = unpack('V', substr($manifest, 6, 4));
+ $ret['alias'] = substr($manifest, 10, $aliaslen[1]);
+ $manifest = substr($manifest, 10 + $aliaslen[1]);
+ $offset = 0;
+ $start = 0;
+ for ($i = 0; $i < $info[1]; $i++) {
+ // length of the file name
+ $len = unpack('V', substr($manifest, $start, 4));
+ $start += 4;
+ // file name
+ $savepath = substr($manifest, $start, $len[1]);
+ $start += $len[1];
+ // retrieve manifest data:
+ // 0 = uncompressed file size
+ // 1 = timestamp of when file was added to phar
+ // 2 = compressed filesize
+ // 3 = crc32
+ // 4 = flags
+ $ret['manifest'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ce', substr($manifest, $start, 17)));
+ $ret['manifest'][$savepath][5] = $offset;
+ $offset += $ret['manifest'][$savepath][2];
+ $start += 17;
+ }
+ return $ret;
+ }
+
+ /**
+ * Open the requested file - PHP streams API
+ *
+ * @param string $file String provided by the Stream wrapper
+ * @access private
+ */
+ public function stream_open($file)
+ {
+ return $this->_streamOpen($file);
+ }
+
+ /**
+ * @param string filename to opne, or directory name
+ * @param bool if true, a directory will be matched, otherwise only files
+ * will be matched
+ * @uses trigger_error()
+ * @return bool success of opening
+ * @access private
+ */
+ private function _streamOpen($file, $searchForDir = false)
+ {
+ $path = $this->initializeStream($file);
+ if (!$path) {
+ trigger_error('Error: Unknown phar in "' . $file . '"', E_USER_ERROR);
+ }
+ if (is_array($this->file = $this->extractFile($path))) {
+ trigger_error($this->file[0], E_USER_ERROR);
+ return false;
+ }
+ if ($path != $this->currentFilename) {
+ if (!$searchForDir) {
+ trigger_error("Cannot open '$file', is a directory", E_USER_ERROR);
+ return false;
+ } else {
+ $this->file = '';
+ return true;
+ }
+ }
+
+ if (!is_null($this->file) && $this->file !== false) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Read the data - PHP streams API
+ *
+ * @param int
+ * @access private
+ */
+ public function stream_read($count)
+ {
+ $ret = substr($this->file, $this->position, $count);
+ $this->position += strlen($ret);
+ return $ret;
+ }
+
+ /**
+ * Whether we've hit the end of the file - PHP streams API
+ * @access private
+ */
+ function stream_eof()
+ {
+ return $this->position >= $this->currentStat[7];
+ }
+
+ /**
+ * For seeking the stream - PHP streams API
+ * @param int
+ * @param SEEK_SET|SEEK_CUR|SEEK_END
+ * @access private
+ */
+ public function stream_seek($pos, $whence)
+ {
+ switch ($whence) {
+ case SEEK_SET:
+ if ($pos < 0) {
+ return false;
+ }
+ $this->position = $pos;
+ break;
+ case SEEK_CUR:
+ if ($pos + $this->currentStat[7] < 0) {
+ return false;
+ }
+ $this->position += $pos;
+ break;
+ case SEEK_END:
+ if ($pos + $this->currentStat[7] < 0) {
+ return false;
+ }
+ $this->position = $pos + $this->currentStat[7];
+ default:
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * The current position in the stream - PHP streams API
+ * @access private
+ */
+ public function stream_tell()
+ {
+ return $this->position;
+ }
+
+ /**
+ * The result of an fstat call, returns mod time from creation, and file size -
+ * PHP streams API
+ * @uses _stream_stat()
+ * @access private
+ */
+ public function stream_stat()
+ {
+ return $this->_stream_stat();
+ }
+
+ /**
+ * Retrieve statistics on a file or directory within the .phar
+ * @param string file/directory to stat
+ * @access private
+ */
+ public function _stream_stat($file = null)
+ {
+ $std = $file ? self::processFile($file) : $this->currentFilename;
+ if ($file) {
+ if (isset(self::$_manifest[$this->_archiveName][$file])) {
+ $this->_setCurrentFile($file);
+ $isdir = false;
+ } else {
+ $isdir = true;
+ }
+ } else {
+ $isdir = false; // open streams must be files
+ }
+ $mode = $isdir ? 0040444 : 0100444;
+ // 040000 = dir, 010000 = file
+ // everything is readable, nothing is writeable
+ return array(
+ 0, 0, $mode, 0, 0, 0, 0, 0, 0, 0, 0, 0, // non-associative indices
+ 'dev' => 0, 'ino' => 0,
+ 'mode' => $mode,
+ 'nlink' => 0, 'uid' => 0, 'gid' => 0, 'rdev' => 0, 'blksize' => 0, 'blocks' => 0,
+ 'size' => $this->currentStat[7],
+ 'atime' => $this->currentStat[9],
+ 'mtime' => $this->currentStat[9],
+ 'ctime' => $this->currentStat[9],
+ );
+ }
+
+ /**
+ * Stat a closed file or directory - PHP streams API
+ * @param string
+ * @param int
+ * @access private
+ */
+ public function url_stat($url, $flags)
+ {
+ $path = $this->initializeStream($url);
+ return $this->_stream_stat($path);
+ }
+
+ /**
+ * Open a directory in the .phar for reading - PHP streams API
+ * @param string directory name
+ * @access private
+ */
+ public function dir_opendir($path)
+ {
+ $info = parse_url($path);
+ $path = !empty($info['path']) ?
+ $info['host'] . $info['path'] : $info['host'] . '/';
+ $path = $this->initializeStream('phar://' . $path);
+ if (isset(self::$_manifest[$this->_archiveName][$path])) {
+ trigger_error('Error: "' . $path . '" is a file, and cannot be opened with opendir',
+ E_USER_ERROR);
+ return false;
+ }
+ if ($path == false) {
+ trigger_error('Error: Unknown phar in "' . $file . '"', E_USER_ERROR);
+ return false;
+ }
+ $this->fp = @fopen($this->_archiveName, "rb");
+ if (!$this->fp) {
+ trigger_error('Error: cannot open phar "' . $this->_archiveName . '"');
+ return false;
+ }
+ $this->_dirFiles = array();
+ foreach (self::$_manifest[$this->_archiveName] as $file => $info) {
+ if ($path == '/') {
+ if (strpos($file, '/')) {
+ $a = explode('/', $file);
+ $this->_dirFiles[array_shift($a)] = true;
+ } else {
+ $this->_dirFiles[$file] = true;
+ }
+ } elseif (strpos($file, $path) === 0) {
+ $fname = substr($file, strlen($path) + 1);
+ if (strpos($fname, '/')) {
+ $a = explode('/', $fname);
+ $this->_dirFiles[array_shift($a)] = true;
+ } elseif (strlen($file) != strlen($path)) {
+ // if the two match exactly, the path searched for was
+ // not a directory, but was a file.
+ $this->_dirFiles[$fname] = true;
+ }
+ }
+ }
+ @fclose($this->fp);
+ @uksort($this->_dirFiles, 'strnatcmp');
+ return true;
+ }
+
+ /**
+ * Read the next directory entry - PHP streams API
+ * @access private
+ */
+ public function dir_readdir()
+ {
+ $ret = key($this->_dirFiles);
+ @next($this->_dirFiles);
+ if (!$ret) {
+ return false;
+ }
+ return $ret;
+ }
+
+ /**
+ * Close a directory handle opened with opendir() - PHP streams API
+ * @access private
+ */
+ public function dir_closedir()
+ {
+ $this->_dirFiles = array();
+ reset($this->_dirFiles);
+ return true;
+ }
+
+ /**
+ * Rewind to the first directory entry - PHP streams API
+ * @access private
+ */
+ public function dir_rewinddir()
+ {
+ reset($this->_dirFiles);
+ return true;
+ }
+
+ /**
+ * API version of this class
+ * @return string
+ */
+ public final function APIVersion()
+ {
+ return '0.8.0';
+ }
+}}
+if (!class_exists('Phar')) {
+ if (!in_array('phar', stream_get_wrappers())) {
+ stream_wrapper_register('phar', 'PHP_Archive');
+ }
+ PHP_Archive::mapPhar(__FILE__, __COMPILER_HALT_OFFSET__);
+} else {
+ Phar::mapPhar();
+}
+if (class_exists('PHP_Archive') && !in_array('phar', stream_get_wrappers())) {
+ stream_wrapper_register('phar', 'PHP_Archive');
+}
+@ini_set('memory_limit', -1);
+
+require_once 'phar://install-pear-nozlib.phar/index.php';
+__HALT_COMPILER();¡
+
+
+
+
+
+
/* vim: set ts=4 sw=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
@@ -661,7 +679,7 @@ __HALT_COMPILER(); 
// | Author: Vincent Blavet <vincent@phpconcept.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Tar.php,v 1.29 2005/03/17 21:02:31 vblavet Exp $
+// $Id: Tar.php,v 1.22.2.1 2006/05/25 22:00:05 cellog Exp $
require_once 'phar://install-pear-nozlib.phar/PEAR.php';
@@ -672,7 +690,7 @@ define ('ARCHIVE_TAR_ATT_SEPARATOR', 90001);
* Creates a (compressed) Tar archive
*
* @author Vincent Blavet <vincent@phpconcept.net>
-* @version $Revision: 1.29 $
+* @version $Revision: 1.22.2.1 $
* @package Archive
*/
class Archive_Tar extends PEAR
@@ -5323,7 +5341,7 @@ class Console_Getopt {
?>
-/* $Id: install-pear.php,v 1.26 2006/01/02 15:29:03 cellog Exp $ */
+/* $Id: install-pear.php,v 1.27 2006/08/13 21:11:48 cellog Exp $ */
error_reporting(E_ALL);
$pear_dir = dirname(__FILE__);
@@ -5354,7 +5372,7 @@ if (!$a) {
$force = false;
$install_files = array('Archive_Tar' => 'phar://install-pear-nozlib.phar/Archive_Tar-1.3.1.tar',
'Console_Getopt' => 'phar://install-pear-nozlib.phar/Console_Getopt-1.2.tar',
-'PEAR' => 'phar://install-pear-nozlib.phar/PEAR-1.4.9.tar',
+'PEAR' => 'phar://install-pear-nozlib.phar/PEAR-1.4.11.tar',
);
array_shift($argv);
$debug = false;
@@ -5451,11 +5469,16 @@ $pkg = new PEAR_PackageFile($config, $debug);
foreach ($install_files as $package => $instfile) {
$info = $pkg->fromAnyFile($instfile, PEAR_VALIDATE_INSTALLING);
- $new_ver = $info->getVersion();
if (PEAR::isError($info)) {
+ if (is_array($info->getUserInfo())) {
+ foreach ($info->getUserInfo() as $err) {
+ $ui->outputData(sprintf("[PEAR] %s: %s", $package, $err['message']));
+ }
+ }
$ui->outputData(sprintf("[PEAR] %s: %s", $package, $info->getMessage()));
continue;
}
+ $new_ver = $info->getVersion();
$downloaderpackage = new PEAR_Downloader_Package($installer);
$err = $downloaderpackage->initialize($instfile);
if (PEAR::isError($err)) {
@@ -5543,7 +5566,7 @@ foreach ($install_files as $package => $instfile) {
* @author Gregory Beaver <cellog@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Guess.php,v 1.20 2005/10/26 19:33:03 cellog Exp $
+ * @version CVS: $Id: Guess.php,v 1.20.2.1 2006/06/16 11:41:16 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since PEAR 0.1
*/
@@ -5620,7 +5643,7 @@ foreach ($install_files as $package => $instfile) {
* @author Gregory Beaver <cellog@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -5729,10 +5752,12 @@ class OS_Guess
return $glibc; // no need to run this multiple times
}
include_once "phar://install-pear-nozlib.phar/System.php";
- if (!file_exists('/usr/bin/cpp') || !is_executable('/usr/bin/cpp')) {
+ if (!@file_exists('/usr/bin/cpp') || !@is_executable('/usr/bin/cpp')) {
// Use glibc's <features.h> header file to
// get major and minor version number:
- if ($features_file = @fopen('/usr/include/features.h', 'rb') ) {
+ if (@file_exists('/usr/include/features.h') &&
+ @is_readable('/usr/include/features.h')) {
+ $features_file = fopen('/usr/include/features.h', 'rb');
while (!feof($features_file)) {
$line = fgets($features_file, 8192);
if (!$line || (strpos($line, '#define') === false)) {
@@ -5868,8 +5893,8 @@ class OS_Guess
* End:
*/
?>
-package.xml
-<package packagerversion="1.4.9" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
+package2.xml
+<package packagerversion="1.4.11" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>PEAR</name>
<channel>pear.php.net</channel>
<summary>PEAR Base System</summary>
@@ -5908,22 +5933,22 @@ package.xml
<active>yes</active>
</lead>
<lead>
+ <name>Pierre-Alain Joye</name>
+ <user>pajoye</user>
+ <email>pajoye@pearfr.org</email>
+ <active>yes</active>
+ </lead>
+ <lead>
<name>Stig Bakken</name>
<user>ssb</user>
<email>stig@php.net</email>
- <active>yes</active>
+ <active>no</active>
</lead>
<lead>
<name>Tomas V.V.Cox</name>
<user>cox</user>
<email>cox@idecnet.com</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Pierre-Alain Joye</name>
- <user>pajoye</user>
- <email>pajoye@pearfr.org</email>
- <active>yes</active>
+ <active>no</active>
</lead>
<helper>
<name>Tim Jackson</name>
@@ -5935,7 +5960,7 @@ package.xml
<name>Bertrand Gugger</name>
<user>toggg</user>
<email>toggg@php.net</email>
- <active>yes</active>
+ <active>no</active>
</helper>
<helper>
<name>Martin Jansen</name>
@@ -5943,10 +5968,10 @@ package.xml
<email>mj@php.net</email>
<active>no</active>
</helper>
- <date>2006-03-22</date>
- <time>23:52:54</time>
+ <date>2006-08-16</date>
+ <time>12:15:15</time>
<version>
- <release>1.4.9</release>
+ <release>1.4.11</release>
<api>1.4.2</api>
</version>
<stability>
@@ -5954,112 +5979,109 @@ package.xml
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
- <notes>CRITICAL BUGFIX RELEASE
-users upgrading from PEAR 1.3.x cannot upgrade to 1.4.8
-users who use --packagingroot may find that installation fails
-* fix Bug #7093: if pear channel does not exist, it cannot be retrieved
-* fix Bug #7165: warnings in pear
-* fix Bug #7075: PEAR_PackageFile_v2 :: setLogger failed on autodetection</notes>
+ <notes>minor bugfix release
+* fix the conflicts detection for the web frontend (before 0.5.0)
+* fix warnings in the list-all command</notes>
<contents>
<dir name="/">
- <file md5sum="64153f3054d39f0f1d0102fa3f5b35a3" name="OS/Guess.php" role="php">
+ <file md5sum="b309a1eb31b2826cd1cec229fb352eb0" name="OS/Guess.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="8c7e266a63d74cf96f9acb88d8f3383b" name="PEAR/ChannelFile/Parser.php" role="php">
+ <file md5sum="28016a108b34962267f86ccc1d70d852" name="PEAR/ChannelFile/Parser.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="4a11a3c4bc2c2f338c183b332def156b" name="PEAR/Command/Auth.xml" role="php" />
- <file md5sum="369704305c09c243ec79e44fedee642a" name="PEAR/Command/Auth.php" role="php">
+ <file md5sum="20a596c843275e8607c0e1fdc7953e64" name="PEAR/Command/Auth.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="73602fd7f051eaf8d37452d0e3063bdb" name="PEAR/Command/Build.xml" role="php" />
- <file md5sum="fc8dfcbf203a0ffcfdb99b810bc9f830" name="PEAR/Command/Build.php" role="php">
+ <file md5sum="bf340957761207ff4408b560cba982e1" name="PEAR/Command/Build.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="14ed4bd2028f26ac984a0db8c91fd5fd" name="PEAR/Command/Channels.xml" role="php" />
- <file md5sum="7f4c5dad5c5e65f8a540cb35914c7b2e" name="PEAR/Command/Channels.php" role="php">
+ <file md5sum="d5586c3708924122c9383738315f6539" name="PEAR/Command/Channels.xml" role="php" />
+ <file md5sum="f68e6ae36ed4dd9e3b4cd2a8d67e1227" name="PEAR/Command/Channels.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="75159b905c8db019cec524cdcea28c33" name="PEAR/Command/Common.php" role="php">
+ <file md5sum="0033cb00b42b118df88c0daaacbfe1d3" name="PEAR/Command/Common.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="91f189cb9423b5e87ee0abc5ea1a2be3" name="PEAR/Command/Config.xml" role="php" />
- <file md5sum="429bfebc20e70ddf7a7ab5a8ee7b2de8" name="PEAR/Command/Config.php" role="php">
+ <file md5sum="12df978b3560fc1e846ecbd5e367240c" name="PEAR/Command/Config.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="516da3eb7ebbecfbfb4188408a1983b2" name="PEAR/Command/Install.xml" role="php" />
- <file md5sum="bbd5b352db1cb8e348ae3d8606adb33a" name="PEAR/Command/Install.php" role="php">
+ <file md5sum="aa6ea8b7087130a518fcbb401f3369c6" name="PEAR/Command/Install.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="5cb62a04c0a268f4edd64a49a3895c92" name="PEAR/Command/Mirror.xml" role="php" />
- <file md5sum="acbfc57a7ed9d3167f7491e3e8853cb4" name="PEAR/Command/Mirror.php" role="php">
+ <file md5sum="d35b596f8c060eb666797cd2f0f61643" name="PEAR/Command/Mirror.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="23250b3cd9fae3475b1af03350cc05dc" name="PEAR/Command/Package.xml" role="php" />
- <file md5sum="69d812c4c7dddf1cbfcd527c783a0db2" name="PEAR/Command/Package.php" role="php">
+ <file md5sum="bbf88f26cd10b1caa76d5eec474f093f" name="PEAR/Command/Package.xml" role="php" />
+ <file md5sum="ed3d49a880913827d7c3a1beacb5531c" name="PEAR/Command/Package.php" role="php">
<tasks:replace from="@DATA-DIR@" to="data_dir" type="pear-config" />
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="35817866283227237796b32d32dac44d" name="PEAR/Command/Pickle.xml" role="php" />
- <file md5sum="4fd62cc0bbc33d3e5f5d0b07fbdfa950" name="PEAR/Command/Pickle.php" role="php">
+ <file md5sum="dea2b4d9388a9511e59548c61f60251a" name="PEAR/Command/Pickle.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="e7fc652e4b5266bbac1c23140de01598" name="PEAR/Command/Registry.xml" role="php" />
- <file md5sum="37125dee4259ccaac350730ee90bd943" name="PEAR/Command/Registry.php" role="php">
+ <file md5sum="2f8013f7a0c1e2f2ba7ca3113135015d" name="PEAR/Command/Registry.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="d57b54857aba5b6ff2fe528cbf522b00" name="PEAR/Command/Remote.xml" role="php" />
- <file md5sum="7a0814e3158cd4212145a69417b658dd" name="PEAR/Command/Remote.php" role="php">
+ <file md5sum="ad00e67d39dc0d15c5ed9cbd26992ec9" name="PEAR/Command/Remote.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="f5072ed4032dc28fac20f526f03520f8" name="PEAR/Command/Test.xml" role="php" />
- <file md5sum="2736a481b20b6e656cbfa1fc8e8a1744" name="PEAR/Command/Test.php" role="php">
+ <file md5sum="a537a76b067ccdac893469fb95c1c9cc" name="PEAR/Command/Test.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="841f797b04fb0ae96fc12f9a308ed2b6" name="PEAR/Downloader/Package.php" role="php">
+ <file md5sum="9643b5ff1188628499cbbd6050e9cbab" name="PEAR/Downloader/Package.php" role="php">
<tasks:replace from="@PEAR-VER@" to="version" type="package-info" />
</file>
- <file md5sum="af599522077f71d4be9a1163c659d5cf" name="PEAR/Frontend/CLI.php" role="php">
+ <file md5sum="e0417ade6ffb4235c8f6fee2b9779a25" name="PEAR/Frontend/CLI.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="cd5807103ede23734e60356cd8bdd0f5" name="PEAR/Installer/Role/Common.php" role="php">
+ <file md5sum="80ac44ab528facdffacc2f2183d351cf" name="PEAR/Installer/Role/Common.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="a102cceaf8e9348965a856e2b5ae4e35" name="PEAR/Installer/Role/Data.xml" role="php" />
- <file md5sum="d83cab75511a3cf4c428f9d83f88f537" name="PEAR/Installer/Role/Data.php" role="php">
+ <file md5sum="594fe03ab037716e90f01036b238dac9" name="PEAR/Installer/Role/Data.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="5755c03e061dd14ab04a8662a860af13" name="PEAR/Installer/Role/Doc.xml" role="php" />
- <file md5sum="ab0fd8ccf2ea680e196f7dd82358b00b" name="PEAR/Installer/Role/Doc.php" role="php">
+ <file md5sum="691537b382e6c38b1da2797ce38a0950" name="PEAR/Installer/Role/Doc.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="2752669b1ccf927c4c71db68ac046095" name="PEAR/Installer/Role/Ext.xml" role="php" />
- <file md5sum="a56ffbb2031fb7effa9ecdbe43d79dc0" name="PEAR/Installer/Role/Ext.php" role="php">
+ <file md5sum="0e3823a9702ca20530761c0f9b7cd678" name="PEAR/Installer/Role/Ext.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="8997db19129f121be2d5fffb92f4075a" name="PEAR/Installer/Role/Php.xml" role="php" />
- <file md5sum="e52b84b0a716084dd41e9d8ba3a97cc2" name="PEAR/Installer/Role/Php.php" role="php">
+ <file md5sum="99a73d79d2647c5b573c7e929d476fb7" name="PEAR/Installer/Role/Php.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="a146c5985d669938c633bfef60692db4" name="PEAR/Installer/Role/Script.xml" role="php" />
- <file md5sum="2a5220d3d9e77a4bbeeaa593ed287581" name="PEAR/Installer/Role/Script.php" role="php">
+ <file md5sum="f9d6d3999088c48ce4638d938e7ab158" name="PEAR/Installer/Role/Script.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="ad0f719669cb90e76048394896c51136" name="PEAR/Installer/Role/Src.xml" role="php" />
- <file md5sum="e8c64f25150d20614524d82589d29111" name="PEAR/Installer/Role/Src.php" role="php">
+ <file md5sum="70626b32b828aae617853372287098f2" name="PEAR/Installer/Role/Src.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="dc2f729ae9356540c91131b3b94caddf" name="PEAR/Installer/Role/Test.xml" role="php" />
- <file md5sum="7ae6b8336e4732ffa594b804acc5f0de" name="PEAR/Installer/Role/Test.php" role="php">
+ <file md5sum="7e5652e079b75f15b8ea1541fde125e6" name="PEAR/Installer/Role/Test.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="6c51d65895cf5b71a8385b247dbd0189" name="PEAR/Installer/Role.php" role="php">
+ <file md5sum="4640fe2a15a082b57361bf7522d3b0fa" name="PEAR/Installer/Role.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="db40e2b0c033f3565af6c135e28a512b" name="PEAR/PackageFile/Generator/v1.php" role="php">
+ <file md5sum="786d5cb198bc0ff160c202519c20201e" name="PEAR/PackageFile/Generator/v1.php" role="php">
<tasks:replace from="@PEAR-VER@" to="version" type="package-info" />
</file>
- <file md5sum="b79890e413dfa78cf37cd626fe0774b1" name="PEAR/PackageFile/Generator/v2.php" role="php">
+ <file md5sum="1c4afb91b1dd8f310f42b5f5531a0dea" name="PEAR/PackageFile/Generator/v2.php" role="php">
<tasks:replace from="@PEAR-VER@" to="version" type="package-info" />
</file>
<file md5sum="ea3c85eac9d81f6ac0d445219b882c8b" name="PEAR/PackageFile/Parser/v1.php" role="php">
@@ -6068,116 +6090,116 @@ users who use --packagingroot may find that installation fails
<file md5sum="a173a2ff92d2a93d7153b101da34cf18" name="PEAR/PackageFile/Parser/v2.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="13129c54d393a8e3018571106572b521" name="PEAR/PackageFile/v2/rw.php" role="php">
+ <file md5sum="2656bd7b445c1885072ad2a25e8dfd0e" name="PEAR/PackageFile/v2/rw.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="9953c60c0861398ccfe958dfc8b4f7cd" name="PEAR/PackageFile/v2/Validator.php" role="php">
+ <file md5sum="5b702d0d25f40e889b9bd205b655fb16" name="PEAR/PackageFile/v2/Validator.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="33f622302e817fa6ed2ce4285df45012" name="PEAR/PackageFile/v1.php" role="php">
+ <file md5sum="30d4ddc15dfc592389411d99a2dd3b37" name="PEAR/PackageFile/v1.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="6cc1e92726f8e6bca9760fc406404bcc" name="PEAR/PackageFile/v2.php" role="php">
+ <file md5sum="2a36cf4ff04777f950c9afd2aad468a1" name="PEAR/PackageFile/v2.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="d8f321b01d6bfe1e039aeee0e8c4eb55" name="PEAR/REST/10.php" role="php">
+ <file md5sum="8b309d72a3c773429dea666696d9888e" name="PEAR/REST/10.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="ee95643e89c0a755daaba7c450b9053c" name="PEAR/REST/11.php" role="php">
+ <file md5sum="08fee3e5c8443e5ebafc17bb13959b62" name="PEAR/REST/11.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="e4ec4c2e865fe0d863ec537117a83529" name="PEAR/Task/Postinstallscript/rw.php" role="php">
+ <file md5sum="311c875b56dcda3f8848c22d1fc3d0f8" name="PEAR/Task/Postinstallscript/rw.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="4de8267715f6a5d137af80e2f813d62b" name="PEAR/Task/Replace/rw.php" role="php">
+ <file md5sum="09eb8d30ef25a47f1975a2447264f645" name="PEAR/Task/Replace/rw.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="78f2b48aaf9aa4fafe7a4810b8c97d74" name="PEAR/Task/Unixeol/rw.php" role="php">
+ <file md5sum="b9afa2dcef500ac15885e01647f454b5" name="PEAR/Task/Unixeol/rw.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="a11f251093545db4cd8c5f0684a7b3a3" name="PEAR/Task/Windowseol/rw.php" role="php">
+ <file md5sum="631e7a866fc9921e0b9f2d45b68a1687" name="PEAR/Task/Windowseol/rw.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="a56c5f9161b46b299cef23f16491dc8b" name="PEAR/Task/Common.php" role="php">
+ <file md5sum="1f0757906fc64708103e19bac2b3a4d5" name="PEAR/Task/Common.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="0a1629801eeecedaf1c6d07ac8cdcdf3" name="PEAR/Task/Postinstallscript.php" role="php">
+ <file md5sum="5815d0ea19cd0a4f00cb1e8e2e9eb163" name="PEAR/Task/Postinstallscript.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="bf45b4b62b86b854a07552d9ebf32091" name="PEAR/Task/Replace.php" role="php">
+ <file md5sum="0cba8e6997e694aa4452a0041aaa4228" name="PEAR/Task/Replace.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="6641fe2f91c4f102b0af4182f6180ce5" name="PEAR/Task/Unixeol.php" role="php">
+ <file md5sum="d33a1fb9258fbbc780b2d07d81d3af46" name="PEAR/Task/Unixeol.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="943192d2194c5c1187d336fe0245019b" name="PEAR/Task/Windowseol.php" role="php">
+ <file md5sum="4f8233e21872e0fcd63efa556d63a3fc" name="PEAR/Task/Windowseol.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="eb608fe901b0d752aea41ee221351c47" name="PEAR/Validator/PECL.php" role="php">
+ <file md5sum="16fba26b50c17e2752c9ad82f96f102c" name="PEAR/Validator/PECL.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="61be98ca654ca4e19bba431fa4dc1bc1" name="PEAR/Autoloader.php" role="php">
+ <file md5sum="5ce65e09af7eb738c639141838c6f26a" name="PEAR/Autoloader.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="29369a600bc560a4bac1c2a441b76eca" name="PEAR/Builder.php" role="php">
+ <file md5sum="ece2de8def8f8dd7f665b00e6694cc07" name="PEAR/Builder.php" role="php">
<tasks:replace from="@PEAR-VER@" to="version" type="package-info" />
</file>
- <file md5sum="b50c43adb5045b4016730dd4d4839a02" name="PEAR/ChannelFile.php" role="php">
+ <file md5sum="d6f16bff9405077e918a8f7be9e31fcf" name="PEAR/ChannelFile.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="4e79a801b34389864e77232ce37ba548" name="PEAR/Command.php" role="php">
+ <file md5sum="7a6a51d4986f04e15e53fbe96fae6a9b" name="PEAR/Command.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="63325bcbd4b3c11478a75d120f123c33" name="PEAR/Common.php" role="php">
+ <file md5sum="d24d08cc90e7d3fd03277806ac016b34" name="PEAR/Common.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="fc42ca3c5e2c1d647ce59f23e9ff90b1" name="PEAR/Config.php" role="php">
+ <file md5sum="50af115a5d8fa85ee5f3068d172292d1" name="PEAR/Config.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="f42d5ae2639dd67b90b890ac2b0e6e56" name="PEAR/Dependency.php" role="php" />
- <file md5sum="32a0bc84ac0cd679a2cd4a85de1c0239" name="PEAR/DependencyDB.php" role="php">
+ <file md5sum="23082dcb6a8a754c9a2fd093a81cfde5" name="PEAR/DependencyDB.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="9038786e6a01295351662fb6c19b518b" name="PEAR/Dependency2.php" role="php">
+ <file md5sum="82befcf59d8a42ab9283134649179ebc" name="PEAR/Dependency2.php" role="php">
<tasks:replace from="@PEAR-VER@" to="version" type="package-info" />
</file>
- <file md5sum="7c9489f7f7b7b6c77902bcb913a14794" name="PEAR/Downloader.php" role="php">
+ <file md5sum="15764f5cf89d436c9c5fa06d4652a912" name="PEAR/Downloader.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="40e4900bf7437e8a3f4659d8816cb967" name="PEAR/ErrorStack.php" role="php">
+ <file md5sum="594630ac0ef25c775ef31d1c9bb3c8e6" name="PEAR/ErrorStack.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="cdc1bdbb9b624a971844f2cdd03215d0" name="PEAR/Exception.php" role="php">
+ <file md5sum="985799a0d417427029cff74f1c7e94d6" name="PEAR/Exception.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="42f26287b2e3a78e3def7d2079117a87" name="PEAR/Frontend.php" role="php">
+ <file md5sum="e6692dee75572336cb7b4ebea6699312" name="PEAR/Frontend.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="49fc3714f093cbd5fcd1130dbf5349e5" name="PEAR/Installer.php" role="php">
+ <file md5sum="16871c2327ab0a6372a64ec4a91308cd" name="PEAR/Installer.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="cddbfc6594e973b223a027bfff9d7529" name="PEAR/PackageFile.php" role="php">
+ <file md5sum="7fce4e17c75790a7800dd61a6e2a1314" name="PEAR/PackageFile.php" role="php">
<tasks:replace from="@PEAR-VER@" to="version" type="package-info" />
</file>
- <file md5sum="a3c6c802ce887f63c1494d010a5020f8" name="PEAR/Packager.php" role="php">
+ <file md5sum="89fbe13ab1e56bb98e2f026669a8a749" name="PEAR/Packager.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="8ee992a2e56afed8bed5d0832434ea21" name="PEAR/Registry.php" role="php">
+ <file md5sum="c008052d80ba8bf49a80b6f4a224ff78" name="PEAR/Registry.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="73269d1eb0735ae699cf1825ec3445fc" name="PEAR/Remote.php" role="php">
+ <file md5sum="b9df405a9c72526de21053d305251eec" name="PEAR/Remote.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="268906e90d4661aaff2445106303ad31" name="PEAR/REST.php" role="php">
+ <file md5sum="882d0d90865afc47d746e54748ded42a" name="PEAR/REST.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="fa5a6b0916fb819dae2400f7b8685859" name="PEAR/RunTest.php" role="php">
+ <file md5sum="dd390ae06a1284fd54e5ac5e7efe87e2" name="PEAR/RunTest.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="0703200ee14f5ae595f419963f1acb49" name="PEAR/Validate.php" role="php">
+ <file md5sum="f15a4b531bd9750a17639a4201f9abbc" name="PEAR/Validate.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="740304a1ee87a803cc2eea78c7da726d" name="PEAR/XMLParser.php" role="php">
+ <file md5sum="4708bbff52de958814b6ac2e22070e56" name="PEAR/XMLParser.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file baseinstalldir="/" md5sum="000e0141cccb734d87df52d4c5cb110b" name="scripts/pear.bat" role="script">
@@ -6232,10 +6254,10 @@ users who use --packagingroot may find that installation fails
<tasks:replace from="@include_path@" to="php_dir" type="pear-config" />
</file>
<file md5sum="ca444da9174e05f8a0dc71d8ee47900f" name="package.dtd" role="data" />
- <file md5sum="06b49e789f39426ba4498a578e6a370c" name="PEAR.php" role="php">
+ <file md5sum="5b404cc7109d0772fb757707e4c8fa56" name="PEAR.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file md5sum="947f419a1bba9a6a8bd3d5a0f967c6b8" name="System.php" role="php">
+ <file md5sum="280dd4d725a486ffff1605aa16c77a6e" name="System.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
<file md5sum="acd010e3bc43c0f72df584acde7b9158" name="template.spec" role="data" />
@@ -6266,7 +6288,6 @@ users who use --packagingroot may find that installation fails
<name>PEAR_Frontend_Web</name>
<channel>pear.php.net</channel>
<max>0.5.0</max>
- <exclude>0.5.0</exclude>
<conflicts />
</package>
<package>
@@ -6294,7 +6315,7 @@ users who use --packagingroot may find that installation fails
<package>
<name>PEAR_Frontend_Web</name>
<channel>pear.php.net</channel>
- <min>0.5.0</min>
+ <min>0.5.1</min>
</package>
</group>
<group hint="PEAR&apos;s PHP-GTK-based installer" name="gtkinstaller">
@@ -6308,6 +6329,7 @@ users who use --packagingroot may find that installation fails
<package>
<name>PEAR_Frontend_Gtk2</name>
<channel>pear.php.net</channel>
+ <min>0.1.2</min>
</package>
</group>
</dependencies>
@@ -6342,6 +6364,32 @@ users who use --packagingroot may find that installation fails
</phprelease>
<changelog>
<release>
+ <date>2006-07-18</date>
+ <version>
+ <release>1.4.10</release>
+ <api>1.4.2</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://www.php.net/license">PHP License</license>
+ <notes>bugfix release
+* fix Bug #7579: cannot convert package 1.0 to 2.0 with PFM 1.6.0
+* fix Bug #7640: Check invalid date format
+* fix Bug #7726: &lt;uri&gt; dependency is broken
+* fix Bug #7830: Warning in package-dependencies command when a dir is used
+* fix Bug #7842: package-dependencies wrong type display with package 1.0
+* fix Bug #8230: pear help channel-discover shows wrong text
+* fix many open_basedir issues
+* fix an issue in the better state detection
+* fix typo in pickle command that would allow pickling of non-PECL package.xml
+* implement Request #7090: PEAR_Downloader mustn&apos;t contact pear server
+ when installing local package file
+* implement Request #7844: download_dir and temp_dir configuration option
+* check pearinstaller dependency prior to validating package.xml 2.0</notes>
+ </release>
+ <release>
<version>
<release>1.4.0</release>
<api>1.4.0</api>
@@ -6605,9 +6653,27 @@ caused crashes in many places due to improper error handling
* fix Bug #7015: install a package.tgz with unknown channel, fatal error in PEAR/Registry.php
* fix Bug #7020: tests/PEAR_Registry/api1_1/test_getChannelValidator.phpt crashes PEAR</notes>
</release>
+ <release>
+ <version>
+ <release>1.4.9</release>
+ <api>1.4.2</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2006-03-29</date>
+ <license uri="http://www.php.net/license/3_0.txt">PHP License</license>
+ <notes>CRITICAL BUGFIX RELEASE
+users upgrading from PEAR 1.3.x cannot upgrade to 1.4.8
+users who use --packagingroot may find that installation fails
+* fix Bug #7093: if pear channel does not exist, it cannot be retrieved
+* fix Bug #7165: warnings in pear
+* fix Bug #7075: PEAR_PackageFile_v2 :: setLogger failed on autodetection</notes>
+ </release>
</changelog>
</package>
-
+
/**
* The OS_Guess class
*
@@ -6625,7 +6691,7 @@ caused crashes in many places due to improper error handling
* @author Gregory Beaver <cellog@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Guess.php,v 1.20 2005/10/26 19:33:03 cellog Exp $
+ * @version CVS: $Id: Guess.php,v 1.20.2.1 2006/06/16 11:41:16 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since PEAR 0.1
*/
@@ -6702,7 +6768,7 @@ caused crashes in many places due to improper error handling
* @author Gregory Beaver <cellog@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -6811,10 +6877,12 @@ class OS_Guess
return $glibc; // no need to run this multiple times
}
include_once "System.php";
- if (!file_exists('/usr/bin/cpp') || !is_executable('/usr/bin/cpp')) {
+ if (!@file_exists('/usr/bin/cpp') || !@is_executable('/usr/bin/cpp')) {
// Use glibc's <features.h> header file to
// get major and minor version number:
- if ($features_file = @fopen('/usr/include/features.h', 'rb') ) {
+ if (@file_exists('/usr/include/features.h') &&
+ @is_readable('/usr/include/features.h')) {
+ $features_file = fopen('/usr/include/features.h', 'rb');
while (!feof($features_file)) {
$line = fgets($features_file, 8192);
if (!$line || (strpos($line, '#define') === false)) {
@@ -6950,7 +7018,7 @@ class OS_Guess
* End:
*/
?>
-
+
/**
* PEAR_ChannelFile_Parser for parsing channel.xml
*
@@ -6984,7 +7052,7 @@ require_once 'PEAR/ChannelFile.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -7022,7 +7090,7 @@ class PEAR_ChannelFile_Parser extends PEAR_XMLParser
return $ret;
}
}
-?>
+?>
<login>
<summary>Connects and authenticates to remote server</summary>
<shortcut>li</shortcut>
@@ -7046,7 +7114,7 @@ Logs out from the remote server. This command does not actually
connect to the remote server, it only deletes the stored username and
password from your user configuration.</doc>
</logout>
-</commands>
+</commands>
/**
* PEAR_Command_Auth (login, logout commands)
*
@@ -7084,7 +7152,7 @@ require_once 'PEAR/Config.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -7231,7 +7299,7 @@ password from your user configuration.',
// }}}
}
-?>
+?>
<build>
<summary>Build an Extension From C Source</summary>
<function>doBuild</function>
@@ -7240,7 +7308,7 @@ password from your user configuration.',
<doc>[package.xml]
Builds one or more extensions contained in a package.</doc>
</build>
-</commands>
+</commands>
/**
* PEAR_Command_Auth (build command)
*
@@ -7279,7 +7347,7 @@ require_once 'PEAR/Command/Common.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -7344,7 +7412,7 @@ Builds one or more extensions contained in a package.'
// }}}
}
-
+
<list-channels>
<summary>List Available Channels</summary>
<function>doList</function>
@@ -7432,11 +7500,12 @@ alias.
<function>doDiscover</function>
<shortcut>di</shortcut>
<options />
- <doc>&lt;package&gt;
-List the files in an installed package.
+ <doc>[&lt;channel.xml&gt;|&lt;channel name&gt;]
+Initialize a Channel from its server and create the local channel.xml.
</doc>
</channel-discover>
-</commands>
+</commands>
+
// /* vim: set expandtab tabstop=4 shiftwidth=4: */
/**
* PEAR_Command_Channels (list-channels, update-channels, channel-delete, channel-add,
@@ -7456,7 +7525,7 @@ List the files in an installed package.
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Channels.php,v 1.44 2006/03/02 18:14:13 cellog Exp $
+ * @version CVS: $Id: Channels.php,v 1.44.2.1 2006/07/17 18:24:10 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -7474,7 +7543,7 @@ require_once 'PEAR/Command/Common.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -7570,8 +7639,8 @@ alias.
'function' => 'doDiscover',
'shortcut' => 'di',
'options' => array(),
- 'doc' => '<package>
-List the files in an installed package.
+ 'doc' => '[<channel.xml>|<channel name>]
+Initialize a Channel from its server and creates the local channel.xml.
'
),
);
@@ -8216,7 +8285,7 @@ List the files in an installed package.
}
}
?>
-
+
/**
* PEAR_Command_Common base class
*
@@ -8234,7 +8303,7 @@ List the files in an installed package.
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Common.php,v 1.32 2006/03/02 16:39:14 pajoye Exp $
+ * @version CVS: $Id: Common.php,v 1.32.2.1 2006/06/08 22:27:11 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -8253,7 +8322,7 @@ require_once 'PEAR.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -8292,7 +8361,7 @@ class PEAR_Command_Common extends PEAR
var $_deps_type_trans = array(
'pkg' => 'package',
- 'extension' => 'extension',
+ 'ext' => 'extension',
'php' => 'PHP',
'prog' => 'external program',
'ldlib' => 'external library for linking',
@@ -8495,7 +8564,7 @@ class PEAR_Command_Common extends PEAR
}
?>
-
+
<config-show>
<summary>Show All Settings</summary>
<function>doConfigShow</function>
@@ -8586,7 +8655,7 @@ PEAR installation (using the --remoteconfig option of install, upgrade,
and uninstall).
</doc>
</config-create>
-</commands>
+</commands>
/**
* PEAR_Command_Config (config-show, config-get, config-set, config-help, config-create commands)
*
@@ -8604,7 +8673,7 @@ and uninstall).
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Config.php,v 1.51 2006/03/02 13:32:38 pajoye Exp $
+ * @version CVS: $Id: Config.php,v 1.51.2.1 2006/06/04 12:11:39 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -8623,7 +8692,7 @@ require_once 'PEAR/Command/Common.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -8836,7 +8905,7 @@ and uninstall).
$failmsg .= "config-set expects 2 or 3 parameters";
return PEAR::raiseError($failmsg);
}
- if ($error = $this->_checkLayer(@$params[2])) {
+ if (isset($params[2]) && $error = $this->_checkLayer($params[2])) {
$failmsg .= $error;
return PEAR::raiseError("config-set:$failmsg");
}
@@ -9004,7 +9073,7 @@ and uninstall).
}
?>
-
+
<install>
<summary>Install Package</summary>
<function>doInstall</function>
@@ -9257,7 +9326,7 @@ package if needed.
Run post-installation scripts in package &lt;package&gt;, if any exist.
</doc>
</run-scripts>
-</commands>
+</commands>
/**
* PEAR_Command_Install (install, upgrade, upgrade-all, uninstall, bundle, run-scripts commands)
*
@@ -9295,7 +9364,7 @@ require_once 'PEAR/Command/Common.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -10030,7 +10099,7 @@ Run post-installation scripts in package <package>, if any exist.
}
}
?>
-
+
<download-all>
<summary>Downloads each available package from the default channel</summary>
<function>doDownloadAll</function>
@@ -10047,7 +10116,7 @@ Requests a list of available packages from the default channel ({config default_
and downloads them to current working directory. Note: only
packages within preferred_state ({config preferred_state}) will be downloaded</doc>
</download-all>
-</commands>
+</commands>
/**
* PEAR_Command_Mirror (download-all command)
*
@@ -10082,7 +10151,7 @@ require_once 'PEAR/Command/Common.php';
* @author Alexander Merz <alexmerz@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.2.0
*/
@@ -10200,7 +10269,7 @@ packages within preferred_state ({config preferred_state}) will be downloaded'
// }}}
}
-
+
<package>
<summary>Build Package</summary>
<function>doPackage</function>
@@ -10335,7 +10404,7 @@ use the &quot;slide&quot; option to move the release tag.
<shortcut>pd</shortcut>
<options />
<doc>
-List all depencies the package has.</doc>
+List all dependencies the package has.</doc>
</package-dependencies>
<sign>
<summary>Sign a package distribution file</summary>
@@ -10393,7 +10462,8 @@ This is not the most intelligent conversion, and should only be
used for automated conversion or learning the format.
</doc>
</convert>
-</commands>
+</commands>
+
/**
* PEAR_Command_Package (package, package-validate, cvsdiff, cvstag, package-dependencies,
* sign, makerpm, convert commands)
@@ -10413,7 +10483,7 @@ used for automated conversion or learning the format.
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Package.php,v 1.119 2006/03/02 18:14:13 cellog Exp $
+ * @version CVS: $Id: Package.php,v 1.119.2.1 2006/06/07 23:39:22 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -10580,7 +10650,7 @@ release), pass them as additional parameters.
'shortcut' => 'pd',
'options' => array(),
'doc' => '
-List all depencies the package has.'
+List all dependencies the package has.'
),
'sign' => array(
'summary' => 'Sign a package distribution file',
@@ -11557,7 +11627,7 @@ used for automated conversion or learning the format.
}
?>
-
+
<pickle>
<summary>Build PECL Package</summary>
<function>doPackage</function>
@@ -11596,7 +11666,7 @@ will cause pickle to fail, and output an error message. If your package2.xml
uses any of these features, you are best off using PEAR_PackageFileManager to
generate both package.xml.</doc>
</pickle>
-</commands>
+</commands>
/**
* PEAR_Command_Pickle (pickle command)
*
@@ -11613,7 +11683,7 @@ generate both package.xml.</doc>
* @author Greg Beaver <cellog@php.net>
* @copyright 2005-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Pickle.php,v 1.5 2006/01/06 04:47:36 cellog Exp $
+ * @version CVS: $Id: Pickle.php,v 1.5.2.1 2006/05/10 03:25:15 cellog Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.1
*/
@@ -11631,7 +11701,7 @@ require_once 'PEAR/Command/Common.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 2005-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.1
*/
@@ -11754,7 +11824,7 @@ generate both package.xml.
require_once 'PEAR/PackageFile/v1.php';
$pf = new PEAR_PackageFile_v1;
$pf->setConfig($this->config);
- if (is_array($pf2->getPackageType() != 'extsrc')) {
+ if ($pf2->getPackageType() != 'extsrc') {
return $this->raiseError('Cannot safely convert "' . $packagexml .
'", is not an extension source package. Using a PEAR_PackageFileManager-based ' .
'script is an option');
@@ -11972,7 +12042,7 @@ generate both package.xml.
}
?>
-
+
<list>
<summary>List Installed Packages In The Default Channel</summary>
<function>doList</function>
@@ -12025,7 +12095,7 @@ Displays information about a package. The package argument may be a
local package file, an URL to a package file, or the name of an
installed package.</doc>
</info>
-</commands>
+</commands>
/**
* PEAR_Command_Registry (list, list-files, shell-test, info commands)
*
@@ -12062,7 +12132,7 @@ require_once 'PEAR/Command/Common.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -13022,7 +13092,7 @@ installed package.'
}
?>
-
+
<remote-info>
<summary>Information About Remote Packages</summary>
<function>doRemoteInfo</function>
@@ -13113,7 +13183,7 @@ Clear the XML-RPC/REST cache. See also the cache_ttl configuration
parameter.
</doc>
</clear-cache>
-</commands>
+</commands>
/**
* PEAR_Command_Remote (remote-info, list-upgrades, remote-list, search, list-all, download,
* clear-cache commands)
@@ -13132,7 +13202,7 @@ parameter.
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Remote.php,v 1.90.2.2 2006/03/23 05:45:17 cellog Exp $
+ * @version CVS: $Id: Remote.php,v 1.90.2.3 2006/06/04 12:27:55 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -13152,7 +13222,7 @@ require_once 'PEAR/REST.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -13647,7 +13717,7 @@ parameter.
function doListUpgrades($command, $options, $params)
{
require_once 'PEAR/Common.php';
- if (isset($params[0]) && !PEAR_Common::betterStates($params[0])) {
+ if (isset($params[0]) && !is_array(PEAR_Common::betterStates($params[0]))) {
return $this->raiseError($params[0] . ' is not a valid state (stable/beta/alpha/devel/etc.) try "pear help list-upgrades"');
}
$savechannel = $channel = $this->config->get('default_channel');
@@ -13783,7 +13853,7 @@ parameter.
}
?>
-
+
<run-tests>
<summary>Run Regression Tests</summary>
<function>doRunTests</function>
@@ -13822,7 +13892,7 @@ parameter.
<doc>[testfile|dir ...]
Run regression tests with PHP&apos;s regression testing script (run-tests.php).</doc>
</run-tests>
-</commands>
+</commands>
/**
* PEAR_Command_Test (run-tests)
*
@@ -13861,7 +13931,7 @@ require_once 'PEAR/Command/Common.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -14097,7 +14167,7 @@ Run regression tests with PHP\'s regression testing script (run-tests.php).',
}
?>
-
+
/**
* PEAR_Downloader_Package
*
@@ -14114,7 +14184,7 @@ Run regression tests with PHP\'s regression testing script (run-tests.php).',
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Package.php,v 1.91 2006/01/23 19:05:52 cellog Exp $
+ * @version CVS: $Id: Package.php,v 1.91.2.1 2006/05/25 22:00:05 cellog Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -14148,7 +14218,7 @@ define('PEAR_DOWNLOADER_PACKAGE_STATE', -1003);
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -15109,8 +15179,10 @@ class PEAR_Downloader_Package
}
} else {
if (isset($param['uri'])) {
- $param['channel'] = '__uri';
- $param['package'] = $param['dep']['name'];
+ if ($this->getChannel() != '__uri') {
+ return false;
+ }
+ return $param['uri'] == $this->getURI();
}
$package = isset($param['package']) ? $param['package'] :
$param['info']->getPackage();
@@ -15818,7 +15890,7 @@ class PEAR_Downloader_Package
}
}
?>
-
+
/**
* PEAR_Frontend_CLI
*
@@ -15853,7 +15925,7 @@ require_once 'PEAR/Frontend.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -16560,7 +16632,7 @@ class PEAR_Frontend_CLI extends PEAR_Frontend
}
?>
-
+
/**
* Base class for all installation roles.
*
@@ -16592,7 +16664,7 @@ class PEAR_Frontend_CLI extends PEAR_Frontend
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -16739,7 +16811,7 @@ class PEAR_Installer_Role_Common
return $roleInfo['phpextension'];
}
}
-?>
+?>
<releasetypes>php</releasetypes>
<releasetypes>extsrc</releasetypes>
<releasetypes>extbin</releasetypes>
@@ -16751,7 +16823,7 @@ class PEAR_Installer_Role_Common
<executable />
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Data
*
@@ -16779,12 +16851,12 @@ class PEAR_Installer_Role_Common
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
class PEAR_Installer_Role_Data extends PEAR_Installer_Role_Common {}
-?>
+?>
<releasetypes>php</releasetypes>
<releasetypes>extsrc</releasetypes>
<releasetypes>extbin</releasetypes>
@@ -16796,7 +16868,7 @@ class PEAR_Installer_Role_Data extends PEAR_Installer_Role_Common {}
<executable />
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Doc
*
@@ -16824,12 +16896,12 @@ class PEAR_Installer_Role_Data extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
class PEAR_Installer_Role_Doc extends PEAR_Installer_Role_Common {}
-?>
+?>
<releasetypes>extbin</releasetypes>
<installable>1</installable>
<locationconfig>ext_dir</locationconfig>
@@ -16839,7 +16911,7 @@ class PEAR_Installer_Role_Doc extends PEAR_Installer_Role_Common {}
<executable />
<phpextension>1</phpextension>
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Ext
*
@@ -16867,12 +16939,12 @@ class PEAR_Installer_Role_Doc extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
class PEAR_Installer_Role_Ext extends PEAR_Installer_Role_Common {}
-?>
+?>
<releasetypes>php</releasetypes>
<releasetypes>extsrc</releasetypes>
<releasetypes>extbin</releasetypes>
@@ -16884,7 +16956,7 @@ class PEAR_Installer_Role_Ext extends PEAR_Installer_Role_Common {}
<executable />
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Php
*
@@ -16912,12 +16984,12 @@ class PEAR_Installer_Role_Ext extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
class PEAR_Installer_Role_Php extends PEAR_Installer_Role_Common {}
-?>
+?>
<releasetypes>php</releasetypes>
<releasetypes>extsrc</releasetypes>
<releasetypes>extbin</releasetypes>
@@ -16929,7 +17001,7 @@ class PEAR_Installer_Role_Php extends PEAR_Installer_Role_Common {}
<executable>1</executable>
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Script
*
@@ -16957,12 +17029,12 @@ class PEAR_Installer_Role_Php extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
class PEAR_Installer_Role_Script extends PEAR_Installer_Role_Common {}
-?>
+?>
<releasetypes>extsrc</releasetypes>
<installable />
<locationconfig />
@@ -16972,7 +17044,7 @@ class PEAR_Installer_Role_Script extends PEAR_Installer_Role_Common {}
<executable />
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Src
*
@@ -17000,7 +17072,7 @@ class PEAR_Installer_Role_Script extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -17011,7 +17083,7 @@ class PEAR_Installer_Role_Src extends PEAR_Installer_Role_Common
$installer->source_files++;
}
}
-?>
+?>
<releasetypes>php</releasetypes>
<releasetypes>extsrc</releasetypes>
<releasetypes>extbin</releasetypes>
@@ -17023,7 +17095,7 @@ class PEAR_Installer_Role_Src extends PEAR_Installer_Role_Common
<executable />
<phpextension />
<config_vars />
-</role>
+</role>
/**
* PEAR_Installer_Role_Test
*
@@ -17051,12 +17123,12 @@ class PEAR_Installer_Role_Src extends PEAR_Installer_Role_Common
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
class PEAR_Installer_Role_Test extends PEAR_Installer_Role_Common {}
-?>
+?>
/**
* PEAR_Installer_Role
*
@@ -17090,7 +17162,7 @@ require_once 'PEAR/XMLParser.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -17304,7 +17376,7 @@ class PEAR_Installer_Role
}
}
?>
-
+
/**
* package.xml generation class, package.xml version 1.0
*
@@ -17321,7 +17393,7 @@ class PEAR_Installer_Role
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: v1.php,v 1.70 2006/01/06 04:47:37 cellog Exp $
+ * @version CVS: $Id: v1.php,v 1.70.2.1 2006/05/10 02:55:06 cellog Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -17341,7 +17413,7 @@ require_once 'PEAR/PackageFile/v2.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -17358,7 +17430,7 @@ class PEAR_PackageFile_Generator_v1
function getPackagerVersion()
{
- return '1.4.9';
+ return '1.4.11';
}
/**
@@ -17512,7 +17584,7 @@ class PEAR_PackageFile_Generator_v1
);
$ret = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
$ret .= "<!DOCTYPE package SYSTEM \"http://pear.php.net/dtd/package-1.0\">\n";
- $ret .= "<package version=\"1.0\" packagerversion=\"1.4.9\">\n" .
+ $ret .= "<package version=\"1.0\" packagerversion=\"1.4.11\">\n" .
" <name>$pkginfo[package]</name>";
if (isset($pkginfo['extends'])) {
$ret .= "\n<extends>$pkginfo[extends]</extends>";
@@ -17986,7 +18058,9 @@ class PEAR_PackageFile_Generator_v1
}
$ret = new $class;
$ret->setConfig($this->_packagefile->_config);
- $ret->setLogger($this->_packagefile->_logger);
+ if (isset($this->_packagefile->_logger) && is_object($this->_packagefile->_logger)) {
+ $ret->setLogger($this->_packagefile->_logger);
+ }
$ret->fromArray($arr);
return $ret;
}
@@ -18570,7 +18644,7 @@ class PEAR_PackageFile_Generator_v1
return $ret;
}
}
-?>
+?>
/**
* package.xml generation class, package.xml version 2.0
*
@@ -18607,7 +18681,7 @@ require_once 'System.php';
* @author Stephan Schmidt (original XML_Serializer code)
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -18686,7 +18760,7 @@ http://pear.php.net/dtd/package-2.0.xsd',
*/
function getPackagerVersion()
{
- return '1.4.9';
+ return '1.4.11';
}
/**
@@ -18930,7 +19004,7 @@ http://pear.php.net/dtd/package-2.0.xsd',
}
$this->options['beautifyFilelist'] = true;
}
- $arr['attribs']['packagerversion'] = '1.4.9';
+ $arr['attribs']['packagerversion'] = '1.4.11';
if ($this->serialize($arr, $options)) {
return $this->_serializedData . "\n";
}
@@ -20102,7 +20176,7 @@ class PEAR_PackageFile_Generator_v2_XML_Util {
return PEAR::raiseError($msg, $code);
}
}
-?>
+?>
/**
* package.xml parsing class, package.xml version 1.0
*
@@ -20562,7 +20636,7 @@ class PEAR_PackageFile_Parser_v1
// }}}
}
-?>
+?>
/**
* package.xml parsing class, package.xml version 2.0
*
@@ -20676,7 +20750,7 @@ class PEAR_PackageFile_Parser_v2 extends PEAR_XMLParser
return $ret;
}
}
-?>
+?>
/**
* PEAR_PackageFile_v2, package.xml version 2.0, read/write version
*
@@ -20707,7 +20781,7 @@ require_once 'PEAR/PackageFile/v2.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a8
*/
@@ -22232,7 +22306,7 @@ class PEAR_PackageFile_v2_rw extends PEAR_PackageFile_v2
unset($this->_packageInfo['changelog']);
}
}
-?>
+?>
//
// +----------------------------------------------------------------------+
// | PHP Version 5 |
@@ -22251,7 +22325,7 @@ class PEAR_PackageFile_v2_rw extends PEAR_PackageFile_v2
// | |
// +----------------------------------------------------------------------+
//
-// $Id: Validator.php,v 1.86 2006/03/02 18:14:13 cellog Exp $
+// $Id: Validator.php,v 1.86.2.1 2006/05/10 02:55:06 cellog Exp $
/**
* Private validation class used by PEAR_PackageFile_v2 - do not use directly, its
* sole purpose is to split up the PEAR/PackageFile/v2.php file to make it smaller
@@ -22337,6 +22411,15 @@ class PEAR_PackageFile_v2_Validator
'*changelog',
);
$test = $this->_packageInfo;
+ if (isset($test['dependencies']) &&
+ isset($test['dependencies']['required']) &&
+ isset($test['dependencies']['required']['pearinstaller']) &&
+ isset($test['dependencies']['required']['pearinstaller']['min']) &&
+ version_compare('1.4.11',
+ $test['dependencies']['required']['pearinstaller']['min'], '<')) {
+ $this->_pearVersionTooLow($test['dependencies']['required']['pearinstaller']['min']);
+ return false;
+ }
// ignore post-installation array fields
if (array_key_exists('filelist', $test)) {
unset($test['filelist']);
@@ -23504,6 +23587,14 @@ class PEAR_PackageFile_v2_Validator
return in_array($role, PEAR_Installer_Role::getValidRoles($this->_pf->getPackageType()));
}
+ function _pearVersionTooLow($version)
+ {
+ $this->_stack->push(__FUNCTION__, 'error',
+ array('version' => $version),
+ 'This package.xml requires PEAR version %version% to parse properly, we are ' .
+ 'version 1.4.11');
+ }
+
function _invalidTagOrder($oktags, $actual, $root)
{
$this->_stack->push(__FUNCTION__, 'error',
@@ -24213,7 +24304,7 @@ class PEAR_PackageFile_v2_Validator
return $providesret;
}
}
-?>
+?>
/**
* PEAR_PackageFile_v1, package.xml version 1.0
*
@@ -24496,7 +24587,7 @@ define('PEAR_PACKAGEFILE_ERROR_INVALID_FILENAME', 52);
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -25813,7 +25904,7 @@ class PEAR_PackageFile_v1
// }}}
}
?>
-
+
/**
* PEAR_PackageFile_v2, package.xml version 2.0
*
@@ -25844,7 +25935,7 @@ require_once 'PEAR/ErrorStack.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -27821,7 +27912,7 @@ class PEAR_PackageFile_v2
}
}
?>
-
+
/**
* PEAR_REST_10
*
@@ -27856,7 +27947,7 @@ require_once 'PEAR/REST.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a12
*/
@@ -28444,7 +28535,7 @@ class PEAR_REST_10
return array_slice($states, $i + 1);
}
}
-?>
+?>
/**
* PEAR_REST_11 - implement faster list-all/remote-list command
*
@@ -28461,7 +28552,7 @@ class PEAR_REST_10
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: 11.php,v 1.4 2006/01/06 04:47:37 cellog Exp $
+ * @version CVS: $Id: 11.php,v 1.4.2.3 2006/08/15 21:25:12 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.3
*/
@@ -28479,7 +28570,7 @@ require_once 'PEAR/REST.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.3
*/
@@ -28502,7 +28593,7 @@ class PEAR_REST_11
return $categorylist;
}
$ret = array();
- if (!is_array($categorylist['c'])) {
+ if (!is_array($categorylist['c']) || !isset($categorylist['c'][0])) {
$categorylist['c'] = array($categorylist['c']);
}
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
@@ -28589,9 +28680,11 @@ class PEAR_REST_11
}
}
$d = false;
- foreach ($packageinfo['deps'] as $dep) {
- if ($dep['v'] == $latest) {
- $d = unserialize($dep['d']);
+ if (isset($packageinfo['deps']) && is_array($packageinfo['deps'])) {
+ foreach ($packageinfo['deps'] as $dep) {
+ if ($dep['v'] == $latest) {
+ $d = unserialize($dep['d']);
+ }
}
}
if ($d) {
@@ -28650,7 +28743,8 @@ class PEAR_REST_11
return array_slice($states, $i + 1);
}
}
-?>
+?>
+
/**
* <tasks:postinstallscript> - read/write version
*
@@ -28682,7 +28776,7 @@ require_once 'PEAR/Task/Postinstallscript.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a10
*/
@@ -28825,7 +28919,7 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript
);
}
}
-?>
+?>
/**
* <tasks:replace> - read/write version
*
@@ -28857,7 +28951,7 @@ require_once 'PEAR/Task/Replace.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a10
*/
@@ -28891,7 +28985,7 @@ class PEAR_Task_Replace_rw extends PEAR_Task_Replace
return $this->_params;
}
}
-?>
+?>
/**
* <tasks:unixeol> - read/write version
*
@@ -28923,7 +29017,7 @@ require_once 'PEAR/Task/Unixeol.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a10
*/
@@ -28952,7 +29046,7 @@ class PEAR_Task_Unixeol_rw extends PEAR_Task_Unixeol
return '';
}
}
-?>
+?>
/**
* <tasks:windowseol> - read/write version
*
@@ -28984,7 +29078,7 @@ require_once 'PEAR/Task/Windowseol.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a10
*/
@@ -29013,7 +29107,7 @@ class PEAR_Task_Windowseol_rw extends PEAR_Task_Windowseol
return '';
}
}
-?>
+?>
/**
* PEAR_Task_Common, base class for installer tasks
*
@@ -29068,7 +29162,7 @@ define('PEAR_TASK_PACKAGEANDINSTALL', 3);
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
* @abstract
@@ -29220,7 +29314,7 @@ class PEAR_Task_Common
return PEAR::raiseError($msg, $code);
}
}
-?>
+?>
/**
* <tasks:postinstallscript>
*
@@ -29255,7 +29349,7 @@ require_once 'PEAR/Task/Common.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -29548,7 +29642,7 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common
{
}
}
-?>
+?>
/**
* <tasks:replace>
*
@@ -29580,7 +29674,7 @@ require_once 'PEAR/Task/Common.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -29729,7 +29823,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common
return $contents;
}
}
-?>
+?>
/**
* <tasks:unixeol>
*
@@ -29761,7 +29855,7 @@ require_once 'PEAR/Task/Common.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -29811,7 +29905,7 @@ class PEAR_Task_Unixeol extends PEAR_Task_Common
return preg_replace("/\r\n|\n\r|\r|\n/", "\n", $contents);
}
}
-?>
+?>
/**
* <tasks:windowseol>
*
@@ -29843,7 +29937,7 @@ require_once 'PEAR/Task/Common.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -29893,7 +29987,7 @@ class PEAR_Task_Windowseol extends PEAR_Task_Common
return preg_replace("/\r\n|\n\r|\r|\n/", "\r\n", $contents);
}
}
-?>
+?>
/**
* Channel Validator for the pecl.php.net channel
*
@@ -29919,7 +30013,7 @@ require_once 'PEAR/Validate.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a5
*/
@@ -29954,7 +30048,7 @@ class PEAR_Validator_PECL extends PEAR_Validate
return $ret;
}
}
-?>
+?>
/**
* Class auto-loader
*
@@ -30006,7 +30100,7 @@ require_once "PEAR.php";
* @author Stig Bakken <ssb@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/manual/en/core.ppm.php#core.ppm.pear-autoloader
* @since File available since Release 0.1
* @deprecated File deprecated in Release 1.4.0a1
@@ -30177,7 +30271,7 @@ class PEAR_Autoloader extends PEAR
overload("PEAR_Autoloader");
?>
-
+
/**
* PEAR_Builder for building PHP extensions (PECL packages)
*
@@ -30214,7 +30308,7 @@ require_once 'PEAR/PackageFile.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since PHP 4.0.2
* @see http://pear.php.net/manual/en/core.ppm.pear-builder.php
@@ -30510,7 +30604,7 @@ class PEAR_Builder extends PEAR_Common
if (!@chdir($build_dir)) {
return $this->raiseError("could not chdir to $build_dir");
}
- putenv('PHP_PEAR_VERSION=1.4.9');
+ putenv('PHP_PEAR_VERSION=1.4.11');
foreach ($to_run as $cmd) {
$err = $this->_runCommand($cmd, $callback);
if (PEAR::isError($err)) {
@@ -30632,7 +30726,7 @@ class PEAR_Builder extends PEAR_Common
}
?>
-
+
/**
* PEAR_ChannelFile, the channel handling class
*
@@ -30786,7 +30880,7 @@ $GLOBALS['_PEAR_CHANNELS_MIRROR_TYPES'] = array('server');
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -32247,7 +32341,7 @@ class PEAR_ChannelFile {
}
}
?>
-
+
/**
* PEAR_Command, command pattern class
*
@@ -32265,7 +32359,7 @@ class PEAR_ChannelFile {
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Command.php,v 1.36 2006/01/06 04:47:36 cellog Exp $
+ * @version CVS: $Id: Command.php,v 1.36.2.1 2006/06/16 13:01:59 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -32343,7 +32437,7 @@ $GLOBALS['_PEAR_Command_objects'] = array();
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -32480,6 +32574,11 @@ class PEAR_Command
if ($dir === null) {
$dir = dirname(__FILE__) . '/Command';
}
+
+ if (!@is_dir($dir)) {
+ return PEAR::raiseError("registerCommands: opendir($dir) '$dir' does not exist or is not a directory");
+ }
+
$dp = @opendir($dir);
if (empty($dp)) {
return PEAR::raiseError("registerCommands: opendir($dir) failed");
@@ -32654,7 +32753,7 @@ class PEAR_Command
}
?>
-
+
/**
* PEAR_Common, the base class for the PEAR Installer
*
@@ -32784,7 +32883,7 @@ $GLOBALS['_PEAR_Common_script_phases'] = array('pre-install', 'post-install', 'p
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
* @deprecated This class will disappear, and its components will be spread
@@ -33782,7 +33881,7 @@ class PEAR_Common extends PEAR
}
require_once 'PEAR/Config.php';
require_once 'PEAR/PackageFile.php';
-?>
+?>
/**
* PEAR_Config, customized configuration handling for the PEAR Installer
*
@@ -33800,7 +33899,7 @@ require_once 'PEAR/PackageFile.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Config.php,v 1.124 2006/03/02 18:14:12 cellog Exp $
+ * @version CVS: $Id: Config.php,v 1.124.2.3 2006/07/15 00:38:27 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -33922,6 +34021,15 @@ if (getenv('PHP_PEAR_TEST_DIR')) {
$PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'tests');
}
+// Default for temp_dir
+if (getenv('PHP_PEAR_TEMP_DIR')) {
+ define('PEAR_CONFIG_DEFAULT_TEMP_DIR', getenv('PHP_PEAR_TEMP_DIR'));
+} else {
+ define('PEAR_CONFIG_DEFAULT_TEMP_DIR',
+ System::tmpdir() . DIRECTORY_SEPARATOR . 'pear' .
+ DIRECTORY_SEPARATOR . 'temp');
+}
+
// Default for cache_dir
if (getenv('PHP_PEAR_CACHE_DIR')) {
define('PEAR_CONFIG_DEFAULT_CACHE_DIR', getenv('PHP_PEAR_CACHE_DIR'));
@@ -33931,6 +34039,15 @@ if (getenv('PHP_PEAR_CACHE_DIR')) {
DIRECTORY_SEPARATOR . 'cache');
}
+// Default for download_dir
+if (getenv('PHP_PEAR_DOWNLOAD_DIR')) {
+ define('PEAR_CONFIG_DEFAULT_DOWNLOAD_DIR', getenv('PHP_PEAR_DOWNLOAD_DIR'));
+} else {
+ define('PEAR_CONFIG_DEFAULT_DOWNLOAD_DIR',
+ System::tmpdir() . DIRECTORY_SEPARATOR . 'pear' .
+ DIRECTORY_SEPARATOR . 'download');
+}
+
// Default for php_bin
if (getenv('PHP_PEAR_PHP_BIN')) {
define('PEAR_CONFIG_DEFAULT_PHP_BIN', getenv('PHP_PEAR_PHP_BIN'));
@@ -34000,7 +34117,7 @@ if (getenv('PHP_PEAR_SIG_KEYDIR')) {
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -34196,6 +34313,20 @@ class PEAR_Config extends PEAR
'prompt' => 'PEAR Installer cache directory',
'group' => 'File Locations (Advanced)',
),
+ 'temp_dir' => array(
+ 'type' => 'directory',
+ 'default' => PEAR_CONFIG_DEFAULT_TEMP_DIR,
+ 'doc' => 'directory which is used for all temp files',
+ 'prompt' => 'PEAR Installer temp directory',
+ 'group' => 'File Locations (Advanced)',
+ ),
+ 'download_dir' => array(
+ 'type' => 'directory',
+ 'default' => PEAR_CONFIG_DEFAULT_CACHE_DIR,
+ 'doc' => 'directory which is used for all downloaded files',
+ 'prompt' => 'PEAR Installer download directory',
+ 'group' => 'File Locations (Advanced)',
+ ),
'php_bin' => array(
'type' => 'file',
'default' => PEAR_CONFIG_DEFAULT_PHP_BIN,
@@ -35848,7 +35979,7 @@ class PEAR_Config extends PEAR
}
?>
-
+
//
// +----------------------------------------------------------------------+
// | PHP Version 5 |
@@ -36343,7 +36474,7 @@ class PEAR_Dependency
// }}}
}
?>
-
+
/**
* PEAR_DependencyDB, advanced installed packages dependency database
*
@@ -36361,7 +36492,7 @@ class PEAR_Dependency
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: DependencyDB.php,v 1.30 2006/01/06 04:47:36 cellog Exp $
+ * @version CVS: $Id: DependencyDB.php,v 1.30.2.1 2006/05/25 22:00:05 cellog Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -36380,7 +36511,7 @@ require_once 'PEAR/Config.php';
* @author Tomas V.V.Cox <cox@idec.net.com>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -36635,16 +36766,36 @@ class PEAR_DependencyDB
return false;
}
foreach ($this->_cache['dependencies'][$channel][$package] as $info) {
+ if (isset($info['dep']['uri'])) {
+ if (is_object($child)) {
+ if ($info['dep']['uri'] == $child->getURI()) {
+ return true;
+ }
+ } elseif (isset($child['uri'])) {
+ if ($info['dep']['uri'] == $child['uri']) {
+ return true;
+ }
+ }
+ return false;
+ }
if (strtolower($info['dep']['channel']) == strtolower($depchannel) &&
strtolower($info['dep']['name']) == strtolower($deppackage)) {
return true;
}
}
foreach ($this->_cache['dependencies'][$channel][$package] as $info) {
- if ($this->_dependsOn(array(
- 'channel' => $info['dep']['channel'],
- 'package' => $info['dep']['name']), $child, $checked)) {
- return true;
+ if (isset($info['dep']['uri'])) {
+ if ($this->_dependsOn(array(
+ 'uri' => $info['dep']['uri'],
+ 'package' => $info['dep']['name']), $child, $checked)) {
+ return true;
+ }
+ } else {
+ if ($this->_dependsOn(array(
+ 'channel' => $info['dep']['channel'],
+ 'package' => $info['dep']['name']), $child, $checked)) {
+ return true;
+ }
}
}
return false;
@@ -36997,7 +37148,7 @@ class PEAR_DependencyDB
}
}
}
-?>
+?>
/**
* PEAR_Dependency2, advanced dependency validation
*
@@ -37036,7 +37187,7 @@ require_once 'PEAR/Validate.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -37524,7 +37675,7 @@ class PEAR_Dependency2
*/
function getPEARVersion()
{
- return '1.4.9';
+ return '1.4.11';
}
function validatePearinstallerDependency($dep)
@@ -38198,7 +38349,7 @@ class PEAR_Dependency2
$this->_currentPackage, true)));
}
}
-?>
+?>
/**
* PEAR_Downloader, the PEAR Installer's download utility class
*
@@ -38218,7 +38369,7 @@ class PEAR_Dependency2
* @author Martin Jansen <mj@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Downloader.php,v 1.99 2006/03/02 18:14:13 cellog Exp $
+ * @version CVS: $Id: Downloader.php,v 1.99.2.2 2006/06/16 12:35:12 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.3.0
*/
@@ -38245,7 +38396,7 @@ define('PEAR_INSTALLER_ERROR_NO_PREF_STATE', 2);
* @author Martin Jansen <mj@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.3.0
*/
@@ -38332,7 +38483,7 @@ class PEAR_Downloader extends PEAR_Common
* @access private
*/
var $_errorStack = array();
-
+
/**
* @var boolean
* @access private
@@ -38493,29 +38644,37 @@ class PEAR_Downloader extends PEAR_Common
$this->pushError('Package "' . $param . '" is not valid',
PEAR_INSTALLER_SKIPPED);
} else {
- if ($params[$i] && !isset($channelschecked[$params[$i]->getChannel()]) &&
- !isset($this->_options['offline'])) {
- $channelschecked[$params[$i]->getChannel()] = true;
- PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
- if (!class_exists('System')) {
- require_once 'System.php';
- }
- $curchannel = &$this->_registry->getChannel($params[$i]->getChannel());
- if (PEAR::isError($curchannel)) {
- PEAR::staticPopErrorHandling();
- return $this->raiseError($curchannel);
+ do {
+ if ($params[$i] && $params[$i]->getType() == 'local') {
+ // bug #7090
+ // skip channel.xml check for local packages
+ break;
}
- $a = $this->downloadHttp('http://' . $params[$i]->getChannel() .
- '/channel.xml', $this->ui,
- System::mktemp(array('-d')), null, $curchannel->lastModified());
- PEAR::staticPopErrorHandling();
- if (PEAR::isError($a) || !$a) {
- continue;
+ if ($params[$i] && !isset($channelschecked[$params[$i]->getChannel()]) &&
+ !isset($this->_options['offline'])) {
+ $channelschecked[$params[$i]->getChannel()] = true;
+ PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
+ if (!class_exists('System')) {
+ require_once 'System.php';
+ }
+ $curchannel = &$this->_registry->getChannel($params[$i]->getChannel());
+ if (PEAR::isError($curchannel)) {
+ PEAR::staticPopErrorHandling();
+ return $this->raiseError($curchannel);
+ }
+ $a = $this->downloadHttp('http://' . $params[$i]->getChannel() .
+ '/channel.xml', $this->ui,
+ System::mktemp(array('-t' . $this->getDownloadDir())), null, $curchannel->lastModified());
+
+ PEAR::staticPopErrorHandling();
+ if (PEAR::isError($a) || !$a) {
+ break;
+ }
+ $this->log(0, 'WARNING: channel "' . $params[$i]->getChannel() . '" has ' .
+ 'updated its protocols, use "channel-update ' . $params[$i]->getChannel() .
+ '" to update');
}
- $this->log(0, 'WARNING: channel "' . $params[$i]->getChannel() . '" has ' .
- 'updated its protocols, use "channel-update ' . $params[$i]->getChannel() .
- '" to update');
- }
+ } while (false);
if ($params[$i] && !isset($this->_options['downloadonly'])) {
if (isset($this->_options['packagingroot'])) {
$checkdir = $this->_prependPath(
@@ -39043,33 +39202,62 @@ class PEAR_Downloader extends PEAR_Common
{
$xsdversion = isset($dep['rel']) ? '1.0' : '2.0';
$curchannel = $this->config->get('default_channel');
- if (isset($dep['channel'])) {
- $remotechannel = $dep['channel'];
+ if (isset($dep['uri'])) {
+ $xsdversion = '2.0';
+ $chan = &$this->_registry->getChannel('__uri');
+ if (PEAR::isError($chan)) {
+ return $chan;
+ }
+ $version = $this->_registry->packageInfo($dep['name'], 'version', '__uri');
+ $this->configSet('default_channel', '__uri');
} else {
- $remotechannel = 'pear.php.net';
- }
- if (!$this->_registry->channelExists($remotechannel)) {
- do {
- if ($this->config->get('auto_discover')) {
- if ($this->discover($remotechannel)) {
- break;
+ if (isset($dep['channel'])) {
+ $remotechannel = $dep['channel'];
+ } else {
+ $remotechannel = 'pear.php.net';
+ }
+ if (!$this->_registry->channelExists($remotechannel)) {
+ do {
+ if ($this->config->get('auto_discover')) {
+ if ($this->discover($remotechannel)) {
+ break;
+ }
}
- }
- return PEAR::raiseError('Unknown remote channel: ' . $remotechannel);
- } while (false);
+ return PEAR::raiseError('Unknown remote channel: ' . $remotechannel);
+ } while (false);
+ }
+ $chan = &$this->_registry->getChannel($remotechannel);
+ if (PEAR::isError($chan)) {
+ return $chan;
+ }
+ $version = $this->_registry->packageInfo($dep['name'], 'version',
+ $remotechannel);
+ $this->configSet('default_channel', $remotechannel);
}
- $this->configSet('default_channel', $remotechannel);
$state = isset($parr['state']) ? $parr['state'] : $this->config->get('preferred_state');
if (isset($parr['state']) && isset($parr['version'])) {
unset($parr['state']);
}
- $chan = &$this->_registry->getChannel($remotechannel);
- if (PEAR::isError($chan)) {
- return $chan;
- }
- $version = $this->_registry->packageInfo($dep['name'], 'version',
- $remotechannel);
- if ($chan->supportsREST($this->config->get('preferred_mirror')) &&
+ if (isset($dep['uri'])) {
+ $info = &$this->newDownloaderPackage($this);
+ PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
+ $err = $info->initialize($dep);
+ PEAR::staticPopErrorHandling();
+ if (!$err) {
+ // skip parameters that were missed by preferred_state
+ return PEAR::raiseError('Cannot initialize dependency');
+ }
+ if (PEAR::isError($err)) {
+ if (!isset($this->_options['soft'])) {
+ $this->log(0, $err->getMessage());
+ }
+ if (is_object($info)) {
+ $param = $info->getChannel() . '/' . $info->getPackage();
+ }
+ return PEAR::raiseError('Package "' . $param . '" is not valid');
+ }
+ return $info;
+ } elseif ($chan->supportsREST($this->config->get('preferred_mirror')) &&
$base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) {
$rest = &$this->config->getREST('1.0', $this->_options);
$url = $rest->getDepDownloadURL($base, $xsdversion, $dep, $parr,
@@ -39126,7 +39314,7 @@ class PEAR_Downloader extends PEAR_Common
} else {
$url = $this->_remote->call('package.getDepDownloadURL', $xsdversion, $dep, $parr, $state);
}
- if ($parr['channel'] != $curchannel) {
+ if ($this->config->get('default_channel') != $curchannel) {
$this->configSet('default_channel', $curchannel);
}
if (!is_array($url)) {
@@ -39284,7 +39472,7 @@ class PEAR_Downloader extends PEAR_Common
*/
function sortPkgDeps(&$packages, $uninstall = false)
{
- $uninstall ?
+ $uninstall ?
$this->sortPackagesForUninstall($packages) :
$this->sortPackagesForInstall($packages);
}
@@ -39527,7 +39715,7 @@ class PEAR_Downloader extends PEAR_Common
$config = &PEAR_Config::singleton();
}
$proxy_host = $proxy_port = $proxy_user = $proxy_pass = '';
- if ($config->get('http_proxy')&&
+ if ($config->get('http_proxy')&&
$proxy = parse_url($config->get('http_proxy'))) {
$proxy_host = @$proxy['host'];
if (isset($proxy['scheme']) && $proxy['scheme'] == 'https') {
@@ -39595,7 +39783,7 @@ class PEAR_Downloader extends PEAR_Common
$ifmodifiedsince = ($lastmodified ? "If-Modified-Since: $lastmodified\r\n" : '');
}
$request .= "Host: $host:$port\r\n" . $ifmodifiedsince .
- "User-Agent: PEAR/1.4.9/PHP/" . PHP_VERSION . "\r\n";
+ "User-Agent: PEAR/1.4.11/PHP/" . PHP_VERSION . "\r\n";
if (isset($this)) { // only pass in authentication for non-static calls
$username = $config->get('username');
$password = $config->get('password');
@@ -39708,7 +39896,7 @@ class PEAR_Downloader extends PEAR_Common
// }}}
?>
-
+
/**
* Error Stack Implementation
*
@@ -39842,7 +40030,7 @@ define('PEAR_ERRORSTACK_ERR_OBJTOSTRING', 2);
* $local_stack = new PEAR_ErrorStack('MyPackage');
* </code>
* @author Greg Beaver <cellog@php.net>
- * @version 1.4.9
+ * @version 1.4.11
* @package PEAR_ErrorStack
* @category Debugging
* @copyright 2004-2006 Greg Beaver
@@ -40678,7 +40866,7 @@ class PEAR_ErrorStack {
$stack = &PEAR_ErrorStack::singleton('PEAR_ErrorStack');
$stack->pushCallback(array('PEAR_ErrorStack', '_handleError'));
?>
-
+
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
/**
* PEAR_Exception
@@ -40775,7 +40963,7 @@ $stack->pushCallback(array('PEAR_ErrorStack', '_handleError'));
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.3.3
*
@@ -41053,7 +41241,7 @@ class PEAR_Exception extends Exception
}
}
-?>
+?>
/**
* PEAR_Frontend, the singleton-based frontend for user input/output
*
@@ -41097,7 +41285,7 @@ $GLOBALS['_PEAR_FRONTEND_SINGLETON'] = null;
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -41238,7 +41426,7 @@ class PEAR_Frontend extends PEAR
{
}
}
-?>
+?>
/**
* PEAR_Installer
*
@@ -41282,7 +41470,7 @@ define('PEAR_INSTALLER_NOBINARY', -240);
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -42829,7 +43017,7 @@ if (!function_exists("md5_file")) {
}
// }}}
-?>
+?>
/**
* PEAR_PackageFile, package.xml parsing utility class
*
@@ -42846,7 +43034,7 @@ if (!function_exists("md5_file")) {
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: PackageFile.php,v 1.33 2006/02/09 22:39:32 cellog Exp $
+ * @version CVS: $Id: PackageFile.php,v 1.33.2.1 2006/06/08 00:04:13 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -42872,7 +43060,7 @@ define('PEAR_PACKAGEFILE_ERROR_INVALID_PACKAGEVERSION', 2);
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -43235,6 +43423,11 @@ class PEAR_PackageFile
*/
function &fromAnyFile($info, $state)
{
+ if (is_dir($info)) {
+ $info = PEAR::raiseError("'$info' is a directory, a file is expected");
+ return $info;
+ }
+
$fp = false;
if (is_string($info) && strlen($info) < 255 &&
(file_exists($info) || ($fp = @fopen($info, 'r')))) {
@@ -43264,7 +43457,8 @@ class PEAR_PackageFile
}
}
-?>
+?>
+
/**
* PEAR_Packager for generating releases
*
@@ -43303,7 +43497,7 @@ require_once 'System.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -43466,7 +43660,7 @@ if (!function_exists('md5_file')) {
// }}}
?>
-
+
/**
* PEAR_Registry
*
@@ -43511,7 +43705,7 @@ define('PEAR_REGISTRY_ERROR_CHANNEL_FILE', -6);
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -45627,7 +45821,7 @@ class PEAR_Registry extends PEAR
}
?>
-
+
/**
* PEAR_Remote
*
@@ -45669,7 +45863,7 @@ require_once 'PEAR/Config.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -46146,7 +46340,7 @@ class PEAR_Remote extends PEAR
}
?>
-
+
/**
* PEAR_REST
*
@@ -46182,7 +46376,7 @@ require_once 'PEAR/XMLParser.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -46471,7 +46665,7 @@ class PEAR_REST
$ifmodifiedsince = ($lastmodified ? "If-Modified-Since: $lastmodified\r\n" : '');
}
$request .= "Host: $host:$port\r\n" . $ifmodifiedsince .
- "User-Agent: PEAR/1.4.9/PHP/" . PHP_VERSION . "\r\n";
+ "User-Agent: PEAR/1.4.11/PHP/" . PHP_VERSION . "\r\n";
$username = $this->config->get('username');
$password = $this->config->get('password');
if ($username && $password) {
@@ -46543,7 +46737,7 @@ class PEAR_REST
}
}
?>
-
+
/**
* PEAR_RunTest
*
@@ -46589,7 +46783,7 @@ putenv("PHP_PEAR_RUNTESTS=1");
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.3.3
*/
@@ -46952,7 +47146,7 @@ $text
}
?>
-
+
/**
* PEAR_Validate
*
@@ -46969,7 +47163,7 @@ $text
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Validate.php,v 1.46 2006/01/23 17:16:35 cellog Exp $
+ * @version CVS: $Id: Validate.php,v 1.46.2.3 2006/07/17 17:49:37 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -46992,7 +47186,7 @@ require_once 'PEAR/Validator/PECL.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -47399,17 +47593,16 @@ class PEAR_Validate
{
if ($this->_state == PEAR_VALIDATE_NORMAL ||
$this->_state == PEAR_VALIDATE_PACKAGING) {
- if (!preg_match('/\d\d\d\d\-\d\d\-\d\d/',
- $this->_packagexml->getDate())) {
- $this->_addFailure('date', 'invalid release date "' .
- $this->_packagexml->getDate() . '"');
- return false;
- }
- if (strtotime($this->_packagexml->getDate()) == -1) {
+ if (!preg_match('/(\d\d\d\d)\-(\d\d)\-(\d\d)/',
+ $this->_packagexml->getDate(), $res) ||
+ count($res) < 4
+ || !checkdate($res[2], $res[3], $res[1])
+ ) {
$this->_addFailure('date', 'invalid release date "' .
$this->_packagexml->getDate() . '"');
return false;
}
+
if ($this->_state == PEAR_VALIDATE_PACKAGING &&
$this->_packagexml->getDate() != date('Y-m-d')) {
$this->_addWarning('date', 'Release Date "' .
@@ -47582,7 +47775,8 @@ class PEAR_Validate
return true;
}
}
-?>
+?>
+
/**
* PEAR_FTP
*
@@ -47613,7 +47807,7 @@ class PEAR_Validate
* @author Stephan Schmidt (original XML_Unserializer code)
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -47842,7 +48036,7 @@ class PEAR_XMLParser
$this->_dataStack[$this->_depth] .= $cdata;
}
}
-?>
+?>
REM ----------------------------------------------------------------------
REM PHP version 5
@@ -47956,7 +48150,7 @@ GOTO END
:RUN
"%PHP_PEAR_PHP_BIN%" -C -d output_buffering=1 -d safe_mode=0 -d open_basedir="" -d include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
:END
-@ECHO ON
+@ECHO ON
REM ----------------------------------------------------------------------
REM PHP version 5
@@ -48070,7 +48264,7 @@ GOTO END
:RUN
"%PHP_PEAR_PHP_BIN%" -C -d memory_limit="-1" -d safe_mode=0 -d open_basedir="" -d output_buffering=1 -d include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
:END
-@ECHO ON
+@ECHO ON
REM ----------------------------------------------------------------------
REM PHP version 5
@@ -48184,7 +48378,7 @@ GOTO END
:RUN
"%PHP_PEAR_PHP_BIN%" -C -n -d output_buffering=1 -d safe_mode=0 -d include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\peclcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
:END
-@ECHO ON
+@ECHO ON
# first find which PHP binary to use
if test "x$PHP_PEAR_PHP_BIN" != "x"; then
@@ -48212,7 +48406,7 @@ else
fi
exec $PHP -C -q $INCARG -d output_buffering=1 -d open_basedir="" -d safe_mode=0 $INCDIR/pearcmd.php "$@"
-
+
# first find which PHP binary to use
if test "x$PHP_PEAR_PHP_BIN" != "x"; then
@@ -48240,7 +48434,7 @@ else
fi
exec $PHP -d memory_limit="-1" -C -q $INCARG -d output_buffering=1 -d open_basedir="" -d safe_mode=0 $INCDIR/pearcmd.php "$@"
-
+
# first find which PHP binary to use
if test "x$PHP_PEAR_PHP_BIN" != "x"; then
@@ -48268,7 +48462,7 @@ else
fi
exec $PHP -C -n -q $INCARG -d output_buffering=1 -d safe_mode=0 $INCDIR/peclcmd.php "$@"
-
+
//
// +----------------------------------------------------------------------+
// | PHP Version 5 |
@@ -48705,7 +48899,7 @@ function error_handler($errno, $errmsg, $file, $line, $vars) {
// vim600:syn=php
?>
-
+
//
// +----------------------------------------------------------------------+
// | PHP Version 5 |
@@ -48750,7 +48944,7 @@ require_once 'pearcmd.php';
// vim600:syn=php
?>
-
+
$Id: package.dtd,v 1.38 2005/11/12 02:23:07 cellog Exp $
This is the PEAR package description, version 1.0.
@@ -48853,7 +49047,7 @@ require_once 'pearcmd.php';
to CDATA #REQUIRED>
-
+
/**
* PEAR, the PHP Extension and Application Repository
*
@@ -48948,7 +49142,7 @@ $GLOBALS['_PEAR_error_handler_stack'] = array();
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @see PEAR_Error
* @since Class available since PHP 4.0.2
@@ -49663,7 +49857,7 @@ function _PEAR_call_destructors()
* @author Gregory Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/manual/en/core.pear.pear-error.php
* @see PEAR::raiseError(), PEAR::throwError()
* @since Class available since PHP 4.0.2
@@ -49954,7 +50148,7 @@ class PEAR_Error
* End:
*/
?>
-
+
/**
* File/Directory manipulation
*
@@ -49971,7 +50165,7 @@ class PEAR_Error
* @author Tomas V.V.Cox <cox@idecnet.com>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: System.php,v 1.53 2006/01/06 04:47:36 cellog Exp $
+ * @version CVS: $Id: System.php,v 1.53.2.1 2006/06/16 13:55:16 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -50011,7 +50205,7 @@ $GLOBALS['_System_temp_files'] = array();
* @author Tomas V.V. Cox <cox@idecnet.com>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
-* @version Release: 1.4.9
+* @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
@@ -50447,7 +50641,7 @@ class System
foreach ($exe_suffixes as $suff) {
foreach ($path_elements as $dir) {
$file = $dir . DIRECTORY_SEPARATOR . $program . $suff;
- if ($pear_is_executable($file)) {
+ if (@$pear_is_executable($file)) {
return $file;
}
}
@@ -50541,7 +50735,7 @@ class System
}
}
?>
-
+
Name: @rpm_package@
Version: @version@
Release: 1
@@ -50613,7 +50807,639 @@ cp -p package@package2xml@.xml %{buildroot}@rpm_xml_dir@/@package@.xml
%defattr(-,root,root)
%doc @doc_files@
/
-
+
+<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
+<package version="1.0" packagerversion="1.4.11">
+ <name>PEAR</name>
+ <summary>PEAR Base System</summary>
+ <description>The PEAR package contains:
+ * the PEAR installer, for creating, distributing
+ and installing packages
+ * the beta-quality PEAR_Exception PHP5 error handling mechanism
+ * the beta-quality PEAR_ErrorStack advanced error handling mechanism
+ * the PEAR_Error error handling mechanism
+ * the OS_Guess class for retrieving info about the OS
+ where PHP is running on
+ * the System class for quick handling of common operations
+ with files and directories
+ * the PEAR base class
+
+ New features in a nutshell:
+ * full support for channels
+ * pre-download dependency validation
+ * new package.xml 2.0 format allows tremendous flexibility while maintaining BC
+ * support for optional dependency groups and limited support for sub-packaging
+ * robust dependency support
+ * full dependency validation on uninstall
+ * remote install for hosts with only ftp access - no more problems with
+ restricted host installation
+ * full support for mirroring
+ * support for bundling several packages into a single tarball
+ * support for static dependencies on a url-based package
+ * support for custom file roles and installation tasks
+
+ NOTE: users of PEAR_Frontend_Web/PEAR_Frontend_Gtk must upgrade their installations
+ to the latest version, or PEAR will not upgrade properly
+ </description>
+ <maintainers>
+ <maintainer>
+ <user>cellog</user>
+ <name>Greg Beaver</name>
+ <email>cellog@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>ssb</user>
+ <name>Stig Bakken</name>
+ <email>stig@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>cox</user>
+ <name>Tomas V.V.Cox</name>
+ <email>cox@idecnet.com</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>pajoye</user>
+ <name>Pierre-Alain Joye</name>
+ <email>pajoye@pearfr.org</email>
+ <role>lead</role>
+ </maintainer>
+ <maintainer>
+ <user>timj</user>
+ <name>Tim Jackson</name>
+ <email>timj@php.net</email>
+ <role>helper</role>
+ </maintainer>
+ <maintainer>
+ <user>toggg</user>
+ <name>Bertrand Gugger</name>
+ <email>toggg@php.net</email>
+ <role>helper</role>
+ </maintainer>
+ <maintainer>
+ <user>mj</user>
+ <name>Martin Jansen</name>
+ <email>mj@php.net</email>
+ <role>helper</role>
+ </maintainer>
+ </maintainers>
+ <release>
+ <version>1.4.11</version>
+ <date>2006-08-16</date>
+ <license>PHP License</license>
+ <state>stable</state>
+ <notes>minor bugfix release
+* fix the conflicts detection for the web frontend (before 0.5.0)
+* fix warnings in the list-all command
+ </notes>
+ <deps>
+ <dep type="php" rel="ge" version="4.2"/>
+ <dep type="pkg" rel="ge" version="1.3.3">PEAR</dep>
+ <dep type="pkg" rel="ge" version="1.3.1">Archive_Tar</dep>
+ <dep type="pkg" rel="ge" version="1.2">Console_Getopt</dep>
+ <dep type="pkg" rel="ge" version="1.4.0" optional="yes">XML_RPC</dep>
+ <dep type="pkg" rel="ge" version="0.5.0" optional="yes">PEAR_Frontend_Web</dep>
+ <dep type="pkg" rel="ge" version="0.4.0" optional="yes">PEAR_Frontend_Gtk</dep>
+ <dep type="pkg" rel="ge" version="0.1.0" optional="yes">PEAR_Frontend_Gtk2</dep>
+ <dep type="ext" rel="has">xml</dep>
+ <dep type="ext" rel="has">pcre</dep>
+ </deps>
+ <provides type="class" name="OS_Guess" />
+ <provides type="class" name="System" />
+ <provides type="function" name="md5_file" />
+ <filelist>
+ <file role="php" name="OS/Guess.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/ChannelFile/Parser.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command/Auth.xml"/>
+ <file role="php" name="PEAR/Command/Auth.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command/Build.xml"/>
+ <file role="php" name="PEAR/Command/Build.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command/Channels.xml"/>
+ <file role="php" name="PEAR/Command/Channels.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command/Common.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command/Config.xml"/>
+ <file role="php" name="PEAR/Command/Config.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command/Install.xml"/>
+ <file role="php" name="PEAR/Command/Install.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command/Package.xml"/>
+ <file role="php" name="PEAR/Command/Package.php">
+ <replace from="@DATA-DIR@" to="data_dir" type="pear-config"/>
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command/Pickle.xml"/>
+ <file role="php" name="PEAR/Command/Pickle.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command/Registry.xml"/>
+ <file role="php" name="PEAR/Command/Registry.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command/Remote.xml"/>
+ <file role="php" name="PEAR/Command/Remote.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command/Mirror.xml"/>
+ <file role="php" name="PEAR/Command/Mirror.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command/Test.xml"/>
+ <file role="php" name="PEAR/Command/Test.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Downloader/Package.php">
+ <replace from="@PEAR-VER@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Frontend/CLI.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Installer/Role/Common.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Installer/Role/Data.xml"/>
+ <file role="php" name="PEAR/Installer/Role/Data.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Installer/Role/Doc.xml"/>
+ <file role="php" name="PEAR/Installer/Role/Doc.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Installer/Role/Ext.xml"/>
+ <file role="php" name="PEAR/Installer/Role/Ext.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Installer/Role/Php.xml"/>
+ <file role="php" name="PEAR/Installer/Role/Php.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Installer/Role/Script.xml"/>
+ <file role="php" name="PEAR/Installer/Role/Script.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Installer/Role/Src.xml"/>
+ <file role="php" name="PEAR/Installer/Role/Src.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Installer/Role/Test.xml"/>
+ <file role="php" name="PEAR/Installer/Role/Test.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Installer/Role.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/PackageFile/Generator/v1.php">
+ <replace from="@PEAR-VER@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/PackageFile/Generator/v2.php">
+ <replace from="@PEAR-VER@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/PackageFile/Parser/v1.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/PackageFile/Parser/v2.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/PackageFile/v2/rw.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/PackageFile/v2/Validator.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/PackageFile/v1.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/PackageFile/v2.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/REST/10.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/REST/11.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Task/Postinstallscript/rw.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Task/Replace/rw.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Task/Unixeol/rw.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Task/Windowseol/rw.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Task/Common.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Task/Postinstallscript.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Task/Replace.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Task/Unixeol.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Task/Windowseol.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Validator/PECL.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Autoloader.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Builder.php">
+ <replace from="@PEAR-VER@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/ChannelFile.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Command.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Common.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Config.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Dependency.php"/>
+ <file role="php" name="PEAR/DependencyDB.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Dependency2.php">
+ <replace from="@PEAR-VER@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Downloader.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/ErrorStack.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Exception.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Frontend.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Installer.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Packager.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/PackageFile.php">
+ <replace from="@PEAR-VER@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Registry.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Remote.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/REST.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/RunTest.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/Validate.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" name="PEAR/XMLParser.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="script" baseinstalldir="/" platform="!windows" install-as="pear" name="scripts/pear.sh">
+ <replace from="@php_bin@" to="php_bin" type="pear-config"/>
+ <replace from="@php_dir@" to="php_dir" type="pear-config"/>
+ <replace from="@pear_version@" to="version" type="package-info"/>
+ <replace from="@include_path@" to="php_dir" type="pear-config"/>
+ </file>
+ <file role="script" baseinstalldir="/" platform="!windows" install-as="peardev" name="scripts/peardev.sh">
+ <replace from="@php_bin@" to="php_bin" type="pear-config"/>
+ <replace from="@php_dir@" to="php_dir" type="pear-config"/>
+ <replace from="@pear_version@" to="version" type="package-info"/>
+ <replace from="@include_path@" to="php_dir" type="pear-config"/>
+ </file>
+ <file role="script" baseinstalldir="/" platform="!windows" install-as="pecl" name="scripts/pecl.sh">
+ <replace from="@php_bin@" to="php_bin" type="pear-config"/>
+ <replace from="@php_dir@" to="php_dir" type="pear-config"/>
+ <replace from="@pear_version@" to="version" type="package-info"/>
+ <replace from="@include_path@" to="php_dir" type="pear-config"/>
+ </file>
+ <file role="script" baseinstalldir="/" platform="windows" install-as="peardev.bat" name="scripts/peardev.bat">
+ <replace from="@bin_dir@" to="bin_dir" type="pear-config"/>
+ <replace from="@php_bin@" to="php_bin" type="pear-config"/>
+ <replace from="@include_path@" to="php_dir" type="pear-config"/>
+ </file>
+ <file role="script" baseinstalldir="/" platform="windows" install-as="pear.bat" name="scripts/pear.bat">
+ <replace from="@bin_dir@" to="bin_dir" type="pear-config"/>
+ <replace from="@php_bin@" to="php_bin" type="pear-config"/>
+ <replace from="@include_path@" to="php_dir" type="pear-config"/>
+ </file>
+ <file role="script" baseinstalldir="/" platform="windows" install-as="pecl.bat" name="scripts/pecl.bat">
+ <replace from="@bin_dir@" to="bin_dir" type="pear-config"/>
+ <replace from="@php_bin@" to="php_bin" type="pear-config"/>
+ <replace from="@include_path@" to="php_dir" type="pear-config"/>
+ </file>
+ <file role="php" baseinstalldir="/" install-as="pearcmd.php" name="scripts/pearcmd.php">
+ <replace from="@php_bin@" to="php_bin" type="pear-config"/>
+ <replace from="@php_dir@" to="php_dir" type="pear-config"/>
+ <replace from="@pear_version@" to="version" type="package-info"/>
+ <replace from="@include_path@" to="php_dir" type="pear-config"/>
+ </file>
+ <file role="php" baseinstalldir="/" install-as="peclcmd.php" name="scripts/peclcmd.php">
+ <replace from="@php_bin@" to="php_bin" type="pear-config"/>
+ <replace from="@php_dir@" to="php_dir" type="pear-config"/>
+ <replace from="@pear_version@" to="version" type="package-info"/>
+ <replace from="@include_path@" to="php_dir" type="pear-config"/>
+ </file>
+ <file role="data" baseinstalldir="/" name="package.dtd"/>
+ <file role="data" baseinstalldir="/" name="template.spec"/>
+ <file role="php" baseinstalldir="/" name="PEAR.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file role="php" baseinstalldir="/" name="System.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ </filelist>
+ </release>
+ <changelog>
+ <release>
+ <version>1.4.0</version>
+ <date>2005-09-18</date>
+ <license>PHP License</license>
+ <state>stable</state>
+ <notes>This is a major milestone release for PEAR. In addition to several killer features,
+every single element of PEAR has a regression test, and so stability is much higher
+than any previous PEAR release.
+New features in a nutshell:
+* full support for channels
+* pre-download dependency validation
+* new package.xml 2.0 format allows tremendous flexibility while maintaining BC
+* support for optional dependency groups and limited support for sub-packaging
+* robust dependency support
+* full dependency validation on uninstall
+* remote install for hosts with only ftp access - no more problems with
+ restricted host installation
+* full support for mirroring
+* support for bundling several packages into a single tarball
+* support for static dependencies on a url-based package
+* support for custom file roles and installation tasks
+NOTE: users of PEAR_Frontend_Web/PEAR_Frontend_Gtk must upgrade their installations
+to the latest version, or PEAR will not upgrade properly
+ </notes>
+ </release>
+ <release>
+ <version>1.4.1</version>
+ <date>2005-09-25</date>
+ <license>PHP License</license>
+ <state>stable</state>
+ <notes>Major bugfix release. This is a recommended download for ALL PEAR users
+
+UPGRADING FROM 1.4.0 WILL CAUSE A SERIES OF NOTICES. IGNORE THEM.
+THIS IS CAUSED BY A BUG IN 1.4.0 THAT IS FIXED IN 1.4.1
+* fix prompt processing in post-install scripts
+* make dual package.xml equivalency stricter when using package.xml/package2.xml
+* fix critical error in validating bogus php dependencies of package.xml 1.0
+ This error has existed for every PEAR version, and allows dependencies like:
+ &lt;dep type=&quot;php&quot; rel=&quot;has&quot;&gt;4.3.0&lt;/dep&gt; to
+ slip through unnoticed
+* re-enable php-const replacements
+* PEAR_PackageFile_v2::getConfigureOptions() was missing!!
+* fix cvsdiff command
+* fix xml encoding issues finally
+* clean up package.xml 1.0 dir/file parsing
+* fix invalid PEAR_Config generation
+* change the user agent from PHP/phpversion to PEAR/pearversion/PHP/phpversion
+* don&apos;t use a bogus uri for licenses on running convert command
+* add &quot;pickle&quot; command for PECL packaging
+* add validation warning if the release date in package.xml is not today when packaging
+* implement progress bar for list-all/remote-list
+* fix Bug #5323: pear search returns odd version numbers
+* fix Bug #5428: pear cvstag package2.xml does not include the package.xml
+* fix Bug #5449: pear makerpm completely broken for package.xml 2.0
+* fix Bug #5462: raiseError method does not return by ref anymore
+* fix Bug #5465: pear install --offline fails to display error
+* fix Bug #5477: Bug in Downloader.php and Dependency2.php
+* fix Bug #5481: &quot;pear install PECLextension&quot; should display warning to use pecl command
+* fix Bug #5482: installation of PECL packages should say add extensions to php.ini
+* fix Bug #5483: pecl uninstall crack fatal error
+* fix Bug #5487: PECL: compiled files are not uninstalled via the uninstall command
+* fix Bug #5488: pecl uninstall package fails if package has a package.xml 1.0
+* fix Bug #5501: the commands list mentions XML-RPC
+* fix Bug #5509: addDependecyGroup does not validate group name
+* fix Bug #5513: PEAR 1.4 does not install non-pear.php.net packages
+ </notes>
+ </release>
+ <release>
+ <version>1.4.2</version>
+ <date>2005-10-08</date>
+ <license>PHP License</license>
+ <state>stable</state>
+ <notes>Minor bugfix release
+* fix issues with API for adding tasks to package2.xml
+* fix Bug #5520: pecl pickle fails on pecl pickle fails on extension/package deps
+* fix Bug #5523: pecl pickle misses to put configureoptions into package.xml v1
+* fix Bug #5527: No need for cpp
+* fix Bug #5529: configure options in package.xml 2.0 will be ignored
+* fix Bug #5530: PEAR_PackageFile_v2-&gt;getConfigureOptions() API incompatible with v1
+* fix Bug #5531: adding of installconditions/binarypackage/configure options
+ to extsrc may fail
+* fix Bug #5550: PHP notices/warnings/errors are 1 file off in trace
+* fix Bug #5580: pear makerpm XML_sql2xml-0.3.2.tgz error
+* fix Bug #5619: pear makerpm produces invalid .spec dependancy code
+* fix Bug #5629: pear install http_download dies with bad error message
+ </notes>
+ </release>
+ <release>
+ <version>1.4.3</version>
+ <date>2005-11-03</date>
+ <license>PHP License</license>
+ <state>stable</state>
+ <notes>MINOR SECURITY FIX release
+A security vulnerability has been discovered in all
+PEAR versions (1.0 to 1.4.2). This vulnerability has been fixed,
+and this is a recommended upgrade for all users.
+Run &quot;pear channel-update&quot; after upgrading for exponentially
+faster list-all/remote-list!!
+* fix installation of files named like &quot;.test&quot;
+* fix base class for writeable unixeol/windowseol classes
+* fix running of post-install scripts with empty or no paramgroup
+ in CLI frontend
+* fix validation of &lt;postinstallscript&gt;
+* fix writeable PEAR_Task_Postinstallscript_rw class
+* fix error in REST-based search command if searching through description
+ as well
+* silence warning on list-upgrades/upgrade-all if no releases exist at a channel
+* add checks for updated channel.xml in all remote commands
+* fix pecl script if safe_mode is enabled by default
+* implement SERIOUS improvement in list-all/remote-list speed. From 6 minutes
+ down to about 16-30 seconds
+* implement --loose option to avoid recommended version validation
+* implement Request #5527: alternative approach to determining glibc version
+* fix Bug #5717: analyzeSourceCode() fails to process certain
+ quote situations properly
+* fix Bug #5736: if registry can&apos;t lock registry or open filemap,
+ checkFileMap(), no error
+* fix Bug #5676: pear config-create broken
+* fix Bug #5683: Deadlock with (almost) circular dependency
+* fix Bug #5725: PHP5 warnings need improvement
+* fix Bug #5789: small typo
+* fix Bug #5810: internet should not be contacted on install if dependencies are installed
+ </notes>
+ </release>
+ <release>
+ <version>1.4.4</version>
+ <date>2005-11-04</date>
+ <license>PHP License</license>
+ <state>stable</state>
+ <notes>* fix Bug #5865: doesn&apos;t work with PHP4.2.x
+ </notes>
+ </release>
+ <release>
+ <version>1.4.5</version>
+ <date>2005-11-21</date>
+ <license>PHP License</license>
+ <state>stable</state>
+ <notes>* REALLY fix Bug #5865: doesn&apos;t work with PHP4.2.x
+* fix Bug #5854: if no installconditions match, no error is raised
+* fix Bug #5945: installer should auto-skip to the next channel on timeout
+* fix Bug #5947: Some package-info not handled by PEAR_PackageFile_v2
+* fix Bug #5948: Minor typo in PEAR_Validate
+* fix Bug #5958: strange error on mistyping
+* fix Bug #5959: patch: pear makerpm produces RPMs that do not uninstall/upgrade cleanly
+ </notes>
+ </release>
+ <release>
+ <version>1.4.6</version>
+ <date>2006-01-06</date>
+ <license>PHP License</license>
+ <state>stable</state>
+ <notes>Minor bugfix release
+* fix problem with -options when using CGI version of PHP
+* fix Critical Bug #5999: support for baseinstalldir broken in package2.xml format
+* fix Bug #6034: date format bug
+* fix Bug #6040: PEAR_Frontend#setFrontendClass has no docblock;
+ PEAR_Frontend not documented
+* fix Bug #6044: PEAR_REST::retrieveCacheFirst doesn&apos;t return error codes
+* fix Bug #6047: pear makerpm fails to handle docs in root directory
+* fix Bug #6048: PEAR_Frontend::log parameters are wrong
+* fix Bug #6106: Notices by list-upgrades (caused by time-outs ?)
+* fix Bug #6145: Can&apos;t install PEAR with INSTALL_ROOT environment
+* fix Bug #6218: the &quot;pear&quot; command does nothing
+* fix Bug #6269: System::which() returns silliness if passed null
+* fix Bug #6322: Installer fails to follow redirects [patch by Bertrand Gugger]
+* fix Request #6119: Add PEAR_Frontend_Gtk2 support to PEAR
+ </notes>
+ </release>
+ <release>
+ <version>1.4.7</version>
+ <date>2006-02-27</date>
+ <license>PHP License</license>
+ <state>stable</state>
+ <notes>Minor bugfix release
+* Prevent packaging of release candidate releases with versions like 1.0.0rc1
+ version_compare() only understands upper-case 1.0.0RC1
+* implement CLEAN section in .phpt tests
+* implement run-tests command for phpunit-based tests
+* implement Request #6039: setFrontendObject needed to allow objects passed
+* fix Bug #6075: unnecessary validation of maintainers can break PEAR_PFM
+* fix Bug #6076: optional is not set for conversion of package2.xml to &quot;has&quot; rel
+* fix Bug #6077: PEAR_PackageFile_Parser_v2 should return by reference
+* fix Bug #6273: pear download-all fails
+* fix Bug #6383: incomplete PEAR::Error message on addReplacement()
+* fix Bug #6445: PEAR::registerShutdownFunc doesn&apos;t work in static calls
+* fix Bug #6480: pear install --installroot option fails for pecl packages [timj]
+* fix Bug #6510: status active of a maintainer cannot be change
+* fix Bug #6537: wrong export compatible v1 dependencies list with exclude limit
+* fix Bug #6559: pear should ignore safemode/open_basedir
+* fix Bug #6576: PFM2 run in trouble with sessions
+* fix Bug #6579: PFM2 changelog and license with uri
+* fix Bug #6673: pear install --offline --packagingroot=/blah does not work
+* fix Bug #6674: --packagingroot always uses channel pear.php.net configuration
+* fix Bug #6675: postinstallscript validation fails
+* fix Bug #6690: channel with / will not allow upgrade
+* fix Bug #6692: Optional feature install message needs channel name
+* fix Bug #6716: &quot;pear install -r&quot; errors after install when
+ attempting &quot;pear list &lt;pkgname&gt;&quot;
+* fix Bug #6735: PEAR_PackageFile::fromTgzFile doesn&apos;t work with package.xml
+ not in root dir
+ </notes>
+ </release>
+ <release>
+ <version>1.4.8</version>
+ <date>2006-03-05</date>
+ <license>PHP License</license>
+ <state>stable</state>
+ <notes>CRITICAL BUGFIX RELEASE
+
+Channels with &quot;-&quot; in their name were suddenly invalid, and
+caused crashes in many places due to improper error handling
+* fix Bug #6960: channels are not allowed to have &quot;-&quot; in their name
+* fix critical Bug #6969: PEAR list-upgrades crashes
+* fix Bug #6991: Class &apos;PEAR_PackageFile_v1&apos; not found in Registry.php at line 1657
+* fix Bug #7008: PEAR_Frontend::setFrontendObject doesn&apos;t set the object
+* fix Bug #7015: install a package.tgz with unknown channel, fatal error in PEAR/Registry.php
+* fix Bug #7020: tests/PEAR_Registry/api1_1/test_getChannelValidator.phpt crashes PEAR
+ </notes>
+ </release>
+ <release>
+ <version>1.4.9</version>
+ <date>2006-03-29</date>
+ <license>PHP License</license>
+ <state>stable</state>
+ <notes>CRITICAL BUGFIX RELEASE
+users upgrading from PEAR 1.3.x cannot upgrade to 1.4.8
+users who use --packagingroot may find that installation fails
+* fix Bug #7093: if pear channel does not exist, it cannot be retrieved
+* fix Bug #7165: warnings in pear
+* fix Bug #7075: PEAR_PackageFile_v2 :: setLogger failed on autodetection
+ </notes>
+ </release>
+ <release>
+ <version>1.4.10</version>
+ <date>2006-07-18</date>
+ <license>PHP License</license>
+ <state>beta</state>
+ <notes>bugfix release
+* fix Bug #7579: cannot convert package 1.0 to 2.0 with PFM 1.6.0
+* fix Bug #7640: Check invalid date format
+* fix Bug #7726: &lt;uri&gt; dependency is broken
+* fix Bug #7830: Warning in package-dependencies command when a dir is used
+* fix Bug #7842: package-dependencies wrong type display with package 1.0
+* fix Bug #8230: pear help channel-discover shows wrong text
+* fix many open_basedir issues
+* fix an issue in the better state detection
+* fix typo in pickle command that would allow pickling of non-PECL package.xml
+* implement Request #7090: PEAR_Downloader mustn&apos;t contact pear server
+ when installing local package file
+* implement Request #7844: download_dir and temp_dir configuration option
+* check pearinstaller dependency prior to validating package.xml 2.0
+ </notes>
+ </release>
+ </changelog>
+</package>
+
/**
* PEAR, the PHP Extension and Application Repository
*
@@ -53419,7 +54245,7 @@ class PEAR_ChannelFile_Parser extends PEAR_XMLParser
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Command.php,v 1.36 2006/01/06 04:47:36 cellog Exp $
+ * @version CVS: $Id: Command.php,v 1.36.2.1 2006/06/16 13:01:59 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -53634,6 +54460,11 @@ class PEAR_Command
if ($dir === null) {
$dir = dirname(__FILE__) . '/Command';
}
+
+ if (!@is_dir($dir)) {
+ return PEAR::raiseError("registerCommands: opendir($dir) '$dir' does not exist or is not a directory");
+ }
+
$dp = @opendir($dir);
if (empty($dp)) {
return PEAR::raiseError("registerCommands: opendir($dir) failed");
@@ -53826,7 +54657,7 @@ class PEAR_Command
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Common.php,v 1.32 2006/03/02 16:39:14 pajoye Exp $
+ * @version CVS: $Id: Common.php,v 1.32.2.1 2006/06/08 22:27:11 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -53884,7 +54715,7 @@ class PEAR_Command_Common extends PEAR
var $_deps_type_trans = array(
'pkg' => 'package',
- 'extension' => 'extension',
+ 'ext' => 'extension',
'php' => 'PHP',
'prog' => 'external program',
'ldlib' => 'external library for linking',
@@ -56259,7 +57090,7 @@ require_once 'phar://install-pear-nozlib.phar/PEAR/PackageFile.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Config.php,v 1.124 2006/03/02 18:14:12 cellog Exp $
+ * @version CVS: $Id: Config.php,v 1.124.2.3 2006/07/15 00:38:27 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -56381,6 +57212,15 @@ if (getenv('PHP_PEAR_TEST_DIR')) {
$PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'tests');
}
+// Default for temp_dir
+if (getenv('PHP_PEAR_TEMP_DIR')) {
+ define('PEAR_CONFIG_DEFAULT_TEMP_DIR', getenv('PHP_PEAR_TEMP_DIR'));
+} else {
+ define('PEAR_CONFIG_DEFAULT_TEMP_DIR',
+ System::tmpdir() . DIRECTORY_SEPARATOR . 'pear' .
+ DIRECTORY_SEPARATOR . 'temp');
+}
+
// Default for cache_dir
if (getenv('PHP_PEAR_CACHE_DIR')) {
define('PEAR_CONFIG_DEFAULT_CACHE_DIR', getenv('PHP_PEAR_CACHE_DIR'));
@@ -56390,6 +57230,15 @@ if (getenv('PHP_PEAR_CACHE_DIR')) {
DIRECTORY_SEPARATOR . 'cache');
}
+// Default for download_dir
+if (getenv('PHP_PEAR_DOWNLOAD_DIR')) {
+ define('PEAR_CONFIG_DEFAULT_DOWNLOAD_DIR', getenv('PHP_PEAR_DOWNLOAD_DIR'));
+} else {
+ define('PEAR_CONFIG_DEFAULT_DOWNLOAD_DIR',
+ System::tmpdir() . DIRECTORY_SEPARATOR . 'pear' .
+ DIRECTORY_SEPARATOR . 'download');
+}
+
// Default for php_bin
if (getenv('PHP_PEAR_PHP_BIN')) {
define('PEAR_CONFIG_DEFAULT_PHP_BIN', getenv('PHP_PEAR_PHP_BIN'));
@@ -56655,6 +57504,20 @@ class PEAR_Config extends PEAR
'prompt' => 'PEAR Installer cache directory',
'group' => 'File Locations (Advanced)',
),
+ 'temp_dir' => array(
+ 'type' => 'directory',
+ 'default' => PEAR_CONFIG_DEFAULT_TEMP_DIR,
+ 'doc' => 'directory which is used for all temp files',
+ 'prompt' => 'PEAR Installer temp directory',
+ 'group' => 'File Locations (Advanced)',
+ ),
+ 'download_dir' => array(
+ 'type' => 'directory',
+ 'default' => PEAR_CONFIG_DEFAULT_CACHE_DIR,
+ 'doc' => 'directory which is used for all downloaded files',
+ 'prompt' => 'PEAR Installer download directory',
+ 'group' => 'File Locations (Advanced)',
+ ),
'php_bin' => array(
'type' => 'file',
'default' => PEAR_CONFIG_DEFAULT_PHP_BIN,
@@ -58346,7 +59209,7 @@ require_once 'phar://install-pear-nozlib.phar/PEAR/Validate.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -58834,7 +59697,7 @@ class PEAR_Dependency2
*/
function getPEARVersion()
{
- return '1.4.9';
+ return '1.4.11';
}
function validatePearinstallerDependency($dep)
@@ -59526,7 +60389,7 @@ class PEAR_Dependency2
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: DependencyDB.php,v 1.30 2006/01/06 04:47:36 cellog Exp $
+ * @version CVS: $Id: DependencyDB.php,v 1.30.2.1 2006/05/25 22:00:05 cellog Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -59800,16 +60663,36 @@ class PEAR_DependencyDB
return false;
}
foreach ($this->_cache['dependencies'][$channel][$package] as $info) {
+ if (isset($info['dep']['uri'])) {
+ if (is_object($child)) {
+ if ($info['dep']['uri'] == $child->getURI()) {
+ return true;
+ }
+ } elseif (isset($child['uri'])) {
+ if ($info['dep']['uri'] == $child['uri']) {
+ return true;
+ }
+ }
+ return false;
+ }
if (strtolower($info['dep']['channel']) == strtolower($depchannel) &&
strtolower($info['dep']['name']) == strtolower($deppackage)) {
return true;
}
}
foreach ($this->_cache['dependencies'][$channel][$package] as $info) {
- if ($this->_dependsOn(array(
- 'channel' => $info['dep']['channel'],
- 'package' => $info['dep']['name']), $child, $checked)) {
- return true;
+ if (isset($info['dep']['uri'])) {
+ if ($this->_dependsOn(array(
+ 'uri' => $info['dep']['uri'],
+ 'package' => $info['dep']['name']), $child, $checked)) {
+ return true;
+ }
+ } else {
+ if ($this->_dependsOn(array(
+ 'channel' => $info['dep']['channel'],
+ 'package' => $info['dep']['name']), $child, $checked)) {
+ return true;
+ }
}
}
return false;
@@ -60182,7 +61065,7 @@ class PEAR_DependencyDB
* @author Martin Jansen <mj@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Downloader.php,v 1.99 2006/03/02 18:14:13 cellog Exp $
+ * @version CVS: $Id: Downloader.php,v 1.99.2.2 2006/06/16 12:35:12 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.3.0
*/
@@ -60296,7 +61179,7 @@ class PEAR_Downloader extends PEAR_Common
* @access private
*/
var $_errorStack = array();
-
+
/**
* @var boolean
* @access private
@@ -60457,29 +61340,37 @@ class PEAR_Downloader extends PEAR_Common
$this->pushError('Package "' . $param . '" is not valid',
PEAR_INSTALLER_SKIPPED);
} else {
- if ($params[$i] && !isset($channelschecked[$params[$i]->getChannel()]) &&
- !isset($this->_options['offline'])) {
- $channelschecked[$params[$i]->getChannel()] = true;
- PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
- if (!class_exists('System')) {
- require_once 'phar://install-pear-nozlib.phar/System.php';
- }
- $curchannel = &$this->_registry->getChannel($params[$i]->getChannel());
- if (PEAR::isError($curchannel)) {
- PEAR::staticPopErrorHandling();
- return $this->raiseError($curchannel);
+ do {
+ if ($params[$i] && $params[$i]->getType() == 'local') {
+ // bug #7090
+ // skip channel.xml check for local packages
+ break;
}
- $a = $this->downloadHttp('http://' . $params[$i]->getChannel() .
- '/channel.xml', $this->ui,
- System::mktemp(array('-d')), null, $curchannel->lastModified());
- PEAR::staticPopErrorHandling();
- if (PEAR::isError($a) || !$a) {
- continue;
+ if ($params[$i] && !isset($channelschecked[$params[$i]->getChannel()]) &&
+ !isset($this->_options['offline'])) {
+ $channelschecked[$params[$i]->getChannel()] = true;
+ PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
+ if (!class_exists('System')) {
+ require_once 'phar://install-pear-nozlib.phar/System.php';
+ }
+ $curchannel = &$this->_registry->getChannel($params[$i]->getChannel());
+ if (PEAR::isError($curchannel)) {
+ PEAR::staticPopErrorHandling();
+ return $this->raiseError($curchannel);
+ }
+ $a = $this->downloadHttp('http://' . $params[$i]->getChannel() .
+ '/channel.xml', $this->ui,
+ System::mktemp(array('-t' . $this->getDownloadDir())), null, $curchannel->lastModified());
+
+ PEAR::staticPopErrorHandling();
+ if (PEAR::isError($a) || !$a) {
+ break;
+ }
+ $this->log(0, 'WARNING: channel "' . $params[$i]->getChannel() . '" has ' .
+ 'updated its protocols, use "channel-update ' . $params[$i]->getChannel() .
+ '" to update');
}
- $this->log(0, 'WARNING: channel "' . $params[$i]->getChannel() . '" has ' .
- 'updated its protocols, use "channel-update ' . $params[$i]->getChannel() .
- '" to update');
- }
+ } while (false);
if ($params[$i] && !isset($this->_options['downloadonly'])) {
if (isset($this->_options['packagingroot'])) {
$checkdir = $this->_prependPath(
@@ -61007,33 +61898,62 @@ class PEAR_Downloader extends PEAR_Common
{
$xsdversion = isset($dep['rel']) ? '1.0' : '2.0';
$curchannel = $this->config->get('default_channel');
- if (isset($dep['channel'])) {
- $remotechannel = $dep['channel'];
+ if (isset($dep['uri'])) {
+ $xsdversion = '2.0';
+ $chan = &$this->_registry->getChannel('__uri');
+ if (PEAR::isError($chan)) {
+ return $chan;
+ }
+ $version = $this->_registry->packageInfo($dep['name'], 'version', '__uri');
+ $this->configSet('default_channel', '__uri');
} else {
- $remotechannel = 'pear.php.net';
- }
- if (!$this->_registry->channelExists($remotechannel)) {
- do {
- if ($this->config->get('auto_discover')) {
- if ($this->discover($remotechannel)) {
- break;
+ if (isset($dep['channel'])) {
+ $remotechannel = $dep['channel'];
+ } else {
+ $remotechannel = 'pear.php.net';
+ }
+ if (!$this->_registry->channelExists($remotechannel)) {
+ do {
+ if ($this->config->get('auto_discover')) {
+ if ($this->discover($remotechannel)) {
+ break;
+ }
}
- }
- return PEAR::raiseError('Unknown remote channel: ' . $remotechannel);
- } while (false);
+ return PEAR::raiseError('Unknown remote channel: ' . $remotechannel);
+ } while (false);
+ }
+ $chan = &$this->_registry->getChannel($remotechannel);
+ if (PEAR::isError($chan)) {
+ return $chan;
+ }
+ $version = $this->_registry->packageInfo($dep['name'], 'version',
+ $remotechannel);
+ $this->configSet('default_channel', $remotechannel);
}
- $this->configSet('default_channel', $remotechannel);
$state = isset($parr['state']) ? $parr['state'] : $this->config->get('preferred_state');
if (isset($parr['state']) && isset($parr['version'])) {
unset($parr['state']);
}
- $chan = &$this->_registry->getChannel($remotechannel);
- if (PEAR::isError($chan)) {
- return $chan;
- }
- $version = $this->_registry->packageInfo($dep['name'], 'version',
- $remotechannel);
- if ($chan->supportsREST($this->config->get('preferred_mirror')) &&
+ if (isset($dep['uri'])) {
+ $info = &$this->newDownloaderPackage($this);
+ PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
+ $err = $info->initialize($dep);
+ PEAR::staticPopErrorHandling();
+ if (!$err) {
+ // skip parameters that were missed by preferred_state
+ return PEAR::raiseError('Cannot initialize dependency');
+ }
+ if (PEAR::isError($err)) {
+ if (!isset($this->_options['soft'])) {
+ $this->log(0, $err->getMessage());
+ }
+ if (is_object($info)) {
+ $param = $info->getChannel() . '/' . $info->getPackage();
+ }
+ return PEAR::raiseError('Package "' . $param . '" is not valid');
+ }
+ return $info;
+ } elseif ($chan->supportsREST($this->config->get('preferred_mirror')) &&
$base = $chan->getBaseURL('REST1.0', $this->config->get('preferred_mirror'))) {
$rest = &$this->config->getREST('1.0', $this->_options);
$url = $rest->getDepDownloadURL($base, $xsdversion, $dep, $parr,
@@ -61090,7 +62010,7 @@ class PEAR_Downloader extends PEAR_Common
} else {
$url = $this->_remote->call('package.getDepDownloadURL', $xsdversion, $dep, $parr, $state);
}
- if ($parr['channel'] != $curchannel) {
+ if ($this->config->get('default_channel') != $curchannel) {
$this->configSet('default_channel', $curchannel);
}
if (!is_array($url)) {
@@ -61248,7 +62168,7 @@ class PEAR_Downloader extends PEAR_Common
*/
function sortPkgDeps(&$packages, $uninstall = false)
{
- $uninstall ?
+ $uninstall ?
$this->sortPackagesForUninstall($packages) :
$this->sortPackagesForInstall($packages);
}
@@ -61491,7 +62411,7 @@ class PEAR_Downloader extends PEAR_Common
$config = &PEAR_Config::singleton();
}
$proxy_host = $proxy_port = $proxy_user = $proxy_pass = '';
- if ($config->get('http_proxy')&&
+ if ($config->get('http_proxy')&&
$proxy = parse_url($config->get('http_proxy'))) {
$proxy_host = @$proxy['host'];
if (isset($proxy['scheme']) && $proxy['scheme'] == 'https') {
@@ -61689,7 +62609,7 @@ class PEAR_Downloader extends PEAR_Common
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Package.php,v 1.91 2006/01/23 19:05:52 cellog Exp $
+ * @version CVS: $Id: Package.php,v 1.91.2.1 2006/05/25 22:00:05 cellog Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -61723,7 +62643,7 @@ define('PEAR_DOWNLOADER_PACKAGE_STATE', -1003);
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -62684,8 +63604,10 @@ class PEAR_Downloader_Package
}
} else {
if (isset($param['uri'])) {
- $param['channel'] = '__uri';
- $param['package'] = $param['dep']['name'];
+ if ($this->getChannel() != '__uri') {
+ return false;
+ }
+ return $param['uri'] == $this->getURI();
}
$package = isset($param['package']) ? $param['package'] :
$param['info']->getPackage();
@@ -67550,7 +68472,7 @@ class PEAR_Installer_Role_Test extends PEAR_Installer_Role_Common {}
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: PackageFile.php,v 1.33 2006/02/09 22:39:32 cellog Exp $
+ * @version CVS: $Id: PackageFile.php,v 1.33.2.1 2006/06/08 00:04:13 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -67576,7 +68498,7 @@ define('PEAR_PACKAGEFILE_ERROR_INVALID_PACKAGEVERSION', 2);
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -67939,6 +68861,11 @@ class PEAR_PackageFile
*/
function &fromAnyFile($info, $state)
{
+ if (is_dir($info)) {
+ $info = PEAR::raiseError("'$info' is a directory, a file is expected");
+ return $info;
+ }
+
$fp = false;
if (is_string($info) && strlen($info) < 255 &&
(file_exists($info) || ($fp = @fopen($info, 'r')))) {
@@ -67968,7 +68895,8 @@ class PEAR_PackageFile
}
}
-?><?php
+?>
+<?php
/**
* package.xml generation class, package.xml version 1.0
*
@@ -67985,7 +68913,7 @@ class PEAR_PackageFile
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: v1.php,v 1.70 2006/01/06 04:47:37 cellog Exp $
+ * @version CVS: $Id: v1.php,v 1.70.2.1 2006/05/10 02:55:06 cellog Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -68005,7 +68933,7 @@ require_once 'phar://install-pear-nozlib.phar/PEAR/PackageFile/v2.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -68022,7 +68950,7 @@ class PEAR_PackageFile_Generator_v1
function getPackagerVersion()
{
- return '1.4.9';
+ return '1.4.11';
}
/**
@@ -68176,7 +69104,7 @@ class PEAR_PackageFile_Generator_v1
);
$ret = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
$ret .= "<!DOCTYPE package SYSTEM \"http://pear.php.net/dtd/package-1.0\">\n";
- $ret .= "<package version=\"1.0\" packagerversion=\"1.4.9\">\n" .
+ $ret .= "<package version=\"1.0\" packagerversion=\"1.4.11\">\n" .
" <name>$pkginfo[package]</name>";
if (isset($pkginfo['extends'])) {
$ret .= "\n<extends>$pkginfo[extends]</extends>";
@@ -68650,7 +69578,9 @@ class PEAR_PackageFile_Generator_v1
}
$ret = new $class;
$ret->setConfig($this->_packagefile->_config);
- $ret->setLogger($this->_packagefile->_logger);
+ if (isset($this->_packagefile->_logger) && is_object($this->_packagefile->_logger)) {
+ $ret->setLogger($this->_packagefile->_logger);
+ }
$ret->fromArray($arr);
return $ret;
}
@@ -69271,7 +70201,7 @@ require_once 'phar://install-pear-nozlib.phar/System.php';
* @author Stephan Schmidt (original XML_Serializer code)
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
@@ -69350,7 +70280,7 @@ http://pear.php.net/dtd/package-2.0.xsd',
*/
function getPackagerVersion()
{
- return '1.4.9';
+ return '1.4.11';
}
/**
@@ -69594,7 +70524,7 @@ http://pear.php.net/dtd/package-2.0.xsd',
}
$this->options['beautifyFilelist'] = true;
}
- $arr['attribs']['packagerversion'] = '1.4.9';
+ $arr['attribs']['packagerversion'] = '1.4.11';
if ($this->serialize($arr, $options)) {
return $this->_serializedData . "\n";
}
@@ -74979,7 +75909,7 @@ require_once 'phar://install-pear-nozlib.phar/PEAR/PackageFile/v2.php';
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: 1.4.9
+ * @version Release: 1.4.11
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a8
*/
@@ -76523,7 +77453,7 @@ class PEAR_PackageFile_v2_rw extends PEAR_PackageFile_v2
// | |
// +----------------------------------------------------------------------+
//
-// $Id: Validator.php,v 1.86 2006/03/02 18:14:13 cellog Exp $
+// $Id: Validator.php,v 1.86.2.1 2006/05/10 02:55:06 cellog Exp $
/**
* Private validation class used by PEAR_PackageFile_v2 - do not use directly, its
* sole purpose is to split up the PEAR/PackageFile/v2.php file to make it smaller
@@ -76609,6 +77539,15 @@ class PEAR_PackageFile_v2_Validator
'*changelog',
);
$test = $this->_packageInfo;
+ if (isset($test['dependencies']) &&
+ isset($test['dependencies']['required']) &&
+ isset($test['dependencies']['required']['pearinstaller']) &&
+ isset($test['dependencies']['required']['pearinstaller']['min']) &&
+ version_compare('1.4.11',
+ $test['dependencies']['required']['pearinstaller']['min'], '<')) {
+ $this->_pearVersionTooLow($test['dependencies']['required']['pearinstaller']['min']);
+ return false;
+ }
// ignore post-installation array fields
if (array_key_exists('filelist', $test)) {
unset($test['filelist']);
@@ -77776,6 +78715,14 @@ class PEAR_PackageFile_v2_Validator
return in_array($role, PEAR_Installer_Role::getValidRoles($this->_pf->getPackageType()));
}
+ function _pearVersionTooLow($version)
+ {
+ $this->_stack->push(__FUNCTION__, 'error',
+ array('version' => $version),
+ 'This package.xml requires PEAR version %version% to parse properly, we are ' .
+ 'version 1.4.11');
+ }
+
function _invalidTagOrder($oktags, $actual, $root)
{
$this->_stack->push(__FUNCTION__, 'error',
@@ -83445,7 +84392,7 @@ class PEAR_Task_Windowseol_rw extends PEAR_Task_Windowseol
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Validate.php,v 1.46 2006/01/23 17:16:35 cellog Exp $
+ * @version CVS: $Id: Validate.php,v 1.46.2.3 2006/07/17 17:49:37 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -83875,17 +84822,16 @@ class PEAR_Validate
{
if ($this->_state == PEAR_VALIDATE_NORMAL ||
$this->_state == PEAR_VALIDATE_PACKAGING) {
- if (!preg_match('/\d\d\d\d\-\d\d\-\d\d/',
- $this->_packagexml->getDate())) {
- $this->_addFailure('date', 'invalid release date "' .
- $this->_packagexml->getDate() . '"');
- return false;
- }
- if (strtotime($this->_packagexml->getDate()) == -1) {
+ if (!preg_match('/(\d\d\d\d)\-(\d\d)\-(\d\d)/',
+ $this->_packagexml->getDate(), $res) ||
+ count($res) < 4
+ || !checkdate($res[2], $res[3], $res[1])
+ ) {
$this->_addFailure('date', 'invalid release date "' .
$this->_packagexml->getDate() . '"');
return false;
}
+
if ($this->_state == PEAR_VALIDATE_PACKAGING &&
$this->_packagexml->getDate() != date('Y-m-d')) {
$this->_addWarning('date', 'Release Date "' .
@@ -84058,7 +85004,8 @@ class PEAR_Validate
return true;
}
}
-?><?php
+?>
+<?php
/**
* Channel Validator for the pecl.php.net channel
*
@@ -84396,7 +85343,7 @@ class PEAR_XMLParser
* @author Tomas V.V.Cox <cox@idecnet.com>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: System.php,v 1.53 2006/01/06 04:47:36 cellog Exp $
+ * @version CVS: $Id: System.php,v 1.53.2.1 2006/06/16 13:55:16 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -84872,7 +85819,7 @@ class System
foreach ($exe_suffixes as $suff) {
foreach ($path_elements as $dir) {
$file = $dir . DIRECTORY_SEPARATOR . $program . $suff;
- if ($pear_is_executable($file)) {
+ if (@$pear_is_executable($file)) {
return $file;
}
}
diff --git a/php.ini-dist b/php.ini-dist
index c98cb65b2..4fee3fee8 100644
--- a/php.ini-dist
+++ b/php.ini-dist
@@ -124,6 +124,7 @@ output_buffering = Off
; 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
+;zlib.output_compression_level = -1
; You cannot specify additional output handlers if zlib.output_compression
; is activated here. This setting does the same as output_handler but in
@@ -253,7 +254,7 @@ expose_php = On
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)
+memory_limit = 16M ; Maximum amount of memory a script may consume (16MB)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -264,6 +265,7 @@ memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
; 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
@@ -271,7 +273,7 @@ memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
; 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
+; 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
@@ -295,7 +297,7 @@ memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
;
; - Show only errors
;
-;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
+;error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
;
; - Show all errors except for notices and coding standards warnings
;
@@ -328,7 +330,7 @@ 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.
+; source lines.
ignore_repeated_source = Off
; If this parameter is set to Off, then memory leaks will not be shown (on
@@ -336,6 +338,8 @@ ignore_repeated_source = Off
; error reporting includes E_WARNING in the allowed list
report_memleaks = On
+;report_zend_debug = 0
+
; Store the last error/warning message in $php_errormsg (boolean).
track_errors = Off
@@ -531,6 +535,9 @@ upload_max_filesize = 2M
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On
+; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
+allow_url_include = Off
+
; Define the anonymous ftp password (your email address)
;from="john@doe.com"
@@ -617,7 +624,33 @@ default_socket_timeout = 60
[Date]
; Defines the default timezone used by the date functions
-;date.timezone =
+;date.timezone =
+
+;date.default_latitude = 31.7667
+;date.default_longitude = 35.2333
+
+;date.sunrise_zenith = 90.583333
+;date.sunset_zenith = 90.583333
+
+[filter]
+;filter.default = unsafe_raw
+;filter.default_flags =
+
+[iconv]
+;iconv.input_encoding = ISO-8859-1
+;iconv.internal_encoding = ISO-8859-1
+;iconv.output_encoding = ISO-8859-1
+
+[sqlite]
+;sqlite.assoc_case = 0
+
+[xmlrpc]
+;xmlrpc_error_number = 0
+;xmlrpc_errors = 0
+
+[Pcre]
+;pcre.recursion_limit=100000
+;pcre.backtrack_limit=100000
[Syslog]
; Whether or not to define the various syslog variables (e.g. $LOG_PID,
@@ -703,7 +736,7 @@ mysql.default_user =
; file will be able to reveal the password as well.
mysql.default_password =
-; Maximum time (in secondes) for connect timeout. -1 means no limit
+; Maximum time (in seconds) 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
@@ -791,7 +824,7 @@ sybase.min_error_severity = 10
; Minimum message severity to display.
sybase.min_message_severity = 10
-; Compatability mode with old versions of PHP 3.0.
+; Compatibility 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
@@ -893,6 +926,8 @@ session.save_handler = files
; Whether to use cookies.
session.use_cookies = 1
+;session.cookie_secure =
+
; 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
@@ -912,6 +947,9 @@ session.cookie_path = /
; The domain for which the cookie is valid.
session.cookie_domain =
+; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript.
+session.cookie_httponly =
+
; Handler used to serialize data. php is the standard serializer of PHP.
session.serialize_handler = php
@@ -1014,7 +1052,7 @@ mssql.min_error_severity = 10
; Minimum message severity to display.
mssql.min_message_severity = 10
-; Compatability mode with old versions of PHP 3.0.
+; Compatibility mode with old versions of PHP 3.0.
mssql.compatability_mode = Off
; Connect timeout
@@ -1067,28 +1105,6 @@ mssql.secure_connection = Off
; 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 =
@@ -1098,7 +1114,7 @@ pfpro.defaulttimeout = 30
;com.autoregister_typelib = true
; register constants casesensitive
;com.autoregister_casesensitive = false
-; show warnings on duplicate constat registrations
+; show warnings on duplicate constant registrations
;com.autoregister_verbose = true
[mbstring]
@@ -1142,9 +1158,6 @@ pfpro.defaulttimeout = 30
; 4: Overload ereg*() functions
;mbstring.func_overload = 0
-; enable strict encoding detection.
-;mbstring.strict_encoding = Off
-
[FrontBase]
;fbsql.allow_persistent = On
;fbsql.autocommit = On
@@ -1159,14 +1172,13 @@ pfpro.defaulttimeout = 30
;fbsql.max_links = 128
;fbsql.max_persistent = -1
;fbsql.max_results = 128
-;fbsql.batchSize = 1000
[gd]
; Tell the jpeg decode to libjpeg warnings and try to create
; a gd image. The warning will then be displayed as notices
; disabled by default
;gd.jpeg_ignore_warning = 0
-
+
[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
diff --git a/php.ini-recommended b/php.ini-recommended
index 54a31b1b6..b2a640af9 100644
--- a/php.ini-recommended
+++ b/php.ini-recommended
@@ -67,18 +67,6 @@
; 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
@@ -112,7 +100,7 @@
; 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
+; By default, PHP suppresses 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.
@@ -121,7 +109,6 @@
; when calling a function. The PHP 4 style to do this is by making the
; function require the relevant argument by reference.
-
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
@@ -182,6 +169,7 @@ output_buffering = 4096
; 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
+;zlib.output_compression_level = -1
; You cannot specify additional output handlers if zlib.output_compression
; is activated here. This setting does the same as output_handler but in
@@ -311,7 +299,7 @@ expose_php = On
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)
+memory_limit = 16M ; Maximum amount of memory a script may consume (16MB)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -322,6 +310,7 @@ memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
; 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
@@ -353,7 +342,7 @@ memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
;
; - Show only errors
;
-;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
+;error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
;
; - Show all errors, except coding standards warnings
;
@@ -386,7 +375,7 @@ 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.
+; source lines.
ignore_repeated_source = Off
; If this parameter is set to Off, then memory leaks will not be shown (on
@@ -394,6 +383,8 @@ ignore_repeated_source = Off
; error reporting includes E_WARNING in the allowed list
report_memleaks = On
+;report_zend_debug = 0
+
; Store the last error/warning message in $php_errormsg (boolean).
track_errors = Off
@@ -589,6 +580,9 @@ upload_max_filesize = 2M
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On
+; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
+allow_url_include = Off
+
; Define the anonymous ftp password (your email address)
;from="john@doe.com"
@@ -677,6 +671,32 @@ default_socket_timeout = 60
; Defines the default timezone used by the date functions
;date.timezone =
+;date.default_latitude = 31.7667
+;date.default_longitude = 35.2333
+
+;date.sunrise_zenith = 90.583333
+;date.sunset_zenith = 90.583333
+
+[filter]
+;filter.default = unsafe_raw
+;filter.default_flags =
+
+[iconv]
+;iconv.input_encoding = ISO-8859-1
+;iconv.internal_encoding = ISO-8859-1
+;iconv.output_encoding = ISO-8859-1
+
+[sqlite]
+;sqlite.assoc_case = 0
+
+[xmlrpc]
+;xmlrpc_error_number = 0
+;xmlrpc_errors = 0
+
+[Pcre]
+;pcre.recursion_limit=100000
+;pcre.backtrack_limit=100000
+
[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
@@ -761,7 +781,7 @@ mysql.default_user =
; file will be able to reveal the password as well.
mysql.default_password =
-; Maximum time (in secondes) for connect timeout. -1 means no limit
+; Maximum time (in seconds) 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
@@ -849,10 +869,10 @@ sybase.min_error_severity = 10
; Minimum message severity to display.
sybase.min_message_severity = 10
-; Compatability mode with old versions of PHP 3.0.
+; Compatibility 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
+; 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
@@ -951,6 +971,8 @@ session.save_handler = files
; Whether to use cookies.
session.use_cookies = 1
+;session.cookie_secure =
+
; 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
@@ -970,6 +992,9 @@ session.cookie_path = /
; The domain for which the cookie is valid.
session.cookie_domain =
+; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript.
+session.cookie_httponly =
+
; Handler used to serialize data. php is the standard serializer of PHP.
session.serialize_handler = php
@@ -1072,7 +1097,7 @@ mssql.min_error_severity = 10
; Minimum message severity to display.
mssql.min_message_severity = 10
-; Compatability mode with old versions of PHP 3.0.
+; Compatibility mode with old versions of PHP 3.0.
mssql.compatability_mode = Off
; Connect timeout
@@ -1125,28 +1150,6 @@ mssql.secure_connection = Off
; 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 =
@@ -1156,7 +1159,7 @@ pfpro.defaulttimeout = 30
;com.autoregister_typelib = true
; register constants casesensitive
;com.autoregister_casesensitive = false
-; show warnings on duplicate constat registrations
+; show warnings on duplicate constant registrations
;com.autoregister_verbose = true
[mbstring]
@@ -1217,7 +1220,6 @@ pfpro.defaulttimeout = 30
;fbsql.max_links = 128
;fbsql.max_persistent = -1
;fbsql.max_results = 128
-;fbsql.batchSize = 1000
[gd]
; Tell the jpeg decode to libjpeg warnings and try to create
diff --git a/regex/regcomp.c b/regex/regcomp.c
index ec034d4c4..d72cc8294 100644
--- a/regex/regcomp.c
+++ b/regex/regcomp.c
@@ -1553,6 +1553,11 @@ register struct re_guts *g;
if (g->mlen == 0) /* there isn't one */
return;
+ if (!start) {
+ g->mlen = 0;
+ return;
+ }
+
/* turn it into a character string */
g->must = malloc((size_t)g->mlen + 1);
if (g->must == NULL) { /* argh; just forget it */
diff --git a/run-tests.php b/run-tests.php
index ca298f3e3..69df191f4 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -23,7 +23,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: run-tests.php,v 1.226.2.38 2006/08/23 12:43:53 tony2001 Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.15 2006/09/14 16:58:52 nlopess Exp $ */
/* 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
@@ -158,7 +158,7 @@ $ini_overwrites = array(
'safe_mode=0',
'disable_functions=',
'output_buffering=Off',
- 'error_reporting=4095',
+ 'error_reporting=8191',
'display_errors=1',
'log_errors=0',
'html_errors=0',
@@ -239,7 +239,7 @@ $pass_option_n = false;
$pass_options = '';
$compression = 0;
-$output_file = $CUR_DIR . '/php_test_results_' . date('Ymd_Hi') . '.txt';
+$output_file = $CUR_DIR . '/php_test_results_' . @date('Ymd_Hi') . '.txt';
if ($compression) {
$output_file = 'compress.zlib://' . $output_file . '.gz';
}
@@ -397,7 +397,7 @@ if (isset($argc) && $argc > 1) {
$html_output = is_resource($html_file);
break;
case '--version':
- echo '$Revision: 1.226.2.38 $'."\n";
+ echo '$Revision: 1.226.2.37.2.15 $'."\n";
exit(1);
default:
echo "Illegal switch '$switch' specified!\n";
@@ -710,7 +710,9 @@ if ($just_save_results || !getenv('NO_INTERACTION')) {
/* 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');
+ if ($sys_libtool_path) {
+ $sys_libtool = shell_exec(str_replace("\n", "", $sys_libtool_path) . ' --version');
+ }
/* Try the most common flags for 'version' */
$flags = array('-v', '-V', '--version');
@@ -768,7 +770,7 @@ 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 = "php_test_data=" . urlencode(base64_encode(str_replace("\00", '[0x0]', $data)));
$data_length = strlen($data);
$fs = fsockopen($url_bits['host'], $url_bits['port'], $errno, $errstr, 10);
@@ -835,7 +837,7 @@ function error_report($testname, $logname, $tested)
}
}
-function system_with_timeout($commandline, $env = null)
+function system_with_timeout($commandline, $env = null, $stdin = null)
{
global $leak_check;
@@ -850,6 +852,9 @@ function system_with_timeout($commandline, $env = null)
if (!$proc)
return false;
+ if (is_string($stdin)) {
+ fwrite($pipes[0], $stdin);
+ }
fclose($pipes[0]);
while (true) {
@@ -972,7 +977,7 @@ TEST $file
$line = fgets($fp);
// Match the beginning of a section.
- if (preg_match('/^--([A-Z_]+)--/', $line, $r)) {
+ if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
$section = $r[1];
$section_text[$section] = '';
$secfile = $section == 'FILE' || $section == 'FILEEOF';
@@ -1236,6 +1241,17 @@ TEST $file
// a redirected test never fails
$IN_REDIRECT = false;
return 'REDIR';
+ } else {
+ $bork_info = "Redirect info must contain exactly one TEST string to be used as redirect directory.";
+ show_result("BORK", $bork_info, '', $temp_filenames);
+ $PHP_FAILED_TESTS['BORKED'][] = array (
+ 'name' => $file,
+ 'test_name' => '',
+ 'output' => '',
+ 'diff' => '',
+ 'info' => "$bork_info [$file]",
+ 'unicode'=> $unicode_semantics,
+ );
}
}
if (is_array($org_file) || @count($section_text['REDIRECTTEST']) == 1) {
@@ -1299,13 +1315,14 @@ TEST $file
$post = trim($section_text['POST']);
save_text($tmp_post, $post);
-
$content_length = strlen($post);
+
$env['REQUEST_METHOD'] = 'POST';
$env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded';
$env['CONTENT_LENGTH'] = $content_length;
$cmd = "$php$pass_options$ini_settings -f \"$test_file\" 2>&1 < $tmp_post";
+
} else {
$env['REQUEST_METHOD'] = 'GET';
@@ -1316,7 +1333,10 @@ TEST $file
}
if ($leak_check) {
- $cmd = "valgrind -q --tool=memcheck --log-file-exactly=$memcheck_filename $cmd";
+ $env['USE_ZEND_ALLOC'] = '0';
+ $cmd = "valgrind -q --tool=memcheck --trace-children=yes --log-file-exactly=$memcheck_filename $cmd";
+ } else {
+ $env['USE_ZEND_ALLOC'] = '1';
}
if ($DETAILED) echo "
@@ -1330,7 +1350,7 @@ SCRIPT_FILENAME = " . $env['SCRIPT_FILENAME'] . "
COMMAND $cmd
";
- $out = system_with_timeout($cmd, $env);
+ $out = system_with_timeout($cmd, $env, isset($section_text['STDIN']) ? $section_text['STDIN'] : null);
if (array_key_exists('CLEAN', $section_text) && (!$no_clean || $cfg['keep']['clean'])) {
if (trim($section_text['CLEAN'])) {
@@ -1370,8 +1390,47 @@ COMMAND $cmd
$output = str_replace("\r\n", "\n", trim($out));
/* when using CGI, strip the headers from the output */
- if (isset($old_php) && ($pos = strpos($output, "\n\n")) !== FALSE) {
- $output = substr($output, ($pos + 2));
+ $headers = "";
+ if (isset($old_php) && preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $out, $match)) {
+ $output = trim($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]);
+ }
+ }
+ }
+
+ $failed_headers = false;
+ if (isset($section_text['EXPECTHEADERS'])) {
+ $want = array();
+ $wanted_headers = array();
+ $lines = preg_split("/[\n\r]+/",$section_text['EXPECTHEADERS']);
+ foreach($lines as $line) {
+ if (strpos($line, ':') !== false) {
+ $line = explode(':', $line, 2);
+ $want[trim($line[0])] = trim($line[1]);
+ $wanted_headers[] = trim($line[0]) . ': ' . trim($line[1]);
+ }
+ }
+ $org_headers = $headers;
+ $headers = array();
+ $output_headers = array();
+ foreach($want as $k => $v) {
+ if (isset($org_headers[$k])) {
+ $headers = $org_headers[$k];
+ $output_headers[] = $k . ': ' . $org_headers[$k];
+ }
+ if (!isset($org_headers[$k]) || $org_headers[$k] != $v) {
+ $failed_headers = true;
+ }
+ }
+ ksort($wanted_headers);
+ $wanted_headers = join("\n", $wanted_headers);
+ ksort($output_headers);
+ $output_headers = join("\n", $output_headers);
}
if (isset($section_text['EXPECTF']) || isset($section_text['EXPECTREGEX'])) {
@@ -1407,7 +1466,7 @@ COMMAND $cmd
if (isset($old_php)) {
$php = $old_php;
}
- if (!$leaked) {
+ if (!$leaked && !$failed_headers) {
show_result("PASS", $tested, $tested_file, '', $temp_filenames);
return 'PASSED';
}
@@ -1424,7 +1483,7 @@ COMMAND $cmd
if (isset($old_php)) {
$php = $old_php;
}
- if (!$leaked) {
+ if (!$leaked && !$failed_headers) {
show_result("PASS", $tested, $tested_file, '', $temp_filenames);
return 'PASSED';
}
@@ -1433,7 +1492,15 @@ COMMAND $cmd
}
// Test failed so we need to report details.
-
+ if ($failed_headers) {
+ $passed = false;
+ $wanted = $wanted_headers . "\n--HEADERS--\n" . $wanted;
+ $output = $output_headers . "\n--HEADERS--\n" . $output;
+ if (isset($wanted_re)) {
+ $wanted_re = $wanted_headers . "\n--HEADERS--\n" . $wanted_re;
+ }
+ }
+
if ($leaked) {
$restype = 'LEAK';
} else if ($warn) {
@@ -1478,7 +1545,7 @@ $output
'test_name' => (is_array($IN_REDIRECT) ? $IN_REDIRECT['via'] : '') . $tested . " [$tested_file]",
'output' => $output_filename,
'diff' => $diff_filename,
- 'info' => $info
+ 'info' => $info,
);
if (isset($old_php)) {
@@ -1743,10 +1810,10 @@ function show_start($start_time)
if ($html_output)
{
- fwrite($html_file, "<h2>Time Start: " . date('Y-m-d H:i:s', $start_time) . "</h2>\n");
+ fwrite($html_file, "<h2>Time Start: " . @date('Y-m-d H:i:s', $start_time) . "</h2>\n");
fwrite($html_file, "<table>\n");
}
- echo "TIME START " . date('Y-m-d H:i:s', $start_time) . "\n=====================================================================\n";
+ echo "TIME START " . @date('Y-m-d H:i:s', $start_time) . "\n=====================================================================\n";
}
function show_end($end_time)
@@ -1756,9 +1823,9 @@ function show_end($end_time)
if ($html_output)
{
fwrite($html_file, "</table>\n");
- fwrite($html_file, "<h2>Time End: " . date('Y-m-d H:i:s', $end_time) . "</h2>\n");
+ fwrite($html_file, "<h2>Time End: " . @date('Y-m-d H:i:s', $end_time) . "</h2>\n");
}
- echo "=====================================================================\nTIME END " . date('Y-m-d H:i:s', $end_time) . "\n";
+ echo "=====================================================================\nTIME END " . @date('Y-m-d H:i:s', $end_time) . "\n";
}
function show_summary()
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index 52c069b5e..118b9cfc9 100644
--- a/sapi/apache/mod_php5.c
+++ b/sapi/apache/mod_php5.c
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php5.c,v 1.19.2.9 2006/05/13 22:03:51 rasmus Exp $ */
+/* $Id: mod_php5.c,v 1.19.2.7.2.6 2006/10/12 20:02:58 bfrance Exp $ */
#include "php_apache_http.h"
#include "http_conf_globals.h"
@@ -209,7 +209,6 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head
static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
{
request_rec *r = SG(server_context);
- char *status_buf = NULL;
const char *sline = SG(sapi_headers).http_status_line;
int sline_len;
@@ -223,11 +222,10 @@ static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
* the status-code: */
if (sline && ((sline_len = strlen(sline)) > 12) && strncmp(sline, "HTTP/1.", 7) == 0 && sline[8] == ' ' && sline[12] == ' ') {
if ((sline_len - 9) > MAX_STATUS_LENGTH) {
- status_buf = estrndup(sline + 9, MAX_STATUS_LENGTH);
+ r->status_line = ap_pstrndup(r->pool, sline + 9, MAX_STATUS_LENGTH);
} else {
- status_buf = estrndup(sline + 9, sline_len - 9);
+ r->status_line = ap_pstrndup(r->pool, sline + 9, sline_len - 9);
}
- r->status_line = status_buf;
}
if(r->status==304) {
@@ -235,9 +233,6 @@ static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
} else {
send_http_header(r);
}
- if (status_buf) {
- efree(status_buf);
- }
return SAPI_HEADER_SENT_SUCCESSFULLY;
}
/* }}} */
@@ -254,13 +249,17 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
for (i = 0; i < arr->nelts; i++) {
char *val;
+ int val_len, new_val_len;
if (elts[i].val) {
val = elts[i].val;
} else {
val = "";
}
- php_register_variable(elts[i].key, val, track_vars_array TSRMLS_CC);
+ val_len = strlen(val);
+ if (sapi_module.input_filter(PARSE_SERVER, elts[i].key, &val, val_len, &new_val_len TSRMLS_CC)) {
+ php_register_variable_safe(elts[i].key, val, new_val_len, track_vars_array TSRMLS_CC);
+ }
}
/* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */
@@ -680,8 +679,7 @@ static int send_parsed_php(request_rec * r)
char *mem_usage;
TSRMLS_FETCH();
- mem_usage = ap_psprintf(r->pool, "%u", AG(allocated_memory_peak));
- AG(allocated_memory_peak) = 0;
+ mem_usage = ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC));
ap_table_setn(r->notes, "mod_php_memory_usage", mem_usage);
}
#endif
@@ -860,6 +858,18 @@ static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, HashTabl
}
/* }}} */
+/* {{{ php_apache_phpini_set
+ */
+static CONST_PREFIX char *php_apache_phpini_set(cmd_parms *cmd, HashTable *conf, char *arg)
+{
+ if (apache_sapi_module.php_ini_path_override) {
+ return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored";
+ }
+ apache_sapi_module.php_ini_path_override = ap_server_root_relative(cmd->pool, arg);
+ return NULL;
+}
+/* }}} */
+
/* {{{ int php_xbithack_handler(request_rec * r)
*/
static int php_xbithack_handler(request_rec * r)
@@ -962,6 +972,7 @@ command_rec php_commands[] =
{"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)"},
+ {"PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, TAKE1, "Directory containing the php.ini file"},
{NULL}
};
/* }}} */
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c
index 07fe6bb8b..18671af8a 100644
--- a/sapi/apache/php_apache.c
+++ b/sapi/apache/php_apache.c
@@ -17,7 +17,7 @@
| David Sklar <sklar@student.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_apache.c,v 1.89.2.4 2006/04/26 09:31:23 edink Exp $ */
+/* $Id: php_apache.c,v 1.89.2.4.2.1 2006/09/06 11:54:28 nlopess Exp $ */
#include "php_apache_http.h"
@@ -394,7 +394,8 @@ PHP_FUNCTION(apache_response_headers)
Set an Apache subprocess_env variable */
PHP_FUNCTION(apache_setenv)
{
- int var_len, val_len, top=0;
+ int var_len, val_len;
+ zend_bool top=0;
char *var = NULL, *val = NULL;
request_rec *r = (request_rec *) SG(server_context);
diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c
index 384ab7b39..eca894aaa 100644
--- a/sapi/apache2filter/apache_config.c
+++ b/sapi/apache2filter/apache_config.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: apache_config.c,v 1.34.2.2 2006/06/09 16:29:45 mike Exp $ */
+/* $Id: apache_config.c,v 1.34.2.1.2.1 2006/06/09 16:29:35 mike Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
diff --git a/sapi/apache2filter/config.w32 b/sapi/apache2filter/config.w32
new file mode 100755
index 000000000..194630cca
--- /dev/null
+++ b/sapi/apache2filter/config.w32
@@ -0,0 +1,35 @@
+// vim:ft=javascript
+// $Id: config.w32,v 1.1 2006/07/05 10:12:42 edink Exp $
+
+ARG_ENABLE('apache2filter', 'Build Apache 2.x filter', 'no');
+
+if (PHP_APACHE2FILTER != "no") {
+ if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2FILTER", PHP_PHP_BUILD + "\\apache2\\include") &&
+ CHECK_LIB("libhttpd.lib", "apache2filter", PHP_PHP_BUILD + "\\apache2\\lib") &&
+ CHECK_LIB("libapr.lib", "apache2filter", PHP_PHP_BUILD + "\\apache2\\lib") &&
+ CHECK_LIB("libaprutil.lib", "apache2filter", PHP_PHP_BUILD + "\\apache2\\lib")
+ ) {
+ SAPI('apache2filter', 'sapi_apache2.c apache_config.c php_functions.c',
+ 'php' + PHP_VERSION + 'apache2_filter.dll',
+ '/D PHP_APACHE2_EXPORTS /I win32');
+ } else {
+ WARNING("Could not find apache2 filter libraries/headers");
+ }
+}
+
+ARG_ENABLE('apache2-2filter', 'Build Apache 2.2.x filter', 'no');
+
+if (PHP_APACHE2_2FILTER != "no") {
+ if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2_2FILTER", PHP_PHP_BUILD + "\\include\\apache2_2") &&
+ CHECK_LIB("libhttpd.lib", "apache2_2filter", PHP_PHP_BUILD + "\\lib\\apache2_2") &&
+ CHECK_LIB("libapr-1.lib", "apache2_2filter", PHP_PHP_BUILD + "\\lib\\apache2_2") &&
+ CHECK_LIB("libaprutil-1.lib", "apache2_2filter", PHP_PHP_BUILD + "\\lib\\apache2_2")
+ ) {
+ SAPI('apache2_2filter', 'sapi_apache2.c apache_config.c php_functions.c',
+ 'php' + PHP_VERSION + 'apache2_2_filter.dll',
+ '/D PHP_APACHE2_EXPORTS /I win32',
+ 'sapi\\apache2_2filter');
+ } else {
+ WARNING("Could not find apache2.2 filter libraries/headers");
+ }
+}
diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h
index cd678f9dc..87e9baaa4 100644
--- a/sapi/apache2filter/php_apache.h
+++ b/sapi/apache2filter/php_apache.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_apache.h,v 1.25.2.1 2006/01/01 12:50:18 sniper Exp $ */
+/* $Id: php_apache.h,v 1.25.2.1.2.1 2006/07/03 16:51:38 john Exp $ */
#ifndef PHP_APACHE_H
#define PHP_APACHE_H
@@ -48,12 +48,21 @@ typedef struct php_struct {
int request_processed;
} php_struct;
+typedef struct _php_apr_bucket_brigade {
+ unsigned int total_len;
+ apr_bucket_brigade *bb;
+} php_apr_bucket_brigade;
+
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[];
+static size_t php_apache_read_stream(void *, char *, size_t TSRMLS_DC);
+static void php_apache_close_stream(void * TSRMLS_DC);
+static long php_apache_fteller_stream(void * TSRMLS_DC);
+
#define APR_ARRAY_FOREACH_OPEN(arr, key, val) \
{ \
apr_table_entry_t *elts; \
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index 22212dfbb..1ed582b40 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.136.2.2 2006/03/19 14:54:53 mike Exp $ */
+/* $Id: sapi_apache2.c,v 1.136.2.2.2.3 2006/07/25 13:40:05 dmitry Exp $ */
#include <fcntl.h>
@@ -39,6 +39,7 @@
#include "apr_strings.h"
#include "ap_config.h"
+#include "apr_buckets.h"
#include "util_filter.h"
#include "httpd.h"
#include "http_config.h"
@@ -73,7 +74,7 @@ php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
ctx = SG(server_context);
f = ctx->f;
-
+
if (str_length == 0) return 0;
ba = f->c->bucket_alloc;
@@ -82,15 +83,6 @@ php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC)
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();
}
@@ -366,7 +358,7 @@ static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb,
}
for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b)) {
- apr_bucket_read(b, &str, &n, 1);
+ apr_bucket_read(b, &str, &n, APR_NONBLOCK_READ);
if (n > 0) {
old_index = ctx->post_len;
ctx->post_len += n;
@@ -420,6 +412,8 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC)
static void php_apache_request_dtor(ap_filter_t *f TSRMLS_DC)
{
+ php_apr_bucket_brigade *pbb = (php_apr_bucket_brigade *)f->ctx;
+
php_request_shutdown(NULL);
if (SG(request_info).query_string) {
@@ -431,16 +425,20 @@ static void php_apache_request_dtor(ap_filter_t *f TSRMLS_DC)
if (SG(request_info).path_translated) {
free(SG(request_info).path_translated);
}
+
+ apr_brigade_destroy(pbb->bb);
}
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();
-
+ zend_file_handle zfd;
+ php_apr_bucket_brigade *pbb;
+ apr_bucket *b;
+
if (f->r->proxyreq) {
zend_try {
zend_ini_deactivate(TSRMLS_C);
@@ -454,8 +452,28 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
zend_ini_deactivate(TSRMLS_C);
} zend_end_try();
return ap_pass_brigade(f->next, bb);
+ }
+
+ if(f->ctx) {
+ pbb = (php_apr_bucket_brigade *)f->ctx;
+ } else {
+ pbb = f->ctx = apr_palloc(f->r->pool, sizeof(*pbb));
+ pbb->bb = apr_brigade_create(f->r->pool, f->c->bucket_alloc);
+ pbb->total_len = 0;
}
+ if(ap_save_brigade(NULL, &pbb->bb, &bb, f->r->pool) != APR_SUCCESS) {
+ // Bad
+ }
+
+ apr_brigade_cleanup(bb);
+
+ // Check to see if the last bucket in this brigade, it not
+ // we have to wait until then.
+ if(!APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(pbb->bb))) {
+ return 0;
+ }
+
/* 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. */
@@ -475,7 +493,8 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
} zend_end_try();
return HTTP_INTERNAL_SERVER_ERROR;
}
- ctx->f = f; /* save whatever filters are after us in the chain. */
+
+ ctx->f = f->next; /* save whatever filters are after us in the chain. */
if (ctx->request_processed) {
zend_try {
@@ -484,78 +503,45 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
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);
+ php_apache_request_ctor(f, ctx TSRMLS_CC);
+
+ // It'd be nice if we could highlight based of a zend_file_handle here....
+ // ...but we can't.
+
+ zfd.type = ZEND_HANDLE_STREAM;
+
+ zfd.handle.stream.handle = pbb;
+ zfd.handle.stream.reader = php_apache_read_stream;
+ zfd.handle.stream.closer = php_apache_close_stream;
+ zfd.handle.stream.fteller = php_apache_fteller_stream;
+ zfd.handle.stream.interactive = 0;
+
+ zfd.filename = f->r->filename;
+ zfd.opened_path = NULL;
+ zfd.free_filename = 0;
+
+ 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);
- }
+ {
+ char *mem_usage;
+
+ mem_usage = apr_psprintf(ctx->r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC));
+ 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;
- }
+
+ php_apache_request_dtor(f TSRMLS_CC);
+
+ if (!f->r->main) {
+ ctx->request_processed = 1;
}
-
+
+ b = apr_bucket_eos_create(f->c->bucket_alloc);
+ APR_BRIGADE_INSERT_TAIL(pbb->bb, b);
+
/* Pass whatever is left on the brigade. */
- return ap_pass_brigade(f->next, bb);
+ return ap_pass_brigade(f->next, pbb->bb);
}
static apr_status_t
@@ -704,6 +690,38 @@ static void php_register_hook(apr_pool_t *p)
ap_register_input_filter("PHP", php_input_filter, php_apache_disable_caching, AP_FTYPE_RESOURCE);
}
+static size_t php_apache_read_stream(void *handle, char *buf, size_t wantlen TSRMLS_DC)
+{
+ php_apr_bucket_brigade *pbb = (php_apr_bucket_brigade *)handle;
+ apr_bucket_brigade *rbb;
+ apr_size_t readlen;
+ apr_bucket *b = NULL;
+
+ rbb = pbb->bb;
+
+ if((apr_brigade_partition(pbb->bb, wantlen, &b) == APR_SUCCESS) && b){
+ pbb->bb = apr_brigade_split(rbb, b);
+ }
+
+ readlen = wantlen;
+ apr_brigade_flatten(rbb, buf, &readlen);
+ apr_brigade_cleanup(rbb);
+ pbb->total_len += readlen;
+
+ return readlen;
+}
+
+static void php_apache_close_stream(void *handle TSRMLS_DC)
+{
+ return;
+}
+
+static long php_apache_fteller_stream(void *handle TSRMLS_DC)
+{
+ php_apr_bucket_brigade *pbb = (php_apr_bucket_brigade *)handle;
+ return pbb->total_len;
+}
+
AP_MODULE_DECLARE_DATA module php5_module = {
STANDARD20_MODULE_STUFF,
create_php_config, /* create per-directory config structure */
diff --git a/sapi/apache2handler/EXPERIMENTAL b/sapi/apache2handler/EXPERIMENTAL
deleted file mode 100644
index 293159a69..000000000
--- 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/apache_config.c b/sapi/apache2handler/apache_config.c
index 13f447db3..bd80bb86f 100644
--- a/sapi/apache2handler/apache_config.c
+++ b/sapi/apache2handler/apache_config.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: apache_config.c,v 1.7.2.2 2006/06/09 15:13:58 mike Exp $ */
+/* $Id: apache_config.c,v 1.7.2.1.2.1 2006/06/09 15:13:39 mike Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
diff --git a/sapi/apache2handler/config.w32 b/sapi/apache2handler/config.w32
index ec099503b..d64da17c0 100644
--- a/sapi/apache2handler/config.w32
+++ b/sapi/apache2handler/config.w32
@@ -1,5 +1,5 @@
// vim:ft=javascript
-// $Id: config.w32,v 1.1 2003/12/19 18:28:56 wez Exp $
+// $Id: config.w32,v 1.1.6.1 2006/05/07 00:09:20 edink Exp $
ARG_ENABLE('apache2handler', 'Build Apache 2.x handler', 'no');
@@ -16,3 +16,20 @@ if (PHP_APACHE2HANDLER != "no") {
WARNING("Could not find apache2 libraries/headers");
}
}
+
+ARG_ENABLE('apache2-2handler', 'Build Apache 2.2.x handler', 'no');
+
+if (PHP_APACHE2_2HANDLER != "no") {
+ if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE2_2HANDLER", PHP_PHP_BUILD + "\\include\\apache2_2") &&
+ CHECK_LIB("libhttpd.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") &&
+ CHECK_LIB("libapr-1.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2") &&
+ CHECK_LIB("libaprutil-1.lib", "apache2_2handler", PHP_PHP_BUILD + "\\lib\\apache2_2")
+ ) {
+ SAPI('apache2_2handler', 'mod_php5.c sapi_apache2.c apache_config.c php_functions.c',
+ 'php' + PHP_VERSION + 'apache2_2.dll',
+ '/D PHP_APACHE2_EXPORTS /I win32',
+ 'sapi\\apache2_2handler');
+ } else {
+ WARNING("Could not find apache2.2 libraries/headers");
+ }
+}
diff --git a/sapi/apache2handler/php_apache.h b/sapi/apache2handler/php_apache.h
index 332c2736a..e4030cbbe 100644
--- a/sapi/apache2handler/php_apache.h
+++ b/sapi/apache2handler/php_apache.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_apache.h,v 1.8.2.1 2006/01/01 12:50:18 sniper Exp $ */
+/* $Id: php_apache.h,v 1.8.2.1.2.1 2006/05/28 20:32:00 mike Exp $ */
#ifndef PHP_APACHE_H
#define PHP_APACHE_H
@@ -44,6 +44,8 @@ typedef struct php_struct {
#endif
/* Whether or not we've processed PHP in the output filters yet. */
int request_processed;
+ /* final content type */
+ char *content_type;
} php_struct;
void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf);
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index 50e2550c1..21bce6128 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.57.2.11 2006/08/08 13:11:39 stas Exp $ */
+/* $Id: sapi_apache2.c,v 1.57.2.10.2.6 2006/08/10 13:43:18 tony2001 Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -105,8 +105,10 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header,sapi_headers_stru
} while (*val == ' ');
if (!strcasecmp(sapi_header->header, "content-type")) {
- val = apr_pstrdup(ctx->r->pool, val);
- ap_set_content_type(ctx->r, val);
+ if (ctx->content_type) {
+ efree(ctx->content_type);
+ }
+ ctx->content_type = estrdup(val);
} else if (sapi_header->replace) {
apr_table_set(ctx->r->headers_out, sapi_header->header, val);
} else {
@@ -131,6 +133,15 @@ php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
&& sline[8] == ' ') {
ctx->r->status_line = apr_pstrdup(ctx->r->pool, sline + 9);
}
+
+ /* call ap_set_content_type only once, else each time we call it,
+ configured output filters for that content type will be added */
+ if (!ctx->content_type) {
+ ctx->content_type = sapi_get_default_content_type(TSRMLS_C);
+ }
+ ap_set_content_type(ctx->r, apr_pstrdup(ctx->r->pool, ctx->content_type));
+ efree(ctx->content_type);
+ ctx->content_type = NULL;
return SAPI_HEADER_SENT_SUCCESSFULLY;
}
@@ -221,12 +232,12 @@ 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);
}
@@ -405,7 +416,6 @@ static apr_status_t php_server_context_cleanup(void *data_)
static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
{
- char *content_type;
char *content_length;
const char *auth;
@@ -418,10 +428,6 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
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);
@@ -524,7 +530,7 @@ normal:
/* 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. */
+ /* .. or if the sub-request environment differs from the main-request. */
r->subprocess_env != r->main->subprocess_env
) {
/* setup standard CGI variables */
@@ -591,7 +597,7 @@ zend_first_try {
{
char *mem_usage;
- mem_usage = apr_psprintf(ctx->r->pool, "%u", AG(allocated_memory_peak));
+ mem_usage = apr_psprintf(ctx->r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC));
apr_table_set(r->notes, "mod_php_memory_usage", mem_usage);
}
#endif
diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c
index 6d12dfd47..cc3236f38 100644
--- a/sapi/apache_hooks/mod_php5.c
+++ b/sapi/apache_hooks/mod_php5.c
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php5.c,v 1.11.2.1 2006/01/01 12:50:18 sniper Exp $ */
+/* $Id: mod_php5.c,v 1.11.2.1.2.3 2006/08/03 09:56:50 dmitry Exp $ */
#include "php_apache_http.h"
@@ -742,8 +742,7 @@ static int send_parsed_php(request_rec * r)
char *mem_usage;
TSRMLS_FETCH();
- mem_usage = ap_psprintf(r->pool, "%u", AG(allocated_memory_peak));
- AG(allocated_memory_peak) = 0;
+ mem_usage = ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC));
ap_table_setn(r->notes, "mod_php_memory_usage", mem_usage);
}
#endif
@@ -1161,6 +1160,18 @@ static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, php_per_
}
/* }}} */
+/* {{{ php_apache_phpini_set
+ */
+static CONST_PREFIX char *php_apache_phpini_set(cmd_parms *cmd, HashTable *conf, char *arg)
+{
+ if (apache_sapi_module.php_ini_path_override) {
+ return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored";
+ }
+ apache_sapi_module.php_ini_path_override = ap_server_root_relative(cmd->pool, arg);
+ return NULL;
+}
+/* }}} */
+
/* {{{ int php_xbithack_handler(request_rec * r)
*/
static int php_xbithack_handler(request_rec * r)
@@ -1432,6 +1443,7 @@ command_rec php_commands[] =
{"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)"},
+ {"PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, TAKE1, "Directory containing the php.ini file"},
{NULL}
};
/* }}} */
diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c
index 1b5aeb2e9..256d5e08b 100644
--- a/sapi/apache_hooks/php_apache.c
+++ b/sapi/apache_hooks/php_apache.c
@@ -17,7 +17,7 @@
| David Sklar <sklar@student.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_apache.c,v 1.19.2.3 2006/01/01 12:50:18 sniper Exp $ */
+/* $Id: php_apache.c,v 1.19.2.3.2.1 2006/09/06 11:54:29 nlopess Exp $ */
#include "php_apache_http.h"
@@ -1796,7 +1796,8 @@ PHP_FUNCTION(apache_response_headers)
Set an Apache subprocess_env variable */
PHP_FUNCTION(apache_setenv)
{
- int var_len, val_len, top=0;
+ int var_len, val_len;
+ zend_bool top=0;
char *var = NULL, *val = NULL;
request_rec *r = (request_rec *) SG(server_context);
diff --git a/sapi/cgi/README.FastCGI b/sapi/cgi/README.FastCGI
index f51ae5686..3dda295d8 100644
--- a/sapi/cgi/README.FastCGI
+++ b/sapi/cgi/README.FastCGI
@@ -126,17 +126,22 @@ 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)
+PHP_FCGI_CHILDREN (default value: 0)
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.
+page request at a time. Value 0 means that PHP willnot start additional
+processes and main process will handle FastCGI requests by itself. Note that
+this process may die (because of PHP_FCGI_MAX_REQUESTS) and it willnot
+respawned automatic. Values 1 and above force PHP start additioanl processes
+those will handle requests. The main process will restart children in case of
+their death. So by default, you will be able to handle 1 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)
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 317c823f4..51fc7c4c3 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -17,10 +17,11 @@
| Zeev Suraski <zeev@zend.com> |
| FastCGI: Ben Mansell <php@slimyhorror.com> |
| Shane Caraveo <shane@caraveo.com> |
+ | Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: cgi_main.c,v 1.267.2.16 2006/05/24 07:55:38 dmitry Exp $ */
+/* $Id: cgi_main.c,v 1.267.2.15.2.13 2006/09/23 12:27:40 tony2001 Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -81,9 +82,8 @@ int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS;
#if PHP_FASTCGI
#include "fastcgi.h"
-#ifdef PHP_WIN32
-extern int OS_SetImpersonate(void);
-#else
+
+#ifndef PHP_WIN32
/* XXX this will need to change later when threaded fastcgi is
implemented. shane */
struct sigaction act, old_term, old_quit, old_int;
@@ -130,7 +130,6 @@ static const opt_struct OPTIONS[] = {
{'d', 1, "define"},
{'e', 0, "profile-info"},
{'f', 1, "file"},
- {'g', 1, "global"},
{'h', 0, "help"},
{'i', 0, "info"},
{'l', 0, "syntax-check"},
@@ -234,9 +233,9 @@ static inline size_t sapi_cgibin_single_write(const char *str, uint str_length T
#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 (fcgi_is_fastcgi()) {
+ fcgi_request *request = (fcgi_request*) SG(server_context);
+ long ret = fcgi_write(request, FCGI_STDOUT, str, str_length);
if (ret <= 0) {
return 0;
}
@@ -276,13 +275,13 @@ static int sapi_cgibin_ub_write(const char *str, uint str_length TSRMLS_DC)
static void sapi_cgibin_flush(void *server_context)
{
#if PHP_FASTCGI
- if (!FCGX_IsCGI()) {
- FCGX_Request *request = (FCGX_Request *) server_context;
+ if (fcgi_is_fastcgi()) {
+ fcgi_request *request = (fcgi_request*) server_context;
if (
#ifndef PHP_WIN32
!parent &&
#endif
- request && FCGX_FFlush(request->out) == -1) {
+ request && !fcgi_flush(request, 0)) {
php_handle_aborted_connection();
}
return;
@@ -324,14 +323,14 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
PHPWRITE_H(buf, len);
}
- h = zend_llist_get_first_ex(&sapi_headers->headers, &pos);
+ h = (sapi_header_struct*)zend_llist_get_first_ex(&sapi_headers->headers, &pos);
while (h) {
/* prevent CRLFCRLF */
if (h->header_len) {
PHPWRITE_H(h->header, h->header_len);
PHPWRITE_H("\r\n", 2);
}
- h = zend_llist_get_next_ex(&sapi_headers->headers, &pos);
+ h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos);
}
PHPWRITE_H("\r\n", 2);
@@ -349,9 +348,9 @@ static int sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
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);
+ if (fcgi_is_fastcgi()) {
+ fcgi_request *request = (fcgi_request*) SG(server_context);
+ tmp_read_bytes = fcgi_read(request, pos, count_bytes - read_bytes);
pos += tmp_read_bytes;
} else {
tmp_read_bytes = read(0, buffer + read_bytes, count_bytes - read_bytes);
@@ -375,9 +374,9 @@ static char *sapi_cgibin_getenv(char *name, size_t name_len TSRMLS_DC)
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);
+ if (fcgi_is_fastcgi()) {
+ fcgi_request *request = (fcgi_request*) SG(server_context);
+ return fcgi_getenv(request, name, name_len);
}
#endif
/* if cgi, or fastcgi and not found in fcgi env
@@ -387,45 +386,68 @@ static char *sapi_cgibin_getenv(char *name, size_t name_len TSRMLS_DC)
static char *_sapi_cgibin_putenv(char *name, char *value TSRMLS_DC)
{
- int len = 0;
- char *buf = NULL;
+ int name_len;
+#if !HAVE_SETENV || !HAVE_UNSETENV
+ int len;
+ char *buf;
+#endif
+
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);
- }
+ name_len = strlen(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);
+ if (fcgi_is_fastcgi()) {
+ fcgi_request *request = (fcgi_request*) SG(server_context);
+ return fcgi_putenv(request, name, name_len, value);
+ }
+#endif
+#if HAVE_SETENV
+ if (value) {
+ setenv(name, value, 1);
}
#endif
+#if HAVE_UNSETENV
+ if (!value) {
+ unsetenv(name);
+ }
+#endif
+
+#if !HAVE_SETENV || !HAVE_UNSETENV
/* 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);
+ len = name_len + (value ? strlen(value) : 0) + sizeof("=") + 2;
+ buf = (char *) malloc(len);
+ if (buf == NULL) {
+ return getenv(name);
+ }
+#endif
+#if !HAVE_SETENV
+ if (value) {
+ len = snprintf(buf, len - 1, "%s=%s", name, value);
+ putenv(buf);
+ }
+#endif
+#if !HAVE_UNSETENV
+ if (!value) {
+ len = snprintf(buf, len - 1, "%s=", name);
+ putenv(buf);
+ }
+#endif
return getenv(name);
}
static char *sapi_cgi_read_cookies(TSRMLS_D)
{
- return sapi_cgibin_getenv((char *) "HTTP_COOKIE", 0 TSRMLS_CC);
+ return sapi_cgibin_getenv((char *) "HTTP_COOKIE", sizeof("HTTP_COOKIE")-1 TSRMLS_CC);
}
#if PHP_FASTCGI
@@ -450,26 +472,28 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC)
zval_copy_ctor(array_ptr);
return;
}
- if (!FCGX_IsCGI()) {
- FCGX_Request *request = (FCGX_Request *) SG(server_context);
- char **env, *p;
+
+ /* call php's original import as a catch-all */
+ php_php_import_environment_variables(array_ptr TSRMLS_CC);
+
+ if (fcgi_is_fastcgi()) {
+ fcgi_request *request = (fcgi_request*) SG(server_context);
+ HashPosition pos;
int magic_quotes_gpc = PG(magic_quotes_gpc);
+ char *var, **val;
+ uint var_len;
+ ulong idx;
/* 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;
- }
- *p = 0;
- php_register_variable(*env, p + 1, array_ptr TSRMLS_CC);
- *p = '=';
+ for (zend_hash_internal_pointer_reset_ex(&request->env, &pos);
+ zend_hash_get_current_key_ex(&request->env, &var, &var_len, &idx, 0, &pos) == HASH_KEY_IS_STRING &&
+ zend_hash_get_current_data_ex(&request->env, (void **) &val, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(&request->env, &pos)) {
+ php_register_variable(var, *val, array_ptr TSRMLS_CC);
}
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
@@ -486,13 +510,21 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
static void sapi_cgi_log_message(char *message)
{
#if PHP_FASTCGI
- if (!FCGX_IsCGI() && fcgi_logging) {
- FCGX_Request *request;
+ if (fcgi_is_fastcgi() && fcgi_logging) {
+ fcgi_request *request;
TSRMLS_FETCH();
- request = (FCGX_Request *) SG(server_context);
- if (request) {
- FCGX_FPrintF(request->err, "%s\n", message);
+ request = (fcgi_request*) SG(server_context);
+ if (request) {
+ int len = strlen(message);
+ char *buf = malloc(len+2);
+
+ memcpy(buf, message, len);
+ memcpy(buf + len, "\n", sizeof("\n"));
+ fcgi_write(request, FCGI_STDERR, buf, len+1);
+ free(buf);
+ } else {
+ fprintf(stderr, "%s\n", message);
}
/* ignore return code */
} else
@@ -667,8 +699,8 @@ static void php_cgi_usage(char *argv0)
*/
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 *env_script_filename = sapi_cgibin_getenv("SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME")-1 TSRMLS_CC);
+ char *env_path_translated = sapi_cgibin_getenv("PATH_TRANSLATED", sizeof("PATH_TRANSLATED")-1 TSRMLS_CC);
char *script_path_translated = env_script_filename;
#if !DISCARD_PATH
@@ -696,14 +728,14 @@ static void init_request_info(TSRMLS_D)
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);
+ char *content_length = sapi_cgibin_getenv("CONTENT_LENGTH", sizeof("CONTENT_LENGTH")-1 TSRMLS_CC);
+ char *content_type = sapi_cgibin_getenv("CONTENT_TYPE", sizeof("CONTENT_TYPE")-1 TSRMLS_CC);
+ char *env_path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO")-1 TSRMLS_CC);
+ char *env_script_name = sapi_cgibin_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME")-1 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);
+ char *env_redirect_url = sapi_cgibin_getenv("REDIRECT_URL", sizeof("REDIRECT_URL")-1 TSRMLS_CC);
+ char *env_document_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT")-1 TSRMLS_CC);
if (fix_pathinfo) {
@@ -853,7 +885,7 @@ static void init_request_info(TSRMLS_D)
_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);
+ SG(request_info).request_uri = sapi_cgibin_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME")-1 TSRMLS_CC);
} else {
#endif
/* pre 4.3 behaviour, shouldn't be used but provides BC */
@@ -869,9 +901,9 @@ static void init_request_info(TSRMLS_D)
#if ENABLE_PATHINFO_CHECK
}
#endif
- SG(request_info).request_method = sapi_cgibin_getenv("REQUEST_METHOD", 0 TSRMLS_CC);
+ SG(request_info).request_method = sapi_cgibin_getenv("REQUEST_METHOD", sizeof("REQUEST_METHOD")-1 TSRMLS_CC);
/* FIXME - Work out proto_num here */
- SG(request_info).query_string = sapi_cgibin_getenv("QUERY_STRING", 0 TSRMLS_CC);
+ SG(request_info).query_string = sapi_cgibin_getenv("QUERY_STRING", sizeof("QUERY_STRING")-1 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, "..")) {
@@ -881,43 +913,12 @@ static void init_request_info(TSRMLS_D)
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);
+ auth = sapi_cgibin_getenv("HTTP_AUTHORIZATION", sizeof("HTTP_AUTHORIZATION")-1 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
@@ -959,6 +960,7 @@ static int is_port_number(const char *bindpath)
*/
int main(int argc, char *argv[])
{
+ int free_query_string = 0;
int exit_status = SUCCESS;
int cgi = 0, c, i, len;
zend_file_handle file_handle;
@@ -970,7 +972,7 @@ int main(int argc, char *argv[])
int orig_optind = php_optind;
char *orig_optarg = php_optarg;
char *script_file = NULL;
- zend_llist global_vars;
+ int ini_entries_len = 0;
#if FORCE_CGI_REDIRECT
long force_redirect = 1;
char *redirect_status_env = NULL;
@@ -988,12 +990,12 @@ int main(int argc, char *argv[])
#if PHP_FASTCGI
int max_requests = 500;
int requests = 0;
- int fastcgi = !FCGX_IsCGI();
+ int fastcgi = fcgi_is_fastcgi();
#ifndef PHP_WIN32
char *bindpath = NULL;
#endif
int fcgi_fd = 0;
- FCGX_Request request;
+ fcgi_request request;
#ifdef PHP_WIN32
long impersonate = 0;
#else
@@ -1060,6 +1062,37 @@ int main(int argc, char *argv[])
case 'n':
cgi_sapi_module.php_ini_ignore = 1;
break;
+ case 'd': {
+ /* define ini entries on command line */
+ int len = strlen(php_optarg);
+ char *val;
+
+ if ((val = strchr(php_optarg, '='))) {
+ val++;
+ if (!isalnum(*val) && *val != '"' && *val != '\'' && *val != '\0') {
+ cgi_sapi_module.ini_entries = realloc(cgi_sapi_module.ini_entries, ini_entries_len + len + sizeof("\"\"\n\0"));
+ memcpy(cgi_sapi_module.ini_entries + ini_entries_len, php_optarg, (val - php_optarg));
+ ini_entries_len += (val - php_optarg);
+ memcpy(cgi_sapi_module.ini_entries + ini_entries_len, "\"", 1);
+ ini_entries_len++;
+ memcpy(cgi_sapi_module.ini_entries + ini_entries_len, val, len - (val - php_optarg));
+ ini_entries_len += len - (val - php_optarg);
+ memcpy(cgi_sapi_module.ini_entries + ini_entries_len, "\"\n\0", sizeof("\"\n\0"));
+ ini_entries_len += sizeof("\n\0\"") - 2;
+ } else {
+ cgi_sapi_module.ini_entries = realloc(cgi_sapi_module.ini_entries, ini_entries_len + len + sizeof("\n\0"));
+ memcpy(cgi_sapi_module.ini_entries + ini_entries_len, php_optarg, len);
+ memcpy(cgi_sapi_module.ini_entries + ini_entries_len + len, "\n\0", sizeof("\n\0"));
+ ini_entries_len += len + sizeof("\n\0") - 2;
+ }
+ } else {
+ cgi_sapi_module.ini_entries = realloc(cgi_sapi_module.ini_entries, ini_entries_len + len + sizeof("=1\n\0"));
+ memcpy(cgi_sapi_module.ini_entries + ini_entries_len, php_optarg, len);
+ memcpy(cgi_sapi_module.ini_entries + ini_entries_len + len, "=1\n\0", sizeof("=1\n\0"));
+ ini_entries_len += len + sizeof("=1\n\0") - 2;
+ }
+ break;
+ }
#if PHP_FASTCGI
#ifndef PHP_WIN32
/* if we're started on command line, check to see if
@@ -1173,14 +1206,10 @@ consult the installation file that came with this distribution, or visit \n\
/* 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 && is_port_number(bindpath)) {
char *tmp;
@@ -1188,10 +1217,10 @@ consult the installation file that came with this distribution, or visit \n\
tmp[0] = ':';
memcpy(tmp + 1, bindpath, strlen(bindpath) + 1);
- fcgi_fd = FCGX_OpenSocket(tmp, 128);
+ fcgi_fd = fcgi_listen(tmp, 128);
free(tmp);
} else {
- fcgi_fd = FCGX_OpenSocket(bindpath, 128);
+ fcgi_fd = fcgi_listen(bindpath, 128);
}
if (fcgi_fd < 0) {
fprintf(stderr, "Couldn't create FastCGI listen socket on port %s\n", bindpath);
@@ -1200,14 +1229,14 @@ consult the installation file that came with this distribution, or visit \n\
#endif
return FAILURE;
}
- fastcgi = !FCGX_IsCGI();
+ fastcgi = fcgi_is_fastcgi();
}
#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) {
+ if (max_requests < 0) {
fprintf(stderr, "PHP_FCGI_MAX_REQUESTS is not valid\n");
return FAILURE;
}
@@ -1218,14 +1247,13 @@ consult the installation file that came with this distribution, or visit \n\
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);
+ fcgi_init_request(&request, fcgi_fd);
#ifndef PHP_WIN32
/* Pre-fork, if required */
if (getenv("PHP_FCGI_CHILDREN")) {
children = atoi(getenv("PHP_FCGI_CHILDREN"));
- if (!children) {
+ if (children < 0) {
fprintf(stderr, "PHP_FCGI_CHILDREN is not valid\n");
return FAILURE;
}
@@ -1327,10 +1355,10 @@ consult the installation file that came with this distribution, or visit \n\
if (cfg_get_long("fastcgi.impersonate", &impersonate) == FAILURE) {
impersonate = 0;
}
- if (impersonate) OS_SetImpersonate();
+ if (impersonate) fcgi_impersonate();
}
#endif
- while (!fastcgi || FCGX_Accept_r(&request) >= 0) {
+ while (!fastcgi || fcgi_accept_request(&request) >= 0) {
#endif
#if PHP_FASTCGI
@@ -1339,7 +1367,6 @@ consult the installation file that came with this distribution, or visit \n\
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
@@ -1368,9 +1395,6 @@ consult the installation file that came with this distribution, or visit \n\
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;
@@ -1384,14 +1408,6 @@ consult the installation file that came with this distribution, or visit \n\
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);
@@ -1504,7 +1520,7 @@ consult the installation file that came with this distribution, or visit \n\
len += strlen(argv[i]) + 1;
}
- s = malloc(len + 1); /* leak - but only for command line version, so ok */
+ s = malloc(len + 1);
*s = '\0'; /* we are pretending it came from the environment */
for (i = php_optind, len = 0; i < argc; i++) {
strcat(s, argv[i]);
@@ -1513,6 +1529,7 @@ consult the installation file that came with this distribution, or visit \n\
}
}
SG(request_info).query_string = s;
+ free_query_string = 1;
}
} /* end !cgi && !fastcgi */
@@ -1544,7 +1561,7 @@ consult the installation file that came with this distribution, or visit \n\
if (php_request_startup(TSRMLS_C) == FAILURE) {
#if PHP_FASTCGI
if (fastcgi) {
- FCGX_Finish_r(&request);
+ fcgi_finish_request(&request);
}
#endif
php_module_shutdown(TSRMLS_C);
@@ -1555,10 +1572,6 @@ consult the installation file that came with this distribution, or visit \n\
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
@@ -1591,12 +1604,12 @@ consult the installation file that came with this distribution, or visit \n\
/* #!php support */
c = fgetc(file_handle.handle.fp);
if (c == '#') {
- while (c != 10 && c != 13) {
+ while (c != '\n' && c != '\r') {
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) {
+ if (c == '\r') {
+ if (fgetc(file_handle.handle.fp) != '\n') {
long pos = ftell(file_handle.handle.fp);
fseek(file_handle.handle.fp, pos - 1, SEEK_SET);
}
@@ -1676,6 +1689,11 @@ fastcgi_request_done:
free(SG(request_info).path_translated);
SG(request_info).path_translated = NULL;
}
+ if (free_query_string && SG(request_info).query_string) {
+ free(SG(request_info).query_string);
+ SG(request_info).query_string = NULL;
+ }
+
}
#if PHP_FASTCGI
@@ -1683,7 +1701,7 @@ fastcgi_request_done:
/* only fastcgi will get here */
requests++;
if (max_requests && (requests == max_requests)) {
- FCGX_Finish_r(&request);
+ fcgi_finish_request(&request);
#ifndef PHP_WIN32
if (bindpath) {
free(bindpath);
@@ -1698,6 +1716,9 @@ fastcgi_request_done:
if (cgi_sapi_module.php_ini_path_override) {
free(cgi_sapi_module.php_ini_path_override);
}
+ if (cgi_sapi_module.ini_entries) {
+ free(cgi_sapi_module.ini_entries);
+ }
} zend_catch {
exit_status = 255;
} zend_end_try();
diff --git a/sapi/cgi/config.w32 b/sapi/cgi/config.w32
index f9805a636..edd43eead 100644
--- a/sapi/cgi/config.w32
+++ b/sapi/cgi/config.w32
@@ -1,5 +1,5 @@
// vim:ft=javascript
-// $Id: config.w32,v 1.2.4.1 2006/02/02 08:17:23 dmitry Exp $
+// $Id: config.w32,v 1.2.4.1.2.2 2006/09/28 09:37:52 dmitry Exp $
ARG_ENABLE('cgi', 'Build CGI version of PHP', 'yes');
ARG_ENABLE('fastcgi', 'Build FastCGI support into CGI binary', 'yes');
@@ -15,8 +15,10 @@ AC_DEFINE("ENABLE_PATHINFO_CHECK", PHP_PATH_INFO_CHECK == "yes" ? 1 : 0, "Pathin
if (PHP_CGI == "yes") {
AC_DEFINE('PHP_FASTCGI', PHP_FASTCGI == "yes" ? 1 : 0);
+ ADD_FLAG("LDFLAGS_CGI", "/stack:8388608");
+
if (PHP_FASTCGI == "yes") {
- SAPI('cgi', 'cgi_main.c getopt.c fastcgi.c', 'php-cgi.exe', '/I sapi/cgi/libfcgi/include /D FCGI_STATIC');
+ SAPI('cgi', 'cgi_main.c getopt.c fastcgi.c', 'php-cgi.exe');
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
index c521beb2d..f4f3ffe13 100644
--- a/sapi/cgi/config9.m4
+++ b/sapi/cgi/config9.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config9.m4,v 1.17.2.2 2006/02/02 09:59:23 dmitry Exp $
+dnl $Id: config9.m4,v 1.17.2.2.2.1 2006/09/28 09:37:52 dmitry Exp $
dnl
AC_ARG_ENABLE(cgi,
@@ -127,11 +127,6 @@ if test "$PHP_SAPI" = "default"; then
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_FASTCGI=1
PHP_FCGI_FILES="fastcgi.c"
diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c
index 807df718d..6f528109f 100644
--- a/sapi/cgi/fastcgi.c
+++ b/sapi/cgi/fastcgi.c
@@ -16,10 +16,10 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fastcgi.c,v 1.4.2.18 2006/08/20 17:49:05 sas Exp $ */
+/* $Id: fastcgi.c,v 1.4.2.13.2.11 2006/10/16 10:46:59 dmitry Exp $ */
-#include "fastcgi.h"
#include "php.h"
+#include "fastcgi.h"
#include <string.h>
#include <stdlib.h>
@@ -125,14 +125,15 @@ typedef union _sa_t {
} sa_t;
typedef struct _fcgi_mgmt_rec {
- char* name;
- char val;
+ char* name;
+ size_t name_len;
+ char val;
} fcgi_mgmt_rec;
static const fcgi_mgmt_rec fcgi_mgmt_vars[] = {
- {"FCGI_MAX_CONNS", 1},
- {"FCGI_MAX_REQS", 1},
- {"FCGI_MPXS_CONNS", 0}
+ {"FCGI_MAX_CONNS", sizeof("FCGI_MAX_CONNS")-1, 1},
+ {"FCGI_MAX_REQS", sizeof("FCGI_MAX_REQS")-1, 1},
+ {"FCGI_MPXS_CONNS", sizeof("FCGI_MPXS_CONNS")-1, 0}
};
@@ -140,13 +141,6 @@ static int is_initialized = 0;
static int is_fastcgi = 0;
static int in_shutdown = 0;
-static inline char* fcgi_strndup(const char *str, int len)
-{
- char *s = malloc(len+1);
- memcpy(s, str, len+1);
- return s;
-}
-
#ifdef _WIN32
static DWORD WINAPI fcgi_shutdown_thread(LPVOID arg)
@@ -396,12 +390,16 @@ static inline int fcgi_make_header(fcgi_header *hdr, fcgi_request_type type, int
return pad;
}
-static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end, int n)
+static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end)
{
+ char buf[128];
+ char *tmp = buf;
+ int buf_size = sizeof(buf);
int name_len, val_len;
char *s;
+ int ret = 1;
- while (p < end && n < FCGI_MAX_ENV_VARS - 1) {
+ while (p < end) {
name_len = *p++;
if (name_len >= 128) {
name_len = ((name_len & 0x7f) << 24);
@@ -416,31 +414,43 @@ static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *e
val_len |= (*p++ << 8);
val_len |= *p++;
}
- req->env[n] = s = malloc(name_len + val_len + 2);
- memcpy(s, p, name_len);
- p += name_len;
- s[name_len] = '=';
- memcpy(s+name_len+1, p, val_len);
- p += val_len;
- s[name_len+1+val_len] = '\0';
- n++;
+ if (p + name_len + val_len > end) {
+ /* Malformated request */
+ ret = 0;
+ break;
+ }
+ if (name_len+1 >= buf_size) {
+ buf_size = name_len + 64;
+ tmp = (tmp == buf ? emalloc(buf_size): erealloc(tmp, buf_size));
+ }
+ memcpy(tmp, p, name_len);
+ tmp[name_len] = 0;
+ s = zend_strndup((char*)p + name_len, val_len);
+ zend_hash_update(&req->env, tmp, name_len+1, &s, sizeof(char*), NULL);
+ p += name_len + val_len;
}
- return n;
+ if (tmp != buf && tmp != NULL) {
+ efree(tmp);
+ }
+ return ret;
+}
+
+static void fcgi_free_var(char **s)
+{
+ free(*s);
}
static int fcgi_read_request(fcgi_request *req)
{
fcgi_header hdr;
int len, padding;
- int n = 1;
- char *s;
unsigned char buf[FCGI_MAX_LENGTH+8];
req->keep = 0;
req->in_len = 0;
req->out_hdr = NULL;
req->out_pos = req->out_buf;
- memset(req->env, 0, sizeof(req->env));
+ zend_hash_init(&req->env, 0, NULL, (void (*)(void *)) fcgi_free_var, 1);
if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) ||
hdr.version < FCGI_VERSION_1) {
@@ -463,6 +473,8 @@ static int fcgi_read_request(fcgi_request *req)
req->id = (hdr.requestIdB1 << 8) + hdr.requestIdB0;
if (hdr.type == FCGI_BEGIN_REQUEST && len == sizeof(fcgi_begin_request)) {
+ char *val;
+
if (safe_read(req, buf, len+padding) != len+padding) {
return 0;
}
@@ -470,13 +482,16 @@ static int fcgi_read_request(fcgi_request *req)
req->keep = (((fcgi_begin_request*)buf)->flags & FCGI_KEEP_CONN);
switch ((((fcgi_begin_request*)buf)->roleB1 << 8) + ((fcgi_begin_request*)buf)->roleB0) {
case FCGI_RESPONDER:
- req->env[0] = fcgi_strndup("FCGI_ROLE=RESPONDER", sizeof("FCGI_ROLE=RESPONDER")-1);
+ val = strdup("RESPONDER");
+ zend_hash_update(&req->env, "FCGI_ROLE", sizeof("FCGI_ROLE"), &val, sizeof(char*), NULL);
break;
case FCGI_AUTHORIZER:
- req->env[0] = fcgi_strndup("FCGI_ROLE=AUTHORIZER", sizeof("FCGI_ROLE=AUTHORIZER")-1);
+ val = strdup("AUTHORIZER");
+ zend_hash_update(&req->env, "FCGI_ROLE", sizeof("FCGI_ROLE"), &val, sizeof(char*), NULL);
break;
case FCGI_FILTER:
- req->env[0] = fcgi_strndup("FCGI_ROLE=FILTER", sizeof("FCGI_ROLE=FILTER")-1);
+ val = strdup("FILTER");
+ zend_hash_update(&req->env, "FCGI_ROLE", sizeof("FCGI_ROLE"), &val, sizeof(char*), NULL);
break;
default:
return 0;
@@ -495,7 +510,11 @@ static int fcgi_read_request(fcgi_request *req)
req->keep = 0;
return 0;
}
- n = fcgi_get_params(req, buf, buf+len, n);
+
+ if (!fcgi_get_params(req, buf, buf+len)) {
+ req->keep = 0;
+ return 0;
+ }
if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) ||
hdr.version < FCGI_VERSION_1) {
@@ -506,31 +525,29 @@ static int fcgi_read_request(fcgi_request *req)
padding = hdr.paddingLength;
}
} else if (hdr.type == FCGI_GET_VALUES) {
- int i, j;
- int name_len;
+ int j;
unsigned char *p = buf + sizeof(fcgi_header);
if (safe_read(req, buf, len+padding) != len+padding) {
+ req->keep = 0;
return 0;
}
- n = fcgi_get_params(req, buf, buf+len, 0);
- for (i = 0; i < n; i++) {
- if ((s = strchr(req->env[i], '=')) != NULL) {
- *s = '\0';
- name_len = s - req->env[i];
- } else {
- name_len = strlen(req->env[i]);
- }
- for (j = 0; j < sizeof(fcgi_mgmt_vars)/sizeof(fcgi_mgmt_vars[0]); j++) {
- if (strncmp(req->env[i], fcgi_mgmt_vars[j].name, name_len) == 0) {
- sprintf((char*)p, "%c%c%s%c", name_len, 1, fcgi_mgmt_vars[j].name, fcgi_mgmt_vars[j].val);
- p += name_len+3;
- }
+
+ if (!fcgi_get_params(req, buf, buf+len)) {
+ req->keep = 0;
+ return 0;
+ }
+
+ for (j = 0; j < sizeof(fcgi_mgmt_vars)/sizeof(fcgi_mgmt_vars[0]); j++) {
+ if (zend_hash_exists(&req->env, fcgi_mgmt_vars[j].name, fcgi_mgmt_vars[j].name_len+1) == 0) {
+ sprintf((char*)p, "%c%c%s%c", fcgi_mgmt_vars[j].name_len, 1, fcgi_mgmt_vars[j].name, fcgi_mgmt_vars[j].val);
+ p += fcgi_mgmt_vars[j].name_len + 3;
}
}
len = p - buf - sizeof(fcgi_header);
len += fcgi_make_header((fcgi_header*)buf, FCGI_GET_VALUES_RESULT, 0, len);
if (safe_write(req, buf, sizeof(fcgi_header)+len) != (int)sizeof(fcgi_header)+len) {
+ req->keep = 0;
return 0;
}
return 0;
@@ -597,10 +614,7 @@ int fcgi_read(fcgi_request *req, char *str, int len)
static inline void fcgi_close(fcgi_request *req, int force, int destroy)
{
if (destroy) {
- char **env = req->env;
- while (*env) {
- free(*env++);
- }
+ zend_hash_destroy(&req->env);
}
if ((force || !req->keep) && req->fd >= 0) {
#ifdef _WIN32
@@ -614,10 +628,12 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy)
RevertToSelf();
}
#else
- char buf[8];
+ if (!force) {
+ char buf[8];
- shutdown(req->fd, 1);
- while (recv(req->fd, buf, sizeof(buf), 0) > 0) {}
+ shutdown(req->fd, 1);
+ while (recv(req->fd, buf, sizeof(buf), 0) > 0) {}
+ }
close(req->fd);
#endif
req->fd = -1;
@@ -666,12 +682,12 @@ int fcgi_accept_request(fcgi_request *req)
FCGI_UNLOCK(req->listen_socket);
#else
{
- sa_t sa;
- socklen_t len = sizeof(sa);
+ sa_t sa;
+ socklen_t len = sizeof(sa);
- FCGI_LOCK(req->listen_socket);
- req->fd = accept(req->listen_socket, (struct sockaddr *)&sa, &len);
- FCGI_UNLOCK(req->listen_socket);
+ FCGI_LOCK(req->listen_socket);
+ req->fd = accept(req->listen_socket, (struct sockaddr *)&sa, &len);
+ FCGI_UNLOCK(req->listen_socket);
}
#endif
@@ -683,7 +699,7 @@ int fcgi_accept_request(fcgi_request *req)
break;
#else
if (req->fd >= 0) {
- struct timeval tv = {1,0};
+ struct timeval tv = {5,0};
fd_set set;
FD_ZERO(&set);
@@ -722,7 +738,7 @@ static inline void close_packet(fcgi_request *req)
if (req->out_hdr) {
int len = req->out_pos - ((unsigned char*)req->out_hdr + sizeof(fcgi_header));
- req->out_pos += fcgi_make_header(req->out_hdr, req->out_hdr->type, req->id, len);
+ req->out_pos += fcgi_make_header(req->out_hdr, (fcgi_request_type)req->out_hdr->type, req->id, len);
req->out_hdr = NULL;
}
}
@@ -777,7 +793,7 @@ int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int l
if (limit < sizeof(fcgi_header)) {
if (!fcgi_flush(req, 0)) {
return -1;
- }
+ }
}
open_packet(req, type);
}
@@ -877,64 +893,36 @@ int fcgi_finish_request(fcgi_request *req)
return 1;
}
-char* fcgi_getenv_helper(char** env, const char *name, int len)
-{
- if (name && env) {
- while (*env) {
- if ((strncmp(name, *env, len) == 0) && ((*env)[len] == '=')) {
- return *env+len+1;
- }
- env++;
- }
- }
- return NULL;
-}
-
char* fcgi_getenv(fcgi_request *req, const char* var, int var_len)
{
+ char **val;
+
if (!req) return NULL;
- return fcgi_getenv_helper(req->env, var, var_len);
+
+ if (zend_hash_find(&req->env, (char*)var, var_len+1, (void**)&val) == SUCCESS) {
+ return *val;
+ }
+ return NULL;
}
-void fcgi_putenv(fcgi_request *req, char* var, int var_len)
+char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val)
{
if (var && req) {
- char **env = req->env;
- char *s = strchr(var, '=');
- int len;
-
- if (!s) return ;
- len = s - var + 1;
- while (*env) {
- if ((strncmp(var, *env, len) == 0)) {
- free(*env);
- *env = fcgi_strndup(var, var_len);
- return;
- }
- env++;
+ char **ret;
+
+ if (val == NULL) {
+ val = "";
}
- if (env != &req->env[FCGI_MAX_ENV_VARS - 1]) {
- *env = fcgi_strndup(var, var_len);
+ val = strdup(val);
+ if (zend_hash_update(&req->env, var, var_len+1, &val, sizeof(char*), (void**)&ret) == SUCCESS) {
+ return *ret;
}
}
-}
-
-int FCGX_FPrintF(FCGX_Stream stream, const char *format, ...)
-{
- int result;
- va_list args;
- char buf[4096];
-
- va_start(args, format);
- result = vsnprintf(buf, sizeof(buf), format, args);
- va_end(args);
-
- fcgi_write(stream.req, stream.type, buf, result);
- return result;
+ return NULL;
}
#ifdef _WIN32
-void OS_SetImpersonate(void)
+void fcgi_impersonate(void)
{
char *os_name;
diff --git a/sapi/cgi/fastcgi.h b/sapi/cgi/fastcgi.h
index 2b9265b3a..5a9fcb9de 100644
--- a/sapi/cgi/fastcgi.h
+++ b/sapi/cgi/fastcgi.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fastcgi.h,v 1.2.2.6 2006/05/25 07:06:04 dmitry Exp $ */
+/* $Id: fastcgi.h,v 1.2.2.4.2.1 2006/05/15 14:30:31 dmitry Exp $ */
/* FastCGI protocol */
@@ -26,8 +26,6 @@
#define FCGI_KEEP_CONN 1
-#define FCGI_MAX_ENV_VARS 256
-
typedef enum _fcgi_role {
FCGI_RESPONDER = 1,
FCGI_AUTHORIZER = 2,
@@ -107,7 +105,7 @@ typedef struct _fcgi_request {
unsigned char out_buf[1024*8];
unsigned char reserved[sizeof(fcgi_end_request_rec)];
- char *env[FCGI_MAX_ENV_VARS];
+ HashTable env;
} fcgi_request;
int fcgi_init(void);
@@ -118,63 +116,16 @@ int fcgi_accept_request(fcgi_request *req);
int fcgi_finish_request(fcgi_request *req);
char* fcgi_getenv(fcgi_request *req, const char* var, int var_len);
-void fcgi_putenv(fcgi_request *req, char* var, int var_len);
+char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val);
int fcgi_read(fcgi_request *req, char *str, int len);
int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int len);
int fcgi_flush(fcgi_request *req, int close);
-/* Some defines for limited libfcgi comatibility */
-
-typedef struct _FCGX_Stream {
- fcgi_request *req;
- fcgi_request_type type;
-} FCGX_Stream;
-
-typedef struct _FCGX_Request {
- fcgi_request req;
- FCGX_Stream in;
- FCGX_Stream out;
- FCGX_Stream err;
- char **envp;
-} FCGX_Request;
-
-#define FCGX_Init()
-#define FCGX_IsCGI() (!fcgi_is_fastcgi())
-#define FCGX_OpenSocket(path, backlog) fcgi_listen(path, backlog)
-
-#define FCGX_InitRequest(r, sock, flags) \
- do { \
- fcgi_init_request(&(r)->req, sock); \
- (r)->in.req = &(r)->req; \
- (r)->out.req = &(r)->req; \
- (r)->err.req = &(r)->req; \
- (r)->in.type = FCGI_STDIN; \
- (r)->out.type = FCGI_STDOUT; \
- (r)->err.type = FCGI_STDERR; \
- (r)->envp = (r)->req.env; \
- } while (0);
-
-
-#define FCGX_Accept_r(r) fcgi_accept_request(&(r)->req)
-#define FCGX_Finish_r(r) fcgi_finish_request(&(r)->req)
-
-#define FCGX_PutStr(str, len, stream) fcgi_write((stream).req, (stream).type, str, len)
-#define FCGX_PutS(str, len, stream) fcgi_write((stream).req, (stream).type, str, len)
-#define FCGX_FFlush(stream) (fcgi_flush((stream).req, 0)?0:-1)
-#define FCGX_GetStr(str, len, stream) fcgi_read((stream).req, str, len)
-
-#define FCGX_GetParam(var, envp) fcgi_getenv_helper(envp, var, strlen(var));
-
-#define FCGX_PutEnv(r, var) fcgi_putenv(&(r)->req, var, strlen(var));
-
-int FCGX_FPrintF(FCGX_Stream stream, const char *format, ...);
-
-/* Internal helper functions. They shouldn't be used directly. */
-
-char* fcgi_getenv_helper(char** env, const char *name, int len);
-
+#ifdef PHP_WIN32
+void fcgi_impersonate(void);
+#endif
/*
* Local variables:
* tab-width: 4
diff --git a/sapi/cgi/libfcgi/LICENSE.TERMS b/sapi/cgi/libfcgi/LICENSE.TERMS
deleted file mode 100644
index 7e6bdfded..000000000
--- 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 a55ce5cd3..000000000
--- a/sapi/cgi/libfcgi/acinclude.m4
+++ /dev/null
@@ -1,389 +0,0 @@
-dnl $Id: acinclude.m4,v 1.3 2004/12/30 07:08:37 sniper Exp $
-
-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 <stdarg.h>],
- [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: acinclude.m4,v 1.3 2004/12/30 07:08:37 sniper Exp $
-dnl @author Steven G. Johnson <stevenj@alum.mit.edu> and Alejandro Forero Cuervo <bachue@bachue.com>
-
-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.h>],
- [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 <pthread.h>],
- [int attr=PTHREAD_CREATE_JOINABLE;],
- ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
- if test x"$ok" = xunknown; then
- AC_TRY_LINK([#include <pthread.h>],
- [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: acinclude.m4,v 1.3 2004/12/30 07:08:37 sniper Exp $
-dnl @author Ville Laurikari <vl@iki.fi>
-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 <<EOF
-int main(int argc, char **argv) { return 0; }
-EOF
-
- dnl GCC
- if test "$GCC" = "yes"; then
- if test -z "$ansi"; then
- ac_cv_prog_cc_warnings="-Wall"
- else
- ac_cv_prog_cc_warnings="-Wall -ansi -pedantic"
- fi
-
- dnl Solaris C compiler
- elif $CC -flags 2>&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 c8376aac6..000000000
--- 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: fcgi_stdio.c,v 1.1 2002/03/10 21:39:28 shane Exp $";
-#endif /* not lint */
-
-#include <errno.h> /* for errno */
-#include <stdarg.h> /* for va_arg */
-#include <stdlib.h> /* for malloc */
-#include <string.h> /* for strerror */
-
-#include "fcgi_config.h"
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#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 <stdio.h>
-#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 b98fca463..000000000
--- 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: fcgiapp.c,v 1.4 2003/03/05 15:01:13 joosters Exp $";
-#endif /* not lint */
-
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h> /* for fcntl */
-#include <math.h>
-#include <memory.h> /* for memchr() */
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-
-#include "fcgi_config.h"
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h> /* for getpeername */
-#endif
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#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(&paramsPtr);
- 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(&paramsPtr);
- } 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 4db0ee02d..000000000
--- 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: fastcgi.h,v 1.1 2002/03/10 21:39:28 shane Exp $
- */
-
-#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 07236793b..000000000
--- 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 <php_config.h>
-#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 a9ec224de..000000000
--- 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 <arpa/inet.h> header file. */
-#define HAVE_ARPA_INET_H 1
-
-/* Define if you have the <dlfcn.h> 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 <inttypes.h> 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 <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the <netdb.h> header file. */
-/* #define HAVE_NETDB_H 1 */
-
-/* Define if you have the <netinet/in.h> 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 <stdint.h> header file. */
-/* #undef HAVE_STDINT_H */
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the `strerror' function. */
-#define HAVE_STRERROR 1
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the <sys/param.h> header file. */
-/* #define HAVE_SYS_PARAM_H 1 */
-
-/* Define if you have the <sys/socket.h> header file. */
-/*#define HAVE_SYS_SOCKET_H 1*/
-
-/* Define if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define if you have the <sys/time.h> header file. */
-/*#define HAVE_SYS_TIME_H 1*/
-
-/* Define if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define if you have the <unistd.h> 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 f56b3af75..000000000
--- 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 <arpa/inet.h> 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 <inttypes.h> 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 <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if we need cross-process locking */
-#undef USE_LOCKING
-
-/* Define if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define if you have the <netdb.h> header file. */
-#undef HAVE_NETDB_H
-
-/* Define if you have the <netinet/in.h> 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 <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define if you have the `strerror' function. */
-#define HAVE_STRERROR 1
-
-/* Define if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define if you have the <unistd.h> 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 <sys/types.h> 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 c3ecceefa..000000000
--- 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: fcgi_stdio.h,v 1.1 2002/03/10 21:39:28 shane Exp $
- */
-
-#ifndef _FCGI_STDIO
-#define _FCGI_STDIO 1
-
-#include <stdio.h>
-#include <sys/types.h>
-#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 b9289fae3..000000000
--- 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: fcgiapp.h,v 1.2 2002/12/01 21:37:14 shane Exp $
- */
-
-#ifndef _FCGIAPP_H
-#define _FCGIAPP_H
-
-/* Hack to see if we are building TCL - TCL needs varargs not stdarg */
-#ifndef TCL_LIBRARY
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#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 96becd4a8..000000000
--- 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: fcgiappmisc.h,v 1.1 2002/03/10 21:39:28 shane Exp $
- */
-
-#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 e80001164..000000000
--- 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: fcgimisc.h,v 1.1 2002/03/10 21:39:28 shane Exp $
- */
-
-#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 a4fc1d4b7..000000000
--- a/sapi/cgi/libfcgi/include/fcgio.h
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// Provides support for FastCGI via C++ iostreams.
-//
-// $Id: fcgio.h,v 1.1 2002/03/10 21:39:28 shane Exp $
-//
-// 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 <iostream.h>
-
-#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 e0f8373fb..000000000
--- 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 <windows.h>
-#include <winsock2.h>
-#endif
-
-#include "fcgi_config.h"
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#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 69d184933..000000000
--- a/sapi/cgi/libfcgi/libfcgi.m4
+++ /dev/null
@@ -1,77 +0,0 @@
-dnl $Id: libfcgi.m4,v 1.2 2002/12/02 05:24:54 shane Exp $
-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 <iostream>],
-# [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 <iostream>],
-# [cin = static_cast<streambuf *>(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 <iostream>],
-# [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 b79e804ce..000000000
--- 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: os_unix.c,v 1.4 2003/12/07 12:59:54 stas Exp $";
-#endif /* not lint */
-
-#include "fcgi_config.h"
-
-#include <sys/types.h>
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#include <arpa/inet.h>
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h> /* for fcntl */
-#include <math.h>
-#include <memory.h> /* for memchr() */
-#include <netinet/tcp.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/un.h>
-#include <signal.h>
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h> /* for getpeername */
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#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 39e3d6db3..000000000
--- 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: os_win32.c,v 1.6 2002/10/13 07:23:17 shane Exp $";
-#endif /* not lint */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <winsock2.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <stdio.h>
-#include <sys/timeb.h>
-
-#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("<H2>OS_LibInit Failed CreateIoCompletionPort! ERROR: %d</H2>\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("<H2>OS_LibInit Failed CreateIoCompletionPort: STDIN! ERROR: %d</H2>\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("<H2>OS_LibInit Failed to create STDIN thread! ERROR: %d</H2>\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:<port>\" or "
- " just use \":<port>.\"\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 83e0344ff..000000000
--- 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: strerror.c,v 1.1 2002/03/10 21:39:28 shane Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include "fcgi_config.h"
-
-#if ! defined (HAVE_STRERROR)
-#include <string.h>
-
-/*
- * 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/cli/config.w32 b/sapi/cli/config.w32
index 98898fd7e..37b1ca6f1 100644
--- a/sapi/cli/config.w32
+++ b/sapi/cli/config.w32
@@ -1,5 +1,5 @@
// vim:ft=javascript
-// $Id: config.w32,v 1.4 2005/05/14 19:33:18 helly Exp $
+// $Id: config.w32,v 1.4.4.1 2006/05/18 21:46:12 edink Exp $
ARG_ENABLE('cli', 'Build CLI version of PHP', 'yes');
ARG_ENABLE('crt-debug', 'Extra CRT debugging', 'no');
@@ -10,9 +10,11 @@ if (PHP_CLI == "yes") {
if (PHP_CRT_DEBUG == "yes") {
ADD_FLAG("CFLAGS_CLI", "/D PHP_WIN32_DEBUG_HEAP");
}
+ ADD_FLAG("LDFLAGS_CLI", "/stack:8388608");
}
if (PHP_CLI_WIN32 == "yes") {
SAPI('cli_win32', 'getopt.c cli_win32.c php_cli_readline.c', 'php-win.exe');
+ ADD_FLAG("LDFLAGS_CLI_WIN32", "/stack:8388608");
}
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 262d1d6ab..cb094a07b 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_cli.c,v 1.129.2.14 2006/05/11 22:11:17 dmitry Exp $ */
+/* $Id: php_cli.c,v 1.129.2.13.2.10 2006/09/22 17:41:09 iliaa Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -106,6 +106,15 @@
#define PHP_MODE_REFLECTION_CLASS 9
#define PHP_MODE_REFLECTION_EXTENSION 10
+#define HARDCODED_INI \
+ "html_errors=0\n" \
+ "register_argc_argv=1\n" \
+ "implicit_flush=1\n" \
+ "output_buffering=0\n" \
+ "max_execution_time=0\n" \
+ "max_input_time=-1\n"
+
+
static char *php_optarg = NULL;
static int php_optind = 1;
#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
@@ -122,7 +131,6 @@ static const opt_struct OPTIONS[] = {
{'e', 0, "profile-info"},
{'F', 1, "process-file"},
{'f', 1, "file"},
- {'g', 1, "global"},
{'h', 0, "help"},
{'i', 0, "info"},
{'l', 0, "syntax-check"},
@@ -306,6 +314,14 @@ static char* sapi_cli_read_cookies(TSRMLS_D)
return NULL;
}
+static int sapi_cli_header_handler(sapi_header_struct *h, sapi_headers_struct *s TSRMLS_DC)
+{
+ /* free allocated header line */
+ efree(h->header);
+ /* avoid pushing headers into SAPI headers list */
+ return 0;
+}
+
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
@@ -335,10 +351,6 @@ static int php_cli_startup(sapi_module_struct *sapi_module)
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;
@@ -371,7 +383,7 @@ static sapi_module_struct cli_sapi_module = {
php_error, /* error handler */
- NULL, /* header handler */
+ sapi_cli_header_handler, /* header handler */
sapi_cli_send_headers, /* send headers handler */
sapi_cli_send_header, /* send header handler */
@@ -415,7 +427,7 @@ static void php_cli_usage(char *argv0)
" -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 <file> Parse <file>.\n"
+ " -f <file> Parse and execute <file>.\n"
" -h This help\n"
" -i PHP information\n"
" -l Syntax check only (lint)\n"
@@ -444,44 +456,6 @@ static void php_cli_usage(char *argv0)
}
/* }}} */
-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)
@@ -553,12 +527,12 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file,
/* #!php support */
c = fgetc(file_handle->handle.fp);
if (c == '#') {
- while (c != 10 && c != 13) {
+ while (c != '\n' && c != '\r') {
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) {
+ if (c == '\r') {
+ if (fgetc(file_handle->handle.fp) != '\n') {
long pos = ftell(file_handle->handle.fp);
fseek(file_handle->handle.fp, pos - 1, SEEK_SET);
}
@@ -585,15 +559,15 @@ int main(int argc, char *argv[])
/* temporary locals */
int behavior=PHP_MODE_STANDARD;
#ifdef HAVE_REFLECTION
- char *reflection_what;
+ char *reflection_what = NULL;
#endif
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 request_started = 0;
int lineno = 0;
char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL;
const char *param_error=NULL;
@@ -610,6 +584,7 @@ int main(int argc, char *argv[])
int argc = __argc;
char **argv = __argv;
#endif
+ int ini_entries_len = 0;
#if defined(PHP_WIN32) && defined(_DEBUG) && defined(PHP_WIN32_DEBUG_HEAP)
{
@@ -642,6 +617,7 @@ int main(int argc, char *argv[])
tsrm_startup(1, 1, 0, NULL);
#endif
+ cli_sapi_module.php_ini_path_override = NULL;
cli_sapi_module.ini_defaults = sapi_cli_ini_defaults;
cli_sapi_module.phpinfo_as_text = 1;
sapi_startup(&cli_sapi_module);
@@ -653,6 +629,10 @@ int main(int argc, char *argv[])
setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */
#endif
+ ini_entries_len = strlen(HARDCODED_INI);
+ cli_sapi_module.ini_entries = malloc(ini_entries_len+2);
+ memcpy(cli_sapi_module.ini_entries, HARDCODED_INI, ini_entries_len+1);
+ cli_sapi_module.ini_entries[ini_entries_len+1] = 0;
while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0))!=-1) {
switch (c) {
@@ -662,6 +642,37 @@ int main(int argc, char *argv[])
case 'n':
cli_sapi_module.php_ini_ignore = 1;
break;
+ case 'd': {
+ /* define ini entries on command line */
+ int len = strlen(php_optarg);
+ char *val;
+
+ if ((val = strchr(php_optarg, '='))) {
+ val++;
+ if (!isalnum(*val) && *val != '"' && *val != '\'' && *val != '\0') {
+ cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("\"\"\n\0"));
+ memcpy(cli_sapi_module.ini_entries + ini_entries_len, php_optarg, (val - php_optarg));
+ ini_entries_len += (val - php_optarg);
+ memcpy(cli_sapi_module.ini_entries + ini_entries_len, "\"", 1);
+ ini_entries_len++;
+ memcpy(cli_sapi_module.ini_entries + ini_entries_len, val, len - (val - php_optarg));
+ ini_entries_len += len - (val - php_optarg);
+ memcpy(cli_sapi_module.ini_entries + ini_entries_len, "\"\n\0", sizeof("\"\n\0"));
+ ini_entries_len += sizeof("\n\0\"") - 2;
+ } else {
+ cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("\n\0"));
+ memcpy(cli_sapi_module.ini_entries + ini_entries_len, php_optarg, len);
+ memcpy(cli_sapi_module.ini_entries + ini_entries_len + len, "\n\0", sizeof("\n\0"));
+ ini_entries_len += len + sizeof("\n\0") - 2;
+ }
+ } else {
+ cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("=1\n\0"));
+ memcpy(cli_sapi_module.ini_entries + ini_entries_len, php_optarg, len);
+ memcpy(cli_sapi_module.ini_entries + ini_entries_len + len, "=1\n\0", sizeof("=1\n\0"));
+ ini_entries_len += len + sizeof("=1\n\0") - 2;
+ }
+ break;
+ }
}
}
php_optind = orig_optind;
@@ -690,9 +701,6 @@ int main(int argc, char *argv[])
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;
@@ -702,26 +710,15 @@ int main(int argc, char *argv[])
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");
- INI_HARDCODED("max_input_time", "-1");
-
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 '?':
if (php_request_startup(TSRMLS_C)==FAILURE) {
goto err;
}
+ request_started = 1;
php_cli_usage(argv[0]);
php_end_ob_buffers(1 TSRMLS_CC);
exit_status=0;
@@ -731,6 +728,7 @@ int main(int argc, char *argv[])
if (php_request_startup(TSRMLS_C)==FAILURE) {
goto err;
}
+ request_started = 1;
php_print_info(0xFFFFFFFF TSRMLS_CC);
php_end_ob_buffers(1 TSRMLS_CC);
exit_status=0;
@@ -740,6 +738,7 @@ int main(int argc, char *argv[])
if (php_request_startup(TSRMLS_C)==FAILURE) {
goto err;
}
+ request_started = 1;
php_printf("[PHP Modules]\n");
print_modules(TSRMLS_C);
php_printf("\n[Zend Modules]\n");
@@ -754,6 +753,7 @@ int main(int argc, char *argv[])
goto err;
}
+ request_started = 1;
php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2006 The PHP Group\n%s",
PHP_VERSION, sapi_module.name, __DATE__, __TIME__,
#if ZEND_DEBUG && defined(HAVE_GCOV)
@@ -786,12 +786,11 @@ int main(int argc, char *argv[])
case 'a': /* interactive mode */
if (!interactive) {
-#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
- printf("Interactive shell\n\n");
-#else
- printf("Interactive mode enabled\n\n");
-#endif
- fflush(stdout);
+ if (behavior != PHP_MODE_STANDARD) {
+ param_error = param_mode_conflict;
+ break;
+ }
+
interactive=1;
}
break;
@@ -829,14 +828,6 @@ int main(int argc, char *argv[])
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;
@@ -864,7 +855,7 @@ int main(int argc, char *argv[])
param_error = "You can use -r only once.\n";
break;
}
- } else if (behavior != PHP_MODE_STANDARD) {
+ } else if (behavior != PHP_MODE_STANDARD || interactive) {
param_error = param_mode_conflict;
break;
}
@@ -892,7 +883,7 @@ int main(int argc, char *argv[])
param_error = "You can use -B only once.\n";
break;
}
- } else if (behavior != PHP_MODE_STANDARD) {
+ } else if (behavior != PHP_MODE_STANDARD || interactive) {
param_error = param_mode_conflict;
break;
}
@@ -906,7 +897,7 @@ int main(int argc, char *argv[])
param_error = "You can use -E only once.\n";
break;
}
- } else if (behavior != PHP_MODE_STANDARD) {
+ } else if (behavior != PHP_MODE_STANDARD || interactive) {
param_error = param_mode_conflict;
break;
}
@@ -962,6 +953,15 @@ int main(int argc, char *argv[])
goto err;
}
+ if (interactive) {
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
+ printf("Interactive shell\n\n");
+#else
+ printf("Interactive mode enabled\n\n");
+#endif
+ fflush(stdout);
+ }
+
CG(interactive) = interactive;
/* only set script_file if not set already and not in direct mode and not at end of parameter list */
@@ -1004,10 +1004,10 @@ int main(int argc, char *argv[])
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;
}
+ request_started = 1;
CG(start_lineno) = lineno;
*arg_excp = arg_free; /* reconstuct argv */
@@ -1018,10 +1018,7 @@ int main(int argc, char *argv[])
}
}
- /* 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) {
@@ -1038,6 +1035,19 @@ int main(int argc, char *argv[])
char *prompt = "php > ";
char *history_file;
+ if (PG(auto_prepend_file) && PG(auto_prepend_file)[0]) {
+ zend_file_handle *prepend_file_p;
+ zend_file_handle 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;
+
+ zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 1, prepend_file_p);
+ }
+
history_file = tilde_expand("~/.php_history");
rl_attempted_completion_function = cli_code_completion;
rl_special_prefixes = "$";
@@ -1081,6 +1091,11 @@ int main(int argc, char *argv[])
if (php_last_char != '\0' && php_last_char != '\n') {
sapi_cli_single_write("\n", 1);
}
+
+ if (EG(exception)) {
+ zend_exception_error(EG(exception) TSRMLS_CC);
+ }
+
php_last_char = '\0';
}
write_history(history_file);
@@ -1189,7 +1204,7 @@ int main(int argc, char *argv[])
case PHP_MODE_REFLECTION_CLASS:
case PHP_MODE_REFLECTION_EXTENSION:
{
- zend_class_entry *pce;
+ zend_class_entry *pce = NULL;
zval *arg, *ref;
zend_execute_data execute_data;
@@ -1221,7 +1236,7 @@ int main(int argc, char *argv[])
zend_call_method_with_1_params(&ref, pce, &pce->constructor, "__construct", NULL, arg);
if (EG(exception)) {
- zval *msg = zend_read_property(zend_exception_get_default(), EG(exception), "message", sizeof("message")-1, 0 TSRMLS_CC);
+ zval *msg = zend_read_property(zend_exception_get_default(TSRMLS_C), EG(exception), "message", sizeof("message")-1, 0 TSRMLS_CC);
zend_printf("Exception: %s\n", Z_STRVAL_P(msg));
zval_ptr_dtor(&EG(exception));
EG(exception) = NULL;
@@ -1237,17 +1252,23 @@ int main(int argc, char *argv[])
}
}
- 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 (request_started) {
+ php_request_shutdown((void *) 0);
+ }
if (exit_status == 0) {
exit_status = EG(exit_status);
}
out_err:
+ if (cli_sapi_module.php_ini_path_override) {
+ free(cli_sapi_module.php_ini_path_override);
+ }
+ if (cli_sapi_module.ini_entries) {
+ free(cli_sapi_module.ini_entries);
+ }
+
if (module_started) {
php_module_shutdown(TSRMLS_C);
}
@@ -1259,6 +1280,7 @@ out_err:
exit(exit_status);
err:
+ sapi_deactivate(TSRMLS_C);
zend_ini_deactivate(TSRMLS_C);
exit_status = 1;
goto out_err;
diff --git a/sapi/nsapi/config.m4 b/sapi/nsapi/config.m4
index 533861291..d5d599f46 100644
--- a/sapi/nsapi/config.m4
+++ b/sapi/nsapi/config.m4
@@ -1,10 +1,10 @@
dnl
-dnl $Id: config.m4,v 1.17 2003/06/01 21:45:04 thetaphi Exp $
+dnl $Id: config.m4,v 1.17.6.1 2006/10/27 07:23:44 thetaphi Exp $
dnl
AC_MSG_CHECKING(for NSAPI support)
AC_ARG_WITH(nsapi,
-[ --with-nsapi=DIR Build PHP as NSAPI module for Netscape/iPlanet/SunONE],[
+[ --with-nsapi=DIR Build PHP as NSAPI module for Netscape/iPlanet/Sun Webserver],[
PHP_NSAPI=$withval
],[
PHP_NSAPI=no
@@ -13,20 +13,20 @@ 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)
+ AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/Sun Webserver 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])
+ NSAPI_INC_DIR="$PHP_NSAPI/include"
+ AC_MSG_RESULT(Netscape 3.x / Sun 7.x style)
+ AC_CHECK_HEADERS([$NSAPI_INC_DIR/nsapi.h])
+ NSAPI_INCLUDE="-I$NSAPI_INC_DIR"
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"
+ NSAPI_INC_DIR="$PHP_NSAPI/plugins/include"
+ AC_MSG_RESULT(iPlanet 4.x / Sun 6.x style)
+ AC_CHECK_HEADERS([$NSAPI_INC_DIR/nsapi.h])
+ NSAPI_INCLUDE="$NSAPI_INCLUDE -I$NSAPI_INC_DIR"
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)
@@ -34,7 +34,7 @@ if test "$PHP_NSAPI" != "no"; then
PHP_EVAL_INCLINE($NSAPI_INCLUDE)
PHP_BUILD_THREAD_SAFE
- AC_DEFINE(HAVE_NSAPI,1,[Whether you have a Netscape/iPlanet/SunONE Server])
+ AC_DEFINE(HAVE_NSAPI,1,[Whether you have a Netscape/iPlanet/Sun Webserver])
PHP_SELECT_SAPI(nsapi, shared, nsapi.c)
INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_NSAPI/bin/"
fi
diff --git a/sapi/nsapi/nsapi-readme.txt b/sapi/nsapi/nsapi-readme.txt
index 5e08763f0..a93d69ec6 100644
--- a/sapi/nsapi/nsapi-readme.txt
+++ b/sapi/nsapi/nsapi-readme.txt
@@ -1,8 +1,8 @@
-Configuration of your Netscape/SunONE/iPlanet Web Server for PHP5
+Configuration of your Netscape/iPlanet/Sun Webserver for PHP5
-----------------------------------------------------------------
These instructions are targetted at Netscape Enterprise Web Server and
-SUN/Netscape Alliance iPlanet Web Server/SunONE Webserver.
+SUN/Netscape Alliance iPlanet Web Server and the new Sun Java System Webserver.
On other web servers your milage may vary.
Firstly you may need to add some paths to the LD_LIBRARY_PATH
@@ -13,7 +13,7 @@ probably skip this step. The start script is located in:
<path-to-netscape-server>/https-servername/start
-Netscape/iPlanet/SunONE config files are located in:
+Netscape/iPlanet/Sun config files are located in:
<path-to-server>/https-servername/config
@@ -25,7 +25,7 @@ Add the following line to mime.types (you can do that by the administration serv
Place the following two lines after mime.types init in
<path-to-server>/https-servername/config/obj.conf (for servers < 6) or
-for iPlanet/SunONE Web Server 6.0 and above however at the end of the
+for iPlanet/Sun Webserver 6.0 and above however at the end of the
<path-to-server>/https-servername/config/magnus.conf file:
Init fn="load-modules" funcs="php5_init,php5_execute,php5_auth_trans" shlib="/path/to/phplibrary"
@@ -37,7 +37,7 @@ The "shlib" will vary depending on your OS:
Windows: "c:/path/to/php5/php5nsapi.dll"
-In obj.conf (for virtual server classes [SunONE 6.0+] in their vserver.obj.conf):
+In obj.conf (for virtual server classes [Sun 6.0+] in their vserver.obj.conf):
<Object name="default">
.
@@ -137,7 +137,7 @@ 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
+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:
@@ -151,4 +151,4 @@ 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: nsapi-readme.txt,v 1.12 2004/03/18 13:37:16 thetaphi Exp $
+$Id: nsapi-readme.txt,v 1.12.6.1 2006/10/27 07:29:51 thetaphi Exp $
diff --git a/scripts/dev/check_parameters.php b/scripts/dev/check_parameters.php
new file mode 100644
index 000000000..b7f8dde82
--- /dev/null
+++ b/scripts/dev/check_parameters.php
@@ -0,0 +1,373 @@
+<?php
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2006 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Nuno Lopes <nlopess@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: check_parameters.php,v 1.1.2.3 2006/09/10 11:44:51 tony2001 Exp $ */
+
+
+define('REPORT_LEVEL', 2); // 0 reports less false-positives. up to level 5.
+define('VERSION', '5.2'); // minimum is 5.2
+define('PHPDIR', realpath(dirname(__FILE__) . '/../..'));
+
+
+// be sure you have enough memory and stack for PHP. pcre will push the limits!
+ini_set('pcre.backtrack_limit', 10000000);
+
+
+// ------------------------ end of config ----------------------------
+
+
+$API_params = array(
+ 'a' => array('zval**'), // array as zval*
+ 'b' => array('zend_bool*'), // boolean
+ 'C' => array('zend_class_entry**'), // class
+ 'd' => array('double*'), // double
+ 'f' => array('zend_fcall_info*', 'zend_fcall_info_cache*'), // function
+ 'h' => array('HashTable**'), // array as an HashTable*
+ 'l' => array('long*'), // long
+ 'o' => array('zval**'), //object
+ 'O' => array('zval**', 'zend_class_entry*'), // object of given type
+ 'r' => array('zval**'), // resource
+ 's' => array('char**', 'int*'), // string
+ 'z' => array('zval**'), // zval*
+ 'Z' => array('zval***') // zval**
+);
+
+// specific to PHP >= 6
+if (version_compare(VERSION, '6', 'ge')) {
+ $API_params['S'] = $API_params['s']; // binary string
+ $API_params['t'] = array('zstr*', 'int*', 'zend_uchar*'); // text
+ $API_params['T'] = $API_params['t'];
+ $API_params['u'] = array('UChar**', 'int*'); // unicode
+ $API_params['U'] = $API_params['u'];
+}
+
+
+/** reports an error, according to its level */
+function error($str, $level = 0)
+{
+ global $current_file, $current_function, $line;
+
+ if ($level <= REPORT_LEVEL) {
+ if (strpos($current_file,PHPDIR) === 0) {
+ $filename = substr($current_file, strlen(PHPDIR)+1);
+ } else {
+ $filename = $current_file;
+ }
+ echo $filename , " [$line] $current_function : $str\n";
+ }
+}
+
+
+/** this updates the global var $line (for error reporting) */
+function update_lineno($offset)
+{
+ global $lines_offset, $line;
+
+ $left = 0;
+ $right = $count = count($lines_offset)-1;
+
+ // a nice binary search :)
+ do {
+ $mid = intval(($left + $right)/2);
+ $val = $lines_offset[$mid];
+
+ if ($val < $offset) {
+ if (++$mid > $count || $lines_offset[$mid] > $offset) {
+ $line = $mid;
+ return;
+ } else {
+ $left = $mid;
+ }
+ } else if ($val > $offset) {
+ if ($lines_offset[--$mid] < $offset) {
+ $line = $mid+1;
+ return;
+ } else {
+ $right = $mid;
+ }
+ } else {
+ $line = $mid+1;
+ return;
+ }
+ } while (true);
+}
+
+
+/** parses the sources and fetches its vars name, type and if they are initialized or not */
+function get_vars($txt)
+{
+ $ret = array();
+ preg_match_all('/((?:(?:unsigned|struct)\s+)?\w+)(?:\s*(\*+)\s+|\s+(\**))(\w+(?:\[\s*\w*\s*\])?)\s*(?:(=)[^,;]+)?((?:\s*,\s*\**\s*\w+(?:\[\s*\w*\s*\])?\s*(?:=[^,;]+)?)*)\s*;/S', $txt, $m, PREG_SET_ORDER);
+
+ foreach ($m as $x) {
+ // the first parameter is special
+ if (!in_array($x[1], array('else', 'endif', 'return'))) // hack to skip reserved words
+ $ret[$x[4]] = array($x[1] . $x[2] . $x[3], $x[5]);
+
+ // are there more vars?
+ if ($x[6]) {
+ preg_match_all('/(\**)\s*(\w+(?:\[\s*\w*\s*\])?)\s*(=?)/S', $x[6], $y, PREG_SET_ORDER);
+ foreach ($y as $z) {
+ $ret[$z[2]] = array($x[1] . $z[1], $z[3]);
+ }
+ }
+ }
+
+// if ($GLOBALS['current_function'] == 'for_debugging') { print_r($m);print_r($ret); }
+ return $ret;
+}
+
+
+/** run diagnostic checks against one var. */
+function check_param($db, $idx, $exp, $optional)
+{
+ global $error_few_vars_given;
+
+ if ($idx >= count($db)) {
+ if (!$error_few_vars_given) {
+ error("too few variables passed to function");
+ $error_few_vars_given = true;
+ }
+ return;
+ } elseif ($db[$idx][0] === '**dummy**') {
+ return;
+ }
+
+ if ($db[$idx][1] != $exp) {
+ error("{$db[$idx][0]}: expected '$exp' but got '{$db[$idx][1]}' [".($idx+1).']');
+ }
+
+ if ($optional && !$db[$idx][2]) {
+ error("optional var not initialized: {$db[$idx][0]} [".($idx+1).']', 1);
+
+ } elseif (!$optional && $db[$idx][2]) {
+ error("not optional var is initialized: {$db[$idx][0]} [".($idx+1).']', 2);
+ }
+}
+
+
+/** fetch params passed to zend_parse_params*() */
+function get_params($vars, $str)
+{
+ $ret = array();
+ preg_match_all('/(?:\([^)]+\))?(&?)([\w>.()-]+(?:\[\w+\])?)\s*,?((?:\)*\s*=)?)/S', $str, $m, PREG_SET_ORDER);
+
+ foreach ($m as $x) {
+ $name = $x[2];
+
+ // little hack for last parameter
+ if (strpos($name, '(') === false) {
+ $name = rtrim($name, ')');
+ }
+
+ if (empty($vars[$name][0])) {
+ error("variable not found: '$name'", 3);
+ $ret[][] = '**dummy**';
+
+ } else {
+ $ret[] = array($name, $vars[$name][0] . ($x[1] ? '*' : ''), $vars[$name][1]);
+ }
+
+ // the end (yes, this is a little hack :P)
+ if ($x[3]) {
+ break;
+ }
+ }
+
+// if ($GLOBALS['current_function'] == 'for_debugging') { var_dump($m); var_dump($ret); }
+ return $ret;
+}
+
+
+/** run tests on a function. the code is passed in $txt */
+function check_function($name, $txt, $offset)
+{
+ global $API_params;
+
+ if (preg_match_all('/zend_parse_parameters(?:_ex\s*\([^,]+,[^,]+|\s*\([^,]+),\s*"([^"]*)"\s*,\s*([^{;]*)/S', $txt, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) {
+
+ $GLOBALS['current_function'] = $name;
+
+ foreach ($matches as $m) {
+ $GLOBALS['error_few_vars_given'] = false;
+ update_lineno($offset + $m[2][1]);
+
+ $vars = get_vars(substr($txt, 0, $m[0][1])); // limit var search to current location
+ $params = get_params($vars, $m[2][0]);
+ $optional = $varargs = false;
+ $last_last_char = $last_char = '';
+ $j = -1;
+ $len = strlen($m[1][0]);
+
+ for ($i = 0; $i < $len; ++$i) {
+ switch($char = $m[1][0][$i]) {
+ // separator for optional parameters
+ case '|':
+ if ($optional) {
+ error("more than one optional separator at char #$i");
+ } else {
+ $optional = true;
+ if ($i == $len-1) {
+ error("unnecessary optional separator");
+ }
+ }
+ break;
+
+ // separate_zval_if_not_ref
+ case '/':
+ if (!in_array($last_char, array('r', 'z'))) {
+ error("the '/' specifier cannot be applied to '$last_char'");
+ }
+ break;
+
+ // nullable arguments
+ case '!':
+ if (!in_array($last_char, array('a', 'C', 'f', 'h', 'o', 'O', 'r', 's', 't', 'z', 'Z'))) {
+ error("the '!' specifier cannot be applied to '$last_char'");
+ }
+ break;
+
+ case '&':
+ if (version_compare(VERSION, '6', 'ge')) {
+ if ($last_char == 's' || ($last_last_char == 's' && $last_char == '!')) {
+ check_param($params, ++$j, 'UConverter*', $optional);
+
+ } else {
+ error("the '&' specifier cannot be applied to '$last_char'");
+ }
+ } else {
+ error("unknown char ('&') at column $i");
+ }
+ break;
+
+ case '+':
+ case '*':
+ if (version_compare(VERSION, '6', 'ge')) {
+ if ($varargs) {
+ error("A varargs specifier can only be used once. repeated char at column $i");
+ } else {
+ check_param($params, ++$j, 'zval****', $optional);
+ check_param($params, ++$j, 'int*', $optional);
+ $varargs = true;
+ }
+ } else {
+ error("unknown char ('$char') at column $i");
+ }
+ break;
+
+ default:
+ if (isset($API_params[$char])) {
+ foreach($API_params[$char] as $exp) {
+ check_param($params, ++$j, $exp, $optional);
+ }
+ } else {
+ error("unknown char ('$char') at column $i");
+ }
+ }
+
+ $last_last_char = $last_char;
+ $last_char = $char;
+ }
+ }
+ }
+}
+
+
+/** the main recursion function. splits files in functions and calls the other functions */
+function recurse($path)
+{
+ foreach (scandir($path) as $file) {
+ if ($file == '.' || $file == '..' || $file == 'CVS') continue;
+
+ $file = "$path/$file";
+ if (is_dir($file)) {
+ recurse($file);
+ continue;
+ }
+
+ // parse only .c and .cpp files
+ if (substr_compare($file, '.c', -2) && substr_compare($file, '.cpp', -4)) continue;
+
+ $txt = file_get_contents($file);
+ // remove comments (but preserve the number of lines)
+ $txt = preg_replace(array('@//.*@S', '@/\*.*\*/@SsUe'), array('', 'preg_replace("/[^\r\n]+/S", "", \'$0\')'), $txt);
+
+
+ $split = preg_split('/PHP_(?:NAMED_)?(?:FUNCTION|METHOD)\s*\((\w+(?:,\s*\w+)?)\)/S', $txt, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE);
+
+ if (count($split) < 2) continue; // no functions defined on this file
+ array_shift($split); // the first part isn't relevant
+
+
+ // generate the line offsets array
+ $j = 0;
+ $lines = preg_split("/(\r\n?|\n)/S", $txt, -1, PREG_SPLIT_DELIM_CAPTURE);
+ $lines_offset = array();
+
+ for ($i = 0; $i < count($lines); ++$i) {
+ $j += strlen($lines[$i]) + strlen(@$lines[++$i]);
+ $lines_offset[] = $j;
+ }
+
+ $GLOBALS['lines_offset'] = $lines_offset;
+ $GLOBALS['current_file'] = $file;
+
+
+ for ($i = 0; $i < count($split); $i+=2) {
+ // if the /* }}} */ comment is found use it to reduce false positives
+ // TODO: check the other indexes
+ list($f) = preg_split('@/\*\s*}}}\s*\*/@S', $split[$i+1][0]);
+ check_function(preg_replace('/\s*,\s*/S', '::', $split[$i][0]), $f, $split[$i][1]);
+ }
+ }
+}
+
+$dirs = array();
+
+if (isset($argc) && $argc > 1) {
+ if ($argv[1] == '-h' || $argv[1] == '-help' || $argv[1] == '--help') {
+ echo <<<HELP
+Synopsis:
+ php check_parameters.php [directories]
+
+HELP;
+ exit(0);
+ }
+ for ($i = 1; $i < $argc; $i++) {
+ $dirs[] = $argv[$i];
+ }
+} else {
+ $dirs[] = PHPDIR;
+}
+
+foreach($dirs as $dir) {
+ if (is_dir($dir)) {
+ if (!is_readable($dir)) {
+ echo "ERROR: directory '", $dir ,"' is not readable\n";
+ exit(1);
+ }
+ } else {
+ echo "ERROR: bogus directory '", $dir ,"'\n";
+ exit(1);
+ }
+}
+
+foreach ($dirs as $dir) {
+ recurse(realpath($dir));
+}
diff --git a/scripts/man1/php-config.1.in b/scripts/man1/php-config.1.in
index 78d2b4b1f..9355b4bc2 100644
--- a/scripts/man1/php-config.1.in
+++ b/scripts/man1/php-config.1.in
@@ -43,6 +43,10 @@ Full path to php CLI/CGI binary
.B \-\-version
PHP version
.TP
+.PD 0
+.B \-\-vernum
+PHP version as integer
+.TP
.PD 1
.P
.SH SEE ALSO
diff --git a/scripts/php-config.in b/scripts/php-config.in
index 593f28edc..7937779b1 100644
--- a/scripts/php-config.in
+++ b/scripts/php-config.in
@@ -3,8 +3,9 @@
prefix="@prefix@"
exec_prefix="@exec_prefix@"
version="@PHP_VERSION@"
+version_id="@PHP_VERSION_ID@"
includedir="@includedir@/php"
-includes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend -I$includedir/ext"
+includes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend -I$includedir/ext -I$includedir/ext/date/lib"
ldflags="@PHP_LDFLAGS@"
libs="@EXTRA_LIBS@"
extension_dir='@EXTENSION_DIR@'
@@ -30,8 +31,10 @@ case "$1" in
echo $php_binary;;
--version)
echo $version;;
+--vernum)
+ echo $version_id;;
*)
- echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version]"
+ echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version|--vernum]"
exit 1;;
esac
diff --git a/tests/classes/abstract_by_interface_001.phpt b/tests/classes/abstract_by_interface_001.phpt
new file mode 100755
index 000000000..7565fdf45
--- /dev/null
+++ b/tests/classes/abstract_by_interface_001.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 An abstract method may not be called
+--FILE--
+<?php
+
+class Root {
+}
+
+interface MyInterface
+{
+ function MyInterfaceFunc();
+}
+
+abstract class Derived extends Root implements MyInterface {
+}
+
+class Leaf extends Derived
+{
+ function MyInterfaceFunc() {}
+}
+
+var_dump(new Leaf);
+
+class Fails extends Root implements MyInterface {
+}
+
+?>
+===DONE===
+--EXPECTF--
+object(Leaf)#%d (0) {
+}
+
+Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_001.php on line %d
diff --git a/tests/classes/abstract_by_interface_002.phpt b/tests/classes/abstract_by_interface_002.phpt
new file mode 100755
index 000000000..77c5619df
--- /dev/null
+++ b/tests/classes/abstract_by_interface_002.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 An abstract method may not be called
+--FILE--
+<?php
+
+class Root {
+}
+
+interface MyInterface
+{
+ static function MyInterfaceFunc();
+}
+
+abstract class Derived extends Root implements MyInterface {
+}
+
+class Leaf extends Derived
+{
+ static function MyInterfaceFunc() {}
+}
+
+var_dump(new Leaf);
+
+class Fails extends Root implements MyInterface {
+}
+
+?>
+===DONE===
+--EXPECTF--
+object(Leaf)#%d (0) {
+}
+
+Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_002.php on line %d
diff --git a/tests/classes/abstract_static.phpt b/tests/classes/abstract_static.phpt
index 2e46e9dc0..f25d7cff4 100644
--- a/tests/classes/abstract_static.phpt
+++ b/tests/classes/abstract_static.phpt
@@ -1,21 +1,29 @@
--TEST--
-ZE2 A static abstrcat method may not be called
---SKIPIF--
-<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+ZE2 A static abstract methods
--FILE--
<?php
-abstract class fail {
- abstract static function show();
+interface showable
+{
+ static function show();
}
-class pass extends fail {
+class pass implements showable
+{
static function show() {
echo "Call to function show()\n";
}
}
pass::show();
+
+eval('
+class fail
+{
+ abstract static function func();
+}
+');
+
fail::show();
echo "Done\n"; // shouldn't be displayed
@@ -23,4 +31,6 @@ 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
+Strict Standards: Static function fail::func() should not be abstract in %stests/classes/abstract_static.php(%d) : eval()'d code on line %d
+
+Fatal error: Class fail contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (fail::func) in %s/tests/classes/abstract_static.php(%d) : eval()'d code on line %d
diff --git a/tests/classes/abstract_user_call.phpt b/tests/classes/abstract_user_call.phpt
new file mode 100755
index 000000000..0e1ddbe79
--- /dev/null
+++ b/tests/classes/abstract_user_call.phpt
@@ -0,0 +1,30 @@
+--TEST--
+ZE2 An abstrcat method cannot be called indirectly
+--FILE--
+<?php
+
+abstract class test_base
+{
+ abstract function func();
+}
+
+class test extends test_base
+{
+ function func()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+$o = new test;
+
+$o->func();
+
+call_user_func(array($o, 'test_base::func'));
+
+?>
+===DONE===
+--EXPECTF--
+test::func()
+
+Fatal error: Cannot call abstract method test_base::func() in %s on line %d
diff --git a/tests/classes/ctor_in_interface_01.phpt b/tests/classes/ctor_in_interface_01.phpt
new file mode 100755
index 000000000..f6f9b66ea
--- /dev/null
+++ b/tests/classes/ctor_in_interface_01.phpt
@@ -0,0 +1,19 @@
+--TEST--
+ZE2 A class constructor must keep the signature of an interface
+--FILE--
+<?php
+interface constr
+{
+ function __construct();
+}
+
+class implem implements constr
+{
+ function __construct($a)
+ {
+ }
+}
+
+?>
+--EXPECTF--
+Fatal error: Declaration of implem::__construct() must be compatible with that of constr::__construct() in %s on line %d
diff --git a/tests/classes/ctor_in_interface_02.phpt b/tests/classes/ctor_in_interface_02.phpt
new file mode 100755
index 000000000..a0dfe8778
--- /dev/null
+++ b/tests/classes/ctor_in_interface_02.phpt
@@ -0,0 +1,35 @@
+--TEST--
+ZE2 A class constructor must keep the signature of all interfaces
+--FILE--
+<?php
+interface constr1
+{
+ function __construct();
+}
+
+interface constr2 extends constr1
+{
+}
+
+class implem12 implements constr2
+{
+ function __construct()
+ {
+ }
+}
+
+interface constr3
+{
+ function __construct($a);
+}
+
+class implem13 implements constr1, constr3
+{
+ function __construct()
+ {
+ }
+}
+
+?>
+--EXPECTF--
+Fatal error: Can't inherit abstract function constr3::__construct() (previously declared abstract in constr1) in %s on line %d
diff --git a/tests/classes/ctor_in_interface_03.phpt b/tests/classes/ctor_in_interface_03.phpt
new file mode 100755
index 000000000..953d6822f
--- /dev/null
+++ b/tests/classes/ctor_in_interface_03.phpt
@@ -0,0 +1,23 @@
+--TEST--
+ZE2 A class constructor must keep the signature of base class interfaces
+--FILE--
+<?php
+interface constr
+{
+ function __construct();
+}
+
+abstract class implem implements constr
+{
+}
+
+class derived extends implem
+{
+ function __construct($a)
+ {
+ }
+}
+
+?>
+--EXPECTF--
+Fatal error: Declaration of derived::__construct() must be compatible with that of constr::__construct() in %s on line %d
diff --git a/tests/classes/ctor_in_interface_04.phpt b/tests/classes/ctor_in_interface_04.phpt
new file mode 100755
index 000000000..0016244c1
--- /dev/null
+++ b/tests/classes/ctor_in_interface_04.phpt
@@ -0,0 +1,26 @@
+--TEST--
+ZE2 A class constructor must keep the signature of base class interfaces
+--FILE--
+<?php
+interface constr
+{
+ function __construct();
+}
+
+class implem implements constr
+{
+ function __construct()
+ {
+ }
+}
+
+class derived extends implem
+{
+ function __construct($a)
+ {
+ }
+}
+
+?>
+--EXPECTF--
+Fatal error: Declaration of derived::__construct() must be compatible with that of constr::__construct() in %s on line %d
diff --git a/tests/classes/ctor_visibility.phpt b/tests/classes/ctor_visibility.phpt
new file mode 100755
index 000000000..8d3b1c5c5
--- /dev/null
+++ b/tests/classes/ctor_visibility.phpt
@@ -0,0 +1,69 @@
+--TEST--
+ZE2 A private constructor cannot be called
+--FILE--
+<?php
+
+class Test
+{
+ function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+class Derived extends Test
+{
+ function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ parent::__construct();
+ }
+
+ static function f()
+ {
+ new Derived;
+ }
+}
+
+Derived::f();
+
+class TestPriv
+{
+ private function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ static function f()
+ {
+ new TestPriv;
+ }
+}
+
+TestPriv::f();
+
+class DerivedPriv extends TestPriv
+{
+ function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ parent::__construct();
+ }
+
+ static function f()
+ {
+ new DerivedPriv;
+ }
+}
+
+DerivedPriv::f();
+
+?>
+===DONE===
+--EXPECTF--
+Derived::__construct()
+Test::__construct()
+TestPriv::__construct()
+DerivedPriv::__construct()
+
+Fatal error: Cannot call private TestPriv::__construct() in %sctor_visibility.php on line %d
diff --git a/tests/classes/factory_and_singleton_003.phpt b/tests/classes/factory_and_singleton_003.phpt
index d81cc4642..3d50a810a 100755
--- a/tests/classes/factory_and_singleton_003.phpt
+++ b/tests/classes/factory_and_singleton_003.phpt
@@ -15,4 +15,4 @@ $obj = new test;
echo "Done\n";
?>
--EXPECTF--
-Fatal error: Call to protected test::__construct() from context '' %sfactory_and_singleton_003.php on line %d
+Fatal error: Call to protected test::__construct() from invalid context in %s on line %d
diff --git a/tests/classes/factory_and_singleton_004.phpt b/tests/classes/factory_and_singleton_004.phpt
index 01c53d85a..14edcb1fc 100755
--- a/tests/classes/factory_and_singleton_004.phpt
+++ b/tests/classes/factory_and_singleton_004.phpt
@@ -15,4 +15,4 @@ $obj = new test;
echo "Done\n";
?>
--EXPECTF--
-Fatal error: Call to private test::__construct() from context '' %sfactory_and_singleton_004.php on line %d
+Fatal error: Call to private test::__construct() from invalid context in %s on line %d
diff --git a/tests/classes/inheritance_003.phpt b/tests/classes/inheritance_003.phpt
new file mode 100755
index 000000000..a22e5cce5
--- /dev/null
+++ b/tests/classes/inheritance_003.phpt
@@ -0,0 +1,21 @@
+--TEST--
+ZE2 method inheritance without interfaces
+--FILE--
+<?php
+
+class A
+{
+ function f($x) {}
+}
+
+class B extends A
+{
+ function f() {}
+}
+
+?>
+===DONE===
+--EXPECTF--
+
+Strict Standards: Declaration of B::f() should be compatible with that of A::f() in %sinheritance_003.php on line %d
+===DONE===
diff --git a/tests/classes/inheritance_004.phpt b/tests/classes/inheritance_004.phpt
new file mode 100755
index 000000000..9c81970cc
--- /dev/null
+++ b/tests/classes/inheritance_004.phpt
@@ -0,0 +1,21 @@
+--TEST--
+ZE2 method inheritance without interfaces
+--FILE--
+<?php
+
+class A
+{
+ function f() {}
+}
+
+class B extends A
+{
+ function f($x) {}
+}
+
+?>
+===DONE===
+--EXPECTF--
+
+Strict Standards: Declaration of B::f() should be compatible with that of A::f() in %sinheritance_004.php on line %d
+===DONE===
diff --git a/tests/classes/interface_construct.phpt b/tests/classes/interface_construct.phpt
deleted file mode 100755
index b7b641653..000000000
--- a/tests/classes/interface_construct.phpt
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-ZE2 An interface constructor signature must not be inherited
---SKIPIF--
-<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
---FILE--
-<?php
-error_reporting(4095);
-
-interface test {
- public function __construct($foo);
-}
-
-class foo implements test {
- public function __construct() {
- echo "foo\n";
- }
-}
-
-$foo = new foo;
-
-?>
---EXPECT--
-foo
-
diff --git a/tests/classes/interfaces_003.phpt b/tests/classes/interfaces_003.phpt
index 46ae8290a..f9ab92bb1 100755
--- a/tests/classes/interfaces_003.phpt
+++ b/tests/classes/interfaces_003.phpt
@@ -7,27 +7,20 @@ class MyObject {}
interface MyInterface
{
- public function __construct(Object $o);
+ public function __construct(MyObject $o);
}
class MyTestClass implements MyInterface
{
- public function __construct(Object $o)
+ public function __construct(MyObject $o)
{
}
}
$obj = new MyTestClass;
-class MyTestFail
-{
- public function __construct()
- {
- }
-}
-
?>
===DONE===
--EXPECTF--
-Fatal error: Argument 1 passed to MyTestClass::__construct() must be an object of class Object, called in %sinterfaces_003.php on line %d
+Catchable fatal error: Argument 1 passed to MyTestClass::__construct() must be an instance of MyObject, none given, called in %sinterfaces_003.php on line %d
diff --git a/tests/classes/tostring.phpt b/tests/classes/tostring.phpt
deleted file mode 100644
index 7253cd4c7..000000000
--- a/tests/classes/tostring.phpt
+++ /dev/null
@@ -1,86 +0,0 @@
---TEST--
-ZE2 __toString()
---SKIPIF--
-<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
---FILE--
-<?php
-
-class test1 {
-}
-
-class test2 {
- function __toString() {
- echo __METHOD__ . "()\n";
- return "Converted\n";
- }
-}
-
-echo "====test1====\n";
-$o = new test1;
-print_r($o);
-var_dump((string)$o);
-var_dump($o);
-
-echo "====test2====\n";
-$o = new test2;
-print_r($o);
-print $o;
-var_dump($o);
-echo "====test3====\n";
-echo $o;
-
-echo "====test4====\n";
-echo "string:".$o;
-
-echo "====test5====\n";
-echo 1 . $o;
-
-echo "====test6====\n";
-echo $o.$o;
-
-echo "====test7====\n";
-$ar = array();
-$ar[$o->__toString()] = "ERROR";
-echo $ar[$o];
-
-echo "====test8====\n";
-var_dump(trim($o));
-var_dump(trim((string)$o));
-
-echo "====test9====\n";
-echo sprintf("%s", $o);
-?>
-====DONE!====
---EXPECTF--
-====test1====
-test1 Object
-(
-)
-string(1%d) "Object id #%d"
-object(test1)#%d (%d) {
-}
-====test2====
-test2 Object
-(
-)
-test2::__toString()
-Converted
-object(test2)#%d (%d) {
-}
-====test3====
-test2::__toString()
-Converted
-====test4====
-string:Object id #%d====test5====
-1Object id #%d====test6====
-Object id #%dObject id #2====test7====
-test2::__toString()
-
-Warning: Illegal offset type in %stostring.php on line %d
-====test8====
-
-Notice: Object of class test2 to string conversion in %stostring.php on line %d
-string(6) "Object"
-string(1%d) "Object id #%d"
-====test9====
-Object id #%d====DONE!====
diff --git a/tests/classes/tostring_001.phpt b/tests/classes/tostring_001.phpt
new file mode 100755
index 000000000..53144ca20
--- /dev/null
+++ b/tests/classes/tostring_001.phpt
@@ -0,0 +1,130 @@
+--TEST--
+ZE2 __toString()
+--FILE--
+<?php
+
+function my_error_handler($errno, $errstr, $errfile, $errline) {
+ var_dump($errstr);
+}
+
+set_error_handler('my_error_handler');
+
+class test1
+{
+}
+
+class test2
+{
+ function __toString()
+ {
+ echo __METHOD__ . "()\n";
+ return "Converted\n";
+ }
+}
+
+class test3
+{
+ function __toString()
+ {
+ echo __METHOD__ . "()\n";
+ return 42;
+ }
+}
+echo "====test1====\n";
+$o = new test1;
+print_r($o);
+var_dump((string)$o);
+var_dump($o);
+
+echo "====test2====\n";
+$o = new test2;
+print_r($o);
+print $o;
+var_dump($o);
+echo "====test3====\n";
+echo $o;
+
+echo "====test4====\n";
+echo "string:".$o;
+
+echo "====test5====\n";
+echo 1 . $o;
+echo 1 , $o;
+
+echo "====test6====\n";
+echo $o . $o;
+echo $o , $o;
+
+echo "====test7====\n";
+$ar = array();
+$ar[$o->__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
new file mode 100755
index 000000000..8a4a7af33
--- /dev/null
+++ b/tests/classes/tostring_002.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 __toString() in __destruct
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Test
+{
+ function __toString()
+ {
+ return "Hello\n";
+ }
+
+ function __destruct()
+ {
+ echo $this;
+ }
+}
+
+$o = new Test;
+$o = NULL;
+
+$o = new Test;
+
+?>
+====DONE====
+--EXPECTF--
+Hello
+====DONE====
+Hello
diff --git a/tests/classes/tostring_003.phpt b/tests/classes/tostring_003.phpt
new file mode 100755
index 000000000..8815bd940
--- /dev/null
+++ b/tests/classes/tostring_003.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 __toString() in __destruct/exception
+--FILE--
+<?php
+
+class Test
+{
+ function __toString()
+ {
+ throw new Exception("Damn!");
+ return "Hello\n";
+ }
+
+ function __destruct()
+ {
+ echo $this;
+ }
+}
+
+try
+{
+ $o = new Test;
+ $o = NULL;
+}
+catch(Exception $e)
+{
+ var_dump($e->getMessage());
+}
+
+?>
+====DONE====
+--EXPECTF--
+Fatal error: Method Test::__toString() must not throw an exception in %stostring_003.php on line %d
diff --git a/tests/classes/type_hinting_001.phpt b/tests/classes/type_hinting_001.phpt
index 82241298d..f55dd53bf 100644
--- a/tests/classes/type_hinting_001.phpt
+++ b/tests/classes/type_hinting_001.phpt
@@ -35,4 +35,4 @@ $a->b($b);
?>
--EXPECTF--
-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
+Catchable fatal error: Argument 1 passed to FooBar::a() must implement interface Foo, instance of Blort given, 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
index 4cb75b1b8..7c685bfdb 100755
--- a/tests/classes/type_hinting_002.phpt
+++ b/tests/classes/type_hinting_002.phpt
@@ -13,5 +13,4 @@ $o = new Foo;
$o->a($o);
?>
--EXPECTF--
-
-Fatal error: Class 'NonExisting' not found in %stype_hinting_002.php on line %d
+Catchable fatal error: Argument 1 passed to Foo::a() must be an instance of NonExisting, instance of Foo given, called in %s on line %d and defined in %s on line %d
diff --git a/tests/classes/type_hinting_003.phpt b/tests/classes/type_hinting_003.phpt
index 4a83dd419..431d66eab 100755
--- a/tests/classes/type_hinting_003.phpt
+++ b/tests/classes/type_hinting_003.phpt
@@ -57,4 +57,4 @@ array(1) {
int(25)
}
-Fatal error: Argument 1 passed to Test::f1() must be an array, called in %stype_hinting_003.php on line %d and defined in %stype_hinting_003.php on line %d
+Catchable fatal error: Argument 1 passed to Test::f1() must be an array, integer given, called in %stype_hinting_003.php on line %d and defined in %stype_hinting_003.php on line %d
diff --git a/tests/lang/034.phpt b/tests/lang/034.phpt
index 9c640415d..211544a66 100644
--- a/tests/lang/034.phpt
+++ b/tests/lang/034.phpt
@@ -2,14 +2,14 @@
Bug #12647 (Locale settings affecting float parsing)
--SKIPIF--
<?php # try to activate a german locale
-if (setlocale(LC_NUMERIC, "de_DE", "de", "german", "ge") === FALSE) {
+if (setlocale(LC_NUMERIC, "de_DE", "de", "german", "ge", "de_DE.ISO8859-1") === FALSE) {
print "skip";
}
?>
--FILE--
<?php
# activate the german locale
-setlocale(LC_NUMERIC, "de_DE", "de", "german", "ge");
+setlocale(LC_NUMERIC, "de_DE", "de", "german", "ge", "de_DE.ISO8859-1");
echo (float)"3.14", "\n";
?>
diff --git a/tests/lang/bug22367.phpt b/tests/lang/bug22367.phpt
deleted file mode 100644
index 364472b46..000000000
--- 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--
-<?php
-
-class foo
-{
- public $test = array(0, 1, 2, 3, 4);
-
- function a($arg) {
- var_dump(array_key_exists($arg, $this->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/bug24658.phpt b/tests/lang/bug24658.phpt
index d9bf0f566..944fe44ce 100644
--- a/tests/lang/bug24658.phpt
+++ b/tests/lang/bug24658.phpt
@@ -53,4 +53,4 @@ int(2)
object(foo)#%d (0) {
}
-Fatal error: Argument 1 passed to typehint() must be an object of class foo in %s on line %d
+Catchable fatal error: Argument 1 passed to typehint() must be an instance of foo, integer given in %s on line %d
diff --git a/tests/lang/bug38579.inc b/tests/lang/bug38579.inc
new file mode 100755
index 000000000..f822e6d84
--- /dev/null
+++ b/tests/lang/bug38579.inc
@@ -0,0 +1,3 @@
+<?php
+echo "ok\n";
+?>
diff --git a/tests/lang/bug38579.phpt b/tests/lang/bug38579.phpt
new file mode 100755
index 000000000..fbf98a962
--- /dev/null
+++ b/tests/lang/bug38579.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #38579 (include_once() may include the same file twice)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die('skip only for Windows');
+}
+?>
+--FILE--
+<?php
+$file = dirname(__FILE__)."/bug38579.inc";
+include_once(strtolower($file));
+include_once(strtoupper($file));
+?>
+--EXPECT--
+ok
diff --git a/tests/lang/catchable_error_001.phpt b/tests/lang/catchable_error_001.phpt
new file mode 100644
index 000000000..f6bbdd976
--- /dev/null
+++ b/tests/lang/catchable_error_001.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Catchable fatal error [1]
+--FILE--
+<?php
+ class Foo {
+ }
+
+ function blah (Foo $a)
+ {
+ }
+
+ function error()
+ {
+ $a = func_get_args();
+ var_dump($a);
+ }
+
+ blah (new StdClass);
+ echo "ALIVE!\n";
+?>
+--EXPECTF--
+Catchable fatal error: Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, 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
new file mode 100644
index 000000000..c1762b2db
--- /dev/null
+++ b/tests/lang/catchable_error_002.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Catchable fatal error [2]
+--FILE--
+<?php
+ class Foo {
+ }
+
+ function blah (Foo $a)
+ {
+ }
+
+ function error()
+ {
+ $a = func_get_args();
+ var_dump($a);
+ }
+
+ set_error_handler('error');
+
+ blah (new StdClass);
+ echo "ALIVE!\n";
+?>
+--EXPECTF--
+array(5) {
+ [0]=>
+ int(4096)
+ [1]=>
+ string(%d) "Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_002.php on line %d and defined"
+ [2]=>
+ string(%d) "%scatchable_error_002.php"
+ [3]=>
+ int(5)
+ [4]=>
+ array(0) {
+ }
+}
+ALIVE!
diff --git a/tests/lang/type_hints_001.phpt b/tests/lang/type_hints_001.phpt
index 2b5f6c828..57808d474 100644
--- a/tests/lang/type_hints_001.phpt
+++ b/tests/lang/type_hints_001.phpt
@@ -23,4 +23,4 @@ type_hint_foo($bar);
?>
--EXPECTF--
-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
+Catchable fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, instance of Bar given, 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
new file mode 100644
index 000000000..b21240a79
--- /dev/null
+++ b/tests/lang/type_hints_002.phpt
@@ -0,0 +1,28 @@
+--TEST--
+ZE2 type hinting
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class P { }
+class T {
+ function f(P $p = NULL) {
+ var_dump($p);
+ echo "-\n";
+ }
+}
+
+$o=new T();
+$o->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
new file mode 100644
index 000000000..0ef3e3516
--- /dev/null
+++ b/tests/lang/type_hints_003.phpt
@@ -0,0 +1,14 @@
+--TEST--
+ZE2 type hinting
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class T {
+ function f(P $p = 42) {
+ }
+}
+?>
+--EXPECTF--
+
+Fatal error: Default value for parameters with a class type hint can only be NULL in %stype_hints_003.php on line 3
diff --git a/tests/run-test/test005.phpt b/tests/run-test/test005.phpt
index b54cbc50e..d16a66ef7 100644
--- a/tests/run-test/test005.phpt
+++ b/tests/run-test/test005.phpt
@@ -24,7 +24,7 @@ var_dump($php_errormsg);
?>
--EXPECTF--
string(1) "1"
-string(4) "4095"
+string(4) "8191"
string(1) "0"
string(1) "1"
string(1) "0"
diff --git a/tests/run-test/test008.phpt b/tests/run-test/test008.phpt
index 14fff59bd..41733d96f 100644
--- a/tests/run-test/test008.phpt
+++ b/tests/run-test/test008.phpt
@@ -25,7 +25,7 @@ var_dump($php_errormsg);
--EXPECTF--
%s: %sivision by zero in %s on line %d
string(1) "1"
-string(4) "4095"
+string(4) "8191"
string(1) "0"
string(1) "1"
string(1) "0"
diff --git a/tests/run-test/test008a.phpt b/tests/run-test/test008a.phpt
index 7916ff235..a7d360dc6 100644
--- a/tests/run-test/test008a.phpt
+++ b/tests/run-test/test008a.phpt
@@ -24,7 +24,7 @@ var_dump($php_errormsg);
?>
--EXPECTF--
string(1) "1"
-string(4) "4095"
+string(4) "8191"
string(1) "0"
string(1) "1"
string(1) "0"
diff --git a/tests/run-test/test010.phpt b/tests/run-test/test010.phpt
new file mode 100644
index 000000000..cc3ca3591
--- /dev/null
+++ b/tests/run-test/test010.phpt
@@ -0,0 +1,17 @@
+--TEST--
+STDIN input
+--FILE--
+<?php
+var_dump(stream_get_contents(STDIN));
+var_dump(stream_get_contents(fopen('php://stdin', 'r')));
+var_dump(file_get_contents('php://stdin'));
+?>
+--STDIN--
+fooBar
+use this to input some thing to the php script
+--EXPECT--
+string(54) "fooBar
+use this to input some thing to the php script
+"
+string(0) ""
+string(0) ""
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index bc865cbce..db6ef8fbe 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -1,5 +1,5 @@
// vim:ft=javascript
-// $Id: config.w32,v 1.40.2.8 2006/04/29 14:33:46 fmk Exp $
+// $Id: config.w32,v 1.40.2.8.2.1 2006/07/18 09:06:33 dmitry Exp $
// "Master" config file; think of it as a configure.in
// equivalent.
@@ -293,8 +293,10 @@ 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);
+ARG_ENABLE("malloc-mm", "Use environment variable for run-time malloc/emalloc selection", "");
+if (PHP_MALLOC_MM.length) {
+ AC_DEFINE('ZEND_USE_MALLOC_MM', PHP_MALLOC_MM == "yes" ? 1 : 0);
+}
ARG_ENABLE("zend-multibyte", "Enable Zend multibyte encoding support", "no");
if (PHP_ZEND_MULTIBYTE == "yes") {
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 762c049bb..c01a0ae97 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-// $Id: confutils.js,v 1.60.2.1 2006/01/01 12:50:20 sniper Exp $
+// $Id: confutils.js,v 1.60.2.1.2.1 2006/05/07 00:04:56 edink Exp $
var STDOUT = WScript.StdOut;
var STDERR = WScript.StdErr;
@@ -871,14 +871,20 @@ function generate_version_info_resource(makefiletarget, creditspath)
return resname;
}
-function SAPI(sapiname, file_list, makefiletarget, cflags)
+function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
{
var SAPI = sapiname.toUpperCase();
var ldflags;
var resname;
var ld = "@$(LD)";
- STDOUT.WriteLine("Enabling SAPI " + configure_module_dirname);
+ if (typeof(obj_dir) == "undefined") {
+ sapiname_for_printing = configure_module_dirname;
+ } else {
+ sapiname_for_printing = configure_module_dirname + " (via " + obj_dir + ")";
+ }
+
+ STDOUT.WriteLine("Enabling SAPI " + sapiname_for_printing);
MFO.WriteBlankLines(1);
MFO.WriteLine("# objects for SAPI " + sapiname);
@@ -888,7 +894,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags)
ADD_FLAG('CFLAGS_' + SAPI, cflags);
}
- ADD_SOURCES(configure_module_dirname, file_list, sapiname);
+ ADD_SOURCES(configure_module_dirname, file_list, sapiname, obj_dir);
MFO.WriteBlankLines(1);
MFO.WriteLine("# SAPI " + sapiname);
MFO.WriteBlankLines(1);
@@ -897,7 +903,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags)
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("\t@echo SAPI " + sapiname_for_printing + " build complete");
MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
if (makefiletarget.match(new RegExp("\\.dll$"))) {
diff --git a/win32/crypt_win32.c b/win32/crypt_win32.c
index 047acb322..1e5d2e422 100644
--- a/win32/crypt_win32.c
+++ b/win32/crypt_win32.c
@@ -1,350 +1,557 @@
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: |
- +----------------------------------------------------------------------+
+ * UFC-crypt: ultra fast crypt(3) implementation
+ *
+ * Copyright (C) 1991, Michael Glad, email: glad@daimi.aau.dk
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * @(#)crypt.c 2.2 10/04/91
+ *
+ * Semiportable C version
+ *
*/
-/* $Id: crypt_win32.c,v 1.8.2.1 2006/01/01 12:50:19 sniper Exp $ */
-
-/* This code is distributed under the PHP license with permission from
- the author Jochen Obalek <jochen.obalek@bigfoot.de> */
-
-/* encrypt.c - providing 56 bit DES encryption
- Copyright (C) 1991 Jochen Obalek
+#include <string.h>
- 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.
+#define bzero(addr, cnt) memset(addr, 0, cnt)
+#define bcopy(from, to, len) memcpy(to, from, len)
+
+/* Permutation done once on the 56 bit
+ key derived from the original 8 byte ASCII key.
+*/
+static unsigned long pc1[56] =
+ { 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18,
+ 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36,
+ 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22,
+ 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4
+ };
+
+/* How much to rotate each 28 bit half of the pc1 permutated
+ 56 bit key before using pc2 to give the i' key
+*/
+static unsigned long totrot[16] =
+ { 1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28 };
+
+/* Permutation giving the key of the i' DES round */
+static unsigned long pc2[48] =
+ { 14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10,
+ 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2,
+ 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48,
+ 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32
+ };
+
+/* Reference copy of the expansion table which selects
+ bits from the 32 bit intermediate result.
+*/
+static unsigned long eref[48] =
+ { 32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9,
+ 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17,
+ 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25,
+ 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1
+ };
+static unsigned long disturbed_e[48];
+static unsigned long e_inverse[64];
+
+/* Permutation done on the result of sbox lookups */
+static unsigned long perm32[32] =
+ { 16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10,
+ 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25
+ };
+
+/* The sboxes */
+static unsigned long sbox[8][4][16]=
+ { { { 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7 },
+ { 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8 },
+ { 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0 },
+ { 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13 }
+ },
+
+ { { 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10 },
+ { 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5 },
+ { 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15 },
+ { 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9 }
+ },
+
+ { { 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8 },
+ { 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1 },
+ { 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7 },
+ { 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12 }
+ },
+
+ { { 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15 },
+ { 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9 },
+ { 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4 },
+ { 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14 }
+ },
+
+ { { 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9 },
+ { 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6 },
+ { 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14 },
+ { 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3 }
+ },
+
+ { { 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11 },
+ { 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8 },
+ { 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6 },
+ { 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13 }
+ },
+
+ { { 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1 },
+ { 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6 },
+ { 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2 },
+ { 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12 }
+ },
+
+ { { 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7 },
+ { 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2 },
+ { 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8 },
+ { 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11 }
+ }
+ };
+
+#ifdef notdef
+
+/* This is the initial permutation matrix -- we have no
+ use for it, but it is needed if you will develop
+ this module into a general DES package.
+*/
+static unsigned char inital_perm[64] =
+ { 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4,
+ 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8,
+ 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
+ };
+
+#endif
+
+/* Final permutation matrix -- not used directly */
+static unsigned char final_perm[64] =
+ { 40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31,
+ 38, 6, 46, 14, 54, 22, 62, 30, 37, 5, 45, 13, 53, 21, 61, 29,
+ 36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, 51, 19, 59, 27,
+ 34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25
+ };
+
+/* The 16 DES keys in BITMASK format */
+unsigned long keytab[16][2];
+
+#define ascii_to_bin(c) ((c)>='a'?(c-59):(c)>='A'?((c)-53):(c)-'.')
+#define bin_to_ascii(c) ((c)>=38?((c)-38+'a'):(c)>=12?((c)-12+'A'):(c)+'.')
+
+/* Macro to set a bit (0..23) */
+#define BITMASK(i) ( (1<<(11-(i)%12+3)) << ((i)<12?16:0) )
+
+/* sb arrays:
+
+ Workhorses of the inner loop of the DES implementation.
+ They do sbox lookup, shifting of this value, 32 bit
+ permutation and E permutation for the next round.
+
+ Kept in 'BITMASK' format.
+
+*/
+
+unsigned long sb0[8192],sb1[8192],sb2[8192],sb3[8192];
+static unsigned long *sb[4] = {sb0,sb1,sb2,sb3};
+
+/* eperm32tab: do 32 bit permutation and E selection
+
+ The first index is the byte number in the 32 bit value to be permuted
+ - second - is the value of this byte
+ - third - selects the two 32 bit values
+
+ The table is used and generated internally in init_des to speed it up
+
+*/
+static unsigned long eperm32tab[4][256][2];
- 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.
+/* mk_keytab_table: fast way of generating keytab from ASCII key
+
+ The first index is the byte number in the 8 byte ASCII key
+ - second - - - current DES round i.e. the key number
+ - third - distinguishes between the two 24 bit halfs of
+ the selected key
+ - fourth - selects the 7 bits actually used of each byte
+
+ The table is kept in the format generated by the BITMASK macro
+
+*/
+static unsigned long mk_keytab_table[8][16][2][128];
+
+
+/* efp: undo an extra e selection and do final
+ permutation giving the DES result.
+
+ Invoked 6 bit a time on two 48 bit values
+ giving two 32 bit longs.
+*/
+static unsigned long efp[16][64][2];
+
+
+static unsigned char bytemask[8] =
+ { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
+
+
+static unsigned long longmask[32] =
+ { 0x80000000, 0x40000000, 0x20000000, 0x10000000,
+ 0x08000000, 0x04000000, 0x02000000, 0x01000000,
+ 0x00800000, 0x00400000, 0x00200000, 0x00100000,
+ 0x00080000, 0x00040000, 0x00020000, 0x00010000,
+ 0x00008000, 0x00004000, 0x00002000, 0x00001000,
+ 0x00000800, 0x00000400, 0x00000200, 0x00000100,
+ 0x00000080, 0x00000040, 0x00000020, 0x00000010,
+ 0x00000008, 0x00000004, 0x00000002, 0x00000001
+ };
+
+static unsigned long initialized = 0;
+
+/* lookup a 6 bit value in sbox */
+
+#define s_lookup(i,s) sbox[(i)][(((s)>>4) & 0x2)|((s) & 0x1)][((s)>>1) & 0xf];
+
+/* Generate the mk_keytab_table once in a program execution */
+
+void init_des()
+ { unsigned long tbl_long,bit_within_long,comes_from_bit;
+ unsigned long bit,sg,j;
+ unsigned long bit_within_byte,key_byte,byte_value;
+ unsigned long round,mask;
+
+ bzero((char*)mk_keytab_table,sizeof mk_keytab_table);
+
+ for(round=0; round<16; round++)
+ for(bit=0; bit<48; bit++)
+ { tbl_long = bit / 24;
+ bit_within_long = bit % 24;
+
+ /* from which bit in the key halves does it origin? */
+ comes_from_bit = pc2[bit] - 1;
+
+ /* undo the rotation done before pc2 */
+ if(comes_from_bit>=28)
+ comes_from_bit = 28 + (comes_from_bit + totrot[round]) % 28;
+ else
+ comes_from_bit = (comes_from_bit + totrot[round]) % 28;
+
+ /* undo the initial key half forming permutation */
+ comes_from_bit = pc1[comes_from_bit] - 1;
+
+ /* Now 'comes_from_bit' is the correct number (0..55)
+ of the keybit from which the bit being traced
+ in key 'round' comes from
+ */
+
+ key_byte = comes_from_bit / 8;
+ bit_within_byte = (comes_from_bit % 8)+1;
+
+ mask = bytemask[bit_within_byte];
+
+ for(byte_value=0; byte_value<128; byte_value++)
+ if(byte_value & mask)
+ mk_keytab_table[key_byte][round][tbl_long][byte_value] |=
+ BITMASK(bit_within_long);
+ }
+
+ /* Now generate the table used to do an combined
+ 32 bit permutation and e expansion
+
+ We use it because we have to permute 16384 32 bit
+ longs into 48 bit in order to initialize sb.
+
+ Looping 48 rounds per permutation becomes
+ just too slow...
+
+ */
+
+ bzero((char*)eperm32tab,sizeof eperm32tab);
+ for(bit=0; bit<48; bit++)
+ { unsigned long mask1,comes_from;
+
+ comes_from = perm32[eref[bit]-1]-1;
+ mask1 = bytemask[comes_from % 8];
+
+ for(j=256; j--;)
+ if(j & mask1)
+ eperm32tab[comes_from/8][j][bit/24] |= BITMASK(bit % 24);
+ }
+
+ /* Create the sb tables:
+
+ For each 12 bit segment of an 48 bit intermediate
+ result, the sb table precomputes the two 4 bit
+ values of the sbox lookups done with the two 6
+ bit halves, shifts them to their proper place,
+ sends them through perm32 and finally E expands
+ them so that they are ready for the next
+ DES round.
+
+ The value looked up is to be xored onto the
+ two 48 bit right halves.
+ */
+
+ for(sg=0; sg<4; sg++)
+ { unsigned long j1,j2;
+ unsigned long s1,s2;
+
+ for(j1=0; j1<64; j1++)
+ { s1 = s_lookup(2*sg,j1);
+ for(j2=0; j2<64; j2++)
+ { unsigned long to_permute,inx;
+
+ s2 = s_lookup(2*sg+1,j2);
+ to_permute = ((s1<<4) | s2) << (24-8*sg);
+ inx = ((j1<<6) | j2) << 1;
+
+ sb[sg][inx ] = eperm32tab[0][(to_permute >> 24) & 0xff][0];
+ sb[sg][inx+1] = eperm32tab[0][(to_permute >> 24) & 0xff][1];
+
+ sb[sg][inx ] |= eperm32tab[1][(to_permute >> 16) & 0xff][0];
+ sb[sg][inx+1] |= eperm32tab[1][(to_permute >> 16) & 0xff][1];
+
+ sb[sg][inx ] |= eperm32tab[2][(to_permute >> 8) & 0xff][0];
+ sb[sg][inx+1] |= eperm32tab[2][(to_permute >> 8) & 0xff][1];
+
+ sb[sg][inx ] |= eperm32tab[3][(to_permute) & 0xff][0];
+ sb[sg][inx+1] |= eperm32tab[3][(to_permute) & 0xff][1];
+ }
+ }
+ }
+ initialized++;
+ }
- 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. */
+/* Process the elements of the sb table permuting the
+ bits swapped in the expansion by the current salt.
+*/
+
+void shuffle_sb(k, saltbits)
+ unsigned long *k, saltbits;
+ { int j, x;
+ for(j=4096; j--;) {
+ x = (k[0] ^ k[1]) & saltbits;
+ *k++ ^= x;
+ *k++ ^= x;
+ }
+ }
-#include <time.h>
-#include <string.h>
-#include <stdlib.h>
-#include "md5crypt.h"
+/* Setup the unit for a new salt
+ Hopefully we'll not see a new salt in each crypt call.
+*/
+
+static unsigned char current_salt[3]="&&"; /* invalid value */
+static unsigned long oldsaltbits = 0;
+
+void setup_salt(s)
+ char *s;
+ { unsigned long i,j,saltbits;
+
+ if(!initialized)
+ init_des();
+
+ if(s[0]==current_salt[0] && s[1]==current_salt[1])
+ return;
+ current_salt[0]=s[0]; current_salt[1]=s[1];
+
+ /* This is the only crypt change to DES:
+ entries are swapped in the expansion table
+ according to the bits set in the salt.
+ */
+
+ saltbits=0;
+ bcopy((char*)eref,(char*)disturbed_e,sizeof eref);
+ for(i=0; i<2; i++)
+ { long c=ascii_to_bin(s[i]);
+ if(c<0 || c>63)
+ c=0;
+ for(j=0; j<6; j++)
+ if((c>>j) & 0x1)
+ { disturbed_e[6*i+j ]=eref[6*i+j+24];
+ disturbed_e[6*i+j+24]=eref[6*i+j ];
+ saltbits |= BITMASK(6*i+j);
+ }
+ }
+
+ /* Permute the sb table values
+ to reflect the changed e
+ selection table
+ */
+
+ shuffle_sb(sb0, oldsaltbits ^ saltbits);
+ shuffle_sb(sb1, oldsaltbits ^ saltbits);
+ shuffle_sb(sb2, oldsaltbits ^ saltbits);
+ shuffle_sb(sb3, oldsaltbits ^ saltbits);
+
+ oldsaltbits = saltbits;
+
+ /* Create an inverse matrix for disturbed_e telling
+ where to plug out bits if undoing disturbed_e
+ */
+
+ for(i=48; i--;)
+ { e_inverse[disturbed_e[i]-1 ] = i;
+ e_inverse[disturbed_e[i]-1+32] = i+48;
+ }
+
+ /* create efp: the matrix used to
+ undo the E expansion and effect final permutation
+ */
+
+ bzero((char*)efp,sizeof efp);
+ for(i=0; i<64; i++)
+ { unsigned long o_bit,o_long;
+ unsigned long word_value,mask1,mask2,comes_from_f_bit,comes_from_e_bit;
+ unsigned long comes_from_word,bit_within_word;
+
+ /* See where bit i belongs in the two 32 bit long's */
+ o_long = i / 32; /* 0..1 */
+ o_bit = i % 32; /* 0..31 */
+
+ /* And find a bit in the e permutated value setting this bit.
+
+ Note: the e selection may have selected the same bit several
+ times. By the initialization of e_inverse, we only look
+ for one specific instance.
+ */
+ comes_from_f_bit = final_perm[i]-1; /* 0..63 */
+ comes_from_e_bit = e_inverse[comes_from_f_bit]; /* 0..95 */
+ comes_from_word = comes_from_e_bit / 6; /* 0..15 */
+ bit_within_word = comes_from_e_bit % 6; /* 0..5 */
+
+ mask1 = longmask[bit_within_word+26];
+ mask2 = longmask[o_bit];
+
+ for(word_value=64; word_value--;)
+ if(word_value & mask1)
+ efp[comes_from_word][word_value][o_long] |= mask2;
+
+ }
-#define BS 64
-#define BS2 32
-#define KS 48
-#define KS2 24
-#define IS 56
-#define IS2 28
+ }
-static char schluessel[16][KS];
+/* Generate the key table before running the 25 DES rounds */
+
+void mk_keytab(key)
+ char *key;
+ { unsigned long i,j;
+ unsigned long *k,*mkt;
+ char t;
+
+ bzero((char*)keytab, sizeof keytab);
+ mkt = &mk_keytab_table[0][0][0][0];
+
+ for(i=0; (t=(*key++) & 0x7f) && i<8; i++)
+ for(j=0,k = &keytab[0][0]; j<16; j++)
+ { *k++ |= mkt[t]; mkt += 128;
+ *k++ |= mkt[t]; mkt += 128;
+ }
+ for(; i<8; i++)
+ for(j=0,k = &keytab[0][0]; j<16; j++)
+ { *k++ |= mkt[0]; mkt += 128;
+ *k++ |= mkt[0]; mkt += 128;
+ }
+ }
+/* Do final permutations and convert to ASCII */
-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
-};
+char *output_conversion(l1,l2,r1,r2,salt)
+ unsigned long l1,l2,r1,r2;
+ char *salt;
+ { static char outbuf[14];
+ unsigned long i;
+ unsigned long s,v1,v2;
+ /* Unfortunately we've done an extra E
+ expansion -- undo it at the same time.
+ */
-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
-};
+ v1=v2=0; l1 >>= 3; l2 >>= 3; r1 >>= 3; r2 >>= 3;
+ v1 |= efp[ 3][ l1 & 0x3f][0]; v2 |= efp[ 3][ l1 & 0x3f][1];
+ v1 |= efp[ 2][(l1>>=6) & 0x3f][0]; v2 |= efp[ 2][ l1 & 0x3f][1];
+ v1 |= efp[ 1][(l1>>=10) & 0x3f][0]; v2 |= efp[ 1][ l1 & 0x3f][1];
+ v1 |= efp[ 0][(l1>>=6) & 0x3f][0]; v2 |= efp[ 0][ l1 & 0x3f][1];
-static char E[KS];
+ v1 |= efp[ 7][ l2 & 0x3f][0]; v2 |= efp[ 7][ l2 & 0x3f][1];
+ v1 |= efp[ 6][(l2>>=6) & 0x3f][0]; v2 |= efp[ 6][ l2 & 0x3f][1];
+ v1 |= efp[ 5][(l2>>=10) & 0x3f][0]; v2 |= efp[ 5][ l2 & 0x3f][1];
+ v1 |= efp[ 4][(l2>>=6) & 0x3f][0]; v2 |= efp[ 4][ l2 & 0x3f][1];
+ v1 |= efp[11][ r1 & 0x3f][0]; v2 |= efp[11][ r1 & 0x3f][1];
+ v1 |= efp[10][(r1>>=6) & 0x3f][0]; v2 |= efp[10][ r1 & 0x3f][1];
+ v1 |= efp[ 9][(r1>>=10) & 0x3f][0]; v2 |= efp[ 9][ r1 & 0x3f][1];
+ v1 |= efp[ 8][(r1>>=6) & 0x3f][0]; v2 |= efp[ 8][ r1 & 0x3f][1];
-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
-};
+ v1 |= efp[15][ r2 & 0x3f][0]; v2 |= efp[15][ r2 & 0x3f][1];
+ v1 |= efp[14][(r2>>=6) & 0x3f][0]; v2 |= efp[14][ r2 & 0x3f][1];
+ v1 |= efp[13][(r2>>=10) & 0x3f][0]; v2 |= efp[13][ r2 & 0x3f][1];
+ v1 |= efp[12][(r2>>=6) & 0x3f][0]; v2 |= efp[12][ r2 & 0x3f][1];
+
+ outbuf[0] = salt[0];
+ outbuf[1] = salt[1] ? salt[1] : salt[0];
+ for(i=0; i<5; i++)
+ outbuf[i+2] = bin_to_ascii((v1>>(26-6*i)) & 0x3f);
-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
- }
-};
+ s = (v2 & 0xf) << 2; /* Save the rightmost 4 bit a moment */
+ v2 = (v2>>2) | ((v1 & 0x3)<<30); /* Shift two bits of v1 onto v2 */
-static void
-perm (a, e, pc, n)
- register char *a, *e;
- register char *pc;
- int n;
-{
- for (; n--; pc++, a++)
- *a = e[*pc];
-}
+ for(i=5; i<10; i++)
+ outbuf[i+2] = bin_to_ascii((v2>>(56-6*i)) & 0x3f);
-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;
- }
+ outbuf[12] = bin_to_ascii(s);
+ outbuf[13] = 0;
- e = PERM;
- for (i = 0; i < BS2; i++)
- *nachr_l++ ^= tmp[*e++];
-}
+ return outbuf;
+ }
-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++;
- }
+#define SBA(sb, v) (*(unsigned long*)((char*)(sb)+(v)))
- perm (nachr, tmp, EP, BS);
-}
+#define F(I, O1, O2, SBX, SBY) \
+ s = *k++ ^ I; \
+ O1 ^= SBA(SBX, (s & 0xffff)); O2 ^= SBA(SBX, ((s & 0xffff) + 4)); \
+ O1 ^= SBA(SBY, (s >>= 16)); O2 ^= SBA(SBY, ((s) + 4));
-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;
- }
-}
+#define G(I1, I2, O1, O2) \
+ F(I1, O1, O2, sb1, sb0) F(I2, O1, O2, sb3, sb2)
-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;
- }
+#define H G(r1, r2, l1, l2) ; G(l1, l2, r1, r2)
- 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;
- }
- }
+char *des_crypt(key, salt)
+ char *key;
+ char *salt;
+ { unsigned long l1, l2, r1, r2, i, j, s, *k;
- for (i = 0; i < 25; i++)
- encrypt (key, 0);
+ setup_salt(salt);
+ mk_keytab(key);
- for (k = key, i = 0; i < 11; i++)
- {
- for (j = keybyte = 0; j < 6; j++)
- {
- keybyte <<= 1;
- keybyte |= *k++;
- }
+ l1=l2=r1=r2=0;
- keybyte += '.';
- if (keybyte > '9')
- keybyte += 'A' - '9' - 1;
- if (keybyte > 'Z')
- keybyte += 'a' - 'Z' - 1;
- retkey[i + 2] = keybyte;
+ for(j=0; j<25; j++) {
+ k = &keytab[0][0];
+ for(i=8; i--; ) {
+ H;
+ }
+ s=l1; l1=r1; r1=s; s=l2; l2=r2; r2=s;
}
- retkey[i + 2] = 0;
-
- if (!retkey[1])
- retkey[1] = *retkey;
+ return output_conversion(l1, l2, r1, r2, salt);
+ }
- return retkey;
-}
+#include "php.h"
+#include "md5crypt.h"
-char *
+PHPAPI char *
crypt (const char *pw, const char *salt)
{
if (strlen(salt)>MD5_MAGIC_LEN && strncmp(salt, MD5_MAGIC, MD5_MAGIC_LEN)==0) {
diff --git a/win32/crypt_win32.h b/win32/crypt_win32.h
index cd5a484c1..c728273e2 100644
--- a/win32/crypt_win32.h
+++ b/win32/crypt_win32.h
@@ -16,45 +16,18 @@
+----------------------------------------------------------------------+
*/
-/* $Id: crypt_win32.h,v 1.7.2.1 2006/01/01 12:50:19 sniper Exp $ */
-
-/* This code is distributed under the PHP license with permission from
- the author Jochen Obalek <jochen.obalek@bigfoot.de> */
-
-/* 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_
+#ifndef _CRYPT_WIHN32_H_
+#define _CRYPT_WIHN32_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));
+PHPAPI char* crypt(const char *key, const char *salt);
#ifdef __cplusplus
}
#endif
-#endif /* _ENCRYPT_H_ */
+#endif /* _CRYPT_WIHN32_H_ */
diff --git a/win32/install.txt b/win32/install.txt
index 8d57c7ac6..ab9f1d02b 100644
--- a/win32/install.txt
+++ b/win32/install.txt
@@ -54,9 +54,9 @@ Chapter 1. General Installation Considerations
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
+ * Websites and web applications (server-side scripting)
* Command line scripting
- * Client-side GUI applications
+ * Desktop (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
@@ -66,15 +66,15 @@ Chapter 1. General Installation Considerations
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.
+ In case of 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
@@ -486,7 +486,7 @@ Microsoft IIS / PWS
yourself from those attacks.
_________________________________________________________________
-General considerations for all installations of PHP with IIS
+General considerations for all installations of PHP with IIS or PWS
* First, read the Manual Installation Instructions. Do not skip this
step as it provides crucial information for installing PHP on
@@ -697,7 +697,8 @@ Apache 1.3.x on Microsoft Windows
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.
+ c:/directory/file.ext. A trailing slash may also be necessary for
+ directories.
_________________________________________________________________
Installing as an Apache module
@@ -777,6 +778,11 @@ Apache 2.0.x on Microsoft Windows
Note: You should read the manual installation steps first!
+ Apache 2.2.x Support: Users of Apache 2.2.x may use the
+ documentation below except the appropriate DLL file is named
+ php5apache2_2.dll and it only exists as of PHP 5.2.0. See also
+ http://snaps.php.net/
+
Warning
We do not recommend using a threaded MPM in production with Apache2.
@@ -825,7 +831,8 @@ Apache 2.0.x on Microsoft Windows
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.
+ c:/directory/file.ext. A trailing slash may also be necessary for
+ directories.
_________________________________________________________________
Installing as a CGI binary
@@ -1365,7 +1372,7 @@ $ cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/extname
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.
+ appropriate chapter.
_________________________________________________________________
PECL for Windows users
@@ -1424,6 +1431,14 @@ $ make
A successful install will have created extname.so and put it into the
PHP extensions directory. You'll need to and adjust php.ini and add an
extension=extname.so line before you can use the extension.
+
+ If the system is missing the phpize command, and precompiled packages
+ (like RPM's) are used, be sure to also install the appropriate devel
+ version of the PHP package as they often include the phpize command
+ along with the appropriate header files to build PHP and its
+ extensions.
+
+ Execute phpize --help to display additional usage information.
_________________________________________________________________
Compiling PECL extensions statically into PHP
@@ -1518,9 +1533,10 @@ The configuration file
* SAPI module specific location (PHPIniDir directive in Apache 2, -c
command line option in CGI and CLI, php_ini parameter in NSAPI,
PHP_INI_PATH environment variable in THTTPD)
+ * The PHPRC environment variable. Before PHP 5.2.0 this was checked
+ after the registry key mentioned below.
* HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath (Windows Registry
location)
- * The PHPRC environment variable
* Current working directory (for CLI)
* The web server's directory (for SAPI modules), or directory of PHP
(otherwise in Windows)
@@ -1664,9 +1680,7 @@ Chapter 6. Installation FAQ
is available for almost any OS (except maybe for MacOS before OSX),
and almost any web server.
- To install PHP, follow the instructions in the INSTALL file located in
- the distribution. Windows users should also read the install.txt file.
- There are also some helpful hints for Windows users here.
+ To install PHP, follow the instructions in Installing PHP.
1. Why shouldn't I use Apache2 with a threaded MPM in a production
environment?
diff --git a/win32/installer/README b/win32/installer/README
deleted file mode 100644
index e72534c99..000000000
--- a/win32/installer/README
+++ /dev/null
@@ -1,93 +0,0 @@
-PHP Installer for Win32, by Wez Furlong <wez@thebrainroom.com>
-==============================================================
-$Id: README,v 1.3 2004/01/17 13:00:24 sniper Exp $
-
-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 <snapshot_root>
-cli\php <source_root>\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<Version>.exe, where <Version> 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 50092bac1..000000000
--- 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 <wez@thebrainroom.com>
-; $Id: gen-nsis.php,v 1.4 2004/01/17 13:00:24 sniper Exp $
-<?php
-
-define('PHPVERSION', phpversion());
-define('SOURCEDIR', dirname(__FILE__) . "\\..\\..\\");
-define('DISTDIR', getcwd());
-
-/* for testing, install system files in a safe dir */
-
-if (false) {
- $SYSDIR = "\$INSTDIR\\system";
-} else {
- $SYSDIR = "\$SYSDIR";
-}
-
-$sections = array(
- "core" => 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 "<?= PHPVERSION ?>"
-; 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<?= PHPVERSION ?>.exe"
-
-SetCompressor bzip2
-ShowInstDetails show
-;License page
-LicenseData "license.txt"
-
-;Folder-selection page
-InstallDir "C:\PHP-<?= PHPVERSION ?>"
-;define NSIS_CONFIG_LOG "install.log"
-;LogSet on
-
-!cd <?= SOURCEDIR ?>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 <?= DISTDIR ?>
-
-!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 "<?= $SYSDIR ?>\php5ts.dll" "$INSTDIR\php5ts.dll"
- File "<?= dirname(__FILE__) ?>\setini.php"
-
-; Set the extension_dir setting in the php.ini
- Push "extension_dir=$\"$INSTDIR\extensions$\""
- Call AddIniSetting
-
-FunctionEnd
-
-; Generated Section Info
-<?= $SECTIONS ?>
-; ---------
-
-; 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-<?= PHPVERSION ?>" "UninstallString" "$INSTDIR\Uninstall.exe"
- WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PHP-<?= PHPVERSION ?>" "DisplayName" "PHP-<?= PHPVERSION ?> (Uninstall only)"
-
-
-SectionEnd
-
-;--------------------------------
-;Descriptions
-
-!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
-<?= $DESCRIPTIONS ?>
-!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
-
-;--------------------------------
-;Uninstaller Section
-
-Section "Uninstall"
-<?= $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-<?= PHPVERSION ?>"
-
- !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 b443a50ec..000000000
--- a/win32/installer/setini.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-/* $Id: setini.php,v 1.3 2003/02/16 23:46:45 wez Exp $
- * Wez Furlong <wez@thebrainroom.com>
- *
- * 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/php5dllts.dsp b/win32/php5dllts.dsp
index ccb8def8e..3a2c194c6 100644
--- a/win32/php5dllts.dsp
+++ b/win32/php5dllts.dsp
@@ -393,82 +393,82 @@ SOURCE=..\main\win95nt.h
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_chartables.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_compile.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_exec.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_fullinfo.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_get.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_globals.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_info.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_maketables.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_ord2utf8.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_study.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_tables.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_try_flipped.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_ucp_searchfuncs.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_valid_utf8.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_version.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# Begin Source File
SOURCE=..\ext\pcre\pcrelib\pcre_xclass.c
-# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP"
+# ADD CPP /D "SUPPORT_UTF8" /D LINK_SIZE=2 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D NEWLINE=10 /D "SUPPORT_UCP" /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D MAX_DUPLENGTH=30000 /D "NO_RECURSE"
# End Source File
# End Group
# Begin Group "Header Files No. 3"
@@ -764,6 +764,231 @@ 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
+# PROP Intermediate_Dir "calendar"
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\calendar.c
+# PROP Intermediate_Dir "calendar"
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\dow.c
+# PROP Intermediate_Dir "calendar"
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\easter.c
+# PROP Intermediate_Dir "calendar"
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\french.c
+# PROP Intermediate_Dir "calendar"
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\gregor.c
+# PROP Intermediate_Dir "calendar"
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\jewish.c
+# PROP Intermediate_Dir "calendar"
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\julian.c
+# PROP Intermediate_Dir "calendar"
+# 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 "SPL"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 11"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\spl\php_spl.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_array.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_directory.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_engine.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_exceptions.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_functions.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_iterators.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_observer.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_sxe.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 12"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\spl\php_spl.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_array.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_directory.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_engine.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_exceptions.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_functions.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_iterators.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_observer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\spl\spl_sxe.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "Reflection"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 12"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\reflection\php_reflection.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 13"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\reflection\php_reflection.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "XMLReader"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 13"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\xmlreader\php_xmlreader.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 14"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\xmlreader\php_xmlreader.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "XMLwriter"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 14"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\xmlwriter\php_xmlwriter.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 15"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\xmlwriter\php_xmlwriter.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "IConv"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 15"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\iconv\iconv.c
+# ADD CPP /D "PHP_ICONV_EXPORTS"
+# End Source File
+# End Group
+# Begin Group "Header Files No. 16"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\iconv\php_iconv.h
+# End Source File
+# End Group
+# End Group
# Begin Group "bcmath"
# PROP Default_Filter ""
@@ -2058,267 +2283,90 @@ SOURCE=..\ext\date\lib\timelib.c
# End Source File
# Begin Source File
-SOURCE=..\ext\date\lib\tm2unixtime.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\unixtime2tm.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 7"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\date\lib\astro.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\fallbackmap.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\php_date.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\timelib_config.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\timelib_structs.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\timezonedb.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\date\lib\timezonemap.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "Calendar"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 7"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\calendar\cal_unix.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\calendar.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\dow.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\easter.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\french.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\gregor.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\jewish.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\calendar\julian.c
-# PROP Intermediate_Dir "calendar"
-# End Source File
-# End Group
-# Begin Group "Header Files No. 11"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\calendar\php_calendar.h
-# End Source File
-# Begin Source File
+SOURCE=..\ext\date\lib\timelib_config.h.win32
-SOURCE=..\ext\calendar\sdncal.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "SPL"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 11"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\ext\spl\php_spl.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\ext\spl\spl_array.c
-# End Source File
-# Begin Source File
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-SOURCE=..\ext\spl\spl_directory.c
-# End Source File
-# Begin Source File
+# Begin Custom Build
+InputDir=\Projects\php-5.2\ext\date\lib
+InputPath=..\ext\date\lib\timelib_config.h.win32
-SOURCE=..\ext\spl\spl_engine.c
-# End Source File
-# Begin Source File
+"..\ext\date\lib\timelib_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ copy $(InputPath) $(InputDir)\timelib_config.h
-SOURCE=..\ext\spl\spl_exceptions.c
-# End Source File
-# Begin Source File
+# End Custom Build
-SOURCE=..\ext\spl\spl_functions.c
-# End Source File
-# Begin Source File
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-SOURCE=..\ext\spl\spl_iterators.c
-# End Source File
-# Begin Source File
+# Begin Custom Build
+InputDir=\Projects\php-5.2\ext\date\lib
+InputPath=..\ext\date\lib\timelib_config.h.win32
-SOURCE=..\ext\spl\spl_observer.c
-# End Source File
-# Begin Source File
+"..\ext\date\lib\timelib_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ copy $(InputPath) $(InputDir)\timelib_config.h
-SOURCE=..\ext\spl\spl_sxe.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 12"
+# End Custom Build
-# PROP Default_Filter ""
-# Begin Source File
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-SOURCE=..\ext\spl\php_spl.h
-# End Source File
-# Begin Source File
+# Begin Custom Build
+InputDir=\Projects\php-5.2\ext\date\lib
+InputPath=..\ext\date\lib\timelib_config.h.win32
-SOURCE=..\ext\spl\spl_array.h
-# End Source File
-# Begin Source File
+"..\ext\date\lib\timelib_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ copy $(InputPath) $(InputDir)\timelib_config.h
-SOURCE=..\ext\spl\spl_directory.h
-# End Source File
-# Begin Source File
+# End Custom Build
-SOURCE=..\ext\spl\spl_engine.h
-# End Source File
-# Begin Source File
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-SOURCE=..\ext\spl\spl_exceptions.h
-# End Source File
-# Begin Source File
+# Begin Custom Build
+InputDir=\Projects\php-5.2\ext\date\lib
+InputPath=..\ext\date\lib\timelib_config.h.win32
-SOURCE=..\ext\spl\spl_functions.h
-# End Source File
-# Begin Source File
+"..\ext\date\lib\timelib_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ copy $(InputPath) $(InputDir)\timelib_config.h
-SOURCE=..\ext\spl\spl_iterators.h
-# End Source File
-# Begin Source File
+# End Custom Build
-SOURCE=..\ext\spl\spl_observer.h
-# End Source File
-# Begin Source File
+!ENDIF
-SOURCE=..\ext\spl\spl_sxe.h
# End Source File
-# End Group
-# End Group
-# Begin Group "Reflection"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 12"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\ext\reflection\php_reflection.c
+SOURCE=..\ext\date\lib\tm2unixtime.c
# End Source File
-# End Group
-# Begin Group "Header Files No. 13"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\ext\reflection\php_reflection.h
+SOURCE=..\ext\date\lib\unixtime2tm.c
# End Source File
# End Group
-# End Group
-# Begin Group "XMLReader"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 13"
+# Begin Group "Header Files No. 11"
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\ext\xmlreader\php_xmlreader.c
+SOURCE=..\ext\date\lib\astro.h
# End Source File
-# End Group
-# Begin Group "Header Files No. 14"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\ext\xmlreader\php_xmlreader.h
+SOURCE=..\ext\date\lib\fallbackmap.h
# End Source File
-# End Group
-# End Group
-# Begin Group "XMLwriter"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 14"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\ext\xmlwriter\php_xmlwriter.c
+SOURCE=..\ext\date\php_date.h
# End Source File
-# End Group
-# Begin Group "Header Files No. 15"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\ext\xmlwriter\php_xmlwriter.h
+SOURCE=..\ext\date\lib\timelib.h
# End Source File
-# End Group
-# End Group
-# Begin Group "IConv"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 15"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\ext\iconv\iconv.c
-# ADD CPP /D "PHP_ICONV_EXPORTS"
+SOURCE=..\ext\date\lib\timezonedb.h
# End Source File
-# End Group
-# Begin Group "Header Files No. 16"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\ext\iconv\php_iconv.h
+SOURCE=..\ext\date\lib\timezonemap.h
# End Source File
# End Group
# End Group
@@ -2385,6 +2433,14 @@ SOURCE=..\win32\wsyslog.c
SOURCE=.\build\wsyslog.mc
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
# Begin Custom Build
InputDir=.\build
IntDir=.\Release_TSDbg
@@ -2395,6 +2451,8 @@ InputPath=.\build\wsyslog.mc
# End Custom Build
+!ENDIF
+
# End Source File
# End Group
# Begin Group "Header Files No. 2"
@@ -2648,7 +2706,7 @@ SOURCE=.\phpts.def
!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
-USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def"
+USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" "..\ext\libxml\php_libxml2.def"
# Begin Custom Build - Generating $(InputPath)
InputPath=.\phpts.def
@@ -2659,7 +2717,7 @@ InputPath=.\phpts.def
!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
-USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def"
+USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" "..\ext\libxml\php_libxml2.def"
# Begin Custom Build - Generating $(InputPath)
InputPath=.\phpts.def
@@ -2670,7 +2728,7 @@ InputPath=.\phpts.def
!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
-USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def"
+USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" "..\ext\libxml\php_libxml2.def"
# Begin Custom Build - Generating $(InputPath)
InputPath=.\phpts.def
@@ -2681,7 +2739,7 @@ InputPath=.\phpts.def
!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
-USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def"
+USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def" "..\ext\libxml\php_libxml2.def"
# Begin Custom Build - Generating $(InputPath)
InputPath=.\phpts.def
diff --git a/win32/php5ts.dsp b/win32/php5ts.dsp
index 3922904e6..373681512 100644
--- a/win32/php5ts.dsp
+++ b/win32/php5ts.dsp
@@ -152,6 +152,10 @@ SOURCE=..\sapi\cgi\cgi_main.c
# End Source File
# Begin Source File
+SOURCE=..\sapi\cgi\fastcgi.c
+# End Source File
+# Begin Source File
+
SOURCE=..\sapi\cgi\getopt.c
# End Source File
# End Group
diff --git a/win32/registry.c b/win32/registry.c
index 95d142cfa..2e7a07409 100644
--- a/win32/registry.c
+++ b/win32/registry.c
@@ -1,7 +1,60 @@
#include "php.h"
#include "php_ini.h"
-#define PHP_REGISTRY_KEY "SOFTWARE\\PHP"
+#define PHP_REGISTRY_KEY "SOFTWARE\\PHP"
+
+#define PHP_VER1(V1) #V1
+#define PHP_VER2(V1,V2) #V1"."#V2
+#define PHP_VER3(V1,V2,V3) #V1"."#V2"."#V3
+
+#define PHP_REGISTRY_KEYV(VER) PHP_REGISTRY_KEY"\\"VER
+#define PHP_REGISTRY_KEY1(V1) PHP_REGISTRY_KEY"\\"PHP_VER1(V1)
+#define PHP_REGISTRY_KEY2(V1,V2) PHP_REGISTRY_KEY"\\"PHP_VER2(V1,V2)
+#define PHP_REGISTRY_KEY3(V1,V2,V3) PHP_REGISTRY_KEY"\\"PHP_VER3(V1,V2,V3)
+
+static const char* registry_keys[] = {
+ PHP_REGISTRY_KEYV(PHP_VERSION),
+ PHP_REGISTRY_KEY3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION),
+ PHP_REGISTRY_KEY2(PHP_MAJOR_VERSION, PHP_MINOR_VERSION),
+ PHP_REGISTRY_KEY1(PHP_MAJOR_VERSION),
+ PHP_REGISTRY_KEY,
+ NULL
+};
+
+static int OpenPhpRegistryKey(char* sub_key, HKEY *hKey)
+{
+ const char **key_name = registry_keys;
+
+ if (sub_key) {
+ int main_key_len;
+ int sub_key_len = strlen(sub_key);
+ char *reg_key;
+
+ while (*key_name) {
+ LONG ret;
+
+ main_key_len = strlen(*key_name);
+ reg_key = emalloc(main_key_len + sub_key_len + 1);
+ memcpy(reg_key, *key_name, main_key_len);
+ memcpy(reg_key + main_key_len, sub_key, sub_key_len + 1);
+ ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, reg_key, 0, KEY_READ, hKey);
+ efree(reg_key);
+
+ if (ret == ERROR_SUCCESS) {
+ return 1;
+ }
+ ++key_name;
+ }
+ } else {
+ while (*key_name) {
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, *key_name, 0, KEY_READ, hKey) == ERROR_SUCCESS) {
+ return 1;
+ }
+ ++key_name;
+ }
+ }
+ return 0;
+}
void UpdateIniFromRegistry(char *path TSRMLS_DC)
{
@@ -9,7 +62,7 @@ void UpdateIniFromRegistry(char *path TSRMLS_DC)
HKEY MainKey;
char *strtok_buf = NULL;
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, PHP_REGISTRY_KEY "\\Per Directory Values", 0, KEY_READ, &MainKey)!=ERROR_SUCCESS) {
+ if (!OpenPhpRegistryKey("\\Per Directory Values", &MainKey)) {
return;
}
@@ -100,7 +153,7 @@ char *GetIniPathFromRegistry()
char *reg_location = NULL;
HKEY hKey;
- if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, PHP_REGISTRY_KEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
+ if (OpenPhpRegistryKey(NULL, &hKey)) {
DWORD buflen = MAXPATHLEN;
reg_location = emalloc(MAXPATHLEN+1);
if(RegQueryValueEx(hKey, PHPRC_REGISTRY_NAME, 0, NULL, reg_location, &buflen) != ERROR_SUCCESS) {